Шаблон:Trait list — различия между версиями

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
(Новая страница: «<includeonly>{{#if: <!-- hide whitespace --> {{#vardefine:pagename|{{#replace:{{PAGENAME}}|'|'}}}} {{#vardefine: type | {{ucfirst:{{{type|{{#switch: {{ucfir…»)
 
 
(не показаны 3 промежуточные версии этого же участника)
Строка 1: Строка 1:
 
<includeonly>{{#if: <!-- hide whitespace -->
 
<includeonly>{{#if: <!-- hide whitespace -->
  
{{#vardefine:pagename|{{#replace:{{PAGENAME}}|&#39;|'}}}}
+
{{#vardefine: smw-empty-query-warning|{{#ifeq: {{{warning|true}}}|false|<!-- no warning -->|{{#if: {{NAMESPACE}}||[[Category:Pages with empty semantic mediawiki query results]]}}}}}}
  
{{#vardefine: type | {{ucfirst:{{{type|{{#switch: {{ucfirst:{{{1|{{#var:pagename}}}}}}}
+
{{#vardefine:last_trait|}}{{#vardefine:last_profession|}}{{#vardefine:unique|}}<!-- purge last trait/profession from previous template call -->
| Aegis  
+
 
| Alacrity  
+
{{#vardefine:effect|{{ucfirst:{{{1|{{#titleparts:{{PAGENAME}}}}}}}}}}}
| Fury  
+
 
| Might  
+
{{#vardefine: type | {{#if: {{{type|}}}|{{ucfirst:{{{type|}}}}}|{{#switch: {{#var:effect}}
| Protection  
+
| Aegis
| Quickness  
+
| Alacrity
| Regeneration  
+
| Fury
| Resistance  
+
| Might
| Retaliation  
+
| Protection
| Stability  
+
| Quickness
| Swiftness  
+
| Regeneration
| Vigor  
+
| Resistance
| Bleeding  
+
| Resolution
| Blinded  
+
| Retaliation
| Burning  
+
| Stability
| Chilled  
+
| Swiftness
| Confusion  
+
| Vigor = Boon
| Crippled  
+
| Bleeding
| Fear  
+
| Blinded
| Immobile  
+
| Burning
| Poisoned  
+
| Chilled
| Slow  
+
| Confusion
| Taunt  
+
| Crippled
 +
| Fear
 +
| Immobile
 +
| Poisoned
 +
| Slow
 +
| Taunt
 
| Torment
 
| Torment
 
| Vulnerability
 
| Vulnerability
| Weakness = Buff
+
| Weakness = Condition
| Daze  
+
| Daze
| Float  
+
| Float
 +
| Knockback
 
| Knockdown
 
| Knockdown
 +
| Launch
 +
| Pull
 
| Sink
 
| Sink
| Stun = Time
+
| Stun = Control effect
| Knockback
 
| Launch
 
| Pull = Distance
 
 
| Barrier = Barrier
 
| Barrier = Barrier
| Damage = Damage  
+
| Life Siphon Damage
| Healing = Healing  
+
| Damage = Damage
 +
| Life Siphon Healing
 +
| Healing = Healing
 
| Dark field
 
| Dark field
 
| Ethereal field
 
| Ethereal field
Строка 64: Строка 71:
 
| Power
 
| Power
 
| Precision
 
| Precision
| Toughness  
+
| Toughness
 
| Vitality
 
| Vitality
 
| Concentration
 
| Concentration
Строка 72: Строка 79:
 
| Healing Power = Attribute
 
| Healing Power = Attribute
 
| #default = +
 
| #default = +
}} }}} }} }}  
+
}} }} }}
  
 
}}{{#ask:
 
}}{{#ask:
 
   [[Is for skill.Has context::Trait]]
 
   [[Is for skill.Has context::Trait]]
   {{#if: {{{secondary|}}}  
+
   {{#if: {{{secondary|}}}
     | [[Has fact secondary::{{ucfirst:{{{secondary|}}}}}]]
+
     | [[Has secondary fact::{{ucfirst:{{{secondary|}}}}}]]
       [[Has fact type::{{#var:type}}]]  
+
       [[Has fact type::{{#var:type}}]]
     | {{#switch: {{{include effects|}}}  
+
      {{#vardefine:unique|SECONDARY}}<!-- required for unique heading filter handling -->
       | no  
+
     | {{#switch: {{{include effects|}}}
       | #default = [[Has fact type::{{#var:type}}]] [[Has fact::{{ucfirst:{{{1|{{#var:pagename}}}}}}}]]
+
      | n
       | yes      = {{#ifeq: {{#var:type}}|+|<!-- no restriction -->|[[Has fact type::{{#var:type}}{{!!}}Effect]]}} [[Has fact effect::{{ucfirst:{{{1|{{#var:pagename}}}}}}}]]
+
       | no
       | only    = [[Has fact type::Effect]] [[Has fact effect::{{ucfirst:{{{1|{{#var:pagename}}}}}}}]]
+
       | #default = [[Has fact type::{{#var:type}}]] [[Has fact::{{#var:effect}}]]
 +
      | y
 +
       | yes      = {{#ifeq: {{#var:type}}|+|<!-- no restriction -->|[[Has fact type::{{#var:type}}{{!!}}Effect]]}} [[Has fact effect::{{#var:effect}}]]
 +
       | only    = [[Has fact type::Effect]] [[Has fact effect::{{#var:effect}}]]
 
       }}
 
       }}
 
   }}
 
   }}
   [[Is for skill.Has availability::Current]]
+
   [[Is for skill.Has availability::Current{{#ifeq: {{#show:{{PAGENAME}}|?Has availability}} | Future | {{!!}}Future}}]]
   {{#if: {{{number|}}}|[[Has fact number::{{{number|}}}]]}}  
+
   {{#if: {{{number|}}}
 +
    | [[Has fact number::{{{number}}}]] {{#vardefine:unique|{{#var:unique}}{{{number}}}}}<!-- required for unique heading filter handling -->
 +
    | {{#switch: {{#var:type}}|Boon|Condition=[[Has fact number::>>0]]}} <!-- for boons and conditions select skills with duration greater than 0 only -->
 +
  }}            <!-- this will exclude traits (e.g. "Dogged March") that list conditions which are not applied but rather their duration is decreased -->
 
   {{{query|}}}
 
   {{{query|}}}
  {{#if: {{{missing|}}}|OR [[{{#arraymap: {{{missing|}}}|;|@@@|{{#if: {{#pos: @@@|fact}}|@@@|@@@#fact1}}|{{!!}}}}]]}}
 
 
  | ?Is for skill                      <!-- 2 -->
 
  | ?Is for skill                      <!-- 2 -->
 
  | ?Is for skill.Has canonical name    <!-- 3 -->
 
  | ?Is for skill.Has canonical name    <!-- 3 -->
Строка 96: Строка 108:
 
  | ?Is for skill.Is for specialization <!-- 6 -->
 
  | ?Is for skill.Is for specialization <!-- 6 -->
 
  | ?Is for skill.Has game description  <!-- 7 -->
 
  | ?Is for skill.Has game description  <!-- 7 -->
  | ?Has fact type                      <!-- 8 -->
+
| ?Has fact                          <!-- 8 -->
  | ?Has fact number                    <!-- 9 -->
+
  | ?Has fact type                      <!-- 9 -->
  | ?Has fact stacks                    <!--10 -->
+
  | ?Has fact number                    <!--10 -->
  | ?Has fact coefficient              <!--11 -->
+
  | ?Has fact stacks                    <!--11 -->
  | ?Has fact strikes                  <!--12 -->
+
  | ?Has fact coefficient              <!--12 -->
  | ?Has fact text                      <!--13 -->
+
  | ?Has fact strikes                  <!--13 -->
  | ?Is for game mode                  <!--14 -->
+
  | ?Has game description              <!--14 -->
  | format = template  
+
  | ?Is for game mode                  <!--15 -->
  | template = Trait list result format{{!}}fact={{ucfirst:{{{1|{{#var:pagename}}}}}}}{{!}}suffix={{{suffix|type}}}
+
| ?Is for skill.Is in trait line      <!--16 -->
 +
| ?Is for skill.Is in trait line.Has canonical name <!--17 -->
 +
  | format = template
 +
  | template = Trait list result format{{!}}suffix={{{suffix|type}}}{{!}}type={{#var:type}}{{!}}effect={{#var:effect}}{{!}}unique={{#var:unique}}
 +
| intro = {{{intro|}}}{{#if: {{{heading|}}}|<nowiki/>
 +
<div id="{{{id|traitlist}}}"><{{{heading level|h3}}} class="filter-plain {{#var_final: p-{{#var:type}}-{{#var:effect}}-{{#var:unique}}-SpecTrait }} f-SpecTrait">{{{heading|}}}</{{{heading level|h3}}}></div>}}<ul id="{{{id|traitlist}}}" style="margin-top:0em;">
 +
| outro = </ul>
 
  | link = none
 
  | link = none
  | sort = Is for skill.Has profession sort order, Is for skill.Has specialization sort order, Is for skill.Is in trait line, Is for skill.Has subobject
+
  | sort = Is for skill.Has profession sort order, Is for skill.Has specialization sort order, Is for skill.Has trait line number, Is for skill.Has trait tier number, Is for skill.Has trait type number, Is for skill.Has trait position number, Is for skill.Has page name
  | limit = 250
+
  | limit = 500
  | default = * ''No traits found.''{{#if: {{NAMESPACE}}||[[Category:Pages with empty semantic mediawiki query results]]}}
+
  | searchlabel = <li>Further results... {{#if: {{NAMESPACE}}||[[Category:Pages with further semantic mediawiki query results]]}}</li>
 +
| default = {{{default|* ''No traits found.''{{#var:smw-empty-query-warning}}}}}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
== Description ==
 
== Description ==
 
This template returns a list of traits that grant a certain [[boon]], apply a certain [[condition]] or a certain [[control effect]]. Sorted by profession (alphabetically within heavy, medium, light), by elite specialization and by trait line. It relies on the usage of the template {{tl|skill fact}} which sets the according skill fact properties. An overview of the skill fact properties and their types can be found [[Guild Wars 2 Wiki:Semantic MediaWiki/Skill facts#Overview|here]]. Format using {{tl|trait list result format}}.
 
This template returns a list of traits that grant a certain [[boon]], apply a certain [[condition]] or a certain [[control effect]]. Sorted by profession (alphabetically within heavy, medium, light), by elite specialization and by trait line. It relies on the usage of the template {{tl|skill fact}} which sets the according skill fact properties. An overview of the skill fact properties and their types can be found [[Guild Wars 2 Wiki:Semantic MediaWiki/Skill facts#Overview|here]]. Format using {{tl|trait list result format}}.
  
;See also
+
;Related templates
:* {{tl|Skill list}} &mdash; Skill list by skill effect based on {{tl|skill fact}}.
+
{| class="wikitable"
:* {{tl|Skill list by property}} &mdash; Skill list by semantic mediawiki skill properties.
+
! Usage
 
+
! Skill templates
 +
! Trait templates
 +
! Description
 +
|-
 +
! Section
 +
| {{tl|Related skills}}
 +
| {{tl|Related traits}}
 +
| These templates list all related skills/traits based on {{tl|skill fact}} and on the {{tl|trait infobox}} ''improves'' parameters. They create subsection headings automatically.
 +
|-
 +
! rowspan="2" | Subsection
 +
| {{tl|Skill list}}
 +
| {{tl|Trait list}}
 +
| These templates list all related skills of a certain context (e.g. weapon, utility)/traits based on {{tl|skill fact}}
 +
|-
 +
| {{tl|Skill list by property}}  
 +
| {{tl|Trait list by property}}
 +
| These templates list all related skills/traits based on a smw query, e.g. based on the {{tl|trait infobox}} ''improves'' parameters.
 +
|-
 +
! Inline
 +
| —
 +
| {{tl|Trait list entry}}
 +
| This template displays the profession icon, trait icon, trait, trait line and trait description.
 +
|}
 
For trait skills use <code><nowiki>{{Skill list|Trait|<effect>}}</nowiki></code> (or <code><nowiki>{{Skill list|Trait}}</nowiki></code> using page name as default value).
 
For trait skills use <code><nowiki>{{Skill list|Trait|<effect>}}</nowiki></code> (or <code><nowiki>{{Skill list|Trait}}</nowiki></code> using page name as default value).
  
Строка 132: Строка 173:
 
: Optional. Allows to ask for the skill effect number, e.g. "20" for Physical Projectile (20% chance) and "100" for Physical Projectile.
 
: Optional. Allows to ask for the skill effect number, e.g. "20" for Physical Projectile (20% chance) and "100" for Physical Projectile.
 
;secondary.
 
;secondary.
: Optional. Secondary effect, e.g. "converted from" attribute for type "Attribute Conversion". Disables the default PAGENAME for unnamed parameter 1.
+
: Optional. Secondary effect, e.g. "converted from" attribute for type "Attribute Conversion". Overrides unnamed parameter 1.
 
;include effects
 
;include effects
 
: Optional. Include fact type "Effect" facts to allow keywords set via effect bonus (i.e. to ask for [[Property:Has fact effect]] instead of [[Property:Has fact]]), e.g. "Power" for [[Empower Allies]]. Either "no" (default), "yes" or "only".
 
: Optional. Include fact type "Effect" facts to allow keywords set via effect bonus (i.e. to ask for [[Property:Has fact effect]] instead of [[Property:Has fact]]), e.g. "Power" for [[Empower Allies]]. Either "no" (default), "yes" or "only".
 +
;intro
 +
: Optional. Intro text.
 +
;heading
 +
: Optional. Intro heading. This will internally set filter classes for {{tl|related traits filter}}.
 +
;heading level
 +
: Optional. Intro heading level, defaults to h3.
 +
;default
 +
: Optional. Default text.
 
;query
 
;query
 
: Optional. Additional query.
 
: Optional. Additional query.
;missing
 
: Optional. Missing skills (separated by ";"), use rarely and sparsely.
 
  
 
=== Examples ===
 
=== Examples ===
Строка 155: Строка 202:
 
<pre>{{Trait list|type=Attribute Conversion|secondary=Power}}</pre>
 
<pre>{{Trait list|type=Attribute Conversion|secondary=Power}}</pre>
 
{{Trait list|type=Attribute Conversion|secondary=Power}}
 
{{Trait list|type=Attribute Conversion|secondary=Power}}
 
<pre>{{Trait list|Condition Damage|type=Attribute Conversion|secondary=Power}}</pre>
 
{{Trait list|Condition Damage|type=Attribute Conversion|secondary=Power}}
 
  
 
=== Format comparison (parameter "suffix") ===
 
=== Format comparison (parameter "suffix") ===
{| style="width:100%"
+
{| style="width:100%"
 
! style="width:70%" | description (default)
 
! style="width:70%" | description (default)
 
! style="width:30%" | none
 
! style="width:30%" | none
 
|-
 
|-
 
| style="vertical-align:top" | <pre>{{Trait list|Power|suffix=description}}</pre>
 
| style="vertical-align:top" | <pre>{{Trait list|Power|suffix=description}}</pre>
{{Trait list|Power|suffix=type}}
+
{{Trait list|Power|suffix=description}}
 
| style="vertical-align:top" | <pre>{{Trait list|Power|suffix=none}}</pre>
 
| style="vertical-align:top" | <pre>{{Trait list|Power|suffix=none}}</pre>
 
{{Trait list|Power|suffix=none}}
 
{{Trait list|Power|suffix=none}}

Текущая версия на 11:15, 15 апреля 2022

Description[править]

This template returns a list of traits that grant a certain boon, apply a certain condition or a certain control effect. Sorted by profession (alphabetically within heavy, medium, light), by elite specialization and by trait line. It relies on the usage of the template {{skill fact}} which sets the according skill fact properties. An overview of the skill fact properties and their types can be found here. Format using {{trait list result format}}.

Related templates
Usage Skill templates Trait templates Description
Section {{Related skills}} {{Related traits}} These templates list all related skills/traits based on {{skill fact}} and on the {{trait infobox}} improves parameters. They create subsection headings automatically.
Subsection {{Skill list}} {{Trait list}} These templates list all related skills of a certain context (e.g. weapon, utility)/traits based on {{skill fact}}
{{Skill list by property}} {{Trait list by property}} These templates list all related skills/traits based on a smw query, e.g. based on the {{trait infobox}} improves parameters.
Inline {{Trait list entry}} This template displays the profession icon, trait icon, trait, trait line and trait description.

For trait skills use {{Skill list|Trait|<effect>}} (or {{Skill list|Trait}} using page name as default value).

Usage[править]

{{Trait list|<effect>|type=<type>}}

Parameters[править]

1 (unnamed parameter)
Required. Trait fact, boon, condition or control effect, e.g. Might, Burning. Defaults to PAGENAME.
type
Optional. Trait fact type. For boons, conditions and control effect this is set automatically. See also here.
suffix
Optional. Either "none", "description" (default) or "notes" (stacks and duration).
number
Optional. Allows to ask for the skill effect number, e.g. "20" for Physical Projectile (20% chance) and "100" for Physical Projectile.
secondary.
Optional. Secondary effect, e.g. "converted from" attribute for type "Attribute Conversion". Overrides unnamed parameter 1.
include effects
Optional. Include fact type "Effect" facts to allow keywords set via effect bonus (i.e. to ask for Property:Has fact effect instead of Property:Has fact), e.g. "Power" for Empower Allies. Either "no" (default), "yes" or "only".
intro
Optional. Intro text.
heading
Optional. Intro heading. This will internally set filter classes for {{related traits filter}}.
heading level
Optional. Intro heading level, defaults to h3.
default
Optional. Default text.
query
Optional. Additional query.

Examples[править]

{{Trait list|Power}}
{{Trait list|Power|include effects=only}}
{{Trait list|Power|include effects=yes}}
{{Trait list|Toughness|number=<0}}
  • No traits found.
{{Trait list|type=Attribute Conversion|secondary=Power}}

Format comparison (parameter "suffix")[править]

description (default) none
{{Trait list|Power|suffix=description}}
{{Trait list|Power|suffix=none}}