Wesnoth: Display max_attacks in the unit sidebar

Created on 16 Mar 2018  路  8Comments  路  Source: wesnoth/wesnoth

Since 1.13 we have the option to set max_attacks via [effect]. Unfortunately, it is not displayed, if the unit has more than one attack per turn. It might be reasonable to display the number of attacks per turn in the unit sidebar.

Maybe we can get something like "Attacks (2)"
attacks

Enhancement Good first issue Ready for testing UI Units

All 8 comments

Also, the movement_used for an attack might be good to show (if different from the default).

if this doesn'go into 1.14 coud can also do this in an addon by using luas theme_items hook.

I think this actually _can't_ go into 1.14 solely _because_ of the theme_items hook; there might be a way around that, but it's probably easier to just save it for 1.15.

Added:

2019-10-18-020135_173x132_scrot


test case

diff --git a/data/scenario-test.cfg b/data/scenario-test.cfg
index 69185e223c9..7531835e766 100644
--- a/data/scenario-test.cfg
+++ b/data/scenario-test.cfg
@@ -253,27 +253,16 @@ Xu, Xu, Qxu, Qxu, Ql, Ql, Ql, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Gg, Gg, Gg, Gg, Gg
             generate_name=yes
             [modifications]
                 [trait]
-                    id=feral
-                    availability="musthave"
-                    male_name="feral"
-                    female_name="female^feral"
-                    description="Receive at most 40% defense in villages"
-                    [effect]
-                        apply_to=defense
-                        replace=yes
-                        [defense]
-                            village=-60
-                        [/defense]
-                    [/effect]
-                [/trait]
-                [trait]
                     id=overpowered
                     name="overpowered"
                     availability=musthave
                     [effect]
                         apply_to=attack
-                        increase_attacks=1
-                        increase_damage=1
+                        set_movement_used=2
+                    [/effect]
+                    [effect]
+                        apply_to=max_attacks
+                        increase=1
                     [/effect]
                 [/trait]
             [/modifications]
@@ -1565,6 +1554,7 @@ My best advancement costs $next_cost gold and I鈥檓 $experience|% there."
     [event]
         name=start

+        {UNIT 2 (Orcish Grunt) 14 7 ()}
         [gold]
             side=1
             amount=1000

@CelticMinstrel Could you explain why you think this isn't backportable? If someone replaces or wraps wesnoth.theme_items.unit_weapons, then...what?

I think it's not backportable because I expected it would be adding a new element to wesnoth.theme_items... if that's somehow not the case, then maybe it _can_ be backported?

It just adds another line to the existing unit_weapons report: f973919fdcc97d27e669a8e2b5659c1df2913e3f

Yeah okay... in that case, I'd say it's backportable.

Need to backport ad0867fa4206b237b45d4059ac9a74a034859719 too for the #include.

Was this page helpful?
0 / 5 - 0 ratings