actor Toadman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_4B"
dropitem "RainFlushWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Obituary "$OB_RAINFLUSH"
weapon.ammotype "ShantaeDanceAmmo"
States
{
Spawn:
C_04 B 1
loop

Deselect:
TARM A 0
goto DeselectSwap
Select:
TARM A 0
goto SelectSwap

Ready:
TARM A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_TOADMAN)
TARM A 0 A_GiveInventory("SpawningMisfire",1)
goto Ready2
Ready2:
TARM A 2 A_WeaponReady
TARM A 0 A_TakeInventory("SpawningMisfire",1)
Goto Ready3
Ready3:
TARM A 0 A_TakeInventory("CBM_DisableJumpPower")
TARM A 0 A_GiveInventory("ToadLeapFlagE",1)
TARM A 0 A_TakeInventory("ToadLeapFlag")
TARM A 0 A_JumpIfInventory("ToadLeapDelay",1,"Ready3a")
TARM A 1 A_WeaponReady
wait
Ready3a:
TARM A 1 A_WeaponReady(8)
Goto Ready3+1

SpawnProtect:
TARM A 1
Goto Ready2

Fire:
TARM A 0 A_JumpIfInventory("IsBot",1,"BotFire")
TARM A 0 A_JumpIfInventory("SpawningMisfire",1,"SpawnProtect")
TARM A 0 A_JumpIfInventory("VivifyFlag2",1,"FirePT2")
TARM A 0 A_GiveInventory("ToadM_DanceStart_P")
TARM B 0 A_Refire(1)
TARM B 1
TARM B 0 A_GiveInventory("CBM_DisableJumpPowerGiver",1)

TARM B 0 A_GiveInventory("ShantaeDanceAmmo",1)

TARM B 0 A_TakeInventory("ToadLeapFlag")
TARM B 1 A_TakeInventory("ToadLeapFlagX")
TARM B 0 A_GunFlash("Flash.Toad", 1)
goto FireL

Flash.Toad:
TNT1 A 0 A_JumpIf(z-floorz!=0,3)
TNT1 A 1 A_ChangeVelocity((momx)*1.045,(momy)*1.045,(momz),CVF_REPLACE)
TNT1 A 0 A_JumpIfInventory("VivifyFlag1",1,"Flash.Toad")
stop
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("VivifyFlag1",1,"Flash.Toad")
stop

FireL:
TARM C 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM C 0 A_Refire(1)
goto FireLEnd1
TARM C 1 A_GiveInventory("ToadM_MainCharge_P")
TARM C 0 A_Refire(1)
goto FireLEnd1
TARM C 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM C 0 A_Refire(1)
goto FireLEnd1
TARM C 1 A_GiveInventory("ToadM_MainCharge_P")
TARM C 0 A_Refire(1)
goto FireLEnd1
TARM C 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM C 0 A_Refire(1)
goto FireLEnd1
TARM C 1 A_GiveInventory("ToadM_MainCharge_P")
TARM C 0 A_Refire(1)
goto FireLEnd1

TARM D 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM D 0 A_Refire(1)
goto FireLEnd2
TARM D 1 A_GiveInventory("ToadM_MainCharge_P")
TARM D 0 A_Refire(1)
goto FireLEnd2
TARM D 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM D 0 A_Refire(1)
goto FireLEnd2
TARM D 1 A_GiveInventory("ToadM_MainCharge_P")
TARM D 0 A_Refire(1)
goto FireLEnd2
TARM D 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM D 0 A_Refire(1)
goto FireLEnd2
TARM D 1 A_GiveInventory("ToadM_MainCharge_P")
TARM D 0 A_Refire(1)
goto FireLEnd2

TARM E 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM E 0 A_Refire(1)
goto FireLEnd3
TARM E 1 A_GiveInventory("ToadM_MainCharge_P")
TARM E 0 A_Refire(1)
goto FireLEnd3
TARM E 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM E 0 A_Refire(1)
goto FireLEnd3
TARM E 1 A_GiveInventory("ToadM_MainCharge_P")
TARM E 0 A_Refire(1)
goto FireLEnd3
TARM E 1 A_JumpIfInventory("PlayerPropertyRage",1,2)
TARM E 0 A_Refire(1)
goto FireLEnd3
TARM E 1 A_GiveInventory("ToadM_MainCharge_P")
TARM E 0 A_GiveInventory("VivifyFlag2",1)
TARM E 0 A_Refire("FirePT2")
goto FireLEnd3

FireLEnd3:
TARM E 0 A_PlaySound("class/ToadCroak",1,1.0)
TARM E 0 A_GiveInventory("ToadM_DanceReset_P",1)
TARM EE 2 A_TakeInventory("ShantaeDanceAmmo",4)
goto FireLEnd2+2
FireLEnd2:
TARM D 0 A_PlaySound("class/ToadCroak",1,1.0)
TARM D 0 A_GiveInventory("ToadM_DanceReset_P",1)
TARM DD 2 A_TakeInventory("ShantaeDanceAmmo",4)
goto FireLEnd1+2
FireLEnd1:
TARM C 0 A_PlaySound("class/ToadCroak",1,1.0)
TARM C 0 A_GiveInventory("ToadM_DanceReset_P",1)
TARM CC 2 A_TakeInventory("ShantaeDanceAmmo",4)
goto FireLEnd
FireLEnd:
TARM AA 2 A_TakeInventory("ShantaeDanceAmmo",14)
Goto Ready3

Altfire:
TARM A 0 A_JumpIf(floorz-z==0,"Leap")
TARM A 1
Goto Ready3
Leap:
TARM A 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,true)
TARM A 0 A_GiveInventory("ToadLeapFlag",1)
TARM A 0 A_TakeInventory("ToadLeapStack")
TARM A 0 A_TakeInventory("ToadLeapFlagE")
TARM A 0 ThrustThingZ(0,20,1,0)
TARM GH 4
TARM G 0 A_GiveInventory("CBM_DisableJumpPowerGiver",1)
TARM G 0 A_PlaySoundEx("weapon/superarmuse","Weapon")
TARM G 0 ThrustThingZ(0,80,0,0)
TARM G 0 A_Recoil(-30)
TARM G 0 A_GiveInventory("ToadLeapRageCheck",1)
TARM G 0 A_JumpIfInventory("PlayerPropertyRage",1,"LeapUp_R")
//TARM G 15
//TARM G 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,false)
//TARM G 25
Goto LeapUp

LeapUp:
TARM GGGGGGGGGGGGGGG 1 A_JumpIf(momz<=0,"LeapFallS")
goto LeapFallS
LeapUp_R:
TARM GGGGGGGG 1 A_JumpIf(momz<=0,"LeapFallS")
goto LeapFallS
LeapFallS:
TARM G 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,false)
goto LeapFall
LeapBounce:
TARM HHG 2
TARM G 2 A_TakeInventory("ToadLeapFlagX")
goto LeapFall

LeapFall:
TARM G 0 A_JumpIfInventory("ToadLeapFlagX",1,"LeapBounce")
TARM G 0 A_JumpIf(z-floorz==0,"Ready3")
TARM G 0 A_JumpIf(momz==0,4)
TARM G 0 A_SpawnItemEx("ToadLeapCrush",1,0,-10,momx,momy,-12,0,8)
TARM G 1 A_WeaponReady(14)
TARM G 0 A_JumpIfInventory("ToadLeapDelay",1,"LeapFall")
goto LeapFallR
TARM G 0 A_JumpIfInventory("ToadLeapFlagX",1,"LeapBounce")
TARM G 0 A_SpawnItemEx("ToadLeapCrush",1,0,-10,momx,momy,-12,0,8)
TARM G 1 A_WeaponReady(14)
TARM G 0 A_JumpIf(z-floorz==0,"Ready3")
TARM G 0 A_JumpIf(momz==0,"Ready3")
TARM G 0 A_JumpIfInventory("ToadLeapDelay",1,"LeapFall")
goto LeapFallR
LeapFallR:
TARM G 0 A_JumpIfInventory("ToadLeapFlagX",1,"LeapBounce")
TARM G 0 A_JumpIf(z-floorz==0,"Ready3")
TARM G 0 A_JumpIf(momz==0,3)
TARM G 0 A_SpawnItemEx("ToadLeapCrush",1,0,-10,momx,momy,-12,0,8)
TARM G 1 A_WeaponReady(2)
loop
TARM G 0 A_JumpIfInventory("ToadLeapFlagX",1,"LeapBounce")
TARM G 0 A_SpawnItemEx("ToadLeapCrush",1,0,-10,momx,momy,-12,0,8)
TARM G 1 A_WeaponReady(2)
TARM G 0 A_JumpIf(z-floorz==0,"Ready3")
TARM G 0 A_JumpIf(momz==0,"Ready3")
loop

