enable crafting go stones with crossy as well as starcrossy

pull/5/head
capitalthree 1 year ago
parent 78da25d42b
commit d788495988
  1. 4
      rules.lua
  2. 31
      stones.lua

@ -295,8 +295,6 @@ function lc_liberties.handle_placement(pos)
end
function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing)
cache = {}
if (placer.get_player_control and placer:get_player_control().aux1)
or
(pointed_thing and pointed_thing.under and minetest.get_node(pointed_thing.under).name == "nc_items:stack")
@ -305,6 +303,8 @@ function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing)
end
if pointed_thing and pointed_thing.above then
cache = {}
local territories = territory_search(pointed_thing.above, itemstack:get_count())
if territories.team then
local piece = modname .. ":territory_" .. territories.team

@ -9,6 +9,23 @@ include("rules")
local modname = minetest.get_current_modname()
local function reg_stone_craft(name, pattern)
local piecename = modname .. ":stone_" .. string_lower(name)
nodecore.register_craft({
label = "Chop scored cement into go stones",
action = "pummel",
toolgroups = {choppy = 3},
nodes = {
{
match = "nc_concrete:" .. name .. "_" .. pattern .. "_ply",
replace = "air"
}
},
items = {{name = piecename, count = 3, scatter = 4}},
})
end
local function reg(name, basename, basedef)
local piecename = modname .. ":stone_" .. string_lower(name)
if minetest.registered_nodes[piecename] then return end
@ -119,18 +136,8 @@ local function reg(name, basename, basedef)
on_dig = lc_liberties.handle_dig,
})
nodecore.register_craft({
label = "Chop scored cement into go stones",
action = "pummel",
toolgroups = {choppy = 3},
nodes = {
{
match = "nc_concrete:" .. name .. "_starcrossy_ply",
replace = "air"
}
},
items = {{name = piecename, count = 3, scatter = 4}},
})
reg_stone_craft(name, "crossy")
reg_stone_craft(name, "starcrossy")
nodecore.register_craft({
label = "Smash go stones into territory markers",

Loading…
Cancel
Save