1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-09 13:37:02 +02:00

Merge pull request #132 from Agocelt/fix-mine-speed-2

Fix mine speed 2
This commit is contained in:
Gerkiz 2021-10-14 12:28:08 +02:00 committed by GitHub
commit 8970f67fe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -854,6 +854,7 @@ function Public.set_difficulty()
local collapse_speed = WPT.get('collapse_speed')
local difficulty = WPT.get('difficulty')
local mining_bonus_till_wave = WPT.get('mining_bonus_till_wave')
local mining_bonus = WPT.get('mining_bonus')
local disable_mining_boost = WPT.get('disable_mining_boost')
local wave_number = WD.get_wave()
local player_count = calc_players()
@ -909,17 +910,18 @@ function Public.set_difficulty()
local force = game.forces.player
if wave_number < mining_bonus_till_wave then
-- the mining speed of the players will increase drastically since RPG is also loaded.
-- additional mining speed comes from steel axe research: 100%, and difficulty settings: too young to die 50%, hurt me plenty 25%
force.manual_mining_speed_modifier = force.manual_mining_speed_modifier - mining_bonus
if player_count <= 5 then
force.manual_mining_speed_modifier = 3 -- set a static 400% bonus if there are <= 5 players.
if force.technologies['steel-axe'].researched then
force.manual_mining_speed_modifier = 4
end
mining_bonus = 3 -- set a static 300% bonus if there are <= 5 players.
elseif player_count >= 6 and player_count <= 10 then
force.manual_mining_speed_modifier = 1 -- set a static 100% bonus if there are <= 10 players.
if force.technologies['steel-axe'].researched then
force.manual_mining_speed_modifier = 2
end
mining_bonus = 1 -- set a static 100% bonus if there are <= 10 players.
end
force.manual_mining_speed_modifier = force.manual_mining_speed_modifier + mining_bonus
WPT.set('mining_bonus', mining_bonus) -- Setting mining_bonus globally so it remembers how much to reduce
else
force.manual_mining_speed_modifier = force.manual_mining_speed_modifier - mining_bonus
WPT.set('disable_mining_boost', true)
end
end
end

View File

@ -204,6 +204,8 @@ function Public.reset_table()
lowest = 4
}
this.mining_bonus_till_wave = 300
this.mining_bonus = 0
this.disable_mining_boost = false
this.market_announce = game.tick + 1200
this.check_heavy_damage = true
this.prestige_system_enabled = false