

//WEAPONS
class PalWaltherPPK : DoomWeapon
{
	Default
	{
		Weapon.SelectionOrder 700;
		Weapon.SlotNumber 2;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 8;
		Weapon.AmmoType "Clip";
		Obituary "%o was Killed by %k's Walther PPK.";
		+WEAPON.WIMPY_WEAPON;
		Inventory.Pickupmessage "Picked up a Walther PPK.";
	}
	States
	{
		Ready:
			COLT A 1 A_WeaponReady;
			Loop;
		Deselect:
			COLT A 1 A_Lower(6);
			Loop;
		Select:
			COLT A 1 A_Raise(6);
			Loop;
		Fire:
			COLT A 0;
			COLF A 1 A_WaltherPPKShot;
			COLF A 1 A_Light2;
			COLF A 1 A_Light1;
			COLT B 1 A_Light0;
			COLT CDE 2;
			COLT B 1 A_ReFire;
			Goto Ready;
		Flash:
			COLF A 1 Bright A_Light1;
			COLF A 1 Bright A_Light0;
			Goto LightDone;
		Spawn:
			COLP A -1;
			Stop;
	}
}

extend class PalWaltherPPK
{
    action void A_WaltherPPKShot()
    {
		A_StartSound ("WaltherPPK/Fire", CHAN_WEAPON);
		A_FireBullets(2, 2, -1, 12, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM);
		A_GunFlash();
    }
}


class PalMP40 : DoomWeapon
{
	Default
	{
		Weapon.SelectionOrder 700;
       //$Category Weapons
		Weapon.SlotNumber 4;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 20;
		Weapon.AmmoType "Clip";
		Inventory.PickupMessage "You got the MP40!";
		attacksound "MP40/Fire";
		Obituary "%o was riddled by %k's MP40.";
		Tag "MP40";
		Scale 0.5;
	}
	States
	{
	Ready:
		MP40 A 1 A_WeaponReady;
		Loop;
	Deselect:
		MP40 A 1 A_Lower(10);
		Loop;
	Select:
		MP40 A 1 A_Raise(10);
		Loop;
	Fire:
		MP40 B 2 Bright A_MP40Fire;
		MP40 D 1;
		MP40 CA 1; 
		MP40 A 1 A_ReFire;
		Goto Ready;
	Flash:
		TNT1 A 5 Bright A_Light1;
		Goto LightDone;
		TNT1 A 5 Bright A_Light1;
		Goto LightDone;
	Spawn:
		MP40 E -1;
		Stop;
	}
}

extend class PalMP40
{
	action void A_MP40Fire()
	{
		A_FireBullets(4, 3, 1, 10, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM);
		A_GunFlash();
	}
	override void PostBeginPlay()
	{
		Name NewAmmoClassName = 'TangoBulletClip';
		Class<Ammo> NewAmmoclass= NewAmmoClassName;
		if(NewAmmoClass)
		{
			AmmoType1 = NewAmmoClass;
			if(Owner)
			{
            	Ammo1 = Ammo(Owner.FindInventory(NewAmmoClass));
			}
		}
	}
}

class PalTrenchgun : DoomWeapon
{
    Default
	{
		Tag "M1897 Trenchgun";
       //$Category Weapons
		Weapon.SlotNumber 3;
		Weapon.SelectionOrder 1000;
		Weapon.SlotPriority 2;
		Weapon.AmmoType "Shell";
		Weapon.AmmoGive 8;
		Weapon.AmmoUse 1;
		Weapon.KickBack 100;
		Inventory.PickupSound "Misc/w_pkup" ;
		Obituary "%o was sent back by %k's Trenchgun.";
		Inventory.PickupMessage "Got the Trenchgun!";
		Decal "BulletChip";
	}
    States
    {
    Spawn:
        TGSP A -1;
        Loop;
    Ready:
        TGSG A 1 A_WeaponReady;
        Loop;
    Deselect:
        TGSG A 1 A_Lower(10);
        Loop;
    Select:
        TGSG A 1 A_Raise(10);
        Loop;
    Fire:
		TGSG B 1 BRIGHT A_TrenchgunShot;
        TGSG C 1 BRIGHT;
		TGSG D 2;
		TGSG D 1;
		TGSG E 2;
		TGSG F 6;
		TGSG GH 1;
		TGSG IJ 2;
		TGSG K 0 A_StartSound ("TRNCREL", CHAN_WEAPON);
		TGSG KM 2;
		TGSG NMLK 1;
		TGSG JIHG 2;
		TGSG A 2 A_Refire;
		Goto Ready;
  }
}
extend class PalTrenchgun
{
    action void A_TrenchgunShot()
    {
		A_StartSound ("TRNCFIR", CHAN_WEAPON);
		A_FireBullets(7.5,0, 8, 12, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM);
		A_GunFlash();
    }
}

class PalBoltActionRifle : DoomWeapon
{
	Default
	{
		Weapon.Slotnumber 3;
		Obituary "%o was sniped by %k.";
		Weapon.Ammotype "PalRifleBullets";
		Weapon.Ammogive 5;
		Weapon.ammouse 1;
		Decal "Bulletchip";
		Inventory.Pickupmessage "You got the Kar98k!";
		Attacksound "K98K/FIRE";
		Tag "Kar98k";
		Scale 0.75;
       //$Category Weapons
	}
	States
	{
		Ready:
			K98K A 1 A_Weaponready;
			Loop;
			
		Select:
			K98K A 1 A_Raise(10);
			Loop;
			
		Deselect:
			K98K A 1 A_Lower(10);
			Loop;
			
		Fire:
			K98K B 1 BRIGHT A_Firebullets(3,0,1,75,"PalRiflePuff",FBF_USEAMMO|FBF_NORANDOM);
			// TNT1 A 0 A_Quake(2,3,0,3);
			K98K CDEFEDCA 1;
		Bolt:
			K98K A 2;
			TNT1 A 0 A_PLAYSOUND("K98K/BOLT",CHAN_AUTO);
			K98R A 2;
			K98R B 2;
			K98R C 2;
			K98R D 2;
			K98R E 5;
			K98R D 2;
			K98R C 2;
			K98R B 2;
			K98R A 2;
			K98K A 2;
			TNT1 A 0 A_ReFire;
			Goto Ready;
		Spawn:
			K98J A -1;
			Stop;
		
	}
}

class PalRifleBullets : Ammo
{
	Default
	{
		Inventory.Amount 5;
		Inventory.MaxAmount 40;
		Inventory.Icon "MAUSB0";
		Ammo.BackpackAmount 5;
		Ammo.BackpackMaxAmount 80;
		Tag "Rifle Clip";
		Inventory.PickupMessage "Picked up a clip of Rifle Ammo!";
       //$Category Ammunition
	}
	States
	{
		Spawn:
			MAUS B -1;
			Stop;
	}
}

class PalRifleBulletbox : PalRifleBullets
{
	Default
	{
		Inventory.Amount 20;
		Tag "Rifle Ammo Box";
		Inventory.PickupMessage "Picked up a Box of Rifle Ammo!";
	}
	States
	{
		Spawn:
			MAUS A -1;
			Stop;
	}
}

class PalRiflePuff: Bulletpuff
{
	Default
	{
		+NOEXTREMEDEATH
	}
}

