actor Pluto_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_VH"
Dropitem "BreakDashWep"
weapon.ammouse 0
weapon.ammogive 112
obituary "$OB_PLUTOCLOSE"
Inventory.Pickupmessage "Power up! IN ME POWER!"
weapon.ammotype "OwO_NoticesUrAmmo"
weapon.ammotype2 "BreakingIntoADashAmmo"
States
{
Spawn:
C_0V H 1
loop

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

Ready:
PLUH A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_PLUTO)
PLUH A 0 A_GunFlash("Flash",1)
Goto Ready1

Ready1:
PLUH A 4 A_WeaponReady
PLUH A 0 A_GiveInventory("OwO_NoticesUrAmmo",2)
loop

Fire:
PLUH B 0 A_JumpIfInventory("BreakingIntoADashAmmo",784,"FireFast")
PLUH B 1
PLUH B 2 offset(-10,22)
PLUH B 2 offset(-15,18)
PLUH B 2 offset(-20,12)
PLUH C 0 A_Refire(1)
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 4 offset(-20,12)A_FireCustomMissile("PlutoFireBall",random(-1,1),1,8,0)
PLUH C 0 A_Refire("Fire2")
goto FireEnd
Fire2:
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 4 offset(-20,12)A_FireCustomMissile("PlutoFireBall",random(-1,1),1,8,0)
PLUH C 0 A_Refire("Fire3")
goto FireEnd
Fire3:
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 4 offset(-20,12)A_FireCustomMissile("PlutoFireBall",random(-1,1),1,8,0)
goto FireEnd
FireEnd:
PLUH B 2 offset(-20,12)
PLUH B 2 offset(-15,18)
PLUH B 2 offset(-10,22)
Goto Ready1


FireFast:
PLUH B 1
PLUH B 1 offset(-10,22)A_JumpIfInventory("PlayerPropertyRage",1,1)
PLUH B 1 offset(-13,19)
PLUH B 1 offset(-16,16)A_JumpIfInventory("PlayerPropertyRage",1,1)
PLUH B 1 offset(-20,12)
PLUH C 0 A_Refire(1)
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 3 offset(-20,12)A_FireCustomMissile("PlutoFireBall2",random(-1,1),1,8,0)
PLUH C 0 A_Refire("Fire2Fast")
goto FireFastEnd
Fire2Fast:
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 3 offset(-20,12)A_FireCustomMissile("PlutoFireBall2",random(-1,1),1,8,0)
PLUH C 0 A_Refire("Fire3Fast")
goto FireFastEnd
Fire3Fast:
PLUH C 0 A_PlaySoundEx("weapon/GameBoyFire2","Weapon")
PLUH C 3 offset(-20,12)A_FireCustomMissile("PlutoFireBall2",random(-1,1),1,8,0)
goto FireFastEnd
FireFastEnd:
PLUH B 1 offset(-20,12)A_JumpIfInventory("PlayerPropertyRage",1,1)
PLUH B 1 offset(-16,16)
PLUH B 1 offset(-13,19)A_JumpIfInventory("PlayerPropertyRage",1,1)
PLUH B 1 offset(-10,22)
Goto Ready1

Altfire:
PLUH D 0 A_JumpIfInventory("AirFraudAchieved",2,"AltfireClaw")
PLUH D 0 A_JumpIfInventory("OwO_NoticesUrAmmo",56,"DasherStart")
goto AltfireClaw

AltfireClaw:
PLUH D 2 offset(32,32)A_PlaySoundEx("weapon/slashclaw","Weapon")
PLUH D 2 offset(2,57)A_FireCustomMissile("PlutoFurySwipes2",random(-1,1),1,8,0)
PLUH D 2 offset(-23,88)A_GiveInventory("OwO_NoticesUrAmmo",2)
PLUH E 2 offset(62,22)
PLUH E 2 offset(41,46)
PLUH E 1 offset(29,74)
PLUH E 0 A_Refire("AltfireClaw2")
PLUH E 1 offset(25,92)
TNT1 A 2
goto AltfireClawEnd
AltfireClaw2:
PLUH F 2 offset(-32,32)A_PlaySoundEx("weapon/slashclaw","Weapon")
PLUH F 2 offset(-2,57)A_FireCustomMissile("PlutoFurySwipes",random(-1,1),1,-8,0)
PLUH F 2 offset(23,88)A_GiveInventory("OwO_NoticesUrAmmo",2)
PLUH G 2 offset(-62,22)
PLUH G 2 offset(-41,46)
PLUH G 1 offset(-29,74)
PLUH G 0 A_Refire("AltfireClaw")
PLUH G 1 offset(-25,92)
TNT1 A 2
goto AltfireClawEnd
AltfireClawEnd:
PLUH A 2 offset(-15,86)
PLUH A 2 offset(-8,68)
PLUH A 2 offset(-3,50)
Goto Ready1

DasherStart:
PLUH B 0 A_GiveInventory("PlutoIsDashing",1)
PLUH B 0 A_Refire(1)
PLUH B 1
PLUH B 2 offset(10,42)A_GunFlash("Flash",1)
PLUH B 2 offset(20,52)
PLUH B 2 offset(30,62)
PLUH B 0 //A_TakeInventory("CanWallJump",999)

PLUH B 0 A_GiveInventory("PlutoDashStarter_P",1)
PLUH B 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEON)
PLUH B 0 A_GiveInventory("AirFraudAchieved",1)
PLUH B 0 ACS_NamedExecuteWithResult("core_stopplayer",0,1)
PLUH B 0 A_SetArg(4,momz*100000)
PLUH B 0 A_SetArg(3,momy*100000)
PLUH B 0 A_SetArg(2,momx*100000)

PLUH BBBBBBBBBBBBBBBBBB 1 A_GiveInventory("PlutoBreakDashing_P",1)
//18
PLUH B 0 A_GiveInventory("VivifyDelay4",1)
PLUH B 0 A_TakeInventory("PlutoIsDashing",999)
PLUH B 0 //A_GiveInventory("CanWallJump")
PLUH B 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
PLUH B 0 ACS_NamedExecuteWithResult("core_stopplayer",0,0)
PLUH B 2 offset(30,62)
PLUH B 2 offset(20,52)A_Refire("AltfireClaw")
PLUH B 2 offset(10,42)
goto Ready1

Flash:
TNT1 A 1 A_GiveInventory("PlutoDashFlash_P")
loop
}
}

actor OwO_NoticesUrAmmo : Ammo
{
Inventory.amount 1
Inventory.Maxamount 112
+INVENTORY.IGNORESKILL
}

actor BreakingIntoADashAmmo : Ammo
{
Inventory.amount 1
Inventory.Maxamount 896
+INVENTORY.IGNORESKILL
}

actor PlutoIsDashing : Powerup
{
Powerup.Duration 8
}

actor PlutoPowerTrail : PowerSpeed
{
Speed 1.0
Powerup.Duration 5
}

actor PlutoDashStarter_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("BreakingIntoADashAmmo",784,"PickupBoost")
TNT1 A 0 A_ChangeVelocity(33*cos(pitch),0,33*-sin(pitch),3)
stop
PickupBoost:
TNT1 A 0 A_ChangeVelocity(44*cos(pitch),0,44*-sin(pitch),3)
stop
}
}

actor PlutoBreakDashing_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("OwO_NoticesUrAmmo",1)
TNT1 A 0 A_TakeInventory("OwO_NoticesUrAmmo",2,1)
TNT1 A 0 A_SpawnItemEx("PlutoBreakDashDamager",0,0,32)
TNT1 A 0 A_GiveInventory("PlutoIsDashing",1)
TNT1 A 0 A_JumpIfInventory("VivifyDelay3",1,"No")
TNT1 A 0 A_GiveInventory("VivifyDelay3",1)
TNT1 A 0 A_ChangeVelocity(Args[2]*0.00001,Args[3]*0.00001,Args[4]*0.00001,2)
TNT1 A 0 A_PlaySound("weapon/plutobreakdash",4)
stop
No:
TNT1 A 0
stop
}
}


actor PlutoDashFlash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_DynamicAmmoBaseSpeed",27)

TNT1 A 0 A_JumpIfInventory("PlutoBoostCheckDelay",1,3)
TNT1 A 0 A_GiveInventory("PlutoBoostCheckDelay",1)
TNT1 A 0 A_GiveInventory("PlutoDashAmmoAdjust_P",1)
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("BreakingIntoADashAmmo",784,"BonusSpeed")
stop

BonusSpeed:
TNT1 A 0 A_JumpIfInventory("PlutoPowerTrail",1,2)
TNT1 A 0 A_PlaySound("weapon/plutoultraspeed",7,0.85)
TNT1 A 0 A_GiveInventory("PlutoPowerTrail",1)
stop
}
}

actor PlutoBoostCheckDelay : Powerup
{
Powerup.Duration 2
}

actor PlutoDashDrainDelay : Powerup
{
Powerup.Duration 9
}

actor PlutoDashAmmoAdjust_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 //A_TakeInventory("BreakingIntoADashAmmo",1)
TNT1 A 0 //A_JumpIfInventory("BreakingIntoADashAmmo",896,"Pickup")

