diff --git a/character/extra/skill.js b/character/extra/skill.js index 07fb96d74..0cea4cc5c 100644 --- a/character/extra/skill.js +++ b/character/extra/skill.js @@ -4062,6 +4062,7 @@ const skills = { return 0; }, }, + combo: "tianren" }, subSkill: { effect: { diff --git a/character/jsrg/skill.js b/character/jsrg/skill.js index 101b036a0..4bdfc4d80 100644 --- a/character/jsrg/skill.js +++ b/character/jsrg/skill.js @@ -538,6 +538,7 @@ const skills = { }, jsrgyangge: { global: "jsrgyangge_mizhao", + derivation: "mizhao", subSkill: { mizhao: { //直接继承mizhao @@ -574,11 +575,59 @@ const skills = { player.addTempSkill("jsrgguanshi_effect"); }, position: "hs", - //这个AI难写,交给157了! - check() { - return -1; + selectTargetAi(card) { + let cache = _status.event.getTempCache("jsrgguanshi", "targets"); + if (Array.isArray(cache)) return cache.length; + let player = _status.event.player, + targets = [], + shas = player.mayHaveSha(player, "respond", player.getCards("h", i => { + return card === i; + })); + game.countPlayer(tar => { + if (player === tar) return; + let eff = get.effect(tar, get.autoViewAs({ name: "juedou" }, [card]), player, player); + if (eff <= 0) return; + if (get.attitude(player, tar) > 0) targets.push([tar, eff, 0]); + else targets.push([tar, eff, tar.mayHaveSha(player, "respond", null, "count")]); + }); + targets.sort((a, b) => { + if (!a[2]) return -1; + if (!b[2]) return 1; + return b[1] / b[2] - a[1] / a[2]; + }); + for (let i = 0; i < targets.length; i++) { + if (targets[i][2] > shas) { + targets = targets.slice(0, i); + break; + } + else shas -= targets[i][2]; + } + _status.event.putTempCache("jsrgguanshi", "targets", targets); + return targets.length; + }, + check(card) { + let num = lib.skill.jsrgguanshi.selectTargetAi(card); + if (!num) return -1; + if (num === 1) return 4 - get.value(card); + return num + 5 - get.value(card); + }, + ai: { + order: 9, + result: { + player(player, target) { + let tars = _status.event.putTempCache("jsrgguanshi", "targets", targets); + if (!tars) return lib.card.juedou.ai.result.player(player, target); + }, + target(player, target) { + let tars = _status.event.putTempCache("jsrgguanshi", "targets", targets); + if (!tars) return lib.card.juedou.ai.result.target(player, target); + for (let tar of tars) { + if (tar[0] === target) return tar[1] / get.attitude(player, target); + } + return 0; + } + } }, - ai: {}, subSkill: { effect: { trigger: { diff --git a/character/key/skill.js b/character/key/skill.js index 6d4e19198..b5551b83f 100644 --- a/character/key/skill.js +++ b/character/key/skill.js @@ -6631,6 +6631,7 @@ const skills = { player.removeSkills("godan_feiqu"); }, ai: { + combo: "godan_feiqu", halfneg: true }, }, diff --git a/character/mobile/skill.js b/character/mobile/skill.js index 04170494f..059abf98e 100644 --- a/character/mobile/skill.js +++ b/character/mobile/skill.js @@ -4774,7 +4774,6 @@ const skills = { if (card) player.gain(card, "gain2"); }, ai: { - combo: "fenli", effect: { target: function (card) { if (card.name == "lebu" || card.name == "bingliang") return 0.5; diff --git a/character/refresh/skill.js b/character/refresh/skill.js index 123f9b54a..68776a149 100644 --- a/character/refresh/skill.js +++ b/character/refresh/skill.js @@ -2293,7 +2293,7 @@ const skills = { }, check: function (event, player) { if (player.hasJudge("lebu") || player.hasJudge("bingliang")) return true; - if (player.getHistory("skipped").length > 0) return false; + if (!player.hasSkill("repingkou") || player.getHistory("skipped").length > 0) return false; return game.hasPlayer(function (current) { return get.attitude(player, current) < 0 && current.hp == 1 && get.damageEffect(current, player, player) > 0; }); @@ -2311,6 +2311,7 @@ const skills = { return player.isMaxHp(); }, check: function (event, player) { + if (!player.hasSkill("repingkou")) return false; if (!player.needsToDiscard() || (player.countCards("e") && player.isMaxEquip())) return true; if (player.getHistory("skipped").length > 0) return false; return game.hasPlayer(function (current) { @@ -2334,9 +2335,6 @@ const skills = { }, }, }, - ai: { - combo: "repingkou", - }, }, repingkou: { audio: 2, diff --git a/character/sp/skill.js b/character/sp/skill.js index f67d952fe..4ccdaa44a 100644 --- a/character/sp/skill.js +++ b/character/sp/skill.js @@ -23146,6 +23146,9 @@ const skills = { player.stat[player.stat.length - 1].card.sha--; } }, + ai: { + combo: "wusheng" + }, group: "nuzhan2", }, nuzhan2: { diff --git a/character/sp2/skill.js b/character/sp2/skill.js index f5c5b4ccc..88bddd3db 100644 --- a/character/sp2/skill.js +++ b/character/sp2/skill.js @@ -7145,6 +7145,9 @@ const skills = { player.addTempSkill("csyizheng2", { player: "phaseBegin" }); } }, + ai: { + combo: "cslilu" + }, }, csyizheng2: { audio: "csyizheng", diff --git a/character/standard/skill.js b/character/standard/skill.js index 50d13ce5b..2c00ab3b3 100644 --- a/character/standard/skill.js +++ b/character/standard/skill.js @@ -336,6 +336,7 @@ const skills = { .sortBySeat(); if (targets.length) { for (const target of targets) { + if (!target.isIn()) continue; const next = target.chooseToUse("挥战:是否替" + get.translation(trigger.player) + "使用一张【闪】?", { name: "shan" }); next.set("ai", () => { const event = _status.event; diff --git a/character/yijiang/skill.js b/character/yijiang/skill.js index add26ca63..7895502fc 100644 --- a/character/yijiang/skill.js +++ b/character/yijiang/skill.js @@ -3677,7 +3677,7 @@ const skills = { return player.isMaxHandcard(); }, check: function (event, player) { - if (player.getHistory("skipped").length > 0) return false; + if (!player.hasSkill("pingkou") && !player.hasSkill("xinpingkou") || player.getHistory("skipped").length > 0) return false; return game.hasPlayer(function (current) { return get.attitude(player, current) < 0 && current.hp == 1 && get.damageEffect(current, player, player) > 0; }); @@ -3695,6 +3695,7 @@ const skills = { return player.isMaxHp(); }, check: function (event, player) { + if (!player.hasSkill("pingkou") && !player.hasSkill("xinpingkou")) return false; if (!player.needsToDiscard() || (player.countCards("e") && player.isMaxEquip())) return true; if (player.getHistory("skipped").length > 0) return false; return game.hasPlayer(function (current) { @@ -3719,9 +3720,6 @@ const skills = { }, }, }, - ai: { - combo: "pingkou", - }, }, pingkou: { audio: 2, @@ -3754,7 +3752,6 @@ const skills = { } }, ai: { - combo: "fenli", effect: { target: function (card) { if (card.name == "lebu" || card.name == "bingliang") return 0.5; diff --git a/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts b/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts index 657da1ab1..cc499f538 100644 --- a/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts +++ b/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts @@ -1262,8 +1262,8 @@ export class Player extends HTMLDivElement { */ hasSha(respond?: string | boolean, noauto?: boolean): boolean; hasShan(respond: any): boolean; - mayHaveSha(viewer: any, type: any, ignore: any, rvt: any): number | boolean; - mayHaveShan(viewer: any, type: any, ignore: any, rvt: any): number | boolean; + mayHaveSha(viewer: Player, type?: string, ignore?: CCards | Function, rvt?: string): number | boolean; + mayHaveShan(viewer: Player, type?: string, ignore?: CCards | Function, rvt?: string): number | boolean; hasCard(name: any, position: any): boolean; getEquip(name: any): import("noname-typings/nonameModules/noname/library/element/card.js").Card; getJudge(name: any): ChildNode;