//=================================================================================================
//
// DarkImp
//
//=================================================================================================

actor DarkImp : DoomImp 5003 // [RT] Inherits from the DoomImp for convenience
{
  game Doom
  spawnid 155 // [RT] I think this is the right Spawnid, change if it isn't
  obituary "$OB_DARKIMP"
  hitobituary "$OB_DARKIMP_MELEE"
  health 120
  missiletype DarkImpBall
  meleedamage 3
  meleesound "imp/melee"
  states
  {
  Spawn:
    DIMP AB 10 A_Look
    loop
  See:
    DIMP AABBCCDD 3 A_Chase
    loop
  Melee:
  Missile:
    DIMP EF 8 A_FaceTarget
    DIMP G 6 A_ComboAttack  // See DarkImpBall
    goto See
  Pain:
    DIMP H 2
    DIMP H 2 A_Pain
    goto See
  Death:
    DIMP I 8
    DIMP J 8 A_Scream
    DIMP K 6
    DIMP L 6 A_NoBlocking
    DIMP M -1
    stop
  XDeath:
    DIMP N 5
    DIMP O 5 A_XScream
    DIMP P 5
    DIMP Q 5 A_NoBlocking
    DIMP RST 5
    DIMP U -1
    stop
  Raise:
    DIMP ML 8
    DIMP KJI 6
    goto See
  }
}

actor DarkImpBall : DoomImpBall // [RT] Inherits from DoomImpBall for convenience.
{
  game Doom
  spawnid 218
  Speed 20
  damage 3 // [RT] I think this is right, change if neccesary.
  states
  {
  Spawn:
    BAL4 AB 4 bright
    loop
  Death:
    BAL4 CDE 6 bright
    stop
  }
}

//=================================================================================================
//
// Cacolantern
//
//=================================================================================================

ACTOR Cacolantern : Cacodemon 5006
{
	SpawnID 159
	Health 800
	Obituary "$OB_CACOLANTERN"
	HitObituary "$OB_CACOLANTERN_MELEE"
	States
	{
	Spawn:
		HED2 A 10 A_Look
		Loop
	See:
		HED2 A 3 A_Chase
		Loop
	Pain:
		HED2 E 3
		HED2 E 3 A_Pain
		HED2 F 6
		Goto See
	Missile:
		HED2 BC 5 A_FaceTarget
		HED2 D 5 BRIGHT A_BasicAttack (8, "None", "CacolanternBall", 32)
		Goto See
	Death:
		HED2 G 8 A_NoBlocking
		HED2 H 8 A_Scream
		HED2 IJK 8
		HED2 L -1 A_SetFloorClip
		Stop
	Raise:
		HED2 L 8 A_UnsetFloorClip
		HED2 KJIHG 8
		Goto See
	}
}

ACTOR CacolanternBall
{
	SpawnID 219
	Radius 6
	Height 8
	Speed 20
	Damage 5
	Projectile
	+RANDOMIZE
	RenderStyle Add
	SeeSound "caco/attack"
	DeathSound "caco/shotx"
	States
	{
	Spawn:
		BAL8 AB 4 BRIGHT
		Loop
	Death:
		BAL8 CDE 6 BRIGHT
		Stop
	}
}

//=================================================================================================
//
// Abaddon
//
//=================================================================================================

ACTOR Abaddon : Cacolantern 5015
{
	SpawnID 220
	Health 1200
	Speed 12
	PainChance 40
	Obituary "$OB_ABADDON"
	HitObituary "$OB_ABADDON_MELEE"
	States
	{
	Spawn:
		HED3 A 10 A_Look
		Loop
	See:
		HED3 A 3 A_Chase
		Loop
	Pain:
		HED3 E 3
		HED3 E 3 A_Pain
		HED3 F 6
		Goto See
	Missile:
		HED3 BC 5 A_FaceTarget
		HED3 D 5 BRIGHT A_BasicAttack (8, "None", "AbaddonBall", 32)
		HED3 BC 5 A_FaceTarget
		HED3 D 5 BRIGHT A_BasicAttack (8, "None", "AbaddonBall", 32)
		Goto See
	Death:
		HED3 G 8 A_NoBlocking
		HED3 H 8 A_Scream
		HED3 IJK 8
		HED3 L -1 A_SetFloorClip
		Stop
	Raise:
		HED3 L 8 A_UnSetFloorClip
		HED3 KJIHG 8
		Goto See
	}
}

