added smaller territory marker stones for scoring

firefx
capitalthree 1 year ago
parent 7fda1cf06a
commit 6a77451fc0
  1. 6
      rules.lua
  2. 54
      stones.lua

@ -156,7 +156,7 @@ end
function lc_liberties.handle_placement(pos) function lc_liberties.handle_placement(pos)
cache = {} cache = {}
minetest.chat_send_all(tostring(pos)) --minetest.chat_send_all(tostring(pos))
--nodecore.node_sound(pos, "dug") --nodecore.node_sound(pos, "dug")
local our_stone = check_position(pos) local our_stone = check_position(pos)
@ -211,7 +211,7 @@ function lc_liberties.handle_placement(pos)
local stack_max = minetest.registered_items[stone].stack_max local stack_max = minetest.registered_items[stone].stack_max
while count > 0 do while count > 0 do
nodecore.item_eject(proximal, stone .. " " .. math.min(count, stack_max)) nodecore.item_eject(proximal, stone .. " " .. math.min(count, stack_max), 3)
count = count - stack_max count = count - stack_max
end end
end end
@ -221,7 +221,7 @@ function lc_liberties.handle_placement(pos)
if captures.capture then if captures.capture then
local stone = minetest.get_node(pos).name local stone = minetest.get_node(pos).name
nodecore.set_loud(pos, {name = "air"}) nodecore.set_loud(pos, {name = "air"})
nodecore.item_eject(pos, stone) nodecore.item_eject(pos, stone, 5)
end end
end end
end end

@ -71,8 +71,47 @@ local function reg(name, basename, basedef)
on_construct = lc_liberties.handle_placement on_construct = lc_liberties.handle_placement
}) })
local territory_name = modname .. ":territory_" .. string_lower(name)
minetest.register_node(":" .. territory_name, {
description = "Territory Marker",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-2/16, -8/16, -2/16, 2/16, -7/16, 2/16},
{-3/16, -7/16, -3/16, 3/16, -6/16, 3/16},
{-2/16, -6/16, -2/16, 2/16, -5/16, 2/16},
}
},
selection_box = {
type = "fixed",
fixed = {-6/16, -8/16, -6/16, 6/16, 0/16, 6/16}
},
tiles = {
basedef.tiles[1]
},
paramtype = "light",
sunlight_propagates = true,
groups = {
snappy = 1,
falling_node = 1,
falling_repose = 1,
},
go_team = name,
sounds = basedef.sounds,
})
nodecore.register_craft({ nodecore.register_craft({
label = "shave " .. string_lower(desc) .. " into stones", label = "Chop scored cement into go stones",
action = "pummel", action = "pummel",
toolgroups = {choppy = 3}, toolgroups = {choppy = 3},
nodes = { nodes = {
@ -83,6 +122,19 @@ local function reg(name, basename, basedef)
}, },
items = {{name = piecename, count = 3, scatter = 4}}, items = {{name = piecename, count = 3, scatter = 4}},
}) })
nodecore.register_craft({
label = "Smash go stones into territory markers",
action = "pummel",
toolgroups = {thumpy = 3},
nodes = {
{
match = piecename,
replace = "air"
}
},
items = {{name = territory_name, count = 9, scatter = 4}},
})
end end
local function buildall() local function buildall()

Loading…
Cancel
Save