Author: zookeeper
Date: Fri Dec  5 23:54:04 2008
New Revision: 31295

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31295&view=rev
Log:
Made a random unit (of the highest possible level) be auto-recalled at the 
entrance every turn after the central body has appeared, and did some minor 
cleanup.

Modified:
    
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/12_The_Final_Confrontation.cfg

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/12_The_Final_Confrontation.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/12_The_Final_Confrontation.cfg?rev=31295&r1=31294&r2=31295&view=diff
==============================================================================
--- 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/12_The_Final_Confrontation.cfg
 (original)
+++ 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/12_The_Final_Confrontation.cfg
 Fri Dec  5 23:54:04 2008
@@ -381,6 +381,8 @@
             find_vacant=yes
         [/unstore_unit]
 
+        {CLEAR_VARIABLE stored_kaleh}
+
         [if]
             [have_unit]
                 id=$ally_name
@@ -538,6 +540,8 @@
             {COLOR_HARM}
         [/unstore_unit]
 
+        {CLEAR_VARIABLE stored_eloh}
+
         [redraw]
         [/redraw]
 
@@ -626,117 +630,6 @@
             {CLEAR_VARIABLE possible_spawn_locations}
         [/then]
     [/if]
-#enddef
-
-    # MACRO 2: Perform special attack by Central Body
-
-#define SPECIAL_ATTACK
-    [store_unit]
-        [filter]
-            side=1
-        [/filter]
-
-        kill=no
-        variable=elf_list
-    [/store_unit]
-
-    {VARIABLE_OP victim_i random "1..$elf_list.length"}
-    {VARIABLE_OP victim_i add -1}
-
-    #used to be 140,255,247
-
-    [colour_adjust]
-        red,green,blue=40,0,100
-    [/colour_adjust]
-
-    [redraw]
-    [/redraw]
-
-    [delay]
-        time=250
-    [/delay]
-
-    [colour_adjust]
-        red,green,blue=0,0,0
-    [/colour_adjust]
-
-    [redraw]
-    [/redraw]
-
-    [delay]
-        time=100
-    [/delay]
-
-    # Add 2 effects slow unit and damage it
-    # 1: slow unit
-    # 2: do damage to unit (8/9/10 based on difficulty?-stops healing)
-
-    {VARIABLE elf_list[$victim_i].status.slowed on}
-
-    [unstore_unit]
-        variable=elf_list[$victim_i]
-        find_vacant=no
-#textdomain wesnoth
-        text= _ "slowed"
-#textdomain wesnoth-utbs
-        {COLOR_HARM}
-    [/unstore_unit]
-
-    #ifdef EASY
-        {VARIABLE special_attack_damage 10}
-    #endif
-    #ifdef NORMAL
-        {VARIABLE special_attack_damage 11}
-    #endif
-    #ifdef HARD
-        {VARIABLE special_attack_damage 12}
-    #endif
-
-    [if]
-        [variable]
-            name=elf_list[$victim_i].hitpoints
-            less_than_equal_to=$special_attack_damage
-        [/variable]
-
-        [then]
-            {VARIABLE special_attack_damage $elf_list[$victim_i].hitpoints}
-            {VARIABLE_OP special_attack_damage add -1}
-        [/then]
-    [/if]
-
-    {VARIABLE_OP elf_list[$victim_i].hitpoints add -$special_attack_damage}
-
-    [unstore_unit]
-        variable=elf_list[$victim_i]
-        find_vacant=no
-        text="-$special_attack_damage" # wmllint: ignore no spellcheck
-        {COLOR_HARM}
-    [/unstore_unit]
-
-    [if]
-        [variable]
-            name=hit_by_special_attack
-            not_equals=yes
-        [/variable]
-
-        [then]
-            {VARIABLE hit_by_special_attack yes}
-
-            [message]
-                x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
-                message= _ "What the heck? That central creature just hit me 
with some sort of slime. It hurts and I, I'm stuck!"
-            [/message]
-        [/then]
-
-        [else]
-            [message]
-                x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
-                message= _ "Ow, I'm stuck!"
-            [/message]
-        [/else]
-    [/if]
-
-    {CLEAR_VARIABLE elf_list}
 #enddef
 
     # Event 1: The Death of Eloh and the revealing of the true monster