ACTOR AbaddonBall
{
	SpawnID 221
	Radius 6
	Height 8
	Speed 20
	Damage 10
	Projectile
	+RANDOMIZE
	RenderStyle Add
	SeeSound "caco/attack"
	DeathSound "caco/shotx"
	States
	{
	Spawn:
		BAL3 AB 4 BRIGHT
		Loop
	Death:
		BAL3 CDE 6 BRIGHT
		Stop
	}
}

//=================================================================================================
//
// Belphegor
//
//=================================================================================================

ACTOR Belphegor : HellKnight 5008
{
	SpawnID 215
	Health 1500
	PainChance 25
	SeeSound "baron/sight"
	PainSound "baron/pain"
	DeathSound "baron/death"
	ActiveSound "baron/active"
	Obituary "$OB_BELPHEGOR"
	HitObituary "$OB_BELPHEGOR_MELEE"
	States
	{
	Spawn:
		BOS3 AB 10 A_Look
		Loop
	See:
		BOS3 AABBCCDD 3 A_Chase
		Loop
	Pain:
		BOS3 H 2
		BOS3 H 2 A_Pain
		Goto See
	Melee:
	Missile:
		BOS3 EF 6 A_FaceTarget
		BOS3 G 6 A_BasicAttack (10, "baron/melee", "BelphegorBall", 32)
		BOS3 EF 6 A_FaceTarget
		BOS3 G 6 A_BasicAttack (10, "baron/melee", "BelphegorBall", 32)
		BOS3 EF 6 A_FaceTarget
		BOS3 G 6 A_BasicAttack (10, "baron/melee", "BelphegorBall", 32)
		Goto See
	Death:
		BOS3 I 8
		BOS3 J 8 A_Scream
		BOS3 K 8
		BOS3 L 8 A_NoBlocking
		BOS3 MN 8
		BOS3 O -1 A_BossDeath
		Stop
	Raise:
		BOS3 ONMLKJI 8
		Goto See
	}
}

ACTOR BelphegorBall : BaronBall
{
	SpawnID 222
	Speed 20
}

//=================================================================================================
//
// BloodDemon
//
//=================================================================================================

ACTOR BloodDemon : Demon 5004
{
	SpawnID 156
	Health 300
	Obituary "$OB_BLOODDEMON_MELEE"
	States
	{
	Spawn:
		SRG2 AB 10 A_Look
		Loop
	See:
		SRG2 AABBCCDD 2 A_Chase
		Loop
	Pain:
		SRG2 H 2
		SRG2 H 2 A_Pain
		Goto See
	Melee:
		SRG2 EF 8 A_FaceTarget
		SRG2 G 8 A_SargAttack
		Goto See
	Death:
		SRG2 I 8
		SRG2 J 8 A_Scream
		SRG2 K 4
		SRG2 L 4 A_NoBlocking
		SRG2 M 4
		SRG2 N -1
		Stop
	Raise:
		SRG2 NMLKJI 5
		Goto See
	}
}

//=================================================================================================
//
// Hectebus
//
//=================================================================================================

ACTOR Hectebus : Fatso 5007
{
   SpawnID 158
   Health 1200
   PainChance 20
   Obituary "$OB_HECTEBUS"
   States
   {
   Spawn:
      HECT AB 15 A_Look
      Loop
   See:
      HECT AABBCCDDEEFF 4 A_Chase
      Loop
   Pain:
      HECT J 3
      HECT J 3 A_Pain
      Goto See
   Missile:
      //These Next 2 states replace A_FatRaise and A_HectRaise
      HECT G 0 A_PlaySound("fatso/raiseguns")
      HECT G 20 A_FaceTarget
      HECT H 0 A_CustomMissile("HectShot",28,0,0,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,5.625,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,11.25,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,16.875,1)
      HECT H 10 BRIGHT
      HECT IG 5 A_FaceTarget
      HECT H 0 A_CustomMissile("HectShot",28,0,0,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,-5.625,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,-11.25,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,-16.875,1)
      HECT H 10 BRIGHT
      HECT IG 5 A_FaceTarget
      HECT H 0 A_CustomMissile("HectShot",28,0,-11.25,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,-5.625,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,0,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,5.625,1)
      HECT H 0 A_CustomMissile("HectShot",28,0,11.25,1)
      HECT H 10 BRIGHT
      HECT IG 5 A_FaceTarget
      Goto See
   Death:
      HECT K 6
      HECT L 6 A_Scream
      HECT M 6 A_NoBlocking
      HECT NOPQRS 6
      HECT T -1
      Stop
   Raise:
      HECT RQPONMLK 5
      Goto See
   }
}

