Author: ai0867
Date: Mon Oct  6 12:15:23 2008
New Revision: 29921

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29921&view=rev
Log:
* Add (un)consider attack events. (Bug #12375)

Modified:
    trunk/changelog
    trunk/data/scenario-test.cfg
    trunk/src/mouse_events.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=29921&r1=29920&r2=29921&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Mon Oct  6 12:15:23 2008
@@ -1,6 +1,9 @@
 Version 1.5.5+svn:
  * Language and i18n:
    * updated translations:
+ * WML engine:
+   * Created the "consider attack" and "unconsider attack" events. (bug
+   #12375)
 
 Version 1.5.5:
  * Campaigns:

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=29921&r1=29920&r2=29921&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Mon Oct  6 12:15:23 2008
@@ -36,18 +36,6 @@
     {DUSK}
     {FIRST_WATCH}
     {SECOND_WATCH}
-    [story]
-        [part]
-            background="attacks/hammer-dwarven-runic.png"
-            story="scaled"
-            scale_background=yes
-        [/part]
-        [part]
-            background="attacks/hammer-dwarven-runic.png"
-            story="unscaled"
-            scale_background=no
-        [/part]
-    [/story]
     [music]
         name="traveling_minstrels.ogg"
         ms_before=12000
@@ -234,6 +222,81 @@
         [/filter]
         {LOG "$unit.name (id $unit.id|) requested health insurance!"}
         {FULL_HEAL (x,y=$x1|,$y1)}
+    [/event]
+
+    [label]
+        x,y=4,6
+        text="Special Weaponry"
+    [/label]
+
+    [event]
+        name=moveto
+        [filter]
+            side=1
+            x,y=4,6
+        [/filter]
+        [message]
+            speaker=narrator
+            image=wesnoth-icon.png
+            message="You now have access to a special anti-warlord weapon!"
+        [/message]
+        [event]
+            name=consider attack
+            first_time_only=no
+            [filter_second]
+                type=Orcish Warlord
+            [/filter_second]
+            [object]
+                name= _ "Anti-Warlord Weaponry activated!"
+                [filter]
+                    x,y=$x1,$y1
+                [/filter]
+                [effect]
+                    apply_to=new_attack
+                    name="anti-warlord"
+                    description="anti-warlord"
+                    type=arcane
+                    range=ranged
+                    damage=50
+                    number=5
+                    icon=attacks/faerie-fire.png
+                [/effect]
+            [/object]
+        [/event]
+        [event]
+            name=unconsider attack
+            first_time_only=no
+            [filter_second]
+                type=Orcish Warlord
+            [/filter_second]
+            [object]
+                name= _ "Anti-Warlord Weaponry deactivated."
+                [filter]
+                    x,y=$x1,$y1
+                [/filter]
+                [effect]
+                    apply_to=remove_attacks
+                    name=anti-warlord
+                [/effect]
+            [/object]
+        [/event]
+        [event]
+            name=attack_end
+            first_time_only=no
+            [filter_second]
+                type=Orcish Warlord
+            [/filter_second]
+            [object]
+                name= _ "Anti-Warlord Weaponry deactivated."
+                [filter]
+                    x,y=$x1,$y1
+                [/filter]
+                [effect]
+                    apply_to=remove_attacks
+                    name=anti-warlord
+                [/effect]
+            [/object]
+        [/event]
     [/event]
 
     [label]

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=29921&r1=29920&r2=29921&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Mon Oct  6 12:15:23 2008
@@ -580,6 +580,7 @@
        std::vector<std::string> items;
 
        std::vector<battle_context> bc_vector;
+       game_events::fire("consider attack", attacker_loc, defender_loc);
        unsigned int i, best = 0;
        for (i = 0; i < attacker->second.attacks().size(); i++) {
                // skip weapons with attack_weight=0
@@ -697,6 +698,7 @@
 
                return true;
        } else {
+               game_events::fire("unconsider attack", attacker_loc, 
defender_loc);
                return false;
        }
 }


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

Reply via email to