mirror of
https://notabug.org/TenPlus1/lucky_block.git
synced 2024-10-04 03:03:05 +02:00
add worm farm drops
This commit is contained in:
parent
c83f406f37
commit
27fa7e1223
@ -26,5 +26,6 @@ Changelog:
|
|||||||
- 1.1 - Spawning mobs can now select randomly from a table or single string
|
- 1.1 - Spawning mobs can now select randomly from a table or single string
|
||||||
- 1.2 - Code tidy and fixed wishing well replacements
|
- 1.2 - Code tidy and fixed wishing well replacements
|
||||||
- 1.3 - Add lightning staff as rare drop, tidy code, lightning fire check, slender potion
|
- 1.3 - Add lightning staff as rare drop, tidy code, lightning fire check, slender potion
|
||||||
|
- 1.4 - Bug fix falling nodes, add worm farm drops
|
||||||
|
|
||||||
Lucky Blocks: 262 (depending on mods enabled)
|
Lucky Blocks: 262 (depending on mods enabled)
|
||||||
|
42
blocks.lua
42
blocks.lua
@ -881,6 +881,48 @@ if minetest.get_modpath("nether") then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- worm farm mod
|
||||||
|
if minetest.get_modpath("worm_farm") then
|
||||||
|
|
||||||
|
-- custom function (drop player inventory and replace with dry shrubs)
|
||||||
|
local function wormy(pos, player)
|
||||||
|
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
|
||||||
|
pos = player:get_pos() or pos
|
||||||
|
|
||||||
|
for i = 1, player_inv:get_size("main") do
|
||||||
|
|
||||||
|
local obj = minetest.add_item(pos, player_inv:get_stack("main", i))
|
||||||
|
|
||||||
|
if obj then
|
||||||
|
|
||||||
|
obj:set_velocity({
|
||||||
|
x = math.random(-10, 10) / 9,
|
||||||
|
y = 5,
|
||||||
|
z = math.random(-10, 10) / 9,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
player_inv:set_stack("main", i, "ethereal:worm")
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.chat_send_player(player:get_player_name(),
|
||||||
|
green .. S("Worm Attack!"))
|
||||||
|
end
|
||||||
|
|
||||||
|
lucky_block:add_blocks({
|
||||||
|
{"nod", "default:chest", 0, {
|
||||||
|
{name = "ethereal:worm", max = 5},
|
||||||
|
{name = "worm_farm:worm_tea", max = 5},
|
||||||
|
{name = "ethereal:worm", max = 5},
|
||||||
|
{name = "worm_farm:worm_farm", max = 1}
|
||||||
|
}},
|
||||||
|
{"cus", wormy},
|
||||||
|
{"dro", {"worm_farm:worm_farm"}, 1}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Additional Wishing Well Styles
|
-- Additional Wishing Well Styles
|
||||||
lucky_block:add_blocks({
|
lucky_block:add_blocks({
|
||||||
|
13
init.lua
13
init.lua
@ -180,12 +180,13 @@ local function fill_chest(pos, items)
|
|||||||
|
|
||||||
if not stacks[s].chance
|
if not stacks[s].chance
|
||||||
or math.random(1, stacks[s].chance) == 1 then
|
or math.random(1, stacks[s].chance) == 1 then
|
||||||
if minetest.registered_items[stacks[s].name] then
|
|
||||||
inv:set_stack("main", math.random(32), {
|
if minetest.registered_items[stacks[s].name] then
|
||||||
name = stacks[s].name,
|
inv:set_stack("main", math.random(32), {
|
||||||
count = math.random(stacks[s].max)
|
name = stacks[s].name,
|
||||||
})
|
count = math.random(stacks[s].max)
|
||||||
end
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user