mail[Wesnoth-commits] r33761 - /trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg


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

Header


Content

Posted by soliton . de on March 17, 2009 - 18:50:
Author: soliton
Date: Tue Mar 17 18:50:00 2009
New Revision: 33761

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33761&view=rev
Log:
refactored Malifor's death event to properly filter by his killer's attack 
type (the dialog can be made more fitting now)

Modified:
    trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg?rev=33761&r1=33760&r2=33761&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg Tue 
Mar 17 18:50:00 2009
@@ -1992,7 +1992,7 @@
             speaker=unit
             message= _ "Hey, an underground lake."
         [/message]
-        # We don't have tentacled monsters as such but we do have a 
+        # We don't have tentacled monsters as such but we do have a
         # single tentacle unit
         {NOTRAIT_UNIT 2 "Tentacle of the Deep" 35 23}
         {NOTRAIT_UNIT 2 "Tentacle of the Deep" 33 25}
@@ -2661,44 +2661,15 @@
         {CLEAR_VARIABLE open_the_door}
     [/event]
 
-    # Malifor can be successfully killed only by White Mages, all other
-    # units only cause him to respawn somewhere on the map. This event
-    # handles that assumption
-    [event]
-        name=die
+    [event]
+        name=last breath
         first_time_only=no
         [filter]
             id=Malifor
         [/filter]
-
-        # Over the course of the scenario the player can have any of the
-        # following units. Since outcome of the event depends on which
-        # unit deals the killing blow we need to make sure we cover
-        # all of them.
-
-        # Dwarvish Lord, Dwarvish Dragonguard, Dwarvish Thunderguard,
-        # Dwarvish Steelclad, Dwarvish Fighter, Dwarvish Thunderer
-        # Thug, Poacher, Bandit, Highwayman, Footpad, Outlaw,
-        # Fugitive, Trapper Bowman, Master Bowman, Longbowman,
-        # Peasant, Woodsman, Spearman, Swordsman, Royal Guard,
-        # Pikeman, Javelineer, Halberdier, Arch Mage, Great Mage
-        # Wraith, Spectre, Elvish Druid, Elvish Shyde, Drake Burner,
-        # Fire Drake, Drake Flare, Drake Flameheart, White Mage, Mage
-        # of Light
-        #
-        # Above units can be grouped by a prevailing damage type, we
-        # need to know later which of the groups did the kill to
-        # choose proper dialogue and respawn location
-
-        # Give him a default respawn location in case the possible unit mix
-        # changes and something slips through the filters.
-        {VARIABLE malifor_died_by old_age}
-        {VARIABLE malifor_will_respawn_at_x 23}
-        {VARIABLE malifor_will_respawn_at_y 4}
-
-        # First let's filter out all dwarves. That covers Dwarvish
-        # Lord, Dwarvish Dragonguard, Dwarvish Thunderguard, Dwarvish
-        # Steelclad, Dwarvish Fighter, Dwarvish Thunderer
+        [filter_second_attack]
+            type=impact
+        [/filter_second_attack]
         [if]
             [variable]
                 name=second_unit.race
@@ -2709,88 +2680,46 @@
                 {VARIABLE malifor_will_respawn_at_x 23}
                 {VARIABLE malifor_will_respawn_at_y 4}
             [/then]
-        [/if]
-
-        # In the second step we cover all lawful human and undead units
-        # Bowman, Master Bowman, Longbowman, Peasant, Woodsman,
-        # Spearman, Swordsman, Royal Guard,Pikeman, Javelineer,
-        # Halberdier, Arch Mage, Great Mage, Wraith, Specter, White
-        # Mage, Mage of Light,
-        [if]
-            [variable]
-                name=second_unit.race
-                equals=human
-            [/variable]
-            [variable]
-                name=second_unit.alignment
-                equals=lawful
-            [/variable]
-            [or]
-                [variable]
-                    name=second_unit.race
-                    equals=undead
-                [/variable]
-            [/or]
-            [then]
-                {VARIABLE malifor_died_by blade}
-                {VARIABLE malifor_will_respawn_at_x 14}
-                {VARIABLE malifor_will_respawn_at_y 4}
-            [/then]
-        [/if]
-        # Since the outcome is different for archers we override
-        # things set for them previously, add chaotic humans and elves
-        # to the mix: Thug, Poacher, Bandit, Highwayman, Footpad, Outlaw,
-        # Fugitive, Trapper Bowman, Master Bowman, Longbowman Elvish
-        # Druid, Elvish Shyde
-        [if]
-            [variable]
-                name=second_unit.race
-                equals=human
-            [/variable]
-            [and]
-                [variable]
-                    name=second_unit.usage
-                    equals=archer
-                [/variable]
-                [or]
-                    [variable]
-                        name=second_unit.alignment
-                        equals=chaotic
-                    [/variable]
-                [/or]
-            [/and]
-            [or]
-                [variable]
-                    name=second_unit.race
-                    equals=elf
-                [/variable]
-            [/or]
-            [then]
+            [else]
                 {VARIABLE malifor_died_by arrow}
                 {VARIABLE malifor_will_respawn_at_x 5}
                 {VARIABLE malifor_will_respawn_at_y 2}
-            [/then]
+            [/else]
         [/if]
