Actor DoomguyPlayer : PlayerPawn
{
  Player.DisplayName "Doomguy"
  Player.CrouchSprite "DGYC"
  Player.Face "DGY"
  BloodColor "Red"
  Player.StartItem " Pistol ", 1
  Player.StartItem " Fist ", 1
  Player.StartItem "DoomguyClass", 1
  Player.StartItem "Clip", 50
  Player.Soundclass "Doomguy"
  Player.JumpZ 9//Default is 8
   DamageFactor "PoisonCloud", 1.75
  DamageFactor "TimonsAxe", 0.75
  DamageFactor "Mace", 1.1
  DamageFactor "DragonClaw", 1.1
  +NOSKIN
   -DONTBLAST
  -THRUSPECIES
  Species "Player"
  Player.ColorRange 112, 127
  States
  {
  Spawn:
    DGUY A -1
    Loop
  See:
    DGUY ABCD 4 
    Loop
  Missile:
    DGUY E 12 
    Goto Spawn
  Melee:
    DGUY F 6 BRIGHT
    Goto Missile
  Pain:
    DGUY G 4 
    DGUY G 4 A_Pain
    Goto Spawn
  Burn:
    TNT1 A 0 A_PlaySound("*burndeath")
	DBRN ABCDE 5 Bright
	DBRN FFGHHIIJJK 3 Bright
	DBRN LMNOP 5 Bright
	DBRN QR 4 Bright
	DBRN STU 6
	DBRN V -1
	stop
  Death:
    DGUY H 10
    DGUY I 10 A_PlayerScream
    DGUY J 10 A_NoBlocking
    DGUY KLM 10
    DGUY N -1
    Stop
  XDeath:
    DGUY O 5
    DGUY P 5 A_XScream
    DGUY Q 5 A_NoBlocking
    DGUY RSTUV 5
    DGUY W -1
    Stop
  Death.ZorchPistol:
  Death.Zorch:
	DGUY G 0 A_Stop
	TNT1 A 0 A_PlaySoundEx("chex/zorch","soundslot5",0,0)
	DGUY G 3 A_SpawnItem("ZorchEffectSmall")
    DGUY G 3 A_SetTranslucent(0.9,0)
	DGUY G 0 A_PlayerScream
    DGUY G 3 A_SetTranslucent(0.8,0)
    DGUY G 0 A_NoBlocking
    DGUY G 3 A_SetTranslucent(0.7,0)
    DGUY G 3 A_SetTranslucent(0.6,0)
    DGUY G 3 A_SetTranslucent(0.5,0)
    DGUY G 3 A_SetTranslucent(0.4,0)
    DGUY G 3 A_SetTranslucent(0.3,0)
    DGUY G 3 A_SetTranslucent(0.2,0)
    DGUY G 3 A_SetTranslucent(0.1,0)
	ACLO E 1 A_SetTranslucent(1,0)
    ACLO E -1
    stop
  CoOpModeOn:
    TNT1 A 0
    TNT1 A 0 A_ChangeFlag("THRUSPECIES",1)
    TNT1 A 0 A_ChangeFlag("DONTBLAST",1)
    DGUY A 1
	goto See
  Death.DukeDamage:
    TNT1 A 0 A_Jump(218,"Death")
	TNT1 A 0 A_GiveToTarget("DukeDMTauntDoomguy",1)
	goto Death
  Death.DukeExplosive:
	TNT1 A 0 A_JumpIfHealthLower(-5,"DukeGibStart")
	goto Death.DukeDamage
  DukeGibStart:
	TNT1 A 0 A_UnsetSolid
	TNT1 A 0 A_PlaySound("duke/enemygib")
    TNT1 A 0 A_SpawnDebris("DukeGibs1")
    TNT1 A 0 A_SpawnDebris("DukeGibs2")
    TNT1 A 0 A_SpawnDebris("DukeGibs3")
    TNT1 A 0 A_SpawnDebris("DukeGibs4")
    TNT1 A 0 A_SpawnDebris("DukeGibs5")
    TNT1 A 0 A_SpawnDebris("DukeGibs6")
    TNT1 A 0 A_Jump(96,"XDeath")
	TNT1 A 0 A_GiveToTarget("DukeDMTauntDoomguy",1)
	goto XDeath
  Death.DukeIce:
    TNT1 A 0 A_Jump(218,"Ice")
    TNT1 A 0 A_GiveToTarget("DukeDMTauntDoomguy",1)
	goto Ice
  Ice:
  Death.HexenIce:
  Death.Ice:
    DGUY G 5 A_GenericFreezeDeath
    DGUY G 1 A_FreezeDeathChunks
    Wait
  }
}

actor DoomguyClass : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 1 }
actor VanillaDoom : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 1 }

ACTOR DoomBulletPuff : BulletPuff
{
  States
  {
  Spawn:
    DPFF A 4 bright
    DPFF B 4
  Melee:
    DPFF CD 4
    Stop
  }
}

ACTOR DoomBulletPuff2 : DoomBulletPuff { DamageType Pistol }

ACTOR DoomBullet : FastProjectile
{
   Damage (Random(1,3)*5)
   Radius 1
   Height 1
   Speed 300
   Projectile
   Renderstyle "Normal"
   Species "Player"
   +BLOODSPLATTER
   +THRUGHOST
   +THRUSPECIES
   +NOTIMEFREEZE
   Alpha 1.0
   Decal Bulletchip
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     TNT1 A 1 A_SpawnItem("DoomBulletPuff")
     stop
   XDeath:
     TNT1 A 1
	 stop
   }
}

ACTOR DoomBullet2 : FastProjectile
{
   Damage (Random(1,3)*5)
   Radius 1
   Height 1
   Speed 300
   Projectile
   DamageType "Pistol"
   Renderstyle "Normal"
   Species "Player"
   +BLOODSPLATTER
   +THRUSPECIES
   +NOTIMEFREEZE
   Alpha 1.0
   Decal Bulletchip
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     TNT1 A 1 A_SpawnItem("DoomBulletPuff2")
     stop
   XDeath:
     TNT1 A 1
	 stop
   }
}

ACTOR DoomPunchPuff : BulletPuff
{
  DamageType "Pistol"
  States
  {
  Spawn:
  Crash:
    TNT1 A 0 A_PlaySound("doomguy/wallpunch2")
    DPFF CD 4
    Stop
  Melee:
    TNT1 A 0 A_PlaySound("doomguy/punch")
    stop
  }
}

ACTOR DoomPunchPuff2 : BulletPuff
{
  DamageType "Pistol"
  States
  {
  Spawn:
  Crash:
    TNT1 A 0 A_PlaySound("doomguy/wallpunch")
    DPFF CD 4
	stop
  Melee:
    TNT1 A 0 A_PlaySound("doomguy/punch2")
    stop
  }
}

actor " Fist " : Weapon
{
  Weapon.SlotNumber 0
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  +INVENTORY.UNDROPPABLE
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +WEAPON.NOALERT
  Obituary "%k fisted %o with a pair of brass knuckles."
  States
  {
  Ready:
    DPUN A 1 A_WeaponReady
    loop
  Deselect:
    DPUN A 1 A_Lower
    loop
  Select: 
    DPUN A 1 A_Raise
    loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerChainsawBerserk",1,"FireBerserk")
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
	DPUN LBCD 1
	DPUN E 1 A_CustomPunch(random(1,10)*2,1,0,"DoomPunchPuff")//A_Punch
	DPUN FGHI 2
	DPUN JKL 1
    DPUN A 5 A_ReFire
    goto Ready
  FireBerserk:
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFireBerserk")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFireBerserk")
	DPUN LBCD 1
    DPUN E 1 A_CustomPunch(random(10,20)*12,1,0,"DoomPunchPuff2") // Technically should be random(2,20)*10, but oh well.
	DPUN FGHI 2
	DPUN JKL 1
    DPUN B 5 A_ReFire
    goto Ready
  VanillaFire:
	TNT1 A 0 A_JumpIfInventory("PowerChainsawBerserk",1,"VanillaFireBerserk")
    DPUN M 4
    DPUN N 4 A_CustomPunch(random(1,10)*2,1,0,"DoomPunchPuff")
    DPUN O 5
    DPUN N 4
    DPUN M 5 A_ReFire
    Goto Ready
  VanillaFireBerserk:
    DPUN M 4
    DPUN N 4 A_CustomPunch(random(10,20)*12,1,0,"DoomPunchPuff2")
    DPUN O 5
    DPUN N 4
    DPUN M 5 A_ReFire
    Goto Ready
  }
}

ACTOR " Chainsaw " : Chainsaw replaces Chainsaw
{
  Weapon.SlotNumber 1
  Weapon.SlotPriority 0
  Decal BulletChip
  Weapon.UpSound "doomguy/sawup"
  Weapon.ReadySound "doomguy/sawidle"
  DamageType "Chainsaw"
  +INVENTORY.UNDROPPABLE
  Obituary "%k massacred %o with the Chainsaw."
  States
  {
  Ready:
    DSAW CD 4 A_WeaponReady
    loop
  Deselect:
    DSAW C 1 A_Lower
    loop
  Select:
    DSAW C 1 A_Raise
    loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerChainsawBerserk",1,"FireBerserk")
    DSAW AB 4 A_Saw("doomguy/sawfull","doomguy/sawhit",2,"DoomBulletPuff") 
    DSAW B 0 A_ReFire
    goto Ready
  FireBerserk:
    DSAW AB 3 A_Saw("doomguy/sawfull","doomguy/sawhit",7,"DoomBulletPuff") 
    DSAW B 0 A_ReFire
    goto Ready
  Spawn:
    WSAW A -1
    stop
  }
}

Actor PowerChainsawBerserk : Powerup//PowerDamage
{
  +INVENTORY.HUBPOWER
  Powerup.Duration 0x7FFFFFFF
  //DamageFactor "Chainsaw", 10.0 // Yeah, that turned out to not work for some reason.
}

