mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Added blindness effect
(also improved TT descriptions of some effects)
This commit is contained in:
parent
5610fa1c4b
commit
31adc45da9
2 changed files with 35 additions and 2 deletions
|
@ -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"),
|
||||||
|
|
BIN
textures/mcl_potions_blindness_hud.png
Normal file
BIN
textures/mcl_potions_blindness_hud.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Loading…
Reference in a new issue