From a3dad48a75949690abca2dad4af3007993a7c8e0 Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Thu, 5 Jun 2025 11:37:32 +0800 Subject: [PATCH 1/8] export FATE_TO_CHARACTER_OR_SECT --- gamestate_full_ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamestate_full_ui.js b/gamestate_full_ui.js index 55a94bb..8fa17d8 100644 --- a/gamestate_full_ui.js +++ b/gamestate_full_ui.js @@ -5076,7 +5076,7 @@ export class GameState { } } -const FATE_TO_CHARACTER_OR_SECT = { +export const FATE_TO_CHARACTER_OR_SECT = { sword_in_sheathed_stacks: "sw1", endurance_as_cloud_sea_stacks: "sw1", fire_flame_blade_stacks: "sw2", From 74d9f15bde09aa989c5641370c016a321689d03c Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Fri, 6 Jun 2025 16:18:58 +0800 Subject: [PATCH 2/8] fix: m_consonance_sword_formation --- gamestate_full_ui.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gamestate_full_ui.js b/gamestate_full_ui.js index 8fa17d8..cd1a6b4 100644 --- a/gamestate_full_ui.js +++ b/gamestate_full_ui.js @@ -3403,6 +3403,10 @@ export class GameState { me.sword_intent_flow_mode = true; } if (me.sword_intent > 0) { + if (me.m_consonance_sword_formation_stacks > 0) { + this.reduce_idx_x_by_c(my_idx, "m_consonance_sword_formation_stacks", 1); + this.increase_idx_qi(my_idx, me.sword_intent); + } if (me.sword_intent_flow_mode) { if (me.this_card_sword_intent < me.sword_intent) { this.log("in sword intent flow mode, using " + me.sword_intent + " sword intent without consuming"); @@ -3415,10 +3419,6 @@ export class GameState { this.reduce_idx_x_by_c(my_idx, "sword_intent", me.sword_intent); } } - if (me.m_consonance_sword_formation_stacks > 0) { - this.reduce_idx_x_by_c(my_idx, "m_consonance_sword_formation_stacks", 1); - this.increase_idx_qi(my_idx, me.this_card_sword_intent); - } if (me.is_star_point[me.currently_playing_card_idx]) { dmg += (me.star_power * (1 + me.bonus_star_power_multiplier) From 624899917c621cc9ef9a922bfcfb870b25913904 Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Sun, 8 Jun 2025 01:11:09 +0800 Subject: [PATCH 3/8] winning_info --- web_worker.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/web_worker.js b/web_worker.js index 4573035..7cf68ad 100644 --- a/web_worker.js +++ b/web_worker.js @@ -42,6 +42,7 @@ self.onmessage = async (event) => { const ret = {}; const winning_decks = []; const winning_margins = []; + let winning_info = {}; const winning_logs = []; let try_idx = 0; let best_winning_margin = -99999; @@ -123,7 +124,7 @@ self.onmessage = async (event) => { //if (!game.used_randomness) { //if (winrate >= best_winrate) { best_winrate = winrate; - const hp = game.players[my_idx].hp; + // const hp = game.players[my_idx].hp; //if (hp > best_hp) { // winning_decks.length = 0; // winning_margins.length = 0; @@ -131,7 +132,15 @@ self.onmessage = async (event) => { //} //best_hp = hp; //const winning_margin = game.players[my_idx].hp - game.players[enemy_idx].hp - 1000 * game.turns_taken; - const winning_margin = -game.players[enemy_idx].hp; + // console.log({ + // myHP: game.players[my_idx].hp, + // enemyHP: game.players[enemy_idx].hp, + // turns: game.turns_taken + // }) + const myHP = game.players[my_idx].hp; + const enemyHP = game.players[enemy_idx].hp; + const turns = game.turns_taken; + const winning_margin = (myHP - enemyHP) / turns; const p_combo = combo.slice(); if (winning_margin > best_winning_margin) { winning_decks.length = 0; @@ -140,6 +149,11 @@ self.onmessage = async (event) => { best_winning_margin = winning_margin; winning_decks.push(p_combo); winning_margins.push(winning_margin); + winning_info = { + myHP, + enemyHP, + turns, + } let game_with_log = new GameStateWithLog(alog, blog); for (let key in players[my_idx]) { game_with_log.players[my_idx][key] = players[my_idx][key]; @@ -164,6 +178,7 @@ self.onmessage = async (event) => { ret.combo = combo; ret.winning_decks = winning_decks; ret.winning_margins = winning_margins; + ret.winning_info = winning_info; ret.winning_logs = winning_logs; ret.try_idx = try_idx; postMessage(ret); From e9f945a7519f0739f0c2495094b4f688fe68bd9a Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Wed, 11 Jun 2025 01:38:56 +0800 Subject: [PATCH 4/8] fix do_set_cards_by_round --- gamestate_full_ui.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/gamestate_full_ui.js b/gamestate_full_ui.js index 1344338..0360718 100644 --- a/gamestate_full_ui.js +++ b/gamestate_full_ui.js @@ -708,23 +708,25 @@ export class Player { this.cards = this.cards.slice(0, slot); } reset_can_play() { - { - const cards = this.cards; - for (let i=0; i 0) { const swordplay_talent_cards = this.swordplay_talent_cards; let seen_yeying = false; From 850a00e64f9d6ec772aef2917ae68d13e342c0d0 Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Wed, 11 Jun 2025 01:58:55 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix=20=E5=8F=8C=E8=8A=82=E6=A3=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- names.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/names.json b/names.json index 150d1ea..e100260 100644 --- a/names.json +++ b/names.json @@ -2229,7 +2229,7 @@ { "id": 641011, "name": "Double Stick", - "namecn": "双截棍" + "namecn": "双节棍" }, { "id": 642011, From 40469732d0a59acb894e11f800188fe6b874ac67 Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Wed, 11 Jun 2025 22:54:35 +0800 Subject: [PATCH 6/8] fix do_xuanming_recurring Wood Spirit Recovery --- card_actions.js | 4 ++-- gamestate_full_ui.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/card_actions.js b/card_actions.js index 2465c5a..d849507 100644 --- a/card_actions.js +++ b/card_actions.js @@ -10734,7 +10734,7 @@ card_actions["734042"] = (game) => { game.do_xuanming_recurring(0, 15); const me = game.players[0]; if (game.if_wood_spirit() && me.hp_gained > 0) { - game.increase_idx_x_by_c(0, "increase_atk", 1); + game.increase_idx_x_by_c(0, "increase_atk", 2); } } @@ -10744,7 +10744,7 @@ card_actions["734043"] = (game) => { game.do_xuanming_recurring(0, 15); const me = game.players[0]; if (game.if_wood_spirit() && me.hp_gained > 0) { - game.increase_idx_x_by_c(0, "increase_atk", 1); + game.increase_idx_x_by_c(0, "increase_atk", 3); } } diff --git a/gamestate_full_ui.js b/gamestate_full_ui.js index 0360718..a5f3fc8 100644 --- a/gamestate_full_ui.js +++ b/gamestate_full_ui.js @@ -2631,8 +2631,7 @@ export class GameState { this.reduce_idx_x_by_c(0, "god_opportunity_conform_stacks", 1); this.reduce_idx_x_by_c(0, "god_opportunity_reversal_stacks", 1); this.reduce_idx_x_by_c(0, "m_sinking_qi_stacks", 1); - this.do_resonance_rejuvenation(); - me.xuanming_recurring_hp = me.hp; + this.do_resonance_rejuvenation(); this.do_def_decay(); this.do_fat_immortal_raccoon(); this.do_scarlet_eye_the_sky_consumer(); @@ -2808,6 +2807,7 @@ export class GameState { this.process_this_card_chases(); } } + me.xuanming_recurring_hp = me.hp; if (this.check_for_death()) { return; } @@ -4908,7 +4908,7 @@ export class GameState { if (cap !== undefined) { new_hp = Math.min(new_hp, me.hp + cap); } - this.set_idx_c_of_x(0, "hp", new_hp); + this.set_idx_c_of_x(0, new_hp, "hp"); } } do_resonance_setup(idx) { From 17d11df820b852f0e463b40991532d94cdea054f Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Fri, 13 Jun 2025 02:02:48 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix=20wording:=20=E7=99=BE=E9=B8=9F?= =?UTF-8?q?=E7=81=B5=E5=89=91=E8=AF=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- names.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/names.json b/names.json index e100260..e048358 100644 --- a/names.json +++ b/names.json @@ -188,7 +188,7 @@ { "id": 114041, "name": "CentiBird Spirit Sword Rhythm", - "namecn": "白鸟灵剑诀" + "namecn": "百鸟灵剑诀" }, { "id": 114051, From 68ebe2e27a4ddac35f1330b2d5bb4e986c7ca97e Mon Sep 17 00:00:00 2001 From: Kiven <412386861@qq.com> Date: Tue, 17 Jun 2025 00:27:53 +0800 Subject: [PATCH 8/8] fix k_combinations by slot & winning score --- find_winning_deck.js | 6 +++++- web_worker.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/find_winning_deck.js b/find_winning_deck.js index 25465c5..71692ad 100644 --- a/find_winning_deck.js +++ b/find_winning_deck.js @@ -136,7 +136,11 @@ export async function do_riddle(riddle, handler) { } else { let combo_idx = 0; const tried_combos = {}; - for (let combo of k_combinations(my_cards, 8)) { + let slot = 8; + if (riddle.players[my_idx].round_number) { + slot = Math.min(8, riddle.players[my_idx].round_number + 2); + } + for (let combo of k_combinations(my_cards, slot)) { combo_idx += 1; // sort the combo combo.sort(); diff --git a/web_worker.js b/web_worker.js index 7cf68ad..1f9d556 100644 --- a/web_worker.js +++ b/web_worker.js @@ -140,7 +140,7 @@ self.onmessage = async (event) => { const myHP = game.players[my_idx].hp; const enemyHP = game.players[enemy_idx].hp; const turns = game.turns_taken; - const winning_margin = (myHP - enemyHP) / turns; + const winning_margin = (myHP * 2 - enemyHP - Math.min(turns, 8) * 2); const p_combo = combo.slice(); if (winning_margin > best_winning_margin) { winning_decks.length = 0;