Skip to content

Instantly share code, notes, and snippets.

@zolunx10
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zolunx10/303bbe504ec8e6394c73 to your computer and use it in GitHub Desktop.
Save zolunx10/303bbe504ec8e6394c73 to your computer and use it in GitHub Desktop.
LoveLive活动获得pt计算(假设lp都不浪费)
// data ref <http://www59.atwiki.jp/lovelive-sif/pages/23.html>
var RANK_LP = [25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125];
var RANK_EXP = [11,13,16,20,26,32,39,48,57,67,79,91,105,120,135,152,170,189,208,229,251,274,298,323,349,376,405,434,464,495,528,561,596,620,655,689,724,758,792,827,861,896,931,965,1000,1034,1068,1103,1137,1171,1205,1241,1275,1309,1344,1378,1413,1447,1482,1516,1550,1585,1620,1654,1688,1722,1757,1791,1826,1860,1894,1930,1964,1998,2032,2067,2101,2136,2170,2205,2239,2274,2308,2343,2377,2412,2446,2480,2515,2549,2584,2618,2652,2687,2722,2756,2790,2825,2860,2894,2929,2963,2998,3032,3066,3101,3135,3170,3204,3239,3273,3307,3341,3376,3410,3446,3480,3514,3548,3583,3618,3652,3687,3721,3756,3790,3825,3858,3893,3928,3962,3996,4031,4065,4100,4134,4169,4203,4237,4272,4306,4341,4375,4409,4445,4479,4514,4548,4582,4616,4651,4686,4720,4754,4789,4823,4858,4892,4927,4961,4996,5030,5064,5099,5134,5168,5202,5237,5271,5306,5340,5375,5409,5444,5478,5512,5547,5581,5616,5650,5685,5719,5754,5788,5822,5857,5891,5926,5960,5994,6029,6063,6098,6132,6167,6201,6236,6270,6305,6339];
var SCORE_RANKS = {
hard: {
S: 233,
A: 226,
B: 220,
C: 216
},
ex: {
S: 404,
A: 386,
B: 364,
C: 346
}
}
/****
* @params remainMins 剩余分钟数
* @params currentExp 当前经验
* @params currentRank 当前玩家等级
* @params currentKey 当前活动搜集品数
* @params comboRank 活动曲combo等级, 大写SABCD
* 假设活动曲都打hard且能分数S
*/
function calPT(remainMins, currentExp, currentRank, currentKey, comboRank) {
// 1h = 10lp, 15lp = 16pt + 16key, 25lp = 27lp+27key 45key = 1 comboRank
currentExp = currentExp || 0;
currentRank = currentRank || 1000;
comboRank = comboRank || 'C';
currentKey = currentKey || 0;
var baseLp = Math.floor(remainMins / 6);
var songs = Math.floor(lp / 15);
var lp = baseLp, key = 0, tKey = currentKey;
while (tKey >= 45 || lp >= 15) {
if (lp >= 25) { // 打日替曲hard
lp -= 25;
key += 27; tKey += 27;
currentExp += 83;
} else if (lp >= 15) { // 多余的打普通曲hard
lp -= 15;
key += 16; tKey += 16;
currentExp += 46;
}
if (currentRank < 200 && currentExp >= RANK_EXP[currentRank-1]) {
currentExp -= RANK_EXP[currentRank-1];
currentRank++;
lp += RANK_LP[currentRank];
}
if (tKey >= 45) {
tKey -= 45;
currentExp += 46;
}
}
var pt = key + Math.floor((key+currentKey) / 45) * SCORE_RANKS['hard'][comboRank];
console.log("升至 " + currentRank + " 级, 经验" + currentExp + "/" + RANK_EXP[currentRank-1] + "; 获得pt = " + pt);
return pt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment