Merge pull request 'Make Soul Speed work on Soul Soil' (#4604) from upstream/soul_soil_speed into master

Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4604
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
This commit is contained in:
the-real-herowl 2024-09-18 10:06:03 +02:00
commit cd2ee49591
7 changed files with 27 additions and 19 deletions

View File

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

View File

@ -68,7 +68,7 @@ Mined blocks drop themselves.=Abgebaute Blöcke werfen sich selbst ab.
Smite=Qual Smite=Qual
Increases damage to undead mobs.=Erhöht Schaden für untote Mobs. Increases damage to undead mobs.=Erhöht Schaden für untote Mobs.
Soul Speed=Schnelle Seele Soul Speed=Schnelle Seele
Increases walking speed on soul sand.=Erhöht Gehgeschwindigkeit auf Seelensand. Increases walking speed on soul sand and soul soil.=Erhöht Gehgeschwindigkeit auf Seelensand.
Sweeping Edge=Schwungklinge Sweeping Edge=Schwungklinge
Increases sweeping attack damage.=Erhöht Schwungangriffsschaden. Increases sweeping attack damage.=Erhöht Schwungangriffsschaden.
Thorns=Dornen Thorns=Dornen

View File

@ -36,7 +36,7 @@ Increases mob loot.=Incrementa el botín de los enemigos.
Increases rate of good loot (enchanting books, etc.)=Incrementa la probabilidad de encontrar tesoros. Increases rate of good loot (enchanting books, etc.)=Incrementa la probabilidad de encontrar tesoros.
Increases sweeping attack damage.=Incrementa el daño de efecto area. Increases sweeping attack damage.=Incrementa el daño de efecto area.
Increases underwater movement speed.=Incrementa la velocidad de nado bajo el agua. Increases underwater movement speed.=Incrementa la velocidad de nado bajo el agua.
Increases walking speed on soul sand.=Incrementa la velocidad al caminar sobre arena de Almas. Increases walking speed on soul sand and soul soil.=Incrementa la velocidad al caminar sobre arena de Almas.
Infinity=Infinidad Infinity=Infinidad
Item destroyed on death.=El objeto se destruye tras tu muerte. Item destroyed on death.=El objeto se destruye tras tu muerte.
Knockback=Empuje Knockback=Empuje

View File

@ -36,7 +36,7 @@ Increases mob loot.=Augmente le butin des mobs.
Increases rate of good loot (enchanting books, etc.)=Augmente le taux de bon butin (livres enchanteurs, etc.) Increases rate of good loot (enchanting books, etc.)=Augmente le taux de bon butin (livres enchanteurs, etc.)
Increases sweeping attack damage.=Augmente les dégâts de l'épée Increases sweeping attack damage.=Augmente les dégâts de l'épée
Increases underwater movement speed.=Augmente la vitesse de déplacement sous l'eau. Increases underwater movement speed.=Augmente la vitesse de déplacement sous l'eau.
Increases walking speed on soul sand.=Augmente la vitesse de marche sur le sable des âmes. Increases walking speed on soul sand and soul soil.=Augmente la vitesse de marche sur le sable des âmes.
Infinity=Infinité Infinity=Infinité
Item destroyed on death.=Objet détruit à la mort. Item destroyed on death.=Objet détruit à la mort.
Knockback=Recul Knockback=Recul

View File

@ -36,7 +36,7 @@ Increases mob loot.=MOBの戦利品が増加します。
Increases rate of good loot (enchanting books, etc.)=釣果の質が良くなります(エンチャントの本など)。 Increases rate of good loot (enchanting books, etc.)=釣果の質が良くなります(エンチャントの本など)。
Increases sweeping attack damage.=なぎ払い攻撃のダメージが増加します。 Increases sweeping attack damage.=なぎ払い攻撃のダメージが増加します。
Increases underwater movement speed.=水中での横移動速度が増加します。 Increases underwater movement speed.=水中での横移動速度が増加します。
Increases walking speed on soul sand.=ソウルサンドとソウルソイルの上を歩く速度が増加します。 Increases walking speed on soul sand and soul soil.=ソウルサンドとソウルソイルの上を歩く速度が増加します。
Infinity=無限 Infinity=無限
Item destroyed on death.=死亡時にアイテムが消滅します。 Item destroyed on death.=死亡時にアイテムが消滅します。
Knockback=ノックバック Knockback=ノックバック

View File

@ -36,7 +36,7 @@ Increases mob loot.=
Increases rate of good loot (enchanting books, etc.)= Increases rate of good loot (enchanting books, etc.)=
Increases sweeping attack damage.= Increases sweeping attack damage.=
Increases underwater movement speed.= Increases underwater movement speed.=
Increases walking speed on soul sand.= Increases walking speed on soul sand and soul soil.=
Infinity= Infinity=
Item destroyed on death.= Item destroyed on death.=
Knockback= Knockback=

View File

@ -514,21 +514,29 @@ minetest.register_globalstep(function(dtime)
return return
end end
-- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots) local boots = player:get_inventory():get_stack("armor", 5)
if node_stand == "mcl_nether:soul_sand" then local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed")
-- TODO: Tweak walk speed
-- TODO: Also slow down mobs -- Standing on a soul block? If so, check for speed bonus / penalty
-- Slow down even more when soul sand is above certain block if get_item_group(node_stand, "soul_block") ~= 0 then
local boots = player:get_inventory():get_stack("armor", 5)
local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed") -- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots, then apply bonus)
if soul_speed > 0 then if node_stand == "mcl_nether:soul_sand" then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3) -- TODO: Tweak walk speed
else -- TODO: Also slow down mobs
if node_stand_below == "mcl_core:ice" or node_stand_below == "mcl_core:packed_ice" or node_stand_below == "mcl_core:slimeblock" or node_stand_below == "mcl_core:water_source" then -- Slow down even more when soul sand is above certain block
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", 0.1) if soul_speed > 0 then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3)
else else
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", 0.4) if node_stand_below == "mcl_core:ice" or node_stand_below == "mcl_core:packed_ice" or node_stand_below == "mcl_core:slimeblock" or node_stand_below == "mcl_core:water_source" then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", 0.1)
else
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", 0.4)
end
end end
elseif soul_speed > 0 then
-- Standing on a different soul block? If so, apply Soul Speed bonus unconditionally
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3)
end end
else else
playerphysics.remove_physics_factor(player, "speed", "mcl_playerplus:soul_speed") playerphysics.remove_physics_factor(player, "speed", "mcl_playerplus:soul_speed")