Template:BonusDef: 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 63: | Line 63: | ||
** Law-level bonuses use <code>receivers</code>, <code>receiver_allegiance</code>, <code>action_area</code>, <code>fraction</code>. They never use <code>activation_level</code>, <code>upgrade_*</code>, <code>battle_type</code>, or <code>receiver_role</code>. | ** Law-level bonuses use <code>receivers</code>, <code>receiver_allegiance</code>, <code>action_area</code>, <code>fraction</code>. They never use <code>activation_level</code>, <code>upgrade_*</code>, <code>battle_type</code>, or <code>receiver_role</code>. | ||
* '''<code>action_area</code>''' (law-bonus only so far) — qualifier for which side a <code>barrackUpgradeUnitsHiring</code> etc. effect applies to. Values observed: <code>allied</code>. | * '''<code>action_area</code>''' (law-bonus only so far) — qualifier for which side a <code>barrackUpgradeUnitsHiring</code> etc. effect applies to. Values observed: <code>allied</code>. | ||
'' '' | * '''<code>fraction</code>''' (law-bonus only so far) — target faction filter for a bonus restricted to a single faction. Column name preserves the source JSON's misspelling (<code>fraction</code> ↔ canonical English "faction") for traceability with the raw data. | ||
[[Category:Cargo Definitions]] | [[Category:Cargo Definitions]] | ||
Revision as of 00:31, 13 May 2026
A unified Cargo table for bonus effects across multiple parent entity types. Per D-031: hero specializations, hero sub-classes, artifacts, item-set tiers, and faction laws all carry the same
(type, parameters, [activationLevel], [upgrade], [receivers], …)
source pattern, so they share one Bonus table with parent_type +
parent_id discriminator columns instead of separate <Entity>Bonus
tables.
The bot emits each row inline on the parent entity's wiki page. There are no individual Data:Bonus/… pages.
Schema
This template defines the table "Bonus". View table.
{{BonusDef
| parent_type = String <!-- hero_specialization, hero_sub_class, artifact, item_set_tier, law_level -->
| parent_id = String <!-- the parent entity's id -->
| ordinal = Integer <!-- 0-based position in the source bonuses[] -->
| type = String <!-- bonus effect category (~30 distinct values once laws added) -->
| parameters = List (,) of String <!-- effect arguments; meaning depends on type -->
<!-- Sparse fields (omitted unless populated in source) -->
| activation_level = Integer
| upgrade_increment = Float
| upgrade_level_step = Integer
| receivers = List (,) of String
| battle_type = String
| receiver_role = String
| receiver_allegiance = String
| action_area = String <!-- e.g. allied; law-bonus extension -->
| fraction = String <!-- target faction filter; law-bonus extension -->
}}
Field notes
- Primary key is
(parent_type, parent_id, ordinal). parent_typeidentifies the parent entity table:hero_specialization— joined toHeroSpecialization.idhero_sub_class— joined toHeroSubClass.idartifact— joined toArtifact.iditem_set_tier— joined toItemSetTier.idlaw_level— joined toLawLevelDefonparent_id = law_id || '_L' || levelAdd new values as new bonus-bearing entities come online.
typeis the effect category. ~13 distinct values across the 2026-05-03 corpus, withheroStat(~895),unitStat(~330),heroBattleAbility(~235) the most common. Artifacts add a few new ones (heroMagicAdditionfor spell scrolls,heroTemporallyActiveSubSkills).parametersis comma-joined, type-dependent. Same encoding as the original *Bonus tables. Wiki side parses bytype.- Sparse fields vary by parent type:
- Spec bonuses use the full schema.
- Sub-class bonuses don't carry
activation_level,upgrade_*,battle_type, orreceiver_rolein the 2026-05-03 corpus. - Artifact bonuses use most fields except
battle_typeandreceiver_role. - Law-level bonuses use
receivers,receiver_allegiance,action_area,fraction. They never useactivation_level,upgrade_*,battle_type, orreceiver_role.
action_area(law-bonus only so far) — qualifier for which side abarrackUpgradeUnitsHiringetc. effect applies to. Values observed:allied.fraction(law-bonus only so far) — target faction filter for a bonus restricted to a single faction. Column name preserves the source JSON's misspelling (fraction↔ canonical English "faction") for traceability with the raw data.


