From 3b39fa28edc4c232e74ddaa5bb882aca5316bcc3 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sat, 11 May 2024 16:40:41 +0800 Subject: [PATCH] h-x effect->effect_use --- character/huicui/skill.js | 6 ++-- character/jsrg/skill.js | 6 ++-- character/key/skill.js | 6 ++-- character/mobile/skill.js | 16 +++++----- character/offline/skill.js | 12 ++++---- character/onlyOL/skill.js | 2 +- character/sb/skill.js | 8 ++--- character/shenhua/skill.js | 8 ++--- character/shiji/skill.js | 8 ++--- character/sp/skill.js | 48 +++++++++++++++--------------- character/sp2/skill.js | 6 ++-- character/standard/skill.js | 2 +- character/tw/skill.js | 8 ++--- character/xianding/skill.js | 22 +++++++------- character/xinghuoliaoyuan/skill.js | 4 +-- 15 files changed, 81 insertions(+), 81 deletions(-) diff --git a/character/huicui/skill.js b/character/huicui/skill.js index c632bb62d..c1e249da4 100644 --- a/character/huicui/skill.js +++ b/character/huicui/skill.js @@ -9820,7 +9820,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (player !== target && get.itemtype(target) === "player" && (card.name === "sha" || get.type(card, false) === "trick") && target.countCards("he") && !target.hasSkillTag("noh")) return [1, 0, 1, -1]; }, }, @@ -10483,7 +10483,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (typeof card == "object" && player != target) { var suit = get.suit(card); if (suit == "none") return; @@ -13093,7 +13093,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (_status._dcdanying_aiChecking) return; _status._dcdanying_aiChecking = true; let eff = get.effect(target, { name: "guohe_copy2" }, player, player); diff --git a/character/jsrg/skill.js b/character/jsrg/skill.js index 6df980913..a686cf681 100644 --- a/character/jsrg/skill.js +++ b/character/jsrg/skill.js @@ -5964,7 +5964,7 @@ const skills = { ai: { halfneg: true, effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (card.name == "jiu") return [1, 1]; }, }, @@ -6773,7 +6773,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (lib.skill.jsrgjuxia.countSkill(target) >= lib.skill.jsrgjuxia.countSkill(player)) return; if (card && (card.cards || card.isCard) && get.attitude(target, player) > 0 && (!target.storage.counttrigger || !target.storage.counttrigger.jsrgjuxia)) return [0, 0.5, 0, 0.5]; }, @@ -8034,7 +8034,7 @@ const skills = { pretao: true, threaten: 1.8, effect: { - player(card, player, target) { + player_use(card, player, target) { if ( typeof card === "object" && card.name !== "shan" && diff --git a/character/key/skill.js b/character/key/skill.js index 844cf04fa..aec651483 100644 --- a/character/key/skill.js +++ b/character/key/skill.js @@ -2250,7 +2250,7 @@ const skills = { ai: { threaten: 0.7, effect: { - target(card, player, target, current) { + target_use(card, player, target, current) { if (card.name == "sha") return 0.7; }, }, @@ -9797,10 +9797,10 @@ const skills = { }, ai: { effect: { - target(card, player, target) { + target_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 0.6]; }, - player(card, player, target) { + player_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 1]; }, }, diff --git a/character/mobile/skill.js b/character/mobile/skill.js index 19eb9404f..15e492007 100644 --- a/character/mobile/skill.js +++ b/character/mobile/skill.js @@ -119,7 +119,7 @@ const skills = { }, ai: { effect: { - player(card, player, target, current) { + player_use(card, player, target, current) { if (!target) return; const counttrigger = player.storage.counttrigger; if (counttrigger && counttrigger.mbkuangli_target && counttrigger.mbkuangli_target >= lib.skill.mbkuangli_target.usable) return; @@ -5176,7 +5176,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (player.canUse(card, target) && get.distance(player, target) != 1) return 1.2; }, }, @@ -7599,7 +7599,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (card.name == "sha" && current < 0) return 0.7; }, }, @@ -8046,7 +8046,7 @@ const skills = { ai: { reverseEquip: true, effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (get.type(card) == "equip" && !get.tag(card, "gifts") && target.storage.jueyong && target.storage.jueyong[1].length) { var result1 = get.equipResult(player, target, card.name), subtype = get.subtype(card); @@ -10239,7 +10239,7 @@ const skills = { ai: { expose: 0.2, effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (card.name != "sha") return; var players = game.filterPlayer(); if (get.attitude(player, target) <= 0) { @@ -15180,7 +15180,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (["tiesuo", "lulitongxin"].includes(card.name)) { return "zerotarget"; } @@ -15205,7 +15205,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (typeof card !== "object" || target.hasSkillTag("unequip2")) return; if ( player.hasSkillTag("unequip", false, { @@ -15238,7 +15238,7 @@ const skills = { inherit: "rw_minguangkai_link", ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (["tiesuo", "lulitongxin"].includes(card.name)) { return "zeroplayertarget"; } diff --git a/character/offline/skill.js b/character/offline/skill.js index f42b068ff..45e967189 100644 --- a/character/offline/skill.js +++ b/character/offline/skill.js @@ -442,7 +442,7 @@ const skills = { }, ai: { effect: { - target(card, player, target) { + target_use(card, player, target) { if (card.name == "sha" && !game.hasNature(card) && game.countPlayer(targetx => player.inRange(targetx)) >= 3) return "zerotarget"; }, }, @@ -1487,7 +1487,7 @@ const skills = { threaten: 100, reverseEquip: true, effect: { - player: (card, player, target) => { + player_use(card, player, target) { if (typeof card !== "object") return; let suit = get.suit(card); if ( @@ -1506,7 +1506,7 @@ const skills = { }), ]; }, - target: (card, player, target) => { + target(card, player, target) { if ( card.name === "sha" && !player.hasSkillTag( @@ -1580,7 +1580,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (card.name === "sha" && game.hasNature(card) && target.hasEmptySlot(2)) return "zeroplayertarget"; if (get.subtype(card) == "equip2" && target.isEmpty(2)) return [0.6, -0.8]; }, @@ -2290,7 +2290,7 @@ const skills = { threaten: 1.1, combo: "psshiyin", effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { var list = target.getExpansions("psshiyin"); for (var cardx of list) { if (get.suit(cardx) == get.suit(card)) return "zeroplayertarget"; @@ -6442,7 +6442,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { var type = get.type2(card); var list = target.getExpansions("zuixiang2"); for (var i of list) { diff --git a/character/onlyOL/skill.js b/character/onlyOL/skill.js index a0634a4cb..ac7dc2107 100644 --- a/character/onlyOL/skill.js +++ b/character/onlyOL/skill.js @@ -432,7 +432,7 @@ const skills = { subSkill: { ai: { effect: { - player(card, player) { + player_use(card, player) { if ( !game.hasPlayer(target => { return target.hasSkill("olsbhetao") && (get.attitude(player, target) < 0 || get.attitude(target, player) < 0); diff --git a/character/sb/skill.js b/character/sb/skill.js index 10192e2ee..eab2da1ea 100644 --- a/character/sb/skill.js +++ b/character/sb/skill.js @@ -1479,7 +1479,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (player.getStorage("sbyijue_effect").includes(target)) return "zeroplayertarget"; }, }, @@ -2736,10 +2736,10 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 0.6]; }, - player: function (card, player, target) { + player_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 1]; }, }, @@ -3451,7 +3451,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (player != target && target && target.group == "qun" && card.name != "tao") return [1, 0.1]; }, }, diff --git a/character/shenhua/skill.js b/character/shenhua/skill.js index 3700c8759..6833b2466 100644 --- a/character/shenhua/skill.js +++ b/character/shenhua/skill.js @@ -971,7 +971,7 @@ const skills = { }, ai: { effect: { - target(card, player, target) { + target_use(card, player, target) { let hs = player.getCards("h", i => i !== card && (!card.cards || !card.cards.includes(i))), num = player.getCardUsable("sha"); if ((card.name !== "sha" && card.name !== "juedou") || hs.length < target.countCards("h")) return 1; @@ -2382,7 +2382,7 @@ const skills = { return false; }, effect: { - target(card, player, target) { + target_use(card, player, target) { if ( player == target && get.type(card) == "equip" && @@ -3901,10 +3901,10 @@ const skills = { }, ai: { effect: { - target(card, player, target) { + target_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 0.6]; }, - player(card, player, target) { + player_use(card, player, target) { if (card.name == "sha" && get.color(card) == "red") return [1, 1]; }, }, diff --git a/character/shiji/skill.js b/character/shiji/skill.js index ca0e69924..dfe94fe68 100644 --- a/character/shiji/skill.js +++ b/character/shiji/skill.js @@ -1471,13 +1471,13 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { var hp = player.hp, evt = _status.event; if (evt.name == "chooseToUse" && evt.player == player && evt.skill == "spjungong" && !ui.selected.cards.length) hp -= (player.getStat("skill").spjungong || 0) + 1; if (card && card.name == "sha" && hp == target.hp) return [1, 0.3]; }, - target: function (card, player, target) { + target_use(card, player, target) { if (card && card.name == "sha" && player.hp == target.hp) return [1, 0.3]; }, }, @@ -1710,7 +1710,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (get.name(card) == "shan") { let num = get.number(card); if (!num || num <= player.storage.shanxie_banned.num) return "zeroplayertarget"; @@ -2119,7 +2119,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (card.name == "sha" && player.hp > target.hp && get.attitude(player, target) < 0) { var num = get.number(card); if (typeof num != "number") return false; diff --git a/character/sp/skill.js b/character/sp/skill.js index 8e7463111..9616893cf 100644 --- a/character/sp/skill.js +++ b/character/sp/skill.js @@ -2420,7 +2420,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (card.name == "tiesuo" && (!player.storage.counttrigger || !player.storage.counttrigger.hezhong_0)) return "zerotarget"; }, }, @@ -2457,7 +2457,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (card.name == "tiesuo" && (!player.storage.counttrigger || !player.storage.counttrigger.hezhong_1)) return "zerotarget"; }, }, @@ -4320,7 +4320,7 @@ const skills = { diamond_ai: { ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (get.name(card) == "sha" && !player.hasSkill("oltianhou_diamond") && target != player.getNext() && target != player.getPrevious()) { let num = get.number(card), max = _status.aiyh_MAXNUM || 13; @@ -5067,7 +5067,7 @@ const skills = { ai: { threaten: 3, effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if ( typeof card == "object" && card.cards && @@ -6587,7 +6587,7 @@ const skills = { order: 1, threaten: 1.1, effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (_status._olkenshang_aiChecking || ui.selected.targets.length) return; if (typeof card != "object" || !card.storage || !card.storage.olkenshang) return false; _status._olkenshang_aiChecking = true; @@ -6795,7 +6795,7 @@ const skills = { threaten: 0.8, halfneg: true, effect: { - player: function (card, player, target) { + player_use(card, player, target) { if ((!card.isCard || !card.cards) && get.itemtype(card) != "card") return; let cs = 0; if ( @@ -10746,7 +10746,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (card.name != "sha") return; if ( target.hasSkillTag("unequip2") || @@ -10871,7 +10871,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, effect) { + target_use(card, player, target, effect) { if ( effect > 0 || player.hasSkillTag("unequip", false, { @@ -12042,7 +12042,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (!target || player._saodi_judging || ui.selected.targets.length || player == target || target.hasSkill("nodis")) return; if (typeof card != "object" || (card.name != "sha" && get.type(card) != "trick")) return false; player._saodi_judging = true; @@ -16192,17 +16192,6 @@ const skills = { } }, group: "neifa_use", - ai: { - reverseOrder: true, - skillTagFilter: function (player) { - if (player.storage.counttrigger && player.storage.counttrigger.neifa_use >= 2) return false; - }, - effect: { - target: function (card, player, target) { - if ((!player.storage.counttrigger || !player.storage.counttrigger.neifa_use || player.storage.counttrigger.neifa_use < 2) && player == target && get.type(card) == "equip") return [1, 3]; - }, - }, - }, }, neifa_use: { audio: "neifa", @@ -16215,6 +16204,17 @@ const skills = { content: function () { player.draw(player.countMark("neifa_nobasic")); }, + ai: { + reverseOrder: true, + skillTagFilter(player) { + if (player.storage.counttrigger && player.storage.counttrigger.neifa_use >= 2) return false; + }, + effect: { + player_use(card, player, target) { + if (player.countSkill("neifa_use") < 2 && get.type(card) == "equip") return [1, player.countMark("neifa_nobasic")]; + }, + }, + }, }, //许靖 yuxu: { @@ -16686,7 +16686,7 @@ const skills = { ai: { threaten: 1.8, effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { let used = target.getHistory("useCard").length + target.getHistory("respond").length; if (get.subtype(card) == "equip1" && !get.cardtag(card, "gifts")) { if (player != target || !player.isPhaseUsing()) return; @@ -23894,7 +23894,7 @@ const skills = { }, ai: { effect: { - target: function (card) { + target_use(card) { if (get.type(card) != "trick") return; if (card.name == "tiesuo") return [0, 0]; if (card.name == "yihuajiemu") return [0, 1]; @@ -24055,7 +24055,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target) { + target_use(card, player, target) { if (get.color(card) == "black" && target.countCards("h") > 0) { return [1, 0.5]; } @@ -26673,7 +26673,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (card.name == "sha") return [1, 0.5]; }, }, diff --git a/character/sp2/skill.js b/character/sp2/skill.js index dd503da05..353696fb0 100644 --- a/character/sp2/skill.js +++ b/character/sp2/skill.js @@ -889,7 +889,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { var targets = game.filterPlayer(targetx => targetx != player && targetx.getStorage("starcanxi_xiangsi").includes(player.group)); if (!targets.length) return; if (get.tag(card, "recover") && target == player && target.hp > 2) return 0; @@ -2249,7 +2249,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (_status.event.name == "chooseToUse" && get.name(card) == "sha" && (!player.storage.counttrigger || !player.storage.counttrigger.dctingxian) && !_status._dctingxian_aiChecking) { _status._dctingxian_aiChecking = true; var eff = get.effect(target, { name: "sha" }, player, player); @@ -11789,7 +11789,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { var evt = player.getLastUsed(); if (evt && evt.targets.includes(target) && (!player.storage.counttrigger || !player.storage.counttrigger.xinfu_lianpian || !player.storage.counttrigger.xinfu_lianpian < 3) && player.isPhaseUsing(player)) return [1.5, 0]; }, diff --git a/character/standard/skill.js b/character/standard/skill.js index cc6a634a3..638cb62a8 100644 --- a/character/standard/skill.js +++ b/character/standard/skill.js @@ -1651,7 +1651,7 @@ const skills = { }, ai: { effect: { - target(card, player, target) { + target_use(card, player, target) { if (target.countCards("he") == 0) return; if (card.name != "sha") return; let min = 1; diff --git a/character/tw/skill.js b/character/tw/skill.js index 886a68faf..943707783 100644 --- a/character/tw/skill.js +++ b/character/tw/skill.js @@ -8888,7 +8888,7 @@ const skills = { charlotte: true, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if ( card.cards && card.cards.some(i => i.hasGaintag("twkujianx")) && @@ -9519,7 +9519,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current) { + target_use(card, player, target, current) { if (card.name == "sha" && player.hp > target.hp && get.attitude(player, target) < 0) { var num = get.number(card); var bs = player.getCards("h", function (cardx) { @@ -13976,7 +13976,7 @@ const skills = { }, ai: { effect: { - target: function (card, player, target, current, isLink) { + target_use(card, player, target, current, isLink) { if (card.name == "sha" && !isLink) return 0.8; }, }, @@ -14317,7 +14317,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if (get.type(card) !== "delay" && get.type(card) !== "equip") return 1; let za = game.findPlayer(cur => cur.hasSkill("twzhian") && (!cur.storage.counttrigger || !cur.storage.counttrigger.twzhian) && get.attitude(player, cur) <= 0); if (za) return [0.5, -0.8]; diff --git a/character/xianding/skill.js b/character/xianding/skill.js index 9c2c9cb39..84aaccce4 100644 --- a/character/xianding/skill.js +++ b/character/xianding/skill.js @@ -1146,7 +1146,7 @@ const skills = { }, ai: { effect: { - player(card, player, target, current) { + player_use(card, player, target, current) { if (get.type(card) == "trick" && player.getStorage("dcjujian_forbid").includes(target)) return "zeroplayertarget"; }, }, @@ -5670,7 +5670,7 @@ const skills = { }, ai: { effect: { - player: (card, player, target) => { + player_use(card, player, target) { if (get.itemtype(card) === "card" && cardx.hasGaintag("dczhaowen_tag") && get.color(card, player) === "red") return [1, 1]; }, }, @@ -5737,7 +5737,7 @@ const skills = { if (name != "phase") return false; }, effect: { - target_use: (card, player, target) => { + target_use(card, player, target) { if (player === target || typeof card !== "object" || get.color(card) !== "black") return; if (target.hasSkill("jiu")) { if ( @@ -7056,7 +7056,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { var evt = player.getLastUsed(); if (evt && evt.targets.includes(target)) return [1.5, 0]; }, @@ -8630,7 +8630,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (get.tag(card, "recover") && target.hp > 0) return 0; if (get.tag(card, "damage")) return 0.5; }, @@ -8906,7 +8906,7 @@ const skills = { }, ai: { effect: { - target_use: (card, player, target) => { + target_use(card, player, target) { if (player === target) return; if ( game.hasPlayer2(current => { @@ -9451,7 +9451,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (typeof card != "object") return; var storage = player.getStorage("olddcxiangmian_countdown"); for (var i = 0; i < storage.length / 3; i++) { @@ -9553,7 +9553,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (typeof card != "object") return; var storage = player.getStorage("dcxiangmian_countdown"); for (var i = 0; i < storage.length / 3; i++) { @@ -13133,7 +13133,7 @@ const skills = { }, ai: { effect: { - player: function (card, player, target) { + player_use(card, player, target) { if ( target && target.getExpansions("xinzhoufu2").length > 0 && @@ -13988,7 +13988,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if ( typeof card == "object" && player == _status.currentPhase && @@ -14985,7 +14985,7 @@ const skills = { }, ai: { effect: { - target_use: function (card, player, target) { + target_use(card, player, target) { if (get.itemtype(player) !== "player" || player === target) return 1; let num = 1, ds = 2 + get.sgn(player.hp - target.hp); diff --git a/character/xinghuoliaoyuan/skill.js b/character/xinghuoliaoyuan/skill.js index 854741d6f..83e59132c 100644 --- a/character/xinghuoliaoyuan/skill.js +++ b/character/xinghuoliaoyuan/skill.js @@ -930,7 +930,7 @@ const skills = { }, ai: { effect: { - player_use: function (card, player, target) { + player_use(card, player, target) { if (typeof card != "object" || !player.isPhaseUsing()) return; var hasPanjun = game.hasPlayer(function (current) { return ( @@ -1581,7 +1581,7 @@ const skills = { pretao: true, threaten: 1.8, effect: { - player(card, player, target) { + player_use(card, player, target) { if ( typeof card === "object" && card.name !== "shan" &&