1
0
Fork 0

Added nausea

This commit is contained in:
the-real-herowl 2024-01-22 02:13:08 +01:00
parent 92a77a7dbb
commit aa4ff1827d
1 changed files with 48 additions and 0 deletions

View File

@ -629,6 +629,54 @@ mcl_fovapi.register_modifier({
time = 1, time = 1,
}) })
mcl_potions.register_effect({
name = "nausea",
description = S("Nausea"),
get_tt = function(factor)
return S("not feeling very well...")
end,
res_condition = function(object)
return (not object:is_player())
end,
on_start = function(object, factor)
object:set_lighting({
saturation = -1.0,
})
end,
on_hit_timer = function(object, factor, duration)
if EF.nausea[object].high then
mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_high")
mcl_fovapi.apply_modifier(object, "mcl_potions:nausea_low")
EF.nausea[object].high = false
else
mcl_fovapi.apply_modifier(object, "mcl_potions:nausea_high")
mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_low")
EF.nausea[object].high = true
end
end,
on_end = function(object)
object:set_lighting({
saturation = 1.0,
})
mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_high")
mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_low")
end,
particle_color = "#60AA30",
uses_factor = false,
timer_uses_factor = false,
hit_timer_step = 1,
})
mcl_fovapi.register_modifier({
name = "mcl_potions:nausea_high",
fov_factor = 2.2,
time = 1,
})
mcl_fovapi.register_modifier({
name = "mcl_potions:nausea_low",
fov_factor = 0.2,
time = 1,
})
mcl_potions.register_effect({ mcl_potions.register_effect({
name = "food_poisoning", name = "food_poisoning",
description = S("Food Poisoning"), description = S("Food Poisoning"),