actor Anachrony_Player : DoomPlayer
{
	// Always grunt in pain (default is 255/256); needed for the plasma gun
	PainChance 256
	// Special damage type inflicted by the souleater's cost that never causes
	// player flinching/grunting
	PainChance "leech", 0
	player.damagescreencolor "magenta", 0.25, "leech"

	// Start with the "pelter"
	player.startitem "Anachrony_Pelter"
	player.startitem "Fist"

	// Flash the screen white when affected by an exploding BFG
	player.damagescreencolor "white", 1.0, "nuclearbfg"

	// Used by plasma gun
	var int user_last_damage;
	// Used by minigun
	var int user_stood_still_for;
	// Note also that weapons reserve the right to use the player's final
	// argument (args[4]) to store values temporarily, since retrieving user
	// vars directly from weapons is impossible.

	states {
	// For the sake of the plasma gun, track the type of the last damage we
	// took.  The plasma gun will also reset this in its first frame
	Pain.Fire:
	Pain.Fireball:
	Pain.Rocket:
		TNT1 A 0 A_SetUserVar("user_last_damage", 1)
		goto Pain
	Pain.Slime:
	Pain.Slimeball:
		TNT1 A 0 A_SetUserVar("user_last_damage", 2)
		goto Pain
	// TODO this seems really unreliable, especially for cacodemons
	Pain.Electric:
	Pain.Lightning:
		TNT1 A 0 A_SetUserVar("user_last_damage", 3)
		TNT1 A 0 A_Log("electric!!")
		goto Pain
	Pain.Hitscan:
		TNT1 A 0 A_SetUserVar("user_last_damage", 4)
		goto Pain
	Pain.Ice:
		TNT1 A 0 A_SetUserVar("user_last_damage", 5)
		goto Pain
	Pain.Plasma:
		TNT1 A 0 A_SetUserVar("user_last_damage", 0)
		goto Pain
	}
}
