- added a HealthFactor skill property.

This commit is contained in:
Christoph Oelckers 2015-11-29 12:58:17 +01:00
parent 106886a9bb
commit f7cdb28eac
3 changed files with 12 additions and 1 deletions

View file

@ -563,6 +563,7 @@ enum ESkillProperty
SKILLP_FriendlyHealth,
SKILLP_NoPain,
SKILLP_ArmorFactor,
SKILLP_HealthFactor,
SKILLP_EasyKey,
SKILLP_SlowMonsters,
SKILLP_Infight,
@ -605,6 +606,7 @@ struct FSkillInfo
bool NoPain;
int Infighting;
fixed_t ArmorFactor;
fixed_t HealthFactor;
FSkillInfo() {}
FSkillInfo(const FSkillInfo &other)

View file

@ -236,10 +236,12 @@ bool P_GiveBody (AActor *actor, int num, int max)
return true;
}
}
else
else if (num > 0)
{
if (player->health < max)
{
num = FixedMul(num, G_SkillProperty(SKILLP_HealthFactor));
if (num < 1) num = 1;
player->health += num;
if (player->health > max)
{

View file

@ -84,6 +84,7 @@ void FMapInfoParser::ParseSkill ()
skill.NoPain = false;
skill.ArmorFactor = FRACUNIT;
skill.Infighting = 0;
skill.HealthFactor = FRACUNIT;
sc.MustGetString();
skill.Name = sc.String;
@ -267,6 +268,12 @@ void FMapInfoParser::ParseSkill ()
sc.MustGetFloat();
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
}
else if (sc.Compare("HealthFactor"))
{
ParseAssign();
sc.MustGetFloat();
skill.HealthFactor = FLOAT2FIXED(sc.Float);
}
else if (sc.Compare("NoInfighting"))
{
skill.Infighting = LEVEL2_NOINFIGHTING;