Skip to content
Merged
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
21 changes: 12 additions & 9 deletions scripts/scenario_44_outpost.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ require("generate_call_sign_scenario_utility.lua")
-- Initialization --
--------------------
function init()
scenario_version = "2.0.0"
print(string.format(" ----- Scenario: Outpost ----- Version %s -----",scenario_version))
print(_VERSION)
scenario_version = "2.0.1"
ee_version = "2024.12.08"
print(string.format(" ---- Scenario: Doomed Outpost ---- Version %s ---- Tested with EE version %s ----",scenario_version,ee_version))
if _VERSION ~= nil then
print("Lua version:",_VERSION)
end
spawn_enemy_diagnostic = false
setVariations() --numeric difficulty, Kraylor fortress size
setConstants() --missle type names, template names and scores, deployment directions, player ship names, etc.
Expand Down Expand Up @@ -5911,7 +5914,7 @@ function friendlyComms(comms_data)
addCommsReply(_("Back"), commsShip)
end)
for index, 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 @@ -6817,7 +6820,7 @@ function friendlyServiceJonqueComms(comms_data)
addCommsReply(_("Back"), commsServiceJonque)
end)
for index, 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 @@ -7910,7 +7913,7 @@ function moonCollisionCheck()
for _, obj in ipairs(collision_list) do
if obj:isValid() then
obj_dist = distance(obj,moon_barrier)
if obj.components.ai_controller then
if isObjectType(obj,"CpuShip") then
obj_type_name = obj:getTypeName()
if obj_type_name ~= nil then
ship_distance = shipTemplateDistance[obj:getTypeName()]
Expand All @@ -7925,7 +7928,7 @@ function moonCollisionCheck()
if obj_dist <= moon_barrier.moon_radius + ship_distance + 200 then
obj:takeDamage(100,"kinetic",moon_x,moon_y)
end
elseif obj.components.player_control then
elseif isObjectType(obj,"PlayerSpaceship") then
obj_type_name = obj:getTypeName()
if obj_type_name ~= nil then
ship_distance = playerShipStats[obj:getTypeName()].distance
Expand Down Expand Up @@ -8008,7 +8011,7 @@ function updatePlayerProximityScan(p)
local obj_list = p:getObjectsInRange(p.prox_scan*1000)
if obj_list ~= nil and #obj_list > 0 then
for _, obj in ipairs(obj_list) do
if obj:isValid() and obj.components.ai_controller and not obj:isFullyScannedBy(p) then
if obj:isValid() and isObjectType(obj,"CpuShip") and not obj:isFullyScannedBy(p) then
obj:setScanState("simplescan")
end
end
Expand All @@ -8031,7 +8034,7 @@ function whammyTime(p)
local objs = getObjectsInRadius(p_x,p_y,10000)
local nebulae = {}
for i,obj in ipairs(objs) do
if obj.typeName == "Nebula" then
if isObjectType(obj,"Nebula") then
table.insert(nebulae,obj)
end
end
Expand Down