Greater Rift: two Guardians from level 75, overtime status spelled out (#33); item descriptions stay open on touch (#32); Mac: click monsters to attack, items take the mouse, Share Log

The overtime status (#33) was reported with a clear direction by Joe Hu, who also sent a patch along the same lines (#34).

Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
jhaizhou
2026-10-14 10:34:48 +08:00
co-authored by Joe Hu
parent dc3cc22b9b
commit 2e7177c080
25 changed files with 364 additions and 57 deletions
+11
View File
@@ -40,6 +40,17 @@ int main(void) {
for (int i = 0; i < hn; i++) { long long got = hp_base_limit(hc[i].base, hc[i].full), tot = hc[i].base > 0 ? got * hc[i].full / hc[i].base : got;
if (got != hc[i].want || (hc[i].full > hc[i].base && hc[i].base > 0 && tot > 2147483392LL)) { fails++; printf(" ✗ 基础 %d 合计 %d:可写上限应为 %lld,得 %lld(写满后合计 %lld)\n", hc[i].base, hc[i].full, hc[i].want, got, tot); } }
printf("hp_base_limit %s:%d 格,带百分比加成时写满基础项合计不过属性上限\n", fails ? "失败" : "OK", hn);
// 双守护者的生命系数 s、伤害系数 d(hi_duo_x1000,×1000):75 层 510 / 750,100 层 775 / 1000,中间线性;低于 75 层(被测试开关强制)取 75 层的值。
// 手算:87 层 s = 510 + 265 × 12 ÷ 25 = 637,d = 750 + 250 × 12 ÷ 25 = 870。
// 并核「任何单体不过属性上限」:100 层最大的规则值是巴尔 10819454 点,× 0.775 = 8385076 ≤ 8388607
// Life factor s and damage factor d of dual Guardians (hi_duo_x1000, x1000): 510 / 750 at level 75, 775 / 1000 at level 100, linear in between; below level 75 (forced by a test switch) the level-75 values.
// By hand: level 87 s = 510 + 265 x 12 / 25 = 637, d = 750 + 250 x 12 / 25 = 870.
// Also checks "no single unit exceeds the stat limit": the largest rule value at level 100 is Baal's 10819454 points, x 0.775 = 8385076 <= 8388607
static const struct { int tier, s, d; } dc[] = { { 30, 510, 750 }, { 75, 510, 750 }, { 87, 637, 870 }, { 100, 775, 1000 } };
for (unsigned i = 0; i < sizeof dc / sizeof *dc; i++) { K.tier = dc[i].tier; if (hi_duo_x1000(0) != dc[i].s || hi_duo_x1000(1) != dc[i].d) { fails++; printf(" ✗ 第 %d 层 s / d 应为 %d / %d,得 %d / %d\n", dc[i].tier, dc[i].s, dc[i].d, hi_duo_x1000(0), hi_duo_x1000(1)); } }
K.tier = 100; if (10819454LL * hi_duo_x1000(0) / 1000 > 8388607LL) { fails++; printf(" ✗ 100 层巴尔 × s 过了属性上限\n"); }
K.guards[0] = 7; K.guards[1] = 9; K.guards[2] = 0; if (!is_guard(7) || !is_guard(9) || is_guard(0) || is_guard(8)) { fails++; printf(" ✗ is_guard 认错\n"); }
printf("hi_duo %s:4 格系数 + 巴尔不过上限 + 认守护者\n", fails ? "失败" : "OK");
printf("t_rift_next %s:%d 格(层 × 晋级量)下一层 = 手写期望且 ≤ 100,宿主与顶部条同值\n", fails ? "失败" : "OK", n);
return fails != 0;
}
+6
View File
@@ -27,6 +27,12 @@ int main(void) {
if (town_menu(c[i].st) != c[i].want || m.menu != c[i].want) { fails++; printf(" ✗ %s:应给页 %d,town_menu %d、peek %d\n", c[i].what, c[i].want, town_menu(c[i].st), m.menu); } }
atomic_store(&M.req_start, 7); atomic_store(&M.req_cont, 1); atomic_store(&M.req_abandon, 1); atomic_store(&M.menu, MENU_CHOICE); menu_reset();
if (atomic_load(&M.req_start) || atomic_load(&M.req_cont) || atomic_load(&M.req_abandon) || atomic_load(&M.menu) != MENU_NONE) { fails++; printf(" ✗ 新局重置后仍有残留:开始 %d 继续 %d 放弃 %d 页 %d\n", atomic_load(&M.req_start), atomic_load(&M.req_cont), atomic_load(&M.req_abandon), atomic_load(&M.menu)); }
// 「进行中且已超时」(rift_overtime):= 状态是进行中 ∧ 开局至今 ≥ 900 秒;顶部条与菜单拿到的是同一个量。开局时刻摆在 N 秒前(客体时钟)
// "In progress and overtime" (rift_overtime): = state is in progress AND at least 900 seconds since the start; the top bar and the menu receive the same quantity. The start moment is placed N seconds in the past (guest clock)
static const struct { int st; int ago; int want; } oc[] = { { ST_RUN, 100, 0 }, { ST_RUN, 899, 0 }, { ST_RUN, 901, 1 }, { ST_RUN, 5000, 1 }, { ST_DONE, 901, 0 }, { ST_IDLE, 901, 0 } };
for (unsigned i = 0; i < sizeof oc / sizeof *oc; i++) { atomic_store(&K.st, oc[i].st); K.t0_ns = guest_ns() - (uint64_t)oc[i].ago * 1000000000ull; dm_rift_hud_t h = {0}; dm_rift_menu_t m = {0}; dm_rift_hud(&h); menu_fill(&m, 2);
if (rift_overtime() != oc[i].want || m.overtime != oc[i].want || (oc[i].st != ST_IDLE && h.overtime != oc[i].want)) { fails++; printf(" ✗ 状态 %d 开局 %d 秒前:超时量应为 %d,得 %d(顶部条 %d、菜单 %d)\n", oc[i].st, oc[i].ago, oc[i].want, rift_overtime(), h.overtime, m.overtime); } }
printf("rift_overtime %s:6 格\n", fails ? "失败" : "OK");
printf("t_rift_oldrun %s:%d 格城里入口给页 + 新局重置清请求\n", fails ? "失败" : "OK", n);
return fails != 0;
}
+1 -1
View File
@@ -10,7 +10,7 @@ uint64_t guest_ns(void) { return 0; }
uint64_t dm_guest_frame(void) { return 0; } // 界面鼠标 / 前端路径按出图帧节拍走;本单测不测它们 | the UI mouse / front-end paths run on the presented-frame cadence; this unit test does not test them
int dm_world_has_target(void) { return 1; } // 点世界(dm_world.c)的桩:有目标 = 主按钮照常发键 | stub for world tapping (dm_world.c): has a target = the primary button sends its key as usual
unsigned dm_world_tap(float nx, float ny) { (void)nx; (void)ny; return 0; }
void dm_world_walk(float nx, float ny) { (void)nx; (void)ny; } int dm_world_tap_result(unsigned q) { (void)q; return -1; }
void dm_world_walk(float nx, float ny) { (void)nx; (void)ny; } unsigned dm_world_click(float nx, float ny) { (void)nx; (void)ny; return 0; } int dm_update_click_at(float nx, float ny) { (void)nx; (void)ny; return 0; } int dm_world_tap_result(unsigned q) { (void)q; return -1; }
uint64_t dm_padmode_legend_click(float nx, float ny) { (void)nx; (void)ny; return 0; } int dm_padmode_hud_click(float nx, float ny, uint64_t *b) { (void)nx; (void)ny; (void)b; return 0; } int dm_padmode_legend_has(uint32_t g) { (void)g; return 0; } int dm_game_paused(void) { return 0; }
int dm_shop_open(void) { return 0; } // 商人页(dm_actions.c)的桩:没开 | stub for the vendor page (dm_actions.c): not open
int dm_padmode_current(void) { return 0; } // 手柄 / 触屏模式(dm_padmode.c)的桩:触屏 | Stub for controller / touch mode (dm_padmode.c): touch
+1 -1
View File
@@ -7,7 +7,7 @@ int dm_loadscreen_down(void) { return 1; } // 读取画面判定在 diag.c;
void dm_world_pump(void) {}
int dm_world_has_target(void) { return 1; }
unsigned dm_world_tap(float nx, float ny) { (void)nx; (void)ny; return 0; }
void dm_world_walk(float nx, float ny) { (void)nx; (void)ny; } int dm_world_tap_result(unsigned q) { (void)q; return -1; }
void dm_world_walk(float nx, float ny) { (void)nx; (void)ny; } unsigned dm_world_click(float nx, float ny) { (void)nx; (void)ny; return 0; } int dm_update_click_at(float nx, float ny) { (void)nx; (void)ny; return 0; } int dm_world_tap_result(unsigned q) { (void)q; return -1; }
void dm_textinput_pump(void) {} // 文本框接法(dm_textinput.c):同上,给空桩 | text box hookup (dm_textinput.c): same as above, an empty stub
void dm_update_pump(void) {} // 选角页构建号与新版本提示(dm_update.c):同上,给空桩 | build number and new-version notice on the character select page (dm_update.c): same as above, an empty stub
void dm_num_set(int n) { (void)n; }