//ENEMIES
class PalEnemyDog : MBFHelperDog
{
	Default
	{
		Health 30;
		Tag "Nazi Hound";
       //$Category Monsters
		Species "Nazi";
		Speed 16;
		Obituary "You were mauled to death by a Nazi Hound";
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
	}
}
class PalNaziGuard : WolfensteinSS
{
	Default
	{
		Health 30;
		Radius 16;
		Height 56;
		Speed 10;
		PainChance 200;
		Monster;
		+FLOORCLIP
		SeeSound "naziguard/sight";
		PainSound "wolfss/pain";
		DeathSound "naziguard/death";
		ActiveSound "wolfss/active";
		AttackSound "WaltherPPK/Fire";
		Obituary "You were killed by a Nazi Guard.";
		Tag "Nazi Guard";
       //$Category Monsters
		Dropitem "Clip";
		Species "Nazi";
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
	}
	States
	{
	Spawn:
		NZGD AB 10 A_Look;
		Loop;
	See:
		NZGD AABBCCDD 3 A_Chase;
		Loop;
	Missile:
		NZGD E 10 A_FaceTarget;
		NZGD G 4 BRIGHT A_CPosAttack;
		NZGD F 6 A_FaceTarget;
		NZGD F 4 A_CPosRefire;
		Goto Missile+1;
	Pain:
		NZGD H 3;
		NZGD H 3 A_Pain;
		Goto See;
	Death:
		NZGD I 5;
		NZGD J 5 A_Scream;
		NZGD K 5 A_NoBlocking;
		NZGD L 5;
		NZGD M -1;
		Stop;
	Raise:
		NZGD M 5;
		NZGD LKJI 5;
		Goto See ;
	}
}
class PalNaziSoldier : PalNaziGuard
{
	Default
	{
		Tag "Nazi Soldier";
		Obituary "You were sniped by a Nazi Soldier.";
		Dropitem "PalBoltActionRifle";
		Attacksound "K98K/FIRE";
		Species "Nazi";
	}
	States
	{
	Spawn:
		NAZR AB 10 A_Look;
		Loop;
	See:
		NAZR AABBCCDD 3 A_Chase;
		NAZR A 0 A_GiveInventory("Clip",5);
		NAZR A 0 A_JumpIfInventory("Clip",0, "Reload");
		Loop;
	Missile:
		NAZR E 10 A_FaceTarget;
		NAZR E 0 A_TakeInventory("Clip",1);
		NAZR F 5 A_FaceTarget;
		NAZR G 4 BRIGHT A_CustomBulletAttack(3, 1, 1, random(1,4) * 10, "PalRiflePuff", 0, CBAF_NORANDOM);
		NAZR F 5 A_FaceTarget;
		NAZR E 35 A_NaziSoldierRefire ;
		Goto Missile+1;
	Pain:
		NAZR H 3;
		NAZR H 3 A_Pain;
		Goto See;
	Reload:
		NAZR FE 35 A_GiveInventory("Clip",5);
		Goto Missile;
	Death:
		NAZR I 5;
		NAZR J 5 A_Scream;
		NAZR K 5 A_NoBlocking;
		NAZR L 5;
		NAZR M -1;
		Stop;
	Raise:
		NAZR M 5;
		NAZR LKJI 5;
		Goto See ;
	}
}
extend class PalNaziSoldier
{
	void A_NaziSoldierRefire()
	{
		if (target)
		{
			A_CPosRefire();
			A_PlaySound("K98K/BOLT",CHAN_AUTO,0.65);
		}
	}
}
class PalWaffenSS : WolfensteinSS
{
	Default
	{
		Health 50;
		Radius 16;
		Height 56;
		Speed 8;
		PainChance 150;
		Monster;
		+FLOORCLIP
		SeeSound "wolfss/sight";
		PainSound "wolfss/pain";
		DeathSound "wolfss/death";
		ActiveSound "wolfss/active";
		AttackSound "MP40/Fire";
		Obituary "You were riddled by holes by a Waffen SS.";
		Tag "Waffen SS";
       //$Category Monsters
		Dropitem "PalMP40";
		Species "Nazi";
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
	}
	States
	{
	Spawn:
		SSWV AB 10 A_Look;
		Loop;
	See:
		SSWV AABBCCDD 3 A_Chase;
		Loop;
	Missile:
		SSWV F 10 A_FaceTarget;
		SSWV G 3 BRIGHT A_CPosAttack;
		SSWV F 3 A_FaceTarget;
		SSWV G 3 BRIGHT A_CPosAttack;
		SSWV F 1 A_CPosRefire;
		Goto Missile+1;
	Pain:
		SSWV H 3;
		SSWV H 3 A_Pain;
		Goto See;
	Death:
		SSWV I 5;
		SSWV J 5 A_Scream;
		SSWV K 5 A_NoBlocking;
		SSWV L 5;
		SSWV M -1;
		Stop;
	XDeath:
		SSWV N 5 ;
		SSWV O 5 A_XScream;
		SSWV P 5 A_NoBlocking;
		SSWV QRSTU 5;
		SSWV V -1;
		Stop;
	Raise:
		SSWV M 5;
		SSWV LKJI 5;
		Goto See ;
	}
}
class PalNaziOfficer : WolfensteinSS
{
	Default
	{
		Health 50;
		Radius 16;
		Height 56;
		Speed 10;
		PainChance 150;
		Monster;
		+FLOORCLIP
		SeeSound "naziofficer/sight";
		PainSound "wolfss/pain";
		DeathSound "naziofficer/death";
		ActiveSound "wolfss/active";
		AttackSound "WaltherPPK/Fire";
		Obituary "You were executed  by a Nazi Officer.";
		Tag "Nazi Officer";
       //$Category Monsters
		Dropitem "Clip";
		Species "Nazi";
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
	}
	States
	{
	Spawn:
		NAZO AB 10 A_Look;
		Loop;
	See:
		NAZO AABBCCDD 3 A_Chase;
		Loop;
	Missile:
		NAZO E 7 A_FaceTarget;
		NAZO G 3 BRIGHT A_CPosAttack;
		NAZO F 5 A_FaceTarget;
		NAZO F 2 A_CPosRefire;
		Goto Missile+1;
	Pain:
		NAZO H 3;
		NAZO H 3 A_Pain;
		Goto See;
	Death:
		NAZO I 5;
		NAZO J 5 A_Scream;
		NAZO K 5 A_NoBlocking;
		NAZO L 5;
		NAZO M -1;
		Stop;
	Raise:
		NAZO M 5;
		NAZO LKJI 5;
		Goto See ;
	}
}
class PalPlasmaSS : PalWaffenSS
{
	Default
	{
	   Health 75;
		PainChance 125;
		SeeSound "plasmass/sight";
		PainSound "wolfss/pain";
		DeathSound "plasmass/death"; 
		ActiveSound "wolfss/active";
		AttackSound "baby/attack";
		Obituary "You were melted by a Plasmawaffen SS.";
		Tag "Plasmawaffen SS";
       //$Category Monsters
		Dropitem "PlasmaRifle";
		Species "Nazi";
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
	}
	States
	{
		Spawn:
			SSPL AB 10 A_Look;
			Loop;
		See:
			SSPL AABBCCDD 3 A_Chase;
			Loop;
		Missile:
			SSPL E 5 A_FaceTarget;
			SSPL G 4 BRIGHT A_PlasmaSSAttack;
			SSPL F 4 BRIGHT;
			SSPL F 5 A_CPosRefire;
			Goto Missile+1;
		Pain:
			SSPL H 3;
			SSPL H 3 A_Pain;
			Goto See;
		Death:
			SSPL I 5;
			SSPL J 5 A_Scream;
			SSPL K 5 A_NoBlocking;
			SSPL L 5;
			SSPL M -1;
			Stop;
		XDeath:
			SSPL N 5 ;
			SSPL O 5 A_XScream;
			SSPL P 5 A_NoBlocking;
			SSPL QRSTU 5;
			SSPL V -1;
			Stop;
		Raise:
			SSPL M 5;
			SSPL LKJI 5;
			Goto See ;
	}
}

extend class PalPlasmaSS
{
	void A_PlasmaSSAttack()
	{
		if (target)
		{
			A_FaceTarget();
			SpawnMissile(target, "ArachnotronPlasma");
		}
	}
}

//FOOD
class PalW3DFood : Health
{
    Default
    {
		Tag "Hot Meal";
       //$Category Health and Armor
        Inventory.Amount 10;
        Inventory.PickupMessage "You ate a Hot Meal.";
        Health.LowMessage 25, "You ate some nutritious food that will keep you alive!";
    }
    States
    {
        Spawn:
            W3FD A -1;
            Stop;
    }
}

class PalW3DDogFood: Health
{
    Default
    {
        Tag "Dog Food";
        //$Category Health and Armor
        +COUNTITEM;
        Inventory.Amount 5;
        Inventory.PickupMessage "Ate some dog food." ;
    }
    States
    {
        Spawn:
            W3DF A -11;
            Loop;
    }
}

//DECORATION
class PalW3DPotTree : TorchTree
{
    Default
    {
        Tag "Potted Tree (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3PG A -1;
            Stop;
    }
}
class PalW3DPotPlant : TorchTree
{
    Default
    {
        Tag "Potted Plant (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3PB A -1;
            Stop;
    }
}
class PalW3DPotAlone: TorchTree
{
    Default
    {
        Tag "Blue Pot (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3PS A -1;
            Stop;
    }
}
class PalW3DWoodBarrel : TorchTree
{
    Default
    {
        Tag "Wooden Barrel (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3WB A -1;
            Stop;
    }
}
class PalW3DArmorDeco : TorchTree
{
    Default
    {
        Tag "Decorative Armor (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3AR A -1;
            Stop;
    }
}
class PalW3DNaziFlag : TorchTree
{
    Default
    {
        Tag "Nazi Flag (Wolf3D)";
       //$Category Decoration
    }
    States{
        Spawn:
            W3FL A -1;
            Stop;
    }
}

class PalW3DHangingSkelton :   Meat2
{    
    Default
    {
        Tag "Hanging Skeleton (Wolf3D)";
       //$Category Decoration
        Height 64;
    }
    States
    {
        Spawn:
            SKLC A -1;
            Stop;
    }
}
class PalW3DCage :   Meat2
{
    Default
    {
        Tag "Hanging Cage (Wolf3D)";
       //$Category Decoration
        Height 64;
    }
    States
    {
        Spawn:
            W3CG A -1;
            Stop;
    }
}
class PalW3DCage2 :   Meat2
{
    Default
    {
        Tag "Hanging Cage with Skeleton (Wolf3D)";
       //$Category Decoration
        Height 64;
    }
    States
    {
        Spawn:
            W3CS A -1;
            Stop;
    }
}

class PalW3DChandelier :   Actor
{    
    Default
    {
        Tag "Chandelier (Wolf3D)";
        //$Category Light sources
        Radius 26;
        Height 19;
		+SOLID
		+NOGRAVITY
		+SPAWNCEILING
    }
    States
    {
        Spawn:
            W3CH A -1;
            Stop;
    }
}

class PalW3DSkeletonFloor  :   DeadMarine
{
    Default
    {
        Tag "Skeleton (Wolf3D)";
       //$Category Decoration
    }
    States
    {
        Spawn:
            SKLF A -1;
            Stop;
    }
}

class PalW3DBonePile  :   DeadMarine
{
    Default
    {
        Tag "Bone Pile (Wolf3D)";
       //$Category Decoration
    }
    States
    {
        Spawn:
            SKLP A -1;
            Stop;
    }
}


//DEAD BAD GUYS
class PalW3DDeadDog :  Actor
{
    Default
    {
        Tag "Dead Nazi Hound";
       //$Category Decoration
    }
	States
	{
        Spawn:
            DOGS N -1;
	}
}

class PalW3DDeadNaziGuard : Actor
{
	Default
	{
		Tag "Dead Nazi Guard";
       //$Category Decoration
    }
	States
	{
        Spawn:
            NZGD M -1;
	}
}
class PalW3DDeadWaffenSS : Actor
{
	Default
	{
		Tag "Dead Waffen SS";
       //$Category Decoration
    }
	States
	{
        Spawn:
            SSWV M -1;
	}
}

class PalW3DDeadPlasmaSS : Actor
{
	Default
	{
		Tag "Dead Plasmawaffen SS";
       //$Category Decoration
    }
	States
	{
        Spawn:
            SSPL M -1;
	}
}

class PalW3DDeadNaziOfficer : Actor
{
	Default
	{
		Tag "Dead Nazi Officer";
       //$Category Decoration
    }
	States
	{
        Spawn:
            NAZO M -1;
	}
}