actor Quote : BasisForHales
{
player.soundclass "BOSS601A"
player.forwardmove 0.97, 0.97
player.sidemove 0.95, 0.95
+NOTARGET
damagefactor "Clone", 0.0
player.morphweapon "QuoteBossWeapon"
Translation "198:198=227:227", "192:192=5:5", "84:88=82:82"
States
{
Spawn:
601A A 0
601A B 1
601A A 1
Goto Spawn+2
See:
601A BCDE 5
Goto Spawn
Missile:
601A F 0 A_JumpIfInventory("QuoteMissileLauncherFlag",1,"SuperMissile")
601A FFGG 4
Goto Spawn
SuperMissile:
601A I 0
601A IIII 4
Goto Spawn

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

BossPain:
601A H 0 A_PlaySound("CaveStory/Pain")
601A HHHHHHHHH 2 A_SpawnItem("PainFX",-3,18)
601A H 0 SetPlayerProperty(0,0,1)
Goto Spawn
Death:
601A H 0 A_PlaySound("CaveStory/Death")
601A H 0 SetPlayerProperty(0,0,4)  
601A H 0 A_NoBlocking
601A H 0 A_Stop
601A H 1 A_GiveToTarget("KilledMe",1)
601A H 0 ACS_ExecuteAlways(400,0,437)
601A H 0 SetPlayerProperty(0,0,4)
601A 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 CaveStorySmoke
{
PROJECTILE
+NOINTERACTION
Scale 2.0
States
{
Spawn:
SXP3 ABCDEFG 3
stop
}
}

Actor CaveStoryDeathSmoke : CaveStorySmoke
{
Scale 4.0
}

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

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


actor QuoteBraceBarrierGiver
{
+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("QuoteRadiusSpawner")
TNT1 A 1
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("QuoteRadiusSpawner")
TNT1 A 1
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("QuoteRadiusSpawner")
TNT1 A 1
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("QuoteRadiusSpawner2")
TNT1 A 1
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("QuoteRadiusSpawner2")
TNT1 A 1
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("sh_targetexists")==0,"Death")
TNT1 A 0 A_GiveToTarget("QuoteRadiusSpawner2")
TNT1 A 1
goto SpawnX

Death:
TNT1 A 0
stop
}
}

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

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

actor BarrierGiveToCurlyCheck : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("CurlyBossWeapon",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 BarrierGiveToCurlyCheck2 : CustomInventory
{states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("CurlyBossWeapon",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 BraceBarrierFX1
{
Scale 3.0
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
BRBA A 1 
stop
}
}
actor BraceBarrierFX2
{
Scale 3.0
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
BRBA B 1
stop
}
}


actor BraceBarrierWarper : BaseShieldWarper
{
Scale 3.0
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIfInTargetInventory("PowerBraceBarrier",1,1)
	goto NopeWait
	TNT1 A 0 A_Jump(256, "Shield")
	Goto Shield
	NopeWait:
	TNT1 A 1 A_JumpIfInTargetInventory("PowerBraceBarrier",1,1)
	goto LOOP
	Shield:
	BRBA AAABBB 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
	TNT1 A 0 A_GiveToTarget("BraceBarrierCheck",1)
	goto NopeWait
	}
}

actor BraceBarrierCheck : CustomInventory
{
states
{
Pickup:
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("PowerBraceBarrier",1,"Nevermind")
TNT1 A 0 A_JumpIfInventory("QuoteBossWeapon",1,"Quote")
TNT1 A 0 A_JumpIfInventory("CurlyBossWeapon",1,"Curly")
NeverMind:
TNT1 A 0
stop
Quote:
TNT1 A 0 A_TakeInventory("BraceBarrierHud")
TNT1 A 0 A_GiveInventory("QuoteNoCurly")
stop
Curly:
TNT1 A 0 A_TakeInventory("BraceBarrierHud")
TNT1 A 0 A_GiveInventory("CurlyNoQuote")
stop
}
}


actor BraceBarrierProtection : PowerupGiver
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
Powerup.Type "PowerBraceBarrier"
Powerup.Duration 7
States
{
Spawn:
TNT1 A 1
stop
}
}

actor BraceBarrierStrength : PowerupGiver
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
Powerup.Type "PowerBraceBarrier2"
Powerup.Duration 7
States
{
Spawn:
TNT1 A 1
stop
}
}


actor PowerBraceBarrier : PowerProtection
{
 damagefactor "Normal", 0.60
damagefactor "Crush", 0.25
damagefactor "Falling", 0.25
damagefactor "Fire", 0.25
damagefactor "Drowning", 0.25
damagefactor "Slime", 0.25
damagefactor "Ice", 0.25
damagefactor "Spiney", 0.25
}

actor PowerBraceBarrier2 : PowerDamage
{
 damagefactor "Normal", 1.35
}


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