ACTOR ChexWarrior : PlayerPawn
{
   Player.DisplayName "ChexWarrior"
   Player.StartItem "Mini-Zorcher", 1
   Player.StartItem " Bootspoon ", 1
   Player.StartItem "ChexClass", 1
   Player.StartItem "Clip", 50
   Player.Face "CHX"
   Player.Soundclass "ChexWarrior"
   Player.JumpZ 9//Default is 8
   +NOSKIN
   +NOBLOOD
   +DONTGIB
   -DONTBLAST
   -THRUSPECIES
   Species "Player"
   DamageFactor "PoisonCloud", 1.65
   DamageFactor "TimonsAxe", 0.65
   DamageFactor "Mace", 0.9
   DamageFactor "DragonClaw", 0.9
   DamageFactor "Pistol", 0.8
   DamageFactor "ZorchPistol", 0.8
   DamageFactor "BFG", 0.8
   DamageFactor "BFGSpray", 0.8
   DamageFactor "Normal", 0.8
   DamageFactor "Zorch", 0.8
   DamageFactor "Ice", 0.8
   DamageFactor "Fire", 0.8
   DamageFactor "Slime", 0.8
   DamageFactor "Disintegrate", 0.8
   DamageFactor "Poison", 0.8
   DamageFactor "WolfenFlamethrower", 0.8
   DamageFactor "DukeDamage", 0.8
   DamageFactor "DukeExplosive", 0.8
   DamageFactor "MightyBoot", 0.8
   DamageFactor "DukeIce", 0.8
   RadiusDamageFactor 0.75
   Player.DamageScreenColor "Yellow"
   Player.ColorRange 192, 207
   States
  {
  Spawn:
    CHEX A 1
    Loop
  See:
    CHEX AAAABBBBCCCCDDDD 1
    Loop
  Missile:
    CHEX E 12 
    Goto Spawn
  Melee:
    CHEX F 6 BRIGHT
    Goto Missile
  Pain:
    CHEX G 4 
    CHEX G 4 A_Pain
    Goto Spawn
  Pain.Chickenator:
    CHEX G 1
	goto Spawn
  Death:
    CHEX H 10
    CHEX I 10 A_PlayerScream
    CHEX J 10 A_NoBlocking
    CHEX KLM 10
    CHEX N 20
	CHEX X -1
    Stop
  XDeath:
    CHEX O 5
    CHEX P 5 A_XScream
    CHEX Q 5 A_NoBlocking
    CHEX RSTUV 5
    CHEX W 20
	CHEX X -1
    Stop
  Death.ZorchPistol:
  Death.Zorch:
	CHEX G 0 A_Stop
	TNT1 A 0 A_PlaySoundEx("chex/zorch","soundslot5",0,0)
	CHEX G 3 A_SpawnItem("ZorchEffectSmall")
    CHEX G 3 A_SetTranslucent(0.9,0)
	CHEX G 0 A_PlayerScream
    CHEX G 3 A_SetTranslucent(0.8,0)
    CHEX G 0 A_NoBlocking
    CHEX G 3 A_SetTranslucent(0.7,0)
    CHEX G 3 A_SetTranslucent(0.6,0)
    CHEX G 3 A_SetTranslucent(0.5,0)
    CHEX G 3 A_SetTranslucent(0.4,0)
    CHEX G 3 A_SetTranslucent(0.3,0)
    CHEX G 3 A_SetTranslucent(0.2,0)
    CHEX 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)
    CHEX A 1
	goto See
  Death.DukeExplosive:
  Death.DukeDamage:
    TNT1 A 0 A_Jump(218,"Death")
	TNT1 A 0 A_GiveToTarget("DukeDMTaunt1",1)
	goto Death
  Death.DukeIce:
    TNT1 A 0 A_Jump(218,"Ice")
    TNT1 A 0 A_GiveToTarget("DukeDMTaunt1",1)
	goto Ice
  Ice:
  Death.HexenIce:
  Death.Ice:
    CHEX G 5 A_GenericFreezeDeath
    CHEX G 1 A_FreezeDeathChunks
    Wait
  }
}

