Terraria Wiki
Terraria Wiki
(Weiterleitung nach Das Heilige erstellt)
Markierung: Neue Weiterleitung
 
Westgrass (Diskussion | Beiträge)
K ({{language info}})
 
Zeile 1: Zeile 1:
  +
<includeonly><!--
#WEITERLEITUNG [[Das Heilige]]
 
  +
  +
// register localization info
  +
-->{{l10n/register|ai-row|en
  +
|show_npcs=Show $count$ NPCs
  +
}}<!--
  +
-->{{l10n/register|ai-row|de
  +
|show_npcs=$count$ NPCs anzeigen
  +
}}<!--
  +
  +
  +
// increment row ID
  +
-->{{#if:{{{id|}}}||<!--
  +
-->{{#dplvar:set|ai_table_rowID|{{#expr:{{#or:{{#dplvar:ai_table_rowID}}|-1}}+1}}}}<!-- start with 0
  +
-->}}<!--
  +
  +
// eicons
  +
-->{{#ifeq:{{{eicons|}}}|n|<!-- nothing -->|<!--
  +
-->{{#vardefine:ai_eicons|&#32;{{eicons|errorcate=n|small=y|{{{eicons|{{#dplreplace:{{{1|}}}|/\s+AI$/|}}}}}}}}}<!-- default: strip " AI" from $1
  +
-->}}<!--
  +
  +
// list of npcs
  +
-->{{#vardefine:ai_na|}}<!-- reset var
  +
-->{{#if:{{{3|}}}|<!--
  +
// manual
  +
-->{{#vardefine:ai_npcs|{{{3}}}}}<!--
  +
-->|<!--
  +
// automatic
  +
-->{{#vardefine:ai_npcs|{{#cargo_query:tables=NPCs<!--
  +
-->| fields = nameraw<!--
  +
-->| group by = nameraw<!--
  +
-->| where = ai = "{{{1|}}}"<!--
  +
-->| limit = 200<!--
  +
-->| format = list | delimiter=, <!-- Explicitly specify delimiter to avoid language differences
  +
-->| default =<!--
  +
-->| no html<!--
  +
-->}}}}<!--
  +
// ($add is a comma-separated list)
  +
-->{{#vardefine:ai_npcs|{{#lstuniq:{{#lstjoin:{{#var:ai_npcs}}|,|{{{add|}}}|,|,}}|,|,}}}}<!-- merge them into the automatically generated ones and remove duplicates
  +
-->{{#vardefine:_|{{#lstmap:{{{remove|}}}|,|@@@|<esc>{{#vardefine:ai_npcs|{{#lstrm:@@@|{{#var:ai_npcs}}|,|,}}}}</esc>}}}}<!-- remove unwanted, accidental results (those specified in $remove)
  +
// no cargo result and no manual addition?
  +
-->{{#ifexpr:{{#cargo_query:tables=NPCs|fields=count(distinct nameraw)|where=ai="{{{1|}}}"|no html}}||{{#if:{{{add|}}}||<!--
  +
-->{{#vardefine:ai_na|{{na}}}}<!-- set var that suppresses other output and outputs "{{na}}" instead
  +
-->}}}}<!--
  +
-->}}<!--
  +
-->{{#vardefine:ai_npcs_cnt|{{#lstcnt:{{#var:ai_npcs}}|,}}}}<!-- count NPCs
  +
  +
// output
  +
-->
  +
{{!}}-
  +
{{!}} {{{id|{{#dplvar:ai_table_rowID}}}}}
  +
{{!}} {{ifexists|{{tr|{{{1|}}}|link=y}}|[[{{tr|{{{1|}}}|link=y}}|{{tr|{{{1|}}}}}]]|{{tr|{{{1|}}}}}}}{{#var:ai_eicons}}<!-- name of the ai and eicons -->
  +
{{!}} {{{2|}}}<!-- description -->
  +
{{!}} style="max-width: 450px;" {{!}}<!-- list of npcs
  +
  +
-->{{#var:ai_na|<!-- print {{na}} if there was no result
  +
-->{{#vardefine:ai_collapse|{{bool|{{{collapse|{{#ifexpr:{{#var:ai_npcs_cnt}}>35|y}}}}}}}}}<!--
  +
-->{{#if:{{#var:ai_collapse}}|{{collapse top|{{l10n|ai-row|show_npcs|$count$={{#var:ai_npcs_cnt}}}}}}}}<!--
  +
--><div class="dotlist"><ul><!--
  +
-->{{#listmap:list={{#var:ai_npcs}}|sortmode=sort|sortoptions=ncs asc|insep=,|outsep=|token=@@@|pattern=<li><esc>{{eil|@@@}}</esc></li>}}<!-- print sorted list of npcs
  +
--></ul></div><!--
  +
-->{{#if:{{#var:ai_collapse}}|{{collapse bottom}}}}<!--
  +
-->}}<!--
  +
  +
--></includeonly><!--
  +
  +
--><noinclude>
  +
{{formatting subpage|onlybox=y}}
  +
  +
{{übersetzung}}
  +
Prints a row for the main table. Put the name of the AI as the first unnamed parameter and the description as the second. The first column, the ID, is incremented and printed automatically, but you can use the {{code|id}} parameter to manually set the content of the first column. The automatic ID will not be incremented for that row. The last column, the NPCs of that AI, is generated automatically as well, using [[mw:Extension:Cargo|cargo]]. You can add NPCs by passing a comma-separated list in the {{code|add}} parameter or overwrite it completely by passing a comma-separated list of NPCs as the third unnamed parameter. Unwanted NPCs can be removed by passing a comma-separated list in the {{code|remove}} parameter. Lists that contain more than 35 NPCs will automatically be wrapped in a collapsible box; set <code>collapse=n</code> to prevent this behavior and <code>collapse=y</code> to enforce it.
  +
  +
The name of the AI is linked automatically if the target page exists. {{tl|eicons}} are appended automatically as well, based on the AI name (e.g. "Etherian Lightning Bug" for "Etherian Lightning Bug AI"). Override those by specifying a target eicons page using the parameter {{code|eicons}} (e.g. <code>eicons=Old One's Army</code>) and prevent eicons entirely by setting <code>eicons=n</code>.
  +
{{language info|en=AI/row}}
  +
</noinclude>

Aktuelle Version vom 28. Dezember 2021, 18:25 Uhr

Information
Diese Seite wird lediglich zu Formatierungszwecken auf ihrer Hauptseite, KI, verwendet.
Important Diese Seite ist nicht oder unvollständig übersetzt.
Hilf mit, indem du den Text übersetzt und anschließend diesen Hinweis entfernst. Dies entfernt diese Seite auch aus der Liste von Seiten mit unzureichender Übersetzung.

Prints a row for the main table. Put the name of the AI as the first unnamed parameter and the description as the second. The first column, the ID, is incremented and printed automatically, but you can use the id parameter to manually set the content of the first column. The automatic ID will not be incremented for that row. The last column, the NPCs of that AI, is generated automatically as well, using cargo. You can add NPCs by passing a comma-separated list in the add parameter or overwrite it completely by passing a comma-separated list of NPCs as the third unnamed parameter. Unwanted NPCs can be removed by passing a comma-separated list in the remove parameter. Lists that contain more than 35 NPCs will automatically be wrapped in a collapsible box; set collapse=n to prevent this behavior and collapse=y to enforce it.

The name of the AI is linked automatically if the target page exists. {{eicons}} are appended automatically as well, based on the AI name (e.g. "Etherian Lightning Bug" for "Etherian Lightning Bug AI"). Override those by specifying a target eicons page using the parameter eicons (e.g. eicons=Old One's Army) and prevent eicons entirely by setting eicons=n.