//Mobility recoded
actor Yamatoman : HighArmorClass
{
	Player.ScoreIcon "YAMAMUGS"
	player.startitem "BaseFlagPack", 1
	player.startitem "HighArmor"
	player.soundclass "yamatomanc"
	Player.ViewHeight 54
	player.forwardmove 0.75, 0.75
	player.sidemove 0.73, 0.73
	player.displayname "Yamatoman"
	player.jumpz 12
	player.startitem "YamatoSpearBoss"
	player.startitem "CanThirdFire"
	player.startitem "Base28Ammo", 28
	player.startitem "UltimateAttackItem3", 1
	player.startitem "UltSoundWatcherSpawn3"
	player.startitem "IsFromMM6"
	States
	{
		Animation5:
		Spawn:
		YAMM A 0
		YAMM B 1 A_JumpIf(z-floorz>0, "Jumping")
		YAMM A 1 A_JumpIf(z-floorz>0, "Jumping")
		Goto Spawn+2
		
		Spawn.NoHead:
		Y4M6 A 0 A_JumpIf(z-floorz>0, "Jumping.NoHead")
		Y4M6 B 1 A_JumpIf(momx>0.01||momy>0.01||momx<-0.01||momy<-0.01,"See.NoHead")
		Y4M6 A 0 A_JumpIf(z-floorz>0, "Jumping.NoHead")
		Y4M6 A 1 A_JumpIf(momx>0.01||momy>0.01||momx<-0.01||momy<-0.01,"See.NoHead")
		goto Spawn.NoHead+2
		
		See:
		YAMM BBBBBCCCCCDDDDDEEEEE 1 A_JumpIf(z-floorz>0, "Jumping")
		goto Spawn+1
		
		See.NoHead:
		Y4M6 BBBBBCCCCCDDDDDEEEEE 1 A_JumpIf(z-floorz>0, "Jumping.NoHead")
		goto Spawn.NoHead+1
		
		Jumping:
		YAMM I 1 A_JumpIf(z-floorz<=0, "Spawn")
		wait
		
		Jumping.NoHead:
		Y4M6 I 1 A_JumpIf(z-floorz<=0, "Spawn.NoHead")
		wait
		
		Animation4:
		Missile:
		YAMM JKJKJKJK 1 A_JumpIf(z-floorz>0, "JumpingMissile")
		goto Spawn+2
		
		JumpingMissile:
		YAMM FGFGFGFG 1 A_JumpIf(z-floorz<=0, "Missile")
		goto Jumping
		
		Animation1:
		Y4M6 BCDEBCD 3
		goto Spawn.NoHead+1
		
		Animation2:
		YAMM JJKKJJKKJJKK 1 A_JumpIf(z-floorz>0, "JumpingA2")
		YAMM J 0 A_JumpIfInventory("BaseCustomFlag2",1,"Spawn.NoHead")
		goto Spawn+2
		
		JumpingA2:
		YAMM FFGGFFGGFFGG 1 A_JumpIf(z-floorz<=0, "Animation2")
		YAMM F 0 A_JumpIfInventory("BaseCustomFlag2",1,"Jumping.NoHead")
		goto Jumping
		
		Animation3:
		YAMM NONONONO 1 A_JumpIf(z-floorz>0, "JumpingA3")
		goto Spawn+2
		
		JumpingA3:
		YAMM LMLMLMLM 1 A_JumpIf(z-floorz<=0, "Animation3")
		goto Jumping
		
		Animation6:
		YAMM P 5
		YAMM FGFGFGFGFGFG 1
		YAMM P 25
		goto Spawn+2
		
		ClassTimeStop:
		PLAY A 0 SetPlayerProperty(0,1,4)
		PLAY A 0 ACS_Execute(528,0)
		YAMM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Stop
		PLAY A 0 SetPlayerProperty(0,0,4)
		Goto pain+1
		ClassPain:
		Y4M6 H 0 A_JumpIfInventory("BaseCustomFlag2",1,"ClassPain.NoHead")
		YAMM HHHHHHHHHH 2 A_SpawnItem("PainFX",0,3)
		Goto Spawn+1
		ClassPain.NoHead:
		Y4M6 HHHHHHHHHH 2 A_SpawnItem("PainFX",0,3)
		Goto Spawn.NoHead+1
		ClassDeath:
		Y4M6 H 0 A_JumpIfInventory("BaseCustomFlag2",1,"ClassDeath.NoHead")
		YAMM H 20 ACS_ExecuteAlways(999,0,0)
		YAMM H 0 A_PlayerScream
		NOFX A 0 A_SpawnItemEx("FakeDeathFX",0,0,32)
		NOFX A 1 A_CheckPlayerDone
		wait
		ClassDeath.NoHead:
		Y4M6 H 20 ACS_ExecuteAlways(999,0,0)
		goto ClassDeath+2
		ClassIceDeath:
		YAMM A 35
		NOFX A 0 A_SpawnItemEx("FrozenDeathFX",0,0,16)
		NOFX A 1 A_CheckPlayerDone
		wait
		WeaponGetM:
		CUTM H 0 A_JumpIfInTargetInventory("YamatoSpearWepM",1,2)
		CUTM H 0 A_GiveToTarget("WeaponGetter")
		CUTM H 0 A_GiveToTarget("YamatoSpearWepM")
		goto ClassDeath
	}
}

