ACTOR "Quietus" : FWeapQuietus// Replaces FWeaponPiece1
{
	Tag "Quietus"
	Weapon.KickBack 100
	Weapon.YAdjust 0
	weapon.ammogive1 0
	weapon.ammogive2 0
	Weapon.SelectionOrder 3
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.ALT_AMMO_OPTIONAL
	+UNDROPPABLE
	+MELEEWEAPON
	Inventory.PickupSound "pickup/four"
	Inventory.PickupMessage "QUIETUS"
	Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 2.1
    Weapon.BobRangeY 0.4
    Weapon.BobRangeX 0.7
	States
	{
	Spawn:
		QUTP Z -1
		Stop
	Select:
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 6, 1)
		Goto SelectNoMana
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 6, 1)
		Goto SelectNoMana
		FSRD A 1 Bright A_Raise
		TNT1 A 0 A_Raise
		Loop
	Deselect:
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 6, 1)
		Goto DeSelectNoMana
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 6, 1)
		Goto DeSelectNoMana
		FSRD A 1 Bright A_Lower
		TNT1 A 0 A_Lower
		Loop
	Ready:
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 6, 1)
		Goto ReadyNoMana
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 6, 1)
		Goto ReadyNoMana
		FSRD A 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD A 1 Bright A_WeaponReady
		FSRD A 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD A 1 Bright A_WeaponReady
		FSRD A 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD A 1 Bright A_WeaponReady
		FSRD A 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD A 1 Bright A_WeaponReady
		FSRD B 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD B 1 Bright A_WeaponReady
		FSRD B 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD B 1 Bright A_WeaponReady
		FSRD B 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD B 1 Bright A_WeaponReady
		FSRD B 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD B 1 Bright A_WeaponReady
		FSRD C 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD C 1 Bright A_WeaponReady
		FSRD C 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD C 1 Bright A_WeaponReady
		FSRD C 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD C 1 Bright A_WeaponReady
		FSRD C 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSRD C 1 Bright A_WeaponReady
		Loop
	ReadyNoMana:
		FSRD A 0 A_JumpIfInventory("MightyBlowing",1,"MightyBlow")
		FSRD A 0 A_JumpIfInventory("DeathBlowing",1,"DeathBlow")
		FSD2 A 1 A_WeaponReady
		Goto Ready
	SelectNoMana:
		FSD2 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select
	DeselectNoMana:
		FSD2 A 1 A_Lower
		TNT1 A 0 A_Lower
		Goto Deselect
	AltFire:
		FSRD A 0 A_PlayWeaponSound("FighterSwordMiss")
		FSRD D 0 A_JumpIfInventory("CriticalStrike",Random(1,40),"Altfire2")
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 6, 1)
		Goto FireNoMana
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 6, 1)
		Goto FireNoMana
		FSRD D 1 bright offset(5,36)
		FSRD E 1 bright offset(5,36)
		FSRD E 1 bright offset(-15,50)
		FSRD F 1 bright offset(5,36)
		FSRD F 1 bright offset(-15,50)
		FSRD G 1 bright offset(5,36) A_FireBullets(0,0,1,0,"QuietusPuff",FBF_NORANDOM,144)
		FSRD G 1 bright offset(-15,50) A_FireBullets(0,0,1,0,"QuietusPuff",FBF_NORANDOM,144)
		FSRD H 1 bright offset(5,36)
		FSRD H 1 bright offset(-15,50)
		FSRD I 1 bright offset(5,36)
		FSRD I 1 bright offset(-15,50)
		FSRD I 10 bright offset(5,150)
		FSRD B 1 bright offset(5,60)
		FSRD C 1 bright offset(5,55)
		FSRD C 1 bright offset(5,50)
		FSRD C 1 bright offset(5,45)
		FSRD C 1 bright offset(5,40)
		goto ready
	FireNoMana:
		FSRD D 1 bright offset(5,36)
		FSD2 B 1 bright offset(5,36)
		FSD2 B 1 bright offset(-15,50)
		FSD2 C 1 bright offset(5,36)
		FSD2 C 1 bright offset(-15,50)
		FSD2 D 1 bright offset(5,36) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(40,60), STRENGTH, ABIL_SWORDMASTERY, ACTIVATOR),"HammerPuff",FBF_NORANDOM,128)
		FSD2 D 1 bright offset(-15,50) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(40,60), STRENGTH, ABIL_SWORDMASTERY, ACTIVATOR),"HammerPuff",FBF_NORANDOM,128)
		FSD2 E 1 bright offset(5,36)
		FSD2 E 1 bright offset(-15,50)
		FSD2 F 1 bright offset(5,36)
		FSD2 F 1 bright offset(-15,50)
		FSD2 F 10 bright offset(5,150)
		FSD2 A 1 bright offset(5,60)
		FSD2 A 1 bright offset(5,55)
		FSD2 A 1 bright offset(5,50)
		FSD2 A 1 bright offset(5,45)
		FSD2 A 1 bright offset(5,40)
		goto ready
	Fire:
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 14, 1)
		Goto AltFire
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 14, 1)
		Goto AltFire
		FSRD D 1 bright offset(5,36)
		FSRD E 1 bright offset(5,36)
		FSRD E 1 bright offset(-15,50)
		FSRD F 1 bright offset(5,36)
		FSRD F 1 bright offset(-15,50)
		FSRD G 1 bright offset(5,36) A_FSwordAttack
		FSRD G 1 bright offset(-15,50)
		FSRD H 1 bright offset(5,36)
		FSRD H 1 bright offset(-15,50)
		FSRD I 1 bright offset(5,36)
		FSRD I 1 bright offset(-15,50)
		FSRD I 10 bright offset(5,150)
		FSRD B 1 bright offset(5,60)
		FSRD C 1 bright offset(5,55)
		FSRD C 1 bright offset(5,50)
		FSRD C 1 bright offset(5,45)
		FSRD C 1 bright offset(5,40)
		goto ready
	MightyBlow:
		FSRD A 1 Offset (0, 40)
		FSRD A 1 Offset (0, 48)
		FSRD A 1 Offset (0, 56)
		FPCH E 1 Offset(220,60)
		FPCH E 1 Offset(225,50)
		FPCH E 1 Offset(220,50)
		FPCH E 1 Offset(210,50)
		FPCH E 1 Offset(190,50)
		FPCH E 1 Offset(180,40) 
		FPCH E 1 Offset(95,40)
		FPCH D 0 Offset (5, 40) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(140,180), STRENGTH, ABIL_MIGHTYBLOW, ACTIVATOR),"MightyBlowPuff",FBF_NORANDOM,128)
		FPCH E 1 Offset(10,50)
		FPCH E 1 Offset(5,60) 
		FPCH E 1 Offset(2,70)
		FPCH E 1 Offset(0,80)
		FPCH E 1 Offset(2,90) 
		FPCH E 1 Offset(5,115)
		FPCH E 5 Offset(0,150) A_TakeInventory("MightyBlowing",2)
		FSRD A 1 Offset (1, 56)
		FSRD A 1 Offset (1, 48)
		FSRD A 1 Offset (1, 40)
		Goto Ready
	DeathBlow:
		FSRD A 1 Offset (0, 40)
		FSRD A 1 Offset (0, 48)
		FSRD A 1 Offset (0, 56)
		FPCH E 1 Offset(220,60)
		FPCH E 1 Offset(225,50)
		FPCH E 1 Offset(220,50)
		FPCH E 1 Offset(210,50)
		FPCH E 1 Offset(190,50)
		FPCH E 1 Offset(180,40) 
		FPCH E 1 Offset(95,40)
		FPCH E 0 A_JumpIfInventory("DeathBlow", random(0,25), 2)
		FPCH E 0 A_Jump(256,2)
		FPCH E 0 A_FireBullets(0,0,1,1000000,"DeathBlowPuff",FBF_NORANDOM,128)
		FPCH E 0 A_FireBullets(0,0,1,0,"HammerPuff",FBF_NORANDOM,128)
		FPCH E 1 Offset(10,50)
		FPCH E 1 Offset(5,60) 
		FPCH E 1 Offset(2,70)
		FPCH E 1 Offset(0,80)
		FPCH E 1 Offset(2,90) 
		FPCH E 1 Offset(5,115)
		FPCH E 5 Offset(0,150) A_TakeInventory("DeathBlowing",2)
		FSRD A 1 Offset (1, 56)
		FSRD A 1 Offset (1, 48)
		FSRD A 1 Offset (1, 40)
		Goto Ready
	AltFire2:
		FSRD D 0 Bright A_JumpIfInventory("Mana1", 6, 1)
		Goto FireNoMana2
		FSRD D 0 Bright A_JumpIfInventory("Mana2", 6, 1)
		Goto FireNoMana2
		FSRD D 1 bright offset(5,36)
		FSRD E 1 bright offset(5,36)
		FSRD E 1 bright offset(-15,50)
		FSRD F 1 bright offset(5,36)
		FSRD F 1 bright offset(-15,50)
		FSRD G 0 bright offset(-15,50) A_FireBullets(0,0,1,0,"CriticalPuffGhost",FBF_NORANDOM,144)
		FSRD G 1 bright offset(5,36) A_FireBullets(0,0,1,0,"QuietusPuffCrit",FBF_NORANDOM,144)
		FSRD G 1 bright offset(-15,50) A_FireBullets(0,0,1,0,"QuietusPuffCrit",FBF_NORANDOM,144)
		FSRD H 1 bright offset(5,36)
		FSRD H 1 bright offset(-15,50)
		FSRD I 1 bright offset(5,36)
		FSRD I 1 bright offset(-15,50)
		FSRD I 10 bright offset(5,150)
		FSRD B 1 bright offset(5,60)
		FSRD C 1 bright offset(5,55)
		FSRD C 1 bright offset(5,50)
		FSRD C 1 bright offset(5,45)
		FSRD C 1 bright offset(5,40)
		goto ready

	FireNoMana2:
		FSRD D 1 bright offset(5,36)
		FSD2 B 1 bright offset(5,36)
		FSD2 B 1 bright offset(-15,50)
		FSD2 C 1 bright offset(5,36)
		FSD2 C 1 bright offset(-15,50)
		FSD2 D 0 offset(-15,50) A_FireBullets(0,0,1,0,"CriticalPuff",FBF_NORANDOM,128)
		FSD2 D 1 bright offset(5,36) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", 2*FRandom(40,60), STRENGTH, ABIL_SWORDMASTERY, ACTIVATOR),"HammerPuff",FBF_NORANDOM,128)
		FSD2 D 1 bright offset(-15,50) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", 2*FRandom(40,60), STRENGTH, ABIL_SWORDMASTERY, ACTIVATOR),"HammerPuff",FBF_NORANDOM,128)
		FSD2 E 1 bright offset(5,36)
		FSD2 E 1 bright offset(-15,50)
		FSD2 F 1 bright offset(5,36)
		FSD2 F 1 bright offset(-15,50)
		FSD2 F 10 bright offset(5,150)
		FSD2 A 1 bright offset(5,60)
		FSD2 A 1 bright offset(5,55)
		FSD2 A 1 bright offset(5,50)
		FSD2 A 1 bright offset(5,45)
		FSD2 A 1 bright offset(5,40)
		goto ready
	}
}

ACTOR QuietusPuff : AxePuffGlow
{
    +NOBLOCKMAP
    +NOGRAVITY
    +PUFFONACTORS
    +EXTREMEDEATH
    +PUFFGETSOWNER
	+MTHRUSPECIES
	+FORCERADIUSDMG
	Radius 8
	Height 12
	Damagetype "Arcane"
    RenderStyle Add
	SeeSound "FighterQuietusHitThing"
	AttackSound "FighterQuietusHitWall"
	ActiveSound ""
    States
    {
	Spawn:
	Melee:
		FSFX DD 0
		FSFX D 0 A_JumpIfInTargetInventory("IsDestroyer",1,"Fury")
		Goto Animation
	Fury:
		FSFX D 0 A_GiveToTarget("FuryItem",1)
	Animation:
		FSFX D 0 A_PlaySound("FighterSwordExplode", 5)
		FSFX D 0 A_TakeFromTarget("Mana1", 3, TIF_NOTAKEINFINITE)
		FSFX D 0 Bright A_TakeFromTarget("Mana2", 3, TIF_NOTAKEINFINITE)
		FSFX D 1 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(80,120), STRENGTH, ABIL_SWORDMASTERY, WOCTARGET), 96, 0, 1, 9)
		FSFX D 1 Bright A_GiveToTarget("ScreenPitch2")
		FSFX DE 1 Bright A_GiveToTarget("ScreenPitch1Back")
		FSFX E 1 Bright
		FSFX F 3 Bright
		FSFX G 2 Bright
		FSFX H 3 Bright
		FSFX I 2 Bright
		FSFX J 3 Bright
		FSFX KLM 2 Bright
		Stop
    Crash:
		QUFX A 0 Bright
		QUFX A 0 Bright A_PlaySound("FighterSwordShock", 5)
		QUFX A 1 Bright
		QUFX A 1 Bright A_GiveToTarget("ScreenPitch2")
		QUFX AA 1 Bright A_GiveToTarget("ScreenPitch1Back")
		QUFX BCDEFG 4 Bright
		Stop
    }
}

