Widget:YieldCalc: Difference between revisions

From Ara: History Untold Wiki
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 6: Line 6:
<includeonly>
<includeonly>


<form id="foodYieldForm">
<form id="foodYieldForm" size="5>
   <input type="number" size="5 id="cityProd"> cityProd<br />
   <input type="number" id="cityProd"> City Production<br />
   <input type="number" size="5" id="regiYield"> regiYield<br />
   <input type="number" size="5" id="regiYield"> Yield(Apples) of the region<br />
   <input type="number" size="5" id="farmCount"> farmCount<br />
   <input type="number" size="5" id="farmCount"> Amount of Farms in the region<br />
   <input type="number" size="5" id="percBonus"> percBonus<br />
   <input type="number" size="5" id="percBonus"> Total Percentage Bonus (e.g. 50% from a Plow)<br />
   <input type="submit" value="Calculate" onClick="yieldScript()">   
   <input type="submit" value="Calculate" onClick="yieldScript()">   
</form>
</form>
Line 23: Line 23:
// Yield Calculator
// Yield Calculator
function yieldScript(){   
function yieldScript(){   
   let A = Number(document.getElementById('cityProd').value); /* City Production */
   let A = Number(document.getElementById('cityProd').value);
   let B = Number(document.getElementById('regiYield').value); /* Yield(Apples) of the region */
   let B = Number(document.getElementById('regiYield').value);
   let C = Number(document.getElementById('farmCount').value); /* Amount of Farms in the region */
   let C = Number(document.getElementById('farmCount').value);  
   let E = Number(document.getElementById('percBonus').value); /* Total Percentage Bonus (e.g. 50% from a Plow) */
   let E = Number(document.getElementById('percBonus').value);


   let F = Number(document.getElementById('verse').value); /* Extra farm adjacency from religious verse (Boolean) */
   let F = Number(document.getElementById('verse').value); /* Extra farm adjacency from religious verse (Boolean) */

Revision as of 00:56, 25 October 2024

This widget is used to display and calculate the yield with the values submitted by the user.

Usage: ‎{{#Widget:YieldCalc}}