diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 64 | ||||
-rw-r--r-- | src/game/bg_public.h | 38 | ||||
-rw-r--r-- | src/game/g_buildable.c | 37 | ||||
-rw-r--r-- | src/game/g_client.c | 3 | ||||
-rw-r--r-- | src/game/g_local.h | 1 |
5 files changed, 89 insertions, 54 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index a3acc451..6f6aeada 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1109,7 +1109,7 @@ buildableAttributes_t bg_buildableList[ ] = 200, //int splashRadius; MOD_DSPAWN, //int meansOfDeath; BIT_DROIDS, //int team; - EV_ITEM_GROW, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1130,7 +1130,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_DSPAWN, //int meansOfDeath; BIT_DROIDS, //int team; - EV_ITEM_GROW, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1151,7 +1151,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_DSPAWN, //int meansOfDeath; BIT_DROIDS, //int team; - EV_ITEM_GROW, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 1500, //int turretFireSpeed; 500, //int turretRange; @@ -1172,7 +1172,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_DSPAWN, //int meansOfDeath; BIT_DROIDS, //int team; - EV_ITEM_GROW, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; -1, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1193,7 +1193,7 @@ buildableAttributes_t bg_buildableList[ ] = 150, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1214,7 +1214,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 50, //int nextthink; 500, //int turretFireSpeed; 500, //int turretRange; @@ -1235,7 +1235,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 50, //int nextthink; 50, //int turretFireSpeed; 300, //int turretRange; @@ -1256,7 +1256,7 @@ buildableAttributes_t bg_buildableList[ ] = 50, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 150, //int nextthink; 4000, //int turretFireSpeed; 1500, //int turretRange; @@ -1277,7 +1277,7 @@ buildableAttributes_t bg_buildableList[ ] = 150, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1298,7 +1298,7 @@ buildableAttributes_t bg_buildableList[ ] = 150, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; -1, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1319,7 +1319,7 @@ buildableAttributes_t bg_buildableList[ ] = 150, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - EV_NONE, //int spawnEvent; + BANIM_IDLE1, //int constructAnim; 100, //int nextthink; 0, //int turretFireSpeed; 0, //int turretRange; @@ -1579,10 +1579,10 @@ int BG_FindTeamForBuildable( int bclass ) /* ============== -BG_FindEventForBuildable +BG_FindAnimForBuildable ============== */ -int BG_FindEventForBuildable( int bclass ) +int BG_FindAnimForBuildable( int bclass ) { int i; @@ -1590,11 +1590,11 @@ int BG_FindEventForBuildable( int bclass ) { if( bg_buildableList[ i ].buildNum == bclass ) { - return bg_buildableList[ i ].spawnEvent; + return bg_buildableList[ i ].constructAnim; } } - return EV_NONE; + return BANIM_IDLE1; } /* @@ -3392,6 +3392,7 @@ char *eventnames[] = { "EV_FOOTSTEP", "EV_FOOTSTEP_METAL", + "EV_FOOTSTEP_SQUELCH", "EV_FOOTSPLASH", "EV_FOOTWADE", "EV_SWIM", @@ -3405,7 +3406,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 @@ -3440,7 +3441,7 @@ char *eventnames[] = { "EV_USE_ITEM15", "EV_ITEM_RESPAWN", - "EV_PLAYER_RESPAWN", + "EV_PLAYER_RESPAWN", //TA: for fovwarp effects "EV_ITEM_POP", "EV_PLAYER_TELEPORT_IN", "EV_PLAYER_TELEPORT_OUT", @@ -3449,7 +3450,6 @@ char *eventnames[] = { "EV_GENERAL_SOUND", "EV_GLOBAL_SOUND", // no attenuation - "EV_GLOBAL_TEAM_SOUND", "EV_BULLET_HIT_FLESH", "EV_BULLET_HIT_WALL", @@ -3457,6 +3457,7 @@ char *eventnames[] = { "EV_MISSILE_HIT", "EV_MISSILE_MISS", "EV_MISSILE_MISS_METAL", + "EV_ITEM_EXPLOSION", //TA: human item explosions "EV_RAILTRAIL", "EV_SHOTGUN", "EV_BULLET", // otherEntity is the shooter @@ -3472,22 +3473,23 @@ char *eventnames[] = { "EV_POWERUP_REGEN", "EV_GIB_PLAYER", // gib a previously living player - "EV_SCOREPLUM", // score plum - -//#ifdef MISSIONPACK - "EV_PROXIMITY_MINE_STICK", - "EV_PROXIMITY_MINE_TRIGGER", - "EV_KAMIKAZE", // kamikaze explodes - "EV_OBELISKEXPLODE", // obelisk explodes - "EV_INVUL_IMPACT", // invulnerability sphere impact - "EV_JUICED", // invulnerability juiced effect - "EV_LIGHTNINGBOLT", // lightning bolt bounced of invulnerability sphere -//#endif + "EV_GIB_DROID", //TA: generic green gib for droids + + "EV_BUILD_CONSTRUCT", //TA + "EV_BUILD_DESTROY", //TA + "EV_BUILD_ANIM", //TA "EV_DEBUG_LINE", "EV_STOPLOOPINGSOUND", - "EV_TAUNT" - + "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 }; /* diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 09f5ecf3..01ea379e 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -492,7 +492,6 @@ typedef enum { EV_ITEM_RESPAWN, EV_PLAYER_RESPAWN, //TA: for fovwarp effects - EV_ITEM_GROW, //droid items that grow EV_ITEM_POP, EV_PLAYER_TELEPORT_IN, EV_PLAYER_TELEPORT_OUT, @@ -525,7 +524,10 @@ typedef enum { EV_GIB_PLAYER, // gib a previously living player EV_GIB_DROID, //TA: generic green gib for droids - EV_ITEM_RECEDE, //TA: sent when creep should recede + + EV_BUILD_CONSTRUCT, //TA + EV_BUILD_DESTROY, //TA + EV_BUILD_ANIM, //TA EV_DEBUG_LINE, EV_STOPLOOPINGSOUND, @@ -626,24 +628,26 @@ typedef enum { //TA: for buildable animations typedef enum { - CONSTRUCT1, - CONSTRUCT2, + BANIM_NONE, + + BANIM_CONSTRUCT1, + BANIM_CONSTRUCT2, - IDLE1, - IDLE2, - IDLE3, + BANIM_IDLE1, + BANIM_IDLE2, + BANIM_IDLE3, - ATTACK1, - ATTACK2, + BANIM_ATTACK1, + BANIM_ATTACK2, - SPAWN1, - SPAWN2, + BANIM_SPAWN1, + BANIM_SPAWN2, - PAIN1, - PAIN2, + BANIM_PAIN1, + BANIM_PAIN2, - DESTROY1, - DESTROY2, + BANIM_DESTROY1, + BANIM_DESTROY2, MAX_BUILDABLE_ANIMATIONS } buildableAnimNumber_t; @@ -857,7 +861,7 @@ typedef struct int team; - int spawnEvent; + int constructAnim; int nextthink; @@ -926,7 +930,7 @@ int BG_FindSplashDamageForBuildable( int bclass ); int BG_FindSplashRadiusForBuildable( int bclass ); int BG_FindMODForBuildable( int bclass ); int BG_FindTeamForBuildable( int bclass ); -int BG_FindEventForBuildable( int bclass ); +int BG_FindAnimForBuildable( int bclass ); int BG_FindNextThinkForBuildable( int bclass ); int BG_FindFireSpeedForBuildable( int bclass ); int BG_FindRangeForBuildable( int bclass ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index c9c5fdb7..04e246f8 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -35,6 +35,18 @@ Triggers an animation client side */ void G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ) { + G_AddEvent( ent, EV_BUILD_ANIM, anim ); +} + +/* +================ +G_setIdleBuildableAnim + +Set the animation to use whilst no other animations are running +================ +*/ +void G_setIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ) +{ ent->s.torsoAnim = anim; } @@ -190,7 +202,7 @@ void D_CreepRecede( gentity_t *self ) { //if the creep just died begin the recession if( ( self->timestamp + 100 ) == level.time ) - G_AddEvent( self, EV_ITEM_RECEDE, 0 ); + G_AddEvent( self, EV_BUILD_DESTROY, 0 ); //creep is still receeding if( ( self->timestamp + 10000 ) > level.time ) @@ -225,7 +237,7 @@ void DSpawn_Melt( gentity_t *self ) //start creep recession if( ( self->timestamp + 500 ) == level.time ) - G_AddEvent( self, EV_ITEM_RECEDE, 0 ); + G_AddEvent( self, EV_BUILD_DESTROY, 0 ); //not dead yet if( ( self->timestamp + 10000 ) > level.time ) @@ -279,6 +291,17 @@ void DSpawn_Think( gentity_t *self ) { } +/* +================ +DSpawn_Pain + +pain function for Droid Spawn +================ +*/ +void DSpawn_Pain( gentity_t *self, gentity_t *attacker, int damage ) +{ + G_setBuildableAnim( self, BANIM_PAIN1 ); +} @@ -1214,9 +1237,7 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) { built->splashRadius = BG_FindSplashRadiusForBuildable( buildable ); built->splashMethodOfDeath = BG_FindMODForBuildable( buildable ); - //add a spawn event - if( BG_FindEventForBuildable( buildable ) != EV_NONE ) - G_AddEvent( built, BG_FindEventForBuildable( buildable ), 0 ); + G_setIdleBuildableAnim( built, BG_FindAnimForBuildable( buildable ) ); built->nextthink = BG_FindNextThinkForBuildable( buildable ); @@ -1226,22 +1247,26 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) { case BA_D_SPAWN: built->die = DSpawn_Die; built->think = DSpawn_Think; + built->pain = DSpawn_Pain; break; case BA_D_DEF1: built->die = DDef1_Die; built->think = DDef1_Think; + built->pain = DSpawn_Pain; break; case BA_D_DEF2: built->die = DDef1_Die; built->think = DDef2_Think; + built->pain = DSpawn_Pain; built->enemy = NULL; built->s.weapon = BG_FindProjTypeForBuildable( buildable ); break; case BA_D_HIVEMIND: built->die = DSpawn_Die; + built->pain = DSpawn_Pain; break; case BA_H_SPAWN: @@ -1296,7 +1321,7 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) { built->s.pos.trType = TR_GRAVITY; built->s.pos.trTime = level.time; - G_setBuildableAnim( built, CONSTRUCT1 ); + G_AddEvent( built, EV_BUILD_CONSTRUCT, BANIM_CONSTRUCT1 ); trap_LinkEntity( built ); diff --git a/src/game/g_client.c b/src/game/g_client.c index 17928cc3..66f8afa9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1307,6 +1307,9 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) { trap_SendServerCommand( ent-g_entities, va("print \"No suitable spawns available\n\"" ) ); return; } + + //start spawn animation on egg + G_setBuildableAnim( spawnPoint, BANIM_SPAWN1 ); } } client->pers.teamState.state = TEAM_ACTIVE; diff --git a/src/game/g_local.h b/src/game/g_local.h index 64d3f3de..a176e444 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -545,6 +545,7 @@ typedef enum itemBuildError_t itemFits( gentity_t *ent, buildable_t buildable, int distance ); gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ); void G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ); +void G_setIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ); // // g_utils.c |