Actor QuietusPuffCrit : QuietusPuff
{
	+FORCERADIUSDMG
	States
    {
	Spawn:
	Melee:
		FSFX DD 0
		FSFX D 0 A_JumpIfInTargetInventory("IsDestroyer",1,"Fury")
		Goto Animation
	Fury:
		FSFX D 0 A_GiveToTarget("FuryItem",1)
	Animation:
		FSFX D 0 A_PlaySound("FighterSwordExplode", 5)
		FSFX D 0 A_TakeFromTarget("Mana1", 3, TIF_NOTAKEINFINITE)
		FSFX D 0 Bright A_TakeFromTarget("Mana2", 3, TIF_NOTAKEINFINITE)
		FSFX D 1 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 2*FRandom(80,120), STRENGTH, ABIL_SWORDMASTERY, WOCTARGET), 96, 0, 1, 9)
		FSFX D 1 Bright A_GiveToTarget("ScreenPitch2")
		FSFX DE 1 Bright A_GiveToTarget("ScreenPitch1Back")
		FSFX E 1 Bright
		FSFX F 3 Bright
		FSFX G 2 Bright
		FSFX H 3 Bright
		FSFX I 2 Bright
		FSFX J 3 Bright
		FSFX KLM 2 Bright
		Stop
	}
}

