actor Curly : BasisForHales
{
player.soundclass "BOSS601B"
player.forwardmove 0.85, 0.85
damagefactor "CaveStory", 0.0
damagefactor "Clone", 0.0
+NOTARGET
player.sidemove 0.83, 0.83
player.morphweapon "CurlyBossWeapon"
Translation "198:198=227:227", "192:192=225:225", "84:88=82:82"
States
{
Spawn:
601B A 0
601B B 1
601B A 1
Goto Spawn+2
See:
601B BCDE 5
Goto Spawn+2
Missile:
601B FG 4
Goto Spawn+2

Pain.TimeStopper:
Pain.RNCZaWarudo:
TNT1 A 0 SetPlayerProperty(0,1,4) TNT1 A 0 A_GiveInventory("DioFlashTimeHUD", 1) TNT1 A 0 A_SpawnItem("ZaWarudoHaleFix")
601B AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Stop
601B A 1 SetPlayerProperty(0,0,4)
Goto Spawn

BossPain:
601B H 0 A_PlaySound("CaveStory/Pain")
601B HHHHHHHHH 2 A_SpawnItem("PainFX",-3,18)
601B H 0 SetPlayerProperty(0,0,1)
Goto Spawn+2
Death:
601B H 0 A_PlaySound("CaveStory/Death")
601B H 0 SetPlayerProperty(0,0,4)  
601B H 0 A_NoBlocking
601B H 0 A_Stop
601B H 1 A_GiveToTarget("KilledMe",1)
601B H 1
601B H 0 ACS_ExecuteAlways(400,0,437)
601B H 0 SetPlayerProperty(0,0,4)
601B H 0 A_PlayerScream
TNT1 AAAAAAAAAA 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
PLAY Z 1 A_CheckPlayerDone
wait
}
}

actor CurlyNoQuote : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor CurlyBraceBarrierGiver
{
+NOTARGETSWITCH
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("IronBondFlag",1,"Death")
TNT1 A 2 A_GiveToTarget("IronBondFlag",1)
SpawnX:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner")
TNT1 A 1

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner")
TNT1 A 1

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner")
TNT1 A 1

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner2")
TNT1 A 1

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner2")
TNT1 A 1

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("CurlyRadiusSpawner2")
TNT1 A 1
goto SpawnX
Death:
TNT1 A 0
stop
}
}

actor CurlyRadiusSpawner : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_RadiusGive("BarrierGiveToQuoteCheck",1024,RGF_PLAYERS,1)
stop
Death:
TNT1 A 0
stop}}

actor CurlyRadiusSpawner2 : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_RadiusGive("BarrierGiveToQuoteCheck2",1024,RGF_PLAYERS,1)
stop
Death:
TNT1 A 0
stop}}

actor BarrierGiveToQuoteCheck : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("QuoteBossWeapon",1,1)
stop
TNT1 A 0 A_SpawnItemEx("BraceBarrierFX1",0,0,0,momx,momy,momz,0,SXF_NOCHECKPOSITION)
TNT1 A 0 A_GiveInventory("BraceBarrierProtection",1)
TNT1 A 0 A_GiveInventory("BraceBarrierStrength",1)
stop
}}
actor BarrierGiveToQuoteCheck2 : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("QuoteBossWeapon",1,1)
stop
TNT1 A 0 A_SpawnItemEx("BraceBarrierFX2",0,0,0,momx,momy,momz,0,SXF_NOCHECKPOSITION)
TNT1 A 0 A_GiveInventory("BraceBarrierProtection",1)
TNT1 A 0 A_GiveInventory("BraceBarrierStrength",1)
stop
}}

actor CurlyBoostToggleOnItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "CURMG1"
tag "-== Machine Gun Boost: ON==-"
+INVENTORY.UNDROPPABLE
+COUNTITEM
+INVBAR
states
{
Spawn:
TNT1 A 0
loop
Use:
TNT1 A 0
TNT1 A 1 A_PlaySoundEx("S3_K/Beep","Soundslot7")
TNT1 A 0 A_TakeInventory("CurlyMGBoostFlag",10)
TNT1 A 0 A_GiveInventory("CurlyBoostToggleOffItem",1)
TNT1 A 0 A_TakeInventory("CurlyBoostToggleOnItem",10)
fail
}
}

actor CurlyBoostToggleOffItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "CURMG2"
tag "-== Machine Gun Boost: OFF==-"
+INVENTORY.UNDROPPABLE
+COUNTITEM
+INVBAR
states
{
Spawn:
TNT1 A 0
loop
Use:
TNT1 A 0
TNT1 A 1 A_PlaySoundEx("S3_K/Beep","Soundslot7")
TNT1 A 0 A_GiveInventory("CurlyMGBoostFlag",10)
TNT1 A 0 A_GiveInventory("CurlyBoostToggleOnItem",1)
TNT1 A 0 A_TakeInventory("CurlyBoostToggleOffItem",10)
fail
}
}
