From aa9efcee484b0e6b7c17f0c607955d896fcbe395 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Mon, 17 Jun 2024 17:32:28 -0400 Subject: [PATCH 1/2] Scout: better handling of high-pressure surface scans - Filter out extreme-pressure bodies that 95% of ships won't be able to visit (can be re-added later as high-reward special mission). - Display target body surface pressure and gravity for surface scan ads when relevant. --- data/lang/module-scout/en.json | 8 ++++++++ data/modules/Scout/Scout.lua | 28 ++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/data/lang/module-scout/en.json b/data/lang/module-scout/en.json index 090b6ba627e..f8072be1a9c 100644 --- a/data/lang/module-scout/en.json +++ b/data/lang/module-scout/en.json @@ -442,5 +442,13 @@ "YOU_WILL_BE_PAID_ON_MY_BEHALF_AT_NEW_DESTINATION": { "description": "", "message": "You will be paid on my behalf at the NEW DESTINATION" + }, + "SURFACE_SCAN_DETAILS": { + "description": "Additional warning information about a surface scan target", + "message": "The target has a surface pressure of {pressure} with a gravitational force of {gravity} at the surface." + }, + "SURFACE_SCAN_WARNING": { + "description": "Warning reminder to player", + "message": "Please ensure your ship is capable of operating at the body's surface before accepting the contract." } } diff --git a/data/modules/Scout/Scout.lua b/data/modules/Scout/Scout.lua index dc412bcc0a7..c340fbc6a74 100644 --- a/data/modules/Scout/Scout.lua +++ b/data/modules/Scout/Scout.lua @@ -205,6 +205,16 @@ local onChat = function (form, ref, option) system = ui.Format.SystemPath(ad.location:SystemOnly()), dist = format_dist(ad), }) + + if not ad.orbital and (sbody.surfacePressure > 0.5 or sbody.gravity > 4.5) then + introtext = introtext .. "\n\n" .. l.SURFACE_SCAN_DETAILS % { + pressure = ui.Format.Pressure(sbody.surfacePressure), + gravity = ui.Format.Gravity(sbody.gravity / EARTH_G) + } + + introtext = introtext .. "\n\n" .. l.SURFACE_SCAN_WARNING + end + form:SetMessage(introtext) elseif option == 1 then @@ -214,12 +224,15 @@ local onChat = function (form, ref, option) form:SetMessage(string.interp(l.PLEASE_HAVE_THE_DATA_BACK_BEFORE, {date = Format.Date(ad.due)})) elseif option == 4 then - form:SetMessage(string.interp(l.SCAN_DETAILS, { + + local details = l.SCAN_DETAILS % { coverage = format_coverage(ad.orbital, ad.coverage), resolution = string.format("%.1f", ad.resolution), body = ad.location:GetSystemBody().name, type = ad.orbital and l.AN_ORBITAL_SCAN or l.A_SURFACE_SCAN - })) + } + + form:SetMessage(details) elseif option == 5 then form:SetMessage(ad.orbital and l.ADDITIONAL_INFORMATION_ORBITAL or l.ADDITIONAL_INFORMATION_SURFACE) @@ -371,8 +384,15 @@ local filterBodySurface = function(station, sBody) return false end - -- filter out bodies unless at least 100km in diameter - if sBody.radius < 50000 then + -- filter out bodies unless at least 200km in diameter + if sBody.radius < 100000 then + return false + end + + -- filter out bodies with extreme atmospheric pressures + -- most ships won't be able to scan these planets even with heavy atmospheric shielding + -- TODO: allow surface scans on high-pressure planets as special high-reward mission type + if sBody.surfacePressure > 60.0 then return false end From 712c3a9756aab655c85aabd6f28f325f77f0b557 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Wed, 26 Jun 2024 12:54:57 -0400 Subject: [PATCH 2/2] Scout: improve pressure warning string --- data/lang/module-scout/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/lang/module-scout/en.json b/data/lang/module-scout/en.json index f8072be1a9c..5c745243426 100644 --- a/data/lang/module-scout/en.json +++ b/data/lang/module-scout/en.json @@ -449,6 +449,6 @@ }, "SURFACE_SCAN_WARNING": { "description": "Warning reminder to player", - "message": "Please ensure your ship is capable of operating at the body's surface before accepting the contract." + "message": "Please ensure your ship is capable of operating at the target body's surface before accepting the contract." } }