User:FCSplayz/sandbox/3

From DominionStrategy Wiki
< User:FCSplayz | sandbox(Difference between revisions)
Jump to: navigation, search
(Testing)
(Testing)
Line 1: Line 1:
{{#if:{{{1|}}}|{{#ifeq:{{#switch:{{{1|}}}{{{4|}}}|P=P|{{{1|}}}}}|P||{{Coin|{{#ifeq:{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=-1-|x=-1-|?=-2-|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+|{{{1|}}}}}.0}}|{{#ifeq:{{padleft:|2|{{{1|}}}}}|{{{1|}}}|{{padleft:|1|{{{1|}}}}}|{{padleft:|2|{{{1|}}}}}}}|{{{1|}}}}}|-||{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=1|x=1|?=2|{{{1|}}}}}.0}}|{{#ifeq:{{padleft:|2|{{{1|}}}}}|{{{1|}}}|{{padleft:|1|{{{1|}}}}}|{{padleft:|2|{{{1|}}}}}}}|{{{1|}}}}}}}|{{{2|}}}}}}}|{{#if:{{#switch:{{{4|}}}|P=P|{{{3|}}}}}||{{Coin||{{{2|}}}}}}}}}{{#if:{{{3|}}}|{{Debt|{{#ifeq:{{{3|}}}|-||{{{3|}}}}}|{{{2|}}}}}}}{{#ifeq:{{{4|}}}|P|{{P|{{{2|}}}}}}}{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=-1-|x=-1-|?=-2-|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+|{{{1|}}}}}.0}}|{{#ifeq:{{{4|}}}|P||{{P|{{{2|}}}}}}}&nbsp;<b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the new parameterized syntax.]</b>|}}<noinclude>
+
{{#if:{{{1|}}}|{{#ifeq:{{#switch:{{{1|}}}{{{4|}}}|P=P|{{{1|}}}}}|P||{{Coin|{{#ifeq:{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=-1-|x=-1-|?=-2-|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+|{{{1|}}}}}.0}}|{{#ifeq:{{padleft:|2|{{{1|}}}}}|{{{1|}}}|{{padleft:|1|{{{1|}}}}}|{{padleft:|2|{{{1|}}}}}}}|{{{1|}}}}}|-||{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=-1-|x=-1-|?=-2-|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+|{{{1|}}}}}.0}}|{{#ifeq:{{padleft:|2|{{{1|}}}}}|{{{1|}}}|{{padleft:|1|{{{1|}}}}}|{{padleft:|2|{{{1|}}}}}}}|{{{1|}}}}}}}|{{{2|}}}}}}}|{{#if:{{#switch:{{{4|}}}|P=P|{{{3|}}}}}||{{Coin||{{{2|}}}}}}}}}{{#if:{{{3|}}}|{{Debt|{{#ifeq:{{{3|}}}|-||{{{3|}}}}}|{{{2|}}}}}}}{{#ifeq:{{{4|}}}|P|{{P|{{{2|}}}}}}}{{#iferror:{{#expr:{{#switch:{{{1|}}}|X=-1-|x=-1-|?=-2-|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+|{{{1|}}}}}.0}}|{{#ifeq:{{{4|}}}|P||{{P|{{{2|}}}}}}}&nbsp;<b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the new parameterized syntax.]</b>|}}<noinclude>
 
<!-- Once all existing references to Template:Cost with the old "P" syntax, where the Coin and Potion costs are combined in the first parameter ({{Cost|2P}}), have been replaced with the new parameterized syntax, where the two are separate ({{Cost|2|||P}}), then, AND ONLY THEN, should the "{{#iferror:{{#expr:{{#switch:{{{1|}}}|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+}}.0}}|{{#ifeq:{{{4|}}}|P||{{P|{{{2|}}}}}}}&nbsp;<b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the new parameterized syntax.]</b>|}}" that's found at the end be removed. -->
 
<!-- Once all existing references to Template:Cost with the old "P" syntax, where the Coin and Potion costs are combined in the first parameter ({{Cost|2P}}), have been replaced with the new parameterized syntax, where the two are separate ({{Cost|2|||P}}), then, AND ONLY THEN, should the "{{#iferror:{{#expr:{{#switch:{{{1|}}}|X*=-1*|x*=-1*|?*=-2*|X+=-1+|x+=-1+|?+=-2+}}.0}}|{{#ifeq:{{{4|}}}|P||{{P|{{{2|}}}}}}}&nbsp;<b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the new parameterized syntax.]</b>|}}" that's found at the end be removed. -->
 
{{doc}}
 
{{doc}}
 
</noinclude>
 
</noinclude>

Revision as of 16:28, 8 June 2024

$

This template allows translating text cost into graphical cost.

Usage

  • {{Cost}} → $
  • {{Cost|3}} → $3
  • {{Cost|0*}} → $0*
  • {{Cost|?}} → $?
  • {{Cost|x}} → $x
  • {{Cost|P}} → 16px
  • {{Cost|6P}} → 16px
  • {{Cost|||8}} → 8D
  • {{Cost|6||8}} → $68D
  • {{Cost|6P||8}} → 16px8D
  • {{Cost|5|l}} → $5
  • {{Cost|P|l}} → 32px
  • {{Cost||l|8}} → 8D
  • {{Cost|6P|l|8}} → 32px8D
  • {{Cost|5|xl}} → $5

New Syntax

The old "P" syntax where P is found within the first parameter is being made obsolete in lieu of the new parameterized syntax where the P is separated into a new fourth parameter.
Henceforth, any instances of the "P" syntax found should be replaced with the respective parameterized syntax.

  • {{Cost|6P}} → {{Cost|6|||P}}
  • {{Cost|6P||8}} → {{Cost|6||8|P}}
  • {{Cost|P|l}} → {{Cost||l||P}}
  • {{Cost|6P|l|8}} → {{Cost|6|l|8|P}}
If an instance of {{Cost}} uses the "P" syntax, it will display the following warning.

[Warning: This Cost Template uses the old "P" syntax, please convert it to the new parameterized syntax.]

An instance of the "P" syntax will also file the page it is in under the category titled All the articles that contain the old "P" syntax for Template:Cost on the Dominion Wiki..


The syntactical changes also allow for new functionality with the ability to put "-" in the Coin and Debt parameters, allowing the empty Coin and Debt images to be displayed.

  • {{Cost|-|||P}} → $P
  • {{Cost|||-|P}} → DP
  • {{Cost|-||-}} → $D
  • {{Cost|-||-|P}} → $DP
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Toolbox