1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00
This commit is contained in:
MewMew 2019-10-22 08:29:30 +02:00
parent dd0f5dd8a1
commit 39709712e6
4 changed files with 23 additions and 20 deletions

View File

@ -20,6 +20,7 @@ function locomotive_spawn(surface, position)
global.locomotive_cargo.operable = false
end
--[[
local function fish_tag()
if not global.locomotive_cargo then return end
if not global.locomotive_cargo.valid then return end
@ -55,15 +56,6 @@ local function remove_acceleration()
global.locomotive_driver = nil
end
local function set_player_spawn_and_refill_fish()
if not global.locomotive_cargo then return end
if not global.locomotive_cargo.valid then return end
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 4})
local position = global.locomotive_cargo.surface.find_non_colliding_position("stone-furnace", global.locomotive_cargo.position, 16, 2)
if not position then return end
game.forces.player.set_spawn_position({x = position.x, y = position.y}, global.locomotive_cargo.surface)
end
local function set_daytime()
if not global.locomotive_cargo then return end
if not global.locomotive_cargo.valid then return end
@ -73,12 +65,19 @@ local function set_daytime()
global.locomotive_cargo.surface.daytime = t
game.print(t)
end
]]
local function set_player_spawn_and_refill_fish()
if not global.locomotive_cargo then return end
if not global.locomotive_cargo.valid then return end
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 4})
local position = global.locomotive_cargo.surface.find_non_colliding_position("stone-furnace", global.locomotive_cargo.position, 16, 2)
if not position then return end
game.forces.player.set_spawn_position({x = position.x, y = position.y}, global.locomotive_cargo.surface)
end
local function tick()
if game.tick % 30 == 0 then
fish_tag()
--set_daytime()
accelerate()
if game.tick % 1800 == 0 then
set_player_spawn_and_refill_fish()
end
@ -87,9 +86,13 @@ local function tick()
global.game_reset_tick = nil
reset_map()
end
return
end
--fish_tag()
--set_daytime()
--accelerate()
else
remove_acceleration()
--remove_acceleration()
end
end

View File

@ -252,9 +252,6 @@ local function on_player_joined_game(event)
global.wave_defense.surface_index = global.active_surface_index
global.wave_defense.target = global.locomotive_cargo
global.wave_defense.side_target_search_radius = 768
global.player_modifiers[player.index].character_mining_speed_modifier["mountain_fortress"] = 0.5
update_player_modifiers(player)
if player.online_time == 0 then
player.teleport(surface.find_non_colliding_position("character", game.forces.player.get_spawn_position(surface), 3, 0.5), surface)
@ -271,7 +268,10 @@ local function on_player_joined_game(event)
for item, amount in pairs(starting_items) do
player.insert({name = item, count = amount})
end
end
end
global.player_modifiers[player.index].character_mining_speed_modifier["mountain_fortress"] = 0.5
update_player_modifiers(player)
end
--[[
local function on_player_respawned(event)

View File

@ -97,7 +97,7 @@ local function damage_entity(entity, cell)
if not entity.health then return true end
if entity.health <= 0 then return true end
if not entity.destructible then return true end
if not entity.minable then return true end
--if not entity.minable then return true end
--if global.explosion_cells_reflect[entity.name] then
-- if reflect_cell(entity, cell) then return end
--end

View File

@ -414,8 +414,8 @@ function reset_wave_defense()
side_target_search_radius = 768,
spawn_position = {x = 0, y = 64},
last_wave = game.tick,
next_wave = game.tick + 3600 * 5,
wave_interval = 1800,
next_wave = game.tick + 3600 * 15,
wave_interval = 3600,
wave_number = 0,
game_lost = false,
threat = 0,