
// Cleric Weapon Piece ------------------------------------------------------

class ClericWeaponPiece : WeaponPiece
{
	Default
	{
		Inventory.PickupSound "misc/w_pkup";
		Inventory.PickupMessage "$TXT_WRAITHVERGE_PIECE";
		Inventory.ForbiddenTo "FighterPlayer", "MagePlayer";
		WeaponPiece.Weapon "CWeapWraithverge";
		+FLOATBOB
	}
}

// Cleric Weapon Piece 1 ----------------------------------------------------

class CWeaponPiece1 : ClericWeaponPiece
{
	Default
	{
		WeaponPiece.Number 1;
	}
	States
	{
	Spawn:
		WCH1 A -1;
		Stop;
	}
}

// Cleric Weapon Piece 2 ----------------------------------------------------

class CWeaponPiece2 : ClericWeaponPiece
{
	Default
	{
		WeaponPiece.Number 2;
	}
	States
	{
	Spawn:
		WCH2 A -1;
		Stop;
	}
}

// Cleric Weapon Piece 3 ----------------------------------------------------

class CWeaponPiece3 : ClericWeaponPiece
{
	Default
	{
		WeaponPiece.Number 3;
	}
	States
	{
	Spawn:
		WCH3 A -1;
		Stop;
	}
}

// Wraithverge Drop ---------------------------------------------------------

class WraithvergeDrop : Actor
{
	States
	{
	Spawn:
		TNT1 A 1;
		TNT1 A 1 A_DropWeaponPieces("CWeaponPiece1", "CWeaponPiece2", "CWeaponPiece3");
		Stop;
	}
}

// Cleric's Wraithverge (Holy Symbol?) --------------------------------------

class CWeapWraithverge : ClericWeapon native
{
	Default
	{
		Health 3;
		Weapon.SelectionOrder 3000;
		+WEAPON.PRIMARY_USES_BOTH;
		+Inventory.NoAttenPickupSound
		Weapon.AmmoUse1 18;
		Weapon.AmmoUse2 18;
		Weapon.AmmoGive1 20;
		Weapon.AmmoGive2 20;
		Weapon.KickBack 150;
		Weapon.AmmoType1 "Mana1";
		Weapon.AmmoType2 "Mana2";
		Inventory.PickupMessage "$TXT_WEAPON_C4";
		Tag "$TAG_CWEAPWRAITHVERGE";
		Inventory.PickupSound "WeaponBuild";
	}

	action native void A_CHolyAttack();
	action native void A_CHolyPalette();

	States
	{
	Spawn:
		TNT1 A -1;
		Stop;
	Ready:
		CHLY A 1 A_WeaponReady;
		Loop;
	Select:
		CHLY A 1 A_Raise;
		Loop;
	Deselect:
		CHLY A 1 A_Lower;
		Loop;
	Fire:
		CHLY AB 1 Bright Offset (0, 40);
		CHLY CD 2 Bright Offset (0, 43);
		CHLY E 2 Bright Offset (0, 45);
		CHLY F 6 Bright Offset (0, 48) A_CHolyAttack;
		CHLY GG 2 Bright Offset (0, 40) A_CHolyPalette;
		CHLY G 2 Offset (0, 36) A_CHolyPalette;
		Goto Ready;
	}
}

// Holy Missile -------------------------------------------------------------

class HolyMissile : Actor
{
	Default
	{
		Speed 30;
		Radius 15;
		Height 8;
		Damage 4;
		Projectile;
		-ACTIVATEIMPACT -ACTIVATEPCROSS
		+EXTREMEDEATH
	}

	native void A_CHolyAttack2();

	States
	{
	Spawn:
		SPIR PPPP 3 Bright A_SpawnItemEx("HolyMissilePuff");
	Death:
		SPIR P 1 Bright A_CHolyAttack2;
		Stop;
	}
}

// Holy Missile Puff --------------------------------------------------------

class HolyMissilePuff : Actor
{
	Default
	{
		Radius 4;
		Height 8;
		+NOBLOCKMAP +NOGRAVITY +DROPOFF
		+NOTELEPORT
		RenderStyle "Translucent";
		Alpha 0.4;
	}
	States
	{
	Spawn:
		SPIR QRSTU 3;
		Stop;
	}
}

// Holy Puff ----------------------------------------------------------------

class HolyPuff : Actor
{
	Default
	{
		+NOBLOCKMAP +NOGRAVITY
		RenderStyle "Translucent";
		Alpha 0.6;
	}
	States
	{
	Spawn:
		SPIR KLMNO 3;
		Stop;
	}
}

// Holy Spirit --------------------------------------------------------------

class HolySpirit : Actor native
{
	Default
	{
		Health 105;
		Speed 12;
		Radius 10;
		Height 6;
		Damage 3;
		Projectile;
		+RIPPER +SEEKERMISSILE
		+FOILINVUL +SKYEXPLODE +NOEXPLODEFLOOR +CANBLAST
		+EXTREMEDEATH
		RenderStyle "Translucent";
		Alpha 0.4;
		DeathSound "SpiritDie";
		Obituary "$OB_MPCWEAPWRAITHVERGE";
	}

	native void A_CHolySeek();
	native void A_CHolyCheckScream();

	States
	{
	Spawn:
		SPIR AAB 2 A_CHolySeek;
		SPIR B 2 A_CHolyCheckScream;
		Loop;
	Death:
		SPIR D 4;
		SPIR E 4 A_Scream;
		SPIR FGHI 4;
		Stop;
	}
}

// Holy Tail ----------------------------------------------------------------

class HolyTail : Actor
{
	Default
	{
		Radius 1;
		Height 1;
		+NOBLOCKMAP +NOGRAVITY +DROPOFF +NOCLIP
		+NOTELEPORT
		RenderStyle "Translucent";
		Alpha 0.6;
	}

	native void A_CHolyTail();

	States
	{
	Spawn:
		SPIR C 1 A_CHolyTail;
		Loop;
	TailTrail:
		SPIR D -1;
		Stop;
	}
}

// Holy Tail Trail ---------------------------------------------------------

class HolyTailTrail : HolyTail
{
	States
	{
	Spawn:
		Goto TailTrail;
	}
}
