ethereal/fishing.lua

127 lines
3.0 KiB
Lua
Raw Normal View History

2016-06-09 17:08:34 +03:00
local S = ethereal.intllib
2014-11-09 22:17:41 +03:00
-- Raw Fish (Thanks to Altairas for her Fish image on DeviantArt)
minetest.register_craftitem("ethereal:fish_raw", {
2016-06-09 17:08:34 +03:00
description = S("Raw Fish"),
2014-11-09 22:17:41 +03:00
inventory_image = "fish_raw.png",
2015-11-23 23:43:48 +03:00
wield_image = "fish_raw.png",
2018-03-12 21:40:36 +03:00
groups = {food_fish_raw = 1, flammable = 3},
2014-11-09 22:17:41 +03:00
on_use = minetest.item_eat(2),
})
-- Cooked Fish
minetest.register_craftitem("ethereal:fish_cooked", {
2016-06-09 17:08:34 +03:00
description = S("Cooked Fish"),
2014-11-09 22:17:41 +03:00
inventory_image = "fish_cooked.png",
2015-11-23 23:43:48 +03:00
wield_image = "fish_cooked.png",
2018-03-12 21:40:36 +03:00
groups = {food_fish = 1, flammable = 3},
2014-11-09 22:17:41 +03:00
on_use = minetest.item_eat(5),
})
2015-07-04 14:22:39 +03:00
minetest.register_craft({
type = "cooking",
output = "ethereal:fish_cooked",
recipe = "ethereal:fish_raw",
cooktime = 2,
})
2014-11-09 22:17:41 +03:00
-- Sashimi (Thanks to Natalia Grosner for letting me use the sashimi image)
minetest.register_craftitem("ethereal:sashimi", {
2016-06-09 17:08:34 +03:00
description = S("Sashimi"),
2014-11-09 22:17:41 +03:00
inventory_image = "sashimi.png",
2015-11-23 23:43:48 +03:00
wield_image = "sashimi.png",
2014-11-09 22:17:41 +03:00
on_use = minetest.item_eat(4),
})
minetest.register_craft({
output = "ethereal:sashimi 2",
recipe = {
2018-03-12 21:40:36 +03:00
{'group:food_seaweed','group:food_fish_raw','group:food_seaweed'},
2014-11-09 22:17:41 +03:00
}
})
-- Worm
minetest.register_craftitem("ethereal:worm", {
2016-06-09 17:08:34 +03:00
description = S("Worm"),
2014-11-09 22:17:41 +03:00
inventory_image = "worm.png",
2015-11-23 23:43:48 +03:00
wield_image = "worm.png",
2014-11-09 22:17:41 +03:00
})
-- Fishing Rod
minetest.register_craftitem("ethereal:fishing_rod", {
2016-06-09 17:08:34 +03:00
description = S("Fishing Rod"),
2014-11-09 22:17:41 +03:00
inventory_image = "fishing_rod.png",
2015-11-23 23:43:48 +03:00
wield_image = "fishing_rod.png",
2014-11-09 22:17:41 +03:00
})
minetest.register_craft({
output = "ethereal:fishing_rod",
recipe = {
{"","","default:stick"},
{"", "default:stick", "farming:string"},
{"default:stick", "", "farming:string"},
}
})
-- Sift through 2 Dirt Blocks to find Worm
minetest.register_craft({
output = "ethereal:worm",
recipe = {
{"default:dirt","default:dirt"},
}
})
-- default ethereal fish
ethereal.fish = {
{"ethereal:fish_raw"},
}
-- xanadu server additional fish
if minetest.get_modpath("xanadu") then
ethereal.fish[2] = {"mobs:clownfish_raw"}
ethereal.fish[3] = {"mobs:bluefish_raw"}
end
2015-07-04 14:22:39 +03:00
-- Fishing Rod (Baited)
minetest.register_craftitem("ethereal:fishing_rod_baited", {
2016-06-09 17:08:34 +03:00
description = S("Baited Fishing Rod"),
2015-07-04 14:22:39 +03:00
inventory_image = "fishing_rod_baited.png",
wield_image = "fishing_rod_wield.png",
stack_max = 1,
liquids_pointable = true,
2015-07-04 14:22:39 +03:00
on_use = function (itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
2015-07-04 14:22:39 +03:00
local node = minetest.get_node(pointed_thing.under).name
2015-07-04 14:22:39 +03:00
if (node == "default:water_source"
or node == "default:river_water_source")
and math.random(1, 100) < 5 then
local type = ethereal.fish[math.random(1, #ethereal.fish)][1]
2015-07-04 14:22:39 +03:00
local inv = user:get_inventory()
if inv:room_for_item("main", {name = type}) then
inv:add_item("main", {name = type})
2016-08-28 15:27:48 +03:00
return ItemStack("ethereal:fishing_rod")
2015-07-04 14:22:39 +03:00
else
minetest.chat_send_player(user:get_player_name(),
2016-06-09 17:08:34 +03:00
S("Inventory full, Fish Got Away!"))
2015-07-04 14:22:39 +03:00
end
end
end,
2014-11-09 22:17:41 +03:00
})
minetest.register_craft({
type = "shapeless",
output = "ethereal:fishing_rod_baited",
recipe = {"ethereal:fishing_rod", "ethereal:worm"},
2015-11-23 23:43:48 +03:00
})