mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-30 23:17:53 +02:00
we now check what game version is active
This commit is contained in:
parent
934d0d844e
commit
d23d62b8e6
@ -12,8 +12,6 @@ function Public.init_enemy_weapon_damage()
|
||||
['bullet'] = 0,
|
||||
['cannon-shell'] = 0,
|
||||
['capsule'] = 0,
|
||||
['beam'] = 0,
|
||||
['laser'] = 0,
|
||||
['electric'] = 0,
|
||||
['flamethrower'] = 0,
|
||||
['grenade'] = 0,
|
||||
@ -23,6 +21,17 @@ function Public.init_enemy_weapon_damage()
|
||||
['shotgun-shell'] = 0
|
||||
}
|
||||
|
||||
local experimental = get_game_version()
|
||||
if experimental then
|
||||
data['beam'] = 0
|
||||
data['laser'] = 0
|
||||
else
|
||||
data['railgun'] = 0
|
||||
data['combat-robot-beam'] = 0
|
||||
data['combat-robot-laser'] = 0
|
||||
data['laser-turret'] = 0
|
||||
end
|
||||
|
||||
local e = game.forces.enemy
|
||||
|
||||
e.technologies['refined-flammables-1'].researched = true
|
||||
@ -42,8 +51,6 @@ local function enemy_weapon_damage()
|
||||
['biological'] = 0.08,
|
||||
['bullet'] = 0.08,
|
||||
['capsule'] = 0.08,
|
||||
['beam'] = 0.08,
|
||||
['laser'] = 0.08,
|
||||
['electric'] = 0.08,
|
||||
['flamethrower'] = 0.08,
|
||||
--['grenade'] = 0.08,
|
||||
@ -53,6 +60,16 @@ local function enemy_weapon_damage()
|
||||
--['shotgun-shell'] = 0.08
|
||||
}
|
||||
|
||||
local experimental = get_game_version()
|
||||
if experimental then
|
||||
data['beam'] = 0.08
|
||||
data['laser'] = 0.08
|
||||
else
|
||||
data['combat-robot-beam'] = 0.08
|
||||
data['combat-robot-laser'] = 0.08
|
||||
data['laser-turret'] = 0.08
|
||||
end
|
||||
|
||||
for k, v in pairs(data) do
|
||||
local new = Difficulty.get().difficulty_vote_value * v
|
||||
|
||||
|
@ -833,7 +833,13 @@ end
|
||||
function Public.construct_train(icw, locomotive, carriages)
|
||||
for i, carriage in pairs(carriages) do
|
||||
if carriage == locomotive then
|
||||
local stock = locomotive.get_connected_rolling_stock(defines.rail_direction.front)
|
||||
local stock
|
||||
local experimental = get_game_version()
|
||||
if experimental then
|
||||
stock = locomotive.get_connected_rolling_stock(defines.rail_direction.front)
|
||||
else
|
||||
stock = get_connected_rolling_stock(locomotive, defines.rail_direction.front, carriages)
|
||||
end
|
||||
if stock ~= carriages[i - 1] then
|
||||
local n = 1
|
||||
local m = #carriages
|
||||
|
@ -16,11 +16,18 @@ local function create_gui(player)
|
||||
label.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
|
||||
|
||||
local progressbar = frame.add({type = 'progressbar', name = 'progressbar', value = 0})
|
||||
progressbar.style = 'achievement_progressbar'
|
||||
progressbar.style.minimal_width = 96
|
||||
progressbar.style.maximal_width = 96
|
||||
progressbar.style.padding = -1
|
||||
progressbar.style.top_padding = 1
|
||||
local experimental = get_game_version()
|
||||
if experimental then
|
||||
progressbar.style = 'achievement_progressbar'
|
||||
progressbar.style.minimal_width = 96
|
||||
progressbar.style.maximal_width = 96
|
||||
progressbar.style.padding = -1
|
||||
progressbar.style.top_padding = 1
|
||||
else
|
||||
progressbar.style.minimal_width = 96
|
||||
progressbar.style.maximal_width = 96
|
||||
progressbar.style.top_padding = 10
|
||||
end
|
||||
|
||||
local line = frame.add({type = 'line', direction = 'vertical'})
|
||||
line.style.left_padding = 4
|
||||
|
@ -1,3 +1,7 @@
|
||||
--luacheck: ignore
|
||||
local branch_version = '1.1' -- define what game version we're using
|
||||
local sub = string.sub
|
||||
|
||||
-- Non-applicable stages are commented out.
|
||||
_STAGE = {
|
||||
--settings = 1,
|
||||
@ -9,3 +13,13 @@ _STAGE = {
|
||||
--config_change = 7,
|
||||
runtime = 8
|
||||
}
|
||||
|
||||
function get_game_version()
|
||||
local get_active_branch = sub(game.active_mods.base, 3, 4)
|
||||
local is_branch_experimental = sub(branch_version, 3, 4)
|
||||
if get_active_branch >= is_branch_experimental then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user