From 504bb283f43e2420d78279804cc4c0a17c90ac88 Mon Sep 17 00:00:00 2001 From: Izuru Yakumo Date: Thu, 24 Jul 2025 19:27:15 -0300 Subject: [PATCH] =?UTF-8?q?=E6=AC=A1=E3=81=AE=E4=BA=BA=E7=94=9F=E3=81=AF?= =?UTF-8?q?=E6=9C=80=E5=BE=8C=E3=81=AE=E4=BA=BA=E7=94=9F=E3=82=88=E3=82=8A?= =?UTF-8?q?=E3=82=82=E8=89=AF=E3=81=84=E3=81=A7=E3=81=97=E3=82=87=E3=81=86?= =?UTF-8?q?=E3=81=8B=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- code/game/g_active.c | 4 ++ code/game/g_cmds.c | 1 + code/game/g_cmds_cs.c | 59 ------------------------- code/game/g_cmds_ia.c | 95 +++++++++++++++++++++++++++++++++++++++++ code/game/g_local.h | 11 +++-- code/q3_ui/ui_credits.c | 2 + 7 files changed, 110 insertions(+), 64 deletions(-) delete mode 100644 code/game/g_cmds_cs.c create mode 100644 code/game/g_cmds_ia.c diff --git a/Makefile b/Makefile index e166107..352b62a 100644 --- a/Makefile +++ b/Makefile @@ -694,8 +694,8 @@ Q3GOBJ_ = \ $(B)/baseia/game/g_bot.o \ $(B)/baseia/game/g_client.o \ $(B)/baseia/game/g_cmds.o \ - $(B)/baseia/game/g_cmds_cs.o \ $(B)/baseia/game/g_cmds_ext.o \ + $(B)/baseia/game/g_cmds_ia.o \ $(B)/baseia/game/g_combat.o \ $(B)/baseia/game/g_items.o \ $(B)/baseia/game/bg_alloc.o \ diff --git a/code/game/g_active.c b/code/game/g_active.c index 2d21a93..2a7764b 100644 --- a/code/game/g_active.c +++ b/code/game/g_active.c @@ -961,6 +961,10 @@ void ClientThink_real( gentity_t *ent ) { client->ps.gravity = g_gravity.value*g_gravityModifier.value; + if (ent->flags & FL_BOOTS) { + client->ps.gravity = g_gravity.value * 0.20; + } + // set speed client->ps.speed = g_speed.value; diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 1a4a560..dd12c69 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -2201,6 +2201,7 @@ commands_t cmds[ ] = { "kill", CMD_TEAM|CMD_LIVING, Cmd_Kill_f }, { "where", 0, Cmd_Where_f }, + { "boots", CMD_LIVING, Cmd_Boots_f }, // game commands diff --git a/code/game/g_cmds_cs.c b/code/game/g_cmds_cs.c deleted file mode 100644 index c9a8799..0000000 --- a/code/game/g_cmds_cs.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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_cmds_ia.c b/code/game/g_cmds_ia.c new file mode 100644 index 0000000..e59cc52 --- /dev/null +++ b/code/game/g_cmds_ia.c @@ -0,0 +1,95 @@ +/* + * This file is part of Illusion Arena + * Contains additional functions adapted from other places + * and mods, such as CorkScrew. + * + */ + +#include "g_local.h" + +/** + * Cmd_Boots_f + * Enables the player to perform longer jumps on demand + * It can be toggled from the console, or bound to a key + * + * Note: if you use this on a level that already has low gravity + * using these will get out of hand. + * + * @param ent argument of type gentity_t + */ + +void Cmd_Boots_f( gentity_t *ent ) { + char *msg; + ent->flags ^= FL_BOOTS; + + if (!(ent->flags & FL_BOOTS)) { + msg = "Anti-gravity boots OFF\n"; + } else { + msg = "Anti-gravity boots ON\n"; + } + + trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg)); +} + +/** + * Cmd_AddItem_f + * Inserts a power-up on the player's current location at a given map + * Adapted from CorkScrew (Firestarter) + * + * @param ent argument of type gentity_t + */ + +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 f35ceae..bab682e 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -57,6 +57,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define FL_DROPPED_ITEM 0x00001000 #define FL_NO_BOTS 0x00002000 // spawn point not for bot use #define FL_NO_HUMANS 0x00004000 // spawn point just for bots +#define FL_BOOTS 0x00006000 // anti-gravity boots (Burning) #define FL_FORCE_GESTURE 0x00008000 // force gesture on client // movers are things like doors, plats, buttons, etc @@ -586,10 +587,6 @@ 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 // @@ -609,6 +606,12 @@ int G_ClientNumberFromString( char *s ); qboolean G_ClientIsLagging( gclient_t *client ); void SanitizeString( char *in, char *out ); +// +// g_cmds_ia.c +// +void Cmd_AddItem_f( gentity_t *ent ); +void Cmd_Boots_f( gentity_t *ent ); + // KK-OAX Added this for common file stuff between Admin and Sprees. // g_fileops.c // diff --git a/code/q3_ui/ui_credits.c b/code/q3_ui/ui_credits.c index bf4e7c5..2a14d59 100644 --- a/code/q3_ui/ui_credits.c +++ b/code/q3_ui/ui_credits.c @@ -69,6 +69,8 @@ static void UI_CreditMenu_Draw( void ) { 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, "Burning (from Code3Arena)", 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 );