mail[Wesnoth-commits] r20167 - /trunk/data/core/macros/utils.cfg


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

Header


Content

Posted by lari . nieminen on September 07, 2007 - 13:18:
Author: zookeeper
Date: Fri Sep  7 13:18:14 2007
New Revision: 20167

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20167&view=rev
Log:
Added a FULL_HEAL macro for restoring units to full health.

Modified:
    trunk/data/core/macros/utils.cfg

Modified: trunk/data/core/macros/utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/utils.cfg?rev=20167&r1=20166&r2=20167&view=diff
==============================================================================
--- trunk/data/core/macros/utils.cfg (original)
+++ trunk/data/core/macros/utils.cfg Fri Sep  7 13:18:14 2007
@@ -289,24 +289,24 @@
     [event]
         name=side turn
         first_time_only=no
-        
+
         [if]
             [variable]
                 name=side_number
                 numerical_equals={SIDE}
             [/variable]
-            
+
             [then]
                 [store_unit]
                     [filter]
                         side={SIDE}
                         canrecruit=1
                     [/filter]
-                    
+
                     kill=no
                     variable=stored_side_{SIDE}_leader
                 [/store_unit]
-                
+
                 {MODIFY_UNIT (
                     side={SIDE}
                     canrecruit=1
@@ -314,27 +314,58 @@
             [/then]
         [/if]
     [/event]
-    
+
     [event]
         name=ai turn
         first_time_only=no
-        
+
         [if]
             [variable]
                 name=side_number
                 numerical_equals={SIDE}
             [/variable]
-            
+
             [then]
                 [unstore_unit]
                     variable=stored_side_{SIDE}_leader
                     find_vacant=no
                 [/unstore_unit]
-                
+
                 {CLEAR_VARIABLE stored_side_{SIDE}_leader}
             [/then]
         [/if]
     [/event]
+#enddef
+
+#define FULL_HEAL FILTER
+    # This heals the specified unit(s) to full health. Does not work on 
units on
+    # a recall list.
+    [store_unit]
+        [filter]
+            {FILTER}
+        [/filter]
+
+        kill=no
+        variable=FULL_HEAL_temp
+    [/store_unit]
+
+    {FOREACH FULL_HEAL_temp FULL_HEAL_i}
+        [object]
+            silent=yes
+
+            [filter]
+                
x,y=$FULL_HEAL_temp[$FULL_HEAL_i].x,$FULL_HEAL_temp[$FULL_HEAL_i].y
+            [/filter]
+
+            [effect]
+                apply_to=hitpoints
+                heal_full=yes
+            [/effect]
+        [/object]
+    {NEXT FULL_HEAL_i}
+
+    {CLEAR_VARIABLE FULL_HEAL_temp}
+    {CLEAR_VARIABLE FULL_HEAL_i}
 #enddef
 
 #define PUT_TO_RECALL_LIST FILTER




Related Messages


Powered by MHonArc, Updated Fri Sep 07 13:40:29 2007