Actor " Pistol " : Pistol
{
  Decal BulletChip
  Weapon.SlotNumber 1  
  Weapon.SlotPriority 1
  Weapon.AmmoUse 0
  Weapon.AmmoGive 0
  Weapon.AmmoType ""
  +WEAPON.WIMPY_WEAPON
  +INVENTORY.UNDROPPABLE
  AttackSound "doomguy/pistol"
  DamageType Pistol
  Obituary "%k executed %o for insubordination."
  States
  {
  Ready:
    DPIS A 1 A_WeaponReady
    Loop
  Deselect:
    DPIS A 1 A_Lower
    Loop
  Select:
    DPIS A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    DPIS A 4
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
    TNT1 A 0 A_FireBullets (5.6, 0, 1, 5, "DoomBulletPuff2")
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS B 2 BRIGHT A_GunFlash
    DPIS C 1 BRIGHT
	DPIS CEEDDBB 1
    DPIS A 5 A_ReFire
    Goto Ready
  Hold:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
    DPIS A 4
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaHold")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaHold")
    TNT1 A 0 A_FireBullets (5.6, 0, -1, 5, "DoomBulletPuff2")
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS B 2 BRIGHT A_GunFlash
    DPIS C 1 BRIGHT
	DPIS CEEDDBB 1
    DPIS A 2 A_ReFire
	DPIS A 3 A_ClearRefire
    Goto Ready

  VanillaFire:
    //DPIS A 4
    TNT1 A 0 A_FireBullets (5.6, 0, 1, 5, "DoomBulletPuff2")
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS F 6 BRIGHT
    DPIS G 4
    DPIS H 5 A_ReFire
    Goto Ready
  VanillaHold:
    //DPIS A 4
    TNT1 A 0 A_FireBullets (5.6, 0, -1, 5, "DoomBulletPuff2")
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS F 6 BRIGHT
    DPIS G 4
    DPIS H 5 A_ReFire
    Goto Ready


  CoopFire:
    DPIS A 4
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopFire")
    TNT1 A 0 A_FireCustomMissile("DoomBullet2",0,1,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS B 2 BRIGHT A_GunFlash
    DPIS C 1 BRIGHT
	DPIS CEEDDBB 1
    DPIS A 5 A_ReFire
    Goto Ready
  CoopHold:
    DPIS A 4
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopHold")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopHold")
    TNT1 A 0 A_FireCustomMissile("DoomBullet2",random(-5.6,5.6),1,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS B 2 BRIGHT A_GunFlash
    DPIS C 1 BRIGHT
	DPIS CEEDDBB 1
    DPIS A 2 A_ReFire
	DPIS A 3 A_ClearRefire
    Goto Ready

  VanillaCoopFire:
    //DPIS A 4
    TNT1 A 0 A_FireCustomMissile("DoomBullet2",0,1,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS F 6 BRIGHT
    DPIS G 4
    DPIS H 5 A_ReFire
    Goto Ready
  VanillaCoopHold:
    //DPIS A 4
    TNT1 A 0 A_FireCustomMissile("DoomBullet2",random(-5.6,5.6),1,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
    DPIS F 6 BRIGHT
    DPIS G 4
    DPIS H 5 A_ReFire
    Goto Ready
	
  Flash:
	DPSF A 3 Bright A_Light1
	TNT1 A 2 A_Light1
	Goto LightDone
  Spawn:
    WPST A -1
    Stop
  }
}

ACTOR " Shotgun " : Shotgun
{
  Decal BulletChip
  Weapon.SlotNumber 2
  +THRUGHOST
  +INVENTORY.UNDROPPABLE
  Obituary "%k showed %o his boomstick."
  States
  {
  Ready:
    DSHT A 1 A_WeaponReady
    Loop
  Deselect:
    DSHT A 1 A_Lower
    Loop
  Select:
    DSHT A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    DSHT A 3
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
	TNT1 A 0 A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 A 0 A_FireBullets (5.6, 0, 7, 5, "DoomBulletPuff")
    TNT1 A 0 A_PlayWeaponSound("doomguy/shotgf")
    DSHT A 2 BRIGHT A_GunFlash
	DSHT A 5 BRIGHT A_ZoomFactor(1,ZOOM_INSTANT)
	DSHT BCDEE 1
	DSHT F 3
	DSHT G 3
	DSHT H 4
	DSHT G 3
	DSHT F 3
	DSHT EEDDCC 1
	DSHT B 3 A_Refire
    DSHT A 4 A_ReFire
    Goto Ready
  CoopFire:
    DSHT A 3
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopFire")
	TNT1 A 0 A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 AAAAAA 0 A_FireCustomMissile("DoomBullet",random(-5.6,5.6),0,0,0,1)
	TNT1 A 0 A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/shotgf")
    DSHT A 2 BRIGHT A_GunFlash
	DSHT A 5 BRIGHT A_ZoomFactor(1,ZOOM_INSTANT)
	DSHT BCDEE 1
	DSHT F 3
	DSHT G 3
	DSHT H 4
	DSHT G 4
	DSHT F 3
	DSHT EEDDC 1
	DSHT B 3 A_Refire
    DSHT A 4 A_ReFire
    Goto Ready
  VanillaFire:
    //DSHT A 3
	TNT1 A 0 //A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 A 0 A_FireBullets (5.6, 0, 7, 5, "DoomBulletPuff")
    TNT1 A 0 A_PlayWeaponSound("doomguy/shotgf")
    DSHT A 2 BRIGHT A_GunFlash
	DSHT A 5 //BRIGHT A_ZoomFactor(1,ZOOM_INSTANT)
    DSHT IJ 5
    DSHT K 4
    DSHT JI 5
    DSHT A 3
    DSHT A 7 A_ReFire
    Goto Ready
  VanillaCoopFire:
    //DSHT A 3
	//TNT1 A 0 A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 AAAAAA 0 A_FireCustomMissile("DoomBullet",random(-5.6,5.6),0,0,0,1)
	TNT1 A 0 A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,0,1)
    TNT1 A 0 A_PlayWeaponSound("doomguy/shotgf")
    DSHT A 2 BRIGHT A_GunFlash
	DSHT A 5 BRIGHT //A_ZoomFactor(1,ZOOM_INSTANT)
    DSHT IJ 5
    DSHT K 4
    DSHT JI 5
    DSHT A 3
    DSHT A 7 A_ReFire
    Goto Ready
  Flash:
    DSHF A 3 Bright A_Light1
    DSHF B 4 Bright A_Light2
    Goto LightDone
  Spawn:
    WSHT A -1
    Stop
  }
}

ACTOR "Super Shotgun" : SuperShotgun
{
  Decal BulletChip
  Weapon.SlotNumber 3
  +THRUGHOST
  +INVENTORY.UNDROPPABLE
  Obituary "%k smeared %o across the wall with the SSG."
  States
  {
  Ready:
    DSSG A 1 A_WeaponReady
    Loop
  Deselect:
    DSSG A 1 A_Lower
    Loop
  Select:
    DSSG A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    DSSG A 2
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
    DSSG A 1
	TNT1 A 0 A_ZoomFactor(0.985,ZOOM_INSTANT)
    TNT1 A 0 A_FireBullets (11.2, 7.1, 20, 5, "DoomBulletPuff")
    TNT1 A 0 A_PlayWeaponSound ("doomguy/sshotf")
    DSSG A 2 BRIGHT A_GunFlash
	DSSG A 4 BRIGHT A_ZoomFactor(1,ZOOM_INSTANT)
	DSSG A 3
	DSSG B 2
	DSSG C 3
	DSSG DE 4 A_CheckReload
	DSSG F 2 A_PlayWeaponSound("doomguy/sshoto")
	DSSG GHIJ 2
	DSSG K 3
	DSSG L 3 A_PlayWeaponSound("doomguy/sshotl")
	DSSG MNOP 2
	DSSG Q 1
	DSSG Q 1 A_PlayWeaponSound("doomguy/sshotc")
	DSSG RST 3 A_ReFire
	DSSG A 2 A_Refire
	goto Ready
  CoopFire:
    DSSG A 2
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopFire")
    DSSG A 1
	TNT1 A 0 A_ZoomFactor(0.985,ZOOM_INSTANT)
    TNT1 AAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("DoomBullet",random(-11.2,11.2),0,0,1,1,random(-7.1,7.1))//DSSG A 0 A_FireBullets (11.2, 7.1, 20, 5, "DoomBulletPuff")
	TNT1 A 0 A_FireCustomMissile("DoomBullet",random(-11.2,11.2),1,0,1,1,random(-7.1,7.1))//DSSG A 0 A_FireBullets (11.2, 7.1, 20, 5, "DoomBulletPuff")
    TNT1 A 0 A_PlayWeaponSound ("doomguy/sshotf")
    DSSG A 2 BRIGHT A_GunFlash
	DSSG A 4 BRIGHT A_ZoomFactor(1,ZOOM_INSTANT)
	DSSG A 3
	DSSG B 2
	DSSG C 3
	DSSG D 4 A_CheckReload
	DSSG E 4
	DSSG F 2 A_PlayWeaponSound("doomguy/sshoto")
	DSSG GHIJ 2
	DSSG K 3
	DSSG L 3 A_PlayWeaponSound("doomguy/sshotl")
	DSSG M 2 
	DSSG NOP 2
	DSSG Q 1
	DSSG Q 1 A_PlayWeaponSound("doomguy/sshotc")
	DSSG R 3 A_ReFire
	DSSG S 3 A_ReFire
	DSSG T 3 A_ReFire
	DSSG A 5 A_Refire
	goto Ready
	
	
  VanillaFire:
    DSSG A 1
	TNT1 A 0 //A_ZoomFactor(0.985,ZOOM_INSTANT)
    TNT1 A 0 A_FireBullets (11.2, 7.1, 20, 5, "DoomBulletPuff")
    TNT1 A 0 A_PlayWeaponSound ("doomguy/sshotf")
    DSSG A 2 BRIGHT A_GunFlash
	DSSG A 4 BRIGHT //A_ZoomFactor(1,ZOOM_INSTANT)
	DSSG A 1
    DSG2 B 7
    DSG2 C 7 A_CheckReload
    DSG2 D 7 A_PlayWeaponSound("doomguy/sshoto")
    DSG2 E 7
    DSG2 F 7 A_PlayWeaponSound("doomguy/sshotl")
    DSG2 G 6
	TNT1 A 0 A_PlayWeaponSound("doomguy/sshotc")
    DSG2 H 6 A_Refire
    DSSG A 5 A_ReFire
    Goto Ready
  VanillaCoopFire:
    DSSG A 1
	TNT1 A 0 //A_ZoomFactor(0.985,ZOOM_INSTANT)
    TNT1 AAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("DoomBullet",random(-11.2,11.2),0,0,1,1,random(-7.1,7.1))
	TNT1 A 0 A_FireCustomMissile("DoomBullet",random(-11.2,11.2),1,0,1,1,random(-7.1,7.1))
    TNT1 A 0 A_PlayWeaponSound ("doomguy/sshotf")
    DSSG A 2 BRIGHT A_GunFlash
	DSSG A 4 BRIGHT //A_ZoomFactor(1,ZOOM_INSTANT)
	DSSG A 1
    DSG2 B 7
    DSG2 C 7 A_CheckReload
    DSG2 D 7 A_PlayWeaponSound("doomguy/sshoto")
    DSG2 E 7
    DSG2 F 7 A_PlayWeaponSound("doomguy/sshotl")
    DSG2 G 6
	TNT1 A 0 A_PlayWeaponSound("doomguy/sshotc")
    DSG2 H 6 A_Refire
    DSSG A 5 A_ReFire
    Goto Ready
  Flash:
    DSSF A 3 Bright A_Light1
    DSSF B 3 Bright A_Light2
    Goto LightDone
  Spawn:
    WSSG A -1
    Stop
  }
}

ACTOR " Chaingun " : Chaingun
{
  Decal BulletChip
  Weapon.SlotNumber 4
  AttackSound "doomguy/pistol"
  +THRUGHOST
  +INVENTORY.UNDROPPABLE
  Obituary "%k mowed %o down with his Chaingun."
  States
   {
   Ready:
     DCHG N 1 A_WeaponReady
     Loop
   Deselect:
     DCHG N 1 A_Lower
     Loop
   Select:
     DCHG N 1 A_Raise
     Loop
   Fire:
	 TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	 TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
	 TNT1 A 0 A_GunFlash
     DCHG A 2 BRIGHT A_FireBullets (5.6, 0, 1, 5, "DoomBulletPuff")
	 DCHG B 2 BRIGHT
	 DCHG C 2 BRIGHT A_FireBullets (5.6, 0, 1, 5, "DoomBulletPuff")
	 DCHG D 2 BRIGHT
     DCHG N 1 A_ReFire
     Goto Ready
   Hold:
	 TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
	 TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaHold")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaHold")
	 TNT1 A 0 A_GunFlash
     DCHG A 2 BRIGHT A_FireBullets (5.6, 0, -1, 5, "DoomBulletPuff")
	 DCHG B 2 BRIGHT
	 DCHG C 2 BRIGHT A_FireBullets (5.6, 0, -1, 5, "DoomBulletPuff")
	 DCHG D 2 BRIGHT
     TNT1 A 0 A_ReFire
	 DCHG N 1 A_ClearRefire
     Goto Ready
	 
   VanillaFire:
     DCHG EF 4 BRIGHT A_FireBullets (5.6, 0, 1, 5, "DoomBulletPuff")
     DCHG N 1 A_ReFire
     Goto Ready
   VanillaHold:
     DCHG EF 4 BRIGHT A_FireBullets (5.6, 0, -1, 5, "DoomBulletPuff")
     DCHG N 0 A_ReFire
	 DCHG N 1 A_ClearRefire
     Goto Ready
	 

   CoopFire:
	 TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopFire")
	 TNT1 A 0 A_GunFlash
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
     DCHG A 2 BRIGHT A_FireCustomMissile("DoomBullet",0,1,0,1)
	 DCHG B 2 BRIGHT
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
	 DCHG C 2 BRIGHT A_FireCustomMissile("DoomBullet",0,1,0,1)
	 DCHG D 2 BRIGHT
     DCHG N 1 A_ReFire
     Goto Ready
   CoopHold:
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopHold")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopHold")
	 TNT1 A 0 A_GunFlash
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
     DCHG A 2 BRIGHT A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,1)
	 DCHG B 2 BRIGHT
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
	 DCHG C 2 BRIGHT A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,1)
	 DCHG D 2 BRIGHT
     TNT1 A 0 A_ReFire
	 DCHG N 1 A_ClearRefire
     Goto Ready
	 
   VanillaCoopFire:
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
     DCHG E 4 BRIGHT A_FireCustomMissile("DoomBullet",0,1,0,1)
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
	 DCHG F 4 BRIGHT A_FireCustomMissile("DoomBullet",0,1,0,1)
     DCHG N 1 A_ReFire
     Goto Ready
   VanillaCoopHold:
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
     DCHG E 4 BRIGHT A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,1)
	 TNT1 A 0 A_PlayWeaponSound("doomguy/pistol")
	 DCHG F 4 BRIGHT A_FireCustomMissile("DoomBullet",random(-5.6,5.6),1,0,1)
     DCHG N 0 A_ReFire
	 DCHG N 1 A_ClearRefire
     Goto Ready
	 
   Flash:
     TNT1 A 9 BRIGHT A_Light1
     Goto LightDone
   Spawn:
     WCGN A -1
     Stop
	}
}