FirePT2://A_SpawnItemEx("RainFlushClass",0,0,0)
TARM F 0 A_GiveInventory("ShantaeDanceAmmo",4)
TARM F 2 offset(-16,32)A_FireCustomMissile("ToadRainFlushBoom",0,0)
TARM F 2 offset(-8,32)A_TakeInventory("VivifyCycle1")
TARM F 2 offset(1,32)
TARM F 2 offset(8,32)
TARM F 2 offset(16,32)A_FireCustomMissile("ToadRainFlushBoom2",0,0)
TARM F 2 offset(8,32)
TARM F 2 offset(-1,32)
TARM F 2 offset(-8,32)
TARM F 2 offset(-16,32)A_FireCustomMissile("ToadRainFlushBoom3",0,0)
TARM F 2 offset(-8,32)
TARM F 2 offset(1,32)
TARM F 2 offset(8,32)
TARM F 2 offset(16,32)A_FireCustomMissile("ToadRainFlushBoom3",0,0)
TARM F 2 offset(8,32)
TARM F 2 offset(-1,32)
TARM F 2 offset(-8,32)
TARM A 0 A_Refire("FireHRain")
goto FireEnd
FireHRain:
TARM F 0 A_FireCustomMissile("ToadRainFlushBoom4",0,0)
TARM F 2 offset(-16,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(-8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(1,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 0 A_FireCustomMissile("ToadRainFlushBoom4",0,0)
TARM F 2 offset(16,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(-1,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(-8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 0 A_FireCustomMissile("ToadRainFlushBoom4",0,0)
TARM F 2 offset(-16,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(-8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(1,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 0 A_FireCustomMissile("ToadRainFlushBoom4",0,0)
TARM F 2 offset(16,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 2 offset(-1,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire(1)
goto FireEnd
TARM F 0 A_JumpIfInventory("IsBot",1,"BotFire4")
TARM F 2 offset(-8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire("FireHRainCheck")
goto FireEnd
FireHRainCheck:
TARM F 0 A_TakeInventory("ShantaeDanceAmmo",2,1)
TARM F 0 A_JumpIfInventory("ShantaeDanceAmmo",1,"FireHRain")
goto FireEnd

FireEnd:
TNT1 A 2 offset(1,32)A_GiveInventory("ToadM_DanceReset_P",1)
TNT1 AAAAAAAAAA 2 A_TakeInventory("ShantaeDanceAmmo",3)
TARM HG 2 A_TakeInventory("ShantaeDanceAmmo",14)
Goto Ready3

BotFire:
TNT1 A 0 A_JumpIfCloser(1000,"BotFire2")
TARM A 1 A_Jump(16,"AltFire")
goto Ready3
BotFire2:
TNT1 A 0 A_Jump(220,2)
TNT1 A 0 A_GiveInventory("BotFloorJump")
TNT1 A 0 A_JumpIfCloser(350,"BotFire3")
TARM A 1 A_Jump(4,"AltFire")
goto Ready3
BotFire3:
TARM A 0
goto Fire+2
BotFire4:
TARM F 0 A_Jump(8,"FireEnd")
TARM F 0 A_FaceTarget
TARM F 0 A_JumpIfCloser(640,2)
TARM F 0 A_Jump(40,"FireEnd")
TARM F 2 offset(-8,32)A_GiveInventory("VivifyCycle1",1)
TARM F 1 A_Refire("FireHRainCheck")
goto FireEnd
}
}

actor ShantaeDanceAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor ToadLeapStack : Inventory
{
inventory.amount 1
inventory.maxamount 8
}

actor ToadLeapDelay : Powerup
{
+INVENTORY.ADDITIVETIME
Powerup.Duration 20
}
actor ToadLeapFlag :OnceC{}
actor ToadLeapFlagX :OnceC{}
actor ToadLeapFlagE :OnceC{}

actor ToadLeapRageCheck : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("ToadLeapDelay",1)
stop
}
}

actor ToadM_MainCharge_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("ShantaeDanceAmmo",3)
TNT1 A 1 A_GiveInventory("VivifyCycle1",1)
stop
}
}


actor ToadM_DanceStart_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("ToadLeapFlagE",1)
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,true)
TNT1 A 0 A_PlaySound("class/ToadDance",1,1.0)
TNT1 A 0 A_GiveInventory("VivifyFlag1",1)
TNT1 A 0 A_GiveInventory("VivifyCycle1",2)
TNT1 A 0 A_GiveInventory("CBM_DisableSpeedPowerGiver",1)
stop
}
}

actor ToadM_DanceReset_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("VivifyFlag1")
TNT1 A 0 A_TakeInventory("VivifyFlag2")
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,false)
TNT1 A 0 A_TakeInventory("VivifyCycle1")
TNT1 A 0 A_TakeInventory("CBM_DisableJumpPower")
TNT1 A 0 A_TakeInventory("CBM_DisableSpeedPower")
stop
}
}

actor ToadRainFlushSoakify : SoakifyEffect {args 512}

