mail[Wesnoth-commits] r40359 - in /trunk/data/campaigns/Legend_of_Wesmere: scenarios/ utils/


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

Header


Content

Posted by terraninfo on December 23, 2009 - 22:33:
Author: crab
Date: Wed Dec 23 22:33:58 2009
New Revision: 40359

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40359&view=rev
Log:
extra debug protection - ensure we have only one Landar

Modified:
    trunk/data/campaigns/Legend_of_Wesmere/scenarios/22_Northern_Battle.cfg
    trunk/data/campaigns/Legend_of_Wesmere/scenarios/23_End_of_War.cfg
    trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg

Modified: 
trunk/data/campaigns/Legend_of_Wesmere/scenarios/22_Northern_Battle.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Legend_of_Wesmere/scenarios/22_Northern_Battle.cfg?rev=40359&r1=40358&r2=40359&view=diff
==============================================================================
--- trunk/data/campaigns/Legend_of_Wesmere/scenarios/22_Northern_Battle.cfg 
(original)
+++ trunk/data/campaigns/Legend_of_Wesmere/scenarios/22_Northern_Battle.cfg 
Wed Dec 23 22:33:58 2009
@@ -49,6 +49,7 @@
     [event]
         name=prestart
 
+        # transfer our veterans except Anduilas to side 2
         # wmllint: recognize Anduilas
         [store_unit]
             #TODO spellcheck
@@ -63,6 +64,10 @@
                 # wmllint: recognize Anduilas
                 [not]
                     id=Anduilas
+                [/not]
+                # wmllint: recognize Landar
+                [not]
+                    id=Landar
                 [/not]
                 [not]
                     type={SHAMANS}
@@ -79,6 +84,11 @@
         {NEXT unit}
         {CLEAR_VARIABLE unit}
         {CLEAR_VARIABLE steal_wearer}
+
+        {LOW_STEAL_UNIT_TO "Landar" 3}
+
+        # recall our loyals
+        {RECALL_LOYALS}
     [/event]
 
     # wmllint: recognize Uradredia
@@ -118,7 +128,6 @@
             #wmllint: recognize Landar
             x=15
             y=38
-            canrecruit=yes
         [/unit]
         side=3
         no_leader=yes
@@ -152,7 +161,6 @@
     [event]
         name=prestart
         {MODIFY_UNIT id=Landar canrecruit yes}
-        {REMOVE_HERO_ICON id=Landar}
     [/event]
 
     [side]

Modified: trunk/data/campaigns/Legend_of_Wesmere/scenarios/23_End_of_War.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Legend_of_Wesmere/scenarios/23_End_of_War.cfg?rev=40359&r1=40358&r2=40359&view=diff
==============================================================================
--- trunk/data/campaigns/Legend_of_Wesmere/scenarios/23_End_of_War.cfg 
(original)
+++ trunk/data/campaigns/Legend_of_Wesmere/scenarios/23_End_of_War.cfg Wed 
Dec 23 22:33:58 2009
@@ -40,6 +40,7 @@
     #wmllint: validate-on
     [event]
         name=prestart
+        {LOW_STEAL_UNIT_TO "Landar" 2}
         {RECALL_LOYALS}
     [/event]
 

Modified: trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg?rev=40359&r1=40358&r2=40359&view=diff
==============================================================================
--- trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg (original)
+++ trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg Wed Dec 23 
22:33:58 2009
@@ -393,3 +393,48 @@
     {CLEAR_VARIABLE random_placement_x}
     {CLEAR_VARIABLE random_placement_y}
 #enddef
+
+#define LOW_STEAL_UNIT_TO ID SIDE
+
+        #if we have {ID} not in side {SIDE} transfer him to side {SIDE}
+       # at position determined by existing unit of {SIDE} with id={ID}
+
+        [store_unit]
+            variable=source_var
+            kill=yes
+            [filter]
+                id={ID}
+                [not]
+                    side={SIDE}
+                [/not]
+            [/filter]
+        [/store_unit]
+        [store_unit]
+            variable=target_var
+            kill=no
+            [filter]
+                id={ID}
+                side={SIDE}
+            [/filter]
+        [/store_unit]
+        [if]
+            [variable]
+                name=source_var.length
+                greater_than=0
+            [/variable]
+            [variable]
+                name=target_var.length
+                greater_than=0
+            [/variable]
+            [then]
+                {VARIABLE source_var[0].side {SIDE}}
+                [unstore_unit]
+                    variable=source_var[0]
+                    x=$target_var[0].x
+                    y=$target_var[0].y
+                [/unstore_unit]
+            [/then]
+        [/if]
+        {CLEAR_VARIABLE source_var}
+        {CLEAR_VARIABLE target_var}
+#enddef




Related Messages


Powered by MHonArc, Updated Wed Dec 23 23:00:14 2009