FANDOM


Free*

For legacy support only! {{Cost}} now support discounts directly.
For a 25% discount just use {{Cost|XXX|disc=f}}

This is {{CostCorn}}. It accepts the same input that {{Cost}} accepts, applies the 25% discount received for finishing Cornelius, then produces output in the same format as {{Cost}}. This template is designed to be used in tandem with {{Cost}} when creating tables for flags.

Background

Users can input data for flags much more quickly and easily than before. This template eliminates the need for users to calculate discounts themselves, eliminates errors in calculating or typing discounted prices, and eliminates inconsistencies between users when rounding. Just input cost data, copy and paste, change the name of the template, and that's it!!

{{CostCorn}} is almost an exact duplicate of {{Cost}}, which was designed and created by Koppa Dasao. Koppa Dasao deserves all the credit for this template's logic, structure, and output. The only difference between this template and the original is the tiny amount of code used to calculate the discount.

Syntax

  • {{CostCorn|<resource1=amount1>}}
  • {{CostCorn|<resource1=amount1>|<resource2=amount2>}}
  • {{CostCorn|<resource1=amount1>|<resource2=amount2>|<resource3=amount3>}}
  • {{CostCorn|<resource1=amount1>|<resource2=amount2>|<line=y>}}
    • resource1, resource2, resource3 = the names of the 18 different resources in the TrainStation game: gems, gold, and the 16 materials. (minimum: 4 characters)
    • amount1, amount2, amount3 = the amounts required of resource1, resource2, and resource3, respectively, to purchase an item. Always use plain numbers with no formatting, e.g. 1000000 (NOT 1,000,000 or 1.000.000 or 1 000 000).
    • The 2nd and 3rd parameters are optional. If the item requires only one or two resources, simply close the {{braces}}. DO NOT add extra pipes (|) for the unnecessary parameters.
    • Gems (Gems) always appear alone in an item's cost. No item in the game has a cost that includes gems plus another resource.
    • Optional parameter line, if present, will cause the output to display on one horizontal line.


Examples

NOTE: This template is designed to be used with {{Cost}}. {{CostCorn}} should rarely be used alone, if ever.

{{CostCorn|gold=10000}} gives...
7,500 Gold*

{{CostCorn|gold=10000|wood=20000|bricks=123456}} gives...
7,500 Gold
15,000 Wood
92,592 Bricks
*

Example themes table (abbreviated)

{| border="0" class="article-table sortable" style="text-align:right;"
!scope="col" style="text-align:left;"| Name
!scope="col" style="text-align:right;"| Level
!scope="col" style="text-align:right;" class="unsortable"| Cost
!scope="col" style="text-align:right;" class="unsortable"| [[Discounts#Themes & extensions|Discounted Cost]]
|-
|style="text-align:left;"| [[:Category:Flags|Glorious Boost]]
| {{formatnum:275}}
| {{cost|gems=28}}
| {{CostCorn|gems=28}}
|-
|style="text-align:left;"| [[:Category:Flags|Glorious Boost+]]
| {{formatnum:510}}
| {{cost|steel=29950|u-235=29950|rubber=29950}}
| {{CostCorn|steel=29950|u-235=29950|rubber=29950}}
|}
gives...
Name Level Cost Discounted Cost
Glorious Boost 275 28 Gems 21 Gems*
Glorious Boost+ 510 29,950 Steel
29,950 U-235
29,950 Rubber
22,463 Steel
22,463 U-235
22,463 Rubber
*

Example horizontal output

Cost: {{Cost|wood=5000|bric=5000|sili=5000|line=y}}<br />
Disc.: {{CostCorn|wood=5000|bric=5000|sili=5000|line=y}}

gives...
Cost: 5,000 Wood; 5,000 Bricks; 5,000 Silicon
Disc.: 3,750 Wood; 3,750 Bricks; 3,750 Silicon*

See also

Community content is available under CC-BY-SA unless otherwise noted.