//
//enemy
// 

/* The Red Men */
class Tarman : Actor
{	
	Default
	{
		Health 150;
		Radius 20;
		Height 56;
		Mass 100;
		Speed 8;
		PainChance 200;
		Monster;
		+FLOORCLIP
		+INVULNERABLE
		SeeSound "tarman/rise";
		PainSound "tarman/hurt";
		DeathSound "tarman/Die";
		ActiveSound "tarman/see";
		HitObituary "%o joined the red men.";
		Obituary "was %o turned into red ichor.";
		Tag "$DD_TARMAN";

	}	
	States
	{
	Spawn:
		TNT1 A 1 A_Look;
		Loop;
	See:
		TNT1 A 1;
		TRMN OP 8;
		TRMN QQQRRRSSSTTUU 3;
		TRMN A 1 A_UnSetInvulnerable;
		TRMN A 2;
		Goto Chase;
	Chase:
	TRMN AABBCCDD 3 A_Chase;
	Loop;
	Melee:
	Missile:
		TRMN EF 8 A_FaceTarget;
		TRMN G 6 A_CustomComboAttack("TarmanBall", 32, 3 * random(1, 8), "imp/melee");
		Goto Chase;
	Pain:
		TRMN H 2;
		TRMN H 2 A_Pain;
		Goto Chase;
	Death:
		TRMN I 8;
		TRMN J 8 A_Scream;
		TRMN K 6;
		TRMN L 6 A_NoBlocking;
		TRMN M -1;
		Stop;
	Raise:
		TRMN MLKJI 8;
		TRMN H 2;
		TRMN A 2;
		TNT1 A 0 A_UnSetInvulnerable;
		Goto Chase;
	}
}

class TarmanBall: Actor
{
	Default
	{
		Radius 6;
		Height 8;
		Speed 15;
		FastSpeed 20;
		Damage 3;
		Projectile;
		+RANDOMIZE
		+ZDOOMTRANS
		RenderStyle "Add";
		Alpha 1;
		SeeSound "tarmanprojectile/throw";
		DeathSound "tarmanprojectile/hit";
		Decal "BloodSplat";
	}
	
	States
	{
	Spawn:
	REDB ABCDE 4 BRIGHT;
	Loop;
	 Death:
	BAL1 CDE 6 BRIGHT;
	Stop;
	}

 }

/*Dreamden Chaingunners Only Give A Box of Ammo Due to the MP5 */
class  AutoRifleGuy: ChaingunGuy
{
	Default
	{
		Health 70;
		Radius 20;
		Height 56;
		Mass 100;
		Speed 8;
		PainChance 170;
		Monster;
		+FLOORCLIP
		SeeSound "chainguy/sight";
		PainSound "chainguy/pain";
		DeathSound "chainguy/death";
		ActiveSound "chainguy/active";
		AttackSound "Dreamden/ChaingunnerAtk";
		Obituary "$OB_CHAINGUY";
		Tag "$DD_HEAVY";
		Dropitem "ClipBox";
	}
	States
	{
	Spawn:
		DACG AB 10 A_Look;
		Loop;
	See:
		DACG AABBCCDD 3 A_Chase;
		Loop;
	Missile:
		DACG E 10 A_FaceTarget;
		DACG FE 4 BRIGHT A_CPosAttack;
		DACG F 1 A_CPosRefire;
		Goto Missile+1;
	Pain:
		DACG G 3;
		DACG G 3 A_Pain;
		Goto See;
	Death:
		DACG H 5;
		DACG I 5 A_Scream;
		DACG J 5 A_NoBlocking;
		DACG KLM 5;
		DACG N -1;
		Stop;
	XDeath:
		DACG O 5;
		DACG P 5 A_XScream;
		DACG Q 5 A_NoBlocking;
		DACG RS 5;
		DACG T -1;
		Stop;
	Raise:
		DACG N 5;
		DACG MLKJIH 5;
		Goto See;
	}
} 
  
//
// KEYs
//

Class DataChip1 : Key
{
	Default
	{
		Inventory.PickupMessage "Picked up The Data Chip.";
		Inventory.PickupSound "Dreamden/DataChip1/Pickup";
		inventory.icon "STDAT0";
		+FLOORCLIP
	}
	states
		{
		Spawn:
		DC1P A	-1;
		loop;
		}
}

//Machinegun

Class DreamDenMachinegun : Weapon
{
	Default
	{
    +FLOORCLIP

	Weapon.SlotNumber 4;
	Weapon.SelectionOrder 700;
	Weapon.AmmoUse 1;
	Weapon.AmmoGive 50;
	Weapon.AmmoType "Clip";
    Inventory.PickupSound "Misc/w_pkup";
    Inventory.PickupMessage "Picked up a Machinegun";
	Obituary "%O was swatted by %k with an Machinegun";
	}
    States
    {
    Ready:
        DDMG A 1 A_WeaponReady;
        Loop;
    Deselect:
        DDMG A 1 A_Lower;
        Loop;
    Select:
        DDMG A 1 A_Raise;
        Loop;
    Fire:
	    DDMG A 0;
		NULL A 0 A_GunFlash;
        DDMG A 0 A_StartSound("dreamden/weapon/machinegun",CHAN_WEAPON);
		DDMG A 0 A_FireBullets(1.3, 1.3, 1, 10, "BulletPuff", FBF_USEAMMO|FBF_NORANDOM);
        DDMG BC 1;
		DDMG A 0 A_ReFire;
		Goto Ready;
	Flash:
		DDMG B 1 bright A_Light1;
		DDMG C 1 bright A_Light2;
		stop;
	Spawn:
        DMGW A -1;
        Loop;
	}
}

class EvaReferenceDecoration : Actor
{
Default
	{
		radius 22;
		height 53;
		+SOLID
	}
  States
  {
  Spawn:
    ASUK A -1;
    Stop;
  }
}