This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
init.lua
executable file
·89 lines (80 loc) · 3.67 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
-----------------------------------------------------------------------------------------------
local title = "Fishing - Crabman77's (MFF team) version"
local version = "1.0.0"
local mname = "fishing"
-----------------------------------------------------------------------------------------------
-- original by wulfsdad (http://forum.minetest.net/viewtopic.php?id=4375)
-- rewrited by Mossmanikin (https://forum.minetest.net/viewtopic.php?id=6480)
-- this version rewrited by Crabman77
-- License (code & textures): WTFPL
-- Contains code from: animal_clownfish, animal_fish_blue_white, fishing (original), stoneage
-- Looked at code from: default, farming
-- Dependencies: default
-- Supports: animal_clownfish, animal_fish_blue_white, animal_rat, mobs
-----------------------------------------------------------------------------------------------
minetest.log("action","[mod fishing] Loading...")
local path = minetest.get_modpath("fishing").."/"
fishing_setting = {}
fishing_setting.func = {}
fishing_setting.is_creative_mode = minetest.setting_getbool("creative_mode")
fishing_setting.file_settings = minetest.get_worldpath() .. "/fishing_config.txt"
fishing_setting.file_trophies = minetest.get_worldpath() .. "/fishing_trophies.txt"
fishing_setting.file_contest = minetest.get_worldpath() .. "/fishing_contest.txt"
fishing_setting.file_planned = minetest.get_worldpath() .. "/fishing_planned.txt"
fishing_setting.settings = {}
fishing_setting.contest = {}
fishing_setting.planned = {}
--for random object
random_objects = {}
fishing_setting.baits = {}
fishing_setting.hungry = {}
fishing_setting.prizes = {}
fishing_setting.trophies = {}
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
fishing_setting.func.S = intllib.Getter(minetest.get_current_modname())
else
fishing_setting.func.S = function ( s ) return s end
end
dofile(path .."settings.txt")
dofile(path .."functions.lua")
--default_settings
fishing_setting.settings["message"] = MESSAGES
fishing_setting.settings["worm_is_mob"] = WORM_IS_MOB
fishing_setting.settings["worm_chance"] = WORM_CHANCE
fishing_setting.settings["new_worm_source"] = NEW_WORM_SOURCE
fishing_setting.settings["wear_out"] = WEAR_OUT
fishing_setting.settings["simple_deco_fishing_pole"] = SIMPLE_DECO_FISHING_POLE
fishing_setting.settings["bobber_view_range"] = BOBBER_VIEW_RANGE
fishing_setting.settings["fish_chance"] = FISH_CHANCE
fishing_setting.settings["shark_chance"] = SHARK_CHANCE
fishing_setting.settings["treasure_chance"] = TREASURE_CHANCE
fishing_setting.settings["treasure_enable"] = TREASURE_RANDOM_ENABLE
fishing_setting.settings["escape_chance"] = ESCAPE_CHANCE
-- to mobs_fish|mobs_sharks modpack
if (minetest.get_modpath("mobs_fish") ~= nil or minetest.get_modpath("mobs_sharks") ~= nil) then
fishing_setting.have_true_fish = true
end
-- load config file if exist in worldpath
fishing_setting.func.load()
dofile(path .."worms.lua")
dofile(path .."crafting.lua")
dofile(path .."baits.lua")
dofile(path .."prizes.lua")
dofile(path .."baitball.lua")
dofile(path .."bobber.lua")
dofile(path .."bobber_shark.lua")
dofile(path .."fishes.lua")
dofile(path .."trophies.lua")
dofile(path .."poles.lua")
--random hungry bait
fishing_setting.func.hungry_random()
--load table caught fish by players
fishing_setting.func.load_trophies()
--load table contest
fishing_setting.func.load_contest()
fishing_setting.func.tick()
fishing_setting.func.planned_tick()
-----------------------------------------------------------------------------------------------
minetest.log("action", "[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------