actor YamatoSpearBoss : VCBaseWeapon
{
weapon.ammotype "Base28Ammo"
Weapon.AmmoUse 3
Obituary "$OB_YAMATOMAN1"
States
{
Ready:
TNT1 A 0 A_TakeInventory("BaseCustomFlag1",999)
YASP A 0 A_TakeInventory("BaseCustomFlag2",1)
YASP A 0 A_JumpIfInventory("Base28Ammo",14,"Ready.TF")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack")
YASP A 0 A_GiveInventory("Base28Ammo",1)
Goto Ready

Ready.TF:
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIf(ACS_NamedExecuteWithResult("VC_CheckBtn",3)==3,"User1")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIf(ACS_NamedExecuteWithResult("VC_CheckBtn",3)==3,"User1")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIf(ACS_NamedExecuteWithResult("VC_CheckBtn",3)==3,"User1")
YASP A 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIf(ACS_NamedExecuteWithResult("VC_CheckBtn",3)==3,"User1")
YASP A 0 A_GiveInventory("Base28Ammo",1)
Goto Ready

Ready2:
YASP N 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP N 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP N 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP N 1 A_WeaponReady(WRF_NOSECONDARY*CallACS("VC_AmmoCheck",0,3)) YASP A 0 A_JumpIfInventory("UltAttackFlag",1,"UltimateAttack") YASP A 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP N 0 A_GiveInventory("Base28Ammo",1)
Goto Ready2

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
YASP A 1 A_Lower
Loop

Select:
TNT1 A 0 ACS_ExecuteAlways(991,0,6827)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
YASP A 1 A_Raise
Loop

User1:
YASP K 1

User1.Hold:
YASP H 0 A_GiveInventory("YamatoSlow")
YASP H 0 ACS_NamedExecuteWithResult("VC_SetState",3)
TNT1 A 0 A_PlaySoundEx("weapon/yamatospin","Weapon")
YASP HI 1 A_GiveInventory("YamatoTFHandler1",1)
TNT1 A 0 A_PlaySoundEx("weapon/yamatospin","Weapon")
YASP JK 1 A_GiveInventory("YamatoTFHandler1",1)
YASP H 0 A_TakeInventory("Base28Ammo",1)
TNT1 A 0 A_JumpIfInventory("Base28Ammo",1,1)
goto User1.End
YASP HH 1 A_JumpIf(ACS_NamedExecuteWithResult("VC_CheckBtn",3)==3,"User1.Hold")
Goto User1.End

User1.End:
YASP H 0 A_GiveInventory("YamatoTFHandler2",1)
YASP PXXXXXQA 2 A_TakeInventory("YamatoSlow")
goto Ready

Fire:
TNT1 A 0 A_JumpIfInventory("YamatoSpearCooldown",1,"Fire2")
TNT1 A 0 A_PlaySoundEx("weapon/topspin","Weapon")
TNT1 A 0 A_TakeInventory("BaseCustomFlag1",999)
YASP B 2 ACS_NamedExecuteWithResult("VC_SetState",2)
TNT1 A 0 A_TakeInventory("YamatoSpearCancel",999)
TNT1 A 0 A_GiveInventory("YamatoM1Handler",1)
YASP CDEBCDE 2
YASP NNNNNNNNNN 1 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
goto Ready2

Fire2:
YASP A 0 A_PlaySoundEx("weapon/yamatosprint","Weapon")
YASP A 0 A_SpawnItemEx("YamatoAfterImage1")
YASP A 0 ACS_NamedExecuteWithResult("VC_SetState",1)
YASP N 1 Offset(0,44) A_GiveInventory("YamatoSprintHandler",1)
YASP NN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage2")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage3")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage2")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage1")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage2")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP A 0 A_SpawnItemEx("YamatoAfterImage3")
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1 Offset(0,52) A_GiveInventory("YamatoSprintHandler",1)
YASP N 1 Offset(0,44)

Fire2.Wait:
YASP N 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP N 1 A_WeaponReady(WRF_NOPRIMARY)
YASP N 0 A_GiveInventory("CutterFlag",1)
YASP N 0 A_JumpIfInventory("CutterFlag",35,1)
loop
YASP A 0 A_TakeInventory("CutterFlag",999)
goto Ready2

GiveBackSpear:
YASP A 0 A_TakeInventory("BaseCustomFlag1",999)
YASP A 0 A_TakeInventory("BaseCustomFlag2",999)
YASP A 0 A_TakeInventory("CutterFlag",999)
YASP A 0 A_TakeInventory("YamatoSpearCooldown",999)
YASP A 0 A_GiveInventory("YamatoSpearCancel",1)
YASP A 0 ACS_NamedExecuteWithResult("VC_SetState",5)
YASP A 1 A_TakeInventory("BaseCustomFlag1",999)
goto Ready

Altfire:
TNT1 A 0 A_JumpIfInventory("YamatoSpearCooldown",1,"Altfire2")
RATU A 0 A_JumpIfInventory("NoAltfire",1,"Ready")
YASP E 1

Altfire.Spear:
YASP D 0 A_TakeInventory("WeaponCharge",999)
YASP D 0 A_GiveInventory("YamatoM2Handler1",1)

Altfire.Spin1:
YASP C 0 A_PlaySoundEx("weapon/topspin","Weapon")
YASP BC 1 A_SpawnItemEx("YamatoSpinHitbox")
YASP C 0 A_GiveInventory("WeaponCharge",1)
YASP B 0 A_JumpIfInventory("WeaponCharge",9,"Altfire.Spear")
YASP C 0 A_JumpIfInventory("Base28Ammo",2,1)
goto Altfire.End
YASP C 0 A_Refire("Altfire.Spin2")
goto Altfire.End

Altfire.Spin2:
YASP C 0 A_PlaySoundEx("weapon/topspin","Weapon")
YASP DE 1 A_SpawnItemEx("YamatoSpinHitbox")
YASP C 0 A_GiveInventory("WeaponCharge",1)
YASP B 0 A_JumpIfInventory("WeaponCharge",9,"Altfire.Spear")
YASP C 0 A_JumpIfInventory("Base28Ammo",2,1)
goto Altfire.End
YASP C 0 A_Refire("Altfire.Spin1")
goto Altfire.End

Altfire.End:
YASP B 0 A_ClearRefire
YASP BB 1 A_TakeInventory("WeaponCharge",999)
YASP A 14
goto Ready

Altfire2:
RATU A 0 A_JumpIfInventory("NoAltfire",1,"Ready2")
YASP F 2

Altfire2.Spin:
YASP C 0 A_JumpIfInventory("Base28Ammo",3,1)
goto Altfire2.End
TNT1 A 0 A_GiveInventory("YamatoM2Handler2",1)
YASP GGDDE 1
TNT1 A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
YASP C 0 A_FireCustomMissile("YamatoPhantomSpear2",3,0,8,12)
YASP FFGGD 1
YASP C 0 ACS_NamedExecuteWithResult("VC_SetState",2)
TNT1 A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
YASP C 0 A_FireCustomMissile("YamatoPhantomSpear2",-3,0,8,12)
YASP DEEFF 1
YASP C 0 A_Refire("Altfire2.Spin")

Altfire2.End:
YASP GGG 1 A_ClearRefire
TNT1 A 0 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
YASP NNN 1
goto Ready2

UltimateAttack:
YASP A 1
TNT1 A 0 A_GiveInventory("VC_Timer",1)
TNT1 A 0 A_GiveInventory("NoSpeed",1)
TNT1 A 0 A_SetGravity(0.0)
YASP A 0 ACS_NamedExecuteWithResult("VC_UltimateText",54)
YASP A 0 ACS_NamedExecuteWithResult("VC_SetState",6)
YASP A 0 A_GiveInventory("PharaohUltCooldown",1)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 0 A_GiveInventory("InvProtection",1) 
CUTA A 0 A_PlaySoundEx("classes/ultimateactivation","Auto")
TNT1 A 0 A_SpawnItemEx("MM6UltFXSpawner",0,0,28)
CUTA A 0 A_GiveInventory("YamatoSpearCancel",1)
YASP AAAAAAAAAAAAAAAAAA 1 A_Stop
YASP A 0 A_PlaySoundEx("mm6/ult","Auto")
YASP A 0 A_SpawnItemEx("YamatoManUltColorWatcher")
YASP OOOOAAAAAAOOOOAAAA 1 A_Stop
TNT1 A 0 A_TakeInventory("NoSpeed",999)
TNT1 A 0 A_GiveInventory("GravityRestore")
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_TakeInventory("InvProtection",1)
YASP A 0 A_GiveInventory("PharaohUltCooldown",1)
YASP A 0 A_TakeInventory("MediumUltimateAmmo",1)
YASP A 0 A_TakeInventory("UltAttackFlag",9)
YASP A 0 A_PlaySoundEx("weapon/yamatoultstart","Weapon")
YASP H 0 A_GiveInventory("YamatoSlow")
YASP A 0 A_GiveInventory("PharaohUltCooldown",1)
YASP BCDCDCD 5 ACS_NamedExecuteWithResult("VC_SetState",2)

UltLoop:
YASP H 0 A_TakeInventory("YamatoSlow")
YASP C 0 A_PlaySoundEx("weapon/yamatoultloop","Weapon")
YASP C 0 ACS_NamedExecuteWithResult("VC_SetState",4)
YASP CD 1 A_GiveInventory("YamatoUltHandler",1)
YASP C 0 A_JumpIfInventory("MediumUltimateAmmo",1,"UltLoop")

UltFinish:
YASP C 0 ACS_NamedExecuteWithResult("VC_SetState",2)
YASP CDCD 2 A_PlaySoundEx("weapon/topspin","Weapon")
YASP C 0 ACS_NamedExecuteWithResult("VC_SetState",2)
YASP CDCD 3 A_PlaySoundEx("weapon/topspin","Weapon")
TNT1 A 0 A_TakeInventory("VC_Timer",1)
YASP BAA 2
YASP AAAA 1 A_JumpIfInventory("BaseCustomFlag1",1,"GiveBackSpear")
goto Ready
}
}

actor YamatoSpearCooldown : inventory
{
	inventory.amount 1
	inventory.maxamount 350
}

actor YamatoFXCancel : Powerup
{
Powerup.Duration 6
}