actor ChexClass : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 1 }
actor ChexLAZSprayTime : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 1 }

ACTOR ChexPuff : BulletPuff
{
  +PUFFONACTORS
  +BLOODLESSIMPACT
  +CLIENTSIDEONLY
  DamageType "Zorch"
  RenderStyle Add
  Alpha 0.4
  Scale 0.22
  VSpeed 0
  States
  {
  Spawn:
    CMIS DCB 4 bright
	stop
  }
}

ACTOR ChexPuff2 : ChexPuff { DamageType "ZorchPistol" } // I never understood why you had to damagetype puffs on hitscan weapons.

ACTOR ChexBullet : FastProjectile
{
   Damage (Random(1,3)*5)
   Radius 1
   Height 1
   Speed 300
   Projectile
   Renderstyle "Normal"
   Species "Player"
   DamageType "Zorch"
   -BLOODSPLATTER
   +BLOODLESSIMPACT
   +THRUSPECIES
   +NOTIMEFREEZE
   Alpha 1.0
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     TNT1 A 1 A_SpawnItem("ChexPuff")
     stop
   }
}

ACTOR ChexBullet2 : FastProjectile
{
   Damage (Random(1,3)*5)
   Radius 1
   Height 1
   Speed 300
   Projectile
   Renderstyle "Normal"
   Species "Player"
   DamageType "ZorchPistol"
   -BLOODSPLATTER
   +BLOODLESSIMPACT
   +THRUSPECIES
   +NOTIMEFREEZE
   Alpha 1.0
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     TNT1 A 1 A_SpawnItem("ChexPuff")
     stop
   }
}

ACTOR ChexSpoonPuff : BulletPuff
{
  DamageType "ZorchPistol"
  RenderStyle Add
  -BLOODSPLATTER
  +BLOODLESSIMPACT
  +PUFFONACTORS
  Alpha 0.4
  Scale 0.22
  VSpeed 0
  States
  {
  Spawn:
  Melee:
    TNT1 A 0 A_PlaySound("chex/spoon")
    CMIS DCB 4 bright
    stop
  Crash:
    TNT1 A 0 A_PlaySound("chex/wallspoon")
    CMIS DCB 4 bright
    Stop
  }
}

actor " Bootspoon " : Weapon
{
  Weapon.SlotNumber 0
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +WEAPON.NOALERT
  +BLOODLESSIMPACT
  +INVENTORY.UNDROPPABLE
  Obituary "%k spooned %o back to home."
  States
  {
  Ready:
    CPUN A 1 A_WeaponReady
    loop
  Deselect:
    CPUN A 1 A_Lower
    loop
  Select: 
    CPUN A 1 A_Raise
    loop
  Fire:
    CPUN B 4
    CPUN C 4 A_CustomPunch(random(1,10)*2,1,0,"ChexSpoonPuff")
    CPUN D 5
    CPUN C 4
    CPUN B 5 A_ReFire
    goto Ready
  }
}

actor "Super Bootspork" : Weapon
{
  Weapon.Kickback 0
  Weapon.SelectionOrder 2200
  Weapon.SlotNumber 1
  Weapon.SlotPriority 0
  Inventory.PickUpSound "chex/weaponget"
  Weapon.UpSound "chex/sawup"
  Weapon.ReadySound "chex/sawidle"
  Inventory.PickupMessage "You got a Super Bootspork! Find some milk!"
  Obituary "%k thoroughly mixed %o with the Super Bootspork."
  +WEAPON.MELEEWEAPON
  +BLOODLESSIMPACT
  +INVENTORY.UNDROPPABLE
  DamageType "Zorch"
  States
  {
  Ready:
    SAWC CD 4 A_WeaponReady
    loop
  Deselect:
    SAWC C 1 A_Lower
    loop
  Select:
    SAWC C 1 A_Raise
    loop
  Fire:
    SAWC AB 4 A_Saw("chex/sawfull","chex/sawhit",0,"ChexPuff")
    SAWC B 0 A_ReFire
    goto Ready
  Spawn:
    CSPR A -1
    stop
  }
}

