14576 Commits

Author SHA1 Message Date
Po Lu
29827dce84
Display effect particles by means of particle spawners
* mods/ENTITIES/mcl_mobs/api.lua (get_staticdata): Clear effect
particle spawner ID before serialization.

* mods/ITEMS/mcl_potions/functions.lua (add_spawner): New
function.
(_add_spawner): Delete obsolete function.
(register_globalstep, _reset_effects, _save_player_effects)
(_clear_effects): Create particle spawners just once and clear
them prior to serialization.
2024-09-02 14:36:08 +02:00
Po Lu
142f6a90a9
Ominous bottles should vanish upon consumption
* mods/ITEMS/mcl_potions/functions.lua (_use_potion): Remove
unused parameter.
(generate_on_use): New parameter `vanish'.  If set, do not
replace the consumed potion with a glass bottle.
(register_potion): New parameter `vanishing'.

* mods/ITEMS/mcl_potions/potions.lua (ominous): Specify
`vanishing'.
2024-09-02 14:36:08 +02:00
Po Lu
ca3ed84f29
Witch and raid corrections
* mods/ENTITIES/mobs_mc/witch.lua (hit_node): Add a
`potion_splash_flying' rather than an old style entity.  Not
that this does much of anything.

* mods/ENVIRONMENT/mcl_raids/init.lua (on_complete): Verify that
the player exists and apply effects to objects not usernames.

* mods/ITEMS/mcl_potions/functions.lua (hero_of_village): Effect
color is 44FF44, not 006D2A.

* mods/ITEMS/mcl_potions/potions.lua (register_potion): Enable
overriding the entire description of the potion.
(ominous_bottle): Don't mark as dur_variable.
2024-09-02 14:36:08 +02:00
Po Lu
deb6511dac
; Trivial Luacheck alert 2024-09-02 14:36:08 +02:00
Po Lu
a696701be0
Slowness, Golden Apple and brewing fixes
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.
2024-09-02 14:36:08 +02:00
Po Lu
6a0b936146
Enable Fire Resistance and Water Breathing for mobs
* mods/ENTITIES/mcl_mobs/api.lua (get_staticdata): Verify that
_mcl_potions is non-nil before attempting to access it.

* mods/ENTITIES/mcl_mobs/init.lua (register_mob): Don't define
_mcl_potions as an empty table in the class defaults to
guarantee that each mob receives an table independent of any
others.

* mods/ENTITIES/mcl_mobs/physics.lua (do_env_damage): Correctly
attribute fire damage to its sources.

* mods/ITEMS/mcl_potions/functions.lua (water_breating): Apply
to mobs as well.  Verify that _mcl_potions is non-nil before
attempting to access it.

* mods/ITEMS/mcl_potions/splash.lua (register_splash):
Whitespace.
2024-09-02 14:36:08 +02:00
Po Lu
3d62781658
; Further remove mcl_luck 2024-09-02 14:36:08 +02:00
Po Lu
cfacca730b
; Delete mcl_luck 2024-09-02 14:36:08 +02:00
Po Lu
0d37b177c0
Remove luck and further adapt to mcla and 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.
2024-09-02 14:36:08 +02:00
Po Lu
af50658cde
Shulker arrows should inflict Levitation
* mods/ENTITIES/mobs_mc/shulker.lua (hit_player, hit_mob):
Inflict Levitation I for 10 seconds.
2024-09-02 14:36:07 +02:00
Po Lu
16dfd5f78a
Assign icons to Invisibility and correct dispenser action
* mods/ITEMS/mcl_potions/functions.lua (invisiblity): Assign
mcl_potions_effect_invisible.png.

* mods/ITEMS/mcl_potions/lingering.lua:

* mods/ITEMS/mcl_potions/splash.lua: Correct name of item
parameter.
2024-09-02 14:36:07 +02:00
cora
e8ce1834a1
Fix acess of undefined variables 2024-09-02 14:36:07 +02:00
Po Lu
8fcd1f2149
Fix crash applying instant health-like effects to mobs
* mods/ITEMS/mcl_potions/functions.lua: Read max_hp from object
properties, not luaentity.
2024-09-02 14:36:07 +02:00
Po Lu
703238c543
; Restore hud_elem_type_field functions.lua:
* mods/ITEMS/mcl_potions/functions.lua: Restore
hud_elem_type_field.
2024-09-02 14:36:07 +02:00
Po Lu
64566171ae
Beacons are not WIP any longer
* mods/ITEMS/mcl_beacons/init.lua (effect_symbols, effect_names):
Delete variables supplanted by mcl_potions globals.
(upgrade_effect_level_button): Load effect names from
mcl_potions.registered_effects.
(generate_beacon_formspec): Add Haste and Resistance.
(apply_beacon_formspec): Likewise.

