Difference between revisions of "Template:Test"

From Stoneshard wiki
Jump to navigation Jump to search
(forgot to actually add Crit Avoidance)
(reduce post-expand include size by reducing the Datastring size)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:FloatRight|{{#switch: {{ROOTPAGENAME}}
<!--
--- If we're NOT on a page from this list, define the variable that will float values to the right. ---
--><includeonly>{{#vardefine:FloatRight|{{#switch: {{ROOTPAGENAME}}
|Swords
|Swords
|Axes
|Axes
Line 23: Line 25:
|Tools & Traps =  
|Tools & Traps =  
|#default = float:right;
|#default = float:right;
}}}}{{#ifeq: {{:Weapon_data|{{{1}}}}}|Data does not exist.||{{#vardefine:Datastring|{{:Weapon_data|{{{1}}}}}}}<!--
}}}}<!--
--- Load complete datastring into a variable - only load from the Weapon data page once. ---
-->{{#ifeq: {{:Weapon_data|{{{1}}}}}|Data does not exist.||{{#vardefine:Datastring|{{:Weapon_data|{{{1}}}}}}}<!--
--- This template doesn't use Description, remove it for smaller size ---
-->{{#vardefine:Datastring|{{#sub:{{#var:Datastring}}|0|{{#expr: {{#len:{{#var:Datastring}}}} - {{#len:{{#explode: {{#var:Datastring}}|;|-1}}}}}}}}}}<!--
-->{{#switch: {{#explode: {{#var:Datastring}}|;|2}}
-->{{#switch: {{#explode: {{#var:Datastring}}|;|2}}
|Sword
|Sword
Line 81: Line 87:
-->{{#vardefine:Healing Efficiency|{{#explode: {{#var:Datastring}}|;|60}}}}<!--
-->{{#vardefine:Healing Efficiency|{{#explode: {{#var:Datastring}}|;|60}}}}<!--
-->{{#vardefine:Block Recovery|{{#explode: {{#var:Datastring}}|;|61}}}}<!--
-->{{#vardefine:Block Recovery|{{#explode: {{#var:Datastring}}|;|61}}}}<!--
-->{{#vardefine:Fatigue Resistance|{{#explode: {{#var:Datastring}}|;|62}}}}
-->{{#vardefine:Fatigue Resistance|{{#explode: {{#var:Datastring}}|;|62}}}}<!--
}}}}{{#switch: {{:Consumable_data|{{{1}}}|ItemType}}
-->{{#vardefine:Crit Avoidance|{{#explode: {{#var:Datastring}}|;|63}}}}<!--
-->{{#vardefine:Max Health|{{#explode: {{#var:Datastring}}|;|64}}}}
}}}}<!--
--- Load complete datastring into a variable - only load from the Consumable data page once. ---
-->{{#ifeq: {{:Consumable_data|{{{1}}}}}|Data does not exist.||{{#vardefine:Datastring|{{:Consumable_data|{{{1}}}}}}}<!--
--- This template doesn't use Description, remove it for smaller size ---
-->{{#vardefine:Datastring|{{#sub:{{#var:Datastring}}|0|{{#expr: {{#len:{{#var:Datastring}}}} - {{#len:{{#explode: {{#var:Datastring}}|;|-1}}}}}}}}}}<!--
-->{{#switch: {{#explode: {{#var:Datastring}}|;|2}}
|Food
|Food
|Beverages
|Beverages
Line 120: Line 133:
-->{{#vardefine:Poison Resistance|{{:Consumable_data|{{{1}}}|Poison Resistance}}}}<!--
-->{{#vardefine:Poison Resistance|{{:Consumable_data|{{{1}}}|Poison Resistance}}}}<!--
-->{{#vardefine:Max Health|{{:Consumable_data|{{{1}}}|Max Health}}}}
-->{{#vardefine:Max Health|{{:Consumable_data|{{{1}}}|Max Health}}}}
}}<!--
}}}}<!--
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
-->{{#ifeq: {{:Armor_data|{{{1}}}}}|Data does not exist.||{{#vardefine:Datastring|{{:Armor_data|{{{1}}}}}}}<!--
-->{{#ifeq: {{:Armor_data|{{{1}}}}}|Data does not exist.||{{#vardefine:Datastring|{{:Armor_data|{{{1}}}}}}}<!--
--- This template doesn't use Description, remove it for smaller size ---
-->{{#vardefine:Datastring|{{#sub:{{#var:Datastring}}|0|{{#expr: {{#len:{{#var:Datastring}}}} - {{#len:{{#explode: {{#var:Datastring}}|;|-1}}}}}}}}}}<!--
-->{{#switch: {{#explode: {{#var:Datastring}}|;|2}}
-->{{#switch: {{#explode: {{#var:Datastring}}|;|2}}
|Shield
|Shield
Line 144: Line 159:
-->{{#vardefine:Dodge Chance|{{#explode: {{#var:Datastring}}|;|13}}}}<!--
-->{{#vardefine:Dodge Chance|{{#explode: {{#var:Datastring}}|;|13}}}}<!--
-->{{#vardefine:Crit Chance|{{#explode: {{#var:Datastring}}|;|28}}}}<!--
-->{{#vardefine:Crit Chance|{{#explode: {{#var:Datastring}}|;|28}}}}<!--
-->{{#vardefine:Accuracy|{{#explode: {{#var:Datastring}}|;|26}}}}<!--
-->{{#vardefine:Accuracy|{{#explode: {{#var:Datastring}}|;|27}}}}<!--
-->{{#vardefine:Vision|{{#explode: {{#var:Datastring}}|;|15}}}}<!--
-->{{#vardefine:Vision|{{#explode: {{#var:Datastring}}|;|15}}}}<!--
-->{{#vardefine:Energy|{{#explode: {{#var:Datastring}}|;|17}}}}<!--
-->{{#vardefine:Energy|{{#explode: {{#var:Datastring}}|;|17}}}}<!--
Line 301: Line 316:
-->{{#if: {{#var:Hunger}}{{#var:Hunger Change}}{{#var:Hunger Resistance}}{{#var:Thirst}}{{#var:Thirst Change}}{{#var:Intoxication}}{{#var:Intoxication Change}}{{#var:Intoxication Resistance}}{{#var:Pain}}{{#var:Pain Change}}{{#var:Pain Limit}}{{#var:Sanity}}{{#var:Sanity Change}}{{#var:Morale}}{{#var:Morale Change}}{{#var:Energy Replenishment}}{{#var:Health Replenishment}}{{#var:Injury Treatment}}{{#var:Immunity}}{{#var:Fatigue}}{{#var:Fatigue Change}}{{#var:Fatigue Resistance}}| <div style="order: 160;"> </div> | }}<!--
-->{{#if: {{#var:Hunger}}{{#var:Hunger Change}}{{#var:Hunger Resistance}}{{#var:Thirst}}{{#var:Thirst Change}}{{#var:Intoxication}}{{#var:Intoxication Change}}{{#var:Intoxication Resistance}}{{#var:Pain}}{{#var:Pain Change}}{{#var:Pain Limit}}{{#var:Sanity}}{{#var:Sanity Change}}{{#var:Morale}}{{#var:Morale Change}}{{#var:Energy Replenishment}}{{#var:Health Replenishment}}{{#var:Injury Treatment}}{{#var:Immunity}}{{#var:Fatigue}}{{#var:Fatigue Change}}{{#var:Fatigue Resistance}}| <div style="order: 160;"> </div> | }}<!--
--></div><!--
--></div><!--
--- Reset variables to avoid displaying wrong data for the next item on the same page ---
-->{{#vardefine:Range| }}<!--
-->{{#vardefine:Range| }}<!--
-->{{#vardefine:Armor Damage| }}<!--
-->{{#vardefine:Armor Damage| }}<!--
Line 362: Line 378:
-->{{#vardefine:Psionic Resistance| }}<!--
-->{{#vardefine:Psionic Resistance| }}<!--
-->{{#vardefine:Poison Resistance| }}<!--
-->{{#vardefine:Poison Resistance| }}<!--
-->{{#vardefine:Fatigue Change| }}<!--
-->{{#vardefine:Fatigue Resistance| }}<!--
-->{{#vardefine:Max Health| }}<!--
-->{{#vardefine:Max Health| }}<!--
-->{{#vardefine:Block Chance| }}<!--
-->{{#vardefine:Block Chance| }}<!--

Latest revision as of 22:48, 16 January 2025

This template has no documentation. If you know how to use this template, please add some.