mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-21 11:21:04 +00:00
- the UDMF health key for actors was not correctly implemented. This addresses the problem by adding a second one and documenting 'Health' as implemented.
- fixed: Several ZDoom-exclusive actor keys did not check the current namespace.
This commit is contained in:
parent
0514a997db
commit
e4e023e59a
3 changed files with 19 additions and 2 deletions
|
@ -263,8 +263,8 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
||||||
gravity = <float>; // Set per-actor gravity. Positive values are multiplied with the class's property,
|
gravity = <float>; // Set per-actor gravity. Positive values are multiplied with the class's property,
|
||||||
// negative values are used as their absolute. Default = 1.0.
|
// negative values are used as their absolute. Default = 1.0.
|
||||||
|
|
||||||
health = <int>; // Set per-actor health. Positive values are multiplied with the class's property,
|
health = <int>; // Set per-actor health as an absolute value. Default = actor default.
|
||||||
// negative values are used as their absolute. Default = 1.
|
healthfactor = <float>; // Set per-actor health as a factor to the original. Default = 1.
|
||||||
|
|
||||||
renderstyle = <string>; // Set per-actor render style, overriding the class default. Possible values can be "normal",
|
renderstyle = <string>; // Set per-actor render style, overriding the class default. Possible values can be "normal",
|
||||||
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
|
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
|
||||||
|
|
|
@ -46,6 +46,7 @@ xx(Shadow)
|
||||||
xx(Subtract)
|
xx(Subtract)
|
||||||
xx(Subtractive)
|
xx(Subtractive)
|
||||||
xx(FillColor)
|
xx(FillColor)
|
||||||
|
xx(HealthFactor)
|
||||||
|
|
||||||
// Healingradius types
|
// Healingradius types
|
||||||
xx(Mana)
|
xx(Mana)
|
||||||
|
|
|
@ -515,6 +515,7 @@ public:
|
||||||
FString arg0str, arg1str;
|
FString arg0str, arg1str;
|
||||||
|
|
||||||
memset(th, 0, sizeof(*th));
|
memset(th, 0, sizeof(*th));
|
||||||
|
double healthfactor = 1;
|
||||||
th->Gravity = 1;
|
th->Gravity = 1;
|
||||||
th->RenderStyle = STYLE_Count;
|
th->RenderStyle = STYLE_Count;
|
||||||
th->Alpha = -1;
|
th->Alpha = -1;
|
||||||
|
@ -738,38 +739,52 @@ public:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Alpha:
|
case NAME_Alpha:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->Alpha = CheckFloat(key);
|
th->Alpha = CheckFloat(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_FillColor:
|
case NAME_FillColor:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->fillcolor = CheckInt(key);
|
th->fillcolor = CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Health:
|
case NAME_Health:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->health = CheckInt(key);
|
th->health = CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NAME_HealthFactor:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
|
healthfactor = CheckFloat(key);
|
||||||
|
break;
|
||||||
|
|
||||||
case NAME_Score:
|
case NAME_Score:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->score = CheckInt(key);
|
th->score = CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Pitch:
|
case NAME_Pitch:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->pitch = (short)CheckInt(key);
|
th->pitch = (short)CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Roll:
|
case NAME_Roll:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->roll = (short)CheckInt(key);
|
th->roll = (short)CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_ScaleX:
|
case NAME_ScaleX:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->Scale.X = CheckFloat(key);
|
th->Scale.X = CheckFloat(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_ScaleY:
|
case NAME_ScaleY:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->Scale.Y = CheckFloat(key);
|
th->Scale.Y = CheckFloat(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Scale:
|
case NAME_Scale:
|
||||||
|
CHECK_N(Zd | Zdt)
|
||||||
th->Scale.X = th->Scale.Y = CheckFloat(key);
|
th->Scale.X = th->Scale.Y = CheckFloat(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -793,6 +808,7 @@ public:
|
||||||
{
|
{
|
||||||
th->args[1] = -FName(arg1str);
|
th->args[1] = -FName(arg1str);
|
||||||
}
|
}
|
||||||
|
th->health = int(th->health * healthfactor);
|
||||||
// Thing specials are only valid in namespaces with Hexen-type specials
|
// Thing specials are only valid in namespaces with Hexen-type specials
|
||||||
// and in ZDoomTranslated - which will use the translator on them.
|
// and in ZDoomTranslated - which will use the translator on them.
|
||||||
if (namespc == NAME_ZDoomTranslated)
|
if (namespc == NAME_ZDoomTranslated)
|
||||||
|
|
Loading…
Reference in a new issue