//This goes in frenzy_vehicle.wad, replacing the DECORATE lump
// CLASSES
ACTOR TankPlayer : PlayerPawn
{
	Speed 0.7
	Radius 32
	Height 128
	Mass 100
	PainChance 255
	Player.ColorRange 112, 127
	Player.DisplayName "War Mech"
	Player.CrouchSprite "ZTNK"
	Player.ViewHeight 128
	Player.SideMove 0.5
	Player.AttackZOffset 96
	scale 0.4
	
	States
	{
	Spawn:
		PLAY O -1
		Loop
	See:
		PLAY O 3 A_PlaySound("vehicle/mechleg", CHAN_AUTO)
		PLAY PQRS 3
		PLAY T 3 A_PlaySound("vehicle/mechleg", CHAN_AUTO)
		PLAY UVWXYZ 3
		Loop
	Pain:
		PLAY O 4 A_PlaySound("veh/tankpain")
		PLAY O 4 A_Pain
		Goto Spawn
	Death:
		PLAY U 10 A_PlayerSkinCheck("AltSkinDeath")
		PLAY V 10 A_PlayerScream
		PLAY W 10 A_NoBlocking
		PLAY X 10
		PLAY Y 10
                Stop
	XDeath:
		PLAY G 5 A_PlayerSkinCheck("AltSkinXDeath")
		PLAY H 5 A_XScream
		PLAY I 5 A_NoBlocking
		PLAY JKLMN 5
                Stop
	AltSkinDeath:
		PLAY A 6
		PLAY A 6 A_PlayerScream
		PLAY A 6
		PLAY A 6 A_NoBlocking
		PLAY A 6
		Stop
	AltSkinXDeath:
		PLAY A 5 A_PlayerScream
		PLAY A 5 A_NoBlocking
		PLAY A 5 A_SkullPop
		PLAY A 5
		Stop
	}
}

actor TankGun : Weapon
{
  radius 20 
  height 16
  inventory.pickupmessage "You got the Tank"
  weapon.selectionorder 2500
  weapon.kickback 100
  DamageType MarineFire
  +WEAPON.EXPLOSIVE
  states
  {
  Ready:
    NULL A 1 A_WeaponReady
    loop
  Deselect:
    NULL A 1 A_Lower
	NULL AA 0 A_LOWER
    loop
  Select:
    NULL A 1 A_Raise
	NULL AA 0 A_RAISE
    loop
  Fire:
    NULL A 8 A_PlaySound("NAILUP")
    NULL A 5
    NULL A 3
    NULL A 2
    NULL A 2
  Hold:
	NULL A 0 A_PlayWeaponSound("Weapons/Nailfire")
	NULL A 0 A_GunFlash
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,13,random(-3,3),random(-3,3))
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,-13,random(-3,3),random(-3,3))
    NULL A 2 Bright
    NULL A 0 A_JumpIfNoAmmo(11)
	NULL A 0 A_GunFlash
	NULL A 0 A_PlayWeaponSound("Weapons/Nailfire")
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,13,random(-3,3),random(-3,3))
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,-13,random(-3,3),random(-3,3))
    NULL A 2 Bright 
    NULL A 0 A_Light0
    NULL A 0 A_ReFire
    NULL A 2
    NULL A 3
    NULL A 4
    NULL A 6
    NULL A 8
    NULL A 0 A_CheckReload
    Goto Ready
    NULL A 2 A_Light0
    NULL A 2
    NULL A 3
    NULL A 3
    NULL A 4
    NULL A 6
    NULL A 9
    NULL A 0 A_CheckReload
    Goto Ready
  Spawn:
    NULL A -1
	Stop
  }
}

actor seekerRocket// : MageStaffFX2
{
	spawnid 169
	Radius 12
	Height 8
	Speed 35
	Damage 150
	Projectile
	Scale 1.0//0.74
	+NOTIMEFREEZE
      //+EXTREMEDEATH
	+ROCKETTRAIL
	+SEEKERMISSILE
	//-RIPPER
	DeathSound "DSQKLDTH"
        explosionradius 256
        explosiondamage 600
  DamageType MarineFire
	States
	{
	Spawn:
		QROK A 1 bright A_SeekerMissile(80,90)
		NULL A 0 A_CustomMissile("seekerRockTrail",0,0,0,0)
		QROK A 0 Bright A_LookEx(2,0,12,0,360,"See")
	QROK A 0 Bright //A_MStaffTrack
	Loop
    See:
	QROK A 0 Bright //A_MeleeAttack
	QROK A 0 Bright A_Die
	Death:
		EXP3 A 2 Bright A_Explode
		NULL A 0 A_SpawnItem("ExtraExplosion")
		NULL A 0 A_SpawnItem("Engulf")
		EXP3 BCDEFGHIJKLMNOPQRSTUVWXYZ 1 Bright
		Stop
	}
}

