mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-14 02:34:09 +02:00
fixes
This commit is contained in:
parent
7eb19cd609
commit
03965e18d1
@ -28,8 +28,8 @@ local function autojoin_lane(player)
|
||||
soft_teleport(player, game.forces[player.force.name].get_spawn_position(game.surfaces["wave_of_death"]))
|
||||
player.insert({name = "pistol", count = 1})
|
||||
player.insert({name = "firearm-magazine", count = 16})
|
||||
player.insert({name = "submachine-gun", count = 1})
|
||||
player.insert({name = "uranium-rounds-magazine", count = 128})
|
||||
player.insert({name = "iron-plate", count = 128})
|
||||
player.insert({name = "iron-gear-wheel", count = 32})
|
||||
end
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
|
@ -73,7 +73,8 @@ end
|
||||
ai.trigger_new_wave = function(event)
|
||||
local entity = event.entity
|
||||
if entity.name ~= "loader" then return end
|
||||
if game.tick < 600 then return end
|
||||
if game.tick < 18000 then entity.force.print(">> It is too early to spawn waves yet.", {r = 180, g = 0, b = 0}) return end
|
||||
if #game.players < 4 then entity.force.print(">> More players are required to spawn waves.", {r = 180, g = 0, b = 0}) return end
|
||||
local lane_number = tonumber(entity.force.name)
|
||||
if not global.wod_lane[lane_number] then return end
|
||||
if global.wod_lane[lane_number].alive_biters > 0 then
|
||||
|
@ -2,9 +2,10 @@ local game_status = {}
|
||||
|
||||
local function create_victory_gui(winning_lane)
|
||||
for _, player in pairs(game.connected_players) do
|
||||
player.play_sound{path="utility/game_won", volume_modifier=0.75}
|
||||
local frame = player.gui.left.add {type = "frame", name = "victory_gui", direction = "vertical", caption = "Lane " .. winning_lane .. " has won the game!! ^_^" }
|
||||
frame.style.font = "heading-1"
|
||||
frame.style.font_color = {r = 0, g = 220, b = 220}
|
||||
frame.style.font_color = {r = 220, g = 220, b = 0}
|
||||
end
|
||||
end
|
||||
|
||||
@ -56,9 +57,11 @@ game_status.has_lane_lost = function(event)
|
||||
end
|
||||
end
|
||||
if lanes_alive ~= 1 then return end
|
||||
|
||||
for i = 1, 4, 1 do
|
||||
if global.wod_lane[i].game_lost == true then
|
||||
game.print(">> Lane " .. i .. " has won the game!!", {r = 0, g = 220, b = 220})
|
||||
if global.wod_lane[i].game_lost == false then
|
||||
game.print(">> Lane " .. i .. " has won the game!!", {r = 220, g = 220, b = 0})
|
||||
create_victory_gui(i)
|
||||
global.server_restart_timer = 120
|
||||
end
|
||||
end
|
||||
|
@ -8,13 +8,12 @@ on this map you battle with your team against up to 3 other teams.
|
||||
Each team can call its own wave of biters and spitters at any time and they get stronger with each wave.
|
||||
Each wave, when defeated, sends a percentage of their enemys to all other teams.
|
||||
|
||||
To call a wave, you have to rotate the loader under the marketplace.
|
||||
To call a wave, you have to rotate the loader.
|
||||
But remember that you must also be able to defeat the enemy.
|
||||
|
||||
Each team has a main building, the marketplace, which is the main target of the biters.
|
||||
Your task is to defend the main building. If the main building is destroyed, you have lost!
|
||||
Your task is to defend your loader. If it is destroyed, you have lost!
|
||||
|
||||
A round is over when only one team has its main building left.
|
||||
A round is over when only one team has it's loader left.
|
||||
|
||||
Credits:
|
||||
Map made by MewMew and Kyte
|
||||
@ -51,8 +50,8 @@ local function create_map_intro(player)
|
||||
local frame = t.add {type = "frame"}
|
||||
local l = frame.add {type = "label", caption = info}
|
||||
l.style.single_line = false
|
||||
l.style.font = "heading-3"
|
||||
l.style.font_color = {r=0.95, g=0.95, b=0.95}
|
||||
l.style.font = "heading-2"
|
||||
l.style.font_color = {r=0.60, g=0.8, b=0.60}
|
||||
end
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
|
@ -31,16 +31,25 @@ local function init(surface, left_top)
|
||||
local position = {x = -208 + 160*(i - 1), y = 0}
|
||||
|
||||
for x = -12, 12, 1 do
|
||||
for y = -12, 12, 1 do
|
||||
if math.sqrt(x ^ 2 + y ^ 2) < 8 then
|
||||
local pos = {x = position.x + x, y = position.y + y}
|
||||
if surface.get_tile(pos).name == "water" then
|
||||
surface.set_tiles({{name = "grass-2", position = pos}})
|
||||
for y = -12, 12, 1 do
|
||||
local pos = {x = position.x + x, y = position.y + y}
|
||||
local distance_to_center = math.sqrt(x ^ 2 + y ^ 2)
|
||||
if distance_to_center < 3.5 then
|
||||
surface.set_tiles({{name = "stone-path", position = pos}})
|
||||
else
|
||||
if distance_to_center < 9 then
|
||||
if surface.get_tile(pos).name == "water" then
|
||||
surface.set_tiles({{name = "grass-2", position = pos}})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, e in pairs(surface.find_entities_filtered({area = {{position.x - 2, position.y - 2},{position.x + 3, position.y + 3}}, force = "neutral"})) do
|
||||
e.destroy()
|
||||
end
|
||||
|
||||
global.loaders[i] = surface.create_entity({name = "loader", position = position, force = i})
|
||||
global.loaders[i].minable = false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user