1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-26 22:56:43 +02:00

Mtn: small fixes

This commit is contained in:
Gerkiz 2024-11-02 22:50:47 +01:00
parent f2741c967e
commit 91ccd63c05
4 changed files with 17 additions and 6 deletions

View File

@ -105,12 +105,15 @@ Commands.new('mtn_set_queue_speed', 'Usable only for admins - sets the queue spe
Commands.new('mtn_complete_quests', 'Usable only for admins - sets the queue speed of this map!')
:require_admin()
:require_validation()
:add_parameter('no_grace', true, 'boolean')
:callback(
function (player)
function (player, args)
Discord.send_notification_raw(Public.discord_name, player.name .. ' completed all the quest via command.')
local stateful = Public.get_stateful()
stateful.objectives_completed_count = 6
Task.set_timeout_in_ticks(50, gather_time_token, {})
if args then
Task.set_timeout_in_ticks(50, gather_time_token, {})
end
game.print(mapkeeper .. player.name .. ', has forced completed all quests!', { r = 0.98, g = 0.66, b = 0.22 })
player.print('Quests completed.')
end

View File

@ -511,6 +511,7 @@ function Public.move_players(current_task)
else
player.teleport({ x = 0, y = 0 }, surface)
end
player.clear_items_inside()
end
current_task.message = 'Moved players to initial surface!'
current_task.delay = game.tick + 200

View File

@ -86,6 +86,10 @@ Event.on_nth_tick(
return
end
if collection.game_won_notified then
return
end
if collection.gather_time and collection.gather_time <= 0 and collection.survive_for and collection.survive_for > 0 then
local spawn_positions = table.deepcopy(Public.get_stateful('stateful_spawn_points'))

View File

@ -146,15 +146,16 @@ local function set_collapse_tiles(surface)
game.forces.player.chart(surface, this.area)
this.tiles = surface.find_tiles_filtered({ area = this.area, name = 'out-of-map', invert = true })
if not this.tiles then
if not this.tiles or not next(this.tiles) then
return
end
this.size_of_tiles = #this.tiles
if this.size_of_tiles > 0 then
if this.size_of_tiles and this.size_of_tiles > 0 then
table_shuffle_table(this.tiles)
end
this.position = { x = this.position.x + this.vector[1], y = this.position.y + this.vector[2] }
local v = this.vector
if not v then return end
local area = this.area
this.area = { { area[1][1] + v[1], area[1][2] + v[2] }, { area[2][1] + v[1], area[2][2] + v[2] } }
local chart_area = { { area[1][1] + v[1] - 4, area[1][2] + v[2] - 4 }, { area[2][1] + v[1] + 4, area[2][2] + v[2] + 4 } }
@ -168,15 +169,17 @@ local function set_reverse_collapse_tiles(surface)
end
this.reverse_tiles = surface.find_tiles_filtered({ area = this.reverse_area, name = 'out-of-map', invert = true })
if not this.reverse_tiles then
if not this.reverse_tiles or not next(this.reverse_tiles) then
return
end
this.reverse_size_of_tiles = #this.reverse_tiles
if this.reverse_size_of_tiles > 0 then
if this.reverse_size_of_tiles and this.reverse_size_of_tiles > 0 then
table_shuffle_table(this.reverse_tiles)
end
this.reverse_position = { x = this.reverse_position.x + this.reverse_vector[1], y = this.reverse_position.y + this.reverse_vector[2] }
local v = this.reverse_vector
if not v then return end
local area = this.reverse_area
this.reverse_area = { { area[1][1] + v[1], area[1][2] + v[2] }, { area[2][1] + v[1], area[2][2] + v[2] } }
local chart_area = { { area[1][1] + v[1] - 4, area[1][2] + v[2] - 10 }, { area[2][1] + v[1] + 4, area[2][2] + v[2] + 10 } }