Difference between revisions of "Template:BAM ability"

From Yugipedia
Jump to: navigation, search
(Adding support for "Fusion". Need to strip hyphens out of the input for this.)
(support for "Non-" targets)
Line 2: Line 2:
  
 
before we start, normalize the input a bit:
 
before we start, normalize the input a bit:
* strip "All" and "Necro"
+
* strip "All", "Non-" and "Necro"
 
* "Monsters" and "Spells" to "Monster" and "Spell", respectively
 
* "Monsters" and "Spells" to "Monster" and "Spell", respectively
  
-->{{ #vardefine: $input | {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{{1}}} | All }} | Necro }} | - }} | Spells | Spell }} | Monsters | Monster }} }}<!--
+
-->{{ #vardefine: $input | {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{{1}}} | All }} | Non- }} | Necro }} | - }} | Spells | Spell }} | Monsters | Monster }} }}<!--
  
 
-->{{ #vardefine: $necro | {{ #if: {{ #pos: {{{1}}} | Necro }} | Necro }} }}<!--
 
-->{{ #vardefine: $necro | {{ #if: {{ #pos: {{{1}}} | Necro }} | Necro }} }}<!--
 +
 +
-->{{ #vardefine: $non | {{ #if: {{ #pos: {{{1}}} | Non- }} | Non- }} }}<!--
  
 
-->{{ #vardefine: $all | {{ #if: {{ #pos: +{{ urlencode: {{{1}}} }}+ | +All+ }} | true }} }}<!--
 
-->{{ #vardefine: $all | {{ #if: {{ #pos: +{{ urlencode: {{{1}}} }}+ | +All+ }} | true }} }}<!--
Line 13: Line 15:
 
-->{{BAM ability/action|{{{1}}}}}<!--
 
-->{{BAM ability/action|{{{1}}}}}<!--
  
-->{{ #vardefine: $target | {{ #replace: {{ #var: $input }} | {{ #var: $action }} }} }}<!--
+
-->{{ #vardefine: $target | {{ #var: $non }}{{ #replace: {{ #var: $input }} | {{ #var: $action }} }} }}<!--
  
 
-->{{ #vardefine: $monster
 
-->{{ #vardefine: $monster

Revision as of 18:37, 1 March 2014

.