diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c index e1739af..fb41867 100644 --- a/code/cgame/cg_consolecmds.c +++ b/code/cgame/cg_consolecmds.c @@ -619,4 +619,8 @@ void CG_InitConsoleCommands( void ) { trap_AddCommand ("stats"); trap_AddCommand ("teamtask"); trap_AddCommand ("loaddeferred"); + // + // Adapted from CorkScrew + // + trap_AddCommand ("additem"); } diff --git a/code/cgame/cg_event.c b/code/cgame/cg_event.c index c7b3a35..b93c975 100644 --- a/code/cgame/cg_event.c +++ b/code/cgame/cg_event.c @@ -90,6 +90,9 @@ static void CG_Obituary( entityState_t *ent ) { char attackerName[32]; gender_t gender; clientInfo_t *ci; + // NT - some randomness + static int seed = 0x4A; + int r; target = ent->otherEntityNum; attacker = ent->otherEntityNum2; @@ -116,6 +119,9 @@ static void CG_Obituary( entityState_t *ent ) { message2 = ""; + //NT + r = abs( Q_rand( &seed ) ) % 3; + // check for single client messages if(attacker != ENTITYNUM_WORLD) @@ -123,28 +129,76 @@ static void CG_Obituary( entityState_t *ent ) { else switch( mod ) { case MOD_SUICIDE: - message = "suicides"; + if (r == 0) { + message = "suicides"; + } else if (r == 1) { + message = "escaped from this cruel world"; + } else if (r == 2) { + message = "found the meaning of life by meeting death too soon"; + } break; case MOD_FALLING: - message = "cratered"; + if (r == 0) { + message = "cratered"; + } else if (r == 1) { + message = "fell off"; + } else if (r == 2) { + message = "tried to do bungee jumping without safety measures"; + } break; case MOD_CRUSH: - message = "was squished"; + if (r == 0) { + message = "was squished"; + } else if (r == 1) { + message = "became some weird kind of bean paste"; + } else if (r == 2) { + message = "couldn't out-speed the trap"; + } break; case MOD_WATER: - message = "sank like a rock"; + if (r == 0) { + message = "sank like a rock"; + } else if (r == 1) { + message = "ran out of air"; + } else if (r == 2) { + message = "attempted to do scuba diving without an oxygen tank"; + } break; case MOD_SLIME: - message = "melted"; + if (r == 0) { + message = "melted"; + } else if (r == 1) { + message = "came into contact with acid"; + } else if (r == 2) { + message = "got disintegrated by the acid"; + } break; case MOD_LAVA: - message = "does a back flip into the lava"; + if (r == 0) { + message = "does a back flip into the lava"; + } else if (r == 1) { + message = "became one with the environment itself"; + } else if (r == 2) { + message = "met a tragic end"; + } break; case MOD_TARGET_LASER: - message = "saw the light"; + if (r == 0) { + message = "saw the light"; + } else if (r == 1) { + message = "was burned by the light"; + } else if (r == 2) { + message = "should have not crossed the light's path"; + } break; case MOD_TRIGGER_HURT: - message = "was in the wrong place"; + if (r == 0) { + message = "was in the wrong place"; + } else if (r == 1) { + message = "was taken away by eldritch beings"; + } else if (r == 2) { + message = "shouldn't have done that"; + } break; default: message = NULL; diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 8bcd593..1a4a560 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -2191,6 +2191,7 @@ commands_t cmds[ ] = { "acc", CMD_INTERMISSION, Cmd_Acc_f}, // cheats + { "additem", CMD_CHEAT|CMD_LIVING, Cmd_AddItem_f }, { "give", CMD_CHEAT|CMD_LIVING, Cmd_Give_f }, { "god", CMD_CHEAT|CMD_LIVING, Cmd_God_f }, { "notarget", CMD_CHEAT|CMD_LIVING, Cmd_Notarget_f }, diff --git a/code/game/g_cmds_cs.c b/code/game/g_cmds_cs.c new file mode 100644 index 0000000..c9a8799 --- /dev/null +++ b/code/game/g_cmds_cs.c @@ -0,0 +1,59 @@ +/* + * This file is part of Illusion Arena + * Contents of this file were adapted from CorkScrew + * Copyright (C) Arjen '[F]irestarter' van der Veen + */ + +#include "g_local.h" + +void Cmd_AddItem_f( gentity_t *ent ) { + char buffer[1024]; + char buffer2[48]; + int len; + fileHandle_t f; + char filename[MAX_QPATH] = "powerups/"; + char map[MAX_QPATH]; + char serverinfo[MAX_INFO_STRING]; + + if ( g_cheats.integer == 0 ) { + return; + } + + if ( trap_Argc() != 2 ) { + trap_SendServerCommand( ent-g_entities, va("print \"usage: additem item\nexample: additem item_haste\n\"")); + return; + } + + trap_GetServerinfo( serverinfo, sizeof(serverinfo) ); + Q_strncpyz( map, Info_ValueForKey( serverinfo, "mapname" ), sizeof(map) ); + + strcat(filename, map); + strcat(filename, ".txt"); + + trap_FS_FOpenFile( filename, &f, FS_APPEND ); + + trap_Argv( 1, buffer2, sizeof( buffer2 ) ); + + + if ( ent->s.groundEntityNum ) { // we're on the ground, so spawnflags = 0; + Com_sprintf( buffer, sizeof(buffer), + "\n\n{\nclassname \"%s\"\norigin \"%i %i %i\"\n}\n", + buffer2, + (int)ent->s.pos.trBase[0], + (int)ent->s.pos.trBase[1], + (int)ent->s.pos.trBase[2] ); + trap_SendServerCommand( ent-g_entities, va("print \"%s added at %s\n\"", buffer2, vtos( ent->s.pos.trBase ) ) ); + } else { + Com_sprintf( buffer, sizeof(buffer), + "\n\n{\nclassname \"%s\"\norigin \"%i %i %i\"\nspawnflags \"1\"\n}\n", + buffer2, + (int)ent->s.pos.trBase[0], + (int)ent->s.pos.trBase[1], + (int)ent->s.pos.trBase[2] ); + trap_SendServerCommand( ent-g_entities, va("print \"suspended %s added at %s\n\"", buffer2, vtos( ent->s.pos.trBase ) ) ); + } + + trap_FS_Write( buffer, strlen( buffer ), f ); + + trap_FS_FCloseFile( f ); +} diff --git a/code/game/g_local.h b/code/game/g_local.h index 5309147..f35ceae 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -586,6 +586,9 @@ char *ConcatArgs( int start ); //KK-OAX This declaration moved from g_svccmds.c //KK-OAX Added this to make accessible from g_svcmds_ext.c void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ); +// Adapted from CorkScrew +// g_cmds_cs.c +void Cmd_AddItem_f( gentity_t *ent ); // KK-OAX Added these in a seperate file to keep g_cmds.c familiar. // g_cmds_ext.c diff --git a/code/q3_ui/ui_credits.c b/code/q3_ui/ui_credits.c index 156a950..bf4e7c5 100644 --- a/code/q3_ui/ui_credits.c +++ b/code/q3_ui/ui_credits.c @@ -64,11 +64,15 @@ static void UI_CreditMenu_Draw( void ) { y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "Thanks to:", UI_CENTER|UI_SMALLFONT, color_green ); + y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; + UI_DrawProportionalString( 320, y, "Arjen \"Firestarter\" van der Veen (CorkScrew)", UI_CENTER|UI_SMALLFONT, color_white ); y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "Bishop-333 (OmegA)", UI_CENTER|UI_SMALLFONT, color_white ); y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "id Software for id Tech 3", UI_CENTER|UI_SMALLFONT, color_white ); y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; + UI_DrawProportionalString( 320, y, "Neil \"haste\" Toronto (Alternate Fire, Unlagged)", UI_CENTER|UI_SMALLFONT, color_white ); + y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "OpenArena Team", UI_CENTER|UI_SMALLFONT, color_white ); y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "[Runo] (@runo14 at ModDB)", UI_CENTER|UI_SMALLFONT, color_white );