mail[Wesnoth-commits] r20098 - /trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg


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

Header


Content

Posted by lari . nieminen on September 04, 2007 - 12:17:
Author: zookeeper
Date: Tue Sep  4 12:17:24 2007
New Revision: 20098

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20098&view=rev
Log:
The dehydration should be fixed entirely now.

Modified:
    trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg?rev=20098&r1=20097&r2=20098&view=diff
==============================================================================
--- trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg 
(original)
+++ trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Harsh_Sands.cfg 
Tue Sep  4 12:17:24 2007
@@ -271,14 +271,17 @@
             message= _ "Unfortunately, because of our hasty flight from our 
village, we are short on waterskins and rations. We'll have enough if we move 
quickly and eat as little as possible, but we won't last long in the wastes 
if we can't find more sources of water. As it is, between the heat of the day 
and the cold of the night, this journey will be hard on our people."
         [/message]
 
+        [message]
+            description=Zhul
+            message= _ "The other shamans and I can prevent exhaustion and 
dehydration from weakening anyone close to us. But oases like the one next to 
us are the key to our survival; their fresh water will heal our people back 
to their full strength."
+        [/message]
+
         #!***Rewriten message -> explains new dehydration rules***
         [message]
             speaker=narrator
-            message= _ "During the daytime (Dawn, Morning, Mid-day, 
Afternoon, and Dusk) at the end of each your turns, every unit in a sand, 
road, rubble or sand dune hex will have attack damage weakened. Magic type 
attacks will be unaffected by this. At the start of your turn, each unit in 
an oasis (shallow water) hex will regain full attack strength."
+            message= _ "During the daytime (Dawn, Morning, Mid-day, 
Afternoon, and Dusk) at the beginning of your turn, every unit not on 
grassland, castles or encampments will have their melee attack damage 
weakened by one point. Adjacent healer units will prevent the dehydration 
from taking place, and ranged attacks will always remain unaffected. Every 
unit beginning their turn in an oasis (shallow water) will regain full attack 
strength."
             image=wesnoth-icon.png
         [/message]
-
-        #!***Deleted message -> druids no longer prevent dehydration 
effects***
 
         [message]
             description=Nym
@@ -363,7 +366,7 @@
             id=Travelring
             name= _ "Traveler's Ring"
             image=items/ring-white.png
-            description= _ "At the end of each turn, this unit takes no 
damage from the desert."
+            description= _ "This unit will no longer suffer from the 
fatiguing effects of the daytime heat."
             [filter]
                 x={X}
                 y={Y}
@@ -376,15 +379,16 @@
             y={Y}
         [/removeitem]
 
-        [role]
-            role=immune
-            x={X}
-            y={Y}
-        [/role]
+        {VARIABLE unit.variables.dehydration_immunity yes}
+
+        [unstore_unit]
+            variable=unit
+            find_vacant=no
+        [/unstore_unit]
+
         {CLEAR_VARIABLE tempx}
         {CLEAR_VARIABLE tempy}
     [/event]
-
 #enddef
 
         #!***Check if unit is scout type***
@@ -1591,6 +1595,8 @@
                     description=Kaleh
                     message= _ "The Black Hand outlaws still threaten the 
others. While their leader still fights we won't be able to get all our 
people across the sands safely. We must deal with the Black Hand before we 
can progress further."
                 [/message]
+
+                [allow_undo][/allow_undo]
             [/then]
 
             [else]
@@ -1659,6 +1665,50 @@
                 [/message]
             [/then]
         [/if]
+
+        # Rehydrate all units for the next scenario
+
+        [store_unit]
+            [filter]
+                side=1
+            [/filter]
+
+            kill=no
+            variable=units_to_rehydrate
+        [/store_unit]
+
+        {FOREACH units_to_rehydrate i}
+            [if]
+                [variable]
+                    name=units_to_rehydrate[$i].variables.dehydrated
+                    equals=1
+                [/variable]
+
+                [then]
+                    {VARIABLE units_to_rehydrate[$i].variables.dehydrated 0}
+
+                    {FOREACH units_to_rehydrate[$i].attack j}
+                        [if]
+                            [variable]
+                                name=units_to_rehydrate[$i].attack[$j].range
+                                equals=melee
+                            [/variable]
+
+                            [then]
+                                {VARIABLE 
units_to_rehydrate[$i].attack[$j].damage 
$units_to_rehydrate[$i].variables.attack[$j].real_damage}
+                            [/then]
+                        [/if]
+                    {NEXT j}
+
+                    [unstore_unit]
+                        variable=units_to_rehydrate[$i]
+                        find_vacant=no
+                    [/unstore_unit]
+                [/then]
+            [/if]
+        {NEXT i}
+
+        {CLEAR_VARIABLE units_to_rehydrate}
     [/event]
 
     #time over defeat event
