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
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
<code>Data:AstrologistEvent/<id></code> carries:
<code>Data:AstrologistEvent/<id></code> carries:


# <code><nowiki>{{AstrologistEventDef | id=… | category=week|month | name=… | desc=… | …}}</nowiki></code>
# <code><nowiki>{{AstrologistEventDef | id=… | category=week|month | …}}</nowiki></code>
# <code><nowiki>{{TranslationDef | type=astrologist_event | target_id=<id> | …}}</nowiki></code> — name+desc in the 16 supported languages
# 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 = String
| name_sid = String
| name_sid = String
| description = Wikitext
| 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 -->
| name = String                  <!-- resolved English -->
<!-- Localization references — display text lives in the Translation table, type='astrologist_event' -->
| name_sid = String
| name_sid = String
| description = Wikitext                <!-- resolved English -->
| desc_sid = String              <!-- nullable -->
| desc_sid = String              <!-- nullable -->
| icon = String                  <!-- nullable -->
| icon = String                  <!-- nullable -->
Line 49: Line 46:


== Related tables ==
== Related tables ==
* [[Template:TranslationDef|<code>TranslationDef</code>]] — one row per event with <code>type=astrologist_event</code>, <code>target_id=id</code>.
* [[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 = {{{name|}}}
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| description = {{{description|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}
| icon = {{{icon|}}}
| icon = {{{icon|}}}
Line 64: Line 59:
| count_to_return = {{{count_to_return|}}}
| count_to_return = {{{count_to_return|}}}
| source_path = {{{source_path|}}}
| source_path = {{{source_path|}}}
}}</includeonly>
}}
Created <code>AstrologistEvent</code> entry: <code>{{{id|}}}</code></includeonly>

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:

  1. {{AstrologistEventDef | id=… | category=week|month | …}}
  2. 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

  • id is the source JSON id (e.g. astrologist_week_1, astrologist_month_3).
  • category is the primary filter discriminator: WHERE category='week' to find every week event.
  • buff_sid points at an entry in DB/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_chance is 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_return is 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, see weeks_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).