[engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
-
- Code Contributor
- Posts: 179
- Joined: October 6th, 2017, 12:57 pm
[engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability
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.
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.
Re: [engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability
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 thenewfrenchy83 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.
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.
-
- Code Contributor
- Posts: 179
- Joined: October 6th, 2017, 12:57 pm
Re: [engine] Add "attack_alignment" weapon special for specific attacks and [unit_alignment] ability
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].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.
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
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