mail[Wesnoth-commits] r43890 - /trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg


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

Header


Content

Posted by lari . nieminen on July 04, 2010 - 17:05:
Author: zookeeper
Date: Sun Jul  4 17:05:56 2010
New Revision: 43890

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43890&view=rev
Log:
A more tolerable spawn rate for the drakes: lvl2 and lvl3 drakes will now 
take 2 and 3 turns to spawn, there are no lvl3 spawns on easy and no spawns 
will occur if there's already a drake standing on the spawnpoint. Also 
rewrote the spawn system to be less bloated.

Modified:
    trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg?rev=43890&r1=43889&r2=43890&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg 
(original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg 
Sun Jul  4 17:05:56 2010
@@ -205,29 +205,10 @@
             id="Li'sar"
         [/recall]
 
-        {VARIABLE dwelling_1 active}
-        {VARIABLE dwelling_2 active}
-        {VARIABLE dwelling_3 active}
-        {VARIABLE dwelling_4 active}
-        {VARIABLE dwelling_5 active}
-        {VARIABLE dwelling_6 active}
-        {VARIABLE dwelling_7 active}
-        {VARIABLE dwelling_8 active}
-        {VARIABLE dwelling_9 active}
         {VARIABLE waterfall_sighted no}
         {VARIABLE undead_killed no}
         {OBJ_TRIDENT_STORM 17 11 cot_stormtrident}
         {PLACE_IMAGE items/gohere.png 55 3}
-
-        {PLACE_IMAGE scenery/tent-fancy-red.png 12 10}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 16 6}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 22 7}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 23 13}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 28 9}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 31 5}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 34 12}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 38 7}
-        {PLACE_IMAGE scenery/tent-fancy-red.png 41 12}
 
         {UNDEAD_GUARDIAN Draug 2 17}
         {UNDEAD_GUARDIAN Draug 4 17}
@@ -547,14 +528,56 @@
     [/event]
 
     [event]
+        name=prestart
+
+        [set_variables]
+            name=drake_bases
+
+            [value]
+                x,y=12,10
+            [/value]
+            [value]
+                x,y=16,6
+            [/value]
+            [value]
+                x,y=22,7
+            [/value]
+            [value]
+                x,y=23,13
+            [/value]
+            [value]
+                x,y=28,9
+            [/value]
+            [value]
+                x,y=31,5
+            [/value]
+            [value]
+                x,y=34,12
+            [/value]
+            [value]
+                x,y=38,7
+            [/value]
+            [value]
+                x,y=41,12
+            [/value]
+        [/set_variables]
+
+        {FOREACH drake_bases i}
+            {PLACE_IMAGE scenery/tent-fancy-red.png $drake_bases[$i].x 
$drake_bases[$i].y}
+        {NEXT i}
+    [/event]
+
+    [event]
         name=moveto
+        first_time_only=no
+
         [filter]
-            x=12
-            y=10
             side=1
+
+            [filter_location]
+                find_in=drake_bases
+            [/filter_location]
         [/filter]
-
-        {VARIABLE dwelling_1 destroyed}
 
         {RANDOM 10..50}
 
@@ -562,249 +585,29 @@
             side=1
             amount=+$random
         [/gold]
+
         [message]
             speaker=unit
             message= _ "We've found $random gold in the drake base."
             image=items/gold-coins-medium.png
         [/message]
 
-        {REMOVE_IMAGE 12 10}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 12 10}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=16
-            y=6
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_2 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 16 6}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 16 6}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=22
-            y=7
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_3 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 22 7}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 22 7}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=23
-            y=13
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_4 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 23 13}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 23 13}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=31
-            y=5
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_5 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 31 5}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 31 5}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=28
-            y=9
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_6 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 28 9}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 28 9}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=34
-            y=12
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_7 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 34 12}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 34 12}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=38
-            y=7
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_8 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 38 7}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 38 7}
-
-        {CLEAR_VARIABLE random}
-    [/event]
-
-    [event]
-        name=moveto
-        [filter]
-            x=41
-            y=12
-            side=1
-        [/filter]
-
-        {VARIABLE dwelling_9 destroyed}
-
-        {RANDOM 10..50}
-
-        [gold]
-            side=1
-            amount=+$random
-        [/gold]
-        [message]
-            speaker=unit
-            message= _ "We've found $random gold in the drake base."
-            image=items/gold-coins-medium.png
-        [/message]
-
-        {REMOVE_IMAGE 41 12}
-
-        {PLACE_IMAGE scenery/village-human-burned4.png 41 12}
-
-        {CLEAR_VARIABLE random}
+        [removeitem]
+            x,y=$x1,$y1
+            image=scenery/tent-fancy-red.png
+        [/removeitem]
+
+        {PLACE_IMAGE scenery/village-human-burned4.png $x1 $y1}
+
+        # Remove the current location from the array
+        [store_locations]
+            find_in=drake_bases
+            [not]
+                x,y=$x1,$y1
+            [/not]
+
+            variable=drake_bases
+        [/store_locations]
     [/event]
 
     [event]
@@ -837,139 +640,91 @@
         [/message]
     [/event]
 
-    [event]
-        name=side turn
+    # Each turn, a drake will be spawned from each base which still stands;
+    # however, a lvl2 drake will take 2 turns to appear and a lvl3 drake 3 
turns
+    [event]
+        name=new turn
         first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_1 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 12 10}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_2 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 16 6}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_3 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 22 7}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_4 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 23 13}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_5 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 31 5}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_6 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 28 9}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_7 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 34 12}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_8 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 38 7}
-            [/then]
-        [/if]
-    [/event]
-
-    [event]
-        name=side turn
-        first_time_only=no
-        [if]
-            {CHECK_VARIABLE side_number 1}
-
-            [and]
-                {CHECK_VARIABLE dwelling_9 active}
-            [/and]
-            [then]
-                {RANDOM_DRAKE 41 12}
-            [/then]
-        [/if]
+
+        {FOREACH drake_bases i}
+            [if]
+                # We only attempt to spawn drakes from a base if there isn't 
one
+                # already standing there
+                [not]
+                    [have_unit]
+                        x,y=$drake_bases[$i].x,$drake_bases[$i].y
+                    [/have_unit]
+                [/not]
+
+                [then]
+                    [if]
+                        [variable]
+                            name=drake_bases[$i].delayed_spawning_on_turn
+                            greater_than=1
+                        [/variable]
+
+                        [variable]
+                            name=drake_bases[$i].delayed_spawning_on_turn
+                            # Note: the value might be lower than 
$turn_number
+                            less_than_equal_to=$turn_number
+                        [/variable]
+
+                        [then]
+                            {GENERIC_UNIT 2 $drake_bases[$i].spawn_type 
$drake_bases[$i].x $drake_bases[$i].y}
+                            [+unit]
+                                ai_special=guardian
+                                facing=sw
+                            [/unit]
+
+                            {CLEAR_VARIABLE 
drake_bases[$i].delayed_spawning_on_turn}
+                        [/then]
+
+                        [else]
+                            [if]
+                                [then]
+#ifdef EASY
+                                    {VARIABLE_OP spawn_level rand "1,2"}
+#else
+                                    {VARIABLE_OP spawn_level rand "1,2,2,3"}
+#endif
+
+                                    [switch]
+                                        variable=spawn_level
+
+                                        [case]
+                                            value=1
+
+                                            {VARIABLE_OP spawn_type rand 
"Drake Fighter,Drake Burner,Drake Clasher,Drake Glider"}
+
+                                            {GENERIC_UNIT 2 $spawn_type 
$drake_bases[$i].x $drake_bases[$i].y}
+                                            [+unit]
+                                                ai_special=guardian
+                                            [/unit]
+                                        [/case]
+
+                                        [case]
+                                            value=2
+
+                                            {VARIABLE_OP 
drake_bases[$i].spawn_type rand "Drake Warrior,Drake Flare,Fire Drake,Drake 
Thrasher,Drake Arbiter,Sky Drake"}
+
+                                            {VARIABLE 
drake_bases[$i].delayed_spawning_on_turn "$($turn_number + 1)"}
+                                        [/case]
+
+                                        [case]
+                                            value=3
+
+                                            {VARIABLE_OP 
drake_bases[$i].spawn_type rand "Drake Blademaster,Drake Flameheart,Inferno 
Drake,Drake Enforcer,Drake Warden,Hurricane Drake"}
+
+                                            {VARIABLE 
drake_bases[$i].delayed_spawning_on_turn "$($turn_number + 2)"}
+                                        [/case]
+                                    [/switch]
+                                [/then]
+                            [/if]
+                        [/else]
+                    [/if]
+                [/then]
+            [/if]
+        {NEXT i}
     [/event]
 
     [event]




Related Messages


Powered by MHonArc, Updated Sun Jul 04 17:20:07 2010