ACTOR CorvusPlayer : PlayerPawn
{
  Player.DisplayName "Corvus"
  Player.StartItem "Elven Wand", 1
  Player.StartItem " Staff ", 1
  Player.StartItem "CorvusClass", 1
  Player.StartItem "Clip", 50
  Player.Face "CRV"
  Player.Soundclass "CorvusPlayer"
  Player.JumpZ 9//Default is 8
  BloodColor "Red"
   DamageFactor "PoisonCloud", 1.75
  DamageFactor "TimonsAxe", 0.75
  DamageFactor "Mace", 1.1
  DamageFactor "DragonClaw", 1.1
  +NOSKIN
   -DONTBLAST
  -THRUSPECIES
  Species "Player"
  Translation "106:106=125:125"
  Player.ColorRange 112, 127

  States
  {
  Spawn:
    CORV A -1
    Stop
  See:
    CORV ABCD 4
    Loop
  Melee:
  Missile:
    CORV F 6 BRIGHT
    CORV E 12
    Goto Spawn
  Pain:
    CORV G 4
    CORV G 4 A_Pain
    Goto Spawn
  Death:
    CORV H 6
    CORV I 6 A_PlayerScream
    CORV JK 6
    CORV L 6 A_NoBlocking
    CORV MNO 6
    CORV P -1
    Stop
  XDeath:
    CORV Q 5 A_PlayerScream
	TNT1 A 0 A_SpawnItemEx("BloodySkull2",0,0,46,random(-1,1),random(-1,1),5)
    CORV R 5 A_NoBlocking
    CORV STUVWX 5
    CORV Y -1
    Stop
  Burn:
    FDTH A 5 BRIGHT A_PlaySound("*burndeath")
    FDTH B 4 BRIGHT
    FDTH C 5 BRIGHT
    FDTH D 4 BRIGHT
    FDTH E 5 BRIGHT
    FDTH F 4 BRIGHT
    FDTH G 5 BRIGHT
    FDTH H 4 BRIGHT
    FDTH I 5 BRIGHT
    FDTH J 4 BRIGHT
    FDTH K 5 BRIGHT
    FDTH L 4 BRIGHT
    FDTH M 5 BRIGHT
    FDTH N 4 BRIGHT
    FDTH O 5 BRIGHT A_NoBlocking
    FDTH P 4 BRIGHT
    FDTH Q 5 BRIGHT
    FDTH R 4 BRIGHT
    ACLO E -1
    stop
  Death.ZorchPistol:
  Death.Zorch:
	CORV G 0 A_Stop
	TNT1 A 0 A_PlaySoundEx("chex/zorch","soundslot5",0,0)
	CORV G 3 A_SpawnItem("ZorchEffectSmall")
    CORV G 3 A_SetTranslucent(0.9,0)
	CORV G 0 A_PlayerScream
    CORV G 3 A_SetTranslucent(0.8,0)
    CORV G 0 A_NoBlocking
    CORV G 3 A_SetTranslucent(0.7,0)
    CORV G 3 A_SetTranslucent(0.6,0)
    CORV G 3 A_SetTranslucent(0.5,0)
    CORV G 3 A_SetTranslucent(0.4,0)
    CORV G 3 A_SetTranslucent(0.3,0)
    CORV G 3 A_SetTranslucent(0.2,0)
    CORV 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)
    CORV A 1
	goto See
  Death.DukeDamage:
    TNT1 A 0 A_Jump(218,"Death")
	TNT1 A 0 A_GiveToTarget("DukeDMTaunt1",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("DukeDMTaunt1",1)
	goto XDeath
  Death.DukeIce:
    TNT1 A 0 A_Jump(218,"Ice")
    TNT1 A 0 A_GiveToTarget("DukeDMTaunt1",1)
	goto Ice
  Ice:
  Death.HexenIce:
  Death.Ice:
    CORV G 5 A_GenericFreezeDeath
    CORV G 1 A_FreezeDeathChunks
    Wait
  }
}

ACTOR BloodySkull2
{
 +CLIENTSIDEONLY
   Radius 4
  Height 4
  Gravity 0.25
  +NOBLOCKMAP
  +DROPOFF
  //+DOOMBOUNCE
  //+LOWGRAVITY
  +CANNOTPUSH
  -SKYEXPLODE
  +NOBLOCKMONST
  -SOLID
  +CLIENTSIDEONLY
  //BounceCount 4
  //BounceFactor 0.45
  States
  {
  Spawn:
    BSKL A 0
    BSKL ABCDE 5 A_CheckFloor("Death")
    Goto Spawn+1
  Death:
	TNT1 A 0 A_Stop
    BSKL F -1
    stop
  }
}

ACTOR ChickenPlayer2 : ChickenPlayer
{
  Health 100 // Previously 30
  ReactionTime 0
  PainChance 255
  Radius 8
  Height 12
  Speed 1
  Gravity 0.125
  +NOSKIN
  PainSound "chicken/pain"
  DeathSound "chicken/death"
  Player.JumpZ 1
  Player.Viewheight 21
  Player.ForwardMove 0.85, 0.9//1.22, 1.22
  Player.SideMove 0.85, 0.9//1.22, 1.22
  Player.SoundClass "Chicken"
  Player.DisplayName "Chicken"
  Player.MorphWeapon "Beak"
  -PICKUP
  States
  {
  Spawn:
    CHKN A -1
    Stop
  See:
    CHKN ABAB 3
    Loop
  Melee:
  Missile:
    CHKN C 12
    Goto Spawn
  Pain:
    CHKN D 4 A_Feathers
    CHKN C 4 A_Pain
    Goto Spawn
  Death:
    CHKN E 6 A_Scream
    CHKN F 6 A_Feathers
    CHKN G 6
    CHKN H 6 A_NoBlocking
    CHKN IJK 6
    CHKN L -1
    Stop
  Death.WolfenFlamethrower:
    CHKN E 0 A_Scream
    CHKN EEEEEEE 0 A_Feathers
	CHKN E 0 A_SpawnItem("WolfensteinChickenLeg")
	ACLO E -1
	stop
  }
}

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

ACTOR PortQuartzFlask : HealthPickup
{
	health 25
	inventory.maxamount 16
	inventory.icon "ARTIQRTZ"
	inventory.usesound "heretic/itemuse"
	+inventory.undroppable
	+inventory.hubpower
}

ACTOR PortTorch : PowerupGiver
{
  +FLOATBOB
  +INVENTORY.UNDROPPABLE
  +INVENTORY.PICKUPFLASH
  Inventory.MaxAmount 16
  Inventory.Icon ARTITRCH
  Inventory.UseSound "heretic/itemuse"
  Inventory.PickupMessage "You picked up a Torch!"
  Powerup.Type Torch
  States
  {
  Spawn:
    TRCH ABC 3 Bright
    Loop
  }
}

ACTOR PortRingInvuln : PowerupGiver
{
  +INVENTORY.UNDROPPABLE
  +inventory.hubpower
  Inventory.MaxAmount 16
  Inventory.Icon "ARTIINVU"
  Powerup.Type Invulnerable
  inventory.usesound "heretic/itemuse"
  Powerup.Color GoldMap
}

ACTOR PortSuperHealth : HealthPickup
{
  health 100
  inventory.maxamount 16
  inventory.icon "ARTISPHL"
  inventory.usesound "heretic/itemuse"
  +inventory.undroppable
  +inventory.hubpower
  HealthPickup.Autouse 2
}

actor PortGhostly : PowerupGiver
{
  inventory.maxamount 16
  inventory.usesound "heretic/itemuse"
  +inventory.undroppable
  +inventory.hubpower
  Inventory.Icon "ARTINVSI"
  Powerup.Type Ghost
}

/*actor PortTome : PowerupGiver
{
  inventory.maxamount 16
  inventory.usesound "heretic/itemuse"
  +INVBAR
  +inventory.undroppable
  +inventory.hubpower
  Inventory.Icon "ARTIPWBK"
  Powerup.Type HereticTome
}*/

actor PortTome : CustomInventory
{
  inventory.maxamount 16
  inventory.usesound "heretic/itemuse"
  +INVBAR
  +inventory.undroppable
  +inventory.hubpower
  Inventory.Icon "ARTIPWBK"
  States
  {
  Use:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"UseFail")
	TNT1 A 1
	TNT1 A 0 A_GiveInventory("PowerHereticTome",1)
	TNT1 A 0 A_GiveInventory("PowerGreaterTome",1)
	TNT1 A 0 A_GiveInventory("PowerTomeProtection",1)
	stop
  UseFail:
    TNT1 A 1
	fail
}
}

actor PortTomeCoOp : CustomInventory
{
  inventory.maxamount 1
  inventory.usesound "heretic/itemuse"
  +INVBAR
  +inventory.undroppable
  +inventory.hubpower
  Inventory.Icon "ARTIPWBK"
  States
  {
  Use:
	TNT1 A 0 A_JumpIfInventory("TomeOfPowerCooldown",1,"UseFail")
	TNT1 A 1
	TNT1 A 0 A_GiveInventory("PowerHereticTome",1)
	TNT1 A 0 A_GiveInventory("PowerGreaterTome",1)
	TNT1 A 0 A_GiveInventory("PowerTomeProtection",1)
	TNT1 A 0 ACS_ExecuteAlways(202)
	TNT1 A 0 A_GiveInventory("TomeOfPowerCooldown",250)
	fail
  UseFail:
    TNT1 A 1
	TNT1 A 0 A_Print("The Tome of Power has not cooled down yet.")
	fail
}
}

ACTOR PowerHereticTome : Powerup//PowerWeaponLevel2
{
  Powerup.Duration -90
  Inventory.Icon "SPINBK0"
  Powerup.Color Red, 0.1
}

ACTOR PowerHereticTomeDM : PowerHereticTome
{
  Powerup.Duration -60
}

Actor PowerGreaterTome : PowerDamage
{
  Powerup.Duration -90
  DamageFactor "Pistol", 1.5
  DamageFactor "Mace", 1.5
  DamageFactor "Normal", 1.5
  DamageFactor "DragonClaw", 1.5
  DamageFactor "Fire", 1.5
}

Actor PowerGreaterTomeDM : PowerGreaterTome
{
  Powerup.Duration -60
}

actor PowerTomeProtection : PowerProtection
{
Powerup.Duration -90
damagefactor "normal", 0.55
damagefactor "Pistol", 0.55
damagefactor "ZorchPistol", 0.55
damagefactor "TimonsAxe", 0.55
damagefactor "zorch", 0.55
damagefactor "fire", 0.55
damagefactor "ice", 0.55
damagefactor "slime", 0.55
damagefactor "bfg", 0.55
damagefactor "bfgspray", 0.55
damagefactor "disintegrate", 0.55
damagefactor "electric", 0.55
DamageFactor "BFG", 0.55
DamageFactor "BFGSpray", 0.55
DamageFactor "Poison", 0.55
DamageFactor "PoisonCloud", 0.55
DamageFactor "Mace", 0.55
DamageFactor "DragonClaw", 0.55
DamageFactor "WolfenFlamethrower", 0.55
DamageFactor "DukeDamage", 0.55
DamageFactor "DukeExplosive", 0.55
DamageFactor "MightyBoot", 0.55
DamageFactor "DukeIce", 0.55
}

actor PowerTomeProtectionDM : PowerTomeProtection
{
Powerup.Duration -60
}

Actor ArtiEgg2 : ArtiEgg
{
  +INVENTORY.UNDROPPABLE
  Inventory.MaxAmount 16
  States
  {
  Use:
    TNT1 A 0 A_FireCustomMissile("EggFX2", -15, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", -7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 0, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 15, 0, 0, 0, 1)
    Stop
  }
}

Actor ArtiEgg3 : ArtiEgg
{
  +INVENTORY.UNDROPPABLE
  Inventory.MaxAmount 16
  States
  {
  Use:
    TNT1 A 0 A_FireCustomMissile("EggFX3", -15, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX3", -7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX3", 0, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX3", 7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX3", 15, 0, 0, 0, 1)
    Stop
  }
}

ACTOR EggFX2 : MorphProjectile // Yeah, no more griefing co-op allies.
{
  Radius 8
  Height 8
  Speed 18
  Damage (1)
  DamageType "Chickenator"
  MorphProjectile.MonsterClass "Chicken2"
  MorphProjectile.MorphStyle MRF_FULLHEALTH
  States
  {
  Spawn:
    EGGM ABCDE 4
    Loop
  Death:
    FX01 FFGH 3 Bright
    Stop
  }
}

ACTOR EggFX3 : MorphProjectile // This, however, still works funderfully in DM.
{
  Radius 8
  Height 8
  Speed 18
  Damage (1)
  MorphProjectile.Duration 350 // 35 * 10 = 350
  DamageType "Chickenator"
  MorphProjectile.PlayerClass "ChickenPlayer2"
  MorphProjectile.MonsterClass "Chicken2"
  //MorphProjectile.MorphStyle MRF_FULLHEALTH
  States
  {
  Spawn:
    EGGM ABCDE 4
    Loop
  Death:
    FX01 FFGH 3 Bright
    Stop
  }
}

ACTOR Chicken2 : Chicken replaces Chicken
{
  States
  {
   Death:
     TNT1 A 0 A_GiveToTarget("KillCount",1)
     goto "Super::Death"
Death.ZorchPistol:
  Death.Zorch:
     TNT1 A 0 A_GiveToTarget("KillCount",1)
	CHKN D 0 A_Stop
	TNT1 A 0 A_PlaySoundEx("chex/zorchsmall","soundslot5",0,0)
	CHKN D 3 A_SpawnItem("ZorchEffectSuperTiny")
    CHKN D 3 A_SetTranslucent(0.9,0)
	CHKN DD 0 A_Feathers
	CHKN D 0 A_Scream
    CHKN D 3 A_SetTranslucent(0.8,0)
    TNT1 D 0 A_NoBlocking
    CHKN D 3 A_SetTranslucent(0.7,0)
    CHKN D 3 A_SetTranslucent(0.6,0)
    CHKN D 3 A_SetTranslucent(0.5,0)
    CHKN D 3 A_SetTranslucent(0.4,0)
    CHKN D 3 A_SetTranslucent(0.3,0)
    CHKN D 3 A_SetTranslucent(0.2,0)
    CHKN D 3 A_SetTranslucent(0.1,0)
	TNT1 A 1 A_SetTranslucent(1,0)
    TNT1 A -1
    stop
Ice:
Freeze:
Death.Ice:
    TNT1 A 0 A_GiveToTarget("KillCount",1)
	TNT1 A 0 A_NoBlocking
	CHKN D 0 A_UnsetSolid
    CHKN D 70 A_GenericFreezeDeath
    CHKN D 0 A_IceGuyDie
    CHKN D 1 A_IceGuyDie
	TNT1 A -1
	stop
  Death.WolfenFlamethrower:
    CHKN E 0 A_Scream
	CHKN E 0 A_GiveToTarget("KillCount",1)
    CHKN EEEEEEE 0 A_Feathers
	CHKN E 0 A_SpawnItem("WolfensteinChickenLeg")
	ACLO E -1
	stop
  }
}

ACTOR PowerHereticTomeCoOp : Powerup//PowerWeaponLevel2
{
  Powerup.Duration -120
  Inventory.Icon "SPINBK0"
  Powerup.Color Red, 0.1
}

actor TomeOfPowerCooldown : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 360 }

ACTOR StaffPuff3 : StaffPuff
{
  DamageType "Pistol"
  SeeSound "heretic/staffhit"
  States
  {
  Spawn:
  Crash:
  Melee:
    TNT1 A 0 A_PlaySound("heretic/staffhit")
    PUF3 A 4 BRIGHT
    PUF3 BCD 4
    Stop
  }
}

ACTOR StaffPuff4 : StaffPuff2
{
  DamageType "Pistol"
  SeeSound "heretic/staffpowerhit"
  States
  {
  Spawn:
  Crash:
  Melee:
    TNT1 A 0 A_PlaySound("heretic/staffpowerhit")
    PUF4 ABCDEF 4 BRIGHT
    Stop
  }
}

ACTOR " Staff " : Weapon
{
  Weapon.SlotNumber 0
  Weapon.SelectionOrder 3800
  +THRUGHOST
  +WIMPY_WEAPON
  +MELEEWEAPON
  +NOALERT
  +STAFF2_KICKBACK
  +INVENTORY.UNDROPPABLE
  Obituary "%k spoke softly and gave %o the big stick."
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"Ready2")
    STFF A 1 A_WeaponReady
    Loop
  Ready2:
    TNT1 A 0 A_Jump(128,"Ready3")
    STFF A 0 A_PlayWeaponSound("heretic/staffcrackle")
  Ready3:
    STFF DEF 4 A_WeaponReady
    goto Ready
  Deselect:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"Deselect2")
    STFF A 1 A_Lower
    Loop
  Deselect2:
    STFF D 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"Select2")
    STFF A 1 A_Raise
    Loop
  Select2:
    STFF D 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    STFF B 6
    STFF C 8 A_CustomPunch(random(5,20),1,0,"StaffPuff3")//A_StaffAttack(random[StaffAttack](5, 20), "StaffPuff")
    STFF B 8 A_ReFire
    Goto Ready
  FireTomed:
    STFF G 6
    STFF H 8 A_CustomPunch(random(60,120),1,0,"StaffPuff4")//A_StaffAttack(random[StaffAttack](18, 81), "StaffPuff2")
    STFF G 8 A_ReFire
    Goto Ready2
  }
}

Actor "Gauntlets of the Necromancer" : Gauntlets
{
  Weapon.SlotNumber 1
  Weapon.SlotPriority 0
  +BLOODSPLATTER
  Weapon.SelectionOrder 2300
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +INVENTORY.UNDROPPABLE
  Weapon.Kickback 0
  Weapon.YAdjust 16
  Inventory.PickUpSound "heretic/weaponget"
  Weapon.UpSound "weapons/gauntletsactivate"
  Inventory.PickupMessage "You got the Gauntlets of the Necromancer!"
  Obituary "%k seized %o's soul in %p very body."

  States
  {
  Spawn:
    WGNT A -1
    Stop
  Ready:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"ReadyTome")
    GAUN A 1 A_WeaponReady
    Loop
  ReadyTome:
    GAUN GHI 4 A_WeaponReady
    goto Ready
  Deselect:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"DeselectTome")
    GAUN A 1 A_Lower
    Loop
  DeselectTome:
    GAUN G 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"SelectTome")
    GAUN A 1 A_Raise
    Loop
  SelectTome:
    GAUN G 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTome")
    GAUN B 4 A_PlayWeaponSound("weapons/gauntletsuse")
    GAUN C 4
  Hold:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"HoldTome")
    GAUN DEF 4 BRIGHT A_GauntletAttack(0)
    GAUN C 4 A_ReFire
    GAUN B 4 A_Light0
    Goto Ready
  FireTome:
    GAUN J 4 A_PlayWeaponSound("weapons/gauntletsuse")
    GAUN K 4
  HoldTome:
    GAUN LMN 4 BRIGHT A_GauntletAttack(1)
    GAUN K 4 A_ReFire
    GAUN J 4 A_Light0
    Goto Ready
	}
}

ACTOR "Elven Wand" : Weapon
{
  +BLOODSPLATTER
  +PUFFONACTORS
  +WEAPON.WIMPY_WEAPON
  +INVENTORY.UNDROPPABLE
  Inventory.PickUpSound "heretic/weaponget"
  Weapon.SelectionOrder 2000
  Weapon.SlotNumber 1
  Weapon.SlotPriority 1
  Inventory.PickupMessage "You got the Elven Wand!"
  Weapon.AmmoUse 0
  Weapon.AmmoGive 0
  Decal RailScorchLower
  Obituary "%k put an elven hex on %o."
  Weapon.YAdjust 5
  
  States
  {
  Ready:
    GWND A 1 A_WeaponReady
    Loop
  Deselect:
    GWND A 1 A_Lower
    Loop
  Select:
    GWND A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
    GWND C 0 A_FireBullets(5.6, 0, 1,random(2,4)+3, "GoldWandPuff3") // Previously random(1,8)+6
	GWND C 5 BRIGHT
    GWND D 3
    GWND D 0 A_ReFire
    Goto Ready
  Hold:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
    GWND C 0 A_FireBullets(5.6, 0, -1,random(2,4)+3, "GoldWandPuff3") // Previously random(1,8)+6
	GWND C 5 BRIGHT
    GWND D 3
    GWND D 0 A_ReFire
	GWND D 0 A_ClearRefire
    Goto Ready
  FireTomed:
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
	GWND C 0 A_FireCustomMissile("GoldWandFX4",5.625,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX4",2.8125,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX4",0,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX4",-2.8125,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX4",-5.625,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX3",5.6,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX3",-5.6,0,0,1)
    GWND C 4 BRIGHT
    GWND D 3
	GWND D 0 A_ClearRefire
    GWND D 0 A_ReFire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
    GWND C 0 A_FireCustomMissile("ElvenBullet",0,0,0,1)
	GWND C 5 BRIGHT
    GWND D 3
    GWND D 0 A_ReFire
	GWND D 0 A_ClearRefire
    Goto Ready
  CoopHold:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
    GWND C 0 A_FireCustomMissile("ElvenBullet",random(-5.6,5.6),0,0,1)
	GWND C 5 BRIGHT
    GWND D 3
    GWND D 0 A_ReFire
	GWND D 0 A_ClearRefire
    Goto Ready
  CoopFireTomed:
    GWND B 3 BRIGHT
	GWND C 0 A_PlayWeaponSound("heretic/wand")
	GWND C 0 A_FireCustomMissile("GoldWandFX42",5.625,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX42",2.8125,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX42",0,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX42",-2.8125,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX42",-5.625,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX32",5.6,0,0,1)
	GWND C 0 A_FireCustomMissile("GoldWandFX32",-5.6,0,0,1)
    GWND C 4 BRIGHT
    GWND D 3
    GWND D 0 A_ReFire
    Goto Ready
  }
}

ACTOR ElvenBullet : FastProjectile
{
   Damage (random(1,8)+6)
   Radius 1
   Height 1
   Speed 300
   Projectile
   Renderstyle "Normal"
   Species "Player"
   DamageType "Pistol"
   Decal RailScorchLower
   +BLOODSPLATTER
   +THRUSPECIES
   +NOTIMEFREEZE
   Alpha 1.0
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     TNT1 A 1 A_SpawnItem("GoldWandPuff3")
     stop
   }
}


ACTOR GoldWandPuff3 : GoldWandPuff1
{
  DamageType "Pistol"
+CLIENTSIDEONLY
}

ACTOR GoldWandPuff4 : GoldWandPuff2
{
  DamageType "Pistol"
+CLIENTSIDEONLY
}

ACTOR GoldWandFX3 : GoldWandFX2
{
  Decal HImpScorch
  DamageType "Pistol"
  Obituary "%k put an elven hex on %o."
}

ACTOR GoldWandFX32 : GoldWandFX3 { +THRUSPECIES Species "Player" }

ACTOR GoldWandFX4 : FastProjectile
{
   Damage (Random (2, 12))
   Radius 2
   Height 2
   Speed 300
   Projectile
   DamageType "Pistol"
   +BLOODSPLATTER
   +NOTIMEFREEZE
   Obituary "%k put an elven hex on %o."
   Decal RailScorchLower
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
   Crash:
     FX01 EFGH 3 BRIGHT
     Stop
   XDeath:
     TNT1 A 1
	 stop
   }
}

ACTOR GoldWandFX42 : GoldWandFX4 { +THRUSPECIES Species "Player" }

