New Custom Rousing Ability Help

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Barbaros
Posts: 75
Joined: July 17th, 2020, 7:42 pm

New Custom Rousing Ability Help

Post by Barbaros »

I would like to know if there is something wrong with the synthesis of my code, in my tests, it generated doubts if everything was working correctly. Thanks for any guidance.
I program these things to play in campaigns, I had no time to play for a while.
This ability is quite the face of Orcs kkkkkkkk.

What doesn't seem to be working properly, after further testing, is the experience boost.

I would like to know if I have to use some kind of formula in the event.

PS: I made it easier to read.

Code: Select all

#define ABILITY_ROUSING
    [dummy]
        id=rousing
        name= _ "rousing"
        description="This unit incites your lower level allies to fight like savages, increasing the strength of their physical attacks, and decreasing their physical defenses. (8% ATK and -8% DEF times the difference in levels respectively.) Units affected by this ability gain 50% more experience for battling."
    [/dummy] # wmlxgettext: [abilities]
[/abilities]

    [resistance]
        id=rouse_P1
        sub={VALUE}
        max_value=40
        apply_to=blade,pierce,impact
        affect_self=no
        affect_allies=yes
        affect_enemies=no
            [affect_adjacent]
                adjacent=n,ne,se,s,sw,nw
            [/affect_adjacent]
            [filter_base_value]
                greater_than=-30
            [/filter_base_value]
    [/resistance]

    [leadership]
        id=rouse_P2
        value="(8 * (level - other.level))"
        apply_to=blade,pierce,impact
        cumulative=no
        affect_self=no
            [affect_adjacent]
                [filter]
                    formula="level < other.level"
                [/filter]
            [/affect_adjacent]
    [/leadership]

    [event]
        name=attack_end
        id=rouse_P3
            [filter]
                [filter_adjacent]
                    ability=ABILITY_ROUSING
                    is_enemy=false
                [/filter_adjacent]
            [/filter]
            [set_variable]
                name=unit.experience
                add=50%
            [/set_variable]
            [unstore_unit]
                variable=unit
                text=_ "+50% xp"
                red,green,blue=0,200,255
            [/unstore_unit]
        first_time_only=no
    [/event]

    [event]
        name=attack_end
        id=rouse_P4
            [filter_second]
                [filter_adjacent]
                    ability=ABILITY_ROUSING
                    is_enemy=false
                [/filter_adjacent]
            [/filter_second]
            [set_variable]
                name=second_unit.experience
                add=50%
            [/set_variable]
            [unstore_unit]
                variable=second_unit
                text=_ "+50% xp"
                red,green,blue=0,200,255
            [/unstore_unit]
        first_time_only=no
    [/event]
#enddef
If from 15 to 30 years old, you have not been successful in life, you are already doomed.
User avatar
Ravana
Forum Moderator
Posts: 2934
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: New Custom Rousing Ability Help

Post by Ravana »

You might need to store xp before and after fight in order to see how much it changed and then add 50% of that.
User avatar
Barbaros
Posts: 75
Joined: July 17th, 2020, 7:42 pm

Re: New Custom Rousing Ability Help

Post by Barbaros »

Ravana wrote: June 7th, 2021, 8:50 pm You might need to store xp before and after fight in order to see how much it changed and then add 50% of that.
I could give you a little example, of how I do this, I try harder, I'm a bit limited.
PS: That wouldn't happen if I were from the exact sciences, but unfortunately I'm from the humanities.
If from 15 to 30 years old, you have not been successful in life, you are already doomed.
User avatar
Barbaros
Posts: 75
Joined: July 17th, 2020, 7:42 pm

Re: New Custom Rousing Ability Help

Post by Barbaros »

It may seem like I already have a good knowledge of WML, but it's a big mistake kkkkkkkk :lol:
If from 15 to 30 years old, you have not been successful in life, you are already doomed.
User avatar
Ravana
Forum Moderator
Posts: 2934
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: New Custom Rousing Ability Help

Post by Ravana »

https://github.com/ProditorMagnus/Agele ... _tutor.cfg shows how to give additional fight xp. For kills you would need additional logic.
Post Reply