-
Notifications
You must be signed in to change notification settings - Fork 10
/
init.lua
204 lines (178 loc) · 7.85 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
-----------------------------------------------------------
--
-- Water_life copyright 2024 by Gundul
-- see software and media licenses in the doc folder
--
-----------------------------------------------------------
water_life = {}
water_life.version = "240401"
water_life.shark_food = {}
water_life.repellant = {}
water_life.gull_bait = {}
water_life.no_spawn_table = {}
water_life.catchNet = "water_life:placeholder"
water_life.petz = minetest.get_modpath("petz")
water_life.mobsredo = minetest.get_modpath("mobs")
water_life.farming = minetest.get_modpath("farming")
water_life.swampz = minetest.get_modpath("swaz")
water_life.abr = tonumber(minetest.settings:get('active_block_range')) or 2
water_life.abo = tonumber(minetest.settings:get('active_object_send_range_blocks')) or 2
water_life.avg_dtime = 0
water_life.max_dtime = 0
-- settingtypes
water_life.whale_spawn_rate = tonumber(minetest.settings:get("water_life_whale_spawn_rate")) or 100
water_life.shark_spawn_rate = tonumber(minetest.settings:get("water_life_shark_spawn_rate")) or 100
water_life.urchin_spawn_rate = tonumber(minetest.settings:get("water_life_urchin_spawn_rate")) or 700
water_life.clams_spawn_rate = tonumber(minetest.settings:get("water_life_clams_spawn_rate")) or 500
water_life.fish_spawn_rate = tonumber(minetest.settings:get("water_life_fish_spawn_rate")) or 1000
water_life.maxwhales = tonumber(minetest.settings:get("water_life_maxwhales")) or 1
water_life.maxsharks = tonumber(minetest.settings:get("water_life_maxsharks")) or 5
water_life.maxmobs = tonumber(minetest.settings:get("water_life_maxmobs")) or 60
water_life.apionly = minetest.settings:get_bool("water_life_apionly") or false
water_life.dangerous = minetest.settings:get_bool("water_life_dangerous") or false
water_life.soundadjust = tonumber(minetest.settings:get("water_life_soundadjust")) or 1.0
-- lifetime in sec. ( <15 = no reproducing)
water_life.moskitolifetime = tonumber(minetest.settings:get("water_life_moskitolifetime")) or 120
water_life.moskito_minpos = tonumber(minetest.settings:get("water_life_moskito_minpos")) or -10
water_life.moskito_maxpos = tonumber(minetest.settings:get("water_life_moskito_maxpos")) or 100
water_life.moskito_lightmax = tonumber(minetest.settings:get("water_life_moskito_lightmax")) or 8
water_life.moskito_humidity = tonumber(minetest.settings:get("water_life_moskito_humidity")) or 200
water_life.moskito_mintemp = tonumber(minetest.settings:get("water_life_moskito_mintemp")) or 20
water_life.radar_debug = minetest.settings:get_bool("water_life_radar_debug") or false
water_life.muddy_water = minetest.settings:get_bool("water_life_muddy_water") or true
-- the repellent lasts half a minetest day
water_life.repeltime = math.floor (720 / (tonumber(minetest.settings:get("time_speed")) or 72)*60)
-- 5 days savety from rattlenakes for new players
water_life.newplayerbonus = tonumber(minetest.settings:get("water_life_newplayerbonus")) or 5
water_life.ihateinsects = minetest.settings:get_bool("water_life_hate_insects") or false
-- let there be blood !
water_life.bloody = minetest.settings:get_bool("water_life_bloody") or true
-- add god priv
water_life.godLike = minetest.settings:get_bool("water_life_godLike") or true
-- turn spawning off and let a third party mod taking control
water_life.noSpawn = minetest.settings:get_bool("water_life_nospawn ") or false
local path = minetest.get_modpath(minetest.get_current_modname())
-- load water_life api
dofile(path.."/api.lua")
dofile(path.."/compat.lua")
-- load pathfinding
dofile(path.."/paths.lua")
-- load muddy_water
if water_life.muddy_water then dofile(path.."/mapgen.lua") end
dofile(path.."/crafts.lua")
dofile(path.."/tools/buoy.lua")
dofile(path.."/chatcommands.lua")
dofile(path.."/behaviors.lua")
dofile(path.."/bio.lua")
if not water_life.apionly then
dofile(path.."/hud.lua")
if (not water_life.noSpawn) then
dofile(path.."/spawn.lua")
end
dofile(path.."/animals/whale.lua")
dofile(path.."/animals/riverfish.lua")
dofile(path.."/animals/sea_urchin.lua")
dofile(path.."/animals/clams.lua")
dofile(path.."/flora/plants.lua")
dofile(path.."/flora/corals.lua")
dofile(path.."/animals/jellyfish.lua")
dofile(path.."/animals/coralfish.lua")
dofile(path.."/animals/clownfish.lua")
dofile(path.."/animals/gulls.lua")
dofile(path.."/animals/gecko.lua")
dofile(path.."/animals/beaver.lua")
dofile(path.."/animals/hippo.lua")
if not water_life.dangerous then
dofile(path.."/animals/snake.lua")
dofile(path.."/animals/piranha.lua")
dofile(path.."/animals/shark.lua")
dofile(path.."/animals/crocodile.lua")
dofile(path.."/animals/moskito.lua")
if water_life.swampz then
dofile(path.."/animals/alligator.lua")
end
end
end
--check which lasso to use
if water_life.mobsredo then
water_life.catchBA = "mobs:lasso"
water_life.catchNet = "mobs:net"
if water_life.petz then minetest.unregister_item("petz:lasso") end
elseif water_life.petz then
water_life.catchBA = "petz:lasso"
else
water_life.catchBA = "water_life:lasso"
end
math.randomseed(os.time()) --init random seed
--remove old sharks
minetest.register_entity(":sharks:shark", {
on_activate = function(self, staticdata)
self.object:remove()
end,
})
minetest.register_entity(":zombiestrd:shark", {
on_activate = function(self, staticdata)
self.object:remove()
end,
})
-- register shark food
if minetest.get_modpath("wildlife") then
water_life.register_shark_food("wildlife:deer")
water_life.register_shark_food("wildlife:deer_tamed")
water_life.register_shark_food("wildlife:wolf")
end
if minetest.get_modpath("aerotest") then
water_life.register_shark_food("aerotest:eagle")
end
if minetest.get_modpath("petz") then
water_life.register_shark_food("petz:kitty")
water_life.register_shark_food("petz:rat")
water_life.register_shark_food("petz:goat")
water_life.register_shark_food("petz:puppy")
water_life.register_shark_food("petz:ducky")
water_life.register_shark_food("petz:lamb")
water_life.register_shark_food("petz:camel")
water_life.register_shark_food("petz:calf")
water_life.register_shark_food("petz:chicken")
water_life.register_shark_food("petz:piggy")
water_life.register_shark_food("petz:hamster")
water_life.register_shark_food("petz:chimp")
water_life.register_shark_food("petz:beaver")
water_life.register_shark_food("petz:turtle")
water_life.register_shark_food("petz:penguin")
water_life.register_shark_food("petz:lion")
water_life.register_shark_food("petz:grizzly")
water_life.register_shark_food("petz:pony")
water_life.register_shark_food("petz:wolf")
water_life.register_shark_food("petz:elephant")
water_life.register_shark_food("petz:elephant_female")
water_life.register_shark_food("petz:foxy")
water_life.register_shark_food("petz:polar_bear")
water_life.register_shark_food("petz:tarantula")
water_life.register_shark_food("petz:leopard")
water_life.register_shark_food("petz:snow_leopard")
water_life.register_shark_food("petz:panda")
water_life.register_shark_food("petz:santa_killer")
water_life.register_shark_food("petz:mr_pumpkin")
water_life.register_shark_food("petz:hen")
water_life.register_shark_food("petz:rooster")
end
if minetest.get_modpath("better_fauna") then
water_life.register_shark_food("better_fauna:chicken")
water_life.register_shark_food("better_fauna:cow")
water_life.register_shark_food("better_fauna:pig")
water_life.register_shark_food("better_fauna:sheep")
water_life.register_shark_food("better_fauna:turkey")
end
-- register gull bait
water_life.register_gull_bait("water_life:clownfish")
water_life.register_gull_bait("water_life:coralfish")
water_life.register_gull_bait("water_life:riverfish")
water_life.register_gull_bait("water_life:piranha")
water_life.register_gull_bait("water_life:urchin_item")
water_life.register_gull_bait("water_life:snake_item")
water_life.register_gull_bait("water_life:meat_raw")
water_life.register_gull_bait("water_life:meat")
if minetest.get_modpath("farming") then
water_life.register_gull_bait("farming:bread")
end