parent
20d039182b
commit
0f5dd63767
@ -0,0 +1,107 @@ |
|||||||
|
function English(str) { |
||||||
|
switch (str) { |
||||||
|
case 1:{ //Tab Title of Webpage
|
||||||
|
return "D4DJ Parkings Calculator | Powered by Muni" |
||||||
|
}break; |
||||||
|
case 2:{ //Header Title (Top) of Webpage
|
||||||
|
return "D4DJ Event Parking Calculator" |
||||||
|
}break; |
||||||
|
case 3:{ //Set up your options (Category Title)
|
||||||
|
return "Parking Configuration" |
||||||
|
}break; |
||||||
|
case 4:{ //Selection for event type: Poker/Raid
|
||||||
|
return "Poker/Raid" |
||||||
|
}break; |
||||||
|
case 5:{ //Selection for event type: Bingo
|
||||||
|
return "Bingo" |
||||||
|
}break; |
||||||
|
case 6:{ //Selection for event type: Medley
|
||||||
|
return "Medley" |
||||||
|
}break; |
||||||
|
case 7:{ //Label for team % selector (Include ":")
|
||||||
|
return "Event Team Bonus:" |
||||||
|
}break; |
||||||
|
case 17:{ //Label for whether to enable flexible team options.
|
||||||
|
return "Flexible Team?" |
||||||
|
}break; |
||||||
|
case 8:{ //Tooltip for flexible team options (mouseover)
|
||||||
|
return "If turned on, calculates scoring options using lower % teams also." |
||||||
|
}break; |
||||||
|
case 18:{ //Label for what the max score in free lives is.
|
||||||
|
return "Max Free Live Score:" |
||||||
|
}break; |
||||||
|
case 9:{ //Tooltip for what the max score in free lives is. (Setting it to 0 forces the calculator to use Rehearsal)
|
||||||
|
return "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>" |
||||||
|
}break; |
||||||
|
case 10:{ //Label for Advanced Settings toggle.
|
||||||
|
return "Advanced Options?" |
||||||
|
}break; |
||||||
|
case 11:{ //Tooltip for Advanced Settings toggle.
|
||||||
|
return "Enable voltage & EP limits." |
||||||
|
}break; |
||||||
|
case 12:{ //Label for setting the lowest EP where voltage is allowed.
|
||||||
|
return "Use voltage until: " |
||||||
|
}break; |
||||||
|
case 13:{ //Label for setting the total amount of voltage the calculator may consume.
|
||||||
|
return "Max Voltage to use:" |
||||||
|
}break; |
||||||
|
case 14:{ //Label for setting the Starting EP amount.
|
||||||
|
return "Starting EP:" |
||||||
|
}break; |
||||||
|
case 15:{ //Label for setting the final EP amount.
|
||||||
|
return "Target EP:" |
||||||
|
}break; |
||||||
|
case 16:{ //The text for the button users click to run the calculator.
|
||||||
|
return "Calculate" |
||||||
|
}break; |
||||||
|
case 19:{ //Tip: Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick.
|
||||||
|
return "Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick." |
||||||
|
}break; |
||||||
|
case 20:{ //Tip: 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.
|
||||||
|
return "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." |
||||||
|
}break; |
||||||
|
case 21:{ //Tip: The "Flexible Team" option gives you the fastest park, but at the expense of more voltage.
|
||||||
|
return "The <b>\"Flexible Team\"</b> option gives you the fastest park, but at the expense of more voltage." |
||||||
|
}break; |
||||||
|
case "%INITIAL%":{ //This message is the first thing to display for a normal calculation.
|
||||||
|
//Sample message:
|
||||||
|
/* |
||||||
|
Calculating from 100000 to 104000 for event type Poker/Raid... |
||||||
|
(All games are done in Free Live) |
||||||
|
|
||||||
|
Found a park! 9 steps and 13 voltage required! |
||||||
|
*/ |
||||||
|
//Variables for this message:
|
||||||
|
/* |
||||||
|
Calculating from %START% to %TARGET% for event type %EVENT%... |
||||||
|
(All games are done in Free Live) |
||||||
|
|
||||||
|
Found a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required! |
||||||
|
*/ |
||||||
|
return "Calculating from %START% to %TARGET% for event type %EVENT%...\n\t(All games are done in Free Live)\n\nFound a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required!" |
||||||
|
}break; |
||||||
|
case "%STEP%":{ //This message is displayed for each normal voltage step in the process.
|
||||||
|
//Sample message:
|
||||||
|
/* |
||||||
|
Step 1) Using 5 voltage w/160% team, score between 640000~649999 pts. EP +1480. Remaining:2520 EP
|
||||||
|
*/ |
||||||
|
//Variables for this message:
|
||||||
|
/* |
||||||
|
Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP
|
||||||
|
*/ |
||||||
|
return "Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
||||||
|
}break; |
||||||
|
case "%REHEARSAL%":{ //Similar to above, but for a rehearsal step instead.
|
||||||
|
return "Step %STEP%) Use Rehearsal w/%PERCENT%% team. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
||||||
|
}break; |
||||||
|
case "%LARGEGAP%":{ //This message is displayed if the Starting EP and Final EP gap is too big for reasonable calculations.
|
||||||
|
return "Get closer to target score before using parking calculator!"; |
||||||
|
}break; |
||||||
|
case "%FAILED%":{ //This message is displayed if it's impossible to park.
|
||||||
|
return "Impossible to park using this team!" |
||||||
|
}break; |
||||||
|
default:{ |
||||||
|
return "???" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,107 @@ |
|||||||
|
function Japanese(str) { |
||||||
|
switch (str) { |
||||||
|
case 1:{ //Tab Title of Webpage
|
||||||
|
return "D4DJ Parking Calculator | Powered by Muni" |
||||||
|
}break; |
||||||
|
case 2:{ //Header Title (Top) of Webpage
|
||||||
|
return "D4DJ Event Parking Calculator" |
||||||
|
}break; |
||||||
|
case 3:{ //Set up your options (Category Title)
|
||||||
|
return "Parking Configuration" |
||||||
|
}break; |
||||||
|
case 4:{ //Selection for event type: Poker/Raid
|
||||||
|
return "Poker/Raid" |
||||||
|
}break; |
||||||
|
case 5:{ //Selection for event type: Bingo
|
||||||
|
return "Bingo" |
||||||
|
}break; |
||||||
|
case 6:{ //Selection for event type: Medley
|
||||||
|
return "Medley" |
||||||
|
}break; |
||||||
|
case 7:{ //Label for team % selector (Include ":")
|
||||||
|
return "Event Team Bonus:" |
||||||
|
}break; |
||||||
|
case 17:{ //Label for whether to enable flexible team options.
|
||||||
|
return "Flexible Team?" |
||||||
|
}break; |
||||||
|
case 8:{ //Tooltip for flexible team options (mouseover)
|
||||||
|
return "If turned on, calculates scoring options using lower % teams also." |
||||||
|
}break; |
||||||
|
case 18:{ //Label for what the max score in free lives is.
|
||||||
|
return "Max Free Live Score:" |
||||||
|
}break; |
||||||
|
case 9:{ //Tooltip for what the max score in free lives is. (Setting it to 0 forces the calculator to use Rehearsal)
|
||||||
|
return "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>" |
||||||
|
}break; |
||||||
|
case 10:{ //Label for Advanced Settings toggle.
|
||||||
|
return "Advanced Options?" |
||||||
|
}break; |
||||||
|
case 11:{ //Tooltip for Advanced Settings toggle.
|
||||||
|
return "Enable voltage & EP limits." |
||||||
|
}break; |
||||||
|
case 12:{ //Label for setting the lowest EP where voltage is allowed.
|
||||||
|
return "Use voltage until: " |
||||||
|
}break; |
||||||
|
case 13:{ //Label for setting the total amount of voltage the calculator may consume.
|
||||||
|
return "Max Voltage to use:" |
||||||
|
}break; |
||||||
|
case 14:{ //Label for setting the Starting EP amount.
|
||||||
|
return "Starting EP:" |
||||||
|
}break; |
||||||
|
case 15:{ //Label for setting the final EP amount.
|
||||||
|
return "Target EP:" |
||||||
|
}break; |
||||||
|
case 16:{ //The text for the button users click to run the calculator.
|
||||||
|
return "Calculate" |
||||||
|
}break; |
||||||
|
case 19:{ //Tip: Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick.
|
||||||
|
return "Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick." |
||||||
|
}break; |
||||||
|
case 20:{ //Tip: 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.
|
||||||
|
return "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." |
||||||
|
}break; |
||||||
|
case 21:{ //Tip: The "Flexible Team" option gives you the fastest park, but at the expense of more voltage.
|
||||||
|
return "The <b>\"Flexible Team\"</b> option gives you the fastest park, but at the expense of more voltage." |
||||||
|
}break; |
||||||
|
case "%INITIAL%":{ //This message is the first thing to display for a normal calculation.
|
||||||
|
//Sample message:
|
||||||
|
/* |
||||||
|
Calculating from 100000 to 104000 for event type Poker/Raid... |
||||||
|
(All games are done in Free Live) |
||||||
|
|
||||||
|
Found a park! 9 steps and 13 voltage required! |
||||||
|
*/ |
||||||
|
//Variables for this message:
|
||||||
|
/* |
||||||
|
Calculating from %START% to %TARGET% for event type %EVENT%... |
||||||
|
(All games are done in Free Live) |
||||||
|
|
||||||
|
Found a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required! |
||||||
|
*/ |
||||||
|
return "Calculating from %START% to %TARGET% for event type %EVENT%...\n\t(All games are done in Free Live)\n\nFound a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required!" |
||||||
|
}break; |
||||||
|
case "%STEP%":{ //This message is displayed for each normal voltage step in the process.
|
||||||
|
//Sample message:
|
||||||
|
/* |
||||||
|
Step 1) Using 5 voltage w/160% team, score between 640000~649999 pts. EP +1480. Remaining:2520 EP
|
||||||
|
*/ |
||||||
|
//Variables for this message:
|
||||||
|
/* |
||||||
|
Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP
|
||||||
|
*/ |
||||||
|
return "Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
||||||
|
}break; |
||||||
|
case "%REHEARSAL%":{ //Similar to above, but for a rehearsal step instead.
|
||||||
|
return "Step %STEP%) Use Rehearsal w/%PERCENT%% team. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
||||||
|
}break; |
||||||
|
case "%LARGEGAP%":{ //This message is displayed if the Starting EP and Final EP gap is too big for reasonable calculations.
|
||||||
|
return "Get closer to target score before using parking calculator!"; |
||||||
|
}break; |
||||||
|
case "%FAILED%":{ //This message is displayed if it's impossible to park.
|
||||||
|
return "Impossible to park using this team!" |
||||||
|
}break; |
||||||
|
default:{ //Default to English when translation doesn't exist.
|
||||||
|
return English(str) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,527 +1,397 @@ |
|||||||
const MAXSTEPS= 10000 |
const MAXSTEPS= 10000 |
||||||
|
|
||||||
function Korean(str) { |
function ConvertVariables(str,data) { |
||||||
switch (str) { |
return str |
||||||
case "Hello":{ |
.replaceAll("%START%",data.start) |
||||||
return "안녕하세요" |
.replaceAll("%TARGET%",data.target) |
||||||
}break; |
.replaceAll("%EVENT%",data.event) |
||||||
default:{ |
.replaceAll("%STEPS%",data.steps) |
||||||
return English(str) |
.replaceAll("%PLURAL_STEPS%",Plural(data.steps)) |
||||||
} |
.replaceAll("%VOLTAGE%",data.voltage) |
||||||
} |
.replaceAll("%STEP%",data.step) |
||||||
} |
.replaceAll("%PERCENT%",data.percent) |
||||||
|
.replaceAll("%LOWSCORE%",data.lowscore) |
||||||
function English(str) { |
.replaceAll("%HIGHSCORE%",data.highscore) |
||||||
switch (str) { |
.replaceAll("%EPGAIN%",data.epgain) |
||||||
case 1:{ //Tab Title of Webpage
|
.replaceAll("%REMAINING%",data.remaining) |
||||||
return "D4DJ Parking Calculator | Powered by Muni" |
} |
||||||
}break; |
|
||||||
case 2:{ //Header Title (Top) of Webpage
|
var LANGUAGE=English |
||||||
return "D4DJ Event Parking Calculator" |
var LANGUAGELIST={English:{name:"English",translation:English},Japanese:{name:"Japanese",translation:Japanese}/*,Korean:{name:"한국어",translation:Korean}*/} |
||||||
}break; |
var TRANSLATEELEMENTS=100 //Increase as number of translated elements increases.
|
||||||
case 3:{ //Set up your options (Category Title)
|
|
||||||
return "Parking Configuration" |
function Plural(t) { |
||||||
}break; |
return t==1?"":"s" |
||||||
case 4:{ //Selection for event type: Poker/Raid
|
} |
||||||
return "Poker/Raid" |
|
||||||
}break; |
function ConvertLanguage() { |
||||||
case 5:{ //Selection for event type: Bingo
|
for (var i=0;i<TRANSLATEELEMENTS;i++) { |
||||||
return "Bingo" |
var e = document.getElementsByClassName("translate"+i)[0]; |
||||||
}break; |
if (e) { |
||||||
case 6:{ //Selection for event type: Medley
|
e.innerHTML=LANGUAGE(i) |
||||||
return "Medley" |
} |
||||||
}break; |
//document.getElementById("console").value+=LANGUAGE(e.innerHTML)+"\n"
|
||||||
case 7:{ //Label for team % selector (Include ":")
|
} |
||||||
return "Event Team Bonus:" |
} |
||||||
}break; |
ConvertLanguage() |
||||||
case 17:{ //Label for whether to enable flexible team options.
|
|
||||||
return "Flexible Team?" |
function toggle(){ |
||||||
}break; |
//document.getElementById("console").value+=JSON.stringify(document.getElementById("advanced"))
|
||||||
case 8:{ //Tooltip for flexible team options (mouseover)
|
document.getElementById("advanced2").style.visibility=document.getElementById("advanced").checked?"visible":"hidden" |
||||||
return "If turned on, calculates scoring options using lower % teams also." |
} |
||||||
}break; |
|
||||||
case 18:{ //Label for what the max score in free lives is.
|
function test(){ |
||||||
return "Max Free Live Score:" |
|
||||||
}break; |
var start = Math.abs(Math.max(0,Number(document.getElementById("starting").value))) |
||||||
case 9:{ //Tooltip for what the max score in free lives is. (Setting it to 0 forces the calculator to use Rehearsal)
|
var end = Math.abs(Math.max(0,Number(document.getElementById("ending").value))) |
||||||
return "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>" |
var bonus = Number(document.getElementById("team").value) |
||||||
}break; |
var type = (document.getElementById("Bingo").checked?"Bingo": |
||||||
case 10:{ //Label for Advanced Settings toggle.
|
document.getElementById("Poker").checked?"Poker/Raid": |
||||||
return "Advanced Options?" |
"Medley") |
||||||
}break; |
var flexible = document.getElementById("flexible").checked |
||||||
case 11:{ //Tooltip for Advanced Settings toggle.
|
//document.getElementById("console").value=flexible+"...\n\n"
|
||||||
return "Enable voltage & EP limits." |
var step=1 |
||||||
}break; |
var flameCount=0 |
||||||
case 12:{ //Label for setting the lowest EP where voltage is allowed.
|
var originalTarget=start |
||||||
return "Use voltage until: " |
document.getElementById("console").value="" |
||||||
}break; |
|
||||||
case 13:{ //Label for setting the total amount of voltage the calculator may consume.
|
var interval = (type=="Medley")?15000:10000 |
||||||
return "Max Voltage to use:" |
|
||||||
}break; |
var maxscore = Math.floor(Math.abs(Math.min(5000000,Math.max(0,Number(document.getElementById("maxscore").value))))/interval)*interval |
||||||
case 14:{ //Label for setting the Starting EP amount.
|
|
||||||
return "Starting EP:" |
function EPCalc(voltage,score,bonus) { |
||||||
}break; |
if (voltage>0) { |
||||||
case 15:{ //Label for setting the final EP amount.
|
switch (type) { |
||||||
return "Target EP:" |
case "Bingo":{ |
||||||
}break; |
return voltage * Math.floor((1 + bonus)*Math.max(10,Math.floor(score/interval))) |
||||||
case 16:{ //The text for the button users click to run the calculator.
|
}break; |
||||||
return "Calculate" |
case "Medley":{ |
||||||
}break; |
return voltage * Math.floor((1 + bonus)*(10+Math.floor(score/interval))) |
||||||
case 19:{ //Tip: Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick.
|
}break; |
||||||
return "Here's the Light on EX or Synchrogazer on Hard/EX difficulty are some of the highest scoring songs you can pick." |
case "Poker/Raid":{ |
||||||
}break; |
return voltage * Math.floor((1 + bonus)*(50 + Math.floor(score/interval))) |
||||||
case 20:{ //Tip: 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.
|
}break; |
||||||
return "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." |
} |
||||||
}break; |
} else { |
||||||
case 21:{ //Tip: The "Flexible Team" option gives you the fastest park, but at the expense of more voltage.
|
return Math.round(bonus*10)+10 |
||||||
return "The <b>\"Flexible Team\"</b> option gives you the fastest park, but at the expense of more voltage." |
} |
||||||
}break; |
} |
||||||
case "%INITIAL%":{ //This message is the first thing to display for a normal calculation.
|
|
||||||
//Sample message:
|
function EvenOdd(val) { |
||||||
/* |
return val%2==0?"even":"odd" |
||||||
Calculating from 100000 to 104000 for event type Poker/Raid... |
} |
||||||
(All games are done in Free Live) |
|
||||||
|
function TryBiggestGain(tbonus) { |
||||||
Found a park! 9 steps and 13 voltage required! |
var voltage=5 |
||||||
*/ |
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
||||||
//Variables for this message:
|
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"
|
||||||
Calculating from %START% to %TARGET% for event type %EVENT%... |
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
||||||
(All games are done in Free Live) |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
|
start+=EPCalc(voltage,i,tbonus) |
||||||
Found a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required! |
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" |
||||||
return "Calculating from %START% to %TARGET% for event type %EVENT%...\n\t(All games are done in Free Live)\n\nFound a park! %STEPS% step%PLURAL_STEPS% and %VOLTAGE% voltage required!" |
/*"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"*/ |
||||||
}break; |
return true |
||||||
case "%STEP%":{ //This message is displayed for each normal voltage step in the process.
|
} |
||||||
//Sample message:
|
} |
||||||
/* |
} |
||||||
Step 1) Using 5 voltage w/160% team, score between 640000~649999 pts. EP +1480. Remaining:2520 EP
|
return false |
||||||
*/ |
} |
||||||
//Variables for this message:
|
|
||||||
/* |
function TrySmallerGain(voltage,tbonus) { |
||||||
Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP
|
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))) { |
||||||
return "Step %STEP%) Using %VOLTAGE% voltage w/%PERCENT%% team, score between %LOWSCORE%~%HIGHSCORE% pts. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||||
}break; |
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||||
case "%REHEARSAL%":{ //Similar to above, but for a rehearsal step instead.
|
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
return "Step %STEP%) Use Rehearsal w/%PERCENT%% team. EP +%EPGAIN%. Remaining:%REMAINING% EP" |
start+=EPCalc(voltage,i,tbonus) |
||||||
}break; |
flameCount+=voltage |
||||||
case "%LARGEGAP%":{ //This message is displayed if the Starting EP and Final EP gap is too big for reasonable calculations.
|
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" |
||||||
return "Get closer to target score before using parking calculator!"; |
/*"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"*/ |
||||||
}break; |
return true |
||||||
case "%FAILED%":{ //This message is displayed if it's impossible to park.
|
} |
||||||
return "Impossible to park using this team!" |
} |
||||||
}break; |
} |
||||||
default:{ |
return false |
||||||
return "???" |
} |
||||||
} |
|
||||||
} |
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))) { |
||||||
function Reveal(str) { |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||||
switch (str) { |
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
||||||
case "Hello":{ |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
return "Hi" |
start+=EPCalc(voltage,i,tbonus) |
||||||
}break; |
flameCount+=voltage |
||||||
default:{ |
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" |
||||||
return English(str) |
/*"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 |
||||||
} |
} |
||||||
} |
} |
||||||
|
} |
||||||
function ConvertVariables(str,data) { |
for (var i=maxscore;i>=0;i-=interval) { |
||||||
return str |
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
||||||
.replaceAll("%START%",data.start) |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
||||||
.replaceAll("%TARGET%",data.target) |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
.replaceAll("%EVENT%",data.event) |
start+=EPCalc(voltage,i,tbonus) |
||||||
.replaceAll("%STEPS%",data.steps) |
flameCount+=voltage |
||||||
.replaceAll("%PLURAL_STEPS%",Plural(data.steps)) |
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" |
||||||
.replaceAll("%VOLTAGE%",data.voltage) |
/*"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"*/ |
||||||
.replaceAll("%STEP%",data.step) |
return true |
||||||
.replaceAll("%PERCENT%",data.percent) |
} |
||||||
.replaceAll("%LOWSCORE%",data.lowscore) |
} |
||||||
.replaceAll("%HIGHSCORE%",data.highscore) |
/*for (var i=maxscore;i>=0;i-=interval) { |
||||||
.replaceAll("%EPGAIN%",data.epgain) |
if ((start+EPCalc(voltage,i,tbonus))==end) { |
||||||
.replaceAll("%REMAINING%",data.remaining) |
//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) |
||||||
var LANGUAGE=Reveal |
flameCount+=voltage |
||||||
var LANGUAGELIST={English:English,Korean:Korean} |
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" |
||||||
var TRANSLATEELEMENTS=100 //Increase as number of translated elements increases.
|
return true |
||||||
|
} |
||||||
function Plural(t) { |
}*/ |
||||||
return t==1?"":"s" |
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"
|
||||||
function ConvertLanguage() { |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
for (var i=0;i<TRANSLATEELEMENTS;i++) { |
start+=EPCalc(voltage,i,tbonus) |
||||||
var e = document.getElementsByClassName("translate"+i)[0]; |
flameCount+=voltage |
||||||
if (e) { |
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" |
||||||
e.innerHTML=LANGUAGE(i) |
/*"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 |
||||||
//document.getElementById("console").value+=LANGUAGE(e.innerHTML)+"\n"
|
} |
||||||
} |
} |
||||||
} |
return false |
||||||
ConvertLanguage() |
} |
||||||
|
|
||||||
function toggle(){ |
function TryEqualGain(voltage,tbonus) { |
||||||
//document.getElementById("console").value+=JSON.stringify(document.getElementById("advanced"))
|
for (var i=maxscore;i>=0;i-=interval) { |
||||||
document.getElementById("advanced2").style.visibility=document.getElementById("advanced").checked?"visible":"hidden" |
//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"
|
||||||
function test(){ |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
||||||
|
start+=EPCalc(voltage,i,tbonus) |
||||||
var start = Math.abs(Math.max(0,Number(document.getElementById("starting").value))) |
flameCount+=voltage |
||||||
var end = Math.abs(Math.max(0,Number(document.getElementById("ending").value))) |
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" |
||||||
var bonus = Number(document.getElementById("team").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"*/ |
||||||
var type = (document.getElementById("Bingo").checked?"Bingo": |
return true |
||||||
document.getElementById("Poker").checked?"Poker/Raid": |
} |
||||||
"Medley") |
} |
||||||
var flexible = document.getElementById("flexible").checked |
if (end==start) { |
||||||
//document.getElementById("console").value=flexible+"...\n\n"
|
return false |
||||||
var step=1 |
} else { |
||||||
var flameCount=0 |
return undefined |
||||||
var originalTarget=start |
} |
||||||
document.getElementById("console").value="" |
} |
||||||
|
|
||||||
var interval = (type=="Medley")?15000:10000 |
function TryMatchingRehearsal(tbonus) { |
||||||
|
//document.getElementById("console").value+=(Math.round(tbonus*10))+10
|
||||||
var maxscore = Math.floor(Math.abs(Math.min(5000000,Math.max(0,Number(document.getElementById("maxscore").value))))/interval)*interval |
if (end-start==(Math.round(tbonus*10))+10) { |
||||||
|
var gain=(Math.round(tbonus*10))+10 |
||||||
function EPCalc(voltage,score,bonus) { |
start+=gain |
||||||
if (voltage>0) { |
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
||||||
switch (type) { |
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||||
case "Bingo":{ |
return false |
||||||
return voltage * Math.floor((1 + bonus)*Math.max(10,Math.floor(score/interval))) |
} |
||||||
}break; |
return true |
||||||
case "Medley":{ |
} |
||||||
return voltage * Math.floor((1 + bonus)*(10+Math.floor(score/interval))) |
|
||||||
}break; |
function TryRehearsal(tbonus) { |
||||||
case "Poker/Raid":{ |
if (end==start) { |
||||||
return voltage * Math.floor((1 + bonus)*(50 + Math.floor(score/interval))) |
return false |
||||||
}break; |
} |
||||||
} |
var voltage=0 |
||||||
} else { |
if ((end-start)%2!==0) { |
||||||
return Math.round(bonus*10)+10 |
return undefined |
||||||
} |
} |
||||||
} |
|
||||||
|
if (end-start>(10+Math.round(tbonus*10))+10) { |
||||||
function EvenOdd(val) { |
var gain=(10+Math.round(tbonus*10)) |
||||||
return val%2==0?"even":"odd" |
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" |
||||||
function TryBiggestGain(tbonus) { |
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||||
var voltage=5 |
return true |
||||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
} else
|
||||||
if (start+EPCalc(voltage,i,tbonus)<end-10||((start+EPCalc(voltage,i,tbonus)==end)&&((end-start)%2==1||(end-start)>26))) { |
for (var j=tbonus;j>=0;j-=0.2) { |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
result = TryMatchingRehearsal(j) |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
if (!result) { |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
return false |
||||||
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" |
if (end-start>=20) { |
||||||
/*"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"*/ |
var gain=end-start-10 |
||||||
return true |
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 false |
return true |
||||||
} |
} else
|
||||||
|
if ((end-start)%10==0) { |
||||||
function TrySmallerGain(voltage,tbonus) { |
var gain=10 |
||||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
start+=gain |
||||||
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+="3)"
|
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:0,epgain:gain,remaining:end-start})+"\n" |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
/*"Step "+(step++)+") Use Rehearsal w/0% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
return false |
||||||
start+=EPCalc(voltage,i,tbonus) |
} else
|
||||||
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" |
var gain=end-start |
||||||
/*"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"*/ |
if (((gain-10)*10)>=0) { |
||||||
return true |
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 |
return false
|
||||||
} |
} else { |
||||||
|
return undefined |
||||||
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"
|
return false |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)||start+EPCalc(voltage,i,tbonus)==end) { |
/*var voltage=0 |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
if (end-start>36) { |
||||||
start+=EPCalc(voltage,i,tbonus) |
start+=26 |
||||||
flameCount+=voltage |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
||||||
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" |
return true |
||||||
/*"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"*/ |
} else |
||||||
return true |
if (end-start>20) { |
||||||
} |
var bonus = (end-start-20)*10 |
||||||
} |
var gain = end-start-10 |
||||||
} |
start+=end-start-10 |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
if ((bonus/10)%2!=0) { |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
return undefined |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n"
|
} else { |
||||||
start+=EPCalc(voltage,i,tbonus) |
return true |
||||||
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" |
} else { |
||||||
/*"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"*/ |
if (end-start<10||(end-start)%2!=0) { |
||||||
return true |
return undefined |
||||||
} |
} |
||||||
} |
var bonus = ((end-start-10)/20)*2 |
||||||
/*for (var i=maxscore;i>=0;i-=interval) { |
start+=end-start |
||||||
if ((start+EPCalc(voltage,i,tbonus))==end) { |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((bonus)*100)+"% team. EP +"+EPCalc(voltage,1,bonus)+". Remaining:"+(end-start)+" EP \n" |
||||||
//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"
|
return false |
||||||
start+=EPCalc(voltage,i,tbonus) |
} |
||||||
flameCount+=voltage |
return true*/ |
||||||
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 |
|
||||||
} |
if ((end-start)>1000000) { |
||||||
}*/ |
document.getElementById("console").value= |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
LANGUAGE("%LARGEGAP%") |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26))) { |
//"Get closer to target score before using parking calculator!"
|
||||||
//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"
|
else { |
||||||
start+=EPCalc(voltage,i,tbonus) |
var result=true |
||||||
flameCount+=voltage |
if (maxscore>0) { |
||||||
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" |
if (flexible) { |
||||||
/*"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"*/ |
for (var j=bonus;j>=0;j-=0.2) { |
||||||
return true |
while (TryBiggestGain(j)) { |
||||||
} |
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||||
} |
} |
||||||
return false |
for (var i=4;i>0;i--) { |
||||||
} |
while (TrySmallerGain(i,j)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||||
function TryEqualGain(voltage,tbonus) { |
} |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
} |
||||||
//document.getElementById("console").value+=(start+EPCalc(voltage,i,tbonus))+"/"+end+"\n"
|
for (var i=5;i>0;i--) { |
||||||
if (((start+EPCalc(voltage,i,tbonus))==end)&&((end-start)%2==1||(end-start)>26)) { |
while (TrySmolGain(i,j)) { |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n"
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\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" |
} else { |
||||||
/*"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"*/ |
while (TryBiggestGain(bonus)) { |
||||||
return true |
//document.getElementById("console").value+=+start+" EP"+"\n"
|
||||||
} |
} |
||||||
} |
for (var i=4;i>0;i--) { |
||||||
if (end==start) { |
while (TrySmallerGain(i,bonus)) { |
||||||
return false |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||||
} else { |
} |
||||||
return undefined |
} |
||||||
} |
for (var i=5;i>0;i--) { |
||||||
} |
while (TrySmolGain(i,bonus)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||||
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 |
for (var j=bonus;j>=0;j-=0.2) { |
||||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
result = TryMatchingRehearsal(j) |
||||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
if (!result) { |
||||||
return false |
break; |
||||||
} |
} |
||||||
return true |
} |
||||||
} |
if (result) { |
||||||
|
for (var j=1.6;j>=0;j-=0.2) { |
||||||
function TryRehearsal(tbonus) { |
result = TryMatchingRehearsal(j) |
||||||
if (end==start) { |
if (!result) { |
||||||
return false |
break; |
||||||
} |
} |
||||||
var voltage=0 |
} |
||||||
if ((end-start)%2!==0) { |
} |
||||||
return undefined |
if (result) { |
||||||
} |
do { |
||||||
|
if (flexible) { |
||||||
if (end-start>(10+Math.round(tbonus*10))+10) { |
for (var j=bonus;j>=0;j-=0.2) { |
||||||
var gain=(10+Math.round(tbonus*10)) |
var prevstart = 0 |
||||||
start+=gain |
result = TryRehearsal(j) |
||||||
//document.getElementById("console").value+="1)"
|
if (start!==prevstart) { |
||||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:Math.round(tbonus*100),epgain:gain,remaining:end-start})+"\n" |
break; |
||||||
/*"Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
} |
||||||
return true |
} |
||||||
} else
|
} else { |
||||||
for (var j=tbonus;j>=0;j-=0.2) { |
result = TryRehearsal(bonus) |
||||||
result = TryMatchingRehearsal(j) |
} |
||||||
if (!result) { |
} while (result); |
||||||
return false |
} |
||||||
} |
|
||||||
} |
|
||||||
if (end-start>=20) { |
if (maxscore>0) { |
||||||
var gain=end-start-10 |
if (flexible) { |
||||||
start+=gain |
for (var i=5;i>0;i--) { |
||||||
//document.getElementById("console").value+="2)"
|
for (var j=bonus;j>=0;j-=0.2) { |
||||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
while (result = TryEqualGain(i,j)) { |
||||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"*/ |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||||
return true |
} |
||||||
} else
|
} |
||||||
if ((end-start)%10==0) { |
} |
||||||
var gain=10 |
} else { |
||||||
start+=gain |
for (var i=5;i>0;i--) { |
||||||
//document.getElementById("console").value+="3)"
|
while (result = TryEqualGain(i,bonus)) { |
||||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:0,epgain:gain,remaining:end-start})+"\n" |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\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) { |
function ConvertEvent(str) { |
||||||
start+=gain |
switch (str) { |
||||||
//document.getElementById("console").value+="4)"
|
case "Poker/Raid":{ |
||||||
document.getElementById("console").value+=ConvertVariables(LANGUAGE("%REHEARSAL%"),{step:step++,percent:((gain-10)*10),epgain:gain,remaining:end-start})+"\n" |
return LANGUAGE(4) |
||||||
/*"Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+(gain)+". Remaining:"+(end-start)+" EP \n"*/ |
}break; |
||||||
return false
|
case "Bingo":{ |
||||||
} else { |
return LANGUAGE(5) |
||||||
return undefined |
}break; |
||||||
} |
case "Medley":{ |
||||||
} |
return LANGUAGE(6) |
||||||
|
}break; |
||||||
return false |
} |
||||||
/*var voltage=0 |
} |
||||||
if (end-start>36) { |
|
||||||
start+=26 |
start=end |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
if (result===undefined) { |
||||||
return true |
document.getElementById("console").value=LANGUAGE("%FAILED%") |
||||||
} else |
//"Impossible to park using this team!"
|
||||||
if (end-start>20) { |
} else { |
||||||
var bonus = (end-start-20)*10 |
document.getElementById("console").value=ConvertVariables(LANGUAGE("%INITIAL%"),{ |
||||||
var gain = end-start-10 |
start:originalTarget,target:end,event:ConvertEvent(type),steps:(step-1),voltage:flameCount})+"\n\n"+document.getElementById("console").value |
||||||
start+=end-start-10 |
/*"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++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
} |
||||||
if ((bonus/10)%2!=0) { |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
|
||||||
return undefined |
step++ |
||||||
} 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++ |
|
||||||
} |
|
||||||
} |
|
||||||
|
Loading…
Reference in new issue