Files
Triforce-Source/host/oot_damage.c
ruckus7382sfgsgdf 4fa4f9188b Triforce v0.8.0
Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
2026-11-25 10:21:32 -06:00

22 lines
1.2 KiB
C

/* (Triforce) The System tab's Damage taken row: Half, Normal, Double or Quadruple of each hit on Link.
nx2/oot_patches.py (patch_damage) asks hos_oot_damage_scaled before the write of f_804bd8c0 that takes a hit off an
actor's life, and only while that says 1 and the actor is Link does it call hos_oot_damage, with his life, the life
the game was about to write and the whole hit. At Normal, the default, hos_oot_damage_scaled is 0: nothing else is
called and the game writes its own value. Healing is another write and is never scaled. The Debug tab's heart
protection comes first (its own guard keeps the life as it was, so no hit is left to scale; asked here again all the
same). oot_play.h oot_damage_life has the rule. */
#include "oot_play.h"
#include "../gpu/vk/vk_api.h"
int rx_option(int id, int otherwise);
int hos_oot_hearts_enabled(void); /* hos_main.c */
int hos_oot_damage_scaled(void) { return rx_option(HOS_OPT_DAMAGE_TAKEN, OOT_DAMAGE_NORMAL) != OOT_DAMAGE_NORMAL; }
uint32_t hos_oot_damage(uint32_t old, uint32_t next, uint32_t hit) {
if (next >= old) return next;
if (hos_oot_hearts_enabled()) return old;
return oot_damage_life(old, next, hit, rx_option(HOS_OPT_DAMAGE_TAKEN, OOT_DAMAGE_NORMAL));
}