Template:Blast resistance values: Difference between revisions

From Modded Wiki
Jump to navigation Jump to search
switch input transforms to use variables so they can be spread out a bit, do more transforms to simplify (if only a bit) listing stuff out and allow more free-form input; a bit of rearranging and a few additions
forgot the if-not-equal case in the "block" removal bit
Line 1: Line 1:
<includeonly>{{ #vardefine: $block | {{ lc: {{<!-- initial transform: lowercase, singularize -->
<includeonly>{{ #vardefine: $block | {{{1}}}<!-- easy testing: insert test value here -->
     #switch: {{ lc: {{ #explode: {{{1}}} || -1 }} }}
}}{{ #vardefine: $block | {{ lc: {{<!-- initial transform: lowercase, singularize -->
     | glass | steps | stairs | bars | cactus | leaves | grass = {{{1}}} <!-- don't strip the trailing "s" from these; that just looks weird =) -->
     #switch: {{ lc: {{ #explode: {{ #var: $block }} || -1 }} }}
     | glass | steps | stairs | bars | cactus | leaves | grass = {{ #var: $block }} <!-- don't strip the trailing "s" from these; that just looks weird =) -->
     | #default = {{
     | #default = {{
       #ifeq: {{ #sub: {{{1}}} | -1 }} | s
       #ifeq: {{ #sub: {{ #var: $block }} | -1 }} | s
       | {{ #sub: {{{1}}} || -1 }}
       | {{ #sub: {{ #var: $block }} || -1 }}
       | {{{1}}}
       | {{ #var: $block }}
     }}
     }}
   }} }}
   }} }}
Line 14: Line 15:
       | #default = {{ #replace: {{ #var: $block }} | block }}
       | #default = {{ #replace: {{ #var: $block }} | block }}
     }}
     }}
    | {{ #var: $block }}
   }}
   }}
}}{{ #vardefine: $block | {{ #replace: {{ #var: $block }} }}<!-- final transform: strip whitespace -->
}}{{ #vardefine: $block | {{ #replace: {{ #var: $block }} }}<!-- final transform: strip whitespace -->

Revision as of 14:23, 29 March 2014

[create] [refresh]Documentation
This template has no documentation. If you know how to use this template, please create it.