feat(bazaar): remove mistake grain bonus, add NPC greeting pools with manual start, ground camp & calibrator (20261127_v2)
Browse files- boss-test.html +7 -7
- boss.html +3 -3
- css/bazaar.css +68 -12
- docs/management/STATUS.md +2 -2
- docs/management/decisions.md +10 -0
- index.html +7 -7
- js/admin.js +11 -8
- js/announcements.js +1 -1
- js/bazaar-ui.js +19 -14
- js/bazaar.js +6 -10
- js/boss-battle.js +6 -6
- js/config.js +58 -6
- js/db.js +7 -7
- js/engine.js +4 -4
- js/event-schedule.js +3 -3
- js/game.js +13 -13
- js/lottery-core.js +2 -2
- js/lottery-draw.js +4 -4
- js/lottery.js +8 -8
- js/map.js +9 -8
- js/merchant-ui.js +4 -4
- js/merchant.js +3 -3
- js/preload.js +4 -4
- js/quiz.js +2 -2
- js/tianji.js +4 -4
- js/world-boss-schedule.js +1 -1
- lottery-draw.html +4 -4
- teacher.html +5 -5
- tools/verify-balance-sim.mjs +1 -1
- tools/verify-integrity.mjs +8 -2
boss-test.html
CHANGED
|
@@ -5,14 +5,14 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>上古・饕餮 討伐戰|世界王測試頁</title>
|
| 7 |
<meta name="description" content="世界王上古・饕餮討伐戰獨立測試頁:Boss 介紹、討伐獎勵與全螢幕答題戰鬥。">
|
| 8 |
-
<link rel="stylesheet" href="css/base.css?v=
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&display=swap" rel="stylesheet">
|
| 12 |
<!-- KaTeX 數學式與科學記號渲染引擎 -->
|
| 13 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
|
| 14 |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script>
|
| 15 |
-
<link rel="stylesheet" href="css/boss.css?v=
|
| 16 |
</head>
|
| 17 |
<body>
|
| 18 |
|
|
@@ -410,15 +410,15 @@
|
|
| 410 |
</div>
|
| 411 |
|
| 412 |
<script type="module">
|
| 413 |
-
import { getDB, DBError, defaultBossState } from './js/db.js?v=
|
| 414 |
-
import { loadBank, loadBankIndex } from './js/quiz.js?v=
|
| 415 |
import {
|
| 416 |
recordMistake, recordCorrect, derive, totalProd, grantGrain, grantTally, grantScroll,
|
| 417 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 418 |
getBossDailyQuestionTheme, getBossWeaponBuffs
|
| 419 |
-
} from './js/engine.js?v=
|
| 420 |
-
import { loadEnglishWords, buildWordQuestion } from './js/merchant.js?v=
|
| 421 |
-
import { todayStr, fmt, shuffle, renderRichQuizText } from './js/util.js?v=
|
| 422 |
|
| 423 |
// ==========================================
|
| 424 |
// 1. 全域與連線狀態
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>上古・饕餮 討伐戰|世界王測試頁</title>
|
| 7 |
<meta name="description" content="世界王上古・饕餮討伐戰獨立測試頁:Boss 介紹、討伐獎勵與全螢幕答題戰鬥。">
|
| 8 |
+
<link rel="stylesheet" href="css/base.css?v=20261127_v2">
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&display=swap" rel="stylesheet">
|
| 12 |
<!-- KaTeX 數學式與科學記號渲染引擎 -->
|
| 13 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
|
| 14 |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script>
|
| 15 |
+
<link rel="stylesheet" href="css/boss.css?v=20261127_v2">
|
| 16 |
</head>
|
| 17 |
<body>
|
| 18 |
|
|
|
|
| 410 |
</div>
|
| 411 |
|
| 412 |
<script type="module">
|
| 413 |
+
import { getDB, DBError, defaultBossState } from './js/db.js?v=20261127_v2';
|
| 414 |
+
import { loadBank, loadBankIndex } from './js/quiz.js?v=20261127_v2';
|
| 415 |
import {
|
| 416 |
recordMistake, recordCorrect, derive, totalProd, grantGrain, grantTally, grantScroll,
|
| 417 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 418 |
getBossDailyQuestionTheme, getBossWeaponBuffs
|
| 419 |
+
} from './js/engine.js?v=20261127_v2';
|
| 420 |
+
import { loadEnglishWords, buildWordQuestion } from './js/merchant.js?v=20261127_v2';
|
| 421 |
+
import { todayStr, fmt, shuffle, renderRichQuizText } from './js/util.js?v=20261127_v2';
|
| 422 |
|
| 423 |
// ==========================================
|
| 424 |
// 1. 全域與連線狀態
|
boss.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>世界 Boss 決戰殿堂|爭霸天下</title>
|
| 7 |
<meta name="description" content="全班共抗太古凶神!破除錯題迷障、連擊合力封印,奪取神獸寶庫與至高榮譽稱號!">
|
| 8 |
-
<link rel="stylesheet" href="css/base.css?v=
|
| 9 |
-
<link rel="stylesheet" href="css/boss.css?v=
|
| 10 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 11 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 12 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&display=swap" rel="stylesheet">
|
|
@@ -250,6 +250,6 @@
|
|
| 250 |
|
| 251 |
<!-- ===================== 版本更新公告彈窗(模版展示) ===================== -->
|
| 252 |
|
| 253 |
-
<script type="module" src="js/boss-battle.js?v=
|
| 254 |
</body>
|
| 255 |
</html>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>世界 Boss 決戰殿堂|爭霸天下</title>
|
| 7 |
<meta name="description" content="全班共抗太古凶神!破除錯題迷障、連擊合力封印,奪取神獸寶庫與至高榮譽稱號!">
|
| 8 |
+
<link rel="stylesheet" href="css/base.css?v=20261127_v2">
|
| 9 |
+
<link rel="stylesheet" href="css/boss.css?v=20261127_v2">
|
| 10 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 11 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 12 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&display=swap" rel="stylesheet">
|
|
|
|
| 250 |
|
| 251 |
<!-- ===================== 版本更新公告彈窗(模版展示) ===================== -->
|
| 252 |
|
| 253 |
+
<script type="module" src="js/boss-battle.js?v=20261127_v2"></script>
|
| 254 |
</body>
|
| 255 |
</html>
|
css/bazaar.css
CHANGED
|
@@ -1160,7 +1160,11 @@
|
|
| 1160 |
right: 12px;
|
| 1161 |
bottom: 12px;
|
| 1162 |
z-index: 8;
|
| 1163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1164 |
border-radius: 12px;
|
| 1165 |
background: #fffaf0;
|
| 1166 |
border: 3px solid #3c2213;
|
|
@@ -1170,26 +1174,77 @@
|
|
| 1170 |
animation: bzIntroFadeUp 0.35s ease-out 0.9s forwards;
|
| 1171 |
}
|
| 1172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1173 |
.bz-intro-line {
|
| 1174 |
-
font-size:
|
| 1175 |
font-weight: 900;
|
| 1176 |
-
line-height: 1.
|
|
|
|
| 1177 |
}
|
| 1178 |
|
| 1179 |
.bz-intro-sub {
|
| 1180 |
-
margin-top:
|
| 1181 |
-
font-size:
|
| 1182 |
font-weight: 700;
|
| 1183 |
color: #7c4b27;
|
| 1184 |
}
|
| 1185 |
|
| 1186 |
-
.bz-intro-
|
| 1187 |
-
|
| 1188 |
-
|
| 1189 |
-
|
| 1190 |
-
|
| 1191 |
-
|
| 1192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1193 |
}
|
| 1194 |
|
| 1195 |
.bz-intro-curtain {
|
|
@@ -1956,6 +2011,7 @@
|
|
| 1956 |
|
| 1957 |
.map-spot.spot-merchant-camp.spot-bazaar-camp .spot-merchant-img {
|
| 1958 |
filter: drop-shadow(0 8px 18px rgba(245, 158, 11, 0.55));
|
|
|
|
| 1959 |
}
|
| 1960 |
|
| 1961 |
.map-spot.spot-merchant-camp.spot-bazaar-camp .spot-badge-daily {
|
|
|
|
| 1160 |
right: 12px;
|
| 1161 |
bottom: 12px;
|
| 1162 |
z-index: 8;
|
| 1163 |
+
display: flex;
|
| 1164 |
+
align-items: center;
|
| 1165 |
+
justify-content: space-between;
|
| 1166 |
+
gap: 14px;
|
| 1167 |
+
padding: 14px 18px;
|
| 1168 |
border-radius: 12px;
|
| 1169 |
background: #fffaf0;
|
| 1170 |
border: 3px solid #3c2213;
|
|
|
|
| 1174 |
animation: bzIntroFadeUp 0.35s ease-out 0.9s forwards;
|
| 1175 |
}
|
| 1176 |
|
| 1177 |
+
.bz-intro-dialog-body {
|
| 1178 |
+
flex: 1 1 auto;
|
| 1179 |
+
min-width: 0;
|
| 1180 |
+
}
|
| 1181 |
+
|
| 1182 |
+
.bz-intro-speaker {
|
| 1183 |
+
display: inline-block;
|
| 1184 |
+
margin-bottom: 4px;
|
| 1185 |
+
padding: 2px 10px;
|
| 1186 |
+
border-radius: 999px;
|
| 1187 |
+
background: #3c2213;
|
| 1188 |
+
color: #fde68a;
|
| 1189 |
+
font-size: 12px;
|
| 1190 |
+
font-weight: 800;
|
| 1191 |
+
letter-spacing: 0.04em;
|
| 1192 |
+
}
|
| 1193 |
+
|
| 1194 |
.bz-intro-line {
|
| 1195 |
+
font-size: 16px;
|
| 1196 |
font-weight: 900;
|
| 1197 |
+
line-height: 1.45;
|
| 1198 |
+
color: #2c160b;
|
| 1199 |
}
|
| 1200 |
|
| 1201 |
.bz-intro-sub {
|
| 1202 |
+
margin-top: 4px;
|
| 1203 |
+
font-size: 12px;
|
| 1204 |
font-weight: 700;
|
| 1205 |
color: #7c4b27;
|
| 1206 |
}
|
| 1207 |
|
| 1208 |
+
.bz-intro-start-btn {
|
| 1209 |
+
flex: 0 0 auto;
|
| 1210 |
+
min-height: 44px;
|
| 1211 |
+
padding: 10px 20px;
|
| 1212 |
+
border-radius: 10px;
|
| 1213 |
+
border: 2px solid #78350f;
|
| 1214 |
+
background: linear-gradient(135deg, #f59e0b, #d97706);
|
| 1215 |
+
color: #ffffff;
|
| 1216 |
+
font-size: 15px;
|
| 1217 |
+
font-weight: 900;
|
| 1218 |
+
letter-spacing: 0.04em;
|
| 1219 |
+
cursor: pointer;
|
| 1220 |
+
box-shadow: 0 4px 12px rgba(217, 119, 6, 0.45);
|
| 1221 |
+
transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
|
| 1222 |
+
white-space: nowrap;
|
| 1223 |
+
}
|
| 1224 |
+
|
| 1225 |
+
.bz-intro-start-btn:hover {
|
| 1226 |
+
transform: translateY(-1px) scale(1.03);
|
| 1227 |
+
box-shadow: 0 6px 16px rgba(217, 119, 6, 0.6);
|
| 1228 |
+
filter: brightness(1.05);
|
| 1229 |
+
}
|
| 1230 |
+
|
| 1231 |
+
.bz-intro-start-btn:active {
|
| 1232 |
+
transform: translateY(1px) scale(0.98);
|
| 1233 |
+
}
|
| 1234 |
+
|
| 1235 |
+
@media (max-width: 640px) {
|
| 1236 |
+
.bz-intro-dialog {
|
| 1237 |
+
flex-direction: column;
|
| 1238 |
+
align-items: stretch;
|
| 1239 |
+
gap: 10px;
|
| 1240 |
+
padding: 12px 14px;
|
| 1241 |
+
}
|
| 1242 |
+
.bz-intro-line {
|
| 1243 |
+
font-size: 15px;
|
| 1244 |
+
}
|
| 1245 |
+
.bz-intro-start-btn {
|
| 1246 |
+
width: 100%;
|
| 1247 |
+
}
|
| 1248 |
}
|
| 1249 |
|
| 1250 |
.bz-intro-curtain {
|
|
|
|
| 2011 |
|
| 2012 |
.map-spot.spot-merchant-camp.spot-bazaar-camp .spot-merchant-img {
|
| 2013 |
filter: drop-shadow(0 8px 18px rgba(245, 158, 11, 0.55));
|
| 2014 |
+
animation: none !important;
|
| 2015 |
}
|
| 2016 |
|
| 2017 |
.map-spot.spot-merchant-camp.spot-bazaar-camp .spot-badge-daily {
|
docs/management/STATUS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# 專案狀態總覽 (STATUS.md)
|
| 2 |
|
| 3 |
> **最後更新**:2026-11-27
|
| 4 |
-
> **目前生產版本**:`APP_BUILD_VERSION = '
|
| 5 |
> **主設計文件 (GDD)**:[docs/game_systems_overview.md](file:///d:/git/idle/docs/game_systems_overview.md)
|
| 6 |
|
| 7 |
---
|
|
@@ -27,7 +27,7 @@
|
|
| 27 |
- 產量單調棘輪(`peakProd` / `peakBuildings` 只升不降)、跨裝置 `activeSession` 互斥鎖、`lastAdminOp` 權威時間戳記合併、學生資源全自動對帳腳本。
|
| 28 |
7. **教師軍機中樞**([teacher.html](file:///d:/git/idle/teacher.html)、[js/admin.js](file:///d:/git/idle/js/admin.js))
|
| 29 |
- 全班即時監控、手動開放區間、資源補發/收回、課後防沉迷休整(平日 17:00~07:00、週末全天限制擴軍/升星/出征)。
|
| 30 |
-
- 九州名都沙盤校準器(
|
| 31 |
- 活動管理支援西域商隊/西域萬國大市集 5 種強制覆寫模式(`auto / open / bazaar / caravan / closed`)與 `bazaar_1`~`bazaar_4` 期別指定。
|
| 32 |
|
| 33 |
---
|
|
|
|
| 1 |
# 專案狀態總覽 (STATUS.md)
|
| 2 |
|
| 3 |
> **最後更新**:2026-11-27
|
| 4 |
+
> **目前生產版本**:`APP_BUILD_VERSION = '20261127_v2'`
|
| 5 |
> **主設計文件 (GDD)**:[docs/game_systems_overview.md](file:///d:/git/idle/docs/game_systems_overview.md)
|
| 6 |
|
| 7 |
---
|
|
|
|
| 27 |
- 產量單調棘輪(`peakProd` / `peakBuildings` 只升不降)、跨裝置 `activeSession` 互斥鎖、`lastAdminOp` 權威時間戳記合併、學生資源全自動對帳腳本。
|
| 28 |
7. **教師軍機中樞**([teacher.html](file:///d:/git/idle/teacher.html)、[js/admin.js](file:///d:/git/idle/js/admin.js))
|
| 29 |
- 全班即時監控、手動開放區間、資源補發/收回、課後防沉迷休整(平日 17:00~07:00、週末全天限制擴軍/升星/出征)。
|
| 30 |
+
- 九州名都沙盤校準器(15 點位含 `bazaarCamp` 西域大市集與 `lottery` 錯題樂透箱 4:3 圖資、座標/尺寸正規化防呆、圖片斷線重試與保底降級、快取版號連動)。
|
| 31 |
- 活動管理支援西域商隊/西域萬國大市集 5 種強制覆寫模式(`auto / open / bazaar / caravan / closed`)與 `bazaar_1`~`bazaar_4` 期別指定。
|
| 32 |
|
| 33 |
---
|
docs/management/decisions.md
CHANGED
|
@@ -258,3 +258,13 @@
|
|
| 258 |
1. **產量單調遞增鐵律**:建築等級、星級、秒產量(CPS)與 `peakBuildings` / `peakProd` 永遠只升不降,低於峰值自動觸發 `healYield()` 自我修復,嚴禁低階存檔覆蓋高階進度。
|
| 259 |
2. **零心理負擔原則**:離線屯墾無上限(`OFFLINE_CAP_HOURS = Infinity`),嚴禁設計定時遠征或倒數損毀機制;課後(平日 17:00~07:00、週末全天)進入休整模式,限制擴軍/升星/出征但保留測驗與資源累積。
|
| 260 |
3. **統一古風軍政語彙**:全面使用「兵符、糧草、駐防擴軍、加官進爵、出征收復」,禁用「虎符、圖紙、金幣、購買/升級建築」。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
1. **產量單調遞增鐵律**:建築等級、星級、秒產量(CPS)與 `peakBuildings` / `peakProd` 永遠只升不降,低於峰值自動觸發 `healYield()` 自我修復,嚴禁低階存檔覆蓋高階進度。
|
| 259 |
2. **零心理負擔原則**:離線屯墾無上限(`OFFLINE_CAP_HOURS = Infinity`),嚴禁設計定時遠征或倒數損毀機制;課後(平日 17:00~07:00、週末全天)進入休整模式,限制擴軍/升星/出征但保留測驗與資源累積。
|
| 260 |
3. **統一古風軍政語彙**:全面使用「兵符、糧草、駐防擴軍、加官進爵、出征收復」,禁用「虎符、圖紙、金幣、購買/升級建築」。
|
| 261 |
+
|
| 262 |
+
---
|
| 263 |
+
|
| 264 |
+
### DEC-20261127-02:大市集錯題進度去糧草、商人問候對話庫手動開題、地面固定與沙盤校準獨立項
|
| 265 |
+
- **日期**:2026-11-27
|
| 266 |
+
- **決策內容**:
|
| 267 |
+
1. 錯題進度推進(`0/3 → 1/3 → 2/3`)不再發放 `+180` 秒糧草(`chainTapGrainSec: 0`),介面僅乾淨顯示 `📝 錯題進度 0/3 → 1/3`。
|
| 268 |
+
2. 4 位大市集商人(阿卜杜勒、莎赫拉、迦陵、伊本)各配置 5 句角色專屬問候對話庫;遭遇動畫後停留於問候對話框,由玩家主動點擊 `▶ 開始挑戰` 才開始 40 秒計時答題(取消自動倒數開題)。
|
| 269 |
+
3. 西域萬國大市集於九州沙盤移除上下漂浮動畫(`animation: none !important`),並於 `MAP_POS` 與 `teacher.html` 教師沙盤校準器(`MAP_TOWNS_DEF`)新增獨立可校準項目 `bazaarCamp`(`assets/bazaar_camp.png`),與常規 `merchantCamp` 位置尺寸互不干擾。
|
| 270 |
+
- **適用範圍**:`js/config.js`、`js/bazaar.js`、`js/bazaar-ui.js`、`js/map.js`、`js/admin.js`、`css/bazaar.css`、`tools/verify-balance-sim.mjs`。
|
index.html
CHANGED
|
@@ -8,10 +8,10 @@
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Noto+Sans+TC:wght@400;600;700;900&display=swap" rel="stylesheet">
|
| 11 |
-
<link rel="stylesheet" href="css/base.css?v=
|
| 12 |
-
<link rel="stylesheet" href="css/game.css?v=
|
| 13 |
-
<link rel="stylesheet" href="css/lottery.css?v=
|
| 14 |
-
<link rel="stylesheet" href="css/bazaar.css?v=
|
| 15 |
<!-- KaTeX 數學式與科學記號渲染引擎 -->
|
| 16 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
|
| 17 |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script>
|
|
@@ -75,7 +75,7 @@
|
|
| 75 |
<button id="btnLogin" class="btn btn-primary" type="submit" style="width:100%">進入軍帳</button>
|
| 76 |
<p id="loginErr" class="err-text hidden"></p>
|
| 77 |
</form>
|
| 78 |
-
<p class="mute center">大將軍/教師請前往 <a href="teacher.html?v=
|
| 79 |
</div>
|
| 80 |
</section>
|
| 81 |
|
|
@@ -183,7 +183,7 @@
|
|
| 183 |
<button id="merchantCamel" class="merchant-camel hidden" aria-label="駱駝商人">
|
| 184 |
<div class="camel-bubble" id="camelBubble">🐫 駱駝商人來訪!交流交流~</div>
|
| 185 |
<div class="camel-body-wrap">
|
| 186 |
-
<img src="assets/camel_caravan.png?v=
|
| 187 |
<div class="camel-shadow"></div>
|
| 188 |
</div>
|
| 189 |
</button>
|
|
@@ -370,6 +370,6 @@
|
|
| 370 |
<iframe id="bossBattleIframe" style="width:100%; height:100%; border:none; background:#000;" allow="autoplay" src="about:blank"></iframe>
|
| 371 |
</div>
|
| 372 |
|
| 373 |
-
<script type="module" src="js/game.js?v=
|
| 374 |
</body>
|
| 375 |
</html>
|
|
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Noto+Sans+TC:wght@400;600;700;900&display=swap" rel="stylesheet">
|
| 11 |
+
<link rel="stylesheet" href="css/base.css?v=20261127_v2">
|
| 12 |
+
<link rel="stylesheet" href="css/game.css?v=20261127_v2">
|
| 13 |
+
<link rel="stylesheet" href="css/lottery.css?v=20261127_v2">
|
| 14 |
+
<link rel="stylesheet" href="css/bazaar.css?v=20261127_v2">
|
| 15 |
<!-- KaTeX 數學式與科學記號渲染引擎 -->
|
| 16 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
|
| 17 |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script>
|
|
|
|
| 75 |
<button id="btnLogin" class="btn btn-primary" type="submit" style="width:100%">進入軍帳</button>
|
| 76 |
<p id="loginErr" class="err-text hidden"></p>
|
| 77 |
</form>
|
| 78 |
+
<p class="mute center">大將軍/教師請前往 <a href="teacher.html?v=20261127_v2">軍機中樞(教師後台)</a></p>
|
| 79 |
</div>
|
| 80 |
</section>
|
| 81 |
|
|
|
|
| 183 |
<button id="merchantCamel" class="merchant-camel hidden" aria-label="駱駝商人">
|
| 184 |
<div class="camel-bubble" id="camelBubble">🐫 駱駝商人來訪!交流交流~</div>
|
| 185 |
<div class="camel-body-wrap">
|
| 186 |
+
<img src="assets/camel_caravan.png?v=20261127_v2" class="camel-avatar-img" alt="駱駝商人">
|
| 187 |
<div class="camel-shadow"></div>
|
| 188 |
</div>
|
| 189 |
</button>
|
|
|
|
| 370 |
<iframe id="bossBattleIframe" style="width:100%; height:100%; border:none; background:#000;" allow="autoplay" src="about:blank"></iframe>
|
| 371 |
</div>
|
| 372 |
|
| 373 |
+
<script type="module" src="js/game.js?v=20261127_v2"></script>
|
| 374 |
</body>
|
| 375 |
</html>
|
js/admin.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
import { getDB, normCode } from './db.js?v=
|
| 2 |
-
import { $, $$, bind, withLoading, toast, openModal, fmtDateTime, fmt, esc, todayStr, addDays } from './util.js?v=
|
| 3 |
-
import { loadBankIndex } from './quiz.js?v=
|
| 4 |
-
import { APP_BUILD_VERSION, SCHEDULE, TIERS, EVENTS_CONFIG, WORLD_BOSS_SCHEDULE, DEFAULT_OPEN_HOUR } from './config.js?v=
|
| 5 |
import {
|
| 6 |
newGame, normalizeGame, derive, totalProd, isEventOpen, getEventStatusInfo,
|
| 7 |
checkYieldHealth, healYield, calcWorldBossStatus, calcWorldBossRewards,
|
| 8 |
hasClaimedBossReward, formatCountdown, formatOpenAt,
|
| 9 |
getActiveWorldBossConfig, getBossDailyQuestionTheme, calcDynamicWorldBossBalance,
|
| 10 |
openDate, isRangeOpen
|
| 11 |
-
} from './engine.js?v=
|
| 12 |
import {
|
| 13 |
resolveWeeklySpotlight, resolveCaravanModeState, buildPilotLotterySpotlightPreset, buildOddWeekSpotlightPreset,
|
| 14 |
findUnclaimedLegacyBossStudents, formatCycleRangeLabel
|
| 15 |
-
} from './event-schedule.js?v=
|
| 16 |
import {
|
| 17 |
LOTTERY_DEFAULT_MILESTONES, LOTTERY_PILOT_MILESTONES, calcLotteryMilestonesProgress, calcDynamicLotteryBalance
|
| 18 |
-
} from './lottery-core.js?v=
|
| 19 |
|
| 20 |
let db, user, currentClassCode = null;
|
| 21 |
let classes = [], students = [], banks = [];
|
|
@@ -2487,6 +2487,7 @@ export const MAP_TOWNS_DEF = [
|
|
| 2487 |
{ id: 'b10', name: '霸業王城', icon: '🏰', specialty: '皇極九五・山巔王城', defX: 52.0, defY: 20.6, defSize: 175 },
|
| 2488 |
{ id: 'tianji', name: '天機閣', icon: '🏯', specialty: '急速快答・軍備寶箱', defX: 34.5, defY: 29.7, defSize: 154 },
|
| 2489 |
{ id: 'merchantCamp', name: '西域商隊', icon: '🎪', specialty: '限時快答・商隊大營', defX: 44.2, defY: 46.8, defSize: 145 },
|
|
|
|
| 2490 |
{ id: 'boss', name: '世界Boss', icon: '🐲', specialty: '世界Boss・懸空禁地', defX: 81.5, defY: 22.0, defSize: 168 },
|
| 2491 |
{ id: 'lottery', name: '錯題樂透箱', icon: '🎰', specialty: '空中飛翔・琉璃樂透開獎箱', defX: 18.0, defY: 27.5, defSize: 158 },
|
| 2492 |
];
|
|
@@ -2494,7 +2495,7 @@ export const MAP_TOWNS_DEF = [
|
|
| 2494 |
/** 依點位寬高比例換算沙盤縮圖高度(商隊與 4:3 樂透箱皆維持 0.75 高寬比) */
|
| 2495 |
export function calcMapThumbHeight(bid, size) {
|
| 2496 |
const safeSize = Math.max(40, Math.min(600, Math.round(Number(size) || 120)));
|
| 2497 |
-
return (bid === 'merchantCamp' || bid === 'lottery') ? Math.round(safeSize * 0.75) : safeSize;
|
| 2498 |
}
|
| 2499 |
|
| 2500 |
/** 正規化單一沙盤點位的座標與尺寸,避免舊存檔缺欄位或 NaN 導致圖片縮放為 0 或渲染崩潰 */
|
|
@@ -2535,6 +2536,8 @@ export function resolveMapNodeImageCandidates(town, { curBossId = 'taotie', isEr
|
|
| 2535 |
if (curBossId === 'qiongqi') extraFallbacks.push('assets/boss_taotie.png');
|
| 2536 |
} else if (id === 'merchantCamp') {
|
| 2537 |
basePath = 'assets/merchant_caravan_lv1.png';
|
|
|
|
|
|
|
| 2538 |
} else if (id === 'lottery') {
|
| 2539 |
basePath = 'assets/lottery_box.png';
|
| 2540 |
extraFallbacks.push('assets/chest_gold.png');
|
|
|
|
| 1 |
+
import { getDB, normCode } from './db.js?v=20261127_v2';
|
| 2 |
+
import { $, $$, bind, withLoading, toast, openModal, fmtDateTime, fmt, esc, todayStr, addDays } from './util.js?v=20261127_v2';
|
| 3 |
+
import { loadBankIndex } from './quiz.js?v=20261127_v2';
|
| 4 |
+
import { APP_BUILD_VERSION, SCHEDULE, TIERS, EVENTS_CONFIG, WORLD_BOSS_SCHEDULE, DEFAULT_OPEN_HOUR } from './config.js?v=20261127_v2';
|
| 5 |
import {
|
| 6 |
newGame, normalizeGame, derive, totalProd, isEventOpen, getEventStatusInfo,
|
| 7 |
checkYieldHealth, healYield, calcWorldBossStatus, calcWorldBossRewards,
|
| 8 |
hasClaimedBossReward, formatCountdown, formatOpenAt,
|
| 9 |
getActiveWorldBossConfig, getBossDailyQuestionTheme, calcDynamicWorldBossBalance,
|
| 10 |
openDate, isRangeOpen
|
| 11 |
+
} from './engine.js?v=20261127_v2';
|
| 12 |
import {
|
| 13 |
resolveWeeklySpotlight, resolveCaravanModeState, buildPilotLotterySpotlightPreset, buildOddWeekSpotlightPreset,
|
| 14 |
findUnclaimedLegacyBossStudents, formatCycleRangeLabel
|
| 15 |
+
} from './event-schedule.js?v=20261127_v2';
|
| 16 |
import {
|
| 17 |
LOTTERY_DEFAULT_MILESTONES, LOTTERY_PILOT_MILESTONES, calcLotteryMilestonesProgress, calcDynamicLotteryBalance
|
| 18 |
+
} from './lottery-core.js?v=20261127_v2';
|
| 19 |
|
| 20 |
let db, user, currentClassCode = null;
|
| 21 |
let classes = [], students = [], banks = [];
|
|
|
|
| 2487 |
{ id: 'b10', name: '霸業王城', icon: '🏰', specialty: '皇極九五・山巔王城', defX: 52.0, defY: 20.6, defSize: 175 },
|
| 2488 |
{ id: 'tianji', name: '天機閣', icon: '🏯', specialty: '急速快答・軍備寶箱', defX: 34.5, defY: 29.7, defSize: 154 },
|
| 2489 |
{ id: 'merchantCamp', name: '西域商隊', icon: '🎪', specialty: '限時快答・商隊大營', defX: 44.2, defY: 46.8, defSize: 145 },
|
| 2490 |
+
{ id: 'bazaarCamp', name: '西域大市集', icon: '🕌', specialty: '十卷賓果・萬國大市集', defX: 44.2, defY: 46.8, defSize: 155 },
|
| 2491 |
{ id: 'boss', name: '世界Boss', icon: '🐲', specialty: '世界Boss・懸空禁地', defX: 81.5, defY: 22.0, defSize: 168 },
|
| 2492 |
{ id: 'lottery', name: '錯題樂透箱', icon: '🎰', specialty: '空中飛翔・琉璃樂透開獎箱', defX: 18.0, defY: 27.5, defSize: 158 },
|
| 2493 |
];
|
|
|
|
| 2495 |
/** 依點位寬高比例換算沙盤縮圖高度(商隊與 4:3 樂透箱皆維持 0.75 高寬比) */
|
| 2496 |
export function calcMapThumbHeight(bid, size) {
|
| 2497 |
const safeSize = Math.max(40, Math.min(600, Math.round(Number(size) || 120)));
|
| 2498 |
+
return (bid === 'merchantCamp' || bid === 'bazaarCamp' || bid === 'lottery') ? Math.round(safeSize * 0.75) : safeSize;
|
| 2499 |
}
|
| 2500 |
|
| 2501 |
/** 正規化單一沙盤點位的座標與尺寸,避免舊存檔缺欄位或 NaN 導致圖片縮放為 0 或渲染崩潰 */
|
|
|
|
| 2536 |
if (curBossId === 'qiongqi') extraFallbacks.push('assets/boss_taotie.png');
|
| 2537 |
} else if (id === 'merchantCamp') {
|
| 2538 |
basePath = 'assets/merchant_caravan_lv1.png';
|
| 2539 |
+
} else if (id === 'bazaarCamp') {
|
| 2540 |
+
basePath = 'assets/bazaar_camp.png';
|
| 2541 |
} else if (id === 'lottery') {
|
| 2542 |
basePath = 'assets/lottery_box.png';
|
| 2543 |
extraFallbacks.push('assets/chest_gold.png');
|
js/announcements.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
* 支援預約生效時間、剪影展示、未讀自動彈出、手動隨時回看。
|
| 5 |
*/
|
| 6 |
|
| 7 |
-
import { openModal } from './util.js?v=
|
| 8 |
|
| 9 |
export const ANNOUNCEMENT_REGISTRY = [
|
| 10 |
{
|
|
|
|
| 4 |
* 支援預約生效時間、剪影展示、未讀自動彈出、手動隨時回看。
|
| 5 |
*/
|
| 6 |
|
| 7 |
+
import { openModal } from './util.js?v=20261127_v2';
|
| 8 |
|
| 9 |
export const ANNOUNCEMENT_REGISTRY = [
|
| 10 |
{
|
js/bazaar-ui.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
| 7 |
// - 4 大角色專屬考單字對決舞台(阿卜杜勒/莎赫拉 5×5 配對/迦陵語音切換/伊本拼字)
|
| 8 |
// - 戰後結算、班級首破交易 sync 與計時器/語音嚴格清理
|
| 9 |
// ============================================================================
|
| 10 |
-
import { APP_BUILD_VERSION, BAZAAR_CONFIG, MERCHANT, formatTitleBadge } from './config.js?v=
|
| 11 |
-
import { $, $$, bind, esc, fmt, fmtDateTime, toast, openModal } from './util.js?v=
|
| 12 |
-
import { getMerchantStatus } from './merchant.js?v=
|
| 13 |
-
import { renderMerchantMarketPanel } from './merchant-ui.js?v=
|
| 14 |
import {
|
| 15 |
ensureBazaarCycleState,
|
| 16 |
getBazaarQuotaInfo,
|
|
@@ -25,7 +25,7 @@ import {
|
|
| 25 |
settleBazaarEncounter,
|
| 26 |
loadEnglishWords,
|
| 27 |
speakWord,
|
| 28 |
-
} from './bazaar.js?v=
|
| 29 |
|
| 30 |
const SCROLL_TITLES = ['卷壹', '卷貳', '卷參', '卷肆', '卷伍', '卷陸', '卷柒', '卷捌', '卷玖', '卷拾'];
|
| 31 |
const OPTION_LABELS = ['A', 'B', 'C', 'D'];
|
|
@@ -1234,6 +1234,11 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 1234 |
`<div class="bz-shutter-bar ${idx % 2 === 0 ? 'is-even' : 'is-odd'}" style="animation-delay:${(0.12 + idx * 0.03).toFixed(2)}s;"></div>`
|
| 1235 |
)).join('');
|
| 1236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1237 |
container.innerHTML = `
|
| 1238 |
<div class="bz-shell">
|
| 1239 |
${getHeaderHtml(cycleCfg, summary, false)}
|
|
@@ -1242,12 +1247,14 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 1242 |
<div class="bz-intro-bg"></div>
|
| 1243 |
<div class="bz-intro-npc"><img src="${npc.img}?v=${getBuildVer()}" alt="${esc(npc.name)}"></div>
|
| 1244 |
<div class="bz-intro-dialog" id="bzIntroDialog">
|
| 1245 |
-
<div class="bz-intro-
|
| 1246 |
-
|
| 1247 |
-
|
|
|
|
|
|
|
|
|
|
| 1248 |
</div>
|
| 1249 |
<div class="bz-intro-curtain">${curtainBarsHtml}</div>
|
| 1250 |
-
<button type="button" class="bz-walk-skip-btn" id="btnIntroStart">開始挑戰 ▶</button>
|
| 1251 |
</div>
|
| 1252 |
</div>
|
| 1253 |
</div>
|
|
@@ -1262,8 +1269,6 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 1262 |
startNpcEncounter(session);
|
| 1263 |
};
|
| 1264 |
bind($('#btnIntroStart', container), 'click', (e) => { e.stopPropagation(); start(); });
|
| 1265 |
-
bind($('#bzIntroStage', container), 'click', start);
|
| 1266 |
-
scheduleTimeout(start, 2800);
|
| 1267 |
}
|
| 1268 |
|
| 1269 |
// --------------------------------------------------------------------------
|
|
@@ -2029,7 +2034,7 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 2029 |
} else if (outcome?.newlyLit) {
|
| 2030 |
msg = `✨ 點亮賓果格【${esc(wObj.word)} — ${esc(wObj.zh)}】!`;
|
| 2031 |
} else if (outcome?.chainCracked) {
|
| 2032 |
-
msg = `📝 錯題進度 ${outcome.chainBefore}/3 → ${outcome.chainAfter}/3
|
| 2033 |
} else if (isCorrect) {
|
| 2034 |
msg = `✓ 答對!【${esc(wObj.word)} — ${esc(wObj.zh)}】`;
|
| 2035 |
} else {
|
|
@@ -2191,7 +2196,7 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 2191 |
weaverSpeech = `💥 「${leftCard?.word}」錯題消除,賓果格點亮!`;
|
| 2192 |
} else if (pairOutcome?.chainCracked) {
|
| 2193 |
playBazaarSfx('correct');
|
| 2194 |
-
weaverSpeech = `📝 錯題進度(${pairOutcome.chainBefore}/3 → ${pairOutcome.chainAfter}/3)
|
| 2195 |
} else {
|
| 2196 |
playBazaarSfx('correct');
|
| 2197 |
weaverSpeech = `織得漂亮!「${leftCard?.word}」正是「${rightCard?.zh}」!`;
|
|
@@ -2321,7 +2326,7 @@ export async function openBazaarEventModal(opts = {}) {
|
|
| 2321 |
} else if (o.newlyLit) {
|
| 2322 |
statusBadge = '<span class="bz-pill bz-pill-teal">✨ 點亮賓果格</span>';
|
| 2323 |
} else if (o.chainCracked) {
|
| 2324 |
-
statusBadge = `<span class="bz-pill bz-pill-gold">📝 錯題進度 ${o.chainBefore}/3 → ${o.chainAfter}/3
|
| 2325 |
} else if (o.chainReset) {
|
| 2326 |
statusBadge = '<span class="bz-pill bz-pill-crimson">📝 進入錯題區</span>';
|
| 2327 |
} else if (it.isCorrect) {
|
|
|
|
| 7 |
// - 4 大角色專屬考單字對決舞台(阿卜杜勒/莎赫拉 5×5 配對/迦陵語音切換/伊本拼字)
|
| 8 |
// - 戰後結算、班級首破交易 sync 與計時器/語音嚴格清理
|
| 9 |
// ============================================================================
|
| 10 |
+
import { APP_BUILD_VERSION, BAZAAR_CONFIG, MERCHANT, formatTitleBadge } from './config.js?v=20261127_v2';
|
| 11 |
+
import { $, $$, bind, esc, fmt, fmtDateTime, toast, openModal } from './util.js?v=20261127_v2';
|
| 12 |
+
import { getMerchantStatus } from './merchant.js?v=20261127_v2';
|
| 13 |
+
import { renderMerchantMarketPanel } from './merchant-ui.js?v=20261127_v2';
|
| 14 |
import {
|
| 15 |
ensureBazaarCycleState,
|
| 16 |
getBazaarQuotaInfo,
|
|
|
|
| 25 |
settleBazaarEncounter,
|
| 26 |
loadEnglishWords,
|
| 27 |
speakWord,
|
| 28 |
+
} from './bazaar.js?v=20261127_v2';
|
| 29 |
|
| 30 |
const SCROLL_TITLES = ['卷壹', '卷貳', '卷參', '卷肆', '卷伍', '卷陸', '卷柒', '卷捌', '卷玖', '卷拾'];
|
| 31 |
const OPTION_LABELS = ['A', 'B', 'C', 'D'];
|
|
|
|
| 1234 |
`<div class="bz-shutter-bar ${idx % 2 === 0 ? 'is-even' : 'is-odd'}" style="animation-delay:${(0.12 + idx * 0.03).toFixed(2)}s;"></div>`
|
| 1235 |
)).join('');
|
| 1236 |
|
| 1237 |
+
const greetings = Array.isArray(npc.greetings) && npc.greetings.length
|
| 1238 |
+
? npc.greetings
|
| 1239 |
+
: ['準備好了嗎?來一場四十秒的英文切磋吧!'];
|
| 1240 |
+
const greetingLine = greetings[Math.floor(Math.random() * greetings.length)];
|
| 1241 |
+
|
| 1242 |
container.innerHTML = `
|
| 1243 |
<div class="bz-shell">
|
| 1244 |
${getHeaderHtml(cycleCfg, summary, false)}
|
|
|
|
| 1247 |
<div class="bz-intro-bg"></div>
|
| 1248 |
<div class="bz-intro-npc"><img src="${npc.img}?v=${getBuildVer()}" alt="${esc(npc.name)}"></div>
|
| 1249 |
<div class="bz-intro-dialog" id="bzIntroDialog">
|
| 1250 |
+
<div class="bz-intro-dialog-body">
|
| 1251 |
+
<div class="bz-intro-speaker">${esc(npc.name)}</div>
|
| 1252 |
+
<div class="bz-intro-line">「${esc(greetingLine)}」</div>
|
| 1253 |
+
<div class="bz-intro-sub">${esc(npc.roleTitle)}・限時 40 秒</div>
|
| 1254 |
+
</div>
|
| 1255 |
+
<button type="button" class="bz-intro-start-btn" id="btnIntroStart">▶ 開始挑戰</button>
|
| 1256 |
</div>
|
| 1257 |
<div class="bz-intro-curtain">${curtainBarsHtml}</div>
|
|
|
|
| 1258 |
</div>
|
| 1259 |
</div>
|
| 1260 |
</div>
|
|
|
|
| 1269 |
startNpcEncounter(session);
|
| 1270 |
};
|
| 1271 |
bind($('#btnIntroStart', container), 'click', (e) => { e.stopPropagation(); start(); });
|
|
|
|
|
|
|
| 1272 |
}
|
| 1273 |
|
| 1274 |
// --------------------------------------------------------------------------
|
|
|
|
| 2034 |
} else if (outcome?.newlyLit) {
|
| 2035 |
msg = `✨ 點亮賓果格【${esc(wObj.word)} — ${esc(wObj.zh)}】!`;
|
| 2036 |
} else if (outcome?.chainCracked) {
|
| 2037 |
+
msg = `📝 錯題進度 ${outcome.chainBefore}/3 → ${outcome.chainAfter}/3`;
|
| 2038 |
} else if (isCorrect) {
|
| 2039 |
msg = `✓ 答對!【${esc(wObj.word)} — ${esc(wObj.zh)}】`;
|
| 2040 |
} else {
|
|
|
|
| 2196 |
weaverSpeech = `💥 「${leftCard?.word}」錯題消除,賓果格點亮!`;
|
| 2197 |
} else if (pairOutcome?.chainCracked) {
|
| 2198 |
playBazaarSfx('correct');
|
| 2199 |
+
weaverSpeech = `📝 錯題進度(${pairOutcome.chainBefore}/3 → ${pairOutcome.chainAfter}/3)`;
|
| 2200 |
} else {
|
| 2201 |
playBazaarSfx('correct');
|
| 2202 |
weaverSpeech = `織得漂亮!「${leftCard?.word}」正是「${rightCard?.zh}」!`;
|
|
|
|
| 2326 |
} else if (o.newlyLit) {
|
| 2327 |
statusBadge = '<span class="bz-pill bz-pill-teal">✨ 點亮賓果格</span>';
|
| 2328 |
} else if (o.chainCracked) {
|
| 2329 |
+
statusBadge = `<span class="bz-pill bz-pill-gold">📝 錯題進度 ${o.chainBefore}/3 → ${o.chainAfter}/3</span>`;
|
| 2330 |
} else if (o.chainReset) {
|
| 2331 |
statusBadge = '<span class="bz-pill bz-pill-crimson">📝 進入錯題區</span>';
|
| 2332 |
} else if (it.isCorrect) {
|
js/bazaar.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
| 6 |
// - 錯題三鎖鏈與全域 game.mistakes 雙向同步
|
| 7 |
// - 4 大市集角色隨機遭遇戰與結算引擎
|
| 8 |
// ============================================================================
|
| 9 |
-
import { BAZAAR_CONFIG, MERCHANT, getTitleDef } from './config.js?v=
|
| 10 |
-
import { todayStr, shuffle } from './util.js?v=
|
| 11 |
import {
|
| 12 |
grantGrain,
|
| 13 |
grantTally,
|
|
@@ -16,15 +16,15 @@ import {
|
|
| 16 |
recordCorrect,
|
| 17 |
derive,
|
| 18 |
totalProd,
|
| 19 |
-
} from './engine.js?v=
|
| 20 |
-
import { resolveCaravanModeState } from './event-schedule.js?v=
|
| 21 |
import {
|
| 22 |
loadEnglishWords,
|
| 23 |
speakWord,
|
| 24 |
maskExampleSentence,
|
| 25 |
getMerchantStatus,
|
| 26 |
calcBargainDiscount,
|
| 27 |
-
} from './merchant.js?v=
|
| 28 |
|
| 29 |
export { loadEnglishWords, speakWord };
|
| 30 |
|
|
@@ -1235,16 +1235,12 @@ export function recordBazaarItemOutcome(game, session, itemIndex, isCorrect, cho
|
|
| 1235 |
return item.outcome;
|
| 1236 |
}
|
| 1237 |
|
| 1238 |
-
const dState = derive(session.progress || {}, session.classInfo || null, game);
|
| 1239 |
-
const cps = Math.max(1, totalProd(game, dState) || 1);
|
| 1240 |
-
const bonus = Math.round(cps * (BAZAAR_CONFIG.chainTapGrainSec || 180));
|
| 1241 |
-
grantGrain(game, bonus);
|
| 1242 |
item.outcome = {
|
| 1243 |
chainBefore: before.progress,
|
| 1244 |
chainAfter: rev,
|
| 1245 |
newlyLit: false,
|
| 1246 |
chainCracked: true,
|
| 1247 |
-
grainBonus:
|
| 1248 |
};
|
| 1249 |
return item.outcome;
|
| 1250 |
}
|
|
|
|
| 6 |
// - 錯題三鎖鏈與全域 game.mistakes 雙向同步
|
| 7 |
// - 4 大市集角色隨機遭遇戰與結算引擎
|
| 8 |
// ============================================================================
|
| 9 |
+
import { BAZAAR_CONFIG, MERCHANT, getTitleDef } from './config.js?v=20261127_v2';
|
| 10 |
+
import { todayStr, shuffle } from './util.js?v=20261127_v2';
|
| 11 |
import {
|
| 12 |
grantGrain,
|
| 13 |
grantTally,
|
|
|
|
| 16 |
recordCorrect,
|
| 17 |
derive,
|
| 18 |
totalProd,
|
| 19 |
+
} from './engine.js?v=20261127_v2';
|
| 20 |
+
import { resolveCaravanModeState } from './event-schedule.js?v=20261127_v2';
|
| 21 |
import {
|
| 22 |
loadEnglishWords,
|
| 23 |
speakWord,
|
| 24 |
maskExampleSentence,
|
| 25 |
getMerchantStatus,
|
| 26 |
calcBargainDiscount,
|
| 27 |
+
} from './merchant.js?v=20261127_v2';
|
| 28 |
|
| 29 |
export { loadEnglishWords, speakWord };
|
| 30 |
|
|
|
|
| 1235 |
return item.outcome;
|
| 1236 |
}
|
| 1237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1238 |
item.outcome = {
|
| 1239 |
chainBefore: before.progress,
|
| 1240 |
chainAfter: rev,
|
| 1241 |
newlyLit: false,
|
| 1242 |
chainCracked: true,
|
| 1243 |
+
grainBonus: 0,
|
| 1244 |
};
|
| 1245 |
return item.outcome;
|
| 1246 |
}
|
js/boss-battle.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
| 2 |
// js/boss-battle.js
|
| 3 |
// 世界 Boss 決戰殿堂:戰鬥流程、音效合成、題庫連動、血量同步與即時傷害結算
|
| 4 |
// ============================================================================
|
| 5 |
-
import { SCHEDULE } from './config.js?v=
|
| 6 |
-
import { getDB, DBError, defaultBossState, recordBossHighWaterMark, mergeBossObj } from './db.js?v=
|
| 7 |
-
import { loadBank, loadBankIndex } from './quiz.js?v=
|
| 8 |
import {
|
| 9 |
recordMistake, recordCorrect, derive, totalProd, grantGrain, grantTally, grantScroll,
|
| 10 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 11 |
hasClaimedBossReward, markBossRewardClaimed, formatCountdown, formatOpenAt,
|
| 12 |
getBossDailyQuestionTheme, buildAdaptiveChargeThresholds, calcStudentChargeQuestions, getBossWeaponBuffs,
|
| 13 |
isRangeOpen
|
| 14 |
-
} from './engine.js?v=
|
| 15 |
-
import { loadEnglishWords, buildWordQuestion, getMerchantDayInfo, getCamelPreviewRange } from './merchant.js?v=
|
| 16 |
-
import { todayStr, fmt, shuffle, renderRichQuizText } from './util.js?v=
|
| 17 |
|
| 18 |
// ==========================================
|
| 19 |
// 1. 全域與連線狀態
|
|
|
|
| 2 |
// js/boss-battle.js
|
| 3 |
// 世界 Boss 決戰殿堂:戰鬥流程、音效合成、題庫連動、血量同步與即時傷害結算
|
| 4 |
// ============================================================================
|
| 5 |
+
import { SCHEDULE } from './config.js?v=20261127_v2';
|
| 6 |
+
import { getDB, DBError, defaultBossState, recordBossHighWaterMark, mergeBossObj } from './db.js?v=20261127_v2';
|
| 7 |
+
import { loadBank, loadBankIndex } from './quiz.js?v=20261127_v2';
|
| 8 |
import {
|
| 9 |
recordMistake, recordCorrect, derive, totalProd, grantGrain, grantTally, grantScroll,
|
| 10 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 11 |
hasClaimedBossReward, markBossRewardClaimed, formatCountdown, formatOpenAt,
|
| 12 |
getBossDailyQuestionTheme, buildAdaptiveChargeThresholds, calcStudentChargeQuestions, getBossWeaponBuffs,
|
| 13 |
isRangeOpen
|
| 14 |
+
} from './engine.js?v=20261127_v2';
|
| 15 |
+
import { loadEnglishWords, buildWordQuestion, getMerchantDayInfo, getCamelPreviewRange } from './merchant.js?v=20261127_v2';
|
| 16 |
+
import { todayStr, fmt, shuffle, renderRichQuizText } from './util.js?v=20261127_v2';
|
| 17 |
|
| 18 |
// ==========================================
|
| 19 |
// 1. 全域與連線狀態
|
js/config.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
// 所有數值都集中在這裡,調整平衡只要改這個檔案。
|
| 4 |
// =============================================================
|
| 5 |
|
| 6 |
-
export const APP_BUILD_VERSION = '
|
| 7 |
|
| 8 |
// ---------- 主題(攻城掠地世界觀) ----------
|
| 9 |
export const THEME = {
|
|
@@ -639,7 +639,7 @@ export const BAZAAR_CONFIG = {
|
|
| 639 |
comboBonusSec: 2,
|
| 640 |
comboBonusMaxSec: 8,
|
| 641 |
scrambleBonusSec: 4,
|
| 642 |
-
chainTapGrainSec:
|
| 643 |
firstBloodLines: [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120],
|
| 644 |
personalMilestones: [
|
| 645 |
{ lines: 5, label: '初探絲路', grainSec: 3600, merchantGold: 5, desc: '1 小時糧草包 + 西域金幣 ×5' },
|
|
@@ -650,10 +650,62 @@ export const BAZAAR_CONFIG = {
|
|
| 650 |
{ lines: 120, label: '萬國全制霸', tallies: 10, isGrandPrize: true, desc: '大將金兵符 ×10 + 當期傳奇流光稱號' },
|
| 651 |
],
|
| 652 |
npcs: [
|
| 653 |
-
{
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 657 |
],
|
| 658 |
cycles: {
|
| 659 |
bazaar_1: { id: 'bazaar_1', order: 1, week: 5, openDate: '2026-11-30', endDate: '2026-12-06', startN: 1, endN: 240, title: '第一期・西域萬國大市集(001~240)', grandTitle: '絲路萬國・卷壹宗師' },
|
|
|
|
| 3 |
// 所有數值都集中在這裡,調整平衡只要改這個檔案。
|
| 4 |
// =============================================================
|
| 5 |
|
| 6 |
+
export const APP_BUILD_VERSION = '20261127_v2';
|
| 7 |
|
| 8 |
// ---------- 主題(攻城掠地世界觀) ----------
|
| 9 |
export const THEME = {
|
|
|
|
| 639 |
comboBonusSec: 2,
|
| 640 |
comboBonusMaxSec: 8,
|
| 641 |
scrambleBonusSec: 4,
|
| 642 |
+
chainTapGrainSec: 0,
|
| 643 |
firstBloodLines: [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120],
|
| 644 |
personalMilestones: [
|
| 645 |
{ lines: 5, label: '初探絲路', grainSec: 3600, merchantGold: 5, desc: '1 小時糧草包 + 西域金幣 ×5' },
|
|
|
|
| 650 |
{ lines: 120, label: '萬國全制霸', tallies: 10, isGrandPrize: true, desc: '大將金兵符 ×10 + 當期傳奇流光稱號' },
|
| 651 |
],
|
| 652 |
npcs: [
|
| 653 |
+
{
|
| 654 |
+
id: 'captain',
|
| 655 |
+
name: '商隊隊長・阿卜杜勒',
|
| 656 |
+
roleTitle: '極速喊價・經典四選一',
|
| 657 |
+
img: 'assets/leader_lv4_normal.png',
|
| 658 |
+
accent: '#f59e0b',
|
| 659 |
+
greetings: [
|
| 660 |
+
'平常我們聊過那麼多英文了,接下來的題目應該也不會有問題的吧!',
|
| 661 |
+
'哎呀,老朋友又見面啦!今天這批貨我只給答得最快的貴客打折,準備好了嗎?',
|
| 662 |
+
'哈哈,這不是我們商隊的常客嗎?來來來,四十秒內看你能喊下幾筆好價錢!',
|
| 663 |
+
'這趟從長安一路趕來,就等你來切磋幾題了,別讓我失望啊!',
|
| 664 |
+
'買賣講求眼明手快,你平常英文底子這麼穩,這幾題肯定難不倒你!',
|
| 665 |
+
],
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
id: 'weaver',
|
| 669 |
+
name: '波斯織毯娘子・莎赫拉',
|
| 670 |
+
roleTitle: '錦繡雙語・5×5 英中配對',
|
| 671 |
+
img: 'assets/bazaar_npc_weaver.png',
|
| 672 |
+
accent: '#06b6d4',
|
| 673 |
+
greetings: [
|
| 674 |
+
'歡迎光臨我的織毯攤!把英文和中文穩穩配成對,我就給你市集的好折扣喔。',
|
| 675 |
+
'織毯最講究眼力與手感,讓我看看你配對單字的速度有多俐落吧!',
|
| 676 |
+
'哎呀,有位眼力不錯的客人上門了呢。來幫我把這些中英文絲線一一接上好嗎?',
|
| 677 |
+
'別急、看仔細了,只要找對每一組字義,再花俏的圖樣也難不倒你。',
|
| 678 |
+
'今天剛染好一批新布,順便考考你的詞彙功夫,準備好就開始配對吧!',
|
| 679 |
+
],
|
| 680 |
+
},
|
| 681 |
+
{
|
| 682 |
+
id: 'lutist',
|
| 683 |
+
name: '龜茲琵琶樂師・迦陵',
|
| 684 |
+
roleTitle: '絲路聽音・語音辨字挑戰',
|
| 685 |
+
img: 'assets/bazaar_npc_lutist.png',
|
| 686 |
+
accent: '#a855f7',
|
| 687 |
+
greetings: [
|
| 688 |
+
'叮咚~聽見我的琵琶聲了嗎?豎起耳朵,看你能不能一聽就辨出正確單字!',
|
| 689 |
+
'市集這麼熱鬧,耳朵可不能走神喔!跟著我的節奏,聽音挑字吧!',
|
| 690 |
+
'光看字不算厲害,聽得出來才叫真本事!準備好接受聽力考驗了嗎?',
|
| 691 |
+
'這首曲子裡藏了好多英文單字,專心聽清楚每一個發音,可別漏拍囉!',
|
| 692 |
+
'來得正好!我正想找個人試試耳力,點擊開始,咱們立刻開唱!',
|
| 693 |
+
],
|
| 694 |
+
},
|
| 695 |
+
{
|
| 696 |
+
id: 'scholar',
|
| 697 |
+
name: '大漠星象學者・伊本',
|
| 698 |
+
roleTitle: '古卷尋字・例句填空&拼字',
|
| 699 |
+
img: 'assets/bazaar_npc_scholar.png',
|
| 700 |
+
accent: '#eab308',
|
| 701 |
+
greetings: [
|
| 702 |
+
'遠道而來的旅人,這些古卷缺了幾個關鍵字,能幫我把它們補齊嗎?',
|
| 703 |
+
'從上下文的線索裡找出正確的字詞,就像在夜空裡辨認星辰一樣,靜下心來試試吧。',
|
| 704 |
+
'你的學識在市集裡頗有名氣呢,來看看這幾道例句與拼字題,能不能難住你?',
|
| 705 |
+
'別擔心,每個句子裡都藏著提示。準備好翻開這捲手抄本了嗎?',
|
| 706 |
+
'字詞不只是拿來背的,放在句子裡才見真章。來吧,讓我見識一下你的實力!',
|
| 707 |
+
],
|
| 708 |
+
},
|
| 709 |
],
|
| 710 |
cycles: {
|
| 711 |
bazaar_1: { id: 'bazaar_1', order: 1, week: 5, openDate: '2026-11-30', endDate: '2026-12-06', startN: 1, endN: 240, title: '第一期・西域萬國大市集(001~240)', grandTitle: '絲路萬國・卷壹宗師' },
|
js/db.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
| 3 |
// 1. FirebaseBackend:正式使用(Auth + Firestore)
|
| 4 |
// 2. LocalBackend :firebaseConfig 未填時的本機示範模式(localStorage)
|
| 5 |
// =============================================================
|
| 6 |
-
import { firebaseConfig, STUDENT_EMAIL_DOMAIN, PIN_SUFFIX } from './firebase-config.js?v=
|
| 7 |
-
import { WEEKLY_SCHEDULE, BAZAAR_CONFIG } from './config.js?v=
|
| 8 |
-
import { trafficTracker } from './traffic-tracker.js?v=
|
| 9 |
-
import { normalizeWorldBossState } from './world-boss-schedule.js?v=
|
| 10 |
-
import { LOTTERY_ROUND_SIZE, scoreLotteryAnswer } from './lottery-core.js?v=
|
| 11 |
-
import { grantTally } from './engine.js?v=
|
| 12 |
-
import { todayStr } from './util.js?v=
|
| 13 |
|
| 14 |
const WEEK_TARGET_MAP = Object.fromEntries(WEEKLY_SCHEDULE.map(w => [w.id, w.target]));
|
| 15 |
function clampWeekCap(weekId, val) {
|
|
|
|
| 3 |
// 1. FirebaseBackend:正式使用(Auth + Firestore)
|
| 4 |
// 2. LocalBackend :firebaseConfig 未填時的本機示範模式(localStorage)
|
| 5 |
// =============================================================
|
| 6 |
+
import { firebaseConfig, STUDENT_EMAIL_DOMAIN, PIN_SUFFIX } from './firebase-config.js?v=20261127_v2';
|
| 7 |
+
import { WEEKLY_SCHEDULE, BAZAAR_CONFIG } from './config.js?v=20261127_v2';
|
| 8 |
+
import { trafficTracker } from './traffic-tracker.js?v=20261127_v2';
|
| 9 |
+
import { normalizeWorldBossState } from './world-boss-schedule.js?v=20261127_v2';
|
| 10 |
+
import { LOTTERY_ROUND_SIZE, scoreLotteryAnswer } from './lottery-core.js?v=20261127_v2';
|
| 11 |
+
import { grantTally } from './engine.js?v=20261127_v2';
|
| 12 |
+
import { todayStr } from './util.js?v=20261127_v2';
|
| 13 |
|
| 14 |
const WEEK_TARGET_MAP = Object.fromEntries(WEEKLY_SCHEDULE.map(w => [w.id, w.target]));
|
| 15 |
function clampWeekCap(weekId, val) {
|
js/engine.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
| 7 |
OPEN_OFFSET_DAYS, DEFAULT_OPEN_HOUR, SYSTEMS, WEEKLY_SCHEDULE, SLOTH_PENALTY_MULT,
|
| 8 |
EVENTS_CONFIG, WORLD_BOSS_ROSTER, WORLD_BOSS_END_DATE, MERCHANT,
|
| 9 |
ERA2_TALLY_COST, ERA2_BASE_PROD, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES,
|
| 10 |
-
} from './config.js?v=
|
| 11 |
-
import { todayStr, addDays } from './util.js?v=
|
| 12 |
-
import { normalizeWorldBossState, getScheduledOpenTs, formatCountdown, formatOpenAt } from './world-boss-schedule.js?v=
|
| 13 |
-
import { resolveWeeklySpotlight, resolveCaravanModeState } from './event-schedule.js?v=
|
| 14 |
export { normalizeWorldBossState, formatCountdown, formatOpenAt };
|
| 15 |
export { todayStr, REVIEW_MAX_QUESTIONS, WORLD_BOSS_ROSTER, ERA2_TALLY_COST, ERA2_BASE_PROD, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES };
|
| 16 |
|
|
|
|
| 7 |
OPEN_OFFSET_DAYS, DEFAULT_OPEN_HOUR, SYSTEMS, WEEKLY_SCHEDULE, SLOTH_PENALTY_MULT,
|
| 8 |
EVENTS_CONFIG, WORLD_BOSS_ROSTER, WORLD_BOSS_END_DATE, MERCHANT,
|
| 9 |
ERA2_TALLY_COST, ERA2_BASE_PROD, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES,
|
| 10 |
+
} from './config.js?v=20261127_v2';
|
| 11 |
+
import { todayStr, addDays } from './util.js?v=20261127_v2';
|
| 12 |
+
import { normalizeWorldBossState, getScheduledOpenTs, formatCountdown, formatOpenAt } from './world-boss-schedule.js?v=20261127_v2';
|
| 13 |
+
import { resolveWeeklySpotlight, resolveCaravanModeState } from './event-schedule.js?v=20261127_v2';
|
| 14 |
export { normalizeWorldBossState, formatCountdown, formatOpenAt };
|
| 15 |
export { todayStr, REVIEW_MAX_QUESTIONS, WORLD_BOSS_ROSTER, ERA2_TALLY_COST, ERA2_BASE_PROD, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES };
|
| 16 |
|
js/event-schedule.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
| 4 |
// - 嚴格以東八區 (Asia/Taipei, UTC+8) 判定日期與週次
|
| 5 |
// - 零循環依賴:僅依賴 config.js、util.js、world-boss-schedule.js
|
| 6 |
// ============================================================================
|
| 7 |
-
import { EVENT_CATALOG, PASS_SCORE, WORLD_BOSS_ROSTER, BAZAAR_CONFIG, MERCHANT } from './config.js?v=
|
| 8 |
-
import { todayStr } from './util.js?v=
|
| 9 |
-
import { toTs } from './world-boss-schedule.js?v=
|
| 10 |
|
| 11 |
const TAIPEI_OFFSET_MS = 8 * 3600 * 1000;
|
| 12 |
const CARAVAN_ANCHOR_MS = Date.parse('2026-11-02T00:00:00+08:00');
|
|
|
|
| 4 |
// - 嚴格以東八區 (Asia/Taipei, UTC+8) 判定日期與週次
|
| 5 |
// - 零循環依賴:僅依賴 config.js、util.js、world-boss-schedule.js
|
| 6 |
// ============================================================================
|
| 7 |
+
import { EVENT_CATALOG, PASS_SCORE, WORLD_BOSS_ROSTER, BAZAAR_CONFIG, MERCHANT } from './config.js?v=20261127_v2';
|
| 8 |
+
import { todayStr } from './util.js?v=20261127_v2';
|
| 9 |
+
import { toTs } from './world-boss-schedule.js?v=20261127_v2';
|
| 10 |
|
| 11 |
const TAIPEI_OFFSET_MS = 8 * 3600 * 1000;
|
| 12 |
const CARAVAN_ANCHOR_MS = Date.parse('2026-11-02T00:00:00+08:00');
|
js/game.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
import { getDB, DBError, recordBossHighWaterMark, mergeBossObj, recordLotteryHighWaterMark } from './db.js?v=
|
| 2 |
import {
|
| 3 |
BUILDINGS, TIERS, SCHEDULE, PASS_SCORE, REVIEW_MAX_QUESTIONS, THEME, QUIZ_COIN_MIN, QUIZ_COIN_SECONDS,
|
| 4 |
CLASS_STAGES, LUCKY, STAR_BASE_MAX, QUIZ_COIN_DAILY_FULL, WEEKLY_SCHEDULE, SLOTH_PENALTY_MULT,
|
| 5 |
WORLD_BOSS_UNLOCK_DATE, WORLD_BOSS_END_DATE, MERCHANT, APP_BUILD_VERSION,
|
| 6 |
TITLE_DEFS, getTitleDef, formatTitleBadge,
|
| 7 |
ERA2_TALLY_COST, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES
|
| 8 |
-
} from './config.js?v=
|
| 9 |
import {
|
| 10 |
loadEnglishWords, getMerchantStatus, getMerchantDayInfo, generateMerchantQuiz, speakWord, submitMerchantAnswer,
|
| 11 |
generateDailyChallengeQueue, calcPriceMultiplier, calcBargainDiscount, settleDailyChallenge, buyMerchantItem,
|
| 12 |
getRandomBeggingSpeech, getCaravanImgSrc, getLeaderImgSrc
|
| 13 |
-
} from './merchant.js?v=
|
| 14 |
import {
|
| 15 |
newGame, normalizeGame, derive, isUnlocked, levelCost, maxAffordable, bulkCost,
|
| 16 |
starCost, nextStarMult, donationValue, clickValue, advance, classStage, openDate, isRangeOpen,
|
|
@@ -21,27 +21,27 @@ import {
|
|
| 21 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 22 |
hasClaimedBossReward, markBossRewardClaimed,
|
| 23 |
getEra2Status, getEra2UpgradeInfo, evolveTownToEra2
|
| 24 |
-
} from './engine.js?v=
|
| 25 |
-
import { $, $$, fmt, fmtTime, todayStr, bind, withLoading, toast, openModal, esc, fmtDateTime, shuffle, renderRichQuizText } from './util.js?v=
|
| 26 |
-
import { loadBankIndex, buildQuiz, loadBank } from './quiz.js?v=
|
| 27 |
-
import { checkAndShowAnnouncements, showAnnouncementModal } from './announcements.js?v=
|
| 28 |
-
import { startSecretRotator, stopSecretRotator, preloadStudentBankImages } from './preload.js?v=
|
| 29 |
import {
|
| 30 |
setupMap, renderMapSpots, renderInMapTownPanel, updateMapBossHpUI,
|
| 31 |
focusTownOnMap, openWorldBossModal, getWorldBossStatus,
|
| 32 |
MAP_POS, STRATEGIC_ROUTES, getTownLayout
|
| 33 |
-
} from './map.js?v=
|
| 34 |
import {
|
| 35 |
setupMerchantUI, openTodayWordsModal, openCaravanLevelsModal,
|
| 36 |
openMerchantQuizModal, openMerchantEventModal
|
| 37 |
-
} from './merchant-ui.js?v=
|
| 38 |
import {
|
| 39 |
setupBazaarUI, openBazaarEventModal
|
| 40 |
-
} from './bazaar-ui.js?v=
|
| 41 |
-
import { resolveCaravanModeState } from './event-schedule.js?v=
|
| 42 |
import {
|
| 43 |
setupTianji, openTianjiModal, rollChestRewards, showChestUnboxModal
|
| 44 |
-
} from './tianji.js?v=
|
| 45 |
export { openTodayWordsModal, openCaravanLevelsModal, openMerchantQuizModal, openMerchantEventModal, openBazaarEventModal, openTianjiModal };
|
| 46 |
window.showAnnouncementModal = showAnnouncementModal;
|
| 47 |
window.getRandomBeggingSpeech = getRandomBeggingSpeech;
|
|
|
|
| 1 |
+
import { getDB, DBError, recordBossHighWaterMark, mergeBossObj, recordLotteryHighWaterMark } from './db.js?v=20261127_v2';
|
| 2 |
import {
|
| 3 |
BUILDINGS, TIERS, SCHEDULE, PASS_SCORE, REVIEW_MAX_QUESTIONS, THEME, QUIZ_COIN_MIN, QUIZ_COIN_SECONDS,
|
| 4 |
CLASS_STAGES, LUCKY, STAR_BASE_MAX, QUIZ_COIN_DAILY_FULL, WEEKLY_SCHEDULE, SLOTH_PENALTY_MULT,
|
| 5 |
WORLD_BOSS_UNLOCK_DATE, WORLD_BOSS_END_DATE, MERCHANT, APP_BUILD_VERSION,
|
| 6 |
TITLE_DEFS, getTitleDef, formatTitleBadge,
|
| 7 |
ERA2_TALLY_COST, ERA2_SEQUENCE, ERA2_CONDITIONS, ERA2_TOWN_NAMES
|
| 8 |
+
} from './config.js?v=20261127_v2';
|
| 9 |
import {
|
| 10 |
loadEnglishWords, getMerchantStatus, getMerchantDayInfo, generateMerchantQuiz, speakWord, submitMerchantAnswer,
|
| 11 |
generateDailyChallengeQueue, calcPriceMultiplier, calcBargainDiscount, settleDailyChallenge, buyMerchantItem,
|
| 12 |
getRandomBeggingSpeech, getCaravanImgSrc, getLeaderImgSrc
|
| 13 |
+
} from './merchant.js?v=20261127_v2';
|
| 14 |
import {
|
| 15 |
newGame, normalizeGame, derive, isUnlocked, levelCost, maxAffordable, bulkCost,
|
| 16 |
starCost, nextStarMult, donationValue, clickValue, advance, classStage, openDate, isRangeOpen,
|
|
|
|
| 21 |
WORLD_BOSS_ROSTER, getActiveWorldBossConfig, calcWorldBossRewards, calcWorldBossStatus,
|
| 22 |
hasClaimedBossReward, markBossRewardClaimed,
|
| 23 |
getEra2Status, getEra2UpgradeInfo, evolveTownToEra2
|
| 24 |
+
} from './engine.js?v=20261127_v2';
|
| 25 |
+
import { $, $$, fmt, fmtTime, todayStr, bind, withLoading, toast, openModal, esc, fmtDateTime, shuffle, renderRichQuizText } from './util.js?v=20261127_v2';
|
| 26 |
+
import { loadBankIndex, buildQuiz, loadBank } from './quiz.js?v=20261127_v2';
|
| 27 |
+
import { checkAndShowAnnouncements, showAnnouncementModal } from './announcements.js?v=20261127_v2';
|
| 28 |
+
import { startSecretRotator, stopSecretRotator, preloadStudentBankImages } from './preload.js?v=20261127_v2';
|
| 29 |
import {
|
| 30 |
setupMap, renderMapSpots, renderInMapTownPanel, updateMapBossHpUI,
|
| 31 |
focusTownOnMap, openWorldBossModal, getWorldBossStatus,
|
| 32 |
MAP_POS, STRATEGIC_ROUTES, getTownLayout
|
| 33 |
+
} from './map.js?v=20261127_v2';
|
| 34 |
import {
|
| 35 |
setupMerchantUI, openTodayWordsModal, openCaravanLevelsModal,
|
| 36 |
openMerchantQuizModal, openMerchantEventModal
|
| 37 |
+
} from './merchant-ui.js?v=20261127_v2';
|
| 38 |
import {
|
| 39 |
setupBazaarUI, openBazaarEventModal
|
| 40 |
+
} from './bazaar-ui.js?v=20261127_v2';
|
| 41 |
+
import { resolveCaravanModeState } from './event-schedule.js?v=20261127_v2';
|
| 42 |
import {
|
| 43 |
setupTianji, openTianjiModal, rollChestRewards, showChestUnboxModal
|
| 44 |
+
} from './tianji.js?v=20261127_v2';
|
| 45 |
export { openTodayWordsModal, openCaravanLevelsModal, openMerchantQuizModal, openMerchantEventModal, openBazaarEventModal, openTianjiModal };
|
| 46 |
window.showAnnouncementModal = showAnnouncementModal;
|
| 47 |
window.getRandomBeggingSpeech = getRandomBeggingSpeech;
|
js/lottery-core.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
| 6 |
// - 小班名額縮編、不重複加權抽獎與「向上覆蓋升級遞補」演算法
|
| 7 |
// - 智慧里程碑試算與可擴充獎勵信箱結算產生器
|
| 8 |
// ============================================================================
|
| 9 |
-
import { PASS_SCORE } from './config.js?v=
|
| 10 |
-
import { getQuestionKey, calcDynamicWorldBossBalance } from './engine.js?v=
|
| 11 |
|
| 12 |
export const MAX_DAILY_LOTTERY_ROUNDS = 2;
|
| 13 |
export const LOTTERY_ROUND_SIZE = 10;
|
|
|
|
| 6 |
// - 小班名額縮編、不重複加權抽獎與「向上覆蓋升級遞補」演算法
|
| 7 |
// - 智慧里程碑試算與可擴充獎勵信箱結算產生器
|
| 8 |
// ============================================================================
|
| 9 |
+
import { PASS_SCORE } from './config.js?v=20261127_v2';
|
| 10 |
+
import { getQuestionKey, calcDynamicWorldBossBalance } from './engine.js?v=20261127_v2';
|
| 11 |
|
| 12 |
export const MAX_DAILY_LOTTERY_ROUNDS = 2;
|
| 13 |
export const LOTTERY_ROUND_SIZE = 10;
|
js/lottery-draw.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
// - Canvas 2D 物理攪拌轉動 → 真空吸球 → 滾出滑槽揭曉真得主(100% 對齊 lottery-core.js)
|
| 6 |
// - 支援從小獎抽到頭獎+向上覆蓋升級遞補+班導加抽+奇蹟骰+過週日補結案
|
| 7 |
// ============================================================================
|
| 8 |
-
import { formatTitleBadge } from './config.js?v=
|
| 9 |
-
import { getDB } from './db.js?v=
|
| 10 |
import {
|
| 11 |
LOTTERY_DEFAULT_MILESTONES,
|
| 12 |
LOTTERY_PILOT_MILESTONES,
|
|
@@ -21,8 +21,8 @@ import {
|
|
| 21 |
drawWeightedWinner,
|
| 22 |
applyTierDrawWithUpgrade,
|
| 23 |
buildLotterySettlement,
|
| 24 |
-
} from './lottery-core.js?v=
|
| 25 |
-
import { $, esc } from './util.js?v=
|
| 26 |
|
| 27 |
const SILVER_PALETTE = ['#fffbeb', '#fde68a', '#bae6fd', '#bbf7d0', '#fbcfe8', '#ddd6fe'];
|
| 28 |
const TIER_DRAW_RANK = { t3: 1, t2: 2, t1: 3, head: 4 };
|
|
|
|
| 5 |
// - Canvas 2D 物理攪拌轉動 → 真空吸球 → 滾出滑槽揭曉真得主(100% 對齊 lottery-core.js)
|
| 6 |
// - 支援從小獎抽到頭獎+向上覆蓋升級遞補+班導加抽+奇蹟骰+過週日補結案
|
| 7 |
// ============================================================================
|
| 8 |
+
import { formatTitleBadge } from './config.js?v=20261127_v2';
|
| 9 |
+
import { getDB } from './db.js?v=20261127_v2';
|
| 10 |
import {
|
| 11 |
LOTTERY_DEFAULT_MILESTONES,
|
| 12 |
LOTTERY_PILOT_MILESTONES,
|
|
|
|
| 21 |
drawWeightedWinner,
|
| 22 |
applyTierDrawWithUpgrade,
|
| 23 |
buildLotterySettlement,
|
| 24 |
+
} from './lottery-core.js?v=20261127_v2';
|
| 25 |
+
import { $, esc } from './util.js?v=20261127_v2';
|
| 26 |
|
| 27 |
const SILVER_PALETTE = ['#fffbeb', '#fde68a', '#bae6fd', '#bbf7d0', '#fbcfe8', '#ddd6fe'];
|
| 28 |
const TIER_DRAW_RANK = { t3: 1, t2: 2, t1: 3, head: 4 };
|
js/lottery.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
| 4 |
// - 零 onSnapshot 監聽:開啟舞台時單次拉取班級與同袍錯題,不浪費額度
|
| 5 |
// - P0 就緒防呆 + activeRound F5 鎖定防重整洗題 + Web Audio 音效合成
|
| 6 |
// ============================================================================
|
| 7 |
-
import { SCHEDULE, APP_BUILD_VERSION, formatTitleBadge } from './config.js?v=
|
| 8 |
-
import { recordMistake, recordCorrect, todayStr, isRangeOpen } from './engine.js?v=
|
| 9 |
-
import { loadBank } from './quiz.js?v=
|
| 10 |
-
import { loadEnglishWords, buildWordQuestion, getMerchantDayInfo, getCamelPreviewRange } from './merchant.js?v=
|
| 11 |
-
import { resolveWeeklySpotlight, formatCycleRangeLabel } from './event-schedule.js?v=
|
| 12 |
import {
|
| 13 |
MAX_DAILY_LOTTERY_ROUNDS,
|
| 14 |
LOTTERY_ROUND_SIZE,
|
|
@@ -26,9 +26,9 @@ import {
|
|
| 26 |
calcLotteryMilestonesProgress,
|
| 27 |
calcAdaptiveBallRadius,
|
| 28 |
stepNonOverlappingBalls,
|
| 29 |
-
} from './lottery-core.js?v=
|
| 30 |
-
import { recordLotteryHighWaterMark } from './db.js?v=
|
| 31 |
-
import { $, openModal, esc, renderRichQuizText, toast } from './util.js?v=
|
| 32 |
|
| 33 |
let _audioCtx = null;
|
| 34 |
function playToneSequence(steps = []) {
|
|
|
|
| 4 |
// - 零 onSnapshot 監聽:開啟舞台時單次拉取班級與同袍錯題,不浪費額度
|
| 5 |
// - P0 就緒防呆 + activeRound F5 鎖定防重整洗題 + Web Audio 音效合成
|
| 6 |
// ============================================================================
|
| 7 |
+
import { SCHEDULE, APP_BUILD_VERSION, formatTitleBadge } from './config.js?v=20261127_v2';
|
| 8 |
+
import { recordMistake, recordCorrect, todayStr, isRangeOpen } from './engine.js?v=20261127_v2';
|
| 9 |
+
import { loadBank } from './quiz.js?v=20261127_v2';
|
| 10 |
+
import { loadEnglishWords, buildWordQuestion, getMerchantDayInfo, getCamelPreviewRange } from './merchant.js?v=20261127_v2';
|
| 11 |
+
import { resolveWeeklySpotlight, formatCycleRangeLabel } from './event-schedule.js?v=20261127_v2';
|
| 12 |
import {
|
| 13 |
MAX_DAILY_LOTTERY_ROUNDS,
|
| 14 |
LOTTERY_ROUND_SIZE,
|
|
|
|
| 26 |
calcLotteryMilestonesProgress,
|
| 27 |
calcAdaptiveBallRadius,
|
| 28 |
stepNonOverlappingBalls,
|
| 29 |
+
} from './lottery-core.js?v=20261127_v2';
|
| 30 |
+
import { recordLotteryHighWaterMark } from './db.js?v=20261127_v2';
|
| 31 |
+
import { $, openModal, esc, renderRichQuizText, toast } from './util.js?v=20261127_v2';
|
| 32 |
|
| 33 |
let _audioCtx = null;
|
| 34 |
function playToneSequence(steps = []) {
|
js/map.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
// js/map.js
|
| 3 |
// 超大戰略沙盤大地圖系統(沙盤名都佈局、動態路網、即時互動面板與世界 Boss 標記)
|
| 4 |
// ============================================================================
|
| 5 |
-
import { BUILDINGS, APP_BUILD_VERSION } from './config.js?v=
|
| 6 |
import {
|
| 7 |
isUnlocked, buildingProd, getConquerRequirements, canConquer, conquerTown,
|
| 8 |
maxAffordable, bulkCost, starCost, nextStarMult, nextMilestone, getTianjiStatus,
|
|
@@ -10,15 +10,15 @@ import {
|
|
| 10 |
formatCountdown, formatOpenAt,
|
| 11 |
checkConstructionStatus, isEventOpen, derive,
|
| 12 |
getEra2Status, getEra2UpgradeInfo, evolveTownToEra2, ERA2_TOWN_NAMES, ERA2_SEQUENCE, ERA2_TALLY_COST
|
| 13 |
-
} from './engine.js?v=
|
| 14 |
-
import { resolveWeeklySpotlight, resolveCaravanModeState } from './event-schedule.js?v=
|
| 15 |
import {
|
| 16 |
MAX_DAILY_LOTTERY_ROUNDS, LOTTERY_DEFAULT_MILESTONES,
|
| 17 |
calcLotteryBallStats, calcLotteryMilestonesProgress
|
| 18 |
-
} from './lottery-core.js?v=
|
| 19 |
-
import { getMerchantStatus, getCaravanImgSrc } from './merchant.js?v=
|
| 20 |
-
import { computeBazaarSummary } from './bazaar.js?v=
|
| 21 |
-
import { $, $$, bind, esc, fmt, toast, openModal, todayStr } from './util.js?v=
|
| 22 |
|
| 23 |
// 目前在地圖上選中的城池(預設關閉,點擊城池時才彈出)
|
| 24 |
let selectedTownId = null;
|
|
@@ -53,6 +53,7 @@ export const MAP_POS = {
|
|
| 53 |
tianji: { x: 34.5, y: 29.7, size: 154 }, // 天機閣
|
| 54 |
boss: { x: 81.5, y: 22.0, size: 168 }, // 世界 Boss(懸空禁地)
|
| 55 |
merchantCamp: { x: 44.2, y: 46.8, size: 145 }, // 西域商隊(天機閣右下平原)
|
|
|
|
| 56 |
lottery: { x: 18.0, y: 27.5, size: 158 }, // 錯題樂透(天機閣左方琉璃山谷)
|
| 57 |
};
|
| 58 |
|
|
@@ -336,7 +337,7 @@ export function renderMapSpots() {
|
|
| 336 |
const isCaravanOpen = isEventOpen('caravan', classInfo);
|
| 337 |
if (isCaravanOpen) {
|
| 338 |
const merchantStatus = getMerchantStatus(game);
|
| 339 |
-
const merchantLayout = getTownLayout('merchantCamp');
|
| 340 |
const dayInfo = merchantStatus.dayInfo;
|
| 341 |
const merchantProgressLabel = dayInfo.displayProgress;
|
| 342 |
const mData = game.merchant || {};
|
|
|
|
| 2 |
// js/map.js
|
| 3 |
// 超大戰略沙盤大地圖系統(沙盤名都佈局、動態路網、即時互動面板與世界 Boss 標記)
|
| 4 |
// ============================================================================
|
| 5 |
+
import { BUILDINGS, APP_BUILD_VERSION } from './config.js?v=20261127_v2';
|
| 6 |
import {
|
| 7 |
isUnlocked, buildingProd, getConquerRequirements, canConquer, conquerTown,
|
| 8 |
maxAffordable, bulkCost, starCost, nextStarMult, nextMilestone, getTianjiStatus,
|
|
|
|
| 10 |
formatCountdown, formatOpenAt,
|
| 11 |
checkConstructionStatus, isEventOpen, derive,
|
| 12 |
getEra2Status, getEra2UpgradeInfo, evolveTownToEra2, ERA2_TOWN_NAMES, ERA2_SEQUENCE, ERA2_TALLY_COST
|
| 13 |
+
} from './engine.js?v=20261127_v2';
|
| 14 |
+
import { resolveWeeklySpotlight, resolveCaravanModeState } from './event-schedule.js?v=20261127_v2';
|
| 15 |
import {
|
| 16 |
MAX_DAILY_LOTTERY_ROUNDS, LOTTERY_DEFAULT_MILESTONES,
|
| 17 |
calcLotteryBallStats, calcLotteryMilestonesProgress
|
| 18 |
+
} from './lottery-core.js?v=20261127_v2';
|
| 19 |
+
import { getMerchantStatus, getCaravanImgSrc } from './merchant.js?v=20261127_v2';
|
| 20 |
+
import { computeBazaarSummary } from './bazaar.js?v=20261127_v2';
|
| 21 |
+
import { $, $$, bind, esc, fmt, toast, openModal, todayStr } from './util.js?v=20261127_v2';
|
| 22 |
|
| 23 |
// 目前在地圖上選中的城池(預設關閉,點擊城池時才彈出)
|
| 24 |
let selectedTownId = null;
|
|
|
|
| 53 |
tianji: { x: 34.5, y: 29.7, size: 154 }, // 天機閣
|
| 54 |
boss: { x: 81.5, y: 22.0, size: 168 }, // 世界 Boss(懸空禁地)
|
| 55 |
merchantCamp: { x: 44.2, y: 46.8, size: 145 }, // 西域商隊(天機閣右下平原)
|
| 56 |
+
bazaarCamp: { x: 44.2, y: 46.8, size: 155 }, // 西域萬國大市集(獨立沙盤座標)
|
| 57 |
lottery: { x: 18.0, y: 27.5, size: 158 }, // 錯題樂透(天機閣左方琉璃山谷)
|
| 58 |
};
|
| 59 |
|
|
|
|
| 337 |
const isCaravanOpen = isEventOpen('caravan', classInfo);
|
| 338 |
if (isCaravanOpen) {
|
| 339 |
const merchantStatus = getMerchantStatus(game);
|
| 340 |
+
const merchantLayout = getTownLayout(modeState.activeType === 'bazaar' ? 'bazaarCamp' : 'merchantCamp');
|
| 341 |
const dayInfo = merchantStatus.dayInfo;
|
| 342 |
const merchantProgressLabel = dayInfo.displayProgress;
|
| 343 |
const mData = game.merchant || {};
|
js/merchant-ui.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
| 2 |
// js/merchant-ui.js
|
| 3 |
// 西域商隊大活動彈窗、夷語單字研讀、商隊等級總覽、行商交流與西域集市系統
|
| 4 |
// ============================================================================
|
| 5 |
-
import { MERCHANT, APP_BUILD_VERSION } from './config.js?v=
|
| 6 |
-
import { totalProd, derive, isEventOpen, getEventStatusInfo, recordMistake, recordCorrect } from './engine.js?v=
|
| 7 |
import {
|
| 8 |
loadEnglishWords, getMerchantStatus, getMerchantDayInfo, generateMerchantQuiz, speakWord, submitMerchantAnswer,
|
| 9 |
generateDailyChallengeQueue, calcPriceMultiplier, calcBargainDiscount, settleDailyChallenge, buyMerchantItem,
|
| 10 |
getRandomBeggingSpeech, getCaravanImgSrc, getLeaderImgSrc, maskExampleSentence
|
| 11 |
-
} from './merchant.js?v=
|
| 12 |
-
import { $, $$, bind, esc, fmt, toast, openModal } from './util.js?v=
|
| 13 |
|
| 14 |
let merchantCtx = null;
|
| 15 |
|
|
|
|
| 2 |
// js/merchant-ui.js
|
| 3 |
// 西域商隊大活動彈窗、夷語單字研讀、商隊等級總覽、行商交流與西域集市系統
|
| 4 |
// ============================================================================
|
| 5 |
+
import { MERCHANT, APP_BUILD_VERSION } from './config.js?v=20261127_v2';
|
| 6 |
+
import { totalProd, derive, isEventOpen, getEventStatusInfo, recordMistake, recordCorrect } from './engine.js?v=20261127_v2';
|
| 7 |
import {
|
| 8 |
loadEnglishWords, getMerchantStatus, getMerchantDayInfo, generateMerchantQuiz, speakWord, submitMerchantAnswer,
|
| 9 |
generateDailyChallengeQueue, calcPriceMultiplier, calcBargainDiscount, settleDailyChallenge, buyMerchantItem,
|
| 10 |
getRandomBeggingSpeech, getCaravanImgSrc, getLeaderImgSrc, maskExampleSentence
|
| 11 |
+
} from './merchant.js?v=20261127_v2';
|
| 12 |
+
import { $, $$, bind, esc, fmt, toast, openModal } from './util.js?v=20261127_v2';
|
| 13 |
|
| 14 |
let merchantCtx = null;
|
| 15 |
|
js/merchant.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
// =============================================================
|
| 2 |
// 西域駱駝商隊系統(英文單字出題、發音、獎勵與進度管理)
|
| 3 |
// =============================================================
|
| 4 |
-
import { APP_BUILD_VERSION, MERCHANT } from './config.js?v=
|
| 5 |
-
import { todayStr, shuffle } from './util.js?v=
|
| 6 |
-
import { grantGrain, grantTally, grantScroll, recordMistake, recordCorrect, getCaravanRotation } from './engine.js?v=
|
| 7 |
|
| 8 |
let cachedWords = null;
|
| 9 |
|
|
|
|
| 1 |
// =============================================================
|
| 2 |
// 西域駱駝商隊系統(英文單字出題、發音、獎勵與進度管理)
|
| 3 |
// =============================================================
|
| 4 |
+
import { APP_BUILD_VERSION, MERCHANT } from './config.js?v=20261127_v2';
|
| 5 |
+
import { todayStr, shuffle } from './util.js?v=20261127_v2';
|
| 6 |
+
import { grantGrain, grantTally, grantScroll, recordMistake, recordCorrect, getCaravanRotation } from './engine.js?v=20261127_v2';
|
| 7 |
|
| 8 |
let cachedWords = null;
|
| 9 |
|
js/preload.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
// =============================================================
|
| 2 |
// 題庫卷宗圖片預載與軍中秘史圖卷畫冊系統
|
| 3 |
// =============================================================
|
| 4 |
-
import { SCHEDULE } from './config.js?v=
|
| 5 |
-
import { isRangeOpen } from './engine.js?v=
|
| 6 |
-
import { todayStr } from './util.js?v=
|
| 7 |
-
import { loadBank } from './quiz.js?v=
|
| 8 |
|
| 9 |
export const ILLUSTRATED_SECRETS = [
|
| 10 |
// b1: 瓷鎮(大內官窯・天朝神都)
|
|
|
|
| 1 |
// =============================================================
|
| 2 |
// 題庫卷宗圖片預載與軍中秘史圖卷畫冊系統
|
| 3 |
// =============================================================
|
| 4 |
+
import { SCHEDULE } from './config.js?v=20261127_v2';
|
| 5 |
+
import { isRangeOpen } from './engine.js?v=20261127_v2';
|
| 6 |
+
import { todayStr } from './util.js?v=20261127_v2';
|
| 7 |
+
import { loadBank } from './quiz.js?v=20261127_v2';
|
| 8 |
|
| 9 |
export const ILLUSTRATED_SECRETS = [
|
| 10 |
// b1: 瓷鎮(大內官窯・天朝神都)
|
js/quiz.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
// 題庫載入與出題
|
| 2 |
-
import { APP_BUILD_VERSION, TIERS, BANKS_FALLBACK } from './config.js?v=
|
| 3 |
-
import { shuffle } from './util.js?v=
|
| 4 |
|
| 5 |
const cache = new Map();
|
| 6 |
|
|
|
|
| 1 |
// 題庫載入與出題
|
| 2 |
+
import { APP_BUILD_VERSION, TIERS, BANKS_FALLBACK } from './config.js?v=20261127_v2';
|
| 3 |
+
import { shuffle } from './util.js?v=20261127_v2';
|
| 4 |
|
| 5 |
const cache = new Map();
|
| 6 |
|
js/tianji.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
| 2 |
// js/tianji.js
|
| 3 |
// 天機閣急速快答演武與三階軍備箱開箱系統
|
| 4 |
// ============================================================================
|
| 5 |
-
import { SCHEDULE, APP_BUILD_VERSION } from './config.js?v=
|
| 6 |
import {
|
| 7 |
isRangeOpen, totalProd, getTianjiStatus, recordMistake, recordCorrect,
|
| 8 |
grantGrain, grantTally, grantScroll
|
| 9 |
-
} from './engine.js?v=
|
| 10 |
-
import { loadBank } from './quiz.js?v=
|
| 11 |
import {
|
| 12 |
$, $$, fmt, todayStr, bind, toast, openModal, esc, shuffle, renderRichQuizText
|
| 13 |
-
} from './util.js?v=
|
| 14 |
|
| 15 |
let tianjiCtx = null;
|
| 16 |
|
|
|
|
| 2 |
// js/tianji.js
|
| 3 |
// 天機閣急速快答演武與三階軍備箱開箱系統
|
| 4 |
// ============================================================================
|
| 5 |
+
import { SCHEDULE, APP_BUILD_VERSION } from './config.js?v=20261127_v2';
|
| 6 |
import {
|
| 7 |
isRangeOpen, totalProd, getTianjiStatus, recordMistake, recordCorrect,
|
| 8 |
grantGrain, grantTally, grantScroll
|
| 9 |
+
} from './engine.js?v=20261127_v2';
|
| 10 |
+
import { loadBank } from './quiz.js?v=20261127_v2';
|
| 11 |
import {
|
| 12 |
$, $$, fmt, todayStr, bind, toast, openModal, esc, shuffle, renderRichQuizText
|
| 13 |
+
} from './util.js?v=20261127_v2';
|
| 14 |
|
| 15 |
let tianjiCtx = null;
|
| 16 |
|
js/world-boss-schedule.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
// 世界 Boss 當期自動排程(純函數,無副作用)
|
| 4 |
// - 供 db.js(讀寫時正規化)、engine.js(狀態計算)共用,確保全站看到同一隻 Boss
|
| 5 |
// ============================================================================
|
| 6 |
-
import { WORLD_BOSS_ROSTER, WORLD_BOSS_SCHEDULE } from './config.js?v=
|
| 7 |
|
| 8 |
/** 將 ISO 字串 / Date / 毫秒數轉為毫秒時間戳;無法解析回傳 NaN */
|
| 9 |
export function toTs(v) {
|
|
|
|
| 3 |
// 世界 Boss 當期自動排程(純函數,無副作用)
|
| 4 |
// - 供 db.js(讀寫時正規化)、engine.js(狀態計算)共用,確保全站看到同一隻 Boss
|
| 5 |
// ============================================================================
|
| 6 |
+
import { WORLD_BOSS_ROSTER, WORLD_BOSS_SCHEDULE } from './config.js?v=20261127_v2';
|
| 7 |
|
| 8 |
/** 將 ISO 字串 / Date / 毫秒數轉為毫秒時間戳;無法解析回傳 NaN */
|
| 9 |
export function toTs(v) {
|
lottery-draw.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;600;700;900&display=swap" rel="stylesheet">
|
| 10 |
-
<link rel="stylesheet" href="css/base.css?v=
|
| 11 |
-
<link rel="stylesheet" href="css/lottery.css?v=
|
| 12 |
</head>
|
| 13 |
<body class="lottery-draw-body">
|
| 14 |
<header class="draw-topbar">
|
|
@@ -23,7 +23,7 @@
|
|
| 23 |
<button id="btnRefreshLotteryPool" class="draw-btn" type="button">🔄 更新最新球數與名單</button>
|
| 24 |
<button id="btnLockLotteryBox" class="draw-btn" type="button">🔒 封箱鎖定準備開獎</button>
|
| 25 |
<button id="btnUnlockLotteryBox" class="draw-btn" type="button">🔓 解除封箱重啟投球</button>
|
| 26 |
-
<a href="teacher.html?v=
|
| 27 |
</div>
|
| 28 |
</header>
|
| 29 |
|
|
@@ -151,6 +151,6 @@
|
|
| 151 |
</div>
|
| 152 |
</div>
|
| 153 |
|
| 154 |
-
<script type="module" src="js/lottery-draw.js?v=
|
| 155 |
</body>
|
| 156 |
</html>
|
|
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;600;700;900&display=swap" rel="stylesheet">
|
| 10 |
+
<link rel="stylesheet" href="css/base.css?v=20261127_v2">
|
| 11 |
+
<link rel="stylesheet" href="css/lottery.css?v=20261127_v2">
|
| 12 |
</head>
|
| 13 |
<body class="lottery-draw-body">
|
| 14 |
<header class="draw-topbar">
|
|
|
|
| 23 |
<button id="btnRefreshLotteryPool" class="draw-btn" type="button">🔄 更新最新球數與名單</button>
|
| 24 |
<button id="btnLockLotteryBox" class="draw-btn" type="button">🔒 封箱鎖定準備開獎</button>
|
| 25 |
<button id="btnUnlockLotteryBox" class="draw-btn" type="button">🔓 解除封箱重啟投球</button>
|
| 26 |
+
<a href="teacher.html?v=20261127_v2" class="draw-btn" style="text-decoration:none; display:inline-flex; align-items:center;">⬅️ 回教師後台</a>
|
| 27 |
</div>
|
| 28 |
</header>
|
| 29 |
|
|
|
|
| 151 |
</div>
|
| 152 |
</div>
|
| 153 |
|
| 154 |
+
<script type="module" src="js/lottery-draw.js?v=20261127_v2"></script>
|
| 155 |
</body>
|
| 156 |
</html>
|
teacher.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>教師管理後台 - 放置測驗遊戲</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+TC:wght@400;700&display=swap" rel="stylesheet">
|
| 8 |
-
<link rel="stylesheet" href="css/base.css?v=
|
| 9 |
<style>
|
| 10 |
:root {
|
| 11 |
--admin-bg: #f9e9da; /* 柔和暖杏底色 */
|
|
@@ -511,7 +511,7 @@
|
|
| 511 |
<option value="english">🐪 固定出題:西域英文單字錯題</option>
|
| 512 |
</select>
|
| 513 |
<button class="btn btn-primary" id="btnSaveBossPhase">💾 套用期別與出題模式</button>
|
| 514 |
-
<a id="btnAdminOpenBossPage" href="boss.html?v=
|
| 515 |
<button class="btn btn-primary" id="btnAdminSettleBoss">📬 結算發信(全班獎勵+戰報)</button>
|
| 516 |
<button class="btn btn-danger" id="btnAdminResetBoss" style="background:#fee2e2; border-color:#fca5a5; color:#dc2626;">🔄 重設班級 Boss 滿血</button>
|
| 517 |
</div>
|
|
@@ -597,7 +597,7 @@
|
|
| 597 |
</select>
|
| 598 |
<button class="btn btn-primary" id="btnAdminStartStandardLottery" type="button">🚀 一鍵啟用正式週錯題樂透(手動封箱)</button>
|
| 599 |
<button class="btn" id="btnAdminApplyPilotPreset" type="button" title="商隊週單日測試用">⚡ 快閃測試 (11/19)</button>
|
| 600 |
-
<a id="btnAdminOpenLotteryPage" href="lottery-draw.html?v=
|
| 601 |
<button class="btn" id="btnAdminLockLotteryBox" type="button">🔒 封箱停收新球</button>
|
| 602 |
<button class="btn" id="btnAdminUnlockLotteryBox" type="button">🔓 解除封箱重啟</button>
|
| 603 |
<button class="btn" id="btnAdminExtendLotteryFri" type="button" style="border-color:#38bdf8; color:#0284c7; font-weight:700;">🛠️ 延長/改期至週五</button>
|
|
@@ -1000,7 +1000,7 @@
|
|
| 1000 |
<!-- 主地圖畫布區 -->
|
| 1001 |
<div class="map-editor-stage" id="mapEditorStage">
|
| 1002 |
<div class="map-editor-canvas" id="mapEditorCanvas">
|
| 1003 |
-
<img src="assets/map_chibi.jpg?v=
|
| 1004 |
<div id="mapEditorBgError" class="map-editor-bg-error hidden">
|
| 1005 |
<div style="font-size:28px;">🗺️</div>
|
| 1006 |
<div style="font-weight:800; font-size:14px;">沙盤底圖載入失敗(可能是網路或快取逾時)</div>
|
|
@@ -1093,6 +1093,6 @@
|
|
| 1093 |
<!-- Float layer for toasts -->
|
| 1094 |
<div id="floatLayer"></div>
|
| 1095 |
|
| 1096 |
-
<script type="module" src="js/admin.js?v=
|
| 1097 |
</body>
|
| 1098 |
</html>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
<title>教師管理後台 - 放置測驗遊戲</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+TC:wght@400;700&display=swap" rel="stylesheet">
|
| 8 |
+
<link rel="stylesheet" href="css/base.css?v=20261127_v2">
|
| 9 |
<style>
|
| 10 |
:root {
|
| 11 |
--admin-bg: #f9e9da; /* 柔和暖杏底色 */
|
|
|
|
| 511 |
<option value="english">🐪 固定出題:西域英文單字錯題</option>
|
| 512 |
</select>
|
| 513 |
<button class="btn btn-primary" id="btnSaveBossPhase">💾 套用期別與出題模式</button>
|
| 514 |
+
<a id="btnAdminOpenBossPage" href="boss.html?v=20261127_v2" target="_blank" class="btn" style="text-decoration:none;">⚔️ 前往世界 Boss 決戰殿堂 ➔</a>
|
| 515 |
<button class="btn btn-primary" id="btnAdminSettleBoss">📬 結算發信(全班獎勵+戰報)</button>
|
| 516 |
<button class="btn btn-danger" id="btnAdminResetBoss" style="background:#fee2e2; border-color:#fca5a5; color:#dc2626;">🔄 重設班級 Boss 滿血</button>
|
| 517 |
</div>
|
|
|
|
| 597 |
</select>
|
| 598 |
<button class="btn btn-primary" id="btnAdminStartStandardLottery" type="button">🚀 一鍵啟用正式週錯題樂透(手動封箱)</button>
|
| 599 |
<button class="btn" id="btnAdminApplyPilotPreset" type="button" title="商隊週單日測試用">⚡ 快閃測試 (11/19)</button>
|
| 600 |
+
<a id="btnAdminOpenLotteryPage" href="lottery-draw.html?v=20261127_v2" target="_blank" class="btn" style="text-decoration:none; background:#fef3c7; border-color:#f59e0b; color:#92400e; font-weight:800;">🎰 開啟週五公開開獎台 ➔</a>
|
| 601 |
<button class="btn" id="btnAdminLockLotteryBox" type="button">🔒 封箱停收新球</button>
|
| 602 |
<button class="btn" id="btnAdminUnlockLotteryBox" type="button">🔓 解除封箱重啟</button>
|
| 603 |
<button class="btn" id="btnAdminExtendLotteryFri" type="button" style="border-color:#38bdf8; color:#0284c7; font-weight:700;">🛠️ 延長/改期至週五</button>
|
|
|
|
| 1000 |
<!-- 主地圖畫布區 -->
|
| 1001 |
<div class="map-editor-stage" id="mapEditorStage">
|
| 1002 |
<div class="map-editor-canvas" id="mapEditorCanvas">
|
| 1003 |
+
<img src="assets/map_chibi.jpg?v=20261127_v2" id="mapEditorBgImg" class="map-editor-bg" alt="九州大地圖沙盤">
|
| 1004 |
<div id="mapEditorBgError" class="map-editor-bg-error hidden">
|
| 1005 |
<div style="font-size:28px;">🗺️</div>
|
| 1006 |
<div style="font-weight:800; font-size:14px;">沙盤底圖載入失敗(可能是網路或快取逾時)</div>
|
|
|
|
| 1093 |
<!-- Float layer for toasts -->
|
| 1094 |
<div id="floatLayer"></div>
|
| 1095 |
|
| 1096 |
+
<script type="module" src="js/admin.js?v=20261127_v2"></script>
|
| 1097 |
</body>
|
| 1098 |
</html>
|
tools/verify-balance-sim.mjs
CHANGED
|
@@ -446,7 +446,7 @@ function main() {
|
|
| 446 |
assert.equal(out1.chainBefore, 0);
|
| 447 |
assert.equal(out1.chainAfter, 1);
|
| 448 |
assert.equal(out1.newlyLit, false);
|
| 449 |
-
assert.
|
| 450 |
assert.equal(chainState.litWords['1'], undefined, '1/3 不可點亮賓果格');
|
| 451 |
|
| 452 |
// 第 2 次敲鎖 (1/3 -> 2/3)
|
|
|
|
| 446 |
assert.equal(out1.chainBefore, 0);
|
| 447 |
assert.equal(out1.chainAfter, 1);
|
| 448 |
assert.equal(out1.newlyLit, false);
|
| 449 |
+
assert.equal(out1.grainBonus, 0, '錯題進度推進 (1/3) 不再發放糧草');
|
| 450 |
assert.equal(chainState.litWords['1'], undefined, '1/3 不可點亮賓果格');
|
| 451 |
|
| 452 |
// 第 2 次敲鎖 (1/3 -> 2/3)
|
tools/verify-integrity.mjs
CHANGED
|
@@ -2265,11 +2265,14 @@ ok('教師後台快閃控制台、延長週五雙選與舊窮奇清查檢驗 100
|
|
| 2265 |
assert.ok(teacherHtml.includes('id="mapEditorBgImg"') && teacherHtml.includes('id="mapEditorBgError"') && teacherHtml.includes('id="btnRetryMapBg"'), 'teacher.html 必須具備底圖斷線重試提示容器');
|
| 2266 |
assert.ok(indexHtml.includes(`href="teacher.html?v=${APP_BUILD_VERSION}"`), 'index.html 進入教師後台連結必須帶最新 APP_BUILD_VERSION 版本參數以突破舊快取');
|
| 2267 |
|
| 2268 |
-
assert.equal(MAP_TOWNS_DEF.length,
|
| 2269 |
const lotTown = MAP_TOWNS_DEF.find(t => t.id === 'lottery');
|
|
|
|
| 2270 |
assert.ok(lotTown, 'MAP_TOWNS_DEF 必須包含 lottery 錯題樂透箱');
|
|
|
|
| 2271 |
assert.equal(calcMapThumbHeight('lottery', 158), 119, '錯題樂透箱縮圖高度必須維持 4:3 (0.75) 比例');
|
| 2272 |
assert.equal(calcMapThumbHeight('merchantCamp', 145), 109, '西域商隊縮圖高度必須維持 4:3 (0.75) 比例');
|
|
|
|
| 2273 |
assert.equal(calcMapThumbHeight('b1', 0), 120, '無效尺寸 0 必須安全回退至合理預設值');
|
| 2274 |
|
| 2275 |
// 驗證全部 14 點位在一紀元、二紀元與雙 Boss 狀態下的所有主圖與備援圖皆實體存在
|
|
@@ -2319,7 +2322,10 @@ ok('教師後台城池沙盤校準器圖資、錯題樂透圖示與畸形佈局
|
|
| 2319 |
assert.equal(BAZAAR_CONFIG.boardSize, 5);
|
| 2320 |
assert.equal(BAZAAR_CONFIG.freeCellIndex, 12);
|
| 2321 |
assert.equal(BAZAAR_CONFIG.encounterBatchSize, 5);
|
| 2322 |
-
assert.equal(BAZAAR_CONFIG.chainTapGrainSec,
|
|
|
|
|
|
|
|
|
|
| 2323 |
assert.deepEqual(BAZAAR_CONFIG.firstBloodLines, [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]);
|
| 2324 |
assert.equal(BAZAAR_CONFIG.personalMilestones.length, 6);
|
| 2325 |
assert.equal(BAZAAR_CONFIG.npcs.length, 4);
|
|
|
|
| 2265 |
assert.ok(teacherHtml.includes('id="mapEditorBgImg"') && teacherHtml.includes('id="mapEditorBgError"') && teacherHtml.includes('id="btnRetryMapBg"'), 'teacher.html 必須具備底圖斷線重試提示容器');
|
| 2266 |
assert.ok(indexHtml.includes(`href="teacher.html?v=${APP_BUILD_VERSION}"`), 'index.html 進入教師後台連結必須帶最新 APP_BUILD_VERSION 版本參數以突破舊快取');
|
| 2267 |
|
| 2268 |
+
assert.equal(MAP_TOWNS_DEF.length, 15, 'MAP_TOWNS_DEF 必須完整包含 10 座名都+天機閣+商隊+大市集+Boss+錯題樂透箱共 15 點位');
|
| 2269 |
const lotTown = MAP_TOWNS_DEF.find(t => t.id === 'lottery');
|
| 2270 |
+
const bazTown = MAP_TOWNS_DEF.find(t => t.id === 'bazaarCamp');
|
| 2271 |
assert.ok(lotTown, 'MAP_TOWNS_DEF 必須包含 lottery 錯題樂透箱');
|
| 2272 |
+
assert.ok(bazTown, 'MAP_TOWNS_DEF 必須包含 bazaarCamp 西域大市集');
|
| 2273 |
assert.equal(calcMapThumbHeight('lottery', 158), 119, '錯題樂透箱縮圖高度必須維持 4:3 (0.75) 比例');
|
| 2274 |
assert.equal(calcMapThumbHeight('merchantCamp', 145), 109, '西域商隊縮圖高度必須維持 4:3 (0.75) 比例');
|
| 2275 |
+
assert.equal(calcMapThumbHeight('bazaarCamp', 155), 116, '西域大市集縮圖高度必須維持 4:3 (0.75) 比例');
|
| 2276 |
assert.equal(calcMapThumbHeight('b1', 0), 120, '無效尺寸 0 必須安全回退至合理預設值');
|
| 2277 |
|
| 2278 |
// 驗證全部 14 點位在一紀元、二紀元與雙 Boss 狀態下的所有主圖與備援圖皆實體存在
|
|
|
|
| 2322 |
assert.equal(BAZAAR_CONFIG.boardSize, 5);
|
| 2323 |
assert.equal(BAZAAR_CONFIG.freeCellIndex, 12);
|
| 2324 |
assert.equal(BAZAAR_CONFIG.encounterBatchSize, 5);
|
| 2325 |
+
assert.equal(BAZAAR_CONFIG.chainTapGrainSec, 0);
|
| 2326 |
+
for (const npc of BAZAAR_CONFIG.npcs) {
|
| 2327 |
+
assert.ok(Array.isArray(npc.greetings) && npc.greetings.length >= 3, `NPC ${npc.id} 必須具備至少 3 句問候對話庫`);
|
| 2328 |
+
}
|
| 2329 |
assert.deepEqual(BAZAAR_CONFIG.firstBloodLines, [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]);
|
| 2330 |
assert.equal(BAZAAR_CONFIG.personalMilestones.length, 6);
|
| 2331 |
assert.equal(BAZAAR_CONFIG.npcs.length, 4);
|