Actor NewFSwordMissile : FSwordMissile replaces FSwordMissile
{
	Damage 0
	Damagetype "Arcane"
	+MTHRUSPECIES
	+DONTBLAST
	+FORCERADIUSDMG
	Radius 6
	States
	{
	Spawn:
		FSFX ABC 3 Bright A_CustomMissile("FSwordFireTrail",0,0,0,6)
		Loop
	Death:
		FSFX D 3 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 64, INTELLECT, ABIL_SWORDMASTERY, WOCTARGET), 128, 0)
		FSFX E 2 Bright A_FSwordFlames
		FSFX F 3 Bright
		FSFX G 2 Bright
		FSFX H 3 Bright
		FSFX I 2 Bright
		FSFX J 3 Bright
		FSFX KLM 2 Bright
		Stop
	}
}

actor FSwordFireTrail
{
    Radius 4
    Height 0
    Speed 0
    Damage 0
    Projectile
	+CLIENTSIDEONLY +DONTBLAST
    RenderStyle Add
    States
    {
    Spawn:
		FSFX N 0 A_JumpIf(waterlevel > 0, "Death")
		FSFX NOPQRST 4 Bright A_LowGravity
		Loop
    Death:
		FSFX U 4 Bright
		FSFX VW 4 Bright
		Stop
    }
}

Actor NewFSwordFlame : FSwordFlame replaces FSwordFlame
{
	Renderstyle Add
}

Actor NewQuietusPuff : HammerPuff
{
	+PUFFGETSOWNER
	+THRUGHOST
	+MTHRUSPECIES
	Damagetype "Physical"
	SeeSound "FighterQuietusHitThing"
	AttackSound "FighterQuietusHitWall"
	ActiveSound ""
	States
	{
	Spawn:
	Melee:
		FHFX S 0
		FHFX S 0 A_JumpIfInTargetInventory("IsDestroyer",1,"Fury")
		Goto Crash
	Fury:
		FHFX D 0 A_GiveToTarget("FuryItem",1)
	Crash:
		FHFX S 1
		FHFX S 1 A_GiveToTarget("ScreenPitch2")
		FHFX SS 1 A_GiveToTarget("ScreenPitch1Back")
		FHFX TUVW 4
		Stop
	}
}