Author: zookeeper
Date: Thu Sep 11 21:31:27 2008
New Revision: 29403

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29403&view=rev
Log:
Shortened (the expanded form of) Tallin's type changing code.

Modified:
    trunk/data/campaigns/Northern_Rebirth/scenarios/06a_Old_Friend.cfg

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/06a_Old_Friend.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/06a_Old_Friend.cfg?rev=29403&r1=29402&r2=29403&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/06a_Old_Friend.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/06a_Old_Friend.cfg Thu Sep 
11 21:31:27 2008
@@ -200,39 +200,45 @@
 
         # Check his level, and set new type to be a commander of the same 
level.
         {STORE_UNIT_VAR id=Tallin level old_tallin_level}
-        [if]
-            [variable]
-                name=old_tallin_level
-                greater_than=2
-            [/variable]
-            [then]
-                {TRANSFORM_UNIT id=Tallin General}
-            [/then]
+
+        [switch]
+            variable=old_tallin_level
+
+            [case]
+                value=0
+
+                {VARIABLE new_tallin_type Sergeant}
+            [/case]
+
+            [case]
+                value=1
+
+                {VARIABLE new_tallin_type Sergeant}
+            [/case]
+
+            [case]
+                value=2
+
+                {VARIABLE new_tallin_type Lieutenant}
+            [/case]
+
             [else]
-                [if]
-                    [variable]
-                        name=old_tallin_level
-                        greater_than=1
-                    [/variable]
-                    [then]
-                        {TRANSFORM_UNIT id=Tallin Lieutenant}
-                    [/then]
-                    [else]
-                        {TRANSFORM_UNIT id=Tallin Sergeant}
-                    [/else]
-                [/if]
+                {VARIABLE new_tallin_type General}
             [/else]
         [/if]
-        {CLEAR_VARIABLE old_tallin_level}
+
+        {TRANSFORM_UNIT id=Tallin $new_tallin_type}
         {FULL_HEAL id=Tallin}
-    [/event]
-
-    # Start event, recall heroes, place some bad guys, set objectives, 
+
+        {CLEAR_VARIABLE old_tallin_level,new_tallin_type}
+    [/event]
+
+    # Start event, recall heroes, place some bad guys, set objectives,
     # do the talking
     [event]
         name=start
 
-        # This hack is a workaround for unit roles not getting carried over 
+        # This hack is a workaround for unit roles not getting carried over
         # to next scenario. It may no longer be needed in 1.5 - must test.
         [role]
             [filter_wml]


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to