mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Changed Stats::UpdateHPStat() to update the current HP as well
Updated German translation file.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+18
-14
@@ -188,26 +188,30 @@ 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;
|
||||
|
||||
auto getStatFunc = (derivedHPwBonus) ? fo::func::stat_level : fo::func::stat_get_base;
|
||||
if (!engineDerivedStats) {
|
||||
auto getStatFunc = (derivedHPwBonus) ? fo::func::stat_level : fo::func::stat_get_base;
|
||||
|
||||
double sum = 0;
|
||||
for (int stat = fo::Stat::STAT_st; stat <= fo::Stat::STAT_lu; stat++) {
|
||||
sum += (getStatFunc(critter, stat) + statFormulas[fo::Stat::STAT_max_hit_points].shift[stat]) * statFormulas[fo::Stat::STAT_max_hit_points].multi[stat];
|
||||
double sum = 0;
|
||||
for (int stat = fo::Stat::STAT_st; stat <= fo::Stat::STAT_lu; stat++) {
|
||||
sum += (getStatFunc(critter, stat) + statFormulas[fo::Stat::STAT_max_hit_points].shift[stat]) * statFormulas[fo::Stat::STAT_max_hit_points].multi[stat];
|
||||
}
|
||||
long calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].base + (int)floor(sum);
|
||||
if (calcStatValue < statFormulas[fo::Stat::STAT_max_hit_points].min) calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].min;
|
||||
|
||||
if (proto->critter.base.health != calcStatValue) {
|
||||
fo::func::debug_printf("\nWarning: critter PID: %d, ID: %d, has an incorrect base value of the max HP stat: %d (must be %d)",
|
||||
critter->protoId, critter->id, proto->critter.base.health, calcStatValue);
|
||||
|
||||
proto->critter.base.health = calcStatValue;
|
||||
}
|
||||
}
|
||||
long calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].base + (int)floor(sum);
|
||||
if (calcStatValue < statFormulas[fo::Stat::STAT_max_hit_points].min) calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].min;
|
||||
|
||||
if (proto->critter.base.health != calcStatValue) {
|
||||
fo::func::debug_printf("\nWarning: critter PID: %d, ID: %d, has an incorrect base value of the max HP stat: %d (must be %d)",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user