minigame 2 lock zoom

This commit is contained in:
2026-05-06 07:30:48 +00:00
parent cc1da7a114
commit 95a1262ef1
3 changed files with 79 additions and 3 deletions
File diff suppressed because one or more lines are too long
+59 -1
View File
@@ -4056,6 +4056,16 @@
function usesCrownLobbyShellPlay() {
return isGauntletCrownHeistMapPlay() || isMegaVirusMissionShellMapPlay();
}
/** Last Light (mno9kb07) ใน iframe เอดิเตอร์: ซูมคงที่ — ผู้เล่นปรับเองไม่ได้ */
const PLAY_EMBED_LAST_LIGHT_FIXED_ZOOM_MUL = 1.49;
function isLastLightEmbedZoomLockedPlay() {
return !!(previewMode && editorEmbedReturn && mapData && isGauntletCrownHeistMapPlay());
}
function applyPlayEmbedZoomForCurrentMapPlay() {
if (isLastLightEmbedZoomLockedPlay()) {
playEmbedUserZoomMul = PLAY_EMBED_LAST_LIGHT_FIXED_ZOOM_MUL;
}
}
let gauntletCrownHowtoVisible = false;
function isGauntletCrownPregameBlockingPlay() {
if (!usesCrownLobbyShellPlay()) return false;
@@ -12986,6 +12996,7 @@
else if (dataId) playSessionMapId = dataId;
else if (resMap) playSessionMapId = resMap;
}
applyPlayEmbedZoomForCurrentMapPlay();
if (res && res.hostId != null) playHostId = res.hostId;
if (!isQuizQuestionMissionUiMapPlay()) {
quizQuestionMissionPhase = null;
@@ -13856,6 +13867,7 @@
if (ev.mapId != null && String(ev.mapId).trim() !== '') {
playSessionMapId = String(ev.mapId).trim();
}
applyPlayEmbedZoomForCurrentMapPlay();
if (!isQuizQuestionMissionUiMapPlay()) {
quizQuestionMissionPhase = null;
quizQuestionMissionDeferredPhase = null;
@@ -14267,6 +14279,7 @@
if (!stack) return;
const wheelZoomHandler = (e) => {
if (!previewMode || !editorEmbedReturn || !mapData) return;
if (isLastLightEmbedZoomLockedPlay()) return;
if (isQuizQuestionMissionHudActivePlay()) return;
const t = e.target;
if (t && typeof t.closest === 'function') {
@@ -15513,6 +15526,20 @@
: (isBalloonBoss() ? 'BALLOON BOSS · MEGA VIRUS'
: (isJumpSurviveMissionUiMapPlay() ? 'JUMPER · SURVIVE — เหลือเวลา (วินาที) · TIME (sec)' : 'JUMP SURVIVE · NODE UPLINK')))))));
}
const zoomHintEl = document.getElementById('play-cyber-embed-zoom-hint');
if (zoomHintEl) {
const showEmbedZoom = !!(previewMode && editorEmbedReturn && mapData && !isQuizQuestionMissionHudActivePlay());
if (showEmbedZoom) {
const zNum = Number(playEmbedUserZoomMul.toFixed(2));
zoomHintEl.textContent = '×' + String(zNum);
zoomHintEl.classList.remove('is-hidden');
zoomHintEl.setAttribute('aria-hidden', 'false');
} else {
zoomHintEl.textContent = '';
zoomHintEl.classList.add('is-hidden');
zoomHintEl.setAttribute('aria-hidden', 'true');
}
}
if (timeVal) {
if (isQuiz() && isQuizQuestionMissionUiMapPlay()) {
if (quizQuestionMissionPhase !== 'live' || quizQuestionMissionPhase === 'ended') {
@@ -15990,6 +16017,9 @@
zDraw = Math.min(canvas.width / qmc.mwPx, canvas.height / qmc.mhPx) * 0.96;
}
}
if (isLastLightEmbedZoomLockedPlay()) {
playEmbedUserZoomMul = PLAY_EMBED_LAST_LIGHT_FIXED_ZOOM_MUL;
}
if (previewMode && editorEmbedReturn && mapData && !isQuizQuestionMissionHudActivePlay()) {
zDraw *= playEmbedUserZoomMul;
}
@@ -16649,6 +16679,29 @@
for (let i = 0; i < (id || '').length; i++) h = (h * 31 + (id || '').charCodeAt(i)) >>> 0;
return { ax: ((h % 5) - 2) * 0.1, ay: ((Math.floor(h / 5) % 5) - 2) * 0.1 };
}
function shouldGauntletCrownHeistSkipAvatarDrawPlay(ent, isMeFlag, offAx, offAy) {
if (!isGauntletCrownHeistMapPlay() || gauntletCrownPregamePhase !== 'live') return false;
if (!ent || ent.gauntletEliminated) return true;
const { cw, ch } = getCharacterFootprintWH(mapData);
const ax = safeX(ent.x) + (offAx || 0);
const ay = safeY(ent.y) + (offAy || 0);
const airTicks = isMeFlag ? (meGauntletJumpTicks || 0) : (Number(ent.gauntletJumpTicks) || 0);
const airVis = isMeFlag ? (meGauntletJumpVis || 0) : (Number(ent.gauntletJumpVis) || 0);
const air = airVis > 0.08 ? airVis : airTicks;
let liftWorldY = 0;
if (isGauntlet() && air > 0) {
liftWorldY = gauntletLiftHeightNorm(air, gauntletRuntimeJumpTicks) * tileSize * 0.52;
}
const cxWorld = (ax + cw * 0.5) * tileSize;
const cyBottomWorld = (ay + ch) * tileSize - liftWorldY;
const [sx, sy] = worldToScreen(cxWorld, cyBottomWorld);
const cellSpan = Math.max(cw, ch);
const r = Math.max(14, (tileSize * zDraw * cellSpan) / 2 - 2);
const pad = Math.max(28, r * 0.4);
if (sx + r + pad < 0 || sx - r - pad > canvas.width) return true;
if (sy + 52 < 0 || sy - r * 4 - pad > canvas.height) return true;
return false;
}
const { ch: sortCh } = getCharacterFootprintWH(mapData);
/** ใช้แถวกริด (floor y) เป็นหลัก — ลดการสลับลำดับวาดทุกเฟรมเมื่อ y เป็น float เลอร์ป */
function avatarDrawDepth(ent) {
@@ -16698,11 +16751,13 @@
const faceDirOther = isGauntletFaceRightMapMno9kb07() ? 'right' : o.direction;
const botOut = isJumpSurvive() && isPreviewBotId(id) && o.jumpSurviveEliminated;
const peerName = botOut ? (o.nickname + ' (ตกรอบ)') : o.nickname;
if (shouldGauntletCrownHeistSkipAvatarDrawPlay(o, false, off.ax, off.ay)) return;
if (botOut) ctx.save();
if (botOut) ctx.globalAlpha = 0.4;
drawAvatar(safeX(o.x) + off.ax, safeY(o.y) + off.ay, false, peerName, o.characterId, faceDirOther, otherWalk, ot, (o.gauntletJumpVis != null ? o.gauntletJumpVis : o.gauntletJumpTicks) || 0, o.gauntletScore || 0, quizCarrySignForEntity(o), isGauntletCrownHeistMapPlay() ? (o.gauntletCrownPenaltyFxUntil || 0) : 0);
if (botOut) ctx.restore();
} else {
if (shouldGauntletCrownHeistSkipAvatarDrawPlay(me, true, 0, 0)) return;
if (isJumpSurvive() && jumpSurviveEliminated) ctx.save();
if (isJumpSurvive() && jumpSurviveEliminated) ctx.globalAlpha = 0.4;
const faceDirMe = isGauntletFaceRightMapMno9kb07() ? 'right' : me.direction;
@@ -16820,7 +16875,7 @@
document.addEventListener('keydown', (e) => {
if (isMovementKey(e.code) && isChatFocused()) return;
if (previewMode && editorEmbedReturn && mapData && !isChatFocused() && !isQuizQuestionMissionHudActivePlay()) {
if (previewMode && editorEmbedReturn && mapData && !isChatFocused() && !isQuizQuestionMissionHudActivePlay() && !isLastLightEmbedZoomLockedPlay()) {
if (e.code === 'BracketLeft' || e.code === 'Minus' || e.code === 'NumpadSubtract') {
e.preventDefault();
playEmbedUserZoomMul = Math.max(PLAY_EMBED_USER_ZOOM_MIN, playEmbedUserZoomMul / PLAY_EMBED_ZOOM_STEP_KEY);
@@ -17050,6 +17105,9 @@
others.forEach((o) => {
if (o) clampPlayEntityFootprintToMap(o, mapData);
});
if (isLastLightEmbedZoomLockedPlay()) {
playEmbedUserZoomMul = PLAY_EMBED_LAST_LIGHT_FIXED_ZOOM_MUL;
}
let zGa = zoom;
if (previewMode && editorEmbedReturn && mapData) zGa *= playEmbedUserZoomMul;
const gCam = getGauntletCrownHeistGroupCameraCenterPxPlay(tileSize, canvas.width, canvas.height, zGa);
+19 -1
View File
@@ -2727,6 +2727,23 @@
color: rgba(122, 248, 255, 0.5);
max-width: 70vw;
}
/* พรีวิวใน iframe เอดิเตอร์: แสดงค่าซูม (×) ใต้บรรทัดคำอธิบายใต้เวลา — เช่น Last Light mno9kb07 */
.play-cyber-embed-zoom-hint {
margin-top: 0.12rem;
font-size: 0.62rem;
font-weight: 700;
letter-spacing: 0.06em;
color: rgba(160, 255, 220, 0.72);
text-shadow: 0 0 10px rgba(0, 255, 180, 0.35);
line-height: 1.2;
}
#play-cyber-embed-zoom-hint.is-hidden {
display: none !important;
}
#play-cyber-hud.play-cyber-hud--gauntlet-crown-strip .play-cyber-embed-zoom-hint {
text-align: left;
max-width: min(100%, 320px);
}
.play-cyber-self {
position: absolute;
top: max(52px, calc(env(safe-area-inset-top) + 38px));
@@ -2976,6 +2993,7 @@
<div id="play-cyber-time-val" class="play-cyber-time-val">0</div>
</div>
<div id="play-cyber-time-sub" class="play-cyber-time-sub"></div>
<div id="play-cyber-embed-zoom-hint" class="play-cyber-embed-zoom-hint is-hidden" aria-hidden="true"></div>
</div>
<div id="play-cyber-quiz-mission-q-band" class="play-cyber-quiz-mission-q-band is-hidden" aria-hidden="true">
<img id="play-cyber-quiz-mission-q-plaque" class="play-cyber-quiz-mission-q-plaque is-hidden" alt="" decoding="async" />
@@ -3145,7 +3163,7 @@
</div>
<script src="/Game/socket.io/socket.io.js"></script>
<script src="js/version.js?v=0.0306"></script>
<script src="js/play.js?v=0.0333"></script>
<script src="js/play.js?v=0.0335"></script>
<div class="version-tag">v —</div>
</body>
</html>