Skip to content

Commit 8d9aa07

Browse files
authoredFeb 23, 2020
Sort loot registration into respective mods (#2602)
1 parent 34b4103 commit 8d9aa07

File tree

9 files changed

+44
-16
lines changed

9 files changed

+44
-16
lines changed
 

‎mods/bucket/init.lua

+13
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,16 @@ minetest.register_craft({
225225
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
226226
})
227227

228+
-- Register buckets as dungeon loot
229+
if minetest.global_exists("dungeon_loot") then
230+
dungeon_loot.register({
231+
{name = "bucket:bucket_empty", chance = 0.55},
232+
-- water in deserts/ice or above ground, lava otherwise
233+
{name = "bucket:bucket_water", chance = 0.45,
234+
types = {"sandstone", "desert", "ice"}},
235+
{name = "bucket:bucket_water", chance = 0.45, y = {0, 32768},
236+
types = {"normal"}},
237+
{name = "bucket:bucket_lava", chance = 0.45, y = {-32768, -1},
238+
types = {"normal"}},
239+
})
240+
end

‎mods/bucket/mod.conf

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name = bucket
22
description = Minetest Game mod: bucket
33
depends = default
4+
optional_depends = dungeon_loot

‎mods/carts/init.lua

+7
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ carts.path_distance_max = 3
1919
dofile(carts.modpath.."/functions.lua")
2020
dofile(carts.modpath.."/rails.lua")
2121
dofile(carts.modpath.."/cart_entity.lua")
22+
23+
-- Register rails as dungeon loot
24+
if minetest.global_exists("dungeon_loot") then
25+
dungeon_loot.register({
26+
name = "carts:rail", chance = 0.35, count = {1, 6}
27+
})
28+
end

‎mods/carts/mod.conf

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name = carts
22
description = Carts (formerly boost_cart)
33
depends = default, player_api
4+
optional_depends = dungeon_loot

‎mods/dungeon_loot/loot.lua

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
dungeon_loot.registered_loot = {
2-
-- buckets
3-
{name = "bucket:bucket_empty", chance = 0.55},
4-
-- water in deserts/ice or above ground, lava otherwise
5-
{name = "bucket:bucket_water", chance = 0.45,
6-
types = {"sandstone", "desert", "ice"}},
7-
{name = "bucket:bucket_water", chance = 0.45, y = {0, 32768},
8-
types = {"normal"}},
9-
{name = "bucket:bucket_lava", chance = 0.45, y = {-32768, -1},
10-
types = {"normal"}},
1+
-- Loot from the `default` mod is registered here,
2+
-- with the rest being registered in the respective mods
113

4+
dungeon_loot.registered_loot = {
125
-- various items
136
{name = "default:stick", chance = 0.6, count = {3, 6}},
147
{name = "default:flint", chance = 0.4, count = {1, 3}},
15-
{name = "vessels:glass_fragments", chance = 0.35, count = {1, 4}},
16-
{name = "carts:rail", chance = 0.35, count = {1, 6}},
178

189
-- farming / consumable
19-
{name = "farming:string", chance = 0.5, count = {1, 8}},
20-
{name = "farming:wheat", chance = 0.5, count = {2, 5}},
2110
{name = "default:apple", chance = 0.4, count = {1, 4}},
22-
{name = "farming:seed_cotton", chance = 0.4, count = {1, 4},
23-
types = {"normal"}},
2411
{name = "default:cactus", chance = 0.4, count = {1, 4},
2512
types = {"sandstone", "desert"}},
2613

‎mods/farming/init.lua

+10
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,13 @@ minetest.register_craft({
144144
recipe = "farming:hoe_wood",
145145
burntime = 5,
146146
})
147+
148+
-- Register farming items as dungeon loot
149+
if minetest.global_exists("dungeon_loot") then
150+
dungeon_loot.register({
151+
{name = "farming:string", chance = 0.5, count = {1, 8}},
152+
{name = "farming:wheat", chance = 0.5, count = {2, 5}},
153+
{name = "farming:seed_cotton", chance = 0.4, count = {1, 4},
154+
types = {"normal"}},
155+
})
156+
end

‎mods/farming/mod.conf

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name = farming
22
description = Minetest Game mod: farming
33
depends = default, wool, stairs
4+
optional_depends = dungeon_loot

‎mods/vessels/init.lua

+7
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,10 @@ minetest.register_craft({
228228
recipe = "vessels:shelf",
229229
burntime = 30,
230230
})
231+
232+
-- Register glass fragments as dungeon loot
233+
if minetest.global_exists("dungeon_loot") then
234+
dungeon_loot.register({
235+
name = "vessels:glass_fragments", chance = 0.35, count = {1, 4}
236+
})
237+
end

‎mods/vessels/mod.conf

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name = vessels
22
description = Minetest Game mod: vessels
33
depends = default
4+
optional_depends = dungeon_loot

0 commit comments

Comments
 (0)
Please sign in to comment.