Enable phone auth mock and fix inventory build toast
This commit is contained in:
@@ -4,9 +4,8 @@ import type {
|
||||
} from '../../../../packages/shared/src/contracts/story.js';
|
||||
import { conflict, invalidRequest } from '../../errors.js';
|
||||
import {
|
||||
calculatePlayerBuildSnapshot,
|
||||
type RuntimeGameState as BuildRuntimeGameState,
|
||||
} from '../build/buildCalculationService.js';
|
||||
getPlayerBuildDamageBreakdown,
|
||||
} from '../runtime/runtimeBuildModule.js';
|
||||
import {
|
||||
craftForgeRecipe,
|
||||
dismantleInventoryItem,
|
||||
@@ -96,15 +95,14 @@ function refreshSessionFromGameState(
|
||||
export function buildBuildToast(
|
||||
nextState: InventoryMutationSuccess['nextState'],
|
||||
) {
|
||||
const snapshot = calculatePlayerBuildSnapshot(
|
||||
nextState as BuildRuntimeGameState,
|
||||
);
|
||||
if (!snapshot.ok) {
|
||||
if (!nextState.playerCharacter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const buildMultiplier =
|
||||
snapshot.value.buildBreakdown.buildDamageMultiplier.toFixed(2);
|
||||
const buildMultiplier = getPlayerBuildDamageBreakdown(
|
||||
nextState,
|
||||
nextState.playerCharacter,
|
||||
).buildDamageMultiplier.toFixed(2);
|
||||
return `当前 Build 倍率 x${buildMultiplier}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user