actor MagmaMan_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_9G"
dropitem "MagmaBazookaWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 100
Obituary "$OB_MAGMABAZOOKA"
Inventory.Pickupmessage "Try some Volvic water Tyrannosaurus Alan!"
weapon.ammotype "VolcanicBreakfastAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_09 G 1
loop

Deselect:
MAGX D 0
goto DeselectSwap
Select:
MAGX D 0
goto SelectSwap

Ready:
MAGX D 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_MAGMAMAN)
MAGX D 0 A_GunFlash("Flash.Begin",1)
MAGX PONML 2
goto Ready9


Ready5:
MAGX NL 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY)//4+8
Ready9:
MAGX D 2 A_WeaponReady(8)
loop

Fire:
FireLeft:
MAGX F 0 A_GiveInventory("Magmaman_Fire_P")
MAGX FE 2
//MAGX LMNOP 2
MAGX NOP 2
MAGX P 20//16
goto Ready5

Flash.Begin:
MAGX KJIHG 2
goto Flash

Flash:
MAGX A 0 A_JumpIf(CallACS("cbm_GetPointerButtonInput",0,true) & BT_ALTATTACK,"Flash.FireRight")
MAGX A 1 A_GiveInventory("Magmaman_Flash_P")
loop
Flash.FireRight:
MAGX C 0 A_GunFlash(1)
MAGX C 0 A_GiveInventory("Magmaman_Alt_P")
MAGX C 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX CC 1 A_GiveInventory("Magmaman_Flash_P")
MAGX B 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX BB 1 A_GiveInventory("Magmaman_Flash_P")
//MAGX G 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
//MAGX GG 1 A_GiveInventory("Magmaman_Flash_P")
//MAGX H 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
//MAGX HH 1 A_GiveInventory("Magmaman_Flash_P")
MAGX I 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX II 1 A_GiveInventory("Magmaman_Flash_P")
MAGX J 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX JJ 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")

MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")//
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")//

MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")

//MAGX K 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
//MAGX KK 1 A_GiveInventory("Magmaman_Flash_P")
//MAGX J 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
//MAGX JJ 1 A_GiveInventory("Magmaman_Flash_P")
MAGX I 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX II 1 A_GiveInventory("Magmaman_Flash_P")
//MAGX H 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
//MAGX HH 1 A_GiveInventory("Magmaman_Flash_P")
MAGX G 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
MAGX GG 1 A_GiveInventory("Magmaman_Flash_P")
Goto Flash
}
}


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

actor MagmamanSoundDelay : Powerup
{
powerup.duration 7
}
actor MagmamanReFire_F : Powerup
{
powerup.duration 9
}

actor MagmamanIsIdle_F : Inventory
{
inventory.maxamount 6
}


actor Magmaman_Flash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_HealthDamageRage",14)
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",0,"Reset")
TNT1 A 0 A_JumpIf(!CallACS("cbm_IsInputingMovement",1),1)
goto Reset
TNT1 A 0 A_JumpIfInventory("MagmamanIsIdle_F",0,2)
TNT1 A 0 A_GiveInventory("MagmamanIsIdle_F",1+CallACS("core_checkrune",RUNE_RAGE,0))
stop
TNT1 A 0 A_JumpIfInventory("MagmamanReFire_F",1,"No")
TNT1 A 0 A_GiveInventory("VolcanicBreakfastAmmo",1+CallACS("core_checkrune",RUNE_RAGE,0))
TNT1 A 0 A_GiveInventory("MagmaIgniteFX_P")
stop
No:
TNT1 A 0
stop
Reset:
TNT1 A 0 A_TakeInventory("MagmamanIsIdle_F")
stop

}
}

actor Magmaman_Fire_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("MagmamanReFire_F",1)
TNT1 A 0 A_PlaySound("weapon/magmabazooka",1)
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",8,3)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",-12,0,-8,0)
stop
Pickup2:
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4)
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4,1)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",-15,0,-8,0)
stop
}
}
actor Magmaman_Alt_P : Magmaman_Fire_P
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("MagmamanReFire_F",1)
TNT1 A 0 A_PlaySound("weapon/magmabazooka",4)//7
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",8,3)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB1",12,0,8,0)
stop
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4)
TNT1 A 0 A_TakeInventory("VolcanicBreakfastAmmo",4,1)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("MagmaBazookaB2",15,0,8,0)
stop
}
}

actor MagmaBazookaB1 : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_MAGMABAZOOKA"
damagetype "MagmaM_Shot1"
+BRIGHT
Damage (60)
Radius 10
Height 10
Speed 28
scale 2.5
States
{
Spawn:
Q_9G ABCDEF 2
loop
Death:
TNT1 A 1 A_SpawnItemEx("OilPitIgnite")
stop
}
}

actor MagmaBazookaB2 : MagmaBazookaB1
{
damagetype "MagmaM_Shot2"
Damage (140)
Radius 20
Height 20
States
{
Spawn:
Q_9G GHIJKL 2
loop
Death:
TNT1 A 1 A_SpawnItemEx("OilPitIgnite")
stop
}
}


actor MagmamanBitFX : BasicGraphicEffect
{
+BRIGHT
alpha 0.75
scale 0.5
states
{
SpawnFrame:
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 SpawnFrame+2
}
}

actor MagmaIgniteFX_P : CustomInventory
{
States
{
Pickup:
TNT1 AAA 0 A_SpawnItemEx("MagmamanBitFX",random(12,24),0,random(50,60),frandom(-1,1),0,frandom(0,2),random(0,359),1)
Snd:
TNT1 A 0 A_JumpIfInventory("VolcanicBreakfastAmmo",0,3)
TNT1 A 0 A_JumpIfInventory("MagmamanSoundDelay",1,3)
TNT1 A 0 A_PlaySound("weapon/MagmaMode",7)//4
TNT1 A 0 A_GiveInventory("MagmamanSoundDelay",1)
TNT1 A 0
stop
SndFull:
TNT1 A 0 A_PlaySound("weapon/pharaoh2",7)
stop
}
}


actor MagmaMan_W_NormalBar : NormalBar {Args 216,42}