actor MagmaBazookaBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_9G"
dropitem "MagmaBazookaWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 100
Obituary "$OB_MAGMABAZOOKA"
Inventory.Pickupmessage "Korby sucks"
weapon.ammotype "VolcanicBreakfastAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_09 G 1
loop
Ready:
MAGX D 0 ACS_ExecuteAlways(998,0,DYE_MAGMAMAN)
MAGX D 0 A_GunFlash("Flash.Begin")
goto Ready1

Ready1:
MAGX D 0 A_ClearRefire
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"ReigniteStart")
MAGX D 0 A_JumpIfInventory("MagmaMainCool",1,"Ready2")
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready3")
goto Ready9
Ready2:
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready4")
MAGX D 1 A_WeaponReady(4)//No Main
goto Ready1+1
Ready3:
MAGX D 1 A_WeaponReady(8)//No Alt
goto Ready1+1
Ready4:
MAGX D 1 A_WeaponReady(12)//No Main/Alt
goto Ready1+1

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

Deselect:
MAGX DDDDDDDDDDDDDDDDDDDDDD 0 A_Lower
MAGX D 1 A_Lower
Loop
Select:
MAGX DDDDDDDDDDDDDDDDDDDDDD 0 A_Raise
MAGX D 1 A_Raise
Loop

Fire:
MAGX D 0 A_JumpIfInventory("MagmaMainCool",1,"Ready1")
MAGX A 0 A_JumpIfInventory("MagmaItemFlag",1,"FinishIgnitionX")
MAGX A 0 A_GiveInventory("MagmamanMain_P",1)
MAGX A 0 A_GiveInventory("MagmaMainCool_RC",1)
MAGX A 0 A_JumpIfInventory("MagmaAltCool",1,"FireX")
MAGX F 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 E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1 A_WeaponReady(WRF_NOPRIMARY)
MAGX F 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 F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
MAGX F 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.a")
goto Fire+7
FireX.a:
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
MAGX F 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.b")
goto Fire+9
FireX.b:
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1
MAGX E 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.c")
goto Fire+11
FireX.c:
MAGX E 0 A_GiveInventory("MagmaMainFlag",1)
MAGX E 1
MAGX E 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.d")
goto Fire+13
FireX.d:
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
MAGX F 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.e")
goto Fire+15
FireX.e:
MAGX F 0 A_GiveInventory("MagmaMainFlag",1)
MAGX F 1
MAGX F 0 A_JumpIfInventory("MagmaAltCool",1,"FireX.f")
goto Fire+17
FireX.f:
MAGX F 1 A_TakeInventory("MagmaMainFlag",99)
goto Ready1