@@ -1001,6 +894,160 @@
         [/objectives]
     [/event]
 
+    [event]
+        name=new turn
+        first_time_only=no
+
+        [if]
+            [have_unit]
+                id=Yechnagoth
+            [/have_unit]
+
+            [then]
+                [store_unit]
+                    [filter]
+                        side=1
+                        level=4
+                        x,y=recall,recall
+                    [/filter]
+
+                    kill=no
+                    variable=lvl4_recalls
+                [/store_unit]
+
+                [if]
+                    [variable]
+                        name=lvl4_recalls.length
+                        greater_than=0
+                    [/variable]
+
+                    [then]
+                        {VARIABLE helper_level 4}
+                    [/then]
+
+                    [else]
+                        [store_unit]
+                            [filter]
+                                side=1
+                                level=3
+                                x,y=recall,recall
+                            [/filter]
+
+                            kill=no
+                            variable=lvl3_recalls
+                        [/store_unit]
+
+                        [if]
+                            [variable]
+                                name=lvl3_recalls.length
+                                greater_than=0
+                            [/variable]
+
+                            [then]
+                                {VARIABLE helper_level 3}
+                            [/then]
+
+                            [else]
+                                [store_unit]
+                                    [filter]
+                                        side=1
+                                        level=2
+                                        x,y=recall,recall
+                                    [/filter]
+
+                                    kill=no
+                                    variable=lvl2_recalls
+                                [/store_unit]
+
+                                [if]
+                                    [variable]
+                                        name=lvl2_recalls.length
+                                        greater_than=0
+                                    [/variable]
+
+                                    [then]
+                                        {VARIABLE helper_level 2}
+                                    [/then]
+
+                                    [else]
+                                        [store_unit]
+                                            [filter]
+                                                side=1
+                                                level=1
+                                                x,y=recall,recall
+                                            [/filter]
+
+                                            kill=no
+                                            variable=lvl1_recalls
+                                        [/store_unit]
+
+                                        [if]
+                                            [variable]
+                                                name=lvl1_recalls.length
+                                                greater_than=0
+                                            [/variable]
+
+                                            [then]
+                                                {VARIABLE helper_level 1}
+                                            [/then]
+
+                                            [else]
+                                                {VARIABLE 
no_possible_helpers_left yes}
+                                            [/else]
+                                        [/if]
+                                    [/else]
+                                [/if]
+                            [/else]
+                        [/if]
+                    [/else]
+                [/if]
+
+                {CLEAR_VARIABLE 
lvl1_recalls,lvl2_recalls,lvl3_recalls,lvl4_recalls}
+
+                [if]
+                    [variable]
+                        name=no_possible_helpers_left
+                        not_equals=yes
+                    [/variable]
+
+                    [then]
+                        [store_unit]
+                            [filter]
+                                side=1
+                                level=$helper_level
+                                x,y=recall,recall
+                            [/filter]
+
+                            kill=no
+                            variable=possible_helpers
+                        [/store_unit]
+
+                        {VARIABLE random_helper_i 
"1..$possible_helpers.length"}
+                        {VARIABLE_OP random_helper_i add -1}
+
+                        {VARIABLE possible_helpers[$random_helper_i].x 10}
+                        {VARIABLE possible_helpers[$random_helper_i].y 18}
+
+                        [move_unit_fake]
+                            type=$possible_helpers[$random_helper_i].type
+                            side=1
+                            x=10,10
+                            y=20,18
+                        [/move_unit_fake]
+
+                        [recall]
+                            id=$possible_helpers[$random_helper_i].id
+                            x,y=10,18
+                            show=no
+                        [/recall]
+
+                        {CLEAR_VARIABLE possible_helpers}
+                    [/then]
+                [/if]
+            [/then]
+        [/if]
+    [/event]
+
     # Event 2: New minions are created each turn
 
     [event]
