luanti-org/luanti

Settings and player parameters to control damage flash and tilt

Offen

#15.805 geöffnet am 18.02.2025

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (2.395 Forks)auto 404
@ Client / Audiovisuals@ Script APIConcept approvedFeature requestSSCSMgood first issue

Repository-Metriken

Stars
 (13.341 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 13T 22h) (48 gemergte PRs in 30 T)

Beschreibung

Problem

The engine has a hardcoded red flash and slight camera tilt whenever the player takes damage. Not all games need this, so it should be possible to disable it, and some might want to change the color of the flash, the tilt angle, etc. Also, some players might find the flash or tilt disorienting and so the client should be able to override or disable them from the settings for accessibility purposes.

Solutions

player:set_damage_effects() method along with a getter, using a table like so:

{
    enable_flash = true,
    flash_color = "#RRGGBBAA",
    enable_tilt = true,
    tilt_angle = ... -- not sure the best representation, probably a vector for rotation around each axis with the values being a multiplier for the calculated tilt strength
}

And equivalent settings, such as hurt_flash_enabled, hurt_flash_color (just the RGB components?), hurt_flash_strength?, hurt_tilt_enabled, hurt_tilt_strength...

Alternatives

Just the player parameters, or just the settings

Contributor Guide