不可解な混乱
This commit is contained in:
@@ -619,4 +619,8 @@ void CG_InitConsoleCommands( void ) {
|
||||
trap_AddCommand ("stats");
|
||||
trap_AddCommand ("teamtask");
|
||||
trap_AddCommand ("loaddeferred");
|
||||
//
|
||||
// Adapted from CorkScrew
|
||||
//
|
||||
trap_AddCommand ("additem");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 },
|
||||
|
||||
59
code/game/g_cmds_cs.c
Normal file
59
code/game/g_cmds_cs.c
Normal file
@@ -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 );
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user