mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-03 13:12:11 +02:00
random lane autoselection, spawn moved further south
This commit is contained in:
parent
3183e6a69a
commit
05908fedb7
@ -7,6 +7,7 @@ require "modules.dangerous_goods"
|
||||
require "modules.floaty_chat"
|
||||
|
||||
local event = require 'utils.event'
|
||||
require 'utils.table'
|
||||
local init = require "maps.wave_of_death.init"
|
||||
local on_chunk_generated = require "maps.wave_of_death.terrain"
|
||||
local ai = require "maps.wave_of_death.ai"
|
||||
@ -43,13 +44,17 @@ end
|
||||
|
||||
local function autojoin_lane(player)
|
||||
local lowest_player_count = 256
|
||||
local lane_number = 1
|
||||
for i = 1, 4, 1 do
|
||||
if #game.forces[i].connected_players < lowest_player_count and global.wod_lane[i].game_lost == false then
|
||||
lowest_player_count = #game.forces[i].connected_players
|
||||
lane_number = i
|
||||
local lane_number
|
||||
local lane_numbers = {1,2,3,4}
|
||||
table.shuffle_table(lane_numbers)
|
||||
|
||||
for _, number in pairs(lane_numbers) do
|
||||
if #game.forces[number].connected_players < lowest_player_count and global.wod_lane[number].game_lost == false then
|
||||
lowest_player_count = #game.forces[number].connected_players
|
||||
lane_number = number
|
||||
end
|
||||
end
|
||||
|
||||
player.force = game.forces[lane_number]
|
||||
soft_teleport(player, game.forces[player.force.name].get_spawn_position(game.surfaces["wave_of_death"]))
|
||||
player.insert({name = "pistol", count = 1})
|
||||
@ -103,6 +108,7 @@ local function on_gui_click(event)
|
||||
if event.element.name == "confirm_spectate" then
|
||||
player.gui.center["spectate_confirmation_frame"].destroy()
|
||||
game.permissions.get_group("spectator").add_player(player)
|
||||
if player.force.name == "player" then return end
|
||||
player.force = game.forces.player
|
||||
if player.character then player.character.die() end
|
||||
return
|
||||
|
@ -31,7 +31,7 @@ ai.spawn_wave = function(surface, lane_number, wave_number, amount_modifier)
|
||||
commands = {
|
||||
{
|
||||
type = defines.command.attack_area,
|
||||
destination = global.loaders[lane_number].position,
|
||||
destination = {x = global.loaders[lane_number].position.x + x_modifier, y = global.loaders[lane_number].position.y},
|
||||
radius = 32,
|
||||
distraction=defines.distraction.by_enemy
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ local function init(surface, left_top)
|
||||
|
||||
global.loaders = {}
|
||||
for i = 1, 4, 1 do
|
||||
local position = {x = -208 + 160*(i - 1), y = 0}
|
||||
local position = {x = -208 + 160*(i - 1), y = 32}
|
||||
|
||||
for x = -12, 12, 1 do
|
||||
for y = -12, 12, 1 do
|
||||
|
Loading…
x
Reference in New Issue
Block a user