Added blindness effect

(also improved TT descriptions of some effects)
This commit is contained in:
the-real-herowl 2024-01-17 01:38:24 +01:00
parent 5610fa1c4b
commit 31adc45da9
2 changed files with 35 additions and 2 deletions

View file

@ -369,7 +369,7 @@ mcl_potions.register_effect({
name = "levitation", name = "levitation",
description = S("Levitation"), description = S("Levitation"),
get_tt = function(factor) get_tt = function(factor)
return S("moves you upwards at @1 nodes/s", factor) return S("moves body upwards at @1 nodes/s", factor)
end, end,
on_step = function(dtime, object, factor, duration) on_step = function(dtime, object, factor, duration)
local vel = object:get_velocity().y local vel = object:get_velocity().y
@ -410,7 +410,7 @@ mcl_potions.register_effect({
name = "health_boost", name = "health_boost",
description = S("Health Boost"), description = S("Health Boost"),
get_tt = function(factor) get_tt = function(factor)
return S("increases HP by @1", factor) return S("HP increased by @1", factor)
end, end,
res_condition = function(object) res_condition = function(object)
return (not object:is_player()) return (not object:is_player())
@ -574,6 +574,39 @@ mcl_potions.register_effect({
end, end,
}) })
mcl_potions.register_effect({
name = "blindness",
description = "Blindness",
get_tt = function(factor)
return S("impaired sight")
end,
res_condition = function(object)
return (not object:is_player())
end,
on_start = function(object, factor)
EF.blindness[object].vignette = object:hud_add({
hud_elem_type = "image",
position = {x = 0.5, y = 0.5},
scale = {x = -101, y = -101},
text = "mcl_potions_blindness_hud.png",
z_index = -401
})
mcl_fovapi.apply_modifier(object, "mcl_potions:blindness")
end,
on_end = function(object)
mcl_fovapi.remove_modifier(object, "mcl_potions:blindness")
if not EF.blindness[object] then return end
object:hud_remove(EF.blindness[object].vignette)
end,
particle_color = "#686868",
uses_factor = false,
})
mcl_fovapi.register_modifier({
name = "mcl_potions:blindness",
fov_factor = 0.6,
time = 1,
})
mcl_potions.register_effect({ mcl_potions.register_effect({
name = "food_poisoning", name = "food_poisoning",
description = S("Food Poisoning"), description = S("Food Poisoning"),

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB