wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.31k stars 994 forks source link

Single-unit attribute to prevent dismissing from recall list #8964

Open MadMax3947 opened 3 weeks ago

MadMax3947 commented 3 weeks ago

Describe the desired feature

Would be very helpful to have a [unit] key that prevents the player from dismissing the unit from the recall list.

[unit]
   id=Generic_Hero
   name= _ "Generic Hero"
   x,y=recall,recall
   type=Hero
   side=1
   block_dismiss=yes
[/unit]

Dismiss button would then be grayed out when unit is selected in the recall list.

stevecotton commented 2 weeks ago

I suggest making it a string, which can be shown if the player tries to dismiss them., Later in the campaign it could be set to the empty string to allow the player to dismiss the unit.

block_dismiss=_ "Only Sir Generic will be able to recognise the pirate captain"

MadMax3947 commented 2 weeks ago

What about both? Would also allow for situations where you want to give the player a warning message before dismissing the unit (despite unit's level or whether it's loyal). Situations like this:

[unit]
   id=Apprentice
   name= _ "Apprentice Mage"
   level=0
   block_dismiss=no # default
   dismiss_prompt= _ "This apprentice represents the future of the Academy! Do you really want to dismiss him?"
[/unit]

as well as:

[unit]
   id=Pirate
   name= _ "Powder Boy"
   level=0
   block_dismiss=yes
   dismiss_prompt= _ "Only Sir Generic will be able to recognize the pirate captain!"
[/unit]