ACTOR SSTBFG10k : BFG10k replaces bfg10k
{
  Tag "BFG10K"
  SpawnID 165
  Radius 20
  Height 20
  Weapon.Selectionorder 2799
  Weapon.AmmoUse2 0
  Weapon.AmmoGive2 80
  Weapon.AmmoType2 "Cell"
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "10kShot"
  Weapon.Kickback 100
  Inventory.Pickupmessage "You got the BFG10000! Sick!"
  Obituary "%o blown away by %k's BFG10k."
  +NOALERT
	+FORCEXYBILLBOARD
  +WEAPON.NOAUTOFIRE
  +WEAPON.NOLMS
  //+BLOODSPLATTER
  +AXEBLOOD
  //+AMMO_OPTIONAL
  Weapon.preferredSkin "10kSkin"
  States
  {
  Spawn:
    BFG2 A -1
    Stop
  AlmostReady:
    BG2G OOOOOOOO 2 A_Raise
    BG2G O 1 //A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G A 0 //A_Refire
    BG2G O 1 A_Raise
    Goto Ready
  Ready:
    TNT1 A 0 A_ZoomFactor(1.0)
    RLGG E 0 A_JumpIfNoAmmo("Reload")
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto ReadyEmpty
    BG2G A 0 A_PlayweaponSound ("weapons/bfg10kidle")
    BG2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G B 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G B 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G B 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G C 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G C 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G C 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G D 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G D 1 A_WeaponReady(WRF_ALLOWRELOAD)
    BG2G D 1 A_WeaponReady(WRF_ALLOWRELOAD)
    Loop
  ReadyEmpty:
    BG2G OO 1 A_WeaponReady(WRF_ALLOWRELOAD)
    RLGG E 0 A_JumpIfNoAmmo("Reload")
    Loop
  Deselect:
    TNT1 A 0 ACS_ExecuteAlways(779,0, 2,0,0)
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto DeselectEmpty
    TNT1 A 0
    BG2G E 1 A_Lower
    Goto DeSelect+2
  DeselectEmpty:
    TNT1 A 0
    BG2G O 1 A_Lower
    Goto DeSelectEmpty
  Select:
    RLGG F 0 A_GiveInventory("10krefirecheck", 1)
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "Ready")
    TNT1 A 0 ACS_ExecuteAlways(779,0, 6,0,0)
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto SelectEmpty
    TNT1 A 0
    BG2G E 1 A_Raise
    Goto Select+4
  SelectEmpty:
    TNT1 A 0
    BG2G O 1 A_Raise
    Goto SelectEmpty
  Fire:
    BG2G E 0 A_JumpIfNoAmmo("Reload")
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto Reload
    RLGG F 0 A_TakeInventory("10krefirecheck", 1)
    BG2G E 20 A_PlayweaponSound ("weapons/bfg10kf")
    BG2G F 4
    BG2G G 1
    BG2G H 1
    BG2G I 1
    BG2G J 1
    TNT1 A 0 BRIGHT A_ZoomFactor(0.90)
    Goto Hold
  Hold:
    BG2G E 0 A_JumpIfInventory("10krefirecheck", 1, "Fire")
    BG2G E 0 A_JumpIfNoAmmo("Reload")
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto Reload
    //RLGG F 0 A_TakeInventory("10kShot", 1)
    BG2G K 2 BRIGHT A_GunFlash
	TNT1 A 0 Radius_Quake(2,4,0,1, 0)
    RLGG E 0 A_AlertMonsters
    BG2G L 0 A_RailAttack (0, 0, 0, "none", "00 DD 00", 1, 0, "Bulletpuff") 
    BG2G L 2 BRIGHT A_FireBullets(0,0,1,0,"SSTBFG10kShot")
    BG2G M 2
    BG2G E 0 A_JumpIfInventory("10kShot", 1, 1)
	Goto Reload
    BG2G N 0 A_ReFire
    BG2G O 0 A_PlayweaponSound ("weapons/bfg10kcool")
    BG2G O 1 A_ZoomFactor(0.91)
    BG2G O 1 A_ZoomFactor(0.92)
    BG2G O 1 A_ZoomFactor(0.93)
    BG2G O 1 A_ZoomFactor(0.94)
    BG2G O 1 A_ZoomFactor(0.95)
    BG2G O 1 A_ZoomFactor(0.96)
    BG2G O 1 A_ZoomFactor(0.97)
    BG2G O 1 A_ZoomFactor(0.98)
    BG2G O 1 A_ZoomFactor(0.99)
    BG2G O 1 A_ZoomFactor(1.0)
    BG2G O 25
    Goto Ready
  Flash:
    TNT1 A 0 A_Playsoundex ("weapons/10kshoot",soundslot7)
    TNT1 A 2 Bright A_Light2
    TNT1 A 2 Bright A_light0
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(200,320),0,0)
    TNT1 A 1 Bright A_light0
    Goto LightDone
    Stop
  NoReload:
    BG2G A 1 A_WeaponReady
    BG2G A 1 A_WeaponReady
    BG2G A 1 A_WeaponReady
    BG2G B 1 A_WeaponReady
    BG2G B 1 A_WeaponReady
    BG2G B 1 A_WeaponReady
    BG2G C 1 A_WeaponReady
    BG2G C 1 A_WeaponReady
    BG2G C 1 A_WeaponReady
    BG2G D 1 A_WeaponReady
    BG2G D 1 A_WeaponReady
    BG2G D 1 A_WeaponReady
	Goto Ready
  Reload:
    TNT1 A 0 A_ZoomFactor(1.0)
    BG2G E 0 A_JumpIfInventory("10kShot", 16, "NoReload")
    RLGG F 0 A_JumpIfInventory("Cell", 10, 2)
    BG2G E 0 A_JumpIfInventory("10kShot", 1, "Ready")
    Goto ReadyEmpty
    RLGG F 0 A_GiveInventory("10krefirecheck", 1)
    BG2G OOOOOOOOO 2 A_Lower
    BG2G O 0 A_playsoundex("weapons/BFG10Kreload", "soundslot5")
    BG2G O 40
  Load:
    RLGG F 0 A_JumpIfInventory("10kShot", 16, "AlmostReady")
    RLGG F 0 A_TakeInventory("Cell", 10)
    RLGG F 0 A_GiveInventory("10kShot", 1)
    RLGG F 0 A_JumpIfInventory("Cell", 10, 1)
    Goto AlmostReady
    RLGG F 0
    LOOP
  Altfire:
    BG2G E 0 A_JumpIfInventory("10kShot", 16, "Ready")
    BG2G O 1
    Goto Reload
  }
}

actor 10kShot : Ammo
{
  +IGNORESKILL
  inventory.pickupmessage "You probably shouldn't see this."
  inventory.amount 1
  inventory.maxamount 16
  inventory.icon "CELLA0"
  ammo.backpackamount 0
  ammo.backpackmaxamount 16
}

actor 10krefirecheck : Inventory
{
  inventory.amount 1
  inventory.maxamount 1
}

actor SSTBFG10KShot : BFG10KShot replaces bfg10kshot
{
damagetype "Rocket"
  //SpawnID 217
  //Radius 11
  //Height 8
  //Speed 20
  //Damage 160
  +NOBLOCKMAP
  +NOGRAVITY
  +ACTIVATEIMPACT
  +ACTIVATEPCROSS
  +NOTELEPORT 
  +PUFFONACTORS
  //+PUFFGETSOWNER
  +FORCERADIUSDMG
  Renderstyle Add
  Alpha 0.75
  SeeSound "weapons/bfg10kx"
  AttackSound "weapons/bfg10kx"
  Obituary "$OB_BFG10K" // "%o was blasted by %k's BFG10K."
  States
  {
  Spawn:
    BFE1 A 0 Bright
    TNT1 A 0 bright A_SpawnItemEx("bfgflare2", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("GreenParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    NULL A 0 A_SpawnItemEx ("RocketEcho", 0,0,0, 0,0,0, 0, 160)
         NULL A 0 Radius_Quake (2.75, 10, 0, 8, 0)
    BFE1 A 3 Bright A_Detonate
    BFE1 BCDEF 3 Bright
    Stop
  }

}