ACTOR " Firemace " : Mace
{
  Weapon.SelectionOrder 1400
  Inventory.PickUpSound "heretic/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive1 50
  Weapon.SlotNumber 2
  Weapon.YAdjust 16
  Weapon.AmmoType "Shell"
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Inventory.PickupMessage "You got the Firemace!"
  Obituary "%k pelted %o with balls of steel."
  
  States
  {
  Spawn:
    WMCE A -1
    Stop
  Ready:
    MACE A 1 A_WeaponReady
    Loop
  Deselect:
    MACE A 1 A_Lower
    Loop
  Select:
    MACE A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"SPFire")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    MACE B 4
  Hold:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"SPHold")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide1") // Has about an 89% chance to fire normal Mace balls.
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp1") // Has about an 11% chance to fire a larger ball up.
  DMFireBallsSideBySide1:
    MACE C 3 Offset(1,31) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide2
  DMFireLargeBallUp1:
    MACE C 3 Offset(1,32) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide2
	
  DMDecide2:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide2")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp2")
  DMFireBallsSideBySide2:
    MACE D 3 Offset(0,32) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide3
  DMFireLargeBallUp2:
    MACE D 3 Offset(1,30) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide3
	
  DMDecide3:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp3")
  DMFireBallsSideBySide3:
    MACE E 3 Offset(0,31) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide4
  DMFireLargeBallUp3:
    MACE E 3 Offset(-1,30) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide4
	
  DMDecide4:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide1") // Has about an 89% chance to fire normal Mace balls.
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp4") // Has about an 11% chance to fire a larger ball up.
  DMFireBallsSideBySide4:
    MACE F 3 Offset(1,31) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide5
  DMFireLargeBallUp4:
    MACE F 3 Offset(1,32) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide5
	
  DMDecide5:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide2")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp5")
  DMFireBallsSideBySide5:
    MACE C 3 Offset(1,31) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide6
  DMFireLargeBallUp5:
    MACE C 3 Offset(1,32) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide6
	
  DMDecide6:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp6")
  DMFireBallsSideBySide6:
    MACE D 3 Offset(0,32) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide7
  DMFireLargeBallUp6:
    MACE D 3 Offset(1,30) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide7
	
  DMDecide7:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp7")
  DMFireBallsSideBySide7:
    MACE E 3 Offset(0,31) A_FireCustomMissile("MaceFX12",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto DMDecide8
  DMFireLargeBallUp7:
    MACE E 3 Offset(-1,30) A_FireCustomMissile("MaceFX22",0,0,0,2,1,10)//A_FireMacePL1
	goto DMDecide8
	
  DMDecide8:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide4")
	TNT1 A 0 A_Jump(28,"DMFireLargeBallUp8")
  DMFireBallsSideBySide8:
    MACE F 3 Offset(-1,32) A_FireCustomMissile("MaceFX12",random(-5,5),1,0,0,1,2)//A_FireMacePL1
	MACE C 4 A_Refire
    MACE DEF 4 A_ClearRefire
	goto Ready
  DMFireLargeBallUp8:
    MACE F 3 Offset(1,30) A_FireCustomMissile("MaceFX22",0,1,0,2,1,10)//A_FireMacePL1
	MACE C 4 A_Refire
    MACE DEF 4 A_ClearRefire
	goto Ready
  //FUCK YOU CORVUS I USED TO THINK YOU WERE SO COOL
	
	
  SPFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    MACE B 4
  SPHold:
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
	MACE A 0 A_FireMacePL1
    MACE C 3 A_GiveInventory("Shell",1)
	MACE A 0 A_FireMacePL1
	MACE D 3 A_GiveInventory("Shell",1)
	MACE A 0 A_FireMacePL1
	MACE E 3 A_GiveInventory("Shell",1)
	MACE A 3 A_FireMacePL1
	MACE F 3 A_GiveInventory("Shell",1)
	MACE A 0 A_FireMacePL1
    MACE C 3 A_GiveInventory("Shell",1)
	MACE A 0 A_FireMacePL1
	MACE D 3 A_GiveInventory("Shell",1)
	MACE A 0 A_FireMacePL1
	MACE E 3 A_GiveInventory("Shell",1)
	MACE F 3 A_FireMacePL1
    MACE C 4 A_ReFire
    MACE DEF 4 A_ClearRefire
    Goto Ready
	
 //AND NOW GODDAMN AGAIN FOR CO-OP
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    MACE B 4
  CoopHold:
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide1")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp1")
  FireBallsSideBySide1:
    MACE C 3 Offset(1,31) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide2
  FireLargeBallUp1:
    MACE C 3 Offset(1,32) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide2
	
  CoopDecide2:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide2")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp2")
  FireBallsSideBySide2:
    MACE D 3 Offset(0,32) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide3
  FireLargeBallUp2:
    MACE D 3 Offset(1,30) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide3
	
  CoopDecide3:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp3")
  FireBallsSideBySide3:
    MACE E 3 Offset(0,31) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide4
  FireLargeBallUp3:
    MACE E 3 Offset(-1,30) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide4
	
  CoopDecide4:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp4")
  FireBallsSideBySide4:
    MACE F 3 Offset(0,31) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide5
  FireLargeBallUp4:
    MACE F 3 Offset(-1,30) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide5
	
  CoopDecide5:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide1")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp5")
  FireBallsSideBySide5:
    MACE C 3 Offset(0,32) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide6
  FireLargeBallUp5:
    MACE C 3 Offset(1,30) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide6
	
  CoopDecide6:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide2")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp6")
  FireBallsSideBySide6:
    MACE D 3 Offset(0,31) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide7
  FireLargeBallUp6:
    MACE D 3 Offset(-1,32) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide7
	
  CoopDecide7:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide3")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp7")
  FireBallsSideBySide7:
    MACE E 3 Offset(0,31) A_FireCustomMissile("MaceFX1Coop",random(-5,5),0,0,0,1,2)//A_FireMacePL1
	goto CoopDecide8
  FireLargeBallUp7:
    MACE E 3 Offset(-1,33) A_FireCustomMissile("MaceFX2Coop",0,0,0,2,1,10)//A_FireMacePL1
	goto CoopDecide8
	
  CoopDecide8:
	//TNT1 A 0 A_Jump(227,"FireBallsSideBySide4")
	TNT1 A 0 A_Jump(28,"FireLargeBallUp8")
  FireBallsSideBySide8:
    MACE F 3 Offset(-1,32) A_FireCustomMissile("MaceFX1Coop",random(-5,5),1,0,0,1,2)//A_FireMacePL1
	MACE C 4 A_Refire
    MACE DEF 4 A_ClearRefire
	goto Ready
  FireLargeBallUp8:
    MACE F 3 Offset(1,31) A_FireCustomMissile("MaceFX2Coop",0,1,0,2,1,10)//A_FireMacePL1
	MACE C 4 A_Refire
    MACE DEF 4 A_ClearRefire
	goto Ready
  //Yeah, fuck that.
	
	
  Finish:
	MACE CDEF 4 A_ClearRefire
	goto Ready
  FireTomed:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFireTomed")
    MACE B 4
	MACE D 0 A_PlayWeaponSound("weapons/maceshoot")
    MACE D 0 A_FireCustomMissile("MaceFX42")
	MACE D 0 A_TakeInventory("Shell",4)
	MACE D 4//A_FireMacePL2
    MACE B 4
    MACE A 4 A_ReFire
	MACE A 4 A_ClearRefire
    Goto Ready
  CoopFireTomed:
    MACE B 4
	MACE D 0 A_PlayWeaponSound("weapons/maceshoot")
    MACE D 0 A_FireCustomMissile("MaceFX43")
	MACE D 0 A_TakeInventory("Shell",4)
	MACE D 4//A_FireMacePL2
    MACE B 4
    MACE A 4 A_ReFire
	MACE A 4 A_ClearRefire
    Goto Ready
  }
}

