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

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
(Новая страница: «<includeonly><nowiki/>{{#vardefine:effect|{{ucfirst:{{{1|{{#replace:{{PAGENAME}}|'|'}}}}}}}}}<!-- -->{{#vardefine: heading level+1|h{{#expr:{{#sub:{{{heading…»)
 
Строка 23: Строка 23:
 
Effect: disable related traits heading if there are no related traits/improving traits
 
Effect: disable related traits heading if there are no related traits/improving traits
 
  -->{{#if: {{{heading|}}}{{{heading level|}}}{{#var:smw_results_2}}{{#switch: {{#var:effect type}}|boon|condition|aura=always show heading}}|{{#vardefine:effect_trait_heading_{{#var:rt_id}}|<nowiki/>
 
  -->{{#if: {{{heading|}}}{{{heading level|}}}{{#var:smw_results_2}}{{#switch: {{#var:effect type}}|boon|condition|aura=always show heading}}|{{#vardefine:effect_trait_heading_{{#var:rt_id}}|<nowiki/>
{{#tag:{{{heading level|h3}}}|Traits {{{heading|}}}}}}}{{#vardefine:smw_results|{{#var:smw_results}}{{#var:smw_results_2}}}}
+
{{#tag:{{{heading level|h3}}}|Traits {{{heading|}}}}}}}
 
}}
 
}}
  
Строка 29: Строка 29:
  
 
Trait: traits that improve this trait
 
Trait: traits that improve this trait
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode=heading|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves trait::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
+
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode={{{mode|heading}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves trait::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve this trait}}}}} }}<!--
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve this trait}}}}} }}<!--
  
 
Trait: traits that are improved by this trait
 
Trait: traits that are improved by this trait
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode=heading|heading level={{#var:heading level+1}}|default=|warning=false|[[-Improves trait::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
+
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode={{{mode|heading}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[-Improves trait::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improved|that are improved by this trait}}}}} }}
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improved|that are improved by this trait}}}}} }}
 
}}
 
}}
Строка 40: Строка 40:
  
 
Skill: traits that improve this skill
 
Skill: traits that improve this skill
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode=heading|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves skill::{{#var:effect}}]] [[Is for game mode::Default||PvE]]}}
+
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode={{{mode|heading}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves skill::{{#var:effect}}]] [[Is for game mode::Default||PvE]]}}
 
}}
 
}}
  
Строка 70: Строка 70:
  
 
Default (property): traits that improve the current property
 
Default (property): traits that improve the current property
  -->{{Trait list by property|suffix={{{suffix|description}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves property::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
+
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode={{{mode|plain}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves property::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro=<nowiki/>
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve {{#var:effect}}}}}}} }}
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve {{#var:effect}}}}}}} }}
 
}}{{#vardefineecho:smw_results_2|<!--
 
}}{{#vardefineecho:smw_results_2|<!--
Строка 80: Строка 80:
  
 
Default (skill type): trait that improves the current skill type (disable heading if there are no trait skills of the current skill type)
 
Default (skill type): trait that improves the current skill type (disable heading if there are no trait skills of the current skill type)
  -->{{Trait list by property|suffix={{{suffix|description}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves skill type::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro={{#if: {{{heading improves|}}}{{{heading level|}}}{{#var:smw_results_2}}|<nowiki/>
+
  -->{{Trait list by property|suffix={{{suffix|description}}}|mode={{{mode|plain}}}|heading level={{#var:heading level+1}}|default=|warning=false|[[Improves skill type::{{#var:effect}}]] [[Is for game mode::Default||PvE]]|intro={{#if: {{{heading improves|}}}{{{heading level|}}}{{#var:smw_results_2}}|<nowiki/>
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve {{#var:effect}}}}}}} }} }}
 
{{#tag:{{{heading level|h3}}}|Traits {{{heading improves|that improve {{#var:effect}}}}}}} }} }}
}}{{#vardefine:smw_results|{{#var:smw_results}}{{#var:smw_results_2}}{{#var:smw_results_3}}}}
+
}}
  
 
}}<!--
 
}}<!--
  
-->{{#if: {{#var:smw_results}}||{{#if: {{NAMESPACE}}||[[Category:Pages with empty semantic mediawiki query results]]}}}}</includeonly><noinclude>
+
-->{{#if: {{#var:smw_results}}{{#var:smw_results_2}}{{#var:smw_results_3}}||{{#if: {{NAMESPACE}}||[[Category:Pages with empty semantic mediawiki query results]]}}}}</includeonly><noinclude>
 
== Description ==
 
== Description ==
 
This template returns a list of '''all''' traits that grant or improves a certain effect. It displays the following sections:
 
This template returns a list of '''all''' traits that grant or improves a certain effect. It displays the following sections:
Строка 157: Строка 157:
 
;heading level
 
;heading level
 
: Optional. Heading level, defaults to "h3".
 
: Optional. Heading level, defaults to "h3".
 +
;mode
 +
: Optional. Either "plain" (default) or "heading" (displays trait line headings and omits the profession, primarily intended for trait pages only).
 
;type
 
;type
 
: Optional. Skill fact type. For boons, conditions and control effect this is set automatically. See also [[Guild Wars 2 Wiki:Semantic MediaWiki/Skill facts#Overview|here]].
 
: Optional. Skill fact type. For boons, conditions and control effect this is set automatically. See also [[Guild Wars 2 Wiki:Semantic MediaWiki/Skill facts#Overview|here]].

Версия 23:20, 28 февраля 2021

Description

This template returns a list of all traits that grant or improves a certain effect. It displays the following sections:

Page context: Effect
  1. Traits granting the effect, using template trait list, based on the parameters from the template skill fact. The heading is omitted if the following two sections (related trait skills/traits that improve) are empty.
  2. Trait skills the effect, using template skill list, with the skill context Trait, based on the parameters from the template skill fact.
  3. Traits that improve the effect, using Trait list by property, based on the parameters improves skill/boon/condition/control effect/aura/effect/weapon/type from the template
Page context: Trait
  1. Traits that improve the trait, using Trait list by property, based on from other page's parameters improves trait/boon/condition/control effect/aura/effect from the template trait infobox.
  2. Traits that are improved by the trait, using Trait list by property, based on the this page's parameter improves trait/boon/condition/control effect/aura/effect from the template trait infobox.
Page context: Skill
  1. Traits that improve the skill, using Trait list by property, based on the parameters improves skill/boon/condition/control effect/aura/effect/weapon/type from the template trait infobox.
Page context: Weapon type
  1. Traits that improve the weapon type, using Trait list by property, based on the parameters improves weapon from the template trait infobox.
  2. Trait skills are related to the weapon type, using template skill list by property, with the skill context Trait, based on the skill type from the template trait infobox.
Page context: none (either skill type, e.g. Meditation or skill fact property, e.g. Barrier)
  1. Traits that grant the property, using template trait list, based on the parameters from the template skill fact.
  2. Trait skills that grant the property, using template skill list, with the skill context Trait, based on the parameters from the template skill fact.
  3. Trait skills that have the skill type, using template skill list by property, with the skill context Trait, based on the skill type from the template skill fact. The heading is omitted if the following section (traits that improve) are empty.
  4. Traits that improve the property, using Trait list by property, based on the parameters improves skill type/improves property from the template trait infobox.

Sorted by profession (alphabetically within heavy, medium, light), by elite specialization and trait line. It relies on the usage of the template {{skill fact}}, which sets the according skill fact properties, and on the usage of the improves parameters of the template {{trait infobox}}. An overview of the skill fact properties and their types can be found here.

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.

Usage

{{Related traits}}
{{Related traits|<effect>}}
{{Related traits|<effect>|heading=<heading>|heading level=<h3, h4, ...>}}

Parameters

1 (unnamed parameter)
Required. Skill fact (boon, condition or control effect, e.g. Might, Burning), trait, skill, weapon type, skill type. Defaults to PAGENAME.
heading
Optional. Additional heading suffix, e.g. "that grant might".
heading improves
Optional. Additional heading suffix for traits that impove, e.g. "that improve might".
heading improved
Optional. Additional heading suffix for traits that are improved by, e.g. "that are improved by Might Makes Right".
heading level
Optional. Heading level, defaults to "h3".
mode
Optional. Either "plain" (default) or "heading" (displays trait line headings and omits the profession, primarily intended for trait pages only).
type
Optional. Skill fact type. For boons, conditions and control effect this is set automatically. See also here.
game mode
Optional. On default the game mode is restricted to the PvE version (except for suffix=notes, there all versions are taken into account). Set it to "all" to select all game modes or specify one or more game modes: "PvE", "WvW", "PvP" and "Default" (for skills that aren't split, e.g. "Default, PvE"), separated by ",".
suffix
Optional. Either "description" or "none".
number
Optional. Allows to ask for the skill effect number, e.g. "20" for Physical Projectile (20% chance) and "100" for Physical Projectile.
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 Banner of Strength. Either "no" (default), "yes" or "only".

Example

Context: Effect

{{Related traits|Burning|heading=that apply burning|heading level=h5}}

Context: Trait

{{Related traits|Burning Rage|heading level=h5}}

Context: Weapon type

{{Related traits|Warhorn|heading level=h5}}

Context: None

{{Related traits|Barrier|heading level=h5}}

Черты
Черты, которые улучшают Barrier
{{Related traits|Arcane|heading level=h5}}

Умения черт, которые имеют тип arcane
Черты, которые улучшают умения arcane
{{Related traits|Glyph}} <!-- omitted heading -->
{{Related traits|Unblockable (effect)}} <!-- omitted heading -->

Trivia