Skip to content

Commit

Permalink
cgame - game: Fix client visuals about flight, ki boost, dash smoke a…
Browse files Browse the repository at this point in the history
…nd antigrav rock particles; now PW_FLIGHT and PW_HASTE are reused for flight and ki boost statuses. Disable (remove) unused EF flags: EF_KAMIKAZE and EF_AWARD_DENIED, disable unused particle functions and types, add events for later and apply some cleanup in the code
  • Loading branch information
LegendaryGuard committed Mar 5, 2024
1 parent 6f7fa09 commit fb2a33c
Show file tree
Hide file tree
Showing 14 changed files with 805 additions and 609 deletions.
52 changes: 49 additions & 3 deletions source/cgame/cg_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_JUMP_PAD:
DEBUGNAME("EV_JUMP_PAD");
// CG_Printf( "EV_JUMP_PAD w/effect #%i\n", es->eventParm );
// BFP - No smoke puff effect when using a jump pad
#if 0
{
localEntity_t *smoke;
vec3_t up = {0, 0, 1};
Expand All @@ -554,6 +556,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
LEF_PUFF_DONT_SCALE,
cgs.media.smokePuffShader );
}
#endif

// boing sound at origin, jump sound on player
trap_S_StartSound ( cent->lerpOrigin, -1, CHAN_VOICE, cgs.media.jumpPadSound );
Expand All @@ -563,7 +566,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_JUMP:
DEBUGNAME("EV_JUMP");
// BFP - Use the second jump sound when using ki boost only when it isn't flying
if ( ( es->eFlags & EF_AURA ) && !( cg.predictedPlayerState.pm_flags & PMF_FLYING ) ) {
if ( ( es->eFlags & EF_AURA ) && !( cent->currentState.powerups & ( 1 << PW_FLIGHT ) ) ) {
trap_S_StartSound (NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "sound/bfp/jump2.wav" ) ); // BFP - Ki boost jump sound
} else {
trap_S_StartSound (NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "sound/bfp/jump1.wav" ) ); // BFP - Normal jump sound
Expand Down Expand Up @@ -674,6 +677,43 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_FireWeapon( cent );
break;

case EV_MELEE_READY:
// DEBUGNAME("EV_MELEE_READY");
break;

// BFP - TODO: Implement EV_MELEE (when punching someone using Melee)
case EV_MELEE:
DEBUGNAME("EV_MELEE");
break;

// BFP - TODO: Implement EV_TIER_0-4 (Tiers)
case EV_TIER_0:
DEBUGNAME("EV_TIER_0");
break;

case EV_TIER_1:
DEBUGNAME("EV_TIER_1");
break;

case EV_TIER_2:
DEBUGNAME("EV_TIER_2");
break;

case EV_TIER_3:
DEBUGNAME("EV_TIER_3");
break;

case EV_TIER_4:
DEBUGNAME("EV_TIER_4");
break;
// BFP - TODO: Implement EV_TIER_0-4 (Tiers) ^

// BFP - A normal jump sound is played when enables the flight
case EV_ENABLE_FLIGHT:
// DEBUGNAME("EV_ENABLE_FLIGHT");
trap_S_StartSound (NULL, es->number, CHAN_BODY, CG_CustomSound( es->number, "sound/bfp/jump1.wav" ) );
break;

case EV_USE_ITEM0:
DEBUGNAME("EV_USE_ITEM0");
CG_UseItem( cent );
Expand Down Expand Up @@ -796,6 +836,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_METAL );
break;

// BFP - TODO: Implement EV_MISSILE_DETONATE (it has been used on ki grenade bounces and ki disc, that happens when these explode after some time)
case EV_MISSILE_DETONATE:
DEBUGNAME("EV_MISSILE_DETONATE");
break;

case EV_RAILTRAIL:
DEBUGNAME("EV_RAILTRAIL");
cent->currentState.weapon = WP_RAILGUN;
Expand Down Expand Up @@ -990,9 +1035,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
// don't play gib sound when using the kamikaze because it interferes
// with the kamikaze sound, downside is that the gib sound will also
// not be played when someone is gibbed while just carrying the kamikaze
if ( !(es->eFlags & EF_KAMIKAZE) ) {
// BFP - No EF_KAMIKAZE flag
// if ( !(es->eFlags & EF_KAMIKAZE) ) {
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.gibSound );
}
// }
CG_GibPlayer( cent->lerpOrigin );
break;

Expand Down
19 changes: 12 additions & 7 deletions source/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1486,22 +1486,27 @@ qboolean trap_GetEntityToken( char *buffer, int bufferSize );

void CG_ClearParticles (void);
void CG_AddParticles (void);
void CG_ParticleSnow (qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum);
void CG_ParticleSmoke (qhandle_t pshader, centity_t *cent);
void CG_AddParticleShrapnel (localEntity_t *le);
void CG_ParticleSnowFlurry (qhandle_t pshader, centity_t *cent);
void CG_ParticleBulletDebris (vec3_t org, vec3_t vel, int duration);
void CG_ParticleSparks (vec3_t org, vec3_t vel, int duration, float x, float y, float speed);
void CG_ParticleDust (centity_t *cent, vec3_t origin, vec3_t dir);
void CG_ParticleMisc (qhandle_t pshader, vec3_t origin, int size, int duration, float alpha);
void CG_ParticleExplosion (char *animStr, vec3_t origin, vec3_t vel, int duration, int sizeStart, int sizeEnd);
// BFP - Bubble particle
void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum);
void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum);
// BFP - Dash smoke particle for ki boost when moving in the ground
void CG_ParticleDashSmoke (centity_t *cent, qhandle_t pshader, vec3_t origin);
void CG_ParticleDashSmoke (centity_t *cent, qhandle_t pshader, vec3_t origin);
// BFP - Antigrav rock particles for charging
void CG_ParticleAntigravRock (qhandle_t pshader, centity_t *cent, vec3_t origin);
void CG_ParticleAntigravRock (qhandle_t pshader, centity_t *cent, vec3_t origin);
void CG_AntigravRockHandling (centity_t *cent);

// BFP - Unused particle stuff, saved for later :P
#if 0
void CG_ParticleSnow (qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum);
void CG_ParticleSnowFlurry (qhandle_t pshader, centity_t *cent);
int CG_NewParticleArea ( int num ); // BFP - Unused function for particles, looks like here is to determine in the areas
#endif

extern qboolean initparticles;
int CG_NewParticleArea ( int num );


6 changes: 4 additions & 2 deletions source/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ static void CG_RegisterGraphics( void ) {
}

CG_ClearParticles ();
/*

// BFP - Unused function for particles, looks like here is to determine in the areas
#if 0
for (i=1; i<MAX_PARTICLES_AREAS; i++)
{
{
Expand All @@ -695,7 +697,7 @@ static void CG_RegisterGraphics( void ) {
break;
}
}
*/
#endif
}


Expand Down
Loading

0 comments on commit fb2a33c

Please sign in to comment.