diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 46 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 8 | ||||
-rw-r--r-- | src/game/bg_public.h | 9 | ||||
-rw-r--r-- | src/game/g_active.c | 13 | ||||
-rw-r--r-- | src/game/g_cmds.c | 9 | ||||
-rw-r--r-- | src/game/g_local.h | 7 | ||||
-rw-r--r-- | src/game/g_weapon.c | 44 |
7 files changed, 59 insertions, 77 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 8967f09b..43f01c44 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2140,7 +2140,6 @@ weaponAttributes_t bg_weapons[ ] = 2000, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2163,7 +2162,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2186,7 +2184,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2209,7 +2206,6 @@ weaponAttributes_t bg_weapons[ ] = 2000, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2232,7 +2228,6 @@ weaponAttributes_t bg_weapons[ ] = 2000, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2255,7 +2250,6 @@ weaponAttributes_t bg_weapons[ ] = 2000, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2278,7 +2272,6 @@ weaponAttributes_t bg_weapons[ ] = 2000, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2301,7 +2294,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2324,7 +2316,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 10000, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2347,7 +2338,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qtrue, //qboolean purchasable; 5000, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2370,7 +2360,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 10000, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2393,7 +2382,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 5000, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2416,7 +2404,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2439,7 +2426,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2462,7 +2448,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2485,7 +2470,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2508,7 +2492,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qtrue, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2531,7 +2514,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2554,7 +2536,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qtrue, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2577,7 +2558,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; @@ -2600,7 +2580,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2623,7 +2602,6 @@ weaponAttributes_t bg_weapons[ ] = 0, //int reloadTime; qfalse, //qboolean hasAltMode; qfalse, //qboolean hasThirdMode; - qfalse, //qboolean synced; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; @@ -2938,26 +2916,6 @@ qboolean BG_WeaponHasThirdMode( int weapon ) /* ============== -BG_WeaponModesAreSynced -============== -*/ -qboolean BG_WeaponModesAreSynced( int weapon ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - { - return bg_weapons[ i ].synced; - } - } - - return qfalse; -} - -/* -============== BG_FindPurchasableForWeapon ============== */ @@ -3520,7 +3478,6 @@ char *eventnames[] = { "EV_FIRE_WEAPON", "EV_FIRE_WEAPON2", "EV_FIRE_WEAPON3", - "EV_FIRE_WEAPONBOTH", "EV_USE_ITEM0", "EV_USE_ITEM1", @@ -3593,7 +3550,8 @@ char *eventnames[] = { "EV_TAUNT_GUARDBASE", "EV_TAUNT_PATROL", - "EV_MENU" //TA: menu event + "EV_MENU", //TA: menu event + "EV_POISONCLOUD" //TA: client poisoned }; /* diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 9b274e2f..0539294e 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2346,10 +2346,7 @@ static void PM_Weapon( void ) { if( BG_WeaponHasAltMode( pm->ps->weapon ) ) { - if( BG_WeaponModesAreSynced( pm->ps->weapon ) && attack1 ) - PM_AddEvent( EV_FIRE_WEAPONBOTH ); - else - PM_AddEvent( EV_FIRE_WEAPON2 ); + PM_AddEvent( EV_FIRE_WEAPON2 ); } else { @@ -2523,7 +2520,8 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) //convert viewangles -> axis AnglesToAxis( tempang, axis ); - if( !BG_rotateAxis( ps->grapplePoint, axis, rotaxis, qfalse, + if( !( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) || + !BG_rotateAxis( ps->grapplePoint, axis, rotaxis, qfalse, ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) ) AxisCopy( axis, rotaxis ); diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 361ae0ce..393d278d 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -49,6 +49,8 @@ #define LC_TOTAL_CHARGE 255 #define LC_CHARGE_TIME 2000.0f +#define PCLOUD_TIME 10000 + // // config strings are a general means of communicating variable length strings // from the server to all connected clients. @@ -248,6 +250,7 @@ typedef enum { #define SS_HOVELING 0x00000100 #define SS_BOOSTED 0x00000200 #define SS_SLOWLOCKED 0x00000400 +#define SS_POISONCLOUDED 0x00000800 #define SB_VALID_TOGGLEBIT 0x00004000 @@ -510,7 +513,6 @@ typedef enum { EV_FIRE_WEAPON, EV_FIRE_WEAPON2, EV_FIRE_WEAPON3, - EV_FIRE_WEAPONBOTH, EV_USE_ITEM0, EV_USE_ITEM1, @@ -584,7 +586,8 @@ typedef enum { EV_TAUNT_PATROL, EV_MENU, //TA: menu event - EV_BUILD_DELAY //TA: can't build yet + EV_BUILD_DELAY, //TA: can't build yet + EV_POISONCLOUD //TA: client poisoned } entity_event_t; typedef enum @@ -973,7 +976,6 @@ typedef struct qboolean hasAltMode; qboolean hasThirdMode; - qboolean synced; qboolean purchasable; @@ -1090,7 +1092,6 @@ int BG_FindRepeatRateForWeapon( int weapon ); int BG_FindReloadTimeForWeapon( int weapon ); qboolean BG_WeaponHasAltMode( int weapon ); qboolean BG_WeaponHasThirdMode( int weapon ); -qboolean BG_WeaponModesAreSynced( int weapon ); qboolean BG_FindPurchasableForWeapon( int weapon ); int BG_FindBuildDelayForWeapon( int weapon ); WUTeam_t BG_FindTeamForWeapon( int weapon ); diff --git a/src/game/g_active.c b/src/game/g_active.c index 6e61fe2e..934e2b78 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -545,6 +545,10 @@ void ClientTimerActions( gentity_t *ent, int msec ) { client->time1000 -= 1000; + //client is poisoned + if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) + G_Damage( ent, NULL, NULL, NULL, NULL, 5, 0, MOD_VENOM ); + //replenish alien health if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { @@ -659,11 +663,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) { FireWeapon3( ent ); break; - case EV_FIRE_WEAPONBOTH: - FireWeapon( ent ); - FireWeapon2( ent ); - break; - case EV_USE_ITEM1: // teleporter // drop flags in CTF item = NULL; @@ -900,6 +899,10 @@ void ClientThink_real( gentity_t *ent ) { client->lastBoostedTime + 20000 < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; + if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED && + client->lastPoisonCloudedTime + PCLOUD_TIME < level.time ) + client->ps.stats[ STAT_STATE ] &= ~SS_POISONCLOUDED; + client->ps.gravity = g_gravity.value; if( BG_gotItem( UP_ANTITOXIN, client->ps.stats ) && diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 331326ae..ef2b5b9f 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2454,12 +2454,9 @@ void Cmd_Spawnbody_f( gentity_t *ent ) void Cmd_Test_f( gentity_t *ent ) { - int ammo, clips, maxclips; - playerState_t *ps = &ent->client->ps; - - BG_unpackAmmoArray( WP_MACHINEGUN, ps->ammo, ps->powerups, &ammo, &clips, &maxclips ); - G_Printf( "%d %d\n", ammo, clips ); - BG_packAmmoArray( WP_MACHINEGUN, ps->ammo, ps->powerups, 0, 1, maxclips ); + ent->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; + ent->client->lastPoisonCloudedTime = level.time; + G_AddPredictableEvent( ent, EV_POISONCLOUD, 0 ); } /* diff --git a/src/game/g_local.h b/src/game/g_local.h index e414e608..bacf2f82 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -341,9 +341,10 @@ struct gclient_s { gentity_t *infestBody; //TA: body that is being infested. must be persistant int lastPoisonTime; - int lastGrabTime; //TA: yuck yuck hack urgh - int lastLockTime; //TA: " " - int lastSlowTime; //TA: " " + int lastPoisonCloudedTime; + int lastGrabTime; + int lastLockTime; + int lastSlowTime; int lastBoostedTime; int pouncePayload; //TA: amount of damage pounce attack will do diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 53d4cf59..59fe1877 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -559,14 +559,6 @@ qboolean CheckVenomAttack( gentity_t *ent ) } G_Damage( traceEnt, ent, ent, forward, tr.endpos, 100, DAMAGE_NO_KNOCKBACK, MOD_VENOM ); -/* if( traceEnt->client ) - { - if( !( traceEnt->client->ps.stats[ STAT_STATE ] & SS_POISONED ) ) - { - traceEnt->client->ps.stats[ STAT_STATE ] |= SS_POISONED; - traceEnt->client->lastPoisonTime = level.time; - } - }*/ return qtrue; } @@ -603,7 +595,7 @@ void CheckGrabAttack( gentity_t *ent ) traceEnt = &g_entities[ tr.entityNum ]; - if( !traceEnt->takedamage) + if( !traceEnt->takedamage ) return; if( !traceEnt->client ) return; @@ -614,12 +606,43 @@ void CheckGrabAttack( gentity_t *ent ) VectorCopy( traceEnt->client->ps.viewangles, traceEnt->client->ps.grapplePoint ); traceEnt->client->ps.stats[ STAT_STATE ] |= SS_GRABBED; - traceEnt->client->lastLockTime = level.time; + traceEnt->client->lastGrabTime = level.time; //FIXME: event for some client side grab effect? } /* +=============== +poisonCloud +=============== +*/ +void poisonCloud( gentity_t *ent ) +{ + int entityList[ MAX_GENTITIES ]; + vec3_t range = { 200, 200, 200 }; + vec3_t mins, maxs, dir; + int i, num; + gentity_t *humanPlayer; + float modifier = 1.0f; + + VectorAdd( ent->client->ps.origin, range, maxs ); + VectorSubtract( ent->client->ps.origin, range, mins ); + + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) + { + humanPlayer = &g_entities[ entityList[ i ] ]; + + if( humanPlayer->client && humanPlayer->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + { + humanPlayer->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; + humanPlayer->client->lastPoisonCloudedTime = level.time; + G_AddPredictableEvent( humanPlayer, EV_POISONCLOUD, 0 ); + } + } +} + +/* ====================================================================== CLAW AND POUNCE @@ -913,6 +936,7 @@ void FireWeapon2( gentity_t *ent ) switch( ent->s.weapon ) { case WP_GRAB_CLAW_UPG: + poisonCloud( ent ); break; case WP_POUNCE: case WP_POUNCE_UPG: |