diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 47 | ||||
-rw-r--r-- | src/game/bg_public.h | 38 | ||||
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 40 | ||||
-rw-r--r-- | src/game/g_cmds.c | 84 | ||||
-rw-r--r-- | src/game/g_mover.c | 4 |
6 files changed, 77 insertions, 138 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 40a34e3e..ccddcedb 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -488,10 +488,10 @@ buildableAttributes_t bg_buildableList[ ] = qfalse //qboolean reactorTest; }, { - BA_H_MCU, //int buildNum; + BA_H_ARMOURY, //int buildNum; "mcu", //char *buildName; "Armoury", //char *humanName; - "team_human_mcu", //char *entityName; + "team_human_armoury", //char *entityName; { "models/buildables/mcu/mcu.md3", 0, 0, 0 }, { -40, -40, -15 }, //vec3_t mins; { 40, 40, 15 }, //vec3_t maxs; @@ -3463,7 +3463,7 @@ char *eventnames[ ] = "EV_FALL_MEDIUM", "EV_FALL_FAR", - "EV_JUMP_PAD", // boing sound at origin, jump sound on player + "EV_JUMP_PAD", // boing sound at origin", jump sound on player "EV_JUMP", "EV_WATER_TOUCH", // foot touches @@ -3471,9 +3471,6 @@ char *eventnames[ ] = "EV_WATER_UNDER", // head touches "EV_WATER_CLEAR", // head leaves - "EV_ITEM_PICKUP", // normal item pickups are predictable - "EV_GLOBAL_ITEM_PICKUP", // powerup / team sounds are broadcast to everyone - "EV_NOAMMO", "EV_CHANGE_WEAPON", "EV_NEXT_WEAPON", @@ -3481,26 +3478,7 @@ char *eventnames[ ] = "EV_FIRE_WEAPON2", "EV_FIRE_WEAPON3", - "EV_USE_ITEM0", - "EV_USE_ITEM1", - "EV_USE_ITEM2", - "EV_USE_ITEM3", - "EV_USE_ITEM4", - "EV_USE_ITEM5", - "EV_USE_ITEM6", - "EV_USE_ITEM7", - "EV_USE_ITEM8", - "EV_USE_ITEM9", - "EV_USE_ITEM10", - "EV_USE_ITEM11", - "EV_USE_ITEM12", - "EV_USE_ITEM13", - "EV_USE_ITEM14", - "EV_USE_ITEM15", - - "EV_ITEM_RESPAWN", "EV_PLAYER_RESPAWN", //TA: for fovwarp effects - "EV_ITEM_POP", "EV_PLAYER_TELEPORT_IN", "EV_PLAYER_TELEPORT_OUT", @@ -3519,10 +3497,8 @@ char *eventnames[ ] = "EV_MISSILE_MISS", "EV_MISSILE_MISS_METAL", "EV_BUILDABLE_EXPLOSION", //TA: human item explosions - "EV_RAILTRAIL", "EV_TESLATRAIL", "EV_ALIENZAP", - "EV_SHOTGUN", "EV_BULLET", // otherEntity is the shooter "EV_PAIN", @@ -3531,10 +3507,6 @@ char *eventnames[ ] = "EV_DEATH3", "EV_OBITUARY", - "EV_POWERUP_QUAD", - "EV_POWERUP_BATTLESUIT", - "EV_POWERUP_REGEN", - "EV_GIB_PLAYER", // gib a previously living player "EV_GIB_ALIEN", //TA: generic green gib for aliens @@ -3545,16 +3517,11 @@ char *eventnames[ ] = "EV_DEBUG_LINE", "EV_STOPLOOPINGSOUND", "EV_TAUNT", - "EV_TAUNT_YES", - "EV_TAUNT_NO", - "EV_TAUNT_FOLLOWME", - "EV_TAUNT_GETFLAG", - "EV_TAUNT_GUARDBASE", - "EV_TAUNT_PATROL", - - "EV_MENU", //TA: menu event + + "EV_MENU", //TA: menu event + "EV_BUILD_DELAY", //TA: can't build yet "EV_POISONCLOUD", //TA: client poisoned - "EV_KNOCKOVER" //TA: client knocked over + "EV_KNOCKOVER", //TA: client knocked over "EV_GETUP" //TA: client getting up }; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 3c8606f3..f445945b 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -399,7 +399,7 @@ typedef enum BA_H_MGTURRET, BA_H_TESLAGEN, - BA_H_MCU, + BA_H_ARMOURY, BA_H_DCC, BA_H_MEDISTAT, BA_H_ADVMEDISTAT, @@ -480,9 +480,6 @@ typedef enum EV_WATER_UNDER, // head touches EV_WATER_CLEAR, // head leaves - EV_ITEM_PICKUP, // normal item pickups are predictable - EV_GLOBAL_ITEM_PICKUP, // powerup / team sounds are broadcast to everyone - EV_NOAMMO, EV_CHANGE_WEAPON, EV_NEXT_WEAPON, @@ -490,26 +487,7 @@ typedef enum EV_FIRE_WEAPON2, EV_FIRE_WEAPON3, - EV_USE_ITEM0, - EV_USE_ITEM1, - EV_USE_ITEM2, - EV_USE_ITEM3, - EV_USE_ITEM4, - EV_USE_ITEM5, - EV_USE_ITEM6, - EV_USE_ITEM7, - EV_USE_ITEM8, - EV_USE_ITEM9, - EV_USE_ITEM10, - EV_USE_ITEM11, - EV_USE_ITEM12, - EV_USE_ITEM13, - EV_USE_ITEM14, - EV_USE_ITEM15, - - EV_ITEM_RESPAWN, EV_PLAYER_RESPAWN, //TA: for fovwarp effects - EV_ITEM_POP, EV_PLAYER_TELEPORT_IN, EV_PLAYER_TELEPORT_OUT, @@ -528,10 +506,8 @@ typedef enum EV_MISSILE_MISS, EV_MISSILE_MISS_METAL, EV_BUILDABLE_EXPLOSION, //TA: human item explosions - EV_RAILTRAIL, EV_TESLATRAIL, EV_ALIENZAP, - EV_SHOTGUN, EV_BULLET, // otherEntity is the shooter EV_PAIN, @@ -540,10 +516,6 @@ typedef enum EV_DEATH3, EV_OBITUARY, - EV_POWERUP_QUAD, - EV_POWERUP_BATTLESUIT, - EV_POWERUP_REGEN, - EV_GIB_PLAYER, // gib a previously living player EV_GIB_ALIEN, //TA: generic green gib for aliens @@ -554,12 +526,6 @@ typedef enum EV_DEBUG_LINE, EV_STOPLOOPINGSOUND, EV_TAUNT, - EV_TAUNT_YES, - EV_TAUNT_NO, - EV_TAUNT_FOLLOWME, - EV_TAUNT_GETFLAG, - EV_TAUNT_GUARDBASE, - EV_TAUNT_PATROL, EV_MENU, //TA: menu event EV_BUILD_DELAY, //TA: can't build yet @@ -589,7 +555,7 @@ typedef enum MN_H_SPAWN, MN_H_BUILD, - MN_H_MCU, + MN_H_ARMOURY, MN_H_BANK, MN_H_NOROOM, MN_H_NOPOWER, diff --git a/src/game/g_active.c b/src/game/g_active.c index 6dda7ade..ed4034d9 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1119,7 +1119,7 @@ void ClientThink_real( gentity_t *ent ) } else { - //TA: look for MCU infront of player + //TA: look for object infront of player AngleVectors( client->ps.viewangles, view, NULL, NULL ); VectorMA( client->ps.origin, 200, view, point ); trap_Trace( &trace, client->ps.origin, NULL, NULL, point, ent->s.number, MASK_SHOT ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 4c57d09d..b6e2d02d 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -61,6 +61,13 @@ static qboolean findPower( gentity_t *self ) vec3_t temp_v; qboolean foundPower = qfalse; + if( self->biteam != BIT_HUMANS ) + return qfalse; + + //reactor is always powered + if( self->s.modelindex == BA_H_REACTOR ) + return qtrue; + //if this already has power then stop now if( self->parentNode && self->parentNode->powered ) return qtrue; @@ -117,6 +124,7 @@ static qboolean isPower( vec3_t origin ) gentity_t dummy; dummy.parentNode = NULL; + dummy.biteam = BIT_HUMANS; VectorCopy( origin, dummy.s.origin ); return findPower( &dummy ); @@ -139,6 +147,9 @@ static qboolean findDCC( gentity_t *self ) vec3_t temp_v; qboolean foundDCC = qfalse; + if( self->biteam != BIT_HUMANS ) + return qfalse; + //if this already has dcc then stop now if( self->dccNode && self->dccNode->powered ) return qtrue; @@ -187,6 +198,7 @@ static qboolean isDCC( ) gentity_t dummy; dummy.dccNode = NULL; + dummy.biteam = BIT_HUMANS; return findDCC( &dummy ); } @@ -1097,31 +1109,31 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) /* ================ -HMCU_Activate +HArmoury_Activate -Called when a human activates an MCU +Called when a human activates an Armoury ================ */ -void HMCU_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) +void HArmoury_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) { //only humans can activate this if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) return; - //if this is powered then call the mcu menu + //if this is powered then call the armoury menu if( self->powered ) - G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_ARMOURY ); else G_AddPredictableEvent( activator, EV_MENU, MN_H_NOPOWER ); } /* ================ -HMCU_Think +HArmoury_Think -Think for mcu +Think for armoury ================ */ -void HMCU_Think( gentity_t *self ) +void HArmoury_Think( gentity_t *self ) { //make sure we have power self->nextthink = level.time + REFRESH_TIME; @@ -1148,7 +1160,7 @@ void HBank_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) //only humans can activate this if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) return; - //if this is powered then call the mcu menu + //if this is powered then call the bank menu if( self->powered ) G_AddPredictableEvent( activator, EV_MENU, MN_H_BANK ); else @@ -1973,10 +1985,10 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin built->think = HDef_Think; break; - case BA_H_MCU: - built->think = HMCU_Think; + case BA_H_ARMOURY: + built->think = HArmoury_Think; built->die = HSpawn_Die; - built->use = HMCU_Activate; + built->use = HArmoury_Activate; break; case BA_H_BANK: @@ -2063,10 +2075,10 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin if( built->s.generic1 < 0 ) built->s.generic1 = 0; - if( built->powered ) + if( built->powered = findPower( built ) ) built->s.generic1 |= B_POWERED_TOGGLEBIT; - if( built->dcced ) + if( built->dcced = findDCC( built ) ) built->s.generic1 |= B_DCCED_TOGGLEBIT; VectorCopy( normal, built->s.origin2 ); diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 18b33792..6b8664ec 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -16,8 +16,6 @@ #include "g_local.h" -//#include "../../ui/menudef.h" // for the voice chats - /* ================== ScoreboardMessage @@ -1008,7 +1006,7 @@ void Cmd_Class_f( gentity_t *ent ) if( ent->client->pers.pclass == PCL_NONE ) { - trap_SendServerCommand( ent-g_entities, va("print \"Unknown class\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Unknown class\n\"" ) ); return; } @@ -1049,7 +1047,7 @@ void Cmd_Class_f( gentity_t *ent ) else { ent->client->pers.pclass = PCL_NONE; - trap_SendServerCommand( ent-g_entities, va("print \"You cannot evolve from your current class\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You cannot evolve from your current class\n\"" ) ); return; } } @@ -1075,11 +1073,11 @@ void Cmd_Class_f( gentity_t *ent ) } ent->client->pers.pclass = PCL_NONE; - trap_SendServerCommand( ent-g_entities, va("print \"You cannot spawn as this class\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You cannot spawn as this class\n\"" ) ); } else { - trap_SendServerCommand( ent-g_entities, va("print \"Unknown class\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Unknown class\n\"" ) ); return; } } @@ -1089,7 +1087,7 @@ void Cmd_Class_f( gentity_t *ent ) //humans cannot use this command whilst alive if( ent->client->ps.stats[ STAT_PCLASS ] != PCL_NONE ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be dead to use the class command\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be dead to use the class command\n\"" ) ); return; } @@ -1103,7 +1101,7 @@ void Cmd_Class_f( gentity_t *ent ) else { ent->client->pers.pclass = PCL_NONE; - trap_SendServerCommand( ent-g_entities, va("print \"Unknown starting item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Unknown starting item\n\"" ) ); return; } @@ -1117,7 +1115,7 @@ void Cmd_Class_f( gentity_t *ent ) ent->client->pers.pclass = PCL_NONE; ent->client->sess.sessionTeam = TEAM_FREE; ClientSpawn( ent, NULL ); - trap_SendServerCommand( ent-g_entities, va("print \"Join a team first\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Join a team first\n\"" ) ); } } @@ -1255,8 +1253,8 @@ void Cmd_Buy_f( gentity_t *ent ) char s[ MAX_TOKEN_CHARS ]; vec3_t distance; int i; - gentity_t *mcuEntity; - qboolean nearMCU = qfalse; + gentity_t *armouryEntity; + qboolean nearArmoury = qfalse; int weapon, upgrade, numItems = 0; int quan, clips, maxClips; @@ -1278,23 +1276,23 @@ void Cmd_Buy_f( gentity_t *ent ) if( ent->client->pers.pteam != PTE_HUMANS ) return; - for ( i = 1, mcuEntity = g_entities + i; i < level.num_entities; i++, mcuEntity++ ) + for ( i = 1, armouryEntity = g_entities + i; i < level.num_entities; i++, armouryEntity++ ) { - if( mcuEntity->s.eType != ET_BUILDABLE ) + if( armouryEntity->s.eType != ET_BUILDABLE ) continue; - if( mcuEntity->s.modelindex == BA_H_MCU ) + if( armouryEntity->s.modelindex == BA_H_ARMOURY ) { - VectorSubtract( ent->s.pos.trBase, mcuEntity->s.origin, distance ); + VectorSubtract( ent->s.pos.trBase, armouryEntity->s.origin, distance ); if( VectorLength( distance ) <= 100 ) - nearMCU = qtrue; + nearArmoury = qtrue; } } - //no MCU nearby - if( !nearMCU ) + //no armoury nearby + if( !nearArmoury ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an MCU\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an armoury\n\"" ) ); return; } @@ -1327,21 +1325,21 @@ void Cmd_Buy_f( gentity_t *ent ) if( BG_FindTeamForWeapon( weapon ) != WUT_HUMANS ) { //shouldn't need a fancy dialog - trap_SendServerCommand( ent-g_entities, va("print \"You can't buy alien items\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You can't buy alien items\n\"" ) ); return; } //are we /allowed/ to buy this? if( !BG_FindPurchasableForWeapon( weapon ) ) { - trap_SendServerCommand( ent-g_entities, va("print \"You can't buy this item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You can't buy this item\n\"" ) ); return; } //are we /allowed/ to buy this? if( !BG_FindStagesForWeapon( weapon, g_humanStage.integer ) ) { - trap_SendServerCommand( ent-g_entities, va("print \"You can't buy this item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You can't buy this item\n\"" ) ); return; } @@ -1392,14 +1390,14 @@ void Cmd_Buy_f( gentity_t *ent ) if( BG_FindTeamForUpgrade( upgrade ) != WUT_HUMANS ) { //shouldn't need a fancy dialog - trap_SendServerCommand( ent-g_entities, va("print \"You can't buy alien items\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You can't buy alien items\n\"" ) ); return; } //are we /allowed/ to buy this? if( !BG_FindStagesForUpgrade( upgrade, g_humanStage.integer ) ) { - trap_SendServerCommand( ent-g_entities, va("print \"You can't buy this item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You can't buy this item\n\"" ) ); return; } @@ -1444,7 +1442,7 @@ void Cmd_Buy_f( gentity_t *ent ) } else { - trap_SendServerCommand( ent-g_entities, va("print \"Unknown item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Unknown item\n\"" ) ); } //if the buyer previously had no items at all, force a new selection @@ -1463,8 +1461,8 @@ void Cmd_Sell_f( gentity_t *ent ) char s[ MAX_TOKEN_CHARS ]; vec3_t distance; int i; - gentity_t *mcuEntity; - qboolean nearMCU = qfalse; + gentity_t *armouryEntity; + qboolean nearArmoury = qfalse; int weapon, upgrade; int quan, clips, maxClips; @@ -1474,23 +1472,23 @@ void Cmd_Sell_f( gentity_t *ent ) if( ent->client->pers.pteam != PTE_HUMANS ) return; - for ( i = 1, mcuEntity = g_entities + i; i < level.num_entities; i++, mcuEntity++ ) + for ( i = 1, armouryEntity = g_entities + i; i < level.num_entities; i++, armouryEntity++ ) { - if( mcuEntity->s.eType != ET_BUILDABLE ) + if( armouryEntity->s.eType != ET_BUILDABLE ) continue; - if( mcuEntity->s.modelindex == BA_H_MCU ) + if( armouryEntity->s.modelindex == BA_H_ARMOURY ) { - VectorSubtract( ent->s.pos.trBase, mcuEntity->s.origin, distance ); + VectorSubtract( ent->s.pos.trBase, armouryEntity->s.origin, distance ); if( VectorLength( distance ) <= 100 ) - nearMCU = qtrue; + nearArmoury = qtrue; } } - //no MCU nearby - if( !nearMCU ) + //no armoury nearby + if( !nearArmoury ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an MCU\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an armoury\n\"" ) ); return; } @@ -1528,9 +1526,7 @@ void Cmd_Sell_f( gentity_t *ent ) G_AddEvent( ent, EV_NEXT_WEAPON, 0 ); } else - { - trap_SendServerCommand( ent-g_entities, va("print \"Unknown item\n\"" ) ); - } + trap_SendServerCommand( ent-g_entities, va( "print \"Unknown item\n\"" ) ); } /* @@ -1572,7 +1568,7 @@ void Cmd_Deposit_f( gentity_t *ent ) //no Bank nearby if( !nearBank ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an Bank\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) ); return; } @@ -1608,7 +1604,7 @@ void Cmd_Deposit_f( gentity_t *ent ) //no Bank nearby if( !nearBank ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an Bank\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) ); return; } @@ -1663,7 +1659,7 @@ void Cmd_Withdraw_f( gentity_t *ent ) //no Bank nearby if( !nearBank ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an Bank\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) ); return; } @@ -1699,7 +1695,7 @@ void Cmd_Withdraw_f( gentity_t *ent ) //no Bank nearby if( !nearBank ) { - trap_SendServerCommand( ent-g_entities, va("print \"You must be near an Bank\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) ); return; } @@ -1789,7 +1785,7 @@ void Cmd_Build_f( gentity_t *ent ) } } else - trap_SendServerCommand( ent-g_entities, va("print \"Cannot build this item\n\"" ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"Cannot build this item\n\"" ) ); } @@ -1805,7 +1801,7 @@ void Cmd_Echo_f( gentity_t *ent ) trap_Argv( 1, s, sizeof( s ) ); - trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", s ) ); + trap_SendServerCommand( ent-g_entities, va( "print \"%s\n\"", s ) ); } diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 7327c4cd..74e99968 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -752,10 +752,8 @@ Blocked_Door void Blocked_Door( gentity_t *ent, gentity_t *other ) { // remove anything other than a client - if( !other->client ) + if( !other->client && other->s.eType != ET_BUILDABLE ) { - // except CTF flags!!!! - G_TempEntity( other->s.origin, EV_ITEM_POP ); G_FreeEntity( other ); return; } |