Spaces:
Running
Running
feat: witch potion 2.1 + prompts v4; classification complete (body 1021 / money 984)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- README.md +22 -4
- htlb/miniapp/dist-potato/quiz.js +0 -0
- htlb/miniapp/dist-potato/style.css +58 -0
- htlb/miniapp/dist-witch/quiz.js +0 -0
- htlb/miniapp/dist-witch/style.css +58 -0
- htlb/miniapp/dist-witch/witch-sprites.js +1 -1
- htlb/miniapp/dist-witch/witch.js +184 -71
- htlb/miniapp/dist-witch/witch/man-a1p1-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p1-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p1-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p1l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p1l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p1l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p2l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p3-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p3-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p3-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a1p3l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p1l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p2l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a2p3l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1-good.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1l1-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1l2-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p1l3-idle.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p2-bad.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p2-drink.webp +2 -2
- htlb/miniapp/dist-witch/witch/man-a3p2-good.webp +2 -2
README.md
CHANGED
|
@@ -17,6 +17,24 @@ pinned: false
|
|
| 17 |
- 生成方法:`python3 htlb/pdf-src/build_pdf.py <原 PDF> <输出 PDF> <封面预览 jpg>`(原排版源文件不在本仓库,因此在原 PDF 上做增量修改:遮盖旧文字后用相同字号、颜色、行距写入新文字)
|
| 18 |
- 小工具「领取 PDF」的笔记位置已预留(`app.js` 中 `PDF_NOTE`,发布笔记后填标题)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# 本轮:「女巫的魔药」第 2 版 + 两个版本分开发布(已上线)
|
| 21 |
|
| 22 |
> 用户确认:网页上**两个版本分开展示、分开下载**(「红薯冒险」版、「女巫的魔药」版各一个小工具包);身体拆成年龄 / 身材 / 颜值三项;素材 `女巫的魔药-素材5.zip`(100 个文件)已到。
|
|
@@ -419,7 +437,7 @@ pinned: false
|
|
| 419 |
## 步骤
|
| 420 |
|
| 421 |
1. ✅ **计划写进 README 并推送**(`README.md`)
|
| 422 |
-
2.
|
| 423 |
- 等后台跑完 2005 题,汇总等级分布,把等级写进题库。
|
| 424 |
- 如果某一级题目太少(不到 40 道),这一级的怪就很少出场:按连续难度分 ev 微调到相邻等级,并在报告里写明调整了哪些题。
|
| 425 |
3. ✅ **素材处理**(47 个动画转 WebP 共 2.2 MB;每帧保留 256 px;各动画按「复位帧」身高与脚底自动缩放对齐;无空帧、无贴边碎片,报告见 `sprite-src/REPORT.md`)(新目录 `htlb/miniapp/tool/sprites/`;处理脚本放 `quiz-src/` 旁,不进工具包)
|
|
@@ -476,9 +494,9 @@ pinned: false
|
|
| 476 |
|
| 477 |
- [x] **D1. 接口验证**:该模型不走 chat 接口,走 OpenRouter 决策接口 `POST /api/alpha/decisions`,请求体 `{model, state, questions:{level:{type:"choice", instructions, criteria:{"1".."8"}}}}`,返回 8 个等级各自的概率。
|
| 478 |
- [x] **D2. 评级脚本** `htlb/miniapp/quiz-src/difficulty.mjs`:每道题把「题型、题干、选项、正确答案、解析」作为 state,问「对普通中国成年人有多难」,8 个等级各有文字定义;并发 + 失败重试 + 断点续跑(结果逐行追加到 `difficulty/raw.jsonl`)。
|
| 479 |
-
- [
|
| 480 |
-
- [
|
| 481 |
-
- [
|
| 482 |
|
| 483 |
# 续做计划:题库全量复核 + 网站功能介绍同步
|
| 484 |
|
|
|
|
| 17 |
- 生成方法:`python3 htlb/pdf-src/build_pdf.py <原 PDF> <输出 PDF> <封面预览 jpg>`(原排版源文件不在本仓库,因此在原 PDF 上做增量修改:遮盖旧文字后用相同字号、颜色、行距写入新文字)
|
| 18 |
- 小工具「领取 PDF」的笔记位置已预留(`app.js` 中 `PDF_NOTE`,发布笔记后填标题)
|
| 19 |
|
| 20 |
+
# 本轮:「女巫的魔药」第 2.1 版(按反馈逐条修改)+ 第 4 版素材提示词
|
| 21 |
+
|
| 22 |
+
**已用代码完成(不需要新素材)**
|
| 23 |
+
- [x] 点「冒险」直接进入游戏(不再有介绍页);游戏里「退出」直接回到首页(今日)
|
| 24 |
+
- [x] 头像下「22 岁」改为「我」;头像框颜色随综合等级变化(新头像框素材到位后换成 7 款图片框)
|
| 25 |
+
- [x] 状态栏右侧改为 年龄 / 身材 / 颜值 / 财富 四条「到下一级」进度条(等级色 + 还差多少分),喝对 / 喝错时对应进度条飘出 +N / −N 并闪光
|
| 26 |
+
- [x] 点头像弹出**角色属性面板**:上方房子背景 + 主角全身 + 座驾,下方 年龄 / 身材 / 颜值 / 财富 / 房子 / 车子 文字(按 灰 → 白 → 蓝 → 紫 → 绿 → 金 → 红 七级上色),「战绩」并入面板
|
| 27 |
+
- [x] 每项属性扩为 7 级文字描述;综合等级 = 四项平均
|
| 28 |
+
- [x] 成就改为 **24 枚徽章**(未获得为灰色,点击显示获得条件)
|
| 29 |
+
- [x] 工具栏改为 成就 / 账单 / 设置 / 退出;「开场」移入设置;设置里写清全部游戏机制;「遗忘之药水」在设置里
|
| 30 |
+
- [x] 弹窗点空白处可关闭
|
| 31 |
+
- [x] 文案:「点一下继续」→「继续」;去掉 emoji;「下一杯」→「继续挑战」
|
| 32 |
+
- [x] 魔药杯不再晃动
|
| 33 |
+
- [x] 名字牌去掉框,改为文字 + 金色分割线;对话框、按钮、选项牌改用保边切片 + 平铺(文字多时不再拉伸变形),选项文字居中
|
| 34 |
+
- [x] 「抽搐」缓解:构建时把每帧身体对齐到同一条底边与中线(78 条动画);待机改为慢速往返播放(每秒 4 帧,0-1-2-3-2-1)
|
| 35 |
+
- [x] 人生账单重做:深紫星空底 + 画面卡(房子 / 主角 / 座驾)+ 头像与综合等级 + 六项带等级色的属性和进度条 + 今日战绩;纯绘制部分在任何环境都完整,不再空白
|
| 36 |
+
- [ ] 需要新素材的部分:见 `htlb/miniapp/witch-src/PROMPTS.md`(第 4 版,163 个文件:更顺滑的男主角 96 个 / 女巫 8 个动画、烟雾魔药杯 6、头像框 7、属性图标 6、工具图标 5 + 关闭按钮、成就徽章 24、三段式对话框 / 按钮 / 选项牌 9、分割线 1)。喝药动画改为「手里不画杯子」,由程序把玩家选中的那杯魔药放到手上
|
| 37 |
+
|
| 38 |
# 本轮:「女巫的魔药」第 2 版 + 两个版本分开发布(已上线)
|
| 39 |
|
| 40 |
> 用户确认:网页上**两个版本分开展示、分开下载**(「红薯冒险」版、「女巫的魔药」版各一个小工具包);身体拆成年龄 / 身材 / 颜值三项;素材 `女巫的魔药-素材5.zip`(100 个文件)已到。
|
|
|
|
| 437 |
## 步骤
|
| 438 |
|
| 439 |
1. ✅ **计划写进 README 并推送**(`README.md`)
|
| 440 |
+
2. ✅ **难度评级收尾**(已评 2005 / 2005 题;模型等级 1–8 级:0 / 57 / 237 / 276 / 348 / 442 / 645 / 0;游戏等级:201 / 280 / 281 / 281 / 280 / 281 / 241 / 160;为保证 8 种怪物都有题,增加「游戏等级」:按模型连续分数排序后按 10/14/14/14/14/14/12/8% 切 8 档,题目难易顺序完全沿用模型判断)(`quiz-src/difficulty/*`、`quiz.js`)
|
| 441 |
- 等后台跑完 2005 题,汇总等级分布,把等级写进题库。
|
| 442 |
- 如果某一级题目太少(不到 40 道),这一级的怪就很少出场:按连续难度分 ev 微调到相邻等级,并在报告里写明调整了哪些题。
|
| 443 |
3. ✅ **素材处理**(47 个动画转 WebP 共 2.2 MB;每帧保留 256 px;各动画按「复位帧」身高与脚底自动缩放对齐;无空帧、无贴边碎片,报告见 `sprite-src/REPORT.md`)(新目录 `htlb/miniapp/tool/sprites/`;处理脚本放 `quiz-src/` 旁,不进工具包)
|
|
|
|
| 494 |
|
| 495 |
- [x] **D1. 接口验证**:该模型不走 chat 接口,走 OpenRouter 决策接口 `POST /api/alpha/decisions`,请求体 `{model, state, questions:{level:{type:"choice", instructions, criteria:{"1".."8"}}}}`,返回 8 个等级各自的概率。
|
| 496 |
- [x] **D2. 评级脚本** `htlb/miniapp/quiz-src/difficulty.mjs`:每道题把「题型、题干、选项、正确答案、解析」作为 state,问「对普通中国成年人有多难」,8 个等级各有文字定义;并发 + 失败重试 + 断点续跑(结果逐行追加到 `difficulty/raw.jsonl`)。
|
| 497 |
+
- [x] **D3. 全量评级**(已完成:改用 `lingdt-decision-1.0-27b` 后 2005 / 2005 题全部评完;同一请求里还完成了「身体 / 金钱」两分类:身体 1021 题、金钱 984 题,以及影响大小 0–3。OpenRouter `mammoth-1:free` 试评的 81 题存档于 `difficulty/mammoth-1/`)
|
| 498 |
+
- [x] **D4. 汇总与入库**:生成 `difficulty/levels.json`(每题等级)与 `difficulty/REPORT.md`(分布、各题型 / 各节平均难度、示例);`build.mjs` 把等级写进 `quiz.js`(每题第 7 个字段),供后续「怪物按难度 1–8 级」使用。
|
| 499 |
+
- [x] **D5. 推送**:脚本、原始结果、汇总、quiz.js 同步到 Space。
|
| 500 |
|
| 501 |
# 续做计划:题库全量复核 + 网站功能介绍同步
|
| 502 |
|
htlb/miniapp/dist-potato/quiz.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
htlb/miniapp/dist-potato/style.css
CHANGED
|
@@ -593,3 +593,61 @@ html.game-on img{-webkit-user-drag:none;pointer-events:none}
|
|
| 593 |
.w2-sheet .wt-rotate{z-index:40}
|
| 594 |
@media (max-height:700px){.w2-text{font-size:14px}.w2-opt{min-height:44px}.w2-tool .w2-ic{width:32px;height:32px}}
|
| 595 |
.w2-skip{display:block;margin:4px 0 0 auto;font-size:12px;font-weight:900;color:#5B2A86;min-height:32px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
.w2-sheet .wt-rotate{z-index:40}
|
| 594 |
@media (max-height:700px){.w2-text{font-size:14px}.w2-opt{min-height:44px}.w2-tool .w2-ic{width:32px;height:32px}}
|
| 595 |
.w2-skip{display:block;margin:4px 0 0 auto;font-size:12px;font-weight:900;color:#5B2A86;min-height:32px}
|
| 596 |
+
/* ===== 女巫的魔药 第 2.1 版:状态栏、属性面板、徽章 ===== */
|
| 597 |
+
.w2-cup i{-webkit-animation:none!important;animation:none!important}
|
| 598 |
+
.w2-hud .w2-me{flex-shrink:0;width:74px;text-align:center;padding:0;pointer-events:auto}
|
| 599 |
+
.w2-face{box-shadow:0 0 0 3px #a3a7ad,0 4px 10px rgba(0,0,0,.4)}
|
| 600 |
+
.w2-face.g1{box-shadow:0 0 0 3px #f4f1ea,0 4px 10px rgba(0,0,0,.4)}
|
| 601 |
+
.w2-face.g2{box-shadow:0 0 0 3px #5aa9ff,0 0 12px rgba(90,169,255,.6)}
|
| 602 |
+
.w2-face.g3{box-shadow:0 0 0 3px #c07bff,0 0 14px rgba(192,123,255,.65)}
|
| 603 |
+
.w2-face.g4{box-shadow:0 0 0 3px #45d483,0 0 16px rgba(69,212,131,.7)}
|
| 604 |
+
.w2-face.g5{box-shadow:0 0 0 4px #ffc83d,0 0 20px rgba(255,200,61,.8)}
|
| 605 |
+
.w2-face.g6{box-shadow:0 0 0 4px #ff5a5a,0 0 24px rgba(255,90,90,.85)}
|
| 606 |
+
.w2-bars{flex:1;min-width:0;margin:2px 0 0 8px;background:rgba(20,14,26,.62);border-radius:12px;padding:5px 8px}
|
| 607 |
+
.w2-bar{position:relative;display:flex;align-items:center;height:22px}
|
| 608 |
+
.w2-si{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0;background-size:contain;background-repeat:no-repeat;background-position:center;font-style:normal}
|
| 609 |
+
.w2-si.t{border-radius:5px;background:#5B2A86;color:#FFE58A;font-size:11px;font-weight:900}
|
| 610 |
+
.w2-bl{font-size:11px;font-weight:900;color:rgba(255,255,255,.85);margin:0 5px 0 4px;flex-shrink:0}
|
| 611 |
+
.w2-track{position:relative;flex:1;height:7px;border-radius:4px;background:rgba(255,255,255,.14);overflow:hidden}
|
| 612 |
+
.w2-track i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;transition:width .7s var(--ease)}
|
| 613 |
+
.w2-bar small{flex-shrink:0;width:86px;text-align:right;font-size:10px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:5px}
|
| 614 |
+
.w2-bar.hit-up .w2-track{box-shadow:0 0 0 2px #45d483}
|
| 615 |
+
.w2-bar.hit-down .w2-track{box-shadow:0 0 0 2px #ff5a5a}
|
| 616 |
+
.w2-bump{position:absolute;right:40px;top:-6px;font-family:var(--mono);font-size:16px;font-weight:900;text-shadow:0 1px 3px rgba(0,0,0,.6);-webkit-animation:floatUp 1.4s var(--ease) forwards;animation:floatUp 1.4s var(--ease) forwards;pointer-events:none}
|
| 617 |
+
.w2-bump.up{color:#45d483}
|
| 618 |
+
.w2-bump.down{color:#ff5a5a}
|
| 619 |
+
.w2-title{font-size:16px;font-weight:900;color:#3a1f52;padding:2px 0 8px;margin-bottom:6px;border-bottom:2px solid;border-image:linear-gradient(90deg,transparent,#c9a45c,transparent) 1}
|
| 620 |
+
.w2-title em{font-style:normal}
|
| 621 |
+
.w2-pop.panel .w2-pop-box{max-width:380px}
|
| 622 |
+
.w2-pscene{position:relative;height:200px;border-radius:12px;overflow:hidden;background-size:cover;background-position:center 62%}
|
| 623 |
+
.w2-pscene .wt-actor{left:32%;bottom:8%}
|
| 624 |
+
.w2-pcar{position:absolute;right:2%;bottom:6%;width:52%;height:45%;background-size:contain;background-repeat:no-repeat;background-position:center bottom}
|
| 625 |
+
.w2-attrs{margin-top:8px;background:#2a1d3d;border-radius:12px;padding:6px 10px}
|
| 626 |
+
.w2-attrs p{display:flex;align-items:center;font-size:13.5px;line-height:1.45;margin:0;padding:5px 0;border-bottom:1px solid rgba(255,255,255,.07)}
|
| 627 |
+
.w2-attrs p:last-child{border-bottom:0}
|
| 628 |
+
.w2-attrs b{flex-shrink:0;width:40px;margin-left:6px;color:rgba(255,255,255,.7);font-size:12.5px}
|
| 629 |
+
.w2-attrs span{font-weight:900}
|
| 630 |
+
.w2-subcap{font-size:13px;font-weight:900;color:#5B2A86;margin:10px 0 0}
|
| 631 |
+
.w2-badges{display:-ms-grid;display:grid;grid-template-columns:repeat(4,1fr);grid-gap:8px;margin-top:4px}
|
| 632 |
+
.w2-badge{display:flex;flex-direction:column;align-items:center;font-size:10.5px;font-weight:900;color:#3a1f52;line-height:1.3;text-align:center}
|
| 633 |
+
.w2-badge i{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:50%;background-size:cover;background-position:center;font-style:normal;margin-bottom:3px;-webkit-filter:grayscale(1) opacity(.45);filter:grayscale(1) opacity(.45)}
|
| 634 |
+
.w2-badge i.t{background:radial-gradient(circle at 35% 30%,#ffe58a,#c9a45c 55%,#7a5a20);color:#3a1f52;font-size:20px;box-shadow:inset 0 0 0 3px rgba(255,255,255,.5)}
|
| 635 |
+
.w2-badge.got i{-webkit-filter:none;filter:none;box-shadow:0 0 10px rgba(255,200,61,.7)}
|
| 636 |
+
.w2-badge:not(.got) span{opacity:.5}
|
| 637 |
+
#w2-badge-tip{margin-top:10px!important;text-align:center;min-height:2.4em}
|
| 638 |
+
.w2-setbtns .w2-btn{margin-top:6px}
|
| 639 |
+
.w2-rules h4{font-size:14px;font-weight:900;color:#5B2A86;margin:12px 0 2px}
|
| 640 |
+
.w2-rules p{font-size:13px!important;line-height:1.7;margin:0!important}
|
| 641 |
+
.w2-btn.orig{display:flex;align-items:center;justify-content:center}
|
| 642 |
+
.w2-ic.one{background-size:contain;background-position:center}
|
| 643 |
+
.w2-pop-x{display:flex;align-items:center;justify-content:center;overflow:hidden}
|
| 644 |
+
.w2-pop-x i{display:block;width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:center}
|
| 645 |
+
/* 名字:不用框,文字 + 金色分割线 */
|
| 646 |
+
.w2-name{display:block;position:static;top:auto;margin:0 0 6px;min-width:0;height:auto;padding:0 0 4px;background:none!important;font-size:15px;font-weight:900;color:#4a2a68;letter-spacing:1px;border-bottom:2px solid;border-image:linear-gradient(90deg,#c9a45c,#f3dc9a 40%,rgba(201,164,92,0)) 1}
|
| 647 |
+
/* 对话框 / 按钮 / 选项:保边切片 + 平铺,文字多时不再拉伸变形 */
|
| 648 |
+
.w2-dialog,.w2-pop-box{border-image:url(./witch/ui-dialog.webp) 64 fill / 22px round}
|
| 649 |
+
.w2-btn{background:none;border-style:solid;border-width:14px 22px;border-image:url(./witch/ui-button.webp) 40 60 fill / 14px 22px round;padding:0;min-height:22px}
|
| 650 |
+
.w2-btn.ghost{border:0}
|
| 651 |
+
.w2-opt{justify-content:center;text-align:center;background:none!important;border-style:solid;border-width:12px 18px;border-image:url(./witch/ui-option.webp) 36 60 fill / 12px 18px round;padding:2px 2px;min-height:30px}
|
| 652 |
+
.w2-opt span{flex:1;text-align:center}
|
| 653 |
+
.w2-opt i{width:30px;height:30px;margin-right:2px}
|
htlb/miniapp/dist-witch/quiz.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
htlb/miniapp/dist-witch/style.css
CHANGED
|
@@ -593,3 +593,61 @@ html.game-on img{-webkit-user-drag:none;pointer-events:none}
|
|
| 593 |
.w2-sheet .wt-rotate{z-index:40}
|
| 594 |
@media (max-height:700px){.w2-text{font-size:14px}.w2-opt{min-height:44px}.w2-tool .w2-ic{width:32px;height:32px}}
|
| 595 |
.w2-skip{display:block;margin:4px 0 0 auto;font-size:12px;font-weight:900;color:#5B2A86;min-height:32px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
.w2-sheet .wt-rotate{z-index:40}
|
| 594 |
@media (max-height:700px){.w2-text{font-size:14px}.w2-opt{min-height:44px}.w2-tool .w2-ic{width:32px;height:32px}}
|
| 595 |
.w2-skip{display:block;margin:4px 0 0 auto;font-size:12px;font-weight:900;color:#5B2A86;min-height:32px}
|
| 596 |
+
/* ===== 女巫的魔药 第 2.1 版:状态栏、属性面板、徽章 ===== */
|
| 597 |
+
.w2-cup i{-webkit-animation:none!important;animation:none!important}
|
| 598 |
+
.w2-hud .w2-me{flex-shrink:0;width:74px;text-align:center;padding:0;pointer-events:auto}
|
| 599 |
+
.w2-face{box-shadow:0 0 0 3px #a3a7ad,0 4px 10px rgba(0,0,0,.4)}
|
| 600 |
+
.w2-face.g1{box-shadow:0 0 0 3px #f4f1ea,0 4px 10px rgba(0,0,0,.4)}
|
| 601 |
+
.w2-face.g2{box-shadow:0 0 0 3px #5aa9ff,0 0 12px rgba(90,169,255,.6)}
|
| 602 |
+
.w2-face.g3{box-shadow:0 0 0 3px #c07bff,0 0 14px rgba(192,123,255,.65)}
|
| 603 |
+
.w2-face.g4{box-shadow:0 0 0 3px #45d483,0 0 16px rgba(69,212,131,.7)}
|
| 604 |
+
.w2-face.g5{box-shadow:0 0 0 4px #ffc83d,0 0 20px rgba(255,200,61,.8)}
|
| 605 |
+
.w2-face.g6{box-shadow:0 0 0 4px #ff5a5a,0 0 24px rgba(255,90,90,.85)}
|
| 606 |
+
.w2-bars{flex:1;min-width:0;margin:2px 0 0 8px;background:rgba(20,14,26,.62);border-radius:12px;padding:5px 8px}
|
| 607 |
+
.w2-bar{position:relative;display:flex;align-items:center;height:22px}
|
| 608 |
+
.w2-si{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0;background-size:contain;background-repeat:no-repeat;background-position:center;font-style:normal}
|
| 609 |
+
.w2-si.t{border-radius:5px;background:#5B2A86;color:#FFE58A;font-size:11px;font-weight:900}
|
| 610 |
+
.w2-bl{font-size:11px;font-weight:900;color:rgba(255,255,255,.85);margin:0 5px 0 4px;flex-shrink:0}
|
| 611 |
+
.w2-track{position:relative;flex:1;height:7px;border-radius:4px;background:rgba(255,255,255,.14);overflow:hidden}
|
| 612 |
+
.w2-track i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;transition:width .7s var(--ease)}
|
| 613 |
+
.w2-bar small{flex-shrink:0;width:86px;text-align:right;font-size:10px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:5px}
|
| 614 |
+
.w2-bar.hit-up .w2-track{box-shadow:0 0 0 2px #45d483}
|
| 615 |
+
.w2-bar.hit-down .w2-track{box-shadow:0 0 0 2px #ff5a5a}
|
| 616 |
+
.w2-bump{position:absolute;right:40px;top:-6px;font-family:var(--mono);font-size:16px;font-weight:900;text-shadow:0 1px 3px rgba(0,0,0,.6);-webkit-animation:floatUp 1.4s var(--ease) forwards;animation:floatUp 1.4s var(--ease) forwards;pointer-events:none}
|
| 617 |
+
.w2-bump.up{color:#45d483}
|
| 618 |
+
.w2-bump.down{color:#ff5a5a}
|
| 619 |
+
.w2-title{font-size:16px;font-weight:900;color:#3a1f52;padding:2px 0 8px;margin-bottom:6px;border-bottom:2px solid;border-image:linear-gradient(90deg,transparent,#c9a45c,transparent) 1}
|
| 620 |
+
.w2-title em{font-style:normal}
|
| 621 |
+
.w2-pop.panel .w2-pop-box{max-width:380px}
|
| 622 |
+
.w2-pscene{position:relative;height:200px;border-radius:12px;overflow:hidden;background-size:cover;background-position:center 62%}
|
| 623 |
+
.w2-pscene .wt-actor{left:32%;bottom:8%}
|
| 624 |
+
.w2-pcar{position:absolute;right:2%;bottom:6%;width:52%;height:45%;background-size:contain;background-repeat:no-repeat;background-position:center bottom}
|
| 625 |
+
.w2-attrs{margin-top:8px;background:#2a1d3d;border-radius:12px;padding:6px 10px}
|
| 626 |
+
.w2-attrs p{display:flex;align-items:center;font-size:13.5px;line-height:1.45;margin:0;padding:5px 0;border-bottom:1px solid rgba(255,255,255,.07)}
|
| 627 |
+
.w2-attrs p:last-child{border-bottom:0}
|
| 628 |
+
.w2-attrs b{flex-shrink:0;width:40px;margin-left:6px;color:rgba(255,255,255,.7);font-size:12.5px}
|
| 629 |
+
.w2-attrs span{font-weight:900}
|
| 630 |
+
.w2-subcap{font-size:13px;font-weight:900;color:#5B2A86;margin:10px 0 0}
|
| 631 |
+
.w2-badges{display:-ms-grid;display:grid;grid-template-columns:repeat(4,1fr);grid-gap:8px;margin-top:4px}
|
| 632 |
+
.w2-badge{display:flex;flex-direction:column;align-items:center;font-size:10.5px;font-weight:900;color:#3a1f52;line-height:1.3;text-align:center}
|
| 633 |
+
.w2-badge i{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:50%;background-size:cover;background-position:center;font-style:normal;margin-bottom:3px;-webkit-filter:grayscale(1) opacity(.45);filter:grayscale(1) opacity(.45)}
|
| 634 |
+
.w2-badge i.t{background:radial-gradient(circle at 35% 30%,#ffe58a,#c9a45c 55%,#7a5a20);color:#3a1f52;font-size:20px;box-shadow:inset 0 0 0 3px rgba(255,255,255,.5)}
|
| 635 |
+
.w2-badge.got i{-webkit-filter:none;filter:none;box-shadow:0 0 10px rgba(255,200,61,.7)}
|
| 636 |
+
.w2-badge:not(.got) span{opacity:.5}
|
| 637 |
+
#w2-badge-tip{margin-top:10px!important;text-align:center;min-height:2.4em}
|
| 638 |
+
.w2-setbtns .w2-btn{margin-top:6px}
|
| 639 |
+
.w2-rules h4{font-size:14px;font-weight:900;color:#5B2A86;margin:12px 0 2px}
|
| 640 |
+
.w2-rules p{font-size:13px!important;line-height:1.7;margin:0!important}
|
| 641 |
+
.w2-btn.orig{display:flex;align-items:center;justify-content:center}
|
| 642 |
+
.w2-ic.one{background-size:contain;background-position:center}
|
| 643 |
+
.w2-pop-x{display:flex;align-items:center;justify-content:center;overflow:hidden}
|
| 644 |
+
.w2-pop-x i{display:block;width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:center}
|
| 645 |
+
/* 名字:不用框,文字 + 金色分割线 */
|
| 646 |
+
.w2-name{display:block;position:static;top:auto;margin:0 0 6px;min-width:0;height:auto;padding:0 0 4px;background:none!important;font-size:15px;font-weight:900;color:#4a2a68;letter-spacing:1px;border-bottom:2px solid;border-image:linear-gradient(90deg,#c9a45c,#f3dc9a 40%,rgba(201,164,92,0)) 1}
|
| 647 |
+
/* 对话框 / 按钮 / 选项:保边切片 + 平铺,文字多时不再拉伸变形 */
|
| 648 |
+
.w2-dialog,.w2-pop-box{border-image:url(./witch/ui-dialog.webp) 64 fill / 22px round}
|
| 649 |
+
.w2-btn{background:none;border-style:solid;border-width:14px 22px;border-image:url(./witch/ui-button.webp) 40 60 fill / 14px 22px round;padding:0;min-height:22px}
|
| 650 |
+
.w2-btn.ghost{border:0}
|
| 651 |
+
.w2-opt{justify-content:center;text-align:center;background:none!important;border-style:solid;border-width:12px 18px;border-image:url(./witch/ui-option.webp) 36 60 fill / 12px 18px round;padding:2px 2px;min-height:30px}
|
| 652 |
+
.w2-opt span{flex:1;text-align:center}
|
| 653 |
+
.w2-opt i{width:30px;height:30px;margin-right:2px}
|
htlb/miniapp/dist-witch/witch-sprites.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
window.__WITCH_SPR__={"car-0":{"w":768,"h":512,"box":[127,14,641,488]},"car-1":{"w":768,"h":512,"box":[148,17,644,490]},"car-2":{"w":768,"h":512,"box":[20,72,754,458]},"car-3":{"w":768,"h":512,"box":[24,79,753,458]},"car-4":{"w":768,"h":512,"box":[24,56,748,445]},"car-5":{"w":768,"h":512,"box":[25,65,752,421]},"car-6":{"w":768,"h":512,"box":[18,201,750,432]},"car-7":{"w":768,"h":512,"box":[22,13,744,477]},"cups":{"n":6,"f":1,"boxes":[[77,13,178,245],[65,23,189,244],[74,12,181,244],[72,15,183,244],[52,11,202,245],[66,32,189,243]]},"fx-bad":{"n":6,"f":1,"boxes":[[80,120,175,240],[66,66,188,239],[57,26,198,243],[56,12,198,245],[54,10,200,243],[77,44,178,242]]},"fx-change":{"n":6,"f":1,"boxes":[[71,96,182,229],[63,67,191,232],[60,11,195,236],[54,22,202,241],[47,31,209,241],[64,56,190,236]]},"fx-good":{"n":6,"f":1,"boxes":[[81,88,173,179],[61,61,194,204],[36,30,219,222],[11,11,244,244],[54,46,202,207],[75,76,179,194]]},"witch-appear":{"n":6,"h":219,"b":244},"witch-idle":{"n":6,"h":191,"b":215},"witch-laugh":{"n":4,"h":214,"b":224},"witch-nod":{"n":4,"h":212,"b":224},"witch-offer":{"n":6,"h":213,"b":224},"witch-stop":{"n":4,"h":209,"b":225},"witch-wand":{"n":6,"h":177,"b":
|
|
|
|
| 1 |
+
window.__WITCH_SPR__={"car-0":{"w":768,"h":512,"box":[127,14,641,488]},"car-1":{"w":768,"h":512,"box":[148,17,644,490]},"car-2":{"w":768,"h":512,"box":[20,72,754,458]},"car-3":{"w":768,"h":512,"box":[24,79,753,458]},"car-4":{"w":768,"h":512,"box":[24,56,748,445]},"car-5":{"w":768,"h":512,"box":[25,65,752,421]},"car-6":{"w":768,"h":512,"box":[18,201,750,432]},"car-7":{"w":768,"h":512,"box":[22,13,744,477]},"cups":{"n":6,"f":1,"boxes":[[77,13,178,245],[65,23,189,244],[74,12,181,244],[72,15,183,244],[52,11,202,245],[66,32,189,243]]},"fx-bad":{"n":6,"f":1,"boxes":[[80,120,175,240],[66,66,188,239],[57,26,198,243],[56,12,198,245],[54,10,200,243],[77,44,178,242]]},"fx-change":{"n":6,"f":1,"boxes":[[71,96,182,229],[63,67,191,232],[60,11,195,236],[54,22,202,241],[47,31,209,241],[64,56,190,236]]},"fx-good":{"n":6,"f":1,"boxes":[[81,88,173,179],[61,61,194,204],[36,30,219,222],[11,11,244,244],[54,46,202,207],[75,76,179,194]]},"witch-appear":{"n":6,"h":219,"b":244},"witch-idle":{"n":6,"h":191,"b":215},"witch-laugh":{"n":4,"h":214,"b":224},"witch-nod":{"n":4,"h":212,"b":224},"witch-offer":{"n":6,"h":213,"b":224},"witch-stop":{"n":4,"h":209,"b":225},"witch-wand":{"n":6,"h":177,"b":222},"face-a1l1":{"w":160,"h":160},"face-a1l2":{"w":160,"h":160},"face-a1l3":{"w":160,"h":160},"face-a2l1":{"w":160,"h":160},"face-a2l2":{"w":160,"h":160},"face-a2l3":{"w":160,"h":160},"face-a3l1":{"w":160,"h":160},"face-a3l2":{"w":160,"h":160},"face-a3l3":{"w":160,"h":160},"face-a4l1":{"w":160,"h":160},"face-a4l2":{"w":160,"h":160},"face-a4l3":{"w":160,"h":160},"house-0":{"w":720,"h":1280},"house-1":{"w":720,"h":1280},"house-2":{"w":720,"h":1280},"house-3":{"w":720,"h":1280},"house-4":{"w":720,"h":1280},"house-5":{"w":720,"h":1280},"house-6":{"w":720,"h":1280},"house-7":{"w":720,"h":1280},"man-a1p1-bad":{"n":4,"h":230,"b":243},"man-a1p1-drink":{"n":6,"h":232,"b":245},"man-a1p1-good":{"n":4,"h":214,"b":240},"man-a1p1l1-idle":{"n":4,"h":225,"b":242},"man-a1p1l2-idle":{"n":4,"h":227,"b":243},"man-a1p1l3-idle":{"n":4,"h":226,"b":243},"man-a1p2-bad":{"n":4,"h":231,"b":244},"man-a1p2-drink":{"n":6,"h":233,"b":244},"man-a1p2-good":{"n":4,"h":222,"b":242},"man-a1p2l1-idle":{"n":4,"h":228,"b":244},"man-a1p2l2-idle":{"n":4,"h":222,"b":240},"man-a1p2l3-idle":{"n":4,"h":228,"b":243},"man-a1p3-bad":{"n":4,"h":231,"b":242},"man-a1p3-drink":{"n":6,"h":233,"b":244},"man-a1p3-good":{"n":4,"h":214,"b":234},"man-a1p3l1-idle":{"n":4,"h":229,"b":244},"man-a1p3l2-idle":{"n":4,"h":233,"b":244},"man-a1p3l3-idle":{"n":4,"h":228,"b":243},"man-a2p1-bad":{"n":4,"h":224,"b":239},"man-a2p1-drink":{"n":6,"h":230,"b":243},"man-a2p1-good":{"n":4,"h":218,"b":243},"man-a2p1l1-idle":{"n":4,"h":226,"b":243},"man-a2p1l2-idle":{"n":4,"h":223,"b":243},"man-a2p1l3-idle":{"n":4,"h":214,"b":243},"man-a2p2-bad":{"n":4,"h":221,"b":238},"man-a2p2-drink":{"n":6,"h":232,"b":244},"man-a2p2-good":{"n":4,"h":220,"b":241},"man-a2p2l1-idle":{"n":4,"h":227,"b":243},"man-a2p2l2-idle":{"n":4,"h":225,"b":242},"man-a2p2l3-idle":{"n":4,"h":226,"b":243},"man-a2p3-bad":{"n":4,"h":220,"b":242},"man-a2p3-drink":{"n":6,"h":233,"b":244},"man-a2p3-good":{"n":4,"h":223,"b":242},"man-a2p3l1-idle":{"n":4,"h":225,"b":242},"man-a2p3l2-idle":{"n":4,"h":228,"b":243},"man-a2p3l3-idle":{"n":4,"h":226,"b":243},"man-a3p1-bad":{"n":4,"h":223,"b":242},"man-a3p1-drink":{"n":6,"h":225,"b":244},"man-a3p1-good":{"n":4,"h":225,"b":241},"man-a3p1l1-idle":{"n":4,"h":230,"b":243},"man-a3p1l2-idle":{"n":4,"h":226,"b":243},"man-a3p1l3-idle":{"n":4,"h":230,"b":244},"man-a3p2-bad":{"n":4,"h":226,"b":244},"man-a3p2-drink":{"n":6,"h":232,"b":244},"man-a3p2-good":{"n":4,"h":218,"b":244},"man-a3p2l1-idle":{"n":4,"h":228,"b":244},"man-a3p2l2-idle":{"n":4,"h":228,"b":243},"man-a3p2l3-idle":{"n":4,"h":227,"b":242},"man-a3p3-bad":{"n":4,"h":233,"b":244},"man-a3p3-drink":{"n":6,"h":233,"b":244},"man-a3p3-good":{"n":4,"h":226,"b":244},"man-a3p3l1-idle":{"n":4,"h":225,"b":242},"man-a3p3l2-idle":{"n":4,"h":229,"b":244},"man-a3p3l3-idle":{"n":4,"h":234,"b":244},"man-a4p1-bad":{"n":4,"h":233,"b":244},"man-a4p1-drink":{"n":6,"h":232,"b":244},"man-a4p1-good":{"n":4,"h":216,"b":244},"man-a4p1l1-idle":{"n":4,"h":229,"b":244},"man-a4p1l2-idle":{"n":4,"h":222,"b":244},"man-a4p1l3-idle":{"n":4,"h":228,"b":243},"man-a4p2-bad":{"n":4,"h":233,"b":244},"man-a4p2-drink":{"n":6,"h":231,"b":243},"man-a4p2-good":{"n":4,"h":220,"b":239},"man-a4p2l1-idle":{"n":4,"h":228,"b":244},"man-a4p2l2-idle":{"n":4,"h":227,"b":243},"man-a4p2l3-idle":{"n":4,"h":231,"b":244},"man-a4p3-bad":{"n":4,"h":228,"b":244},"man-a4p3-drink":{"n":6,"h":232,"b":243},"man-a4p3-good":{"n":4,"h":227,"b":242},"man-a4p3l1-idle":{"n":4,"h":231,"b":244},"man-a4p3l2-idle":{"n":4,"h":230,"b":242},"man-a4p3l3-idle":{"n":4,"h":224,"b":242},"man-ride":{"n":6,"h":168,"b":214},"ui-button":{"w":305,"h":124,"box":[2,2,302,121]},"ui-dialog":{"w":1002,"h":304,"box":[2,2,999,301]},"ui-frame":{"w":256,"h":256,"box":[12,14,243,230]},"ui-icons":{"w":1024,"h":128,"box":[43,33,980,92]},"ui-name":{"w":276,"h":80,"box":[2,2,273,77]},"ui-option":{"w":258,"h":117,"box":[2,2,255,114]},"ui-tray":{"w":426,"h":219,"box":[2,2,423,216]}};
|
htlb/miniapp/dist-witch/witch.js
CHANGED
|
@@ -17,9 +17,25 @@
|
|
| 17 |
var AGE_MIN = 18, AGE0 = 22, AGE_MAX = 90, AGE_DOWN = 10; // 往老的方向:每 10 分老 1 岁;90 岁寿终
|
| 18 |
var Y_MIN = -(AGE_MAX - AGE0) * AGE_DOWN, S_MIN = -400;
|
| 19 |
function ageOf(y) { return y >= 0 ? AGE0 - y * (AGE0 - AGE_MIN) / SUB : AGE0 + (-y) / AGE_DOWN; }
|
| 20 |
-
|
| 21 |
-
var
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
function tier(v) { return v < -120 ? 1 : v < 220 ? 2 : 3; }
|
| 24 |
function ageGroup(a) { return a <= 20.5 ? 1 : a <= 32 ? 2 : a <= 55 ? 3 : 4; }
|
| 25 |
var MONEY = [
|
|
@@ -33,10 +49,16 @@
|
|
| 33 |
{ name: '传说', house: '私人岛屿上的地标豪宅', car: '布加迪 + 私人飞机', more: '资产是公司、基金、土地、品牌和股权' }
|
| 34 |
];
|
| 35 |
var CAR_W = [0.34, 0.36, 0.5, 0.52, 0.54, 0.54, 0.62, 0.62];
|
|
|
|
| 36 |
var ACH = [
|
| 37 |
-
['
|
| 38 |
-
['
|
| 39 |
-
['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
];
|
| 41 |
var TYPE_NAME = { tf: '判断题', two: '二选一', four: '单选题' };
|
| 42 |
var ICON = { ach: 0, stat: 1, share: 2, intro: 3, set: 4, exit: 5, forget: 6, time: 7 };
|
|
@@ -126,13 +148,16 @@
|
|
| 126 |
var self = this, m = SPR[name];
|
| 127 |
clearTimeout(this.timer);
|
| 128 |
if (!m) return Promise.resolve();
|
| 129 |
-
var fps = o.fps || 8,
|
|
|
|
|
|
|
|
|
|
| 130 |
return new Promise(function (res) {
|
| 131 |
(function step() {
|
| 132 |
-
self.frame(name, k);
|
| 133 |
-
if (o.onFrame) try { o.onFrame(k); } catch (e) {}
|
| 134 |
k++;
|
| 135 |
-
if (k >=
|
| 136 |
self.timer = setTimeout(step, 1000 / fps);
|
| 137 |
})();
|
| 138 |
});
|
|
@@ -175,7 +200,7 @@
|
|
| 175 |
'<div class="w2-tray" id="w2-tray"></div><div class="wt-fx" id="w2-fx"></div></div>' +
|
| 176 |
'<div class="w2-hud" id="w2-hud"></div><div class="w2-flash" id="w2-flash"></div>' +
|
| 177 |
'<div class="w2-dialog" id="w2-dialog"><div class="w2-name" id="w2-name"></div><div class="w2-text" id="w2-text"></div><div class="w2-extra" id="w2-extra"></div></div>' +
|
| 178 |
-
'<div class="w2-tools" id="w2-tools">' + tool('ach', '成就') + tool('
|
| 179 |
'<div class="wt-rotate"><b>请竖屏游玩</b><small>把手机竖过来,就能继续喝魔药</small></div>';
|
| 180 |
} });
|
| 181 |
G = { mode: 'lobby', busy: false, used: {}, queue: queue || [] };
|
|
@@ -189,7 +214,9 @@
|
|
| 189 |
else lobby();
|
| 190 |
});
|
| 191 |
}
|
| 192 |
-
|
|
|
|
|
|
|
| 193 |
function layout() {
|
| 194 |
var el = L.el, W = el.offsetWidth || 390, H = el.offsetHeight || 844;
|
| 195 |
var sc = Math.max(W / 720, H / 1280), ih = 1280 * sc, oy = (H - ih) / 2;
|
|
@@ -198,6 +225,7 @@
|
|
| 198 |
}
|
| 199 |
function heroT() { return Math.min(G.H * 0.22, G.W * 0.48); }
|
| 200 |
function alive() { return L && L.el.parentNode; }
|
|
|
|
| 201 |
function close() {
|
| 202 |
if (!L) return;
|
| 203 |
stopTimer(); if (G) { G.hero.stop(); G.witch.stop(); }
|
|
@@ -224,17 +252,61 @@
|
|
| 224 |
p.style.width = wpx * 1.08 + 'px'; p.style.left = (G.W * 0.7 - wpx * 0.54) + 'px'; p.style.bottom = (-wpx * 0.06) + 'px'; p.style.height = wpx * 0.16 + 'px';
|
| 225 |
}
|
| 226 |
function hero(name, fps, loop) { G.hero.T = heroT(); return G.hero.play(name, { fps: fps || 6, loop: loop }); }
|
| 227 |
-
function heroIdle() { return hero(heroKey() + '-idle',
|
| 228 |
-
function witchIdle() { return G.witch.play('witch-idle', { fps:
|
| 229 |
function showWitch(on) { $('#w2-witch', L.el).classList.toggle('gone', !on); if (!on) G.witch.stop(); }
|
| 230 |
|
| 231 |
-
/* ---------------- 状态栏 ---------------- */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
function refreshHud() {
|
| 233 |
if (!alive()) return;
|
| 234 |
-
var
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
'<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
}
|
| 239 |
|
| 240 |
/* ---------------- 对话框(逐字打出,点一下出下一句) ---------------- */
|
|
@@ -278,18 +350,18 @@
|
|
| 278 |
G.hero.T = heroT();
|
| 279 |
hero('man-ride', 9, true);
|
| 280 |
void he.offsetWidth; he.className = 'wt-actor hero ride go';
|
| 281 |
-
say(st.who, st.t, '<p class="w2-tap">
|
| 282 |
return;
|
| 283 |
}
|
| 284 |
if (st.book) {
|
| 285 |
$('#w2-hero', L.el).className = 'wt-actor hero';
|
| 286 |
-
G.hero.T = heroT(); hero('man-a2p2l2-idle',
|
| 287 |
var bk = $('#w2-book', L.el); bk.className = 'w2-book on'; bk.setAttribute('style', sprBg('witch-appear', 0));
|
| 288 |
-
say(st.who, st.t, '<p class="w2-tap blink">
|
| 289 |
G.busy = true; // 只能点书
|
| 290 |
return;
|
| 291 |
}
|
| 292 |
-
say(st.who, st.t, st.ready ? '' : '<p class="w2-tap">
|
| 293 |
if (st.ready) {
|
| 294 |
if (!S.intro) { S.intro = true; save(); }
|
| 295 |
tray([{ k: 0, label: '准备好了', v: 'go' }, { k: 1, label: '还没准备好', v: 'no' }]);
|
|
@@ -462,7 +534,7 @@
|
|
| 462 |
G.witch.play('witch-nod', { fps: 6 }).then(function () { if (alive()) witchIdle(); });
|
| 463 |
hero(ak + '-good', 7);
|
| 464 |
await fx('fx-good', 10);
|
| 465 |
-
S.today.right++; S.total.right++; S.combo++;
|
| 466 |
} else {
|
| 467 |
B.buzz('error'); shake();
|
| 468 |
G.witch.play('witch-laugh', { fps: 6 }).then(function () { if (alive()) witchIdle(); });
|
|
@@ -472,31 +544,34 @@
|
|
| 472 |
}
|
| 473 |
if (q.at === 'b') {
|
| 474 |
var r = Math.random(), sub = r < 0.4 ? 'y' : r < 0.7 ? 'phy' : 'look', a0 = age();
|
| 475 |
-
if (sub === 'y') { S.y = Math.max(Y_MIN, Math.min(SUB, S.y + delta)); var da = age() - a0; what = (da < 0 ? '年轻了 ' + (-da).toFixed(1) + ' 岁' : '老了 ' + da.toFixed(1) + ' 岁'); }
|
| 476 |
-
else if (sub === 'phy') { S.phy = Math.max(S_MIN, Math.min(SUB, S.phy + delta)); what = '身材 ' + (delta > 0 ? '+' : '−') + Math.abs(delta); }
|
| 477 |
-
else { S.look = Math.max(S_MIN, Math.min(SUB, S.look + delta)); what = '颜值 ' + (delta > 0 ? '+' : '−') + Math.abs(delta); }
|
| 478 |
-
} else { S.money = Math.max(0, Math.min(TOP, S.money + delta)); S.peak.m = Math.max(S.peak.m, S.money); what = '
|
| 479 |
var change = '';
|
| 480 |
if (heroKey() !== before.hero || moneyStage() !== before.ms) change = await transform(before);
|
| 481 |
-
checkAch(
|
| 482 |
if (age() >= AGE_MAX - 0.01) { S.dead = true; S.total.deaths++; S.ach.dead = S.ach.dead || Date.now(); }
|
| 483 |
-
save(); refreshHud();
|
| 484 |
if (!S.dead) heroIdle();
|
| 485 |
var over = !S.dead && S.wrong >= cap();
|
| 486 |
say('女巫', (ok ? '「喝对了!」' : timeout ? '「时间到,硬灌一杯!」' : '「哈哈,喝错了!」') + what + '。正确答案是「' + q.o[q.a] + '」。' + q.w,
|
| 487 |
-
(change ? '<p class="w2-change">' + change + '</p>' : '') + '<div class="w2-acts"><button class="w2-btn ghost" type="button" data-act="wt-orig" data-id="' + q.id + '">看原文</button>' +
|
| 488 |
-
(S.dead ? '<button class="w2-btn" type="button" data-act="wt-death">寿终了……</button>' : over ? '<button class="w2-btn" type="button" data-act="wt-cap">女巫有话说</button>' : '<button class="w2-btn" type="button" data-act="wt-next">
|
| 489 |
$('#w2-name', L.el).innerHTML = '女巫';
|
| 490 |
tray([]);
|
| 491 |
}
|
| 492 |
-
function checkAch(
|
| 493 |
-
var now = Date.now();
|
| 494 |
-
if (
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
|
|
|
|
|
|
|
|
|
| 500 |
S.peak.age = Math.min(S.peak.age, age());
|
| 501 |
}
|
| 502 |
async function transform(before) {
|
|
@@ -550,46 +625,55 @@
|
|
| 550 |
'<button class="w2-btn ghost wide" type="button" data-act="wt-forget">喝下「遗忘之药水」,重新投胎</button>');
|
| 551 |
}
|
| 552 |
function afterShare(why) {
|
|
|
|
| 553 |
if (why === 'revive') {
|
| 554 |
S.dead = false; S.y = 0; S.phy = 0; S.look = 0; S.total.revives++; S.ach.revive = S.ach.revive || Date.now();
|
| 555 |
B.toast('女巫挥了挥魔杖:你回到了 22 岁!');
|
| 556 |
if (alive()) $('#w2-hero', L.el).className = 'wt-actor hero';
|
| 557 |
-
} else { S.unlock++; B.toast('女巫又给你备好了 10 杯魔药'); }
|
| 558 |
save(true); B.buzz('success');
|
| 559 |
closePopup();
|
| 560 |
if (alive()) { refreshHud(); lobby(); }
|
| 561 |
}
|
| 562 |
|
| 563 |
-
/* ---------------- 弹窗(游戏风格) ---------------- */
|
| 564 |
-
function popup(title, body) {
|
| 565 |
closePopup();
|
| 566 |
-
var p = document.createElement('div'); p.className = 'w2-pop'; p.id = 'w2-pop';
|
| 567 |
-
|
|
|
|
| 568 |
L.el.appendChild(p);
|
| 569 |
}
|
| 570 |
-
function closePopup() { var p = L && $('#w2-pop', L.el); if (p) p.parentNode.removeChild(p); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 571 |
function toolTap(k) {
|
| 572 |
B.buzz('light');
|
| 573 |
-
if (k === 'exit') {
|
| 574 |
-
if (k === 'intro') { closePopup(); G.appeared = false; story(0); return; }
|
| 575 |
if (k === 'share') { share('note', ''); return; }
|
| 576 |
if (k === 'ach') {
|
| 577 |
var n = 0; ACH.forEach(function (a) { if (S.ach[a[0]]) n++; });
|
| 578 |
-
popup('
|
| 579 |
-
return;
|
| 580 |
-
}
|
| 581 |
-
if (k === 'stat') {
|
| 582 |
-
popup('战绩', '<dl class="w2-stats"><div><dt>今天喝对</dt><dd>' + S.today.right + ' 杯</dd></div><div><dt>今天喝错</dt><dd>' + S.today.wrong + ' 杯</dd></div><div><dt>累计喝对</dt><dd>' + S.total.right + ' 杯</dd></div><div><dt>累计喝错</dt><dd>' + S.total.wrong + ' 杯</dd></div>' +
|
| 583 |
-
'<div><dt>最年轻</dt><dd>' + (S.peak.age < 20 ? S.peak.age.toFixed(1) : Math.round(S.peak.age)) + ' 岁</dd></div><div><dt>最高金钱</dt><dd>' + Math.round(S.peak.m) + ' / ' + TOP + '</dd></div><div><dt>连续喝对</dt><dd>' + S.combo + ' 杯</dd></div><div><dt>寿终 / 复活</dt><dd>' + S.total.deaths + ' / ' + S.total.revives + '</dd></div></dl>');
|
| 584 |
return;
|
| 585 |
}
|
| 586 |
if (k === 'set') {
|
| 587 |
-
popup('游戏设置', '<
|
| 588 |
-
'<p class="w2-small">规则:身体题随机影响年龄、身材或颜值;喝对 + 难度分,喝错 − 2 × 难度分;身体每项满分约 ' + SUB + ',金钱满分 ' + TOP + ';90 岁寿终。</p>');
|
| 589 |
return;
|
| 590 |
}
|
| 591 |
}
|
| 592 |
-
function moneyPop() {
|
|
|
|
| 593 |
var M = MONEY[moneyStage()], next = moneyStage() < 7 ? Math.ceil((moneyStage() + 1) * UP - S.money) : 0;
|
| 594 |
popup('金钱 · ' + M.name, '<div class="w2-moneypop"><span style="background-image:url(' + DIR + 'house-' + moneyStage() + '.webp)"></span><span class="car" style="background-image:url(' + DIR + 'car-' + moneyStage() + '.webp)"></span></div>' +
|
| 595 |
'<p><b>住</b> ' + esc(M.house) + '</p><p><b>开</b> ' + esc(M.car) + '</p><p><b>财</b> ' + esc(M.more) + '</p><p class="w2-small">' + (next ? '再得 ' + next + ' 分升到「' + MONEY[moneyStage() + 1].name + '」' : '已经是传说状态') + '</p>');
|
|
@@ -604,20 +688,42 @@
|
|
| 604 |
function billCanvas() {
|
| 605 |
var cv = document.createElement('canvas'); cv.width = 1080; cv.height = 1440;
|
| 606 |
var g = cv.getContext('2d'), f = B.font, ms = moneyStage(), M = MONEY[ms];
|
| 607 |
-
|
| 608 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
var cm = SPR['car-' + ms];
|
| 610 |
-
if (cm) { var bx = cm.box, w =
|
| 611 |
-
drawSpr(g, heroKey() + '-idle',
|
| 612 |
-
|
| 613 |
-
g.
|
| 614 |
-
|
| 615 |
-
g.
|
| 616 |
-
g.
|
| 617 |
-
g.
|
| 618 |
-
g.
|
| 619 |
-
|
| 620 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 621 |
return cv;
|
| 622 |
}
|
| 623 |
function cardCanvas(q) {
|
|
@@ -692,6 +798,12 @@
|
|
| 692 |
case 'wt-death': death(); break;
|
| 693 |
case 'wt-share': share(el.getAttribute('data-k'), el.getAttribute('data-why') || ''); break;
|
| 694 |
case 'wt-tool': toolTap(el.getAttribute('data-k')); break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 695 |
case 'wt-money': moneyPop(); break;
|
| 696 |
case 'wt-orig': B.openDetail(el.getAttribute('data-id')); break;
|
| 697 |
case 'wt-popclose': closePopup(); if (el.getAttribute('data-then') === 'lobby') lobby(); break;
|
|
@@ -704,6 +816,7 @@
|
|
| 704 |
break;
|
| 705 |
}
|
| 706 |
}
|
|
|
|
| 707 |
// 对话框:剧情中点一下出下一句
|
| 708 |
document.addEventListener('click', function (e) {
|
| 709 |
if (!G || G.mode !== 'story' || !L) return;
|
|
@@ -715,7 +828,7 @@
|
|
| 715 |
window.__HTLB_WT__ = { act: act, open: open, landing: landing, hub: landing, _state: function () { return S; }, _g: function () { return G; } };
|
| 716 |
// 「女巫的魔药」版:冒险页与「去喝魔药」入口
|
| 717 |
if (STANDALONE) {
|
| 718 |
-
window.__HTLB_CH__ = { show: landing, act: function (a, el) {
|
| 719 |
if (a === 'ch-item') { var l = (BY_ADV[el.getAttribute('data-id')] || []).slice(); var tp; while ((tp = B.top())) B.close(tp); open(l); }
|
| 720 |
}, bankSize: function () { return ALL.length; } };
|
| 721 |
}
|
|
|
|
| 17 |
var AGE_MIN = 18, AGE0 = 22, AGE_MAX = 90, AGE_DOWN = 10; // 往老的方向:每 10 分老 1 岁;90 岁寿终
|
| 18 |
var Y_MIN = -(AGE_MAX - AGE0) * AGE_DOWN, S_MIN = -400;
|
| 19 |
function ageOf(y) { return y >= 0 ? AGE0 - y * (AGE0 - AGE_MIN) / SUB : AGE0 + (-y) / AGE_DOWN; }
|
| 20 |
+
// 7 级颜色(用户指定顺序):灰 → 白 → 蓝 → 紫 → 绿 → 金 → 红
|
| 21 |
+
var GRADE = [['灰', '#a3a7ad'], ['白', '#f4f1ea'], ['蓝', '#5aa9ff'], ['紫', '#c07bff'], ['绿', '#45d483'], ['金', '#ffc83d'], ['红', '#ff5a5a']];
|
| 22 |
+
var TH_S = [-250, -120, 80, 220, 400, 600], TH_Y = [-400, -150, 100, 250, 420, 600];
|
| 23 |
+
var PHY7 = ['皮包骨或虚胖,走两步就喘', '身材走样,腰酸背痛', '普普通通,有点驼背', '匀称挺拔,精神不错', '肌肉线条明显,肩宽腰窄', '比例完美,像运动员', '神级体魄,力量和耐力超乎常人'];
|
| 24 |
+
var LOOK7 = ['其貌不扬,满脸倦容', '憔悴,黑眼圈很重', '普普通通,扔进人群找不到', '清秀,越看越顺眼', '帅气,回头率很高', '惊为天人,像明星', '颜值封神,自带光环'];
|
| 25 |
+
var AGE7 = ['老态龙钟', '明显显老', '正当年', '青春焕发', '少年感十足', '逆龄生长', '青春永驻'];
|
| 26 |
+
function gradeOf(v, th) { for (var i = 0; i < th.length; i++) if (v < th[i]) return i; return th.length; }
|
| 27 |
+
function band(t, v) { return (t === LOOK7 ? LOOK7 : PHY7)[gradeOf(v, TH_S)]; }
|
| 28 |
+
var PHY = PHY7, LOOK = LOOK7;
|
| 29 |
+
function gPhy() { return gradeOf(S.phy, TH_S); }
|
| 30 |
+
function gLook() { return gradeOf(S.look, TH_S); }
|
| 31 |
+
function gAge() { return gradeOf(S.y, TH_Y); }
|
| 32 |
+
function gMoney() { return Math.min(6, moneyStage()); }
|
| 33 |
+
function gAll() { return Math.round((gPhy() + gLook() + gAge() + gMoney()) / 4); }
|
| 34 |
+
// 进度:当前等级内的位置与到下一级的差值
|
| 35 |
+
function prog(v, th, lo, hi) {
|
| 36 |
+
var g = gradeOf(v, th), a = g === 0 ? lo : th[g - 1], b = g >= th.length ? hi : th[g];
|
| 37 |
+
return { g: g, p: g >= th.length && v >= hi ? 1 : Math.max(0, Math.min(1, (v - a) / (b - a))), need: g >= th.length ? Math.max(0, Math.ceil(hi - v)) : Math.ceil(b - v), max: g >= th.length && v >= hi };
|
| 38 |
+
}
|
| 39 |
function tier(v) { return v < -120 ? 1 : v < 220 ? 2 : 3; }
|
| 40 |
function ageGroup(a) { return a <= 20.5 ? 1 : a <= 32 ? 2 : a <= 55 ? 3 : 4; }
|
| 41 |
var MONEY = [
|
|
|
|
| 49 |
{ name: '传说', house: '私人岛屿上的地标豪宅', car: '布加迪 + 私人飞机', more: '资产是公司、基金、土地、品牌和股权' }
|
| 50 |
];
|
| 51 |
var CAR_W = [0.34, 0.36, 0.5, 0.52, 0.54, 0.54, 0.62, 0.62];
|
| 52 |
+
// 成就(徽章):[id, 名称, 说明]
|
| 53 |
var ACH = [
|
| 54 |
+
['first', '初出茅庐', '喝下第一杯魔药'], ['r10', '小有心得', '累计喝对 10 杯'], ['r100', '魔药常客', '累计喝对 100 杯'], ['r500', '魔药大师', '累计喝对 500 杯'],
|
| 55 |
+
['c5', '五连胜', '连续喝对 5 杯'], ['c10', '十连胜', '连续喝对 10 杯'], ['c20', '二十连胜', '连续喝对 20 杯'],
|
| 56 |
+
['young', '返老还童', '看上去不到 20 岁'], ['ageR', '青春永驻', '年龄达到红色等级'], ['fit', '练出肌肉', '身材达到绿色等级'], ['phyR', '神级体魄', '身材达到红色等级'],
|
| 57 |
+
['hand', '颜值逆袭', '颜值达到绿色等级'], ['lookR', '颜值封神', '颜值达到红色等级'],
|
| 58 |
+
['m1', '第一笔应急金', '金钱达到「稳定」'], ['m2', '有房一族', '金钱达到「小康」,买下第一套房'], ['m4', '江景大平层', '金钱达到「富裕」'], ['m5', '跑车车主', '金钱达到「豪门」'], ['m7', '传说', '金钱达到「传说」,住上私人岛屿'],
|
| 59 |
+
['win', '人生赢家', '年龄、身材、颜值、财富都达到金色等级'],
|
| 60 |
+
['old', '被魔药催老', '看上去超过 30 岁'], ['dead', '寿终正寝', '活到 90 岁寿终一次'], ['revive', '起死回生', '晒人生账单复活'],
|
| 61 |
+
['bill', '晒出账单', '第一次晒人生账单'], ['unlock', '再来十杯', '喝错满 10 杯后晒账单解锁']
|
| 62 |
];
|
| 63 |
var TYPE_NAME = { tf: '判断题', two: '二选一', four: '单选题' };
|
| 64 |
var ICON = { ach: 0, stat: 1, share: 2, intro: 3, set: 4, exit: 5, forget: 6, time: 7 };
|
|
|
|
| 148 |
var self = this, m = SPR[name];
|
| 149 |
clearTimeout(this.timer);
|
| 150 |
if (!m) return Promise.resolve();
|
| 151 |
+
var fps = o.fps || 8, seq = [], i;
|
| 152 |
+
for (i = 0; i < m.n; i++) seq.push(i);
|
| 153 |
+
if (o.pingpong && m.n > 2) for (i = m.n - 2; i > 0; i--) seq.push(i); // 0 1 2 3 2 1 …,循环时不跳帧
|
| 154 |
+
var k = 0;
|
| 155 |
return new Promise(function (res) {
|
| 156 |
(function step() {
|
| 157 |
+
self.frame(name, seq[k]);
|
| 158 |
+
if (o.onFrame) try { o.onFrame(seq[k]); } catch (e) {}
|
| 159 |
k++;
|
| 160 |
+
if (k >= seq.length) { if (o.loop) k = 0; else { res(); return; } }
|
| 161 |
self.timer = setTimeout(step, 1000 / fps);
|
| 162 |
})();
|
| 163 |
});
|
|
|
|
| 200 |
'<div class="w2-tray" id="w2-tray"></div><div class="wt-fx" id="w2-fx"></div></div>' +
|
| 201 |
'<div class="w2-hud" id="w2-hud"></div><div class="w2-flash" id="w2-flash"></div>' +
|
| 202 |
'<div class="w2-dialog" id="w2-dialog"><div class="w2-name" id="w2-name"></div><div class="w2-text" id="w2-text"></div><div class="w2-extra" id="w2-extra"></div></div>' +
|
| 203 |
+
'<div class="w2-tools" id="w2-tools">' + tool('ach', '成就') + tool('share', '账单') + tool('set', '设置') + tool('exit', '退出') + '</div>' +
|
| 204 |
'<div class="wt-rotate"><b>请竖屏游玩</b><small>把手机竖过来,就能继续喝魔药</small></div>';
|
| 205 |
} });
|
| 206 |
G = { mode: 'lobby', busy: false, used: {}, queue: queue || [] };
|
|
|
|
| 214 |
else lobby();
|
| 215 |
});
|
| 216 |
}
|
| 217 |
+
var TOOL_ICON = { ach: 'icon-ach', share: 'icon-share', set: 'icon-set', exit: 'icon-exit' };
|
| 218 |
+
function toolIcon(k) { return SPR[TOOL_ICON[k]] ? '<i class="w2-ic one" style="background-image:url(' + DIR + TOOL_ICON[k] + '.webp)"></i>' : uiIcon(ICON[k]); }
|
| 219 |
+
function tool(k, label) { return '<button class="w2-tool" type="button" data-act="wt-tool" data-k="' + k + '">' + toolIcon(k) + '<span>' + label + '</span></button>'; }
|
| 220 |
function layout() {
|
| 221 |
var el = L.el, W = el.offsetWidth || 390, H = el.offsetHeight || 844;
|
| 222 |
var sc = Math.max(W / 720, H / 1280), ih = 1280 * sc, oy = (H - ih) / 2;
|
|
|
|
| 225 |
}
|
| 226 |
function heroT() { return Math.min(G.H * 0.22, G.W * 0.48); }
|
| 227 |
function alive() { return L && L.el.parentNode; }
|
| 228 |
+
function exitHome() { close(); if (B.tab() !== 'today' && B.go) B.go('today'); window.scrollTo(0, 0); }
|
| 229 |
function close() {
|
| 230 |
if (!L) return;
|
| 231 |
stopTimer(); if (G) { G.hero.stop(); G.witch.stop(); }
|
|
|
|
| 252 |
p.style.width = wpx * 1.08 + 'px'; p.style.left = (G.W * 0.7 - wpx * 0.54) + 'px'; p.style.bottom = (-wpx * 0.06) + 'px'; p.style.height = wpx * 0.16 + 'px';
|
| 253 |
}
|
| 254 |
function hero(name, fps, loop) { G.hero.T = heroT(); return G.hero.play(name, { fps: fps || 6, loop: loop }); }
|
| 255 |
+
function heroIdle() { G.hero.T = heroT(); return G.hero.play(heroKey() + '-idle', { fps: 4, loop: true, pingpong: true }); }
|
| 256 |
+
function witchIdle() { return G.witch.play('witch-idle', { fps: 4, loop: true, pingpong: true }); }
|
| 257 |
function showWitch(on) { $('#w2-witch', L.el).classList.toggle('gone', !on); if (!on) G.witch.stop(); }
|
| 258 |
|
| 259 |
+
/* ---------------- 状态栏:头像(点开属性面板)+ 四条「到下一级」进度条 ---------------- */
|
| 260 |
+
var STAT_ICON = { age: 'icon-age', phy: 'icon-body', look: 'icon-look', money: 'icon-wealth', house: 'icon-house', car: 'icon-car' };
|
| 261 |
+
var STAT_TXT = { age: '龄', phy: '身', look: '颜', money: '财', house: '房', car: '车' };
|
| 262 |
+
function statIcon(k) { return SPR[STAT_ICON[k]] ? '<i class="w2-si" style="background-image:url(' + DIR + STAT_ICON[k] + '.webp)"></i>' : '<i class="w2-si t">' + STAT_TXT[k] + '</i>'; }
|
| 263 |
+
function frameUrl() { var k = 'ui-frame-' + (gAll() + 1); return DIR + (SPR[k] ? k : 'ui-frame') + '.webp'; }
|
| 264 |
+
function bars() {
|
| 265 |
+
var ms = moneyStage();
|
| 266 |
+
return [
|
| 267 |
+
['age', '年龄', prog(S.y, TH_Y, Y_MIN, SUB), ageTxt() + ' 岁'],
|
| 268 |
+
['phy', '身材', prog(S.phy, TH_S, S_MIN, SUB), ''],
|
| 269 |
+
['look', '颜值', prog(S.look, TH_S, S_MIN, SUB), ''],
|
| 270 |
+
['money', '财富', ms >= 7 ? { g: 6, p: 1, need: 0, max: true } : { g: gMoney(), p: (S.money - ms * UP) / UP, need: Math.ceil((ms + 1) * UP - S.money) }, MONEY[ms].name]
|
| 271 |
+
];
|
| 272 |
+
}
|
| 273 |
function refreshHud() {
|
| 274 |
if (!alive()) return;
|
| 275 |
+
var h = '<button class="w2-me" type="button" data-act="wt-panel" aria-label="查看角色属性"><span class="w2-face g' + gAll() + '" style="background-image:url(' + DIR + faceKey() + '.webp)"><i style="background-image:url(' + frameUrl() + ')"></i></span><b class="w2-age">我</b></button><div class="w2-bars">';
|
| 276 |
+
bars().forEach(function (r) {
|
| 277 |
+
var c = GRADE[r[2].g][1];
|
| 278 |
+
h += '<div class="w2-bar" id="w2-bar-' + r[0] + '">' + statIcon(r[0]) + '<span class="w2-bl">' + r[1] + '</span><span class="w2-track"><i style="width:' + Math.round(r[2].p * 100) + '%;background:' + c + '"></i></span>' +
|
| 279 |
+
'<small style="color:' + c + '">' + (r[2].max ? '满级' : (r[3] ? r[3] + ' · ' : '') + '差 ' + r[2].need) + '</small></div>';
|
| 280 |
+
});
|
| 281 |
+
$('#w2-hud', L.el).innerHTML = h + '</div>';
|
| 282 |
+
}
|
| 283 |
+
// 加减分动画:在对应进度条旁飘出数字
|
| 284 |
+
function bump(k, delta) {
|
| 285 |
+
if (!alive() || !delta) return;
|
| 286 |
+
var row = $('#w2-bar-' + k, L.el); if (!row) return;
|
| 287 |
+
var f = document.createElement('b'); f.className = 'w2-bump ' + (delta > 0 ? 'up' : 'down'); f.textContent = (delta > 0 ? '+' : '−') + Math.abs(delta);
|
| 288 |
+
row.appendChild(f); row.classList.add(delta > 0 ? 'hit-up' : 'hit-down');
|
| 289 |
+
setTimeout(function () { f.parentNode && f.parentNode.removeChild(f); row.classList.remove('hit-up', 'hit-down'); }, 1500);
|
| 290 |
+
}
|
| 291 |
+
// 角色属性面板:上方全身 + 房子背景 + 座驾;下方带等级颜色的文字;并入战绩
|
| 292 |
+
function panel() {
|
| 293 |
+
if (!alive()) return;
|
| 294 |
+
B.buzz('light');
|
| 295 |
+
var ms = moneyStage(), M = MONEY[ms], gm = GRADE[gMoney()][1];
|
| 296 |
+
var rows = [
|
| 297 |
+
['age', '年龄', ageTxt() + ' 岁 · ' + AGE7[gAge()], gAge()],
|
| 298 |
+
['phy', '身材', PHY7[gPhy()], gPhy()],
|
| 299 |
+
['look', '颜值', LOOK7[gLook()], gLook()],
|
| 300 |
+
['money', '财富', M.more, gMoney()],
|
| 301 |
+
['house', '房子', M.house, gMoney()],
|
| 302 |
+
['car', '车子', M.car, gMoney()]
|
| 303 |
+
];
|
| 304 |
+
popup('角色属性 · 综合 <em style="color:' + GRADE[gAll()][1] + '">' + GRADE[gAll()][0] + '</em>', '<div class="w2-pscene" id="w2-pscene" style="background-image:url(' + DIR + 'house-' + ms + '.webp)"><div class="w2-pcar" style="background-image:url(' + DIR + 'car-' + ms + '.webp)"></div><div class="wt-actor" id="w2-phero"></div></div>' +
|
| 305 |
+
'<div class="w2-attrs">' + rows.map(function (r) { return '<p>' + statIcon(r[0]) + '<b>' + r[1] + '</b><span style="color:' + GRADE[r[3]][1] + '">' + esc(r[2]) + '</span></p>'; }).join('') + '</div>' +
|
| 306 |
+
'<div class="w2-subcap">战绩</div><dl class="w2-stats"><div><dt>今天喝对</dt><dd>' + S.today.right + ' 杯</dd></div><div><dt>今天喝错</dt><dd>' + S.today.wrong + ' 杯</dd></div><div><dt>累计喝对</dt><dd>' + S.total.right + ' 杯</dd></div><div><dt>累计喝错</dt><dd>' + S.total.wrong + ' 杯</dd></div>' +
|
| 307 |
+
'<div><dt>连续喝对</dt><dd>' + S.combo + ' 杯</dd></div><div><dt>最年轻</dt><dd>' + (S.peak.age < 20 ? S.peak.age.toFixed(1) : Math.round(S.peak.age)) + ' 岁</dd></div><div><dt>最高金钱</dt><dd>' + Math.round(S.peak.m) + '</dd></div><div><dt>寿终 / 复活</dt><dd>' + S.total.deaths + ' / ' + S.total.revives + '</dd></div></dl>', 'panel');
|
| 308 |
+
var ph = $('#w2-phero', L.el);
|
| 309 |
+
if (ph) { var sc = $('#w2-pscene', L.el), a = new Actor(ph, '', (sc.offsetHeight || 200) * 0.62); G.panelA = a; a.play(heroKey() + '-idle', { fps: 4, loop: true, pingpong: true }); }
|
| 310 |
}
|
| 311 |
|
| 312 |
/* ---------------- 对话框(逐字打出,点一下出下一句) ---------------- */
|
|
|
|
| 350 |
G.hero.T = heroT();
|
| 351 |
hero('man-ride', 9, true);
|
| 352 |
void he.offsetWidth; he.className = 'wt-actor hero ride go';
|
| 353 |
+
say(st.who, st.t, '<p class="w2-tap">继续 ▼</p>' + (S.intro ? '<button class="w2-skip" type="button" data-act="wt-skip">跳过开场 ››</button>' : ''));
|
| 354 |
return;
|
| 355 |
}
|
| 356 |
if (st.book) {
|
| 357 |
$('#w2-hero', L.el).className = 'wt-actor hero';
|
| 358 |
+
G.hero.T = heroT(); G.hero.play('man-a2p2l2-idle', { fps: 4, loop: true, pingpong: true });
|
| 359 |
var bk = $('#w2-book', L.el); bk.className = 'w2-book on'; bk.setAttribute('style', sprBg('witch-appear', 0));
|
| 360 |
+
say(st.who, st.t, '<p class="w2-tap blink">点一下路上那本书</p>');
|
| 361 |
G.busy = true; // 只能点书
|
| 362 |
return;
|
| 363 |
}
|
| 364 |
+
say(st.who, st.t, st.ready ? '' : '<p class="w2-tap">继续 ▼</p>' + (S.intro ? '<button class="w2-skip" type="button" data-act="wt-skip">跳过开场 ››</button>' : ''));
|
| 365 |
if (st.ready) {
|
| 366 |
if (!S.intro) { S.intro = true; save(); }
|
| 367 |
tray([{ k: 0, label: '准备好了', v: 'go' }, { k: 1, label: '还没准备好', v: 'no' }]);
|
|
|
|
| 534 |
G.witch.play('witch-nod', { fps: 6 }).then(function () { if (alive()) witchIdle(); });
|
| 535 |
hero(ak + '-good', 7);
|
| 536 |
await fx('fx-good', 10);
|
| 537 |
+
S.today.right++; S.total.right++; S.combo++;
|
| 538 |
} else {
|
| 539 |
B.buzz('error'); shake();
|
| 540 |
G.witch.play('witch-laugh', { fps: 6 }).then(function () { if (alive()) witchIdle(); });
|
|
|
|
| 544 |
}
|
| 545 |
if (q.at === 'b') {
|
| 546 |
var r = Math.random(), sub = r < 0.4 ? 'y' : r < 0.7 ? 'phy' : 'look', a0 = age();
|
| 547 |
+
if (sub === 'y') { S.y = Math.max(Y_MIN, Math.min(SUB, S.y + delta)); var da = age() - a0; what = (da < 0 ? '年轻了 ' + (-da).toFixed(1) + ' 岁' : '老了 ' + da.toFixed(1) + ' 岁'); G.bump = ['age', delta]; }
|
| 548 |
+
else if (sub === 'phy') { S.phy = Math.max(S_MIN, Math.min(SUB, S.phy + delta)); what = '身材 ' + (delta > 0 ? '+' : '−') + Math.abs(delta); G.bump = ['phy', delta]; }
|
| 549 |
+
else { S.look = Math.max(S_MIN, Math.min(SUB, S.look + delta)); what = '颜值 ' + (delta > 0 ? '+' : '−') + Math.abs(delta); G.bump = ['look', delta]; }
|
| 550 |
+
} else { S.money = Math.max(0, Math.min(TOP, S.money + delta)); S.peak.m = Math.max(S.peak.m, S.money); what = '财富 ' + (delta > 0 ? '+' : '−') + Math.abs(delta); G.bump = ['money', delta]; }
|
| 551 |
var change = '';
|
| 552 |
if (heroKey() !== before.hero || moneyStage() !== before.ms) change = await transform(before);
|
| 553 |
+
checkAch();
|
| 554 |
if (age() >= AGE_MAX - 0.01) { S.dead = true; S.total.deaths++; S.ach.dead = S.ach.dead || Date.now(); }
|
| 555 |
+
save(); refreshHud(); if (G.bump) { bump(G.bump[0], G.bump[1]); G.bump = null; }
|
| 556 |
if (!S.dead) heroIdle();
|
| 557 |
var over = !S.dead && S.wrong >= cap();
|
| 558 |
say('女巫', (ok ? '「喝对了!」' : timeout ? '「时间到,硬灌一杯!」' : '「哈哈,喝错了!」') + what + '。正确答案是「' + q.o[q.a] + '」。' + q.w,
|
| 559 |
+
(change ? '<p class="w2-change">' + change + '</p>' : '') + '<div class="w2-acts"><button class="w2-btn ghost orig" type="button" data-act="wt-orig" data-id="' + q.id + '">' + (SPR['icon-book'] ? '<i class="w2-ic one" style="background-image:url(' + DIR + 'icon-book.webp)"></i>' : '') + '看原文</button>' +
|
| 560 |
+
(S.dead ? '<button class="w2-btn" type="button" data-act="wt-death">寿终了……</button>' : over ? '<button class="w2-btn" type="button" data-act="wt-cap">女巫有话说</button>' : '<button class="w2-btn" type="button" data-act="wt-next">继续挑战</button>') + '</div>');
|
| 561 |
$('#w2-name', L.el).innerHTML = '女巫';
|
| 562 |
tray([]);
|
| 563 |
}
|
| 564 |
+
function checkAch() {
|
| 565 |
+
var now = Date.now(), ms = moneyStage(), A = S.ach;
|
| 566 |
+
function got(k, c) { if (c && !A[k]) { A[k] = now; if (alive()) B.toast('获得成就:' + ACH.filter(function (a) { return a[0] === k; })[0][1]); } }
|
| 567 |
+
got('first', S.total.right + S.total.wrong > 0);
|
| 568 |
+
got('r10', S.total.right >= 10); got('r100', S.total.right >= 100); got('r500', S.total.right >= 500);
|
| 569 |
+
got('c5', S.combo >= 5); got('c10', S.combo >= 10); got('c20', S.combo >= 20);
|
| 570 |
+
got('young', age() < 20); got('ageR', gAge() >= 6);
|
| 571 |
+
got('fit', gPhy() >= 4); got('phyR', gPhy() >= 6); got('hand', gLook() >= 4); got('lookR', gLook() >= 6);
|
| 572 |
+
got('m1', ms >= 1); got('m2', ms >= 2); got('m4', ms >= 4); got('m5', ms >= 5); got('m7', ms >= 7);
|
| 573 |
+
got('win', gAge() >= 5 && gPhy() >= 5 && gLook() >= 5 && gMoney() >= 5);
|
| 574 |
+
got('old', age() > 30);
|
| 575 |
S.peak.age = Math.min(S.peak.age, age());
|
| 576 |
}
|
| 577 |
async function transform(before) {
|
|
|
|
| 625 |
'<button class="w2-btn ghost wide" type="button" data-act="wt-forget">喝下「遗忘之药水」,重新投胎</button>');
|
| 626 |
}
|
| 627 |
function afterShare(why) {
|
| 628 |
+
S.ach.bill = S.ach.bill || Date.now();
|
| 629 |
if (why === 'revive') {
|
| 630 |
S.dead = false; S.y = 0; S.phy = 0; S.look = 0; S.total.revives++; S.ach.revive = S.ach.revive || Date.now();
|
| 631 |
B.toast('女巫挥了挥魔杖:你回到了 22 岁!');
|
| 632 |
if (alive()) $('#w2-hero', L.el).className = 'wt-actor hero';
|
| 633 |
+
} else { S.unlock++; S.ach.unlock = S.ach.unlock || Date.now(); B.toast('女巫又给你备好了 10 杯魔药'); }
|
| 634 |
save(true); B.buzz('success');
|
| 635 |
closePopup();
|
| 636 |
if (alive()) { refreshHud(); lobby(); }
|
| 637 |
}
|
| 638 |
|
| 639 |
+
/* ---------------- 弹窗(游戏风格;点空白处关闭) ---------------- */
|
| 640 |
+
function popup(title, body, cls) {
|
| 641 |
closePopup();
|
| 642 |
+
var p = document.createElement('div'); p.className = 'w2-pop' + (cls ? ' ' + cls : ''); p.id = 'w2-pop';
|
| 643 |
+
var x = SPR['ui-close'] ? '<i style="background-image:url(' + DIR + 'ui-close.webp)"></i>' : '✕';
|
| 644 |
+
p.innerHTML = '<div class="w2-pop-box rise"><div class="w2-title">' + title + '</div><div class="w2-pop-body">' + body + '</div><button class="w2-pop-x" type="button" data-act="wt-popclose" aria-label="关闭">' + x + '</button></div>';
|
| 645 |
L.el.appendChild(p);
|
| 646 |
}
|
| 647 |
+
function closePopup() { var p = L && $('#w2-pop', L.el); if (p) p.parentNode.removeChild(p); if (G && G.panelA) { G.panelA.stop(); G.panelA = null; } }
|
| 648 |
+
function badge(a, got) {
|
| 649 |
+
var art = SPR['badge-' + a[0]] ? '<i style="background-image:url(' + DIR + 'badge-' + a[0] + '.webp)"></i>' : '<i class="t">' + a[1].slice(0, 1) + '</i>';
|
| 650 |
+
return '<button class="w2-badge' + (got ? ' got' : '') + '" type="button" data-act="wt-badge" data-id="' + a[0] + '">' + art + '<span>' + a[1] + '</span></button>';
|
| 651 |
+
}
|
| 652 |
+
var RULES = '<div class="w2-rules">' +
|
| 653 |
+
'<h4>怎么玩</h4><p>女巫每次出一道题,选项有几个,托盘上就有几杯魔药。15 秒内选一杯喝下:喝对加分,喝错扣分,超时算喝错。题目全部来自《高性价比人生指南》的 765 条建议。</p>' +
|
| 654 |
+
'<h4>四项属性</h4><p><b>年龄、身材、颜值</b>属于身体:身体类的题,喝对喝错会随机影响其中一项。<b>财富</b>对应金钱类的题,决定你住什么房子、开什么车。</p>' +
|
| 655 |
+
'<h4>加减分</h4><p>喝对 + 题目难度分(1–8);喝错 − 2 × 难度分。题目难度由决策模型离线评定,属性越高,女巫出的题越难。</p>' +
|
| 656 |
+
'<h4>等级颜色</h4><p>每项属性分 7 级:<span style="color:#a3a7ad">灰</span> → <span style="color:#f4f1ea;background:#555;padding:0 3px;border-radius:3px">白</span> → <span style="color:#5aa9ff">蓝</span> → <span style="color:#c07bff">紫</span> → <span style="color:#45d483">绿</span> → <span style="color:#ffc83d">金</span> → <span style="color:#ff5a5a">红</span>。右上角进度条显示每项离下一级还差多少分;头像框随综合等级越来越华丽。</p>' +
|
| 657 |
+
'<h4>年龄</h4><p>开局 22 岁,最年轻 18 岁。往老的方向每 10 分老 1 岁,<b>到 90 岁寿终</b>。老了以后多喝对,也能变回年轻。</p>' +
|
| 658 |
+
'<h4>财富</h4><p>8 个阶段:生存 → 稳定 → 小康 → 中产 → 富裕 → 豪门 → 顶��富豪 → 传说,满分 2000,每阶约 286 分。</p>' +
|
| 659 |
+
'<h4>每天的限制</h4><p>每天最多喝错 10 杯。超过后,晒一下人生账单(发图文、做成图集或发评论)可以再喝 10 杯,不限次数;也可以第二天再来。</p>' +
|
| 660 |
+
'<h4>寿终</h4><p>晒人生账单可以复活:回到 22 岁,身材、颜值回到普通,财富保留。也可以喝下遗忘之药水,全部清零重来。</p></div>';
|
| 661 |
function toolTap(k) {
|
| 662 |
B.buzz('light');
|
| 663 |
+
if (k === 'exit') { exitHome(); return; }
|
|
|
|
| 664 |
if (k === 'share') { share('note', ''); return; }
|
| 665 |
if (k === 'ach') {
|
| 666 |
var n = 0; ACH.forEach(function (a) { if (S.ach[a[0]]) n++; });
|
| 667 |
+
popup('成就徽章 ' + n + ' / ' + ACH.length, '<div class="w2-badges">' + ACH.map(function (a) { return badge(a, S.ach[a[0]]); }).join('') + '</div><p class="w2-small" id="w2-badge-tip">点徽章查看获得条件</p>');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 668 |
return;
|
| 669 |
}
|
| 670 |
if (k === 'set') {
|
| 671 |
+
popup('游戏设置', '<div class="w2-setbtns"><button class="w2-btn" type="button" data-act="wt-replay">重看开场剧情</button><button class="w2-btn danger" type="button" data-act="wt-forget">喝下「遗忘之药水」(全部清零)</button></div>' + RULES);
|
|
|
|
| 672 |
return;
|
| 673 |
}
|
| 674 |
}
|
| 675 |
+
function moneyPop() { panel(); }
|
| 676 |
+
function moneyPopOld() {
|
| 677 |
var M = MONEY[moneyStage()], next = moneyStage() < 7 ? Math.ceil((moneyStage() + 1) * UP - S.money) : 0;
|
| 678 |
popup('金钱 · ' + M.name, '<div class="w2-moneypop"><span style="background-image:url(' + DIR + 'house-' + moneyStage() + '.webp)"></span><span class="car" style="background-image:url(' + DIR + 'car-' + moneyStage() + '.webp)"></span></div>' +
|
| 679 |
'<p><b>住</b> ' + esc(M.house) + '</p><p><b>开</b> ' + esc(M.car) + '</p><p><b>财</b> ' + esc(M.more) + '</p><p class="w2-small">' + (next ? '再得 ' + next + ' 分升到「' + MONEY[moneyStage() + 1].name + '」' : '已经是传说状态') + '</p>');
|
|
|
|
| 688 |
function billCanvas() {
|
| 689 |
var cv = document.createElement('canvas'); cv.width = 1080; cv.height = 1440;
|
| 690 |
var g = cv.getContext('2d'), f = B.font, ms = moneyStage(), M = MONEY[ms];
|
| 691 |
+
// 背景:深紫渐变 + 星点(纯绘制,任何环境都不会空白)
|
| 692 |
+
var bg = g.createLinearGradient(0, 0, 0, 1440); bg.addColorStop(0, '#3a2552'); bg.addColorStop(1, '#130c1c');
|
| 693 |
+
g.fillStyle = bg; g.fillRect(0, 0, 1080, 1440);
|
| 694 |
+
var rnd = B.rng(B.hash('bill' + S.day));
|
| 695 |
+
for (var i = 0; i < 90; i++) { g.fillStyle = 'rgba(255,229,138,' + (0.15 + rnd() * 0.5) + ')'; g.beginPath(); g.arc(rnd() * 1080, rnd() * 1440, 1 + rnd() * 2.5, 0, 6.3); g.fill(); }
|
| 696 |
+
B.sticker(g, 64, 50, '女巫的魔药 · 人生账单', { size: 34, bg: '#7b3fb0', fg: '#FFFFFF', rot: -4 });
|
| 697 |
+
g.textAlign = 'right'; g.fillStyle = 'rgba(255,255,255,.7)'; g.font = f(700, 28, 'Menlo, monospace'); g.fillText(B.today().dot, 1016, 96); g.textAlign = 'left';
|
| 698 |
+
// 画面卡片:房子 + 主角 + 座驾(容器允许时才有图)
|
| 699 |
+
g.save(); B.rr(g, 64, 150, 952, 600, 34); g.clip();
|
| 700 |
+
var sky = g.createLinearGradient(0, 150, 0, 750); sky.addColorStop(0, '#6d4ea0'); sky.addColorStop(1, '#2d1f45'); g.fillStyle = sky; g.fillRect(64, 150, 952, 600);
|
| 701 |
+
drawImg(g, 'house-' + ms, 0, 200, 720, 640, 64, 150, 952, 846);
|
| 702 |
var cm = SPR['car-' + ms];
|
| 703 |
+
if (cm) { var bx = cm.box, w = 952 * CAR_W[ms] * 0.85, sc = w / (bx[2] - bx[0]); drawImg(g, 'car-' + ms, 0, 0, 480, 320, 760 - (bx[0] + (bx[2] - bx[0]) / 2) * sc, 715 - bx[3] * sc, 768 * sc, 512 * sc); }
|
| 704 |
+
drawSpr(g, heroKey() + '-idle', 330, 725, 430);
|
| 705 |
+
g.restore();
|
| 706 |
+
g.strokeStyle = GRADE[gAll()][1]; g.lineWidth = 6; B.rr(g, 64, 150, 952, 600, 34); g.stroke();
|
| 707 |
+
// 头像 + 综合等级
|
| 708 |
+
g.save(); g.beginPath(); g.arc(150, 830, 70, 0, 6.3); g.fillStyle = '#f3d7c0'; g.fill(); g.clip(); drawImg(g, faceKey(), 0, 0, 160, 160, 80, 760, 140, 140); g.restore();
|
| 709 |
+
g.strokeStyle = GRADE[gAll()][1]; g.lineWidth = 8; g.beginPath(); g.arc(150, 830, 72, 0, 6.3); g.stroke();
|
| 710 |
+
g.fillStyle = '#fff'; g.font = f(900, 48); g.fillText('我', 250, 820);
|
| 711 |
+
g.font = f(800, 30); g.fillStyle = GRADE[gAll()][1]; g.fillText('综合等级 · ' + GRADE[gAll()][0], 250, 868);
|
| 712 |
+
// 属性:带等级颜色
|
| 713 |
+
var rows = [['年龄', ageTxt() + ' 岁 · ' + AGE7[gAge()], gAge(), prog(S.y, TH_Y, Y_MIN, SUB).p], ['身材', PHY7[gPhy()], gPhy(), prog(S.phy, TH_S, S_MIN, SUB).p], ['颜值', LOOK7[gLook()], gLook(), prog(S.look, TH_S, S_MIN, SUB).p],
|
| 714 |
+
['财富', M.name + ' · ' + M.more, gMoney(), ms >= 7 ? 1 : (S.money - ms * UP) / UP], ['房子', M.house, gMoney(), -1], ['车子', M.car, gMoney(), -1]];
|
| 715 |
+
rows.forEach(function (r, k) {
|
| 716 |
+
var y = 950 + k * 62, c = GRADE[r[2]][1];
|
| 717 |
+
g.fillStyle = 'rgba(255,255,255,.08)'; B.rr(g, 64, y - 42, 952, 54, 14); g.fill();
|
| 718 |
+
g.fillStyle = c; g.beginPath(); g.arc(100, y - 15, 9, 0, 6.3); g.fill();
|
| 719 |
+
g.font = f(900, 28); g.fillStyle = 'rgba(255,255,255,.75)'; g.fillText(r[0], 124, y - 4);
|
| 720 |
+
g.font = f(800, 28); g.fillStyle = c; g.fillText(B.clip(g, B.wrap(g, r[1], r[3] >= 0 ? 560 : 820), 1, r[3] >= 0 ? 560 : 820)[0], 210, y - 4);
|
| 721 |
+
if (r[3] >= 0) { g.fillStyle = 'rgba(255,255,255,.15)'; B.rr(g, 800, y - 24, 190, 14, 7); g.fill(); g.fillStyle = c; B.rr(g, 800, y - 24, Math.max(8, 190 * r[3]), 14, 7); g.fill(); }
|
| 722 |
+
});
|
| 723 |
+
g.font = f(700, 28); g.fillStyle = 'rgba(255,255,255,.82)';
|
| 724 |
+
g.fillText('今天喝对 ' + S.today.right + ' 杯 · 喝错 ' + S.today.wrong + ' 杯 · 累计喝对 ' + S.total.right + ' 杯', 64, 1340);
|
| 725 |
+
g.fillStyle = 'rgba(255,255,255,.55)'; g.font = f(700, 22);
|
| 726 |
+
g.fillText('高性价比人生 · 魔药题目出自《高性价比人生指南》CC BY 4.0 · github.com/eternity4719/HowToLiveBetter', 64, 1400);
|
| 727 |
return cv;
|
| 728 |
}
|
| 729 |
function cardCanvas(q) {
|
|
|
|
| 798 |
case 'wt-death': death(); break;
|
| 799 |
case 'wt-share': share(el.getAttribute('data-k'), el.getAttribute('data-why') || ''); break;
|
| 800 |
case 'wt-tool': toolTap(el.getAttribute('data-k')); break;
|
| 801 |
+
case 'wt-panel': panel(); break;
|
| 802 |
+
case 'wt-replay': closePopup(); G.appeared = false; story(0); break;
|
| 803 |
+
case 'wt-badge':
|
| 804 |
+
var aa = ACH.filter(function (x) { return x[0] === el.getAttribute('data-id'); })[0], tip = $('#w2-badge-tip', L.el);
|
| 805 |
+
if (aa && tip) { var gt = S.ach[aa[0]]; tip.innerHTML = '<b>' + aa[1] + '</b>:' + aa[2] + (gt ? '(' + new Date(gt).toLocaleDateString() + ' 获得)' : '(未获得)'); B.buzz('light'); }
|
| 806 |
+
break;
|
| 807 |
case 'wt-money': moneyPop(); break;
|
| 808 |
case 'wt-orig': B.openDetail(el.getAttribute('data-id')); break;
|
| 809 |
case 'wt-popclose': closePopup(); if (el.getAttribute('data-then') === 'lobby') lobby(); break;
|
|
|
|
| 816 |
break;
|
| 817 |
}
|
| 818 |
}
|
| 819 |
+
document.addEventListener('click', function (e) { if (L && e.target && e.target.id === 'w2-pop') closePopup(); });
|
| 820 |
// 对话框:剧情中点一下出下一句
|
| 821 |
document.addEventListener('click', function (e) {
|
| 822 |
if (!G || G.mode !== 'story' || !L) return;
|
|
|
|
| 828 |
window.__HTLB_WT__ = { act: act, open: open, landing: landing, hub: landing, _state: function () { return S; }, _g: function () { return G; } };
|
| 829 |
// 「女巫的魔药」版:冒险页与「去喝魔药」入口
|
| 830 |
if (STANDALONE) {
|
| 831 |
+
window.__HTLB_CH__ = { show: function () { landing(); if (!L) open(); }, act: function (a, el) {
|
| 832 |
if (a === 'ch-item') { var l = (BY_ADV[el.getAttribute('data-id')] || []).slice(); var tp; while ((tp = B.top())) B.close(tp); open(l); }
|
| 833 |
}, bankSize: function () { return ALL.length; } };
|
| 834 |
}
|
htlb/miniapp/dist-witch/witch/man-a1p1-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p1-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p1-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p1l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p1l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p1l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p2l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p3-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p3-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p3-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a1p3l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p1l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p2l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a2p3l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1l1-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1l2-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p1l3-idle.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p2-bad.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p2-drink.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
htlb/miniapp/dist-witch/witch/man-a3p2-good.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|