actor UsagiKunaiWep_NormalBar : NormalBar{args 33,239}
actor UsagiKunaiWep : BaseMM8BDMWep
{
Weapon.AmmoUse 3
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_USAGIKUNAI"
Obituary "$OB_USAGIKUNAI"
Tag "$TAG_USAGIKUNAI"
weapon.ammotype "UsagiKunaiAmmo"
inventory.icon "USGKICON"
States
{
SpawnLoop:
USGK Z -1
loop
Ready:
USGK B 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_USAGIKUNAI)
USGK B 0 A_JumpIfNoAmmo("ReadyNoAmmo")
USGK B 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
ReadyNoAmmo:
BUS2 D 1 A_WeaponReady
BUS2 D 0 A_JumpIfNoAmmo("ReadyNoAmmo")
Goto Ready+1

Deselect:
USGK B 0 
goto DeselectSwap
Select:
USGK B 0 
goto SelectSwap
Fire:
BUSH A 0 A_JumpIfNoAmmo("NoAmmo")
BUSH A 0 A_PlaySoundEx("weapon/bladeshoot","Weapon")
BUSH G 0 A_FireCustomMissile("UsagiKunai",0,0,8,0,0,-8)
BUSH G 0 A_FireCustomMissile("UsagiKunai",0,0,8,0,0)
BUSH G 0 A_FireCustomMissile("UsagiKunai",0,1,8,0,0, 8)
BUSH BCD 2
BUSH EFG 2
TNT1 A 10
USGK B 0 A_JumpIfNoAmmo("FireNoAmmoEnd")
USGK B 1 Offset(-4,69)
USGK B 1 Offset(-2,48)
USGK B 0 A_JumpIfNoAmmo("ReadyNoAmmo")
USGK B 2
BUSH A 0 A_Refire
Goto Ready+1
FireNoAmmoEnd:
BUS2 D 1 Offset(-4,69)
BUS2 D 1 Offset(-2,48)
BUS2 D 0 A_JumpIfNoAmmo("ReadyNoAmmo")
BUS2 D 2
BUS2 D 0 A_Refire
Goto Ready+1
NoAmmo:
BUS2 D 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto ReadyNoAmmo

}
}

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

actor UsagiKunai : BasicProjectile
{
PROJECTILE
Radius 12
Height 12
Obituary "$OB_USAGIKUNAI"
damagetype "UsagiKunai"
+HITTRACER
scale 3.0
damage (CallACS("vile_cbm_damage",2))
speed 30
reactiontime 5
States
{
Spawn:
USGW B 1
loop
Xdeath:
USGW B 0
goto Latch
Death:
USGW B 0
goto Latch
Latch:
USGW B 0
USGW B 0 A_JumpIf(ACS_NamedExecuteWithResult("vile_usagikunaicheck",1)==0, "Die")
USGW A 0 A_GiveInventory("TracerAndTargetTeamsMatchCheck",1)
USGW A 0 A_JumpIfInventory("TracerAndTargetTeamsMatchFlag", 1, "Die")
USGW B 0 A_JumpIfInventory("UsagiKunaiFlag",4,"Latch2")
USGW B 0 A_JumpIfInventory("UsagiKunaiFlag2",25,"Die")
USGW B 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
USGW B 0 //A_SpawnItemEx("PunctureNeedleDamager")
USGW B 0 A_GiveInventory("UsagiKunaiFlag",1)
USGW B 0 A_GiveInventory("UsagiKunaiFlag2",1)
loop
Die:
MMFX BCDE 3
stop
Latch2:
USGW B 0
USGW B 0 A_SpawnItemEx("UsagiKunaiDamager")
USGW B 0 A_TakeInventory("UsagiKunaiFlag",999)
goto Latch+4
LatchLoop:
USGW B 0 //DDDDDDDDDDDDDD 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_INTERPOLATE)
USGW B 0 A_SpawnItemEx("UsagiKunaiDamager")
USGW B 0 A_GiveInventory("UsagiKunaiFlag",1)
goto Latch
}
}

actor UsagiKunaiFlag : WeaponCharge {}
actor UsagiKunaiFlag2 : WeaponCharge {}


actor UsagiKunaiDamager : BasicProjectile
{
PROJECTILE
radius 1
height 1
+THRUGHOST
damage (CallACS("vile_cbm_damage",3))
Obituary "$OB_USAGIKUNAI"
damagetype "UsagiKunai"
States
{
Spawn:
TNT1 A 1
loop
Death:
TNT1 A 0
stop
}
}