Actor "Rocket Launcher" : RocketLauncher
{
  Weapon.SlotNumber 5
  +INVENTORY.UNDROPPABLE
  States
  {
  Ready:
    DMIS A 1 A_WeaponReady
    Loop
  Deselect:
    DMIS A 1 A_Lower
    Loop
  Select:
    DMIS A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaFire")
	DMIS A 2 
	DMIS A 4 BRIGHT A_GunFlash
	DMIS B 2 BRIGHT 
	DMIS D 3 BRIGHT A_FireCustomMissile("DoomRocket")
	DMIS C 3 BRIGHT
	DMIS BBEEFG 1
	DMIS A 0 A_ReFire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCoopFire")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCoopFire")
	DMIS A 2 
	DMIS A 4 BRIGHT A_GunFlash
	DMIS B 2 BRIGHT 
	DMIS D 3 BRIGHT A_FireCustomMissile("DoomRocket2")
	DMIS C 3 BRIGHT
	DMIS BBEEFG 1
	DMIS A 0 A_ReFire
    Goto Ready
	
  VanillaFire:
    DRKL A 3 BRIGHT A_Light1
	DRKL B 4 BRIGHT
	DRKL C 1 BRIGHT A_Light2
	DRKL C 3 BRIGHT A_FireCustomMissile("DoomRocket")
	DRKL D 4 BRIGHT
    DMIS B 5 A_Light0
    DMIS B 0 A_ReFire // 20 frames total
    Goto Ready
  VanillaCoopFire:
    DRKL A 3 BRIGHT A_Light1
	DRKL B 4 BRIGHT
	DRKL C 1 BRIGHT A_Light2
	DRKL C 3 BRIGHT A_FireCustomMissile("DoomRocket2")
	DRKL D 4 BRIGHT
    DMIS B 5 A_Light0
    DMIS B 0 A_ReFire
    Goto Ready
	
  Flash:
    DMSF A 3 BRIGHT A_Light1
    DMSF B 2 BRIGHT
	DMSF C 2 BRIGHT A_Light2
    DMSF DE 3 BRIGHT
    Goto LightDone
  Spawn:
    WDRL A -1
    Stop
  }
}

