[solved] weapon specials inside [abilities]

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
white_haired_uncle
Posts: 1288
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

[solved] weapon specials inside [abilities]

Post by white_haired_uncle »

https://wiki.wesnoth.org/AbilitiesWML
(Version 1.15.0 and later only) All weapon specials except for [plague], [heal_on_hit], and [swarm] can be placed in the [abilities] tag. These "weapon specials as abilities" will give that weapon special to all attacks the unit has if matches with [filter_student/opponent/etc][filter_weapon].
Cool, but how? I'm guessing that the wiki omitted mentioning the [specials] tag, and I want something like this?

Code: Select all

[abilities]
        [dummy]
#textdomain wesnoth-loti
                description=_"When this unit kills a certain amount of beings, it obtains special advancements."
                female_name=_"female^soul eater"
                id="soul eater"
                name=_"soul eater"
        [/dummy]
        [regenerate]  
                affect_self=yes
#textdomain wesnoth-help
                description=_"The unit will heal itself 8 HP per turn. If it is poisoned, it will remove the poison instead of healing."
                female_name=_"female^regenerates"
                id="regenerates"
                name=_"regenerates"
                poison="cured"
                special_note=_"This unit regenerates, which allows it to heal as though always stationed in a village."
                value=8  
        [/regenerate]
        [specials]
                [damage]
                        add=0
                        apply_to="self"
                        id="latent_wrath"
                [/damage]
        [/specials]
[/abilities]
Or if the wiki is more correct than I'm giving it credit for, would it just be:

Code: Select all

[abilities]
        [dummy]
#textdomain wesnoth-loti
                description=_"When this unit kills a certain amount of beings, it obtains special advancements."
                female_name=_"female^soul eater"
                id="soul eater"
                name=_"soul eater"
        [/dummy]
        [regenerate]  
                affect_self=yes
#textdomain wesnoth-help
                description=_"The unit will heal itself 8 HP per turn. If it is poisoned, it will remove the poison instead of healing."
                female_name=_"female^regenerates"
                id="regenerates"
                name=_"regenerates"
                poison="cured"
                special_note=_"This unit regenerates, which allows it to heal as though always stationed in a village."
                value=8  
        [/regenerate]

                [damage]
                        add=0
                        apply_to="self"
                        id="latent_wrath"
                [/damage]

[/abilities]
Last edited by white_haired_uncle on May 10th, 2024, 12:21 am, edited 1 time in total.
Speak softly, and carry Doombringer.
User avatar
Celtic_Minstrel
Developer
Posts: 2274
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: weapon specials inside [abilities]

Post by Celtic_Minstrel »

The second one.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
white_haired_uncle
Posts: 1288
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: weapon specials inside [abilities]

Post by white_haired_uncle »

Thank you. I've got a bunch of events to adjust that are non-trivial to test, so I wanted to make sure I was starting off on the right foot.
Speak softly, and carry Doombringer.
white_haired_uncle
Posts: 1288
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: [solved] weapon specials inside [abilities]

Post by white_haired_uncle »

Any idea what would happen in the case where you had the same special (same id) at both the weapon and ability level? I'm looking at moving from having the special on every weapon to putting it in abilities so it could happen when loading an old save.

Like:

Code: Select all

 [abilities]
                [damage]
                        add=10
                        apply_to="self"
                        id="latent_wrath"
                [/damage]
[/abilities]

[attack]
...
       [specials]
                [damage]
                        add=4
                        apply_to="self"
                        id="latent_wrath"
                [/damage]
        [/specials]
[attack]
Speak softly, and carry Doombringer.
User avatar
Celtic_Minstrel
Developer
Posts: 2274
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: [solved] weapon specials inside [abilities]

Post by Celtic_Minstrel »

Sorry, I'm not sure. It might interact and cancel out because they have the same ID, but I can't be sure.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Ravana
Forum Moderator
Posts: 3070
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: [solved] weapon specials inside [abilities]

Post by Ravana »

id probably means it wont give you 14 damage.
Post Reply