mail[Wesnoth-commits] r33750 - in /trunk/data/campaigns/Northern_Rebirth: scenarios/ utils/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on March 17, 2009 - 15:35:
Author: esr
Date: Tue Mar 17 15:35:07 2009
New Revision: 33750

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33750&view=rev
Log:
Encapsulate Supporter computation for NR.

Modified:
    trunk/data/campaigns/Northern_Rebirth/scenarios/01_Breaking_the_Chains.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/03_To_The_Mines.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/04_Clearing_the_Mines.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/08a_Elvish_Princess.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/09a_Introductions.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/10a_Stolen_Gold.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/11a_Eastern_Flank.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/13a_Showdown.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/14a_Epilogue.cfg
    trunk/data/campaigns/Northern_Rebirth/utils/utils.cfg

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/01_Breaking_the_Chains.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/01_Breaking_the_Chains.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- 
trunk/data/campaigns/Northern_Rebirth/scenarios/01_Breaking_the_Chains.cfg 
(original)
+++ 
trunk/data/campaigns/Northern_Rebirth/scenarios/01_Breaking_the_Chains.cfg 
Tue Mar 17 15:35:07 2009
@@ -188,18 +188,9 @@
                 {TRAIT_LOYAL}
                 {TRAIT_RESILIENT}
             [/modifications]
-            [variables]
-                role=Supporter
-            [/variables]
+            {MAKE_SUPPORTER}
         [/unit]
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
+        {MAKE_SUPPORTER}
         [message]
             speaker=Tallin
             message= _ "The orcs have gotten careless - look how easily I 
stole these weapons and this bright gold from them. Now they're killing each 
other. This might be the only chance we got to get rid of this scum once and 
for all. Let's give it to 'em!"

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg Tue 
Mar 17 15:35:07 2009
@@ -195,19 +195,7 @@
             [/objective]
         [/objectives]
 
-        # SUPPORTER is a special macro defined in campaign /utils it chooses 
an unit from peasant advancement tree and sets
-        # him an supporter role.
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
     [/event]
 
     # Start event - execute the flavour bat encounter.

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/03_To_The_Mines.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/03_To_The_Mines.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/03_To_The_Mines.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/03_To_The_Mines.cfg Tue 
Mar 17 15:35:07 2009
@@ -156,17 +156,7 @@
             [/objective]
         [/objectives]
 
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [recall]
             id=Camerin
         [/recall]

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/04_Clearing_the_Mines.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/04_Clearing_the_Mines.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/04_Clearing_the_Mines.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/04_Clearing_the_Mines.cfg 
Tue Mar 17 15:35:07 2009
@@ -95,17 +95,7 @@
     #                  player units.
     [event]
         name=prestart
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [role]
             type=Dwarvish Fighter
             role=dwarven_guard

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg Tue 
Mar 17 15:35:07 2009
@@ -276,14 +276,6 @@
     [event]
         name=start
 
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
         # Malifor escapes into shroud
         [hide_unit]
             x=20
@@ -309,9 +301,7 @@
         [/unhide_unit]
         # Recall some units
 
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [role]
             race=dwarf
             role=follower
@@ -322,7 +312,8 @@
         [recall]
             id=Camerin
         [/recall]
-        # Set up an army of guarding Draugs, first two have an role for 
'sighted' events
+        # Set up an army of guarding Draugs, first two have a role
+        # for 'sighted' events
         {NOTRAIT_UNIT 6 Draug 10 23}
         [+unit]
             role=Treasury Guard

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg 
Tue Mar 17 15:35:07 2009
@@ -274,16 +274,8 @@
             gold=100
         [/modify_side]
 
-        # This hack is a workaround for unit roles not getting carried over 
to next scenario
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
         # Recall heroes
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]
@@ -301,9 +293,6 @@
         [/recall]
         [recall]
             id=Elenia
