Talk:Specimen Mechanics

From Tripwire Interactive Wiki
Revision as of 05:47, 24 March 2012 by Scaryghost (talk | contribs) (Added info about husk stunning)
Jump to navigation Jump to search

Decapitation

Decapitation damage bonus and bleed out timer: KFMonster.RemoveHead() [KFMonster.uc].

// Head explodes, causing additional hurty.
if( KFPawn(LastDamagedBy)!=None )
{
    TakeDamage( LastDamageAmount + 0.25 * HealthMax , LastDamagedBy, LastHitLocation, LastMomentum, LastDamagedByType);
}

if( Health > 0 )
{
   BleedOutTime = Level.TimeSeconds +  BleedOutDuration;
}

BleedOutTime usage: KFMonster.Tick() [KMonster.uc].

// If the Zed has been bleeding long enough, make it die
if ( Role == ROLE_Authority && bDecapitated )
{
    if ( BleedOutTime > 0 && Level.TimeSeconds - BleedOutTime >= 0 )
    {
        Died(LastDamagedBy.Controller,class'DamTypeBleedOut',Location);
        BleedOutTime=0;
    }
}

BleedOutDuration is set to 5 in KFMonster.uc, 6 in ZombieBloatBase.uc, ZombieHuskBase.uc, and ZombieScrakeBase.uc, and 7 in ZombieFleshpoundBase.uc

--Scaryghost 00:46, 24 March 2012 (EDT)

Stunning

Damage requirement for stunning: KFMonster.PlayHit() [KFMonster.uc]

if( Health>0 && Damage>(float(Default.Health)/1.5) )
    FlipOver();

FlipOver's actions: KFMonster.FlipOver() [KFMonster.uc]

// High damage was taken, make em fall over.
function bool FlipOver()
{
    if( Physics==PHYS_Falling )
    {
        SetPhysics(PHYS_Walking);
    }

    bShotAnim = true;
    SetAnimAction('KnockDown');
    Acceleration = vect(0, 0, 0);
    Velocity.X = 0;
    Velocity.Y = 0;
    Controller.GoToState('WaitForAnim');
    KFMonsterController(Controller).bUseFreezeHack = True;
    Return True;
}

Specimens with a blank FlipOver() function cannot be stunned. The ones that have it overloaded and blanked are:

  • Crawler
  • Bloat
  • Siren
  • Fleshpound
  • Patriarch

Husks have a second, alternate condition that can trigger a stun. The stun threshold is set to 200 if the weapon is an ebr, lar, or crossbow.

ZombieHusk.PlayHit() [ZombieHusk.uc]

if( Health>0 && Damage>(float(Default.Health)/1.5) )
{
    FlipOver();
}
else if( Health > 0 && (damageType == class'DamTypeCrossbow' || damageType == class'DamTypeCrossbowHeadShot' ||
        damageType == class'DamTypeWinchester' || damageType == class'DamTypeM14EBR')
        &&  Damage > 200 ) // 200 Damage will be a headshot with the Winchester or EBR, or a hit with the Crossbow
{
    FlipOver();
}


--Scaryghost 01:10, 24 March 2012 (EDT)