// Hand Grenades \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// Sprites by Necronixxus, WildWeasel, and Xaser, Edited by Sergeant_Mark_IV And using Solis Saldana Sprites
// Scripts By Sergeant_Mark_IV

ACTOR NaziGrenade : DoomWeapon
{
	Weapon.AmmoUse 1
	Weapon.AmmoGive 2
	Weapon.AmmoType "GrenadeAmmo"
	Obituary "%o was shreded by %k's StielHandGrenade!"
    AttackSound "None"
    Inventory.PickupSound "grn/pickup"
	Inventory.Pickupmessage "You got the StielHandGrenade!"
   +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	+WEAPON.NO_AUTO_SWITCH
	//+INVENTORY.UNDROPPABLE
    Scale 0.5
	States
	{
	Ready:
                GRWG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		Loop
	
	Deselect:
		TNT1 A 0 A_Lower
		Wait
	Select:
		GRWG A 1 A_Raise
		Loop
	Fire:
		GRWF OPQR 1
		
	Hold:
	    TNT1 A 1
		TNT1 A 1 
		TNT1 A 0 A_PLaySound ("weapons/grntoss")
		
		TNT1 A 0 A_FireCustomMissile("HandGrenade2", random(-3,3), 1, 0, 0, 0, 0)
	    
		GRWF STUVW 2 
		TNT1 A 10 
		Goto Stalin

Stalin:
GRWG A 1 A_Refire
Goto Ready
		
 	Spawn:
		GRND H -1
		Stop
		
		
		DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready
		
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto Ready
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto Ready
    Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
        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 HandGrenade2
{
	Radius 4
	Height 4
	Projectile
	Speed 30
    Gravity 0.7
	Scale 1.0
    -NOGRAVITY
    -BLOODSPLATTER
	-EXTREMEDEATH
	+DOOMBOUNCE
	BounceFACTOR 0.5
	//+BOUNCEONACTORS
    Health 5
    SeeSound "none"
	DeathSound "none"
	Obituary "%o ate %k grenade."
	States
	{
	Spawn:
	    GRND ABCDEF 2
		Loop
		
	Death:
	  TNT1 A 0 A_SpawnItemEx("LandedGrenade", 0, 0, 0, 0, 0, 0, 0,SXF_NOCHECKPOSITION,0)
	  Stop
	}
}




ACTOR LandedGrenade
{   Radius 12
    scale 1.0
    Height 6
    +SHOOTABLE
    -SOLID
    +NOTELEPORT
        DamageType ExplosiveImpact
	DAMAGEFACTOR "Avoid", 0.0
	DAMAGEFACTOR "Trample", 0.0
    +MOVEWITHSECTOR
	+NOBLOOD
    Mass 10
    Health 5
    DAMAGEFACTOR "Blood", 0.0    DAMAGEFACTOR "GreenBlood", 0.0    DAMAGEFACTOR "BlueBlood", 0.0    DAMAGEFACTOR "Taunt", 0.0    DAMAGEFACTOR "KillMe", 0.0  DAMAGEFACTOR "Avoid", 0.0  DAMAGEFACTOR "Taunt", 0.0
States    {
	
    Spawn:
       GRND G 25
       Goto Death
	   
	
	   Death:
        EXPL A 0 Radius_Quake (2, 54, 0, 15, 0)
		TNT1 A 1 A_PlaySound("grn/explode",3)
        TNT1 A 0 A_AlertMonsters

                TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("BarrelExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("BarrelKaboom",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 AAAAAAA 0 A_CustomMissile ("ExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
        TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 180), 2, random (0, 180))
        TNT1 AAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 360))
		
      
        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 AAAAAAAAA 2 A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
        Stop}}

		


ACTOR GrenadeAmmo : Ammo
{
   Inventory.Amount 1
   Inventory.MaxAmount 10
   Ammo.BackpackAmount 1
   Ammo.BackpackMaxAmount 10
   INVENTORY.PICKUPSOUND "Pick/granate"
   Inventory.PickupMessage "Stielhandgranate"
   Inventory.Icon GRNDH0
   Scale 0.5
   States
   {
   Spawn:
      GRND g -1
      Loop
   }
}

