Skip to content

Commit

Permalink
DiD S12: Alternative campaign finish by letting the hero take the book
Browse files Browse the repository at this point in the history
On the third and subsequent playthroughs of Endless Night, Mal Keshar
has learned from the ending of SotA, and can leave the book to be
taken by the foolish hero's army.  This text doesn't handle the unit
that picks up the book being the hero themselves, but the hero seems
to be using the normal boss AI of staying near the castle so that
probably won't happen anyway.

He learns how to lichify level 3 necromancers at the start of the
first playthrough, which fits better with the backstory of the book.
The png icon for this is copied from SotA.

This would close issues #3165 and #3167.

[ci skip]
  • Loading branch information
stevecotton authored and GregoryLundberg committed Oct 21, 2018
1 parent 20b76b3 commit 30764fa
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Expand Up @@ -52,6 +52,10 @@
* Normal healing now happens on turn 1 for all sides except the first. (issue #3562)

## Version 1.14.5+dev
### Campaigns
* Descent Into Darkness:
* Allow converting L3 necromancers to liches from S12 onwards (issue #3165).
* Added an alternative method of completing the campaign (issue #3167).
### Language and i18n
* Updated translations: Chinese (Traditional), French, Italian, Spanish.
### Lua API
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
306 changes: 305 additions & 1 deletion data/campaigns/Descent_Into_Darkness/scenarios/12_Endless_Night.cfg
Expand Up @@ -24,6 +24,58 @@
story= _ "Rumors circulate of a lich that preys on scouting patrols. A hero, gathering his loyal troops to him, decides to put an end to the evil."
{STORYTXT_BACKGROUND end.jpg}
[/part]
# These if statements are before the prestart event, so are off-by-one compared to the other checks of timesForever
[if]
{VARIABLE_CONDITIONAL timesForever less_than_equal_to 0}
[then]
[part]
story= _ "Mal Keshar has had time to study the book, learning how his apprentices can become liches with less reliance on luck than Malin’s own transformation."
{STORYTXT_BACKGROUND book.jpg}
[/part]
[/then]
[/if]
[if]
{VARIABLE_CONDITIONAL timesForever numerical_equals 1}
[then]
[part]
story= _ "Mal Keshar continues to study the book, and re-reads the final entry."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[part]
# po: This text comes from the epilogue of Secrets of the Ancients, edited to avoid revealing the name of the campaign or the names of the protagonists
story = _"<i>“I realize now... the world is not ready for our knowledge. I give up on all of them. I am going to live in the old troll city and learn the applications of mountain fire. In some future time, less conservative attitudes will dominate, and I can certainly afford to wait. In the meantime, we are doing what we can to hasten that day.”</i>"
{STORYTXT_BACKGROUND book.jpg}
[/part]
[part]
# po: More text from the epilogue of Secrets of the Ancients
story= _ "<i>“As for me, I have placed some spells on my journal to help keep it from harm, and I will make it conspicuous on this battlefield. I hope that it will eventually make its way into the hands of someone in Tath who is willing to learn.”</i>"
{STORYTXT_BACKGROUND book.jpg}
[/part]
[/then]
[/if]
[if]
{VARIABLE_CONDITIONAL timesForever greater_than_equal_to 2}
[then]
[part]
# po: This text comes from the epilogue of Secrets of the Ancients, edited to avoid revealing the name of the campaign or the names of the protagonists
story = _"<i>“I realize now... the world is not ready for our knowledge. I give up on all of them. I am going to live in the old troll city and learn the applications of mountain fire. In some future time, less conservative attitudes will dominate, and I can certainly afford to wait. In the meantime, we are doing what we can to hasten that day.”</i>"
{STORYTXT_BACKGROUND book.jpg}
[/part]
[part]
# po: More text from the epilogue of Secrets of the Ancients
story= _ "<i>“As for me, I have placed some spells on my journal to help keep it from harm, and I will make it conspicuous on this battlefield. I hope that it will eventually make its way into the hands of someone in Tath who is willing to learn.”</i>"
{STORYTXT_BACKGROUND book.jpg}
[/part]
[part]
story= _ "That final entry in the book gnaws at Mal Keshar. While he was being used by Darken Volk as a pawn, both of them were being using as pawns by the author of the book itself."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[part]
story= _ "The book’s author had left it for a foolish hero to pick up, and the spells protecting it had been strong enough to resist the mages of Tath. Mal Keshar had already made several copies of the book and had no further need of the original; if he allowed another foolish hero to take it, would another student eventually follow in his footsteps? Could the author’s plan work? Might liches eventually be accepted in society, if he simply waited?"
{STORYTXT_BACKGROUND end.jpg}
[/part]
[/then]
[/if]
[/story]

{DID_TRACK {JOURNEY_12_NEW}}
Expand Down Expand Up @@ -99,6 +151,15 @@
[/show_if]
[/objective]

[objective]
{ALTERNATIVE_OBJECTIVE_CAPTION}
condition=win
description= _ "Allow an enemy unit to take the book"
[show_if]
{VARIABLE_CONDITIONAL timesForever greater_than_equal_to 3}
[/show_if]
[/objective]

[objective]
{ALTERNATIVE_OBJECTIVE_CAPTION}
condition=win
Expand All @@ -116,13 +177,58 @@
description="<b>" + _ "Endless Night $timesForever" + "</b>"
[/note]

[note]
# po: more text copied from Secrets of the Ancients
description= _ "To turn a necromancer into a lich, right-click on it while it is in a castle."
[/note]

{HAS_NO_TURN_LIMIT}

# No {IS_LAST_SCENARIO}, because the player can win and keep on playing
[/objectives]

{MODIFY_UNIT (id=Mal Keshar) profile (portraits/malin_lich-ancient.png)}

# There is now a menu option to turn necromancers into liches.
[set_menu_item]
id=lichify
description= _ "Make Into a Lich"
image=units/icons/icon-lich.png
[show_if]
[have_unit]
x=$x1
y=$y1
side=1
type=Necromancer
[/have_unit]
[/show_if]
[command]
[if]
[have_location]
x=$x1
y=$y1
terrain=C*^*,K*^*,*^K*,*^C* # castles and keeps
[/have_location]
[then]
[fire_event]
name=lichify # See DiD's macros.cfg, or SotA’s sota-utils.cfg
[primary_unit]
x=$x1
y=$y1
[/primary_unit]
[/fire_event]
[/then]
[else]
[message]
speaker=narrator
image=misc/makeshift-altar.png
message= _ "You can only do this in a castle."
[/message]
[/else]
[/if]
[/command]
[/set_menu_item]

[if]
{VARIABLE_CONDITIONAL timesForever greater_than 1}

Expand All @@ -132,6 +238,7 @@
[/then]

[else]
{VARIABLE previous_previous_randomHero -1}
{VARIABLE previous_randomHero -1}
[/else]
[/if]
Expand Down Expand Up @@ -458,6 +565,201 @@
{CLEAR_VARIABLE random}
[/else]
[/switch]

# Place the book, and add a victory event if the foolish hero's army
# takes it. Should the unit have to make its way back to the enemy
# keep? Probably not, Mal Keshar is going to let it go anyway; maybe
# he should have to kill the first unit that picks it up and let a
# second enemy pick it up, to make it more convincing for the foolish
# hero.
#
# The dialog would be wrong if the hero picked up the book themselves,
# but that's unlikely to happen, the hero is likely to stay on the keep
# to recruit.
[if]
{VARIABLE_CONDITIONAL timesForever greater_than_equal_to 3}
[then]
{PLACE_IMAGE (items/book5.png) 12 17}

[event]
name=moveto
first_time_only=yes
[filter]
x,y=12,17
side=2
[/filter]

[remove_item]
x,y=$x1,$y1
image="items/book5.png"
[/remove_item]

[switch]
variable=randomHero
[case]
value=human
[message]
speaker=unit
message= _ "That’s an evil grimoire!"
[/message]

[message]
speaker=Foolish Hero
message= _ "Burn it."
[/message]

[message]
speaker=Mal Keshar
message= _ "<small>(faking pain)</small> Aaargh!"
[/message]

[message]
role=unit
message= _ "It’s not catching fire, sir."
[/message]

[message]
speaker=Foolish Hero
message= _ "But it seems to be hurting the lich. Bring it with us, retreat and let the mages destroy this."
[/message]
[/case]

[case]
value=bandit
[message]
speaker=unit
message= _ "That’s an evil grimoire!"
[/message]

[message]
speaker=Foolish Hero
message= _ "Burn it."
[/message]

[message]
speaker=Mal Keshar
message= _ "<small>(faking pain)</small> Aaargh!"
[/message]

[message]
role=unit
message= _ "It’s paper, but it won’t burn."
[/message]

[message]
speaker=Foolish Hero
message= _ "But it seems to be hurting the lich. Grab it, retreat and throw it on a bigger fire. Once we’ve burnt it, maybe the lich will be weaker."
[/message]
[/case]

[case]
value=elf
[message]
speaker=unit
message= _ "That’s an evil grimoire!"
[/message]

[message]
speaker=Foolish Hero
# po: "faerie fire" as in the elvish sylph's attack
message= _ "Bring it with us, and let’s retreat. Once it’s burned with faerie fire, maybe the lich will be weakened."
[/message]
[/case]

[case]
value=dwarf
[message]
speaker=unit
message= _ "That’s an evil grimoire, bound in iron."
[/message]

[message]
speaker=Foolish Hero
message= _ "Destroy it."
[/message]

[message]
speaker=Mal Keshar
message= _ "<small>(faking pain)</small> Aaargh!"
[/message]

[message]
speaker=unit
# po: the speaker is a dwarf
message= _ "My hammer can’t dent it and my axe can’t cut the paper."
[/message]

[message]
speaker=Foolish Hero
# po: the speaker is a dwarf
message= _ "But it seems to be hurting the lich. Bring it with us, retreat and let the forge destroy it."
[/message]
[/case]

[case]
value=orc
[message]
speaker=unit
# po: the speaker is an orc
message= _ "The skull on that book looks good."
[/message]

[message]
speaker=Foolish Hero
message= _ "Idiot."
[/message]

[message]
speaker=Mal Keshar
message= _ "<small>(faking pain)</small> Aaargh!"
[/message]

[message]
speaker=unit
message= _ "Uuuuuh, I can’t pull the skull off the book, but that lich screams when I try."
[/message]

[message]
speaker=Mal Keshar
message= _ "Defend me my minions! Get the book! Aaargh!"
[/message]

[message]
speaker=Foolish Hero
message= _ "Bring it with you and retreat, let’s take our time smashing that book."
[/message]
[/case]
[/switch]

[story]
title= _ "Epilogue"
[part]
story= _ "The foolish hero was tricked, and left believing both that the book could be destroyed, and that the lich might be weakened by doing so."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[part]
story= _ "Safely outside the cave, the foolish hero tried to destroy the book. None of the attempts left so much as a dent or char, yet each attempt caused another scream to echo from the cave mouth. Finally the cave entrance collapsed, and everything was still."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[part]
story= _ "Years pass. Every summer when the mountain passes become clear, humans, elves and dwarves patrol to repel orcish raiders. Undead no longer trouble the patrols, and memories of the lich fade to become just background in the tale of the brave hero’s victory."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[part]
story= _ "Rumors circulate that fortune smiles on those patrols. That when attacked by orcs at night, it sometimes seems that more blades than just the patrol’s own are fighting the orcs."
{STORYTXT_BACKGROUND end.jpg}
[/part]
[/story]

[endlevel]
next_scenario=null
carryover_report=no
save=no
linger_mode=no
[/endlevel]
[/event]
[/then]
[/if]
[/event]

[event]
Expand Down Expand Up @@ -576,7 +878,7 @@

[message]
role=second
message= _ "I guess we'll never know for sure."
message= _ "I guess well never know for sure."
[/message]
[/case]

Expand Down Expand Up @@ -623,4 +925,6 @@
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]

{TURN_INTO_A_LICH}
[/scenario]

0 comments on commit 30764fa

Please sign in to comment.