From e1702e857084c0a9789bca0dae5dca7c95f96039 Mon Sep 17 00:00:00 2001 From: hanakocz Date: Fri, 24 Nov 2023 00:16:25 +0100 Subject: [PATCH] discord embed, small fixes --- maps/journey/functions.lua | 25 +++++++++++++++++++++++-- maps/journey/unique_modifiers.lua | 1 - 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/maps/journey/functions.lua b/maps/journey/functions.lua index 7c12113d..5805f8c9 100644 --- a/maps/journey/functions.lua +++ b/maps/journey/functions.lua @@ -443,6 +443,7 @@ function Public.import_journey(journey) return else Server.try_get_data('scenario_settings', 'journey_data', journey.import) + Server.set_data('scenario_settings', 'journey_updating', false) end end @@ -1209,6 +1210,16 @@ function Public.notify_discord(journey) return end local caption = 'World ' .. journey.world_number .. ' | ' .. Constants.unique_world_traits[journey.world_trait].name + local modifier_message = '' + for _, mod in pairs(journey.world_selectors[journey.selected_world].modifiers) do + local sign = '' + if mod.value > 0 then sign = '+' end + modifier_message = modifier_message .. sign .. mod.value .. '% ' .. mod.name .. '\n' + end + local capsules = '' + for _, cap in pairs(journey.world_selectors[journey.selected_world].bonus_goods) do + capsules = capsules .. cap[2] .. 'x ' .. cap[1] .. '\n' + end local message = { title = 'World advanced', description = 'Arriving at target destination!', @@ -1224,8 +1235,18 @@ function Public.notify_discord(journey) inline = 'true' }, field3 = { - text1 = 'Fuel cells in mothership cargo:', - text2 = journey.mothership_cargo['uranium-fuel-cell'], + text1 = 'Satellites in mothership cargo:', + text2 = journey.mothership_cargo['satellite'] .. ' / ' .. journey.mothership_cargo_space['satellite'], + inline = 'false' + }, + field4 = { + text1 = 'Modifiers changed:', + text2 = modifier_message, + inline = 'false' + }, + field5 = { + text1 = 'Capsules gained:', + text2 = capsules, inline = 'false' } } diff --git a/maps/journey/unique_modifiers.lua b/maps/journey/unique_modifiers.lua index c477facf..e0840951 100644 --- a/maps/journey/unique_modifiers.lua +++ b/maps/journey/unique_modifiers.lua @@ -565,7 +565,6 @@ Public.railworld = { local delivery_options = { 'solar-panel', - 'rocket-part', 'beacon', 'assembling-machine-3', 'low-density-structure',