datablock ExplosionData(BoostGrenadeExplosion)
{
soundProfileSet = RocketConcreteExplodeSoundSet;
lifeTimeMS = 4200;
// Volume particles
// particleEmitter = FRAGVolumeEmitter;
// particleDensity = 35;
// particleRadius = 2.5;
// Point emission
emitter[0] = DustRingEmitter;
emitter[1] = SteamExhaustEmitter;
emitter[2] = SteamExhaustEmitter;
// Sub explosion objects
// subExplosion[0] = FragGrenadeSubExplosion;
// subExplosion[1] = FragGrenadeSubExplosion2;
lightStartRadius = 10;
lightStartColor = "0.7 0.7 0.7 0.9";
lightEndRadius = 0;
lightEndColor = "0.0 0.0 0.00 0";
};
function Smoker::onAdd(%this)
{
%obj = %this;
%data = GameBase::getDataName(%this);
schedule("Mine::Detonate(" @ %this @ ");",40.0,%this);
if ($GrenadeIsSmoking != 1)
{
schedule("SmokeLikeHell(" @ %this @ ", 270);",3.0,%this); //Make sure only one smoke grenade can go off at a time
schedule("$GrenadeIsSmoking = 0;",30.0); //Or the game may crash, or just get REALLY slow
}
}
function SmokeLikeHell(%this, %steps) //Smoke it up
{
if(%steps)
{
$GrenadeIsSmoking = 1;
%trans = GameBase::getMuzzleTransform(%this);
%vel = Item::getVelocity(%this);
Projectile::spawnProjectile("SmokeSpew",%trans,%this,%vel);
schedule("SmokeLikeHell(" @ %this @ ", " @ %steps - 1 @ ");", 0.1);
}
}