actor SonicSpinWep_NormalBar : NormalBar{args 196, 199}
actor SonicSpinWep_ScriptBar : ScriptBar{}

actor SonicSpinWep : BaseMM8BDMWep 
{
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_SONICSPIN"
Obituary "$OB_SONICSPIN"
Tag "$TAG_SONICSPIN"
weapon.ammotype "SonicSpinAmmo"
inventory.icon "SNSPICON"
States
{
SpawnLoop:
SNSP Z 1
loop
Ready:
SNSP A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_SONICSPIN)
SNSP A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
SNSP A 0 
goto DeselectSwap
Select:
SNSP A 0 
goto SelectSwap
Fire:
SNSP A 0 A_JumpIfNoAmmo("NoAmmo")
SNSP A 1
SNSP A 0 A_Refire("Hold")
Goto FireA
Altfire:
SNSP A 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
SNSP A 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
SNSP A 1 A_JumpIfInventory("MM8BDMPlayer", 1, 1)
wait
SNSP A 0 A_JumpIfNoAmmo("NoAmmo")
SNSP A 0 A_JumpIfInventory("SonicSpinAmmo", 1, "FireA")
goto NoAmmo
ClassAltfire:
DATK A 0 
goto Super::Altfire
Fire1:
SNSP A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
SNSP A 0 A_TakeInventory("SonicSpinAmmo",1,TIF_NOTAKEINFINITE)
SNSP A 0 A_FireCustomMissile("SonicSpinShot",0,0,8,0)
SNSP A 1 A_TakeInventory("WeaponCharge",999)
SNSP BC 2
SNSP A 1
SNSP A 0 A_Refire
goto Ready+1
FireA:
SNSP A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
SNSP A 0 A_TakeInventory("SonicSpinAmmo",1,TIF_NOTAKEINFINITE)
SNSP A 0 A_FireCustomMissile("SonicSpinShot",0,0,8,0)
SNSP A 1 A_TakeInventory("WeaponCharge",999)
SNSP BC 2
SNSP A 1
SNSP A 0 A_Refire
goto Ready+1
Fire2:
SNSP A 0 A_JumpIfInventory("SonicSpinAmmo", 3, "Fire2r")
SNSP A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
SNSP A 0 A_TakeInventory("SonicSpinAmmo",1,TIF_NOTAKEINFINITE)
SNSP A 0 A_FireCustomMissile("SonicSpinShot",0,0,8,0)
SNSP A 1 A_TakeInventory("WeaponCharge",999)
SNSP BC 2
SNSP A 1
SNSP A 0 A_Refire
goto Ready+1
Fire2r:
SNSP A 0 A_TakeInventory("WeaponCharge",999)
SNSP A 0 A_PlaySoundEx("weapon/minchrgshot","Weapon")
SNSP A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPIN,TCLR_NONE)
SNSP A 0 A_TakeInventory("SonicSpinAmmo",3,TIF_NOTAKEINFINITE)
SNSP A 0 A_FireCustomMissile("SonicSpinMidShot",0,0,8,0)
SNSP BC 2
SNSP B 0 A_Refire
goto Ready+1
Fire3:
SNSP A 0 A_JumpIfInventory("SonicSpinAmmo", 6, "Fire3r")
SNSP A 0 A_TakeInventory("WeaponCharge",999)
SNSP A 0 A_PlaySoundEx("weapon/commandoshot","Weapon")
SNSP A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPIN,TCLR_NONE)
SNSP A 0 A_TakeInventory("SonicSpinAmmo",3,TIF_NOTAKEINFINITE)
SNSP A 0 A_FireCustomMissile("SonicSpinMidShot",0,0,8,0)
SNSP BC 3
SNSP B 0 A_Refire
goto Ready+1
Fire3r:
SNSP A 0 A_TakeInventory("WeaponCharge",999)
SNSP A 2 A_PlaySound("weapon/cfire","Weapon")
SNSP A 0 A_PlaySoundEx("weapon/SonicSpin","Weapon")
SNSP A 0 A_TakeInventory("SonicSpinAmmo",6,TIF_NOTAKEINFINITE)
SNSP A 0 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPIN,TCLR_NONE)
SNSP A 0 A_FireCustomMissile("SonicBeamShot",0,0,8,0)
SNS0 ABCDEF 2
SNSP A 0 A_Refire("Hold")
goto Ready+1
Charge1:
SNSP A 0 A_PlaySoundEx("weapon/mmv_charge","Weapon",1)
SNSP A 0 A_JumpIfInventory("WeaponCharge",35,"Charge2Start")
SNSP D 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPINCHARGE1,TCLR_CHARGE1)
SNSP D 0 A_Refire("Charge1.a")
SNSP D 0 A_StopSoundEx("Weapon")
Goto Fire2
Charge1.a:
SNSP A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPIN,TCLR_NONE)
SNSP A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
SNSP D 0 A_Refire("Charge1")
SNSP D 0 A_StopSoundEx("Weapon")
Goto Fire2
Charge2Start:
SNSP A 0 A_GunFlash("Sound.BusterCharge", GFF_NOEXTCHANGE)
Goto Charge2
Charge2:
SNSP A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPINCHARGE2,TCLR_NONE)
SNSP D 0 A_Refire("Charge2.a")
SNSP D 0 A_StopSoundEx("Weapon")
Goto Fire3
Charge2.a:
SNSP E 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPINCHARGE3,TCLR_CHARGE2)
SNSP D 0 A_Refire("Charge2.b")
SNSP D 0 A_StopSoundEx("Weapon")
Goto Fire3
Charge2.b:
SNSP F 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_SONICSPIN,TCLR_CHARGE3)
SNSP A 0 A_JumpIfInventory("WeaponCharge", 35, 2)
SNSP A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
"####" "#" 0 A_JumpIfInventory("IsBot", 1, "BotFire")
SNSP A 0 A_Refire("Charge2")
SNSP D 0 A_StopSoundEx("Weapon")
Goto Fire3
BotFire:
"####" "#" 0 A_Jump(16, "Fire3")
"####" "#" 0 A_Refire("Charge2")
Goto Fire3

Hold:
SNSP A 0 A_JumpIfInventory("SonicSpinAmmo", 3, "Hold2")
goto NoAmmo
Hold2:
SNSP A 0 A_JumpIfInventory("WeaponCharge",18,"Charge")
SNSP A 1 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
SNSP A 0 A_Refire
Goto Fire1
Charge:
SNSP A 0 A_PlaySoundEx("weapon/mmv_charge","Weapon",1)
SNSP A 0 A_JumpIfInventory("WeaponCharge",19,"Charge1")
Goto Charge1
NoAmmo:
SNSP A 0 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
Sound.BusterCharge:
TNT1 A 6 A_PlaySoundEx("weapon/mmv_charge","Weapon",0)
TNT1 A 1 A_JumpIfInventory("WeaponCharge",1,"Sound.BusterCharge")
TNT1 A 3
stop
}
}

actor SonicSpinAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor SonicSpinProtect : PowerProtection
{
Powerup.Duration 12
damagefactor "SonicSpin", 0.0
}

actor SonicSpinShot : MegaShot
{
damagetype "Buster"
Obituary "$OB_SONICSPIN"
height 10
radius 12
damage (CallACS("vile_cbm_damage",9))
speed 40
Scale 2.5
States
{
Spawn:
TNT1 A 2
SSPN AB 2
goto Spawn+1
}
}

actor SonicSpinMidShot : BasicProjectile
{
translation "198:198=199:199", "192:192=196:196"
PROJECTILE
maxstepheight 32
scale 2.5
Obituary "$OB_SONICSPIN"
+RIPPER
+DONTBLAST
-NOGRAVITY
+NOEXPLODEFLOOR
//+FLOORHUGGER
+STEPMISSILE

Speed 12
Radius 8
Height 32
Damage (CallACS("vile_cbm_damage",7))
Damagetype "Buster" 
States
{
Spawn:
SSPN EEFFGGHH 1 A_CheckFloor("Vroom")
loop
BounceVroom:
SSPN E 0 A_ChangeFlag("HEXENBOUNCE",0)
SSPN EEFFGGHH 1
goto Vroom2

Vroom:
SSPN E 0 A_Recoil(-10)
SSPN EEFFGGHH 1
Vroom1:
SSPN E 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN E 1 A_Recoil(-3)
SSPN E 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN E 1 A_Recoil(-3)
SSPN F 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN F 1 A_Recoil(-3)
SSPN F 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN F 1 A_Recoil(-3)
SSPN G 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN G 1 A_Recoil(-3)
SSPN G 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN G 1 A_Recoil(-3)
SSPN H 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN H 1 A_Recoil(-3)
SSPN H 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN H 1 A_Recoil(-3)
SSPN E 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN E 1 A_Recoil(-3)
SSPN E 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN E 1 A_Recoil(-3)
SSPN F 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN F 1 A_Recoil(-3)
SSPN F 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN F 1 A_Recoil(-3)
SSPN G 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN G 1 A_Recoil(-3)
SSPN G 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN G 1 A_Recoil(-3)
SSPN H 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN H 1 A_Recoil(-3)
SSPN H 0 A_Explode(CallACS("vile_cbm_damage",9),32,0,0,32)
SSPN H 1 A_Recoil(-3)
SSPN E 0 //A_ChangeFlag("HEXENBOUNCE",0)
Goto Vroom1
Death:
SSPN E 0 //A_TakeFromTarget("DrillFlag",99)
Stop
}
}

