Updated percentages and added a couple more options.

This commit is contained in:
Josh Mudge 2017-09-14 22:15:29 -06:00
부모 359e40c53f
커밋 5808156e10
2개의 변경된 파일30개의 추가작업 그리고 16개의 파일을 삭제

파일 보기

@ -6,25 +6,34 @@
<title>Minecraft Income Calculator</title>
</head>
<p>Minecraft Income Calculator</p>
<p>Enter the number of blocks eligable for rent:</p>
<p>Enter the number of blocks eligable for rent excluding one "base of operations" you change. (1000 blocks = 1 emerald)</p>
<input type="number" id="blocks"></input>
<br><br>
Enter the number of those blocks that qualify as Housing, Infrastructure, Business or military bases.
Enter the number of blocks used for transportation, recreational purposes, soft infrastructure or utilities that is not buildings. (0.5% bonus)
<br><br>
<input type="number" id="tenblocks"></input>
<input type="number" id="infra"></input>
<br><br>
Enter the number of rent blocks that qualify as being government buildings (other than capitals) or as being exceptionally designed (confirmed by two people).
Enter the number of those blocks that qualify as Housing, transportation buildings, buildings for recreational purposes, soft infrastructure buildings or utility buildings, Business buildings, Government buildings or military bases. (1.0% bonus)
<br><br>
<input type="number" id="twentyfifth"></input>
<input type="number" id="one"></input>
<br><br>
Enter the number of embassies in other empires built by permission and confirmed to be embassies by two people.
Enter the number of rent blocks that qualify as being exceptionally designed buildings. (confirmed by two people). (1.5% bonus)
<br><br>
<input type="number" id="design"></input>
<br><br>
Enter the number of government buildings you have. (2.0% bonus for 4.)
<br><br>
<input type="number" id="gov"></input>
<br><br>
Enter the number of embassies in other empires built by permission and confirmed to be embassies by two people. You can only have three or one per city in another empire. (2.0% bonus per embassy)
<br><br>
<input type="number" id="embassies"></input>
<br><br>
Enter 1 if you have a capital
Enter 1 if you have a capital. (2.5% bonus)
<br><br>
<input type="number" id="capital"></input>
<br><br>
<input type="button" value="Calculate Income" onclick="calculate()" />
<p id="Answer"></p>
<br><br><br><br><br>

파일 보기

@ -13,10 +13,11 @@ function calculate() {
//Get input
var blocks = document.getElementById("blocks").value;
var tenblocks = document.getElementById("tenblocks").value;
var twentyfifth = document.getElementById("twentyfifth").value;
var one = document.getElementById("one").value;
var gov = document.getElementById("gov").value;
var embassies = document.getElementById("embassies").value;
var capital = document.getElementById("capital").value;
var infra = document.getElementById("infra").value;
if (blocks.match(numReg))
{
@ -31,15 +32,19 @@ function calculate() {
var emeralds = +blocks / 1000
console.log(emeralds)
var tenblocks = +tenblocks / 1000 * 0.001
console.log(tenblocks)
var twentyfifth = +twentyfifth / 1000 * 0.0025
console.log(twentyfifth)
var embassies = +embassies * 0.0025
var one = +one / 1000 * 0.01
console.log(one)
var design = +design / 1000 * 0.015
console.log(design)
var gov = +gov / 1000 * 0.02
console.log(gov)
var embassies = +embassies * 0.01
console.log(embassies)
var capital = +capital * 0.01
var capital = +capital * 0.025
console.log(capital)
var percent = +tenblocks + +twentyfifth + +embassies + +capital
var infra = +infra * 0.005
console.log(infra)
var percent = +one + +two + +design + +embassies + +capital
console.log(percent)
var total = +emeralds * +percent +emeralds
var total = total.toFixed(4);