Template:BTD4 upgrade info: Difference between revisions

mNo edit summary
costs by difficulty
Line 2: Line 2:
!class="head"|{{{name M}}}
!class="head"|{{{name M}}}
|-
|-
|style="text-align:center"|<tabs>
|<tabs>
<tab name="Mobile">
<tab name="Mobile">
{|class="info-sub main centered-cells"
{|class="info-sub main centered-cells"
Line 20: Line 20:
{|class="info-sub centered-cells"
{|class="info-sub centered-cells"
!Tower
!Tower
|colspan="2"|[[{{{tower}}} (BTD4)|{{{tower}}}]]
|colspan="3"|[[{{{tower}}} (BTD4)|{{{tower}}}]]
!Tier
|colspan="2"|{{{tier}}}
|}
{|class="info-sub
!colspan="3"|Costs and sell values
|-
|-
!Upgrade cost
!Upgrade cost
|colspan="2"|${{formatnum:{{{cost M|0}}}}}
|colspan="2"|{{BTD4 cost by difficulty|{{{cost M|0}}}}}
|-
|-
!Total cost
!Total cost
|colspan="2"|${{#cargo_query:table=btd4_upgrades
|colspan="2"|{{BTD4 cost by difficulty|{{#cargo_query:table=btd4_upgrades|fields=CONCAT(SUM(cost_M))|group by=tower|where=tower="{{{tower}}}" AND tier<={{{tier}}}|no html}}}}
|fields=FORMAT(SUM(cost_M), 0)
|group by=tower
|where=tower="{{{tower}}}" AND tier<={{{tier}}}
}}
|-
|-
!Sell value
!Sell value
|colspan="2"|${{#cargo_query:table=btd4_upgrades
|colspan="2"|{{BTD4 cost by difficulty|{{#cargo_query:table=btd4_upgrades|fields=CONCAT(SUM(cost_M)*0.8)|group by=tower|where=tower={{{tower}}}" AND tier<={{{tier}}}|no html}}}}
|fields=FORMAT(SUM(cost_M)*0.8, 0)
|group by=tower
|where=tower="{{{tower}}}" AND tier<={{{tier}}}
}}
|}
|}
|}{{#ifeq:{{NAMESPACENUMBER}}|0|{{#cargo_store:_table=btd4_upgrades
|}{{#ifeq:{{NAMESPACENUMBER}}|0|{{#cargo_store:_table=btd4_upgrades