Difference between revisions of "Template:Tooltip ability/doc"

From Wildermyth Wiki
(No parameters are considered optional now. Examples now use game data templates. Add some test cases to visually confirm that blank data is handled correctly.)
 
Line 4: Line 4:
== Usage ==
== Usage ==


This template displays a tooltip for an ability.
This template displays a tooltip for an ability. It functions best when it queries game data templates for current details about an ability. This allows wiki pages to automatically stay up-to-date as abilities are changed or added in the future.


The tooltip uses the following parameters:
The tooltip uses the following parameters:


; ''action'' : Optional [[action point]] for the ability. One of '''single action''', '''single action, ends turn''', or '''swift action'''. Omit for passive abilities.
; ''action'' : [[Action point]] (cost) for the ability. Please use {{[[Template:Data actionPoints|Data actionPoints]]}} to obtain action point information for this ability.


; ''ability'' : Name of the ability
; ''ability'' : Name of the ability


; ''description'' : Description of the ability
; ''description'' : Description of the ability. Please use {{[[Template:Data description|Data description]]}} to obtain the description for this ability.


; ''damage'' : Numeric damage of the ability
; ''damage'' : Numeric damage of the ability. Please use {{[[Template:Data damageType|Data damageType]]}} to obtain the damage (type) for this ability.


; ''formula'' : (Human-readable) formula for the damage calculation
; ''formula'' : (Human-readable) formula for the damage calculation. Please use {{[[Template:Data formula|Data formula]]}} to obtain the (human-readable) formula for this ability.
 
''If any retrieved game data information appears to be incorrect or missing, please mention it on the Discord #wiki channel, so the necessary scripts can be updated or added to fetch the proper information.''


