actor DioFlashBossWeapon : MegaBuster
{
tag "ZA WARUDO"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_BLAZINGFISTS"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge2"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{


Spawn:
TNT1 A 0
stop
Ready:
DIOF I 0 ACS_NamedExecuteAlways("GiveExecution",0)
DIOG A 0 A_JumpIfInventory("ThrowKnivesToken", 1, "BeforeKilling")
DIOF I 0 A_JumpIfInventory("DioFlashTimeStopper", 1, "TimeStopperJump")
DIOF I 1 A_WeaponReady(WRF_NOSWITCH)
SXH1 A 0 ACS_ExecuteAlways(991,0,513)
DIOF I 0 A_GiveInventory("DioReadyForTimeStopper", 1)
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
DIOF I 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
DIOF I 1 A_Raise
Loop
TimeStopperJump:
TNT1 A 0 A_TakeInventory("DioReadyForTimeStopper", 999)
TNT1 A 0 A_TakeInventory("DioFlashTimeStopper", 999)
TNT1 A 0 A_PlaySoundEx("DioFlash/Jump","Item")
DIOF U 1 A_GiveInventory("DioFlashSuperJump",1)
DIOF V 1 A_GiveInventory("DioFlashSuperJump2",1)
DIOF U 1
goto Ready+1
Fire:
DIOF N 0 A_JumpIfInventory("OilSliderFlag", 1, "NoAmmo")
DIOF I 0 A_TakeInventory("DioReadyForTimeStopper", 1)
DIOF I 0 A_JumpIfInventory("ThrowKnivesToken", 1, "ThrowKnives")
DIOF O 0 A_Jump(26, 2) // 10% of chance of skipping the Muda voice clip
DIOF O 0 A_PlaySoundEx("DioFlash/Muda","Voice")
DIOF O 0 A_PlaySoundEx("weapon/napalm","Weapon")
DIOF I 2
DIOF J 0 A_FireCustomMissile("DioFlashFist",0,1,8,0)
DIOF J 1
DIOF J 1
DIOF J 0 SetPlayerProperty(0,1,4)
DIOF J 0 SetPlayerProperty(0,1,3)
DIOF O 0 A_PlaySoundEx("DioFlash/MudaCombo","Voice")
DIOF NN 1 A_ChangeVelocity(15*cos(pitch), 0, 15*sin(-pitch), CVF_RELATIVE|CVF_REPLACE)

GoingWarudo:
DIOF N 0 A_JumpIfInventory("OilSliderFlag", 30, "StopZaWarudo")
DIOF N 0 ACS_NamedExecute("StateChange",0,2) //Fire
DIOF N 0 A_SpawnItemEx("ZaWarudoMudaMuda",0,random(-35,35),random(24,45),cos(-pitch)*46,0,sin(-pitch)*46,0)
DIOF NN 1 A_ChangeVelocity(20*cos(pitch), 0, 20*sin(-pitch), CVF_RELATIVE|CVF_REPLACE)
DIOF N 0 A_GiveInventory("OilSliderFlag",1)
DIOF N 0 A_Jumpif(CallACS("SH_ButtonCheck",BT_ATTACK) == True,"GoingWarudo")

//goto GoingWarudo
StopZaWarudo:
DIOF N 0 SetPlayerProperty(0,0,4)
DIOF N 0 SetPlayerProperty(0,0,3)
DIOF N 0 A_JumpIfInventory("OilSliderFlag",12,"StopZaWarudo2")
DIOF N 0 A_TakeInventory("OilSliderFlag",99)
DIOF N 0 A_GiveInventory("OilSliderFlag",12)
StopZaWarudo2:
DIOF N 20
DIOF J 5
DIOF I 5
DIOF I 0 A_GunFlash
Goto Ready+1
Flash:
TNT1 A 3 A_TakeInventory("OilSliderFlag", 1)
TNT1 A 0 A_JumpIfInventory("OilSliderFlag", 1, "Flash")
goto OkItWorks
OkItWorks:
TNT1 A 0 
stop
NoAmmo:
DIOF I 1 ACS_Execute(979,0)
DIOF I 0 A_Refire
goto Ready+1



AltFire:
DIOF I 0 A_JumpIfInventory("BossRageCharge2",1000,"Rage")
DIOF I 1
Goto Ready+1
Rage:
DIOF I 0 A_JumpIfInventory("ThrowKnivesToken", 1, "NoAmmo")
DIOF I 0 A_JumpIfInventory("MudaDisable", 1, "NoAmmo")
DIOF I 0 A_TakeInventory("DioReadyForTimeStopper", 1)
DIOF I 0 A_GiveInventory("DioFlashZaWarudo", 1)
TNT1 A 0 A_GiveInventory("WarudoDefender", 1)
DIOF I 0 A_TakeInventory("BossRageCharge2", 1000)
DIOF I 0 SetPlayerProperty(0,1,0)
DIOF I 120 // ...
DIOF I 0 SetPlayerProperty(0,0,0)
TNT1 A 0 ACS_NamedExecuteAlways("sh_speeds",0,5)
TNT1 A 0 A_SpawnItemEx("ZaWarudoFXCircleFromTheOVA", 0, 0, 0, 0, 0, 0, 0)
TNT1 A 0 A_TakeInventory("WarudoDefender", 999)
DIOF I 0 A_TakeInventory("DioFlashZaWarudo", 999)
DIOF I 0 A_GiveInventory("ThrowKnivesToken", 1)
DIOF I 0 A_GiveInventory("DioFlashSlowMotion", 1)
TNT1 A 0 A_TakeInventory("WarudoDefender", 999)
goto ReadyToKill+5


BeforeKilling:
TNT1 A 0
goto ReadyToKill+5
ReadyToKill:
DIOF I 0 ACS_ExecuteAlways(998,0,513)
DIOF I 0 ACS_ExecuteAlways(804,0,255)
DIOF I 0
DIOF I 0 A_SpawnItem("BTWIMRIGHTHERE")
DIOF I 0 ACS_ExecuteAlways(808,0)
DIOF I 0 A_GiveInventory("DioReadyForTimeStopper", 1)
DIOG A 0 A_JumpIfInventory("ThrowKnivesToken", 1, 2)
DIOG A 0 A_Jump(256, "BackToReady")
DIOF I 0 A_JumpIfInventory("DioFlashTimeStopper", 1, "TimeStopperJump")
DIOG A 1 A_WeaponReady(WRF_NOSWITCH)
DIOF I 0 A_JumpIfInventory("DioFlashTimeStopper", 1, "TimeStopperJump")
DIOG A 1 
Goto ReadyToKill+5
BackToReady:
TNT1 A 0
goto Ready+1
ThrowKnives:
DIOG BBBCCDE 1
TNT1 A 0 A_PlaySoundEx("DioFlash/KniveThrow", "Voice")
DIOG F 1
DIOG H 1
TNT1 A 0 A_PlaySoundEx("DioFlash/Cling", "Weapon")
TNT1 A 0 A_PlaySoundEx("DioFlash/Knive", "Auto")
TNT1 A 0 A_FireCustomMissile("ZaWarudoKnive",0,1,8,0)
DIOG G 2 A_SpawnItemEx("SakuyaTrap", 0, 0, 0, 0, 0, 0)
DIOG IJK 1
TNT1 A 15
DIOG A 5
goto ReadyToKill+5
}
}

actor DioFlashSuperJump : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("TimeStopGFX", random(-48,48), random(-48,48), random(-48,48), 0, 0, 0, random(0, 359))
TNT1 A 0 A_PlaySoundEx("DioFlash/Jump","Item")
TNT1 A 0 A_TakeInventory("BossJumpCharge",125)
TNT1 A 0 A_PlaySoundEx("weapon/timestopper", "Weapon")
TNT1 A 0 ACS_ExecuteAlways(976,0,0) 
TNT1 A 0 A_FireCustomMissile("DioFlashTimeRadius",0,1,8,0)
TNT1 A 0 ThrustThingZ(0,1450,0,0)
stop
}
}

actor TimeStopActivatorDIO : CustomInventory
{
+INVENTORY.AUTOACTIVATE
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("TimeStoppedDIOCounterX", 1, "No")
//TNT1 A 0 A_JumpIfInventory(ACS_NamedExecuteWithResult("core_getplayerteam", -1), "No")
TNT1 A 0 A_Stop
PLAY H 0 A_GiveInventory("TimeStoppedDIOCounterX",1)
PLAY H 0 ACS_NamedExecuteAlways("core_flyplayer",0,0,1)
PLAY H 0 ACS_NamedExecuteAlways("core_freezeplayer",0,0,1)
TNT1 A 0 A_SpawnItemEx("TimeStoppedWatcherDIO")
stop
No:
TNT1 A 0
stop
}
}

