actor YamatoSpearBoss : BaseMM8BDMWep_CBM
{
dropitem "YamatoSpearWepCDropped"
Weapon.AmmoUse 3
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_YAMATOSPEAR"
weapon.ammotype "YamatoClassAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_06 H 1
loop
Ready:
YAMB A 0 ACS_ExecuteAlways(998,0,827)
YAMB A 0 A_GunFlash
YAMB A 0 A_JumpIfInventory("YamatoClassAmmo",3,"Ready2")
YAMB A 1 A_WeaponReady(WRF_NOPRIMARY)
YAMB A 0 A_GiveInventory("YamatoStock",1)
goto Ready+2
Ready2:
YAMB A 1 A_WeaponReady
YAMB A 0 A_GiveInventory("YamatoStock",1)
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
YAMB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
YAMB A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotFire")
YAMB B 3
Hold:
YAMB A 0 A_JumpIfNoAmmo("No")
YAMB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
YAMB C 0 A_GiveInventory("YamatomanMain_CI",1)
YAMB CDCDCD 2
YAMB A 0 A_Refire
YAMB A 0
No:
YAMB B 3 A_ClearRefire
Goto Ready+2
AltFire:
YAMB C 0 A_JumpIfInventory("YamatoSpinFlag",1,3)
YAMB C 0 ACS_ExecuteAlways(648,0,16)//0.9 speed 10 jump
YAMB C 0 A_GiveInventory("YamatoSpinFlag",1)
YAMB C 1 A_PlaySoundEx("weapon/BRGSpin","Weapon")
YAMB D 0 A_PlaySoundEx("weapon/BRGSpin","Weapon")
YAMB D 0 A_FireCustomMissile("YamatoAlt",0,0,8,0)
YAMB D 1 A_GiveInventory("YamatoStock",1)
YAMB D 0 A_Refire
YAMB D 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB CD 2 A_GiveInventory("YamatoStock",1)
YAMB D 0 ACS_ExecuteAlways(648,0,6)//1.0 speed 13 jump
YAMB C 2 A_GiveInventory("YamatoStock",1)
YAMB C 0 A_GiveInventory("YamatoStock",1)
YAMB CD 1
YAMB B 2 A_GiveInventory("YamatoStock",1)
YAMB B 1 A_GiveInventory("YamatoStock",1)
YAMB B 0 A_TakeInventory("YamatoSpinFlag",20)
Goto Ready+2

Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("YamatoClassAmmo",28,5)
TNT1 A 1 //A_GiveInventory ("YamatoStock",1)
TNT1 A 0 A_JumpIfInventory("YamatoStock",24,1)
loop
TNT1 A 0 A_TakeInventory("YamatoStock",19)
TNT1 A 0 A_GiveInventory("YamatoClassAmmo",1)
goto Flash+2
TNT1 A 1 A_TakeInventory("YamatoStock",999)
goto Flash

BotFire:
TNT1 A 0 A_JumpIfCloser(250,"BotAltFire")
goto Fire+1
BotAltFire:
TNT1 A 0 A_GiveInventory("BotHugFlag",1)
BotAltFire2:
YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB C 1
YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB A 0 A_FireCustomMissile("YamatoAlt",0,0,8,0)
YAMB D 1 A_GiveInventory("YamatoStock",1)
TNT1 A 0 A_Refire(2)
TNT1 A 0 A_TakeInventory("BotHugFlag",999)
Goto AltFire+8
TNT1 A 0 A_JumpIfCloser(250,"BotAltFire2")

YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB C 1
YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB A 0 A_FireCustomMissile("YamatoAlt",0,0,8,0)
YAMB D 1 A_GiveInventory("YamatoStock",1)
TNT1 A 0 A_Refire(2)
TNT1 A 0 A_TakeInventory("BotHugFlag",999)
Goto AltFire+8
TNT1 A 0 A_JumpIfCloser(250,"BotAltFire2")

YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB C 1
YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB A 0 A_FireCustomMissile("YamatoAlt",0,0,8,0)
YAMB D 1 A_GiveInventory("YamatoStock",1)
TNT1 A 0 A_Refire(2)
TNT1 A 0 A_TakeInventory("BotHugFlag",999)
Goto AltFire+8
TNT1 A 0 A_JumpIfCloser(250,"BotAltFire2")

YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB C 1
YAMB A 0 A_PlaySoundEx("weapon/topspin","Weapon")
YAMB A 0 A_FireCustomMissile("YamatoAlt",0,0,8,0)
YAMB D 1 A_GiveInventory("YamatoStock",1)

TNT1 A 0 A_JumpIfCloser(250,"BotAltFire2")

TNT1 A 0 A_TakeInventory("BotHugFlag",999)
TNT1 A 0 A_ClearRefire
Goto AltFire+8
}
}

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

