Allowing conditionals inside [part] and [story]...
...allows some major simplifications in conditional journey macros and their calling code.
This commit is contained in:
parent
e5ff916e97
commit
df7b49deef
15 changed files with 314 additions and 1124 deletions
|
@ -46,6 +46,7 @@
|
|||
[/part]
|
||||
[part]
|
||||
story= _ "All went well once the King's forces arrived. There were no attacks for several weeks, and Gweddry's men started to grow incautious. Then, at dawn one day, Gweddry and his men were roused by the startled cries of the night watchmen..."
|
||||
show_title=yes
|
||||
{TO_THE_OUTPOST}
|
||||
[/part]
|
||||
[/story]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_NORTHERN_OUTPOST}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_NORTHERN_OUTPOST}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_TWO_PATHS}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_TWO_PATHS}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_THE_CROSSING}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_THE_CROSSING}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_UNDEAD_CROSSING}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_UNDEAD_CROSSING}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_TRAINING_THE_OGRES}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_TRAINING_THE_OGRES}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_XENOPHOBIA}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_XENOPHOBIA}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_LAKE_VRUG}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_LAKE_VRUG}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
story= _ "Gweddry had escaped from the orcish prisons. He found himself in the Northlands, farther south than before. Orcs were at his back. He and his men went south, until they reached the Great River."
|
||||
show_title=yes
|
||||
[/part]
|
||||
{TO_EVACUATION}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_EVACUATION}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_THE_DROWNED_PLAINS}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_THE_DROWNED_PLAINS}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
{campaigns/Eastern_Invasion/utils/deaths.cfg}
|
||||
|
||||
[story]
|
||||
{TO_APPROACHING_WELDYN}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_APPROACHING_WELDYN}
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
[side]
|
||||
|
|
|
@ -14,35 +14,28 @@
|
|||
|
||||
# wmllint: local spelling Galdren Ravan
|
||||
[story]
|
||||
{TO_THE_COUNCIL}
|
||||
[part]
|
||||
show_title=yes
|
||||
{TO_THE_COUNCIL}
|
||||
[/part]
|
||||
[part]
|
||||
story= _ "Before we begin our council, I must tell you all the history of this lich we face. He was at first a mage of light, like me, and his fall began during the reign of Haldric VII..."
|
||||
background=portraits/dacyn.png
|
||||
[/part]
|
||||
|
||||
[part]
|
||||
story= _ "The greatest seer in the land, Galdren, foresaw that some day, some day soon, a great evil would spread over the land. The king, naturally, was worried. The seer told him that the only way to stop the evil was to appoint a mage, versed well in combat with the spirits of darkness, to be the king's advisor."
|
||||
# background=
|
||||
[/part]
|
||||
|
||||
[part]
|
||||
story= _ "In all the land, there were two magi of light that clearly stood out from the rest. A mage from the east named Ravan, and myself. The King, wishing to choose a good advisor, sent us both before Galdren. Then he conversed with the seer privately. None know what was said, but when he came out he announced that the seer was dead, and he had chosen me as his new advisor."
|
||||
# background=
|
||||
[/part]
|
||||
|
||||
[part]
|
||||
story= _ "Ravan took this quietly enough, we all thought, but now I think that this was when he began his fall. He went deep into conversation with the spirits of darkness, hoping to discover their weaknesses, but it was they who found his. In time, as all of the magi of death eventually do, he took his own life and reformed himself as a lich, one of the most powerful ones ever seen."
|
||||
# background=
|
||||
[/part]
|
||||
|
||||
[part]
|
||||
story= _ "One day, he disguised himself and came to the castle, where I was living. He demanded to see me, and the guards let him in, for then he was still a respected member of the court. When I came out, he revealed himself, named himself Mal-Ravanal, and challenged me to a duel."
|
||||
# background=
|
||||
[/part]
|
||||
|
||||
[part]
|
||||
story= _ "The guards, surprised by this sudden revelation, advanced to attack him. However, as he was now skilled in the magical art of teleportation, he simply vanished. And has not been seen since."
|
||||
# background=
|
||||
[/part]
|
||||
[/story]
|
||||
|
||||
|
|
|
@ -286,12 +286,6 @@
|
|||
|
||||
# trackplacer: tracks end
|
||||
|
||||
# This is where we stitch together the variant journey tracks.
|
||||
# How these are assembled depends on the value of the variables
|
||||
# first_fork and second_fork.
|
||||
|
||||
# Early macros can be called within [part], as no conditionals are involved.
|
||||
|
||||
#define TO_THE_OUTPOST
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_STAGE1}
|
||||
|
@ -320,251 +314,140 @@
|
|||
{JOURNEY3_STAGE2}
|
||||
#enddef
|
||||
|
||||
# All following macros must be direct children of [story].
|
||||
# This can be fixed when conditionals are supported inside [part]
|
||||
|
||||
#define TO_NORTHERN_OUTPOST
|
||||
background="eastern-invasion-map.png"
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_STAGE3}
|
||||
[/part]
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_STAGE3}
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_STAGE2}
|
||||
[/part]
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_STAGE2}
|
||||
[/else]
|
||||
[/if]
|
||||
#enddef
|
||||
|
||||
#define TO_TWO_PATHS
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY3_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY2_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY4_STAGE1}
|
||||
#enddef
|
||||
|
||||
#define TO_UNDEAD_CROSSING
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY3_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY2_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_STAGE1}
|
||||
#enddef
|
||||
|
||||
#define TO_THE_CROSSING
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY3_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_STAGE1}
|
||||
[/part]
|
||||
{JOURNEY2_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_STAGE1}
|
||||
#enddef
|
||||
|
||||
#define TO_TRAINING_THE_OGRES
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_STAGE2}
|
||||
[/part]
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_STAGE2}
|
||||
[/part]
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY3_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_STAGE2}
|
||||
[/part]
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_STAGE2}
|
||||
[/part]
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY2_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY4_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
{JOURNEY5_STAGE2}
|
||||
[/then]
|
||||
[else]
|
||||
{JOURNEY6_STAGE2}
|
||||
[/else]
|
||||
[/if]
|
||||
#enddef
|
||||
|
||||
#define FROM_TRAINING_THE_OGRES AFTER
|
||||
background="eastern-invasion-map.png"
|
||||
background="eastern-invasion-map.png"
|
||||
{JOURNEY1_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=first_fork
|
||||
equals=east
|
||||
[/variable]
|
||||
[then]
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_COMPLETE}
|
||||
{AFTER}
|
||||
[/part]
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY3_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_COMPLETE}
|
||||
{AFTER}
|
||||
[/part]
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY3_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY5_COMPLETE}
|
||||
{AFTER}
|
||||
[/part]
|
||||
[/then]
|
||||
[else]
|
||||
[part]
|
||||
background="eastern-invasion-map.png"
|
||||
show_title=yes
|
||||
{JOURNEY1_COMPLETE}
|
||||
{JOURNEY2_COMPLETE}
|
||||
{JOURNEY4_COMPLETE}
|
||||
{JOURNEY6_COMPLETE}
|
||||
{AFTER}
|
||||
[/part]
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY2_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{JOURNEY4_COMPLETE}
|
||||
[if]
|
||||
[variable]
|
||||
name=second_fork
|
||||
equals=west
|
||||
[/variable]
|
||||
[then]
|
||||
{JOURNEY5_COMPLETE}
|
||||
[/then]
|
||||
[else]
|
||||
{JOURNEY6_COMPLETE}
|
||||
[/else]
|
||||
[/if]
|
||||
{AFTER}
|
||||
#enddef
|
||||
|
||||
#define TO_XENOPHOBIA
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -466,7 +466,7 @@ def validate_stack(stack, filename, lineno):
|
|||
(tag, attributes) = tagstack[-1]
|
||||
ancestors = map(lambda x: x[0], tagstack)
|
||||
# Most tags are not allowed with [part]
|
||||
if "part" in ancestors and tag not in ("part", "image", "insert_tag", "if", "then", "else", "deprecated_message"):
|
||||
if "part" in ancestors and tag not in ("part", "image", "insert_tag", "if", "then", "else", "switch", "case", "variable", "deprecated_message"):
|
||||
print '"%s", line %d: [%s] within [part] tag' % (filename, lineno+1, tag)
|
||||
|
||||
#if tag == "sound" and "attack" in ancestors:
|
||||
|
|
Loading…
Add table
Reference in a new issue