Widget:YieldCalc: Difference between revisions

From Ara: History Untold Wiki
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 7: Line 7:


<form id="foodYieldForm">
<form id="foodYieldForm">
   <input type="number" id="cityProd"> City Production<br />
   <input type="number" id="cityProd"><br />
  <input type="number"id="regiYield"> Yield(Apples) of the region<br />
  <input type="number"id="farmCount"> Amount of Farms in the region<br />
  <input type="number"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 20:
// Yield Calculator
// Yield Calculator
function yieldScript(){   
function yieldScript(){   
   let A = Number(document.getElementById('cityProd').value);
   let A = Number(document.getElementById('cityProd').value); /* City Production */
   let B = Number(document.getElementById('regiYield').value);
   let B = 4; /* Yield(Apples) of the region */
   let C = Number(document.getElementById('farmCount').value);  
   let C = 4; /* Amount of Farms in the region */
   let E = Number(document.getElementById('percBonus').value);
   let E = 250; /* Total Percentage Bonus (e.g. 50% from a Plow) */


 
  let F = 1; /* Extra farm adjacency from religious verse (Boolean) */
   let H = C + F; /* Add F to the actual amount of farms in the region */
   let H = C + F; /* Add f to the actual amount of farms in the region */


   document.getElementById('outputvalue').innerText= (
   document.getElementById('outputvalue').innerText= (

Revision as of 01:04, 25 October 2024

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

Usage: ‎{{#Widget:YieldCalc}}