From 6b1b1fe92845498030c086749c9967ba9ae036ac Mon Sep 17 00:00:00 2001 From: nemaara Date: Tue, 5 Feb 2019 02:41:25 -0500 Subject: [PATCH] DiD S12: added code for flanking hero --- .../scenarios/12_Endless_Night.cfg | 568 ++++++++++++++++-- 1 file changed, 510 insertions(+), 58 deletions(-) diff --git a/data/campaigns/Descent_Into_Darkness/scenarios/12_Endless_Night.cfg b/data/campaigns/Descent_Into_Darkness/scenarios/12_Endless_Night.cfg index abda3fe013fd..4b87adddb083 100644 --- a/data/campaigns/Descent_Into_Darkness/scenarios/12_Endless_Night.cfg +++ b/data/campaigns/Descent_Into_Darkness/scenarios/12_Endless_Night.cfg @@ -10,8 +10,8 @@ {UNDERGROUND} [time_area] - x=27-31 - y=0-5 + x=27-31,26,21-25 + y=0-5,2-4,0-2 {DEFAULT_SCHEDULE} [/time_area] @@ -145,13 +145,25 @@ # Set ai values later [/side] + # Too Foolish Hero + [side] + side=3 + controller=ai + # Place leader, grant gold, income and recruits later + no_leader=yes + hidden=yes + gold=0 + {NO_INCOME} + # Set ai values later + [/side] + {STARTING_VILLAGES 1 15} - {STARTING_VILLAGES 2 5} [event] name=prestart {VARIABLE_OP timesForever add 1} + {VARIABLE second_hero_arrived 0} [objectives] side=1 @@ -177,6 +189,17 @@ description= _ "Defeat yet another foolish hero" [show_if] {VARIABLE_CONDITIONAL timesForever greater_than_equal_to 3} + [and] + {VARIABLE_CONDITIONAL second_hero_arrived numerical_equals 0} + [/and] + [/show_if] + [/objective] + + [objective] + condition=win + description= _ "Defeat both foolish heroes" + [show_if] + {VARIABLE_CONDITIONAL second_hero_arrived numerical_equals 1} [/show_if] [/objective] @@ -296,6 +319,386 @@ [/do] [/while] + [if] + {VARIABLE_CONDITIONAL timesForever greater_than 4} + + [then] + [replace_map] + map="{campaigns/Descent_Into_Darkness/maps/12a_Endless_Night.map}" + expand=yes + shrink=yes + [/replace_map] + + # don't let the two foolish heroes be from the same faction + {VARIABLE_OP randomHero2 rand (human,bandit,elf,dwarf,orc)} + + [while] + {VARIABLE_CONDITIONAL randomHero2 equals $randomHero} + + [do] + {VARIABLE_OP randomHero2 rand (human,bandit,elf,dwarf,orc)} + [/do] + [/while] + + {VARIABLE_OP flankturn rand 5..10} + + [event] + name=new turn + [filter_condition] + [variable] + name=turn_number + numerical_equals=$flankturn + [/variable] + [/filter_condition] + + # the text here is duplicated from below + [switch] + variable=randomHero2 + [case] + value=human + [scroll_to] + x,y=2,50 + [/scroll_to] + + [move_unit_fake] + type="Royal Guard" + side=3 + x= 2, 6, 8 + y=50,49,46 + [/move_unit_fake] + + [unit] + side=3 + type=Royal Guard + id=Too Foolish Hero + name= _ "Too Foolish Hero" + x,y=8,46 + canrecruit=yes + animate=no + facing=ne + [/unit] + + [terrain] + x,y=8,46 + terrain=Ke + [/terrain] + [terrain] + x= 7,8-9,10 + y=46-47,47,45-47 + terrain=Ce + [/terrain] + [terrain] + x= 9, 5,12, 5 + y=49,45,46,48 + terrain=Uu^Vct + [/terrain] + [redraw][/redraw] + + [capture_village] + side=3 + x= 9, 5,12, 5 + y=49,45,46,48 + [/capture_village] + + [message] + speaker=Too Foolish Hero + message= _ "Your doom is at hand, lich! It is nigh time you answered for your crimes against humanity!" + [/message] + + [modify_side] + side=3 + user_team_name= _ "Humans" + {FLAG_VARIANT loyalist} + recruit=Spearman,Swordsman,Pikeman,Bowman,Longbowman,Heavy Infantryman,Shock Trooper,Mage,Red Mage,White Mage,Horseman,Knight,Lancer + [/modify_side] + + {INCIDENTAL_MUSIC loyalists.ogg} + [/case] + + [case] + value=bandit + [scroll_to] + x,y=2,50 + [/scroll_to] + + [move_unit_fake] + type=Highwayman + side=3 + x= 2, 6, 8 + y=50,49,46 + [/move_unit_fake] + + [unit] + side=3 + type=Highwayman + id=Too Foolish Hero + name= _ "Too Foolish Hero" + x,y=8,46 + canrecruit=yes + animate=no + facing=ne + [/unit] + + [terrain] + x,y=8,46 + terrain=Ke + [/terrain] + [terrain] + x= 7,8-9,10 + y=46-47,47,45-47 + terrain=Ce + [/terrain] + [terrain] + x= 9, 5,12, 5 + y=49,45,46,48 + terrain=Uu^Vct + [/terrain] + [redraw][/redraw] + + [capture_village] + side=3 + x= 9, 5,12, 5 + y=49,45,46,48 + [/capture_village] + + [message] + speaker=Too Foolish Hero + # po: the text that the "Too Foolish Hero" speaks is identical to that in the start event and can probably be copied over + message= _ "You have preyed on too many of my men. Our territory will be much more secure without your undead pestering us." + [/message] + + [modify_side] + side=3 + user_team_name= _ "Bandits" + # default flag + recruit=Thug,Bandit,Footpad,Outlaw,Poacher,Trapper,Thief,Rogue + [/modify_side] + + {INCIDENTAL_MUSIC knolls.ogg} + [/case] + + [case] + value=elf + [scroll_to] + x,y=2,50 + [/scroll_to] + + [move_unit_fake] + type="Elvish Marshal" + side=3 + x= 2, 6, 8 + y=50,49,46 + [/move_unit_fake] + + [unit] + side=3 + type=Elvish Marshal + id=Too Foolish Hero + name= _ "Too Foolish Hero" + x,y=8,46 + canrecruit=yes + animate=no + facing=ne + [/unit] + + [terrain] + x,y=8,46 + terrain=Ke + [/terrain] + [terrain] + x= 7,8-9,10 + y=46-47,47,45-47 + terrain=Ce + [/terrain] + [terrain] + x= 9, 5,12, 5 + y=49,45,46,48 + terrain=Uu^Vct + [/terrain] + [redraw][/redraw] + + [capture_village] + side=3 + x= 9, 5,12, 5 + y=49,45,46,48 + [/capture_village] + + [message] + speaker=Too Foolish Hero + message= _ "We have finally found you, lich! Long have we heard of your abominable deeds, ensnaring the living with your dark sorceries and molding them into your slaves. Your wretched unlife ends here!" + [/message] + + [modify_side] + side=3 + user_team_name= _ "Elves" + {FLAG_VARIANT wood-elvish} + recruit=Elvish Fighter,Elvish Hero,Elvish Captain,Elvish Archer,Elvish Ranger,Elvish Marksman,Elvish Shaman,Elvish Sorceress,Elvish Druid,Elvish Scout,Elvish Rider,Wose + [/modify_side] + + {INCIDENTAL_MUSIC elvish-theme.ogg} + [/case] + + [case] + value=dwarf + [scroll_to] + x,y=2,50 + [/scroll_to] + + [move_unit_fake] + type="Dwarvish Lord" + side=3 + x= 2, 6, 8 + y=50,49,46 + [/move_unit_fake] + + [unit] + side=3 + type=Dwarvish Lord + id=Too Foolish Hero + name= _ "Too Foolish Hero" + x,y=8,46 + canrecruit=yes + animate=no + facing=ne + [/unit] + + [terrain] + x,y=8,46 + terrain=Ke + [/terrain] + [terrain] + x= 7,8-9,10 + y=46-47,47,45-47 + terrain=Ce + [/terrain] + [terrain] + x= 9, 5,12, 5 + y=49,45,46,48 + terrain=Uu^Vct + [/terrain] + [redraw][/redraw] + + [capture_village] + side=3 + x= 9, 5,12, 5 + y=49,45,46,48 + [/capture_village] + + [message] + speaker=Too Foolish Hero + # po: written with a dwarvish accent - regular english would be "it's been along time since I've smashed some undead. You've got plenty of bones for my hammer to break" + message= _ "Been a long time since I’ve smashed me some undead. Ye gots ye plenty o’ bones for me hammer ta break." + [/message] + + [modify_side] + side=3 + user_team_name= _ "Dwarves" + {FLAG_VARIANT knalgan} + recruit=Dwarvish Fighter,Dwarvish Steelclad,Dwarvish Thunderer,Dwarvish Thunderguard,Dwarvish Stalwart,Dwarvish Guardsman,Dwarvish Ulfserker,Dwarvish Berserker,Dwarvish Scout,Dwarvish Pathfinder,Gryphon Rider,Gryphon Master + [/modify_side] + + {INCIDENTAL_MUSIC knalgan_theme.ogg} + [/case] + + [case] + value=orc + [scroll_to] + x,y=2,50 + [/scroll_to] + + [move_unit_fake] + type="Orcish Warlord" + side=3 + x= 2, 6, 8 + y=50,49,46 + [/move_unit_fake] + + [unit] + side=3 + type=Orcish Warlord + id=Too Foolish Hero + name= _ "Too Foolish Hero" + x,y=8,46 + canrecruit=yes + animate=no + facing=ne + [/unit] + + [terrain] + x,y=8,46 + terrain=Ke + [/terrain] + [terrain] + x= 7,8-9,10 + y=46-47,47,45-47 + terrain=Ce + [/terrain] + [terrain] + x= 9, 5,12, 5 + y=49,45,46,48 + terrain=Uu^Vct + [/terrain] + [redraw][/redraw] + + [capture_village] + side=3 + x= 9, 5,12, 5 + y=49,45,46,48 + [/capture_village] + + [modify_side] + side=3 + user_team_name= _ "Orcs" + {FLAG_VARIANT6 ragged} + recruit=Orcish Warrior,Orcish Slayer,Orcish Crossbowman,Troll,Troll Rocklobber + [/modify_side] + + [message] + speaker=Too Foolish Hero + message= _ "I’ve finally found your lair, lich! You have attacked my tribe and wreaked havoc on our homes for many years. You slew my father and turned his body into one of your nasty creations. With your death, your annoying minions will pester us no longer!" + [/message] + + {INCIDENTAL_MUSIC northerners.ogg} + [/case] + [/switch] + + [message] + speaker=Mal Keshar + message= _ "I almost feel as if the universe is mocking me by sending me this many imbeciles..." + [/message] + + [modify_side] + side=3 + hidden=no + team_name=enemies +#ifdef EASY + gold="$(180 + 80 * $timesForever)" + income="$(5 + 3 * $timesForever)" +#endif +#ifdef NORMAL + gold="$(200 + 100 * $timesForever)" + income="$(6 + 4 * $timesForever)" +#endif +#ifdef HARD + gold="$(220 + 120 * $timesForever)" + income="$(7 + 5 * $timesForever)" +#endif + [ai] + aggression="$(min( [1.0, (0.3 + 0.1 * $timesForever) ] ) )" + villages_per_scout=10 + village_value=0.5 + [/ai] + [/modify_side] + + {VARIABLE second_hero_arrived 1} + + [show_objectives] + side=1 + [/show_objectives] + [/event] + [/then] + [/if] + [switch] variable=randomHero [case] @@ -312,7 +715,6 @@ [modify_side] side=2 - team_name=humans user_team_name= _ "Humans" {FLAG_VARIANT loyalist} recruit=Spearman,Swordsman,Pikeman,Bowman,Longbowman,Heavy Infantryman,Shock Trooper,Mage,Red Mage,White Mage,Horseman,Knight,Lancer @@ -325,18 +727,16 @@ value=bandit [unit] side=2 - type=Assassin + type=Highwayman id=Foolish Hero name= _ "Foolish Hero" x,y=22,4 canrecruit=yes - gender=male facing=sw [/unit] [modify_side] side=2 - team_name=bandits user_team_name= _ "Bandits" # default flag recruit=Thug,Bandit,Footpad,Outlaw,Poacher,Trapper,Thief,Rogue @@ -359,7 +759,6 @@ [modify_side] side=2 - team_name=elves user_team_name= _ "Elves" {FLAG_VARIANT wood-elvish} recruit=Elvish Fighter,Elvish Hero,Elvish Captain,Elvish Archer,Elvish Ranger,Elvish Marksman,Elvish Shaman,Elvish Sorceress,Elvish Druid,Elvish Scout,Elvish Rider,Wose @@ -382,7 +781,6 @@ [modify_side] side=2 - team_name=dwarves user_team_name= _ "Dwarves" {FLAG_VARIANT knalgan} recruit=Dwarvish Fighter,Dwarvish Steelclad,Dwarvish Thunderer,Dwarvish Thunderguard,Dwarvish Stalwart,Dwarvish Guardsman,Dwarvish Ulfserker,Dwarvish Berserker,Dwarvish Scout,Dwarvish Pathfinder,Gryphon Rider,Gryphon Master @@ -405,7 +803,6 @@ [modify_side] side=2 - team_name=Orcs user_team_name= _ "Orcs" {FLAG_VARIANT6 ragged} recruit=Orcish Warrior,Orcish Slayer,Orcish Crossbowman,Troll,Troll Rocklobber @@ -415,21 +812,28 @@ [/case] [/switch] + [capture_village] + side=2 + x=21,19,25,24 + y= 2, 5, 4, 6 + [/capture_village] + # Give the foolish hero gold & income based on timesForever # Set ai aggression, it hits 1.0 at 7 timesForever, ensuring the enemy will attack. [modify_side] side=2 + team_name=enemies #ifdef EASY - gold="$(180 * $timesForever)" - income="$(5 * $timesForever)" + gold="$(180 + 80 * $timesForever)" + income="$(5 + 3 * $timesForever)" #endif #ifdef NORMAL - gold="$(200 * $timesForever)" - income="$(6 * $timesForever)" + gold="$(200 + 100 * $timesForever)" + income="$(6 + 4 * $timesForever)" #endif #ifdef HARD - gold="$(220 * $timesForever)" - income="$(7 * $timesForever)" + gold="$(220 + 120 * $timesForever)" + income="$(7 + 5 * $timesForever)" #endif [ai] aggression="$(min( [1.0, (0.3 + 0.1 * $timesForever) ] ) )" @@ -540,7 +944,7 @@ {CLEAR_VARIABLE random} [/else] [/switch] - + [switch] variable=randomHero [case] @@ -615,10 +1019,11 @@ [if] {VARIABLE_CONDITIONAL timesForever numerical_equals 1} [then] - [part] + [message] + speaker=narrator + image=misc/makeshift-altar.png 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] + [/message] [/then] [/if] @@ -642,7 +1047,7 @@ first_time_only=yes [filter] x,y=18,20 - side=2 + side=2,3 [/filter] [remove_item] @@ -650,8 +1055,28 @@ image="items/book5.png" [/remove_item] + [if] + [have_unit] + x,y=$x1,$y1 + side=2 + [/have_unit] + [then] + [role] + id=Foolish Hero + role=speakinghero + [/role] + {VARIABLE hero_type $randomHero} + [/then] + [else] + [role] + id=Too Foolish Hero + role=speakinghero + [/role] + {VARIABLE hero_type $randomHero2} + [/else] + [/if] [switch] - variable=randomHero + variable=hero_type [case] value=human [message] @@ -660,7 +1085,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "It might be linked to the lich’s power! Try burning it." [/message] @@ -675,7 +1100,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Still, it seems to be hurting the lich. Let us retreat and bring it with us. The mages may be able to destroy this and put an end to this lich." [/message] [/case] @@ -688,7 +1113,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "It might be linked to the lich’s power! Try burning it." [/message] @@ -703,7 +1128,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Still, it seems to be hurting the lich. Let us retreat and bring it with us. We may yet find another way to destroy it and put an end to this lich." [/message] [/case] @@ -716,7 +1141,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero # po: "faerie fire" as in the elvish sylph's attack message= _ "It must be connected to the lich’s power somehow. Perhaps if we burn it with faerie fire, the lich will be destroyed. Let us take it and retreat." [/message] @@ -731,7 +1156,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero # po: regular english: Try destroying the darned thing. message= _ "Try destroyin’ the blasted thing." [/message] @@ -748,7 +1173,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero # po: regular english: Yes, but the lich still seems to be hurt. Let's take it and retreat. Maybe the forge can destroy it. message= _ "Aye, but the lich still seems ta be hurtin’. Let’s take it ’n retreat. Maybe tha forge ken destroy it." [/message] @@ -763,7 +1188,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Idiot." [/message] @@ -784,7 +1209,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "The book must be connected to the lich’s power! Take it and retreat. Once we smash that book, the lich should be destroyed." [/message] [/case] @@ -801,11 +1226,11 @@ {STORYTXT_BACKGROUND end.jpg} [/part] [part] - story= _ "Years pass. Every summer, by the time the mountainous paths and high passes shed their wintry gowns of snow, humans, elves and dwarves patrol to repel orcish raiders. Undead no longer trouble the watches and memories of the lich fade to mere legend." + story= _ "Years pass. Every summer, by the time the mountainous paths and high passes shed their wintry gowns of snow, humans, elves and dwarves patrol to resist orcish raiders. Undead no longer trouble the watches and memories of the lich fade to mere legend." {STORYTXT_BACKGROUND end.jpg} [/part] [part] - story= _ "Rumors circulate about a spirit of good fortune that protects these guards. When attacked by orcs at night, it is said that the darkness itself will descend to repel the assailants. True or not, it always seems that the resulting carnage of each battle contains far fewer bodies than there should be." + story= _ "Rumors circulate about a spirit of good fortune that protects these guards. It is said that that when attacked by orcs at night, the darkness itself descends to repel the assailants." {STORYTXT_BACKGROUND end.jpg} [/part] [/story] @@ -833,22 +1258,49 @@ # after a few repetitions, we'll let the campaign really end # when Malin dies [then] - [role] - side=2 - [not] - canrecruit=yes - [/not] - role=second - [/role] + [if] + [have_unit] + x,y=$x2,$y2 + side=2 + [/have_unit] + [then] + [role] + id=Foolish Hero + role=speakinghero + [/role] + [role] + side=2 + [not] + canrecruit=yes + [/not] + role=second + [/role] + {VARIABLE hero_type $randomHero} + [/then] + [else] + [role] + id=Too Foolish Hero + role=speakinghero + [/role] + [role] + side=3 + [not] + canrecruit=yes + [/not] + role=second + [/role] + {VARIABLE hero_type $randomHero2} + [/else] + [/if] [music] - name=elvish-theme.ogg + name=journeys_end.ogg immediate=yes append=no [/music] [switch] - variable=randomHero + variable=hero_type [case] value=human [message] @@ -862,7 +1314,7 @@ [/kill] [message] - speaker=Foolish Hero + role=speakinghero message= _ "His evil deeds have come to an end." [/message] @@ -872,7 +1324,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "No more than a power-hungry mage who selfishly sought to abuse the others around him for his own gain. Necromancers are all the same. Their kind is only ever a pure evil." [/message] @@ -882,7 +1334,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "It matters not. Let us return home; the town will need us to help defend against the orc raids." [/message] @@ -905,7 +1357,7 @@ [/kill] [message] - speaker=Foolish Hero + role=speakinghero message= _ "It is done. He will trouble us no more." [/message] @@ -915,7 +1367,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Likely one of those arrogant mages who think themselves superior to everyone else. He probably learned necromancy just to subjugate people like us." [/message] @@ -925,7 +1377,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Yes, to be oppressed by a tyrant is a terrible thing, whether it be a lich or a king. This is why we go our own path, as outlaws. Although, I suppose this lich must have been a pariah as well." [/message] @@ -935,7 +1387,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Yes, definitely. Anyway, there is no use in dwelling upon one so wicked. Let us go." [/message] [/case] @@ -953,7 +1405,7 @@ [/kill] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Well, that is the end of his evil ways." [/message] @@ -963,7 +1415,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "A selfish human, only greedy for power while utterly indifferent to anything but himself. A necromancer’s only purpose is to work for their own gain, nothing else." [/message] @@ -973,7 +1425,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Indeed. We need not afford this one any compassion. Let us leave this miserable place." [/message] [/case] @@ -991,7 +1443,7 @@ [/kill] [message] - speaker=Foolish Hero + role=speakinghero # po: regular english - the lich is nothing but a pile of bones now message= _ "Tha lich be nae but a pile o’ bones now." [/message] @@ -1003,7 +1455,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero # po: regular english - I guess he was some crazy mage who wanted to make other humans his slaves. Why else do you think he would turn to dark magic? message= _ "Me guess be that he be some loonie mage who wanted ta make other humans inta ’is slaves. Why else d’ye think tha lad woul’ turn ta dark magic?" [/message] @@ -1015,7 +1467,7 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero # po: regular english - Yes. Let's get to work. message= _ "Aye. Let’s git to workin’." [/message] @@ -1034,7 +1486,7 @@ [/kill] [message] - speaker=Foolish Hero + role=speakinghero message= _ "The lich is dead! I have finally avenged my father." [/message] @@ -1044,12 +1496,12 @@ [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Just some puny human. Amusing that he was more bothersome in death than in life. Annoying that it took so long to kill him." [/message] [message] - speaker=Foolish Hero + role=speakinghero message= _ "Anyway, round up the wolves. I’m going home." [/message] [/case]