Android build v1.1.34

This commit is contained in:
Warren H
2026-07-07 23:25:40 -04:00
parent 679900e7f5
commit d61cee55ed
14 changed files with 1718 additions and 28 deletions
+21 -7
View File
@@ -69,8 +69,8 @@ export function createInitialIwt2ArenaState(
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, bounds))
const initialBossIds = bossIds?.length ? [...bossIds] : chooseInitialBossIds(bossId)
const bosses = initialBossIds.map((id, index) => createBossEntity(id, index, initialBossIds.length, bossHealthScale, bounds))
return {
schemaVersion: 1,
time: 0,
@@ -97,9 +97,15 @@ function chooseInitialBossIds(primaryBossId: Iwt2BossId): Iwt2BossId[] {
return [primaryBossId, random]
}
function createBossEntity(bossId: Iwt2BossId, index: number, healthScale: number, bounds: Iwt2ArenaBounds): Iwt2BossEntityState {
function createBossEntity(
bossId: Iwt2BossId,
index: number,
bossCount: number,
healthScale: number,
bounds: Iwt2ArenaBounds,
): Iwt2BossEntityState {
const bossMetadata = IWT2_BOSS_METADATA[bossId]
const position = scaleArenaPoint(initialBossPosition(index), bounds)
const position = scaleArenaPoint(initialBossPosition(index, bossCount), bounds)
const maxHealth = Math.max(1, Math.round(bossMetadata.maxHealth * Math.max(0.01, healthScale)))
return {
id: bossId,
@@ -136,7 +142,14 @@ function createBossEntity(bossId: Iwt2BossId, index: number, healthScale: number
}
}
function initialBossPosition(index: number) {
function initialBossPosition(index: number, bossCount = 2) {
if (bossCount > 2) {
const angle = -Math.PI * 0.5 + (Math.PI * (index + 0.5)) / bossCount
return {
x: 690 + Math.cos(angle) * 120,
y: DEFAULT_ARENA_HEIGHT * 0.5 + Math.sin(angle) * 165,
}
}
return {
x: index === 0 ? 660 : 760,
y: index === 0 ? 190 : 345,
@@ -757,6 +770,7 @@ function advanceBossProjectile({
radius: hitMember.radius + projectile.radius,
}, {
damage: projectile.damage,
damageEventType: 'bossProjectileHit',
sourceId: projectile.sourceId,
time,
})
@@ -774,13 +788,13 @@ function advanceBossProjectile({
bounced = true
}
if (bounced) {
if (hitMember) {
const puddle = addFirePuddle({
damage: IWT2_BOSS_METADATA['yian-kut-ku'].firePuddleDamage!,
duration: IWT2_BOSS_METADATA['yian-kut-ku'].firePuddleSeconds!,
hazards: nextHazards,
nextHazardId: nextHazardIdValue,
position: hitMember?.position ?? position,
position: hitMember.position,
radius: IWT2_BOSS_METADATA['yian-kut-ku'].firePuddleRadius!,
sourceId: projectile.sourceId,
time,