actor YamatoSpearCancel : Powerup
{
Powerup.Duration 6
}

actor YamatoUltHandler : CustomInventory
{
States
{
Pickup:
TNT1 AA 0 A_FireCustomMissile("YamatoUltSpear",random(-12,12),0,8,12,0,random(-7,7))
TNT1 A 0 A_FireCustomMissile("YamatoUltSpear",random(-3,3),0,8,12,0,random(-2,2))
TNT1 A 0 A_TakeInventory("MediumUltimateAmmo",2)
stop
}
}

actor YamatoSpearHead
{
species "YamatoManType"
+THRUSPECIES
PROJECTILE
Radius 5
Height 5
scale 2.5
damage (42)
damagetype "YamatoSpear"
Obituary "$OB_YAMATOMAN1"
+SKYEXPLODE
+THRUGHOST
+DONTREFLECT
speed 60
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
YAMT A 1 A_SpawnItemEx("TimeStopGFX",random(-15,15),random(-15,15),random(-15,15),random(momx*0.2,momx*0.4),0,0,0,1,200)
goto Spawn+2
Death:
TNT1 A 0 A_GiveToTarget("YamatoFXCancel",1)
TNT1 A 0 A_SpawnItemEx("YamatoSpearDrop",0,0,0,0,0,-10)
stop
}
}

actor YamatoHeadFX
{
alpha 0.7
renderstyle add
PROJECTILE
Radius 5
Height 5
scale 2.5
damage (0)
speed 60
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
YAMT AAAAA 1 A_SetScale(scalex+0.7,scaley+0.7)
YAMT A 0 A_JumpIfInTargetInventory("YamatoFXCancel",1,"Death")
YAMT A 0 A_SetScale(2.5)
goto Spawn+2
Death:
TNT1 A 0
stop
}
}

actor YamatoSpearDrop
{
PROJECTILE
+THRUACTORS
+BOUNCEONCEILINGS
+NOEXPLODEFLOOR
-NOGRAVITY
-MOVEWITHSECTOR
+NOBLOCKMAP
+DONTBLAST
+DONTREFLECT
radius 4
height 4
scale 2.5
reactiontime 375
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
TNT1 A 0 A_JumpIfInTargetInventory("YamatoSpearCancel",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("VC_Timer",1,"Death")
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0) == 0, "Death")
YAMT B 0 A_SpawnItemEx("TimeStopGFX",random(-25,25),random(-25,25),random(0,5),0,0,random(1,9),0,1,160)
YAMT B 1 A_JumpIfCloser(64,"Collect")
YAMT B 0 A_Countdown
goto Spawn+2
Collect:
TNT1 A 0 A_GiveToTarget("YamatoCollectHandler",1)
stop
Death:
TNT1 A 0
stop
}
}

actor YamatoCollectHandler : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/yamatopickup","Auto")
TNT1 A 0 A_TakeInventory("YamatoSpearCooldown",999)
TNT1 A 0 A_TakeInventory("BaseCustomFlag2",999)
TNT1 A 0 A_GiveInventory("BaseCustomFlag1")
stop
}
}

actor YamatoUltSpear
{
species "YamatoManType"
+THRUSPECIES
translation "236:236=62:62"
PROJECTILE
Radius 5
Height 5
scale 2.5
+RIPPER
damage (5)
damagetype "YamatoUlt"
Obituary "$OB_YAMATOMAN5"
speed 160
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode",0)
YAMA A 1 A_GiveToTarget("PharaohUltCooldown",1)
goto Spawn+2
}
}

actor YamatoManUltColorWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 4 A_GiveToTarget("TotalWhiteColor")
TNT1 A 6 A_GiveToTarget("YamatoManColor")
TNT1 A 4 A_GiveToTarget("TotalWhiteColor")
TNT1 AAA 1 A_GiveToTarget("YamatoManColor")
stop
}
}

actor YamatoManColor : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+INVENTORY.AUTOACTIVATE
+COUNTITEM
+INVBAR
states
{
Pickup:
TNT1 A 1 ACS_ExecuteAlways(991,0,6827,0)
stop
}
}

