void CBigMomma::LaunchMortar( void ) { m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2, 15 ); Vector startPos = pev->origin; startPos.z += 180; Vector vecLaunch = g_vecZero; if (m_pCine) // is a scripted_action making me shoot? { if (m_hTargetEnt != 0) // don't check m_fTurnType- bigmomma can fire in any direction. { vecLaunch = VecCheckSplatToss( pev, startPos, m_hTargetEnt->pev->origin, RANDOM_FLOAT( 150, 500 ) ); } if (vecLaunch == g_vecZero) { vecLaunch = pev->movedir; } } else { vecLaunch = pev->movedir; } EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY(pSackSounds), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) ); CBMortar *pBomb = CBMortar::Shoot( edict(), startPos, vecLaunch ); pBomb->pev->gravity = 1.0; MortarSpray( startPos, Vector(0,0,1), gSpitSprite, 24 ); }
void CBigMomma::LaunchMortar( void ) { m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2, 15 ); Vector startPos = pev->origin; startPos.z += 180; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY(pSackSounds), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) ); CBMortar *pBomb = CBMortar::Shoot( edict(), startPos, pev->movedir ); pBomb->pev->gravity = 1.0; MortarSpray( startPos, Vector(0,0,1), gSpitSprite, 24 ); }
void CNPC_BigMomma::LaunchMortar( void ) { m_mortarTime = gpGlobals->curtime + RandomFloat( 2, 15 ); Vector startPos = GetAbsOrigin(); startPos.z += 180; CPASAttenuationFilter filter( this ); EmitSound( filter, entindex(), "BigMomma.LaunchMortar" ); CBMortar *pBomb = CBMortar::Shoot( this, startPos, m_vTossDir ); pBomb->SetGravity( 1.0 ); MortarSpray( startPos, Vector(0,0,10), gSpitSprite, 24 ); }
void CBMortar::Animate( void ) { pev->nextthink = gpGlobals->time + 0.1; if ( gpGlobals->time > pev->dmgtime ) { pev->dmgtime = gpGlobals->time + 0.2; MortarSpray( pev->origin, -pev->velocity.Normalize(), gSpitSprite, 3 ); } if ( pev->frame++ ) { if ( pev->frame > m_maxFrame ) { pev->frame = 0; } } }
void CBMortar::Touch( CBaseEntity *pOther ) { trace_t tr; int iPitch; // splat sound iPitch = random->RandomFloat( 90, 110 ); EmitSound( "NPC_BigMomma.SpitTouch1" ); switch ( random->RandomInt( 0, 1 ) ) { case 0: EmitSound( "NPC_BigMomma.SpitHit1" ); break; case 1: EmitSound( "NPC_BigMomma.SpitHit2" ); break; } if ( pOther->IsBSPModel() ) { // make a splat on the wall UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + GetAbsVelocity() * 10, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr ); UTIL_DecalTrace( &tr, "Splash" ); } else { tr.endpos = GetAbsOrigin(); Vector vVelocity = GetAbsVelocity(); VectorNormalize( vVelocity ); tr.plane.normal = -1 * vVelocity; } // make some flecks MortarSpray( tr.endpos + Vector( 0, 0, 15 ), tr.plane.normal, gSpitSprite, 24 ); CBaseEntity *pOwner = GetOwnerEntity(); RadiusDamage( CTakeDamageInfo( this, pOwner, sk_bigmomma_dmg_blast.GetFloat(), DMG_ACID ), GetAbsOrigin(), sk_bigmomma_radius_blast.GetFloat(), CLASS_NONE, NULL ); UTIL_Remove( pSprite ); UTIL_Remove( this ); }
void CBMortar::Touch( CBaseEntity *pOther ) { TraceResult tr; int iPitch; // splat sound iPitch = RANDOM_FLOAT( 90, 110 ); EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "bullchicken/bc_acid1.wav", 1, ATTN_NORM, 0, iPitch ); switch ( RANDOM_LONG( 0, 1 ) ) { case 0: EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, "bullchicken/bc_spithit1.wav", 1, ATTN_NORM, 0, iPitch ); break; case 1: EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, "bullchicken/bc_spithit2.wav", 1, ATTN_NORM, 0, iPitch ); break; } if ( pOther->IsBSPModel() ) { // make a splat on the wall UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT( pev ), &tr ); UTIL_DecalTrace(&tr, DECAL_MOMMASPLAT); } else { tr.vecEndPos = pev->origin; tr.vecPlaneNormal = -1 * pev->velocity.Normalize(); } // make some flecks MortarSpray( tr.vecEndPos, tr.vecPlaneNormal, gSpitSprite, 24 ); entvars_t *pevOwner = NULL; if ( pev->owner ) pevOwner = VARS(pev->owner); RadiusDamage( pev->origin, pev, pevOwner, gSkillData.bigmommaDmgBlast, gSkillData.bigmommaRadiusBlast, CLASS_NONE, DMG_ACID ); UTIL_Remove( this ); }
void CBMortar::Animate( void ) { SetNextThink( gpGlobals->curtime + 0.1 ); Vector vVelocity = GetAbsVelocity(); VectorNormalize( vVelocity ); if ( gpGlobals->curtime > m_flDmgTime ) { m_flDmgTime = gpGlobals->curtime + 0.2; MortarSpray( GetAbsOrigin() + Vector( 0, 0, 15 ), -vVelocity, gSpitSprite, 3 ); } if ( m_iFrame++ ) { if ( m_iFrame > m_maxFrame ) { m_iFrame = 0; } } }