Altfire:
MAGX D 0 A_JumpIfInventory("MagmaAltCool",1,"Ready1")
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"FinishIgnitionX")
MAGX D 0 A_GiveInventory("MagmaAltCool_RC",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 F 1
MAGX F 1
MAGX E 1
MAGX E 1
MAGX F 1
MAGX F 1
MAGX F 0 A_TakeInventory("MagmaMainFlag",99)
goto Ready1

Flash.Begin:
MAGX A 4
goto Flash
Flash:
MAGX A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
MAGX A 0 A_JumpIfInventory("MagmaAltFlag",1,"Flash.FireRight")
MAGX A 1 A_GiveInventory("MagmamanFlashState_P",1)
loop
Flash.FireRight:
//MAGX A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")//SoundSlot7
//MAGX A 0 A_GiveInventory("MagmaAltCool")
MAGX A 0 A_GiveInventory("MagmamanAlt_P",1)
MAGX C 0 //A_JumpIfInventory("PowerRage_ST",1,2)
MAGX CCBBCC 1 //A_GiveInventory("MagmamanFlashState_P",1)
MAGX B 0 A_TakeInventory("MagmaAltFlag",1)
Goto Flash

ReigniteStart:
//MAGX D 0 SetPlayerProperty(0,1,0)
MAGX D 0 A_GiveInventory("PowerMagma",1)
MAGX D 0 A_GiveInventory("MagmaIgniteFlag",1)
MAGX D 0 A_GiveInventory("MagmaIgnitePower")
MAGX D 0 A_GiveInventory("GuardUpFlag")
goto Reignite
Reignite:
MAGX D 0 A_GiveInventory("MagmaIgniteFX_P1",1)
MAGX D 1 A_WeaponReady(2)
//TNT1 A 0 ACS_NamedExecuteAlways("cbm_HealthDamageRage",0,14)
MAGX D 0 A_GiveInventory("MagmaIgniteFX_P2",1)
MAGX D 1 A_WeaponReady(2)
MAGX D 0 A_GiveInventory("MagmaRecharge_RC",1)
TNT1 A 0 A_FireCustomMissile("MagmaShield",0,0,0,0)
MAGX D 0 A_JumpIfInventory("VolcanicBreakfastAmmo",48,"FinishIgnition")
MAGX D 0 A_JumpIfInventory("MagmaItemFlag",1,"Reignite")
goto FinishIgnition
FinishIgnitionX:
MAGX D 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot7")
FinishIgnition:
MAGX D 0 A_TakeInventory("GuardUpFlag")
MAGX D 0 A_TakeInventory("MagmaIgnitePower")
//MAGX D 0 SetPlayerProperty(0,0,0)
MAGX D 0 A_PlaySoundEx("weapon/magmaforcestop","Body")
MAGX D 0 A_TakeInventory("MagmaItemFlag",99)
MAGX D 0 A_TakeInventory("MagmaIgniteFlag",99)
MAGX A 0 A_TakeInventory("PowerMagma",1)
goto Ready1

}
}


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

actor MagmamanSoundDelay : Powerup
{
powerup.duration 7
}

actor MagmaMainCool : Powerup
{
+ADDITIVETIME
powerup.duration 17
}

actor MagmaAltCool : Powerup
{
+ADDITIVETIME
powerup.duration 17
}

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

actor PowerMagma : PowerSpeed
{
Speed 0.25
}

actor MagmaAltFlag :OnceC{}

actor MagmaItemflag :OnceC{}
actor MagmaIgniteFlag :OnceC{}

actor MagmaIgnitePower : BasePowerPro
{
damagefactor "Normal", 0.80
}

Actor MagmaMunchArmor : BasicArmorBonus
{
  armor.maxsaveamount 75
  armor.savepercent 15.001
  armor.saveamount 2
  states
  {
  Spawn:
    TNT1 A 1 //A_GiveToTarget("SaturnArmorFlag",1)
    loop
  }
}

actor MagmaIgnition : BasicClassItem
{
inventory.icon "MGMASI"
inventory.pickupmessage "Try some Volvic water Tyrannosaurus Alan!"
Tag "$TAGC_9G1"
states
{
Spawn:
MAGX Z 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",48,"No")
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot7")
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
}
}

actor MagmamanFlashState_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 A 0 A_JumpIfInventory("BasicArmor",1,"PickupFX")
stop
PickupR:
TNT1 A 0 A_JumpIfInventory("BasicArmor",1,"PickupFX")
stop
PickupFX:
HEAP S 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
stop
}
}

actor MagmaShield : BasicExplosion
{
Obituary "$OB_MAGMABAZOOKA2"
damagetype "FireSpin"
States
{
Spawn:
TNT1 A 0
TNT1 A 4 A_Explode(4,80,0,0,20)
stop
}
}

actor MagmamanMain_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",4,"Pickup2")
TNT1 A 0 A_GiveInventory("MagmamanMain1_CI",1)
MAGX A 0 A_PlaySoundEx("weapon/magmabazookaweak","SoundSlot6")
stop
Pickup2:
TNT1 A 0 A_GiveInventory("MagmamanMain2_CI",1)
MAGX A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
stop
}
}
actor MagmamanAlt_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",4,"Pickup2")
TNT1 A 0 A_GiveInventory("MagmamanAlt1_CI",1)
MAGX A 0 A_PlaySoundEx("weapon/magmabazookaweak","SoundSlot6")
stop
Pickup2:
TNT1 A 0 A_GiveInventory("MagmamanAlt2_CI",1)
MAGX A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
stop
}
}

actor MagmaRecharge_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 //ACS_NamedExecuteAlways("cbm_HealthDamageRage",0,14)
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 A 0 A_GiveInventory("VolcanicBreakfastAmmo",1)
stop
PickupR:
TNT1 A 0 A_GiveInventory("VolcanicBreakfastAmmo",2)
stop
}
}

actor MagmaMainCool_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 AA 0 A_GiveInventory("MagmaMainCool")
stop
PickupR:
TNT1 A 0 A_GiveInventory("MagmaMainCool")
stop
}
}
actor MagmaAltCool_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 AA 0 A_GiveInventory("MagmaAltCool")
stop
PickupR:
TNT1 A 0 A_GiveInventory("MagmaAltCool")
stop
}
}

actor MagmaBazookaB1
{
Translation "192:192=248:248", "198:198=[208,32,32]:[208,32,32]"
PROJECTILE
Obituary "$OB_MAGMABAZOOKA"
damagetype "MagmaM_Shot1"
+BRIGHT
Damage (7)
Radius 10
Height 10
Speed 32
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
X_9G ABCDEF 2
loop
Death:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("CBM_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 "MagmaM_Shot2"
Damage (14)
Radius 20
Height 20
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
X_9G GHIJKL 2
loop
Death:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("CBM_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"
+BRIGHT
alpha 0.75
scale 0.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,3,5,7)
MAGX R 1 ThrustThingZ(0,random(1,3),0,1)
MAGX R 1 A_FadeOut(0.05)
MAGX S 1 ThrustThingZ(0,random(1,3),0,1)
MAGX S 1 A_FadeOut(0.05)
MAGX T 1 ThrustThingZ(0,random(1,3),0,1)
MAGX T 1 A_FadeOut(0.05)
MAGX U 1 ThrustThingZ(0,random(1,3),0,1)
MAGX U 1 A_FadeOut(0.05)
goto Spawn+2
}
}

actor MagmamanBitFX2 : MagmamanBitFX
{
alpha 0.875
Scale 1.0
}

actor MagmaIgniteFX_P1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MagmamanSoundDelay",1,"Pickup2")
TNT1 A 0 A_PlaySoundEx("weapon/MagmaMode","Body")
TNT1 A 0 A_GiveInventory("MagmamanSoundDelay",1)
goto Pickup2
Pickup2:
TNT1 A 0 A_SpawnItemEx("MagmaIgniteFX1",0,0,0,momx,momy,0,0,9)
stop
}
}

actor MagmaIgniteFX_P2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MagmamanSoundDelay",1,"Pickup2")
TNT1 A 0 A_PlaySoundEx("weapon/MagmaMode","Body")
TNT1 A 0 A_GiveInventory("MagmamanSoundDelay",1)
goto Pickup2
Pickup2:
TNT1 A 0 A_SpawnItemEx("MagmaIgniteFX2",0,0,0,momx,momy,0,0,9)
stop
}
}

actor MagmaIgniteFX1 : BasicExplosion
{
+NOTIMEFREEZE
+BRIGHT
Scale 2.5
States
{
Spawn:
HEAP S 0
HEAP SSS 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
HEAP S 1
stop
}
}

actor MagmaIgniteFX2 : MagmaIgniteFX1
{
States
{
Spawn:
HEAP T 0
HEAP TTT 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
HEAP T 1
stop
}
}

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
Done:
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4,1)
stop
}
}

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
Done:
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4,1)
stop
}
}