actor ToadRainFlushBoom : BasicExplosion
{
PainSound "weapon/rainflush"
damagetype "ToadM_Rain"
Obituary "$OB_RAINFLUSH"
RenderStyle None
ReactionTime 35
Args 120,480,112
States
{
Spawn:
TNT1 A 0
Soak:
TNT1 A 1
TNT1 A 0 A_Pain
TNT1 A 0 A_Explode(Args[0],Args[1],0,0,Args[2])//256//A_Explode(500,450,0)
TNT1 A 0 A_SpawnItemEx("ToadRainFlushSoakify")
Spawn2:
TNT1 AAAA 0 A_SpawnItemEx("ToadRainSprinkleFX", random(-248,428), random(-438,438), 306, -30, 0, -30, 180, 1+128)
TNT1 A 0 A_SpawnItemEx("ToadM_DrizzleFX", random(-248,428), random(-438,438), 306, -30, 0, -30, 180, 1+32+128)
TNT1 A 1
TNT1 A 0 A_CountDown
loop
}
}

actor ToadRainFlushBoom2 : ToadRainFlushBoom
{
PainSound ""
ReactionTime 1
Args 120,480,80
}

actor ToadRainFlushBoom3 : ToadRainFlushBoom2
{
damagetype "ToadM_Rain2"
Args 100,496,48
}

actor ToadRainFlushBoom4 : ToadRainFlushBoom3
{
PainSound "weapon/ShortRain"
damagetype "ToadM_Rain2"
ReactionTime 9
Args 90,512,16
}

actor ToadRainSprinkleFX : BasicGraphicEffect
{
States
{
SpawnFrame:
TARM RSRSRSRSRSRSRSR 2
stop
}
}

actor ToadM_DrizzleFX
{
var int user_TranslateWhiteColors;
PROJECTILE
+RIPPER
+NOINTERACTION
+THRUACTORS
+DONTBLAST
+DONTREFLECT
+CLIENTSIDEONLY
Reactiontime 1
Damage (0)
Radius 3
Height 4
Speed 30
Scale 2.5
Args 15
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TARM R 0
SpawnL:
TARM RR 1 A_JumpIf(ceilingz-z>5,"Spawn2")
TARM R 0 A_JumpIf(momz==0,"Death")
TARM R 0 A_CountDownArg(0,"SpawnD")
TARM SS 1 A_JumpIf(ceilingz-z>5,"Spawn2")
TARM S 0 A_JumpIf(momz==0,"Death")
TARM S 0 A_CountDownArg(0,"SpawnD")
loop
Spawn2:
TNT1 A 0 A_SpawnItemEx("ToadM_DrizzleFX1",0,0,0,-30,0,-30,0,1+32+32768)
stop
SpawnD:
TARM R 1// A_CountDown
stop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ToadM_DrizzleBlipFX2",0,0,0,0,0,0,0,1+32)
TNT1 A 2
stop
}
}
actor ToadM_DrizzleFX1 : ToadM_DrizzleFX
{
-RIPPER
-NOINTERACTION
States
{
Spawn:
TARM RS 2 A_CountDownArg(0,"SpawnD")
TARM R 0 A_JumpIf(momz==0,"Death")
//TARM R 0 A_CountDown
loop
}
}
actor ToadM_DrizzleBlipFX2 : BasicGraphicEffect
{
var int user_TranslateWhiteColors;
States
{
SpawnFrame:
TARM TU 2
stop
}
}


actor PainToadM_LeapHit : BasicWatcher
{
States
{
Spawn:
TNT1 A 0 nodelay A_GiveToTarget("ToadM_Leap_P",1,AAPTR_TARGET)
stop
}
}

actor ToadLeapCrush
{
PROJECTILE
Obituary "$OB_TOADLEAP"
damagetype "ToadM_Leap"
+DONTBLAST
+DONTREFLECT
+THRUGHOST
renderstyle none
damage (200+CallACS("core_checkrune",RUNE_SPREAD,2)*400)
Radius 24
Height 2
States
{
Spawn:
TNT1 A 1
stop
}
}

actor ToadM_LeapProtect : PowerProtection
{
Powerup.Duration 6
DamageFactor "ToadM_Leap", 0.0
}

actor ToadM_Leap_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("ToadLeapFlagX",1)
TNT1 A 0 A_JumpIfInventory("ToadLeapStack",8,"Pickup2")
TNT1 A 0 A_GiveInventory("ToadLeapStack",1+CallACS("core_checkrune",RUNE_SPREAD)*2)
goto Pickup1
Pickup1:
TNT1 A 0 A_PlaySoundEx("weapon/ToadCrush","Body")
goto PickupT
Pickup2:
TNT1 A 0 A_PlaySoundEx("weapon/ToadCrushUp","Body")
TNT1 A 0 A_GiveInventory("CBM_HealThing100_PU",1)
goto PickupT
PickupT:
TNT1 A 0 ThrustThingZ(0,48+((CallACS("cbm_GetPointerButtonInput",0,false) & BT_JUMP)>0)*48,0,0)
stop
}
}


actor Toadman_W_NormalBar : NormalBar {Args 4,104}