commit
8f0fad37ab
@ -1,94 +1,94 @@ |
||||
* { |
||||
font-family: "Comic Sans MS", "Comic Sans"; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
body::before { |
||||
content: ""; |
||||
position: fixed; |
||||
width: 100vw; |
||||
height: 100vh; |
||||
top: 0; |
||||
left: 0; |
||||
background-image: url("https://cdn.discordapp.com/emojis/744938186983080126.png?v=1"); |
||||
background-size: cover; |
||||
background-repeat: no-repeat; |
||||
background-position: center calc(62% + 2%); |
||||
z-index: -1; |
||||
opacity: 0.25; |
||||
} |
||||
|
||||
textarea { |
||||
background-color: transparent; |
||||
width: 100%; |
||||
} |
||||
|
||||
textarea:disabled { |
||||
color: black; |
||||
} |
||||
|
||||
/* Tooltip container */ |
||||
.tooltip { |
||||
position: relative; |
||||
display: inline-block; |
||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ |
||||
} |
||||
|
||||
/* Tooltip text */ |
||||
.tooltip .tooltiptext { |
||||
visibility: hidden; |
||||
width: 240px; |
||||
background-color: rgba(62,62,62,0.91); |
||||
color: #fff; |
||||
text-align: center; |
||||
padding: 5px 5px 5px 5px; |
||||
border-radius: 6px; |
||||
|
||||
/* Position the tooltip text */ |
||||
position: absolute; |
||||
z-index: 1; |
||||
top: -100%; |
||||
left: 105%; |
||||
|
||||
/* Fade in tooltip */ |
||||
opacity: 0; |
||||
transition: opacity 0.3s; |
||||
} |
||||
|
||||
/* Tooltip arrow */ |
||||
.tooltip .tooltiptext::after { |
||||
content: " "; |
||||
position: absolute; |
||||
top: 50%; |
||||
right: 100%; /* To the left of the tooltip */ |
||||
margin-top: -5px; |
||||
border-width: 5px; |
||||
border-style: solid; |
||||
border-color: transparent rgba(62,62,62,0.91) transparent transparent; |
||||
} |
||||
|
||||
/* Show the tooltip text when you mouse over the tooltip container */ |
||||
.tooltip:hover .tooltiptext { |
||||
visibility: visible; |
||||
opacity: 1; |
||||
} |
||||
|
||||
.grid{ |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr; |
||||
grid-gap: 20px; |
||||
} |
||||
|
||||
.munigrid{ |
||||
border-left: 1px dotted #000; |
||||
border-right: 1px dotted #000; |
||||
} |
||||
|
||||
.munigrid:nth-child(1){ |
||||
border-left:none; |
||||
} |
||||
|
||||
.munigrid:nth-child(even){ |
||||
border-left:none; |
||||
border-right:none; |
||||
* { |
||||
font-family: "Comic Sans MS", "Comic Sans"; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
body::before { |
||||
content: ""; |
||||
position: fixed; |
||||
width: 100vw; |
||||
height: 100vh; |
||||
top: 0; |
||||
left: 0; |
||||
background-image: url("https://cdn.discordapp.com/emojis/744938186983080126.png?v=1"); |
||||
background-size: cover; |
||||
background-repeat: no-repeat; |
||||
background-position: center calc(62% + 2%); |
||||
z-index: -1; |
||||
opacity: 0.25; |
||||
} |
||||
|
||||
textarea { |
||||
background-color: transparent; |
||||
width: 100%; |
||||
} |
||||
|
||||
textarea:disabled { |
||||
color: black; |
||||
} |
||||
|
||||
/* Tooltip container */ |
||||
.tooltip { |
||||
position: relative; |
||||
display: inline-block; |
||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ |
||||
} |
||||
|
||||
/* Tooltip text */ |
||||
.tooltip .tooltiptext { |
||||
visibility: hidden; |
||||
width: 240px; |
||||
background-color: rgba(62,62,62,0.91); |
||||
color: #fff; |
||||
text-align: center; |
||||
padding: 5px 5px 5px 5px; |
||||
border-radius: 6px; |
||||
|
||||
/* Position the tooltip text */ |
||||
position: absolute; |
||||
z-index: 1; |
||||
top: -100%; |
||||
left: 105%; |
||||
|
||||
/* Fade in tooltip */ |
||||
opacity: 0; |
||||
transition: opacity 0.3s; |
||||
} |
||||
|
||||
/* Tooltip arrow */ |
||||
.tooltip .tooltiptext::after { |
||||
content: " "; |
||||
position: absolute; |
||||
top: 50%; |
||||
right: 100%; /* To the left of the tooltip */ |
||||
margin-top: -5px; |
||||
border-width: 5px; |
||||
border-style: solid; |
||||
border-color: transparent rgba(62,62,62,0.91) transparent transparent; |
||||
} |
||||
|
||||
/* Show the tooltip text when you mouse over the tooltip container */ |
||||
.tooltip:hover .tooltiptext { |
||||
visibility: visible; |
||||
opacity: 1; |
||||
} |
||||
|
||||
.grid{ |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr; |
||||
grid-gap: 20px; |
||||
} |
||||
|
||||
.munigrid{ |
||||
border-left: 1px dotted #000; |
||||
border-right: 1px dotted #000; |
||||
} |
||||
|
||||
.munigrid:nth-child(1){ |
||||
border-left:none; |
||||
} |
||||
|
||||
.munigrid:nth-child(even){ |
||||
border-left:none; |
||||
border-right:none; |
||||
} |
@ -1,397 +1,397 @@ |
||||
const MAXSTEPS= 10000 |
||||
|
||||
function ConvertVariables(str,data) { |
||||
return str |
||||
.replaceAll("%START%",data.start) |
||||
.replaceAll("%TARGET%",data.target) |
||||
.replaceAll("%EVENT%",data.event) |
||||
.replaceAll("%STEPS%",data.steps) |
||||
.replaceAll("%PLURAL_STEPS%",Plural(data.steps)) |
||||
.replaceAll("%VOLTAGE%",data.voltage) |
||||
.replaceAll("%STEP%",data.step) |
||||
.replaceAll("%PERCENT%",data.percent) |
||||
.replaceAll("%LOWSCORE%",data.lowscore) |
||||
.replaceAll("%HIGHSCORE%",data.highscore) |
||||
.replaceAll("%EPGAIN%",data.epgain) |
||||
.replaceAll("%REMAINING%",data.remaining) |
||||
} |
||||
|
||||
var LANGUAGE=English |
||||
var LANGUAGELIST={English:{name:"English",translation:English},Japanese:{name:"Japanese",translation:Japanese}/*,Korean:{name:"한국어",translation:Korean}*/} |
||||
var TRANSLATEELEMENTS=100 //Increase as number of translated elements increases.
|
||||
|
||||
function Plural(t) { |
||||
return t==1?"":"s" |
||||
} |
||||
|
||||
function ConvertLanguage() { |
||||
for (var i=0;i<TRANSLATEELEMENTS;i++) { |
||||
var e = document.getElementsByClassName("translate"+i)[0]; |
||||
if (e) { |
||||
e.innerHTML=LANGUAGE(i) |
||||
} |
||||
//document.getElementById("console").value+=LANGUAGE(e.innerHTML)+"\n"
|
||||
} |
||||
} |
||||
ConvertLanguage() |
||||
|
||||
function toggle(){ |
||||
//document.getElementById("console").value+=JSON.stringify(document.getElementById("advanced"))
|
||||
document.getElementById("advanced2").style.visibility=document.getElementById("advanced").checked?"visible":"hidden" |
||||
} |
||||
|
||||
function test(){ |
||||
|
||||
var start = Math.abs(Math.max(0,Number(document.getElementById("starting").value))) |
||||
var end = Math.abs(Math.max(0,Number(document.getElementById("ending").value))) |
||||
var bonus = Number(document.getElementById("team").value) |
||||
var type = (document.getElementById("Bingo").checked?"Bingo": |
||||
document.getElementById("Poker").checked?"Poker/Raid": |
||||
"Medley") |
||||
var flexible = document.getElementById("flexible").checked |
||||
//document.getElementById("console").value=flexible+"...\n\n"
|
||||
var step=1 |
||||
var flameCount=0 |
||||
var originalTarget=start |
||||
document.getElementById("console").value="" |
||||
|
||||
var interval = (type=="Medley")?15000:10000 |
||||
|
||||
var maxscore = Math.floor(Math.abs(Math.min(5000000,Math.max(0,Number(document.getElementById("maxscore").value))))/interval)*interval |
||||
|
||||
function EPCalc(voltage,score,bonus) { |
||||
if (voltage>0) { |
||||
switch (type) { |
||||
case "Bingo":{ |
||||
return voltage * Math.floor((1 + bonus)*Math.max(10,Math.floor(score/interval))) |
||||
}break; |
||||
case "Medley":{ |
||||
return voltage * Math.floor((1 + bonus)*(10+Math.floor(score/interval))) |
||||
}break; |
||||
case "Poker/Raid":{ |
||||
return voltage * Math.floor((1 + bonus)*(50 + Math.floor(score/interval))) |
||||
}break; |
||||
} |
||||
} else { |
||||
return Math.round(bonus*10)+10 |
||||
} |
||||
} |
||||
|
||||
function EvenOdd(val) { |
||||
return val%2==0?"even":"odd" |
||||
} |
||||
|
||||
function TryBiggestGain(tbonus) { |
||||
var voltage=5 |
||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
||||
if (start+EPCalc(voltage,i,tbonus)<end-10||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TrySmallerGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
||||
if (start+EPCalc(voltage,i,tbonus)<end-10||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TrySmolGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if ((EPCalc(voltage,i,tbonus)>=(10+Math.round(bonus*10))&&(start+EPCalc(voltage,i,tbonus)<=end-(10+Math.round(bonus*10))))||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
/*for (var i=maxscore;i>=0;i-=interval) { |
||||
if ((start+EPCalc(voltage,i,tbonus))==end) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
||||
return true |
||||
} |
||||
}*/ |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TryEqualGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
//document.getElementById("console").value+=(start+EPCalc(voltage,i,tbonus))+"/"+end+"\n"
|
||||
if (((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26)) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
if (end==start) { |
||||
return false |
||||
} else { |
||||
return undefined |
||||
} |
||||
} |
||||
|
||||
function TryMatchingRehearsal(tbonus) { |
||||
//document.getElementById("console").value+=(Math.round(tbonus*10))+10
|
||||
if (end-start==(Math.round(tbonus*10))+10) { |
||||
var gain=(Math.round(tbonus*10))+10 |
||||
start+=gain |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false |
||||
} |
||||
return true |
||||
} |
||||
|
||||
function TryRehearsal(tbonus) { |
||||
if (end==start) { |
||||
return false |
||||
} |
||||
var voltage=0 |
||||
if ((end-start)%2!==0) { |
||||
return undefined |
||||
} |
||||
|
||||
if (end-start>(10+Math.round(tbonus*10))+10) { |
||||
var gain=(10+Math.round(tbonus*10)) |
||||
start+=gain |
||||
//document.getElementById("console").value+="1)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} else
|
||||
for (var j=tbonus;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
return false |
||||
} |
||||
} |
||||
if (end-start>=20) { |
||||
var gain=end-start-10 |
||||
start+=gain |
||||
//document.getElementById("console").value+="2)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} else
|
||||
if ((end-start)%10==0) { |
||||
var gain=10 |
||||
start+=gain |
||||
//document.getElementById("console").value+="3)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:0,epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/0% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false |
||||
} else
|
||||
{ |
||||
var gain=end-start |
||||
if (((gain-10)*10)>=0) { |
||||
start+=gain |
||||
//document.getElementById("console").value+="4)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+(gain)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false
|
||||
} else { |
||||
return undefined |
||||
} |
||||
} |
||||
|
||||
return false |
||||
/*var voltage=0 |
||||
if (end-start>36) { |
||||
start+=26 |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
||||
return true |
||||
} else |
||||
if (end-start>20) { |
||||
var bonus = (end-start-20)*10 |
||||
var gain = end-start-10 |
||||
start+=end-start-10 |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
||||
if ((bonus/10)%2!=0) { |
||||
return undefined |
||||
} else { |
||||
return true |
||||
} |
||||
} else { |
||||
if (end-start<10||(end-start)%2!=0) { |
||||
return undefined |
||||
} |
||||
var bonus = ((end-start-10)/20)*2 |
||||
start+=end-start |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((bonus)*100)+"% team. EP +"+EPCalc(voltage,1,bonus)+". Remaining:"+(end-start)+" EP \n" |
||||
|
||||
return false |
||||
} |
||||
return true*/ |
||||
} |
||||
|
||||
if ((end-start)>1000000) { |
||||
document.getElementById("console").value= |
||||
LANGUAGE("%LARGEGAP%") |
||||
//"Get closer to target score before using parking calculator!"
|
||||
} |
||||
else { |
||||
var result=true |
||||
if (maxscore>0) { |
||||
if (flexible) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
while (TryBiggestGain(j)) { |
||||
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||
} |
||||
for (var i=4;i>0;i--) { |
||||
while (TrySmallerGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
for (var i=5;i>0;i--) { |
||||
while (TrySmolGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
while (TryBiggestGain(bonus)) { |
||||
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||
} |
||||
for (var i=4;i>0;i--) { |
||||
while (TrySmallerGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
for (var i=5;i>0;i--) { |
||||
while (TrySmolGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
break; |
||||
} |
||||
} |
||||
if (result) { |
||||
for (var j=1.6;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if (result) { |
||||
do { |
||||
if (flexible) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
var prevstart = 0 |
||||
result = TryRehearsal(j) |
||||
if (start!==prevstart) { |
||||
break; |
||||
} |
||||
} |
||||
} else { |
||||
result = TryRehearsal(bonus) |
||||
} |
||||
} while (result); |
||||
} |
||||
|
||||
|
||||
if (maxscore>0) { |
||||
if (flexible) { |
||||
for (var i=5;i>0;i--) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
while (result = TryEqualGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
for (var i=5;i>0;i--) { |
||||
while (result = TryEqualGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
function ConvertEvent(str) { |
||||
switch (str) { |
||||
case "Poker/Raid":{ |
||||
return LANGUAGE(4) |
||||
}break; |
||||
case "Bingo":{ |
||||
return LANGUAGE(5) |
||||
}break; |
||||
case "Medley":{ |
||||
return LANGUAGE(6) |
||||
}break; |
||||
} |
||||
} |
||||
|
||||
start=end |
||||
if (result===undefined) { |
||||
document.getElementById("console").value=LANGUAGE("%FAILED%") |
||||
//"Impossible to park using this team!"
|
||||
} else { |
||||
document.getElementById("console").value=ConvertVariables(LANGUAGE("%INITIAL%"),{ |
||||
start:originalTarget,target:end,event:ConvertEvent(type),steps:(step-1),voltage:flameCount})+"\n\n"+document.getElementById("console").value |
||||
/*"Calculating from "+originalTarget+" to "+end+" for event type "+type+"...\n\t(All games are done in Free Live)\n\nFound a park! "+(step-1)+" step"+Plural(step-1)+" and "+flameCount+" voltage required!\n\n"+document.getElementById("console").value*/ |
||||
} |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
step++ |
||||
} |
||||
} |
||||
const MAXSTEPS= 10000 |
||||
|
||||
function ConvertVariables(str,data) { |
||||
return str |
||||
.replaceAll("%START%",data.start) |
||||
.replaceAll("%TARGET%",data.target) |
||||
.replaceAll("%EVENT%",data.event) |
||||
.replaceAll("%STEPS%",data.steps) |
||||
.replaceAll("%PLURAL_STEPS%",Plural(data.steps)) |
||||
.replaceAll("%VOLTAGE%",data.voltage) |
||||
.replaceAll("%STEP%",data.step) |
||||
.replaceAll("%PERCENT%",data.percent) |
||||
.replaceAll("%LOWSCORE%",data.lowscore) |
||||
.replaceAll("%HIGHSCORE%",data.highscore) |
||||
.replaceAll("%EPGAIN%",data.epgain) |
||||
.replaceAll("%REMAINING%",data.remaining) |
||||
} |
||||
|
||||
var LANGUAGE=English |
||||
var LANGUAGELIST={English:{name:"English",translation:English},Japanese:{name:"Japanese",translation:Japanese}/*,Korean:{name:"한국어",translation:Korean}*/} |
||||
var TRANSLATEELEMENTS=100 //Increase as number of translated elements increases.
|
||||
|
||||
function Plural(t) { |
||||
return t==1?"":"s" |
||||
} |
||||
|
||||
function ConvertLanguage() { |
||||
for (var i=0;i<TRANSLATEELEMENTS;i++) { |
||||
var e = document.getElementsByClassName("translate"+i)[0]; |
||||
if (e) { |
||||
e.innerHTML=LANGUAGE(i) |
||||
} |
||||
//document.getElementById("console").value+=LANGUAGE(e.innerHTML)+"\n"
|
||||
} |
||||
} |
||||
ConvertLanguage() |
||||
|
||||
function toggle(){ |
||||
//document.getElementById("console").value+=JSON.stringify(document.getElementById("advanced"))
|
||||
document.getElementById("advanced2").style.visibility=document.getElementById("advanced").checked?"visible":"hidden" |
||||
} |
||||
|
||||
function test(){ |
||||
|
||||
var start = Math.abs(Math.max(0,Number(document.getElementById("starting").value))) |
||||
var end = Math.abs(Math.max(0,Number(document.getElementById("ending").value))) |
||||
var bonus = Number(document.getElementById("team").value) |
||||
var type = (document.getElementById("Bingo").checked?"Bingo": |
||||
document.getElementById("Poker").checked?"Poker/Raid": |
||||
"Medley") |
||||
var flexible = document.getElementById("flexible").checked |
||||
//document.getElementById("console").value=flexible+"...\n\n"
|
||||
var step=1 |
||||
var flameCount=0 |
||||
var originalTarget=start |
||||
document.getElementById("console").value="" |
||||
|
||||
var interval = (type=="Medley")?15000:10000 |
||||
|
||||
var maxscore = Math.floor(Math.abs(Math.min(5000000,Math.max(0,Number(document.getElementById("maxscore").value))))/interval)*interval |
||||
|
||||
function EPCalc(voltage,score,bonus) { |
||||
if (voltage>0) { |
||||
switch (type) { |
||||
case "Bingo":{ |
||||
return voltage * Math.floor((1 + bonus)*Math.max(10,Math.floor(score/interval))) |
||||
}break; |
||||
case "Medley":{ |
||||
return voltage * Math.floor((1 + bonus)*(10+Math.floor(score/interval))) |
||||
}break; |
||||
case "Poker/Raid":{ |
||||
return voltage * Math.floor((1 + bonus)*(50 + Math.floor(score/interval))) |
||||
}break; |
||||
} |
||||
} else { |
||||
return Math.round(bonus*10)+10 |
||||
} |
||||
} |
||||
|
||||
function EvenOdd(val) { |
||||
return val%2==0?"even":"odd" |
||||
} |
||||
|
||||
function TryBiggestGain(tbonus) { |
||||
var voltage=5 |
||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
||||
if (start+EPCalc(voltage,i,tbonus)<end-10||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TrySmallerGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
||||
if (start+EPCalc(voltage,i,tbonus)<end-10||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TrySmolGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if ((EPCalc(voltage,i,tbonus)>=(10+Math.round(bonus*10))&&(start+EPCalc(voltage,i,tbonus)<=end-(10+Math.round(bonus*10))))||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
/*for (var i=maxscore;i>=0;i-=interval) { |
||||
if ((start+EPCalc(voltage,i,tbonus))==end) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
||||
return true |
||||
} |
||||
}*/ |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
|
||||
function TryEqualGain(voltage,tbonus) { |
||||
for (var i=maxscore;i>=0;i-=interval) { |
||||
//document.getElementById("console").value+=(start+EPCalc(voltage,i,tbonus))+"/"+end+"\n"
|
||||
if (((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26)) { |
||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||
start+=EPCalc(voltage,i,tbonus) |
||||
flameCount+=voltage |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%STEP%"),{step:step++,voltage:voltage,percent:Math.round(tbonus*100),lowscore:i,highscore:(i+interval-1),epgain:EPCalc(voltage,i,tbonus),remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} |
||||
} |
||||
if (end==start) { |
||||
return false |
||||
} else { |
||||
return undefined |
||||
} |
||||
} |
||||
|
||||
function TryMatchingRehearsal(tbonus) { |
||||
//document.getElementById("console").value+=(Math.round(tbonus*10))+10
|
||||
if (end-start==(Math.round(tbonus*10))+10) { |
||||
var gain=(Math.round(tbonus*10))+10 |
||||
start+=gain |
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false |
||||
} |
||||
return true |
||||
} |
||||
|
||||
function TryRehearsal(tbonus) { |
||||
if (end==start) { |
||||
return false |
||||
} |
||||
var voltage=0 |
||||
if ((end-start)%2!==0) { |
||||
return undefined |
||||
} |
||||
|
||||
if (end-start>(10+Math.round(tbonus*10))+10) { |
||||
var gain=(10+Math.round(tbonus*10)) |
||||
start+=gain |
||||
//document.getElementById("console").value+="1)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} else
|
||||
for (var j=tbonus;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
return false |
||||
} |
||||
} |
||||
if (end-start>=20) { |
||||
var gain=end-start-10 |
||||
start+=gain |
||||
//document.getElementById("console").value+="2)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return true |
||||
} else
|
||||
if ((end-start)%10==0) { |
||||
var gain=10 |
||||
start+=gain |
||||
//document.getElementById("console").value+="3)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:0,epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/0% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false |
||||
} else
|
||||
{ |
||||
var gain=end-start |
||||
if (((gain-10)*10)>=0) { |
||||
start+=gain |
||||
//document.getElementById("console").value+="4)"
|
||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+(gain)+". Remaining:"+(end-start)+" EP \n"*/ |
||||
return false
|
||||
} else { |
||||
return undefined |
||||
} |
||||
} |
||||
|
||||
return false |
||||
/*var voltage=0 |
||||
if (end-start>36) { |
||||
start+=26 |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
||||
return true |
||||
} else |
||||
if (end-start>20) { |
||||
var bonus = (end-start-20)*10 |
||||
var gain = end-start-10 |
||||
start+=end-start-10 |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
||||
if ((bonus/10)%2!=0) { |
||||
return undefined |
||||
} else { |
||||
return true |
||||
} |
||||
} else { |
||||
if (end-start<10||(end-start)%2!=0) { |
||||
return undefined |
||||
} |
||||
var bonus = ((end-start-10)/20)*2 |
||||
start+=end-start |
||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((bonus)*100)+"% team. EP +"+EPCalc(voltage,1,bonus)+". Remaining:"+(end-start)+" EP \n" |
||||
|
||||
return false |
||||
} |
||||
return true*/ |
||||
} |
||||
|
||||
if ((end-start)>1000000) { |
||||
document.getElementById("console").value= |
||||
LANGUAGE("%LARGEGAP%") |
||||
//"Get closer to target score before using parking calculator!"
|
||||
} |
||||
else { |
||||
var result=true |
||||
if (maxscore>0) { |
||||
if (flexible) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
while (TryBiggestGain(j)) { |
||||
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||
} |
||||
for (var i=4;i>0;i--) { |
||||
while (TrySmallerGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
for (var i=5;i>0;i--) { |
||||
while (TrySmolGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
while (TryBiggestGain(bonus)) { |
||||
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||
} |
||||
for (var i=4;i>0;i--) { |
||||
while (TrySmallerGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
for (var i=5;i>0;i--) { |
||||
while (TrySmolGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
break; |
||||
} |
||||
} |
||||
if (result) { |
||||
for (var j=1.6;j>=0;j-=0.2) { |
||||
result = TryMatchingRehearsal(j) |
||||
if (!result) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if (result) { |
||||
do { |
||||
if (flexible) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
var prevstart = 0 |
||||
result = TryRehearsal(j) |
||||
if (start!==prevstart) { |
||||
break; |
||||
} |
||||
} |
||||
} else { |
||||
result = TryRehearsal(bonus) |
||||
} |
||||
} while (result); |
||||
} |
||||
|
||||
|
||||
if (maxscore>0) { |
||||
if (flexible) { |
||||
for (var i=5;i>0;i--) { |
||||
for (var j=bonus;j>=0;j-=0.2) { |
||||
while (result = TryEqualGain(i,j)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
for (var i=5;i>0;i--) { |
||||
while (result = TryEqualGain(i,bonus)) { |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
function ConvertEvent(str) { |
||||
switch (str) { |
||||
case "Poker/Raid":{ |
||||
return LANGUAGE(4) |
||||
}break; |
||||
case "Bingo":{ |
||||
return LANGUAGE(5) |
||||
}break; |
||||
case "Medley":{ |
||||
return LANGUAGE(6) |
||||
}break; |
||||
} |
||||
} |
||||
|
||||
start=end |
||||
if (result===undefined) { |
||||
document.getElementById("console").value=LANGUAGE("%FAILED%") |
||||
//"Impossible to park using this team!"
|
||||
} else { |
||||
document.getElementById("console").value=ConvertVariables(LANGUAGE("%INITIAL%"),{ |
||||
start:originalTarget,target:end,event:ConvertEvent(type),steps:(step-1),voltage:flameCount})+"\n\n"+document.getElementById("console").value |
||||
/*"Calculating from "+originalTarget+" to "+end+" for event type "+type+"...\n\t(All games are done in Free Live)\n\nFound a park! "+(step-1)+" step"+Plural(step-1)+" and "+flameCount+" voltage required!\n\n"+document.getElementById("console").value*/ |
||||
} |
||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||
step++ |
||||
} |
||||
} |
||||
|
@ -1,104 +1,104 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<link rel="stylesheet" href="muni.css" /> |
||||
<title class="translate1">D4DJ Parking Calculator | Powered by Muni</title> |
||||
<script src="english.js"></script> |
||||
<script src="japanese.js"></script> |
||||
</head> |
||||
<body> |
||||
<h1 class="translate2">D4DJ Event Parking Calculator</h1> |
||||
|
||||
<fieldset> |
||||
<legend class="translate3">Parking Configuration</legend> |
||||
<input type="radio" id="Poker" name="type" value="Poker" checked /> |
||||
<label for="Poker" class="translate4">Poker/Raid</label> |
||||
|
||||
<input type="radio" id="Bingo" name="type" value="Bingo" /> |
||||
<label for="Bingo" class="translate5">Bingo</label> |
||||
|
||||
<input type="radio" id="Medley" name="type" value="Medley" /> |
||||
<label for="Medley" class="translate6">Medley</label> |
||||
|
||||
<hr /> |
||||
<div class="grid"> |
||||
<div class="munigrid"> |
||||
<label for="team" class="translate7">Event Team Bonus:</label> |
||||
<select id="team" name="team"> |
||||
<option value="0">0%</option> |
||||
<option value="0.2">20%</option> |
||||
<option value="0.4">40%</option> |
||||
<option value="0.6">60%</option> |
||||
<option value="0.8">80%</option> |
||||
<option value="1.0">100%</option> |
||||
<option value="1.2">120%</option> |
||||
<option value="1.4">140%</option> |
||||
<option value="1.6" selected>160%</option> |
||||
</select> |
||||
<span class="tooltip"><label for="flexible" alt="Yes" |
||||
><b class="translate17">Flexible Team?</b></label |
||||
><input id="flexible" type="checkbox" /> |
||||
<span class="tooltiptext translate8">If turned on, calculates scoring options using lower % teams also.</span> |
||||
</span> |
||||
<br /> |
||||
<br /> |
||||
<span class="tooltip"><label for="maxscore"><b class="translate18">Max Free Live Score: </b> </label |
||||
><input id="maxscore" min="0" type="number" max="5000000" value="650000" /> <span class="tooltiptext translate9"> |
||||
The maximum score you can get from playing a song using <font color="aqua">Free Live</font>.<br> |
||||
<sub>(Use 0 for Rehearsals Only)</sub></span></span> |
||||
</div> |
||||
<div class="munigrid"> |
||||
<span class="tooltip"><label for="advanced" alt="Yes" |
||||
><b class="translate10">Advanced Options?</b></label |
||||
><input id="advanced" type="checkbox" onclick="toggle()" /><span class="tooltiptext translate11"> |
||||
Enable voltage & EP limits.</span></span> |
||||
<div id="advanced2" style="visibility:hidden"> |
||||
<label for="lowest" class="translate12"> |
||||
Use voltage until: |
||||
</label><input style="width:96px;" id="lowest" type="number" min="10" step="2" value="80"> EP<br> |
||||
<label for="maxvolt" class="translate13"> |
||||
Max Voltage to use: |
||||
</label> <input style="width:64px;" id="maxvolt" type="number" min="0" value="20"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<hr /> |
||||
<b><label for="starting" class="translate14">Starting EP: </label |
||||
></b><input id="starting" min="0" type="number" value="100000" /> |
||||
<span style="font-size: 32px; padding: 0px 10px 0px 10px">➔</span> |
||||
<b><label for="ending" class="translate15">Target EP: </label |
||||
></b><input id="ending" min="0" type="number" value="104000" /> |
||||
<br /> |
||||
<br /> |
||||
<button |
||||
id="calculate" |
||||
style=" |
||||
background-color: #ccddff; |
||||
margin-left: 20px; |
||||
width: 240px; |
||||
height: 32px; |
||||
font-size: 18px; |
||||
" |
||||
onclick="test()" class="translate16" |
||||
> |
||||
Calculate |
||||
</button> |
||||
</fieldset> |
||||
<div style="display: flex; justify-content: stretch; align-items: center"> |
||||
<textarea rows="20" cols="160" id="console" disabled> </textarea> |
||||
</div> |
||||
<sub><u>Tips</u></sub> |
||||
<ul> |
||||
<li class="translate19">Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick.</li> |
||||
<li class="translate20">When you get close to the score you need in Free Live, purposely fail the song. Notes are worth 10% their normal value when you have 0 health so you can finish easily.</li> |
||||
<li class="translate21">The <b>"Flexible Team"</b> option gives you the fastest park, but at the expense of more voltage.</li> |
||||
</ul> |
||||
<script src="muni.js"></script> |
||||
<script> |
||||
document.getElementById("ips").value = ""; |
||||
</script> |
||||
</body> |
||||
</html> |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<link rel="stylesheet" href="muni.css" /> |
||||
<title class="translate1">D4DJ Parking Calculator | Powered by Muni</title> |
||||
<script src="english.js"></script> |
||||
<script src="japanese.js"></script> |
||||
</head> |
||||
<body> |
||||
<h1 class="translate2">D4DJ Event Parking Calculator</h1> |
||||
|
||||
<fieldset> |
||||
<legend class="translate3">Parking Configuration</legend> |
||||
<input type="radio" id="Poker" name="type" value="Poker" checked /> |
||||
<label for="Poker" class="translate4">Poker/Raid</label> |
||||
|
||||
<input type="radio" id="Bingo" name="type" value="Bingo" /> |
||||
<label for="Bingo" class="translate5">Bingo</label> |
||||
|
||||
<input type="radio" id="Medley" name="type" value="Medley" /> |
||||
<label for="Medley" class="translate6">Medley</label> |
||||
|
||||
<hr /> |
||||
<div class="grid"> |
||||
<div class="munigrid"> |
||||
<label for="team" class="translate7">Event Team Bonus:</label> |
||||
<select id="team" name="team"> |
||||
<option value="0">0%</option> |
||||
<option value="0.2">20%</option> |
||||
<option value="0.4">40%</option> |
||||
<option value="0.6">60%</option> |
||||
<option value="0.8">80%</option> |
||||
<option value="1.0">100%</option> |
||||
<option value="1.2">120%</option> |
||||
<option value="1.4">140%</option> |
||||
<option value="1.6" selected>160%</option> |
||||
</select> |
||||
<span class="tooltip"><label for="flexible" alt="Yes" |
||||
><b class="translate17">Flexible Team?</b></label |
||||
><input id="flexible" type="checkbox" /> |
||||
<span class="tooltiptext translate8">If turned on, calculates scoring options using lower % teams also.</span> |
||||
</span> |
||||
<br /> |
||||
<br /> |
||||
<span class="tooltip"><label for="maxscore"><b class="translate18">Max Free Live Score: </b> </label |
||||
><input id="maxscore" min="0" type="number" max="5000000" value="650000" /> <span class="tooltiptext translate9"> |
||||
The maximum score you can get from playing a song using <font color="aqua">Free Live</font>.<br> |
||||
<sub>(Use 0 for Rehearsals Only)</sub></span></span> |
||||
</div> |
||||
<div class="munigrid"> |
||||
<span class="tooltip"><label for="advanced" alt="Yes" |
||||
><b class="translate10">Advanced Options?</b></label |
||||
><input id="advanced" type="checkbox" onclick="toggle()" /><span class="tooltiptext translate11"> |
||||
Enable voltage & EP limits.</span></span> |
||||
<div id="advanced2" style="visibility:hidden"> |
||||
<label for="lowest" class="translate12"> |
||||
Use voltage until: |
||||
</label><input style="width:96px;" id="lowest" type="number" min="10" step="2" value="80"> EP<br> |
||||
<label for="maxvolt" class="translate13"> |
||||
Max Voltage to use: |
||||
</label> <input style="width:64px;" id="maxvolt" type="number" min="0" value="20"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<hr /> |
||||
<b><label for="starting" class="translate14">Starting EP: </label |
||||
></b><input id="starting" min="0" type="number" value="100000" /> |
||||
<span style="font-size: 32px; padding: 0px 10px 0px 10px">➔</span> |
||||
<b><label for="ending" class="translate15">Target EP: </label |
||||
></b><input id="ending" min="0" type="number" value="104000" /> |
||||
<br /> |
||||
<br /> |
||||
<button |
||||
id="calculate" |
||||
style=" |
||||
background-color: #ccddff; |
||||
margin-left: 20px; |
||||
width: 240px; |
||||
height: 32px; |
||||
font-size: 18px; |
||||
" |
||||
onclick="test()" class="translate16" |
||||
> |
||||
Calculate |
||||
</button> |
||||
</fieldset> |
||||
<div style="display: flex; justify-content: stretch; align-items: center"> |
||||
<textarea rows="20" cols="160" id="console" disabled> </textarea> |
||||
</div> |
||||
<sub><u>Tips</u></sub> |
||||
<ul> |
||||
<li class="translate19">Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick.</li> |
||||
<li class="translate20">When you get close to the score you need in Free Live, purposely fail the song. Notes are worth 10% their normal value when you have 0 health so you can finish easily.</li> |
||||
<li class="translate21">The <b>"Flexible Team"</b> option gives you the fastest park, but at the expense of more voltage.</li> |
||||
</ul> |
||||
<script src="muni.js"></script> |
||||
<script> |
||||
document.getElementById("ips").value = ""; |
||||
</script> |
||||
</body> |
||||
</html> |
||||
|
Loading…
Reference in new issue