Mantis 980

o buildings produce less smoke and more sparks when recycled 

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@115 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2005-05-14 18:02:46 +00:00
parent 80944bf2fa
commit ed8ea7c662
3 changed files with 26 additions and 10 deletions

View file

@ -670,6 +670,10 @@ private:
#define GIB_NORMAL 0// gib if entity was overkilled #define GIB_NORMAL 0// gib if entity was overkilled
#define GIB_NEVER 1// never gib, no matter how much death damage is done ( freezing, etc ) #define GIB_NEVER 1// never gib, no matter how much death damage is done ( freezing, etc )
#define GIB_ALWAYS 2// always gib ( Houndeye Shock, Barnacle Bite ) #define GIB_ALWAYS 2// always gib ( Houndeye Shock, Barnacle Bite )
// puzl: 980
// Use gib paramater to control death of recycled buildings
#define GIB_RECYCLED 3// always gib ( Houndeye Shock, Barnacle Bite )
// :puzl
class CBaseMonster; class CBaseMonster;
class CCineMonster; class CCineMonster;

View file

@ -664,15 +664,21 @@ void AvHBaseBuildable::Killed(entvars_t* pevAttacker, int iGib)
this->mKilled = true; this->mKilled = true;
this->mInternalSetConstructionComplete = false; this->mInternalSetConstructionComplete = false;
this->TriggerDeathAudioVisuals(); // puzl: 980
// Less smoke for recycled buildings
this->TriggerDeathAudioVisuals(iGib == GIB_RECYCLED);
if(!this->GetIsOrganic()) if(!this->GetIsOrganic())
{ {
// More sparks for recycled buildings
int numSparks = ( iGib == GIB_RECYCLED ) ? 7 : 3;
for ( int i=0; i < numSparks; i++ ) {
Vector vecSrc = Vector( (float)RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ), (float)RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ), (float)0 ); Vector vecSrc = Vector( (float)RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ), (float)RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ), (float)0 );
vecSrc = vecSrc + Vector( (float)0, (float)0, (float)RANDOM_FLOAT( pev->origin.z, pev->absmax.z ) ); vecSrc = vecSrc + Vector( (float)0, (float)0, (float)RANDOM_FLOAT( pev->origin.z, pev->absmax.z ) );
UTIL_Sparks(vecSrc); UTIL_Sparks(vecSrc);
} }
}
// :puzl
this->TriggerRemoveTech(); this->TriggerRemoveTech();
AvHSURemoveEntityFromHotgroupsAndSelection(this->entindex()); AvHSURemoveEntityFromHotgroupsAndSelection(this->entindex());
@ -772,7 +778,10 @@ void AvHBaseBuildable::RecycleComplete()
// Play "+ resources" event // Play "+ resources" event
AvHSUPlayNumericEventAboveStructure(thePointsBack, this); AvHSUPlayNumericEventAboveStructure(thePointsBack, this);
this->Killed(this->pev, 0); // puzl: 980
// Less smoke and more sparks for recycled buildings
this->Killed(this->pev, GIB_RECYCLED);
// :puzl
} }
} }
@ -1227,7 +1236,7 @@ void AvHBaseBuildable::UpdateTechSlots()
} }
} }
void AvHBaseBuildable::TriggerDeathAudioVisuals() void AvHBaseBuildable::TriggerDeathAudioVisuals(bool isRecycled)
{ {
AvHClassType theTeamType = AVH_CLASS_TYPE_UNDEFINED; AvHClassType theTeamType = AVH_CLASS_TYPE_UNDEFINED;
AvHTeam* theTeam = GetGameRules()->GetTeam((AvHTeamNumber)this->pev->team); AvHTeam* theTeam = GetGameRules()->GetTeam((AvHTeamNumber)this->pev->team);
@ -1244,13 +1253,16 @@ void AvHBaseBuildable::TriggerDeathAudioVisuals()
case AVH_CLASS_TYPE_MARINE: case AVH_CLASS_TYPE_MARINE:
// lots of smoke // lots of smoke
// puzl: 980
// Less smoke for recycled buildings
int smokeScale = isRecycled ? 15 : 25;
MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );
WRITE_BYTE( TE_SMOKE ); WRITE_BYTE( TE_SMOKE );
WRITE_COORD( RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ) ); WRITE_COORD( RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ) );
WRITE_COORD( RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ) ); WRITE_COORD( RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ) );
WRITE_COORD( RANDOM_FLOAT( pev->absmin.z, pev->absmax.z ) ); WRITE_COORD( RANDOM_FLOAT( pev->absmin.z, pev->absmax.z ) );
WRITE_SHORT( g_sModelIndexSmoke ); WRITE_SHORT( g_sModelIndexSmoke );
WRITE_BYTE( 25 ); // scale * 10 WRITE_BYTE( smokeScale ); // scale * 10
WRITE_BYTE( 10 ); // framerate WRITE_BYTE( 10 ); // framerate
MESSAGE_END(); MESSAGE_END();
break; break;

View file

@ -208,7 +208,7 @@ protected:
void SetSelectID(int inSelectID); void SetSelectID(int inSelectID);
virtual void TriggerDeathAudioVisuals(); virtual void TriggerDeathAudioVisuals(bool isRecycled=false);
void UpdateAutoBuild(float inTimePassed); void UpdateAutoBuild(float inTimePassed);