forked from Mirrors/openclonk
AI do not use shield on explosives
parent
70875e3465
commit
c2271f743a
|
@ -243,8 +243,8 @@ private func ExecuteProtection(fx)
|
|||
if (!PathFree(GetX(),GetY(),obj->GetX(),obj->GetY())) continue;
|
||||
// This might hit :o
|
||||
fx.alert=fx.time;
|
||||
// do we have a shield?
|
||||
if (fx.shield)
|
||||
// Use a shield if the object is not explosive.
|
||||
if (fx.shield && !obj->~HasExplosionOnImpact())
|
||||
{
|
||||
// use it!
|
||||
if (fx.aim_weapon == fx.shield)
|
||||
|
|
|
@ -26,6 +26,8 @@ func Hit2()
|
|||
return Explode(18);
|
||||
}
|
||||
|
||||
public func HasExplosionOnImpact() { return true; }
|
||||
|
||||
local Collectible = 1;
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
|
|
|
@ -31,6 +31,8 @@ public func Hit()
|
|||
// Determines the arrow strength: only 30% that of the normal arrow.
|
||||
public func ArrowStrength() { return 3; }
|
||||
|
||||
public func HasExplosionOnImpact() { return !!GetEffect("InFlight", this); }
|
||||
|
||||
|
||||
/*-- Properties --*/
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ public func IsDroppedOnDeath(object clonk)
|
|||
return !!GetEffect("FuseBurn", this);
|
||||
}
|
||||
|
||||
public func HasExplosionOnImpact() { return armed; }
|
||||
|
||||
public func IsWeapon() { return true; }
|
||||
public func IsArmoryProduct() { return true; }
|
||||
|
|
Loading…
Reference in New Issue