
class HereticWeapon : Weapon
{
	Default
	{
		Weapon.Kickback 150;
	}
}


// Staff --------------------------------------------------------------------

class Staff : HereticWeapon
{
	Default
	{
		Weapon.SelectionOrder 3800;
		+THRUGHOST
		+WEAPON.WIMPY_WEAPON
		+WEAPON.MELEEWEAPON
		Weapon.sisterweapon "StaffPowered";
		Obituary "$OB_MPSTAFF";
		Tag "$TAG_STAFF";
	}

	native void A_StaffAttack (int damage, class<Actor> puff);

	States
	{
	Ready:	
		STFF A 1 A_WeaponReady;
		Loop;
	Deselect:
		STFF A 1 A_Lower;
		Loop;
	Select:
		STFF A 1 A_Raise;
		Loop;
	Fire:
		STFF B 6;
		STFF C 8 A_StaffAttack(random[StaffAttack](5, 20), "StaffPuff");
		STFF B 8 A_ReFire;
		Goto Ready;
	}
}

class StaffPowered : Staff
{
	Default
	{
		Weapon.sisterweapon "Staff";
		Weapon.ReadySound "weapons/staffcrackle";
		+WEAPON.POWERED_UP
		+WEAPON.READYSNDHALF
		+WEAPON.STAFF2_KICKBACK
		Obituary "$OB_MPPSTAFF";
		Tag "$TAG_STAFFP";
	}

	States
	{
	Ready:	
		STFF DEF 4 A_WeaponReady;
		Loop;
	Deselect:
		STFF D 1 A_Lower;
		Loop;
	Select:
		STFF D 1 A_Raise;
		Loop;
	Fire:
		STFF G 6;
		STFF H 8 A_StaffAttack(random[StaffAttack](18, 81), "StaffPuff2");
		STFF G 8 A_ReFire;
		Goto Ready;
	}
}


// Staff puff ---------------------------------------------------------------

class StaffPuff : Actor
{
	Default
	{
		RenderStyle "Translucent";
		Alpha 0.4;
		VSpeed 1;
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		AttackSound "weapons/staffhit";
	}

	States
	{
	Spawn:
		PUF3 A 4 BRIGHT;
		PUF3 BCD 4;
		Stop;
	}
}

// Staff puff 2 -------------------------------------------------------------

class StaffPuff2 : Actor
{
	Default
	{
		RenderStyle "Add";
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		AttackSound "weapons/staffpowerhit";
	}

	States
	{
	Spawn:
		PUF4 ABCDEF 4 BRIGHT;
		Stop;
	}
}	



// Gold wand ----------------------------------------------------------------

class GoldWand : HereticWeapon
{
	Default
	{
		+BLOODSPLATTER
		Weapon.SelectionOrder 2000;
		Weapon.AmmoGive 25;
		Weapon.AmmoUse 1;
		Weapon.AmmoType "GoldWandAmmo";
		Weapon.SisterWeapon "GoldWandPowered";
		Weapon.YAdjust 5;
		Inventory.PickupMessage "$TXT_WPNGOLDWAND";
		Obituary "$OB_MPGOLDWAND";
		Tag "$TAG_GOLDWAND";
	}

	native void A_FireGoldWandPL1 ();
	
	States
	{
	Spawn:
		GWAN A -1;
		Stop;
	Ready:
		GWND A 1 A_WeaponReady;
		Loop;
	Deselect:
		GWND A 1 A_Lower;
		Loop;
	Select:
		GWND A 1 A_Raise;
		Loop;
	Fire:
		GWND B 3;
		GWND C 5 A_FireGoldWandPL1;
		GWND D 3;
		GWND D 0 A_ReFire;
		Goto Ready;
	}
}

class GoldWandPowered : GoldWand
{
	Default
	{
		+WEAPON.POWERED_UP
		Weapon.AmmoGive 0;
		Weapon.SisterWeapon "GoldWand";
		Obituary "$OB_MPPGOLDWAND";
		Tag "$TAG_GOLDWANDP";
	}

	native void A_FireGoldWandPL2 ();

	States
	{
	Fire:
		GWND B 3;
		GWND C 4 A_FireGoldWandPL2;
		GWND D 3;
		GWND D 0 A_ReFire;
		Goto Ready;
	}
}
	

// Gold wand FX1 ------------------------------------------------------------

class GoldWandFX1 : Actor
{
	Default
	{
		Radius 10;
		Height 6;
		Speed 22;
		Damage 2;
		Projectile;
		RenderStyle "Add";
		DeathSound "weapons/wandhit";
		Obituary "$OB_MPPGOLDWAND";
	}

	States
	{
	Spawn:
		FX01 AB 6 BRIGHT;
		Loop;
	Death:
		FX01 EFGH 3 BRIGHT;
		Stop;
	}
}

// Gold wand FX2 ------------------------------------------------------------

class GoldWandFX2 : GoldWandFX1
{
	Default
	{
		Speed 18;
		Damage 1;
		DeathSound "";
	}

	States
	{
	Spawn:
		FX01 CD 6 BRIGHT;
		Loop;
	}
}

// Gold wand puff 1 ---------------------------------------------------------

class GoldWandPuff1 : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		RenderStyle "Add";
	}

	States
	{
	Spawn:
		PUF2 ABCDE 3 BRIGHT;
		Stop;
	}
}

// Gold wand puff 2 ---------------------------------------------------------

class GoldWandPuff2 : GoldWandFX1
{
	Default
	{
		Skip_Super;
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
	}

	States
	{
	Spawn:
		Goto Super::Death;
	}
}


// Crossbow -----------------------------------------------------------------

class Crossbow : HereticWeapon
{
	Default
	{
		Weapon.SelectionOrder 800;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 10;
		Weapon.AmmoType "CrossbowAmmo";
		Weapon.SisterWeapon "CrossbowPowered";
		Weapon.YAdjust 15;
		Inventory.PickupMessage "$TXT_WPNCROSSBOW";
		Tag "$TAG_CROSSBOW";
	}

	native void A_FireCrossbowPL1 ();

	States
	{
	Spawn:
		WBOW A -1;
		Stop;
	Ready:
		CRBW AAAAAABBBBBBCCCCCC 1 A_WeaponReady;
		Loop;
	Deselect:
		CRBW A 1 A_Lower;
		Loop;
	Select:
		CRBW A 1 A_Raise;
		Loop;
	Fire:
		CRBW D 6 A_FireCrossbowPL1;
		CRBW EFGH 3;
		CRBW AB 4;
		CRBW C 5 A_ReFire;
		Goto Ready;
	}
}


class CrossbowPowered : Crossbow
{
	Default
	{
		+WEAPON.POWERED_UP
		Weapon.AmmoGive 0;
		Weapon.SisterWeapon "Crossbow";
		Tag "$TAG_CROSSBOWP";
	}

	native void A_FireCrossbowPL2();

	States
	{
	Fire:
		CRBW D 5 A_FireCrossbowPL2;
		CRBW E 3;
		CRBW F 2;
		CRBW G 3;
		CRBW H 2;
		CRBW A 3;
		CRBW B 3;
		CRBW C 4 A_ReFire;
		Goto Ready;
	}
}


// Crossbow FX1 -------------------------------------------------------------

class CrossbowFX1 : Actor
{
	Default
	{
		Radius 11;
		Height 8;
		Speed 30;
		Damage 10;
		Projectile;
		RenderStyle "Add";
		SeeSound "weapons/bowshoot";
		DeathSound "weapons/bowhit";
		Obituary "$OB_MPCROSSBOW";
	}

	States
	{
	Spawn:
		FX03 B 1 BRIGHT;
		Loop;
	Death:
		FX03 HIJ 8 BRIGHT;
		Stop;
	}
}


// Crossbow FX2 -------------------------------------------------------------