Actor "Mini-Zorcher" : Weapon
{
  Weapon.SelectionOrder 1900
  Weapon.SlotNumber 1
  Weapon.SlotPriority 1
  Inventory.PickUpSound "chex/weaponget"
  Obituary "%k zorched %o with his pea-blaster."
  Inventory.PickupMessage "You got the Mini-Zorcher!"
  Weapon.AmmoUse 0
  Weapon.AmmoGive 0
  +WEAPON.WIMPY_WEAPON
  +BLOODLESSIMPACT
  +PUFFONACTORS
  +INVENTORY.UNDROPPABLE
  DamageType "ZorchPistol"
  States
  {
  Ready:
    PISC A 1 A_WeaponReady
    Loop
  Deselect:
    PISC A 1 A_Lower
    Loop
  Select:
    PISC A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    PISC A 4
    PISC B 0 A_FireBullets (3, 0, 1, 5, "ChexPuff2")
    PISC B 0 A_PlayWeaponSound("chex/pistol")
    PISC B 6 A_GunFlash
    PISC C 4
    PISC D 5 A_ReFire
    Goto Ready
  CoopFire:
    PISC A 4
    PISC B 0 A_FireCustomMissile("ChexBullet2",0,0,0,1)
    PISC B 0 A_PlayWeaponSound("chex/pistol")
    PISC B 6 A_GunFlash
    PISC C 4
    PISC D 5 A_ReFire
    Goto Ready
  Hold:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
    PISC A 4
    PISC B 0 A_FireBullets (3, 0, -1, 5, "ChexPuff2")
    PISC B 0 A_PlayWeaponSound("chex/pistol")
    PISC B 6 A_GunFlash
    PISC C 4
	TNT1 A 0 A_ReFire
    PISC D 5 A_ClearRefire
    Goto Ready
  CoopHold:
    PISC A 4
    PISC B 0 A_FireCustomMissile("ChexBullet2",random(-3,3),0,0,1)
    PISC B 0 A_PlayWeaponSound("chex/pistol")
    PISC B 6 A_GunFlash
    PISC C 4
	TNT1 A 0 A_ReFire
    PISC D 5 A_ClearRefire
    Goto Ready
  Flash:
    CPIS A 7 Bright A_Light1
    Goto LightDone
    CPIS A 7 Bright A_Light0
    Goto LightDone
  Spawn:
    CIST A -1
    Stop
  }
}


Actor "Large Zorcher" : Weapon
{
  Weapon.SelectionOrder 1300
  Weapon.SlotNumber 2
  Inventory.PickUpSound "chex/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  +BLOODLESSIMPACT
  +PUFFONACTORS
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  DamageType "Zorch"
  Inventory.PickupMessage "You got the Large Zorcher!"
  Obituary "%k splayed %o with zorches all over."
  States
  {
  Ready:
    SHTC A 1 A_WeaponReady
    Loop
  Deselect:
    SHTC A 1 A_Lower
    Loop
  Select:
    SHTC A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    SHTC A 3
    SHTC A 0 A_FireBullets (4, 0, 7, 5, "ChexPuff")
    SHTC A 0 A_PlayWeaponSound ("chex/shotgf")
    SHTC A 6 A_GunFlash // 7
    SHTC BC 4 // 5
    SHTC D 4 // 4
    SHTC CB 4 // 5
    SHTC A 3 // 3
    SHTC A 5 A_ReFire // 7
    Goto Ready
  CoopFire:
    SHTC A 3
    SHTC A 0 A_FireCustomMissile("ChexBullet",random(-4,4),1,0,1)
    SHTC AAAAAA 0 A_FireCustomMissile("ChexBullet",random(-4,4),0,0,1)
    SHTC A 0 A_PlayWeaponSound ("chex/shotgf")
    SHTC A 6 A_GunFlash // 7
    SHTC BC 4 // 5
    SHTC D 4 // 4
    SHTC CB 4 // 5
    SHTC A 3 // 3
    SHTC A 5 A_ReFire // 7
    Goto Ready
  Flash:
    CSHT A 3 Bright A_Light1
    CSHT B 3 Bright A_Light2
    Goto LightDone
  Spawn:
    SHOC A -1
    Stop
  }
}