@@ -1684,116 +1734,6 @@
 
         {VARIABLE turn_temp $turn_number}
         {VARIABLE_OP turn_temp modulo 15}
-
-        [if]
-            #!***Check if k*15 < turn < k*15+6 or k*15+6 < turn < k*15 + 12 
-> those bands mean daytime including dawn and dusk***
-            [variable]
-                name=turn_temp
-                greater_than=6
-            [/variable]
-            [variable]
-                name=turn_temp
-                less_than=12
-            [/variable]
-            [or]
-                [variable]
-                    name=turn_temp
-                    less_than=6
-                [/variable]
-                [variable]
-                    name=turn_temp
-                    greater_than=0
-                [/variable]
-            [/or]
-
-            [then]
-                #!***If daytime perform dehydration***
-                #!***Step 1 : find coordinates of desert, road, dune, crater 
hexes with nonundead, nonringwearing, nonscorpion unit and store them into 
array***
-                [store_locations]
-                    x=1-40
-                    y=1-80
-                    #!***Adding extra radius was not necesary in this case***
-                    terrain=Hd, Dd, Rr, Dd^Dr
-                    [filter]
-                        [not]
-                            role=immune
-                        [/not]
-                        [not]
-                            race=undead
-                        [/not]
-                        [not]
-                            type=Giant Scorpion
-                        [/not]
-                        [not]
-                            type=Dust Devil
-                        [/not]
-                    [/filter]
-                    variable=coords
-                [/store_locations]
-
-                #!***For each pair of coordinates found do***
-                {FOREACH coords i}
-
-                #!***Store unit on a hex into a variable***
-                [store_unit]
-                    [filter]
-                        x,y=$coords[$i].x,$coords[$i].y
-                    [/filter]
-                    variable=victim
-                [/store_unit]
-                #!***If it's the first time it's affected by dehydration, 
store its original damage values and set flag to bypas this step in the 
future***
-                [if]
-                    [variable]
-                        name=victim.variables.dehydration_flag
-                        numerical_not_equals=1
-                    [/variable]
-
-                    [then]
-                        {VARIABLE victim.variables.dehydration_flag 1}
-
-                        {FOREACH victim.attack j}
-
-                        {VARIABLE victim.attack[$j].real_damage 
$victim.attack[$j].damage}
-
-                        {NEXT j}
-                    [/then]
-                [/if]
-
-                {FOREACH victim.attack j}
-                #!***Go trough units attacks and decrease damage of each 
nonranged one by 1, end value cannot fall below 0***
-                [if]
-                    [variable]
-                        name=victim.attack[$j].range
-                        equals=melee
-                    [/variable]
-
-                    [then]
-                        [if]
-                            [variable]
-                                name=victim.attack[$j].damage
-                                greater_than=1
-                            [/variable]
-
-                            [then]
-                                {ADD victim.attack[$j].damage -1}
-                            [/then]
-                        [/if]
-                    [/then]
-                [/if]
-
-                {NEXT j}
-                #!***Apply changes***
-                [unstore_unit]
-                    variable=victim
-                [/unstore_unit]
-
-                {NEXT i}
-            [/then]
-            {CLEAR_VARIABLE victim}
-            {CLEAR_VARIABLE coords}
-            {CLEAR_VARIABLE i}
-            {CLEAR_VARIABLE j}
-        [/if]
 
         #!***Ghost apperance event***
         [if]
@@ -1887,7 +1827,7 @@
             variable=victim
             kill=yes
         [/store_unit]
-        {VARIABLE victim.variables.dehydration_flag 0}
+        {VARIABLE victim.variables.dehydrated 0}
         [unstore_unit]
             variable=victim
         [/unstore_unit]
@@ -1974,48 +1914,155 @@
         [/if]
     [/event]
 
-    #!***Rehydrate units in an oasis***
-    [event]
-        name=moveto
+    [event]
+        name=new turn
         first_time_only=no
-        [filter]
-            [not]
-                race=undead
-            [/not]
-            [not]
-                type=Giant Scorpion
-            [/not]
-            [not]
-                type=Dust Devil
-            [/not]
-            [filter_location]
-                terrain=Ww
-            [/filter_location]
-            [wml_filter]
-                [variables]
-                    dehydration_flag=1
-                [/variables]
-            [/wml_filter]
-        [/filter]
-
-        [if]
-            [variable]
-                name=unit.variables.dehydration_flag
-                numerical_equals=1
-            [/variable]
-
-            [then]
-                {FOREACH unit.attack i}
-                {VARIABLE unit.attack[$i].damage 
$unit.attack[$i].real_damage}
-                {NEXT i}
-
-                [unstore_unit]
-                    variable=unit
-                    find_vacant=no
-                [/unstore_unit]
-            [/then]
-        [/if]
-    [/event]
+
+        [store_unit]
+            [filter]
+                [not]
+                    [wml_filter]
+                        [variables]
+                            dehydration_immunity=yes
+                        [/variables]
+                    [/wml_filter]
+                [/not]
+                [not]
+                    race=undead
+                [/not]
+                [not]
+                    type=Giant Scorpion
+                [/not]
+                [not]
+                    type=Dust Devil
+                [/not]
+                [filter_location]
+                    terrain=Hd, Dd, Rr, Dd^Dr
+                [/filter_location]
+                [not]
+                    [filter_adjacent]
+                        ability=healing,curing
+                        is_enemy=no
+                    [/filter_adjacent]
+                [/not]
+                [not]
+                    [filter_location]
+                        time_of_day=chaotic
+                    [/filter_location]
+                [/not]
+            [/filter]
+
+            kill=no
+            variable=units_to_dehydrate
+        [/store_unit]
+
+        {FOREACH units_to_dehydrate i}
+            {VARIABLE units_to_dehydrate[$i].variables.dehydrated 1}
+
+            {FOREACH units_to_dehydrate[$i].attack j}
+                [if]
+                    [variable]
+                        name=units_to_dehydrate[$i].attack[$j].range
+                        equals=melee
+                    [/variable]
+
+                    [then]
+                        [if]
+                            [variable]
+                                name=units_to_dehydrate[$i].attack[$j].damage
+                                greater_than=1
+                            [/variable]
+
+                            [then]
+                                [if]
+                                    [variable]
+                                        
name=units_to_dehydrate[$i].variables.attack[$j].real_damage
+                                        greater_than=0
+                                    [/variable]
+
+                                    [else]
+                                        {VARIABLE 
units_to_dehydrate[$i].variables.attack[$j].real_damage 
$units_to_dehydrate[$i].attack[$j].damage}
+                                    [/else]
+                                [/if]
+
+                                {ADD 
units_to_dehydrate[$i].attack[$j].damage -1}
+                            [/then]
+                        [/if]
+                    [/then]
+                [/if]
+            {NEXT j}
+
+            [unstore_unit]
+                variable=units_to_dehydrate[$i]
+                find_vacant=no
+                {COLOR_HARM}
+                text= _ "Dehydrated"
+            [/unstore_unit]
+        {NEXT i}
+
+        {CLEAR_VARIABLE units_to_dehydrate}
+    [/event]
+
+    [event]
+        name=new turn
+        first_time_only=no
+
+        [store_unit]
+            [filter]
+                [not]
+                    race=undead
+                [/not]
+                [not]
+                    type=Giant Scorpion
+                [/not]
+                [not]
+                    type=Dust Devil
+                [/not]
+                [filter_location]
+                    terrain=Ww
+                [/filter_location]
+            [/filter]
+
+            kill=no
+            variable=units_to_rehydrate
+        [/store_unit]
+
+        {FOREACH units_to_rehydrate i}
+            [if]
+                [variable]
+                    name=units_to_rehydrate[$i].variables.dehydrated
+                    equals=1
+                [/variable]
+
+                [then]
+                    {VARIABLE units_to_rehydrate[$i].variables.dehydrated 0}
+
+                    {FOREACH units_to_rehydrate[$i].attack j}
+                        [if]
+                            [variable]
+                                name=units_to_rehydrate[$i].attack[$j].range
+                                equals=melee
+                            [/variable]
+
+                            [then]
+                                {VARIABLE 
units_to_rehydrate[$i].attack[$j].damage 
$units_to_rehydrate[$i].variables.attack[$j].real_damage}
+                            [/then]
+                        [/if]
+                    {NEXT j}
+
+                    [unstore_unit]
+                        variable=units_to_rehydrate[$i]
+                        find_vacant=no
+                        {COLOR_HEAL}
+                        text= _ "Rehydrated"
+                    [/unstore_unit]
+                [/then]
+            [/if]
+        {NEXT i}
+
+        {CLEAR_VARIABLE units_to_rehydrate}
+    [/event]
+
     {@campaigns/Under_the_Burning_Suns/utils/deaths.cfg}
 
     {@campaigns/Under_the_Burning_Suns/utils/global-events.cfg}




Related Messages


Powered by MHonArc, Updated Tue Sep 04 16:00:18 2007