ACTOR Firebrand : NaziWeapon replaces Chainsaw 15006
{
	//$Category Weapons (Wolf3D)
	//$Title (1) Tyrfing
	//$Color 14
	Weapon.SlotNumber 1
	Weapon.SelectionOrder 9999
	Inventory.PickupMessage "The legendary Tyrfing!"
	Inventory.PickupSound "sword/draw"
	Weapon.UpSound "sword/draw"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	-WEAPON.AMMO_CHECKBOTH
	Tag "Tyrfing"
	States
	{
	Select:
		SRDG A 0 A_Raise
		SRDG A 1 A_Raise
		Loop
	Deselect:
		SRDG A 0 A_Lower
		SRDG A 1 A_Lower
		Loop
	Ready:
		TNT1 A 0 A_JumpIfInventory("PowerWeaponLevel2",1,2)
		SRDG A 1 A_WeaponReady
		Loop
		SRDF A 3 A_WeaponReady
		SRDI BC 3 A_WeaponReady
		Loop
	Fire:
		TNT1 A 0 A_JumpIfInventory("PowerWeaponLevel2",1,"SuperFire")
		SRDG B 0 A_JumpIfInventory("SwordSeq",2,"Fire3")
		SRDG B 1 A_JumpIfInventory("SwordSeq",1,"Fire2")
		SRDG C 1 A_GiveInventory("SwordSeq")
		TNT1 A 4
		SRDG DE 1
		SRDG F 1 A_PlaySound("sword/swing")
		SRDG GHI 1
		SRDG J 1 A_CustomPunch(35,1,0,"SwordPuff",96)
		SRDG KLM 1
		TNT1 A 8 A_WeaponReady
		SRDG C 1
		SRDG B 1 A_TakeInventory("SwordSeq")
		Goto ready
	Fire2:
		TNT1 A 5
		SRDG N 1 A_GiveInventory("SwordSeq")
		SRDG O 1 A_PlaySound("sword/swing")
		SRDG PQR 1
		SRDG S 1 A_CustomPunch(45,1,0,"SwordPuff",96)
		SRDG TUV 1
		TNT1 A 8 A_WeaponReady
		TNT1 A 0 A_TakeInventory("SwordSeq")
		Goto Ready
	Fire3:
		TNT1 A 4
		SRDG DE 1
		SRDG F 1 A_PlaySound("sword/swing")
		SRDG GHI 1
		SRDG J 1 A_CustomPunch(35,1,0,"SwordPuff",96)
		SRDG KL 1
		SRDG M 1 A_TakeInventory("SwordSeq",1)
		TNT1 A 8 A_WeaponReady
		SRDG C 1
		SRDG B 1 A_TakeInventory("SwordSeq")
		Goto Ready
	SuperFire:
		SRDF B 0 A_JumpIfInventory("SwordSeq",2,"SuperFire3")
		SRDF B 1 A_JumpIfInventory("SwordSeq",1,"SuperFire2")
		SRDF C 1 A_GiveInventory("SwordSeq")
		TNT1 A 4
		SRDG DE 1
		SRDF F 1 A_PlaySound("flamesword/swing")
		SRDF GHI 1
		SRDF J 1 A_CustomPunch(80,1,0,"FireSwordPuff",96)
		SRDF KLM 1
		TNT1 A 8 A_WeaponReady
		SRDF C 1
		SRDF B 1 A_TakeInventory("SwordSeq")
		Goto ready
	SuperFire2:
		TNT1 A 5
		SRDF N 1 A_GiveInventory("SwordSeq")
		SRDF O 1 A_PlaySound("flamesword/swing")
		SRDF PQR 1
		SRDF S 1 A_CustomPunch(100,1,0,"FireSwordPuff",96)
		SRDF TUV 1
		TNT1 A 8 A_WeaponReady
		TNT1 A 0 A_TakeInventory("SwordSeq")
		Goto Ready
	SuperFire3:
		TNT1 A 4
		SRDG DE 1
		SRDF F 1 A_PlaySound("flamesword/swing")
		SRDF GHI 1
		SRDF J 1 A_CustomPunch(80,1,0,"FireSwordPuff",96)
		SRDF KL 1
		SRDF M 1 A_TakeInventory("SwordSeq",1)
		TNT1 A 8 A_WeaponReady
		SRDF C 1
		SRDF B 1 A_TakeInventory("SwordSeq")
		Goto Ready
	AltFire:
		SRDG A 1 A_JumpIfInventory("PowerWeaponLevel2",1,"Altfire2")
		SRDG BC 1
		TNT1 A 7 Thing_Damage(0,25)
		SRDG C 1 A_GiveInventory("PowerWeaponLevel2")
		SRDG BA 1
		Goto Ready
	Altfire2:
		SRDF BC 1
		TNT1 A 4
		SRDG DE 1
		SRDF F 1 A_PlaySound("flamesword/swing")
		SRDF GH 1
		SRDF I 1 Thing_Damage(0,2)
		SRDF J 1 A_FireCustomMissile("FirebrandFireball")
		SRDF KLM 1
		TNT1 A 20 A_WeaponReady
		SRDF C 1
		SRDF B 1 A_TakeInventory("SwordSeq")
		Goto Ready
	Spawn:
		SRDP A -1 bright
		Loop
	}
}

ACTOR FirebrandFireball
{
	Projectile
	Radius 12
	Height 12
	Speed 40
	Damage (40)
	RenderStyle Add
	DeathSound "world/barrelboom"
	DamageType Fire
	//Obituary "%o was killed by %k."
	ProjectileKickback 30
	States
	{
	Spawn:
		CFFX N 1 BRIGHT A_SpawnItemEx("FirebrandFireballTrail")
		Loop
	Death:
		CFCF Q 2 BRIGHT A_Scream
		CFCF R 2 BRIGHT A_Explode(16,128,0)
		CFCF STUVWXYZ 2 BRIGHT
		Stop
	}
}

ACTOR FirebrandFireballTrail
{
	RenderStyle Add
	States
	{
	Spawn:
		CFFX NOP 4 BRIGHT
		Stop
	}
}

ACTOR SwordPuff
{
	+NOBLOCKMAP
	+NOGRAVITY
	+PUFFONACTORS
	AttackSound "sword/wall"
	SeeSound "sword/hit"
	//Obituary "%o was killed by %k."
	ProjectileKickback 10
	States
	{
	Spawn:
	Melee:
		TNT1 A 1
		stop
	Crash:
		TNT1 A 0 A_SpawnDebris("SwordPuffSpark")
		TNT1 A 1 A_AlertMonsters
		Stop
	}
}

ACTOR FireSwordPuff : SwordPuff
{
	DamageType Fire
	ProjectileKickback 30
	SeeSound "flamesword/hit"
}

ACTOR SwordPuffSpark
{
	Health 4
	radius 3
	height 6
	speed .1
	RenderStyle Add
	Scale .4
	Mass 0
	BounceType Doom
	+missile
	+FLOORCLIP
	+DONTSPLASH
	States
	{
	States:
		PUFF A 1
		PUFF A 5 Bright A_SetTranslucent(.8,1)
		PUFF A 6 Bright A_SetTranslucent(.6,1)
		PUFF A 8 Bright A_SetTranslucent(.4,1)
		PUFF A 10 Bright A_SetTranslucent(.2,1)
		Stop
	}
}

ACTOR SwordSeq : Inventory
{
	Inventory.MaxAmount 2
}