Skip to content

Commit

Permalink
Merge pull request #5841 from Web-eWorks/surface-scan-pressure
Browse files Browse the repository at this point in the history
Improve surface scan missions on high-pressure worlds
  • Loading branch information
Webster Sheets authored Jun 26, 2024
2 parents 935a3a5 + 712c3a9 commit ad7b33b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
8 changes: 8 additions & 0 deletions data/lang/module-scout/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 target body's surface before accepting the contract."
}
}
28 changes: 24 additions & 4 deletions data/modules/Scout/Scout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ad7b33b

Please sign in to comment.