User:NtCarlson/Template:Damage dice image: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Prototype of damage dice display that replicates how the game displays it)
 
(Parameter parsing)
 
Line 1: Line 1:
<includeonly><span style="display: block; width: 60px; height: 60px; padding-left: 40px; padding-top: 40px; position: relative">
<includeonly>{{#lvardef: i | 1 }}<span style="display: block; width: 60px; height: 60px; padding-left: 40px; padding-top: 40px; position: relative">
<span style="z-index: 0; position: absolute">[[File:d8 Physical.png]]</span>
{{#while:
<span style="z-index:-1; position: absolute; transform: translate(40px, -20px) rotate(20deg)">[[File:d4 Fire.png]]</span>
| {{{{{#lvar: i }} |}}}
<span style="z-index:-2; position: absolute; transform: translate(-30px, -15px) rotate(40deg)">[[File:d8 Radiant.png]]</span>
|
<span style="z-index:-3; position: absolute; transform: translate(30px, -40px) rotate(25deg)">[[File:d6 Poison.png]]</span>
{{#lvardef: die  | {{ #explode: {{{{{#lvar: i }} |}}} |:|0}}}}
<span style="z-index:-4; position: absolute; transform: translate(-28px, -42px) rotate(45deg)">[[File:d4 Psychic.png]]</span>
{{#lvardef: type | {{ #explode: {{{{{#lvar: i }} |}}} |:|1}}}}
{{#lvardef: pos  | {{ #switch: {{#lvar: i }}
| 1 = translate(0px, 0px)
| 2 = translate(40px, -20px) rotate(20deg)
| 3 = translate(-30px, -15px) rotate(40deg)
| 4 = translate(30px, -40px) rotate(25deg)
| 5 = translate(-28px, -42px) rotate(45deg)
}}}}
<span style="z-index: -{{#lvar: i}}; position: absolute; transform: {{#lvar: pos}}">[[File:{{#lvar: die}} {{#lvar:type}}.png]]</span>
{{#lvardef: i | {{#expr: {{#lvar: i }} + 1 }} }}
}}
</span></includeonly><noinclude>
</span></includeonly><noinclude>
{{User:NtCarlson/Template:Damage dice image}} test
{{User:NtCarlson/Template:Damage dice image|d6:Fire|d4:Radiant|d8:Physical|d12:Lightning}} test
</noinclude>
</noinclude>

Latest revision as of 20:21, 14 December 2024

D6 Fire.pngD4 Radiant.pngD8 Physical.pngD12 Lightning.png test