Widget:YieldCalc: Difference between revisions
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" | <input type="number" id="cityProd"> City Production<br /> | ||
<input type="number" size="5" id="regiYield"> | <input type="number" size="5" id="regiYield"> Yield(Apples) of the region<br /> | ||
<input type="number" size="5" id="farmCount"> | <input type="number" size="5" id="farmCount"> Amount of Farms in the region<br /> | ||
<input type="number" size="5" id="percBonus"> | <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); | let A = Number(document.getElementById('cityProd').value); | ||
let B = Number(document.getElementById('regiYield').value); | let B = Number(document.getElementById('regiYield').value); | ||
let C = Number(document.getElementById('farmCount').value); | let C = Number(document.getElementById('farmCount').value); | ||
let E = Number(document.getElementById('percBonus').value); | 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}}