Android build v1.0.58 stadium added
This commit is contained in:
+40
-3
@@ -2309,7 +2309,13 @@ function completeRoguelike(database, characterId, accountId, runMetrics) {
|
||||
? 'pvp-boss-quarter-level'
|
||||
: runMetrics?.experienceMode === 'pvp-fight-twelfth-level'
|
||||
? 'pvp-fight-twelfth-level'
|
||||
: 'default'
|
||||
: runMetrics?.experienceMode === 'pvp-stadium-round-win-quarter-level'
|
||||
? 'pvp-stadium-round-win-quarter-level'
|
||||
: runMetrics?.experienceMode === 'pvp-stadium-round-loss-tenth-level'
|
||||
? 'pvp-stadium-round-loss-tenth-level'
|
||||
: runMetrics?.experienceMode === 'pvp-stadium-match-half-level'
|
||||
? 'pvp-stadium-match-half-level'
|
||||
: 'default'
|
||||
const fightsCleared = Number(runMetrics?.fightsCleared ?? encountersCleared)
|
||||
const resourceSpent = Number(runMetrics?.resourceSpent)
|
||||
const durationSeconds = Number(runMetrics?.durationSeconds)
|
||||
@@ -2412,6 +2418,35 @@ function completeRoguelike(database, characterId, accountId, runMetrics) {
|
||||
WHERE experience_required <= ?
|
||||
`).get(newExperience).level
|
||||
}
|
||||
} else if (
|
||||
experienceMode === 'pvp-stadium-round-win-quarter-level'
|
||||
|| experienceMode === 'pvp-stadium-round-loss-tenth-level'
|
||||
|| experienceMode === 'pvp-stadium-match-half-level'
|
||||
) {
|
||||
const currentLevelFloor = database.prepare(`
|
||||
SELECT experience_required AS experienceRequired
|
||||
FROM level_progression
|
||||
WHERE level = ?
|
||||
`).get(newLevel).experienceRequired
|
||||
const nextLevelExperience = newLevel >= maxLevel
|
||||
? maxExperience
|
||||
: database.prepare(`
|
||||
SELECT experience_required AS experienceRequired
|
||||
FROM level_progression
|
||||
WHERE level = ?
|
||||
`).get(newLevel + 1).experienceRequired
|
||||
const levelBand = Math.max(1, nextLevelExperience - currentLevelFloor)
|
||||
const rewardRate = experienceMode === 'pvp-stadium-round-win-quarter-level'
|
||||
? 0.25
|
||||
: experienceMode === 'pvp-stadium-round-loss-tenth-level'
|
||||
? 0.1
|
||||
: 0.5
|
||||
newExperience = Math.min(maxExperience, newExperience + Math.round(levelBand * rewardRate))
|
||||
newLevel = database.prepare(`
|
||||
SELECT MAX(level) AS level
|
||||
FROM level_progression
|
||||
WHERE experience_required <= ?
|
||||
`).get(newExperience).level
|
||||
} else {
|
||||
const baseExperienceReward = Math.round(
|
||||
dungeon.experienceReward * dungeon.experienceMultiplier * (encountersCleared / 3),
|
||||
@@ -2564,7 +2599,7 @@ function cleanupPvpMemory(now = Date.now()) {
|
||||
}
|
||||
|
||||
function validatePvpContentType(value) {
|
||||
if (value !== 'dungeon' && value !== 'raid') {
|
||||
if (value !== 'dungeon' && value !== 'raid' && value !== 'stadium') {
|
||||
throw new Error('The PvP content type is invalid.')
|
||||
}
|
||||
return value
|
||||
@@ -2736,7 +2771,7 @@ function requirePvpMatchForSession(session, matchId) {
|
||||
|
||||
function updatePvpMatchState(session, matchId, payload) {
|
||||
const { match, side } = requirePvpMatchForSession(session, matchId)
|
||||
const status = ['playing', 'upgrade-choice', 'won', 'lost'].includes(payload.status)
|
||||
const status = ['playing', 'upgrade-choice', 'shop', 'won', 'lost'].includes(payload.status)
|
||||
? payload.status
|
||||
: 'playing'
|
||||
const progress = {
|
||||
@@ -2762,6 +2797,8 @@ function submitPvpUpgradeChoice(session, matchId, payload) {
|
||||
encounterIndex,
|
||||
buffId: String(payload.buffId ?? ''),
|
||||
debuffId: String(payload.debuffId ?? ''),
|
||||
purchases: Array.isArray(payload.purchases) ? payload.purchases.map((purchase) => String(purchase)) : [],
|
||||
shopReady: Boolean(payload.shopReady),
|
||||
}
|
||||
match.updatedAt = Date.now()
|
||||
return pvpSnapshot(match)
|
||||
|
||||
Reference in New Issue
Block a user