Actor "Super Large Zorcher" : Weapon
{
  Weapon.SelectionOrder 1500
  Weapon.SlotNumber 3
  Weapon.KickBack 30000000000
  Inventory.PickUpSound "chex/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  DamageType "Zorch"
  Inventory.PickupMessage "You got the Super Large Zorcher!"
  Obituary "%k pounded %o with super-kinetic zorches."
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfNoAmmo("Ready2")
    CSLZ ABCDEDCB 1 A_WeaponReady
    Loop
  Ready2:
	TNT1 A 0 A_JumpIfInventory("Shell",1,"FunReload")
    CSLZ T 1 A_WeaponReady
    Loop
  Deselect:
	TNT1 A 0 A_JumpIfNoAmmo("Deselect2")
    CSLZ ABCDEDCB 1 A_Lower
    Loop
  Deselect2:
    CSLZ T 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_JumpIfNoAmmo("Select2")
    CSLZ ABCDEDCB 1 A_Raise
    Loop
  Select2:
    CSLZ T 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"SPFire")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	CSLZ A 3
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltDM",0,0,10,5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltDM",0,0,10,-5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltDM",0,0,0,5)
    TNT1 A 0 A_PlayWeaponSound ("chex/slzorcher")
	TNT1 A 0 A_GunFlash
    CSLZ F 3 A_FireCustomMissile("SLZorcherBoltDM",0,1,0,-5)
    CSLZ GH 3
    CSLZ IJJJ 3
    CSLZ KLMM 3
	TNT1 A 0 A_PlaySound("chex/slzorchmagdown")
    CSLZ NNOOPPQRST 1
	TNT1 A 0 A_CheckReload
    CSLZ T 12
	goto FunReload
  SPFire:
	CSLZ A 3
    TNT1 A 0 A_FireCustomMissile("SLZorcherBolt",0,0,16,5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBolt",0,0,16,-5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBolt",0,0,5,5)
    TNT1 A 0 A_PlayWeaponSound ("chex/slzorcher")
	TNT1 A 0 A_GunFlash
    CSLZ F 3 A_FireCustomMissile("SLZorcherBolt",0,1,5,-5)
    CSLZ GH 3
    CSLZ IJJJ 3
    CSLZ KLMM 3
	TNT1 A 0 A_PlaySound("chex/slzorchmagdown")
    CSLZ NNOOPPQRST 1
	TNT1 A 0 A_CheckReload
    CSLZ T 12
	goto FunReload
  CoopFire:
	CSLZ A 3
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltCoop",0,0,16,5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltCoop",0,0,16,-5)
    TNT1 A 0 A_FireCustomMissile("SLZorcherBoltCoop",0,0,5,5)
    TNT1 A 0 A_PlayWeaponSound ("chex/slzorcher")
	TNT1 A 0 A_GunFlash
    CSLZ F 3 A_FireCustomMissile("SLZorcherBoltCoop",0,1,5,-5)
    CSLZ GH 3
    CSLZ IJJJ 3
    CSLZ KLMM 3
	TNT1 A 0 A_PlaySound("chex/slzorchmagdown")
    CSLZ NNOOPPQRST 1
	TNT1 A 0 A_CheckReload
    CSLZ T 12
	goto FunReload
  FunReload:
    CSLZ TSRQPP 1
	TNT1 A 0 A_PlaySound("chex/slzorchmagup")
	CSLZ ON 2
	CSLZ UVWX 1
	CSLZ YZ 3
	CSLZ A 4 A_Refire // Takes 78 frames to reload, 82 if fire isn't held.
    Goto Ready
  Flash:
    TNT1 A 2 Bright A_Light1
    TNT1 A 3 Bright A_Light2
    Goto LightDone
  Spawn:
    WSLZ A -1
    Stop
  }
}

Actor SLZorcherBolt
{
	Radius 15
	Height 10
	Speed 100
	Damage 8
	Scale 0.95
	Alpha 0.9
	PROJECTILE
	+HEXENBOUNCE
	-BLOODSPLATTER
	+NOBLOOD
	BounceCount 3
	RenderStyle Add
	DamageType "Zorch"
	SeeSound "chex/pistol"//"chex/slzorchbounce"
    DeathSound "chex/slzorchhit"
	States
	{
	Spawn:
		SLZR AB 1 BRIGHT A_CustomMissile("SLZorchBoltBlur",0,0,180)
		Loop
	Death:
		TNT1 A 0 //A_RadiusThrust(5000,32,0)
		SLZD ABCDEF 2 BRIGHT
		Stop
	}
}

Actor SLZorcherBoltDM : SLZorcherBolt
{
Damage 6
}

Actor SLZorcherBoltCoop : SLZorcherBolt
{
	+THRUSPECIES
	Species "Player"
}

Actor SLZorchBoltBlur
{
	Height 8
   	Radius 1
   	Damage 0
    Speed 0
   	RenderStyle Add
   	Alpha 0.7
   	Scale 0.7
	+CLIENTSIDEONLY
	+RANDOMIZE
   	+NOGRAVITY
   	+DROPOFF
   	States
   	{
   	Spawn:
      	SLZR A 2 BRIGHT A_FadeOut(0.1)
		SLZR B 2 BRIGHT A_FadeOut(0.1)
      	Loop
   	}
}

Actor "Rapid Zorcher" : Weapon
{
   Weapon.SelectionOrder 700
   Weapon.SlotNumber 4
   Inventory.PickUpSound "chex/weaponget"
   Weapon.AmmoUse 1
   Weapon.AmmoGive 20
   Weapon.AmmoType "Clip"
   +BLOODLESSIMPACT
   +PUFFONACTORS
   //+AMMO_OPTIONAL
   +INVENTORY.UNDROPPABLE
   DamageType "Zorch"
   Inventory.PickupMessage "You got the Rapid Zorcher!"
   Obituary "%k zorched %o full of neat holes."
   States
   {
   Ready:
     CHGC A 1 A_WeaponReady
     Loop
   Deselect:
     CHGC A 1 A_Lower
     Loop
   Select:
     CHGC A 1 A_Raise
     Loop
   Fire:
	 TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
     CHGC A 0 A_FireBullets (4, 0, 1, 5, "ChexPuff")
     CHGC A 0 A_PlayWeaponSound("chex/pistol")
     CHGC A 4 A_GunFlash
     CHGC B 0 A_FireBullets (4, 0, 1, 5, "ChexPuff")
     CHGC B 0 A_PlayWeaponSound("chex/pistol")
     CHGC B 4
     CHGC B 1 A_ReFire
     goto Ready
   CoopFire:
     CHGC A 0 A_FireCustomMissile("ChexBullet",0,1,0,1)
     CHGC A 0 A_PlayWeaponSound("chex/pistol")
     CHGC A 4 A_GunFlash
     CHGC B 0 A_FireCustomMissile("ChexBullet",0,1,0,1)
     CHGC B 0 A_PlayWeaponSound("chex/pistol")
     CHGC B 4
     CHGC B 1 A_ReFire
     goto Ready
   Hold:
	 TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
     CHGC A 0 A_FireBullets (4, 0, -1, 5, "ChexPuff")
     CHGC A 0 A_PlayWeaponSound("chex/pistol")
     CHGC A 4 A_GunFlash
     CHGC B 0 A_FireBullets (4, 0, -1, 5, "ChexPuff")
     CHGC B 0 A_PlayWeaponSound("chex/pistol")
     CHGC B 4
     CHGC B 1 A_ReFire
	 CHGC B 0 A_ClearRefire
     goto Ready
   CoopHold:
     CHGC A 0 A_FireCustomMissile("ChexBullet",random(-4,4),1,0,1)
     CHGC A 0 A_PlayWeaponSound("chex/pistol")
     CHGC A 4 A_GunFlash
     CHGC B 0 A_FireCustomMissile("ChexBullet",random(-4,4),1,0,1)
     CHGC B 0 A_PlayWeaponSound("chex/pistol")
     CHGC B 4
     CHGC B 1 A_ReFire
	 CHGC B 0 A_ClearRefire
     goto Ready
   Flash:
     CCHG A 4 bright A_Light1
     CCHG B 5 bright A_Light2
     CCHG A 0 bright A_Light0
     stop
   Spawn:
     MGUC A -1
     Stop
   }
}

