Soul speed works on soul soil too

(needs localization)
This commit is contained in:
seventeenthShulker 2024-08-18 18:59:57 +02:00 committed by the-real-herowl
parent b239549774
commit 79e8452f62
2 changed files with 10 additions and 5 deletions

View File

@ -691,7 +691,7 @@ mcl_enchanting.enchantments.soul_speed = {
disallow = {non_combat_armor = true},
incompatible = {frost_walker = true},
weight = 2,
description = S("Increases walking speed on soul sand."),
description = S("Increases walking speed on soul sand and soul soil."),
curse = false,
on_enchant = function() end,
requires_tool = false,

View File

@ -514,13 +514,18 @@ minetest.register_globalstep(function(dtime)
return
end
-- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots)
if node_stand == "mcl_nether:soul_sand" then
local boots = player:get_inventory():get_stack("armor", 5)
local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed")
-- Standing on soul soil? If so, apply Soul Speed bonus
if node_stand == "mcl_blackstone:soul_soil" and soul_speed > 0 then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3)
-- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots, then apply bonus)
elseif node_stand == "mcl_nether:soul_sand" then
-- TODO: Tweak walk speed
-- TODO: Also slow down mobs
-- Slow down even more when soul sand is above certain block
local boots = player:get_inventory():get_stack("armor", 5)
local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed")
if soul_speed > 0 then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3)
else