Skip to content

Commit f5fdf0e

Browse files
WIP adding Exile support
1 parent 4064eb7 commit f5fdf0e

File tree

15 files changed

+765
-64
lines changed

15 files changed

+765
-64
lines changed

exchangeclone/alchemical_books.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
-- There's a lot of duplicated code in this file, but removing it means adding more duplicated code... so I'm just going to leave it.
22

33
local function extract_dimension(pos)
4-
if exchangeclone.mtg then
4+
if exchangeclone.exile then
5+
return nil, pos
6+
elseif exchangeclone.mtg then
57
if minetest.get_modpath("nether") then
68
if pos.y >= nether.DEPTH_FLOOR and pos.y <= nether.DEPTH_CEILING then
79
return "Nether", pos
@@ -11,6 +13,7 @@ local function extract_dimension(pos)
1113
end
1214
return nil, pos
1315
end
16+
assert(exchangeclone.mcl)
1417

1518
-- overworld
1619
if (pos.y >= mcl_vars.mg_overworld_min) and (pos.y <= mcl_vars.mg_overworld_max) then
@@ -35,9 +38,10 @@ end
3538

3639
local function add_dimension(dimension, pos)
3740
dimension = dimension:lower()
38-
if exchangeclone.mtg then
41+
if exchangeclone.mtg or exchangeclone.exile then
3942
return pos
4043
end
44+
assert(exchangeclone.mcl)
4145

4246
if dimension == "nether" then
4347
local report_y = pos.y + mcl_vars.mg_nether_min
@@ -332,13 +336,11 @@ minetest.register_tool("exchangeclone:arcane_alchemical_book", {
332336
on_place = alchemical_book_function
333337
})
334338

335-
local craftitem = exchangeclone.mcl and "mcl_throwing:ender_pearl" or "default:mese_crystal"
336-
337339
minetest.register_craft({
338340
output = "exchangeclone:basic_alchemical_book",
339341
recipe = {
340342
{"exchangeclone:low_covalence_dust","exchangeclone:red_matter", "exchangeclone:low_covalence_dust"},
341-
{craftitem, exchangeclone.itemstrings.book, "exchangeclone:philosophers_stone"},
343+
{ exchangeclone.itemstrings.ender_pearl, exchangeclone.itemstrings.book, "exchangeclone:philosophers_stone" },
342344
{"exchangeclone:low_covalence_dust","exchangeclone:red_matter", "exchangeclone:low_covalence_dust"},
343345
}
344346
})
@@ -347,7 +349,7 @@ minetest.register_craft({
347349
output = "exchangeclone:advanced_alchemical_book",
348350
recipe = {
349351
{"exchangeclone:medium_covalence_dust","exchangeclone:pink_matter", "exchangeclone:medium_covalence_dust"},
350-
{craftitem, "exchangeclone:basic_alchemical_book", "exchangeclone:pink_matter"},
352+
{ exchangeclone.itemstrings.ender_pearl, "exchangeclone:basic_alchemical_book", "exchangeclone:pink_matter" },
351353
{"exchangeclone:medium_covalence_dust","exchangeclone:pink_matter", "exchangeclone:medium_covalence_dust"},
352354
}
353355
})

exchangeclone/alchemical_chests.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ minetest.register_node("exchangeclone:alchemical_chest", {
7575
can_dig = exchangeclone.can_dig,
7676
})
7777

78-
local stone_itemstring = exchangeclone.mcl and "mcl_core:stone" or "default:stone"
79-
local chest_itemstring = exchangeclone.mcl and "mcl_chests:chest" or "default:chest"
78+
local stone_itemstring = exchangeclone.itemstrings.stone
79+
local chest_itemstring = exchangeclone.itemstrings.chest
8080

