1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-17 21:08:08 +02:00

Change to number difficulty scaling

This commit is contained in:
Matthew Heguy 2019-03-14 20:53:58 -04:00 committed by plague006
parent 7bcf77dc1d
commit 2f44acdd15
2 changed files with 4 additions and 11 deletions

View File

@ -348,14 +348,14 @@ global.config = {
enabled = true,
-- frequency of automatic attacks (in seconds)
attack_frequency = 40 * 60, -- 40 minutes
-- difficulty of automatic attacks (easy, normal, hard, brutal)
attack_difficulty = 'normal'
-- difficulty of automatic attacks (1-easy, 3-normal, 10-hard, 40-brutal)
attack_difficulty = 3
},
-- whether or not to send attacks on rocket launches
launch_attacks = {
enabled = true,
-- whether to only attack on the first launch
first_launch_only = false
first_launch_only = true
}
}
}

View File

@ -28,12 +28,6 @@ local insert = table.insert
local ceil = math.ceil
-- Constants
local difficulty_settings = {
easy = 1,
normal = 3,
hard = 10,
brutal = 40
}
local defaults = {
total_scan_radius = 5000,
individual_scan_radius = 500 -- a 500 radius scan is < 0.5ms on avg
@ -85,8 +79,7 @@ end
--- Calculates the number of biters to send for timed attacks according to the difficulty selected
-- @return <number>
local function calculate_biters()
local difficulty = global.config.biter_attacks.timed_attacks.attack_difficulty
local multiplier = difficulty_settings[difficulty]
local multiplier = global.config.biter_attacks.timed_attacks.attack_difficulty
return ceil((game.forces.enemy.evolution_factor * 100 * multiplier))
end