Template:HeroSpecializationDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
 
obelisk-bot: uploading initial Cargo templates
Line 3: Line 3:


The specialization carries identity (name, desc, icon) plus a list of structured <code>bonuses[]</code> effects that compose the spec's mechanical impact. Bonuses are emitted as inline
The specialization carries identity (name, desc, icon) plus a list of structured <code>bonuses[]</code> effects that compose the spec's mechanical impact. Bonuses are emitted as inline
<code>{{HeroSpecializationBonus}}</code> rows on the same wiki page.
<code><nowiki>{{HeroSpecializationBonus}}</nowiki></code> rows on the same wiki page.


== Page layout ==
== Page layout ==
<code>Data:HeroSpecialization/<id></code> carries:
<code>Data:HeroSpecialization/<id></code> carries:


# <code>{{HeroSpecializationDef | id=… | name=… | desc=… | icon=… | …}}</code>
# <code><nowiki>{{HeroSpecializationDef | id=… | name=… | desc=… | icon=… | …}}</nowiki></code>
# <code>{{TranslationDef | type=hero_specialization | target_id=<id> | …}}</code>
# <code><nowiki>{{TranslationDef | type=hero_specialization | target_id=<id> | …}}</nowiki></code>
# N × <code>{{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}}</code> (1367 total bonus rows across all 126 specs)
# N × <code><nowiki>{{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}}</nowiki></code> (1367 total bonus rows across all 126 specs)


== Schema ==
== Schema ==
Line 16: Line 16:
| id = String
| id = String
| name = String
| name = String
| desc = Wikitext
| description = Wikitext
| name_sid = String
| name_sid = String
| desc_sid = String
| desc_sid = String
Line 27: Line 27:
| id = String
| id = String
| name = String
| name = String
| desc = Wikitext
| description = Wikitext
| name_sid = String
| name_sid = String
| desc_sid = String
| desc_sid = String
Line 38: Line 38:
* '''<code>id</code>''' is the source JSON id (e.g. <code>human_hero_1_specialization</code>, <code>campaign_hero_4_specialization</code>). The <code>_specialization</code> suffix is preserved.
* '''<code>id</code>''' is the source JSON id (e.g. <code>human_hero_1_specialization</code>, <code>campaign_hero_4_specialization</code>). The <code>_specialization</code> suffix is preserved.
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries (e.g. <code>human_hero_1_spec_name</code> / <code>human_hero_1_spec_description</code>). Description text is heavy with <code>{0}</code>/<code>{1}</code> placeholders for stat values; the resolver substitutes via the standard pipeline before storing.
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries (e.g. <code>human_hero_1_spec_name</code> / <code>human_hero_1_spec_description</code>). Description text is heavy with <code>{0}</code>/<code>{1}</code> placeholders for stat values; the resolver substitutes via the standard pipeline before storing.
* '''<code>name</code> / <code>desc</code>''' carry the resolved English text inline. Translations live on the <code>{{TranslationDef | type=hero_specialization}}</code> row.
* '''<code>name</code> / <code>desc</code>''' carry the resolved English text inline. Translations live on the <code><nowiki>{{TranslationDef | type=hero_specialization}}</nowiki></code> row.
* '''No <code>hero_id</code> back-reference.''' The Hero → HeroSpecialization direction is sufficient (forward join via <code>Hero.specialization_id = HeroSpecialization.id</code>). Reverse queries — "which hero has this spec" — work via the same join. Per D-028.
* '''No <code>hero_id</code> back-reference.''' The Hero → HeroSpecialization direction is sufficient (forward join via <code>Hero.specialization_id = HeroSpecialization.id</code>). Reverse queries — "which hero has this spec" — work via the same join. Per D-028.


Line 52: Line 52:
| id = {{{id|}}}
| id = {{{id|}}}
| name = {{{name|}}}
| name = {{{name|}}}
| desc = {{{desc|}}}
| description = {{{description|}}}
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}

Revision as of 00:02, 13 May 2026

One row per hero specialization (126 in the 2026-05-03 corpus: 108 faction + 9 campaign + 5 tutorial + 4 test). Each spec is the unique passive that distinguishes one hero mechanically — every Hero record carries specialization_id pointing at one of these.

The specialization carries identity (name, desc, icon) plus a list of structured bonuses[] effects that compose the spec's mechanical impact. Bonuses are emitted as inline {{HeroSpecializationBonus}} rows on the same wiki page.

Page layout

Data:HeroSpecialization/<id> carries:

  1. {{HeroSpecializationDef | id=… | name=… | desc=… | icon=… | …}}
  2. {{TranslationDef | type=hero_specialization | target_id=<id> | …}}
  3. N × {{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}} (1367 total bonus rows across all 126 specs)

Schema

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

{{HeroSpecializationDef
| id = String
| name = String
| description = Wikitext
| name_sid = String
| desc_sid = String
| icon = String
| source_path = String
}}

Field notes

  • id is the source JSON id (e.g. human_hero_1_specialization, campaign_hero_4_specialization). The _specialization suffix is preserved.
  • name_sid / desc_sid point at the L10n entries (e.g. human_hero_1_spec_name / human_hero_1_spec_description). Description text is heavy with {0}/{1} placeholders for stat values; the resolver substitutes via the standard pipeline before storing.
  • name / desc carry the resolved English text inline. Translations live on the {{TranslationDef | type=hero_specialization}} row.
  • No hero_id back-reference. The Hero → HeroSpecialization direction is sufficient (forward join via Hero.specialization_id = HeroSpecialization.id). Reverse queries — "which hero has this spec" — work via the same join. Per D-028.

Related tables

  • Hero — joined on id = Hero.specialization_id (1:1 in practice; the schema permits N:1 in case a future patch shares specs across heroes).
  • HeroSpecializationBonus — joined on id = spec_id (1:N).
  • TranslationDef — one row per spec with type=hero_specialization, target_id=id.

Notes