1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-26 22:56:43 +02:00
This commit is contained in:
MewMew 2019-05-08 01:02:00 +02:00
parent 8ef281b88c
commit 1598277664
6 changed files with 37 additions and 12 deletions

View File

@ -65,7 +65,7 @@ local function on_tick(event)
if game.tick % 300 ~= 0 then return end
for i = 1, 4, 1 do
game.forces[i].chart(game.surfaces["wave_of_death"], {{-288, -420}, {352, 32}})
game.forces[i].chart(game.surfaces["wave_of_death"], {{-288, -420}, {352, 64}})
end
game_status.restart_server()

View File

@ -7,7 +7,9 @@ ai.spawn_wave = function(surface, lane_number, wave_number, amount_modifier)
if not global.loaders[lane_number].valid then return end
local spawn_position = {x = global.loaders[lane_number].position.x, y = global.loaders[lane_number].position.y - 288}
local x_modifier = 32 - math.random(0, 64)
local spawn_position = {x = global.loaders[lane_number].position.x + x_modifier, y = global.loaders[lane_number].position.y - 288}
local unit_group = surface.create_unit_group({position = spawn_position, force = "enemy"})
@ -81,15 +83,23 @@ ai.trigger_new_wave = function(event)
entity.force.print(">> There are " .. global.wod_lane[lane_number].alive_biters .. " spawned biters left.", {r = 180, g = 0, b = 0})
return
end
local wave_number = global.wod_lane[lane_number].current_wave
if not biter_waves[wave_number] then wave_number = #biter_waves end
ai.spawn_wave(entity.surface, lane_number, wave_number, 1)
local player = game.players[event.player_index]
for _, force in pairs(game.forces) do
if force.name == entity.force.name then
force.print(">> " .. player.name .. " has summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0})
else
force.print(">> Lane " .. entity.force.name .. " summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0})
end
end
for _, player in pairs(game.connected_players) do
player.play_sound{path="utility/new_objective", volume_modifier=0.3}
end
game.print(">> Lane " .. entity.force.name .. " summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0})
end
end
ai.prevent_friendly_fire = function(event)

View File

@ -30,9 +30,10 @@ game_status.has_lane_lost = function(event)
if event.entity.name ~= "loader" then return end
local lane_number = tonumber(event.entity.force.name)
global.wod_lane[lane_number].game_lost = true
game.forces[lane_number].set_spawn_position({x = 32, y = 0}, event.entity.surface)
local surface = event.entity.surface
game.forces[lane_number].set_spawn_position({x = 32, y = 0}, surface)
event.entity.surface.create_entity({
surface.create_entity({
name = "atomic-rocket",
position = event.entity.position,
force = "enemy",
@ -64,7 +65,13 @@ game_status.has_lane_lost = function(event)
create_victory_gui(i)
global.server_restart_timer = 120
end
end
end
for _, unit in pairs(surface.find_entities_filtered({type = "unit"})) do
if unit.valid then
unit.die()
end
end
end
return game_status

View File

@ -32,6 +32,7 @@ local function init_forces(surface)
for _, force in pairs(game.forces) do
if force.name ~= "enemy" then
force.technologies["optics"].researched = true
force.technologies["artillery"].enabled = false
force.technologies["artillery-shell-range-1"].enabled = false
force.technologies["artillery-shell-speed-1"].enabled = false

View File

@ -104,7 +104,14 @@ local function place_entities(surface, position, noise_position, seed)
end
if get_noise("rocks", noise_position, seed + 30000) > 0.82 then
if get_noise("random_things", noise_position, seed) > 0.5 then surface.create_entity({name = "rock-big", position = position}) end
local random_noise = get_noise("random_things", noise_position, seed)
if random_noise > 0.5 then
if random_noise > 0.75 then
surface.create_entity({name = "rock-big", position = position})
else
surface.create_entity({name = "rock-huge", position = position})
end
end
return
end

View File

@ -15,7 +15,7 @@ local function on_console_chat(event)
text = event.message,
surface = player.surface,
target = player.character,
target_offset = {-0.1, -3},
target_offset = {-0.05, -4},
color = {
r = player.color.r * 0.6 + 0.25,
g = player.color.g * 0.6 + 0.25,
@ -23,10 +23,10 @@ local function on_console_chat(event)
a = 1
},
time_to_live = 600,
scale = 0.9,
scale = 1.50,
font = "default-game",
alignment = "center",
scale_with_zoom = true
scale_with_zoom = false
}
end