actor DanceTornadoWep_NormalBar : NormalBar {args 58, 249}

actor DanceTornadoWep : BaseMM8BDMWep
{
Weapon.AmmoUse 7
Weapon.AmmoGive 28
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_DANCETORNADO"
Tag "$TAG_DANCETORNADO"
Obituary "$OB_DANCETORNADO"
weapon.ammotype "DanceTornadoAmmo"
inventory.icon "DTRNICON"
States
{
SpawnLoop:
DTRN Z -1
loop
Ready:
DTRN A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_DANCETORNADO)
DTRN A 0 A_TakeInventory("DanceTime",9999)
ReadyReal:
DTRN A 1 A_WeaponReady
Goto Ready+2
ReadyC: Goto Ready+2
Deselect:
DTRN A 0 A_GunFlash("NoFlash")
goto DeselectSwap
Select:
DTRN A 0
goto SelectSwap
Fire:
DTRN A 0 A_JumpIfInventory("DanceTime",1,"SpinEnd")
DTRN A 0 A_JumpIfInventory("IsBot", 1, "BotCheck")
DTRN A 0 A_JumpIfNoAmmo("NoAmmo")
TNT1 A 0 A_GiveInventory("TakeDanceTornadoAmmo",1)
DTRN A 0 A_TakeInventory("JumpCancler", 1)
DTRN A 0 A_GunFlash
TNT1 B 0 A_ChangeVelocity(momx/1.5,momy/2,0)
DTRN A 1 ThrustThingZ(0,65,0,0)
DTRN A 0 A_GiveInventory("DanceTime",1)
TNT1 A 0 A_SpawnItemEx("DanceTornadoFX")
TNT1 A 0 A_SpawnItemEx("DanceTornadoFX2")
TNT1 A 0 A_SpawnItemEx("DanceTornadoFX3")
SpinLoop2:
DTRN A 0 A_GiveInventory("DanceTime",1)
DTRN A 0 A_SpawnItemEx("DanceTornadoRadius2",8,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
DTRN A 0 A_JumpIfInventory("CutterFlag",999,"Ready")
TNT1 A 1 A_JumpIf(CallACS("core_CheckFooting_ThruPlayer"),"SpinEnd")
DTRN A 0 A_JumpIfInventory("EndDance",1,"SpinEnd")
DTRN A 0 A_JumpIfInventory("DanceTime",11,"SpinLoop2")
loop
SpinLoop2:
DTRN A 0 A_GiveInventory("DanceTime",1)
DTRN A 0 A_SpawnItemEx("DanceTornadoRadius",8,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
DTRN A 0 A_JumpIfInventory("CutterFlag",999,"Ready")
TNT1 A 1 A_JumpIf(CallACS("core_CheckFooting_ThruPlayer"),"SpinEnd")
DTRN A 0 A_JumpIfInventory("EndDance",1,"SpinEnd")
loop
SpinEnd:
DTRN A 0 A_GunFlash("NoFlash")
TNT1 A 0 A_TakeInventory("DanceTornadoFlag", 5)
DTRN A 0 A_TakeInventory("DanceTime",9999)
DTRN A 0 A_TakeInventory("EndDance",1)
DTRN A 0 A_StopSound(CHAN_WEAPON)
DTRN A 1
DTRN A 0 A_TakeInventory("CutterFlag", 15)
Goto Ready+1
BotCheck:
DTRN A 0 A_JumpIf(momz==0, 1)
Goto Fire+3
DTRN A 0 ThrustThingZ(0,50,0,1)
Goto Fire+3
NoAmmo:
DTRN A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
Flash:
TNT1 A 0 A_PlaySoundEx("misc/galaxyteleport","Weapon")
DTRN BBCCDDEE 1 //A_SetAngle(angle-20.0)
TNT1 AAAAAAAAAAA 1 //A_SetAngle(angle-20.0)
TNT1 BBCCDDEE 1 //A_SetAngle(angle-20.0)
TNT1 AAAAAAAAAAA 1 //A_SetAngle(angle-20.0)
TNT1 BBCCDDEE 1 //A_SetAngle(angle-20.0)
TNT1 AAAAAAAAAAA 1 //A_SetAngle(angle-20.0)
TNT1 A 0 A_GiveInventory("EndDance",1)
NoFlash:
TNT1 A 0
stop

}
}

actor DanceTime : WeaponCharge {}
actor EndDance : Once {}

actor DanceTornadoFlag : Inventory
{
inventory.amount 1
inventory.maxamount 5
}

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

actor DanceTornadoRadius : BasicExplosion
{
translation "0:255=58:58"
damagetype "DanceTornado"
Obituary "$OB_DANCETORNADO"
States
{
Spawn:
TNT1 A 0
TOPS A 2 A_Explode(CallACS("vile_cbm_damage",14),90,0)
stop
}
}


actor DanceTornadoRadius2 : BasicExplosion
{
translation "0:255=58:58"
damagetype "DanceTornado"
Obituary "$OB_DANCETORNADO"
States
{
Spawn:
TNT1 A 0
TOPS A 2 A_Explode(CallACS("vile_cbm_damage",11),90,0)
stop
}
}

actor DanceTornadoFX : BasicShieldWarper
{
	scale 3.75
	renderstyle translucent
	speed 100
	translation "192:192=58:58", "198:198=249:249"
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("core_shieldwarper_dance", 0)
		TNT1 A 0 A_Jump(256, "Shield")
		Goto Shield
	Shield:
		DTRN J 1 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 32768, 100) // 13106 = 0.5 * 65536
		goto Shield2
	Shield2:
		DTRN J 0 ACS_NamedExecuteWithResult("core_copytranslation_client",0)
		DTRN JJKKLLMM 1 A_Warp(AAPTR_TARGET, 1, 0, 0, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
		loop
	}
}

actor DanceTornadoFX2 : DanceTornadoFX
{
	States
	{
	Shield:
		DTRN J 0
		DTRN J 1 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 32768, 100) // 13106 = 0.5 * 65536
		goto Shield2
	Shield2:
		DTRN J 0 ACS_NamedExecuteWithResult("core_copytranslation_client",0)
		DTRN JJKKLLMM 1 A_Warp(AAPTR_TARGET, -1, 0, 0, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
		loop
	}
}

actor DanceTornadoFX3 : DanceTornadoFX
{
alpha 0.0
speed 1
	States
	{
	Shield:
		DTRN J 0
		DTRN J 1 A_JumpIf(CallACS("vile_IsPointerClient",2)==1,"Spawn2")//A_Stop
		goto Shield2
		Spawn2:
		DTRN J 0 //A_SetScale(1.5)
		DTRN J 1 A_SetTranslucent(0.5)
		goto Shield2
	Shield2:
		DTRN J 0 ACS_NamedExecuteWithResult("core_copytranslation_client",0)
		DTRN JJKKLLMM 1 A_Warp(AAPTR_TARGET, 2, 0, 0, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
		loop
	}
}


actor TakeDanceTornadoAmmo : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("DanceTornadoAmmo", 7, TIF_NOTAKEINFINITE)
stop
}
}
