Template:AstrologistEventDef: 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 7: | Line 7: | ||
<code>Data:AstrologistEvent/<id></code> carries: | <code>Data:AstrologistEvent/<id></code> carries: | ||
# <code><nowiki>{{AstrologistEventDef | id=… | category=week|month | # <code><nowiki>{{AstrologistEventDef | id=… | category=week|month | …}}</nowiki></code> | ||
# <code><nowiki>{{TranslationDef | type=astrologist_event | target_id=<id> | …}}</nowiki></code> — name+ | # N × <code><nowiki>{{TranslationDef | type=astrologist_event | target_id=<id> | language=… | …}}</nowiki></code> — name+description, one row per language | ||
== Schema == | == Schema == | ||
| Line 14: | Line 14: | ||
| id = String | | id = String | ||
| category = String | | category = String | ||
| name_sid = String | | name_sid = String | ||
| desc_sid = String | | desc_sid = String | ||
| icon = String | | icon = String | ||
| Line 29: | Line 27: | ||
| id = String | | id = String | ||
| category = String <!-- week | month --> | | category = String <!-- week | month --> | ||
<!-- Localization references — display text lives in the Translation table, type='astrologist_event' --> | |||
| name_sid = String | | name_sid = String | ||
| desc_sid = String <!-- nullable --> | | desc_sid = String <!-- nullable --> | ||
| icon = String <!-- nullable --> | | icon = String <!-- nullable --> | ||
| Line 49: | Line 46: | ||
== Related tables == | == Related tables == | ||
* [[Template:TranslationDef| | * [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>id = Translation.target_id WHERE Translation.type='astrologist_event' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language). | ||
[[Category:Cargo Definitions]] | [[Category:Cargo Definitions]] | ||
| Line 55: | Line 52: | ||
| id = {{{id|}}} | | id = {{{id|}}} | ||
| category = {{{category|}}} | | category = {{{category|}}} | ||
| name_sid = {{{name_sid|}}} | | name_sid = {{{name_sid|}}} | ||
| desc_sid = {{{desc_sid|}}} | | desc_sid = {{{desc_sid|}}} | ||
| icon = {{{icon|}}} | | icon = {{{icon|}}} | ||
Latest revision as of 20:47, 14 May 2026
One row per astrologist event — the periodically-rolled global modifiers the in-game Astrologer announces between weeks and months. 26 entries total in 2026-05-05: 15 weeks (e.g. "Week of Sorcery", "Week of Luck") + 11 months ("Month of the Locust", and so on).
A single discriminator column category separates weeks from months — the source ships them in two parallel files (DB/weeks/weeks.json + DB/weeks/months.json) but the schema is identical, so we collapse to one table.
Page layout
Data:AstrologistEvent/<id> carries:
{{AstrologistEventDef | id=… | category=week|month | …}}- N ×
{{TranslationDef | type=astrologist_event | target_id=<id> | language=… | …}}— name+description, one row per language
Schema
This template defines the table "AstrologistEvent". View table.
{{AstrologistEventDef
| id = String
| category = String <!-- week | month -->
<!-- Localization references — display text lives in the Translation table, type='astrologist_event' -->
| name_sid = String
| desc_sid = String <!-- nullable -->
| icon = String <!-- nullable -->
| buff_sid = String <!-- nullable; pointer into DB/buffs/ for the actual mechanical effect -->
| roll_chance = Integer <!-- nullable; weight in the random-pick table -->
| count_to_return = Integer <!-- global re-roll threshold (countToReturnWeek / countToReturnMonth) -->
| source_path = String
}}
Field notes
idis the source JSON id (e.g.astrologist_week_1,astrologist_month_3).categoryis the primary filter discriminator:WHERE category='week'to find every week event.buff_sidpoints at an entry inDB/buffs/carrying the actual mechanical payload (the bonuses the buff applies while the event is active). Not flattened into this table — the player-facing description on the event already covers gameplay impact.roll_chanceis the relative weight in the engine's random-pick table when an astrology phase rolls. Per-event scalar; values across the 15-week table sum to roughly the same magnitude as the 11-month table since each is independently rolled.count_to_returnis the global re-roll cooldown — the same event can't repeat within this many ticks. Stored per row (rather than as a global config) so queries don't need a join. Currently 3 for weeks and (a different value, seeweeks_info.json) for months.
Related tables
- Translation — display text in every language (English included), joined on
id = Translation.target_id WHERE Translation.type='astrologist_event' AND Translation.language='en'(1:N, one row per language).


