Author: cycholka
Date: Fri Jun 13 11:47:07 2008
New Revision: 27145

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27145&view=rev
Log:
separate [swarm] special to it's own entity. create [attacks] special as 
currently described in the wiki. adapt WEAPON_SPECIAL_SWARM macro to the 
changes.

Modified:
    trunk/data/core/macros/abilities.cfg
    trunk/src/actions.cpp

Modified: trunk/data/core/macros/abilities.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/abilities.cfg?rev=27145&r1=27144&r2=27145&view=diff
==============================================================================
--- trunk/data/core/macros/abilities.cfg (original)
+++ trunk/data/core/macros/abilities.cfg Fri Jun 13 11:47:07 2008
@@ -625,12 +625,12 @@
 #define WEAPON_SPECIAL_SWARM
     # Canned definition of the Swarm ability to be included in a
     # [specials] clause.
-    [attacks]
+    [swarm]
         id=swarm
         name= _ "swarm"
         description= _ "Swarm:
 The number of strikes of this attack decreases when the unit is wounded. The 
number of strikes is proportional to the % of HP/maximum HP the unit has. For 
example a unit with 3/4 of its maximum HP will get 3/4 of the number of 
strikes."
-    [/attacks]
+    [/swarm]
 #enddef
 
 #define WEAPON_SPECIAL_CHARGE

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=27145&r1=27144&r2=27145&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Fri Jun 13 11:47:07 2008
@@ -687,16 +687,19 @@
                        damage = slow_damage;
 
                // Compute the number of blows and handle swarm.
-               unit_ability_list swarm_specials = 
weapon->get_specials("attacks");
+               unit_ability_list swarm_specials = 
weapon->get_specials("swarm");
 
                if (!swarm_specials.empty()) {
                        swarm = true;
-                       swarm_min = swarm_specials.highest("attacks_min").first;
-                       swarm_max = swarm_specials.highest("attacks_max", 
weapon->num_attacks()).first;
+                       swarm_min = 
swarm_specials.highest("swarm_attacks_min").first;
+                       swarm_max = swarm_specials.highest("swarm_attacks_max", 
weapon->num_attacks()).first;
                        num_blows = swarm_min + (swarm_max - swarm_min) * hp / 
max_hp;
                } else {
                        swarm = false;
                        num_blows = weapon->num_attacks();
+                       unit_ability_list attacks_specials = 
weapon->get_specials("attacks");
+                       unit_abilities::effect 
attacks_effect(attacks_specials,num_blows,backstab_pos);
+                       num_blows = attacks_effect.get_composite_value();
                        swarm_min = num_blows;
                        swarm_max = num_blows;
                }


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

Reply via email to