////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WEAPONS                                                                    //
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

actor BatmanFist : DoomWeapon replaces Fist
{
  Game Doom
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +BLOODLESSIMPACT
  Obituary "%o was punched by %k"
  States
  {
  Ready:
    PUNG A 1 A_WeaponReady
    loop
  Deselect:
    PUNG A 1 A_Lower
    loop
  Select: 
    PUNG A 1 A_Raise
    loop
  Fire:
    PUNG B 4
    PUNG C 4 A_Punch
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    goto Ready
  }
}

actor BatmanTazer : DoomWeapon replaces Chainsaw 2005
{
  SpawnID 161
  
  Game Doom
  Weapon.Kickback 0
  Weapon.SelectionOrder 2200
  Weapon.UpSound "weapons/sawup"
  Weapon.ReadySound "weapons/sawidle"
  Inventory.PickupMessage "You got the tazer!"
  Obituary "%o was tazed by %k"
  +WEAPON.MELEEWEAPON		
  +BLOODLESSIMPACT
  States
  {
  Ready:
    SAWG CD 4 A_WeaponReady
    loop
  Deselect:
    SAWG C 1 A_Lower
    loop
  Select:
    SAWG CCCCDDDD 1 A_Raise
    loop
  Fire:
    SAWG AB 4 A_Saw
    SAWG B 0 A_ReFire
    goto Ready
  Spawn:
    CSAW A -1
    stop
  }
}

actor Batarang replaces Rocket
{
  SpawnID 68
  
  Game Doom
  Radius 11
  Height 8
  Speed 22
  Damage 8
  Projectile
  +BLOODLESSIMPACT
  +RANDOMIZE
  SeeSound "vile/raise"
  DeathSound "baby/attack"
  Obituary "%o was bataranged"
  
  States
  {
  Spawn:
    PLSS A 4
    POL3 B 4
    PLSS B 4
    POL3 A 4
    loop
  Death:
    BAL2 C 8 bright
    BAL2 D 6 bright
    BAL2 E 4 bright
    stop
  }
}

actor BatmanBatarang : DoomWeapon replaces Pistol 5010
{
  SpawnID 162
  
  Game Doom
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Clip"
  Obituary "%o was bataranged by %k"
  +WEAPON.WIMPY_WEAPON
  Inventory.Pickupmessage "Picked up batarangs"
  States
  {
  Ready:
    PISG A 1 A_WeaponReady
    Loop
  Deselect:
    PISG A 1 A_Lower
    Loop
  Select:
    PISG A 1 A_Raise
    Loop
  Fire:
    PISG A 3
    PISG B 3 A_Light0
    PISG C 3
    PISG D 3 A_FireMissile
    PISG E 10 A_Light0
    BON1 D 3 
    BON1 C 10 A_ReFire
    Goto Ready
  Spawn:
    PIST A -1
    Stop
  }
}

actor BatmanBlastgun : DoomWeapon replaces BlueCard 5
{
  SpawnID 163
  
  Game Doom
  Weapon.SelectionOrder 1300
  Weapon.AmmoUse 2
  Weapon.AmmoGive 6
  Weapon.AmmoType "Shell"
  Inventory.PickupMessage "You got the Blastgun!"
  Obituary "%o was blasted by %k's Blastgun"
  +BLOODLESSIMPACT
  States
  {
  Ready:
    SHTG A 1 A_WeaponReady
    Loop
  Deselect:
    SHTG A 1 A_Lower
    Loop
  Select:
    SHTG A 1 A_Raise
    Loop
  Fire:
    SHTF A 5
    SHTF B 7 A_FireShotgun2
    PISF A 5
    SHTG BC 5
    SHTG D 5 A_CheckReload
    COL5 A 35 
    COL5 A 1 A_ReFire
    Goto Ready
  Flash:
    POL5 A 5 Bright A_Light1
    SHTG E 0 Bright A_Light0
    Goto LightDone
  Spawn:
    SHOT A -1
    Stop
  }
}

actor BatmanAzerealGlove : DoomWeapon replaces SuperShotgun 82
{
  SpawnID 164
  
  Game Doom
  Weapon.SelectionOrder 400
  Weapon.AmmoUse 1
  Weapon.AmmoGive 6
  Weapon.AmmoType "Shell"
  Inventory.PickupMessage "Got Azrael's gloves!"
  Obituary "%o was blasted by %k's Gloves"
  +BLOODLESSIMPACT
  States
  {
  Ready:
    SHT2 A 1 A_WeaponReady
    Loop
  Deselect:
    SHT2 A 1 A_Lower
    Loop
  Select:
    SHT2 A 1 A_Raise
    Loop
  Fire:
    SHT2 A 4
    SHT2 A 0 A_CheckReload
    SHT2 I 0 A_FireShotgun
    SHT2 I 4 Bright A_OpenShotgun2
    SHT2 J 4 Bright
    SMBT A 4
    SMBT B 0 Bright A_FireShotgun
    SMBT B 4 Bright A_OpenShotgun2
    SMBT C 4 Bright
	SMBT D 4
    SHT2 B 4
    SHT2 C 4
    SHT2 D 4 A_ReFire
    Goto Ready
  Flash:
    POL5 A 3 Bright A_Light1
    Goto LightDone
  Spawn:
    SGN2 A -1
    Stop
  }
}

