Template:HeroStreetBrawlItems: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Populate hero Street Brawl section: tier headings + favored/unfavored/common groups and counter block via Module:StreetBrawlItems (with help from vergir-bot LLM)
Use translation keys instead of hardcoded English strings, so the template localizes on /xx subpages (with help from vergir-bot LLM)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>== Street Brawl ==
<includeonly><templatestyles src="Template:HeroStreetBrawlItems/styles.css" />
In [[Street Brawl]], every hero draws from a shared item pool. The cards below show which items are weighted '''for''' and '''against''' {{{1}}}, grouped by [[Street Brawl#Legendary Items|tier]]. The full shared pool sits inside each "Common" collapsible.
{{#invoke:Dictionary|translate|HeroStreetBrawlItemsIntro|{{HeroIcon|{{{1}}}|no-file=true|no-link=true}}}}<span id="{{{id|sb-items}}}-top"></span>


=== Tier 1 ===
{{#invoke:StreetBrawlItems|tiers|{{{1}}}|gate={{{id|sb-items}}}|high={{#invoke:Dictionary|translate|HeroStreetBrawlItemsHighChance}}|average={{#invoke:Dictionary|translate|HeroStreetBrawlItemsAverageChance}}|low={{#invoke:Dictionary|translate|HeroStreetBrawlItemsLowChance}}|tier1={{#invoke:Dictionary|translate|HeroStreetBrawlItemsTier|1}}|tier2={{#invoke:Dictionary|translate|HeroStreetBrawlItemsTier|2}}|tier3={{#invoke:Dictionary|translate|HeroStreetBrawlItemsTier|3}}|tier4={{#invoke:Dictionary|translate|HeroStreetBrawlItemsTier|4}}|tier5={{#invoke:Lang|get_string|Citadel_ItemDraft_Legendary}}}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|favored|1|label=Favored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|unfavored|1|label=Unfavored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|common|1|label=Common|collapse=yes}}


=== Tier 2 ===
{{#invoke:StreetBrawlItems|hero_counter|{{{1}}}|heading={{#invoke:Dictionary|translate|HeroStreetBrawlItemsCounterHeading}}|note={{#invoke:Dictionary|translate|HeroStreetBrawlItemsCounterNote|{{HeroIcon|{{{1}}}|no-file=true|no-link=true}}}}}}<div class="sb-gate-fade"></div></div><div class="sb-gate-btn">[[#{{{id|sb-items}}}|{{#invoke:Dictionary|translate|HeroStreetBrawlItemsShowAll}}]]</div><div class="sb-gate-hide">[[#{{{id|sb-items}}}-top|{{#invoke:Dictionary|translate|HeroStreetBrawlItemsHide}}]]</div></div></includeonly><noinclude>{{Documentation}}</noinclude>
{{#invoke:StreetBrawlItems|hero|{{{1}}}|favored|2|label=Favored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|unfavored|2|label=Unfavored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|common|2|label=Common|collapse=yes}}
 
=== Tier 3 ===
{{#invoke:StreetBrawlItems|hero|{{{1}}}|favored|3|label=Favored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|unfavored|3|label=Unfavored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|common|3|label=Common|collapse=yes}}
 
=== Tier 4 ===
{{#invoke:StreetBrawlItems|hero|{{{1}}}|favored|4|label=Favored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|unfavored|4|label=Unfavored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|common|4|label=Common|collapse=yes}}
 
=== Legendary ===
{{#invoke:StreetBrawlItems|hero|{{{1}}}|favored|5|label=Favored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|unfavored|5|label=Unfavored}}
{{#invoke:StreetBrawlItems|hero|{{{1}}}|common|5|label=Common|collapse=yes}}
 
{{#invoke:StreetBrawlItems|hero_counter|{{{1}}}|heading=Counter items|note=When facing {{{1}}} in Street Brawl, the enemy team is more likely to be offered these items as counters.}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 20:31, 1 August 2026

Template documentation [view] [edit] [history] [purge]

Renders the Street Brawl item-chance section for a hero page. For each tier, the Street Brawl item pool is split by how likely each item is to be offered to the hero — High, Average, or Low chance — followed by any items that counter the hero. Weightings come from Data:StreetBrawlData.json via Module:StreetBrawlItems; item names and tiers from Data:ItemData.json, hero names from Data:HeroData.json.

Place it under a section heading (the template supplies the intro and the per-tier content, but not a top-level heading):

== Street Brawl ==
{{HeroStreetBrawlItems|HERO NAME}}
Parameter Required Description
1 Yes The hero's in-game display name, e.g. Holliday or Seven.
id No Anchor id for the collapsible "Show all items" gate. Defaults to sb-items; give each transclusion a unique id if a single page has more than one.

Examples

[edit source]

{{HeroStreetBrawlItems|Holliday}}

{{HeroStreetBrawlItems|Seven|id=seven-brawl}}

  • The section is collapsed by default. Readers expand it with the Show all items link and collapse it again with Hide. This is a pure-CSS :target toggle, which is what the id anchors point at, so the id must be unique on the page.
  • Columns only appear when they hold items: Low chance is dropped when the hero has none, and the Counter items block is omitted when the hero has no counters.
  • Legendary (Tier 5) cards omit the redundant tier badge, and all cards render in low-graphics mode to keep these card-heavy pages responsive.
  • Styling comes from Template:HeroStreetBrawlItems/styles.css, loaded automatically.

Localization

[edit source]

The template carries no hardcoded English. Every visible string is looked up at render time, and the language is taken from the page title suffix, so {{HeroStreetBrawlItems|Abrams}} on Abrams/ru renders in Russian with no extra parameters. Module:StreetBrawlItems itself holds no display text — all labels are passed in by this template.

The hero name in the intro and in the counter note goes through {{HeroIcon|…|no-file=true|no-link=true}}, which yields the localized hero name with no icon and no self-link.

The Legendary tier label reuses Valve's own string via {{#invoke:Lang|get_string|Citadel_ItemDraft_Legendary}}, so it is already translated everywhere. The remaining strings live in Data:Dictionary:

Key English Notes
HeroStreetBrawlItemsIntro (intro paragraph) {{{1}}} is the hero name. Contains a link to Street Brawl; translations should point at the localized page.
HeroStreetBrawlItemsHighChance High chance Column heading
HeroStreetBrawlItemsAverageChance Average chance Column heading
HeroStreetBrawlItemsLowChance Low chance Column heading
HeroStreetBrawlItemsTier Tier {{{1}}} {{{1}}} is the tier number 1–4; word order may be changed freely
HeroStreetBrawlItemsCounterHeading Counter items Section heading
HeroStreetBrawlItemsCounterNote (counter note) {{{1}}} is the hero name
HeroStreetBrawlItemsShowAll Show all items Expand link; keep it short
HeroStreetBrawlItemsHide Hide Collapse link; keep it short
Only English values exist so far. Until a language is filled in, that language falls back to English and the string is tagged with {{NeedsTranslationTooltip}}.