mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-29 21:47:08 +02:00
Merge pull request #245 from ComfyFactory/mtn_v3
fix collapse and shuffle the zones more
This commit is contained in:
commit
28fba9ac7e
@ -276,6 +276,10 @@ local function distance(player)
|
|||||||
Task.set_timeout_in_ticks(550, collapse_message, data)
|
Task.set_timeout_in_ticks(550, collapse_message, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Collapse.start_now() then
|
||||||
|
clear_breach_text_and_render()
|
||||||
|
end
|
||||||
|
|
||||||
RPG.set_value_to_player(index, 'bonus', bonus + 1)
|
RPG.set_value_to_player(index, 'bonus', bonus + 1)
|
||||||
|
|
||||||
RPG.gain_xp(player, bonus_xp_on_join * bonus)
|
RPG.gain_xp(player, bonus_xp_on_join * bonus)
|
||||||
|
@ -341,7 +341,7 @@ local function wall(p, data)
|
|||||||
force = 'player',
|
force = 'player',
|
||||||
callback = stone_wall
|
callback = stone_wall
|
||||||
}
|
}
|
||||||
if not alert_zone_1 then
|
if not alert_zone_1 and data.y >= -zone_settings.zone_depth then
|
||||||
local x_min = -zone_settings.zone_width / 2
|
local x_min = -zone_settings.zone_width / 2
|
||||||
local x_max = zone_settings.zone_width / 2
|
local x_max = zone_settings.zone_width / 2
|
||||||
WPT.set('zone1_beam1', surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}}))
|
WPT.set('zone1_beam1', surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}}))
|
||||||
@ -2568,8 +2568,21 @@ local function init_terrain(adjusted_zones)
|
|||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
adjusted_zones.size = count
|
count = count - 1
|
||||||
adjusted_zones.shuffled_zones = shuffled_zones
|
|
||||||
|
local shuffle_again = {}
|
||||||
|
|
||||||
|
local size = 132
|
||||||
|
|
||||||
|
for inc = 1, size do
|
||||||
|
local map = shuffled_zones[random(1, count)]
|
||||||
|
if map then
|
||||||
|
shuffle_again[inc] = map
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
adjusted_zones.size = size
|
||||||
|
adjusted_zones.shuffled_zones = shuffle_again
|
||||||
adjusted_zones.init_terrain = true
|
adjusted_zones.init_terrain = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user