Co-authored-by: Zozosticot <zozosticot@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Just Playing <jplay2@users.noreply.translate.codeberg.org>
Previously, only the tab icon was clickable. Clicking next to the icon would
just close the inventory.
The icon is still kept clickable too since that gives a nicer press animation.
I didn't end up using image_button because that resulted in a different image
size and position, even with the exact same coordinates.
Re-enable modifying brewed potions and homogenize slowness
potion durations with Minecraft.
* mods/HELP/mcl_tt/snippets_mcl.lua: Make use of common metric
computation functions.
* mods/HUD/mcl_inventory/creative.lua (set_inv_search):
Guarantee that potion tooltips appear for unmodified potions
also.
* mods/ITEMS/mcl_brewing/init.lua (sort_stack): Permit placing
splash and lingering potions in item stands.
* mods/ITEMS/mcl_core/craftitems.lua (eat_gapple): Enchanted
apples should grant Resistance I, not V.
* mods/ITEMS/mcl_potions/functions.lua (duration_from_details):
Respect potent_factor if provided.
* mods/ITEMS/mcl_potions/init.lua: Update comment.
* mods/ITEMS/mcl_potions/potions.lua (generate_on_use): Use
common metric computation functions.
(register_potion): Accept a `potent_factor' that overrides
POTENT_FACTOR in the context of a single potion effect. Return
"oral" potions to the `potion' group.
(slowness): Set potent_factor to 4.5, as in Minecraft.
* mods/CORE/mcl_damage/API.md: Fix errors in description of
modifier prioritization.
* mods/ENTITIES/mcl_mobs/breeding.lua (feed_tame)
(check_breathing):
* mods/ENTITIES/mcl_mobs/mod.conf: Delete references to luck.
* mods/ENTITIES/mcl_mobs/physics.lua (reset_breath): New
function.
* mods/ENTITIES/mobs_mc/shulker.lua (hit_mob): Fix typo.
* mods/HELP/mcl_tt/snippets_mcl.lua: Remove references to
stackable effects, which don't exist in Minecraft.
* mods/HELP/tt/init.lua (apply_snippets): Delete unused local
variable.
(reload_itemstack_description): Filter original description
through `def._mcl_filter_description' if it exists. Delete
special case for potions.
* mods/HUD/mcl_experience/bottle.lua (bottle, throw_xp_bottle):
* mods/HUD/mcl_experience/mod.conf: Delete references to luck.
* mods/HUD/mcl_inventory/creative.lua (set_inv_search):
Guarantee that potent and extended variants of potions appear in
search list.
* mods/HUD/mcl_inventory/mod.conf: Render tt a mandatory
dependency.
* mods/ITEMS/mcl_bows/bow.lua:
* mods/ITEMS/mcl_bows/crossbow.lua:
* mods/ITEMS/mcl_bows/mod.conf:
* mods/ITEMS/mcl_end/eye_of_ender.lua (ender_eye):
* mods/ITEMS/mcl_end/mod.conf (depends):
* mods/ITEMS/mcl_fishing/init.lua (mcl_fishing):
* mods/ITEMS/mcl_fishing/mod.conf (description): Delete
references to mcl_luck.
* mods/ITEMS/mcl_potions/API.md: Document on_reject.
* mods/ITEMS/mcl_potions/functions.lua (register_effect): Save
`on_reject' in registered definitions.
(absorption): Enable for mobs as well; implement on_reject to
set a lower bound on absorption health when an inferior effect
is discarded for a better one, but without affecting the
duration of the latter.
(fire_resistance, resistance): Enable for mobs.
(luck, bad_luck): Extricate from mcl_luck.
(level_from_details, duration_from_details): Extract some
copypasta here.
(give_effect): Call on_reject in the abovementioned scenario.
(_extinguish_nearby_fire): Rename to `_water_effect'.
Extinguish nearby burning entities and replenish breath counter
of axolotls.
* mods/ITEMS/mcl_potions/init.lua (water_splash): Delete
function.
(water): Call _water_effect on splash.
* mods/ITEMS/mcl_potions/lingering.lua (lingering_effect_at):
Rename to `lingering_effects_at'.
(potency_to_level): New function.
(add_lingering_effects): New function. Record a list of active
effects at any position to enable applying multiple effects to
one position.
(def_to_effect_list, particle_texture): New function.
(register_globalstep): Enable overriding the total lifespan of
an area effect cloud. Restore ability to extinguish nearby
fires and mobs, and adapt to the new area effect representation.
(register_lingering): Set _mcl_filter_description. Correct
invocation of obsolete function and adapt to the foregoing
changes.
* mods/ITEMS/mcl_potions/potions.lua (generate_on_use)
(register_potion): Effects do not stack in Minecraft, so remove
them from Mineclonia also. Register implementation of
_mcl_filter_description.
(filter_potion_description): New function.
* mods/ITEMS/mcl_potions/splash.lua (register_splash): Extract
some widely reused code into a common function, and register
implementation of _mcl_filter_description.
* mods/ITEMS/mcl_potions/tipped_arrow.lua (register_arrow):
Likewise.
* mods/ITEMS/mcl_totems/init.lua: Grant user Regeneration, Fire
Resistance and Absorption upon resurrection.
* mods/ITEMS/mcl_totems/mod.conf (depends): Depend on
mcl_potions.
* mods/PLAYER/mcl_criticals/init.lua:
* mods/PLAYER/mcl_criticals/mod.conf: Revert mcl_luck changes.
* mods/CORE/mcl_damage/init.lua (damage_player, heal_player)
(get_hp): New functions.
(register_on_hpchange): Do not apply modifiers to damage
inflicted by damage_player and heal_player. Otherwise, first
apply the difference to internal damage and compute the engine
hp difference from thence.
(register_on_punchplayer): Inflict punch damage by means of
damage_player.
(register_on_joinplayer): Synchronize player engine health with
internal health counter if nonexistent.
(register_on_dieplayer): Reset internal health counter.
* mods/CORE/mcl_util/init.lua (deal_damage): If dealing damage
to player, invoke mcl_damage.damage_player.
(get_hp): Return fractional health gauge if player.
* mods/ITEMS/mcl_totems/init.lua (register_modifier):
* mods/HUD/mcl_death_messages/init.lua (register_on_damage):
Derive whether damage is lethal from the fractional health gauge
rather than `obj:get_hp'.
* mods/ITEMS/mcl_armor/damage.lua (register_modifier): Do not
compute ceiling of modified damage; return the floating point
value as-is.
* mods/ITEMS/mcl_potions/functions.lua (healing_func)
(register_globalstep): Use heal_player rather than set_hp.
* mods/ITEMS/mcl_throwing/register.lua (pearl_tp):
* mods/MISC/mcl_commands/kill.lua (damage_player):
* mods/PLAYER/mcl_hunger/hunger.lua:
* mods/PLAYER/mcl_hunger/init.lua: As above.