Skip to content

Delta Quadrant Patrol Duty Scenario Updates #2330

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 2 commits 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
22 changes: 14 additions & 8 deletions scripts/scenario_54_PatrolDuty.lua
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ end
-- Initialization --
----------------------
function init()
scenario_version = "8.0.1"
ee_version = "2024.12.08"
print(string.format(" ---- Scenario: Patrol Duty ---- Version %s ---- Tested with EE version %s ----",scenario_version,ee_version))
if _VERSION ~= nil then
print("Lua version:",_VERSION)
end
setVariations()
setConstants()
diagnostic = false
Expand Down Expand Up @@ -4601,7 +4607,7 @@ function handleDockedState()
local sx, sy = comms_target:getPosition()
local nearby_objects = getObjectsInRadius(sx,sy,30000)
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
if brochure_stations == "" then
brochure_stations = string.format(_("cartographyOffice-comms", "%s %s %s"),obj:getSectorName(),obj:getFaction(),obj:getCallSign())
Expand All @@ -4623,7 +4629,7 @@ function handleDockedState()
local sx, sy = comms_target:getPosition()
local nearby_objects = getObjectsInRadius(sx,sy,30000)
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
if obj.comms_data.goods ~= nil then
for good, good_data in pairs(obj.comms_data.goods) do
Expand Down Expand Up @@ -4657,7 +4663,7 @@ function handleDockedState()
local nearby_objects = getObjectsInRadius(sx,sy,50000)
local stations_known = 0
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
stations_known = stations_known + 1
addCommsReply(obj:getCallSign(),function()
Expand Down Expand Up @@ -4695,7 +4701,7 @@ function handleDockedState()
local button_count = 0
local by_goods = {}
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
if obj.comms_data.goods ~= nil then
for good, good_data in pairs(obj.comms_data.goods) do
Expand Down Expand Up @@ -5181,7 +5187,7 @@ function masterCartographer()
local nearby_objects = getAllObjects()
local stations_known = 0
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
local station_distance = distance(comms_target,obj)
if station_distance > 50000 then
Expand Down Expand Up @@ -5223,7 +5229,7 @@ function masterCartographer()
local nearby_objects = getAllObjects()
local by_goods = {}
for i, obj in ipairs(nearby_objects) do
if obj.typeName == "SpaceStation" then
if isObjectType(obj,"SpaceStation") then
if not obj:isEnemy(comms_target) then
local station_distance = distance(comms_target,obj)
if station_distance > 50000 then
Expand Down Expand Up @@ -5746,7 +5752,7 @@ function friendlyComms(comms_data)
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 Expand Up @@ -7589,7 +7595,7 @@ function jumpStart(delta)
objList = getObjectsInRadius(x, y, 30000)
nebulaList = {}
for i, obj in ipairs(objList) do
if obj.typeName == "Nebula" then
if isObjectType(obj,"Nebula") then
table.insert(nebulaList,obj)
end
end
Expand Down
Loading