@@ -1140,7 +1187,113 @@
             [/have_unit]
 
             [then]
-                {SPECIAL_ATTACK}
+                [store_unit]
+                    [filter]
+                        side=1
+                        x,y=1-99,1-99
+                    [/filter]
+
+                    kill=no
+                    variable=elf_list
+                [/store_unit]
+
+                {VARIABLE_OP victim_i random "1..$elf_list.length"}
+                {VARIABLE_OP victim_i add -1}
+
+                #used to be 140,255,247
+
+                [colour_adjust]
+                    red,green,blue=40,0,100
+                [/colour_adjust]
+
+                [redraw]
+                [/redraw]
+
+                [delay]
+                    time=250
+                [/delay]
+
+                [colour_adjust]
+                    red,green,blue=0,0,0
+                [/colour_adjust]
+
+                [redraw]
+                [/redraw]
+
+                [delay]
+                    time=100
+                [/delay]
+
+                # Add 2 effects slow unit and damage it
+                # 1: slow unit
+                # 2: do damage to unit (8/9/10 based on difficulty?-stops 
healing)
+
+                {VARIABLE elf_list[$victim_i].status.slowed on}
+
+                [unstore_unit]
+                    variable=elf_list[$victim_i]
+                    find_vacant=no
+#textdomain wesnoth
+                    text= _ "slowed"
+#textdomain wesnoth-utbs
+                    {COLOR_HARM}
+                [/unstore_unit]
+
+                #ifdef EASY
+                    {VARIABLE special_attack_damage 10}
+                #endif
+                #ifdef NORMAL
+                    {VARIABLE special_attack_damage 11}
+                #endif
+                #ifdef HARD
+                    {VARIABLE special_attack_damage 12}
+                #endif
+
+                [if]
+                    [variable]
+                        name=elf_list[$victim_i].hitpoints
+                        less_than_equal_to=$special_attack_damage
+                    [/variable]
+
+                    [then]
+                        {VARIABLE special_attack_damage 
$elf_list[$victim_i].hitpoints}
+                        {VARIABLE_OP special_attack_damage add -1}
+                    [/then]
+                [/if]
+
+                {VARIABLE_OP elf_list[$victim_i].hitpoints add 
-$special_attack_damage}
+
+                [unstore_unit]
+                    variable=elf_list[$victim_i]
+                    find_vacant=no
+                    text="-$special_attack_damage"     # wmllint: ignore no 
spellcheck
+                    {COLOR_HARM}
+                [/unstore_unit]
+
+                [if]
+                    [variable]
+                        name=hit_by_special_attack
+                        not_equals=yes
+                    [/variable]
+
+                    [then]
+                        {VARIABLE hit_by_special_attack yes}
+
+                        [message]
+                            x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
+                            message= _ "What the heck? That central creature 
just hit me with some sort of slime. It hurts and I, I'm stuck!"
+                        [/message]
+                    [/then]
+
+                    [else]
+                        [message]
+                            x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
+                            message= _ "Ow, I'm stuck!"
+                        [/message]
+                    [/else]
+                [/if]
+
+                {CLEAR_VARIABLE elf_list}
             [/then]
         [/if]
     [/event]
@@ -1415,7 +1568,6 @@
             [/then]
         [/if]
 
-        {CLEAR_VARIABLE stored_kaleh}
         {CLEAR_VARIABLE minion_turn_counter}
         {CLEAR_VARIABLE attacked_yechnagoth}
         {CLEAR_VARIABLE hit_by_special_attack}


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

Reply via email to