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

Journey more to the update, also test to start luachecking journey

This commit is contained in:
hanakocz 2023-07-17 19:34:22 +02:00
parent b0cea418cc
commit 4d8a6fb551
4 changed files with 160 additions and 174 deletions

View File

@ -4,7 +4,7 @@ map_info_sub_caption=v 1.9
map_info_text=The selectors in the mothership, allow you to choose a destination.\nWorlds can be rerolled by spending a satellite at the top selector.\nOnce enough players are on a selector, mothership will start traveling.\n\nA teleporter will be deployed, after reaching the target.\nIt is however, only capable of transfering the subjects body.\n\nWorlds will get more difficult with each jump, stacking the chosen modifiers.\nLaunch uranium fuel cells via rocket cargo, to advance to the next world.\nThe tooltips on the top buttons yield informations about the current world.\nIf the journey ends, an admin can fully reset the map via command "/journey-reset".\n\nHow far will the journey lead? map_info_text=The selectors in the mothership, allow you to choose a destination.\nWorlds can be rerolled by spending a satellite at the top selector.\nOnce enough players are on a selector, mothership will start traveling.\n\nA teleporter will be deployed, after reaching the target.\nIt is however, only capable of transfering the subjects body.\n\nWorlds will get more difficult with each jump, stacking the chosen modifiers.\nLaunch uranium fuel cells via rocket cargo, to advance to the next world.\nThe tooltips on the top buttons yield informations about the current world.\nIf the journey ends, an admin can fully reset the map via command "/journey-reset".\n\nHow far will the journey lead?
tooltip_satellite=Satellites stored: __1__ / __2__\nSatellites are used by Mothership to scout for alternative destinations. tooltip_satellite=Satellites stored: __1__ / __2__\nSatellites are used by Mothership to scout for alternative destinations.
tooltip_nuclear_fuel=Emergency Reactors working: __1__ / __2__\n30 Emergency Reactors are usually damaged by Mothership if the current colony is determined to be lost and Mothership has to leave in a hurry.\n If teleporter is lost and there is no emergency power, the game is over and run resets. tooltip_nuclear_fuel=Emergency Reactors working: __1__ / __2__\n30 Emergency Reactors are usually damaged by Mothership if the current colony is determined to be lost and Mothership has to leave in a hurry.\nIf teleporter is lost and there is no emergency power, the game is over and run resets.
tooltip_fuel=Fuel requirement to advance to next world:\n__1__\n\nNuclear Fuel Cells in Mothership Cargo:\n__2__ tooltip_fuel=Fuel requirement to advance to next world:\n__1__\n\nNuclear Fuel Cells in Mothership Cargo:\n__2__
beacon_hp=HP: __1__/10000 beacon_hp=HP: __1__/10000
@ -18,4 +18,5 @@ tooltip_modifier=__1__ - __2__%\n
tooltip_capsule= __1__x [item=__2__] tooltip_capsule= __1__x [item=__2__]
tooltip_capsule2= __1__x [item=__2__]\n tooltip_capsule2= __1__x [item=__2__]\n
message_rocket_launched=Launching a rocket with __1__x [item=__2__] at [gps=__3__,__4__,nauvis].
cmd_server_restarting=Server is restarting to apply updates to the scenario...Please reconnect in a minute. cmd_server_restarting=Server is restarting to apply updates to the scenario...Please reconnect in a minute.

View File

