mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-05 13:15:03 +02:00
fixes
This commit is contained in:
parent
d0f7fd4625
commit
f950eed421
@ -124,6 +124,12 @@ end
|
||||
|
||||
local function set_locomotive_health()
|
||||
local this = WPT.get()
|
||||
if not this.locomotive then
|
||||
return
|
||||
end
|
||||
if not this.locomotive.valid then
|
||||
return
|
||||
end
|
||||
local locomotive_health = WPT.get('locomotive_health')
|
||||
local locomotive_max_health = WPT.get('locomotive_max_health')
|
||||
local m = locomotive_health / locomotive_max_health
|
||||
|
@ -194,6 +194,7 @@ function Public.reset_map()
|
||||
disable_tech()
|
||||
|
||||
local surface = game.surfaces[this.active_surface_index]
|
||||
surface.min_brightness = 0.5
|
||||
|
||||
Explosives.set_surface_whitelist({[surface.name] = true})
|
||||
|
||||
@ -221,9 +222,6 @@ function Public.reset_map()
|
||||
Collapse.set_direction('north')
|
||||
Collapse.start_now(false)
|
||||
|
||||
surface.brightness_visual_weights = {1, 0, 0, 0}
|
||||
surface.freeze_daytime = false
|
||||
surface.solar_power_multiplier = 1
|
||||
this.locomotive_health = 10000
|
||||
this.locomotive_max_health = 10000
|
||||
this.cargo_health = 10000
|
||||
@ -243,9 +241,8 @@ function Public.reset_map()
|
||||
|
||||
set_difficulty()
|
||||
|
||||
Task.reset_queue()
|
||||
Task.start_queue()
|
||||
Task.set_queue_speed(10)
|
||||
Task.set_queue_speed(2)
|
||||
|
||||
this.chunk_load_tick = game.tick + 500
|
||||
end
|
||||
@ -468,7 +465,7 @@ local function chunk_load()
|
||||
if this.chunk_load_tick then
|
||||
if this.chunk_load_tick < game.tick then
|
||||
this.chunk_load_tick = nil
|
||||
Task.set_queue_speed(1)
|
||||
Task.set_queue_speed(0.8)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -20,32 +20,25 @@ function Public.reset_table()
|
||||
this.locomotive_index = nil
|
||||
this.loco_surface = nil
|
||||
this.game_lost = false
|
||||
this.game_won = false
|
||||
this.energy = {}
|
||||
this.wave_counter = 0
|
||||
this.locomotive_health = 10000
|
||||
this.locomotive_max_health = 10000
|
||||
this.cargo_health = 10000
|
||||
this.cargo_max_health = 10000
|
||||
this.revealed_spawn = 0
|
||||
this.left_top = {
|
||||
x = 0,
|
||||
y = 0
|
||||
}
|
||||
this.train_upgrades = 0
|
||||
this.energy_purchased = false
|
||||
this.freeze_daytime = false
|
||||
this.offline_players = {}
|
||||
this.biter_pets = {}
|
||||
this.mined_scrap = 0
|
||||
this.biters_killed = 0
|
||||
this.locomotive_xp_aura = 40
|
||||
this.randomness = 0
|
||||
this.xp_points = 0
|
||||
this.xp_points_upgrade = 0
|
||||
this.aura_upgrades = 0
|
||||
this.health_upgrades = 0
|
||||
this.threat_upgrades = 0
|
||||
this.left_top = {
|
||||
x = 0,
|
||||
y = 0
|
||||
}
|
||||
end
|
||||
|
||||
function Public.get(key)
|
||||
|
@ -11,8 +11,8 @@ local math_random = math.random
|
||||
local math_floor = math.floor
|
||||
local math_abs = math.abs
|
||||
Public.level_depth = 704
|
||||
Public.level_width = 448
|
||||
local worm_level_modifier = 0.18
|
||||
Public.level_width = 512
|
||||
local worm_level_modifier = 0.19
|
||||
local average_number_of_wagons_per_level = 2
|
||||
local chunks_per_level = ((Public.level_depth - 32) / 32) ^ 2
|
||||
local chance_for_wagon_spawn = math_floor(chunks_per_level / average_number_of_wagons_per_level)
|
||||
@ -1373,7 +1373,7 @@ local function on_chunk_generated(event)
|
||||
local pl = WPT.get().locomotive.position
|
||||
for _, entity in pairs(
|
||||
surface.find_entities_filtered(
|
||||
{area = {{pl.x - 3, pl.y - 4}, {pl.x + 3, pl.y + 10}}, type = 'simple-entity'}
|
||||
{area = {{pl.x - 5, pl.y - 6}, {pl.x + 5, pl.y + 10}}, type = 'simple-entity'}
|
||||
)
|
||||
) do
|
||||
entity.destroy()
|
||||
|
@ -155,15 +155,6 @@ function Task.start_queue()
|
||||
end
|
||||
end
|
||||
|
||||
function Task.reset_queue()
|
||||
if #task_queue > 50 then
|
||||
task_queue = {
|
||||
_head = 1,
|
||||
_tail = 0
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function Task.get_task_queue()
|
||||
return task_queue
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user