actor ScrambleThunderWep : Weapon {}

actor ScrambleThunderWepSH : BaseMM8BDMWep
{
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_SCRAMBLETHUNDER"
Obituary "$OB_SCRAMBLETHUNDER"
Tag "$TAG_SCRAMBLETHUNDER"
weapon.ammotype "ScrambleThunderAmmo"
inventory.icon "STHUICON"
States
{
SpawnLoop:
11WP G 1
loop
Ready:
STHU A 0 ACS_ExecuteAlways(998,0,246)
STHU A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
STHU A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
STHU A 1 A_Raise
Loop
Fire:
STHU A 0 A_JumpIfNoAmmo("NoAmmo")
STHU A 1 //A_Stop
STHU A 0 ThrustThingZ(0,40,0,0)
STHU AABBB 1
STHU A 0 A_PlaySoundEx("weapon/scrambleshot","Weapon")
STHU A 0 A_FireCustomMissile("ScrambleThunderStart",0,1,0,0)
STHU A 0 
STHU A 0 
STHU A 0 
FireEnd:
STHU CBA 5
STHU A 0 A_Refire
Goto Ready+1
NoAmmo:
STHU A 1 ACS_Execute(979,0)
Goto Ready+1
}
}

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

actor ScrambleThunderStart : PlugBallStart
{
+BRIGHT
Damage (13)
Obituary "$OB_SCRAMBLETHUNDER"
damagetype "ScrambleThunder"
States
{
Spawn:
SCTH E 0
SCTH E 0 ThrustThingZ(0,-32,0,0)
SpawnLoop:
SCTH EEEFFFGGG 1 ThrustThingZ(0,-2,0,4)
loop
Death:
TNT1 A 0 A_PlaySoundEx("weapon/scrambletravel","Weapon")
TNT1 A 0 A_CustomMissile("ScrambleThunder",0,0,0,2,0)
TNT1 A 1 A_CustomMissile("ScrambleThunder",0,0,180,2,0)
stop
XDeath:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/scrambleboom","Weapon")
SCTH H 1 A_Explode(15, 100, 0,0,100)
SCTH I 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
//SCTH HIJKJLJMJKJLJMJKJLJM 3 A_Explode(5, 100, 0,0,100)
stop
}
}

actor ScrambleThunder : PlugBall
{
+BRIGHT
+DONTSPLASH
Obituary "$OB_SCRAMBLETHUNDER"
damagetype "ScrambleThunder"
Damage (6)
Speed 24
reactiontime 140
States
{
Spawn:
SCTH A 0
SCTH A 0 A_SetUserVar(user_x, x)
SCTH A 0 A_SetUserVar(user_y, y)
SCTH A 0 A_GiveInventory("Once", 1)
SCTH A 0 ACS_ExecuteAlways(206, 0)
SCTH A 0 A_ChangeVelocity(0, 0, -36, CVF_RELATIVE|CVF_REPLACE)
SpawnLoop1:
SCTH A 0 A_ChangeVelocity(36, 0, -36, CVF_RELATIVE|CVF_REPLACE)
SCTH A 1 A_CountDown
SCTH A 0 A_CheckFloor("SpawnLoop2")
goto Fall
SpawnLoop2:
SCTH A 0 A_JumpIf((user_x-x < 2 && user_x-x > -2) && (user_y-y < 2 && user_y-y > -2) /*|| (z > user_z)*/, "Death")
SCTH A 0 A_SetUserVar(user_x, x)
SCTH A 0 A_SetUserVar(user_y, y)
SCTH B 1 A_CountDown
SCTH A 0 A_CheckFloor("SpawnLoop3")
goto Fall
SpawnLoop3:
SCTH A 0 A_ChangeVelocity(36, 0, -36, CVF_RELATIVE|CVF_REPLACE)
SCTH C 1 A_CountDown
SCTH A 0 A_CheckFloor("SpawnLoop4")
goto Fall
SpawnLoop4:
SCTH A 0 A_JumpIf((user_x-x < 2 && user_x-x > -2) && (user_y-y < 2 && user_y-y > -2) /*|| (z > user_z)*/, "Death")
SCTH A 0 A_SetUserVar(user_x, x)
SCTH A 0 A_SetUserVar(user_y, y)
SCTH D 1 A_CountDown
SCTH A 0 A_CheckFloor("SpawnLoop1")
goto Fall
Fall:
SCTH A 0 A_JumpIf(z-floorz < 32, "FallLoop")
SCTH A 0 A_Warp(AAPTR_DEFAULT)
FallLoop:
SCTH A 0 A_ChangeVelocity(0, 0, -36, CVF_RELATIVE|CVF_REPLACE)
SCTH ABCD 1 A_CheckFloor("Continue")
SCTH A 0 A_CountDown
loop
Continue:
SCTH A 0 A_ChangeVelocity(36, 0, 0, CVF_RELATIVE|CVF_REPLACE)
goto SpawnLoop1
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/scrambleboom","Weapon")
SCTH H 1 A_Explode(15, 100, 0,0,100)
SCTH I 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH K 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH L 1 A_Stop
SCTH J 1 A_Explode(15, 100, 0,0,100)
SCTH M 1 A_Stop
//SCTH HIJKJLJMJKJLJMJKJLJM 3 A_Explode(5, 100, 0,0,100)
stop
}
}