
class StrifeWeapon : Weapon
{
	Default
	{
		Weapon.Kickback 100;
	}
}

// Same as the bullet puff for Doom -----------------------------------------

class StrifePuff : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+ALLOWPARTICLES
		RenderStyle "Translucent";
		Alpha 0.25;
	}

	States
	{
	Spawn:
		POW3 ABCDEFGH 3;
		Stop;
	Crash:
		PUFY A 4 Bright;
		PUFY BCD 4;
		Stop;
	}
}
	

// A spark when you hit something that doesn't bleed ------------------------
// Only used by the dagger.

class StrifeSpark : StrifePuff
{
	Default
	{
		RenderStyle "Add";
	}
	States
	{
	Crash:
		POW2 ABCD 4;
		Stop;
	}
}

// Punch Dagger -------------------------------------------------------------

class PunchDagger : StrifeWeapon
{
	Default
	{
		Weapon.SelectionOrder 3900;
		+WEAPON.NOALERT
		Obituary "$OB_MPPUNCHDAGGER";
		Tag "$TAG_PUNCHDAGGER";
	}
	
	native void A_JabDagger ();
	
	States
	{
	Ready:
		PNCH A 1 A_WeaponReady;
		Loop;
	Deselect:
		PNCH A 1 A_Lower;
		Loop;
	Select:
		PNCH A 1 A_Raise;
		Loop;
	Fire:
		PNCH B 4;
		PNCH C 4 A_JabDagger;
		PNCH D 5;
		PNCH C 4;
		PNCH B 5 A_ReFire;
		Goto Ready;
	}

}	


// The base for Strife projectiles that die with ZAP1 -----------------------

class StrifeZap1 : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+DROPOFF
	}
	States
	{
	Spawn:
	Death:
		ZAP1 A 3 A_AlertMonsters;
		ZAP1 BCDEFE 3;
		ZAP1 DCB 2;
		ZAP1 A 1;
		Stop;
	}
}


// Electric Bolt ------------------------------------------------------------

class ElectricBolt : StrifeZap1
{
	Default
	{
		Speed 30;
		Radius 10;
		Height 10;
		Damage 10;
		Projectile;
		+STRIFEDAMAGE
		MaxStepHeight 4;
		SeeSound "misc/swish";
		ActiveSound "misc/swish";
		DeathSound "weapons/xbowhit";
		Obituary "$OB_MPELECTRICBOLT";
	}
	States
	{
	Spawn:
		AROW A 10 A_LoopActiveSound;
		Loop;
	}
}


// Poison Bolt --------------------------------------------------------------

class PoisonBolt : Actor native
{
	Default
	{
		Speed 30;
		Radius 10;
		Height 10;
		Damage 500;
		Projectile;
		+STRIFEDAMAGE
		MaxStepHeight 4;
		SeeSound "misc/swish";
		ActiveSound "misc/swish";
		Obituary "$OB_MPPOISONBOLT";
	}
	States
	{
	Spawn:
		ARWP A 10 A_LoopActiveSound;
		Loop;
	Death:
		AROW A 1;
		Stop;
	}
}


// Strife's Crossbow --------------------------------------------------------

class StrifeCrossbow : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 1200;
		+WEAPON.NOALERT
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 8;
		Weapon.AmmoType1 "ElectricBolts";
		Weapon.SisterWeapon "StrifeCrossbow2";
		Inventory.PickupMessage "$TXT_STRIFECROSSBOW";
		Tag "$TAG_STRIFECROSSBOW1";
		Inventory.Icon "CBOWA0";
	}
	
	native void A_ClearFlash ();
	native void A_ShowElectricFlash ();
	native void A_FireArrow (class<Actor> proj);

	States
	{
	Spawn:
		CBOW A -1;
		Stop;
	Ready:
		XBOW A 0 A_ShowElectricFlash;
		XBOW A 1 A_WeaponReady;
		Wait;
	Deselect:
		XBOW A 1 A_Lower;
		Loop;
	Select:
		XBOW A 1 A_Raise;
		Loop;
	Fire:
		XBOW A 3 A_ClearFlash;
		XBOW B 6 A_FireArrow("ElectricBolt");
		XBOW C 4;
		XBOW D 6;
		XBOW E 3;
		XBOW F 5;
		XBOW G 0 A_ShowElectricFlash;
		XBOW G 5 A_CheckReload;
		Goto Ready+1;
	Flash:
		XBOW KLM 5;
		Loop;
	}
}


class StrifeCrossbow2 : StrifeCrossbow
{
	Default
	{
		Weapon.SelectionOrder 2700;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 0;
		Weapon.AmmoType1 "PoisonBolts";
		Weapon.SisterWeapon "StrifeCrossbow";
		Tag "$TAG_STRIFECROSSBOW2";
	}
	States
	{
	Ready:
		XBOW H 1 A_WeaponReady;
		Loop;
	Deselect:
		XBOW H 1 A_Lower;
		Loop;
	Select:
		XBOW H 1 A_Raise;
		Loop;
	Fire:
		XBOW H 3;
		XBOW B 6 A_FireArrow("PoisonBolt");
		XBOW C 4;
		XBOW D 6;
		XBOW E 3;
		XBOW I 5;
		XBOW J 5 A_CheckReload;
		Goto Ready;
	Flash:
		Stop;
	}
}

// Assault Gun --------------------------------------------------------------

class AssaultGun : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 600;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 20;
		Weapon.AmmoType1 "ClipOfBullets";
		Inventory.Icon "RIFLA0";
		Tag "$TAG_ASSAULTGUN";
		Inventory.PickupMessage "$TXT_ASSAULTGUN";
		Obituary "$OB_MPASSAULTGUN";
	}
	States
	{
	Spawn:
		RIFL A -1;
		Stop;
	Ready:
		RIFG A 1 A_WeaponReady;
		Loop;
	Deselect:
		RIFG B 1 A_Lower;
		Loop;
	Select:
		RIFG A 1 A_Raise;
		Loop;
	Fire:
		RIFF AB 3 A_FireAssaultGun;
		RIFG D 3 A_FireAssaultGun;
		RIFG C 0 A_ReFire;
		RIFG B 2 A_Light0;
		Goto Ready;
	}
}


// Standing variant of the assault gun --------------------------------------

class AssaultGunStanding : WeaponGiver
{
	Default
	{
		DropItem "AssaultGun";
		Inventory.PickupMessage "$TXT_ASSAULTGUN";
	}
	States
	{
	Spawn:
		RIFL B -1;
		Stop;
	}
}


// Mini-Missile Launcher ----------------------------------------------------


class MiniMissileLauncher : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 1800;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 8;
		Weapon.AmmoType1 "MiniMissiles";
		Inventory.Icon "MMSLA0";
		Tag "$TAG_MMLAUNCHER";
		Inventory.PickupMessage "$TXT_MMLAUNCHER";
	}

	native void A_FireMiniMissile ();

	States
	{
	Spawn:
		MMSL A -1;
		Stop;
	Ready:
		MMIS A 1 A_WeaponReady;
		Loop;
	Deselect:
		MMIS A 1 A_Lower;
		Loop;
	Select:
		MMIS A 1 A_Raise;
		Loop;
	Fire:
		MMIS A 4 A_FireMiniMissile;
		MMIS B 4 A_Light1;
		MMIS C 5 Bright;
		MMIS D 2 Bright A_Light2;
		MMIS E 2 Bright;
		MMIS F 2 Bright A_Light0;
		MMIS F 0 A_ReFire;
		Goto Ready;
	}
}
	

// Rocket Trail -------------------------------------------------------------

class RocketTrail : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		RenderStyle "Translucent";
		Alpha 0.25;
		SeeSound "misc/missileinflight";
	}
	States
	{
	Spawn:
		PUFY BCBCD 4;
		Stop;
	}
}

// Rocket Puff --------------------------------------------------------------

class MiniMissilePuff : StrifePuff
{
	Default
	{
		-ALLOWPARTICLES
	}
	States
	{
	Spawn:
		Goto Crash;
	}
}

// Mini Missile -------------------------------------------------------------

class MiniMissile : Actor
{
	Default
	{
		Speed 20;
		Radius 10;
		Height 14;
		Damage 10;
		Projectile;
		+STRIFEDAMAGE
		MaxStepHeight 4;
		SeeSound "weapons/minimissile";
		DeathSound "weapons/minimissilehit";
		Obituary "$OB_MPMINIMISSILELAUNCHER";
	}
	States
	{
	Spawn:
		MICR A 6 Bright A_RocketInFlight;
		Loop;
	Death:
		SMIS A 0 Bright A_SetTranslucent(1,1);
		SMIS A 5 Bright A_Explode(64,64,1,1);
		SMIS B 5 Bright;
		SMIS C 4 Bright;
		SMIS DEFG 2 Bright;
		Stop;
	}
}

// Flame Thrower ------------------------------------------------------------

class FlameThrower : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 2100;
		Weapon.Kickback 0;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 100;
		Weapon.UpSound "weapons/flameidle";
		Weapon.ReadySound "weapons/flameidle";
		Weapon.AmmoType1 "EnergyPod";
		Inventory.Icon "FLAMA0";
		Tag "$TAG_FLAMER";
		Inventory.PickupMessage "$TXT_FLAMER";
	}
	
	native void A_FireFlamer ();

	States
	{
	Spawn:
		FLAM A -1;
		Stop;
	Ready:
		FLMT AB 3 A_WeaponReady;
		Loop;
	Deselect:
		FLMT A 1 A_Lower;
		Loop;
	Select:
		FLMT A 1 A_Raise;
		Loop;
	Fire:
		FLMF A 2 A_FireFlamer;
		FLMF B 3 A_ReFire;
		Goto Ready;
	}
}	


// Flame Thrower Projectile -------------------------------------------------

class FlameMissile : Actor
{
	Default
	{
		Speed 15;
		Height 11;
		Radius 8;
		Mass 10;
		Damage 4;
		DamageType "Fire";
		ReactionTime 8;
		Projectile;
		-NOGRAVITY
		+STRIFEDAMAGE
		MaxStepHeight 4;
		RenderStyle "Add";
		SeeSound "weapons/flamethrower";
		Obituary "$OB_MPFLAMETHROWER";
	}

	native void A_FlameDie ();

	States
	{
	Spawn:
		FRBL AB 3 Bright;
		FRBL C 3 Bright A_Countdown;
		Loop;
	Death:
		FRBL D 5 Bright A_FlameDie;
		FRBL EFGHI 5 Bright;
		Stop;
	}

}


// Mauler -------------------------------------------------------------------
// The scatter version

class Mauler : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 300;
		Weapon.AmmoUse1 20;
		Weapon.AmmoGive1 40;
		Weapon.AmmoType1 "EnergyPod";
		Weapon.SisterWeapon "Mauler2";
		Inventory.Icon "TRPDA0";
		Tag "$TAG_MAULER1";
		Inventory.PickupMessage "$TXT_MAULER";
		Obituary "$OB_MPMAULER1";
	}

	native void A_FireMauler1 ();

	States
	{
	Ready:
		MAUL FGHA 6 A_WeaponReady;
		Loop;
	Deselect:
		MAUL A 1 A_Lower;
		Loop;
	Select:
		MAUL A 1 A_Raise;
		Loop;
	Fire:
		BLSF A 5 Bright A_FireMauler1;
		MAUL B 3 Bright A_Light1;
		MAUL C 2 A_Light2;
		MAUL DE 2;
		MAUL A 7 A_Light0;
		MAUL H 7;
		MAUL G 7 A_CheckReload;
		Goto Ready;
	Spawn:
		TRPD A -1;
		Stop;
	}
}


// Mauler Torpedo version ---------------------------------------------------

class Mauler2 : Mauler
{
	Default
	{
		Weapon.SelectionOrder 3300;
		Weapon.AmmoUse1 30;
		Weapon.AmmoGive1 0;
		Weapon.AmmoType1 "EnergyPod";
		Weapon.SisterWeapon "Mauler";
		Tag "$TAG_MAULER2";
	}

	native void A_FireMauler2Pre ();
	native void A_FireMauler2 ();

	States
	{
	Ready:
		MAUL IJKL 7 A_WeaponReady;
		Loop;
	Deselect:
		MAUL I 1 A_Lower;
		Loop;
	Select:
		MAUL I 1 A_Raise;
		Loop;
	Fire:
		MAUL I 20 A_FireMauler2Pre;
		MAUL J 10 A_Light1;
		BLSF A 10 Bright A_FireMauler2;
		MAUL B 10 Bright A_Light2;
		MAUL C 2;
		MAUL D 2 A_Light0;
		MAUL E 2 A_ReFire;
		Goto Ready;
	}
}


// Mauler "Bullet" Puff -----------------------------------------------------

class MaulerPuff : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+PUFFONACTORS
		RenderStyle "Add";
		DamageType "Disintegrate";
	}
	States
	{
	Spawn:
		MPUF AB 5;
		POW1 ABCDE 4;
		Stop;
	}
}

// The Mauler's Torpedo -----------------------------------------------------

class MaulerTorpedo : Actor
{
	Default
	{
		Speed 20;
		Height 8;
		Radius 13;
		Damage 1;
		DamageType "Disintegrate";
		Projectile;
		+STRIFEDAMAGE
		MaxStepHeight 4;
		RenderStyle "Add";
		SeeSound "weapons/mauler2fire";
		DeathSound "weapons/mauler2hit";
		Obituary "$OB_MPMAULER";
	}

	native void A_MaulerTorpedoWave ();

	States
	{
	Spawn:
		TORP ABCD 4 Bright;
		Loop;
	Death:
		THIT AB 8 Bright;
		THIT C 8 Bright A_MaulerTorpedoWave;
		THIT DE 8 Bright;
		Stop;
	}
}


// The mini torpedoes shot by the big torpedo --------------------------------

class MaulerTorpedoWave : Actor
{
	Default
	{
		Speed 35;
		Radius 13;
		Height 13;
		Damage 10;
		DamageType "Disintegrate";
		Projectile;
		+STRIFEDAMAGE
		MaxStepHeight 4;
		RenderStyle "Add";
		Obituary "$OB_MPMAULER";
	}
	States
	{
	Spawn:
		TWAV AB 9 Bright;
	Death:
		TWAV C 9 Bright;
		Stop;
	}
}


// High-Explosive Grenade ---------------------------------------------------

class HEGrenade : Actor
{
	Default
	{
		Speed 15;
		Radius 13;
		Height 13;
		Mass 20;
		Damage 1;
		Reactiontime 30;
		Projectile;
		-NOGRAVITY
		+STRIFEDAMAGE
		+BOUNCEONACTORS
		+EXPLODEONWATER
		MaxStepHeight 4;
		BounceType "Doom";
		BounceFactor 0.5;
		BounceCount 2;
		SeeSound "weapons/hegrenadeshoot";
		DeathSound "weapons/hegrenadebang";
		Obituary "$OB_MPSTRIFEGRENADE";
	}
	States
	{
	Spawn:
		GRAP AB 3 A_Countdown;
		Loop;
	Death:
		BNG4 A 0 Bright A_NoGravity;
		BNG4 A 0 Bright A_SetTranslucent(1,1);
		BNG4 A 2 Bright A_Explode(192,192,1,1);
		BNG4 BCDEFGHIJKLMN 3 Bright;
		Stop;
	}
}

// White Phosphorous Grenade ------------------------------------------------

class PhosphorousGrenade : Actor
{
	Default
	{
		Speed 15;
		Radius 13;
		Height 13;
		Mass 20;
		Damage 1;
		Reactiontime 40;
		Projectile;
		-NOGRAVITY
		+STRIFEDAMAGE
		+BOUNCEONACTORS
		+EXPLODEONWATER
		BounceType "Doom";
		MaxStepHeight 4;
		BounceFactor 0.5;
		BounceCount 2;
		SeeSound "weapons/phgrenadeshoot";
		DeathSound "weapons/phgrenadebang";
		Obituary "$OB_MPPHOSPHOROUSGRENADE";
	}
	States
	{
	Spawn:
		GRIN AB 3 A_Countdown;
		Loop;
	Death:
		BNG3 A 2 A_SpawnItemEx("PhosphorousFire");
		Stop;
	}
}

// Fire from the Phoshorous Grenade -----------------------------------------

class PhosphorousFire : Actor native
{
	Default
	{
	Reactiontime 120;
	DamageType "Fire";
	+NOBLOCKMAP
	+FLOORCLIP
	+NOTELEPORT
	+NODAMAGETHRUST
	+DONTSPLASH
	RenderStyle "Add";
	Obituary "$OB_MPPHOSPHOROUSGRENADE";
	}

	native void A_Burnarea ();
	native void A_Burnination ();

	States
	{
	Spawn:
		BNG3 B 2 Bright A_Burnarea;
		BNG3 C 2 Bright A_Countdown;
		FLBE A 2 Bright A_Burnination;
		FLBE B 2 Bright A_Countdown;
		FLBE C 2 Bright A_Burnarea;
		FLBE D 3 Bright A_Countdown;
		FLBE E 3 Bright A_Burnarea;
		FLBE F 3 Bright A_Countdown;
		FLBE G 3 Bright A_Burnination;
		Goto Spawn+5;
	Death:
		FLBE H 2 Bright;
		FLBE I 2 Bright A_Burnination;
		FLBE JK 2 Bright;
		Stop;
	}
}

// High-Explosive Grenade Launcher ------------------------------------------

class StrifeGrenadeLauncher : StrifeWeapon
{
	Default
	{
		+FLOORCLIP
		Weapon.SelectionOrder 2400;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 12;
		Weapon.AmmoType1 "HEGrenadeRounds";
		Weapon.SisterWeapon "StrifeGrenadeLauncher2";
		Inventory.Icon "GRNDA0";
		Tag "$TAG_GLAUNCHER1";
		Inventory.PickupMessage "$TXT_GLAUNCHER";
	}

	native void A_FireGrenade (class<Actor> grenadetype, float angleofs, state flash);

	States
	{
	Spawn:
		GRND A -1;
		Stop;
	Ready:
		GREN A 1 A_WeaponReady;
		Loop;
	Deselect:
		GREN A 1 A_Lower;
		Loop;
	Select:
		GREN A 1 A_Raise;
		Loop;
	Fire:
		GREN A 5 A_FireGrenade("HEGrenade", -90, "Flash");
		GREN B 10;
		GREN A 5 A_FireGrenade("HEGrenade",  90, "Flash2");
		GREN C 10;
		GREN A 0 A_ReFire;
		Goto Ready;
	Flash:
		GREF A 5 Bright A_Light1;
		Goto LightDone;
	Flash2:
		GREF B 5 Bright A_Light2;
		Goto LightDone;
	}

}

// White Phosphorous Grenade Launcher ---------------------------------------

class StrifeGrenadeLauncher2 : StrifeGrenadeLauncher
{
	Default
	{
		Weapon.SelectionOrder 3200;
		Weapon.AmmoUse1 1;
		Weapon.AmmoGive1 0;
		Weapon.AmmoType1 "PhosphorusGrenadeRounds";
		Weapon.SisterWeapon "StrifeGrenadeLauncher";
		Tag "$TAG_GLAUNCHER2";
	}
	States
	{
	Ready:
		GREN D 1 A_WeaponReady;
		Loop;
	Deselect:
		GREN D 1 A_Lower;
		Loop;
	Select:
		GREN D 1 A_Raise;
		Loop;
	Fire:
		GREN D 5 A_FireGrenade("PhosphorousGrenade", -90, "Flash");
		GREN E 10;
		GREN D 5 A_FireGrenade("PhosphorousGrenade",  90, "Flash2");
		GREN F 10;
		GREN A 0 A_ReFire;
		Goto Ready;
	Flash:
		GREF C 5 Bright A_Light1;
		Goto LightDone;
	Flash2:
		GREF D 5 Bright A_Light2;
		Goto LightDone;
	}
}