ACTOR HectShot : FatShot
{
   Speed 22
   Damage 12
   States
   {
   Spawn:
      HECF AB 4 BRIGHT
      Loop
   Death:
      HECF C 8 BRIGHT
      HECF D 6 BRIGHT
      HECF E 4 BRIGHT
      Stop
   }
}

//=================================================================================================
//
// SuperShotgunGuy
//
//=================================================================================================

ACTOR SuperShotgunGuy 5005
{
   Game Doom
   SpawnID 157
   Health 120
   Radius 20
   Height 56
   Mass 100
   Speed 8
   PainChance 170
   SeeSound "chainguy/sight"
   PainSound "chainguy/pain"
   DeathSound "chainguy/death"
   ActiveSound "chainguy/active"
   AttackSound "ssgguy/attack"
   MONSTER
   +FLOORCLIP
   Obituary "$OB_SSGGUY"
   DropItem "SuperShotgun"
   States
   {
      Spawn:
         GPOS AB 10 A_Look
         Loop
      See:
         GPOS AABBCCDD 4 A_Chase
         Loop
      Missile:
         GPOS E 10 A_FaceTarget
         GPOS F 8 Bright A_CustomBulletAttack(8, 7, 7, 5, "BulletPuff")
         GPOS E 8
         Goto See
      Pain:
         GPOS G 3
         GPOS G 3 A_Pain
         Goto See
      Death:
         GPOS H 5
         GPOS I 5 A_Scream
         GPOS J 5 A_NoBlocking
         GPOS KLM 5
         GPOS N -1
         Stop
      XDeath:
         GPOS O 5
         GPOS P 5 A_XScream
         GPOS Q 5 A_NoBlocking
         GPOS RS 5
         GPOS T -1
         Stop
      Raise:
         GPOS LKJIH 5
         Goto See
   }
}

//=================================================================================================
//
// Minigun
//
//=================================================================================================

ACTOR Minigun : Weapon 5014
{
	Game Doom
	Weapon.AmmoType "Clip" 
	Weapon.AmmoGive 20
	Weapon.AmmoUse 1
	Weapon.Selectionorder 700
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_MINIGUN"
	Obituary "$OB_MINIGUN"
	AttackSound "weapons/minigun"
	SpawnID 214
	Radius 20
	Height 16
	States
	{
	Spawn:
		MNGN A -1
		Loop
	Ready:
		MNGG A 1 A_WeaponReady
		Loop
	Deselect:
		MNGG A 1 A_Lower
		Loop
	Select: 
		MNGG A 1 A_Raise 
		Loop 
	Fire: 
		MNGG A 0 A_GunFlash
		MNGG A 2 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
		MNGG B 2 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
		MNGG A 2 A_ReFire
		MNGG B 2
		MNGG A 4
		MNGG B 4
		MNGG A 8
		MNGG B 8
		goto Ready 
	Flash: 
		MNGF A 3 BRIGHT A_Light1 
		MNGF B 3 BRIGHT A_Light0
		Stop 
	}
}

//=================================================================================================
//
// RailGun
//
//=================================================================================================

ACTOR RailGun : DoomWeapon 5012
{
	Game Doom
	SpawnID 164
	Radius 20
	Height 16
	Weapon.Selectionorder 100
	Weapon.AmmoUse 10
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Inventory.Pickupmessage "$PICKUP_RAILGUN"
	Obituary "$OB_RAILGUN"
	States
	{
	Ready:
		RLGG A 1 A_WeaponReady
		loop
	Deselect:
		RLGG A 1 A_Lower
		loop
	Select:
		RLGG A 1 A_Raise
		loop
	Fire:
		RLGG E 12 A_FireRailgun
		RLGG F 6 //A_CheckRailReload
		RLGG G 6
		RLGG H 6
		RLGG I 6
		RLGG J 6
		RLGG K 6
		RLGG L 6
		RLGG A 6
		RLGG M 0 A_ReFire
		goto Ready
	Flash:
		TNT1 A 5 bright A_Light1
		TNT1 A 5 bright A_Light2
		TNT1 A 0 bright A_Light0
		Goto LightDone
	Spawn:
		RAIL A -1
		stop
	}
}

//=================================================================================================
//
// BFG10K
//
//=================================================================================================

