/*
CREDITS:
Sprites:
Original by Midway, rip by Murden
Explosions - 3DRealms, recolor by Cacodemon
Spiffy shockwave - AEoD Team... or Murden, not sure.

Sounds:
Up, Idle - Epic Games (UT2004)
Fire & Charge - Blizzard
Down, up in fire change mode - ID (Doom 3)
Inner part of fire change mode - ?
*/

ACTOR Yamato : Weapon 24513
{
   //$Category Weapons
   //$Title Yamato Cannon
   //$Sprite YAMAX0
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the ''Yamato'' cannon! Not really russian weapon, yet utterly devastating! (8)"
   Obituary "%o was battlecruiser operationed by %k's ''Yamato'' cannon."
   Weapon.UpSound "Weapons/YamatoGun"
   Weapon.SelectionOrder 1
   Weapon.AmmoType "NukeCellAmmo"
   Weapon.AmmoGive 50
   Weapon.AmmoUse 25
   Weapon.AmmoType2 "NukeCellAmmo"
   Weapon.AmmoUse2 0
   Weapon.Kickback 100
   Weapon.SlotNumber 8
   +NOAUTOFIRE
   +NOALERT
   Scale 0.8
   States
   {
   Spawn:
      YAMA X -1
      Loop
   Ready:
      YAMA ABCY 2
   ReadyMain:
      YAMG A 0 A_PlaySoundEx("Weapons/YamatoLoop","SoundSlot5",1)
      YAMG ABC 2 A_WeaponReady
      Loop
   Deselect:
      YAMA Y 0 A_StopSoundEx("SoundSlot5")
      YAMG A 0 A_ZoomFactor(1)
      YAMA Y 1 A_Lower
      YAMA Y 0 A_Lower
      Loop
   Select:
      YAMG A 0 SetPlayerProperty(0,0,4)
      YAMA A 1 A_Raise
      Loop
   Fire:
      YAMG A 0 A_AlertMonsters
      YAMG A 0 A_JumpIfInventory("YamatoTrigger",1,"QuantumJump")
      YAMG A 0 A_PlayWeaponSound("Weapons/YamatoCharge")
      YAMG DEFGHIJKLMNODEFG 1 ACS_Execute(851,0,random(12,-12),random(25,-25),0)
      YAMG HIJKLMNO 1
      YAMG P 0 A_Recoil(4)
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))
      YAMG P 2 Bright
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))
      YAMG Q 2 Bright
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))

      YAMG A 0 A_ZoomFactor(0.7)
      YAMG A 0 A_Recoil(18)
      YAMG A 0 A_SetBlend("Red",0.6,60)
      YAMG A 0 A_GunFlash

      YAMG A 0 A_AlertMonsters
      YAMG A 0 A_PlaySound("Weapons/YamatoFire",6)
      YAMG A 0 A_FireCustomMissile("YamatoFakeFade",0,0,20,0)
      YAMG A 0 A_FireCustomMissile("YamatoFaky1",0,0,20,0)
      YAMG A 0 A_FireCustomMissile("YamatoFaky2",0,0,20,0)
      YAMG A 0 A_FireCustomMissile("YamatoBomb",0,1,20,0)
      YAMG A 0 ACS_Execute(851,0,120+random(-10,10),25+random(-5,5))
      YAMG R 2 Bright
      YAMG A 0 ACS_Execute(851,0,120+random(-10,10),15+random(-5,5))
      YAMG S 2 Bright
      YAMG A 0 ACS_Execute(851,0,120+random(-10,10),5+random(-5,5))
      YAMG T 2 Bright
      YAMG A 0 A_ZoomFactor(1)
      YAMG ABCABC 2
      Goto ReadyMain
   QuantumJump:
      YAMG A 0 A_TakeInventory("YamatoTrigger")
      YAMG A 0 A_PlayWeaponSound("Weapons/YamatoCharge")
      YAMG DEFGHIJKLMNODEFG 1 ACS_Execute(851,0,random(12,-12),random(12,-12),0)
      YAMG A 0 SetPlayerProperty(0,1,4)
      YAMG HIJKLMNO 1 ACS_Execute(851,0,-140+random(-12,12),10+random(-12,12))

      YAMG P 0 A_Recoil(4)
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))
      YAMG P 2 Bright
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))
      YAMG Q 2 Bright
      YAMG A 0 ACS_Execute(851,0,20+random(-10,10),10+random(-5,5))

      YAMG A 0 A_AlertMonsters
      YAMG A 0 A_StopSoundEx("SoundSlot5")
      YAMG A 0 A_FireCustomMissile("YamatoSounder",0,1,0,0)
      YAMG A 0 A_SetBlend("Red",1,175)
      YAMG A 0 A_GunFlash
      YAMD A 0 A_GiveInventory("YamatoInvicibility")
      YAMD A 0 A_GiveInventory("YamatoFrightener")
      YAMD A 210
      YAMD A 35 A_GiveInventory("YamatoFreeze")
      YAMG A 0 A_BrainDie
      Goto ReadyMain
   AltFire:
      YAMG ABCABC 2
      YAMG A 0 A_ReFire
	  Goto ReadyMain
   AltHold:
   	  YAMG A 0 A_Print("sorry, but quantum jump is turned off on the account of not being fucking funny. if you seriously considered using it you're an asshole in 99% cases. have a good day")
	  Goto ReadyMain
      YAMU A 0 A_StopSoundEx("SoundSlot5")
      YAMG A 0 A_PlayWeaponSound("Weapons/YamatoDown")
      YAMG A 0 A_PlaySoundEx("Weapons/YamatoLoad","Normal")
      YAMU JIHGFEDCBA 2
      TNT1 A 10
      TNT1 A 10 A_PlaySoundEx("Weapons/YamatoPut","SoundSlot6")
      TNT1 A 0 A_JumpIfInventory("YamatoTrigger",1,"UnLoad")
   Load:
      TNT1 A 0 A_GiveInventory("YamatoTrigger")
      TNT1 A 0 A_SetBlend("Green",0.1,15)
      TNT1 A 0 A_PlaySoundEx("Weapons/YamatoJumpOn","SoundSlot5")
      TNT1 A 0 A_GiveInventory("StalinActive")
      TNT1 A 0 A_Print("Quantum jump activated.")
      Goto KromkamCieBardzoMaczno
   Unload:
      TNT1 A 0 A_TakeInventory("YamatoTrigger")
      TNT1 A 0 A_SetBlend("Red",0.1,15)
      TNT1 A 0 A_PlaySoundEx("Weapons/YamatoJumpOff","SoundSlot5")
      TNT1 A 0 A_GiveInventory("StalinActive")
      TNT1 A 0 A_Print("Quantum jump deactivated.")
   KromkamCieBardzoMaczno:
      TNT1 A 40
      YAMG A 0 A_PlayWeaponSound("Weapons/YamatoUp")
      YAMG A 0 A_PlaySoundEx("Weapons/YamatoLoad","Normal")
      YAMU ABCDEFGHIJ 2
      YAMG ABCABC 2
      YAMG A 0 A_ClearReFire
      Goto ReadyMain
   Flash:
      TNT1 A 10 Bright A_Light2
      TNT1 A 5 Bright A_Light1
      TNT1 A 0 Bright A_Light0
      Stop
   }
}

ACTOR YamatoBomb
{
	Radius 12
	Height 8
	Speed 150
	Damage 0
	PROJECTILE
	+EXPLODEONWATER
	Renderstyle Add
	Scale 2.5
	Alpha 0.9
	DamageType "Superweapon"
	States
	{
	Spawn:
		YAS3 ABCD 2 bright A_Explode(100,128,0)
		Loop
	Death:
			YAS3 AB 2 Bright
        	TNT1 A 0 A_PlaySound("Weapons/YamatoHizz",6)
			YAS3 CD 2 Bright
        	TNT1 A 0 A_SpawnItemEx("YamatoShockInverse",0,0,0,0,0,0,0,128,0)
			YAS3 ABCDAB 2 bright A_FadeOut(0.1)
			TNT1 A 1 A_SpawnItemEx("YamatoHit",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
        	stop
	}
}

ACTOR YamatoHit
{
	+NOGRAVITY
	+NOINTERACTION
	States
	{
	Spawn:
		TNT1 A 0 Radius_Quake(99999,100,0,100,0)
        TNT1 A 0 A_PlaySound("Weapons/YamatoBlast",6)
		TNT1 A 0 A_SpawnItemEx("YamatoIllumination",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoShockwave",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoDamageAbuse",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoDamageLethal",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoSpinalCord",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoGroundSpin",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoShocker",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoExploder",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoShroom",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoBasis",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoShroomer",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoAfterBoomEffect",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
        TNT1 A 1
        stop
	}
}

ACTOR YamatoFakeFade
{
	Radius 12
	Height 8
	PROJECTILE
	Renderstyle Add
	+EXPLODEONWATER
	+CLIENTSIDEONLY
	Scale 1
	Speed 150
	States
	{
	Spawn:
		TNT1 A 0 A_SpawnItemEx("YamatoBombTrail2",random(-4,4),random(-4,4),random(-4,4),0,0,0,0,128,0)
        TNT1 A 1 Bright A_SpawnItemEx("YamatoBombTrail",random(-4,4),random(-4,4),random(-4,4),0,0,0,0,128,0)
		TNT1 B 0 A_SpawnItemEx("YamatoBombTrail2",random(-4,4),random(-4,4),random(-4,4),0,0,0,0,128,0)
        TNT1 B 1 Bright A_SpawnItemEx("YamatoBombTrail",random(-4,4),random(-4,4),random(-4,4),0,0,0,0,128,0)
		Loop
	Death:
		TNT1 AB 1 A_FadeOut(0.1)
		Wait
	}
}

ACTOR YamatoFaky1 : YamatoFakeFade
{
	Scale 3
	Alpha 0.3
	States
	{
	Spawn:
        YAS3 ABCD 3 Bright
		Loop
	Death:
		YAS3 ABCD 3 Bright A_FadeOut(0.025)
		Wait
	}
}

ACTOR YamatoFaky2 : YamatoFakeFade
{
	Scale 4
	Alpha 0.25
	States
	{
	Spawn:
        YAS3 DCBA 4 Bright
		Loop
	Death:
		YAS3 DCBA 4 Bright A_FadeOut(0.015)
		Wait
	}
}

ACTOR YamatoBombTrail : YamatoFakeFade
{
	Speed 0
	Scale 3
	Alpha 0.15
	States
	{
	Spawn:
        YAS1 AB 1 Bright A_FadeOut(0.02)
		Loop
	}
}

ACTOR YamatoBombTrail2 : YamatoFakeFade
{
	Speed 0
	Scale 1.5
	Alpha 0.35
	States
	{
	Spawn:
        YAE1 ABCBA 1 Bright
        YAS2 ABCDEF 1 Bright
		Stop
	}
}

ACTOR YamatoShockInverse
{
	+NOGRAVITY
	+NOINTERACTION
	+CLIENTSIDEONLY
	Renderstyle Add
	Scale 2
	States
	{
	Spawn:
        YAE3 SRQPONMLKJIHGFEDCBA 1 Bright
		Stop
	}
}

ACTOR YamatoIllumination
{
	+NOGRAVITY
	+NOINTERACTION
	+CLIENTSIDEONLY
	Renderstyle Add
	Alpha 1
	Scale 5.5
	States
	{
	Spawn:
        YAE4 A 1 Bright A_FadeOut(0.0075)
		Wait
	}
}

ACTOR YamatoShockwave
{
	+NOINTERACTION
	+NOCLIP
	+NOGRAVITY
	States
	{
	Spawn:
			TNT1 A 0
			TNT1 AAAAA 0 A_SpawnItemEx("YamatoShock4",0.1*random(10,-10),0.1*random(10,-10),0.1*random(10,-10),2*random(4.25,3.25),0.1*random(6,-6),0.1*random(6,-6),random(0,359),128,0)
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("YamatoExploder",0.1*random(10,-10),0.1*random(10,-10),0.1*random(10,-10),5*random(4.25,3.25),0.1*random(6,-6),0.1*random(6,-6),random(0,359),SXF_TRANSFERPOINTERS,0)
			TNT1 AAAAAAAA 0 A_SpawnItemEx("YamatoAfterBoomEffect",0.1*random(10,-10),0.1*random(10,-10),0.1*random(10,-10),2.5*random(4.25,3.25),0.1*random(6,-6),0.1*random(6,-6),random(0,359),128,0)
			TNT1 A 1
			Stop
	}
}

ACTOR YamatoDamageAbuse
{
	+NOGRAVITY
	+NOINTERACTION
	+FORCERADIUSDMG
	DamageType "Superweapon"
	States
	{
	Spawn:
        	TNT1 A 0
        	TNT1 A 0 A_Explode(10000,2048,0,1)
        	TNT1 A 0 A_Explode(5000,4096,0,1)
        	TNT1 A 1
			Stop
	}
}

ACTOR YamatoDamageLethal
{
	+NOGRAVITY
	+NOINTERACTION
	DamageType "Superweapon"
   	Obituary "%o was battlecruiser operationed by %k's ''Yamato'' cannon."
	States
	{
	Spawn:
        	TNT1 A 0
        	TNT1 A 0 A_Explode(1000,512)
        	TNT1 A 0 A_Explode(100,3072)
        	TNT1 A 1
			Stop
	}
}

ACTOR YamatoShocker
{
	+NOGRAVITY
	+CLIENTSIDEONLY
	+NOINTERACTION
	States
	{
	Spawn:
		TNT1 A 20 A_SpawnItemEx("YamatoShock1",0,0,0,0,0,0,0,128,0)
		TNT1 A 20 A_SpawnItemEx("YamatoShock2",0,0,0,0,0,0,0,128,0)
		TNT1 A 20 A_SpawnItemEx("YamatoShock3",0,0,0,0,0,0,0,128,0)
		TNT1 A 20 A_SpawnItemEx("YamatoShock4",0,0,0,0,0,0,0,128,0)
		TNT1 A 20 A_SpawnItemEx("YamatoShock5",0,0,0,0,0,0,0,128,0)
		Stop
	}
}

ACTOR YamatoShock1
{
	+NOGRAVITY
	+CLIENTSIDEONLY
	+NOINTERACTION
	Renderstyle Add
	Scale 12
	States
	{
	Spawn:
        YAE3 ABCDEFGHIJKLMNOPQRS 3 Bright
		Stop
	}
}

ACTOR YamatoConcussionShock : YamatoShock1
{
	Scale 1
	States
	{
	Spawn:
        YAE3 ABCDEFGHIJKLMNOPQRS 1 Bright
		Stop
	}
}

ACTOR YamatoShock2 : YamatoShock1
{
	Scale 10
}

ACTOR YamatoShock3 : YamatoShock1
{
	Scale 8
}

ACTOR YamatoShock4 : YamatoShock1
{
	Scale 6
}

ACTOR YamatoShock5 : YamatoShock1
{
	Scale 4
}

ACTOR YamatoExploder
{
	+NOGRAVITY
	+NOINTERACTION
	Renderstyle Add
	ReactionTime 25
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 4 A_SpawnItemEx("YamatoExplode",random(-700,700),random(-700,700),15+random(-150,150),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoExplode
{
	+NOGRAVITY
	+NOINTERACTION
	Renderstyle Add
	+CLIENTSIDEONLY
	SeeSound ""
	Scale 2
	States
	{
	Spawn:
		YAE2 A 0
		YAE2 A 0 A_PlaySound("Weapons/YamatoExp")
        YAE2 ACEGIKMO 2 Bright A_SpawnItemEx("YamatoExplodeFade",random(-65,65),random(-65,65),random(-65,65),0,0,2+random(-1,0),0,SXF_TRANSFERPOINTERS,0)
		YAE2 QSU 2
		Stop
	}
}

ACTOR YamatoExplodeFade
{
	+NOGRAVITY
	+NOINTERACTION
	+FORCERADIUSDMG
	DamageType "Superweapon"
	Renderstyle Add
	Alpha 0.75
	Scale 2
	States
	{
	Spawn:
		YAE2 A 0
		YAE2 A 0 A_Explode(150,192,0)
        YAE2 ABCDEFGHIJKLMNO 1 Bright
		YAE2 PQRSTU 2
		Stop
	}
}

ACTOR YamatoSpinalCord
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 80
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0, 2, 0, 1)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(8 + angle)
		TNT1 A 0 A_Countdown

		TNT1 A 0 ThrustThingZ(0, 2, 0, 1)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(8 + angle)
		TNT1 A 0 A_Countdown


		TNT1 A 0 ThrustThingZ(0, 2, 0, 1)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(8 + angle)
		TNT1 A 0 A_Countdown


		TNT1 A 0 ThrustThingZ(0, 2, 0, 1)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeCord",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(8 + angle)
		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoExplodeCord : YamatoExplode
{
	Speed 45
}

ACTOR YamatoGroundSpin
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 120
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(6 + angle)
		TNT1 A 0 A_Countdown

		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(6 + angle)
		TNT1 A 0 A_Countdown


		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(6 + angle)
		TNT1 A 0 A_Countdown

		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,270,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,180,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,90,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("YamatoExplodeSpin",0,0,0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
		TNT1 A 1 A_SetAngle(6 + angle)
		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoExplodeSpin : YamatoExplode
{
	Speed 55
}

ACTOR YamatoShroom
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 80
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0, 2, 0, 1)
		TNT1 A 0 A_SpawnItemEx("YamatoExplode",random(-200,200),random(-200,200),15+random(-70,70),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 1 A_SpawnItemEx("YamatoExplode",random(-200,200),random(-200,200),15+random(-70,70),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)

		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 0 A_SpawnItemEx("YamatoAirplode",0,0,0,0,0,0,0,128,0)
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("YamatoExplode",frandom(-1000,1000),frandom(-1000,1000),15+frandom(-400,400),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_SpawnItemEx("YamatoShock3",0,0,0,0,0,0,0,128,0)
		TNT1 A 0 A_SpawnItemEx("YamatoExploder",0,0,0,0,0,0,0,128,0)
		TNT1 A 0 A_SpawnItemEx("YamatoAfterboomEffectAir",0,0,0,0,0,0,0,128,0)
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoAirplode
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 95
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 AAAA 0 A_SpawnItemEx("YamatoExplode",0.1*frandom(-10000,10000),0.1*frandom(-10000,10000),15+frandom(-400,400),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 1 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoShroomer
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 8
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0, 16, 0, 1)
		TNT1 A 0 A_SpawnItemEx("YamatoMidplode",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 10

		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoMidplode
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 25
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 AAA 0 A_SpawnItemEx("YamatoAfterFade",0.1*frandom(-2000,2000),0.1*frandom(-2000,2000),15+frandom(-90,90),random(-20,20),random(-20,20),0,random(0,359),SXF_TRANSFERPOINTERS,0)
		TNT1 A 4 A_SpawnItemEx("YamatoExplode",0.1*frandom(-2000,2000),0.1*frandom(-2000,2000),15+frandom(-90,90),0,0,2+random(-2,2),0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoBasis
{
	+NOGRAVITY
	+NOINTERACTION
	ReactionTime 4
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0, 8, 0, 1)
		TNT1 A 10 A_SpawnItemEx("YamatoExploder",frandom(-300,300),frandom(-300,300),frandom(-150,150),0,0,0,0,SXF_TRANSFERPOINTERS,0)

		TNT1 A 0 A_Countdown
		Loop
	Death:
		TNT1 A 0 A_SpawnItemEx("YamatoAfterboomEffect",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoAfterBoomEffect
{
	+NOGRAVITY
	+NOINTERACTION
	+CLIENTSIDEONLY
	ReactionTime 120
	States
	{
	Spawn:
        	TNT1 A 0
        	TNT1 A 0 A_Countdown
        	TNT1 A 1 A_SpawnItemEx("YamatoAfterFade",0.1*random(-7000,7000),0.1*random(-7000,7000),15+random(-150,150),random(-20,20),random(-20,20),0,random(0,359),SXF_TRANSFERPOINTERS,0)
			Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR YamatoAfterBoomEffectAir : YamatoAfterBoomEffect
{
	ReactionTime 100
}

ACTOR YamatoAfterFade
{
	+NOGRAVITY
	+CLIENTSIDEONLY
	+NOINTERACTION
	Renderstyle Add
	Scale 0.5
	States
	{
	Spawn:
		YAE2 A 0
		TNT1 A 0 ThrustThingZ(0, 6, 0, 1)
		YAS2 AAA 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)

		TNT1 A 0 ThrustThingZ(0, 4, 0, 1)
		YAS2 BBB 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)

		TNT1 A 0 ThrustThingZ(0, 6, 0, 1)
        YAS2 CCC 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)
        
		TNT1 A 0 ThrustThingZ(0, 4, 0, 1)
        YAS2 DDD 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)
        
		TNT1 A 0 ThrustThingZ(0, 6, 0, 1)
        YAS2 EEE 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)
        
		TNT1 A 0 ThrustThingZ(0, 4, 0, 1)
		YAS2 FFF 1 Bright A_SpawnItemEx("YamatoAfterFadeTrail",0,0,random(-5,5),random(-5,5),0,0,0,128,0)
		Stop
	}
}

ACTOR YamatoAfterFadeTrail
{
	+NOGRAVITY
	+NOINTERACTION
	+CLIENTSIDEONLY
	Renderstyle Add
	Alpha 1
	Scale 0.5
	States
	{
	Spawn:
		YAS2 A 0
        YAS2 ABCDEF 1 Bright A_FadeOut(0.1)
		Stop
	}
}

//Alt-Fire

ACTOR YamatoTrigger : Inventory
{
	Inventory.MaxAmount 1
}

ACTOR YamatoFrightener : PowerupGiver
{
	Inventory.Amount 1
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	powerup.duration 999
	Powerup.Type Invulnerable
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

ACTOR YamatoInvicibility : PowerupGiver
{
	Inventory.Amount 1
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	powerup.duration 999
	Powerup.Type Invulnerable
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

ACTOR YamatoFreeze : PowerupGiver
{
	Inventory.Amount 1
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	powerup.duration 999
	Powerup.Type TimeFreezer
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

ACTOR YamatoSounder
{
	+NOGRAVITY
	+NOINTERACTION
	+NOTIMEFREEZE
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("YamatoDamageAbuse",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
		TNT1 A 0 A_PlaySoundEx("Weapons/YamatoTeleport","SoundSlot5",0,2)
		TNT1 A 0 A_PlaySoundEx("Weapons/YamatoFire","SoundSlot6",0,2)
		TNT1 A 0 A_PlaySoundEx("Weapons/YamatoBlast","Normal",0,2)
		TNT1 A 1
		Stop
	}
}