-        # Filtering out the single drake and overriding red mage
-        # Drake Burner, Fire Drake, Drake Flare, Drake Flameheart
-        # Arch Mage, Great Mage
-        [if]
-            [variable]
-                name=second_unit.id
-                equals=Krash
-            [/variable]
-            [or]
-                [variable]
-                    name=second_unit.id
-                    equals=Camerin
-                [/variable]
-            [/or]
-            [then]
-                {VARIABLE malifor_died_by fire}
-                {VARIABLE malifor_will_respawn_at_x 30}
-                {VARIABLE malifor_will_respawn_at_y 11}
-            [/then]
-        [/if]
+    [/event]
+
+#define MALICORS_LAST_BREATH TYPE X Y
+    [event]
+        name=last breath
+        first_time_only=no
+        [filter]
+            id=Malifor
+        [/filter]
+        [filter_second_attack]
+            type={TYPE}
+        [/filter_second_attack]
+        {VARIABLE malifor_died_by {TYPE}}
+        {VARIABLE malifor_will_respawn_at_x {X}}
+        {VARIABLE malifor_will_respawn_at_y {Y}}
+    [/event]
+#enddef
+
+    {MALICORS_LAST_BREATH pierce 5 2}
+    {MALICORS_LAST_BREATH blade 14 4}
+    {MALICORS_LAST_BREATH fire 30 11}
+    {MALICORS_LAST_BREATH cold 30 11}
+    {MALICORS_LAST_BREATH arcane 30 11}
+
+    # Malifor can be successfully killed only by White Mages, all other
+    # units only cause him to respawn somewhere on the map. This event
+    # handles that assumption
+    [event]
+        name=die
+        first_time_only=no
+        [filter]
+            id=Malifor
+        [/filter]
+
         # And finally, overriding the white mages and calling scenario end
         # White Mage, Mage of Light.
         [if]
@@ -2851,6 +2780,17 @@
             [/then]
         [/if]
 
+        # default spawn location
+        [if]
+            [variable]
+                name=malifor_will_respawn_at_x
+                less_than=1
+            [/variable]
+            [then]
+                {VARIABLE malifor_will_respawn_at_x 23}
+                {VARIABLE malifor_will_respawn_at_y 4}
+            [/then]
+        [/if]
         # If Malifor wasn't killed by white mages, respawn him at the
         # location set previously and give him some extra gold.
         [unit]
@@ -2874,13 +2814,10 @@
             terrain=Uu
         [/terrain]
 
-        # Malifor was killed by dwarves
-        [if]
-            [variable]
-                name=malifor_died_by
-                equals=axe
-            [/variable]
-            [then]
+        [switch]
+            variable=malifor_died_by
+            [case]
+                value=axe
                 [message]
                     speaker=Malifor
                     message= _ "HAHAHAHAHA, FOOLS, YOU THINK YOU CAN KILL 
ME?"
@@ -2902,15 +2839,9 @@
                     speaker=Tallin
                     message= _ "Blast it! Now where did he go? Let's find 
him and try something else!"
                 [/message]
-            [/then]
-        [/if]
-        # Malifor was killed by units with mainly slashing damage...
-        [if]
-            [variable]
-                name=malifor_died_by
-                equals=blade
-            [/variable]
-            [then]
+            [/case]
+            [case]
+                value=blade
                 [message]
                     speaker=Malifor
                     message= _ "HAHAHAHAHAHA, DEATH HAS NO EFFECT ON ME YOU 
FOOLS!"
@@ -2932,15 +2863,9 @@
                     speaker=Tallin
                     message= _ "And look, he's gone. Now we gotta find him 
all over again!"
                 [/message]
-            [/then]
-        [/if]
-        # Malifor was killed by archers or blunt-damage dealers...
-        [if]
-            [variable]
-                name=malifor_died_by
-                equals=arrow
-            [/variable]
-            [then]
+            [/case]
+            [case]
+                value=pierce
                 [message]
                     speaker=Malifor
                     message= _ "HAHAHAHAHAHA, YOUR IDIOCY AMUSES ME GREATLY!"
@@ -2962,15 +2887,9 @@
                     speaker=Tallin
                     message= _ "Oh darn, he disappeared. Let's find him and 
try a different weapon."
                 [/message]
-            [/then]
-        [/if]
-        # Malifor was burned with fire
-        [if]
-            [variable]
-                name=malifor_died_by
-                equals=fire
-            [/variable]
-            [then]
+            [/case]
+            [case]
+                value=fire
                 [message]
                     speaker=Malifor
                     message= _ "HAHAHAHAHAHA, I AM IMMORTAL!"
@@ -2988,15 +2907,8 @@
                     speaker=Tallin
                     message= _ "Look, he disappeared again. Let's find him 
and try using a different weapon on him."
                 [/message]
-            [/then]
-        [/if]
-        # Malifor was killed something that slipped through the filters
-        [if]
-            [variable]
-                name=malifor_died_by
-                equals=old_age
-            [/variable]
-            [then]
+            [/case]
+            [else]
                 [message]
                     speaker=Malifor
                     message= _ "HAHAHAHAHA, FOOLS, YOU THINK YOU CAN KILL 
ME?"
@@ -3014,10 +2926,8 @@
                     speaker=Tallin
                     message= _ "Blast it! Now where did he go? Let's find 
him and try something else!"
                 [/message]
-            [/then]
-        [/if]
-        # FIXME: Again, white mages might not have been freed yet, in
-        # that case the following dialogue looks absurd.
+            [/else]
+        [/switch]
         [if]
             [have_unit]
                 id=Father Marcus
@@ -3052,6 +2962,9 @@
                 [/message]
             [/then]
         [/if]
+        {CLEAR_VARIABLE malifor_will_respawn_at_x}
+        {CLEAR_VARIABLE malifor_will_respawn_at_y}
+        {CLEAR_VARIABLE malifor_died_by}
     [/event]
 
     [event]




Related Messages


Powered by MHonArc, Updated Tue Mar 17 19:20:28 2009