Android build v1.1.23
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
completeDungeon,
|
||||
completeRoguelike,
|
||||
loadProfile,
|
||||
recordBossKill,
|
||||
type DungeonReward,
|
||||
rollEncounterLoot,
|
||||
type LootRoll,
|
||||
@@ -55,6 +54,7 @@ import {
|
||||
createPveCombatState,
|
||||
createPveRoguelikeRunStart,
|
||||
} from '../combat/pveRoguelikeRunSetup'
|
||||
import type { RunBossCoinAward } from '../combat/rewardSummaries'
|
||||
import {
|
||||
appendCombatLog,
|
||||
type BasicFloatingCombatText,
|
||||
@@ -79,7 +79,7 @@ import { usePartyTargeting } from '../hooks/usePartyTargeting'
|
||||
import { PartyMemberFrame } from './PartyFrames'
|
||||
import { ResourceBar, SpellBar } from './SpellBars'
|
||||
import { barFillStyle } from './barStyles'
|
||||
import { BonusItemReward, LootRollList, RewardXpSummary } from './RewardPanels'
|
||||
import { BonusItemReward, LootRollList, PvpRunLootList, RewardXpSummary } from './RewardPanels'
|
||||
import { ResultScreen } from './ResultScreen'
|
||||
import {
|
||||
DualScreenTopCombat,
|
||||
@@ -236,6 +236,7 @@ function makeRoguelikeSegment(
|
||||
mode: RoguelikeMode,
|
||||
): RoguelikeEncounter[] {
|
||||
const mechanics = chooseRandom(ROGUELIKE_MECHANICS, Math.min(2 + Math.floor(stage / 3), 4))
|
||||
const stageOneDamageScale = 0.58 + (mode === 'raid' ? 0.13 : 0.1)
|
||||
return buildRoguelikeSegment<RoguelikeMechanic, { roguelikeMechanics: RoguelikeMechanic[] }>({
|
||||
pool,
|
||||
stage,
|
||||
@@ -243,8 +244,8 @@ function makeRoguelikeSegment(
|
||||
trashCandidateCount: (trashCount) => Math.min(trashCount, 4 + stage * (mode === 'raid' ? 1 : 2)),
|
||||
bossCandidateCount: (bossCount) => Math.min(bossCount, 2 + Math.floor((stage + 1) / 2)),
|
||||
healthScale: difficulty.healthMultiplier * (0.64 + stage * (mode === 'raid' ? 0.15 : 0.11)),
|
||||
damageScale: difficulty.damageMultiplier * (0.58 + stage * (mode === 'raid' ? 0.13 : 0.1)),
|
||||
partyDamageScale: 0.9 + stage * 0.05,
|
||||
damageScale: difficulty.damageMultiplier * stageOneDamageScale,
|
||||
partyDamageScale: 0.95,
|
||||
idBase: 900000,
|
||||
bossDescription: (selectedMechanics) => `Roguelike boss with ${selectedMechanics.map(mechanicLabel).join(', ')}.`,
|
||||
extraFields: (_encounter, isBoss, selectedMechanics) => ({
|
||||
@@ -359,6 +360,7 @@ export function CombatScreen({
|
||||
const [reward, setReward] = useState<DungeonReward | null>(null)
|
||||
const [rewardError, setRewardError] = useState('')
|
||||
const [lootRolls, setLootRolls] = useState<LootRoll[]>([])
|
||||
const [roguelikeBossCoins, setRoguelikeBossCoins] = useState<RunBossCoinAward[]>([])
|
||||
const [showEndLog, setShowEndLog] = useState(false)
|
||||
const {
|
||||
floatingTexts,
|
||||
@@ -540,9 +542,31 @@ export function CombatScreen({
|
||||
const key = `${runTokenRef.current}:${encounter.id}:${encounterIndex}`
|
||||
if (recordedBossKillIdsRef.current.has(key)) return
|
||||
recordedBossKillIdsRef.current.add(key)
|
||||
recordBossKill(encounter.id, { petVariant: 'purple' })
|
||||
completeRoguelike(
|
||||
dungeon.id,
|
||||
difficulty.id,
|
||||
0,
|
||||
0,
|
||||
Math.max(1, Math.round((Date.now() - runStartedAtRef.current) / 1000)),
|
||||
{
|
||||
bossesCleared: 0,
|
||||
fightsCleared: 0,
|
||||
lootSourceEncounterId: encounter.id,
|
||||
roguelikeStage,
|
||||
},
|
||||
)
|
||||
.then((result) => {
|
||||
onProfileUpdated(result.profile)
|
||||
if (result.bonusItem) {
|
||||
setRoguelikeBossCoins((current) => [...current, {
|
||||
...result.bonusItem!,
|
||||
sourceLabel: encounter.enemyName,
|
||||
}])
|
||||
addLog(
|
||||
`${result.bonusItem.name} x${result.bonusItem.quantity} awarded.`,
|
||||
'loot',
|
||||
)
|
||||
}
|
||||
if (result.petAwarded) {
|
||||
addLog(
|
||||
`${result.petAwarded.petName} awarded${result.petAwarded.duplicate ? ` (owned x${result.petAwarded.quantityAfter})` : ''}.`,
|
||||
@@ -552,11 +576,11 @@ export function CombatScreen({
|
||||
})
|
||||
.catch((reason: unknown) => {
|
||||
addLog(
|
||||
reason instanceof Error ? reason.message : 'Unable to record boss kill.',
|
||||
reason instanceof Error ? reason.message : 'Unable to award boss coins.',
|
||||
'danger',
|
||||
)
|
||||
})
|
||||
}, [addLog, encounterIndex, isRoguelike, onProfileUpdated])
|
||||
}, [addLog, difficulty.id, dungeon.id, encounterIndex, isRoguelike, onProfileUpdated, roguelikeStage])
|
||||
|
||||
const resetRun = useCallback(() => {
|
||||
const nextRoguelikeEncounters = roguelikeMode
|
||||
@@ -581,6 +605,7 @@ export function CombatScreen({
|
||||
setReward(setup.defaults.reward)
|
||||
setRewardError(setup.defaults.rewardError)
|
||||
setLootRolls(setup.defaults.lootRolls)
|
||||
setRoguelikeBossCoins([])
|
||||
setShowEndLog(setup.defaults.showEndLog)
|
||||
clearFloatingTexts()
|
||||
setRoguelikeUpgrades(setup.defaults.roguelikeUpgrades)
|
||||
@@ -1434,7 +1459,11 @@ export function CombatScreen({
|
||||
{rewardError && <p className="reward-error">{rewardError}</p>}
|
||||
{reward && (
|
||||
<>
|
||||
{isRoguelike && <p>Run totals</p>}
|
||||
<RewardXpSummary reward={reward} />
|
||||
{isRoguelike && (
|
||||
<PvpRunLootList loot={roguelikeBossCoins} emptyLabel="No boss coins collected this run." />
|
||||
)}
|
||||
{!isRoguelike && (
|
||||
<>
|
||||
<p>Component tier: item level {reward.droppedItemLevel}.</p>
|
||||
@@ -1459,6 +1488,7 @@ export function CombatScreen({
|
||||
<>
|
||||
<RewardXpSummary reward={reward} />
|
||||
<p>{encounterIndex} encounters cleared.</p>
|
||||
<PvpRunLootList loot={roguelikeBossCoins} emptyLabel="No boss coins collected this run." />
|
||||
<p className="efficiency-result">
|
||||
{reward.resourceSpent} {gameClass.resourceName} spent
|
||||
<small>{reward.durationSeconds}s survived</small>
|
||||
|
||||
Reference in New Issue
Block a user