ACTOR BFG10K : DoomWeapon 5013
{
	Game Doom
	SpawnID 165
	Radius 20
	Height 20
	Weapon.Selectionorder 2800
	Weapon.AmmoUse 5
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Weapon.Kickback 100
	Inventory.Pickupmessage "$PICKUP_BFG10K"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOLMS
	States
	{
	Spawn:
		BFG2 A -1
		stop
	Ready:
		BG2G A 0 A_PlaySound ("weapons/bfg10kidle")
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		loop
	Deselect:
		BG2G E 1 A_Lower
		loop
	Select:
		BG2G E 1 A_Raise
		loop
	Fire:
		BG2G E 20 A_PlaySound ("weapons/bfg10kf")
		BG2G F 4
		BG2G G 1
		BG2G H 1
		BG2G I 1
		BG2G J 1
		goto Hold
	Hold:
		BG2G K 2 A_GunFlash
		BG2G L 2 A_FireBullets(0,0,1,0,"BFG10kShot")
		BG2G M 2
		BG2G N 0 A_ReFire
		BG2G O 35 A_PlaySound ("weapons/bfg10kcool")
		goto Ready
	Flash:
		TNT1 A 2 bright A_Light1
		TNT1 A 3 bright
		Goto LightDone
		stop
	}
}

//=================================================================================================
//
// BFG10K explosive shot
//
//=================================================================================================

ACTOR BFG10kShot
{
	Game Doom
	SpawnID 217
	Radius 11
	Height 8
	Speed 20
	Damage 160
	DamageType BFG10k
	+NOBLOCKMAP
	+NOGRAVITY
	+ACTIVATEIMPACT
	+ACTIVATEPCROSS
	+NOTELEPORT 
	+PUFFONACTORS
	+PUFFGETSOWNER
	+FORCERADIUSDMG
	Renderstyle Add
	Alpha 0.75
	SeeSound "weapons/bfg10kx"
	AttackSound "weapons/bfg10kx"
	Obituary "$OB_BFG10K"
	States
	{
	Spawn:
		BFE1 A 0 bright
		BFE1 A 3 bright A_Detonate
		BFE1 BCDEF 3 bright
		Stop
	}
}

//=================================================================================================
//
// GrenadeLauncher
//
//=================================================================================================

ACTOR GrenadeLauncher : DoomWeapon 5011
{
	Game Doom
	SpawnID 163
	Radius 20
	Height 16
	Weapon.Selectionorder 2500
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Weapon.AmmoUse 1
	Weapon.AmmoGive 2
	Weapon.AmmoType "RocketAmmo"
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_GRENADELAUNCHER"

	States
	{
	Spawn:
		GLAU A -1
		stop
	Ready:
		GRLG A 1 A_WeaponReady
		loop
	Deselect:
		GRLG A 1 A_Lower
		loop
	Select: 
		GRLG A 1 A_Raise
		loop
	Fire: 
		GRLG B 8 A_GunFlash
		GRLG B 12 A_FireCustomMissile ( "Grenade", 0, 1, 0, 0, 0, 6.328125 )
		GRLG B 0 A_ReFire
		goto Ready 
	Flash: 
		GRLF A	3 bright A_Light1
		GRLF B	4 bright
		GRLF C 4 bright A_Light2
		GRLF D 4 bright A_Light2
		Goto LightDone
	}
}

//=================================================================================================
//
// Red Armor
//
//=================================================================================================

ACTOR RedArmor : BasicArmorPickup 5040
{
	Game Doom
	SpawnID 168
	Radius 20
	Height 16
	Armor.Savepercent 66.66666
	Armor.Saveamount 200
	Inventory.Icon "ARM3A0"
	Inventory.Pickupmessage "$PICKUP_REDARMOR"
	DamageFactor "Fire", 0.125
	DamageFactor "Rocket", 0.125
	DamageFactor "Grenade", 0.125
	States
	{
	Spawn:
		ARM3 A 6
		ARM3 B 6 bright
		goto Spawn
	}
}

//=================================================================================================
//
// Max. armor bonus
//
//=================================================================================================

ACTOR MaxArmorBonus : BasicArmorBonus 5091
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 167
	Radius 20
	Height 16
	Inventory.Pickupmessage "$PICKUP_MAXARMORBONUS"
	Inventory.Icon "ARM1A0"
	Armor.Savepercent 33.33333
	Armor.Saveamount 1
	Armor.Maxsaveamount 200
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		BON4 ABCDCB 6
		loop
	}
}

ACTOR MaxHealthBonus : CustomInventory 5090
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 166
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.Amount 1
	Inventory.MaxAmount 50
	Health 200
	Inventory.PickupMessage "$PICKUP_MAXHEALTHBONUS"
	States
	{
	Spawn:
		BON3 ABCDCB 6
		Loop
	}
}