Widget:YieldCalc: Difference between revisions
No edit summary |
No edit summary Tag: Reverted |
||
Line 7: | Line 7: | ||
<form id="foodYieldForm"> | <form id="foodYieldForm"> | ||
<input type="number" id="cityProd"><br /> | <input type="number" id="cityProd"> cityProd<br /> | ||
<input type="number" id="regiYield"> regiYield<br /> | |||
<input type="number" id="farmCount"> farmCount<br /> | |||
<input type="number" id="percBonus"> percBonus<br /> | |||
<input type="submit" value="Calculate" onClick="yieldScript()"> | <input type="submit" value="Calculate" onClick="yieldScript()"> | ||
</form> | </form> | ||
Line 21: | Line 24: | ||
function yieldScript(){ | function yieldScript(){ | ||
let A = Number(document.getElementById('cityProd').value); /* City Production */ | let A = Number(document.getElementById('cityProd').value); /* City Production */ | ||
let B = | let B = Number(document.getElementById('regiYield').value); /* Yield(Apples) of the region */ | ||
let C = | let C = Number(document.getElementById('farmCount').value); /* Amount of Farms in the region */ | ||
let E = | let E = Number(document.getElementById('percBonus').value); /* Total Percentage Bonus (e.g. 50% from a Plow) */ | ||
let F = 1; /* Extra farm adjacency from religious verse (Boolean) */ | let F = 1; /* Extra farm adjacency from religious verse (Boolean) */ |
Revision as of 00:50, 25 October 2024
This widget is used to display and calculate the yield with the values submitted by the user.
Usage: {{#Widget:YieldCalc}}