fire effect only over official goban concrete (tm)

firefx
capitalthree 1 year ago
parent 3e3a0ca98d
commit 001f715f94
  1. 13
      rules.lua

@ -33,6 +33,7 @@ Stype: a go stone of some type
W: full block wall W: full block wall
WE0-WE3: edge concrete WE0-WE3: edge concrete
WC0-WC3: corner concrete WC0-WC3: corner concrete
WB: other goban concrete
--]] --]]
local function _check_position_uncached(pos) local function _check_position_uncached(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
@ -60,6 +61,10 @@ local function _check_position_uncached(pos)
return "WE" .. node.param2 return "WE" .. node.param2
elseif reg_item.pattern_def.name == "corny" then elseif reg_item.pattern_def.name == "corny" then
return "WC" .. node.param2 return "WC" .. node.param2
elseif reg_item.pattern_def.name == "crossy" then
return "WB"
elseif reg_item.pattern_def.name == "starcrossy" then
return "WB"
end end
end end
@ -257,7 +262,13 @@ function lc_liberties.handle_placement(pos)
local proximal_c = 0 local proximal_c = 0
for i2, v2 in pairs(v.stones) do for i2, v2 in pairs(v.stones) do
nodecore.set_loud(v2, {name = "nc_fire:fire"}) local under = check_position(v2 + down)
print(under)
if (under:sub(1, 1) == "W") and (under:len() > 1) then
nodecore.set_loud(v2, {name = "nc_fire:fire"})
else
nodecore.set_loud(v2, {name = "air"})
end
count = count + 1 count = count + 1
if (v2:distance(pos) < 2.3) then if (v2:distance(pos) < 2.3) then
proximal_c = proximal_c + 1 proximal_c = proximal_c + 1

Loading…
Cancel
Save