Widget:YieldCalc: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
Line 21: | Line 21: | ||
// Yield Calculator | // Yield Calculator | ||
function yieldScript(){ | function yieldScript(){ | ||
let A = document.getElementById("cityProd").value; /* City Production */ | let A = document.getElementById("cityProd").value; /* City Production */ | ||
let B = 4; /* Yield(Apples) of the region */ | let B = 4; /* Yield(Apples) of the region */ | ||
let C = 4; /* Amount of Farms in the region */ | let C = 4; /* Amount of Farms in the region */ | ||
let E = 250; /* Total Percentage Bonus (e.g. 50% from a Plow) */ | let E = 250; /* 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) */ | ||
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 */ | ||
let Z = Math.round(A*B+B*5*C+5+(A+5*C)*(E/100)+(C-1)*5+A); /* Food yield for a single farm in the region */ | let Z = Math.round(A*B+B*5*C+5+(A+5*C)*(E/100)+(C-1)*5+A); /* Food yield for a single farm in the region */ | ||
document.getElementById('outputvalue').innerText= Z ; | document.getElementById('outputvalue').innerText= Z ; | ||
} | } | ||
Revision as of 23:51, 24 October 2024
This widget is used to display and calculate the yield with the values submitted by the user.
Usage: {{#Widget:YieldCalc}}