actor TimeStoppedWatcherDIO
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
Renderstyle none
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Warp(AAPTR_TARGET, 0.0,0.0,0.0,0.0,WARPF_NOCHECKPOSITION)
TNT1 AAAAAA 0 A_SpawnItemEx("TimeStopGFX", random(8, 64), 0, random(0, 64), 0, 0, 0, random(0, 359))
TNT1 A 0 A_JumpIfInTargetInventory("TimeStoppedDIOCounterX", 1, "Spawn")
TNT1 A 5 A_GiveToTarget("TimeUnstopped")
stop
}
}


actor DioFlashSuperJump2 : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("TimeStopGFX", random(-48,48), random(-48,48), random(-48,48), 0, 0, 0, random(0, 359))
TNT1 A 0 A_Stop
stop
}
}

actor SakuyaTrap
{
PROJECTILE
+NOBLOCKMAP
+DONTBLAST
+NOINTERACTION
States
{
Spawn:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("ZaWarudoKnive", random(-25,25), random(-70,70), random(-15,140), 8, 0, 0)
stop
}
}

actor ZaWarudoKnive
{
PROJECTILE
scale 2.5
//+RIPPER
+DONTBLAST
Speed 2
Radius 22
Height 9
Obituary "$OB_ZAWARUDO"
//Damage (100)
damagetype "BossInstagib"
States
{
Spawn:
DIOF W 10
DIOF W 0 A_SpawnItemEx("ZaWarudoKnive2", 0, 0, 0, 0, 0, 0)
stop
}
}

actor ZaWarudoKnive2 : ZaWarudoKnive
{
States
{
Spawn:
DIOF W 0
DIOF W 3
DIOF W 0 A_JumpIfInTargetInventory("ThrowKnivesToken", 1, "Recreate")
goto KillingTime
Recreate:
DIOF W 0 A_SpawnItemEx("ZaWarudoKnive2", 0, 0, 0, 0, 0, 0)
stop
KillingTime:
DIOF W 0
DIOF W 1 A_SpawnItemEx("ZaWarudoKnive3", 0, 0, 0, 35, 0, 0)
stop
}
}

actor ZaWarudoKnive3 : ZaWarudoKnive
{
speed 25
Damage (80)
States
{
Spawn:
DIOF W 3
loop
Death:
DIOF W 1
stop
}
}


actor ZaWarudoRetablisher : BatGirlAssist
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ZaWarudoBack1", 1)
TNT1 A 1 A_GiveToTarget("ZaWarudoBack2", 1)
TNT1 A 1 A_GiveToTarget("ZaWarudoBack3", 1)
TNT1 A 1 A_GiveToTarget("ZaWarudoBack4", 1)
TNT1 A 1 A_GiveToTarget("ZaWarudoBack5", 1)
TNT1 A 0 A_TakeFromTarget("DioFlashMuda", 999)
TNT1 A 10
TNT1 A 0 A_TakeFromTarget("MudaDisable", 999)
stop
}
}

actor ZaWarudoSending
{
PROJECTILE
+DONTBLAST
+SKYEXPLODE
Height 32
Radius 24
+RIPPER
/*+SOLID
-SHOOTABLE
+INVULNERABLE
Height 74
Radius 50 //14
*/
damagetype "DioFlashMini"
TRANSLATION "198:198=229:229", "192:192=92:92"
Obituary "$OB_BLAZINGFISTS"
RenderStyle "Translucent"
Alpha 0.00
scale 3.6 // 3.5
speed 34
damage (40)
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_FadeIn(0.30)
TNT1 A 0 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_FadeIn(0.30)
TNT1 A 0 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_FadeIn(0.30)
TNT1 A 0 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMuda", 30, 0, 5, momx, momy, momz)
TNT1 A 0 A_JumpIfInTargetInventory("ZaWarudoFlag", 1, "ZaWarudoCombo")
FLSM G 1 A_SpawnItemEx("ZaWarudoMudaFinal", 40, 25, 20, momx, momy, momz)
goto Death
ZaWarudoCombo:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBlazingFists", 0, 0, 0, 5, 0, 0) //momz ; momz/2
stop
Death:
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 1)
TNT1 A 0 A_GiveToTarget("ZaWarudoComboNotToday", 1)
TNT1 A 0 A_Stop
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack5GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack4GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack3GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack2GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack1GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 55
TNT1 A 0 A_SpawnItemEx("ZaWarudoRetablisher", 0, 0, 0, 0, 0, 0)
stop
}
}

