AI do not use shield on explosives

shapetextures
Maikel de Vries 2015-10-14 20:58:52 +02:00
parent 70875e3465
commit c2271f743a
4 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -26,6 +26,8 @@ func Hit2()
return Explode(18);
}
public func HasExplosionOnImpact() { return true; }
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -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 --*/

View File

@ -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; }