add pova effects to lb

This commit is contained in:
tenplus1 2023-05-23 14:48:13 +01:00
parent 2a15a00ed8
commit a56384fea7
4 changed files with 57 additions and 2 deletions

@ -30,4 +30,4 @@ Changelog:
- 1.5 - Filled chests can now add tools with custom wear levels, code tidy and tweaks
- 1.6 - Add support for mineclone2 game, tweak and tidy code, add new screenshot
Lucky Blocks: 266 (depending on mods enabled)
Lucky Blocks: 268 (depending on mods enabled)

@ -4,3 +4,4 @@ screwdriver?
intllib?
mcl_core?
mcl_sounds?
pova?

@ -397,3 +397,57 @@ if lucky_block.mod_def then
}}
})
end
-- pova mod effects
if minetest.get_modpath("pova") then
-- slowmo effect
local function slowmo(pos, player, def)
local name = player:get_player_name()
minetest.chat_send_player(name,
lucky_block.green .. S("You suddenly feel sluggish, take 30 seconds!"))
pova.add_override(name, "lb_sluggish", {speed = -0.9})
pova.do_override(player)
minetest.after(30, function(player)
local name = player:get_player_name()
if name then
pova.del_override(name, "lb_sluggish")
pova.do_override(player)
end
end, player)
end
-- high jump effect
local function highfly(pos, player, def)
local name = player:get_player_name()
minetest.chat_send_player(name,
lucky_block.green .. S("You suddenly feel lighter, wait 30 seconds!"))
pova.add_override(name, "lb_lighter", {jump = 4})
pova.do_override(player)
minetest.after(30, function(player)
local name = player:get_player_name()
if name then
pova.del_override(name, "lb_lighter")
pova.do_override(player)
end
end, player)
end
lucky_block:add_blocks({
{"cus", slowmo},
{"cus", highfly}
})
end

@ -1,4 +1,4 @@
name = lucky_block
depends =
optional_depends = default, mcl_core, mcl_sounds, tnt, screwdriver, intllib
optional_depends = default, mcl_core, mcl_sounds, tnt, screwdriver, intllib, pova
description = Adds lucky blocks into the game which may give good, bad, hurtful items when open :)