8181
minetest.register_craft({
8282
output = "exchangeclone:alchemical_chest",
@@ -98,8 +98,8 @@ end)
9898
for color, color_data in pairs(exchangeclone.colors) do
9999
local bag_itemstring = "exchangeclone:alchemical_bag_"..color
100100
local advanced_itemstring = "exchangeclone:advanced_alchemical_chest_"..color
101-
local wool_itemstring = (exchangeclone.mcl and "mcl_wool:" or "wool:")..color
102-
local dye_itemstring = (exchangeclone.mcl and "mcl_dye:" or "dye:")..color
101+
local wool_itemstring = exchangeclone.itemstrings.wool_prefix .. color
102+
local dye_itemstring = exchangeclone.itemstrings.dye_prefix .. color
103103

104104
local bag_modifier = "^[multiply:"..color_data.hex
105105
if color == "white" then bag_modifier = "" end

exchangeclone/amulets.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ local fire_nodes = {
1111
["default:torch"] = true,
1212
["default:torch_ceiling"] = true,
1313
["default:torch_wall"] = true,
14+
["tech:small_wood_fire"] = true,
15+
["tech:large_wood_fire"] = true,
16+
["tech:small_wood_fire_smoldering"] = true,
17+
["tech:large_wood_fire_smoldering"] = true,
18+
["tech:small_charcoal_fire"] = true,
19+
["tech:large_charcoal_fire"] = true,
20+
["tech:small_charcoal_fire_smoldering"] = true,
21+
["tech:large_charcoal_fire_smoldering"] = true,
22+
["tech:torch"] = true,
23+
["tech:torch_wall"] = true,
24+
["tech:torch_ceiling"] = true,
25+
["nodes_nature:lava_source"] = true,
26+
["nodes_nature:lava_flowing"] = true,
27+
["climate:air_temp"] = true,
28+
["climate:air_temp_visible"] = true,
1429
}
1530

1631
local function place_liquid(itemstack, player, pointed_thing)

exchangeclone/armor.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ if exchangeclone.mcl then
199199
return math.max(0, damage - blocked)
200200
end
201201
end, -100)
202+
elseif exchangeclone.exile then
203+
-- FIXME: add armor
202204
else
205+
assert(exchangeclone.mtg)
203206
for _, matter in pairs({"Dark", "Red"}) do
204207
for piece, place in pairs({Helmet = "head", Chestplate = "torso", Leggings = "legs", Boots = "feet"}) do
205208
local matter_lower = matter:lower()

exchangeclone/axes.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function exchangeclone.axe_action(itemstack, player, center, force_strip)
1818
if strip and not (exchangeclone.mcla or stripped_variant) then return end
1919
end
2020
local nodes
21-
local groups_to_search = strip and {start_node.name} or {"group:tree", "group:leaves", "group:bamboo_block"}
21+
local groups_to_search = strip and { start_node.name } or
22+
{ "group:tree", "group:leaves", "group:leafdecay", "group:bamboo_block" }
2223
local range_type = strip and "basic_radius" or "large_radius"
2324
if charge > 1 then
2425
local vector1, vector2 = exchangeclone.process_range(player, range_type, charge)
@@ -71,7 +72,7 @@ local function axe_on_place(itemstack, player, pointed_thing)
7172
if pointed_thing.type == "node" then
7273
local name = minetest.get_node(pointed_thing.under).name
7374
if (minetest.get_item_group(name, "tree") > 0)
74-
or (minetest.get_item_group(name, "bamboo_block") > 0) then
75+
or (minetest.get_item_group(name, "bamboo_block") > 0) then
7576
exchangeclone.axe_action(itemstack, player, pointed_thing.under)
7677
elseif exchangeclone.mcl then
7778
if minetest.registered_items[name]._mcl_stripped_variant then

