actor HellKnightClass : Playerpawn
{
  health 500
  radius 24
  height 64
  mass 1000
  speed 0.35
  painchance 50
  Player.DisplayName "HellKnight"
  Player.MaxHealth 500
  Player.ViewHeight 54
  Player.SoundClass HellKnightClass 
  Player.JumpZ 5
  Player.MorphWeapon "KnightHand"
  Player.WeaponSlot 1, KnightHand
  
  BloodColor "darkgreen"
  
  DamageFactor "MarineDamage", 0.85
  DamageFactor "MarineRLDamage", 0.85
  DamageFactor "MarineRail", 0.55
  DamageFactor "CybRLDamage", 0.2
  DamageFactor "ImpBallDamage", 0
  DamageFactor "CacoDamage", 0
  DamageFactor "SkelDamage", 0
  DamageFactor "FatsoDamage", 0
  DamageFactor "KnightDamage", 0
  DamageFactor "ArachDamage", 0
  DamageFactor "viledamage", 0
  DamageFactor "Control", 0
  DamageFactor "ZombiesDamage", 0
  DamageFactor "Slime", 0
  
  -PICKUP
  +NOSKIN
  +NOPAIN
  -FRIENDLY
  +NOTARGET
  states
  {
  Spawn:
    BOS2 AB 10 
    loop
  See:
    BOS2 A 0 A_Jump (240,2)
    BOS2 A 0 A_PlaySoundEx ("knight/active","body")
    BOS2 AABBCCDD 3
    loop
  Missile:
    BOS2 E 8 
    BOS2 F 8 bright
    BOS2 G 8 bright
    goto See   
  Death:
    BOS2 I 0 ACS_ExecuteAlways(426,0,6)
    BOS2 I 8 A_GiveToTarget ("MarineExp",6)
    BOS2 J 8 A_PlaySoundEx ("knight/death","body")
    BOS2 K 8 A_NoBlocking
    BOS2 LMN 8
    TNT1 A 0 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
  DeathWait:
    BOS2 O 2 A_CheckSight("Removecorpse")
    loop
  Removecorpse:
    TNT1 A 0 Thing_Remove (0)
    stop	
  }
}

// Weapon

ACTOR KnightHand : Weapon
{
  obituary "%o was burned by %k."
  hitobituary "%o was slashed by %k."
  weapon.kickback 80
  attacksound "baron/melee"
  weapon.ammouse 0
  
  +WEAPON.NOALERT
  +ammo_optional
  +Alt_Ammo_Optional
  +WEAPON.CHEATNOTWEAPON
  +INVENTORY.UNDROPPABLE
  
  states
  {
  Spawn:
    TNT1 A 0 Thing_Remove (0)
    Stop
  Select:
    KHND A 1 A_Raise
	goto ready
  Ready:
    KHND FAEA 3 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory ("Mskull",0,6)
    KHND FAEA 3 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory ("Mskull",3,1)
    Loop
	TNT1 A 0 HealThing(2)
	goto ready 
  DeSelect:
    KHND A 1 A_Lower
    Loop
  Fire:
    KHND A 0 A_JumpIfCloser (80,"Melee")
    KHND A 5 ACS_ExecuteAlways(426,0,5)
    KHND B 5
    KHND C 5
    KHND D 5 A_FireCustomMissile ("MBaronBall",0,0,0,7,0)
    KHND CB 3 ACS_ExecuteAlways(426,0,6)
    Goto Ready
  Melee:
    KHND B 3 
    KHND C 4 
    KHND D 4 A_CustomPunch (15,0,0,"FBulletPuff",90)
    KHND C 4
    Goto Ready
  Altfire:
    KHND A 5 ACS_ExecuteAlways (419,0,7)
    goto Ready
  }
}

//    Projectile

actor MBaronBall : MKnightBall
{
  radius 10
  height 16
  speed 17
  damage 8
  states
  {
  Spawn:
    BAL7 AB 4 bright
    loop
  Death:
    BAL7 C 5 A_Explode (8,64,0,0)
    BAL7 DE 5 bright
    stop
  }
}