From 680ccdb618f716c38236f2f7de292abe2908cd84 Mon Sep 17 00:00:00 2001 From: giteaadmin Date: Sat, 13 Jun 2026 16:12:15 +0000 Subject: [PATCH] fix game 7 --- www/html/Game/data/game-timing.json | 5 ++- www/html/Game/public/js/play.js | 57 ++++++++++++++++------------- www/html/Game/public/play.html | 2 +- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/www/html/Game/data/game-timing.json b/www/html/Game/data/game-timing.json index 2507448..62342ee 100644 --- a/www/html/Game/data/game-timing.json +++ b/www/html/Game/data/game-timing.json @@ -76,7 +76,7 @@ "/Game/img/ViolentCrime/Rocket-broke-2.png", "/Game/img/ViolentCrime/Rocket-broke-3.png" ], - "balloonBossMissionTimeSec": 0, + "balloonBossMissionTimeSec": 60, "balloonBossBossImageUrl": "/Game/img/MegaVirus/boss.png", "balloonBossPlayerBalloonImageUrls": [ "/Game/img/MegaVirus/balloon-1.png", @@ -86,5 +86,6 @@ "/Game/img/MegaVirus/balloon-5.png", "/Game/img/MegaVirus/balloon-6.png" ], - "balloonBossPlayerBalloonFallbackUrl": "/Game/img/MegaVirus/Artboard%209.png" + "balloonBossPlayerBalloonFallbackUrl": "/Game/img/MegaVirus/Artboard%209.png", + "balloonBossBalloonsPerPlayer": 3 } \ No newline at end of file diff --git a/www/html/Game/public/js/play.js b/www/html/Game/public/js/play.js index d9bcb86..246918e 100644 --- a/www/html/Game/public/js/play.js +++ b/www/html/Game/public/js/play.js @@ -15930,16 +15930,31 @@ else o.balloonBossBotNextFire = 0.8 + Math.random() * 0.9; if (o.balloonBossBotNextFire <= 0) { o.balloonBossBotNextFire = 0.9 + Math.random() * 1.1; - const delayMs = balloonBossFireDelayMsPlay(); - const dx = bossCx - o.balloonBossCx; - const dy = bossCy - o.balloonBossCy; - const L = Math.hypot(dx, dy) || 1; const bspd = 500 + Math.random() * 90; + let bvx; + let bvy; + let bdelay; + if (isMegaVirusMissionShellMapPlay()) { + /** Mega Virus: บอทยิงตามมุม "ลูกศรวงกลม" ของตัวเอง (ทันที) เหมือนผู้เล่น — ไม่ auto-aim ใส่บอส */ + const aim = (typeof o.balloonBossAimRad === 'number' && Number.isFinite(o.balloonBossAimRad)) + ? o.balloonBossAimRad + : Math.atan2(bossCy - o.balloonBossCy, bossCx - o.balloonBossCx); + bvx = Math.cos(aim) * bspd; + bvy = Math.sin(aim) * bspd; + bdelay = 0; + } else { + const dx = bossCx - o.balloonBossCx; + const dy = bossCy - o.balloonBossCy; + const L = Math.hypot(dx, dy) || 1; + bvx = (dx / L) * bspd; + bvy = (dy / L) * bspd; + bdelay = balloonBossFireDelayMsPlay(); + } balloonBossPendingShots.push({ - releaseAt: performance.now() + delayMs, + releaseAt: performance.now() + bdelay, sx: o.balloonBossCx, sy: o.balloonBossCy, - vx: (dx / L) * bspd, - vy: (dy / L) * bspd, + vx: bvx, + vy: bvy, ownerId: bid, }); } @@ -16198,23 +16213,15 @@ const wantFire = !isChatFocused() && !!keys['Space'] && !me.balloonBossEliminated; if (wantFire && balloonBossPlayerFireCd <= 0 && me.balloonBossCy != null) { balloonBossPlayerFireCd = 0.35; - const delayMs = balloonBossFireDelayMsPlay(); + /** ยิงตามมุม "ลูกศรวงกลม" เสมอ (me.balloonBossAimRad อัปเดตทุกเฟรม) — fallback เล็งบอสเฉพาะตอนมุมยังไม่พร้อม */ + /** Mega Virus: ยิงทันที (delay 0) ไม่งั้นลูกศรหมุนต่อระหว่างหน่วง → กระสุนโผล่ไม่ตรงลูกศร */ + const delayMs = isMegaVirusMissionShellMapPlay() ? 0 : balloonBossFireDelayMsPlay(); const bspd = 480; - let vx; - let vy; - if (isMegaVirusMissionShellMapPlay()) { - const aim = (typeof me.balloonBossAimRad === 'number' && Number.isFinite(me.balloonBossAimRad)) - ? me.balloonBossAimRad - : Math.atan2(bossC.cy - me.balloonBossCy, bossC.cx - me.balloonBossCx); - vx = Math.cos(aim) * bspd; - vy = Math.sin(aim) * bspd; - } else { - const dx = bossC.cx - me.balloonBossCx; - const dy = bossC.cy - me.balloonBossCy; - const L = Math.hypot(dx, dy) || 1; - vx = (dx / L) * bspd; - vy = (dy / L) * bspd; - } + const aim = (typeof me.balloonBossAimRad === 'number' && Number.isFinite(me.balloonBossAimRad)) + ? me.balloonBossAimRad + : Math.atan2(bossC.cy - me.balloonBossCy, bossC.cx - me.balloonBossCx); + const vx = Math.cos(aim) * bspd; + const vy = Math.sin(aim) * bspd; balloonBossPendingShots.push({ releaseAt: now + delayMs, sx: me.balloonBossCx, sy: me.balloonBossCy, @@ -16610,10 +16617,10 @@ const sc = Math.min(maxBox / iw, maxBox / ih); const dw = iw * sc; const dh = ih * sc; - /** หางฟอง (Artboard +Y) หมุนตาม angRing — tail ชี้ทิศยิง */ + /** หางฟอง (Artboard 9: หางอยู่มุมขวาล่าง ~32.7°/0.5714rad จาก +X ไม่ใช่ +Y) หมุนให้ "หางชี้ตรงทิศยิง" = angRing */ ctx.save(); ctx.translate(sx, bubbleCy); - ctx.rotate(angRing - Math.PI / 2); + ctx.rotate(angRing - 0.5714); ctx.drawImage(ringImg, -dw / 2, -dh / 2, dw, dh); ctx.restore(); } diff --git a/www/html/Game/public/play.html b/www/html/Game/public/play.html index a2a99c0..48f9c22 100644 --- a/www/html/Game/public/play.html +++ b/www/html/Game/public/play.html @@ -5180,7 +5180,7 @@ - +
v —