Change references from tetris to quad for 4-line clears

This commit is contained in:
cmclark00 2025-04-01 05:09:02 -04:00
parent 38163c33a3
commit 22fd887037
5 changed files with 27 additions and 36 deletions

View file

@ -93,24 +93,15 @@ class PlayerProgressionManager(context: Context) {
/**
* Calculate XP from a game session based on score, lines, level, etc.
*/
fun calculateGameXP(score: Int, lines: Int, level: Int, gameTime: Long,
tetrisCount: Int, perfectClearCount: Int): Long {
// Base XP from score with level multiplier (capped at level 10)
val cappedLevel = min(level, 10)
val scoreXP = (score * (1 + LEVEL_MULTIPLIER * cappedLevel)).toLong()
// XP from lines cleared (reduced for higher levels)
val linesXP = lines * XP_PER_LINE * (1 - (level - 1) * 0.05).coerceAtLeast(0.5)
// XP from special moves (reduced for higher levels)
val tetrisBonus = tetrisCount * TETRIS_XP_BONUS * (1 - (level - 1) * 0.05).coerceAtLeast(0.5)
val perfectClearBonus = perfectClearCount * PERFECT_CLEAR_XP_BONUS * (1 - (level - 1) * 0.05).coerceAtLeast(0.5)
// Time bonus (reduced for longer games)
val timeBonus = (gameTime / 60000) * TIME_XP_PER_MINUTE * (1 - (gameTime / 3600000) * 0.1).coerceAtLeast(0.5)
// Calculate total XP
return (scoreXP + linesXP + tetrisBonus + perfectClearBonus + timeBonus).toLong()
fun calculateGameXP(score: Int, lines: Int, level: Int, timePlayedMs: Long,
quadCount: Int, perfectClearCount: Int): Long {
val scoreXP = score * SCORE_XP_MULTIPLIER
val linesXP = lines * LINES_XP_MULTIPLIER * level
val quadBonus = quadCount * QUAD_XP_BONUS * (1 - (level - 1) * 0.05).coerceAtLeast(0.5)
val perfectClearBonus = perfectClearCount * PERFECT_CLEAR_XP_BONUS
val timeBonus = (timePlayedMs / 1000) * TIME_XP_MULTIPLIER
return (scoreXP + linesXP + quadBonus + perfectClearBonus + timeBonus).toLong()
}
/**