actor BatmanChaingun : DoomWeapon replaces Chaingun 2002
{
  SpawnID 165
  
   Game Doom
   Weapon.SelectionOrder 700
   Weapon.AmmoUse 1
   Weapon.AmmoGive 20
   Weapon.AmmoType "Clip"
   Inventory.PickupMessage "You got the shuriken glove!"//fixme what
   Obituary "%o was slashed by %k's shuriken"
   +BLOODLESSIMPACT
   States
   {
   Ready:
     CHGG A 1 A_WeaponReady
     Loop
   Deselect:
     CHGG A 1 A_Lower
     Loop
   Select:
     CHGG A 1 A_Raise
     Loop
   Fire:
     CHGG BB 6 A_FireCGun
     CHGG B 0 A_ReFire
     Goto Ready
   Flash:
     CHGF A 0 Bright A_Light1
     CHGF A 1 Bright
     CHGF A 1 Bright A_LoadShotgun2
     CHGF B 2 Bright
     SMGT B 2 Bright
     SMGT B 0 Bright A_Light0
     Goto LightDone
   Spawn:
     MGUN A -1
     Stop
   }
}

actor SmokeBomb replaces BFGBall
{
  SpawnID 69
  
  Game Doom
  Radius 13
  Height 8
  Speed 35
  Damage 20
  DeathSound "weapons/bfgx"
  Projectile
  +BLOODLESSIMPACT
  +RANDOMIZE
  +OLDRADIUSDMG
  -NOGRAVITY
  Obituary "%o was gassed by %k's smoke bomb"
  
  States
  {
  Spawn:
    BFS1 A -1
    loop
  Death:
    POL5 A 0 A_Explode(128)
	POL5 A 0 A_NoGravity
    TFOG ABCDEFGHI 4
    stop
  }
}

actor BatmanSmokeBomb : DoomWeapon replaces RocketLauncher 2003
{
  SpawnID 166
  
  Game Doom
  Weapon.SelectionOrder 2500
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "RocketAmmo"
  +WEAPON.NOAUTOFIRE
  +WEAPON.NOAUTOAIM
  +WEAPON.EXPLOSIVE
  Inventory.PickupMessage "You got some smoke bombs!"
  States
  {
  Ready:
    MISG A 1 A_WeaponReady
    Loop
  Deselect:
    MISG A 1 A_Lower
    Loop
  Select:
    MISG A 1 A_Raise
    Loop
  Fire:
    MISF A 5
    MISF BC 5
    MISF D 5 A_FireBFG
    SHT2 E 5
    SHT2 F 5
    SHT2 G 5 A_ReFire
    Goto Ready
  Spawn:
    LAUN A -1
    Stop
  }
}

actor BatFlame : Flame replaces PlasmaBall
{
  SpawnID 70
  
  States
  {
  Spawn:
    SMRT BCD 3
    SKUL HJ 3
    stop
  Death:
    TGRN CD 3 BRIGHT
    stop
  }
}

actor BatmanFlamer : DoomWeapon replaces PlasmaRifle 2004
{
  SpawnID 167
  
  Game Doom
  Weapon.SelectionOrder 100
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Cell"
  Inventory.PickupMessage "Got the flamethrower!"
  States
  {
  Ready:
    PLSG A 1 A_WeaponReady
    Loop
  Deselect:
    PLSG A 1 A_Lower
    Loop
  Select:
    PLSG A 1 A_Raise
    Loop
  Fire:
    POL5 A 3 A_FirePlasma
    PLSG B 20 A_ReFire
    Goto Ready
  Flash:
    PLSF A 4 Bright A_Light1
    Goto LightDone
    PLSF B 4 Bright A_Light1
    Goto LightDone
  Spawn:
    PLAS A -1
    Stop
  }
}

actor BatmanFinalGlove : DoomWeapon
{
  Game Doom
  Height 20
  Weapon.SelectionOrder 2800
  Weapon.Kickback 100
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +WEAPON.CHEATNOTWEAPON
  +BLOODLESSIMPACT
  
  Obituary "Was beaten like Bane"
  
  States
  {
  Ready:
    BFGG A 1 A_WeaponReady
    loop
  Deselect:
    BFGF A 50
    BFGF A -1 A_BFGSound
    loop
  Select: 
    BFGG A 1 A_Raise
    loop
  Fire:
    BFGG B 5 A_Light0
    BFGG C 5 A_Light0
    SMIT A 6 A_CustomPunch(random(1,10)*20, 1)
    BFGG C 5 A_Light0
    BFGG B 6 A_ReFire
    goto Ready
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor BatmanFinalGloveItem : CustomInventory replaces BFG9000 2006
{
  SpawnID 168
  
  Game Doom
  Height 20
  SpawnID 31
  Inventory.PickupSound ""

  Inventory.PickupMessage ""
  
  States
  {
  Pickup:
    TNT1 A 0 A_JumpIfInventory ("BatmanFinalGlove", 1, "Set")
    TNT1 A 0 A_PlaySound ("misc/w_pkup")
    TNT1 A 0 A_Print("You prepair to fight Bane with only your fists")

    /*TNT1 A 0 A_TakeInventory ("BatmanFist")
    TNT1 A 0 A_TakeInventory ("BatmanTazer")
    TNT1 A 0 A_TakeInventory ("BatmanBatarang")
    TNT1 A 0 A_TakeInventory ("BatmanBlastgun")
    TNT1 A 0 A_TakeInventory ("BatmanAzerealGlove")
    TNT1 A 0 A_TakeInventory ("BatmanChaingun")
    TNT1 A 0 A_TakeInventory ("BatmanSmokeBomb")
    TNT1 A 0 A_TakeInventory ("BatmanFlamer")*/

  Set:
    TNT1 A 0 A_GiveInventory ("BatmanFinalGlove")
    TNT1 A 0 A_SelectWeapon("BatmanFinalGlove")
    TNT1 A 0 

    fail//forces weapon to stay on ground always
  Spawn:
    BFUG A -1
    Stop
  }
}