I'm not sure if you can define some kind of default armor but if not, it should be doable with a simple script:
Code: Select all
{
HEALTHATTRIBUTE [health]
ARMORATTRIBUTE [armor]
HEALTHDAMAGE [50.0]
ARMORDAMAGE [20.0]
tmp_health [0]
tmp_damage [0]
Spawn[ ()
{
LowLevel("setup");
} ]
setup[ ()
{
PawnRender(false);
tmp_health = GetAttribute(HEALTHATTRIBUTE,"Player");
think = "run";
} ]
run[ ()
{
ThinkTime = 0;
if((GetAttribute(HEALTHATTRIBUTE,"Player") < tmp_health) and (GetAttribute(ARMORATTRIBUTE,"Player") > 0))
{
tmp_damage = tmp_health - GetAttribute(HEALTHATTRIBUTE,"Player");
ModifyAttribute(HEALTHATTRIBUTE,tmp_damage*(100-HEALTHDAMAGE)/100,"Player");
ModifyAttribute(ARMORATTRIBUTE,-tmp_damage*ARMORDAMAGE/100,"Player");
}
if(GetAttribute(HEALTHATTRIBUTE,"Player") != tmp_health)
{
tmp_health = GetAttribute(HEALTHATTRIBUTE,"Player");
}
} ]
}
HEALTHATTRIBUTE and ARMORATTRIBUTE are pretty obvious, I think. HEALTHDAMAGE and ARMORDAMAGE are the factors for the damage taken by health and armor. 100 = full damage and 0 = no damage. So for example:
Code: Select all
HEALTHDAMAGE [50.0]
ARMORDAMAGE [20.0]
Means that if you have armor, the damage your health takes is 50% of original damage while the armor takes 20% of the damage. So if you take 50 damage in total, your health will take 25 damage and armor 10 damage. Setting both to 0 would make you invulnerable and 100 would make your armor useless as you're taking full damage with or without armor.
***EDIT***
Note: This script won't reduce damage if it's greater than your current health. So if you have 20 health and you receive 50 damage you're going to die, no matter what. That's because the script heals the player after the damage is dealt.
Pain is only psychological.