Unique charge abilities? E. g. 3x per scenario

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
shevegen
Posts: 429
Joined: June 3rd, 2004, 4:35 pm

Unique charge abilities? E. g. 3x per scenario

Post by shevegen »

In the campaign that I will create eventually, in one scenario I need to introduce
a "hero" (NPC). This one will be a lancer rider with better stats.

But I would also like to use special abilities, such as power charge 3x per scenario.

Most abilities I found in add-ons were how you could select or pick a tree for
it, and then just use that passively most of the time. But I'd need it to be
an active charge-able ability so that the player can decide when to use it,
e. g. it will do even more damage than normal but perhaps exhaust the
mount a bit (reduced movement for 3 turns after that or something like
it).

My question now is: does anyone have an example to study for a charge
ability that has only n times uses available? Or is there some code snippet
somewhere? I wanted to ask before I invest too much time into reinventing
the wheel here. (I also bookmarked this so I don't forget to re-visit at a
later time; I put these links into the blue print I am currently writing
to specify more details in regards to the whole campaign.)
User avatar
Ravana
Forum Moderator
Posts: 2545
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Unique charge abilities? E. g. 3x per scenario

Post by Ravana »

Unity magic has something like that.
newfrenchy83
Code Contributor
Posts: 99
Joined: October 6th, 2017, 12:57 pm

Re: Unique charge abilities? E. g. 3x per scenario

Post by newfrenchy83 »

you could use implement this in your unit_type

Code: Select all

		[specials]
                        [damage]
                            id=charge_limited
                            apply_to=opponent
                            cumulative=no
                            multiply=3
                            [filter_self]
                                [filter_wml]
                                [not]
                                    [variables]
                                        charge_remain=0
                                    [/variables]
                                     [/not]
                                [/filter_wml]
                            [/filter_self]
                        [/damage]
                    [/specials]
and pull this code in [campaign]

Code: Select all

[event]
name=prestart
first_time_only=yes
{VARIABLE charge_remain 3}
[/event]
[event]
name=attack end
first_time_only=no
[filter_condition]
    [variable]
        name=charge_remain
        numerical_not_equals=0
    [/variable]
 [/filter_condition]
[filter_attack]
special_id=charge_limited
[/filter_attack]
[set_variable]
        name=charge_remain
        sub=1
    [/set_variable]
  [/event]
    
Post Reply