smoke effect for captures, on captured stones, and increased smoke for capturing stone

master
capitalthree 1 year ago
parent 0a2a4e4cda
commit f08ed693cf
  1. 15
      rules.lua

@ -29,9 +29,9 @@ local solid_drawtypes = {
local smokecontrol local smokecontrol
if nodecore.smokeclear then if nodecore.smokeclear then
smokecontrol = function(pos, smoke) smokecontrol = function(pos, smoke,smoke2)
if smoke then if smoke then
nodecore.smokefx(pos, 300, 2) nodecore.smokefx(pos, smoke, smoke2 or 1)
else else
nodecore.smokeclear(pos) nodecore.smokeclear(pos)
end end
@ -293,6 +293,7 @@ function lc_liberties.handle_placement(pos)
end end
end end
local allcaptured = {}
if captured then if captured then
for i,v in pairs(captureses) do for i,v in pairs(captureses) do
if v.capture then if v.capture then
@ -303,6 +304,8 @@ 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
allcaptured[#allcaptured + 1] = v2
local under = check_position(v2 + down) local under = check_position(v2 + down)
if (under:sub(1, 1) == "W") and (under:len() > 1) then if (under:sub(1, 1) == "W") and (under:len() > 1) then
nodecore.sound_play("nc_fire_ignite", {gain = 1, pos = pos}) nodecore.sound_play("nc_fire_ignite", {gain = 1, pos = pos})
@ -341,7 +344,13 @@ function lc_liberties.handle_placement(pos)
end end
end end
smokecontrol(pos, 1) smokecontrol(pos, 300, 2+#allcaptured)
for i = #allcaptured, 1, -1 do
local chosen = math.random(1, i)
smokecontrol(allcaptured[chosen], 90)
allcaptured[chosen] = allcaptured[i]
end
end end
function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing) function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing)

Loading…
Cancel
Save