TNT1 A 0 A_JumpIfInventory("PlutoIsDashing",1,"P_SpeedCheckD")//PowerWallJumpSpeed
TNT1 A 0 A_JumpIfInventory("PowerWallJumpSpeed",1,"P_SpeedCheckD")
TNT1 A 0 A_JumpIf(CallACS("cbm_IsInputingMovement"),"P_SpeedCheck")//Is attempting to move!
TNT1 A 0 A_JumpIfInventory("PlutoDashDrainDelay",1,"P_Take0")//5
goto P_Take50
P_SpeedCheck:
//TNT1 A 0 A_JumpIf( (MOMX*MOMX+MOMY*MOMY)*0.006 >= 1,"P_Give")
TNT1 A 0 A_JumpIf(sqrt(MOMX*MOMX+MOMY*MOMY)>=11,"P_Give")
TNT1 A 0 A_JumpIfInventory("PlutoDashDrainDelay",1,"P_Take0")
goto P_Take35
P_SpeedCheckD:
TNT1 A 0 A_JumpIf(sqrt(MOMX*MOMX+MOMY*MOMY)>=11,"P_Give")
TNT1 A 0 A_JumpIfInventory("PlutoDashDrainDelay",1,"P_Take0")
goto P_Take5

P_Give:
TNT1 A 0 A_GiveInventory("PlutoDashDrainDelay",1)
TNT1 A 0 A_JumpIfInventory("PlutoIsDashing",1,"P_GiveD")
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,"P_Give_R")
//TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",(MOMX*MOMX+MOMY*MOMY)*0.025)
TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",sqrt(MOMX*MOMX+MOMY*MOMY)*0.5)
stop
P_Give_R:
//TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",(MOMX*MOMX+MOMY*MOMY)*0.04)
TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",sqrt(MOMX*MOMX+MOMY*MOMY)*1)
stop
P_GiveD:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,"P_GiveD_R")
TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",sqrt(MOMX*MOMX+MOMY*MOMY)*0.75)
stop
P_GiveD_R:
TNT1 A 0 A_GiveInventory("BreakingIntoADashAmmo",sqrt(MOMX*MOMX+MOMY*MOMY)*1.5)
stop 

P_Take0:
TNT1 A 0
stop
P_Take5:
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",2)
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",3,1)
stop
P_Take35:
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",15)
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",20,1)
stop
P_Take50:
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",25)
TNT1 A 0 A_TakeInventory("BreakingIntoADashAmmo",25,1)
stop
}
}


actor PlutoFireBall : ProjSpawnFuncActor
{
translation "192:192=56:56", "198:198=60:60"
PROJECTILE
Obituary "$OB_PLUTOSHOT"
Damagetype "Pluto_Shot"
ReactionTime 1
damage (60)
Radius 10
Height 10
speed 40
scale 2.5
States
{
Spawn:
PLUH HIHIHIH 3
PLUH I 1 A_CountDown
wait
Death:
PLUH IHI 1 A_Fadeout
stop
}
}
actor PlutoFireBall2 : PlutoFireBall
{
speed 60
States
{
Spawn:
PLUH HIHIHIH 2
PLUH I 1 A_CountDown
wait
Death:
PLUH IHIHI 1 A_Fadeout
stop
}
}

actor PlutoFurySwipes : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Pluto_Swipe"
Obituary "$OB_PLUTOSWIPE"
+THRUACTORS
+DONTBLAST
+DONTREFLECT
damage (0)
Radius 5
Height 5
speed 30
scale 2.5
States
{
Spawn:
//Y_7F ABCDE
TNT1 A 0
PLUH KLM 1 A_Explode(40,70,0,0,24)
PLUH NO 1 A_Explode(30,70,0,0,24)
stop
}
}

actor PlutoFurySwipes2 : PlutoFurySwipes
{
States
{
Spawn:
//Y_7F FGHIJ
TNT1 A 0
PLUH PQR 1 A_Explode(40,70,0,0,24)
PLUH ST 1 A_Explode(30,70,0,0,24)
stop
}
}

actor Pluto_Dash1Protect : PowerProtection
{
Powerup.Duration 20
DamageFactor "Pluto_Dash1", 0.04
}
actor Pluto_Dash2Protect : PowerProtection
{
Powerup.Duration 20
DamageFactor "Pluto_Dash2", 0.4
}

actor PlutoBreakDashDamager : BasicImplosion
{
obituary "$OB_PLUTODASH"
Damagetype "Pluto_Dash1"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(120+CallACS("core_checkrune",RUNE_SPREAD,2)*240,75,0,0,75)
TNT1 A 0 A_SetDamagetype("Pluto_Dash2")
TNT1 A 2 A_Explode(50+CallACS("core_checkrune",RUNE_SPREAD,2)*100,100,0,0,95)
stop
}
}

actor Pluto_W_NormalBar : NormalBar {Args 4,62}//56 50
actor Pluto_W_SecondBar : SecondBar {Args 4,56}
actor Pluto_W_ScriptBar : ScriptBar {}