actor seekerRocket_ForAirstrike// : MageStaffFX2
{
	spawnid 170
	Radius 12
	Height 8
	Speed 35
	Damage 250
	Projectile
	Scale 3.0//0.74
	+NOTIMEFREEZE
      //+EXTREMEDEATH
	+ROCKETTRAIL
	+SEEKERMISSILE
	//-RIPPER
	DeathSound "DSQKLDTH"
        explosionradius 300
        explosiondamage 700
	renderstyle add
  DamageType MarineFire
	States
	{
	Spawn:
		QROK A 1 bright A_SeekerMissile(80,90)
		NULL A 0 A_CustomMissile("seekerRockTrail",0,0,0,0)
		QROK A 0 Bright A_LookEx(2,0,12,0,360,"See")
	QROK A 0 Bright //A_MStaffTrack
	Loop
    See:
	QROK A 0 Bright //A_MeleeAttack
	QROK A 0 Bright A_Die
	Death:
		EXP3 A 2 Bright A_Explode
		NULL A 0 A_SpawnItem("ExtraExplosion")
		NULL A 0 A_SpawnItem("Engulf")
		EXP3 BCDEFGHIJKLMNOPQRSTUVWXYZ 1 Bright
		Stop
	}
}

actor seekerRockTrail
{
	Radius 1
	Height 1
	Speed 0
	Damage 0
	Scale 0.8
	RenderStyle Add
	Alpha 0.5
	+NOINTERACTION
	+CLIENTSIDEONLY
	+NOTIMEFREEZE
  DamageType MarineFire
	States
	{
	Spawn:
		SMO2 ABCDE 3
		Stop
	}
}
Actor ExtraExplosion
{
PROJECTILE
+NOCLIP
+NOTIMEFREEZE
radius 6
  height 8
  mass 1
  speed 35
  //damage 20   too powerful :P
	RenderStyle Add
  DamageType MarineFire
States
{
Spawn:
EXP2 A 2 Bright A_Explode
EXP2 A 0 Radius_Quake(10,8,0,15,0)
EXP2 ABCDEFGHIJKLMN 2 Bright A_SetTranslucent(1,1.0)
stop
}
}

Actor Engulf
{
scale 7.0
PROJECTILE
+NOCLIP
+NOTIMEFREEZE
radius 6
  height 8
  mass 1
  speed 35
  //damage 20   too powerful :P
	RenderStyle Add
  DamageType MarineFire
States
{
Spawn:
BLST A 1 A_FadeOut(0.3)
loop
}
}


