Template:AttackPassiveDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
obelisk-bot: Pushing translation table rework
 
Line 13: Line 13:
| name_sid = String
| name_sid = String
| desc_sid = String
| desc_sid = String
| display_name = String
| description = Wikitext
}}
}}


Line 22: Line 20:
| pattern_token = String (allowed values=swipe,swirl,reach,rumble,tri_reach)
| pattern_token = String (allowed values=swipe,swirl,reach,rumble,tri_reach)
| rank = Integer                                            <!-- 1 = no falloff; 2 = -X% to additional targets -->
| rank = Integer                                            <!-- 1 = no falloff; 2 = -X% to additional targets -->
<!-- Localization references — display text lives in the Translation table, type='attack_passive' -->
| name_sid = String                                        <!-- base_passive_strike_<token>_<rank>_name -->
| name_sid = String                                        <!-- base_passive_strike_<token>_<rank>_name -->
| desc_sid = String
| desc_sid = String
| display_name = String
| description = Wikitext
}}
}}
</nowiki></pre>
</nowiki></pre>
Line 33: Line 30:
* '''<code>pattern_token</code>''' is the L10n SID's family token. Drives the <code>name_sid</code> / <code>desc_sid</code> derivation. Five canonical families.
* '''<code>pattern_token</code>''' is the L10n SID's family token. Drives the <code>name_sid</code> / <code>desc_sid</code> derivation. Five canonical families.
* '''<code>rank</code>''' distinguishes the falloff variant. Rank 1 = full damage to all hexes; rank 2 = additional targets take <code>–{0}%</code> damage (the percentage is unit-level — the <code>{0}</code> placeholder gets resolved per unit via <code>data.stats</code> blocks if present).
* '''<code>rank</code>''' distinguishes the falloff variant. Rank 1 = full damage to all hexes; rank 2 = additional targets take <code>–{0}%</code> damage (the percentage is unit-level — the <code>{0}</code> placeholder gets resolved per unit via <code>data.stats</code> blocks if present).
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at L10n entries. The translation table joins on these.
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at L10n entries, surfaced for traceability. Display name / description for every language (English included) live in the [[Template:TranslationDef|Translation]] table, <code>type='attack_passive'</code>.
* '''<code>display_name</code>''' / '''<code>description</code>''' are the resolved English defaults that render directly on the wiki without a join lookup.


== Canonical row contents ==
== Canonical row contents ==
{| class="wikitable"
{| class="wikitable"
! <code>attack_passive_id</code> !! <code>pattern_token</code> !! <code>rank</code> !! <code>display_name</code> !! engine pattern_sid(s)
! <code>attack_passive_id</code> !! <code>pattern_token</code> !! <code>rank</code> !! display name (en) !! engine pattern_sid(s)
|-
|-
| <code>sweeping_strike</code> || swipe || 1 || Sweeping Strike || <code>attack_swipe_x100_x100</code>
| <code>sweeping_strike</code> || swipe || 1 || Sweeping Strike || <code>attack_swipe_x100_x100</code>
Line 69: Line 65:
== Related tables ==
== Related tables ==
* [[../UnitAttack|<code>UnitAttackDef</code>]] — references via <code>default_passive</code>, <code>counter_passive</code>, <code>alt_passive</code>, <code>alt2_passive</code> (N:1 each).
* [[../UnitAttack|<code>UnitAttackDef</code>]] — references via <code>default_passive</code>, <code>counter_passive</code>, <code>alt_passive</code>, <code>alt2_passive</code> (N:1 each).
* [[AttackPassiveTranslation]] — joined on <code>attack_passive_id</code> (1:1).
* [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>attack_passive_id = Translation.target_id WHERE Translation.type='attack_passive' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language).


[[Category:Cargo Definitions]]
[[Category:Cargo Definitions]]
Line 78: Line 74:
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}
| display_name = {{{display_name|}}}
| description = {{{description|}}}
}}
}}
Created <code>AttackPassive</code> entry: <code>{{{attack_passive_id|}}}</code></includeonly>
Created <code>AttackPassive</code> entry: <code>{{{attack_passive_id|}}}</code></includeonly>