actor ZaWarudoBlazingFists : ZaWarudoSending
{
damage (20)
Alpha 0.9
speed 40 // doesn't matter, look at its SpawnItemEx's MOMX speed
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("DioFlash/MudaCombo", "Voice")
TNT1 A 0 A_GiveInventory("EnoughMuda", 1)
TNT1 A 0 A_JumpIfInventory("EnoughMuda", 18, "Death")
TNT1 A 0 A_SpawnItemEx("ZaWarudoMudaMuda", 30, random(-35,40), random(-20, 45), 40, 0, momz)
FLSM F 2
TNT1 A 0 A_SpawnItemEx("ZaWarudoMudaMuda", 30, random(-35,40), random(-10, 55), 40, 0, momz)
FLSM G 2
goto Spawn+2
Death:
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 1)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack5GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack4GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack3GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack2GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("ZaWarudoBack1GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 60
TNT1 I 0 A_SpawnItemEx("ZaWarudoRetablisher", 0, 0, 0, 0, 0, 0)
stop
}
}

//actor ZaWarudoHitBox
//{
//}


actor DioFlashFist : SaxtonFist
{
Obituary "$OB_BLAZINGFISTS"
-NOINTERACTION
scale 2.5
radius 10
height 25
damage (40)
damagetype "DioFlashMini" // this damagetype sends far away the killed opponents
States
{
Spawn:
SXP2 R 1 // NOTE FOR THE FUTURE : add more faithful graphics for this attack
stop
Death:
TNT1 A 0 A_SpawnItemEx("DioFlashBang", 0,0,-50,0,0,0)
stop
XDeath:
SXP1 P 0 A_Stop
SXP1 PPP 1
stop
}
}

actor ZaWarudoMuda : DioFlashFist // Long punch
{
Radius 52
Height 42
scale 3.2
damagetype "DioFlashMini"
damage (40)
States
{
Spawn:
DIOF P 1
stop
}
}

actor TimeStoppedDIOCounterX : Powerup
{
powerup.duration 24
}

actor DioFlashMiniProtect : PowerProtection
{
powerup.duration 20
damagefactor "DioFlashMini", 0.0
}


actor ZaWarudoMudaFinal : ZaWarudoMuda
{
States
{
Spawn:
DIOF P 2
Death:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBang", 0,0,-50,0,0,0)
stop
}
}

actor ZaWarudoMudaMuda : ZaWarudoMuda // One punch (from the Muda Muda fist combo)
{
damagetype "DioFlash"
TRANSLATION "198:198=229:229", "192:192=92:92"
Radius 13
Height 21
scale 3.0
damage (15)
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/napalm","Voice")
MARM BBC 1
MARM CBB 1 A_FadeOut(0.335)
stop
Death:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBang", 0,0,-50,0,0,0)
stop
}
}


actor DioFlashBang
{
+NOINTERACTION
+DONTBLAST
+FORCEXYBILLBOARD
scale 1.8
States
{
Spawn:
DIOF Q 4
TNT1 A 0 A_SetTranslucent(0.8)
DIOF R 4
stop
}
}

actor ZaWarudoBang : DioFlashBang
{
States
{
Spawn:
DIOF S 4
TNT1 A 0 A_SetTranslucent(0.8)
DIOF T 4
stop
}
}


actor DioFlashStandSummon : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("DioFlashStandController", 0, 0, 0, 0, 0, 0)
stop
}
}

