ACTOR ShrapnelGrenades : Weapon
{
	+NOAUTOAIM
	+UNDROPPABLE
	Weapon.SelectionOrder 2
	Weapon.AmmoType1 "Mana2" 
	Weapon.AmmoGive1 0 
	Weapon.AmmoUse1 4
	Weapon.AmmoType2 "Mana2" 
	Weapon.AmmoGive2 0 
	Weapon.AmmoUse2 4 
	Weapon.Kickback 100
	Inventory.PickupMessage "SHRAPNEL GRENADES" 
	Tag "Shrapnel Grenades"
	Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 2.1
    Weapon.BobRangeY 0.4
    Weapon.BobRangeX 0.7
	States 
	{ 
	Spawn: 
		SGRN Z -1
		Loop 
	Ready:
		SGRN A 0 A_JumpIfInventory("IsKicking",1,"Kicking")
		SGRN A 1 A_WeaponReady 
		Loop 
	Deselect:
		SGRN A 1 A_Lower 
		TNT1 A 0 A_Lower
		Loop 
	Select: 
		SGRN A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop 
	Fire:
		SGRN B 0 A_GiveInventory("ShadowWalkAttackCheck")
		TNT1 A 5
		SGRN B 1
		SGRN B 1 OFFSET (-14, 27)
		SGRN B 1 OFFSET (-28, 22)
		SGRN C 1 OFFSET (-1, 27)
		SGRN C 1 OFFSET (-6, 22)
		SGRN C 1 OFFSET (-10, 20)
		SGRN D 0 A_PlayWeaponSound ("AssassinGrenadeThrow")
		SGRN D 1 OFFSET (-40, 35) A_FireCustomMissile ("ShrapnelGrenade", 0, 1, 0, 0)
		SGRN D 1 OFFSET (-60, 38)
		SGRN D 1 OFFSET (-75, 40)
		SGRN E 1 OFFSET (-15, 50)
		SGRN E 1 OFFSET (-25, 60)
		SGRN E 1 OFFSET (-35, 70)
		SGRN F 1 OFFSET (-30, 70)
		SGRN F 1 OFFSET (-40, 80)
		SGRN F 1 OFFSET (-50, 85)
		TNT1 A 5
		TNT1 A 0 A_ReFire
		SGRN A 1 OFFSET (1, 64)
		SGRN A 1 OFFSET (1, 48)
		SGRN A 1 OFFSET (1, 32)
		Goto Ready
	AltFire:
		SGRN B 0 A_GiveInventory("ShadowWalkAttackCheck")
		TNT1 A 7 
		SGRN B 1
		SGRN B 1 OFFSET (-14, 27)
		SGRN B 1 OFFSET (-28, 22)
		SGRN C 1 OFFSET (-1, 27)
		SGRN C 1 OFFSET (-6, 22)
		SGRN C 1 OFFSET (-10, 20)
		SGRN D 0 A_PlayWeaponSound ("AssassinGrenadeThrow")
		SGRN D 1 OFFSET (-40, 35) A_FireCustomMissile ("ShrapnelGrenadeBounce", 0, 1, 0, 0)
		SGRN D 1 OFFSET (-60, 38)
		SGRN D 1 OFFSET (-75, 40)
		SGRN E 1 OFFSET (-15, 50)
		SGRN E 1 OFFSET (-25, 60)
		SGRN E 1 OFFSET (-35, 70)
		SGRN F 1 OFFSET (-30, 70)
		SGRN F 1 OFFSET (-40, 80)
		SGRN F 1 OFFSET (-50, 85)
		TNT1 A 7
		TNT1 A 0 A_ReFire
		SGRN A 1 OFFSET (1, 64)
		SGRN A 1 OFFSET (1, 48)
		SGRN A 1 OFFSET (1, 32)
		Goto Ready
		
	Kicking:
		SGRN A 1 offset(-1,40)
		SGRN A 1 offset(-1,50)
		SGRN A 1 offset(-1,60)
		SGRN A 0 offset(-1,33)
		AKCK A 2
		AKCK B 2
		AKCK B 0 A_GiveInventory("ShadowWalkAttackCheck")
		AKCK C 3 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20,35), STRENGTH, ABIL_KICK, ACTIVATOR), "KickPuff", FBF_NORANDOM, 96)
		AKCK D 4
		TNT1 A 6
		SGRN A 1 offset(-1,60)
		SGRN A 1 offset(-1,50)
		SGRN A 1 offset(-1,40)
		SGRN A 0 A_TakeInventory("IsKicking",2)
		Goto Ready
	} 
}