Latest revision as of 20:47, 14 May 2026

Shared reference table for named attack-pattern passives — the side-effects-of-default-attack abilities that show up in unit tooltips as passives (e.g. Hydra has "Sweeping Strike" inherent to its standard melee attack). One row per (pattern_token, rank) pair; ~9 rows total.

The bot does not maintain rows here directly; this is hand-curated reference data the wiki ships pre-populated. UnitAttackDef slots reference the attack_passive_id enum; the wiki layer joins to render the player-facing name and description.

Why this is shared, not per-unit: every Hydra / Lich Dragon / Sweeping-pattern user sees the same Sweeping Strike text. Storing it once and referencing it by id (instead of inlining the text on each unit page) cuts duplicate spam from i18n storage and lets editors fix typos in one place.

Schema

This template defines the table "AttackPassive". View table.

{{AttackPassiveDef
| attack_passive_id = String                                <!-- enum value referenced by UnitAttack slots -->
| pattern_token = String (allowed values=swipe,swirl,reach,rumble,tri_reach)
| rank = Integer                                            <!-- 1 = no falloff; 2 = -X% to additional targets -->
<!-- Localization references — display text lives in the Translation table, type='attack_passive' -->
| name_sid = String                                         <!-- base_passive_strike_<token>_<rank>_name -->
| desc_sid = String
}}

Field notes

  • attack_passive_id is the primary key and the value UnitAttackDef rows reference (default_passive, counter_passive, alt_passive, alt2_passive). Stable, lowercase, snake_case.
  • pattern_token is the L10n SID's family token. Drives the name_sid / desc_sid derivation. Five canonical families.
  • rank distinguishes the falloff variant. Rank 1 = full damage to all hexes; rank 2 = additional targets take –{0}% damage (the percentage is unit-level — the {0} placeholder gets resolved per unit via data.stats blocks if present).
  • name_sid / desc_sid point at L10n entries, surfaced for traceability. Display name / description for every language (English included) live in the Translation table, type='attack_passive'.

Canonical row contents

attack_passive_id pattern_token rank display name (en) engine pattern_sid(s)
sweeping_strike swipe 1 Sweeping Strike attack_swipe_x100_x100
sweeping_strike_falloff swipe 2 Sweeping Strike (rank-2 swipe; no current units use this)
whirlwind_strike swirl 1 Whirlwind Strike attack_swirl_with_target_x100, attack_swirl_x1_x100
whirlwind_strike_falloff swirl 2 Whirlwind Strike attack_swirl_with_target_x50, attack_swirl_x2_x100
dragonbreath_strike reach 1 Dragonbreath Strike attack_reach_x1_x100_x100_with_delay, attack_reach_x1_x100_x100
dragonbreath_strike_falloff reach 2 Dragonbreath Strike attack_reach_x2_x100_x100_x100_with_delay
area_strike rumble 1 Area Strike attack_rumble_x1_x100, attack_rumble_without_self_x1_x100_x100
area_strike_falloff rumble 2 Area Strike attack_rumble_x1_x100_x50, attack_rumble_without_self_x1_x100_x50, attack_rumble_x2_x100
cone_strike tri_reach 1 Cone Strike attack_swipe_x100_x100_x2, attack_massive_x1_x100_x100_with_dalay

The engine pattern_sid → attack_passive_id mapping lives in extract/_pattern_passive_map.py. Some mappings are non-trivial: attack_massive_*cone_strike is confirmed via Black Dragon's Fighting Style ability text ("Performs a Cone Strike").

Out of scope here

Piercing Strike (base_passive_strike_pierce_<rank>_) is not an attack-pattern passive. It's the player-facing name for the attackPen stat-passive and lives in the existing stat_passive synthesis path, not in AttackPassiveDef.

Related tables

  • [[../UnitAttack|UnitAttackDef]] — references via default_passive, counter_passive, alt_passive, alt2_passive (N:1 each).
  • Translation — display text in every language (English included), joined on attack_passive_id = Translation.target_id WHERE Translation.type='attack_passive' AND Translation.language='en' (1:N, one row per language).