patchBattle for Wesnoth - Patches: patch #3234, Start to support to [recall_cost]...

 
 
Show feedback again

patch #3234: Start to support to [recall_cost] key

Submitted by:  None
Submitted on:  Mon 02 Apr 2012 07:50:11 AM UTC  
 
Priority: 1 - LaterStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 22 May 2012 09:20:19 AM UTC, comment #6:

thx for the new patch, i'll try to look at it soonish...

I don't know how to disable a unit in the menu... you might want to ask mordante about that on IRC

does the menu display the unit recall cost ? it will need to do that now that the recall cost changes with evry unit...

Boucman

Anonymous
Tue 22 May 2012 08:00:13 AM UTC, comment #5:

are you still working on this ?

if yes, could you add the check at recall time for gold ? At this point the feature is incomplete since it changes the way gold is handled

the cleanest way to handle this would be to

  • always allow the recall menu to be opened, even with negative gold
  • disable in the menu the units that can't be recalled (greyed out) this way the player can check the available units even when he can't recall them
  • the logic would be to have the recall cost come from the unit_type. I.E it should be a property of the unit type that could be overridden for any given unit. I'm not sure where the concept of team recall cost should fit in there. Probably drop it completely

I hope you are still interested in working on that, if not i'll probably drop the patch

Boucman

Anonymous
Mon 02 Apr 2012 09:56:52 AM UTC, comment #4:

@gabba The only time the recall function checks if there is enough gold to recall it compares it against the team recall cost. If your amount of gold isn't enough to recall then it won't allow you to open the menu.

I changed that to allow you to open the menu if you have at least one coin of gold.

Once the menu is opened there isn't any other check (that I am aware of) comparing the amount of gold and allows you to complete the recall.

Angel <faryshta>
Mon 02 Apr 2012 09:48:30 AM UTC, comment #3:

(This is a patch by a gsoc applicant, Faryshta)

Iurii Chernyi <crab>
Project Member
Mon 02 Apr 2012 08:07:48 AM UTC, comment #2:

Also if "* allows you to open the recall menu if you have one gold
possibly will create a bug allowing recall units
even if you don't have enough gold (in which case will
cause you to have negative gold)" is a bug your modifications introduce, you have to find a way to solve it.

Otherwise please explain in a bit more detail since your description is not entirely clear.

Gabriel Morin <gabba>
Project Member
Mon 02 Apr 2012 08:05:43 AM UTC, comment #1:

As I mentioned on IRC, please submit a unified diff, not whole files.
Please follow instructions here: http://wiki.wesnoth.org/PatchSubmissionGuidelines

Gabriel Morin <gabba>
Project Member
Mon 02 Apr 2012 07:50:11 AM UTC, original submission:

unit.hpp:

  • added function int recall_cost() const
  • added parameter unit_recall_value_

unit.cpp:

  • added function int recall_cost() const
  • added parameter unit_recall_value_
  • constructors fill the unit_recall_value_ on initializers
  • when creating a cfg from a unit it also fills the

[recall_value] key.

menu_events.cpp:
recall:
* allows you to open the recall menu if you have one gold
possibly will create a bug allowing recall units
even if you don't have enough gold (in which case will
cause you to have negative gold)
* asking first if the recalled unit have defined a
recall cost. If not will use the default recall cost.
undo, redo:
* when undo, redo recall ask first if the recalled unit
have defined a recall cost. If not will
use the default recall cost.

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15769:  recall.patch added by faryshta (6kB - text/x-patch - This is the latest patch I think I only shared it on the irc channel. As you can see it does what you say about the unit_type. How do I dissable units from being recalled?)
file #15503:  recall_key.patch added by None (4kB - text/x-patch - The patch file.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by faryshta (Posted a comment)
  • -unavailable- added by crab (Posted a comment)
  • -unavailable- added by gabba (Posted a comment)
  • -unavailable- added by gabba
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 May 2012 09:06:05 AM UTCfaryshtaAttached File-=>Added recall.patch, #15769
    Mon 02 Apr 2012 03:45:22 PM UTCgabbaAttached File#15498=>Removed
    Mon 02 Apr 2012 03:45:18 PM UTCgabbaAttached File#15499=>Removed
    Mon 02 Apr 2012 03:45:12 PM UTCgabbaAttached File#15497=>Removed
    Mon 02 Apr 2012 10:16:17 AM UTCNoneAttached File-=>Added recall_key.patch, #15503
    Mon 02 Apr 2012 07:59:24 AM UTCgabbaCarbon-Copy-=>Added gabba
    Mon 02 Apr 2012 07:50:11 AM UTCNoneAttached File-=>Added unit.hpp, #15497
      Attached File-=>Added menu_events.cpp, #15498
      Attached File-=>Added unit.cpp, #15499
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup