Difference between revisions of "Template:Enemy test"
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><!-- | ||
--- | --- 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}}}}}}<!-- | ||
<!-- | -->{{#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| | | 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| | | 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| | | 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 | -->{{#ifeq: {{#var:TotalPhysicalResistance}} | 0 | |<div style="width: 145px;">Physical <span style="float:right;">{{#var:TotalPhysicalResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#ifeq: {{#var:TotalSlashingResistance}} | 0 | |<div style="width: 145px;">Slashing <span style="float:right;">{{#var:TotalSlashingResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#ifeq: {{#var:TotalPiercingResistance}} | 0 | |<div style="width: 145px;">Piercing <span style="float:right;">{{#var:TotalPiercingResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#ifeq: {{#var:TotalCrushingResistance}} | 0 | |<div style="width: 145px;">Crushing <span style="float:right;">{{#var:TotalCrushingResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#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 | -->{{#ifeq: {{#var:TotalNatureResistance}} | 0 | |<div style="width: 145px;">Nature <span style="float:right;">{{#var:TotalNatureResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#ifeq: {{#var:TotalFireResistance}} | 0 | |<div style="width: 145px;">{{C|Fire}} <span style="float:right;">{{C|Fire|{{#var:TotalFireResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#ifeq: {{#var:TotalFrostResistance}} | 0 | |<div style="width: 145px;">{{C|Frost}} <span style="float:right;">{{C|Frost|{{#var:TotalFrostResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#ifeq: {{#var:TotalShockResistance}} | 0 | |<div style="width: 145px;">{{C|Shock}} <span style="float:right;">{{C|Shock|{{#var:TotalShockResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#ifeq: {{#var:TotalPoisonResistance}} | 0 | |<div style="width: 145px;">{{C|Poison}} <span style="float:right;">{{C|Poison|{{#var:TotalPoisonResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq | -->{{#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 | -->{{#ifeq: {{#var:TotalMagicResistance}} | 0 | |<div style="width: 145px;">Magic <span style="float:right;">{{#var:TotalMagicResistance}}%</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#ifeq: {{#var:TotalUnholyResistance}} | 0 | |<div style="width: 145px;">{{C|Unholy}} <span style="float:right;">{{C|Unholy|{{#var:TotalUnholyResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#ifeq: {{#var:TotalArcaneResistance}} | 0 | |<div style="width: 145px;">{{C|Arcane}} <span style="float:right;">{{C|Arcane|{{#var:TotalArcaneResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#ifeq: {{#var:TotalSacredResistance}} | 0 | |<div style="width: 145px;">{{C|Sacred}} <span style="float:right;">{{C|Sacred|{{#var:TotalSacredResistance}}%}}</span></div>}}<!-- | ||
-->{{#ifeq: {{#var: | -->{{#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.