actor DioFlashStandController : BatGirlAssist
{
+MISSILE
+NOCLIP
+NOINTERACTION
+DONTBLAST
states
{
Spawn:
TNT1 A 0
IsStanding:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoStanding", 1)
loop
IsWalking:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 1 A_GiveToTarget("ZaWarudoWalking1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 1 A_GiveToTarget("ZaWarudoWalking1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 1 A_GiveToTarget("ZaWarudoWalking1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 1 A_GiveToTarget("ZaWarudoWalking1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
TNT1 A 1 A_GiveToTarget("ZaWarudoWalking1", 1)	
loop
IsFiring:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring2", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring2", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring2", 1)
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashZaWarudo", 1, "IsZaWarudo")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashMuda", 1, "IsMuda")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 1 A_GiveToTarget("ZaWarudoFiring2", 1)
loop
IsMuda:
TNT1 A 1
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashStanding", 1, "IsStanding")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashWalking", 1, "IsWalking")
TNT1 A 0 A_JumpIfInTargetInventory("DioFlashFiring", 1, "IsFiring")
loop
IsZaWarudo:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_GiveToTarget("ZaWarudoFiring1", 1)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_GiveToTarget("ZaWarudoFiring2", 1)
TNT1 A 350 A_GiveToTarget("ZaWarudoArtefact", 1) // this objects summon the Za Warudo sprite that stays
// on the field while Za Warudo is active.
TNT1 A 85 A_GiveToTarget("RemiliaRageEndNoMove", 1)
TNT1 A 0 A_TakeFromTarget("ThrowKnivesToken", 999)
TNT1 A 0 A_GiveToTarget("RemiliaRageEndYesMove", 1)
goto IsStanding
}
}

actor DioFlashSlowMotion : PowerupGiver
{
//speed 0.1
powerup.duration -20
powerup.type "PowerSlowDio"
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
states
{
Pickup:
TNT1 A 0 

TNT1 A 1500
stop
}
}

actor PowerSlowDio : PowerSpeed
{
}

actor ZaWarudoStanding : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ZaWarudoStandingGFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoStandingGFX
{
//+SOLID
-SHOOTABLE
+NOINTERACTION
//Height 74
//Radius 14
RenderStyle "Translucent"
Alpha 0.90
scale 3.6 // 3.5
TRANSLATION "198:198=229:229", "192:192=92:92"

States
{
Spawn:
TNT1 A 0
FLSM E 1
stop
}
}

actor ZaWarudoWalking1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoWalking1GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoWalking2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoWalking2GFX", -32, -30, 16, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoWalking3 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoWalking3GFX", -32, -30, 18, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoWalking4 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoWalking4GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoWalking1GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM E 1
stop
}
}

actor ZaWarudoWalking2GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM E 1
stop
}
}

actor ZaWarudoWalking3GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM E 1
stop
}
}

actor ZaWarudoWalking4GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM E 1
stop
}
}

actor ZaWarudoFiring1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoFiring1GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoFiring2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoFiring2GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoFiring1GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM F 1
stop
}
}

actor ZaWarudoFiring2GFX : ZaWarudoStandingGFX
{
States
{
Spawn:
TNT1 A 0
FLSM G 1
stop
}
}

actor ZaWarudoBack1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBack1GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoBack2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBack2GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoBack3 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBack3GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoBack4 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBack4GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor ZaWarudoBack5 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudoBack5GFX", -32, -30, 14, momx, momy, momz) // -55 ; -35 ; 14
stop
}
}

actor  ZaWarudoBack1GFX : ZaWarudoFiring1GFX
{
Alpha 0.15
scale 10.8 // 10.5
}

actor  ZaWarudoBack2GFX : ZaWarudoFiring1GFX
{
Alpha 0.30
scale 9.36
}

actor  ZaWarudoBack3GFX : ZaWarudoFiring1GFX
{
Alpha 0.45
scale 7.92
}

actor  ZaWarudoBack4GFX : ZaWarudoFiring1GFX
{
Alpha 0.60
scale 6.48
}

actor  ZaWarudoBack5GFX : ZaWarudoFiring1GFX
{
Alpha 0.60
scale 5.04
}

actor DioFlashTimeRadius
{
+NOINTERACTION
Obituary "$OB_TIMESWITCH"
PROJECTILE
radius 1
height 1
+FORCEPAIN
+PIERCEARMOR
+FOILINVUL
damagetype "DioFlashTimeX"
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(1, 700, 0, 0, 700)
stop
}
}


actor ZaWarudoBinderSummon : CustomInventory
{
States
{
Pickup:
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("ZaWarudoBinder", 0, 0, 0, 0, 0, 0)
stop
}
}

actor ZaWarudoBinder
{
PROJECTILE
+NOBLOCKMAP
+DONTBLAST
+NOINTERACTION
reactiontime 435
States
{
Spawn:
TNT1 A 1
LetsDoIt:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ZaWarudoNoPhysicalLaws", 1)
TNT1 A 0// A_GiveToTarget("RepulseTheDio", 1)
TNT1 A 0 A_Countdown
loop
Death:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("ZaWarudoYesPhysicalLaws", 1)
TNT1 A 0 A_TakeFromTarget("PowerZaWarudoVision", 999)
TNT1 A 0 A_TakeFromTarget("ZaWarudoEffect", 999)
stop
}
}

/*actor RepulseTheDio : CustomInventory
{
states
{
Pickup:
TNT1 A 1 A_SpawnItemEx("RepulseTheDioSummoned", 0, 0, 0, 0, 0, 0)
stop
}
}

actor RepulseTheDioSummoned : BatGirlAssist
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 0 ACS_Execute(247,0,2000,4000)
stop
}
}*/

actor RageWaiterLV1
{
+NOINTERACTION
states
{
Spawn:
TNT1 A 0 A_GiveToTarget("CutterFlag", 1)
stop
}
}

actor ZaWarudoNoPhysicalLaws : CustomInventory
{
States
{
Pickup:
// TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
TNT1 A 0 A_Stop
TNT1 A 0 SetPlayerProperty(0,1,4)
stop
}
}

actor ZaWarudoYesPhysicalLaws : CustomInventory
{
States
{
Pickup:
// TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
TNT1 A 0 SetPlayerProperty(0,0,4)
stop
}
}

actor ZaWarudoArtefact : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ZaWarudo", -32, -30, 14, momx, momy, momz)
stop
}
}

actor DioTest
{
scale 2.5
States
{
Spawn:
DIOF W -1
loop
}
}

actor ZaWarudo : ZaWarudoFiring2GFX
{
+NOGRAVITY
States
{
Spawn:
TNT1 A 0
FLSM G 315
TNT1 A 2 A_SpawnItemEx("ZaWarudoBack5GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 2 A_SpawnItemEx("ZaWarudoBack4GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 2 A_SpawnItemEx("ZaWarudoBack3GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 2 A_SpawnItemEx("ZaWarudoBack2GFX", 0, 0, 0, 0, 0, 0)
TNT1 A 2 A_SpawnItemEx("ZaWarudoBack1GFX", 0, 0, 0, 0, 0, 0)
stop
}
}

actor ZaWarudoEffect : PowerupGiver
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
Powerup.Type "PowerZaWarudoVision"
Powerup.Colormap 0.4, 0.2, 0.4, 1.0, 1.0, 1.0
Powerup.Duration -16
States
{
Spawn:
TNT1 A 1
Loop
}
}

actor ZaWarudoVictim : Powerup
{
Powerup.Colormap 0.5, 0.2, 0.5, 0.2, 0.2, 0.2
Powerup.Duration -16
}

actor PowerZaWarudoVision : PowerProtection
{
	damagefactor "TimeStopper", 1.0
}

actor DioFlashStanding : Inventory // Dio Flash receives this flag item when he's standing still
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashWalking : Inventory // ^ walking
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashFiring : Inventory // ^ firing
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashZaWarudo : Inventory // ^ Za Warudo mode
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashMuda : Inventory // ^ when using the normalfire (make Za Warudo disappears from Dio's back)
{
inventory.amount 1
inventory.maxamount 1
}

actor ZaWarudoFlag : Inventory // has a similar use to DrillFlag (Drill Bomb's flag)
{
inventory.amount 1
inventory.maxamount 1
}

actor ZaWarudoComboNotToday : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor GoingToMuda : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor EnoughMuda : Inventory
{
inventory.amount 1
inventory.maxamount 18
}

actor MudaDisable : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashTimeStopper : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor DioReadyForTimeStopper : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor DioFlashTimeHUD : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor ThrowKnivesToken : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor WarudoDefender : PowerProtection
{
damagefactor "Normal", 0.0
Powerup.Duration -20
}

actor ZaWarudoFXCircleFromTheOVA
{
+NOINTERACTION
+NOGRAVITY
scale 0.001
renderstyle add
alpha 1.0
states
{
	Spawn:
	MSP0 L 0 A_SetScale(scalex*1.5,scaley*1.5)
	MSP0 L 1 A_FadeOut(0.025)
	loop
}
}
