actor CurlyBossWeapon : MegaBuster
{
tag "Machine Gun LV3 / Nemesis LV1"
Weapon.AmmoUse 1
Weapon.AmmoGive 100
Weapon.SlotNumber 1
Obituary "$OB_CURLYMACHINEGUNL3"
+INVENTORY.UNDROPPABLE
weapon.ammotype "CurlyAmmo"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 1
stop
Ready:
MCHG A 0 ACS_NamedExecuteAlways("GiveExecution",0)
MCHG A 0 A_SpawnItemEx("CurlyBraceBarrierGiver")
MCHG A 0 A_GiveInventory("CurlyNoQuote",1)
MCHG A 1 A_WeaponReady(WRF_NOSWITCH)
MCHG A 0 ACS_ExecuteAlways(991,0,539)
MCHG A 0 A_GiveInventory("CurlyAmmo",1)
MCHG A 2
goto Ready+3
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MCHG A 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MCHG A 1 A_Raise
loop
Fire:
Hold:
MCHG A 0 A_JumpIfNoAmmo("Noammo")
MCHG A 0 A_JumpIfInventory("WeaponCharge",2,"Fire1")
MCHG A 0
MCHG A 1 A_GiveInventory("WeaponCharge",1)
MCHG A 0 A_Refire
Goto FireCancel
FireCancel:
MCHG A 0 A_PlaySoundEx("CaveStory/MachineGun","Weapon")
MCHG A 0 A_TakeInventory("CurlyAmmo", 1)
MCHG A 0 A_JumpIf(pitch>15 && pitch<=90, "ThrustingCancel")
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd2
Fire1:
MCHG A 0 A_PlaySoundEx("CaveStory/MachineGun","Weapon")
MCHG A 0 A_TakeInventory("CurlyAmmo", 1)
MCHG A 0 A_JumpIf(pitch>15 && pitch<=90, "Thrusting")
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd
Thrusting:
MCHG A 0 A_JumpIfInventory("CurlyMGBoostFlag",1,1)
goto NoThrust
MCHG A 0 ThrustThingZ(0,27,0,0)
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd
ThrustingCancel:
MCHG A 0 A_JumpIfInventory("CurlyMGBoostFlag",1,1)
goto NoThrustCancel
MCHG A 0 ThrustThingZ(0,27,0,0)
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd2
NoThrust:
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd
NoThrustCancel:
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-2,2),0,0,0)
goto MachineGunFireEnd2
MachineGunFireEnd:
MCHG B 2
MCHG A 1 A_TakeInventory("WeaponCharge", 999)
goto Ready+3
MachineGunFireEnd2:
MCHG AB 1
MCHG A 0 A_TakeInventory("WeaponCharge", 999)
goto Ready+3
NemesisFire:
MCHG A 1 A_Gunflash("Flash.NemesisFire")
MCHG A 0 A_PlaySoundEx("CaveStory/ProjectilePure","Weapon")
MCHG A 0 A_FireCustomMissile("NemesisShotCurly",random(-3,3),0,0,0)
MCHG A 0 A_TakeInventory("CurlyBraceNemesisAmmo",1)
MCHG AA 2//MCHG BA 2
MCHG A 1 A_Refire
Goto Ready+3
Fire2:
MCHG A 0 A_TakeInventory("BoosterFlag",1)
MCHG BA 1
MCHG A 1 A_Refire
AltFire:
MCHG A 0 A_JumpIfInventory("BossRageCharge",500,"Rage")
MCHG A 1 //A_JumpIfInventory("CurlyBraceNemesisAmmo", 1, "NemesisFire") 
Goto Ready+3
Rage:
MCHG A 0 //A_GiveInventory("CloneSpawner",2)
MCHG A 0 A_PlaySoundEx("BusterRodG/PressureJumpX", "Auto")
MCHG A 0 A_GiveInventory("StarmanSlowDown", 1)
MCHG A 0 ACS_NamedExecuteAlways("sh_speeds",0,9)
MCHG A 2 Offset(20, 40)
MCHG A 2 Offset(40, 80)
MCHG A 2 Offset(60, 120)
MCHG A 2 Offset(80, 160)
MCHG A 0 A_GiveInventory("CurlyBlueScreenOfDeath", 1)
MCHG A 10 Offset(100, 200)
MCHG A 0 A_TakeInventory("BossRageCharge",500)
MCHG A 0 A_SetBlend("99 99 99", 0.95, 15)
MCHG A 0 A_TakeInventory("CurlyBlueScreenOfDeath", 999)
MCHG A 0 A_PlaySoundEx("CaveStory/CurlyGetEquippedWithNemesis", "Auto")
MCHG A 0 A_TakeInventory("PowerSlowMover", 999)
MCHG A 0 ACS_NamedExecuteAlways("sh_speeds",0,0)
MCHG A 0 A_GiveInventory("CurlyBraceNemesisAmmo", 30)
MCHG A 1 A_Gunflash
MCHG A 15 Offset(100, 200)SetPlayerProperty(0, 1, 4)
MCHG A 0 SetPlayerProperty(0, 0, 4)
MCHG A 1 Offset(60, 120)
MCHG A 1 Offset(20, 40)
NoAmmo:
MCHG A 1
goto Ready+3
Flash:
TNT1 A 0
TNT1 A 1 A_JumpIfInventory("CurlyBraceNemesisAmmo",1,"Flash.NemesisEquip")
loop
Flash.NemesisEquip:
TNT1 A 0
NMSS A 15 Offset(100, 200)
NMSS A 1 Offset(60, 120)
NMSS A 1 Offset(20, 40)
goto Flash.NemesisHold
Flash.NemesisHold:
NMSS AAAAAA 1 A_Jumpif(CallACS("SH_ButtonCheck",BT_ALTATTACK) == True,"Flash.NemesisFire")
NMSS A 1 A_JumpIfInventory("CurlyBraceNemesisAmmo",1,"Flash.NemesisHold")
NMSS A 7 
TNT1 A 0
NMSS A 1 Offset(20, 40)
NMSS B 1 Offset(60, 120)
NMSS C 8 Offset(100, 200)
TNT1 A 8
stop
Flash.NemesisFire:
MCHG A 0 A_JumpIfInventory("CurlyBraceNemesisAmmo", 1, 1) 
Goto Flash.NemesisPutAway
NMSS B 1
NMSS A 0 A_PlaySoundEx("CaveStory/ProjectilePure","Weapon")
NMSS A 0 A_FireCustomMissile("NemesisShotCurly",random(-3,3),0,0,0)
NMSS A 0 A_TakeInventory("CurlyBraceNemesisAmmo",1)
NMSS CCCA 1//MCHG BA 2
goto Flash.NemesisHold
Flash.NemesisPutAway:
TNT1 A 0
NMSS A 1 Offset(20, 40)
NMSS A 1 Offset(60, 120)
NMSS A 8 Offset(100, 200)
TNT1 A 8
stop
}
}


actor CurlyBlueScreenOfDeath : Powerup
{
powerup.color 0 81 255, 0.5
powerup.duration -50
}

actor CurlyBraceNemesisAmmo : Ammo
{
+INVENTORY.IGNORESKILL
inventory.amount 1
inventory.maxamount 300
}

actor CurlyMGBoostFlag : OnceC {}

actor BoostChecker 
{
PROJECTILE
//+RIPPER
Height 16
Radius 16
Speed 80
States
{
Spawn:
TNT1 AAAAA 2
stop
//loop
Death:
TNT1 A 0
TNT1 A 0 A_JumpIf(z-floorz==0, "Booster")
stop
Booster:
TNT1 A 1 A_GiveToTarget("CurlyBoost",1)
stop
}
}


actor CurlyBoost : CustomInventory
{
+INVENTORY.AUTOACTIVATE
states
{
Pickup:
TNT1 A 0 A_JumpIf(pitch>15 && pitch<=90, "Thrusting")
stop
Thrusting:
TNT1 A 0 ThrustThingZ(0,27,0,0)
stop
}
}

actor BoosterFlag : Inventory
{
inventory.amount 1
Inventory.MaxAmount 1
}

actor MachineGunShot
{
PROJECTILE
Radius 8
Height 6
Obituary "$OB_CURLYMACHINEGUNL3"
damagetype "CaveStory"
scale 2.5
damage (6)
speed 40
States
{
Spawn:
SXP3 H 26
TNT1 A 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
stop
Death:
TNT1 A 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
stop
BoostCurly:
TNT1 A 0 A_GiveToTarget("CurlyBoost",1)
stop
}
}


actor NemesisShotCurly : MachineGunShot
{
PROJECTILE
+DONTBLAST
Radius 13
Height 10
Obituary "$OB_CURLYNEMESISL1"
damagetype "CaveStory"
scale 4.3
damage (16)
speed 56
states
{
Spawn:
CAST J 0
CAST JKJKJKJKJKJKJKJKJKJKJKJK 1 A_SpawnItemEx("CaveStoryNemesisSmoke", -8, 0, random(-1, 1), random(-5, -1), 0, random(-2, 4))
Death:
TNT1 A 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
stop
}
}