actor YamatoSpinFlag : Inventory
{
inventory.amount 1
inventory.maxamount 3
}

actor YamatoStock : Inventory
{
inventory.amount 1
inventory.maxamount 999
}

actor YamatoSpearBFirer
{
Translation "198:198=60:60", "202:202=4:4"
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
Height 0
Radius 0
speed 1
States
{
spawn:
YAMA E 0
YAMA E 0 A_SpawnItemEX("YamatoSpearB",0,0,0,momx*40,momy*40,momz*40,0,9,0)
YAMA E 0 A_SpawnItemEX("YamatoSpearB2",0,0,0,momx*40,momy*40,momz*40,0,9,0)
stop
}
}

actor YamatoSpearBFirerB : YamatoSpearBFirer{translation "202:202=205:205", "198:198=74:74"}
actor YamatoSpearBFirerR : YamatoSpearBFirer{translation "202:202=171:171", "198:198=41:41"}
actor YamatoSpearBFirerO : YamatoSpearBFirer{translation "202:202=104:104", "198:198=128:128"}
actor YamatoSpearBFirerP : YamatoSpearBFirer{translation "202:202=229:229", "198:198=232:232"}

actor YamatoSpearB : YamatoSpear
{
damage (6)
speed 40
States
{
Spawn:
YAMA E 1
loop
}
}

actor YamatoSpearB2 : YamatoSpearB
{
damage (0)
-RIPPER
+DONTREFLECT
states
{
Death:
YAMA E 0 A_SpawnItemEX("YamatoSpearB3",0,0,0,0,0,0,0,1)
stop
}
}

actor YamatoSpearB3 : YamatoSpearB2
{
-MISSILE
+DONTBLAST
-NOGRAVITY
reactiontime 30
states
{
Spawn:
YAMA F 0
YAMA FFFFFFFFFF 1 A_JumpIfCloser(100,"Return")
YAMA F 0 A_CountDown
loop
Return:
YAMA F 0 A_GiveToTarget("YamatoPickup",1)
stop
Death:
YAMA F 0
stop
}
}

actor YamatoAlt : BasicExplosion
{
Damagetype "ClassPainLess2"//"YamatoSpin"
Obituary "$OB_YAMATOSPIN"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(5,150,0,0,16)
stop
}
}

actor YamatoPickup : CustomInventory
{
inventory.pickupmessage "Picked up a spear tip."
inventory.pickupsound ""
scale 2.5
States
{
Pickup:
DUST B 0 A_GiveInventory("YamatoStock",12)
DUST B 0 A_PlaySound("item/energyup", 3, 0.75)
DUST B 0
stop
}
}

actor YamatomanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirer",random(7,3),1,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirer",random(2,-2),0,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirer",random(-3,-7),0,8,random(5,10))
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerB",random(7,3),1,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerB",random(2,-2),0,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerB",random(-3,-7),0,8,random(5,10))
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerR",random(7,3),1,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerR",random(2,-2),0,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerR",random(-3,-7),0,8,random(5,10))
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerO",random(7,3),1,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerO",random(2,-2),0,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerO",random(-3,-7),0,8,random(5,10))
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerP",random(7,3),1,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerP",random(2,-2),0,8,random(5,10))
TNT1 A 0 A_FireCustomMissile("YamatoSpearBFirerP",random(-3,-7),0,8,random(5,10))
goto Done
}
}
