Skip to content

Fermi 500 Scenario Updates #2336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions scripts/scenario_58_race.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ require("place_station_scenario_utility.lua")
-- Initialization --
----------------------
function init()
scenario_version = "2.2.2"
print(string.format(" ----- Scenario: Fermi 500 ----- Version %s -----",scenario_version))
scenario_version = "2.2.3"
ee_version = "2024.12.08"
print(string.format(" ---- Scenario: Fermi 500 ---- Version %s ---- Tested with EE version %s ----",scenario_version,ee_version))
if _VERSION ~= nil then
print("Lua version:",_VERSION)
end
Expand Down Expand Up @@ -1697,9 +1698,40 @@ function handleDockedState()
end
end
local out = _("cartographyOffice-comms","Without looking at you, the clerk tells you that the cartographers are out of the office for the race. They left this list of stations that provide upgrades for any racer that dropped by:")
for i,station_info in ipairs(station_upgrade_list) do
if station_info.station:isValid() then
out = string.format(_("upgrade-comms","%s\nSector:%s Station:%s Upgrade:%s"),out,station_info.station:getSectorName(),station_info.station:getCallSign(),station_info.upgrade)
if comms_target:isFriendly(comms_source) then
for i,station_info in ipairs(station_upgrade_list) do
if station_info.station:isValid() then
out = string.format(_("upgrade-comms","%s\nSector:%s Station:%s Upgrade:%s"),out,station_info.station:getSectorName(),station_info.station:getCallSign(),station_info.upgrade)
end
end
else
out = _("cartographyOffice-comms","Without looking at you, the clerk tells you that the cartographers are out of the office for the race. They left this list of neutral station locations in the area and what goods they might sell for any racer that dropped by:")
for i,station in ipairs(stationList) do
if station:isValid() and not station:isFriendly(comms_source) and not station:isEnemy(comms_source) then
out = string.format(_("cartographyOffice-comms","%s\n%s %s"),out,station:getSectorName(),station:getCallSign())
if station.comms_data == nil then
out = string.format(_("cartographyOffice-comms","%s: none"),out)
else
if station.comms_data.goods == nil then
out = string.format(_("cartographyOffice-comms","%s: none"),out)
else
local good_present = false
for good, good_data in pairs(station.comms_data.goods) do
if good_data.quantity > 0 then
if good_present then
out = string.format(_("cartographyOffice-comms","%s, %s"),out,good)
else
out = string.format(_("cartographyOffice-comms","%s: %s"),out,good)
end
good_present = true
end
end
if not good_present then
out = string.format(_("cartographyOffice-comms","%s: none"),out)
end
end
end
end
end
end
setCommsMessage(string.format(_("cartographyOffice-comms", "%s %s"),comms_target.cartographer_description,out))
Expand Down Expand Up @@ -1864,7 +1896,7 @@ function handleDockedState()
local objects = getObjectsInRadius(sx,sy,10000)
local asteroids = {}
for i,obj in ipairs(objects) do
if obj.typeName == "Asteroid" then
if isObjectType(obj,"Asteroid") then
local ax, ay = obj:getPosition()
local sx, sy = comms_target:getPosition()
table.insert(asteroids,{a = obj, dist = distance(ax, ay, sx, sy)})
Expand Down Expand Up @@ -2592,7 +2624,7 @@ function friendlyComms()
addCommsReply(_("Back"), commsShip)
end)
for i, obj in ipairs(comms_target:getObjectsInRange(5000)) do
if obj.typeName == "SpaceStation" and not comms_target:isEnemy(obj) then
if isObjectType(obj,"SpaceStation") and not comms_target:isEnemy(obj) then
addCommsReply(string.format(_("shipAssist-comms", "Dock at %s"), obj:getCallSign()), function()
setCommsMessage(string.format(_("shipAssist-comms", "Docking at %s."), obj:getCallSign()));
comms_target:orderDock(obj)
Expand Down
Loading