Actor "Zorch Propulsor" : Weapon
{
  Weapon.SelectionOrder 2500
  Weapon.SlotNumber 5
  Inventory.PickUpSound "chex/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 2
  Weapon.AmmoType "RocketAmmo"
  +WEAPON.NOAUTOFIRE
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Inventory.PickupMessage "You got the Zorch Propulsor!"
  States
  {
  Ready:
    MISC A 1 A_WeaponReady
    Loop
  Deselect:
    MISC A 1 A_Lower
    Loop
  Select:
    MISC A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    MISC B 8 A_GunFlash
    MISC B 12 A_FireCustomMissile("ChexRocket")
    MISC B 0 A_ReFire
    Goto Ready
  CoopFire:
    MISC B 8 A_GunFlash
    MISC B 12 A_FireCustomMissile("ChexRocket2")
    MISC B 0 A_ReFire
    Goto Ready
  Flash:
    MCSF A 3 Bright A_Light1
    MCSF B 4 Bright
    MCSF CD 4 Bright A_Light2
    Goto LightDone
  Spawn:
    LAUC A -1
    Stop
  }
}

Actor ChexRocket
{
  Radius 11
  Height 8
  Speed 20
  Damage 20
  Projectile
  +RANDOMIZE
  +BLOODLESSIMPACT
  +BRIGHT
  SeeSound "chex/rocklf"
  DeathSound "chex/rocklx"
  Obituary "%k zorched %o with way more force than needed."
  DamageType "Zorch"
  States
  {
  Spawn:
    CMIS A 1 Bright
    Loop
  Death:
    CMIS B 8 Bright A_Explode(128,128,0)
    CMIS C 6 Bright
    CMIS D 4 Bright
    Stop
  }
}

Actor ChexRocket2 : ChexRocket { +THRUSPECIES Species "Player" }

Actor "Phasing Zorcher" : Weapon
{
  Weapon.SelectionOrder 100
  Weapon.SlotNumber 6
  Inventory.PickUpSound "chex/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 40
  Weapon.AmmoType "Cell"
  +INVENTORY.UNDROPPABLE
  Inventory.PickupMessage "You got the Phasing Zorcher!"
  States
  {
  Ready:
    PLSC A 1 A_WeaponReady
    Loop
  Deselect:
    PLSC A 1 A_Lower
    Loop
  Select:
    PLSC A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    PLSC A 0 A_GunFlash
	TNT1 A 0 A_Jump(256,"Fire1","Fire2")
  Fire1:
	CPLS A 2 BRIGHT A_FireCustomMissile("ChexPlasma")
    PLSC A 1
    PLSC B 20 A_ReFire
    Goto Ready
  Fire2:
	CPLS B 2 BRIGHT A_FireCustomMissile("ChexPlasma")
    PLSC A 1
    PLSC B 20 A_ReFire
    Goto Ready
  CoopFire:
    PLSC A 0 A_GunFlash
	TNT1 A 0 A_Jump(256,"CoopFire1","CoopFire2")
  CoopFire1:
	CPLS A 2 BRIGHT A_FireCustomMissile("ChexPlasma2")
    PLSC A 1
    PLSC B 20 A_ReFire
    Goto Ready
  CoopFire2:
	CPLS B 2 BRIGHT A_FireCustomMissile("ChexPlasma2")
    PLSC A 1
    PLSC B 20 A_ReFire
    Goto Ready
  Flash:
    TNT1 A 3 A_Light1
    //CPLS A 4 Bright A_Light1
    //CPLS B 4 Bright A_Light1
    Goto LightDone
  Spawn:
    PLAC A -1
    Stop
  }
}

Actor ChexPlasma
{
  Radius 13
  Height 8
  Speed 25
  Damage 5
  Projectile
  +RANDOMIZE
  +BLOODLESSIMPACT
  +BRIGHT
  RenderStyle Add
  Alpha 0.75
  SeeSound "chex/plasmaf"
  DeathSound "chex/plasmax"
  Obituary "%k phased %o off of this planet."
  DamageType "Zorch"
  Decal ChexPlasmaScorch
  States
  {
  Spawn:
    CLSS AB 6 bright
    loop
  Death:
    CLSE ABCDE 4 bright
    stop
  }
}

Actor ChexPlasma2 : ChexPlasma { +THRUSPECIES Species "Player" }

Actor "LAZ Device" : Weapon
{
  DamageType "BFG"
  Weapon.SelectionOrder 2800
  Weapon.SlotNumber 7
  Inventory.PickUpSound "chex/weaponget"
  Weapon.AmmoUse 40
  Weapon.AmmoGive 40
  Weapon.AmmoType "Cell"
  +WEAPON.NOAUTOFIRE
  +BLOODLESSIMPACT
  +WEAPON.BFG
  +NOEXTREMEDEATH
  +INVENTORY.UNDROPPABLE
  Inventory.PickupMessage "You got the LAZ Device! Woot!"
  Obituary "%k showed %o you can always get LAZ'd."
  DamageType "Zorch"
  States
  {
  /*ChexLAZSprayAction:
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-45,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-42.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-40.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-38.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-36,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-33.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-31.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-29.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-27,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-24.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-22.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-20.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-18,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-15.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-13.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-11.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-9,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-6.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-4.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",-2.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",0,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",2.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",4.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",6.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",9,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",11.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",13.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",15.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",18,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",20.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",22.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",24.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",27,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",29.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",31.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",33.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",36,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",38.25,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",40.5,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",42.75,0)
	TNT1 A 0 A_FireCustomMissile("ChexLAZSpray",45,0)
	TNT1 A 0 A_TakeInventory("ChexLAZSprayTime",99)*/
  Ready:
	//TNT1 A 0 A_JumpIfInventory("ChexLAZSprayTime",1,"ChexLAZSprayAction")
    CFGG A 1 A_WeaponReady
    loop
  Deselect:
    CFGG A 1 A_Lower
    loop
  Select:
    CFGG A 1 A_Raise
    loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
    CFGG A 20 A_PlayWeaponSound("chex/bfgf")
    CFGG B 10 A_GunFlash
    CFGG B 10 A_FireCustomMissile("ChexBFGBall")
    CFGG B 20 A_ReFire
    goto Ready
  CoopFire:
    CFGG A 20 A_PlayWeaponSound("chex/bfgf")
    CFGG B 10 A_GunFlash
    CFGG B 10 A_FireCustomMissile("ChexBFGBall2")
    CFGG B 20 A_ReFire
    goto Ready
  Flash:
    CFGF A 11 bright A_Light1
    CFGF B 6 bright A_Light2
    Goto LightDone
  Spawn:
    CFUG A -1
    stop
  }
}

actor ChexBFGBall
{
  DamageType "BFG"
  Radius 13
  Height 8
  Speed 25
  Damage 100
  RenderStyle Translucent
  Obituary "%o fell prey to %k's LAZ device."
  Alpha 0.75
  DeathSound "chex/bfgx"
  Projectile
  +RANDOMIZE
  +BRIGHT
  +BLOODLESSIMPACT
  +NOEXTREMEDEATH
  +DONTREFLECT
  DamageType "Zorch"
  States
  {
  Spawn:
    CFS1 AB 4 bright
    loop
  Death:
    CFE1 AB 8 bright
    CFE1 C 8 bright A_BFGSpray("ChexLAZPuff")//A_GiveToTarget("ChexLAZSprayTime")
    CFE1 DEF 8 bright
    stop
  }
}

Actor ChexBFGBall2 : ChexBFGBall { +THRUSPECIES Species "Player" }

actor ChexLAZPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +PUFFONACTORS
  +NOEXTREMEDEATH
  +CLIENTSIDEONLY
  RenderStyle Add
  Alpha 0.75
  DamageType "Zorch"
  States
  {
  Spawn:
    CFE2 ABCD 8 bright
    stop
  }
}