ACTOR CrowbarBuild2 : CustomInventory 
{
	Inventory.Amount 0
	scale 0.7
	Inventory.Icon "HCR1A0"
	Inventory.PickupMessage "Got the Crow-hammer."
	Inventory.PickupSound "items/armorpickup"
	States
	{
	Spawn:
		HCR1 A 10
		HCR1 A 1 bright
		loop
	Pickup:
	    TNT1 A 0 A_GiveInventory("Crowbar2", 1)
	    TNT1 A 2
		TNT1 A 0 A_selectweapon("Crowbar2")
		TNT1 A 0 A_PlaySound("special/workbench",CHAN_ITEM)
		TNT1 A 2
		Stop
	}
}
ACTOR Crowbar : Weapon replaces fist
{
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  Obituary "$OBIT_CROWBAR"
  Inventory.Icon "CBARA0"
  Tag "$WEAPON_CROWBAR"
  weapon.slotnumber 1
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +NOALERT
  Weapon.BobStyle Alpha
	Weapon.BobSpeed 1.5
	Weapon.BobRangeX .2
	Weapon.BobRangeY .5
  States
  {
  Ready:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"ReadyLantern")
    CROW A 1 A_WeaponReady(WRF_ALLOWUSER1|WRF_ALLOWuser2|WRF_ALLOWUSER3)
    Loop
   ReadyLantern:
     SOLR A 1 BRIGHT A_WeaponReady(WRF_ALLOWUSER3|WRF_allowuser2|WRF_ALLOWUSER1)
     loop
  Deselect:
    "----" A 0 A_lower
    "----" A 1 A_Lower
    Loop
  Select:
    CROW A 1 A_Raise
	CROW A 0 A_Raise
    Loop
   Fire:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"FireLantern")
    CROW NOPQ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	goto Downswing
   FireLantern:
    SOLR FGH 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
   Downswing:
	CROW RS 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CROW S 0 A_setreflective
	CROW TU 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CROW A 0 A_CustomPunch(random(3, 6) * 5, TRUE, 0, "CrowbarPuff", 90)
	CROW VW 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CROW S 0 A_unSetreflective
	CROW XY 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 2
	TNT1 A 5 a_refire("upswing")
	CROR CBA 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	goto ready
   Upswing:
    TNT1 A 8 
    CRO2 AB 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CRO2 A 0 A_CustomPunch(random(3, 6) * 5, TRUE, 0, "CrowbarPuff", 90)
	CROW S 0 A_setreflective
	CRO2 DEF 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CROW S 0 A_unsetreflective
	CRO2 GH 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    TNT1 A 5
	TNT1 A 5 a_refire("downswing")
	CROW QPON 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	goto ready
    Altfire:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"AltFireLantern")
    CROR ABC 2 A_LIGHT0
	goto heavyattack
   Altfirelantern:
    SOLR FGH 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
   HeavyAttack:
	TNT1 A 5
	CROW BBCCCD 1
	CROW E 1
    {
        A_CustomPunch(random(12,12) * 5, TRUE, 0, "CrowbarPuff", 90);
        A_FireCustomMissile("Effect_ParryTokenGiver", 0, 0, 0, 0, 0);
    }
	CROW FGHI 1
	TNT1 A 8
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	CROW QPON 2
	CROW A 1
    CROW A 1 A_ReFire
    Goto Ready
  Quicklantern:
    SOLR HGF 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	goto ready
  user2:
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"unlight")
    TNT1 A 0 a_JumpIfInventory("batteries",20,"light")
	TNT1 A 0 a_JumpIfInventory("BatteryReload",1,"user3")
	goto light
  unlight:
	SOLR A 1 a_playsound("items/flashlighton")
	SOLR B 2 A_takeinventory("lightlit",1)
	SOLR CDE 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 5
    CROW QPON 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    goto ready
  Light:
	CROW NOPQ 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 5 
	SOLR EDCB 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	SOLR A 2 a_playsound("items/flashlighton")
	TNT1 A 0 A_giveinventory("lightlit",1) 
    goto ready
  user3:
    "----" # 0 a_JumpIfInventory("BatteryReload",1,"user3start")
	 "----" # 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	 goto ready
  User3Start:
    CROW NOPQ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	CROW C 0 a_playsound("items/flashlightload")
	MAGL HIJKL 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH) 
	MAGL MNO 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH) 
	MAGL O 0 A_takeinventory("BatteryReload",1)
	MAGL O 0 A_giveinventory("batteries",120)
	MAGL PQRS 3 A_WeaponReady(WRF_NOFIRE)
	TNT1 A 8 A_WeaponReady(WRF_NOFIRE)
	SOLR EDCB 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 A_giveinventory("lightlit",1) 
	SOLR A 1 a_playsound("items/flashlighton")
	goto ready
  }
}
ACTOR Crowbar2 : Weapon 
{
  Weapon.SelectionOrder 3700
  Weapon.Kickback 300
  Obituary "$OBIT_CROWBAR"
  Inventory.Icon "HCR1A0"
  Tag "$WEAPON_CROWBAR2"
  weapon.slotnumber 1
  +WEAPON.MELEEWEAPON
  +NOALERT
   +CHEATNOTWEAPON
  Weapon.BobStyle Alpha
	Weapon.BobSpeed 1.5
	Weapon.BobRangeX .2
	Weapon.BobRangeY .5
  States
  {
  Ready:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"Readylantern")
    C2OW A 1 A_WeaponReady(WRF_ALLOWUSER1|WRF_ALLOWuser2|WRF_ALLOWUSER3)
    Loop
   ReadyLantern:
     S2LR A 1 BRIGHT A_WeaponReady(WRF_ALLOWUSER3|WRF_allowuser2|WRF_ALLOWUSER1)
     loop
  Deselect:
    "----" A 0 A_lower
    "----" A 1 A_Lower
    Loop
  Select:
    C2OW A 0 A_takeinventory("crowbar",1)
    C2OW A 1 A_Raise
	C2OW A 0 A_Raise
    Loop
   Fire:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"FireLantern")
    C2OW NOPQ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	goto Downswing
   FireLantern:
    S2LR FGH 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
   Downswing:
    C2OW A 0 a_playsound("CroHam/swing1",CHAN_BODY,1.0)
	C2OW RS 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2OW S 0 A_setreflective
	C2OW TU 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2OW A 0 A_CustomPunch(random(5, 9) * 5, TRUE, 0, "CrohamPuff", 90)
	C2OW VW 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2OW S 0 A_unSetreflective
	C2OW XY 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 2
	TNT1 A 5 a_refire("upswing")
	C2OR CBA 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	goto ready
   Upswing:
    TNT1 A 8 
	C2O2 A 0 a_playsound("CroHam/swing2",CHAN_BODY,1.0)
    C2O2 AB 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2O2 A 0 A_CustomPunch(random(5, 9) * 5, TRUE, 0, "CrohamPuff", 90)
	C2OW S 0 A_setreflective
	C2O2 DEF 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2OW S 0 A_unsetreflective
	C2O2 GH 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    TNT1 A 5
	TNT1 A 5 a_refire("downswing")
	C2OW QPON 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	goto ready
   Altfire:
    TNT1 A 0 a_JumpIfInventory("lightlit",1,"AltFireLantern")
    C2OR ABC 2 A_LIGHT0
	goto heavyattack
   Altfirelantern:
    S2LR FGH 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
   HeavyAttack:
	TNT1 A 5
	C2OW A 0 a_playsound("CroHam/swing2",CHAN_BODY,1.0)
	C2OW BBCCCD 1
	C2OW E 1
    {
        A_CustomPunch(random(14,18) * 5, TRUE, 0, "CrohamPuff", 90);
        A_FireCustomMissile("Effect_ParryTokenGiver", 0, 0, 0, 0, 0);
    }
	C2OW FGHI 1
	TNT1 A 8
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"quicklantern")
	C2OW QPON 2
	C2OW A 1
    C2OW A 1 A_ReFire
    Goto Ready
  Quicklantern:
    S2LR HGF 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	goto ready
  user2:
	TNT1 A 0 a_JumpIfInventory("lightlit",1,"unlight")
    TNT1 A 0 a_JumpIfInventory("batteries",20,"light")
	TNT1 A 0 a_JumpIfInventory("BatteryReload",1,"user3")
	goto light
  unlight:
	S2LR A 1 a_playsound("items/flashlighton")
	S2LR B 2 A_takeinventory("lightlit",1)
	S2LR CDE 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 5
    C2OW QPON 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    goto ready
  Light:
	C2OW NOPQ 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 5 
	S2LR EDCB 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	S2LR A 2 a_playsound("items/flashlighton")
	TNT1 A 0 A_giveinventory("lightlit",1) 
    goto ready
  user3:
  "----" # 0 a_JumpIfInventory("BatteryReload",1,"user3start")
	 "----" # 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	 goto ready
  User3Start:
    C2OW NOPQ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	C2OW C 0 a_playsound("items/flashlightload")
	MAGL HIJKL 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH) 
	MAGL MNO 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH) 
	MAGL O 0 A_takeinventory("BatteryReload",1)
	MAGL O 0 A_giveinventory("batteries",120)
	MAGL PQRS 3 A_WeaponReady(WRF_NOFIRE)
	TNT1 A 8 A_WeaponReady(WRF_NOFIRE)
	S2LR EDCB 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 A_giveinventory("lightlit",1) 
	S2LR A 1 a_playsound("items/flashlighton")
	goto ready
  }
}
ACTOR Holsterweapon : Weapon
{
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  Inventory.Icon "CBARA0"
  Tag "$WEAPON_HOLSTER"
  weapon.slotnumber 0
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +NOALERT
  +CHEATNOTWEAPON
  Weapon.BobStyle Alpha
	Weapon.BobSpeed 1.5
	Weapon.BobRangeX .2
	Weapon.BobRangeY .5
  States
  {
  Ready:
    Tnt1 A 1 A_WeaponReady(WRF_NOFIRE)
    Loop
	 Deselect:
    "----" A 0 A_lower
    "----" A 1 A_Lower
    Loop
  Select:
    TNT1 A 1 A_Raise
	TNT1 A 0 A_Raise
    Loop
   fire: 
    TNT1 A 1 
	goto ready
  }
}