ACTOR ShrapnelGrenade 
{
	Radius 8
	Height 10
	Speed 35
	Damage 0
	DamageType "Fire"
	PROJECTILE
	+THRUGHOST
	+WINDTHRUST
	-NOGRAVITY
	+DONTBLAST
	+MTHRUSPECIES
	//Gravity 0.35
	SeeSound "AssassinGrenadeBounce"
	DeathSound "AssassinGrenadeHit"
	States
	{
	Spawn:
		SGRN L 0
		SGRN LMNOLMNOLMNOLMNOLMNOLMNO 1 A_SpawnItemEx("ShrapnelGrenadeTrail")
		SGRN LMNOLMNOLMNOLMNOLMNOLMNO 1 A_SpawnItemEx("ShrapnelGrenadeTrail")
		SGRN LMNOLMNOLMNOLMNOLMNOLMNO 1 A_SpawnItemEx("ShrapnelGrenadeTrail")
		SGRN LMNOLMNOLMNOLMNOLMNOLMNO 1 A_SpawnItemEx("ShrapnelGrenadeTrail")
		SGRN O 0 A_Scream
		SGRN O 0 A_Die
		Goto Death
	Death:
		CFCF Q 0 Bright A_SetTranslucent(1,1)
		CFCF Q 0 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 128, AGILITY, 0, WOCTARGET), 128, 0)
		CFCF Q 0 Bright Radius_Quake(1,10,0,2,0)
		TNT1 AAAAAAAAAA 0 A_CustomMissile("ShrapnelGrenadeShrapnel",0,0,random(0,360),6,random(0,360))
		CFCF Q 1 Bright A_NoGravity
		CFCF Q 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
		CFCF Q 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
		CFCF Q 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
		CFCF R 0 Bright A_Scream
		CFCF RRR 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
		CFCF SSSS 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
		CFCF T 3 Bright
		CFCF U 4 Bright
		CFCF W 3 Bright
		CFCF X 4 Bright
		CFCF Z 3 Bright
		Stop
	}
}

ACTOR ShrapnelGrenadeBounce : ShrapnelGrenade
{
	BounceType "Hexen"
	SeeSound "AssassinGrenadeBounce"
	BounceSound "AssassinGrenadeBounce"
	SPeed 30
}

actor ShrapnelGrenadeShrapnel
{
	PROJECTILE
	+RIPPER
	+BLOODSPLATTER
	+HEXENBOUNCE
	+NODAMAGETHRUST
	-ALLOWBOUNCEONACTORS
	-BOUNCEONACTORS
	+WINDTHRUST
	+THRUGHOST
	-NOGRAVITY
	+DONTBLAST
	+MTHRUSPECIES
	+DONTSPLASH
	Radius 2
	Height 2
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(1,8), AGILITY, 0, WOCTARGET))
	Speed 40
	BounceCount 5
	DamageType "Physical"
	Scale 0.3
	States {
	Spawn:
		SHRD N 5 BRIGHT
		SHRD M 4 //A_Gravity
		SHRD L 26
		goto Death
	Death:
		SHRD N 1 A_FadeOut (0.2)
		Stop
	}
}

ACTOR ShrapnelGrenadeTrail
{
	Radius 5
	Height 5
	PROJECTILE
	Damagetype normal
	+FORCEXYBILLBOARD
	+EXTREMEDEATH
	+DOOMBOUNCE
	+NOINTERACTION
	+CLIENTSIDEONLY +DONTBLAST
	RenderStyle Add
	//Alpha 0.5
	DeathSound "weapons/firex2"
	States
	{
	Spawn:
		SGRN LMNO 1 Bright A_Fadeout(0.15)
		loop
	}
}