mail[Wesnoth-commits] r27165 - in /trunk/data: campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg 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 June 14, 2008 - 13:45:
Author: zookeeper
Date: Sat Jun 14 13:17:56 2008
New Revision: 27165

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27165&view=rev
Log:
Added a macro for allowing a side to randomly recruit given unit variations 
(usually WC variations), and made Muff Malal's Peninsula use that.

Modified:
    
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
    trunk/data/core/macros/utils.cfg

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg?rev=27165&r1=27164&r2=27165&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
 (original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
 Sat Jun 14 13:17:56 2008
@@ -76,6 +76,8 @@
         enemy=1
     [/side]
 
+    {RECRUIT_UNIT_VARIATIONS 2 "Walking Corpse" 
none,none,none,none,swimmer,swimmer,mounted,bat}
+
     {STARTING_VILLAGES 2 30}
 
     [event]

Modified: trunk/data/core/macros/utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/utils.cfg?rev=27165&r1=27164&r2=27165&view=diff
==============================================================================
--- trunk/data/core/macros/utils.cfg (original)
+++ trunk/data/core/macros/utils.cfg Sat Jun 14 13:17:56 2008
@@ -479,3 +479,46 @@
     {CLEAR_VARIABLE TIME_ACTIONS_time_begin}
     {CLEAR_VARIABLE TIME_ACTIONS_time_end}
 #enddef
+
+#define RECRUIT_UNIT_VARIATIONS SIDE TYPE VARIATIONS
+    # Allows a side to seemingly recruit variations of a given unit, such as 
the
+    # the Walking Corpse.
+    #
+    # An example which makes side 2 have a 50% chance of getting a normal WC
+    # and a 50% chance of getting either a drake or dwarf variation:
+    #! {RECRUIT_UNIT_VARIATIONS 2 "Walking Corpse" none,none,drake,dwarf}
+    [event]
+        name=prerecruit
+        first_time_only=no
+
+        [filter]
+            side={SIDE}
+            type={TYPE}
+        [/filter]
+
+        {VARIABLE_OP recruited_unit_random_variation rand {VARIATIONS}}
+
+        [if]
+            [variable]
+                name=recruited_unit_random_variation
+                not_equals=none
+            [/variable]
+
+            [then]
+                [object]
+                    duration=forever
+                    silent=yes
+
+                    [filter]
+                        x,y=$x1,$y1
+                    [/filter]
+
+                    [effect]
+                        apply_to=variation
+                        name=$recruited_unit_random_variation
+                    [/effect]
+                [/object]
+            [/then]
+        [/if]
+    [/event]
+#enddef




Related Messages


Powered by MHonArc, Updated Sat Jun 14 14:21:42 2008