From b1b85fa71040c5a93f184af44412171c4e4bc181 Mon Sep 17 00:00:00 2001 From: nemaara Date: Mon, 14 Jan 2019 18:37:22 -0500 Subject: [PATCH] DiD S8: rebalancing and code style changes --- .../scenarios/08_A_Small_Favor2.cfg | 511 +++++++++--------- 1 file changed, 255 insertions(+), 256 deletions(-) diff --git a/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg b/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg index b3dd8ec45050..67cd372ead75 100644 --- a/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg +++ b/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg @@ -328,48 +328,19 @@ {GENERIC_UNIT 2 "$magetypetable[$($loc.n % $magetypetable.length)].type" $loc.x $loc.y} [/command] [/random_placement] -#ifdef EASY + [set_variable] name=S7_turns - value=$(min(7,($S7_turns))) + value=$(min({ON_DIFFICULTY 7 6 5},($S7_turns))) [/set_variable] [set_variable] name=spawn1 - value=$("7 + ($S7_turns)") + value=$("{ON_DIFFICULTY 7 6 5} + ($S7_turns)") [/set_variable] [set_variable] name=spawn2 - value=$("14 + ($S7_turns)") - [/set_variable] -#endif -#ifdef NORMAL - [set_variable] - name=S7_turns - value=$(min(6,($S7_turns))) - [/set_variable] - [set_variable] - name=spawn1 - value=$("6 + ($S7_turns)") + value=$("{ON_DIFFICULTY 14 12 10} + ($S7_turns)") [/set_variable] - [set_variable] - name=spawn2 - value=$("12 + ($S7_turns)") - [/set_variable] -#endif -#ifdef HARD - [set_variable] - name=S7_turns - value=$(min(5,($S7_turns))) - [/set_variable] - [set_variable] - name=spawn1 - value=$("5 + ($S7_turns)") - [/set_variable] - [set_variable] - name=spawn2 - value=$("10 + ($S7_turns)") - [/set_variable] -#endif [recall] id=Darken Volk @@ -453,244 +424,195 @@ [/event] # City guard spawns +#define SPAWN_GUARD + [random_placement] + num_items=1 + variable=loc + min_distance=1 + [filter_location] + x=22,23,21-26 + y=18,18,19-20 + [not] + [filter][/filter] + [/not] + [/filter_location] + [command] + [set_variable] + name=ind + rand=1..$guardtypetable.length + [/set_variable] + {VARIABLE_OP ind sub 1} + {GENERIC_UNIT 3 "$guardtypetable[$ind].type" $loc.x $loc.y} + {CLEAR_VARIABLE ind} + [/command] + [/random_placement] +#enddef +#define SPAWN_MAGE + [random_placement] + num_items=1 + variable=loc + min_distance=1 + [filter_location] + x=22,23,21-26 + y=18,18,19-20 + [not] + [filter][/filter] + [/not] + [/filter_location] + [command] + [set_variable] + name=ind + rand=1..$magetypetable.length + [/set_variable] + {VARIABLE_OP ind sub 1} + {GENERIC_UNIT 3 "$magetypetable[$ind].type" $loc.x $loc.y} + {CLEAR_VARIABLE ind} + [/command] + [/random_placement] +#enddef [event] name=new turn - first_time_only=yes - [filter_condition] + first_time_only=no + + [if] [variable] name=turn_number - numerical_equals=$S7_turns + greater_than_equal_to=$spawn2 [/variable] - [/filter_condition] - - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$guardtypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$guardtypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] + [then] + {RANDOM 0..2} + [switch] + variable=random + [case] + value=0 + {SPAWN_GUARD} +#ifdef HARD + {SPAWN_GUARD} +#endif + [/case] + [case] + value=1 + {SPAWN_MAGE} + [/case] + [case] + value=2 + {SPAWN_GUARD} + {SPAWN_MAGE} + [/case] + [/switch] + [/then] + [elseif] + [variable] + name=turn_number + greater_than_equal_to=$spawn1 + [/variable] + [then] + [set_variable] + name=turn_mod + value=$("($turn_number - $spawn1) % 2") + [/set_variable] + [if] + [variable] + name=turn_mod + numerical_equals=0 + [/variable] + [then] + {RANDOM 0..3} + [switch] + variable=random + [case] + value=0 + {SPAWN_GUARD} +#ifdef HARD + {SPAWN_GUARD} +#endif + [/case] + [case] + value=1 + {SPAWN_GUARD} + [/case] + [case] + value=2 + {SPAWN_MAGE} + [/case] + [case] + value=3 + {SPAWN_GUARD} + {SPAWN_MAGE} + [/case] + [/switch] + [/then] + [/if] + {CLEAR_VARIABLE turn_mod} + [/then] + [/elseif] + [elseif] + [variable] + name=turn_number + greater_than_equal_to=$S7_turns + [/variable] + [then] + [set_variable] + name=turn_mod + value=$("($turn_number - $S7_turns) % 3") + [/set_variable] + [if] + [variable] + name=turn_mod + numerical_equals=0 + [/variable] + [then] + {RANDOM 0..3} + [switch] + variable=random + [case] + value=0 + {SPAWN_GUARD} + [/case] + [case] + value=1 + {SPAWN_GUARD} + [/case] + [case] + value=2 + {SPAWN_MAGE} + [/case] + [case] + value=3 +#ifndef EASY + {SPAWN_GUARD} +#endif + {SPAWN_MAGE} + [/case] + [/switch] + [/then] + [/if] + {CLEAR_VARIABLE turn_mod} + [/then] + [/elseif] + [/if] [fire_event] name=city guard dialogue + [/fire_event] + [fire_event] + name=city guard dialogue2 + [/fire_event] + [fire_event] + name=city guard dialogue3 [/fire_event] [/event] [event] - name=new turn - first_time_only=no - [filter_condition] - [variable] - name=turn_number - greater_than=$S7_turns - [/variable] - [/filter_condition] - - {RANDOM 0..3} - [if] - [variable] - name=random - greater_than=2 - [/variable] - [then] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$guardtypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$guardtypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$magetypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$magetypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [/then] - [/if] - [/event] - - [event] - name=new turn - first_time_only=no - [filter_condition] - [variable] - name=turn_number - greater_than=$spawn1 - [/variable] - [/filter_condition] - - {RANDOM 0..2} - [if] - [variable] - name=random - greater_than=1 - [/variable] - [then] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$guardtypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$guardtypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$magetypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$magetypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [fire_event] - name=city guard dialogue2 - [/fire_event] - [/then] - [/if] - [/event] - [event] - name=new turn - first_time_only=no + name=city guard dialogue [filter_condition] [variable] name=turn_number - greater_than=$spawn2 + equals=$S7_turns [/variable] [/filter_condition] - - {RANDOM 0..11} - [if] - [variable] - name=random - greater_than=6 - [/variable] - [then] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$guardtypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$guardtypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [random_placement] - num_items=1 - variable=loc - min_distance=1 - [filter_location] - x=22,23,21-26 - y=18,18,19-20 - [not] - [filter][/filter] - [/not] - [/filter_location] - [command] - [set_variable] - name=ind - rand=1..$magetypetable.length - [/set_variable] - {VARIABLE_OP ind sub 1} - {GENERIC_UNIT 3 "$magetypetable[$ind].type" $loc.x $loc.y} - {CLEAR_VARIABLE ind} - [/command] - [/random_placement] - [fire_event] - name=city guard dialogue2 - [/fire_event] - [fire_event] - name=city guard dialogue3 - [/fire_event] - [/then] - [/if] - [/event] - - [event] - name=city guard dialogue - + [message] side=3 [filter_location] @@ -706,7 +628,13 @@ [/event] [event] name=city guard dialogue2 - + [filter_condition] + [variable] + name=turn_number + equals=$spawn1 + [/variable] + [/filter_condition] + [message] speaker=Darken Volk message= _ "More guards are coming. We must hasten our search!" @@ -714,6 +642,12 @@ [/event] [event] name=city guard dialogue3 + [filter_condition] + [variable] + name=turn_number + equals=$spawn2 + [/variable] + [/filter_condition] [message] speaker=Malin Keshar @@ -951,8 +885,73 @@ Leaving only bones to remain." {CLEAR_VARIABLE spawn2} [/event] + [event] + name=time over + + [if] + [have_unit] + id=Lord Karres + [/have_unit] + [then] + [unit] + type=Royal Guard + side=3 + x,y=22,18 + id=RGuard + canrecruit=yes + animate=yes + facing=nw + [/unit] + {GENERIC_UNIT 3 (Pikeman) 23 18} {FACING nw} + {GENERIC_UNIT 3 (Longbowman) 22 19} {FACING nw} + {GENERIC_UNIT 3 (Swordsman) 21 19} {FACING nw} + {GENERIC_UNIT 3 (Mage of Light) 23 19} {FACING nw} + + [message] + speaker=RGuard + message= _ "Surround those necromancers! They cannot escape us now!" + [/message] + [message] + speaker=Darken Volk + message= _ "Fool boy! You took too long to defeat Karres! Now we are at the mercy of the city guards!" + [/message] + [/then] + [else] + [remove_shroud] + side=1 + x=0-3,3,4,5 + y=0-3,3-4,1-4,4-5 + [/remove_shroud] + [unit] + type=Royal Guard + side=3 + x,y=2,3 + id=RGuard + canrecruit=yes + animate=yes + facing=se + [/unit] + {GENERIC_UNIT 3 (Pikeman) 2 2} {FACING se} + {GENERIC_UNIT 3 (Longbowman) 3 2} {FACING se} + {GENERIC_UNIT 3 (Swordsman) 1 3} {FACING se} + {GENERIC_UNIT 3 (Mage of Light) 2 1} {FACING se} + + [message] + speaker=RGuard + message= _ "Surround those necromancers! They cannot escape us now!" + [/message] + [message] + speaker=Darken Volk + message= _ "Fool boy! You took too long to find the path to the great hall! Now we are at the mercy of the city guards!" + [/message] + [/else] + [/if] + + [endlevel] + result=defeat + [/endlevel] + [/event] + {HERODEATH_MALIN} {HERODEATH_VOLK_B} - - {TIME_OVER_DEFEAT_MANOR} [/scenario]