mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +00:00
- Added IfInvulnerable SBARINFO command (modified from Blue-Shadow's pull request)
This commit is contained in:
parent
81f29556bf
commit
42edd7db22
1 changed files with 20 additions and 0 deletions
|
@ -3424,6 +3424,23 @@ class CommandIfHealth : public SBarInfoNegatableFlowControl
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class CommandIfInvulnerable : public SBarInfoNegatableFlowControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CommandIfInvulnerable(SBarInfo *script) : SBarInfoNegatableFlowControl(script)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tick(const SBarInfoMainBlock *block, const DSBarInfo *statusBar, bool hudChanged)
|
||||||
|
{
|
||||||
|
SBarInfoNegatableFlowControl::Tick(block, statusBar, hudChanged);
|
||||||
|
|
||||||
|
SetTruth((statusBar->CPlayer->mo->flags2 & MF2_INVULNERABLE) || (statusBar->CPlayer->cheats & (CF_GODMODE | CF_GODMODE2)), block, statusBar);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static const char *SBarInfoCommandNames[] =
|
static const char *SBarInfoCommandNames[] =
|
||||||
{
|
{
|
||||||
"drawimage", "drawnumber", "drawswitchableimage",
|
"drawimage", "drawnumber", "drawswitchableimage",
|
||||||
|
@ -3434,6 +3451,7 @@ static const char *SBarInfoCommandNames[] =
|
||||||
"isselected", "usesammo", "usessecondaryammo",
|
"isselected", "usesammo", "usessecondaryammo",
|
||||||
"hasweaponpiece", "inventorybarnotvisible",
|
"hasweaponpiece", "inventorybarnotvisible",
|
||||||
"weaponammo", "ininventory", "alpha", "ifhealth",
|
"weaponammo", "ininventory", "alpha", "ifhealth",
|
||||||
|
"ifinvulnerable",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3447,6 +3465,7 @@ enum SBarInfoCommands
|
||||||
SBARINFO_ISSELECTED, SBARINFO_USESAMMO, SBARINFO_USESSECONDARYAMMO,
|
SBARINFO_ISSELECTED, SBARINFO_USESAMMO, SBARINFO_USESSECONDARYAMMO,
|
||||||
SBARINFO_HASWEAPONPIECE, SBARINFO_INVENTORYBARNOTVISIBLE,
|
SBARINFO_HASWEAPONPIECE, SBARINFO_INVENTORYBARNOTVISIBLE,
|
||||||
SBARINFO_WEAPONAMMO, SBARINFO_ININVENTORY, SBARINFO_ALPHA, SBARINFO_IFHEALTH,
|
SBARINFO_WEAPONAMMO, SBARINFO_ININVENTORY, SBARINFO_ALPHA, SBARINFO_IFHEALTH,
|
||||||
|
SBARINFO_IFINVULNERABLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
SBarInfoCommand *SBarInfoCommandFlowControl::NextCommand(FScanner &sc)
|
SBarInfoCommand *SBarInfoCommandFlowControl::NextCommand(FScanner &sc)
|
||||||
|
@ -3480,6 +3499,7 @@ SBarInfoCommand *SBarInfoCommandFlowControl::NextCommand(FScanner &sc)
|
||||||
case SBARINFO_ININVENTORY: return new CommandInInventory(script);
|
case SBARINFO_ININVENTORY: return new CommandInInventory(script);
|
||||||
case SBARINFO_ALPHA: return new CommandAlpha(script);
|
case SBARINFO_ALPHA: return new CommandAlpha(script);
|
||||||
case SBARINFO_IFHEALTH: return new CommandIfHealth(script);
|
case SBARINFO_IFHEALTH: return new CommandIfHealth(script);
|
||||||
|
case SBARINFO_IFINVULNERABLE: return new CommandIfInvulnerable(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc.ScriptError("Unknown command '%s'.\n", sc.String);
|
sc.ScriptError("Unknown command '%s'.\n", sc.String);
|
||||||
|
|
Loading…
Reference in a new issue