actor NailShot
{

	Radius 6
	Height 6
	Speed 30
	Damage 200
	Projectile
	Scale 0.8
	DeathSound "weapons/nailpuff"
  DamageType MarineFire
	States
	{
	Spawn:
		SPIK A 1 //A_spawnitem("MicroNailPuff")
		loop
	Death:
		TNT1 A 0 A_SpawnItemEx("NailPuff",0,0,0,0,0,0,0,32)
		NULL AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MiniNailShotgravity",0,0,0,random(-4,4),random(-4,4),random(-4,4),random(1,360))
		TNT1 A 0 A_Jump(128,1)
		TNT1 A 0 A_PlaySound("weapons/nailricochet")
		TNT1 A 3
		Stop
	}
}
actor MiniNailShot
{
	Radius 6
	Height 6
	Speed 30
	Damage 30
	Projectile
	Scale 0.15
	DeathSound "weapons/nailpuff"
  DamageType MarineFire
	States
	{
	Spawn:
		SPIK A 1 // A_spawnitem("MiniNailPuff")
		loop
	Death:
		TNT1 A 0 A_SpawnItemEx("MicroNailPuff",0,0,0,0,0,0,0,32)
		TNT1 A 0 A_Jump(128,1)
		TNT1 A 0 A_PlaySound("weapons/nailricochet")
		TNT1 A 3
		Stop
	}
}
actor MiniNailShotGravity
{
Radius 0
	Height 0
	Speed 30
	Damage 2
	Projectile
	+LOWGRAVITY
	Scale 0.07
	DeathSound "weapons/nailpuff"
  DamageType MarineFire
	States
	{
	Spawn:
		SPIK A 1// A_spawnitem("MiniNailPuff")
		NULL A 0 A_GRAVITY
		SPIK A 1// A_spawnitem("MiniNailPuff")
		SPIK A 1// A_spawnitem("MiniNailPuff")
		NULL A 0 A_GRAVITY
		SPIK A 1// A_spawnitem("MiniNailPuff")
		SPIK A 1// A_spawnitem("MiniNailPuff")
		NULL A 0 A_GRAVITY
		SPIK A 1// A_spawnitem("MiniNailPuff")
		SPIK A 1// A_spawnitem("MiniNailPuff")
		NULL A 0 A_GRAVITY
		SPIK A 1// A_spawnitem("MiniNailPuff")
	Death:
		TNT1 A 0 A_SpawnItemEx("MicroNailPuff",0,0,0,0,0,0,0,32)
		Stop
	}
}
Actor NailPuff
{
	Projectile

	+NOCLIP
	Speed 0
	Damage 0
	Scale 3.2
	RenderStyle Add
  DamageType MarineFire
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(128,11)
		FX57 ABCDEFGHIJ 2 Bright A_FadeOut
		Stop
		FX57 KLMNOPQRST 2 Bright A_FadeOut
		Stop
	}
}
Actor MicroNailPuff : NailPuff
{
	Scale 0.08
  DamageType MarineFire
}
Actor MiniNailPuff : NailPuff
{
	Scale 0.05
  DamageType MarineFire
}



actor TankGunAdvanced : Weapon
{
  radius 20 
  height 16
  inventory.pickupmessage "You got the Tank"
  weapon.selectionorder 2500
  weapon.kickback 100
  DamageType MarineFire
  +WEAPON.EXPLOSIVE
  states
  {
  Ready:
    NULL A 1 A_WeaponReady
    loop
  Deselect:
    NULL A 1 A_Lower
	NULL AA 0 A_LOWER
    loop
  Select:
    NULL A 1 A_Raise
	NULL AA 0 A_RAISE
    loop
  Fire:
    NULL A 8 A_PlaySound("NAILUP")
    NULL A 5
    NULL A 3
    NULL A 2
    NULL A 2
  Hold:
	NULL A 0 A_PlayWeaponSound("Weapons/Nailfire")
	NULL A 0 A_GunFlash
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,13,random(-3,3),random(-3,3))
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,-13,random(-3,3),random(-3,3))
    NULL A 2 Bright
    NULL A 0 A_JumpIfNoAmmo(11)
	NULL A 0 A_GunFlash
	NULL A 0 A_PlayWeaponSound("Weapons/Nailfire")
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,13,random(-3,3),random(-3,3))
    NULL A 0 Bright A_FireCustomMissile("MiniNailShot",random(-3,3),1,-13,random(-3,3),random(-3,3))
    NULL A 2 Bright 
    NULL A 0 A_Light0
    NULL A 0 A_ReFire
    NULL A 2
    NULL A 3
    NULL A 4
    NULL A 6
    NULL A 8
    NULL A 0 A_CheckReload
    Goto Ready
    NULL A 2 A_Light0
    NULL A 2
    NULL A 3
    NULL A 3
    NULL A 4
    NULL A 6
    NULL A 9
    NULL A 0 A_CheckReload
    Goto Ready
  AltFire:
    NULL A 1
	NULL A 0 A_PlayWeaponSound("SEEKLAUNCH")
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,26,-2)
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,-26,-2)
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,26,-2)
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,-26,-2)
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,26,-2)
    NULL A 2 bright A_FireCustomMissile ("SeekerRocket",0,1,-26,-2)
    NULL A 2 bright 
	NULL AAAAAAA 2
	NULL A 8
	NULL A 0 A_PlayWeaponSound("RPGOPN")
	NULL AAAAA 2
	NULL A 7
	NULL A 0 A_PlayWeaponSound("RPGLAD")
	NULL AAAA 2
	NULL A 20
	NULL A 0 A_PlayWeaponSound("RPGOCLS")
	NULL AAAAA 2
	NULL A 4
	Goto ready
  Spawn:
    NULL A -1
	Stop
  }
}
