mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 08:41:59 +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_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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue