Skip to content
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

Scenario: Beacon - Don't require redock to continue to next section #2166

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
64 changes: 45 additions & 19 deletions scripts/scenario_05_beacon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,35 @@ Your translator has difficulty translating the message, but it seems to come dow
)
end
end

function missionAmbushed(delta)
local briefing_for_next_section = _("incCall",
[[Good job dealing with those Exuari scum. The criminals are safely in our custody, and we'll send a protection detail to Refugee-X.

We extracted some vital info from the Exuari. In the next transport convoy toward Research-1, an Exuari death squad is hiding in one of the ships. The transport detail is heading in from sector D7. Seek them out and scan the ships to find the Exuari transport.]])

--- Sets up the next mission state: Spawns ships
local function SetupNextMissionState()
x, y = neutral_station:getPosition()
CpuShip():setTemplate("Phobos T3"):setFaction("Human Navy"):setPosition(x - 1000, y - 1000):orderDefendTarget(
neutral_station):setCommsScript("")
CpuShip():setTemplate("Nirvana R5"):setFaction("Human Navy"):setPosition(x + 1000, y + 1000):orderDefendTarget(
neutral_station):setCommsScript("")

transports = {}

for n = 1, 5 do
table.insert(transports,
CpuShip():setTemplate("Personnel Freighter 2"):setFaction("Independent"):setPosition(
50000 + random(-10000, 10000), -30000 + random(-10000, 10000)))
end

transport_target = CpuShip():setTemplate("Personnel Freighter 2"):setFaction("Exuari"):setPosition(
50000 + random(-10000, 10000), -30000 + random(-10000, 10000))
end

local all_ambush_ships_are_dead = not ambush_main:isValid() and not ambush_side1:isValid() and
not ambush_side2:isValid()

if player:isDocked(main_station) then
local refilled = false

Expand All @@ -235,41 +262,40 @@ function missionAmbushed(delta)
refilled = true
end

if not ambush_main:isValid() and not ambush_side1:isValid() and not ambush_side2:isValid() then
message = _("incCall", [[Good job dealing with those Exuari scum. The criminals are safely in our custody, and we'll send a protection detail to Refugee-X.
if all_ambush_ships_are_dead then
local message = briefing_for_next_section

We extracted some vital info from the Exuari. In the next transport convoy toward Research-1, an Exuari death squad is hiding in one of the ships. The transport detail is heading in from sector D7. Seek them out and scan the ships to find the Exuari transport.]])
if refilled then
message = message .. _("incCall", [[We have refitted your nukes and EMPs.]]) .. _("incCall", [[Awesome job taking out the Exuari without those.]])
message = message ..
_("incCall", [[We have refitted your nukes and EMPs. Awesome job taking out the Exuari without those.]])
refilled = false
end

main_station:sendCommsMessage(
player,
message
)

x, y = neutral_station:getPosition()
CpuShip():setTemplate("Phobos T3"):setFaction("Human Navy"):setPosition(x - 1000, y - 1000):orderDefendTarget(neutral_station):setCommsScript("")
CpuShip():setTemplate("Nirvana R5"):setFaction("Human Navy"):setPosition(x + 1000, y + 1000):orderDefendTarget(neutral_station):setCommsScript("")

transports = {}

for n = 1, 5 do
table.insert(transports, CpuShip():setTemplate("Personnel Freighter 2"):setFaction("Independent"):setPosition(50000 + random(-10000, 10000), -30000 + random(-10000, 10000)))
end

transport_target = CpuShip():setTemplate("Personnel Freighter 2"):setFaction("Exuari"):setPosition(50000 + random(-10000, 10000), -30000 + random(-10000, 10000))

SetupNextMissionState()
mission_state = missionGotoTransport
end

if refilled then
main_station:sendCommsMessage(
player,
_("incCall", [[We have refitted your nukes and EMPs.]]) .. _("incCall", [[Now to get those Exuari!]])
_("incCall", [[We have refitted your nukes and EMPs. Now to get those Exuari!]])
)
end
elseif player.old_nuke_max == nil and all_ambush_ships_are_dead then
-- The Epsilon refitted the nukes and then went back to destroy the remaining ambush ships.
-- Call them immediately after destroying the last ambush ship.

main_station:sendCommsMessage(
player,
briefing_for_next_section
)

SetupNextMissionState()
mission_state = missionGotoTransport
end
end

Expand Down
Loading