ACTOR MechMorph : PowerupGiver 6969
{
 Inventory.PickupMessage "Illegali stolen from zdoom wiki"  
 Inventory.PickupSound "world/thunder"
 Powerup.Type PowerGoMech
 Powerup.Duration 42000
 +COUNTITEM
 +FLOATBOB
 +INVENTORY.AUTOACTIVATE
 -INVENTORY.ALWAYSPICKUP
 -INVENTORY.INVBAR
 scale 0.5
 States
 {
  Spawn:
   WARM Q 1
    Goto Spawn
 }
}

ACTOR PowerGoMech : PowerMorph
{
 PowerMorph.PlayerClass "MechPlayer"
 PowerMorph.MorphStyle (MRF_FULLHEALTH|MRF_ADDSTAMINA)
}
//--------------------------------------------------------------------------------------------------------------------

ACTOR MechWalk : Ammo //ammo.. I am noob xD
{
  Inventory.PickupMessage "you picked the fact you made left leg step with your lovely cute awesome looking mech :D"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 1
  Inventory.Icon "CLIPA0" //dont want to try remove it *plays weird music*
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

ACTOR MechFroze : Ammo //copy and paste one thing and change minor things
{
  Inventory.PickupMessage "you picked the fact your mech stopped moving 100% so it wont do glitches"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 1
  Inventory.Icon "CLIPA0" 
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}


ACTOR MechPlayer : PlayerPawn
{
	Speed 0.7
	Radius 32
	Height 128
	Mass 10000 //[Samu] Mechs are big!, and they have a lot of Metals, Fire and Blast! Fire And Blast!
	PainChance 255
	Player.ColorRange 112, 127
	Player.DisplayName "War Mech"
	Player.CrouchSprite "ZTNK"
	Player.ViewHeight 128
	Player.SideMove 0.5
	Player.AttackZOffset 96
	Player.JumpZ 15
	Player.SoundClass "MechPlayer"
	Player.DamageScreenColor "00 00 ff", 0.5
	scale 0.4
	Species Marines
	DamageFactor "MarineFire", 0.0
	+NOSKIN

	
	States
	{

	Spawn:
		WARM "#" 1
		goto Spawn
	See:
		"####" "#" 1 A_CheckFloor(1)
		"####" "#" 50 A_Jump(256, 1) 
		goto Spawn 
		TNT1 A 0 A_JumpIfInventory("MechWalk",1,"See.LeftLeg")
	See.RightLeg:
		TNT1 A 0 A_GiveInventory("MechWalk",1)
		WARM A 3 A_PlaySound("vehicle/mechleg", CHAN_AUTO)
		WARM ABC 3 
		TNT1 A 0 A_SpawnItem("MechLegDamage")
		WARM DEF 3 
		"####" "#" 0 A_SpawnItem("MechLegDamage")
		"####" "#" 50 A_Jump(256, "Spawn") 
		goto Spawn
	StopMove:
		"####" "#" 1 //A_Stop
		"####" "#" 50 A_Jump(256, "Spawn") 
		goto Spawn

	See.LeftLeg:
		WARM A 0 A_TakeInventory("MechWalk",1)
		WARM F 3 A_PlaySound("vehicle/mechleg", CHAN_AUTO)
		WARM GHI 3 
		TNT1 A 0 A_SpawnItem("MechLegDamage")
		WARM JKL 3 
		"####" "#" 0 A_SpawnItem("MechLegDamage")
		"####" "#" 1 A_CheckFloor("StopMove")
		"####" "#" 50 A_Jump(256, "Spawn") 
		goto Spawn
		
	Pain:
	    WARM A 0 A_SpawnItem("MechLegDamage")
		"####" "#" 0 A_PlaySound("veh/tankpain")
		"####" "#" 4 A_Pain
		Goto Spawn
	Death:
		WARM G 5 
		TNT1 A 0 A_JumpIf(CallACS("MechUp_CheckCvar") == 1, "Death.SelfDestruct")
		TNT1 A 0 A_JumpIfInventory("MechUp_SelfDestruct", 1, "Death.SelfDestruct")
		WARM A 0 A_SpawnItem("MechExplosion")
		goto FinishDeath
	Death.SelfDestruct:
		WARM A 0 A_SpawnItem("MechExplosion_lv.Fuckyou")
		goto FinishDeath
	FinishDeath:
		WARM H 5 A_Scream
		WARM I 5 A_NoBlocking
		TNT1 A 0 A_SpawnItem("Junk_Mech_Spawn")
		WARM J 5
		TNT1 A -1
        Stop 
				// you cant do that! It should freeze the skulltag!.. if you were that mech still
				// [Samu] Zandronum fixed that, so fuck it.
	XDeath:
		WARM G 5 
		TNT1 A 0 A_JumpIf(CallACS("MechUp_CheckCvar") == 1, "XDeath.SelfDestruct")
		TNT1 A 0 A_JumpIfInventory("MechUp_SelfDestruct", 1, "XDeath.SelfDestruct")
		WARM A 0 A_SpawnItem("MechExplosion") 
		goto FinishXDeath
	XDeath.SelfDestruct:
		WARM A 0 A_SpawnItem("MechExplosion_lv.Fuckyou")
		goto FinishXDeath
	FinishXDeath:
		WARM H 5 A_XScream
		WARM I 5 A_NoBlocking
		TNT1 A 0 A_SpawnItem("Junk_Mech_Spawn")
		WARM J 5
		TNT1 A -1
        Stop
	}
}

Actor KaBoomBiatch
{
	Radius 6
	Height 6
	Speed 2
	Alpha 0.9
	Obituary "%o went KABOOOOOOOOOOOOOOOOOOOM!"
	DamageType MarineFire
	PROJECTILE
	+NOGRAVITY
	+FLOORHUGGER
	-BLOODSPLATTER
	States
	{
	Spawn:
		TNT1 AA 2 bright A_Explode(500, 512, 0)
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR MechExplosion
{
	+NOGRAVITY
	Speed 0.5
	states
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL B 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL C 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL D 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			stop	
	}
}

ACTOR MechExplosion_lv.FuckYou
{
	+NOGRAVITY
	Speed 0.5
	states
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			TNT1 AAAAAA 0 A_SpawnitemEx("KaBoomBiatch")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL B 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			TNT1 AAAAAA 0 A_SpawnitemEx("KaBoomBiatch")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL C 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			TNT1 AAAAAA 0 A_SpawnitemEx("KaBoomBiatch")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			MISL D 5 bright A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			TNT1 A 0 A_PlaySound("weapons/rocklx")
			TNT1 AAAAAA 0 A_SpawnitemEx("KaBoomBiatch")
			MISL BBBBBB 0 A_SpawnItemEx("ExplosionPart",random(-64,64),random(-64,64),random(-64,64) + 64)
			stop	
	}
}

ACTOR ExplosionPart
{
	+NOGRAVITY
    +CLIENTSIDEONLY
	+NOINTERACTION
	states
	{
		Spawn:
			MISL A 0
			MISL BCD 5 bright
			stop	
	}
}

actor MechLegDamage
{
	
	height 2
	radius 2
	
	+NOCLIP
	+NOBLOCKMAP
	+NOGRAVITY
	+NOBLOOD
	+BLOODLESSIMPACT
	-SOLID
	projectile
	donthurtshooter
	DamageType MarineFire
	states
	{
		spawn:
		TNT1 AA 1 A_Explode(164,128)
		stop
	}
}

actor MechDummy 6070
{
	Radius 32
	Height 128
	scale 0.4
	
	States
	{
	Spawn:
	    WARM Q 1
  	    Goto Spawn
	}
}
