actor StarSpurUpgrade : BaseMM8BDMUseItem
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_STARSPUR"
Tag "$TAG_STARSPUR"
inventory.icon "W601ICON"
Inventory.PickupSound "item/1up"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
W601 A 1 A_SpawnItemEx("StarSpurMapMarker")
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_TakeInventory("BusterGiven", 999)
TNT1 A 0 A_GiveInventory("BusterGiven",9)
TRBB I 0 A_GiveInventory("StarSpurWepSH",1)
TRBB I 0 A_SelectWeapon("StarSpurWepSH")
stop
}
}

actor StarSpurUpgradeBalcony : BaseMM8BDMUseItem
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_STARSPUR"
Tag "$TAG_STARSPUR"
inventory.icon "W601ICON"
Inventory.PickupSound "item/1up"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
scale 2.0
+COUNTITEM
+INVBAR
+THRUACTORS
states
{
SpawnLoop:
W601 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("StarSpurMapMarker")
W601 A 0 A_ChangeFlag("THRUACTORS",0)
SpawnLoop2:
W601 A 1 A_SpawnItemEx("StarSpurMapMarker")
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_TakeInventory("BusterGiven", 999)
TNT1 A 0 A_GiveInventory("BusterGiven",9)
TRBB I 0 A_GiveInventory("StarSpurWepSH",1)
TRBB I 0 A_SelectWeapon("StarSpurWepSH")
TRBB I 0 A_TakeInventory("StarSpurUpgradeBalcony",1)
stop
}
}


actor StarSpurMapMarker : MapMarker
{
height 0
radius 0
+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
+NOTIMEFREEZE
States
{
Spawn:
W601 A 2
stop
}
}

actor StarSpurWepSH : BaseMM8BDMWep
{
//$Title Star Spur
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Inventory.Pickupmessage "$PU_STARSPUR"
Obituary "$OB_STARSPUR"
weapon.ammotype "BusterAmmo"
Tag "$TAG_STARSPUR"
inventory.pickupsound "weapon/weaponup"
inventory.icon "NULLICON"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
SpawnLoop:
W601 A 1
loop
Ready:
SPUR D 0 ACS_ExecuteAlways(998,0,5601)
SPUR D 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SPUR D 1
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SPUR D 1
Loop
Altfire:
SPUR D 4
Goto Fire1X
Fire:
SPUR D 1
Goto Hold
Fire1:
SPUR D 0 A_PlaySoundEx("CaveStory/ProjectilePure","SoundSlot7")
SPUR D 0 A_FireCustomMissile("W_SpurShot",0,0,8,0)
SPUR D 0 A_TakeInventory("WeaponCharge",999)
SPUR D 0 A_TakeInventory("SpurDoubleCheck",999)
SPUR D 0
SPUR H 2
SPUR I 1
SPUR H 0 A_Refire
Goto Ready+1
Fire1X:
SPUR D 0 A_PlaySoundEx("CaveStory/ProjectilePure","SoundSlot7")
SPUR D 0 A_FireCustomMissile("W_SpurShot",0,0,8,0)
SPUR D 0 A_TakeInventory("WeaponCharge",999)
SPUR D 0 A_TakeInventory("SpurDoubleCheck",999)
SPUR D 0
SPUR H 2
SPUR I 1
SPUR D 0 A_Refire
Goto Ready+1
Fire2:
SPUR D 0 A_TakeInventory("WeaponCharge",999)
SPUR D 0 A_TakeInventory("SpurDoubleCheck",999)
SPUR D 0 ACS_ExecuteAlways(991,0,5601)
SPUR D 0 A_PlaySoundEx("CaveStory/Spur1","SoundSlot7")
SPUR D 0 A_FireCustomMissile("W_SpurLaser1",0,0,8,0)
SPUR HI 1
SPUR D 0
SPUR D 0 A_Refire
Goto Ready+1
Fire3:
SPUR D 0 A_TakeInventory("WeaponCharge",999)
SPUR D 0 A_TakeInventory("SpurDoubleCheck",999)
SPUR D 0 A_PlaySoundEx("CaveStory/Spur2","SoundSlot7")
SPUR D 0
SPUR D 0 ACS_ExecuteAlways(991,0,5601)
SPUR D 0 A_FireCustomMissile("W_SpurLaser2",0,0,8,0)
SPUR HI 1
SPUR D 0
SPUR D 0 A_Refire
Goto Ready+1
FireMax:
SPUR D 0 A_TakeInventory("WeaponCharge",999)
SPUR D 0 A_TakeInventory("CutterFlag",999)
SPUR D 0 A_TakeInventory("SpurDoubleCheck",999)
SPUR D 0 A_PlaySoundEx("CaveStory/Spur3","SoundSlot7")
SPUR D 0
SPUR D 0 ACS_ExecuteAlways(991,0,5601)
SPUR D 0 A_FireCustomMissile("W_SpurLaser3",0,0,8,0)
SPUR HHIIII 2
SPUR Y 27
SPUR B 0 A_Refire
Goto Ready+1
Hold:
SPUR D 0 A_JumpIfInventory("CutterFlag",666,"HoldMax")
SPUR D 0 A_JumpIfInventory("SpurDoubleCheck",3,"Hold1")
SPUR D 0
SPUR D 1 A_GiveInventory("SpurDoubleCheck",1)
SPUR D 0 A_Refire
Goto Fire1
Hold1:
SPUR D 0 A_JumpIfInventory("CutterFlag",666,"HoldMax")
SPUR D 0 //A_StopSoundEx("Weapon")
SPUR D 0 A_PlaySoundEx("CaveStory/SpurCharge1","Weapon")
SPUR D 0 A_JumpIfInventory("WeaponCharge",8,"Hold2")
SPUR D 1
SPUR D 1
SPUR D 1 A_GiveInventory("WeaponCharge_RC",1)
SPUR D 0 A_Refire
Goto Fire1
Hold2:
SPUR D 0 A_JumpIfInventory("CutterFlag",666,"HoldMax")
SPUR D 0 //A_StopSoundEx("Weapon") 
SPUR D 0 A_PlaySoundEx("CaveStory/SpurCharge2","Weapon")
SPUR D 0 ACS_ExecuteAlways(991,0,6601)
SPUR D 0 A_JumpIfInventory("WeaponCharge",16, "Hold3")
SPUR DE 1
SPUR D 0 ACS_ExecuteAlways(991,0,5601)
SPUR D 1 A_GiveInventory("WeaponCharge_RC",1)
SPUR D 0 A_Refire
Goto Fire2
Hold3:
SPUR D 0 A_JumpIfInventory("CutterFlag",666,"HoldMax")
SPUR D 0 //A_StopSoundEx("Weapon")
SPUR D 0 A_PlaySoundEx("CaveStory/SpurCharge3","Weapon")
SPUR D 0 ACS_ExecuteAlways(991,0,7601)
SPUR D 0 A_JumpIfInventory("WeaponCharge",36,"HoldMaxStart")
SPUR F 1
SPUR G 1 ACS_ExecuteAlways(991,0,8601)
SPUR D 0 A_GiveInventory("WeaponCharge_RC",1)
SPUR D 0 A_Refire
Goto Fire3
HoldMaxStart:
SPUR D 0 A_PlaySoundEx("CaveStory/SpurCharged","Weapon")
SPUR D 0 A_GiveInventory("CutterFlag",666)
Goto HoldMax
HoldMax:
SPUR D 0
SPUR E 1 ACS_ExecuteAlways(991,0,6601)
SPUR F 1 ACS_ExecuteAlways(991,0,7601)
SPUR G 1 ACS_ExecuteAlways(991,0,8601)
SPUR D 0 A_Refire
Goto FireMax
}
}

actor SpurDoubleCheck : Inventory //Do you want to charge or not
{
+INVENTORY.IGNORESKILL
inventory.amount 1
inventory.maxamount 5
}

Actor W_SpurShot
{
Obituary "$OB_STARSPUR"
PROJECTILE
+BRIGHT
Damagetype "W_StarSpur"
Radius 14
Height 11
Scale 2.0
Speed 50
Damage (7)
States
{
Spawn:
SPUR M 14
goto XDeath
Death:
SPUR M 0 A_Explode(8,32,0,0,16)
SPUR M 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
XDeath:
Crash:
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 0, 0, -3, 0, 0, 0)
stop
}
}

actor W_SpurShotFlashyEnd
{
scale 3.2
+NOINTERACTION
+NOGRAVITY
states
{
Spawn:
CAST EDC 3
stop
}
}

actor W_SpurShotFlashyEndStar : W_SpurShotFlashyEnd
{
states
{
Spawn:
CAST FGHI 2
stop
}
}

