Created
April 30, 2019 16:09
-
-
Save esterTion/f2e3c0565e0f649f3ad483ed18db4a94 to your computer and use it in GitHub Desktop.
pseudo code of fragment award algorithm in Arcaea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void award_fragment() { | |
int play_award = 0; | |
int clear_award = 0; | |
int performance_award = 0; | |
int first_clear_award = 0; | |
int partner_award = 0; | |
int difficulty = Chart->difficulty; | |
int clear_type = GameResult::getCalculatedClearType(...); | |
if (clear_type == 0) { | |
// Track Lost, but higher than 5.5m | |
if (ArcUtil::calculateScore(...) >= 5500000) | |
play_award = difficulty; | |
} else { | |
// At least Track Clear | |
int diff_award_base; | |
switch (difficulty) { | |
case 0: { diff_award_base = 1; break; } | |
case 1: { diff_award_base = 2; break; } | |
case 2: { diff_award_base = 3; break; } | |
default: { diff_award_base = 4; } | |
} | |
int diff_shrinked = floor(difficulty / 1.2); | |
clear_award = diff_award_base + 4; | |
switch (clear_type) { | |
case 1: { // Track Clear | |
clear_award = diff_shrinked + diff_award_base + 4; | |
break; | |
} | |
case 2: { // Full Recall | |
performance_award = diff_shrinked * 2; | |
break; | |
} | |
case 3: { // Pure Memory | |
performance_award = floor(diff_shrinked * 2.7); | |
break; | |
} | |
} // switch (clear_type) | |
if (!UnlockManager::getClearedSong(...)) { | |
first_clear_award = 10; | |
} | |
} // clear_type != 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment