//Affliction item.
class BleedItem : CustomInventory
{
	Default
	{
		Inventory.Amount 0;
		Inventory.PickupMessage "If it bleeds...";
		Inventory.PickupSound "";
		Inventory.PickupFlash "None";
		+INVENTORY.ALWAYSPICKUP
		+INVENTORY.AUTOACTIVATE
		+INVENTORY.NOSCREENFLASH
	}
	
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("IfItBleeds");
		Stop;
	}
}

class IfItBleeds : PowerupGiver
{
	Default
	{
		Powerup.Duration -6;
		Powerup.Type "PowerIsBleeding";
		Powerup.Color "None", 0.0;
		Inventory.PickupMessage "...we can kill it.";
		+INVENTORY.AUTOACTIVATE
		+INVENTORY.ALWAYSPICKUP
		+INVENTORY.ADDITIVETIME
	}
}

class PowerIsBleeding : Powerup
{
}

class BleedIndicator : Actor
{
	Default
	{
		Obituary "%o couldn't staunch the flow.";
		Damagetype "Manuel2"; //So it won't like, you know... RECURRSIVE BLEEDING!
		+NOINTERACTION
		+NOCLIP
		//+FORCERADIUSDMG
		+MISSILE
	}
	
	int User_Radius;
	int User_Height;
	
	States
	{
	Spawn:
		TNT1 A random(35,45) NoDelay {
			A_Warp(AAPTR_TARGET,0,0,0,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE);
			A_DamageTarget((15),"Manuel2"); //A_Explode((15),8,1,0,8);
			A_GiveInventory("BloodLetter",1,AAPTR_TARGET); // Has to be an inventory item, so A_SpawnItemEx acknowledges SXF_USEBLOODCOLOR. YholleCrime(tm)(c)!
		}
		TNT1 A 0 A_JumpIf(CountInv("PowerIsBleeding",AAPTR_TARGET),"Spawn");
		Stop;
	}
}

class BloodLetter : CustomInventory
{
	Default
	{
		Inventory.MaxAmount 0;
		+INVENTORY.AUTOACTIVATE
		+INVENTORY.ALWAYSPICKUP
	}
	
	States
	{
	Use:
		TNT1 A 0 A_SpawnItemEx("Blood",0,0,30,0,0,0,0,SXF_CLIENTSIDE|SXF_USEBLOODCOLOR,64);
		Stop;
	}
}