Skip to content

Commit

Permalink
Handle cases where player fails/skips some Benedict missions
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoromisato committed Dec 4, 2016
1 parent c6baada commit 992e241
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 5 deletions.
2 changes: 2 additions & 0 deletions TransCore/Benedict02.xml
Expand Up @@ -115,13 +115,15 @@
(msnGetData gSource 'playerDestroyedFreighter)
(block Nil
(rpgCharacterChangeRel &unidBenedict; 'betrayal)
(rpgCharacterSetStatus &unidFiona; 'dead)
(setq achievementText 'AchievementBetrayal)
)

; Player failed to defend freighter

(block Nil
(rpgCharacterChangeRel &unidBenedict; 'failure)
(rpgCharacterSetStatus &unidFiona; 'dead)
(setq achievementText 'AchievementFailure)
)
)
Expand Down
5 changes: 4 additions & 1 deletion TransCore/Benedict03.xml
Expand Up @@ -8,12 +8,15 @@
korolovNodeID: The system where the station can be found.
korolovID: ID of Korolov station.
NOTE: This mission does not have the benedictStoryArc attribute because
we don't want it to hold up the other missions.
======================================================================== -->

<MissionType UNID="&msBenedictToKorolov;"
name= "Benedict to Korolov"
attributes= "benedictStoryArc"
attributes= ""

level= "1"

Expand Down
36 changes: 34 additions & 2 deletions TransCore/Benedict04.xml
Expand Up @@ -33,7 +33,22 @@

(not (benedict_isMissionAvailable (objGetType gSource)))
(msnDestroy gSource)


; Only if we're in the New Beyond

(not (sysHasAttribute 'newBeyond))
(msnDestroy gSource)

; If Fiona is dead, mission doesn't show up

(not (rpgCharacterIsAliveAndWell &unidFiona;))
(msnDestroy gSource)

; If player skipped original Fiona mission, then nothing here.

(not (msnFind "r +unid:&msBenedictAndFiona;; +property:isSuccess;"))
(msnDestroy gSource)

; OK
)
)
Expand Down Expand Up @@ -92,11 +107,18 @@

<OnObjDestroyed>
(switch
; We don't care if an object ascends or enters a stargate

(or (= aDestroyReason 'ascended) (= aDestroyReason 'enteredStargate))
Nil

; If Stormhound dies, the mission fails.

(eq (objGetID aObjDestroyed) (msnGetData gSource 'stormhoundID))
(msnFailure gSource)
(block Nil
(rpgCharacterSetStatus &unidStormhound; 'dead)
(msnFailure gSource)
)
)
</OnObjDestroyed>

Expand Down Expand Up @@ -365,6 +387,16 @@
<Text id="SuccessMsg">
"Mission complete!"
</Text>
<Text id="FailureDebrief">
(cat
"Benedict slumps in a chair, rubbing his forehead with his hand:\n\n"

"\"I should never have trusted you on such a mission! "
"I failed her...\"\n\n"

"Benedict says no more."
)
</Text>

<Text id="StormhoundMeeting">
(list
Expand Down
5 changes: 5 additions & 0 deletions TransCore/Benedict05.xml
Expand Up @@ -32,6 +32,11 @@
(not (benedict_isMissionAvailable (objGetType gSource)))
(msnDestroy gSource)

; If Fiona is dead, mission doesn't show up

(not (rpgCharacterIsAliveAndWell &unidFiona;))
(msnDestroy gSource)

; OK
)
)
Expand Down
13 changes: 12 additions & 1 deletion TransCore/Benedict05A.xml
Expand Up @@ -153,8 +153,18 @@

<OnObjDestroyed>
(switch
; We don't care if an object ascends or enters a stargate

(or (= aDestroyReason 'ascended) (= aDestroyReason 'enteredStargate))
Nil

; If Sandoval dies, mission failure.

(= (objGetID aObjDestroyed) (msnGetData gSource 'sandovalID))
(msnFailure gSource)
(block Nil
(rpgCharacterSetStatus &unidHugoSandoval; 'dead)
(msnFailure gSource)
)
)
</OnObjDestroyed>

Expand Down Expand Up @@ -399,6 +409,7 @@
(scrShowScreen gScreen &dsAbandonedShip;)

; If Sandoval is dead, we go to special text without Sandoval
; [This can't happen because the mission fails if Sandoval is dead.]

(not sandovalObj)
(scrSetData gScreen 'dialogTree 'dlgBenedictAlone)
Expand Down
5 changes: 5 additions & 0 deletions TransCore/Benedict06.xml
Expand Up @@ -40,6 +40,11 @@
(!= (sysGetNode) (if (find (sysGetNodes) 'C6A) 'C6A 'C6))
(msnDestroy gSource)

; Must have completed Sandoval mission

(not (msnFind "r +unid:&msFindHandOfSolace;; +property:isSuccess;"))
(msnDestroy gSource)

; OK
)
)
Expand Down
85 changes: 85 additions & 0 deletions TransCore/Benedict07.xml
Expand Up @@ -48,6 +48,18 @@
(not (benedict_isMissionAvailable (objGetType gSource)))
(msnDestroy gSource)

; Must have completed Sandoval mission (but previous Benedict
; mission is optional).

(not (msnFind "r +unid:&msFindHandOfSolace;; +property:isSuccess;"))
(msnDestroy gSource)

; If Penitent infiltration mission fails, we can't proceed
; (but OK if we never do it).

(msnFind "r +unid:&msInfiltratePenitents;; +property:isFailure;")
(msnDestroy gSource)

; OK
)
)
Expand Down Expand Up @@ -320,6 +332,23 @@
)
</Text>
<Text id="Intro">
(switch
; If we never got the Penitent infiltration mission, tell the player
; what Benedict found.

(not (msnFind "r +unid:&msInfiltratePenitents;; +property:isSuccess;"))
(append
(msnTranslate gSource 'Intro.benedictExpo)
(msnTranslate gSource 'Intro.circleOfObligation)
)

(append
(msnTranslate gSource 'Intro.default)
(msnTranslate gSource 'Intro.circleOfObligation)
)
)
</Text>
<Text id="Intro.default">
(list
{
desc: (cat
Expand Down Expand Up @@ -348,6 +377,62 @@
"Just then, the meteorsteel door opens and all of you are led inside."
)
}
)
</Text>
<Text id="Intro.benedictExpo">
(list
{
desc: (cat
"The beautiful central chamber, built hundreds of years ago by Saint Eugenia, "
"is lit by the holograms of various Sisters. Lay and ordained women walk "
"through the halls in quiet conversation.\n\n"

"You see Fiona and Sandoval pacing in front of a large meteorsteel door."
)
label: "\"[W]here's Benedict?\""
}
{
desc: (cat
"Fiona frowns, \"You haven't heard? He was captured by Penitents!\"\n\n"

"Sandoval interjects, \"Actually, I think he's working them from the inside. "
"He's not as stupid as I thought.\""
)
label: "\"[W]hat happened?\""
}
{
desc: (cat
"Sandoval smiles, \"We had the perfect plan! Benedict and I infiltrated "
"a Penitent station looking for evidence&mdash;and we found some! "
"We've got a video ROM of Sister Ston making a deal with the Penitents.\n\n"

"\"But we almost got caught and Benedict stayed behind to give me a chance "
"to escape.\""
)
label: "\"[S]ister Ston?\""
}
{
desc: (cat
"Fiona is furious, \"She's betrayed us! And with the video we can prove it!\n\n"

"\"We're waiting for an audience with the Circle of Obligation, the "
"Sisters' leadership. They'll help us.\""
)
label: "\"[H]ow can you be sure?\""
}
{
desc: (cat
"\"I talked to Sister Oriela, the grandmatriarch of the Sisters. "
"I gave her the video ROM and she's convened a meeting of the Circle "
"to formally charge Sister Ston.\"\n\n"

"Just then, the meteorsteel door opens and all of you are led inside."
)
}
)
</Text>
<Text id="Intro.circleOfObligation">
(list
{
desc: (cat
"The Circle of Obligation sits at a curved table in front of you. "
Expand Down
1 change: 0 additions & 1 deletion TransCore/BenedictStoryArc.xml
Expand Up @@ -25,7 +25,6 @@
Benedict and/or Fiona. Each time the player does so, we increment
this variable.
-->

<Type UNID="&unidBenedictStoryArc;">
Expand Down
33 changes: 33 additions & 0 deletions TransCore/RPGCharacters.xml
Expand Up @@ -442,6 +442,27 @@
(typGetData charType 'playerRel)
))

(setq rpgCharacterGetStatus (lambda (charType)
(typGetData charType 'status)
))

(setq rpgCharacterIsAliveAndWell (lambda (charType)
(block (
(status (typGetData charType 'status))
)
(switch
; Dead means dead

(= status 'dead)
Nil

; Otherwise, we're alive and well

True
)
)
))

(setq rpgCharacterSetMeeting (lambda (charType)
(block Nil
(typSetData charType 'latestPlayerMeetingTime (unvGetTick))
Expand All @@ -454,6 +475,18 @@
(setq rpgCharacterSetScreen (lambda (charType screenData)
(typSetData charType 'screenData screenData)
))

(setq rpgCharacterSetStatus (lambda (charType status)

; This function sets the status of the character. We support the following
; values:
;
; Nil: Character is alive and well. No special status.
;
; 'dead: Character is dead.

(typSetData charType 'status status)
))

(setq rpgCharacterShowMissionScreen (lambda (missionSource options)

Expand Down

0 comments on commit 992e241

Please sign in to comment.