Difference between revisions of "Template:Enemy test"

From Stoneshard wiki
Jump to navigation Jump to search
(res groups above individual resistances in 3-column layout)
(backport some changes from live template to this test one)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--- Define datastring as variable - to only load from the Enemy data page once. ---
--- Load complete datastring into a variable - to only load from the Enemy data page once. ---
-->{{#vardefine:Datastring|{{:Enemy_data|{{ROOTPAGENAME}}}}}}<!--
-->{{#vardefine:Datastring|{{:Enemy_data|{{ROOTPAGENAME}}}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Matter|{{#explode: {{#var:Datastring}}|;|9}}}}<!--
-->{{#vardefine:Matter|{{#explode: {{#var:Datastring}}|;|9}}}}<!--
-->{{#vardefine:Name|{{#explode: {{#var:Datastring}}|;|-2}}}}<!--
-->{{#vardefine:Name|{{#explode: {{#var:Datastring}}|;|-2}}}}<!--
Line 38: Line 39:
-->{{#vardefine:SacredResistance|{{#ifeq: {{#explode: {{#var:Datastring}}|;|94}} | |0|{{#explode: {{#var:Datastring}}|;|94}}}}}}<!--
-->{{#vardefine:SacredResistance|{{#ifeq: {{#explode: {{#var:Datastring}}|;|94}} | |0|{{#explode: {{#var:Datastring}}|;|94}}}}}}<!--
-->{{#vardefine:PsionicResistance|{{#ifeq: {{#explode: {{#var:Datastring}}|;|95}} | |0|{{#explode: {{#var:Datastring}}|;|95}}}}}}<!--
-->{{#vardefine:PsionicResistance|{{#ifeq: {{#explode: {{#var:Datastring}}|;|95}} | |0|{{#explode: {{#var:Datastring}}|;|95}}}}}}<!--
<!-- DEFINE ENEMY BODY TYPE BONUSES
-->{{#vardefine:BleedResistance|{{#ifeq: {{#explode: {{#var:Datastring}}|;|35}} | |0|{{#explode: {{#var:Datastring}}|;|35}}}}}}<!--
--- Define additional resistance bonuses from enemy body type as individual variables (from scr_mob_material_type). ---
-->{{#if: {{#var:Matter}} | {{#switch: {{#var:Matter}}
-->{{#if: {{#var:Matter}} | {{#switch: {{#var:Matter}}
| bones = {{#vardefine:rescrushing|-20}}{{#vardefine:respiercing|30}}{{#vardefine:resslashing|20}}{{#vardefine:respoison|100}}
| bones = {{#vardefine:resphysical|20}}{{#vardefine:rescrushing|-20}}{{#vardefine:respiercing|10}}{{#vardefine:respoison|200}}{{#vardefine:resnature|35}}{{#vardefine:resbleed|200}}
| ectoplasm = {{#vardefine:resphysical|80}}{{#vardefine:resnature|90}}{{#vardefine:resmagic|50}}{{#vardefine:respoison|100}}
| ectoplasm = {{#vardefine:resphysical|80}}{{#vardefine:resnature|60}}{{#vardefine:resmagic|-50}}{{#vardefine:respoison|200}}{{#vardefine:resbleed|200}}{{#vardefine:resstone|100}}
| ooze = {{#vardefine:rescaustic|100}}{{#vardefine:respoison|75}}{{#vardefine:resfire|-75}}
| ooze = {{#vardefine:rescaustic|100}}{{#vardefine:respoison|75}}{{#vardefine:resfire|-75}}
| chitin = {{#vardefine:resphysical|25}}{{#vardefine:rescaustic|-25}}
| chitin = {{#vardefine:resphysical|30}}
| #default = }}
| #default = }}
| }}<!--
| }}<!--
--- Define Total Resistance variables by adding up resistances from enemy res, body type res and from the respective phys/natur/magic res category. ---
-->{{#vardefine:TotalPhysicalResistance|{{#expr: {{#var:resphysical}} + {{#var:PhysicalResistance}}}}}}<!--
-->{{#vardefine:TotalNatureResistance|{{#expr: {{#var:resnature}} + {{#var:NatureResistance}}}}}}<!--
-->{{#vardefine:TotalMagicResistance|{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}}}}}}<!--
-->{{#vardefine:TotalSlashingResistance|{{#expr: {{#var:resphysical}} + {{#var:resslashing}} + {{#var:PhysicalResistance}} + {{#var:SlashingResistance}}}}}}<!--
-->{{#vardefine:TotalPiercingResistance|{{#expr: {{#var:resphysical}} + {{#var:respiercing}} + {{#var:PhysicalResistance}} + {{#var:PiercingResistance}}}}}}<!--
-->{{#vardefine:TotalCrushingResistance|{{#expr: {{#var:resphysical}} + {{#var:rescrushing}} + {{#var:PhysicalResistance}} + {{#var:CrushingResistance}}}}}}<!--
-->{{#vardefine:TotalRendingResistance|{{#expr: {{#var:resphysical}} + {{#var:PhysicalResistance}} + {{#var:RendingResistance}}}}}}<!--
-->{{#vardefine:TotalFireResistance|{{#expr: {{#var:resnature}} + {{#var:resfire}} + {{#var:NatureResistance}} + {{#var:FireResistance}}}}}}<!--
-->{{#vardefine:TotalFrostResistance|{{#expr: {{#var:resnature}} + {{#var:NatureResistance}} + {{#var:FrostResistance}}}}}}<!--
-->{{#vardefine:TotalShockResistance|{{#expr: {{#var:resnature}} + {{#var:NatureResistance}} + {{#var:ShockResistance}}}}}}<!--
-->{{#vardefine:TotalPoisonResistance|{{#expr: {{#var:resnature}} + {{#var:respoison}} + {{#var:NatureResistance}} + {{#var:PoisonResistance}}}}}}<!--
-->{{#vardefine:TotalCausticResistance|{{#expr: {{#var:resnature}} + {{#var:rescaustic}} + {{#var:NatureResistance}} + {{#var:CausticResistance}}}}}}<!--
-->{{#vardefine:TotalUnholyResistance|{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}} + {{#var:UnholyResistance}}}}}}<!--
-->{{#vardefine:TotalArcaneResistance|{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}} + {{#var:ArcaneResistance}}}}}}<!--
-->{{#vardefine:TotalSacredResistance|{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}} + {{#var:SacredResistance}}}}}}<!--
-->{{#vardefine:TotalPsionicResistance|{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}} + {{#var:PsionicResistance}}}}}}<!--
-->{{#vardefine:TotalBleedResistance|{{#expr: {{#var:resbleed}} + {{#var:BleedResistance}}}}}}<!--
--- TOOLTIP START ---
--><div style="width: 450px;">
--><div style="width: 450px;">
<div style="text-align:center;"><br><span style="font-size: 20px;">{{#if:{{#var:Name}}|{{#var:Name}}|{{ROOTPAGENAME}}}}</span><br><!--
<div style="text-align:center;"><br><span style="font-size: 20px;">{{#if:{{#var:Name}}|{{#var:Name}}|{{ROOTPAGENAME}}}}</span><br><!--
Line 77: Line 98:
--><div style="display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; justify-content: space-between;"><!--
--><div style="display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; justify-content: space-between;"><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
-->{{#ifeq: {{#expr: {{#var:resphysical}} + {{#var:PhysicalResistance}}}} | 0 | |<div style="width: 145px;">Physical <span style="float:right;">{{#expr: {{#var:resphysical}} + {{#var:PhysicalResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalPhysicalResistance}} | 0 | |<div style="width: 145px;">Physical <span style="float:right;">{{#var:TotalPhysicalResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:resslashing}} + {{#var:SlashingResistance}}}} | 0 | |<div style="width: 145px;">Slashing <span style="float:right;">{{#expr: {{#var:resslashing}} + {{#var:SlashingResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalSlashingResistance}} | 0 | |<div style="width: 145px;">Slashing <span style="float:right;">{{#var:TotalSlashingResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:respiercing}} + {{#var:PiercingResistance}}}} | 0 | |<div style="width: 145px;">Piercing <span style="float:right;">{{#expr: {{#var:respiercing}} + {{#var:PiercingResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalPiercingResistance}} | 0 | |<div style="width: 145px;">Piercing <span style="float:right;">{{#var:TotalPiercingResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:rescrushing}} + {{#var:CrushingResistance}}}} | 0 | |<div style="width: 145px;">Crushing <span style="float:right;">{{#expr: {{#var:rescrushing}} + {{#var:CrushingResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalCrushingResistance}} | 0 | |<div style="width: 145px;">Crushing <span style="float:right;">{{#var:TotalCrushingResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#var:RendingResistance}} | 0 | |<div style="width: 145px;">Rending <span style="float:right;">{{#var:RendingResistance}}%</span></div>}}</div><!--
-->{{#ifeq: {{#var:TotalRendingResistance}} | 0 | |<div style="width: 145px;">Rending <span style="float:right;">{{#var:TotalRendingResistance}}%</span></div>}}</div><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
-->{{#ifeq: {{#expr: {{#var:resnature}} + {{#var:NatureResistance}}}} | 0 | |<div style="width: 145px;">Nature <span style="float:right;">{{#expr: {{#var:resnature}} + {{#var:NatureResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalNatureResistance}} | 0 | |<div style="width: 145px;">Nature <span style="float:right;">{{#var:TotalNatureResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:resfire}} + {{#var:FireResistance}}}} | 0 | |<div style="width: 145px;">{{C|Fire}} <span style="float:right;">{{C|Fire|{{#expr: {{#var:resfire}} + {{#var:FireResistance}}}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalFireResistance}} | 0 | |<div style="width: 145px;">{{C|Fire}} <span style="float:right;">{{C|Fire|{{#var:TotalFireResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:FrostResistance}} | 0 | |<div style="width: 145px;">{{C|Frost}} <span style="float:right;">{{C|Frost|{{#var:FrostResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalFrostResistance}} | 0 | |<div style="width: 145px;">{{C|Frost}} <span style="float:right;">{{C|Frost|{{#var:TotalFrostResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:ShockResistance}} | 0 | |<div style="width: 145px;">{{C|Shock}} <span style="float:right;">{{C|Shock|{{#var:ShockResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalShockResistance}} | 0 | |<div style="width: 145px;">{{C|Shock}} <span style="float:right;">{{C|Shock|{{#var:TotalShockResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:respoison}} + {{#var:PoisonResistance}}}} | 0 | |<div style="width: 145px;">{{C|Poison}} <span style="float:right;">{{C|Poison|{{#expr: {{#var:respoison}} + {{#var:PoisonResistance}}}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalPoisonResistance}} | 0 | |<div style="width: 145px;">{{C|Poison}} <span style="float:right;">{{C|Poison|{{#var:TotalPoisonResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#expr: {{#var:rescaustic}} + {{#var:CausticResistance}}}} | 0 | |<div style="width: 145px;">{{C|Caustic}} <span style="float:right;">{{C|Caustic|{{#expr: {{#var:rescaustic}} + {{#var:CausticResistance}}}}%}}</span></div>}}</div><!--
-->{{#ifeq: {{#var:TotalCausticResistance}} | 0 | |<div style="width: 145px;">{{C|Caustic}} <span style="float:right;">{{C|Caustic|{{#var:TotalCausticResistance}}%}}</span></div>}}</div><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
--><div style="width: 142px; float: left; padding-right: 5px; min-height: 1px;"><!--
-->{{#ifeq: {{#expr: {{#var:resmagic}} + {{#var:MagicResistance}}}} | 0 | |<div style="width: 145px;">Magic <span style="float:right;">{{#expr: {{#var:resmagic}} + {{#var:MagicResistance}}}}%</span></div>}}<!--
-->{{#ifeq: {{#var:TotalMagicResistance}} | 0 | |<div style="width: 145px;">Magic <span style="float:right;">{{#var:TotalMagicResistance}}%</span></div>}}<!--
-->{{#ifeq: {{#var:UnholyResistance}} | 0 | |<div style="width: 145px;">{{C|Unholy}} <span style="float:right;">{{C|Unholy|{{#var:UnholyResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalUnholyResistance}} | 0 | |<div style="width: 145px;">{{C|Unholy}} <span style="float:right;">{{C|Unholy|{{#var:TotalUnholyResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:ArcaneResistance}} | 0 | |<div style="width: 145px;">{{C|Arcane}} <span style="float:right;">{{C|Arcane|{{#var:ArcaneResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalArcaneResistance}} | 0 | |<div style="width: 145px;">{{C|Arcane}} <span style="float:right;">{{C|Arcane|{{#var:TotalArcaneResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:SacredResistance}} | 0 | |<div style="width: 145px;">{{C|Sacred}} <span style="float:right;">{{C|Sacred|{{#var:SacredResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:TotalSacredResistance}} | 0 | |<div style="width: 145px;">{{C|Sacred}} <span style="float:right;">{{C|Sacred|{{#var:TotalSacredResistance}}%}}</span></div>}}<!--
-->{{#ifeq: {{#var:PsionicResistance}} | 0 | |<div style="width: 145px;">{{C|Psionic}} <span style="float:right;">{{C|Psionic|{{#var:PsionicResistance}}%}}</span></div>}}</div></div><!--
-->{{#ifeq: {{#var:TotalPsionicResistance}} | 0 | |<div style="width: 145px;">{{C|Psionic}} <span style="float:right;">{{C|Psionic|{{#var:TotalPsionicResistance}}%}}</span></div>}}</div></div><!--
--><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-statistics1"><!--
--><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-statistics1"><!--
--><div style="text-align:center;">{{Tooltip rule}}'''Defensive stats'''</div><!--
--><div style="text-align:center;">{{Tooltip rule}}'''Defensive stats'''</div><!--

Revision as of 18:26, 13 March 2023

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