== Example ==
== Example ==
Note that even though this (constant damage) passive ability doesn't have any action points or formula to presently display, you should still call {{[[Template:Data actionPoints|Data actionPoints]]}} and {{[[Template:Data formula|Data formula]]}}. The reason is to automatically show new game data, should this ability change in the future.
<pre><nowiki>
{{Tooltip ability
| action = {{Data actionPoints|Static Shock}}
| ability = Static Shock
| description = {{Data description|Static Shock}}
| damage = {{Data damageType|Static Shock}}
| formula = {{Data formula|Static Shock}}
}}
</nowiki></pre>
{{Tooltip ability
| action = {{Data actionPoints|Static Shock}}
| ability = Static Shock
| description = {{Data description|Static Shock}}
| damage = {{Data damageType|Static Shock}}
| formula = {{Data formula|Static Shock}}
}}
=== A bad example ===
Entering information by hand (and omitting other required parameters) means that the wiki can't automatically display any new or changed details, if the developers updated this ability in the future.
<pre><nowiki>
{{Tooltip ability
| ability = Static Shock
| description = Incoming melee damage has a 30% chance to deal 2 true damage to the attacker.
| damage = 2 true damage
}}
</nowiki></pre>
=== Test cases ===
==== Missing ability parameter ====
<pre><nowiki>
{{Tooltip ability
| ability =
| ...
}}
</nowiki></pre>
{{Tooltip ability
|ability =
}}
An ability name must be supplied. This should be the name of the ability's (sub)page. E.g., '''Swipes''' for &#91;&#91;Beartouched/Swipes&#93;&#93;, or '''Flashcone''' for &#91;&#91;Flashcone&#93;&#93;.
==== Missing description parameter ====
<pre><nowiki>
{{Tooltip ability
| ability = NoSuchAbility
| description = {{Data description|NoSuchAbility}}
| ...
}}
</nowiki></pre>
{{Tooltip ability
| ability = NoSuchAbility
| description = {{Data description|NoSuchAbility}}
}}
An description must be supplied, since all game data will at least have a name and a description. If no description is returned, either the wrong value is being used, or that data has not been extracted from the game yet and added to the wiki. Please ask on the Discord #wiki channel if you're stuck.
==== No damage ====


<pre><nowiki>
<pre><nowiki>
{{Tooltip ability
{{Tooltip ability
| action = single action
| action = {{Data actionPoints|Invigoration}}
| ability = Shooting Star
| ability = Invigoration
| description = [[Hero]] shoots a burst of star-energy at a nearby foe with their celestial arm.
| description = {{Data description|Invigoration}}
| damage = ''x'' magic damage, 1 pierce
| damage = {{Data damageType|Invigoration}}
| formula = (1 to 5) + 1/2([[Bonus Damage]] + [[Potency]])
| formula = {{Data formula|Invigoration}}
}}
</nowiki></pre>
 
{{Tooltip ability
| action = {{Data actionPoints|Invigoration}}
| ability = Invigoration
| description = {{Data description|Invigoration}}
| damage = {{Data damageType|Invigoration}}
| formula = {{Data formula|Invigoration}}
}}
 
If an ability does no damage, the damage paragraph will be omitted from the tooltip.
 
==== No damage or formula ====
 
<pre><nowiki>
{{Tooltip ability
| action = {{Data actionPoints|Tongue Whip}}
| ability = Tongue Whip
| description = {{Data description|Tongue Whip}}
| damage = {{Data damageType|Tongue Whip}}
| formula = {{Data formula|Tongue Whip}}
}}
}}
</nowiki></pre>
</nowiki></pre>


{{Tooltip ability
{{Tooltip ability
| action = single action
| action = {{Data actionPoints|Tongue Whip}}
| ability = Shooting Star
| ability = Tongue Whip
| description = [[Hero]] shoots a burst of star-energy at a nearby foe with their celestial arm.
| description = {{Data description|Tongue Whip}}
| damage = ''x'' magic damage, 1 pierce
| damage = {{Data damageType|Tongue Whip}}
| formula = (1 to 5) + 1/2([[Bonus Damage]] + [[Potency]])
| formula = {{Data formula|Tongue Whip}}
}}
}}


== Example (passive ability) ==
If an ability has no damage or formula, the damage and formula paragraphs will be omitted from the tooltip.
 
==== All data ====


<pre><nowiki>
<pre><nowiki>
{{Tooltip ability
{{Tooltip ability
| ability = Broadswipes
| action = {{Data actionPoints|Shooting Star+}}
| description = [[Hero]]'s melee attacks deal ''x'' damage to all other foes within range.
| ability = Shooting Star
| damage = ''x'' damage
| description = {{Data description|Shooting Star+}}
| formula = [[Bonus Damage]] + [[Potency]]
| damage = {{Data damageType|Shooting Star+}}
| formula = {{Data formula|Shooting Star+}}
}}
}}
</nowiki></pre>
</nowiki></pre>


{{Tooltip ability
{{Tooltip ability
| ability = Broadswipes
| action = {{Data actionPoints|Shooting Star+}}
| description = [[Hero]]'s melee attacks deal ''x'' damage to all other foes within range.
| ability = Shooting Star
| damage = ''x'' damage
| description = {{Data description|Shooting Star+}}
| formula = [[Bonus Damage]] + [[Potency]]
| damage = {{Data damageType|Shooting Star+}}
| formula = {{Data formula|Shooting Star+}}
}}
}}


__NOTOC__
<includeonly>[[Category:Template]]</includeonly>
<includeonly>[[Category:Template]]</includeonly>

Latest revision as of 12:25, 21 January 2022

This is a documentation subpage for Template:Tooltip ability.

Usage

This template displays a tooltip for an ability. It functions best when it queries game data templates for current details about an ability. This allows wiki pages to automatically stay up-to-date as abilities are changed or added in the future.

The tooltip uses the following parameters:

action
Action point (cost) for the ability. Please use {{Data actionPoints}} to obtain action point information for this ability.
ability
Name of the ability
description
Description of the ability. Please use {{Data description}} to obtain the description for this ability.
damage
Numeric damage of the ability. Please use {{Data damageType}} to obtain the damage (type) for this ability.
formula
(Human-readable) formula for the damage calculation. Please use {{Data formula}} to obtain the (human-readable) formula for this ability.

If any retrieved game data information appears to be incorrect or missing, please mention it on the Discord #wiki channel, so the necessary scripts can be updated or added to fetch the proper information.

Example

Note that even though this (constant damage) passive ability doesn't have any action points or formula to presently display, you should still call {{Data actionPoints}} and {{Data formula}}. The reason is to automatically show new game data, should this ability change in the future.

{{Tooltip ability
| action = {{Data actionPoints|Static Shock}}
| ability = Static Shock
| description = {{Data description|Static Shock}}
| damage = {{Data damageType|Static Shock}}
| formula = {{Data formula|Static Shock}}
}}

Static Shock

2 true damage

Incoming melee damage has a 30% chance to deal 2 true damage to the attacker.

A bad example

Entering information by hand (and omitting other required parameters) means that the wiki can't automatically display any new or changed details, if the developers updated this ability in the future.

{{Tooltip ability
| ability = Static Shock
| description = Incoming melee damage has a 30% chance to deal 2 true damage to the attacker.
| damage = 2 true damage
}}

Test cases

Missing ability parameter

{{Tooltip ability
| ability = 
| ...
}}

(Need a value for the ability parameter)

(Need a value for the description parameter)

An ability name must be supplied. This should be the name of the ability's (sub)page. E.g., Swipes for [[Beartouched/Swipes]], or Flashcone for [[Flashcone]].

Missing description parameter

{{Tooltip ability
| ability = NoSuchAbility
| description = {{Data description|NoSuchAbility}}
| ...
}}

NoSuchAbility

(Need a value for the description parameter)

An description must be supplied, since all game data will at least have a name and a description. If no description is returned, either the wrong value is being used, or that data has not been extracted from the game yet and added to the wiki. Please ask on the Discord #wiki channel if you're stuck.

No damage

{{Tooltip ability
| action = {{Data actionPoints|Invigoration}}
| ability = Invigoration
| description = {{Data description|Invigoration}}
| damage = {{Data damageType|Invigoration}}
| formula = {{Data formula|Invigoration}}
}}
UI DiamondFeather.png swift action (free once per turn)

Invigoration

Twice per combat, <name> touches an adjacent target to grant x Temp Health.

Health: 2 + 1/2(Bonus Damage + Potency)

If an ability does no damage, the damage paragraph will be omitted from the tooltip.

No damage or formula

{{Tooltip ability
| action = {{Data actionPoints|Tongue Whip}}
| ability = Tongue Whip
| description = {{Data description|Tongue Whip}}
| damage = {{Data damageType|Tongue Whip}}
| formula = {{Data formula|Tongue Whip}}
}}
UI DiamondFeather.png swift action (free once per turn)

Tongue Whip

Every other turn, <name> pulls the target to themself with their tongue.

If an ability has no damage or formula, the damage and formula paragraphs will be omitted from the tooltip.

All data

{{Tooltip ability
| action = {{Data actionPoints|Shooting Star+}}
| ability = Shooting Star
| description = {{Data description|Shooting Star+}}
| damage = {{Data damageType|Shooting Star+}}
| formula = {{Data formula|Shooting Star+}}
}}
UI DiamondFilled.png single action

Shooting Star

x magic damage, range 4 (Ranged)

<self> shoots a burst of star-energy at a nearby foe with their celestial arm.

Damage: (2 to 6) + (Bonus Damage + Potency)