Changed Stats::UpdateHPStat() to update the current HP as well

Updated German translation file.
This commit is contained in:
NovaRain
2022-05-11 21:55:50 +08:00
parent 51035958a3
commit 7057e044d0
4 changed files with 22 additions and 16 deletions
+2
View File
@@ -16,6 +16,8 @@ PartyOrderAttackHuman=Ich k
PartyOrderAttackCreature=::Grrrr::
PartyOrderAttackRobot=::Piep::
HiResInfo=Diese Version von Sfall verfügt über einen integrierten High Resolution Patch-Modus, der mit den Einstellungen des Hi-Res-Patch von Mash kompatibel ist.\n\nWenn der Hi-Res Patch von Mash weiterhin verwenden soll, deaktiviere die 'HiResMode'-Option in der ddraw.ini.\nUm die Grafikverbesserungen von Sfall zu erhalten, muss der originale Hi-Res-Patch deaktiviert werden.\n\nSoll der Hi-Res-Patch von Mash deaktiviert werden?
[AppearanceMod]
RaceText=Geschlecht
StyleText=Stil
+1 -1
View File
@@ -1114,7 +1114,7 @@ void Interface::init() {
HookCall(0x44C018, gmouse_handle_event_hook); // replaces hack function from HRP by Mash
if (HRP::Setting::VersionIsValid) HRP::IFaceBar::IFACE_BAR_MODE = (GetIntHRPValue(HRP_VAR_IFACE_BAR_MODE) != 0);
// Fix crash when the player equips a weapon that is overloaded with ammo
// Fix crash when the player equips a weapon overloaded with ammo (ammo bar overflow)
MakeCall(0x45F94F, intface_update_ammo_lights_hack);
}
+1 -1
View File
@@ -98,7 +98,7 @@ pickNewID: // skip PM range (18000 - 83535)
}
}
// Reassigns object IDs to all critters upon first loading a map and updates their max HP stat
// Reassigns object IDs to all critters upon first loading a map and updates their HP stats
// TODO: for items?
static void map_fix_critter_id() {
long npcStartID = 4096; // 0x1000
+7 -3
View File
@@ -188,11 +188,10 @@ static void __declspec(naked) stat_recalc_derived_hack() {
}
void Stats::UpdateHPStat(fo::GameObject* critter) {
if (engineDerivedStats) return;
fo::Proto* proto;
if (fo::func::proto_ptr(critter->protoId, &proto) == -1) return;
if (!engineDerivedStats) {
auto getStatFunc = (derivedHPwBonus) ? fo::func::stat_level : fo::func::stat_get_base;
double sum = 0;
@@ -207,7 +206,12 @@ void Stats::UpdateHPStat(fo::GameObject* critter) {
critter->protoId, critter->id, proto->critter.base.health, calcStatValue);
proto->critter.base.health = calcStatValue;
critter->critter.health = calcStatValue + proto->critter.bonus.health;
}
}
// set the current HP to match the maximum HP stat for non-party member critters
if (!fo::util::IsPartyMember(critter)) { // prevent free healing for party members when entering random encounter maps
critter->critter.health = proto->critter.base.health + proto->critter.bonus.health;
}
}