-        [/recall]
-        [recall]
-            role=Supporter
         [/recall]
         # Place sidekick
         [unit]

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/08a_Elvish_Princess.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/08a_Elvish_Princess.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/08a_Elvish_Princess.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/08a_Elvish_Princess.cfg 
Tue Mar 17 15:35:07 2009
@@ -218,18 +218,7 @@
             x=0-30
             y=0-21
         [/remove_shroud]
-        # This hack is a workaround for unit roles not getting carried over 
to next scenario
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/09a_Introductions.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/09a_Introductions.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/09a_Introductions.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/09a_Introductions.cfg Tue 
Mar 17 15:35:07 2009
@@ -62,17 +62,8 @@
         {GENERIC_UNIT 2 "Troll Rocklobber" 13 4}
         {GENERIC_UNIT 2 "Troll Rocklobber" 9 4}
         {GENERIC_UNIT 2 "Troll Rocklobber" 9 4}
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/10a_Stolen_Gold.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/10a_Stolen_Gold.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/10a_Stolen_Gold.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/10a_Stolen_Gold.cfg Tue 
Mar 17 15:35:07 2009
@@ -481,17 +481,8 @@
         [/if]
 
         {PLACE_IMAGE scenery/dwarven-doors-closed.png 18 12}
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]

Modified: 
trunk/data/campaigns/Northern_Rebirth/scenarios/11a_Eastern_Flank.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/11a_Eastern_Flank.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/11a_Eastern_Flank.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/11a_Eastern_Flank.cfg Tue 
Mar 17 15:35:07 2009
@@ -155,18 +155,7 @@
     [event]
         name=start
 
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/13a_Showdown.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/13a_Showdown.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/13a_Showdown.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/13a_Showdown.cfg Tue Mar 
17 15:35:07 2009
@@ -760,17 +760,7 @@
             image=wesnoth-icon.png
         [/message]
         # Recall heroes
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [recall]
             id=Camerin
         [/recall]

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/14a_Epilogue.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/14a_Epilogue.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/14a_Epilogue.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/14a_Epilogue.cfg Tue Mar 
17 15:35:07 2009
@@ -32,17 +32,7 @@
 
         {SCATTER_IMAGE (terrain=Gg,Gs^Fp) 12 scenery/oak-leaning.png}
         # Recall heroes and there they go.
-        [role]
-            [filter_wml]
-                [variables]
-                    role=Supporter
-                [/variables]
-            [/filter_wml]
-            role=Supporter
-        [/role]
-        [recall]
-            role=Supporter
-        [/recall]
+        {RECALL_SUPPORTER}
         [recall]
             id=Abhai
         [/recall]

Modified: trunk/data/campaigns/Northern_Rebirth/utils/utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/utils/utils.cfg?rev=33750&r1=33749&r2=33750&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/utils/utils.cfg (original)
+++ trunk/data/campaigns/Northern_Rebirth/utils/utils.cfg Tue Mar 17 15:35:07 
2009
@@ -1,4 +1,43 @@
 #textdomain wesnoth-nr
+
+#define MAKE_SUPPORTER
+    # Tag a unit as preferred for the Supporter role
+    [variables]
+        role=Supporter
+    [/variables]
+#enddef
+
+#define RECALL_SUPPORTER
+    # Recall a walk-on to say lines.  Prefer whoever was tagged with the 
+    # variable role=Supporter previously; if that unit is dead, pick
+    # anyone from side 1.
+    [role]
+        [filter_wml]
+            [variables]
+                role=Supporter
+            [/variables]
+        [/filter_wml]
+        role=Supporter
+    [/role]
+    [if]
+        [not]
+            [have_unit]
+                role=Supporter
+            [/have_unit]
+        [/not]
+        [role]
+            side=1
+            [not]
+                id=Tallin
+            [/not]
+            role=Supporter
+        [/role]
+    [/if]
+    [recall]
+        role=Supporter
+    [/recall]
+#enddef
+
 ## These macros support a fourth difficulty level, NIGHTMARE.
 
 #macro to define a 'quantity' differently based on difficulty levels




Related Messages


Powered by MHonArc, Updated Tue Mar 17 16:20:20 2009