Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Exile support #23

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions exchangeclone/alchemical_books.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- 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.

local function extract_dimension(pos)
if exchangeclone.mtg then
if exchangeclone.exile then
return nil, pos
elseif exchangeclone.mtg then
if minetest.get_modpath("nether") then
if pos.y >= nether.DEPTH_FLOOR and pos.y <= nether.DEPTH_CEILING then
return "Nether", pos
Expand All @@ -11,6 +13,7 @@ local function extract_dimension(pos)
end
return nil, pos
end
assert(exchangeclone.mcl)

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

local function add_dimension(dimension, pos)
dimension = dimension:lower()
if exchangeclone.mtg then
if exchangeclone.mtg or exchangeclone.exile then
return pos
end
assert(exchangeclone.mcl)

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

local craftitem = exchangeclone.mcl and "mcl_throwing:ender_pearl" or "default:mese_crystal"

minetest.register_craft({
output = "exchangeclone:basic_alchemical_book",
recipe = {
{"exchangeclone:low_covalence_dust","exchangeclone:red_matter", "exchangeclone:low_covalence_dust"},
{craftitem, exchangeclone.itemstrings.book, "exchangeclone:philosophers_stone"},
{ exchangeclone.itemstrings.ender_pearl, exchangeclone.itemstrings.book, "exchangeclone:philosophers_stone" },
{"exchangeclone:low_covalence_dust","exchangeclone:red_matter", "exchangeclone:low_covalence_dust"},
}
})
Expand All @@ -347,7 +349,7 @@ minetest.register_craft({
output = "exchangeclone:advanced_alchemical_book",
recipe = {
{"exchangeclone:medium_covalence_dust","exchangeclone:pink_matter", "exchangeclone:medium_covalence_dust"},
{craftitem, "exchangeclone:basic_alchemical_book", "exchangeclone:pink_matter"},
{ exchangeclone.itemstrings.ender_pearl, "exchangeclone:basic_alchemical_book", "exchangeclone:pink_matter" },
{"exchangeclone:medium_covalence_dust","exchangeclone:pink_matter", "exchangeclone:medium_covalence_dust"},
}
})
Expand Down
8 changes: 4 additions & 4 deletions exchangeclone/alchemical_chests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ minetest.register_node("exchangeclone:alchemical_chest", {
can_dig = exchangeclone.can_dig,
})

local stone_itemstring = exchangeclone.mcl and "mcl_core:stone" or "default:stone"
local chest_itemstring = exchangeclone.mcl and "mcl_chests:chest" or "default:chest"
local stone_itemstring = exchangeclone.itemstrings.stone
local chest_itemstring = exchangeclone.itemstrings.chest

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

local bag_modifier = "^[multiply:"..color_data.hex
if color == "white" then bag_modifier = "" end
Expand Down
15 changes: 15 additions & 0 deletions exchangeclone/amulets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ local fire_nodes = {
["default:torch"] = true,
["default:torch_ceiling"] = true,
["default:torch_wall"] = true,
["tech:small_wood_fire"] = true,
["tech:large_wood_fire"] = true,
["tech:small_wood_fire_smoldering"] = true,
["tech:large_wood_fire_smoldering"] = true,
["tech:small_charcoal_fire"] = true,
["tech:large_charcoal_fire"] = true,
["tech:small_charcoal_fire_smoldering"] = true,
["tech:large_charcoal_fire_smoldering"] = true,
["tech:torch"] = true,
["tech:torch_wall"] = true,
["tech:torch_ceiling"] = true,
["nodes_nature:lava_source"] = true,
["nodes_nature:lava_flowing"] = true,
["climate:air_temp"] = true,
["climate:air_temp_visible"] = true,
}

local function place_liquid(itemstack, player, pointed_thing)
Expand Down
3 changes: 3 additions & 0 deletions exchangeclone/armor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ if exchangeclone.mcl then
return math.max(0, damage - blocked)
end
end, -100)
elseif exchangeclone.exile then
-- FIXME: add armor
else
assert(exchangeclone.mtg)
for _, matter in pairs({"Dark", "Red"}) do
for piece, place in pairs({Helmet = "head", Chestplate = "torso", Leggings = "legs", Boots = "feet"}) do
local matter_lower = matter:lower()
Expand Down
5 changes: 3 additions & 2 deletions exchangeclone/axes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function exchangeclone.axe_action(itemstack, player, center, force_strip)
if strip and not (exchangeclone.mcla or stripped_variant) then return end
end
local nodes
local groups_to_search = strip and {start_node.name} or {"group:tree", "group:leaves", "group:bamboo_block"}
local groups_to_search = strip and { start_node.name } or
{ "group:tree", "group:leaves", "group:leafdecay", "group:bamboo_block" }
local range_type = strip and "basic_radius" or "large_radius"
if charge > 1 then
local vector1, vector2 = exchangeclone.process_range(player, range_type, charge)
Expand Down Expand Up @@ -71,7 +72,7 @@ local function axe_on_place(itemstack, player, pointed_thing)
if pointed_thing.type == "node" then
local name = minetest.get_node(pointed_thing.under).name
if (minetest.get_item_group(name, "tree") > 0)
or (minetest.get_item_group(name, "bamboo_block") > 0) then
or (minetest.get_item_group(name, "bamboo_block") > 0) then
exchangeclone.axe_action(itemstack, player, pointed_thing.under)
elseif exchangeclone.mcl then
if minetest.registered_items[name]._mcl_stripped_variant then
Expand Down
210 changes: 210 additions & 0 deletions exchangeclone/base_emc_values.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
if exchangeclone.exile then
table.insert_all(exchangeclone.group_values, {
{"log", 32},
{"leafdecay", 1},
{"_ncrafting_bundle", 64},
{"_ncrafting_dye_color", 32},
{"wet_sediment", 1},
})
for itemstring, emc_value in pairs({
["tech:soup"] = 16,

["bones:bones"] = 32,
["lore:exile_letter"] = 32,

["animals:gundu"] = 128,
["animals:pegasun_male"] = 128,
["animals:pegasun"] = 144, -- higher because they lay eggs
["animals:kubwakubwa"] = 144,
["animals:darkasthaan"] = 192,
["animals:sarkamos"] = 256,
["animals:impethu"] = 32,
["animals:sneachan"] = 32,

["animals:gundu_eggs"] = 64,
["animals:pegasun_eggs"] = 32,
["animals:kubwakubwa_eggs"] = 24,
["animals:darkasthaan_eggs"] = 32,
["animals:sarkamos_eggs"] = 64,
["animals:impethu_eggs"] = 16,
["animals:sneachan_eggs"] = 16,

["animals:carcass_invert_small"] = 3,
["animals:carcass_invert_large"] = 10,
["animals:carcass_bird_small"] = 20,
["animals:carcass_fish_small"] = 15,
["animals:carcass_fish_large"] = 45,

["nodes_nature:vansano"] = 32,
["nodes_nature:anperla"] = 32,
["nodes_nature:reshedaar"] = 64,
["nodes_nature:mahal"] = 64,
["nodes_nature:tikusati"] = 32,
["nodes_nature:nebiyi"] = 32,
["nodes_nature:marbhan"] = 32,
["nodes_nature:hakimi"] = 32,
["nodes_nature:merki"] = 32,
["nodes_nature:wiha"] = 32,
["nodes_nature:zufani"] = 32,
["nodes_nature:galanta"] = 32,
["nodes_nature:momo"] = 32,
["nodes_nature:glow_worm"] = 32,
["nodes_nature:lambakap"] = 64,

["nodes_nature:gemedi"] = 16,
["nodes_nature:cana"] = 16,
["nodes_nature:tiken"] = 16,
["nodes_nature:chalin"] = 16,

["nodes_nature:salt_water_source"] = 0.05, -- basically free
["nodes_nature:freshwater_source"] = 64, -- hard to get and doesn't duplicate
['nodes_nature:lava_source'] = 8192, -- because it's so hard to get
['tech:molten_slag_source'] = 8192, -- because it's so hard to get

['nodes_nature:ironstone_boulder'] = 64,
['tech:slag'] = 16,
['nodes_nature:volcanic_ash'] = 1,
['tech:wood_ash'] = 8,
['tech:broken_pottery'] = 8,
['nodes_nature:gneiss_boulder'] = 4,
['tech:clay_water_pot'] = 16,
['tech:cooking_pot'] = 16,
['tech:clay_storage_pot'] = 16,
['tech:clay_oil_lamp_empty'] = 16,

['nodes_nature:jade_boulder'] = 64,

--costly processed materials, expensive tools, crap artifacts (rarity 4)
--['artifacts:moon_glass'] = 64,
['artifacts:antiquorium_ladder'] = 4096 * 7 / 16,
['artifacts:antiquorium_chest'] = 4096 * 4,
--['artifacts:antiquorium'] = 64,
['doors:door_antiquorium'] = 4096 * 4,
['artifacts:trapdoor_antiquorium'] = 4096 * 2,

--['nodes_nature:zufani_seed'] = 64,


--low level artifacts (rarity 5), non-durables
['artifacts:conveyor'] = 256,
['artifacts:trampoline'] = 256,

--['nodes_nature:merki_seed'] = 256,

['artifacts:light_meter'] = 4000,
['artifacts:thermometer'] = 4000,
['artifacts:temp_probe'] = 4000,
['artifacts:fuel_probe'] = 4000,
['artifacts:smelter_probe'] = 4000,
['artifacts:potters_probe'] = 4000,
['artifacts:chefs_probe'] = 4000,
['artifacts:farmers_probe'] = 4000,
['artifacts:animal_probe'] = 4000,

['artifacts:spyglass'] = 256,
['artifacts:bell'] = 256,
['artifacts:waystone'] = 256,
['artifacts:wayfinder_0'] = 256,

--['tech:stick'] = 256,

--['tech:fine_fibre'] = 256,
--['tech:coarse_fibre'] = 256,
--['tech:paint_lime_white'] = 256,
--['tech:paint_glow_paint'] = 256,

['artifacts:sculpture_mg_dancers'] = 256,
['artifacts:sculpture_mg_bonsai'] = 256,
['artifacts:sculpture_mg_bloom'] = 256,
['artifacts:sculpture_j_axeman'] = 256,
['artifacts:sculpture_j_dragon_head'] = 256,
['artifacts:sculpture_j_skull_head'] = 256,

['artifacts:star_stone'] = 256,
['artifacts:singing_stone'] = 256,
['artifacts:drumming_stone'] = 256,

['artifacts:gamepiece_a_black'] = 256,
['artifacts:gamepiece_a_white'] = 256,
['artifacts:gamepiece_b_black'] = 256,
['artifacts:gamepiece_b_white'] = 256,
['artifacts:gamepiece_c_black'] = 256,
['artifacts:gamepiece_c_white'] = 256,

--high level artifacts, and intact non-durables (rarity 6)
--['artifacts:moon_stone'] = 1024,
--['artifacts:sun_stone'] = 1024,

--['tech:fine_fabric'] = 1024,
--['tech:torch'] = 1024,
--['tech:vegetable_oil'] = 1024,
--['tech:coarse_fabric'] = 1024,
--['tech:mattress'] = 32768,

--["backpacks:backpack_fabric_bag"] = 1024,

['artifacts:airboat'] = 8192,
['artifacts:mapping_kit'] = 1024,
['artifacts:antiquorium_chisel'] = 8192,

['artifacts:transporter_key'] = 1024,
['artifacts:transporter_regulator'] = 1024,
['artifacts:transporter_stabilizer'] = 1024,
['artifacts:transporter_focalizer'] = 1024,
['artifacts:transporter_power_dep'] = 1024,
['artifacts:transporter_power'] = 1024,
['artifacts:transporter_pad'] = 1024,
['artifacts:transporter_pad_charging'] = 1024,

--['nodes_nature:lambakap_seed'] = 1024,
--['nodes_nature:reshedaar_seed'] = 1024,
--['nodes_nature:mahal_seed'] = 1024,

['artifacts:sculpture_g_arch_judge'] = 1024,
['artifacts:sculpture_g_arch_beast'] = 1024,
['artifacts:sculpture_g_arch_trickster'] = 1024,
['artifacts:sculpture_g_arch_mother'] = 1024,

['player_api:cloth_female_upper_default'] = 1024,
['player_api:cloth_female_lower_default'] = 1024,
['player_api:cloth_unisex_footwear_default'] = 1024,
['player_api:cloth_female_head_default'] = 1024,
['player_api:cloth_male_upper_default'] = 1024,
['player_api:cloth_male_lower_default'] = 1024,

['artifacts:metastim'] = 100000,

}) do
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or emc_value
end
for _, v in ipairs(plantlist) do
local itemstring = "nodes_nature:"..v[1]
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 16
local itemstring = "nodes_nature:"..v[1].."_seedling"
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 8
end
for _, v in ipairs(searooted_list) do
local itemstring = "nodes_nature:"..v[1]
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 16
end
for _, v in ipairs(rock_list) do
local itemstring = "nodes_nature:"..v[1]
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 4
local itemstring = "nodes_nature:"..v[1].."_boulder"
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 4
exchangeclone.register_alias("nodes_nature:"..v[1].."_cobble2", "nodes_nature:"..v[1].."_cobble1")
exchangeclone.register_alias("nodes_nature:"..v[1].."_cobble2", "nodes_nature:"..v[1].."_cobble3")
end
for _, v in ipairs(sed_list) do
local itemstring = "nodes_nature:"..v[1]
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
end
for _, v in ipairs(stone_list) do
local itemstring = "nodes_nature:"..v[1]
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
local itemstring = "nodes_nature:"..v[1].."_block"
exchangeclone.base_emc_values[itemstring] = exchangeclone.base_emc_values[itemstring] or 1
end
exchangeclone.register_alias("artifacts:antiquorium", "rings:antiquorium")
exchangeclone.register_alias("artifacts:moon_glass", "rings:moon_glass")
end
2 changes: 1 addition & 1 deletion exchangeclone/black_hole_band.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ minetest.register_tool("exchangeclone:void_ring", {
_exchangeclone_pedestal = black_hole_pedestal,
})