actor YamatoSprintHandler : BaseMovement//CustomInventory
{
States
{
itTimeGo://Pickup:
TNT1 A 0 A_ChangeVelocity(CallACS("VC_XYMob",30),0,momz,CVF_RELATIVE|CVF_REPLACE)
TNT1 A 0 A_SpawnItemEx("YamatoSprintHitbox")
stop
}
}

actor YamatoSprintHitbox : BasicExplosion
{
species "YamatoManType"
+THRUSPECIES
Obituary "$OB_YAMATOMAN2"
damagetype "YamatoSprint"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(16,40,0,0,40)
stop
}
}

actor YamatoSprintProtect : PowerProtection
{
	Powerup.Duration 35
	DamageFactor "YamatoSprint", 0.0
}

actor YamatoAfterImage1
{
+NOINTERACTION
-SOLID
+NOGRAVITY
Translation "0:255=62:62"
alpha 1.0
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("SpecialTransID",2)
TNT1 A 0 A_GiveInventory("ProjectileCode")
TNT1 A 1
Fade:
Y4M6 B 1 A_FadeOut(0.1)
loop
}
}

actor YamatoAfterImage2 : YamatoAfterImage1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("SpecialTransID",2)
TNT1 A 0 A_GiveInventory("ProjectileCode")
TNT1 A 1
Fade:
Y4M6 C 1 A_FadeOut(0.1)
loop
}
}

actor YamatoAfterImage3 : YamatoAfterImage1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("SpecialTransID",2)
TNT1 A 0 A_GiveInventory("ProjectileCode")
TNT1 A 1
Fade:
Y4M6 D 1 A_FadeOut(0.1)
loop
}
}

actor YamatoPhantomSpear1
{
species "YamatoManType"
+THRUSPECIES
PROJECTILE
Radius 5
Height 5
scale 2.5
damage (13)
damagetype "YamatoSpear"
Obituary "$OB_YAMATOMAN3"
speed 40
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
YAMT A 1
goto Spawn+2
Death:
TNT1 A 0
stop
}
}

actor YamatoPhantomSpear2 : YamatoPhantomSpear1
{
translation "236:236=62:62"
+RIPPER
damage(3)
speed 35
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
YAMA A 1
goto Spawn+2
}
}

actor YamatoSpinHitbox : BasicExplosion
{
species "YamatoManType"
+THRUSPECIES
Obituary "$OB_YAMATOMAN3"
damagetype "YamatoSpin"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(2,40,0,0,40)
stop
}
}

actor YamatoBenKHitbox : BasicExplosion
{
species "YamatoManType"
+THRUSPECIES
Obituary "$OB_YAMATOMAN4"
damagetype "YamatoBenK"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(3,40,0,0,40)
stop
}
}

actor YamatoSpinProtect : PowerProtection
{
	Powerup.Duration 4
	DamageFactor "YamatoSpin", 0.0
	DamageFactor "YamatoBenK", 0.0
}

actor YamatoTFHandler1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("YamatoBenKHitbox")
TNT1 A 0 A_SpawnItemEx("YamatoShield",33,0,0,momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor YamatoTFHandler2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/enemyweapon","Weapon")
TNT1 A 0 A_TakeInventory("Base28Ammo",14)
TNT1 A 0 A_FireCustomMissile("YamatoBenKSpear",0,0,0,-20)
stop
}
}

actor YamatoShield
{
+MISSILE
Speed 0
+DONTSPLASH
+NOEXPLODEFLOOR
+FLOORCLIP
+NOGRAVITY
Damage 0
Height 64
Radius 32
health 99999
scale 2.5
+SHOOTABLE
+NOBLOOD
-SOLID
painchance 256
bloodtype ""
species "YamatoManType"
+THRUSPECIES
+CANTSEEK
+DONTRIP
+GHOST
+NORADIUSDMG
+NOTARGETSWITCH
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
TNT1 AA 1
stop
Death:
TNT1 A 0 //A_PlaySound("item/protoreflect")
TNT1 A 1
stop
Pain:
TNT1 A 0 A_SpawnItemEx("YamatoBlockFX",0,0,36)
TNT1 A 2 A_PlaySound("item/protoreflect")
stop
}
}

actor YamatoBenKSpear
{
Obituary "$OB_YAMATOMAN4"
scale 2.5
species "YamatoManType"
+THRUSPECIES
+MISSILE
+NOGRAVITY
Damage (0)
+DONTBLAST
+RIPPER
+SHOOTABLE
+NOBLOOD
-SOLID
painchance 256
health 999999
+DONTRIP
+NORADIUSDMG
+ghost
+NOTARGETSWITCH
damagetype "YamatoSpear"
Speed 18
mass 99999
Radius 40
Height 80
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode")
loopit:
YABK AB 1 A_Explode(3,48,0,0,48)
loop
Pain:
TNT1 A 0 
TNT1 A 0 A_PlaySound("item/protoreflect")
goto loopit
Death:
TNT1 A 0 A_CheckFloor("Death.Floor")
stop
Death.Floor:
TNT1 A 0 A_SpawnItemEx("YamatoBenKSpearFloor",0,0,0,18)
stop
}
}

actor YamatoBenKSpearFloor : YamatoBenKSpear
{
States
{
Death:
TNT1 A 0
stop
}
}

actor YamatoBlockFX : BasicClientSide
{
+BRIGHT
alpha 0.9
renderstyle add
states
{
Spawn:
YAMT C 0 A_SetScale(scaleX + 0.1, 2.5) 
YAMT C 1 A_FadeOut(0.05)
loop
}
}

actor YamatoM2Handler1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/enemyweapon","Auto")
TNT1 A 0 A_FireCustomMissile("YamatoPhantomSpear1",-10,0,8,12)
TNT1 A 0 A_FireCustomMissile("YamatoPhantomSpear1",0,0,8,12)
TNT1 A 0 A_FireCustomMissile("YamatoPhantomSpear1",10,0,8,12)
TNT1 A 0 A_TakeInventory("Base28Ammo",2)
stop
}
}

actor YamatoM2Handler2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("Base28Ammo",3)
TNT1 A 0 ACS_NamedExecuteWithResult("VC_SetState",2)
TNT1 A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
TNT1 A 0 A_FireCustomMissile("YamatoPhantomSpear2",0,0,8,12)
stop
}
}

actor YamatoM1Handler : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("BaseCustomFlag1",999)
TNT1 A 0 A_FireCustomMissile("YamatoSpearHead",0,0,8,12)
TNT1 A 0 A_FireCustomMissile("YamatoHeadFX",0,0,8,12)
TNT1 A 0 A_PlaySoundEx("weapon/enemyweapon","Weapon")
TNT1 A 0 A_GiveInventory("YamatoSpearCooldown",350)
TNT1 A 0 A_SpawnItemEx("YamatoManSpearWatcher")
TNT1 A 0 A_GiveInventory("BaseCustomFlag2",1)
stop
}
}

actor YamatoManSpearWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_TakeFromTarget("YamatoSpearCooldown",1)
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0) == 0, "Death")
TNT1 A 0 A_JumpIfInTargetInventory("VC_Timer",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("BaseCustomFlag1",1,"Death2")
TNT1 A 1 A_JumpIfInTargetInventory("YamatoSpearCooldown",1,"Spawn")
TNT1 A 1 A_JumpIfInTargetInventory("YamatoSpearCooldown",1,"Spawn")
goto Death

Death:
TNT1 A 0 A_GiveToTarget("BaseCustomFlag1")
Death2:
TNT1 A 0 A_GiveToTarget("YamatoSpearCancel")
stop
}
}

actor YamatoSlow : PowerSpeed
{
+POWERSPEED.NOTRAIL
Speed 0.75
}