Actor MaceFX12 : MaceFX1 replaces MaceFX1
{
  DamageType "Mace"
  Damage 2 // Originally 2
  Decal BaronScorch
  //+STRIFEDAMAGE
  Obituary "%k pelted %o with balls of steel."
}

Actor MaceFX1Coop : MaceFX12
{
  -NOGRAVITY
  +THRUSPECIES
  Gravity 0.125
  VSpeed 0.5
  Species "Player"
}

Actor MaceFX22 : MaceFX2 replaces MaceFX2
{
  DamageType "Mace"
  Damage 4 // Originally 6
  SeeSound "weapons/maceshoot"
  Decal BaronScorch
  //+STRIFEDAMAGE
  Obituary "%k pelted %o with balls of steel."
}

Actor MaceFX2Coop : MaceFX22
{
  -NOGRAVITY
  +THRUSPECIES
  Gravity 0.125
  VSpeed 0.5
  Species "Player"
}

Actor MaceFX32 : MaceFX3 replaces MaceFX3
{
  DamageType "Mace"
  Damage 3 // Originally 4
  Decal BaronScorch
  //+STRIFEDAMAGE
  Obituary "%k pelted %o with balls of steel."
}

Actor MaceFX42 : MaceFX4 replaces MaceFX4
{
  DamageType "Mace"
  Decal BFGScorch
  +FOILINVUL
  Obituary "%k crushed %o with giant balls."
}

Actor MaceFX43 : MaceFX42 { +THRUSPECIES Species "Player" }