local ingredient = exchangeclone.mcl and "mcl_mobitems:string" or "farming:cotton"
local ingredient = exchangeclone.itemstrings.cotton
minetest.register_craft({
output = "exchangeclone:black_hole_band",
recipe = {
Expand Down
2 changes: 1 addition & 1 deletion exchangeclone/covalence_dust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for group, amount in pairs({
exchangeclone.tool_types[group] = exchangeclone.tool_types[group] or amount
end

local charcoal_itemstring = exchangeclone.mcl and "mcl_core:charcoal_lump" or "group:tree"
local charcoal_itemstring = exchangeclone.itemstrings.charcoal

minetest.register_craftitem("exchangeclone:low_covalence_dust", {
description = S("Low Covalence Dust"),
Expand Down
4 changes: 2 additions & 2 deletions exchangeclone/energy_collectors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ local collectors = {
"White",
}

local ingredient = exchangeclone.mcl and "mcl_nether:glowstone" or "default:gold_ingot"
local ingredient = exchangeclone.itemstrings.collector_ingredient

exchangeclone.register_energy_collector(
"exchangeclone:basic_collector",
Expand All @@ -225,7 +225,7 @@ exchangeclone.register_energy_collector(
{{
{ingredient, exchangeclone.itemstrings.glass, ingredient},
{ingredient, "exchangeclone:aeternalis_fuel_block", ingredient},
{ingredient, (exchangeclone.mcl and "mcl_furnaces:furnace" or "default:furnace"), ingredient},
{ingredient, exchangeclone.itemstrings.furnace, ingredient},

}},
5
Expand Down
Loading