actor SonicBeamShot : BasicProjectile
{
+BRIGHT
PROJECTILE
Obituary "$OB_SONICSPIN"
damagetype "SonicSpin"
var int user_P;
Damage (CallACS("vile_cbm_damage",25+user_P/2))
Damage (65)
+RIPPER
radius 48
height 48
speed 180
States
{
Spawn:
SSPN C 0
SSPN C 0 A_SpawnItemEx("SonicBeamFX2",0,0,0,0,0,0,0,1)
SSPN C 0 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+30)*2.5,-sin(pitch+30)*2.5,0,1)
SSPN C 0 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+150)*2.5,-sin(pitch+150)*2.5,0,1)
SSPN C 1 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+270)*2.5,-sin(pitch+270)*2.5,0,1)
SSPN C 0 A_SetUserVar("user_P",user_P+1)
SSPN C 0 A_SetPitch(pitch%360+30)
SSPN C 0
SSPN C 0 A_SpawnItemEx("SonicBeamFX2",0,0,0,0,0,0,0,1)
SSPN C 0 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+30)*2.5,-sin(pitch+30)*2.5,0,1)
SSPN C 0 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+150)*2.5,-sin(pitch+150)*2.5,0,1)
SSPN C 1 A_SpawnItemEx("SonicBeamFX1",0,0,0,0,cos(pitch+270)*2.5,-sin(pitch+270)*2.5,0,1)
SSPN C 0 A_SetUserVar("user_P",user_P+1)
SSPN C 0 A_SetPitch(pitch%360+30)
SSPN D 0
SSPN D 0 A_SpawnItemEx("SonicBeamFX4",0,0,0,0,0,0,0,1)
SSPN D 0 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+30)*2.5,-sin(pitch+30)*2.5,0,1)
SSPN D 0 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+150)*2.5,-sin(pitch+150)*2.5,0,1)
SSPN D 1 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+270)*2.5,-sin(pitch+270)*2.5,0,1)
SSPN D 0 A_SetUserVar("user_P",user_P+1)
SSPN D 0 A_SetPitch(pitch%360+30)
SSPN D 0
SSPN D 0 A_SpawnItemEx("SonicBeamFX4",0,0,0,0,0,0,0,1)
SSPN D 0 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+30)*2.5,-sin(pitch+30)*2.5,0,1)
SSPN D 0 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+150)*2.5,-sin(pitch+150)*2.5,0,1)
SSPN D 1 A_SpawnItemEx("SonicBeamFX3",0,0,0,0,cos(pitch+270)*2.5,-sin(pitch+270)*2.5,0,1)
SSPN D 0 A_SetUserVar("user_P",user_P+1)
SSPN D 0 A_SetPitch(pitch%360+30)
loop
}
}
actor SonicBeamFX1 : BasicGraphicEffect
{
+BRIGHT
+FORCEXYBILLBOARD
RenderStyle "translucent"
Alpha 0.9
ReactionTime 7
States
{
SpawnFrame:
TNT1 A 1
SSPN C 1 A_CountDown
SSPN C 0 A_FadeOut
SSPN C 0 A_SetScale(scaleX-0.2)
Goto Spawn+1
}
}
actor SonicBeamFX2 : BasicGraphicEffect
{
+FORCEXYBILLBOARD
RenderStyle "translucent"
Alpha 1.0
ReactionTime 8
States
{
SpawnFrame:
TNT1 A 1
SSPN C 1 A_CountDown
SSPN C 0 A_FadeOut
SSPN C 0 A_SetScale(scaleX-0.2)
Goto SpawnFrame+1
}
}
actor SonicBeamFX3 : BasicGraphicEffect
{
+BRIGHT
+FORCEXYBILLBOARD
RenderStyle "translucent"
Alpha 0.9
ReactionTime 7
States
{
SpawnFrame:
TNT1 A 1
SSPN D 1 A_CountDown
SSPN D 0 A_FadeOut
SSPN D 0 A_SetScale(scaleX-0.2)
Goto SpawnFrame+1
}
}
actor SonicBeamFX4 : BasicGraphicEffect
{
+BRIGHT
+FORCEXYBILLBOARD
RenderStyle "translucent"
Alpha 1.0
ReactionTime 8
States
{
SpawnFrame:
TNT1 A 1
SSPN D 1 A_CountDown
SSPN D 0 A_FadeOut
SSPN D 0 A_SetScale(scaleX-0.2)
Goto SpawnFrame+1
}
}