actor MagmaBazookaBoss : BaseMM8BDMWep_CBM
{
dropitem "MagmaBazookaWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 100
Weapon.SlotNumber 1
Obituary "$OB_MAGMABAZOOKA"
Inventory.Pickupmessage "Korby sucks"
weapon.ammotype "MagmaAmmoB"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_09 G 1
loop
Ready:
MAGX A 0 A_GunFlash
MAGX A 0 A_SpawnItemEx("MagmaAmmoHelper")
MAGX D 0 ACS_ExecuteAlways(998,0,886)
goto Ready1
Ready1:
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 0 A_JumpIfInventory("MagmaMainCool",1,"Ready2a")
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready3")
goto ReadyX
Ready2a:
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready4")
Ready2://No Main
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 1 A_WeaponReady(4)
MAGX D 0 A_JumpIfInventory("MagmaMainCool",1,"Ready2")
goto ReadyX
Ready3://No Alt
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 1 A_WeaponReady(8)
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready3")
goto ReadyX
Ready4://No Main/Alt
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 1 A_WeaponReady(12)
MAGX D 0 A_JumpIfInventory("MagmaMainCool",1,"Ready2a")
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready3")
goto ReadyX

ReadyX:
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 1 A_WeaponReady
loop

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MAGX D 1
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MAGX D 1
Loop
Fire:
MAGX A 0 A_JumpIfInventory("MagmaItemFlag",1,"FinishIgnitionX")
MAGX A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
MAGX A 0 A_JumpIfInventory("MagmaAmmoB",1,"Fire3r")
MAGX A 0 A_GiveInventory("MagmamanMain1_CI",1)
goto FireDone
Fire3r:
MAGX A 0 A_TakeInventory("MagmaAmmoB",4)
MAGX A 0 A_GiveInventory("MagmamanMain2_CI",1)
goto FireDone

FireDone:
MAGX A 0 A_GiveInventory("MagmaMainCool",1)
MAGX A 0 A_JumpIfInventory("MagmaAltCool",1,"FireX")
MAGX A 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX A 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX F 0 A_TakeInventory("MagmaMainFlag",99)
goto Ready1

FireX:
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1
MAGX E 0 A_JumpIfInventory("MagmaAltCool",1,1)
goto FireDone+4
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1
MAGX E 0 A_JumpIfInventory("MagmaAltCool",1,1)
goto FireDone+6
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
MAGX F 0 A_JumpIfInventory("MagmaAltCool",1,1)
goto FireDone+8
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
goto Ready1

Altfire:
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"FinishIgnitionX")
MAGX D 0 A_GiveInventory("MagmaAltCool",1)
MAGX D 0 A_GiveInventory("MagmaAltFlag",1)
MAGX D 0 A_JumpIfInventory("MagmaMainFlag",1,"AltfireX")
Goto Ready1
AltfireX:
MAGX E 0 A_JumpIfInventory("MagmaMainFlag",4,6)
MAGX F 0 A_JumpIfInventory("MagmaMainFlag",3,4)
MAGX F 0 A_JumpIfInventory("MagmaMainFlag",2,2)
MAGX E 1
MAGX E 1
MAGX F 1
MAGX F 1
MAGX F 0 A_TakeInventory("MagmaMainFlag",99)
goto Ready1

Flash:
MAGX A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
MAGX A 1 A_JumpIfInventory("MagmaAltFlag",1,"AltFireFire")
MAGX A 0
goto Flash
AltFireFire:
MAGX A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
MAGX A 0 A_JumpIfInventory("MagmaAmmoB",1,"Fire3rA")
MAGX A 0 A_GiveInventory("MagmamanAlt1_CI",1)
goto AltFlashDone
Fire3rA:
MAGX A 0 A_TakeInventory("MagmaAmmoB",4)
MAGX A 0 A_GiveInventory("MagmamanAlt2_CI",1)
goto AltFlashDone
AltFlashDone:
MAGX BC 2
MAGX A 0 A_TakeInventory("MagmaAltFlag",1)
Goto Flash

ReigniteStart:
MAGX D 0 A_TakeInventory("GenericSoundFlag",99)
MAGX D 0 SetPlayerProperty(0,1,0)
goto Reignite
Reignite:
MAGX D 0 A_JumpIfInventory("GenericSoundFlag",7,5)
MAGX D 0 A_JumpIfInventory("GenericSoundFlag",1,2)
MAGX D 0 A_PlaySoundEx("weapon/MagmaMode","Body")
MAGX D 0 A_GiveInventory("GenericSoundFlag",1)
MAGX D 0 A_Jump(256,2)
MAGX D 0 A_TakeInventory("GenericSoundFlag",99)
MAGX D 0 A_SpawnItemEx("MagmaIgniteFX",0,0,0,momx,momy,0,0,9)
MAGX D 1 A_WeaponReady(WRF_NOSWITCH)
MAGX D 0 A_SpawnItemEx("MagmaIgniteFX2",0,0,0,momx,momy,0,0,9)
MAGX D 1 A_WeaponReady(WRF_NOSWITCH)
MAGX D 0 A_GiveInventory("MagmaAmmoB",1)
MAGX D 0 A_JumpIfInventory("IsDead",1,"NoFlash")
MAGX D 0 A_JumpIfInventory("MagmaAmmoB",48,"FinishIgnition")
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"Reignite")
goto FinishIgnition
FinishIgnitionX:
MAGX D 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
FinishIgnition:
MAGX D 0 SetPlayerProperty(0,0,0)
MAGX D 0 A_PlaySoundEx("weapon/pharaoh2","Body")
MAGX D 0 A_TakeInventory("MagmaItemFlag",99)
goto Ready1

