Android build v1.0.43
This commit is contained in:
+29
-7
@@ -590,6 +590,7 @@ export function getProfile(database, characterId, accountId) {
|
||||
dungeons.party_size AS partySize,
|
||||
dungeons.completion_item_level AS completionItemLevel,
|
||||
dungeons.experience_reward AS experienceReward,
|
||||
dungeons.image_url AS imageUrl,
|
||||
dungeons.description,
|
||||
locations.name AS locationName
|
||||
FROM dungeons
|
||||
@@ -748,6 +749,11 @@ export function getProfile(database, characterId, accountId) {
|
||||
...bonus,
|
||||
active: bonus.equippedPieces >= bonus.requiredPieces,
|
||||
}))
|
||||
const gearUpgradePaths = database.prepare(`
|
||||
SELECT from_item_id AS fromItemId, to_item_id AS toItemId
|
||||
FROM gear_upgrade_paths
|
||||
ORDER BY from_item_id
|
||||
`).all()
|
||||
const leaderboardRuns = database.prepare(`
|
||||
SELECT
|
||||
rank,
|
||||
@@ -843,6 +849,7 @@ export function getProfile(database, characterId, accountId) {
|
||||
inventory,
|
||||
gearStats,
|
||||
setBonuses,
|
||||
gearUpgradePaths,
|
||||
craftingRecipes: craftingRecipeRows.map((recipe) => {
|
||||
const components = craftingComponentRows
|
||||
.filter((component) => component.recipeId === recipe.id)
|
||||
@@ -1792,24 +1799,39 @@ function upgradeItem(database, characterId, itemId) {
|
||||
if (item.slot === componentSlot) throw new Error('Components cannot be upgraded.')
|
||||
|
||||
const currentRecipe = database.prepare(`
|
||||
SELECT source_encounter_id AS sourceEncounterId
|
||||
SELECT id
|
||||
FROM crafting_recipes
|
||||
WHERE item_id = ?
|
||||
`).get(itemId)
|
||||
if (!currentRecipe) throw new Error('No upgrade is available for this item.')
|
||||
|
||||
const targetRecipe = database.prepare(`
|
||||
const pathRecipe = database.prepare(`
|
||||
SELECT
|
||||
crafting_recipes.id,
|
||||
crafting_recipes.item_id AS itemId
|
||||
FROM gear_upgrade_paths
|
||||
JOIN crafting_recipes ON crafting_recipes.item_id = gear_upgrade_paths.to_item_id
|
||||
WHERE gear_upgrade_paths.from_item_id = ?
|
||||
`).get(itemId)
|
||||
|
||||
const targetRecipe = pathRecipe ?? database.prepare(`
|
||||
WITH next_tier AS (
|
||||
SELECT MIN(items.item_level) AS item_level
|
||||
FROM crafting_recipes
|
||||
JOIN items ON items.id = crafting_recipes.item_id
|
||||
WHERE items.slot = ?
|
||||
AND items.item_level > ?
|
||||
)
|
||||
SELECT
|
||||
crafting_recipes.id,
|
||||
crafting_recipes.item_id AS itemId
|
||||
FROM crafting_recipes
|
||||
JOIN items ON items.id = crafting_recipes.item_id
|
||||
WHERE crafting_recipes.source_encounter_id = ?
|
||||
AND items.slot = ?
|
||||
AND items.item_level > ?
|
||||
ORDER BY items.item_level
|
||||
JOIN next_tier ON next_tier.item_level = items.item_level
|
||||
WHERE items.slot = ?
|
||||
ORDER BY crafting_recipes.id
|
||||
LIMIT 1
|
||||
`).get(currentRecipe.sourceEncounterId, item.slot, item.itemLevel)
|
||||
`).get(item.slot, item.itemLevel, item.slot)
|
||||
if (!targetRecipe) throw new Error('No upgrade is available for this item.')
|
||||
|
||||
const components = database.prepare(`
|
||||
|
||||
Reference in New Issue
Block a user