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