class CrossbowFX2 : CrossbowFX1
{
	Default
	{
		Speed 32;
		Damage 6;
		Obituary "$OB_MPPCROSSBOW";
	}

	States
	{
	Spawn:
		FX03 B 1 BRIGHT A_SpawnItemEx("CrossbowFX4", random2[BoltSpark]()*0.015625, random2[BoltSpark]()*0.015625, 0, 0,0,0,0,SXF_ABSOLUTEPOSITION, 50);
		Loop;
	}
}

// Crossbow FX3 -------------------------------------------------------------

class CrossbowFX3 : CrossbowFX1
{
	Default
	{
		Speed 20;
		Damage 2;
		SeeSound "";
		-NOBLOCKMAP
		+WINDTHRUST
		+THRUGHOST
	}

	States
	{
	Spawn:
		FX03 A 1 BRIGHT;
		Loop;
	Death:
		FX03 CDE 8 BRIGHT;
		Stop;
	}
}

// Crossbow FX4 -------------------------------------------------------------

class CrossbowFX4 : Actor
{
	Default
	{
		+NOBLOCKMAP
		Gravity 0.125;
		RenderStyle "Add";
	}

	States
	{
	Spawn:
		FX03 FG 8 BRIGHT;
		Stop;
	}
}




// Gauntlets ----------------------------------------------------------------

class Gauntlets : Weapon
{
	Default
	{
		+BLOODSPLATTER
		Weapon.SelectionOrder 2300;
		+WEAPON.WIMPY_WEAPON
		+WEAPON.MELEEWEAPON
		Weapon.Kickback 0;
		Weapon.YAdjust 15;
		Weapon.UpSound "weapons/gauntletsactivate";
		Weapon.SisterWeapon "GauntletsPowered";
		Inventory.PickupMessage "$TXT_WPNGAUNTLETS";
		Tag "$TAG_GAUNTLETS";
		Obituary "$OB_MPGAUNTLETS";
	}

	native void A_GauntletAttack (int power);

	States
	{
	Spawn:
		WGNT A -1;
		Stop;
	Ready:
		GAUN A 1 A_WeaponReady;
		Loop;
	Deselect:
		GAUN A 1 A_Lower;
		Loop;
	Select:
		GAUN A 1 A_Raise;
		Loop;
	Fire:
		GAUN B 4 A_PlaySound("weapons/gauntletsuse", CHAN_WEAPON);
		GAUN C 4;
	Hold:
		GAUN DEF 4 BRIGHT A_GauntletAttack(0);
		GAUN C 4 A_ReFire;
		GAUN B 4 A_Light0;
		Goto Ready;
	}
}


class GauntletsPowered : Gauntlets
{
	Default
	{
		+WEAPON.POWERED_UP
		Tag "$TAG_GAUNTLETSP";
		Obituary "$OB_MPPGAUNTLETS";
		Weapon.SisterWeapon "Gauntlets";
	}

	States
	{
	Ready:
		GAUN GHI 4 A_WeaponReady;
		Loop;
	Deselect:
		GAUN G 1 A_Lower;
		Loop;
	Select:
		GAUN G 1 A_Raise;
		Loop;
	Fire:
		GAUN J 4 A_PlaySound("weapons/gauntletsuse", CHAN_WEAPON);
		GAUN K 4;
	Hold:
		GAUN LMN 4 BRIGHT A_GauntletAttack(1);
		GAUN K 4 A_ReFire;
		GAUN J 4 A_Light0;
		Goto Ready;
	}
}


// Gauntlet puff 1 ----------------------------------------------------------

class GauntletPuff1 : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		RenderStyle "Translucent";
		Alpha 0.4;
		VSpeed 0.8;
	}

	States
	{
	Spawn:
		PUF1 ABCD 4 BRIGHT;
		Stop;
	}
}

// Gauntlet puff 2 ---------------------------------------------------------

class GauntletPuff2 : GauntletPuff1
{
	States
	{
	Spawn:
		PUF1 EFGH 4 BRIGHT;
		Stop;
	}
}


// The mace itself ----------------------------------------------------------

class Mace : HereticWeapon
{
	Default
	{
		Weapon.SelectionOrder 1400;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive1 50;
		Weapon.YAdjust 15;
		Weapon.AmmoType "MaceAmmo";
		Weapon.SisterWeapon "MacePowered";
		Inventory.PickupMessage "$TXT_WPNMACE";
		Tag "$TAG_MACE";
	}

	native void A_FireMacePL1();
	
	States
	{
	Spawn:
		WMCE A -1;
		Stop;
	Ready:
		MACE A 1 A_WeaponReady;
		Loop;
	Deselect:
		MACE A 1 A_Lower;
		Loop;
	Select:
		MACE A 1 A_Raise;
		Loop;
	Fire:
		MACE B 4;
	Hold:
		MACE CDEF 3 A_FireMacePL1;
		MACE C 4 A_ReFire;
		MACE DEFB 4;
		Goto Ready;
	}
}

class MacePowered : Mace
{
	Default
	{
		+WEAPON.POWERED_UP
		Weapon.AmmoUse 5;
		Weapon.AmmoGive 0;
		Weapon.SisterWeapon "Mace";
		Tag "$TAG_MACEP";
	}

	native void A_FireMacePL2();
	
	States
	{
	Fire:
	Hold:	
		MACE B 4;
		MACE D 4 A_FireMacePL2;
		MACE B 4;
		MACE A 8 A_ReFire;
		Goto Ready;
	}
}

// Mace FX1 -----------------------------------------------------------------

class MaceFX1 : Actor
{
	Default
	{
		Radius 8;
		Height 6;
		Speed 20;
		Damage 2;
		Projectile;
		+THRUGHOST
		BounceType "HereticCompat";
		SeeSound "weapons/maceshoot";
		Obituary "$OB_MPMACE";
	}

	native void A_MacePL1Check();
	native void A_MaceBallImpact();

	States
	{
	Spawn:
		FX02 AB 4 A_MacePL1Check;
		Loop;
	Death:
		FX02 F 4 BRIGHT A_MaceBallImpact;
		FX02 GHIJ 4 BRIGHT;
		Stop;
	}
}

// Mace FX2 -----------------------------------------------------------------

class MaceFX2 : MaceFX1
{
	Default
	{
		Speed 10;
		Damage 6;
		Gravity 0.125;
		-NOGRAVITY
		SeeSound "";
	}

	native void A_MaceBallImpact2();

	States
	{
	Spawn:
		FX02 CD 4;
		Loop;
	Death:
		FX02 F 4 A_MaceBallImpact2;
		goto Super::Death+1;
	}
}

// Mace FX3 -----------------------------------------------------------------

class MaceFX3 : MaceFX1
{
	Default
	{
		Speed 7;
		Damage 4;
		-NOGRAVITY;
		Gravity 0.125;
	}

	States
	{
	Spawn:
		FX02 AB 4;
		Loop;
	}
}


// Mace FX4 -----------------------------------------------------------------

class MaceFX4 : Actor native
{
	Default
	{
		Radius 8;
		Height 6;
		Speed 7;
		Damage 18;
		Gravity 0.125;
		Projectile;
		-NOGRAVITY
		+TELESTOMP
		+THRUGHOST
		-NOTELEPORT
		BounceType "HereticCompat";
		SeeSound "";
		Obituary "$OB_MPPMACE";
	}

	native void A_DeathBallImpact();

	States
	{
	Spawn:
		FX02 E 99;
		Loop;
	Death:
		FX02 C 4 A_DeathBallImpact;
		FX02 GHIJ 4 BRIGHT;
		Stop;
	}
}


// Mace spawn spot ----------------------------------------------------------

class MaceSpawner : SpecialSpot
{
	Default
	{
		+NOSECTOR
		+NOBLOCKMAP
	}

	States
	{
	Spawn:
		TNT1 A 1;
		TNT1 A -1 A_SpawnSingleItem("Mace", 64, 64, 0);
		Stop;
	}
}


// Blaster ------------------------------------------------------------------

class Blaster : HereticWeapon
{
	Default
	{
		+BLOODSPLATTER
		Weapon.SelectionOrder 500;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 30;
		Weapon.YAdjust 15;
		Weapon.AmmoType "BlasterAmmo";
		Weapon.SisterWeapon "BlasterPowered";
		Inventory.PickupMessage "$TXT_WPNBLASTER";
		Tag "$TAG_BLASTER";
		Obituary "$OB_MPBLASTER";
	}

	native void A_FireBlasterPL1();

	States
	{
	Spawn:
		WBLS A -1;
		Stop;
	Ready:
		BLSR A 1 A_WeaponReady;
		Loop;
	Deselect:
		BLSR A 1 A_Lower;
		Loop;
	Select:
		BLSR A 1 A_Raise;
		Loop;
	Fire:
		BLSR BC 3;
	Hold:
		BLSR D 2 A_FireBlasterPL1;
		BLSR CB 2;
		BLSR A 0 A_ReFire;
		Goto Ready;
	}
}

class BlasterPowered : Blaster
{
	Default
	{
		+WEAPON.POWERED_UP
		Weapon.AmmoUse 5;
		Weapon.AmmoGive 0;
		Weapon.SisterWeapon "Blaster";
		Tag "$TAG_BLASTERP";
	}

	States
	{
	Fire:
		BLSR BC 0;
	Hold:
		BLSR D 3 A_FireCustomMissile("BlasterFX1");
		BLSR CB 4;
		BLSR A 0 A_ReFire;
		Goto Ready;
	}
}

// Blaster FX 1 -------------------------------------------------------------

class BlasterFX1 : FastProjectile native
{
	Default
	{
		Radius 12;
		Height 8;
		Speed 184;
		Damage 2;
		SeeSound "weapons/blastershoot";
		DeathSound "weapons/blasterhit";
		+SPAWNSOUNDSOURCE
		Obituary "$OB_MPPBLASTER";
	}

	native void A_SpawnRippers();

	States
	{
	Spawn:
		ACLO E 200;
		Loop;
	Death:
		FX18 A 3 BRIGHT A_SpawnRippers;
		FX18 B 3 BRIGHT;
		FX18 CDEFG 4 BRIGHT;
		Stop;
	}
}

// Blaster smoke ------------------------------------------------------------

class BlasterSmoke : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+NOTELEPORT
		+CANNOTPUSH
		RenderStyle "Translucent";
		Alpha 0.4;
	}

	States
	{
	Spawn:
		FX18 HIJKL 4;
		Stop;
	}
}

// Ripper -------------------------------------------------------------------

class Ripper : Actor native
{
	Default
	{
		Radius 8;
		Height 6;
		Speed 14;
		Damage 1;
		Projectile;
		+RIPPER
		DeathSound "weapons/blasterpowhit";
		Obituary "$OB_MPPBLASTER";
	}

	States
	{
	Spawn:
		FX18 M 4;
		FX18 N 5;
		Loop;
	Death:
		FX18 OPQRS 4 BRIGHT;
		Stop;
	}
}

// Blaster Puff -------------------------------------------------------------

class BlasterPuff : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		RenderStyle "Add";
		SeeSound "weapons/blasterhit";
	}

	States
	{
	Crash:
		FX17 ABCDE 4 BRIGHT;
		Stop;
	Spawn:
		FX17 FG 3 BRIGHT;
		FX17 HIJKL 4 BRIGHT;
		Stop;
	}
}


// Skull (Horn) Rod ---------------------------------------------------------

class SkullRod : HereticWeapon
{
	Default
	{
		Weapon.SelectionOrder 200;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 50;
		Weapon.YAdjust 15;
		Weapon.AmmoType1 "SkullRodAmmo";
		Weapon.SisterWeapon "SkullRodPowered";
		Inventory.PickupMessage "$TXT_WPNSKULLROD";
		Tag "$TAG_SKULLROD";
	}

	native void A_FireSkullRodPL1();

	States
	{
	Spawn:
		WSKL A -1;
		Stop;
	Ready:
		HROD A 1 A_WeaponReady;
		Loop;
	Deselect:
		HROD A 1 A_Lower;
		Loop;
	Select:
		HROD A 1 A_Raise;
		Loop;
	Fire:
		HROD AB 4 A_FireSkullRodPL1;
		HROD B 0 A_ReFire;
		Goto Ready;
	}
}

class SkullRodPowered : SkullRod
{
	Default
	{
		+WEAPON.POWERED_UP
		Weapon.AmmoUse1 5;
		Weapon.AmmoGive1 0;
		Weapon.SisterWeapon "SkullRod";
		Tag "$TAG_SKULLRODP";
	}

	native void A_FireSkullRodPL2();

	States
	{
	Fire:
		HROD C 2;
		HROD D 3;
		HROD E 2;
		HROD F 3;
		HROD G 4 A_FireSkullRodPL2;
		HROD F 2;
		HROD E 3;
		HROD D 2;
		HROD C 2 A_ReFire;
		Goto Ready;
	}
}

// Horn Rod FX 1 ------------------------------------------------------------

class HornRodFX1 : Actor
{
	Default
	{
		Radius 12;
		Height 8;
		Speed 22;
		Damage 3;
		Projectile;
		+WINDTHRUST
		-NOBLOCKMAP
		RenderStyle "Add";
		SeeSound "weapons/hornrodshoot";
		DeathSound "weapons/hornrodhit";
		Obituary "$OB_MPSKULLROD";
	}

	States
	{
	Spawn:
		FX00 AB 6 BRIGHT;
		Loop;
	Death:
		FX00 HI 5 BRIGHT;
		FX00 JK 4 BRIGHT;
		FX00 LM 3 BRIGHT;
		Stop;
	}
}


// Horn Rod FX 2 ------------------------------------------------------------

class HornRodFX2 : Actor native
{
	Default
	{
		Radius 12;
		Height 8;
		Speed 22;
		Damage 10;
		Health 140;
		Projectile;
		RenderStyle "Add";
		SeeSound "weapons/hornrodpowshoot";
		DeathSound "weapons/hornrodpowhit";
		Obituary "$OB_MPPSKULLROD";
	}

	native void A_AddPlayerRain();
	native void A_HideInCeiling();
	native void A_SkullRodStorm();

	States
	{
	Spawn:
		FX00 C 3 BRIGHT;
		FX00 D 3 BRIGHT A_SeekerMissile(10, 30);
		FX00 E 3 BRIGHT;
		FX00 F 3 BRIGHT A_SeekerMissile(10, 30);
		Loop;
	Death:
		FX00 H 5 BRIGHT A_AddPlayerRain;
		FX00 I 5 BRIGHT;
		FX00 J 4 BRIGHT;
		FX00 KLM 3 BRIGHT;
		FX00 G 1 A_HideInCeiling;
		FX00 G 1 A_SkullRodStorm;
		Wait;
	}
}

// Rain pillar 1 ------------------------------------------------------------

class RainPillar : Actor native
{
	Default
	{
		Radius 5;
		Height 12;
		Speed 12;
		Damage 5;
		Mass 5;
		Projectile;
		-ACTIVATEPCROSS
		-ACTIVATEIMPACT
		RenderStyle "Add";
		Obituary "$OB_MPPSKULLROD";
	}

	native void A_RainImpact();

	States
	{
	Spawn:
		FX22 A -1 BRIGHT;
		Stop;
	Death:
		FX22 B 4 BRIGHT A_RainImpact;
		FX22 CDEF 4 BRIGHT;
		Stop;
	NotFloor:
		FX22 GHI 4 BRIGHT;
		Stop;
	}
}

// Rain tracker "inventory" item --------------------------------------------

