mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-18 03:21:36 +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,
|
['bullet'] = 0,
|
||||||
['cannon-shell'] = 0,
|
['cannon-shell'] = 0,
|
||||||
['capsule'] = 0,
|
['capsule'] = 0,
|
||||||
['beam'] = 0,
|
|
||||||
['laser'] = 0,
|
|
||||||
['electric'] = 0,
|
['electric'] = 0,
|
||||||
['flamethrower'] = 0,
|
['flamethrower'] = 0,
|
||||||
['grenade'] = 0,
|
['grenade'] = 0,
|
||||||
@ -23,6 +21,17 @@ function Public.init_enemy_weapon_damage()
|
|||||||
['shotgun-shell'] = 0
|
['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
|
local e = game.forces.enemy
|
||||||
|
|
||||||
e.technologies['refined-flammables-1'].researched = true
|
e.technologies['refined-flammables-1'].researched = true
|
||||||
@ -42,8 +51,6 @@ local function enemy_weapon_damage()
|
|||||||
['biological'] = 0.08,
|
['biological'] = 0.08,
|
||||||
['bullet'] = 0.08,
|
['bullet'] = 0.08,
|
||||||
['capsule'] = 0.08,
|
['capsule'] = 0.08,
|
||||||
['beam'] = 0.08,
|
|
||||||
['laser'] = 0.08,
|
|
||||||
['electric'] = 0.08,
|
['electric'] = 0.08,
|
||||||
['flamethrower'] = 0.08,
|
['flamethrower'] = 0.08,
|
||||||
--['grenade'] = 0.08,
|
--['grenade'] = 0.08,
|
||||||
@ -53,6 +60,16 @@ local function enemy_weapon_damage()
|
|||||||
--['shotgun-shell'] = 0.08
|
--['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
|
for k, v in pairs(data) do
|
||||||
local new = Difficulty.get().difficulty_vote_value * v
|
local new = Difficulty.get().difficulty_vote_value * v
|
||||||
|
|
||||||
|
@ -833,7 +833,13 @@ end
|
|||||||
function Public.construct_train(icw, locomotive, carriages)
|
function Public.construct_train(icw, locomotive, carriages)
|
||||||
for i, carriage in pairs(carriages) do
|
for i, carriage in pairs(carriages) do
|
||||||
if carriage == locomotive then
|
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
|
if stock ~= carriages[i - 1] then
|
||||||
local n = 1
|
local n = 1
|
||||||
local m = #carriages
|
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}
|
label.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
|
||||||
|
|
||||||
local progressbar = frame.add({type = 'progressbar', name = 'progressbar', value = 0})
|
local progressbar = frame.add({type = 'progressbar', name = 'progressbar', value = 0})
|
||||||
progressbar.style = 'achievement_progressbar'
|
local experimental = get_game_version()
|
||||||
progressbar.style.minimal_width = 96
|
if experimental then
|
||||||
progressbar.style.maximal_width = 96
|
progressbar.style = 'achievement_progressbar'
|
||||||
progressbar.style.padding = -1
|
progressbar.style.minimal_width = 96
|
||||||
progressbar.style.top_padding = 1
|
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'})
|
local line = frame.add({type = 'line', direction = 'vertical'})
|
||||||
line.style.left_padding = 4
|
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.
|
-- Non-applicable stages are commented out.
|
||||||
_STAGE = {
|
_STAGE = {
|
||||||
--settings = 1,
|
--settings = 1,
|
||||||
@ -9,3 +13,13 @@ _STAGE = {
|
|||||||
--config_change = 7,
|
--config_change = 7,
|
||||||
runtime = 8
|
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…
x
Reference in New Issue
Block a user