70 lines
1.3 KiB
Ucode
70 lines
1.3 KiB
Ucode
class MeanBleedInventory extends Inventory;
|
|
|
|
|
|
const dmtype_bleed=class'NiceDamTypeStalkerBleed';
|
|
var int maxBleedCount;
|
|
var private float fBleedPeriod;
|
|
|
|
var int bleedLevel;
|
|
var MeanZombieCrawler stalker;
|
|
|
|
|
|
event PostBeginPlay()
|
|
{
|
|
super.PostBeginPlay();
|
|
// start the timer
|
|
SetTimer(fBleedPeriod, true);
|
|
}
|
|
|
|
|
|
event Timer()
|
|
{
|
|
local pawn locpawn;
|
|
local bool amAlive;
|
|
local int bleedDamage;
|
|
|
|
locpawn = Pawn(Owner);
|
|
amAlive = locpawn != none && locpawn.Health > 0;
|
|
|
|
// if pawn owner is dead or bleed count is done - destroy
|
|
if (!amAlive || maxBleedCount < 0)
|
|
Destroy();
|
|
|
|
maxBleedCount--;
|
|
|
|
bleedDamage = bleedLevel * 7;
|
|
if (bleedDamage < 1.0)
|
|
{
|
|
maxBleedCount = 0;
|
|
return;
|
|
}
|
|
|
|
if (stalker != none)
|
|
locpawn.TakeDamage(bleedDamage, stalker, locpawn.Location,
|
|
vect(0, 0, 0), dmtype_bleed);
|
|
else
|
|
locpawn.TakeDamage(bleedDamage, locpawn, locpawn.Location,
|
|
vect(0, 0, 0), dmtype_bleed);
|
|
|
|
if (locpawn.isA('KFPawn'))
|
|
{
|
|
KFPawn(locpawn).HealthToGive -= 2 * bleedLevel;
|
|
}
|
|
}
|
|
|
|
|
|
// cleanup
|
|
function Destroyed()
|
|
{
|
|
if (stalker != none)
|
|
stalker = none;
|
|
|
|
super.Destroyed();
|
|
}
|
|
|
|
|
|
defaultproperties
|
|
{
|
|
maxBleedCount=7
|
|
fBleedPeriod=1.500000
|
|
} |