ACTOR AssassinDagger : Weapon
{
	+NOALERT
	+UNDROPPABLE
	+MELEEWEAPON
	Weapon.SelectionOrder 4
	Weapon.Kickback 100
	Weapon.YAdjust 0
	AttackSound ""
	Tag "Assassin's Dagger"
	Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 2.1
    Weapon.BobRangeY 0.4
    Weapon.BobRangeX 0.7
	States
	{
	Ready:
		DAG1 A 0 A_JumpIfInventory("IsKicking",1,"Kicking")
		DAG1 A 0 A_JumpIfInventory("IsImpaling",1,"Impaling")
		DAG1 A 0 A_JumpIfInventory("IsLunging",1,"Lunging")
		DAG1 A 1 A_WeaponReady
		Loop
	Deselect:
		DAG1 A 1 A_Lower
		TNT1 A 0 A_Lower
		Loop
	Select:
		DAG1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Fire:
	Fire1:
		DAG1 A 0 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 ABC 1
		DAG1 A 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 D 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto NormalFire1
		DAG1 D 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 D 0 A_JumpIfTargetInLos("NormalFire1",270,JLOSF_TARGETLOS)
		Goto BackstabFire1
		DAG1 D 0 A_JumpIfTargetInLos("NormalFire1",180,JLOSF_TARGETLOS)
	BackstabFire1:
		DAG1 D 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(40,70), STRENGTH, ABIL_DEFTSTRIKES, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 EFG 1 
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Hold1")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
	NormalFire1:
		DAG1 D 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20,35), STRENGTH, ABIL_DAGGERMASTERY, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 EFG 1 
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Hold1")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
		
	Hold1:
		DAG1 H 0 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 HIJ 1
		DAG1 J 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 K 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto NormalHold1
		DAG1 K 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 K 0 A_JumpIfTargetInLos("NormalHold1",270,JLOSF_TARGETLOS)
		Goto BackstabHold1
		DAG1 K 0 A_JumpIfTargetInLos("NormalHold1",180,JLOSF_TARGETLOS)
	BackstabHold1:
		DAG1 K 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(40,70), STRENGTH, ABIL_DEFTSTRIKES, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 LMN 1 
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Hold11")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
	NormalHold1:
		DAG1 K 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20,35), STRENGTH, ABIL_DAGGERMASTERY, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 LMN 1 
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Hold11")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
		
	Hold11:
		DAG1 O 0 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 OPQ 1
		DAG1 Q 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 Q 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto NormalHold11
		DAG1 R 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 R 0 A_JumpIfTargetInLos("NormalHold11",270,JLOSF_TARGETLOS)
		Goto BackstabHold11
		DAG1 R 0 A_JumpIfTargetInLos("NormalHold11",180,JLOSF_TARGETLOS)
	BackstabHold11:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(50,100), STRENGTH, ABIL_DEFTSTRIKES, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 ST 1
		DAG1 U 1
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Fire1")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
	NormalHold11:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(25,50), STRENGTH, ABIL_DAGGERMASTERY, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 ST 1
		DAG1 U 1
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 A_ReFire ("Fire1")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
		
	Altfire:
		DAG1 A 1 offset(-1,36)
		DAG1 A 1 offset(-1,44)
		DAG1 A 1 offset(-1,52)
		DAG1 A 1 offset(-1,60)
	Althold:
		DAG1 A 0 offset(-1,33)
		TNT1 A 3 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 OPQ 1
		DAG1 Q 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 R 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto NormalAlthold
		DAG1 R 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 R 0 A_JumpIfTargetInLos("NormalAlthold",270,JLOSF_TARGETLOS)
		Goto BackstabAlthold
		DAG1 R 0 A_JumpIfTargetInLos("NormalAlthold",180,JLOSF_TARGETLOS)
	BackstabAlthold:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(60,120), STRENGTH, ABIL_DEFTSTRIKES, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 ST 1
		DAG1 U 1
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 A_ReFire("AltHold")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
	NormalAlthold:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(30,60), STRENGTH, ABIL_DAGGERMASTERY, ACTIVATOR), "DaggerPuff", FBF_NORANDOM, 96)
		DAG1 ST 1
		DAG1 U 1
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 A_ReFire("AltHold")
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto Ready
	
	Kicking:
		DAG1 A 1 offset(-1,40)
		DAG1 A 1 offset(-1,50)
		DAG1 A 1 offset(-1,60)
		DAG1 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
		DAG1 A 1 offset(-1,60)
		DAG1 A 1 offset(-1,50)
		DAG1 A 1 offset(-1,40)
		DAG1 A 0 A_TakeInventory("IsKicking",2)
		Goto Ready
		
	Impaling:
		TNT1 A 0 A_JumpIfInventory("Impale", Random(1,10), "CritImpale")
		TNT1 A 3 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 OPQ 1
		DAG1 Q 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 R 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto NormalImpale
		DAG1 R 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 R 0 A_JumpIfTargetInLos("NormalImpale",270,JLOSF_TARGETLOS)
		Goto BackstabImpale
		DAG1 R 0 A_JumpIfTargetInLos("NormalImpale",180,JLOSF_TARGETLOS)
	BackstabImpale:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(80,160), STRENGTH, ABIL_DEFTIMPALE, ACTIVATOR), "ImpalingPuff", FBF_NORANDOM, 128)
		DAG1 ST 1
		DAG1 U 6
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 //A_ReFire
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto ImpaleClear
	NormalImpale:
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(40,80), STRENGTH, ABIL_IMPALE, ACTIVATOR), "ImpalingPuff", FBF_NORANDOM, 128)
		DAG1 ST 1
		DAG1 U 6
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 //A_ReFire
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto ImpaleClear
		
	CritImpale:
		TNT1 A 3 A_PlayWeaponSound("AssassinDaggerMiss")
		DAG1 OPQ 1
		DAG1 Q 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 R 0 A_JumpIfInventory("DeftStrikes",1,1)
		Goto CNormalImpale
		DAG1 R 0 A_JumpIfInventory("IsExecutioner",1,2)
		DAG1 R 0 A_JumpIfTargetInLos("CNormalImpale",270,JLOSF_TARGETLOS)
		Goto CBackstabImpale
		DAG1 R 0 A_JumpIfTargetInLos("CNormalImpale",180,JLOSF_TARGETLOS)
	CBackstabImpale:
		DAG1 R 0 A_FireBullets(0,0,1,0,"ImpalingCritPuff",FBF_NORANDOM,128)
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(160,320), STRENGTH, ABIL_DEFTIMPALE, ACTIVATOR), "ImpalingPuff", FBF_NORANDOM, 128)
		DAG1 ST 1
		DAG1 U 6
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 //A_ReFire
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto ImpaleClear
	CNormalImpale:
		DAG1 R 0 A_FireBullets(0,0,1,0,"ImpalingCritPuff",FBF_NORANDOM,128)
		DAG1 R 1 A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(80,160), STRENGTH, ABIL_IMPALE, ACTIVATOR), "ImpalingPuff", FBF_NORANDOM, 128)
		DAG1 ST 1
		DAG1 U 6
		DAG1 TS 1
		DAG1 RQ 1
		DAG1 PO 1
		TNT1 A 6
		TNT1 A 0 //A_ReFire
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		Goto ImpaleClear
	ImpaleClear:
		DAG1 A 0 A_TakeInventory("IsImpaling",2)
		Goto Ready
	
	Lunging:
		DAG1 A 1 offset(-1,40) 
		DAG1 A 1 offset(-1,50)
		DAG1 A 1 offset(-1,60)
		DAG1 A 0 A_GiveInventory("ShadowWalkAttackCheck")
		DAG1 A 0 offset(-1,33) A_PlayWeaponSound("Physical/Machete/Hit")
		
		DAG2 A 1 BRIGHT A_GiveInventory("ShadowWalkAttackCheck")
		DAG2 A 0 Bright ThrustThing(angle * 256 / 360, 40, 1, 0)
		DAG2 B 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 C 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 D 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 E 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 F 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 G 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		DAG2 H 1 BRIGHT A_SpawnItemEx("LungingEffects",0,0,0,0,0,0,0,0)
		//TNT1 AAAAA 1 A_FireCustomMissile ("LungeEffects", 0, 0, 0, 0)
		TNT1 A 10 BRIGHT
		DAG1 A 1 offset(-1,60) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,52) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,44) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 1 offset(-1,36) //a_weaponready(wrf_nobob|wrf_noswitch)
		DAG1 A 0 A_TakeInventory("IsLunging",2)
		Goto Ready
	} 
}

Actor DaggerPuff : BulletPuff
{
	+PUFFONACTORS
	+PUFFGETSOWNER
	+THRUGHOST
	+MTHRUSPECIES
	Damagetype "Physical"
	AttackSound "AssassinDaggerHitWall"
	SeeSound "AssassinDaggerHitThing"
	States
	{
	Spawn:
		PUFH A 1
		PUFH A 0 A_AlertMonsters(96)
		PUFH A 1 A_GiveToTarget("ScreenPitch1")
		PUFH AA 1 A_GiveToTarget("ScreenPitchHalfBack")
		PUFH B 4
		PUFH CD 4
		Stop
	Crash:
		PUFH A 1
		PUFH A 0 //A_AlertMonsters(128)
		PUFH A 1 A_GiveToTarget("ScreenPitch1")
		PUFH AA 1 A_GiveToTarget("ScreenPitchHalfBack")
		PUFH B 4
		PUFH CD 4
		Stop
	Melee:
		PUFH C 0
		PUFH C 1 A_StopSound
		PUFH C 0 A_AlertMonsters(96)
		PUFH C 1 A_GiveToTarget("ScreenPitch1")
		PUFH CC 1 A_GiveToTarget("ScreenPitchHalfBack")
		PUFH D 4
		Stop
	}
}

Actor LungingEffects
{
	Speed 0
	Radius 8
	Height 4
	Alpha 0.6
	PROJECTILE
	+RIPPER
	+BLOODLESSIMPACT
	+FORCEPAIN
	+DONTBLAST
	+FORCERADIUSDMG
	ReactionTime 5
	Damagetype "Physical"
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1 A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 25, STRENGTH, ABIL_LUNGINGSTRIKE, WOCTARGET),32,0,0,32)
		Stop
	Death:
		TNT1 S 1
		Stop
	}
}