ACTOR NailCannon : Weapon
{
	Inventory.PickupMessage "NAIL CANNON"
	Tag "Nail Cannon"
	Weapon.AmmoType1 "Mana1"
	Weapon.AmmoType2 "Mana1"
	Weapon.SelectionOrder 3
	Weapon.AmmoUse1 1
	Weapon.AmmoUse2 1
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.Kickback 100
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	+UNDROPPABLE
	States
	{
	Spawn:
		WNAI A -1 
		Loop
	Ready:
		DNLG A 0 A_JumpIfInventory("IsKicking",1,"Kicking")
		DNLG A 1 A_WeaponReady
		Loop
	Deselect:
		DNLG A 1 A_Lower
		DNLG A 0 A_Lower
		Loop
	Select:
		DNLG A 1 A_Raise
		DNLG A 0 A_Raise
		Loop
	Fire:
		DNLG B 0 A_GiveInventory("ShadowWalkAttackCheck")
		DNLG B 0 Bright A_JumpIfInventory("NailgunCount",1,"Fire2")
		DNLG B 0 Bright A_GiveInventory("NailgunCount",1)
		DNLG B 0 Bright A_GunFlash
		DNLG B 0 Bright A_PlayWeaponSound("AssassinNailgunFire1")
		DNLG B 1 Bright A_FireCustomMissile("SteelNail",0,1,-6,0)
		DNLG B 0 Bright A_SetPitch(Pitch-.3)
		DNLG CDE 1 Bright A_SetPitch(Pitch+.1)
		DNLG E 0 Bright A_Refire
		DNLG K 1
		goto Ready
	Fire2:
		DNLG D 0 Bright A_TakeInventory("NailgunCount",1)
		DNLG D 0 Bright A_GunFlash
		DNLG D 0 Bright A_PlayWeaponSound("AssassinNailgunFire1")
		DNLG F 1 Bright A_FireCustomMissile("SteelNail",0,1,6,0)
		DNLG F 0 Bright A_SetPitch(Pitch-.3)
		DNLG GHI 1 Bright A_SetPitch(Pitch+.1)
		DNLG I 0 Bright A_Refire
		DNLG J 1 
		goto Ready
	AltFire:
		DNLG B 0 A_GiveInventory("ShadowWalkAttackCheck")
		DNLG B 0 Bright A_JumpIfInventory("NailgunCount",1,"AltFire2")
		DNLG B 0 Bright A_GiveInventory("NailgunCount",1)
		DNLG B 0 Bright A_GunFlash
		DNLG B 0 Bright A_PlayWeaponSound("AssassinNailgunFire2")
		DNLG B 1 Bright A_FireCustomMissile("MoltenNail",0,1,-6,0)
		DNLG B 0 Bright A_SetPitch(Pitch-.3)
		DNLG CDE 1 Bright A_SetPitch(Pitch+.1)
		DNLG E 0 Bright A_Refire
		DNLG K 1
		goto Ready
	AltFire2:
		DNLG D 0 Bright A_TakeInventory("NailgunCount",1)
		DNLG D 0 Bright A_GunFlash
		DNLG D 0 Bright A_PlayWeaponSound("AssassinNailgunFire2")
		DNLG F 1 Bright A_FireCustomMissile("MoltenNail",0,1,6,0)
		DNLG F 0 Bright A_SetPitch(Pitch-.3)
		DNLG GHI 1 Bright A_SetPitch(Pitch+.1)
		DNLG I 0 Bright A_Refire
		DNLG J 1 
		goto Ready
	Flash:
		TNT1 A 2 Bright A_Light1
		TNT1 A 2 Bright A_Light2
		TNT1 A 0 Bright A_Light0
		stop
	Kicking:
		DNLG A 1 offset(-1,40)
		DNLG A 1 offset(-1,50)
		DNLG A 1 offset(-1,60)
		DNLG 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
		DNLG A 1 offset(-1,60)
		DNLG A 1 offset(-1,50)
		DNLG A 1 offset(-1,40)
		DNLG A 0 A_TakeInventory("IsKicking",2)
		Goto Ready
	}
}

actor SteelNail : FastProjectile
{
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(1,8), AGILITY, 0, WOCTARGET))
	Radius 1
	Height 1
	Speed 100
	Damagetype "Physical" 
	Obituary "%o got nailed by %k"
	+THRUGHOST
	+WINDTHRUST
	+NODAMAGETHRUST
	+HITTRACER
	+RIPPER
	+DONTBLAST
	+MTHRUSPECIES
	DeathSound "AssassinNailgunHit"
	States
	{	
	Spawn:
		NAIL A 1
		Wait
	Crash:
	Death:
		//NAIL D 0 A_Playsound("weapons/rico")
		NAIL D 2 Bright A_SetTranslucent(1.0, 1)
		NAIL EFGHI 2 Bright A_Fadeout(0.125)
		stop
	Xdeath: 
		TNT1 a 2 //A_PlaySound("weapons/rico")
		stop
	}
}

ACTOR MoltenNail : FastProjectile //Molten nail
{
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(21,41), AGILITY, 0, WOCTARGET))
	Radius 4
	Height 4
	Speed 100
	Damagetype "Fire"   
	Obituary "%o was scorched by %k's molten nails."
	DeathSound "AssassinNailgunAltHit"   
	+HITTRACER
	+DONTBLAST
	+MTHRUSPECIES
	States
	{
	Spawn:
		NAIL B 1 Bright
		loop
	Death:
		IMFX Q 3 Bright A_SetTranslucent(1,1)
		IMFX RSTUVW 3 Bright
		stop
	}
}

ACTOR NailgunCount: Inventory //used to cycle firing animations
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}