exchangeclone/base_emc_values.lua

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
if exchangeclone.exile then
2+
table.insert_all(exchangeclone.group_values, {
3+
{"log", 32},
4+
{"leafdecay", 1},
5+
{"_ncrafting_bundle", 64},
6+
{"_ncrafting_dye_color", 32},
7+
{"air", 0},
8+
})
9+
for itemstring, emc_value in pairs({
10+
["tech:soup"] = 16,
11+
12+
["bones:bones"] = 32,
13+
["lore:exile_letter"] = 32,
14+
15+
["animals:impethu"] = 32,
16+
["animals:impethu_eggs"] = 8,
17+
18+
["nodes_nature:vansano"] = 32,
19+
["nodes_nature:anperla"] = 32,
20+
["nodes_nature:reshedaar"] = 64,
21+
["nodes_nature:mahal"] = 64,
22+
["nodes_nature:tikusati"] = 32,
23+
["nodes_nature:nebiyi"] = 32,
24+
["nodes_nature:marbhan"] = 32,
25+
["nodes_nature:hakimi"] = 32,
26+
["nodes_nature:merki"] = 32,
27+
["nodes_nature:wiha"] = 32,
28+
["nodes_nature:zufani"] = 32,
29+
["nodes_nature:galanta"] = 32,
30+
["nodes_nature:momo"] = 32,
31+
["nodes_nature:glow_worm"] = 32,
32+
["nodes_nature:lambakap"] = 64,
33+
34+
["nodes_nature:gemedi"] = 16,
35+
["nodes_nature:cana"] = 16,
36+
["nodes_nature:tiken"] = 16,
37+
["nodes_nature:chalin"] = 16,
38+
39+
["nodes_nature:salt_water_source"] = 0.05, -- basically free
40+
["nodes_nature:freshwater_source"] = 64, -- hard to get and doesn't duplicate
41+
['nodes_nature:lava_source'] = 8192, -- because it's so hard to get
42+
['tech:molten_slag_source'] = 8192, -- because it's so hard to get
43+
44+
['nodes_nature:ironstone_boulder'] = 64,
45+
['nodes_nature:volcanic_ash'] = 1,
46+
['tech:wood_ash'] = 8,
47+
['tech:potash_source'] = 32,
48+
['tech:broken_pottery'] = 8,
49+
['nodes_nature:gneiss_boulder'] = 4,
50+
['tech:clay_water_pot'] = 16,
51+
['tech:cooking_pot'] = 16,
52+
['tech:clay_storage_pot'] = 16,
53+
['tech:clay_oil_lamp_empty'] = 16,
54+
['tech:charcoal'] = 128,
55+
56+
['nodes_nature:jade_boulder'] = 64,
57+
58+
--costly processed materials, expensive tools, crap artifacts (rarity 4)
59+
--['artifacts:moon_glass'] = 64,
60+
['artifacts:antiquorium_ladder'] = 4096 * 7 / 16,
61+
['artifacts:antiquorium_chest'] = 4096 * 4,
62+
--['artifacts:antiquorium'] = 64,
63+
['doors:door_antiquorium'] = 4096 * 4,
64+
['artifacts:trapdoor_antiquorium'] = 4096 * 2,
65+
66+
--['nodes_nature:zufani_seed'] = 64,
67+
68+
69+
--low level artifacts (rarity 5), non-durables
70+
--['artifacts:conveyor'] = 256,
71+
--['artifacts:trampoline'] = 256,
72+
73+
--['nodes_nature:merki_seed'] = 256,
74+
75+
['artifacts:light_meter'] = 4000,
76+
['artifacts:thermometer'] = 4000,
77+
['artifacts:temp_probe'] = 4000,
78+
['artifacts:fuel_probe'] = 4000,
79+
['artifacts:smelter_probe'] = 4000,
80+
['artifacts:potters_probe'] = 4000,
81+
['artifacts:chefs_probe'] = 4000,
82+
['artifacts:farmers_probe'] = 4000,
83+
['artifacts:animal_probe'] = 4000,
84+
85+
['artifacts:spyglass'] = 256,
86+
['artifacts:bell'] = 256,
87+
['artifacts:waystone'] = 256,
88+
['artifacts:wayfinder_0'] = 256,
89+
90+
--['tech:stick'] = 256,
91+
92+
--['tech:fine_fibre'] = 256,
93+
--['tech:coarse_fibre'] = 256,
94+
--['tech:paint_lime_white'] = 256,
95+
--['tech:paint_glow_paint'] = 256,
96+
97+
['artifacts:sculpture_mg_dancers'] = 256,
98+
['artifacts:sculpture_mg_bonsai'] = 256,
99+
['artifacts:sculpture_mg_bloom'] = 256,
100+
['artifacts:sculpture_j_axeman'] = 256,
101+
['artifacts:sculpture_j_dragon_head'] = 256,
102+
['artifacts:sculpture_j_skull_head'] = 256,
103+
104+
--['artifacts:star_stone'] = 256,
105+
['artifacts:singing_stone'] = 256,
106+
['artifacts:drumming_stone'] = 256,
107+
108+
['artifacts:gamepiece_a_black'] = 256,
109+
['artifacts:gamepiece_a_white'] = 256,
110+
['artifacts:gamepiece_b_black'] = 256,
111+
['artifacts:gamepiece_b_white'] = 256,
112+
['artifacts:gamepiece_c_black'] = 256,
113+
['artifacts:gamepiece_c_white'] = 256,
114+
115+
--high level artifacts, and intact non-durables (rarity 6)
116+
--['artifacts:moon_stone'] = 1024,
117+
--['artifacts:sun_stone'] = 1024,
118+
119+
--['tech:fine_fabric'] = 1024,
120+
--['tech:torch'] = 1024,
121+
--['tech:vegetable_oil'] = 1024,
122+
--['tech:coarse_fabric'] = 1024,
123+
--['tech:mattress'] = 32768,
124+
125+
--["backpacks:backpack_fabric_bag"] = 1024,
126+
127+
['artifacts:airboat'] = 8192,
128+
['artifacts:mapping_kit'] = 1024,
129+
['artifacts:antiquorium_chisel'] = 8192,
130+
131+
['artifacts:transporter_key'] = 1024,
132+
['artifacts:transporter_regulator'] = 1024,
133+
['artifacts:transporter_stabilizer'] = 1024,
134+
['artifacts:transporter_focalizer'] = 1024,
135+
['artifacts:transporter_power_dep'] = 1024,
136+
['artifacts:transporter_power'] = 1024,
137+
['artifacts:transporter_pad'] = 1024,
138+
['artifacts:transporter_pad_charging'] = 1024,
139+
140+
--['nodes_nature:lambakap_seed'] = 1024,
141+
--['nodes_nature:reshedaar_seed'] = 1024,
142+
--['nodes_nature:mahal_seed'] = 1024,
143+
144+
['artifacts:sculpture_g_arch_judge'] = 1024,
145+
['artifacts:sculpture_g_arch_beast'] = 1024,
146+
['artifacts:sculpture_g_arch_trickster'] = 1024,
147+
['artifacts:sculpture_g_arch_mother'] = 1024,
148+
149+
['artifacts:metastim'] = 100000,
150+
151+
}) do
152+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or emc_value
153+
end
154+
for _, v in ipairs(plantlist) do
155+
local itemstring = "nodes_nature:"..v[1]
156+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 16
157+
local itemstring = "nodes_nature:"..v[1].."_seedling"
158+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 8
159+
end
160+
for _, v in ipairs(searooted_list) do
161+
local itemstring = "nodes_nature:"..v[1]
162+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 16
163+
end
164+
for _, v in ipairs(rock_list) do
165+
local itemstring = "nodes_nature:"..v[1]
166+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 4
167+
local itemstring = "nodes_nature:"..v[1].."_boulder"
168+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 4
169+
exchangeclone.register_alias("nodes_nature:"..v[1].."_cobble2", "nodes_nature:"..v[1].."_cobble1")
170+
exchangeclone.register_alias("nodes_nature:"..v[1].."_cobble2", "nodes_nature:"..v[1].."_cobble3")
171+
end
172+
for _, v in ipairs(sed_list) do
173+
local itemstring = "nodes_nature:"..v[1]
174+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
175+
end
176+
for _, v in ipairs(stone_list) do
177+
local itemstring = "nodes_nature:"..v[1]
178+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
179+
local itemstring = "nodes_nature:"..v[1].."_block"
180+
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
181+
end
182+
end