* mods/ITEMS/mcl_potions/functions.lua: Assign swiftness a
specific icon.
2024-09-02 14:36:07 +02:00
the-real-herowl
7262b1983d
Effect loading fixes (#4425)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4425
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-09-02 14:36:07 +02:00
the-real-herowl
5705a1c394
Potion conversion fix (#4426)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4426
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-09-02 14:36:07 +02:00
Po Lu
7d45c51c8c
; Update files for Emacs
* .dir-locals.el: New file.

* .gitignore: Ignore VC temporary checkouts.
2024-09-02 14:36:07 +02:00
Po Lu
a3bdf5ec2f
Enable Absorption HUD
* mods/ITEMS/mcl_potions/functions.lua: Adapt to Mineclonia.
2024-09-02 14:36:07 +02:00
Po Lu
3303c427d6
Assign an icon to hunger
* mods/ITEMS/mcl_potions/functions.lua: Assign
`mcl_potions_effect_food_poisoning'.
2024-09-02 14:36:07 +02:00
Po Lu
172a96854e
; Restore deleted texture 2024-09-02 14:36:07 +02:00
Po Lu
b076ee14bc
; * mods/items/mcl_potions/API.md: Adjust API.md 2024-09-02 14:36:07 +02:00
Po Lu
7dc36f02ba
Conclude merge
* mods/CORE/mcl_util/init.lua (converter): New variable.
(mcl_util.to_roman): Move roman numeral conversion routine
to mcl_util.

* mods/ENTITIES/mcl_mobs/combat.lua (mob_class:on_punch):
Restore code overwritten during merge.

* mods/ENTITIES/mobs_mc/guardian_elder.lua: Remove redundant
statements.

* mods/ENVIRONMENT/mcl_raids/init.lua (mcl_raids): Remove
references to fireworks.

* mods/ITEMS/mcl_beacons/init.lua (effect_player): Port to new
effect framework.
(apply_effects_to_all_players): Establish that a secondary
effect exists before providing it to effect_player.
(apply_beacon_formspec): Delete redundant statement.

* mods/ITEMS/mcl_enchanting/groupcaps.lua (update_groupcaps):
New parameter IGNORE_HASH; used by Haste and Mining Fatigue
implementations.  All callers changed.

* mods/ITEMS/mcl_enchanting/init.lua (mcl_enchanting): Remove
roman numeral converter.

* mods/ITEMS/mcl_fishing/items.lua (eat_pufferfish): Adapt to
names of parameters renamed in Mineclonia.

* mods/ITEMS/mcl_mobitems/init.lua (drink_milk): Call
_reset_effects, not _reset_player_effects.

* mods/ITEMS/mcl_potions/commands.lua (get_chat_function): Delete
unused variable.
(effect): Delete redundant initializer.

* mods/ITEMS/mcl_potions/functions.lua
(generate_rational_lvl_to_frac): Fix math.
(regeneration, strength, weakness, swiftness, slowness)
(fire_resistance): Explicitly specify icons whose names cannot
be derived from those of the effects.
(blindness, nausea): Disable FOV modification for the time
being.
(hf_update_internal, update_haste_and_fatigue)
(_reset_haste_fatigue_item_meta): Guarantee that tool
capabilities are reset properly to their standard values.
(_load_player_effects): Correct typos.
(clear_effect, _reset_effects): Remove effects from
item_speed_effects also.
(give_effect): Fix typo.

* mods/ITEMS/mcl_potions/init.lua (awkward_table, thick_table)
(inversion_table): Delete numerous recipes absent from
Minecraft.

* mods/ITEMS/mcl_potions/lingering.lua (register_lingering): Typos.

* mods/ITEMS/mcl_potions/potions.lua (time_string, perc_string)
(return_on_use): Delete obsolete functions.
(generate_on_use): Provide itemstack to _use_potion.
(trolling, levitation, darkness, glowing, health_boost)
(absorption, resistance, blindness, nausea, food_poisoning)
(saturation, haste, fatigue): Delete numerous potions absent
from Minecraft.
(turtle_master, withering): Rename descriptions to agree with
Minecraft.

* mods/ITEMS/mcl_potions/splash.lua (register_splash): Delete
redundant statement.

* mods/ITEMS/mcl_potions/tipped_arrow.lua (arrow_image): Restore
ommitted function.
(register_arrow): Remove redundant statements; return to
deriving bespoke ARROW_ENTITIES from the original.  Set potency
and plus to 0.

* mods/ITEMS/mcl_sus_stew/init.lua (mcl_sus_stew)
(registered_stews, item_effects, register_stew): Delete unused
variables and functions.
(get_random_effect, eat_stew): Port properly from VL.

* mods/PLAYER/mcl_hunger/init.lua (mcl_hunger): Use hunger in
place of food_poisoning.

* mods/PLAYER/mcl_hunger/hunger.lua (mcl_hunger): Remove
reference to variable and option absent from Mineclonia.
2024-09-02 14:36:07 +02:00
the-real-herowl
fbca4f7dd9
Added a darkness potion recipe 2024-09-02 14:36:07 +02:00
the-real-herowl
d3f7a089fb
Improved compat alias visual 2024-09-02 14:36:07 +02:00
the-real-herowl
f6bf80284e
Legacy potion conversion extended 2024-09-02 14:36:07 +02:00
the-real-herowl
df086bef2a
Legacy potions converter 2024-09-02 14:36:07 +02:00
the-real-herowl
8ff3f546e5
Guardian fixes 2024-09-02 14:36:07 +02:00
the-real-herowl
5524c87d88
Add more sus stew effects 2024-09-02 14:36:07 +02:00
the-real-herowl
35703f809c
Migrated mobs to the new effects API 2024-09-02 14:36:07 +02:00
the-real-herowl
7e5a9903c6
Move most of the game to the new API 2024-09-02 14:36:07 +02:00
the-real-herowl
fecb34b750
Documentation update 2024-09-02 14:36:07 +02:00
the-real-herowl
d20cae6158
Added effect stacking option to the potions API
Also:
* Frost and Food Poisoning potion now stack their effects
* fixed a crash related to tipped arrows
2024-09-02 14:36:07 +02:00
the-real-herowl
1ae40104ca
Added on_save_effect support for mobs 2024-09-02 14:36:06 +02:00
the-real-herowl
04bf91c825
Fixed effects still being handled after mob death 2024-09-02 14:36:06 +02:00
the-real-herowl
7831d05b52
Effects persist on loads for mobs too 2024-09-02 14:36:06 +02:00
the-real-herowl
dab4c63071
Remove unused function in mcl_hunger 2024-09-02 14:36:06 +02:00
the-real-herowl
bd5a493004
Added some potion recipes
Also:
* changed the duration of saturation and food poisoning potions
* minor code changes
2024-09-02 14:36:06 +02:00
the-real-herowl
e87f21a6f5
Added the ominous potion 2024-09-02 14:36:06 +02:00
the-real-herowl
dc1aa1aa03
Improved API mob support
* various API functions now work with mobs properly
* the following effects don't work with mobs at all:
  water breathing, dolphin's grace, leaping, swiftness,
  slowness, slow falling, night vision, darkness, frost,
  health boost, absorption, fire resistance, resistance,
  luck, bad luck, blindness, nausea, hunger, saturation,
  haste, fatigue, conduit power
* the following effects should work with mobs:
  invisibility, regeneration, poison, withering,
  strength, weakness, levitation, glowing
* the following effects have no effect on mobs
  (but can be applied with the API):
  bad omen, hero of the village
2024-09-02 14:36:06 +02:00
the-real-herowl
41e7a421ff
Allowed infinite effect duration 2024-09-02 14:36:06 +02:00
the-real-herowl
4704ee0568
Added the option to remove and clear effects...
...with the /effect command.
Also made the API for clearing effects more robust.
2024-09-02 14:36:06 +02:00
the-real-herowl
31bc527484
Allowed giving effect without particles
...both with API and the /effect command
2024-09-02 14:36:06 +02:00
the-real-herowl
9350754879
Typos fixed 2024-09-02 14:36:06 +02:00
the-real-herowl
e44f6c7f43
Tooltip and color fixes 2024-09-02 14:36:06 +02:00
the-real-herowl
f4031e7d2d
Expanded brewing recipe API
Added recipes using thick or mundane potion
2024-09-02 14:36:06 +02:00
the-real-herowl
9cb0b925f6
Added potions for new effects
* also added some new brewing recipes
2024-09-02 14:36:06 +02:00
the-real-herowl
eacee6ff56
Added strength and weakness potions
Also fixed potent slowness potion level
Also fixed slowness and swiftness effect descriptions
2024-09-02 14:36:06 +02:00
the-real-herowl
bc01f700f3
New brewing recipes registering API
Also migrated all recipes to the new system
2024-09-02 14:36:06 +02:00
the-real-herowl
03d4a8fac8
Brewing fully works with the new system 2024-09-02 14:36:06 +02:00