actor W_SpurLaser1
{
+BRIGHT
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTREFLECT
+DONTBLAST
+FORCEXYBILLBOARD
+RIPPER
Speed 4
Damagetype "W_StarSpur"
Damage (2)
radius 3
height 3
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("W_SpurShadower1",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)
stop
Death:
SXP2 U 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
}
}

actor W_SpurShadower1
{
+BRIGHT
Obituary "$OB_STARSPUR"
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTREFLECT
+DONTBLAST
+FORCEXYBILLBOARD
+RIPPER
Damagetype "W_StarSpur"
Damage (1)
radius 7
height 7
scale 1.4
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ScaleVelocity(9.5)
//TNT1 A 1
Goto Continue
Continue:
SPUR J 2
SPUR JJ 1 A_SpawnItemEx("W_SpurTrail1",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
goto Continue+1
Death:
SPUR J 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
}
}

actor W_SpurTrail1
{
+BRIGHT
Obituary "$OB_STARSPUR"
PROJECTILE
+RIPPER
+DONTREFLECT
+FORCEXYBILLBOARD
damage (1)
radius 7
height 7
scale 1.4
Damagetype "W_StarSpur"
States
{
Spawn:
SPUR JJJJJ 1 
SPUR JJJJJ 1 A_SpawnItemEx("W_SpurTrail1X",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
Death:
SPUR L 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
}
}

actor W_SpurTrail1X
{
+BRIGHT
Obituary "$OB_STARSPUR"
PROJECTILE
+DONTREFLECT
+RIPPER
+FORCEXYBILLBOARD
damage (0)
radius 7
height 7
scale 1.4
Damagetype "W_StarSpur"
States
{
Spawn:
SPUR LLLl 1 A_SpawnItemEx("W_SpurTrail1XX",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
Death:
SPUR L 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
}
}

actor W_SpurTrail1XX : W_SpurTrail1
{
Damage (0)
scale 1.4
radius 7
height 7
States
{
Spawn:
SPUR N 5
stop
}
}

actor W_SpurLaser2 : W_SpurLaser1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("W_SpurShadower2",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor W_SpurShadower2 : W_SpurShadower1
{
Obituary "$OB_STARSPUR"
Damage (2)
radius 12
scale 2.85
height 24
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ScaleVelocity(9.5)
Continue:
SPUR K 1 A_SpawnItemEx("W_SpurTrail0",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
goto Continue
}
}
actor W_SpurTrail0 : W_SpurTrail1
{
scale 2.85
Damage (2)
+DONTBLAST
radius 12
height 24
States
{
Spawn:
SPUR KKKKKKK 1
SPUR KKKK 1 A_SpawnItemEx("W_SpurTrail2",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor W_SpurTrail2 : W_SpurTrail1
{
Obituary "$OB_STARSPUR"
scale 2.85
Damage (1)
+DONTBLAST
radius 12
height 24
States
{
Spawn:
SPUR OOOOO 1
SPUR O 1 A_SpawnItemEx("W_SpurTrail2X",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}
actor W_SpurTrail2X : W_SpurTrail1X
{
Damage (0)
scale 2.6
radius 18
height 24
States
{
Spawn:
SPUR P 7
stop
}
}

actor W_SpurLaser3 : W_SpurLaser1
{
+THRUGHOST
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("W_SpurShadower3",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor W_SpurShadower3 : W_SpurShadower1
{
Obituary "$OB_STARSPUR"
Damage (3)
scale 2.6
radius 18
height 24
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ScaleVelocity(10.5)
Continue:
SPUR AAAA 1 A_SpawnItemEx("W_SpurTrail3",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
goto Continue+1
}
}

actor W_SpurTrail3 : W_SpurTrail2
{
Obituary "$OB_STARSPUR"
Damage (3)
scale 2.6
radius 18
height 24
States
{
Spawn:
SPUR AAAAA 1
SPUR AA 1 A_SpawnItemEx("W_SpurTrail3X",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor W_SpurTrail3X : W_SpurTrail2
{
Obituary "$OB_STARSPUR"
Damage (3)
scale 2.6
radius 18
height 24
States
{
Spawn:
SPUR BBBBBB 1
SPUR BB 1 A_SpawnItemEx("W_SpurTrail4",0,0,0,momx/3,momy/3,momz/3,0,SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor W_SpurTrail4 : W_SpurTrail2
{
Obituary "$OB_STARSPUR"
Damage (2)
scale 2.6
radius 18
height 24
States
{
Spawn:
SPUR C 9
stop
}
}
