Widget:YieldCalc: Difference between revisions
mNo edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
} | } | ||
#foodYieldForm { | #foodYieldForm { | ||
width: | width: 700px; | ||
} | } | ||
</style> | </style> | ||
Line 17: | Line 17: | ||
<input type="number" id="regionYield"> - Yield(Apples) of the region<br /> | <input type="number" id="regionYield"> - Yield(Apples) of the region<br /> | ||
<input type="number" id="farmCount"> - Amount of Farms in 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="number" id="percBonus"> - Total Percentage Bonus (e.g. 50% from a Plow and 150% from an expert adds up to 200%)<br /> | ||
<input type="checkbox" id="verseBonus" onClick="yieldScript()"> - Religious Verse active?<br /> | <input type="checkbox" id="verseBonus" onClick="yieldScript()"> - Religious Verse active?<br /> | ||
<input type="submit" value="Calculate" onClick="yieldScript()"> | <input type="submit" value="Calculate" onClick="yieldScript()"> | ||
Line 43: | Line 43: | ||
let H = C + G; // Add G to the actual amount of farms in the region | let H = C + G; // Add G to the actual amount of farms in the region | ||
let Z = Number(Math.floor(A*B+B*5*H+5+(A+5*H)*(E/100)+(H-1)*5+A)); // Resulting production of a single farm | let Z = Number(Math.floor(A*B+B*5*H+5+(A+5*H)*(E/100)+(H-1)*5+A)); // Resulting production of a single farm | ||
let Y = Math. | let Y = Math.round(Z/25); // Resulting food yield of that production of a single farm | ||
let O = Y*C; // Resulting food yield of that production of the entire region | let O = Y*C; // Resulting food yield of that production of the entire region | ||
Latest revision as of 03:06, 30 October 2024
This widget is used to display and calculate the yield with the values submitted by the user.
Usage: {{#Widget:YieldCalc}}