From 5ebd05d4b49297d1472642e13b4751f0cea20fbf Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Mon, 12 Oct 2026 00:09:32 +0800 Subject: [PATCH] =?UTF-8?q?test(fx):=20=E8=BF=AD=E4=BB=A320=20V4=20?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E6=96=AD=E8=A8=80=E8=A1=A5=E9=BD=90=E2=80=94?= =?UTF-8?q?=E2=80=94=E8=B7=A8=E4=BA=8B=E4=BB=B6=E8=AE=A1=E6=95=B0=E7=B4=AF?= =?UTF-8?q?=E7=A7=AF/counter=5Fspend=20=E6=B6=88=E8=80=97/reset=5Fat=20?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E5=88=B6=E4=B8=A4=E6=80=81=EF=BC=88effect=5F?= =?UTF-8?q?words=5Ft1=2017=20checks=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/tests/unit/core/effect_words_t1_test.gd | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/game/tests/unit/core/effect_words_t1_test.gd b/game/tests/unit/core/effect_words_t1_test.gd index f0ce4845..2169b743 100644 --- a/game/tests/unit/core/effect_words_t1_test.gd +++ b/game/tests/unit/core/effect_words_t1_test.gd @@ -93,4 +93,34 @@ func _init() -> void: fx4.counters_seed({"pain_layers": 7}) Kit.check_quiet(fx4.counter("pain_layers") == 7, "seed 回灌:counters_seed 后 adventure 域计数器=7〔专长批 V1〕") + # ⑦ V4——攒层/计数类件跨事件计数(置计数→事件路径→清零点:round_start 重置/用后清零) + var fx5 = EffectEngineScript.new(null) + fx5.rebuild([], [], []) + fx5._push_trigger("test", "round_row", {"on": "mine_hit", + "do": {"kind": "counter_add", "counter_id": "round_mines", "value": 1}}, {}) # 未声明 reset_at——round_start 不重置(声明制对照面) + fx5._push_trigger("test", "spend_row", {"on": "treasure_used", + "do": {"kind": "counter_spend", "counter_id": "round_mines", "value": 1}}, {}) + for h in fx5.dispatch("mine_hit", {}): + if String(h.get("kind", "")) == "counter_add": + fx5.counter_add(String(h.get("counter_id", "")), int(h.get("value", 0))) + for h in fx5.dispatch("mine_hit", {}): + if String(h.get("kind", "")) == "counter_add": + fx5.counter_add(String(h.get("counter_id", "")), int(h.get("value", 0))) + Kit.check_quiet(fx5.counter("round_mines") == 2, "V4:跨事件计数累积(两雷两计)〔专长批 V4〕") + Kit.check_quiet(fx5.counter_spend("round_mines", 1) and fx5.counter("round_mines") == 1, + "V4:counter_spend 写口消耗(用后清零语义承载面)〔专长批 V4〕") + fx5.dispatch("round_start", {"round": 2}) + Kit.check_quiet(fx5.counter("round_mines") == 1, + "V4:非 reset 点计数器不受 round_start 影响(reset_at 声明制——round_mines 未声明重置)〔专长批 V4〕") + var fx6 = EffectEngineScript.new(null) + fx6.rebuild([], [], []) + fx6._push_trigger("test", "reset_row", {"on": "mine_hit", + "do": {"kind": "counter_add", "counter_id": "helm_layers", "value": 1, "reset_at": "round_start"}}, {}) + for h in fx6.dispatch("mine_hit", {}): + if String(h.get("kind", "")) == "counter_add": + fx6.counter_add(String(h.get("counter_id", "")), int(h.get("value", 0))) + fx6.dispatch("round_start", {"round": 2}) + Kit.check_quiet(fx6.counter("helm_layers") == 0, + "V4:round_start 重置点清零(订阅行声明 reset_at——安全帽攒层清零语义)〔专长批 V4〕") + quit(Kit.finish("effect_words_t1"))