exchangeclone/init.lua

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ local start_time = minetest.get_us_time()
66
minetest.log("action", "[ExchangeClone] Registering own stuff")
77

88
-- Decides what mod to use for sounds
9-
exchangeclone.sound_mod = exchangeclone.mcl and mcl_sounds or default
9+
if exchangeclone.mcl then
10+
exchangeclone.sound_mod = mcl_sounds
11+
elseif exchangeclone.exile then
12+
exchangeclone.sound_mod = {
13+
node_sound_stone_defaults = nodes_nature.node_sound_stone_defaults,
14+
node_sound_metal_defaults = nodes_nature.node_sound_glass_defaults,
15+
node_sound_glass_defaults = nodes_nature.node_sound_glass_defaults,
16+
}
17+
else
18+
assert(exchangeclone.mtg, "unhandled game type")
19+
exchangeclone.sound_mod = default
20+
end
1021

1122
local modpath = minetest.get_modpath("exchangeclone")
1223

@@ -23,7 +34,19 @@ if exchangeclone.mcl then
2334
}
2435
end
2536
end
37+
elseif exchangeclone.exile then
38+
exchangeclone.colors = {} -- FIXME: extract from ncrafting
39+
for name, palette in pairs(bundlelist) do
40+
if name ~= "none" then
41+
exchangeclone.colors[name] = {
42+
name = name,
43+
hex = dye_to_colorstring(palette),
44+
dye = "ncrafting:dye_"..name,
45+
}
46+
end
47+
end
2648
else
49+
assert(exchangeclone.mtg)
2750
-- color hex values taken from MCLA
2851
exchangeclone.colors = {
2952
white = {
@@ -108,6 +131,10 @@ if exchangeclone.mcl2 then
108131
mcl_item_id.set_mod_namespace("exchangeclone")
109132
end
110133

134+
if exchangeclone.exile then
135+
crafting.register_type("exchangeclone_crafting")
136+
end
137+
111138
-- The order is usually unimportant
112139
local files = {
113140
"craftitems",
@@ -139,6 +166,7 @@ local files = {
139166
"dark_matter_pedestal",
140167
"black_hole_band",
141168
"rings",
169+
"base_emc_values",
142170
}
143171

144172
if exchangeclone.mcl or minetest.get_modpath("3d_armor") then

exchangeclone/matter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ minetest.register_craft({
4343
output = "exchangeclone:dark_matter",
4444
recipe = {
4545
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"},
46-
{"exchangeclone:aeternalis_fuel", exchangeclone.mcl and "mcl_core:diamondblock" or 'default:diamondblock', "exchangeclone:aeternalis_fuel"},
46+
{"exchangeclone:aeternalis_fuel", exchangeclone.itemstrings.diamondblock, "exchangeclone:aeternalis_fuel"},
4747
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"}
4848
}
4949
})

exchangeclone/mod.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name = exchangeclone
22
title = ExchangeClone
33
description = The main part of the modpack (depends on both the other mods)
44
depends = zzzz_exchangeclone_init
5-
optional_depends = mcl_core, default, mcl_armor, 3d_armor, mcl_item_id, mobs_mc, hopper, pipeworks, mcl_dispensers, awards
5+
optional_depends = mcl_core, default, mcl_armor, 3d_armor, mcl_item_id, mobs_mc, hopper, pipeworks, mcl_dispensers, awards, exile_env_sounds, nodes_nature, ncrafting, crafting, megamorph
66
author = ThePython10110

0 commit comments

Comments
 (0)