ACTOR "Ethereal Crossbow" : Weapon
{
  Weapon.SelectionOrder 800
  Inventory.PickUpSound "heretic/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 10
  Weapon.AmmoType "Shell"
  Weapon.SlotNumber 3
  Weapon.YAdjust 16
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Inventory.PickupMessage "You got the Ethereal Crossbow!"
  Obituary "%k turned %o into an ethereal pincushion."

  States
  {
  Spawn:
    WCBW A -1
    Stop
  Ready:
    CRBW AAAAAABBBBBBCCCCCC 1 A_WeaponReady
    Loop
  Deselect:
    CRBW A 1 A_Lower
    Loop
  Select:
    CRBW A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    CRBW A 0 A_FireCustomMissile("CrossbowFX1B",0,1)
	CRBW A 0 A_FireCustomMissile("CrossbowFX3B",4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX3B",-4.5,0)
	CRBW D 6
    CRBW EFGH 3
    CRBW AB 4
    CRBW C 5 A_ReFire
    Goto Ready
  FireTomed:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFireTomed")
    CRBW A 0 A_FireCustomMissile("CrossbowFX2B",0,1)
	CRBW A 0 A_FireCustomMissile("CrossbowFX2B",4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX2B",-4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX3B",9,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX3B",-9,0)
	CRBW D 5
    CRBW E 3
    CRBW F 2
    CRBW G 3
    CRBW H 2
    CRBW A 3
    CRBW B 3
    CRBW C 4 A_ReFire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    CRBW A 0 A_FireCustomMissile("CrossbowFX12",0,1)
	CRBW A 0 A_FireCustomMissile("CrossbowFX32",4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX32",-4.5,0)
	CRBW D 6
    CRBW EFGH 3
    CRBW AB 4
    CRBW C 5 A_ReFire
    Goto Ready
  CoopFireTomed:
    CRBW A 0 A_FireCustomMissile("CrossbowFX22",0,1)
	CRBW A 0 A_FireCustomMissile("CrossbowFX22",4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX22",-4.5,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX32",9,0)
	CRBW A 0 A_FireCustomMissile("CrossbowFX32",-9,0)
	CRBW D 5
    CRBW E 3
    CRBW F 2
    CRBW G 3
    CRBW H 2
    CRBW A 3
    CRBW B 3
    CRBW C 4 A_ReFire
    Goto Ready
  }
}

ACTOR CrossbowFX1B : CrossbowFX1
{
Damage 12 // Originally 10
Speed 40
Decal CrossbowScorch
}

ACTOR CrossbowFX3B : CrossbowFX3
{
Damage 3 // Originally 2
Speed 35
Decal CrossbowScorch2
}

ACTOR CrossbowFX2B : CrossbowFX2
{
Damage 8 // Originally 6
Speed 42
Decal CrossbowScorch2
}

ACTOR CrossbowFX5 : CrossbowFX4 replaces CrossbowFX4
{
+CLIENTSIDEONLY
Alpha 0.75
Gravity 0.095//Gravity 0.85//+LOWGRAVITY//+NOGRAVITY
}

Actor CrossbowFX12 : CrossbowFX1
{
Damage 12
+THRUSPECIES
Species "Player"
Decal CrossbowScorch
}

Actor CrossbowFX22 : CrossbowFX2
{
Damage 8
+THRUSPECIES
Species "Player"
Decal CrossbowScorch2
}

Actor CrossbowFX32 : CrossbowFX3
{
Damage 3
+THRUSPECIES
Species "Player"
Decal CrossbowScorch2
}

ACTOR "Dragon Claw" : Weapon
{
  +BLOODSPLATTER
  +PUFFONACTORS
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Weapon.SelectionOrder 500
  Inventory.PickUpSound "heretic/weaponget"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 30
  Weapon.YAdjust 16
  Weapon.SlotNumber 4
  Weapon.AmmoType "Clip"
  DamageType "DragonClaw"
  Decal RailScorchLower
  Obituary "%k clawed %o wide open."
  Inventory.PickupMessage "You got the Dragon Claw!"

  States
  {
  Spawn:
    WBLS A -1
    Stop
  Ready:
    BLSR A 1 A_WeaponReady
    Loop
  Deselect:
    BLSR A 1 A_Lower
    Loop
  Select:
    BLSR A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    BLSR BC 3
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
	BLSR D 0 A_FireBullets(0,0,1,random(3,9),"BlasterPuff2") // Damage is 4d8. Previously 4-32, which is too flat a probability. Gonna have to think about this.
    BLSR D 2
    BLSR CB 2
    BLSR A 0 A_ReFire
	BLSR A 1 A_ClearRefire
    Goto Ready
  Hold:
	TNT1 A 0 A_JumpIfInventory("SPModeOn",1,"CoopHold")
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHold")
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
	BLSR D 0 A_FireBullets(5.6,0,-1,random(3,9),"BlasterPuff2")
    BLSR D 2
    BLSR CB 2
    BLSR A 0 A_ReFire
	BLSR A 1 A_ClearRefire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    BLSR BC 3
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
	BLSR D 0 A_FireCustomMissile("DragonBullet",0,1,0,1)
    BLSR D 2
    BLSR CB 2
    BLSR A 0 A_ReFire
	BLSR A 1 A_ClearRefire
    Goto Ready
  CoopHold:
	TNT1 A 0 A_JumpIfNoAmmo("Finish")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
	BLSR D 0 A_FireCustomMissile("DragonBullet",random(-5.6,5.6),1,0,1)
    BLSR D 2
    BLSR CB 2
    BLSR A 0 A_ReFire
	BLSR A 1 A_ClearRefire
    Goto Ready
  Finish:
    BLSR A 1 A_ClearRefire
	goto Ready
  FireTomed:
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
    BLSR D 3 A_FireCustomMissile("BlasterFX1B")
    BLSR CB 4 A_ClearRefire
    Goto Ready
  CoopFireTomed:
	BLSR D 0 A_PlayWeaponSound("heretic/dragonclaw")
    BLSR D 3 A_FireCustomMissile("BlasterFX1C")
    BLSR CB 4 A_ClearRefire
    Goto Ready
  }
}

ACTOR DragonBullet : FastProjectile
{
   Damage (Random(1,8)*4)
   Radius 1
   Height 1
   Speed 300
   Projectile
   Renderstyle "Add"
   Species "Player"
   DamageType "DragonClaw"
   +BLOODSPLATTER
   +THRUSPECIES
   +NOTIMEFREEZE
   Decal RailScorchLower
   Alpha 1.0
   States
   {
   Spawn:
     TNT1 A 1
     loop
   Death:
     FX17 ABCDE 4 BRIGHT
     stop
   XDeath:
   Crash:
     FX17 FGHIJKL 4 BRIGHT
     stop
   }
}

Actor BlasterPuff2 : BlasterPuff
{
  DamageType "DragonClaw"
+CLIENTSIDEONLY
}

ACTOR BlasterFX1B : FastProjectile
{
  Radius 12
  Height 8
  Speed 300
  Damage 2
  SeeSound "weapons/blastershoot"
  DeathSound "weapons/blasterhit"
  Decal HImpScorch
  +SPAWNSOUNDSOURCE
   +NOTIMEFREEZE
  DONTHURTSHOOTER
  States
  {
  Spawn:
    ACLO E 200
    Loop
  Death:
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,0,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,45,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,90,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,135,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,180,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,225,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,270,2,0)
    TNT1 A 0 A_CustomMissile("Ripper2",0,0,315,2,0)
    FX18 A 3 BRIGHT
    FX18 B 3 BRIGHT
    FX18 CDEFG 4 BRIGHT
    Stop
  }
}

ACTOR BlasterFX1C : BlasterFX1B { +THRUSPECIES Species "Player" }

Actor Ripper2 : Ripper
{
  +MISSILE
  -NOCLIP
  +NOBOSSRIP
  DONTHURTSHOOTER
  Decal HImpScorch
}

ACTOR "Phoenix Rod" : Weapon
{
  Weapon.SelectionOrder 2600
  Weapon.Kickback 150
  Weapon.YAdjust 16
  Weapon.AmmoUse 1
  Weapon.AmmoGive 2
  Weapon.SlotNumber 5
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Weapon.AmmoType "RocketAmmo"
  Inventory.PickUpSound "heretic/weaponget"
  Inventory.PickupMessage "You got the Phoenix Rod!"
  Obituary "%k will help %o rise from the ashes eventually."

  States
  {
  Spawn:
    WPHX A -1
    Stop
  Ready:
    PHNX A 1 A_WeaponReady
    Loop
  Deselect:
	TNT1 A 0 A_StopSoundEx("Weapon")
    PHNX A 1 A_Lower
    Loop
  Select:
    PHNX A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_StopSoundEx("Weapon")
	TNT1 A 0 A_ClearRefire
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    PHNX B 5 BRIGHT
	PHNX C 0 A_Recoil(4)
	PHNX C 0 A_FireCustomMissile("PhoenixShot")
    PHNX C 7 BRIGHT
    PHNX DB 4
    PHNX B 0 A_Refire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_StopSoundEx("Weapon")
	TNT1 A 0 A_ClearRefire
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    PHNX B 5 BRIGHT
	PHNX C 0 A_Recoil(4)
	PHNX C 0 A_FireCustomMissile("PhoenixShot2")
    PHNX C 7 BRIGHT
    PHNX DB 4
    PHNX B 0 A_Refire
    Goto Ready
  FireTomed:
    PHNX B 3
  Hold:
    PHNX A 0 A_JumpIfInventory("PowerHereticTome",1,"HoldTomed")
	PHNX A 0 A_ClearRefire
    goto Fire
  HoldTomed:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopHoldTomed")
	TNT1 A 0 A_JumpIfInventory("PhoenixRodCount",280,"Powerdown")
	PHNX C 0 A_JumpIfInventory("PhoenixRodCount",1,1)
	PHNX C 0 A_PlaySoundEx("weapons/phoenixpowshoot","weapon",1,0)
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("PhoenixRodCount",1)
	PHNX C 0 A_FireCustomMissile("PhoenixFX2",random(-2,2),0,0,0,2,2)//,26,2,2)
    PHNX C 1 BRIGHT //A_FirePhoenixPL2
    PHNX B 4 BRIGHT A_ReFire
	TNT1 A 0 A_TakeInventory("PhoenixRodCount",360)
	TNT1 A 0 A_StopSoundEx("Weapon")
	goto Ready
  CoopHoldTomed:
	TNT1 A 0 A_JumpIfInventory("PhoenixRodCount",280,"Powerdown")
	PHNX C 0 A_JumpIfInventory("PhoenixRodCount",1,1)
	PHNX C 0 A_PlaySoundEx("weapons/phoenixpowshoot","weapon",1,0)
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("PhoenixRodCount",1)
	PHNX C 0 A_FireCustomMissile("PhoenixFX2A",random(-2,2),0,0,0,2,2)//,26,2,2)
    PHNX C 1 BRIGHT //A_FirePhoenixPL2
    PHNX B 4 BRIGHT A_ReFire
	TNT1 A 0 A_TakeInventory("PhoenixRodCount",360)
	TNT1 A 0 A_StopSoundEx("Weapon")
	goto Ready
  Powerdown:
	TNT1 A 0 A_StopSoundEx("Weapon")
	TNT1 A 0 A_TakeInventory("RocketAmmo",1)
	TNT1 A 0 A_TakeInventory("PhoenixRodCount",360)
    PHNX B 4 A_Refire
	TNT1 A 0 A_ClearRefire
    Goto Ready
  }
}

actor PhoenixRodCount : inventory { -INVBAR +INVENTORY.UNDROPPABLE inventory.maxamount 280 }

Actor PhoenixShot : PhoenixFX1
{
  -SPECIALFIREDAMAGE
  +FIREDAMAGE
  Decal Scorch
  Obituary "%k will help %o rise from the ashes eventually."
}

Actor PhoenixShot2 : PhoenixShot { +THRUSPECIES Species "Player" }
Actor PhoenixFX2A : PhoenixFX2
{
+THRUSPECIES
Species "Player"
DECAL PhoenixThrowerScorch
}

Actor PhoenixPuff2 : PhoenixPuff replaces PhoenixPuff
{
DECAL PhoenixThrowerScorch
+CLIENTSIDEONLY
}

ACTOR Hellstaff : Weapon
{
  Weapon.SelectionOrder 200
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 50
  Weapon.YAdjust 16
  Weapon.AmmoType1 "Cell"
  Weapon.SlotNumber 6
  //+AMMO_OPTIONAL
  +INVENTORY.UNDROPPABLE
  Inventory.PickUpSound "heretic/weaponget"
  Inventory.PickupMessage "You got the Hellstaff!"
  Obituary "%k sent %o to the depths of Hell."

  States
  {
  Spawn:
    WSKL A -1
    Stop
  Ready:
    HROD A 1 A_WeaponReady
    Loop
  Deselect:
    HROD A 1 A_Lower
    Loop
  Select:
    HROD A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFire")
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"FireTomed")
    HROD AB 4 BRIGHT A_FireCustomMissile("HellstaffShot")//A_FireSkullRodPL1
    HROD B 0 A_ReFire
    Goto Ready
  FireTomed:
	TNT1 A 0 A_JumpIfInventory("CoopModeOn",1,"CoopFireTomed")
    HROD C 2
    HROD D 3
    HROD E 2 BRIGHT
    HROD F 3 BRIGHT
	HROD A 0 A_PlayWeaponSound("weapons/hornrodpowshoot")
    HROD G 4 BRIGHT A_FireCustomMissile("HornRodFX2")
    HROD F 2 BRIGHT
    HROD E 3
    HROD D 2
    HROD C 2 A_ReFire
    Goto Ready
  CoopFire:
	TNT1 A 0 A_JumpIfInventory("PowerHereticTome",1,"CoopFireTomed")
    HROD AB 4 BRIGHT A_FireCustomMissile("HellstaffShot2")//A_FireSkullRodPL1
    HROD B 0 A_ReFire
    Goto Ready
  CoopFireTomed:
    HROD C 2
    HROD D 3
    HROD E 2 BRIGHT
    HROD F 3 BRIGHT
	HROD A 0 A_PlayWeaponSound("weapons/hornrodpowshoot")
    HROD G 4 BRIGHT A_FireCustomMissile("HornRodFX2A")
    HROD F 2 BRIGHT
    HROD E 3
    HROD D 2
    HROD C 2 A_ReFire
    Goto Ready
  }
}

Actor HellstaffShot
{
  Radius 12
  Height 8
  Speed 22
  Damage 3
  Projectile
  +WINDTHRUST
  -NOBLOCKMAP
  Decal PlasmaScorchLower
  RenderStyle Add
  SeeSound "heretic/hornrodshoot"
  DeathSound "weapons/bowhit"
  States
  {
  Spawn:
    FX00 A 0 A_Jump(128,"Spawn2")
    FX00 A 6 BRIGHT
  Spawn2:
    FX00 BA 6 BRIGHT
    Loop
  Death:
    FX00 HI 5 BRIGHT
    FX00 JK 4 BRIGHT
    FX00 LM 3 BRIGHT
    Stop
  }
}

Actor HellstaffShot2 : HellstaffShot { +THRUSPECIES Species "Player" }

Actor HornRodFX2A : HornRodFX2
{
+THRUSPECIES
Species "Player"
Alpha 0.9
SeeSound "weapons/hornrodpowshoot"
DeathSound "weapons/hornrodpowhit"
States
{
Death:
    TNT1 A 0 A_Scream
    FX00 H 5 BRIGHT
    FX00 I 5 BRIGHT
    FX00 J 4 BRIGHT
    FX00 KLM 3 BRIGHT
    FX00 G 1
    FX00 G 1 A_AddPlayerRain
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	TNT1 A 0 A_JumpIfHealthLower(20,"Death2")
	ACLO EEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0)
	ACLO E 1 A_TakeInventory("Health",100)
	ACLO E 0 A_SkullRodStorm
    ACLO E 5
    stop
   Death2:
	ACLO EEEEEEEEEEEEEEEE 1 A_SpawnItemEx("HellstaffRain",random(-64,64),random(-64,64),0,0,0,0) // When the Heretic rain pillar "dies", its health is actually set at 16 and gives 16 more raindrops before going away.
	ACLO E 1 A_TakeInventory("Health",100)
	ACLO E 0 A_SkullRodStorm
    ACLO E 5
	stop
  }
}

Actor HellstaffRain
{
Radius 3//Original is 5
Height 4//Original is 12
Speed 12
Damage 5
Mass 10//Original is 5
Renderstyle Add
Gravity 12
Species "Player"
+THRUSPECIES
+DONTSPLASH   
+EXPLODEONWATER
-CANBOUNCEWATER
-NOTELEPORT
+CEILINGHUGGER
//+SPAWNCEILING
//+NOGRAVITY
+BRIGHT
+MISSILE
States
{
  Spawn:
    TNT1 A 2
  Spawn2:
    FX22 A 1 BRIGHT
	loop
  Death:
    FX22 BCDEF 4 BRIGHT
    Stop
  //Death:
    //FX22 GHI 4 BRIGHT
    //Stop
}
}

Actor RainPillar2 : RainPillar
{
+SPAWNCEILING
}