actor TornadoBlowWep : BaseMM8BDMWep 10023
{
//$Category MM8BDM-Weapons
//$Title Tornado Blow
//$Sprite TBLOA0
Weapon.AmmoUse 7
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Obituary "$OB_TORNADOBLOW"
Tag "$TAG_TORNADOBLOW"
Inventory.Pickupmessage "$PU_TORNADOBLOW"
weapon.ammotype "TornadoBlowAmmo"
inventory.icon "TORNADBI"
States
{
SpawnLoop:
TBLO A -1
loop
Ready:
TBLH A 0 ACS_ExecuteAlways(998,0,189)
TBLH A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TBLH A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
TBLH A 1 A_Raise
Loop
Fire:
TBLH B 0 A_JumpIfNoAmmo("NoAmmo")
TBLH B 2
TBLH A 0 A_PlaySoundEx("weapon/tornadoblow","Weapon")
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 60, 1, 8, 0)
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 210, 0, 8, 0)
TBLH A 0 A_SpawnItemEx("TornadoDamager")
TBLH C 1 A_GiveInventory("TornadoBlowThrust",1)
TBLH CD 1
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 120, 0, 8, 0)
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 270, 0, 8, 0)
TBLH A 0 A_SpawnItemEx("TornadoDamager")
TBLH D 1 A_GiveInventory("TornadoBlowThrust",1)
TBLH EE 1 

TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 180, 0, 8, 0)
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 0, 0, 8, 0)
TBLH A 0 A_SpawnItemEx("TornadoDamager")
TBLH F 1 A_GiveInventory("TornadoBlowThrust",1)
TBLH F 1
TNT1 A 1
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 240, 0, 8, 0)
TBLH A 0 A_FireCustomMissile("TornadoBlowTracer", 300, 0, 8, 0)
TBLH A 0 A_SpawnItemEx("TornadoDamager")
TNT1 AA 1 A_GiveInventory("TornadoBlowThrust",1)
TNT1 AA 3 A_GiveInventory("TornadoBlowThrust",1)
TNT1 A 20
TNT1 A 12
TBLH GH 1
TBLH F 0 A_Refire
Goto Ready+1
// Flash: // Old stuff
// TNT1 A 0 A_SpawnItemEx("TornadoBlow",100,100,0)
// TNT1 A 0 A_SpawnItemEx("TornadoDamager")
// TNT1 A 3 A_GiveInventory("TornadoBlowThrust",1)
// TNT1 A 0 A_SpawnItemEx("TornadoBlow",-100,100,0)
// TNT1 A 0 A_SpawnItemEx("TornadoDamager")
// TNT1 A 3 A_GiveInventory("TornadoBlowThrust",1)
// TNT1 A 0 A_SpawnItemEx("TornadoBlow",-100,-100,0)
// TNT1 A 0 A_SpawnItemEx("TornadoDamager")
// TNT1 A 3 A_GiveInventory("TornadoBlowThrust",1)
// TNT1 A 0 A_SpawnItemEx("TornadoBlow",100,-100,0)
// TNT1 A 0 A_SpawnItemEx("TornadoDamager")
// TNT1 A 3 A_GiveInventory("TornadoBlowThrust",1)
// TNT1 AAAAAA 3 A_GiveInventory("TornadoBlowThrust",1)
// stop
NoAmmo:
TBLH A 1 ACS_Execute(979,0)
Goto Ready+1
}
}


actor TornadoBlowAmmo : Ammo
{
inventory.amount 7
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor TornadoBlowTracer 
{
PROJECTILE
+DONTSPLASH
+NOEXPLODEFLOOR
+NOCLIP
+DONTBLAST
+STEPMISSILE
maxstepheight 32
Damage (0)
Speed 40
Radius 16
Height 96
Scale 2.5
var int user_turndivisor;
var int user_turndivisor_add;
var int user_loopcount;

states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar("user_turndivisor", 50)
TNT1 A 0 A_SetUserVar("user_turndivisor_add", 12)
TNT1 A 0 A_SetUserVar("user_loopcount", 0)
//TNT1 A 0 A_ChangeFlag("FLOORHUGGER", 1)
TNT1 A 0 A_Changeflag("NOCLIP", 0)
Spawn2:
TNT1 A 0 A_Setangle(angle-2000/user_turndivisor)
TNT1 A 1 A_ChangeVelocity(50,0,0,CVF_RELATIVE|CVF_REPLACE)
TNT1 A 0 A_SpawnItemEx("TornadoBlowFX", 0, 0,0, 0, 0, 5)
TNT1 A 0 A_SpawnItemEx("TornadoBlow2", 0, 0, (floorz-z)+8)
TNT1 A 0 A_SetUserVar("user_turndivisor",user_turndivisor+user_turndivisor_add)
TNT1 A 0 A_SetUserVar("user_loopcount", user_loopcount+1)
//TNT1 A 0 A_LogInt(user_loopcount)
Spawn3:
TNT1 A 0 A_Setangle(angle-2000/user_turndivisor)
TNT1 A 1 A_ChangeVelocity(50,0,0,CVF_RELATIVE|CVF_REPLACE)
TNT1 A 0 A_SpawnItemEx("TornadoBlowFX", 0, 0,0, 0, 0, 5)
TNT1 A 0 A_SetUserVar("user_turndivisor",user_turndivisor+user_turndivisor_add)
TNT1 A 0 A_SetUserVar("user_loopcount", user_loopcount+1)
//TNT1 A 0 A_LogInt(user_loopcount)

TNT1 A 0 A_JumpIf(user_loopcount > 4, 1)
Goto Spawn3
TNT1 A 0
Goto XDeath
/*Death:
TNT1 A 0
stop
*/
Crash:
XDeath:
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("TornadoBlow", 0, 0, (floorz-z)+8)
stop
}
}


actor TornadoBlow
{
PROJECTILE
+DONTBLAST
+NOINTERACTION
Obituary "$OB_TORNADOBLOW"
damage 0
radius 1
height 1
Scale 2.5
damagetype "TornadoBlow"
States
{
Spawn:
TBLO B 0
TBLO B 0 ThrustThingZ(0,5,0,0)
TBLO B 0 A_SpawnItemEx("TornadoDamager")
TBLO BC 2
TBLO B 0 ThrustThingZ(0,10,0,1)
TBLO DE 2 
TBLO B 0 ThrustThingZ(0,10,0,1)
TBLO B 0 A_SpawnItemEx("TornadoDamager")
TBLO BC 2
TBLO B 0 ThrustThingZ(0,15,0,1)
TBLO DE 2
TBLO B 0 ThrustThingZ(0,15,0,1)
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
stop
}
}

actor TornadoDamager : TornadoBlow
{
-NOINTERACTION
damagetype "TornadoBlow"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(10,96,0,0,96)
stop
}
}

actor TornadoBlow2
{
PROJECTILE
+DONTBLAST
+NOINTERACTION
Obituary "$OB_TORNADOBLOW"
damage 0
radius 1
height 1
Scale 2.5
damagetype "TornadoBlow"
States
{
Spawn:
TBLO B 0
TBLO B 0 ThrustThingZ(0,5,0,0)
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BC 2
TBLO B 0 ThrustThingZ(0,10,0,1)
TBLO DE 2 
TBLO B 0 ThrustThingZ(0,10,0,1)
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BC 2
TBLO B 0 ThrustThingZ(0,15,0,1)
TBLO DE 2
TBLO B 0 ThrustThingZ(0,15,0,1)
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")
TBLO BCDE 2
TBLO B 0 A_SpawnItemEx("TornadoDamager2")

stop
}
}

actor TornadoDamager2 : TornadoBlow
{
-NOINTERACTION
damagetype "TornadoBlow"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(4,96,0,0,96)
stop
}
}

actor TornadoBlowFX
{
scale 6.0
+CLIENTSIDEONLY
+MISSILE
+DONTSPLASH
+NOGRAVITY
Translation "198:198=106:106", "192:192=4:4"
Damage (0)
height 0
radius 0
States
{
Spawn:
BLKH R 1 A_Fadeout
wait
}
}

actor TornadoBlowThrust : CustomInventory
{
States
{
Pickup:
TNT1 A 0
//TNT1 A 0 A_JumpIf(z-floorz<5, "End")
TNT1 A 0 A_JumpIf(momz==0, "end")
TNT1 A 0 A_Jumpif(momz<0, "falling")
TNT1 A 0 ThrustThingZ(0, 8, 0, 1)
stop
Falling:
TNT1 A 0 ThrustThingZ(0, 4, 0, 1)
Goto End
End:
TNT1 A 0
stop
}
}