Actor CaveStoryNemesisSmoke : CaveStoryMissileSmoke {renderstyle add}

actor CurlyAmmo : Ammo
{
+INVENTORY.IGNORESKILL
inventory.amount 1
Inventory.MaxAmount 100
}

// Clone //

actor CloneSpawner : CustomInventory
{
inventory.amount 2
inventory.maxamount 2
inventory.icon "SXISI4"
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
TNT1 A 1
loop
Use:
TNT1 A 0 A_SpawnItemEx("CurlyClone",0,5,0,5,0,5)
TNT1 A 1 A_PlaySoundEx("item/refill","weapon")
TNT1 A 0 A_TakeInventory("CloneSpawner",1)
fail
}
}

actor CurlyClone
{
MONSTER
+THRUGHOST
Obituary "%o was gunned down by a Clone."
Height 48
Radius 32
scale 2.5
Health 500
painchance 255
reactiontime 1400
speed 20
damagefactor "TopSpin", 0.40 // 0.5 ; 0.38
damagefactor "FlashBomb", 0.35 // 0.70
damagefactor "GravityHold", 1.35
damagefactor "AtomicFire3", 0.5
damagefactor "WindStorm", 0.7
damagefactor "instagib", 0.0
damagefactor "CaveStory", 0.0
damagefactor "StarCrash", 0.35
//damagefactor "Sakugarne", 1.25
+SHOOTABLE
+NOBLOOD
+WINDTHRUST
+NEVERRESPAWN
-ACTIVATEMCROSS
+FRIENDLY
-SOLID
+FLOAT
+MISSILEMORE
-NOGRAVITY
+LOOKALLAROUND
States
{
Spawn:
SXS9 A 0
SXS9 A 1
SXS9 A 1 A_Look
loop
See:
SXS9 BCDC 5 A_Chase
loop
Missile:
SXS9 E 0 A_FaceTarget
SXS9 E 5
SXS9 E 0 A_PlaySoundEx("weapon/magnetmissile","weapon")
SXS9 E 2 A_CustomMissile("CloneShot",25,0,0,0)
SXS9 E 2 A_FaceTarget
SXS9 E 2 A_CustomMissile("CloneShot",25,0,0,0)
SXS9 E 2 A_CustomMissile("CloneShot",25,0,0,0)
goto see
Pain.WindStorm:
SXS9 F 0 ThrustThingZ(0,25,0,0)
Goto pain
Pain.GravityHold:
SXS9 F 0 A_JumpIf(z-floorz>180,"GravityForce4")
SXS9 F 0 A_JumpIf(z-floorz>128,"GravityForce3")
SXS9 F 0 A_JumpIf(z-floorz>32,"GravityForce2")
SXS9 F 0 A_JumpIf(z-floorz>8,"GravityForce1")
Goto pain
GravityForce4:
SXS9 F 0 A_GiveInventory("GravityForce4",1)
Goto Pain
GravityForce3:
SXS9 F 0 A_GiveInventory("GravityForce3",1)
Goto Pain
GravityForce2:
SXS9 F 0 A_GiveInventory("GravityForce2",1)
Goto Pain
GravityForce1:
SXS9 F 0 A_GiveInventory("GravityForce1",1)
Goto Pain
Pain.FlameSword:
PLAY HH 0 A_SpawnItemEx("ScorchBit",0,0,0,random(-10,10),random(-10,10),random(10,15),random(0,360))
Goto pain
Pain.SlashClaw:
SXS9 F 0 A_PlaySoundEx("weapon/slashclawhit","SoundSlot5")
Goto Pain
Pain.TimeSlow:
SXS9 F 0 A_GiveInventory("Slowed",1)
Goto Pain
Pain:
SXS9 F 0 A_PlaySound("CaveStory/Pain")
SXS9 F 0 A_Pain
SXS9 F 1 A_SpawnItem("PainFX",-3,18)
SXS9 F 1 A_Recoil(1)
SXS9 F 1 A_SpawnItem("PainFX",-3,18)
SXS9 F 1
goto See
Death:
SXS9 F 0
SXS9 F 0 A_PlaySoundEx("weapon/napalm","Weapon")
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
TNT1 A 0 A_SpawnItemEX("CaveStoryDeathSmoke",0,0,15,random(-5,5),random(-5,5),random(-5,5))
PLAY Z 1 A_CheckPlayerDone
stop
}
}

actor CloneShot : MachineGunShot
{
Obituary "%o was gunned down by a Clone."
damage (10)
damagetype "CaveStory"
States
{
Spawn:
SXP3 I 1
loop
}
}
