[engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

[engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability

Post by newfrenchy83 »

I'm opening this thread to suggest adding the [attack_alignment] ability/weapon and the [unit_aligment] ability to the game, and I've already posted an in git request at https://github.com/wesnoth/wesnoth/pull/6968.

I believe that while in general it is consistent for a unit's alignment to apply to all its attacks, it can happen that a unit has an attack whose characteristics are at odds with the alignment, and in this case either the idea is abandoned, or we use [damage] to partially imitate an alignment (Efraim de Celse at the beginning of Legend of the Invincible) but in the latter case; when the lighting/darkening conditions have values different from the standard (deep underground or illumination greater than 25%) [damage] then finds its limit by imposing a fixed value under such a condition.

There are two instances in mainline where [attack_alignment] can be used, the Rod of Fire in several campaigns and the Rod of Justice in Northern Rebirth, both of these artifacts have such magical power that a warrior's alignment not mastering the magic should not (in my opinion) affect their potency. Besides, it seems that this is the opinion of the developers of Heir to the Throne since when Konrad seizes the artefact, its attack power is adjusted so that at equal level, it is identical at night to that which Li'sar who is neutral would possess.

If [attack_alignment] could be used in leadership for precise attacks, [unit_alignment] can change the alignment of the unit in the wml filtering and the user interface, however I admit to missing a concrete example for this last case.

I therefore invite you to discuss whether or not to add this special weapon. Go to github instead to discuss encoding.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: [engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability

Post by gfgtdf »

newfrenchy83 wrote: March 15th, 2023, 1:57 pm but in the latter case; when the lighting/darkening conditions have values different from the standard (deep underground or illumination greater than 25%) [damage] then finds its limit by imposing a fixed value under such a condition.
If this is the only problem i think we can probably easily add a forumla function to calculate the correct alignment bonus, for example by allowing to pass an alignment string (instead of a unit) as the first parameter to the timeofday_modifier function.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: [engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability

Post by newfrenchy83 »

gfgtdf wrote;
If this is the only problem i think we can probably easily add a forumla function to calculate the correct alignment bonus, for example by allowing to pass an alignment string (instead of a unit) as the first parameter to the timeofday_modifier function.
That's not the only problem, and placing alignment string as a parameter of the timeofday function is what [attack_alignment] does without purposely raising a special [damage].
such special can be write like this::

Code: Select all

#define WEAPON_SPECIAL_NEUTRAL
    [attack_alignment]
        id=neutral
        name= _ "neutral"
        description= _ "This attack inflict same damage regardless of time of day."
        alignment=neutral
    [/attack_alignment]
#enddef
The other reason, in addition to giving a special where you just have to specify the alignment without having to complicate the code for [damage] to add this attribute, is the possibility of customizing the alignments ([attack_alignment] only) as per example decrease the "day/night" influence on high level warriors by dividing the value of tod_bonus without making them perfect neutrals, or conversely increase it in completely novice fighters (level 0), such an operation must be done after tod_bonus is calculated and base damage(with [damage] ) is calculated before.

Code: Select all

#define WEAPON_SPECIAL_SEMI_LAWFUL
    [attack_alignment]
        id=semi_lawful
        name= _ "semi lawful"
        description= _ "This attack is 12% better at day and 12% worse at night."
        alignment=lawful
        divide=2
    [/attack_alignment]
#enddef
Post Reply