Fix casting, change iron to steel

This commit is contained in:
Evert Prants 2018-04-04 18:31:12 +03:00
parent 20179aed71
commit b9cf10bd3d
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
4 changed files with 9 additions and 7 deletions

View File

@ -6,7 +6,7 @@ This repository is technically a modpack, in which all mods need to be enabled.
### fluidity
![](fluidity/screenshot.png)
Fluidity adds molten metals to the game. Supports metals from [default](https://github.com/minetest/minetest_game), [technic](https://github.com/minetest-mods/technic) and [moreores](https://github.com/minetest-mods/technic).
Fluidity adds molten metals to the game. Supports metals from [default](https://github.com/minetest/minetest_game), [technic](https://github.com/minetest-mods/technic) and [moreores](https://github.com/minetest-mods/moreores).
### metal_melter
![](metal_melter/screenshot.png)

View File

@ -203,7 +203,7 @@ end
-- Get the corresponding cast for an item
local function get_cast_for(item)
local typename, castname = item:match(":([%a_]+)_(%a+)$")
local typename, castname = item:match("(%a+)_([%a_]+)$")
if not typename or not castname then
return nil
end
@ -312,14 +312,15 @@ local function caster_node_timer(pos, elapsed)
end
end
end
elseif castname:find("_ingot") or castname:find("_crystal") or castname:find("_lump") and metal_type == "gold" then
else
-- Create a new cast
local result_cost = metal_caster.spec.cast
local coolant_cost = result_cost / 4
if metal_count >= result_cost and coolant_count >= coolant_cost then
local mtype, ctype = get_cast_for(castname)
if mtype then
local stack = ItemStack("metal_melter:"..ctype)
local cmod = metal_caster.casts[ctype].mod or "metal_melter"
local stack = ItemStack(cmod..":"..ctype)
local output_stack = inv:get_stack("output", 1)
local cast_stack = inv:get_stack("cast", 1)
if output_stack:item_fits(stack) then

View File

@ -30,7 +30,7 @@ local modifiers = {
{name = "stonebound", description = "Stonebound"}
}
},
iron = {
steel = {
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2},
snappy = {times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
@ -240,7 +240,7 @@ tinkering.materials = {
obsidian = {name = "Obsidian", default = "default:obsidian", color = "#2C384E", base = "node", cast = true, modifier = modifiers.obsidian},
-- Metals
iron = {name = "Iron", default = "default:steel_ingot", color = "#FFF", base = "ingot", cast = true, modifier = modifiers.iron},
steel = {name = "Steel", default = "default:steel_ingot", color = "#FFF", base = "ingot", cast = true, modifier = modifiers.steel},
copper = {name = "Copper", default = "default:copper_ingot", color = "#E87945", base = "ingot", cast = true, modifier = modifiers.copper},
tin = {name = "Tin", default = "default:tin_ingot", color = "#C1C1C1", base = "ingot", cast = true, modifier = modifiers.tin},
gold = {name = "Gold", default = "default:gold_ingot", color = "#FFFF54", base = "ingot", cast = true, modifier = modifiers.gold},

View File

@ -365,7 +365,8 @@ for i,v in pairs(components) do
name = v.description:sub(4).." Cast",
mod = "tinkering",
result = "%s:%s_"..i,
cost = metal_caster.spec.cast
cost = metal_caster.spec.cast,
typenames = {i}
})
end