Actor DoomRocket : Rocket
{
  Decal Scorch
  SeeSound "doomguy/rocklf"
  DeathSound "doomguy/rocklx"
  -FIREDAMAGE
  Obituary "%k made %o ride the rocket."
  States
  {
  Spawn:
    DMSL A 1 Bright
    Loop
  Death:
    DMSL B 8 Bright A_Explode
    DMSL C 6 Bright
    DMSL D 4 Bright
    Stop
  }
}

Actor DoomRocket2 : DoomRocket { +THRUSPECIES Species "Player" }

Actor "Plasma Rifle" : PlasmaRifle
{
  Weapon.SlotNumber 6
  +INVENTORY.UNDROPPABLE
  States
  {
  Ready:
    DPLS A 1 A_WeaponReady
    Loop
  Deselect:
    DPLS A 1 A_Lower
    Loop
  Select:
    DPLS A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    DPLS A 0 A_GunFlash
	TNT1 A 0 A_Jump(258,"Fire1","Fire2")
  Fire1:
    DPLF A 3 BRIGHT A_FireCustomMissile("DoomPlasmaBall")
	TNT1 A 0 A_Refire
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
    DPLS B 1 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
	DPLS DEF 1
	DPLS GF 3
	DPLS EDCBA 2
    Goto Ready
  Fire2:
    DPLF B 3 BRIGHT A_FireCustomMissile("DoomPlasmaBall")
	TNT1 A 0 A_Refire
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
    DPLS B 1 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
	DPLS DEF 1
	DPLS GF 3
	DPLS EDCBA 2
    Goto Ready
  CoopFire:
    DPLS A 0 A_GunFlash
	TNT1 A 0 A_Jump(258,"CoopFire1","CoopFire2")
  CoopFire1:
    DPLF A 3 BRIGHT A_FireCustomMissile("DoomPlasmaBall2")
	TNT1 A 0 A_Refire
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
    DPLS B 1 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
	DPLS DEF 1 A_CheckReload
	DPLS GF 3
	DPLS EDCBA 2
	goto Ready
  CoopFire2:
    DPLF B 3 BRIGHT A_FireCustomMissile("DoomPlasmaBall2")
	TNT1 A 0 A_Refire
	TNT1 A 0 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
    DPLS B 1 A_JumpIfInventory("VanillaDoom",1,"VanillaCooldown")//A_JumpIf(ACS_ExecuteWithResult(219,0,0,0)==1,"VanillaCooldown")
	DPLS DEF 1
	DPLS GF 3
	DPLS EDCBA 2
    Goto Ready
  VanillaCooldown:
	DPLS H 20
	goto Ready
  Flash:
    TNT1 A 3 A_Light1
	goto Lightdone
  Spawn:
    WPLS A -1
    Stop
  }
}

Actor DoomPlasmaBall : PlasmaBall
{
  Decal DoomPlasmaScorch
  SeeSound "doomguy/plasmaf"
  DeathSound "doomguy/plasmax"
  Obituary "%k melted %o with the Plasma Rifle."
  States
  {
  Spawn:
    DPLM AB 6 bright
    loop
  Death:
    DPLE ABCDE 4 bright
    stop
  }
}

Actor DoomPlasmaBall2 : DoomPlasmaBall { +THRUSPECIES Species "Player" }

Actor "B.F.G. 9000" : BFG9000
{
  Weapon.SlotNumber 7
  DamageType "BFG"
  Obituary "%k showed %o you don't hide from the B.F.G. 9000."
  +INVENTORY.UNDROPPABLE
  States
  {
  Ready:
    DBFG A 1 A_WeaponReady
    loop
  Deselect:
    DBFG A 1 A_Lower
    loop
  Select:
    DBFG A 1 A_Raise
    loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    DBFG A 0 A_PlayWeaponSound("doomguy/bfgf")
	DBFG A 1 Offset(-1,33)
	DBFG A 1 Offset(0,33)
	DBFG A 1 Offset(1,33)
	DBFG A 1 Offset(0,32)
	DBFG A 1 Offset(-1,32)
	DBFG A 1 Offset(0,32)
	DBFG A 1 Offset(1,31)
	DBFG A 1 Offset(0,31)
	DBFG A 1 Offset(-1,31)
	DBFG A 1 Offset(0,30)
	DBFG A 10 Offset(0,30)
    DBFG B 10 BRIGHT A_GunFlash
	DSSG A 0 A_ZoomFactor(0.99,ZOOM_INSTANT)
    DBFG B 5 BRIGHT A_FireCustomMissile("DoomBFGBall")
	DBFG B 5 BRIGHT A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 A 0 A_ZoomFactor(1,ZOOM_INSTANT)
    DBFG C 20 A_ReFire
    goto Ready
  CoopFire:
    DBFG A 0 A_PlayWeaponSound("doomguy/bfgf")
	DBFG A 1 Offset(-1,33)
	DBFG A 1 Offset(0,33)
	DBFG A 1 Offset(1,33)
	DBFG A 1 Offset(0,32)
	DBFG A 1 Offset(-1,32)
	DBFG A 1 Offset(0,32)
	DBFG A 1 Offset(1,31)
	DBFG A 1 Offset(0,31)
	DBFG A 1 Offset(-1,31)
	DBFG A 1 Offset(0,30)
	DBFG A 10 Offset(0,30)
    DBFG B 10 BRIGHT A_GunFlash
	DSSG A 0 A_ZoomFactor(0.99,ZOOM_INSTANT)
    DBFG B 5 BRIGHT A_FireCustomMissile("DoomBFGBall2")
	DBFG B 5 BRIGHT A_ZoomFactor(0.995,ZOOM_INSTANT)
	TNT1 A 0 A_ZoomFactor(1,ZOOM_INSTANT)
    DBFG C 20 A_ReFire
    goto Ready
  Flash:
    DBFF A 10 bright A_Light1
    DBFF B 6 bright A_Light2
    Goto LightDone
  Spawn:
    WBFG A -1
    stop
  }
}

Actor DoomBFGBall : BFGBall
{
  DamageType "BFG"
  Decal BFGLightning
  +BRIGHT
  +DONTREFLECT
  DeathSound "doomguy/bfgx"
  Obituary "%k obliterated %o with the B.F.G. 9000."
  States
  {
  Spawn:
    DBFS AB 4 bright
    loop
  Death:
    DBFE AB 8 bright
    DBFE C 8 bright A_BFGSpray("DoomBFGSplash")
    DBFE DEF 8 bright
    stop
  }
}

Actor DoomBFGBall2 : DoomBFGBall { +THRUSPECIES Species "Player" }

Actor DoomBFGSplash
{
  +NOBLOCKMAP
  +CLIENTSIDEONLY
  +NOGRAVITY
  RenderStyle Add
  Alpha 0.75
  States
  {
  Spawn:
    DBFP ABCD 8 bright
    stop
  }
}