Difference between revisions of "Template:Test"
Jump to navigation
Jump to search
(add Block Recovery and Fatigue Resistance to weapons) |
(reduce post-expand include size by reducing the Datastring size) |
||
(5 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}}}}<!-- | ||
}}}}{{# | -->{{#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}}|;| | -->{{#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 243: | Line 258: | ||
-->{{#if: {{#var:Range}} | <div style="order: 79;"> {{#ifexpr: {{#var:Range}}>1|{{Translate|Range|Properties}}: <span style="{{#var:FloatRight}}">{{c|W|{{#var:Range}}}}</span>}}</div>| }}<!-- | -->{{#if: {{#var:Range}} | <div style="order: 79;"> {{#ifexpr: {{#var:Range}}>1|{{Translate|Range|Properties}}: <span style="{{#var:FloatRight}}">{{c|W|{{#var:Range}}}}</span>}}</div>| }}<!-- | ||
-->{{#if: {{#var:Dodge Chance}} | <div style="order: 80;"> {{Translate|Dodge Chance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Dodge Chance}}>0|{{c|+|+{{#var:Dodge Chance}}%}}|{{c|-|{{#var:Dodge Chance}}%}}}}</span></div>| }}<!-- | -->{{#if: {{#var:Dodge Chance}} | <div style="order: 80;"> {{Translate|Dodge Chance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Dodge Chance}}>0|{{c|+|+{{#var:Dodge Chance}}%}}|{{c|-|{{#var:Dodge Chance}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Damage Taken}} | <div style="order: | -->{{#if: {{#var:Crit Avoidance}} | <div style="order: 81;"> {{Translate|Crit Avoidance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Crit Avoidance}}>0|{{c|+|+{{#var:Crit Avoidance}}%}}|{{c|-|{{#var:Crit Avoidance}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Damage Reflection}} | <div style="order: | -->{{#if: {{#var:Damage Taken}} | <div style="order: 82;"> {{Translate|Damage Taken|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Damage Taken}}>0|{{c|-|+{{#var:Damage Taken}}%}}|{{c|+|{{#var:Damage Taken}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Bonus Range}} | <div style="order: | -->{{#if: {{#var:Damage Reflection}} | <div style="order: 83;"> {{Translate|Damage Reflection|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Damage Reflection}}>0|{{c|+|+{{#var:Damage Reflection}}%}}|{{c|-|{{#var:Damage Reflection}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Backfire Chance}} | <div style="order: | -->{{#if: {{#var:Bonus Range}} | <div style="order: 84;"> {{Translate|Bonus Range|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Bonus Range}}>0|{{c|+|+{{#var:Bonus Range}}}}|{{c|-|{{#var:Bonus Range}}}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Backfire Chance}} | <div style="order: 85;"> {{Translate|Backfire Chance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Backfire Chance}}>0|{{c|-|+{{#var:Backfire Chance}}%}}|{{c|+|{{#var:Backfire Chance}}%}}}}</span></div>| }}<!-- | |||
-->{{#if: {{#var:Miracle Chance}} | <div style="order: 86;"> {{Translate|Miracle Chance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Miracle Chance}}>0|{{c|+|+{{#var:Miracle Chance}}%}}|{{c|-|{{#var:Miracle Chance}}%}}}}</span></div>| }}<!-- | -->{{#if: {{#var:Miracle Chance}} | <div style="order: 86;"> {{Translate|Miracle Chance|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Miracle Chance}}>0|{{c|+|+{{#var:Miracle Chance}}%}}|{{c|-|{{#var:Miracle Chance}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Miracle Potency}} | <div style="order: 87;"> {{Translate|Miracle Potency|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Miracle Potency}}>0|{{c|+|+{{#var:Miracle Potency}}%}}|{{c|-|{{#var:Miracle Potency}}%}}}}</span></div>| }}<!-- | -->{{#if: {{#var:Miracle Potency}} | <div style="order: 87;"> {{Translate|Miracle Potency|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Miracle Potency}}>0|{{c|+|+{{#var:Miracle Potency}}%}}|{{c|-|{{#var:Miracle Potency}}%}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Block Chance}}{{#var:Block Power}}{{#var:Accuracy}}{{#var:Crit Chance}}{{#var:Crit Efficiency}}{{#var:Counter Chance}}{{#var:Fumble Chance}}{{#var:Range}}{{#var:Dodge Chance}}{{#var:Damage Taken}}{{#var:Damage Reflection}}{{#var:Bonus Range}}{{#var:Backfire Chance}}{{#var:Miracle Chance}}{{#var:Miracle Potency}} | <div style="order: 90;"> </div> | }}<!-- | -->{{#if: {{#var:Block Chance}}{{#var:Block Power}}{{#var:Accuracy}}{{#var:Crit Chance}}{{#var:Crit Efficiency}}{{#var:Counter Chance}}{{#var:Fumble Chance}}{{#var:Range}}{{#var:Dodge Chance}}{{#var:Crit Avoidance}}{{#var:Damage Taken}}{{#var:Damage Reflection}}{{#var:Bonus Range}}{{#var:Backfire Chance}}{{#var:Miracle Chance}}{{#var:Miracle Potency}} | <div style="order: 90;"> </div> | }}<!-- | ||
-->{{#if: {{#var:Energy}} | <div style="order: 91;"> {{Translate|Energy|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Energy}}>0|{{c|+|+{{#var:Energy}}}}|{{c|-|{{#var:Energy}}}}}}</span></div>| }}<!-- | -->{{#if: {{#var:Energy}} | <div style="order: 91;"> {{Translate|Energy|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Energy}}>0|{{c|+|+{{#var:Energy}}}}|{{c|-|{{#var:Energy}}}}}}</span></div>| }}<!-- | ||
-->{{#if: {{#var:Energy Restoration}} | <div style="order: 92;"> {{Translate|Energy Restoration|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Energy Restoration}}>0|{{c|+|+{{#var:Energy Restoration}}%}}|{{c|-|{{#var:Energy Restoration}}%}}}}</span></div>| }}<!-- | -->{{#if: {{#var:Energy Restoration}} | <div style="order: 92;"> {{Translate|Energy Restoration|Properties}}: <span style="{{#var:FloatRight}}">{{#ifexpr:{{#var:Energy Restoration}}>0|{{c|+|+{{#var:Energy Restoration}}%}}|{{c|-|{{#var:Energy Restoration}}%}}}}</span></div>| }}<!-- | ||
Line 300: | 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 361: | 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.