// *****************************************************************************
// Monster adjustments

// Fix the blood color of a few monsters
actor GreenHellKnight : HellKnight replaces HellKnight
{
	BloodColor "green"
}

actor GreenBaronOfHell : BaronOfHell replaces BaronOfHell
{
	BloodColor "green"
}

// This also makes the cacodemon splat to the ground when it dies
// From: http://zdoom.org/wiki/Improving_original_monsters_with_DECORATE
actor BlueCacodemon : Cacodemon replaces Cacodemon
{
	BloodColor "blue"
	states {
	Death:
		HEAD G 4 A_SetSolid
		HEAD G 4 A_SetShootable
		HEAD H 8 A_Scream
		HEAD H -1
		stop
	Crash:
		HEAD I 4 A_PlaySound ("*fist") //I had no better sound, so feel free to use another.
		HEAD J 4
		HEAD K 2 A_NoBlocking
		HEAD K 1 A_UnsetSolid
		HEAD K 1 A_UnSetShootable
		HEAD L -1 A_SetFloorClip
		stop
	Raise:
		HEAD L 8 A_UnSetFloorClip
		HEAD KJIHG 8
		goto See
	}
}

// Assign damage types to various attacks
ACTOR SlimyBaronBall : BaronBall replaces BaronBall
{
	DamageType slimeball
	Alpha 0.9
}


// *****************************************************************************
// Custom powerups

// Make a double sphere that also makes the player /take/ double damage
// Extends what's given in DoubleDamage.wad
ACTOR PowerHalfProtection : PowerProtection
{
	DamageFactor "normal", 2
}

ACTOR HalfProtectionGiver : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type PowerHalfProtection
	Powerup.Duration -30
	Powerup.Color RedMap
}

ACTOR DoubleDamageGiver : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	Inventory.MaxAmount 0
	Powerup.Type DoubleDamage
	Powerup.Color RedMap
	Powerup.Duration -30
}

ACTOR DoomSphere : CustomInventory 13301
{
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Inventory.PickupMessage "Double Damage!"
	// Copied from PowerupGiver
	+INVENTORY.FANCYPICKUPSOUND
	Inventory.PickupSound "misc/p_pkup"
	
	states {
	Spawn:
		DDMG ABC 6 Bright
		loop
	Pickup:
		DDMG A 0 A_GiveInventory("DoubleDamageGiver", 1)
		DDMG A 0 A_GiveInventory("HalfProtectionGiver", 1)
		stop
	}
}

// Radiation suit that only protects against...  radiation.
ACTOR TrueRadiationProtection : PowerProtection
{
	DamageFactor "slime", 0
	DamageFactor "slimeball", 0.5
	Powerup.Duration -60
	Powerup.ColorMap 0.0, 1.0, 0.0
}

ACTOR TrueRadiationSuit : RadSuit 13307
{
	Powerup.Type TrueRadiationProtection
}



// *****************************************************************************
// Special effects

// Dead monsters that are still genuine monsters.
// Note that these cannot be raised by an Archvile; they're designed ONLY to be
// resurrected from a script or special, using Thing_Activate.
ACTOR RaisableDeadZombieMan : ZombieMan 13302
{
	+DORMANT
	-SOLID
	states {
	Spawn:
		// First frame's pointer is ignored.  Anyway, this is the one that the
		// corpse gets stuck on while it's dormant.
		POSS L 1
		// Since we're not using Thing_Raise, we have to play this manually.
		POSS L 0 A_PlaySound("vile/raise", CHAN_BODY, 1.0, false, ATTN_IDLE)
		// Need to explicitly set ourselves re-blocking, since we're not using
		// Thing_Raise to do so ourselves.
		POSS L 0 A_SetSolid
		// Then play the raise animation as soon as we're activated!
		goto Raise
	// Need this state explicitly, else a monster that loses its target will
	// appear to resurrect itself??
	Idle:
		goto super::Spawn
	}
}

ACTOR RaisableDeadShotgunGuy : ShotgunGuy 13303
{
	+DORMANT
	-SOLID
	states {
	Spawn:
		SPOS L 1
		SPOS L 0 A_PlaySound("vile/raise", CHAN_BODY, 1.0, false, ATTN_IDLE)
		SPOS L 0 A_SetSolid
		goto Raise
	Idle:
		goto super::Spawn
	}
}

ACTOR RaisableDeadDoomImp : DoomImp 13304
{
	+DORMANT
	-SOLID
	states {
	Spawn:
		TROO M 1
		TROO M 0 A_PlaySound("vile/raise", CHAN_BODY, 1.0, false, ATTN_IDLE)
		TROO M 0 A_SetSolid
		goto Raise
	Idle:
		goto super::Spawn
	}
}

ACTOR RaisableDeadDemon : Demon 13305
{
	+DORMANT
	-SOLID
	states {
	Spawn:
		SARG N 1
		SARG N 0 A_PlaySound("vile/raise", CHAN_BODY, 1.0, false, ATTN_IDLE)
		SARG N 0 A_SetSolid
		goto Raise
	Idle:
		goto super::Spawn
	}
}

ACTOR RaisableDeadHellKnight : HellKnight 13306
{
	+DORMANT
	-SOLID
	states {
	Spawn:
		BOS2 O 1
		BOS2 O 0 A_PlaySound("vile/raise", CHAN_BODY, 1.0, false, ATTN_IDLE)
		BOS2 O 0 A_SetSolid
		// Hell Knight has a noticeable delay at the start of its raise
		// animation, which I would like to skip
		goto Raise + 2
	Idle:
		goto super::Spawn
	}
}

// *****************************************************************************
// Allow missiles to teleport
// This is basically just for the sake of slipgates.

actor TeleportingRocket : Rocket replaces Rocket
{
	-NOTELEPORT
}
