initial commit
rewriting original fishing mod by 4aiman
@ -1,2 +1,4 @@
|
||||
# fishing
|
||||
minetest fishing mod
|
||||
|
||||
|
||||
-- original by 4aiman https://github.com/4aiman/fishing
|
||||
|
19
amorce.lua
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- amorce
|
||||
|
||||
minetest.register_craftitem("fishing:amorce", {
|
||||
description = "Amorce",
|
||||
inventory_image = "fishing_amorce.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "fishing:amorce",
|
||||
recipe = {"farming:flour", "farming:corn", "food:egg", "bucket:bucket_water"}
|
||||
})
|
20
baits.lua
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
|
||||
--bait_corn
|
||||
minetest.register_craftitem("fishing:bait_corn", {
|
||||
description = "Bait corn",
|
||||
inventory_image = "fishing_bait_corn.png",
|
||||
})
|
||||
|
||||
fishing_setting.baits["fishing:bait_corn"] = { ["bait"] = "fishing:bait_corn", ["bobber"] = "fishing:bobber_entity" }
|
||||
|
||||
|
||||
|
||||
--bait_pain
|
||||
minetest.register_craftitem("fishing:bait_pain", {
|
||||
description = "Bait pain",
|
||||
inventory_image = "fishing_bait_corn.png",
|
||||
})
|
||||
|
||||
fishing_setting.baits["fishing:bait_pain"] = { ["bait"] = "fishing:bait_pain", ["bobber"] = "fishing:bobber_entity" }
|
218
bobber.lua
Normal file
@ -0,0 +1,218 @@
|
||||
|
||||
|
||||
minetest.register_alias("flowers_plus:seaweed", "flowers:seaweed") -- exception
|
||||
|
||||
|
||||
-- bobber
|
||||
minetest.register_node("fishing:bobber_box", {
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-8/16, -8/16, 0, 8/16, 8/16, 0}, -- feathers
|
||||
{-2/16, -8/16, -2/16, 2/16, -4/16, 2/16}, -- bobber
|
||||
}
|
||||
},
|
||||
tiles = {
|
||||
"fishing_bobber_top.png",
|
||||
"fishing_bobber_bottom.png",
|
||||
"fishing_bobber.png",
|
||||
"fishing_bobber.png",
|
||||
"fishing_bobber.png",
|
||||
"fishing_bobber.png^[transformFX"
|
||||
}, --
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
||||
local FISHING_BOBBER_ENTITY={
|
||||
hp_max = 605,
|
||||
water_damage = 1,
|
||||
physical = true,
|
||||
timer = 0,
|
||||
env_damage_timer = 0,
|
||||
visual = "wielditem",
|
||||
visual_size = {x=1/3, y=1/3, z=1/3},
|
||||
textures = {"fishing:bobber_box"},
|
||||
-- {left ,bottom, front, right, top , back}
|
||||
collisionbox = {-2/16, -4/16, -2/16, 2/16, 0/16, 2/16},
|
||||
view_range = 7,
|
||||
randomtime = 50,
|
||||
chance = 0,
|
||||
amorce = false,
|
||||
prize = "",
|
||||
|
||||
-- DESTROY BOBBER WHEN PUNCHING IT
|
||||
on_punch = function (self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||
if not puncher:is_player() then return end
|
||||
local player = puncher:get_player_name()
|
||||
if player ~= self.object.owner then return end
|
||||
if MESSAGES == true then minetest.chat_send_player(player, fishing_setting.S("You didn't prizes anything."), false) end -- fish escaped
|
||||
if not fishing_setting.is_creative_mode then
|
||||
local inv = puncher:get_inventory()
|
||||
if inv:room_for_item("main", {name="fishing:bait_corn", count=1, wear=0, metadata=""}) then
|
||||
inv:add_item("main", {name="fishing:bait_corn", count=1, wear=0, metadata=""})
|
||||
if MESSAGES == true then minetest.chat_send_player(player, fishing_setting.S("The bait is still there."), false) end -- bait still there
|
||||
end
|
||||
end
|
||||
-- make sound and remove bobber
|
||||
minetest.sound_play("fishing_bobber1", { pos = self.object:getpos(), gain = 0.5, })
|
||||
self.object:remove()
|
||||
end,
|
||||
|
||||
|
||||
|
||||
|
||||
-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
|
||||
on_rightclick = function (self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local player = clicker:get_player_name()
|
||||
local inv = clicker:get_inventory()
|
||||
local pos = self.object:getpos()
|
||||
local item_name = item:get_name()
|
||||
if string.find(item_name, "fishing:pole_") ~= nil then
|
||||
|
||||
--##############################################################################################################
|
||||
if self.prize ~= "" then
|
||||
local name = self.prize[1]..":"..self.prize[2]
|
||||
local desc = self.prize[4]
|
||||
print("You caught "..name.." "..desc)
|
||||
minetest.chat_send_player(player, "You caught "..desc, false)
|
||||
if inv:room_for_item("main", {name=name, count=1, wear=0, metadata=""}) then
|
||||
local used
|
||||
if self.prize[3] == "random" then
|
||||
used = (2000*(math.random(20, 29)))
|
||||
elseif self.prize[3] == "randomtools" then
|
||||
used = (65535/(30-(math.random(15, 29))))
|
||||
else
|
||||
used = 0
|
||||
end
|
||||
inv:add_item("main", {name=name, count=1, wear=used, metadata=""})
|
||||
else
|
||||
minetest.spawn_item(clicker:getpos(), name)
|
||||
end
|
||||
end
|
||||
|
||||
-- weither player has fishing pole or not
|
||||
minetest.sound_play("fishing_bobber1", { pos = self.object:getpos(), gain = 0.5, })
|
||||
self.object:remove()
|
||||
|
||||
|
||||
--##############################################################################################################
|
||||
|
||||
|
||||
|
||||
elseif item:get_name() == "fishing:amorce" then
|
||||
|
||||
|
||||
if not fishing_setting.is_creative_mode then
|
||||
inv:remove_item("main", "fishing:amorce")
|
||||
end
|
||||
self.amorce = true
|
||||
--addparticle
|
||||
minetest.add_particlespawner(30, 0.5, -- for how long (?) -- Particles on splash
|
||||
{x=pos.x,y=pos.y-0.0625,z=pos.z}, {x=pos.x,y=pos.y,z=pos.z}, -- position min, pos max
|
||||
{x=-2,y=-0.0625,z=-2}, {x=2,y=3,z=2}, -- velocity min, vel max
|
||||
{x=0,y=-9.8,z=0}, {x=0,y=-9.8,z=0},
|
||||
0.3, 1.2,
|
||||
0.25, 0.5, -- min size, max size
|
||||
false, "fishing_particle_amorce.png")
|
||||
-- add sound
|
||||
minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(), gain = 0.2, })
|
||||
--inc hp
|
||||
print("amorce")
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- AS SOON AS THE BOBBER IS PLACED IT WILL ACT LIKE
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos()
|
||||
|
||||
if self.owner == nil then self.object:remove(); return end
|
||||
local player = minetest.get_player_by_name(self.owner)
|
||||
if not player then self.object:remove(); return end
|
||||
--remove if nobody in radius
|
||||
local p = player:getpos()
|
||||
local dist = ((p.x-pos.x)^2 + (p.y-pos.y)^2 + (p.z-pos.z)^2)^0.5
|
||||
if dist > self.view_range then
|
||||
minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,})
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
||||
--rotate bobber
|
||||
if math.random(1, 4) == 1 then
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi))
|
||||
end
|
||||
|
||||
--###################
|
||||
self.timer = self.timer + 1
|
||||
if self.timer < self.randomtime then
|
||||
if self.prize ~= "" then
|
||||
local n = math.random(1,3)
|
||||
if n == 1 then
|
||||
if self.old_pos2 == true then
|
||||
pos.y = pos.y-0.0325
|
||||
self.object:moveto(pos, false)
|
||||
self.old_pos2 = false
|
||||
else
|
||||
pos.y = pos.y+0.0325
|
||||
self.object:moveto(pos, false)
|
||||
self.old_pos2 = true
|
||||
end
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
self.timer = 0
|
||||
self.object:moveto(self.old_pos, false)
|
||||
self.randomtime = math.random(2,12)*10
|
||||
--self.object:moveto({x=pos.x,y=pos.y-0.015625,z=pos.z})
|
||||
--print("randomtime:"..tostring(self.randomtime))
|
||||
if math.random(1, 100) > FISH_CHANCE then
|
||||
self.prize = ""
|
||||
return
|
||||
end
|
||||
|
||||
local c = 0
|
||||
if self.amorce then
|
||||
c = 20
|
||||
end
|
||||
|
||||
|
||||
local chance = math.random(1, 100)+c
|
||||
print(" chance: " .. tostring(chance) .. " randomtime: "..tostring(self.randomtime))
|
||||
if chance == 1 then
|
||||
local r = math.random(1, 100)
|
||||
if r < 10 then
|
||||
self.prize = fishing_setting.prizes.tresor[math.random(1,#fishing_setting.prizes.tresor)]
|
||||
else
|
||||
self.prize = ""
|
||||
end
|
||||
elseif chance < 10 then
|
||||
self.prize = ""
|
||||
elseif chance < 40 then
|
||||
self.prize = fishing_setting.prizes.loose[math.random(1,#fishing_setting.prizes.loose)]
|
||||
else
|
||||
self.prize = fishing_setting.prizes.fish[math.random(1,#fishing_setting.prizes.fish)]
|
||||
end
|
||||
|
||||
self.amorce = false
|
||||
if self.prize ~= nil then
|
||||
pos.y = self.old_pos.y-0.1
|
||||
self.object:moveto(pos, false)
|
||||
minetest.sound_play("fishing_bobber1", {pos=pos,gain = 0.5,})
|
||||
print("prize: "..tostring(self.prize[1])..":"..tostring(self.prize[2]))
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
minetest.register_entity("fishing:bobber_entity", FISHING_BOBBER_ENTITY)
|
||||
|
75
chatcommands.lua
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
|
||||
|
||||
--FIXME server set fishing enable|disable treasure
|
||||
minetest.register_chatcommand("fishing_enable", {
|
||||
params = "",
|
||||
description = "display trophie of treasure from the water",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
if param == "true" then
|
||||
fishing_setting.enable = true
|
||||
minetest.chat_send_player(name, "treasure is enabled")
|
||||
elseif param == "false" then
|
||||
fishing_setting.enable = false
|
||||
minetest.chat_send_player(name, "treasure is disabled")
|
||||
else
|
||||
minetest.chat_send_player(name, "unknow param ".. tostring(param))
|
||||
minetest.chat_send_player(name, "command is /fishing_enable <true|false>")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--[[ --FIXME server set fishing random timer
|
||||
minetest.register_chatcommand("fishing_stimer", {
|
||||
params = "",
|
||||
description = "display trophie of treasure from the water",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
minetest.chat_send_player(name, "treasure is " .. treasure)
|
||||
|
||||
end
|
||||
})
|
||||
]]
|
||||
|
||||
|
||||
--[[ --FIXME server set fishing config
|
||||
minetest.register_chatcommand("fishing_setting", {
|
||||
params = "",
|
||||
description = "display trophie of treasure from the water",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
minetest.chat_send_player(name, "")
|
||||
|
||||
end
|
||||
})
|
||||
]]
|
||||
|
||||
|
||||
|
||||
minetest.register_chatcommand("fishing_trophies", {
|
||||
params = "",
|
||||
description = "display trophie of treasure from the water",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
--FIXME fixed treasure
|
||||
local tresure = "nothing"
|
||||
minetest.chat_send_player(name, "treasure is " .. treasure)
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
|
||||
end)
|
||||
]]
|
75
crafting.lua
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Fishing Pole
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole_wood",
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "farming:string"},
|
||||
{"group:stick", "", "farming:string"},
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.get_modpath("moreblocks") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole_wood",
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "moreblocks:rope" },
|
||||
{"group:stick", "", "moreblocks:rope" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("ropes") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole_wood",
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "ropes:rope" },
|
||||
{"group:stick", "", "ropes:rope" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Mithril Fishing Pole
|
||||
if minetest.get_modpath("moreores") ~= nil and minetest.get_modpath("mobs") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole_perfect",
|
||||
recipe = {
|
||||
{"", "", "moreores:mithril_ingot" },
|
||||
{"", "moreores:mithril_ingot", "mobs:spider_cobweb" },
|
||||
{"moreores:mithril_ingot", "", "mobs:spider_cobweb" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Fishing bait
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--bait corn
|
||||
minetest.register_craft({
|
||||
output = "fishing:bait_corn 9",
|
||||
recipe = {
|
||||
{"", "farming:corn", ""},
|
||||
}
|
||||
})
|
||||
|
||||
--bait pain
|
||||
minetest.register_craft({
|
||||
output = "fishing:bait_pain 9",
|
||||
recipe = {
|
||||
{"", "farming:bread", ""},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Fishing bobber
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--bobber
|
||||
|
||||
|
||||
|
2
depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
farming
|
79
fishes.lua
Normal file
@ -0,0 +1,79 @@
|
||||
-------------------------------------------------------------------------------------------
|
||||
-- Fishing - Mossmanikin's version - Fishes 0.0.4
|
||||
-- License (code & textures): WTFPL
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Fish
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_craftitem("fishing:fish_raw", {
|
||||
description = S("Fish"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_fish.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
-----------------------------------------------------
|
||||
-- Roasted Fish
|
||||
-----------------------------------------------------
|
||||
minetest.register_craftitem("fishing:fish", {
|
||||
description = S("Roasted Fish"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_fish_cooked.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
-----------------------------------------------------
|
||||
-- Sushi
|
||||
-----------------------------------------------------
|
||||
minetest.register_craftitem("fishing:sushi", {
|
||||
description = S("Sushi (Hoso Maki)"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_sushi.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Whatthef... it's a freakin' Shark!
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_craftitem("fishing:shark", {
|
||||
description = S("Shark"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_shark.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
-----------------------------------------------------
|
||||
-- Roasted Shark
|
||||
-----------------------------------------------------
|
||||
minetest.register_craftitem("fishing:shark_cooked", {
|
||||
description = S("Roasted Shark"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_shark_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Pike
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_craftitem("fishing:pike", {
|
||||
description = S("Northern Pike"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_pike.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
-----------------------------------------------------
|
||||
-- Roasted Pike
|
||||
-----------------------------------------------------
|
||||
minetest.register_craftitem("fishing:pike_cooked", {
|
||||
description = S("Roasted Northern Pike"),
|
||||
groups = {},
|
||||
inventory_image = "fishing_pike_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
61
init.lua
Normal file
@ -0,0 +1,61 @@
|
||||
print("loading [fishing] mod")
|
||||
fishing_setting = {}
|
||||
|
||||
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
fishing_setting.S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
fishing_setting.S = function ( s ) return s end
|
||||
end
|
||||
|
||||
|
||||
|
||||
fishing_setting.file = minetest.get_worldpath() .. "/fishing_config.txt"
|
||||
fishing_setting.is_creative_mode = minetest.setting_getbool("creative_mode")
|
||||
fishing_setting.setting = {}
|
||||
fishing_setting.random_timer = 3600
|
||||
fishing_setting.prizes = {}
|
||||
|
||||
--for random object
|
||||
random_objects = {}
|
||||
|
||||
fishing_setting.baits = {}
|
||||
local path = minetest.get_modpath("fishing").."/"
|
||||
dofile(path .."settings.txt")
|
||||
dofile(path .."crafting.lua")
|
||||
dofile(path .."baits.lua")
|
||||
dofile(path .."prizes.lua")
|
||||
dofile(path .."amorce.lua")
|
||||
dofile(path .."bobber.lua")
|
||||
--dofile(path .."bobber_shark.lua")
|
||||
dofile(path .."fishes.lua")
|
||||
dofile(path .."trophies.lua")
|
||||
dofile(path .."poles.lua")
|
||||
|
||||
|
||||
|
||||
-- timer
|
||||
fishing_setting.timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
if fishing_setting.enable == false then return end
|
||||
fishing_setting.timer = fishing_setting.timer - dtime
|
||||
-- if fishing.new_object then
|
||||
-- new object is item, time to catch is timer
|
||||
-- fishing_setting.timer = fishing_setting.random_timer
|
||||
-- end
|
||||
-- if timer == 300 then
|
||||
--you have 5min for catch item
|
||||
-- end
|
||||
if fishing_setting.timer < 0 then
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
--FIXME display message
|
||||
end
|
||||
--get random object
|
||||
fishing_setting.timer = fishing_setting.random_timer
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
56
locale/de.txt
Normal file
@ -0,0 +1,56 @@
|
||||
# Translation by Xanthin
|
||||
|
||||
### bobber.lua ###
|
||||
You caught a Fish. = Du hast einen Fisch gefangen.
|
||||
You caught a Clownfish. = Du hast einen Clownfisch gefangen.
|
||||
You caught a Blue white fish. = Du hast einen blau-weissen Fisch gefangen.
|
||||
You caught a Twig. = Du hast einen Zweig gefangen.
|
||||
You caught a Rat. = Du hast eine Ratte gefangen.
|
||||
You caught some Seaweed. = Du hast etwas Seetang gefangen.
|
||||
You caught a Green Kelp. = Du hast etwas gruenen Kelp gefangen.
|
||||
You caught a String. = Du hast eine Schnur gefangen.
|
||||
You caught an old Fishing Pole. = Du hast eine alte Angelrute gefangen.
|
||||
You caught some very old Boots. = Du hast ein Paar sehr alte Schuhe gefangen.
|
||||
You caught a Waterlily. = Du hast eine Seerose gefangen.
|
||||
You didn't catch anything. = Du hast nichts gefangen.
|
||||
The bait is still there. = Der Koeder ist noch vorhanden.
|
||||
Your fish escaped. = Dein Fisch ist entkommen.
|
||||
|
||||
### bobber_shark.lua ###
|
||||
You caught a small Shark. = Du hast einen kleinen Hai gefangen.
|
||||
You caught a Northern Pike. = Du hast einen Hecht gefangen.
|
||||
You didn't catch any fish. = Du hast keinen Fisch gefangen.
|
||||
|
||||
### crafting.lua ###
|
||||
### fishes.lua ###
|
||||
Fish = Fisch
|
||||
Roasted Fish = Gebratener Fisch
|
||||
Sushi (Hoso Maki) = Sushi (Hoso Maki)
|
||||
Shark = Hai
|
||||
Roasted Shark = Gebratener Hai
|
||||
Northern Pike = Hecht
|
||||
Roasted Northern Pike = Gebratener Hecht
|
||||
|
||||
### init.lua ###
|
||||
Fishing Pole = Angelrute
|
||||
Dirt = Erde
|
||||
Wooden Hoe = Holzhacke
|
||||
Stone Hoe = Steinhacke
|
||||
Steel Hoe = Stahlhacke
|
||||
Bronze Hoe = Bronzehacke
|
||||
|
||||
### trophies.lua ###
|
||||
Fish Trophy = Fisch-Trophaee
|
||||
Northern Pike Trophy = Hecht-Trophaee
|
||||
Shark Trophy = Hai-Trophaee
|
||||
Clownfish Trophy = Clownfisch-Trophaee
|
||||
Blue white fish Trophy = Blau-weisser-Fisch-Trophaee
|
||||
Trophy = Trophaee
|
||||
This Huge Fish was caught by the Famous Angler %s ! = Dieser riesige Fisch wurde vom beruehmten Angler %s gefangen!
|
||||
This Huge Northern Pike was caught by the Famous Angler %s ! = Dieser riesige Hecht wurde vom beruehmten Angler %s gefangen!
|
||||
This Huge Shark was caught by the Famous Angler %s ! = Dieser riesige Hai wurde vom beruehmten Angler %s gefangen!
|
||||
This Huge Clownfish was caught by the Famous Angler %s ! = Dieser riesige Clownfisch wurde vom beruehmten Angler %s gefangen!
|
||||
This Huge Blue white fish was caught by the Famous Angler %s ! = Dieser riesige blau-weisse Fisch wurde vom beruehmten Angler %s gefangen!
|
||||
|
||||
### worms.lua ###
|
||||
Worm = Wurm
|
56
locale/template.txt
Normal file
@ -0,0 +1,56 @@
|
||||
# Template
|
||||
|
||||
### bobber.lua ###
|
||||
You caught a Fish. =
|
||||
You caught a Clownfish. =
|
||||
You caught a Blue white fish. =
|
||||
You caught a Twig. =
|
||||
You caught a Rat. =
|
||||
You caught some Seaweed. =
|
||||
You caught a Green Kelp. =
|
||||
You caught a String. =
|
||||
You caught an old Fishing Pole. =
|
||||
You caught some very old Boots. =
|
||||
You caught a Waterlily. =
|
||||
You didn't catch anything. =
|
||||
The bait is still there. =
|
||||
Your fish escaped. =
|
||||
|
||||
### bobber_shark.lua ###
|
||||
You caught small Shark. =
|
||||
You caught a Northern Pike. =
|
||||
You didn't catch any fish. =
|
||||
|
||||
### crafting.lua ###
|
||||
### fishes.lua ###
|
||||
Fish =
|
||||
Roasted Fish =
|
||||
Sushi (Hoso Maki) =
|
||||
Shark =
|
||||
Roasted Shark =
|
||||
Northern Pike =
|
||||
Roasted Northern Pike =
|
||||
|
||||
### init.lua ###
|
||||
Fishing Pole =
|
||||
Dirt =
|
||||
Wooden Hoe =
|
||||
Stone Hoe =
|
||||
Steel Hoe =
|
||||
Bronze Hoe =
|
||||
|
||||
### trophies.lua ###
|
||||
Fish Trophy =
|
||||
Northern Pike Trophy =
|
||||
Shark Trophy =
|
||||
Clownfish Trophy =
|
||||
Blue white fish Trophy =
|
||||
Trophy =
|
||||
This Huge Fish was caught by the Famous Angler %s ! =
|
||||
This Huge Northern Pike was caught by the Famous Angler %s ! =
|
||||
This Huge Shark was caught by the Famous Angler %s ! =
|
||||
This Huge Clownfish was caught by the Famous Angler %s ! =
|
||||
This Huge Blue white fish was caught by the Famous Angler %s ! =
|
||||
|
||||
### worms.lua ###
|
||||
Worm =
|
153
poles.lua
Normal file
@ -0,0 +1,153 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Fishing Pole
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
local function rod_wear(itemstack, user, pointed_thing, uses)
|
||||
itemstack:add_wear(65535/(uses-1))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
fishing_setting.poles = {}
|
||||
fishing_setting.poles.wood = {["name"] = "wood", ["max_use"] = 30, ["desc"] = fishing_setting.S("Fishing Pole") }
|
||||
fishing_setting.poles.perfect = {["name"] = "perfect", ["max_use"] = 1500, ["desc"] = fishing_setting.S("Perfect Fishing Pole") }
|
||||
|
||||
|
||||
for _,pole in pairs(fishing_setting.poles) do
|
||||
minetest.register_tool("fishing:pole_".. pole.name, {
|
||||
description = pole.desc,
|
||||
groups = {},
|
||||
inventory_image = "fishing_pole_".. pole.name ..".png",
|
||||
wield_image = "fishing_pole_".. pole.name ..".png^[transformFXR270",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
|
||||
on_use = function (itemstack, user, pointed_thing)
|
||||
if pointed_thing and pointed_thing.under then
|
||||
local pt = pointed_thing
|
||||
local node = minetest.get_node(pt.under)
|
||||
if string.find(node.name, "default:water") == nil then return nil end
|
||||
local player = user:get_player_name()
|
||||
local inv = user:get_inventory()
|
||||
local bait = inv:get_stack("main", user:get_wield_index()+1 ):get_name()
|
||||
if fishing_setting.baits[bait] == nil then return nil end
|
||||
|
||||
|
||||
local bobbers = {}
|
||||
local objs = minetest.get_objects_inside_radius(pt.under, 3)
|
||||
for m, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil and string.find(obj:get_luaentity().name, "fishing:bobber") ~= nil then
|
||||
bobbers[m] = obj
|
||||
end
|
||||
end
|
||||
|
||||
local nodes = {}
|
||||
local i = 1
|
||||
for _,k in pairs({ 1, 0, -1}) do
|
||||
for _,l in pairs({ -1, 0, 1}) do
|
||||
if string.find(minetest.get_node({x=pt.under.x+l, y=pt.under.y, z=pt.under.z+k}).name, "default:water") ~= nil
|
||||
and minetest.get_node({x=pt.under.x+l, y=pt.under.y+1, z=pt.under.z+k}).name == "air" then
|
||||
local empty = true
|
||||
for o, obj in pairs(bobbers) do
|
||||
local p = obj:getpos()
|
||||
local dist = ((p.x-pt.under.x)^2 + (p.y-pt.under.y)^2 + (p.z-pt.under.z)^2)^0.5
|
||||
if dist < 2 then
|
||||
empty = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if empty then
|
||||
nodes[i] = {x=pt.under.x+l, y=pt.under.y, z=pt.under.z+k}
|
||||
i = i+1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--if water == -3 nodes
|
||||
if #nodes < 1 then return nil end
|
||||
local new_pos = nodes[math.random(1, #nodes)]
|
||||
new_pos.y=new_pos.y+(45/64)
|
||||
local ent = minetest.add_entity({interval = 1,x=new_pos.x, y=new_pos.y, z=new_pos.z}, fishing_setting.baits[bait].bobber)
|
||||
if not ent then return nil end
|
||||
local luaentity = ent:get_luaentity()
|
||||
luaentity.owner = player
|
||||
luaentity.prize = ""
|
||||
luaentity.old_pos = new_pos
|
||||
luaentity.old_pos2 = true
|
||||
if not fishing_setting.is_creative_mode then
|
||||
inv:remove_item("main", bait)
|
||||
end
|
||||
minetest.sound_play("fishing_bobber2", {pos = new_pos, gain = 0.5})
|
||||
|
||||
if WEAR_OUT == true and not fishing_setting.is_creative_mode then
|
||||
return rod_wear(itemstack, user, pointed_thing, pole.max_use)
|
||||
else
|
||||
return {name="fishing:pole_".. pole.name, count=1, wear=0, metadata=""}
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
local pt_under_name = minetest.get_node(pt.under).name
|
||||
if pt_under_name ~= "default:water_source" and pt_under_name ~= "default:water_flowing" then
|
||||
local wear = itemstack:get_wear()
|
||||
--print (wear)
|
||||
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
--local meta1 = minetest.get_meta(pt.under)
|
||||
local meta = minetest.get_meta(pt.above)
|
||||
minetest.set_node(pt.above, {name="fishing:pole_".. pole.name .."_deco", param2=direction})
|
||||
--meta1:set_int("wear", wear)
|
||||
meta:set_int("wear", wear)
|
||||
if not fishing_setting.is_creative_mode then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_node("fishing:pole_".. pole.name .."_deco", {
|
||||
description = pole.desc,
|
||||
inventory_image = "fishing_pole_".. pole.name ..".png",
|
||||
wield_image = "fishing_pole.png^[transformFXR270",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"fishing_pole_".. pole.name .."_simple.png",
|
||||
"fishing_pole_".. pole.name .."_simple.png",
|
||||
"fishing_pole_".. pole.name .."_simple.png",
|
||||
"fishing_pole_".. pole.name .."_simple.png^[transformFX",
|
||||
},
|
||||
groups = { snappy=3, flammable=2, not_in_creative_inventory=1 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ 0 , -1/2 , 0 , 0 , 1/2 , 1 },
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16 , -1/2 , 0 , 1/16 , 1/2 , 1 },
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_dig = function(pos, node, digger)
|
||||
if digger:is_player() and digger:get_inventory() then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local wear_out = meta:get_int("wear")
|
||||
digger:get_inventory():add_item("main", {name="fishing:pole_".. pole.name, count=1, wear=wear_out, metadata=""})
|
||||
end
|
||||
minetest.remove_node(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
|
28
prizes.lua
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fishing_setting.prizes.fish = {
|
||||
{"fishing", "fish_raw", 0, "a Fish.", 1, 60}
|
||||
}
|
||||
|
||||
|
||||
-- Here's what you can prizes
|
||||
fishing_setting.prizes.loose = {
|
||||
-- MoD iTeM WeaR MeSSaGe ("You caught "..) NRMiN CHaNCe (../120)
|
||||
{"default", "stick", 0, "a Twig.", 81, 2},
|
||||
{"mobs", "rat", 0, "a Rat.", 83, 1},
|
||||
{"flowers_plus", "seaweed", 0, "some Seaweed.", 86, 20},
|
||||
{"seaplants", "kelpgreen", 0, "a Green Kelp.", 106, 10},
|
||||
{"farming", "string", 0, "a String.", 116, 2},
|
||||
{"trunks", "twig_1", 0, "a Twig.", 121, 2}
|
||||
}
|
||||
|
||||
|
||||
fishing_setting.prizes.tresor = {
|
||||
{"fishing", "pole_wood", "randomtools", "an old Fishing Pole.", 118, 2},
|
||||
{"3d_armor", "boots_wood", "random", "some very old Boots.", 120, 1}
|
||||
}
|
||||
|
||||
|
3
random_object.lua
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
random_objects = {}
|
9
settings.txt
Normal file
@ -0,0 +1,9 @@
|
||||
MESSAGES = true
|
||||
FISH_CHANCE = 60
|
||||
NEW_WORM_SOURCE = true
|
||||
WORM_IS_MOB = true
|
||||
WORM_CHANCE = 66
|
||||
WEAR_OUT = true
|
||||
BOBBER_CHECK_RADIUS = 5
|
||||
SIMPLE_DECO_FISHING_POLE = true
|
||||
SHARK_CHANCE = 30
|
4
sounds/SoundLicense.txt
Normal file
@ -0,0 +1,4 @@
|
||||
These sounds are used for the Mod for Minetest; Fishing - Mossmanikin's version.
|
||||
The included sounds are http://creativecommons.org/licenses/by-nc-sa/3.0/
|
||||
|
||||
--"fishing_bobber1" & "fishing_bobber2" sampled from "01260 water swimming splashing 1.wav", Attribution Noncommercial License, Robinhood76, http://www.freesound.org/people/Robinhood76/sounds/79657/
|
BIN
sounds/fishing_bobber1.ogg
Normal file
BIN
sounds/fishing_bobber2.ogg
Normal file
BIN
textures/alternates/fishing_bobber.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
textures/alternates/fishing_bobber_bottom.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
textures/alternates/fishing_bobber_top.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
textures/alternates/fishing_pole.png
Normal file
After Width: | Height: | Size: 295 B |
BIN
textures/animal_clownfish_clownfish_item.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
textures/animal_fish_blue_white_fish_blue_white_item.png
Normal file
After Width: | Height: | Size: 317 B |
BIN
textures/fishing_amorce.png
Normal file
After Width: | Height: | Size: 503 B |
BIN
textures/fishing_bait_corn.png
Normal file
After Width: | Height: | Size: 540 B |
BIN
textures/fishing_bobber.png
Normal file
After Width: | Height: | Size: 580 B |
BIN
textures/fishing_bobber_bottom.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
textures/fishing_bobber_feather_1.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
textures/fishing_bobber_top.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
textures/fishing_deco_pike.png
Normal file
After Width: | Height: | Size: 508 B |
BIN
textures/fishing_fish.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
textures/fishing_fish_cooked.png
Normal file
After Width: | Height: | Size: 846 B |
BIN
textures/fishing_particle_amorce.png
Normal file
After Width: | Height: | Size: 180 B |
BIN
textures/fishing_pike.png
Normal file
After Width: | Height: | Size: 297 B |
BIN
textures/fishing_pike_cooked.png
Normal file
After Width: | Height: | Size: 702 B |
BIN
textures/fishing_pole_perfect.png
Normal file
After Width: | Height: | Size: 284 B |
BIN
textures/fishing_pole_perfect_back.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
textures/fishing_pole_perfect_bottom.png
Normal file
After Width: | Height: | Size: 185 B |
BIN
textures/fishing_pole_perfect_front.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
textures/fishing_pole_perfect_simple.png
Normal file
After Width: | Height: | Size: 332 B |
BIN
textures/fishing_pole_perfect_top.png
Normal file
After Width: | Height: | Size: 190 B |
BIN
textures/fishing_pole_wood.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
textures/fishing_pole_wood_back.png
Normal file
After Width: | Height: | Size: 235 B |
BIN
textures/fishing_pole_wood_bottom.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
textures/fishing_pole_wood_deco.png
Normal file
After Width: | Height: | Size: 354 B |
BIN
textures/fishing_pole_wood_front.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
textures/fishing_pole_wood_simple.png
Normal file
After Width: | Height: | Size: 303 B |
BIN
textures/fishing_pole_wood_top.png
Normal file
After Width: | Height: | Size: 197 B |
BIN
textures/fishing_shark.png
Normal file
After Width: | Height: | Size: 389 B |
BIN
textures/fishing_shark_cooked.png
Normal file
After Width: | Height: | Size: 763 B |
BIN
textures/fishing_sushi.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
textures/fishing_trophy_label.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
textures/fishing_worm.png
Normal file
After Width: | Height: | Size: 280 B |
BIN
textures/not_in_use/fishing_bobber_feather_1.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
textures/not_in_use/fishing_bobber_feather_2.png
Normal file
After Width: | Height: | Size: 363 B |
BIN
textures/not_in_use/fishing_bobber_ready.png
Normal file
After Width: | Height: | Size: 222 B |
BIN
textures/not_in_use/fishing_pole_on_use.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
textures/old/fishing_bobber_alternate_old.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
textures/old/fishing_bobber_old.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
textures/old/fishing_pole_wield.png
Normal file
After Width: | Height: | Size: 269 B |
BIN
textures/old/fishing_shark_old6.png
Normal file
After Width: | Height: | Size: 391 B |