Author: espreon
Date: Tue Mar  8 01:22:02 2011
New Revision: 48824

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48824&view=rev
Log:
Applied patch #1883 with slight modifications.

Modified:
    trunk/changelog
    trunk/data/campaigns/An_Orcish_Incursion/scenarios/03_Wasteland.cfg
    trunk/data/campaigns/Delfadors_Memoirs/scenarios/06_Swamps_of_Illuven.cfg
    trunk/data/campaigns/tutorial/scenarios/2_Tutorial.cfg
    trunk/data/core/macros/items.cfg
    trunk/data/lua/wml-tags.lua

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar  8 01:22:02 2011
@@ -57,6 +57,8 @@
    * Added TAKE_IT_STRING and LEAVE_IT_STRING arguments to PICKUPPABLE_ITEM
    * The tags [remove_shroud] and [place_shroud] now take comma-separated 
lists of sides.
      They default to affecting all sides now if no side is set.
+   * The [gold] tag now takes a comma-separated list of sides, and defaults to
+     giving gold to all sides, rather than just one.
  * Miscellaneous and bugfixes:
    * Fixed: g++ compiler warnings.
    * Added: cmake target to build the gui design pdf.

Modified: trunk/data/campaigns/An_Orcish_Incursion/scenarios/03_Wasteland.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/An_Orcish_Incursion/scenarios/03_Wasteland.cfg?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/data/campaigns/An_Orcish_Incursion/scenarios/03_Wasteland.cfg 
(original)
+++ trunk/data/campaigns/An_Orcish_Incursion/scenarios/03_Wasteland.cfg Tue Mar 
 8 01:22:02 2011
@@ -287,6 +287,7 @@
             [/variable]
             [then]
                 [gold]
+                    side=1
                     amount=$camp_gold
                 [/gold]
             [/then]

Modified: 
trunk/data/campaigns/Delfadors_Memoirs/scenarios/06_Swamps_of_Illuven.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Delfadors_Memoirs/scenarios/06_Swamps_of_Illuven.cfg?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/data/campaigns/Delfadors_Memoirs/scenarios/06_Swamps_of_Illuven.cfg 
(original)
+++ trunk/data/campaigns/Delfadors_Memoirs/scenarios/06_Swamps_of_Illuven.cfg 
Tue Mar  8 01:22:02 2011
@@ -210,6 +210,7 @@
                         [/sound]
                         #TODO add the gold sound effect
                         [gold]
+                            side=1
                             amount=100
                         [/gold]
                         [message]

Modified: trunk/data/campaigns/tutorial/scenarios/2_Tutorial.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/tutorial/scenarios/2_Tutorial.cfg?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/data/campaigns/tutorial/scenarios/2_Tutorial.cfg (original)
+++ trunk/data/campaigns/tutorial/scenarios/2_Tutorial.cfg Tue Mar  8 01:22:02 
2011
@@ -50,6 +50,7 @@
         [/variable]
         [then]
             [gold]
+                side=1
                 amount=20
             [/gold]
             # put the unit back into the recall list
@@ -119,6 +120,7 @@
         [else]
             # simply use cost to return
             [gold]
+                side=1
                 amount=$recruit.cost
             [/gold]
         [/else]

Modified: trunk/data/core/macros/items.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/items.cfg?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/data/core/macros/items.cfg (original)
+++ trunk/data/core/macros/items.cfg Tue Mar  8 01:22:02 2011
@@ -39,6 +39,7 @@
                 message= _ "Lots of gold"
                 [command]
                     [gold]
+                        side=$side_number
                         amount=-1
                     [/gold]
                     [message]
@@ -52,6 +53,7 @@
                 message= _ "Peace throughout Wesnoth."
                 [command]
                     [gold]
+                        side=$side_number
                         amount=-1
                     [/gold]
                     [message]

Modified: trunk/data/lua/wml-tags.lua
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/lua/wml-tags.lua?rev=48824&r1=48823&r2=48824&view=diff
==============================================================================
--- trunk/data/lua/wml-tags.lua (original)
+++ trunk/data/lua/wml-tags.lua Tue Mar  8 01:22:02 2011
@@ -71,10 +71,18 @@
 end
 
 function wml_actions.gold(cfg)
-       local team = get_team(cfg.side, "[gold]")
+       local side_list = cfg.side
        local amount = tonumber(cfg.amount) or
                helper.wml_error "[gold] missing required amount= attribute."
-       team.gold = team.gold + amount
+       if side_list == nil then
+               for side in helper.all_teams() do side.gold = side.gold + 
amount end
+       else
+               side_list = side_list .. ","
+               for v in string.gmatch(side_list, "(%w+),") do
+                       local side = wesnoth.get_side(tonumber(v))
+                       side.gold = side.gold + amount
+               end
+       end
 end
 
 function wml_actions.store_gold(cfg)


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

Reply via email to