Android build v1.1.31
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
export function ArenaBar({
|
||||
className = '',
|
||||
current,
|
||||
label,
|
||||
max,
|
||||
shield = 0,
|
||||
}: {
|
||||
className?: string
|
||||
current: number
|
||||
label?: string
|
||||
max: number
|
||||
shield?: number
|
||||
}) {
|
||||
@@ -15,6 +17,7 @@ export function ArenaBar({
|
||||
<div className={`iwt2-bar ${className}`}>
|
||||
<span style={{ width: `${percent}%` }} />
|
||||
{shieldPercent > 0 && <i style={{ width: `${shieldPercent}%` }} />}
|
||||
{label && <em>{label}</em>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -46,9 +46,8 @@ export function PartyFrames({
|
||||
<div>
|
||||
<div className="iwt2-party-row-title">
|
||||
<strong>{meta.name}</strong>
|
||||
<small>{Math.ceil(member.health)}</small>
|
||||
</div>
|
||||
<ArenaBar className="hp" current={member.health} max={member.maxHealth} shield={member.shield} />
|
||||
<ArenaBar className="hp" current={member.health} label={`${Math.ceil(member.maxHealth)}`} max={member.maxHealth} shield={member.shield} />
|
||||
{member.maxMana > 0 && (
|
||||
<ArenaBar className="mana" current={member.mana} max={member.maxMana} />
|
||||
)}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
tickIwt2Arena,
|
||||
type Iwt2ArenaState,
|
||||
} from '../sim/arenaState'
|
||||
import type { Iwt2EntityId } from '../sim'
|
||||
import type { Iwt2ArenaBounds, Iwt2EntityId } from '../sim'
|
||||
import { castIwt2HealerAbility } from '../sim'
|
||||
import { PhaserArena } from '../render/PhaserArena'
|
||||
import {
|
||||
@@ -64,6 +64,10 @@ const PVP_RESULT_OVERLAY_NAV_ENTRIES: OverlayNavEntry[] = [
|
||||
]
|
||||
const EMPTY_ROGUELIKE_BUFFS: Iwt2RoguelikeSelfBuffId[] = []
|
||||
const IWT2_PVP_BOSS_HEALTH_MULTIPLIER = 0.7
|
||||
const IWT2_TOP_PARTY_RAIL_WIDTH = 172
|
||||
const IWT2_THOR_TOP_PARTY_RAIL_WIDTH = 154
|
||||
const IWT2_THOR_TOP_BREAKPOINT_WIDTH = 1000
|
||||
const IWT2_THOR_TOP_BREAKPOINT_HEIGHT = 620
|
||||
|
||||
type BossArenaScreenProps = {
|
||||
bossId: Iwt2BossId
|
||||
@@ -103,6 +107,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
const pvpBossHealthScale = pvpRoguelike ? IWT2_PVP_BOSS_HEALTH_MULTIPLIER : 1
|
||||
const combinedBossHealthScale = bossHealthScale * difficultyHealthScale * pvpBossHealthScale
|
||||
const combinedDamageScale = difficultyDamageScale * roguelikeDamageScale
|
||||
const arenaBounds = useMemo(() => createTopScreenArenaBounds(), [])
|
||||
const [arenaState, setArenaState] = useState<Iwt2ArenaState>(() => createArenaState(
|
||||
bossId,
|
||||
bossIds,
|
||||
@@ -111,6 +116,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
roguelikeBuffs,
|
||||
createPressureState(roguelikeStage, roguelikeContentType),
|
||||
pveGearActive ? save.gearProgress : undefined,
|
||||
arenaBounds,
|
||||
))
|
||||
const [opponentArenaState, setOpponentArenaState] = useState<Iwt2ArenaState | null>(() => (
|
||||
pvpRoguelike
|
||||
@@ -120,6 +126,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
combinedBossHealthScale,
|
||||
combinedDamageScale,
|
||||
createPressureState(roguelikeStage, roguelikeContentType),
|
||||
arenaBounds,
|
||||
)
|
||||
: null
|
||||
))
|
||||
@@ -183,6 +190,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
roguelikeBuffs,
|
||||
pressureState,
|
||||
pveGearActive ? save.gearProgress : undefined,
|
||||
arenaBounds,
|
||||
)
|
||||
const nextOpponentState = pvpRoguelike
|
||||
? createInitialIwt2ArenaState(
|
||||
@@ -191,6 +199,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
combinedBossHealthScale,
|
||||
combinedDamageScale,
|
||||
pressureState,
|
||||
arenaBounds,
|
||||
)
|
||||
: null
|
||||
recordedKillIdsRef.current = new Set()
|
||||
@@ -205,7 +214,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
setPetAwards([])
|
||||
setSelectedOverlayAction('primary')
|
||||
setStatus('playing')
|
||||
}, [bossId, bossIds, combinedBossHealthScale, combinedDamageScale, pveGearActive, pvpRoguelike, roguelikeBuffs, roguelikeContentType, roguelikeStage, save.gearProgress])
|
||||
}, [arenaBounds, bossId, bossIds, combinedBossHealthScale, combinedDamageScale, pveGearActive, pvpRoguelike, roguelikeBuffs, roguelikeContentType, roguelikeStage, save.gearProgress])
|
||||
|
||||
const showOverlay = useCallback((nextStatus: Exclude<ArenaStatus, 'playing'>) => {
|
||||
setSelectedOverlayAction('primary')
|
||||
@@ -337,6 +346,7 @@ export function BossArenaScreen({ bossId, bossIds, difficulty, modeLabel, save,
|
||||
return
|
||||
}
|
||||
if (action.startsWith('targetParty')) {
|
||||
if (statusRef.current !== 'playing') return
|
||||
const index = Number(action.replace('targetParty', '')) - 1
|
||||
const target = stateRef.current.party[index]
|
||||
if (target) setSelectedPartyId(target.id)
|
||||
@@ -701,6 +711,7 @@ function createArenaState(
|
||||
buffs: Iwt2RoguelikeSelfBuffId[],
|
||||
roguelikePressure: ReturnType<typeof createPressureState>,
|
||||
gearProgress?: Iwt2Save['gearProgress'],
|
||||
bounds?: Iwt2ArenaBounds,
|
||||
): Iwt2ArenaState {
|
||||
const baseState = createInitialIwt2ArenaState(
|
||||
bossId,
|
||||
@@ -708,6 +719,7 @@ function createArenaState(
|
||||
bossHealthScale,
|
||||
partyDamageTakenScale,
|
||||
roguelikePressure,
|
||||
bounds,
|
||||
)
|
||||
const state = gearProgress ? applyIwt2PveGearStats(baseState, gearProgress) : baseState
|
||||
const shieldedDamageTakenMultiplier = shieldedDamageTakenMultiplierForBuffs(buffs)
|
||||
@@ -723,6 +735,17 @@ function createArenaState(
|
||||
}
|
||||
}
|
||||
|
||||
function createTopScreenArenaBounds(): Iwt2ArenaBounds {
|
||||
if (typeof window === 'undefined') return { width: 960, height: 540 }
|
||||
const thorTopLayout = window.innerWidth <= IWT2_THOR_TOP_BREAKPOINT_WIDTH
|
||||
&& window.innerHeight <= IWT2_THOR_TOP_BREAKPOINT_HEIGHT
|
||||
const railWidth = thorTopLayout ? IWT2_THOR_TOP_PARTY_RAIL_WIDTH : IWT2_TOP_PARTY_RAIL_WIDTH
|
||||
return {
|
||||
width: Math.max(320, Math.round(window.innerWidth - railWidth)),
|
||||
height: Math.max(240, Math.round(window.innerHeight)),
|
||||
}
|
||||
}
|
||||
|
||||
function createPressureState(
|
||||
stage: number | undefined,
|
||||
contentType: Iwt2RoguelikeContentType | undefined,
|
||||
|
||||
@@ -1256,7 +1256,7 @@ export function Iwt2RoguelikeUpgradeScreen({
|
||||
setSelectedIndex((current) => moveUpgradeSelection(entries, current, action))
|
||||
return
|
||||
}
|
||||
if (action === 'back' || action === 'pause') return
|
||||
if (action === 'back') onBack()
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -1547,33 +1547,10 @@ export function Iwt2HunterProfileScreen({
|
||||
|
||||
function moveSelection(action: InputAction) {
|
||||
if (!action.startsWith('navigate') || navEntries.length === 0) return
|
||||
setSelectedIndex((current) => {
|
||||
const bounded = Math.min(current, navEntries.length - 1)
|
||||
const active = navEntries[bounded]
|
||||
if (!active) return 0
|
||||
const candidates = navEntries
|
||||
.map((entry, index) => ({ entry, index }))
|
||||
.filter(({ index }) => index !== bounded)
|
||||
.filter(({ entry }) => {
|
||||
if (action === 'navigateLeft') return entry.column < active.column
|
||||
if (action === 'navigateRight') return entry.column > active.column
|
||||
if (action === 'navigateUp') return entry.row < active.row
|
||||
return entry.row > active.row
|
||||
})
|
||||
if (candidates.length === 0) return bounded
|
||||
candidates.sort((a, b) => {
|
||||
const aPrimary = Math.abs(a.entry.row - active.row) + Math.abs(a.entry.column - active.column)
|
||||
const bPrimary = Math.abs(b.entry.row - active.row) + Math.abs(b.entry.column - active.column)
|
||||
const aSecondary = action === 'navigateLeft' || action === 'navigateRight'
|
||||
? Math.abs(a.entry.row - active.row)
|
||||
: Math.abs(a.entry.column - active.column)
|
||||
const bSecondary = action === 'navigateLeft' || action === 'navigateRight'
|
||||
? Math.abs(b.entry.row - active.row)
|
||||
: Math.abs(b.entry.column - active.column)
|
||||
return aPrimary - bPrimary || aSecondary - bSecondary || a.index - b.index
|
||||
})
|
||||
return candidates[0]?.index ?? bounded
|
||||
})
|
||||
const nextIndex = moveHunterProfileSelection(navEntries, selectedIndex, action)
|
||||
const nextEntry = navEntries[nextIndex]
|
||||
setSelectedIndex(nextIndex)
|
||||
if (nextEntry?.kind === 'item') setFocusedItemKey(nextEntry.itemKey)
|
||||
}
|
||||
|
||||
function openEntry(entry: Iwt2HunterProfileNavEntry | undefined) {
|
||||
@@ -1863,6 +1840,7 @@ function Iwt2ProfileNameEditor({
|
||||
<label>
|
||||
<span>Profile Name</span>
|
||||
<input
|
||||
data-controller-nav="skip"
|
||||
maxLength={IWT2_NAME_MAX_LENGTH}
|
||||
onChange={(event) => setDraft(event.target.value.slice(0, IWT2_NAME_MAX_LENGTH))}
|
||||
value={draft}
|
||||
@@ -1901,38 +1879,42 @@ export function Iwt2CloudSaveScreen({
|
||||
const [onlineSave, setOnlineSave] = useState<Iwt2Save | null>(null)
|
||||
const [syncingOnlineSave, setSyncingOnlineSave] = useState(false)
|
||||
const [message, setMessage] = useState('')
|
||||
const statusMessage = message || (!onlineBackupsAvailable ? 'Online save unavailable in offline mode.' : '')
|
||||
|
||||
const checkOnlineSave = useCallback(async (isCancelled: () => boolean) => {
|
||||
setSyncingOnlineSave(true)
|
||||
setMessage('Checking online save...')
|
||||
try {
|
||||
const result = await loadIwt2OnlineSave()
|
||||
if (isCancelled()) return
|
||||
setOnlineSave(result.save)
|
||||
setMessage(result.save ? 'Online save loaded.' : 'No online save yet.')
|
||||
} catch (reason) {
|
||||
if (isCancelled()) return
|
||||
setOnlineSave(null)
|
||||
setMessage(reason instanceof Error ? reason.message : 'Unable to check online save.')
|
||||
} finally {
|
||||
if (!isCancelled()) setSyncingOnlineSave(false)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
if (!onlineBackupsAvailable) {
|
||||
setOnlineSave(null)
|
||||
setMessage('Online save unavailable in offline mode.')
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}
|
||||
setSyncingOnlineSave(true)
|
||||
setMessage('Checking online save...')
|
||||
loadIwt2OnlineSave()
|
||||
.then((result) => {
|
||||
if (cancelled) return
|
||||
setOnlineSave(result.save)
|
||||
setMessage(result.save ? 'Online save loaded.' : 'No online save yet.')
|
||||
})
|
||||
.catch((reason) => {
|
||||
if (cancelled) return
|
||||
setOnlineSave(null)
|
||||
setMessage(reason instanceof Error ? reason.message : 'Unable to check online save.')
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setSyncingOnlineSave(false)
|
||||
})
|
||||
const timer = window.setTimeout(() => {
|
||||
void checkOnlineSave(() => cancelled)
|
||||
}, 0)
|
||||
return () => {
|
||||
cancelled = true
|
||||
window.clearTimeout(timer)
|
||||
}
|
||||
}, [onlineBackupsAvailable])
|
||||
}, [checkOnlineSave, onlineBackupsAvailable])
|
||||
|
||||
const useLocalSave = useCallback(async () => {
|
||||
const handleUseLocalSave = useCallback(async () => {
|
||||
if (!onlineBackupsAvailable) {
|
||||
setMessage('Using local save. Sign in online to update the server copy.')
|
||||
return
|
||||
@@ -1950,13 +1932,13 @@ export function Iwt2CloudSaveScreen({
|
||||
}
|
||||
}, [onlineBackupsAvailable, save])
|
||||
|
||||
const useOnlineSave = useCallback(() => {
|
||||
if (!onlineSave) return
|
||||
const handleUseOnlineSave = useCallback(() => {
|
||||
if (!onlineBackupsAvailable || !onlineSave) return
|
||||
onSaveUpdated(onlineSave)
|
||||
setMessage('Local save now uses online progress.')
|
||||
}, [onlineSave, onSaveUpdated])
|
||||
}, [onlineBackupsAvailable, onlineSave, onSaveUpdated])
|
||||
|
||||
const useNewSave = useCallback(() => {
|
||||
const handleUseNewSave = useCallback(() => {
|
||||
onSaveUpdated(createDefaultIwt2Save())
|
||||
setMessage('Started a new local IWT2 save.')
|
||||
}, [onSaveUpdated])
|
||||
@@ -1969,7 +1951,7 @@ export function Iwt2CloudSaveScreen({
|
||||
value: onlineBackupsAvailable ? 'Upload' : 'Current',
|
||||
disabled: syncingOnlineSave,
|
||||
onConfirm: () => {
|
||||
void useLocalSave()
|
||||
void handleUseLocalSave()
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1977,30 +1959,30 @@ export function Iwt2CloudSaveScreen({
|
||||
label: 'Use Online Save',
|
||||
detail: syncingOnlineSave ? 'Checking online save...' : formatIwt2SaveSummary(onlineSave),
|
||||
value: onlineSave ? 'Download' : 'Empty',
|
||||
disabled: syncingOnlineSave || !onlineSave,
|
||||
onConfirm: useOnlineSave,
|
||||
disabled: syncingOnlineSave || !onlineBackupsAvailable || !onlineSave,
|
||||
onConfirm: handleUseOnlineSave,
|
||||
},
|
||||
{
|
||||
key: 'new-save',
|
||||
label: 'Use New Save File',
|
||||
detail: 'Start over with a fresh IWT2 character. Online save is not overwritten until you choose local save.',
|
||||
value: 'New',
|
||||
onConfirm: useNewSave,
|
||||
onConfirm: handleUseNewSave,
|
||||
},
|
||||
], onBack), [
|
||||
handleUseLocalSave,
|
||||
handleUseNewSave,
|
||||
handleUseOnlineSave,
|
||||
onlineBackupsAvailable,
|
||||
onlineSave,
|
||||
onBack,
|
||||
save,
|
||||
syncingOnlineSave,
|
||||
useLocalSave,
|
||||
useNewSave,
|
||||
useOnlineSave,
|
||||
])
|
||||
|
||||
return (
|
||||
<Iwt2ScreenShell title="Backup Slot" onBack={onBack}>
|
||||
{message && <p className="iwt2-screen-note">{message}</p>}
|
||||
{statusMessage && <p className="iwt2-screen-note">{statusMessage}</p>}
|
||||
<Iwt2ActionList actions={actions} />
|
||||
</Iwt2ScreenShell>
|
||||
)
|
||||
@@ -2114,6 +2096,16 @@ export function Iwt2GearUpgradeScreen({
|
||||
<section className="content-screen iwt2-screen-shell iwt2-gear-screen" data-game-nav-active="true">
|
||||
<div className="iwt2-gear-layout">
|
||||
<section className="iwt2-gear-column">
|
||||
<button
|
||||
className={`back-button iwt2-gear-back ${activeEntry?.kind === 'back' ? 'game-selected' : ''}`}
|
||||
data-controller-nav="skip"
|
||||
data-game-selected={activeEntry?.kind === 'back' ? 'true' : undefined}
|
||||
onClick={onBack}
|
||||
onPointerDown={() => selectGearEntry(navEntries, setSelectedIndex, 'back')}
|
||||
type="button"
|
||||
>
|
||||
Back
|
||||
</button>
|
||||
<div className="iwt2-gear-class-list">
|
||||
{IWT2_PARTY_ORDER.map((classId) => {
|
||||
const metadata = IWT2_CLASS_METADATA[classId]
|
||||
@@ -2372,6 +2364,39 @@ function activeUpgradeEntry(entries: Iwt2UpgradeNavEntry[], index: number) {
|
||||
return entries[Math.min(index, entries.length - 1)]
|
||||
}
|
||||
|
||||
function moveHunterProfileSelection(
|
||||
entries: Iwt2HunterProfileNavEntry[],
|
||||
current: number,
|
||||
action: InputAction,
|
||||
) {
|
||||
if (!action.startsWith('navigate') || entries.length === 0) return current
|
||||
const bounded = Math.min(current, entries.length - 1)
|
||||
const active = entries[bounded]
|
||||
if (!active) return 0
|
||||
const candidates = entries
|
||||
.map((entry, index) => ({ entry, index }))
|
||||
.filter(({ index }) => index !== bounded)
|
||||
.filter(({ entry }) => {
|
||||
if (action === 'navigateLeft') return entry.column < active.column
|
||||
if (action === 'navigateRight') return entry.column > active.column
|
||||
if (action === 'navigateUp') return entry.row < active.row
|
||||
return entry.row > active.row
|
||||
})
|
||||
if (candidates.length === 0) return bounded
|
||||
candidates.sort((a, b) => {
|
||||
const aPrimary = Math.abs(a.entry.row - active.row) + Math.abs(a.entry.column - active.column)
|
||||
const bPrimary = Math.abs(b.entry.row - active.row) + Math.abs(b.entry.column - active.column)
|
||||
const aSecondary = action === 'navigateLeft' || action === 'navigateRight'
|
||||
? Math.abs(a.entry.row - active.row)
|
||||
: Math.abs(a.entry.column - active.column)
|
||||
const bSecondary = action === 'navigateLeft' || action === 'navigateRight'
|
||||
? Math.abs(b.entry.row - active.row)
|
||||
: Math.abs(b.entry.column - active.column)
|
||||
return aPrimary - bPrimary || aSecondary - bSecondary || a.index - b.index
|
||||
})
|
||||
return candidates[0]?.index ?? bounded
|
||||
}
|
||||
|
||||
function upgradeEntryDisabled(entry: Iwt2UpgradeNavEntry) {
|
||||
return entry.kind === 'upgradeContinue' && Boolean(entry.disabled)
|
||||
}
|
||||
|
||||
+19
-10
@@ -9,6 +9,7 @@ import type {
|
||||
Iwt2EntityId,
|
||||
Iwt2GroundHazardState,
|
||||
Iwt2HostileAddState,
|
||||
Iwt2ArenaBounds,
|
||||
Iwt2PartyAiRole,
|
||||
Iwt2PartyEntityId,
|
||||
Iwt2PartyEntityState,
|
||||
@@ -66,14 +67,15 @@ export function createInitialIwt2ArenaState(
|
||||
bossHealthScale = 1,
|
||||
partyDamageTakenScale = 1,
|
||||
roguelikePressure?: Iwt2RoguelikePressureState,
|
||||
bounds: Iwt2ArenaBounds = { width: DEFAULT_ARENA_WIDTH, height: DEFAULT_ARENA_HEIGHT },
|
||||
): Iwt2ArenaState {
|
||||
const initialBossIds = bossIds?.length ? bossIds.slice(0, 2) : chooseInitialBossIds(bossId)
|
||||
const bosses = initialBossIds.map((id, index) => createBossEntity(id, index, bossHealthScale))
|
||||
const bosses = initialBossIds.map((id, index) => createBossEntity(id, index, bossHealthScale, bounds))
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
time: 0,
|
||||
bounds: { width: DEFAULT_ARENA_WIDTH, height: DEFAULT_ARENA_HEIGHT },
|
||||
party: INITIAL_PARTY.map((member) => createPartyMember(member, partyDamageTakenScale)),
|
||||
bounds,
|
||||
party: INITIAL_PARTY.map((member) => createPartyMember(member, partyDamageTakenScale, bounds)),
|
||||
projectiles: [],
|
||||
hostileAdds: [],
|
||||
hazards: [],
|
||||
@@ -95,9 +97,9 @@ function chooseInitialBossIds(primaryBossId: Iwt2BossId): Iwt2BossId[] {
|
||||
return [primaryBossId, random]
|
||||
}
|
||||
|
||||
function createBossEntity(bossId: Iwt2BossId, index: number, healthScale: number): Iwt2BossEntityState {
|
||||
function createBossEntity(bossId: Iwt2BossId, index: number, healthScale: number, bounds: Iwt2ArenaBounds): Iwt2BossEntityState {
|
||||
const bossMetadata = IWT2_BOSS_METADATA[bossId]
|
||||
const position = initialBossPosition(index)
|
||||
const position = scaleArenaPoint(initialBossPosition(index), bounds)
|
||||
const maxHealth = Math.max(1, Math.round(bossMetadata.maxHealth * Math.max(0.01, healthScale)))
|
||||
return {
|
||||
id: bossId,
|
||||
@@ -123,9 +125,9 @@ function createBossEntity(bossId: Iwt2BossId, index: number, healthScale: number
|
||||
chargeHitEntityIds: [],
|
||||
slamApplied: false,
|
||||
wallContactSeconds: 0,
|
||||
relocateTarget: { x: DEFAULT_ARENA_WIDTH * 0.58, y: DEFAULT_ARENA_HEIGHT * 0.5 + (index === 0 ? -64 : 64) },
|
||||
relocateTarget: scaleArenaPoint({ x: DEFAULT_ARENA_WIDTH * 0.58, y: DEFAULT_ARENA_HEIGHT * 0.5 + (index === 0 ? -64 : 64) }, bounds),
|
||||
fireballCooldownRemaining: initialBossSecondaryCooldown(bossId) + index * 0.7,
|
||||
fireballTarget: { x: 320, y: 250 },
|
||||
fireballTarget: scaleArenaPoint({ x: 320, y: 250 }, bounds),
|
||||
birdWaveThresholdsTriggered: [],
|
||||
mechanicLanes: [],
|
||||
mechanicCircles: [],
|
||||
@@ -141,6 +143,13 @@ function initialBossPosition(index: number) {
|
||||
}
|
||||
}
|
||||
|
||||
function scaleArenaPoint(point: Iwt2Vec2, bounds: Iwt2ArenaBounds): Iwt2Vec2 {
|
||||
return {
|
||||
x: point.x * bounds.width / DEFAULT_ARENA_WIDTH,
|
||||
y: point.y * bounds.height / DEFAULT_ARENA_HEIGHT,
|
||||
}
|
||||
}
|
||||
|
||||
function initialBossSpecialCooldown(bossId: Iwt2BossId): number {
|
||||
if (bossId === 'bulldrome') return 2
|
||||
if (bossId === 'great-jaggi') return 2.4
|
||||
@@ -324,7 +333,7 @@ function regeneratePartyMana(party: Iwt2PartyEntityState[], dt: number): Iwt2Par
|
||||
})
|
||||
}
|
||||
|
||||
function createPartyMember(initial: InitialPartyMember, damageTakenScale: number): Iwt2PartyEntityState {
|
||||
function createPartyMember(initial: InitialPartyMember, damageTakenScale: number, bounds: Iwt2ArenaBounds): Iwt2PartyEntityState {
|
||||
const metadata = IWT2_CLASS_METADATA[initial.classId]
|
||||
const safeDamageTakenScale = Number.isFinite(damageTakenScale) ? Math.max(0.01, damageTakenScale) : 1
|
||||
return {
|
||||
@@ -332,7 +341,7 @@ function createPartyMember(initial: InitialPartyMember, damageTakenScale: number
|
||||
kind: 'party',
|
||||
classId: initial.classId,
|
||||
aiRole: initial.aiRole,
|
||||
position: { x: initial.x, y: initial.y },
|
||||
position: scaleArenaPoint({ x: initial.x, y: initial.y }, bounds),
|
||||
velocity: { x: 0, y: 0 },
|
||||
facing: { x: 1, y: 0 },
|
||||
radius: metadata.radius,
|
||||
@@ -355,7 +364,7 @@ function createPartyMember(initial: InitialPartyMember, damageTakenScale: number
|
||||
attackReady: false,
|
||||
status: createEmptyStatus(),
|
||||
hotEffects: [],
|
||||
preferredOffset: { ...initial.preferredOffset },
|
||||
preferredOffset: scaleArenaPoint(initial.preferredOffset, bounds),
|
||||
decisionSecondsRemaining: initial.decisionOffset,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
import type {
|
||||
Iwt2ArenaIndicator,
|
||||
Iwt2ArenaInput,
|
||||
Iwt2ArenaBounds,
|
||||
Iwt2ArenaState as Iwt2CoreArenaState,
|
||||
Iwt2BossEntityState,
|
||||
Iwt2HostileAddState,
|
||||
@@ -61,8 +62,9 @@ export function createInitialIwt2ArenaState(
|
||||
bossHealthScale?: number,
|
||||
partyDamageTakenScale?: number,
|
||||
roguelikePressure?: Iwt2RoguelikePressureState,
|
||||
bounds?: Iwt2ArenaBounds,
|
||||
): Iwt2ArenaState {
|
||||
return decorateArenaState(createCoreIwt2ArenaState(bossId, bossIds, bossHealthScale, partyDamageTakenScale, roguelikePressure))
|
||||
return decorateArenaState(createCoreIwt2ArenaState(bossId, bossIds, bossHealthScale, partyDamageTakenScale, roguelikePressure, bounds))
|
||||
}
|
||||
|
||||
export function tickIwt2Arena(state: Iwt2ArenaState, input: Iwt2ArenaInput, dt: number): Iwt2ArenaState {
|
||||
|
||||
@@ -12,9 +12,11 @@ const ROGUELIKE_PRESSURE_INITIAL_STAGE_DAMAGE = 2
|
||||
const ROGUELIKE_PRESSURE_SOURCE_ID = 'roguelike-pressure'
|
||||
|
||||
export function roguelikeIncomingDamageScale(
|
||||
_stage: number,
|
||||
_contentType: Iwt2RoguelikePressureContentType,
|
||||
stage: number,
|
||||
contentType: Iwt2RoguelikePressureContentType,
|
||||
): number {
|
||||
void stage
|
||||
void contentType
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user