// --------------------------------------------------------------------------
//
//	Tokens
//
// --------------------------------------------------------------------------

ACTOR FireSeq : Inventory { inventory.maxamount 2 }
ACTOR WeapSpecial : Inventory { inventory.maxamount 1 }
ACTOR MonsterHaveSeenPlayer : Inventory { Inventory.MaxAmount 1 }
ACTOR ChainsawCrueltyBonus : Inventory { Inventory.MaxAmount 150 }
ACTOR IdleCounter : Inventory { inventory.maxamount 200 }
ACTOR DummyToken : Inventory { inventory.maxamount 999 }
ACTOR PlayerIsABot : Inventory { inventory.maxamount 1 }
ACTOR BD21graphics : Inventory { inventory.maxamount 1 }
ACTOR IsShakin : Inventory { inventory.maxamount 1 }
ACTOR ShakeMore : Inventory { inventory.maxamount 1 }
ACTOR WasFiring : Inventory { inventory.maxamount 1 }
ACTOR SmokeToken : Inventory { inventory.maxamount 10 }
ACTOR MinigunTurbo : Inventory { inventory.maxamount 1 }


// --------------------------------------------------------------------------
//
//	Captured Marines
//
// --------------------------------------------------------------------------

ACTOR U_MarineMinigun: Marine_Minigun Replaces Marine_Minigun
{
	DropItem "U_MiniGun"
}
//ACTOR U_MarineRifle: Marine_Rifle Replaces Marine_Rifle
//{
//	DropItem "RifleDrop"
//}
ACTOR U_MarineShotgun: Marine_Shotgun Replaces Marine_Shotgun
{
	DropItem "ShotgunDrop"
}
ACTOR U_MarinePlasmaRifle: Marine_PlasmaGun Replaces Marine_PlasmaGun
{
	DropItem "U_PlasmaRifle"
}
ACTOR U_MarineRocket: Marine_Rocket Replaces Marine_Rocket
{
	DropItem "U_RocketLauncher"
}
ACTOR U_MarineBFG: Marine_BFG Replaces Marine_BFG
{
	DropItem "U_BFG9000"
}


// --------------------------------------------------------------------------
//
//	Other random stuffs
//
// --------------------------------------------------------------------------

ACTOR SpawnShot2 replaces SpawnShot
{
	Radius 6
	Height 32
	Speed 10
	Damage 3
	Projectile
	+NOCLIP
	-ACTIVATEPCROSS
	+RANDOMIZE
	SeeSound "brain/spit"
	DeathSound "brain/cubeboom"
	States
	{
	Spawn:
		ORBB A 2 BRIGHT A_SpawnSound
		ORBB BCDEF 2 BRIGHT
		Loop
	}
}

ACTOR U_DetectCeilBrain replaces DetectCeilBrain
{
	game Doom
	scale 0.4
	speed 0
	health 1
	radius 2
	height 2
	Gravity 0.0
	damage 0
	Renderstyle Translucent
	Alpha 0.95
	DamageType Blood
	+MISSILE
	+CLIENTSIDEONLY
	+NOTELEPORT
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+NODAMAGETHRUST
	-DONTSPLASH
	+NOGRAVITY
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,35,0,1)
		XDB5 A 1
		TNT1 A 0 A_SpawnItem("SmearingBrain")
		Stop
	Death:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("SmallBrainPiece", -15, 0, 90, 2, 90)
		Stop
	}
}

actor U_SawBlood : Blood Replaces SawBlood
{
	Decal BrutalBloodSplat
	game Doom
	+FORCEXYBILLBOARD
	+GHOST
	+NOBLOCKMAP
	+NOGRAVITY
	+NOCLIP
	-DONTSPLASH
	-ALLOWPARTICLES 
	MONSTER
	-FRIENDLY
	+NOTARGET
	-COUNTKILL
	Speed 0
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1 A_Look
	See:		
		TNT1 A 0 Radius_Quake (4, 4, 0, 2, 0)
		TNT1 A 0 A_PlaySOund("misc/xdeath4", 1)
		TNT1 A 0 A_GiveToTarget("PowerBloodOnVisor", 1)
		TNT1 A 0 A_GiveToTarget("ChainsawCrueltyBonus", 4)
		TNT1 A 0 A_CustomMissile ("BloodMist", 0, 0, random (0, 360), 2, random (30, 90))
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 1 A_Chase("Melee","Melee")
		Stop
	Melee:	
		TNT1 A 0 A_GiveToTarget("BloodSplasherz", 1)
		TNT1 A 10
		stop
	Splash:
		BLOD A 0
		TNT1 AAA 0 A_CustomMissile ("Underblood1", 7, 0, random (0, 360), 2, random (30, 150))
		stop
	}
}

ACTOR U_ExplosiveBarrel : ExplosiveBarrel1 Replaces ExplosiveBarrel
{
	Game Doom
    damagefactor "Trample", 0.0
    damagefactor "Kick", 0.1
	damagefactor "LowKick", 0.1
    damagefactor "Melee", 0.1
	damagefactor "Extremepunches", 0.1
	damagefactor "Fatality", 10.1
	damagefactor "SuperPunch", 10.1
	damagefactor "ExplosiveImpact", 0.4
	damagefactor "Fire", 3.5
	damagefactor "GibRemoving", 0.0
	damagefactor "BHFTOnBarrel", 500.0
	damagefactor "Blood", 0.0
	damagefactor "BlueBlood", 0.0
	damagefactor "GreenBlood", 0.0
	damagefactor "Avoid", 0.0
    damagefactor "Shrapnel", 0.0
	damagefactor "KillMe", 0.0
	damagefactor "TeleportRemover", 0.0
//	Species "Marines"
	Health 20
	Radius 10
	Height 34
    Mass 200
	DamageType ExplosiveImpact
	+SOLID
	+SHOOTABLE
	+NOBLOOD
	+ACTIVATEMCROSS
	+NOICEDEATH
    +PUSHABLE
	+SLIDESONWALLS
    +WINDTHRUST
    +TELESTOMP
	+NOBLOCKMONST
	+FLOORCLIP
	+FRIENDLY
	+MISSILEMORE
	+MISSILEEVENMORE
	+EXTREMEDEATH
	MONSTER
	-COUNTKILL
	Speed 0
	MaxTargetRange 200
	DamageFactor "BHFT", 10.0
	Painchance "Blood", 255
	PainChance "Kick", 255
	DeathSound "Explosion"
	Obituary "$OB_BARREL"
	PainChance "DontCallTheBaron", 255
	Painchance 255
}


// --------------------------------------------------------------------------
//
//	Dead stuff
//
// --------------------------------------------------------------------------

ACTOR New_DeadCacodemon : DeadCacodemon replaces DeadCacodemon
{
	Radius 0
	Height 0
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
	Spawn1:
		TNT1 AAAAAA 0 A_CustomMissile ("Blue_FlyingBlood", 15, 0, random (150, 210), 2, random (10, 70))
		TNT1 A 0 A_SpawnItem ("DeadCacoDemon4", 1)
		Stop
	Spawn2:
		TNT1 AAAAAA 0 A_CustomMissile ("Blue_FlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("DeadCacoDemon3", 1)
		Stop
	Spawn3:
		TNT1 AAAAAA 0 A_CustomMissile ("Blue_FlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("U_DeadCacoDemon2", 1)
		Stop
	Spawn4:
		TNT1 AAAAAA 0 A_CustomMissile ("Blue_FlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("DeadCacoDemon1", 1)
		Stop
	}
}

Actor U_VeryDeadMarine: DeadMarine Replaces DeadMarine
{
	damagefactor "Avoid", 0.0
	damagefactor "Blood", 0.0
	damagefactor "GreenBlood", 0.0
	damagefactor "BlueBlood", 0.0
	damagefactor "Taunt", 0.0
	damagefactor "KillMe", 0.0
	damagefactor "Shrapnel", 100.0
	damagefactor "GibRemoving", 990.0
	+CLIENTSIDEONLY
	+FLOORCLIP
	Radius 0
	Game Doom
	States
	{
    Spawn:
		TNT1 A 0
		TNT1 AAAAA 0 A_CustomMissile ("SuperWallRedBlood", 10, 0, random (0, 360), 2, random (5, 40))
		TNT1 AAAAAA 0 A_SpawnItemEx("Brutal_BloodSpot",random(64, -64),random(64, -64))
		TNT1 A 1 A_SpawnItem("MediumBloodSpot")

		TNT1 A 0 A_Jump(128,"Spawn2")									//50% chance to skip to next corpse.
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1001,1)==0, "Spawn2")	//Is pistol updated?
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1042)==1, "Spawn2")		//Only spawn one thing per level.
		//Drop pistol
		TNT1 A 0 A_JumpIfInventory("Beretta", 1, 3, AAPTR_PLAYER1)
		TNT1 A 0 A_SpawnItem("Beretta",40)
		TNT1 A 0 A_Jump(256,"Spawn2")
		//Drop flashlight
		TNT1 A 0 A_JumpIfInventory("PistolFlashlight", 1, 3, AAPTR_PLAYER1)
		TNT1 A 0 A_SpawnItem("PistolFlashlight",40)
		TNT1 A 0 A_Jump(256,"Spawn2")
		//Drop silencer
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo", 1, 2, AAPTR_PLAYER1)
		TNT1 A 0 A_SpawnItem("PistolSilencer",40)
		
	Spawn2:
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
		TNT1 A 1 A_SpawnItem("CurbstompedMarine")
		Stop
		TNT1 A 1 A_SpawnItem("AteMarine")
		Stop
		TNT1 A 1 A_SpawnItem("DeadRippedOffMarine")
		Stop
		TNT1 A 1 A_SpawnItem("FuckedMarine")
		Stop
		TNT1 A 1 A_SpawnItem("ADoomedSpaceMarine")
		Stop
		TNT1 A 1 A_SpawnItem("ADoomedSpaceMarine2")
		Stop
	}
}

ACTOR U_HangingDeadGuyNoLeg: HangingDeadGuyNoLeg Replaces Meat3
{
	damagefactor "Fire", 0.1
}

// The following are temporary disabled

ACTOR U_DeadHangNoGuts
{
	Radius 20
	Height 90
	Health 100
	Mass 999999
	+SOLID
	+NOGRAVITY
	+SPAWNCEILING
	+SHOOTABLE
    GibHealth 10
	DropItem "U_HealthBonus" 128
	DropItem "U_HealthBonus" 128
	DropItem "U_ArmorBonus" 128
	DropItem "U_ArmorBonus" 128
    damagefactor "Blood", 0.0
	damagefactor "GreenBlood", 0.0
	damagefactor "BlueBlood", 0.0
	damagefactor "Taunt", 0.0
	damagefactor "KillMe", 0.0
	damagefactor "Avoid", 0.0
	damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	States
	{
    Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB1 A 15
		Goto Stand
	Stand:
		HDB1 A 90
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
    Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR U_DeadHangBNoBrain
{
	Radius 16
	Height 88
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB2 A 30
		Goto Stand
	Stand:
		HDB2 A 95
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
    Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR U_DeadHangTLookingDown
{
	Radius 16
	Height 64
	Health 50
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB3 A 20
		Goto Stand
	Stand:
		HDB3 A 100
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
	Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	 }
}

ACTOR U_DeadHangTLookingUp
{
	Radius 16
	Height 64
	Health 50
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB5 A 20
		Goto Stand
	Stand:
		HDB5 A 110
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
	Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR U_DeadHangTSkull
{
	Radius 16
	Height 64
	Health 30
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB4 A 20
		Goto Stand
	Stand:
		HDB4 A 120
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
	Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR U_DeadHangTNoBrain
{
	Radius 16
	Height 64
	Health 50
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		HDB6 A 50
		Goto Stand
	Stand:
		HDB6 A 130
		TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
		loop
	Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile ("HalfManDeath", 0, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}