mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
- added a HealthFactor skill property.
This commit is contained in:
parent
106886a9bb
commit
f7cdb28eac
3 changed files with 12 additions and 1 deletions
|
@ -563,6 +563,7 @@ enum ESkillProperty
|
||||||
SKILLP_FriendlyHealth,
|
SKILLP_FriendlyHealth,
|
||||||
SKILLP_NoPain,
|
SKILLP_NoPain,
|
||||||
SKILLP_ArmorFactor,
|
SKILLP_ArmorFactor,
|
||||||
|
SKILLP_HealthFactor,
|
||||||
SKILLP_EasyKey,
|
SKILLP_EasyKey,
|
||||||
SKILLP_SlowMonsters,
|
SKILLP_SlowMonsters,
|
||||||
SKILLP_Infight,
|
SKILLP_Infight,
|
||||||
|
@ -605,6 +606,7 @@ struct FSkillInfo
|
||||||
bool NoPain;
|
bool NoPain;
|
||||||
int Infighting;
|
int Infighting;
|
||||||
fixed_t ArmorFactor;
|
fixed_t ArmorFactor;
|
||||||
|
fixed_t HealthFactor;
|
||||||
|
|
||||||
FSkillInfo() {}
|
FSkillInfo() {}
|
||||||
FSkillInfo(const FSkillInfo &other)
|
FSkillInfo(const FSkillInfo &other)
|
||||||
|
|
|
@ -236,10 +236,12 @@ bool P_GiveBody (AActor *actor, int num, int max)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (num > 0)
|
||||||
{
|
{
|
||||||
if (player->health < max)
|
if (player->health < max)
|
||||||
{
|
{
|
||||||
|
num = FixedMul(num, G_SkillProperty(SKILLP_HealthFactor));
|
||||||
|
if (num < 1) num = 1;
|
||||||
player->health += num;
|
player->health += num;
|
||||||
if (player->health > max)
|
if (player->health > max)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,6 +84,7 @@ void FMapInfoParser::ParseSkill ()
|
||||||
skill.NoPain = false;
|
skill.NoPain = false;
|
||||||
skill.ArmorFactor = FRACUNIT;
|
skill.ArmorFactor = FRACUNIT;
|
||||||
skill.Infighting = 0;
|
skill.Infighting = 0;
|
||||||
|
skill.HealthFactor = FRACUNIT;
|
||||||
|
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
skill.Name = sc.String;
|
skill.Name = sc.String;
|
||||||
|
@ -267,6 +268,12 @@ void FMapInfoParser::ParseSkill ()
|
||||||
sc.MustGetFloat();
|
sc.MustGetFloat();
|
||||||
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
|
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("HealthFactor"))
|
||||||
|
{
|
||||||
|
ParseAssign();
|
||||||
|
sc.MustGetFloat();
|
||||||
|
skill.HealthFactor = FLOAT2FIXED(sc.Float);
|
||||||
|
}
|
||||||
else if (sc.Compare("NoInfighting"))
|
else if (sc.Compare("NoInfighting"))
|
||||||
{
|
{
|
||||||
skill.Infighting = LEVEL2_NOINFIGHTING;
|
skill.Infighting = LEVEL2_NOINFIGHTING;
|
||||||
|
|
Loading…
Reference in a new issue