×
Create a new article
Write your page title here:
We currently have 3,035 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,035Articles

Template:NeedsEffect: Difference between revisions

(Test for delimiter change in data-effect-params.)
No edit summary
Line 1: Line 1:
<onlyinclude>{{#if: {{{1|}}}|{{#arraydefine:effects|{{{1}}}}}|{{#arraydefine:effects}}}}<span style="display:none;">{{#arrayprint:effects}}</span><span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with {{#ifexpr: {{#arraysize:effects}} > 0 |the&#32;|an}}{{#vardefine:effectstodisplay|{{#arrayprint:effects |;&nbsp;|@ |@ |print=pretty }}}}{{#switch: {{{2}}}
<onlyinclude>{{#if: {{{1|}}}|{{#arraydefine:effects|{{{1}}}}}|{{#arraydefine:effects}}}}<span style="display:none;">{{#arrayprint:effects}}</span><span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with {{#ifexpr: {{#arraysize:effects}} > 0 |the&#32;|an}}{{#vardefine:effectstodisplay|{{#arrayprint:effects |;&nbsp;|@ |@ |print=pretty }}}}{{#switch: {{{2}}}
|Or = {{#replace:{{#var:effectstodisplay}}| and | or }}
|Or = {{#replace:{{#var:effectstodisplay}}| and | or }}
|#default{{#var:effectstodisplay}}
|{{#var:effectstodisplay}}
}} {{#ifexpr: {{#arraysize:effects}} > 1|effects|effect}}">✨</span></onlyinclude>
}} {{#ifexpr: {{#arraysize:effects}} > 1|effects|effect}}">✨</span></onlyinclude>



Revision as of 15:13, 26 November 2020

{{#arraydefine:effects}}{{#arrayprint:effects}}<span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with Expression error: Unrecognized punctuation character "{".{{#vardefine:effectstodisplay|{{#arrayprint:effects |; |@ |@ |print=pretty }}}}{{#var:effectstodisplay}} Expression error: Unrecognized punctuation character "{".">✨

Usage:

 {{NeedsEffect|<effect name>}} 

where

 {{NeedsEffect|Bike}} 

will return {{#arraydefine:effects|Bike}}{{#arrayprint:effects}}<span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with Expression error: Unrecognized punctuation character "{".{{#vardefine:effectstodisplay|{{#arrayprint:effects |; |@ |@ |print=pretty }}}}{{#var:effectstodisplay}} Expression error: Unrecognized punctuation character "{".">✨,

 {{NeedsEffect|Stretch, Spring, Glasses|And}} 

will return {{#arraydefine:effects|Stretch, Spring, Glasses}}{{#arrayprint:effects}}<span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with Expression error: Unrecognized punctuation character "{".{{#vardefine:effectstodisplay|{{#arrayprint:effects |; |@ |@ |print=pretty }}}}{{#var:effectstodisplay}} Expression error: Unrecognized punctuation character "{".">✨ (note that And is optional, as that is the default value of the second argument),

 {{NeedsEffect|Child, Fairy|Or}} 

will return {{#arraydefine:effects|Child, Fairy}}{{#arrayprint:effects}}<span data-effect-params="{{#arrayprint:effects|;}}" title="Can be accessed with Expression error: Unrecognized punctuation character "{".{{#vardefine:effectstodisplay|{{#arrayprint:effects |; |@ |@ |print=pretty }}}}{{#var:effectstodisplay}} Expression error: Unrecognized punctuation character "{".">✨.