Template:Cost

From DominionStrategy Wiki
(Difference between revisions)
Jump to: navigation, search
(Switching Template:Cost to the first backwards-compatible version of the new parameterized syntax.)
(Switching Template:Cost to the second backwards-compatible version of the new parameterized syntax (with warnings for "P" syntax usage).)
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-|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|}}}}}}}|}}<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;<p style="color:red; display:inline;"><b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the [[Template:Cost#New_Syntax|new parameterized syntax]].]</b></p><includeonly>[[Category:Pages with old "P" syntax]]</includeonly>|}}<noinclude>
{{doc}}
+
<!-- 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;<p style="color:red; display:inline;"><b>[Warning: This Cost Template uses the old "P" syntax, please convert it to the [[Template:Cost#New_Syntax|new parameterized syntax]].]</b></p><includeonly>[[Category:Pages with old "P" syntax]]</includeonly>|}}" that's found at the end be removed. -->
 +
{{Large Edits|to clean up its wikitext, fix issues, and add new functionality.}}{{doc}}
 
</noinclude>
 
</noinclude>

Revision as of 01:45, 10 June 2024

$

Workers VillageArt.jpg This page is currently undergoing large-scale edits by the community. Please be patient as the information is updated. We sincerely thank you in advance.

This  Template  page is being edited to clean up its wikitext, fix issues, and add new functionality.

This template allows translating text cost into graphical cost.

Usage

  • {{Cost}} → $
  • {{Cost|3}} → $3
  • {{Cost|0*}} → $0*
  • {{Cost|?}} → $?
  • {{Cost|x}} → $x
  • {{Cost||||P}} → P
  • {{Cost|6|||P}} → $6P
  • {{Cost|||8}} → 8D
  • {{Cost|6||8}} → $68D
  • {{Cost|-|||P}} → $P
  • {{Cost|6||8|P}} → $68DP
  • {{Cost||m|-|P}} → DP
  • {{Cost|5|l}} → $5
  • {{Cost||l||P}} → P
  • {{Cost||l|8}} → 8D
  • {{Cost|-|l|-}} → $D
  • {{Cost|6|l|8|P}} → $68DP
  • {{Cost|5|xl}} → $5
  • {{Cost|-|xl|-|P}} → $DP

Obsolete Syntax

As of June 10th 2024 5:00pm UTC, the old "P" syntax where P is found within the first parameter has been made obsolete in lieu of the new parameterized syntax where the P is separated into a new fourth parameter.
As such, any instances of the "P" syntax are now broken and thus need to be replaced with the new 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}}
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Toolbox