Template:Cell performance for charge: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(create cell performance template for chargeuse)
 
(Include liquid-fueled cells in ChargeUse tooltip for Item infobox)
Line 2: Line 2:
|{{#cargo_query:
|{{#cargo_query:
   |tables=ItemsTable
   |tables=ItemsTable
   |fields=_pageName,MaxCharge,FLOOR(MaxCharge / {{#var:charge_consumed}})=Uses
   |fields=_pageName,CONCAT(CASE WHEN MaxCharge IS NOT NULL THEN MaxCharge ELSE ChargePerDram * MaxVolume END)=MaxCharge,FLOOR((CASE WHEN MaxCharge IS NOT NULL THEN MaxCharge ELSE ChargePerDram * MaxVolume END) / {{#var:charge_consumed}})=Uses
   |where=MaxCharge IS NOT NULL
   |where=MaxCharge IS NOT NULL OR (ChargePerDram IS NOT NULL AND MaxVolume IS NOT NULL)
   |order by=Uses ASC
   |order by=Uses ASC
   |format=template
   |format=template

Revision as of 15:10, 22 September 2021


Specify an item's charge use as the first parameter.

Shows how many uses can be obtained from each type of energy cell as a hoverable tooltip.

Example

{{cell performance for charge | 7500 }}

7500

Error 1054: Unknown column 'MaxCharge' in 'field list' (localhost)

Function: CargoSQLQuery::run Query: SELECT `_pageName` AS `_pageName`,CONCAT(CASE WHEN MaxCharge IS NOT NULL THEN MaxCharge ELSE ChargePerDram * MaxVolume END) AS `MaxCharge`,FLOOR((CASE WHEN MaxCharge IS NOT NULL THEN MaxCharge ELSE ChargePerDram * MaxVolume END) / 7500) AS `Uses` FROM `ItemsTable` WHERE MaxCharge IS NOT NULL OR (ChargePerDram IS NOT NULL AND MaxVolume IS NOT NULL) ORDER BY `Uses` LIMIT 100