ACTOR ChainGunGuyClass : PlayerPawn
{
  Health 80
  Radius 20
  Height 56
  Mass 100
  Speed 0.35
  PainChance 170
  Player.MorphWeapon "ChainGuyGun"
  Player.WeaponSlot 1, ChainGuyGun
  Player.DisplayName "Chaingunner"
  Player.MaxHealth 80   
  Player.ViewHeight 41
  Player.SoundClass Brainless
  Player.JumpZ 10
 
  DamageFactor "MarineDamage", 0.85
  DamageFactor "BFGSplash", 0.85
  DamageFactor "MarineRLDamage", 0.85
  DamageFactor "CybRLDamage", 0.25
  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
  +NOPAIN
  -PICKUP
  +NOSKIN
  -FRIENDLY
  +NOTARGET
  states
  {
  Spawn:
    CPOS AB 10
    loop
  See:
    CPOS A 0 
	CPOS A 0 A_Jump (240,2)
	CPOS A 0 A_PlaySoundEx ("chainguy/active","body")	
    CPOS ABCD 4 
    Loop
  Missile:
    CPOS A 0 A_JumpIfInventory ("FHeat",90,"CantShot")
    CPOS E 2
    CPOS F 3 bright
    CPOS E 2
    CPOS F 3 bright
    CPOS E 7
	Goto See
  CantShot:
    CPOS E 30
    Goto See
  Death:
    CPOS H 0 ACS_ExecuteAlways(426,0,1)
    CPOS H 0 A_GiveToTarget ("MarineExp",3)
    CPOS H 5 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    CPOS I 5 A_PlaySoundEx ("chainguy/death","body")
    CPOS J 5 A_NoBlocking
    CPOS KLM 5
	TNT1 A 0 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
  DeathWait:
	CPOS N 2 A_CheckSight("Removecorpse")
    loop	
  XDeath:
    CPOS O 0 ACS_ExecuteAlways(426,0,1)
    CPOS O 0 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    CPOS O 5 A_GiveToTarget ("MarineExp",3)
    CPOS P 5 A_XScream
    CPOS Q 5 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
    CPOS RS 5  
  XDeathWait:	
    CPOS T 2 A_CheckSight("Removecorpse")
    loop
  Removecorpse:
	TNT1 A 0 Thing_Remove (0)
	stop	
  }
}

ACTOR ChainGuyGun : Weapon
{
  OBITUARY "%o was perforated by %k."
  ATTACKSOUND "weapons/shotgf"
  weapon.kickback 100
  Weapon.AmmoUse 0
  +WEAPON.NOALERT
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.CHEATNOTWEAPON
  +INVENTORY.UNDROPPABLE

  states
  {
  Spawn:
    TNT1 A 0 Thing_Remove (0)
    Stop
  Ready:
    CHGG A 5 A_WeaponReady	
    CHGG A 0 A_TakeInventory ("FHeat",2)
    TNT1 A 0 A_JumpIfInventory ("Mskull",0,4)
    CHGG A 5 A_WeaponReady	
    CHGG A 0 A_TakeInventory ("FHeat",2)
    TNT1 A 0 A_JumpIfInventory ("Mskull",3,1)
    Loop
	TNT1 A 0 HealThing(1)
	goto ready 
  DeSelect: 
    CHGG A 1 A_Lower
    Loop
  Select:
    CHGG A 1 A_Raise
	goto ready
  Fire:
    CHGG A 0 A_JumpIfInventory ("FHeat",90,"Overheat")
    CHGG A 0 A_GiveInventory ("FHeat",2)
    CHGG A 0 A_GunFlash
    CHGG A 2 ACS_ExecuteAlways(426,0,5)
    CHGG B 3 A_FireBullets (3.2, 1.8, -1, 6, "FBulletPuff")
    CHGG C 2
    CHGG D 3 A_FireBullets (3.2, 1.8, -1, 6, "FBulletPuff")
    CHGG A 0 A_Refire
    CHGG A 0 ACS_ExecuteAlways(426,0,1)
    goto Ready
  AltFire:
    CHGG A 5 ACS_ExecuteAlways (419,0,4)
	goto ready
  Overheat:
    CHGG A 0 ACS_ExecuteAlways(426,0,5)
    CHGG A 0 A_PlaySoundEx ("cybie/overheat","body")
    CHGG A 30 ACS_ExecuteAlways (408)
    CHGG A 0 A_TakeInventory ("FHeat",3)
    CHGG A 0 ACS_ExecuteAlways(426,0,1)
    goto ready
  Flash:
	CHGF A 2 bright A_Light1
	TNT1 A 3 A_Light2
	CHGF B 2 bright A_Light1
	TNT1 A 3 A_Light2
	CHGF A 0 A_Light0
    Stop
  }
}

ACTOR ChainGunGuy2Class : PlayerPawn
{
  Health 150
  Radius 20
  Height 56
  Mass 100
  Speed 0.30
  PainChance 170
  Player.MorphWeapon "DoubleChainGun"
  Player.WeaponSlot 1, DoubleChainGun
  Player.DisplayName "DoubleChaingunner"
  Player.MaxHealth 150  
  Player.ViewHeight 41
  Player.SoundClass Brainless
  Player.JumpZ 10
 
  DamageFactor "MarineDamage", 0.95
  DamageFactor "BFGSplash", 0.95
  DamageFactor "MarineRLDamage", 0.95
  DamageFactor "CybRLDamage", 0.25
  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
  +NOPAIN
  -PICKUP
  +NOSKIN
  -FRIENDLY
  +NOTARGET
  states
  {
  Spawn:
    DPOS AB 10
    loop
  See:
    DPOS A 0 
	DPOS A 0 A_Jump (240,2)
	DPOS A 0 A_PlaySoundEx ("chainguy/active","body")	
    DPOS ABCD 4 
    Loop
  Missile:
    DPOS A 0 A_JumpIfInventory ("FHeat",60,"CantShot")
    DPOS F 3 bright
    DPOS E 2
    DPOS F 3 bright
    DPOS E 2
    DPOS F 3 bright
    DPOS E 7
	Goto See
  CantShot:
    DPOS E 30
    Goto See
  Death:
    TNT1 A 0 A_GiveToTarget ("MarineExp",5)
    DPOS H 0 ACS_ExecuteAlways(426,0,4)
    DPOS H 0 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    DPOS H 5 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    DPOS I 5 A_PlaySoundEx ("chainguy/death","body")
    DPOS J 5 A_NoBlocking
    DPOS KLM 5
	TNT1 A 0 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
  DeathWait:
	DPOS N 1 A_CheckSight("Removecorpse")
    loop	
  XDeath:
    DPOS O 0 ACS_ExecuteAlways(426,0,4)
    DPOS O 0 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    DPOS O 0 A_SpawnItemEx ("MChainGun",0,0,random(29,38),0,0,0,0,32,0)
    DPOS O 5 A_GiveToTarget ("MarineExp",5)
    DPOS P 5 A_XScream
    DPOS Q 5 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
    DPOS RS 5  
  XDeathWait:	
    DPOS T 1 A_CheckSight("Removecorpse")
    loop
  Removecorpse:
	TNT1 A 0 Thing_Remove (0)
	stop	
  }
}

ACTOR DoubleChainGun : Weapon
{
  OBITUARY "%o was perforated by %k."
  ATTACKSOUND "weapons/shotgf"
  weapon.kickback 100
  Weapon.AmmoUse 0
  +WEAPON.NOALERT
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.CHEATNOTWEAPON
  +INVENTORY.UNDROPPABLE

  states
  {
  Spawn:
    TNT1 A 0 Thing_Remove (0)
    Stop
  Ready:
    DCGN A 5 A_WeaponReady	
    DCGN A 0 A_TakeInventory ("FHeat",2)
    TNT1 A 0 A_JumpIfInventory ("Mskull",0,4)
    DCGN A 5 A_WeaponReady	
    DCGN A 0 A_TakeInventory ("FHeat",2)
    TNT1 A 0 A_JumpIfInventory ("Mskull",3,1)
    Loop
	TNT1 A 0 HealThing(1)
	goto ready 
  DeSelect: 
    DCGN A 1 A_Lower
    Loop
  Select:
    DCGN A 1 A_Raise
    goto ready
  Fire:
    DCGN A 0 A_JumpIfInventory ("FHeat",65,"Overheat")
    DCGN A 0 ACS_ExecuteAlways(426,0,2)
    DCGN A 0 A_GiveInventory ("FHeat",2)
    DCGN A 0 A_GunFlash
    DCGN B 0 A_FireBullets (5.2, 1.8, -1, 5, "FBulletPuff")
    DCGN B 3 bright A_FireBullets (3.2, 1.8, -1, 5, "FBulletPuff")
    DCGN D 2
    DCGN C 0 A_FireBullets (5.2, 1.8, -1, 5, "FBulletPuff")
    DCGN C 3 bright A_FireBullets (3.2, 1.8, -1, 5, "FBulletPuff")
    DCGN A 2
    DCGN A 0 A_ReFire
    DCGN A 0 ACS_ExecuteAlways(426,0,4)
    goto Ready
  AltFire:
    DCGN A 5 ACS_ExecuteAlways (419,0,22)
	goto ready
  Overheat:
    DCGN A 0 ACS_ExecuteAlways(426,0,2)
    DCGN A 0 A_PlaySoundEx ("cybie/overheat","body")
    DCGN A 30 ACS_ExecuteAlways (408)
    DCGN A 0 A_TakeInventory ("FHeat",3)
    DCGN A 0 ACS_ExecuteAlways(426,0,4)
    goto ready
  Flash:
    TNT1 A 3 bright A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 3 bright A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 0 A_Light0
    Stop
  }
}