Allow for Basic and Hexen armor replacing
This commit is contained in:
parent
5fa220219e
commit
0d43272c8f
21 changed files with 56 additions and 34 deletions
|
|
@ -436,7 +436,7 @@ static bool DoSubstitution (FString &out, const char *in)
|
|||
{
|
||||
if (strnicmp(a, "armor", 5) == 0)
|
||||
{
|
||||
auto armor = player->mo->FindInventory(NAME_BasicArmor);
|
||||
auto armor = player->mo->FindInventory(NAME_BasicArmor, true);
|
||||
out.AppendFormat("%d", armor != NULL ? armor->IntVar(NAME_Amount) : 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1036,7 +1036,7 @@ public:
|
|||
ammocount2 = ammo2 != nullptr ? ammo2->IntVar(NAME_Amount) : 0;
|
||||
|
||||
//prepare ammo counts
|
||||
armor = CPlayer->mo->FindInventory(NAME_BasicArmor);
|
||||
armor = CPlayer->mo->FindInventory(NAME_BasicArmor, true);
|
||||
}
|
||||
|
||||
void _Draw (EHudState state)
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
|
|||
{
|
||||
int armorType = type - HEXENARMOR_ARMOR;
|
||||
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor);
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor, true);
|
||||
if (harmor != NULL)
|
||||
{
|
||||
double *Slots = (double*)harmor->ScriptVar(NAME_Slots, nullptr);
|
||||
|
|
@ -596,7 +596,7 @@ class CommandDrawSwitchableImage : public CommandDrawImage
|
|||
}
|
||||
else if(condition == ARMORTYPE)
|
||||
{
|
||||
auto armor = statusBar->CPlayer->mo->FindInventory(NAME_BasicArmor);
|
||||
auto armor = statusBar->CPlayer->mo->FindInventory(NAME_BasicArmor, true);
|
||||
if(armor != NULL)
|
||||
{
|
||||
auto n = armor->NameVar(NAME_ArmorType).GetIndex();
|
||||
|
|
@ -1413,7 +1413,7 @@ class CommandDrawNumber : public CommandDrawString
|
|||
case SAVEPERCENT:
|
||||
{
|
||||
double add = 0;
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor);
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor, true);
|
||||
if(harmor != NULL)
|
||||
{
|
||||
double *Slots = (double*)harmor->ScriptVar(NAME_Slots, nullptr);
|
||||
|
|
@ -2775,7 +2775,7 @@ class CommandDrawBar : public SBarInfoCommand
|
|||
case SAVEPERCENT:
|
||||
{
|
||||
double add = 0;
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor);
|
||||
auto harmor = statusBar->CPlayer->mo->FindInventory(NAME_HexenArmor, true);
|
||||
if (harmor != NULL)
|
||||
{
|
||||
double *Slots = (double*)harmor->ScriptVar(NAME_Slots, nullptr);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, backpacktype)
|
|||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, Armor2Percent)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, ArmorIcon1)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, ArmorIcon2)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, BasicArmorClass)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, HexenArmorClass)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, gametype)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, norandomplayerclass)
|
||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, infoPages)
|
||||
|
|
@ -392,6 +394,8 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_SOUNDARRAY(PrecachedSounds, "precachesounds", 0, false)
|
||||
GAMEINFOKEY_STRINGARRAY(EventHandlers, "addeventhandlers", 0, false)
|
||||
GAMEINFOKEY_STRINGARRAY(EventHandlers, "eventhandlers", 0, false)
|
||||
GAMEINFOKEY_STRING(BasicArmorClass, "BasicArmorClass")
|
||||
GAMEINFOKEY_STRING(HexenArmorClass, "HexenArmorClass")
|
||||
GAMEINFOKEY_STRING(PauseSign, "pausesign")
|
||||
GAMEINFOKEY_STRING(quitSound, "quitSound")
|
||||
GAMEINFOKEY_STRING(BorderFlat, "borderFlat")
|
||||
|
|
|
|||
|
|
@ -148,6 +148,8 @@ struct gameinfo_t
|
|||
FString SkyFlatName;
|
||||
FString ArmorIcon1;
|
||||
FString ArmorIcon2;
|
||||
FName BasicArmorClass;
|
||||
FName HexenArmorClass;
|
||||
FString PauseSign;
|
||||
FString Endoom;
|
||||
double Armor2Percent;
|
||||
|
|
|
|||
|
|
@ -5506,7 +5506,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args, int &
|
|||
else
|
||||
{
|
||||
FName p(Level->Behaviors.LookupString(args[0]));
|
||||
auto armor = Level->Players[args[1]]->mo->FindInventory(NAME_BasicArmor);
|
||||
auto armor = Level->Players[args[1]]->mo->FindInventory(NAME_BasicArmor, true);
|
||||
if (armor && armor->NameVar(NAME_ArmorType) == p) return armor->IntVar(NAME_Amount);
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -5517,7 +5517,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args, int &
|
|||
{
|
||||
if (activator == NULL || activator->player == NULL) return 0;
|
||||
|
||||
auto equippedarmor = activator->FindInventory(NAME_BasicArmor);
|
||||
auto equippedarmor = activator->FindInventory(NAME_BasicArmor, true);
|
||||
|
||||
if (equippedarmor && equippedarmor->IntVar(NAME_Amount) != 0)
|
||||
{
|
||||
|
|
@ -8898,7 +8898,7 @@ scriptwait:
|
|||
case PCD_PLAYERARMORPOINTS:
|
||||
if (activator)
|
||||
{
|
||||
auto armor = activator->FindInventory(NAME_BasicArmor);
|
||||
auto armor = activator->FindInventory(NAME_BasicArmor, true);
|
||||
PushToStack (armor ? armor->IntVar(NAME_Amount) : 0);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue