add function to determine if ironbomb and dynamite are fusing

liquid_container
Maikel de Vries 2016-04-22 23:26:05 +02:00
parent bc32456ac1
commit f46f38511a
2 changed files with 7 additions and 1 deletions

View File

@ -172,6 +172,8 @@ public func DoExplode()
public func IsChemicalProduct() { return true; }
public func IsGrenadeLauncherAmmo() { return true; }
public func IsFusing() { return GetAction() == "Fuse"; }
// Drop fusing dynamite on death to prevent explosion directly after respawn
public func IsDroppedOnDeath(object clonk)
{

View File

@ -28,6 +28,10 @@ func Fuse(bool explode_on_hit)
AddEffect("FuseBurn", this, 1,1, this);
}
public func FuseTime() { return 90; }
public func IsFusing() { return !!GetEffect("FuseBurn", this); }
public func OnCannonShot(object cannon)
{
Fuse(true);
@ -41,7 +45,7 @@ func FxFuseBurnTimer(object bomb, proplist effect, int timer)
CreateParticle("Smoke", x, y, x, y, PV_Random(18, 36), Particles_Smoke(), 2);
if(timer == 1) Sound("Fire::FuseLoop",nil,nil,nil,+1);
if(timer >= 90)
if(timer >= FuseTime())
{
Sound("Fire::FuseLoop",nil,nil,nil,-1);
DoExplode();