NoAmmo:
MAGX A 1
Goto Ready2
}
}


actor MagmaAmmoB : Ammo
{
+INVENTORY.IGNORESKILL
inventory.amount 1
inventory.maxamount 48
}


actor MBBCoolDown : PowerDamage
{
powerup.duration 35
damagefactor "normal", 1.0
}

actor MagmaMainCool : MBBCoolDown {}
actor MagmaAltCool : MBBCoolDown {}

actor MagmaMainFlag : Inventory
{
inventory.amount 1
inventory.maxamount 4
}

actor MagmaAltFlag :OnceC{}

actor MagmaItemflag :OnceC{}

actor MagmaIgnition : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+INVBAR
inventory.icon "MGMASI"
inventory.pickupmessage "Try some Volvic water Tyrannosaurus Alan!"
Scale 2.0
states
{
Spawn:
MAGX G 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("MagmaAmmoB",48,"No")
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_JumpIfInventory("MagmaItemFlag",1,"Use2")
TNT1 A 0 A_GiveInventory("MagmaItemFlag",1)
fail
Use2:
TNT1 A 0 A_TakeInventory("MagmaItemFlag",99)
fail
No:
TNT1 A 0
fail
}
}

actor MagmaBazookaB1
{
Translation "192:192=248:248", "198:198=[208,32,32]:[208,32,32]"

PROJECTILE
Obituary "$OB_MAGMABAZOOKA"
damagetype "MagmaBazooka1"
Damage (6)
Radius 10
Height 10
Speed 28
scale 2.5
States
{
Spawn:
MGM9 BCDEFG 2
loop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite")
stop
}
}

actor MagmaBazookaB1B : MagmaBazookaB1{translation "192:192=205:205", "198:198=74:74"}
actor MagmaBazookaB1R : MagmaBazookaB1{translation "192:192=171:171", "198:198=41:41"}
actor MagmaBazookaB1O : MagmaBazookaB1{translation "192:192=104:104", "198:198=128:128"}
actor MagmaBazookaB1P : MagmaBazookaB1{translation "192:192=229:229", "198:198=232:232"}

actor MagmaBazookaB2 : MagmaBazookaB1
{
damagetype "MagmaBazooka2"
Damage (14)
Radius 20
Height 20
States
{
Spawn:
MGM9 HIJKLM 2
loop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite")
stop
}
}

actor MagmaBazookaB2B : MagmaBazookaB2{translation "192:192=205:205", "198:198=74:74"}
actor MagmaBazookaB2R : MagmaBazookaB2{translation "192:192=171:171", "198:198=41:41"}
actor MagmaBazookaB2O : MagmaBazookaB2{translation "192:192=104:104", "198:198=128:128"}
actor MagmaBazookaB2P : MagmaBazookaB2{translation "192:192=229:229", "198:198=232:232"}


actor MagmamanBitFX : BasicClientSide
{
Translation "192:192=220:220", "198:198=46:46"
alpha 0.75
scale 0.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,3,5,7)
MGM9 R 1 ThrustThingZ(0,random(1,3),0,1)
MGM9 R 1 A_FadeOut(0.05)
MGM9 S 1 ThrustThingZ(0,random(1,3),0,1)
MGM9 S 1 A_FadeOut(0.05)
MGM9 T 1 ThrustThingZ(0,random(1,3),0,1)
MGM9 T 1 A_FadeOut(0.05)
MGM9 U 1 ThrustThingZ(0,random(1,3),0,1)
MGM9 U 1 A_FadeOut(0.05)
goto Spawn+2
}
}

actor MagmamanBitFX2 : MagmamanBitFX
{
alpha 0.875
Scale 1.0
}

actor MagmaIgniteFX
{
Scale 2.5
-SOLID
+NOGRAVITY
//+CLIENTSIDEONLY
+NOINTERACTION
+NOTIMEFREEZE
States
{
Spawn:
HEAS A 0
HEAS AAA 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
HEAS A 1
stop
}
}

actor MagmaIgniteFX2 : MagmaIgniteFX
{
States
{
Spawn:
HEAS B 0
HEAS BBB 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
HEAS B 1
stop
}
}

actor MagmaAmmoHelper : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAAAAAAA 1 A_GiveToTarget("MagmaAmmoCheckPickup")

TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
loop
}
}

actor MagmaAmmoCheckPickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 ACS_ExecuteAlways(648,0,14)
TNT1 A 0
stop
}
}

actor LastMagmaHealth : Inventory
{
inventory.amount 1
inventory.maxamount 100
}



actor MagmamanMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",-12,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1B",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1B",-12,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1R",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1R",-12,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1O",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1O",-12,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1P",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1P",-12,0,-8,0)
goto Done
}
}

actor MagmamanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",-15,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2B",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2B",-15,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2R",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2R",-15,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2O",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2O",-15,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2P",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2P",-15,0,-8,0)
goto Done
}
}

actor MagmamanAlt1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",12,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1B",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1B",12,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1R",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1R",12,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1O",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1O",12,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1P",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1P",12,0,8,0)
goto Done
}
}

actor MagmamanAlt2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",15,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2B",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2B",15,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2R",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2R",15,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2O",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2O",15,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2P",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2P",15,0,8,0)
goto Done
}
}