class RainTracker : Inventory native
{
	Default
	{
		+INVENTORY.UNDROPPABLE
	}
}


// Phoenix Rod --------------------------------------------------------------

class PhoenixRod : Weapon native
{
	Default
	{
		+WEAPON.NOAUTOFIRE
		Weapon.SelectionOrder 2600;
		Weapon.Kickback 150;
		Weapon.YAdjust 15;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 2;
		Weapon.AmmoType "PhoenixRodAmmo";
		Weapon.Sisterweapon "PhoenixRodPowered";
		Inventory.PickupMessage "$TXT_WPNPHOENIXROD";
		Tag "$TAG_PHOENIXROD";
	}

	native void A_FirePhoenixPL1();

	States
	{
	Spawn:
		WPHX A -1;
		Stop;
	Ready:
		PHNX A 1 A_WeaponReady;
		Loop;
	Deselect:
		PHNX A 1 A_Lower;
		Loop;
	Select:
		PHNX A 1 A_Raise;
		Loop;
	Fire:
		PHNX B 5;
		PHNX C 7 A_FirePhoenixPL1;
		PHNX DB 4;
		PHNX B 0 A_ReFire;
		Goto Ready;
	}
}

class PhoenixRodPowered : PhoenixRod native
{
	Default
	{
		+WEAPON.POWERED_UP
		+WEAPON.MELEEWEAPON
		Weapon.SisterWeapon "PhoenixRod";
		Weapon.AmmoGive 0;
		Tag "$TAG_PHOENIXRODP";
	}

	native void A_InitPhoenixPL2();
	native void A_FirePhoenixPL2();
	native void A_ShutdownPhoenixPL2();

	States
	{
	Fire:
		PHNX B 3 A_InitPhoenixPL2;
	Hold:
		PHNX C 1 A_FirePhoenixPL2;
		PHNX B 4 A_ReFire;
	Powerdown:
		PHNX B 4 A_ShutdownPhoenixPL2;
		Goto Ready;
	}
}

// Phoenix FX 1 -------------------------------------------------------------

class PhoenixFX1 : Actor native
{
	Default
	{
		Radius 11;
		Height 8;
		Speed 20;
		Damage 20;
		DamageType "Fire";
		Projectile;
		+THRUGHOST
		+SPECIALFIREDAMAGE
		SeeSound "weapons/phoenixshoot";
		DeathSound "weapons/phoenixhit";
		Obituary "$OB_MPPHOENIXROD";
	}

	native void A_PhoenixPuff();

	States
	{
	Spawn:
		FX04 A 4 BRIGHT A_PhoenixPuff;
		Loop;
	Death:
		FX08 A 6 BRIGHT A_Explode;
		FX08 BC 5 BRIGHT;
		FX08 DEFGH 4 BRIGHT;
		Stop;
	}
}

// Phoenix puff -------------------------------------------------------------

class PhoenixPuff : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+NOTELEPORT
		+CANNOTPUSH
		RenderStyle "Translucent";
		Alpha 0.4;
	}

	States
	{
	Spawn:
		FX04 BCDEF 4;
		Stop;
	}
}

// Phoenix FX 2 -------------------------------------------------------------

class PhoenixFX2 : Actor native
{
	Default
	{
		Radius 6;
		Height 8;
		Speed 10;
		Damage 2;
		DamageType "Fire";
		Projectile;
		RenderStyle "Add";
		Obituary "$OB_MPPPHOENIXROD";
	}

	native void A_FlameEnd();
	native void A_FloatPuff();

	States
	{
	Spawn:
		FX09 ABABA 2 BRIGHT;
		FX09 B 2 BRIGHT A_FlameEnd;
		FX09 CDEF 2 BRIGHT;
		Stop;
	Death:
		FX09 G 3 BRIGHT;
		FX09 H 3 BRIGHT A_FloatPuff;
		FX09 I 4 BRIGHT;
		FX09 JK 5 BRIGHT;
		Stop;
	}
}

