// --------------------------------------------------------------------------
//
// PanzerShreck
//
// --------------------------------------------------------------------------

ACTOR PanzerShreck : Weapon Replaces RocketLauncher
{
	Game Doom
	SpawnID 29
	Speed 20
	Damage 20
	Weapon.SelectionOrder 2500
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoGive1 4
	Weapon.AmmoType1 "PANZERAmmo"
	Weapon.AmmoType2 "MISSILAMMO"
	Weapon.BobRangeX 0.75
	Weapon.BobRangeY 0.5
	Weapon.BobSpeed 1.5
	Weapon.BobStyle "InverseAlpha" //Denis Belmondo's Bobstyle
    Inventory.PickupSound "MP40_TAKE"
    +WEAPON.NOAUTOAIM
	+WEAPON.NO_AUTO_SWITCH
	Inventory.PickupMessage "You have the PANZERSHRECK!Now you are fucked,krauts!"
Inventory.Icon "PANBACK"	
States
	{
	Steady:
	TNT1 A 1
	Goto Ready

	Ready:
PASW AABBCC 1 A_PlaySound("WEAPONCHANGE")
     PZSH A 1 A_WeaponReady
       TNT1 A 0 A_JumpIfInventory("MISSILAMMO",1,2)
        Goto Reload
                TNT1 B 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 B 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 B 0 A_JumpIfInventory("Salute2", 1, "Salute")
		GOTO READY+6
	Deselect:
TNT1 A 0 A_Takeinventory("Kicking",1)
TNT1 A 0 A_Takeinventory("Taunting",1)
TNT1 A 0 A_Takeinventory("LaunchGrenade",1)
	PZSH A 1 A_Lower
		Loop
  Select:
TNT1 a 0  A_Takeinventory("Kicking",1)
TNT1 a 0  A_Takeinventory("Taunting",1)
TNT1 a 0  A_TakeInventory("LaunchGrenade", 1)
   TNT1 A 0 A_Raise
    Loop

	Fire:
        TNT1 A 0 A_JumpIfInventory("MISSILAMMO",1,2)
        Goto Reload
        TNT1 AAAA 0

		TNT1 A 0 A_FireCustomMissile("RedFlareSpawn",-5,0,0,0)
        TNT1 A 0 A_PlaySound ("DSRFIRE")
		TNT1 A 0 BRIGHT A_FireCustomMissile("Alerter")
		PZSH B 1 BRIGHT A_FireCustomMissile("panzershreckRocket", 0, 1, 0, -5)
		TNT1 A 0 A_Takeinventory("MISSILAMMO",1)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
       PZSH C 1
        PZSH AAAAA 2 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
       PZSH A 2
        TNT1 A 0 A_Refire
		GOTO READY+6


    Reload:
		PZSH A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_JumpIfInventory("MISSILAMMO",1,"insertbullets")
        TNT1 A 0 A_JumpIfInventory("PANZERAmmo",1,3)
        Goto ORCODIO
        TNT1 AAAA 0
        PZSH CDE 2
        TNT1 A 0 A_PlaySound("Reload/Panzer")
        PZSH EEEEE 2 
        MISR BBCCDDEEFF 2 
        TNT1 AAAAA 0
        PZSH AAA 2

InsertBullets:
		TNT1 AAAAAA 0
		TNT1 A 0 A_JumpIfInventory("MISSILAMMO",1,"ORCODIO")
		TNT1 A 0 A_JumpIfInventory("PANZERAmmo",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("MISSILAMMO",1)
		TNT1 A 0 A_Takeinventory("PANZERAmmo",1)
		Goto InsertBullets
		
			TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
	

ORCODIO:

		MISG A 2 A_WeaponReady
		Goto Ready+6


	Spawn:
		LAUN A -1
		Stop

   
    Taunt:
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("FUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready

	}
}

ACTOR MISSILAMMO : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 1
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 1
}

ACTOR PANZERAmmo : Ammo Replaces RocketAmmo
{
	Inventory.PickupSound "pickups/ammo"
	Inventory.PickupMessage "PanzerShreck's Rocket"
	Inventory.Amount 1
	Inventory.MaxAmount 20
	Ammo.BackpackAmount 1
	Ammo.BackpackMaxAmount 20
	Mass 10000
        Inventory.Icon "ROCKA0"
	States
	{
	Spawn:
		ROCK A -1
		Loop
	}
}
ACTOR PanzerAmmoBox : PANZERAmmo Replaces RocketBox
{
	Inventory.PickupMessage "Box of PanzerShreck's Rocket"
	Inventory.Amount 5
	Ammo.BackpackAmount 5
	States
	{
	Spawn:
		PANB A -1
		Loop
	}
}



ACTOR panzershreckRocket
{
	Radius 10
	Height 8
	Projectile
	Speed 35
    Damage 125
	DamageType Explosive
    MeleeDamage 0
    Gravity 0.00
    Decal "Scorch"
    -NOGRAVITY
    +EXTREMEDEATH
    +BLOODSPLATTER 
    Health 5
    SeeSound "weapons/RLL"
    //SeeSound "RLANSHOT"
	DeathSound "Explosion"
	Obituary "$OB_MPROCKET"
	States
	{
	Spawn:
	    MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RocketFlare",-20,0)
		TNT1 A 0 A_CustomMissile ("RocketSmokeTrail52", 2, 0, random (70, 110), 2, random (0, 360))
		TNT1 A 0 A_SpawnItem ("RocketSmokeTrail52")
		Loop
		
	Death:
EXPL A 0 Radius_Quake (2, 54, 0, 15, 0)

        TNT1 A 0 A_AlertMonsters

		//EXPL A 0 A_CustomMissile ("BigNeoSmoke", 0, 0, random (0, 360), 2, random (0, 360))
//TNT1 AA 0 A_CustomMissile ("ExplosionSmoke", 22, 0, random (0, 360), 2, random (0, 360))

        TNT1 A 0 A_CustomMissile ("MetalShard1", 5, 0, random (0, 360), 2, random (30, 160))
		TNT1 A 0 A_CustomMissile ("MetalShard2", 5, 0, random (0, 360), 2, random (30, 160))
		TNT1 A 0 A_CustomMissile ("MetalShard3", 5, 0, random (0, 360), 2, random (30, 160))
		TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("RocketExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
        TNT1 AAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleVeryFast", 0, 0, random (0, 360), 2, random (0, 360))
//XXXX A 0 A_CustomMissile ("ExplosionQuake", 1, 0, random (0, 360), 2, random (0, 160))
         
        TNT1 AAAAAAA 0 A_CustomMissile ("MediumExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
EXPL AAA 0 A_CustomMissile ("BigNeoSmoke", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAAA 1 A_CustomMissile ("ExplosionSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 3
		TNT1 A 0 A_PlaySound("FAREXPL", 3)
				TNT1 AAAAAAAAA 2 A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		Stop
	}
}