Template:Blast resistance values: Difference between revisions
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: {{ | }}{{ #vardefine: $block | {{ lc: {{<!-- initial transform: lowercase, singularize --> | ||
| glass | steps | stairs | bars | cactus | leaves | grass = {{ | #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: {{ | #ifeq: {{ #sub: {{ #var: $block }} | -1 }} | s | ||
| {{ #sub: {{ | | {{ #sub: {{ #var: $block }} || -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 --> |