@ -1,8 +1,8 @@
--luacheck: ignore
local Public = {} local Public = {}
Public.mothership_teleporter_position = {x = 0, y = 12} Public.mothership_teleporter_position = {x = 0, y = 12}
Public.teleporter_tile = "lab-dark-2" Public.teleporter_tile = 'lab-dark-2'
Public.mothership_radius = 48 Public.mothership_radius = 48
@ -53,172 +53,147 @@ Public.reroll_selector_area = {
Public.mothership_messages = { Public.mothership_messages = {
waiting = { waiting = {
"Return to me, so we can continue the journey!", 'Return to me, so we can continue the journey!',
"Don't leave me waiting for so long. Let's continue our journey.", 'Don\'t leave me waiting for so long. Let\'s continue our journey.',
"Please return to me.", 'Please return to me.',
"Board me, so we can continue this adventure!", 'Board me, so we can continue this adventure!',
}, },
answers = { answers = {
"Yes, great idea.", 'Yes, great idea.',
"Yes, wonderful.", 'Yes, wonderful.',
"Yes, definitely.", 'Yes, definitely.',
"Yes, i love it!", 'Yes, i love it!',
"The calculations say yes.", 'The calculations say yes.',
"I don't know how to feel about this.", 'I don\'t know how to feel about this.',
"Ask again later, my processors are very busy.", 'Ask again later, my processors are very busy.',
"No, this is certainly wrong.", 'No, this is certainly wrong.',
"No, i don't think so.", 'No, i don\'t think so.',
"No, you are wrong.", 'No, you are wrong.',
"No, that would be weird.", 'No, that would be weird.',
"The calculations say no.", 'The calculations say no.',
}, },
} }
Public.mothership_gen_settings = { Public.mothership_gen_settings = {
["water"] = 0, ['water'] = 0,
["starting_area"] = 1, ['starting_area'] = 1,
["cliff_settings"] = {cliff_elevation_interval = 0, cliff_elevation_0 = 0}, ['cliff_settings'] = {cliff_elevation_interval = 0, cliff_elevation_0 = 0},
["default_enable_all_autoplace_controls"] = false, ['default_enable_all_autoplace_controls'] = false,
["autoplace_settings"] = { ['autoplace_settings'] = {
["entity"] = {treat_missing_as_default = false}, ['entity'] = {treat_missing_as_default = false},
["tile"] = {treat_missing_as_default = false}, ['tile'] = {treat_missing_as_default = false},
["decorative"] = {treat_missing_as_default = false}, ['decorative'] = {treat_missing_as_default = false},
}, },
autoplace_controls = { autoplace_controls = {
["coal"] = {frequency = 0, size = 0, richness = 0}, ['coal'] = {frequency = 0, size = 0, richness = 0},
["stone"] = {frequency = 0, size = 0, richness = 0}, ['stone'] = {frequency = 0, size = 0, richness = 0},
["copper-ore"] = {frequency = 0, size = 0, richness = 0}, ['copper-ore'] = {frequency = 0, size = 0, richness = 0},
["iron-ore"] = {frequency = 0, size = 0, richness = 0}, ['iron-ore'] = {frequency = 0, size = 0, richness = 0},
["uranium-ore"] = {frequency = 0, size = 0, richness = 0}, ['uranium-ore'] = {frequency = 0, size = 0, richness = 0},
["crude-oil"] = {frequency = 0, size = 0, richness = 0}, ['crude-oil'] = {frequency = 0, size = 0, richness = 0},
["trees"] = {frequency = 0, size = 0, richness = 0}, ['trees'] = {frequency = 0, size = 0, richness = 0},
["enemy-base"] = {frequency = 0, size = 0, richness = 0} ['enemy-base'] = {frequency = 0, size = 0, richness = 0}
}, },
} }
Public.modifiers_old = {
["trees"] = {-20, -10, "Trees"},
["tree_durability"] = {-30, -15, "Tree Durability"},
["cliff_settings"] = {20, 40, "Cliffs"},
["water"] = {-20, -10, "Water"},
["coal"] = {-20, -10, "Coal"},
["stone"] = {-20, -10, "Stone"},
["iron-ore"] = {-20, -10, "Iron Ore"},
["copper-ore"] = {-20, -10, "Copper Ore"},
["crude-oil"] = {-20, -10, "Oil"},
["uranium-ore"] = {-20, -10, "Uranium Ore"},
["mixed_ore"] = {-20, -10, "Mixed Ore"},
["enemy-base"] = {10, 20, "Nests"},
["expansion_cooldown"] = {-30, -15, "Nest Expansion Cooldown"},
["enemy_attack_pollution_consumption_modifier"] = {-20, -10, "Nest Pollution Consumption"},
["max_unit_group_size"] = {15, 30, "Biter Group Size Maximum"},
["time_factor"] = {15, 30, "Evolution Time Factor"},
["destroy_factor"] = {15, 30, "Evolution Destroy Factor"},
["pollution_factor"] = {15, 30, "Evolution Pollution Factor"},
["ageing"] = {-20, -10, "Terrain Pollution Consumption"},
["diffusion_ratio"] = {10, 20, "Pollution Diffusion"},
["technology_price_multiplier"] = {10, 20, "Technology Price"},
}
Public.modifiers = { Public.modifiers = {
["trees"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Trees"}, ['trees'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Trees'},
["tree_durability"] = {min = 0.01, max = 10, base = 1, dmin = -30, dmax =-15, name = "Tree Durability"}, ['tree_durability'] = {min = 0.1, max = 50, base = 10, dmin = -30, dmax =-15, name = 'Tree Durability'},
["cliff_settings"] = {min = 0.01, max = 10, base = 1, dmin = 20, dmax = 40, name = "Cliffs"}, ['cliff_settings'] = {min = 0.01, max = 10, base = 1, dmin = 20, dmax = 40, name = 'Cliffs'},
["water"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Water"}, ['water'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Water'},
["coal"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Coal"}, ['coal'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Coal'},
["stone"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Stone"}, ['stone'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Stone'},
["iron-ore"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Iron Ore"}, ['iron-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Iron Ore'},
["copper-ore"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Copper Ore"}, ['copper-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Copper Ore'},
["crude-oil"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Oil"}, ['crude-oil'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Oil'},
["uranium-ore"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Uranium Ore"}, ['uranium-ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Uranium Ore'},
["mixed_ore"] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = "Mixed Ore"}, ['mixed_ore'] = {min = 0.01, max = 10, base = 1, dmin = -20, dmax = -10, name = 'Mixed Ore'},
["enemy-base"] = {min = 0.01, max = 10, base = 1, dmin = 10, dmax = 20, name = "Nests"}, ['enemy-base'] = {min = 0.01, max = 10, base = 1, dmin = 10, dmax = 20, name = 'Nests'},
["expansion_cooldown"] = {min = 3600, max = 28800, base = 14400, dmin = -20, dmax = -10, name = "Nest Expansion Cooldown"}, ['expansion_cooldown'] = {min = 3600, max = 28800, base = 14400, dmin = -20, dmax = -10, name = 'Nest Expansion Cooldown'},
["enemy_attack_pollution_consumption_modifier"] = {min = 0.2, max = 10, base = 1, dmin = -10, dmax = -5, name = "Nest Pollution Consumption"}, ['enemy_attack_pollution_consumption_modifier'] = {min = 0.25, max = 4, base = 1, dmin = -5, dmax = -2.5, name = 'Nest Pollution Consumption'},
["max_unit_group_size"] = {min = 10, max = 500, base = 100, dmin = 10, dmax = 20, name = "Biter Group Size Maximum"}, ['max_unit_group_size'] = {min = 10, max = 500, base = 100, dmin = 10, dmax = 20, name = 'Biter Group Size Maximum'},
["time_factor"] = {min = 0.000001, max = 0.0001, base = 0.000004, dmin = 15, dmax = 30, name = "Evolution Time Factor"}, ['time_factor'] = {min = 0.000001, max = 0.0001, base = 0.000004, dmin = 15, dmax = 30, name = 'Evolution Time Factor'},
["destroy_factor"] = {min = 0.0002, max = 0.2, base = 0.002, dmin = 15, dmax = 30, name = "Evolution Destroy Factor"}, ['destroy_factor'] = {min = 0.0002, max = 0.2, base = 0.002, dmin = 15, dmax = 30, name = 'Evolution Destroy Factor'},
["pollution_factor"] = {min = 0.00000009, max = 0.00009, base = 0.0000009, dmin = 15, dmax = 30, name = "Evolution Pollution Factor"}, ['pollution_factor'] = {min = 0.00000009, max = 0.00009, base = 0.0000009, dmin = 15, dmax = 30, name = 'Evolution Pollution Factor'},
["ageing"] = {min = 0.01, max = 4, base = 1, dmin = -20, dmax = -10, name = "Terrain Pollution Consumption"}, ['ageing'] = {min = 0.01, max = 4, base = 1, dmin = -20, dmax = -10, name = 'Terrain Pollution Consumption'},
["diffusion_ratio"] = {min = 0.01, max = 0.1, base = 0.02, dmin = 10, dmax = 20, name = "Pollution Diffusion"}, ['diffusion_ratio'] = {min = 0.005, max = 0.05, base = 0.02, dmin = 10, dmax = 20, name = 'Pollution Diffusion'},
["technology_price_multiplier"] = {min = 0.5, max = 10, base = 1, dmin = 10, dmax = 20, name = "Technology Price"}, ['technology_price_multiplier'] = {min = 0.05, max = 5, base = 0.5, dmin = 10, dmax = 20, name = 'Technology Price'},
} }
Public.starter_goods_pool = { Public.starter_goods_pool = {
{"accumulator", 8, 16}, {'accumulator', 8, 16},
{"big-electric-pole", 8, 16}, {'big-electric-pole', 8, 16},
{"burner-inserter", 64, 128}, {'burner-inserter', 64, 128},
{"burner-mining-drill", 8, 16}, {'burner-mining-drill', 8, 16},
{"car", 2, 4}, {'car', 2, 4},
{"copper-cable", 128, 256}, {'copper-cable', 128, 256},
{"copper-plate", 64, 128}, {'copper-plate', 64, 128},
{"electric-furnace", 4, 8}, {'electric-furnace', 4, 8},
{"electric-mining-drill", 4, 8}, {'electric-mining-drill', 4, 8},
{"firearm-magazine", 64, 128}, {'firearm-magazine', 64, 128},
{"grenade", 8, 16}, {'grenade', 8, 16},
{"gun-turret", 4, 8}, {'gun-turret', 4, 8},
{"inserter", 32, 64}, {'inserter', 32, 64},
{"iron-gear-wheel", 64, 128}, {'iron-gear-wheel', 64, 128},
{"iron-plate", 64, 128}, {'iron-plate', 64, 128},
{"lab", 2, 4}, {'lab', 2, 4},
{"long-handed-inserter", 32, 64}, {'long-handed-inserter', 32, 64},
{"medium-electric-pole", 16, 32}, {'medium-electric-pole', 16, 32},
{"pipe", 128, 256}, {'pipe', 128, 256},
{"radar", 4, 8}, {'radar', 4, 8},
{"small-lamp", 64, 128}, {'small-lamp', 64, 128},
{"solar-panel", 8, 16}, {'solar-panel', 8, 16},
{"solid-fuel", 256, 512}, {'solid-fuel', 256, 512},
{"stack-inserter", 16, 32}, {'stack-inserter', 16, 32},
{"stack-filter-inserter", 16, 32}, {'stack-filter-inserter', 16, 32},
{"steam-turbine", 4, 8}, {'steam-turbine', 4, 8},
{"steel-chest", 16, 32}, {'steel-chest', 16, 32},
{"steel-furnace", 8, 16}, {'steel-furnace', 8, 16},
{"steel-plate", 32, 64}, {'steel-plate', 32, 64},
{"stone-wall", 128, 256}, {'stone-wall', 128, 256},
{"substation", 4, 8}, {'substation', 4, 8},
{"green-wire", 256, 512}, {'green-wire', 256, 512},
{"red-wire", 256, 512}, {'red-wire', 256, 512},
} }
Public.build_type_whitelist = { Public.build_type_whitelist = {
["arithmetic-combinator"] = true, ['arithmetic-combinator'] = true,
["constant-combinator"] = true, ['constant-combinator'] = true,
["decider-combinator"] = true, ['decider-combinator'] = true,
["electric-energy-interface"] = true, ['electric-energy-interface'] = true,
["electric-pole"] = true, ['electric-pole'] = true,
["gate"] = true, ['gate'] = true,
["heat-pipe"] = true, ['heat-pipe'] = true,
["lamp"] = true, ['lamp'] = true,
["pipe"] = true, ['pipe'] = true,
["pipe-to-ground"] = true, ['pipe-to-ground'] = true,
["programmable-speaker"] = true, ['programmable-speaker'] = true,
["transport-belt"] = true, ['transport-belt'] = true,
["wall"] = true, ['wall'] = true,
} }
Public.unique_world_traits = { Public.unique_world_traits = {
["lush"] = {"Lush", "Pure Vanilla.", 1}, ['lush'] = {'Lush', 'Pure Vanilla.', 1},
["abandoned_library"] = {"Abandoned Library", "No blueprints to be found.", 3}, ['abandoned_library'] = {'Abandoned Library', 'No blueprints to be found.', 3},
["lazy_bastard"] = {"Lazy Bastard", "The machine does the job.", 4}, ['lazy_bastard'] = {'Lazy Bastard', 'The machine does the job.', 4},
["oceanic"] = {"Oceanic", "Arrrr, the flame turrets seem to malfunction in this climate.", 2}, ['oceanic'] = {'Oceanic', 'Arrrr, the flame turrets seem to malfunction in this climate.', 2},
["ribbon"] = {"Ribbon", "Go right. (or left)", 4}, ['ribbon'] = {'Ribbon', 'Go right. (or left)', 4},
["wasteland"] = {"Wasteland", "Rusty treasures.", 2}, ['wasteland'] = {'Wasteland', 'Rusty treasures.', 2},
["infested"] = {"Infested", "They lurk inside.", 4}, ['infested'] = {'Infested', 'They lurk inside.', 4},
["pitch_black"] = {"Pitch Black", "No light may reach this realm.", 2}, ['pitch_black'] = {'Pitch Black', 'No light may reach this realm.', 2},
["volcanic"] = {"Volcanic", "The floor is (almost) lava.", 4}, ['volcanic'] = {'Volcanic', 'The floor is (almost) lava.', 4},
["matter_anomaly"] = {"Matter Anomaly", "Why can't i hold all these ores.\nThe laser turret structures seem to malfunction.", 2}, ['matter_anomaly'] = {'Matter Anomaly', 'Why can\'t I hold all these ores.\nThe laser turret structures seem to malfunction.', 2},
["mountainous"] = {"Mountainous", "Diggy diggy hole!", 2}, ['mountainous'] = {'Mountainous', 'Diggy diggy hole!', 2},
["eternal_night"] = {"Eternal Night", "This world seems to be missing a sun.", 2}, ['eternal_night'] = {'Eternal Night', 'This world seems to be missing a sun.', 2},
["dense_atmosphere"] = {"Dense Atmosphere", "Your roboport structures seem to malfunction.", 3}, ['dense_atmosphere'] = {'Dense Atmosphere', 'Your roboport structures seem to malfunction.', 3},
["undead_plague"] = {"Undead Plague", "The dead are restless.", 4}, ['undead_plague'] = {'Undead Plague', 'The dead are restless.', 4},
["swamps"] = {"Swamps", "No deep water to be found in this world.", 3}, ['swamps'] = {'Swamps', 'No deep water to be found in this world.', 3},
["chaotic_resources"] = {"Chaotic Resources", "Something to sort out.", 2}, ['chaotic_resources'] = {'Chaotic Resources', 'Something to sort out.', 2},
["low_mass"] = {"Low Mass", "You feel light footed and the robots are buzzing.", 2}, ['low_mass'] = {'Low Mass', 'You feel light footed and the robots are buzzing.', 2},
["eternal_day"] = {"Eternal Day", "The sun never moves.", 1}, ['eternal_day'] = {'Eternal Day', 'The sun never moves.', 1},
["quantum_anomaly"] = {"Quantum Anomaly", "Research complete.", 2}, ['quantum_anomaly'] = {'Quantum Anomaly', 'Research complete.', 2},
["replicant_fauna"] = {"Replicant Fauna", "The biters feed on your structures.", 4}, ['replicant_fauna'] = {'Replicant Fauna', 'The biters feed on your structures.', 4},
["tarball"] = {"Tarball", "Door stuck, Door stuck...", 4}, ['tarball'] = {'Tarball', 'Door stuck, Door stuck...', 4},
--[[
]]
} }
return Public return Public

View File

@ -450,9 +450,11 @@ function Public.hard_reset(journey)
journey.beacon_objective_health = 10000 journey.beacon_objective_health = 10000
journey.beacon_objective_resistance = 0.9 journey.beacon_objective_resistance = 0.9
journey.world_number = 0 journey.world_number = 0
journey.world_trait = "lush" journey.world_trait = 'lush'
journey.world_modifiers = {} journey.world_modifiers = {}
journey.game_state = "create_mothership" journey.emergency_triggered = false
journey.emergency_selected = false
journey.game_state = 'create_mothership'
journey.mothership_messages_last_damage = game.tick journey.mothership_messages_last_damage = game.tick
for k, modifier in pairs(Constants.modifiers) do for k, modifier in pairs(Constants.modifiers) do
journey.world_modifiers[k] = modifier.base journey.world_modifiers[k] = modifier.base
@ -907,19 +909,27 @@ function Public.mothership_world_selection(journey)
local reroll_selector_activation_level = get_activation_level(surface, Constants.reroll_selector_area) local reroll_selector_activation_level = get_activation_level(surface, Constants.reroll_selector_area)
journey.reroll_selector.activation_level = reroll_selector_activation_level journey.reroll_selector.activation_level = reroll_selector_activation_level
journey.selected_world = false if journey.emergency_triggered then
for i = 1, 3, 1 do if not journey.emergency_selected then
local activation_level = get_activation_level(surface, Constants.world_selector_areas[i]) journey.selected_world = math.random(1, 3)
journey.world_selectors[i].activation_level = activation_level table.insert(journey.mothership_messages, "Emergency destination selected..")
if activation_level > 1 then table.insert(journey.mothership_messages, "Some reactors were damaged due to unplanned circumstances..")
journey.selected_world = i journey.emergency_selected = true
end
else
journey.selected_world = false
for i = 1, 3, 1 do
local activation_level = get_activation_level(surface, Constants.world_selector_areas[i])
journey.world_selectors[i].activation_level = activation_level
if activation_level > 1 then
journey.selected_world = i
end
end
if reroll_selector_activation_level > 1 and journey.mothership_speed == 0.35 and journey.mothership_cargo.satellite > 0 then
journey.game_state = "reroll_worlds"
table.insert(journey.mothership_messages, "Dispatching satellite..")
return
end end
end
if reroll_selector_activation_level > 1 and journey.mothership_speed == 0.35 and journey.mothership_cargo.satellite > 0 then
journey.game_state = "reroll_worlds"
table.insert(journey.mothership_messages, "Dispatching satellite..")
return
end end
if journey.selected_world then if journey.selected_world then
@ -978,7 +988,8 @@ function Public.mothership_arrives_at_world(journey)
journey.mothership_speed = 0.15 journey.mothership_speed = 0.15
end end
journey.beacon_objective_resistance = 0.90 - (0.03 * journey.world_number) journey.beacon_objective_resistance = 0.90 - (0.03 * journey.world_number)
journey.emergency_triggered = false
journey.emergency_selected = false
draw_background(journey, surface) draw_background(journey, surface)
Public.update_tooltips(journey) Public.update_tooltips(journey)
end end
@ -1060,7 +1071,7 @@ function Public.create_the_world(journey)
game.map_settings.pollution.diffusion_ratio = journey.world_modifiers[name] game.map_settings.pollution.diffusion_ratio = journey.world_modifiers[name]
end end
if name == "tree_durability" then if name == "tree_durability" then
game.map_settings.pollution.min_pollution_to_damage_trees = journey.world_modifiers[name] game.map_settings.pollution.min_pollution_to_damage_trees = journey.world_modifiers[name] * 6
game.map_settings.pollution.pollution_restored_per_tree_damage = journey.world_modifiers[name] game.map_settings.pollution.pollution_restored_per_tree_damage = journey.world_modifiers[name]
end end
if name == "max_unit_group_size" then if name == "max_unit_group_size" then
@ -1238,15 +1249,13 @@ function Public.world(journey)
table.remove(journey.rocket_silos, k) table.remove(journey.rocket_silos, k)
break break
end end
local inventory = silo.get_inventory(defines.inventory.rocket_silo_rocket) local inventory = silo.get_inventory(defines.inventory.rocket_silo_rocket) or {}
if inventory then local slot = inventory[1]
local fuel_cells_required = journey.mothership_cargo_space['uranium-fuel-cell'] - journey.mothership_cargo['uranium-fuel-cell'] if slot and slot.valid and slot.valid_for_read then
if fuel_cells_required > 50 then fuel_cells_required = 50 end local needs = (journey.mothership_cargo_space[slot.name] or 0) - (journey.mothership_cargo[slot.name] or 0)
local reactors_required = journey.mothership_cargo_space['nuclear-reactor'] - journey.mothership_cargo['nuclear-reactor'] if needs > 0 and slot.count >= math.min(game.item_prototypes[slot.name].stack_size, needs) then
if reactors_required > 10 then reactors_required = 10 end
if inventory.get_item_count('satellite') == 1 or inventory.get_item_count('uranium-fuel-cell') >= fuel_cells_required or inventory.get_item_count('nuclear-reactor') >= reactors_required then
if silo.launch_rocket() then if silo.launch_rocket() then
table.insert(journey.mothership_messages, "Launching rocket [gps=" .. silo.position.x .. "," .. silo.position.y .. ",nauvis]") table.insert(journey.mothership_messages, {'journey.message_rocket_launched', slot.count, slot.name, silo.position.x, silo.position.y})
end end
end end
end end
@ -1319,6 +1328,7 @@ function Public.deal_damage_to_beacon(journey, incoming_damage)
end end
Public.hard_reset(journey) Public.hard_reset(journey)
else else
journey.emergency_triggered = true
journey.game_state = "set_world_selectors" journey.game_state = "set_world_selectors"
Public.update_tooltips(journey) Public.update_tooltips(journey)
Public.draw_gui(journey) Public.draw_gui(journey)

View File

@ -143,8 +143,8 @@ local function on_rocket_launched(event)
if journey.mothership_cargo[slot.name] > journey.mothership_cargo_space[slot.name] then if journey.mothership_cargo[slot.name] > journey.mothership_cargo_space[slot.name] then
journey.mothership_cargo[slot.name] = journey.mothership_cargo_space[slot.name] journey.mothership_cargo[slot.name] = journey.mothership_cargo_space[slot.name]
end end
if slot.name == "uranium-fuel-cell" or slot.name == 'nuclear-fuel' then if slot.name == 'uranium-fuel-cell' or slot.name == 'nuclear-reactor' then
Server.to_discord_embed("Refueling progress: " .. journey.mothership_cargo[slot.name] .. "/" .. journey.mothership_cargo_space[slot.name]) Server.to_discord_embed('Refueling progress: ' .. slot.name .. ': ' .. journey.mothership_cargo[slot.name] .. '/' .. journey.mothership_cargo_space[slot.name])
end end
end end
end end