import { lib, game, ui, get, ai, _status } from "../../noname.js"; /** @type { importCharacterConfig['skill'] } */ const skills = { //新InitFilter测试高达一号 //打赢复活赛的牢达[哭] dclonghun: { audio: 2, enable: ["chooseToUse", "chooseToRespond"], prompt: "将♦牌当做火【杀】,♥牌当做【桃】,♣牌当做【闪】,♠牌当做【无懈可击】使用或打出", viewAs(cards, player) { var name; var nature = null; switch (get.suit(cards[0], player)) { case "club": name = "shan"; break; case "diamond": name = "sha"; nature = "fire"; break; case "spade": name = "wuxie"; break; case "heart": name = "tao"; break; } if (name) return { name: name, nature: nature }; return null; }, check(card) { var player = _status.event.player; if (_status.event.type == "phase") { var max = 0; var name2; var list = ["sha", "tao"]; var map = { sha: "diamond", tao: "heart" }; for (var i = 0; i < list.length; i++) { var name = list[i]; if ( player.countCards("hes", function (card) { return (name != "sha" || get.value(card) < 5) && get.suit(card, player) == map[name]; }) > 0 && player.getUseValue({ name: name, nature: name == "sha" ? "fire" : null, }) > 0 ) { var temp = get.order({ name: name, nature: name == "sha" ? "fire" : null, }); if (temp > max) { max = temp; name2 = map[name]; } } } if (name2 == get.suit(card, player)) return name2 == "diamond" ? 5 - get.value(card) : 20 - get.value(card); return 0; } return 1; }, position: "hes", filterCard(card, player, event) { event = event || _status.event; var filter = event._backup.filterCard; var name = get.suit(card, player); if (name == "club" && filter({ name: "shan", cards: [card] }, player, event)) return true; if (name == "diamond" && filter({ name: "sha", cards: [card], nature: "fire" }, player, event)) return true; if (name == "spade" && filter({ name: "wuxie", cards: [card] }, player, event)) return true; if (name == "heart" && filter({ name: "tao", cards: [card] }, player, event)) return true; return false; }, filter(event, player) { var filter = event.filterCard; if (filter(get.autoViewAs({ name: "sha", nature: "fire" }, "unsure"), player, event) && player.countCards("hes", { suit: "diamond" })) return true; if (filter(get.autoViewAs({ name: "shan" }, "unsure"), player, event) && player.countCards("hes", { suit: "club" })) return true; if (filter(get.autoViewAs({ name: "tao" }, "unsure"), player, event) && player.countCards("hes", { suit: "heart" })) return true; if (filter(get.autoViewAs({ name: "wuxie" }, "unsure"), player, event) && player.countCards("hes", { suit: "spade" })) return true; return false; }, usable: 20, ai: { respondSha: true, respondShan: true, skillTagFilter(player, tag) { if ((player.getStat("skill").dclonghun || 0) >= 20) return false; var name; switch (tag) { case "respondSha": name = "diamond"; break; case "respondShan": name = "club"; break; case "save": name = "heart"; break; } if (!player.countCards("hes", { suit: name })) return false; }, order(item, player) { if (player && _status.event.type == "phase") { var max = 0; var list = ["sha", "tao"]; var map = { sha: "diamond", tao: "heart" }; for (var i = 0; i < list.length; i++) { var name = list[i]; if ( player.countCards("hes", function (card) { return (name != "sha" || get.value(card) < 5) && get.suit(card, player) == map[name]; }) > 0 && player.getUseValue({ name: name, nature: name == "sha" ? "fire" : null, }) > 0 ) { var temp = get.order({ name: name, nature: name == "sha" ? "fire" : null, }); if (temp > max) max = temp; } } max /= 1.1; return max; } return 2; }, }, hiddenCard(player, name) { if ((player.getStat("skill").dclonghun || 0) >= 20) return false; if (name == "wuxie" && _status.connectMode && player.countCards("hes") > 0) return true; if (name == "wuxie") return player.countCards("hes", { suit: "spade" }) > 0; if (name == "tao") return player.countCards("hes", { suit: "heart" }) > 0; }, }, dczhanjiang: { audio: 2, trigger: { player: "phaseZhunbeiBegin" }, filter(event, player) { return game.hasPlayer(target => { return target.countCards("ej", card => get.name(card, false) == "qinggang" || get.name(card, get.owner(card)) == "qinggang"); }); }, content() { let cards = [], targets = game.filterPlayer(target => { return target.countCards("ej", card => get.name(card, false) == "qinggang" || get.name(card, get.owner(card)) == "qinggang"); }); targets.forEach(target => cards.addArray(target.getCards("ej", card => get.name(card, false) == "qinggang" || get.name(card, get.owner(card)) == "qinggang"))); player.gain(cards, "give"); }, }, //孙策 //双壁=100%技能周瑜+100%原画孙策 dcshuangbi: { audio: 2, enable: "phaseUse", usable: 1, *content(event, map) { var player = map.player, num = game.countPlayer(); var result = yield player .chooseControl() .set("choiceList", ["摸" + get.cnNumber(num) + "张牌,本回合手牌上限+" + parseFloat(num), "弃置至多" + get.cnNumber(num) + "张牌,随机对其他角色造成等量火焰伤害", "视为使用" + get.cnNumber(num) + "张火【杀】或【火攻】"]) .set("ai", () => { var player = _status.event.player, card = { name: "sha", nature: "fire" }; if (!game.hasPlayer(target => player.canUse(card, target) && get.effect(target, card, player, player) > 0)) return 0; return 2; }); player.flashAvatar("dcshuangbi", ["re_zhouyu", "shen_zhouyu", "dc_sb_zhouyu"][result.index]); switch (result.index) { case 0: player.draw(num); player.addTempSkill("dcshuangbi_effect"); player.addMark("dcshuangbi_effect", num, false); break; case 1: var result2 = yield player.chooseToDiscard("双壁:弃置至多" + get.cnNumber(num) + "张牌,随机对其他角色造成等量火焰伤害", [1, num], "he").set("ai", card => 1 / (get.value(card) || 0.5)); if (result2.bool) { var map = {}, sum = result2.cards.length; var targets = game.filterPlayer(target => target != player); if (targets.length) { while (sum) { sum--; var target = targets.randomGet(); player.line(target); target.damage(1, "fire"); game.delayx(); } } } break; case 2: while (num && game.hasPlayer(target => player.canUse({ name: "sha", nature: "fire" }, target) || player.canUse({ name: "huogong" }, target))) { num--; var list = []; if (game.hasPlayer(target => player.canUse({ name: "sha", nature: "fire" }, target))) list.push(["基本", "", "sha", "fire"]); if (game.hasPlayer(target => player.canUse({ name: "huogong" }, target))) list.push(["锦囊", "", "huogong"]); var result2 = yield player.chooseButton(["双壁:请选择你要使用的牌", [list, "vcard"]], true).set("ai", button => (button.link[2] == "sha" ? 1 : 0)); if (result2.bool) { var card = { name: result2.links[0][2], nature: result2.links[0][3], }; yield player.chooseUseTarget(true, card, false); } else break; } break; } }, ai: { order: 9, result: { player: 1 }, }, subSkill: { effect: { charlotte: true, onremove: true, intro: { content: "手牌上限+#" }, mod: { maxHandcard(player, num) { return num + player.countMark("dcshuangbi_effect"); }, }, }, }, }, //哪吒 dcsantou: { audio: 2, trigger: { player: "damageBegin4" }, forced: true, *content(event, map) { var player = map.player, trigger = map.trigger; var source = trigger.source; trigger.cancel(); var hp = player.getHp(); var lose = false; if (hp >= 3) { if ( player.hasHistory("useSkill", evt => { var evtx = evt.event; return evt.skill == "dcsantou" && evtx.getTrigger().source == source && evtx.getParent(2) != trigger; }) ) lose = true; } else if (hp == 2) { if (trigger.hasNature()) lose = true; } else if (hp == 1) { if (trigger.card && get.color(trigger.card) == "red") lose = true; } if (lose) player.loseHp(); }, ai: { filterDamage: true, skillTagFilter(player, tag, arg) { if (arg && arg.player && arg.player.hasSkillTag("jueqing", false, player)) return false; }, effect: { target(card, player, target) { if (player.hasSkillTag("jueqing", false, target)) return; if (player._dcsantou_temp) return; if (get.tag(card, "damage")) { const hp = target.getHp(); player._dcsantou_temp = true; const losehp = get.effect(target, { name: "losehp" }, target, target) / get.attitude(target, target); delete player._dcsantou_temp; if (hp >= 3) { if (target.hasHistory("useSkill", evt => evt.skill == "dcsantou" && evt.event.getTrigger().source == player)) return [0, losehp, 0, 0]; else if (get.attitude(player, target) < 0) { let hs = player.getCards("hs", i => { return i !== card && (!card.cards || !card.cards.includes(i)); }), num = player.getCardUsable("sha"); if (card.name === "sha") num--; hs = hs.filter(i => { if (!player.canUse(i, target)) return false; if (get.tag(card, "damage") && get.name(i, player) !== "sha") return true; if (num) { num--; return true; } return false; }).length; if ( player.hasSkillTag("damage", null, { target: target, }) ) hs++; if (!hs) return "zeroplayertarget"; num = 1 - 2 / 3 / hs; return [num, 0, num, 0]; } } if ((hp == 2 && get.tag(card, "natureDamage")) || (hp == 1 && typeof card == "object" && get.color(card) == "red")) return [0, losehp, 0, 0]; return "zeroplayertarget"; } }, }, }, }, dcfaqi: { audio: 2, trigger: { player: "useCardAfter" }, filter(event, player) { if (get.type(event.card) != "equip") return false; if (!player.isPhaseUsing()) return false; for (const name of lib.inpile) { if (get.type(name) != "trick") continue; if (!player.hasStorage("dcfaqi", name) && player.hasUseTarget({ name: name, isCard: true })) return true; } return false; }, direct: true, *content(event, map) { var player = map.player; var list = get.inpileVCardList(info => { if (info[0] != "trick") return false; var name = info[2]; return !player.hasStorage("dcfaqi", name) && player.hasUseTarget({ name: name, isCard: true }); }); if (list.length) { var result = yield player.chooseButton(["法器:视为使用一张普通锦囊牌", [list, "vcard"]], true).set("ai", button => { return get.player().getUseValue({ name: button.link[2] }); }); if (result.bool) { var name = result.links[0][2]; if (!player.storage.dcfaqi) player.when({ global: "phaseAfter" }).then(() => delete player.storage.dcfaqi); player.markAuto("dcfaqi", name); player.chooseUseTarget({ name: name, isCard: true }, true, false).logSkill = "dcfaqi"; } } else event.finish(); }, ai: { reverseEquip: true, }, }, //隅泣曹操 dcjianxiong: { audio: "rejianxiong", trigger: { player: "damageEnd", }, content() { "step 0"; if (get.itemtype(trigger.cards) == "cards" && get.position(trigger.cards[0], true) == "o") { player.gain(trigger.cards, "gain2"); } player.draw(player.countMark("dcjianxiong") + 1, "nodelay"); "step 1"; if (player.countMark("dcjianxiong") < 4) player.addMark("dcjianxiong", 1, false); }, marktext: "雄", intro: { markcount(storage, player) { return player.countMark("dcjianxiong") + 1; }, content(storage, player) { return "摸牌数为" + (player.countMark("dcjianxiong") + 1); }, }, ai: { maixie: true, maixie_hp: true, effect: { target(card, player, target) { if (player.hasSkillTag("jueqing", false, target)) return [1, -1]; if (get.tag(card, "damage") && player != target) { var cards = card.cards, evt = _status.event; if (evt.player == target && card.name == "damage" && evt.getParent().type == "card") cards = evt.getParent().cards.filterInD(); if (target.hp <= 1) return; if (get.itemtype(cards) != "cards") return; for (var i of cards) { if (get.name(i, target) == "tao") return [1, 5 + player.countMark("dcjianxiong") / 2]; } if (get.value(cards, target) >= 7 - player.countMark("dcjianxiong") / 2 + target.getDamagedHp()) return [1, 3 + player.countMark("dcjianxiong") / 2]; return [1, 0.6 + player.countMark("dcjianxiong") / 2]; } }, }, }, }, //缺德刘备 dcrende: { audio: "rerende", enable: "phaseUse", filter(event, player) { return game.hasPlayer(current => { return lib.skill.dcrende.filterTarget(null, player, current); }); }, discard: false, lose: false, delay: false, filterTarget(card, player, target) { if (player.getStorage("dcrende_targeted").includes(target)) return false; return player != target && target.countGainableCards(player, "h") > 1; }, content() { "step 0"; player.addTempSkill("dcrende_targeted", "phaseUseAfter"); player.markAuto("dcrende_targeted", [target]); player.gainPlayerCard(target, "h", true, 2); "step 1"; var list = []; for (var name of lib.inpile) { if (get.type(name) != "basic") continue; var card = { name: name, isCard: true }; if ( lib.filter.cardUsable(card, player, event.getParent("chooseToUse")) && game.hasPlayer(current => { return player.canUse(card, current); }) ) { list.push(["基本", "", name]); } if (name == "sha") { for (var nature of lib.inpile_nature) { card.nature = nature; if ( lib.filter.cardUsable(card, player, event.getParent("chooseToUse")) && game.hasPlayer(current => { return player.canUse(card, current); }) ) { list.push(["基本", "", name, nature]); } } } } if (list.length) { player.chooseButton(["是否视为使用一张基本牌?", [list, "vcard"]]).set("ai", function (button) { var player = _status.event.player; var card = { name: button.link[2], nature: button.link[3], isCard: true, }; if (card.name == "tao") { if (player.hp == 1 || (player.hp == 2 && !player.hasShan()) || player.needsToDiscard()) return 5; return 1; } if (card.name == "sha") { if ( game.hasPlayer(function (current) { return player.canUse(card, current) && get.effect(current, card, player, player) > 0; }) ) { if (card.nature == "fire") return 2.95; if (card.nature == "thunder" || card.nature == "ice") return 2.92; return 2.9; } return 0; } if (card.name == "jiu") { return 0.5; } return 0; }); } else { event.finish(); } "step 2"; if (result && result.bool && result.links[0]) { var card = { name: result.links[0][2], nature: result.links[0][3], isCard: true, }; player.chooseUseTarget(card, true); } }, subSkill: { targeted: { onremove: true, charlotte: true, }, }, ai: { fireAttack: true, order(skill, player) { return 10; }, result: { target(player, target) { if (target.hasSkillTag("noh")) return -0.1; return -2; }, }, threaten: 3, }, }, //会玩孙权 dczhiheng: { audio: "rezhiheng", init: player => { player.storage.dczhiheng_hit = []; }, enable: "phaseUse", position: "he", filterCard: lib.filter.cardDiscardable, discard: false, lose: false, delay: false, selectCard: [1, Infinity], filter(event, player) { var skill = player.getStat().skill; return !skill.dczhiheng || skill.dczhiheng < 1 + player.getStorage("dczhiheng_hit").length; }, check(card) { var player = _status.event.player; if ( get.position(card) == "h" && !player.countCards("h", "du") && (player.hp > 2 || !player.countCards("h", function (card) { return get.value(card) >= 8; })) ) { return 1; } return 6 - get.value(card); }, group: "dczhiheng_add", content() { "step 0"; player.discard(cards); event.num = 1; var hs = player.getCards("h"); if (!hs.length) event.num = 0; for (var i = 0; i < hs.length; i++) { if (!cards.includes(hs[i])) { event.num = 0; break; } } "step 1"; player.draw(event.num + cards.length); }, subSkill: { add: { audio: 2, trigger: { source: "damageSource", }, forced: true, locked: false, filter(event, player) { return !player.getStorage("dczhiheng_hit").includes(event.player); }, content() { player.addTempSkill("dczhiheng_hit"); player.markAuto("dczhiheng_hit", [trigger.player]); }, }, hit: { charlotte: true, onremove: player => { player.storage.dczhiheng_hit = []; }, mark: true, marktext: "衡", intro: { markcount(storage) { if (storage) return storage.length; return 0; }, content: "本回合已对$造成过伤害", }, }, }, ai: { order(item, player) { if ( player.hasCard(i => { return get.value(i) > Math.max(6, 9 - player.hp); }, "he") ) return 1; return 10; }, result: { player: 1, }, nokeep: true, skillTagFilter(player, tag, arg) { if (tag === "nokeep") return ( (!arg || (arg && arg.card && get.name(arg.card) === "tao")) && player.isPhaseUsing() && player.countSkill("dczhiheng") < 1 + player.getStorage("dczhiheng_hit").length && player.hasCard(card => { return get.name(card) !== "tao"; }, "h") ); }, threaten: 1.55, }, }, //朱铁雄 dcbianzhuang: { audio: 2, enable: "phaseUse", usable: 1, content() { "step 0"; var list = []; for (var i in lib.skill.dcbianzhuang.characterMap) { if (lib.character[i] && get.is.object(lib.skill[lib.skill.dcbianzhuang.characterMap[i]])) list.push(i); } var characters = list.randomGets(player.storage.dcbianzhuang_inited ? 3 : 2); if (!characters.length) { event.finish(); return; } var skills = characters.map(i => lib.skill.dcbianzhuang.characterMap[i]); player.chooseControl(skills).set("dialog", ["选择获得一个技能并“变装”", [characters, "character"]]); "step 1"; var skill = result.control; player.addTempSkills(skill, "dcbianzhuangAfter"); for (var i in lib.skill.dcbianzhuang.characterMap) { if (lib.skill.dcbianzhuang.characterMap[i] == skill) { player.flashAvatar("dcbianzhuang", i); player.popup(skill); game.log(player, "“变装”为了", "#b" + get.translation(i)); break; } } player.chooseUseTarget("sha", true, false, "nodistance"); "step 2"; if (result.bool && !player.storage.dcbianzhuang_inited) { player.addMark("dcbianzhuang", 1, false); if (player.countMark("dcbianzhuang") > 2) { player.storage.dcbianzhuang_inited = true; player.reinitCharacter("zhutiexiong", "wu_zhutiexiong"); } } }, group: "dcbianzhuang_refresh", ai: { order: 16, result: { player(player) { if (player.hasValueTarget("sha", false)) return 1; return 0; }, }, effect: { target(card, player, target, current) { if (player == target && player.isPhaseUsing() && get.type(card) == "equip") { if (player.hasValueTarget("sha", false) && typeof player.getStat("skill").dcbianzhuang == "number") return [1, 3]; } }, }, }, subSkill: { refresh: { trigger: { player: "useCardAfter" }, forced: true, filter(event, player) { return get.type2(event.card, false) == "equip" && typeof player.getStat("skill").dcbianzhuang == "number"; }, content() { var stat = player.getStat("skill"); delete stat.dcbianzhuang; }, }, }, characterMap: { re_zhangchunhua: "rejueqing", wangshuang: "spzhuilie", re_machao: "retieji", ol_weiyan: "xinkuanggu", re_lvbu: "wushuang", re_huangzhong: "xinliegong", ol_pangde: "rejianchu", ol_zhurong: "lieren", re_masu: "rezhiman", re_panzhangmazhong: "reanjian", mayunlu: "fengpo", re_quyi: "refuqi", }, }, //小约翰可汗 dctongliao: { audio: 3, trigger: { player: "phaseDrawAfter" }, direct: true, locked: false, filter(event, player) { return player.countCards("h") > 0; }, content() { "step 0"; player .chooseCard("h", get.prompt("dctongliao"), "选择一张牌标记为“通辽”", function (card, player) { if (card.hasGaintag("dctongliao")) return false; var num = get.number(card, player); return !player.hasCard(card2 => { return card != card2 && get.number(card2, player) < num; }); }) .set("ai", function (card) { var player = _status.event.player; return 1 + Math.max(0, player.getUseValue(card, null, true)); }); "step 1"; if (result.bool) { player.logSkill("dctongliao"); player.addGaintag(result.cards, "dctongliao"); game.delayx(); } }, mod: { aiOrder(player, card, num) { if (get.itemtype(card) == "card" && card.hasGaintag("dctongliao")) return num + 0.6; }, }, group: "dctongliao_draw", subSkill: { draw: { trigger: { player: ["loseAfter"], global: ["equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"], }, filter(event, player) { var evt = event.getl(player); if (!evt || !evt.hs || !evt.hs.length) return false; if (event.name == "lose") { for (var i in event.gaintag_map) { if (event.gaintag_map[i].includes("dctongliao")) return true; } return false; } return player.hasHistory("lose", function (evt) { if (event != evt.getParent()) return false; for (var i in evt.gaintag_map) { if (evt.gaintag_map[i].includes("dctongliao")) return true; } return false; }); }, forced: true, content() { var num = 0; var cards = trigger.getl(player).hs, ids = []; if (trigger.name == "lose") { for (var i in trigger.gaintag_map) { if (trigger.gaintag_map[i].includes("dctongliao")) ids.push(i); } } else player.getHistory("lose", function (evt) { if (trigger != evt.getParent()) return false; for (var i in evt.gaintag_map) { if (evt.gaintag_map[i].includes("dctongliao")) ids.push(i); } }); for (var card of cards) { if (ids.includes(card.cardid)) num += get.number(card, player); } if (num > 0) player.draw(num); }, }, }, }, dcwudao: { audio: 3, trigger: { player: "useCardAfter" }, frequent: true, filter(event, player) { if (player.getStorage("dcwudao_effect").includes(get.type2(event.card, false))) return false; var history = player.getHistory("useCard"), index = history.indexOf(event); if (index < 1) return false; var evt = history[index - 1]; return get.type2(event.card, false) == get.type2(evt.card, false); }, prompt2(event) { return "令你本回合使用" + get.translation(get.type2(event.card, false)) + "牌时不可被响应且伤害+1"; }, content() { player.addTempSkill("dcwudao_effect"); player.markAuto("dcwudao_effect", [get.type2(trigger.card, false)]); }, subSkill: { effect: { trigger: { player: "useCard" }, forced: true, popup: false, onremove: true, filter(event, player) { return player.getStorage("dcwudao_effect").includes(get.type2(event.card, false)); }, content() { if (get.tag(trigger.card, "damage") > 0) trigger.baseDamage++; trigger.directHit.addArray(game.filterPlayer()); }, intro: { content: "已经悟到了$牌" }, ai: { directHit_ai: true, skillTagFilter(player, tag, arg) { if (arg && arg.card && player.getStorage("dcwudao_effect").includes(get.type2(arg.card))) return true; return false; }, }, }, }, }, //叶诗文 clbjisu: { audio: 2, trigger: { player: "phaseJudgeBefore" }, direct: true, content() { "step 0"; var check = player.countCards("h") > 2; player .chooseTarget(get.prompt("clbjisu"), "跳过判定阶段和摸牌阶段,视为对一名其他角色使用一张【杀】", function (card, player, target) { if (player == target) return false; return player.canUse({ name: "sha" }, target, false); }) .set("check", check) .set("ai", function (target) { if (!_status.event.check) return 0; return get.effect(target, { name: "sha" }, _status.event.player); }) .setHiddenSkill("clbjisu"); "step 1"; if (result.bool) { player.useCard({ name: "sha", isCard: true }, result.targets[0], false, "clbjisu"); trigger.cancel(); player.skip("phaseDraw"); } }, }, clbshuiyong: { audio: 2, trigger: { player: "damageBegin4" }, filter(event) { return event.hasNature("fire"); }, forced: true, content() { trigger.cancel(); }, ai: { nofire: true, effect: { target(card, player, target, current) { if (get.tag(card, "fireDamage")) return "zerotarget"; }, }, }, }, //孙杨 clbshuijian: { audio: 2, trigger: { player: "phaseDrawBegin2" }, frequent: true, filter(event, player) { return !event.numFixed; }, content() { var num = 1 + Math.floor(player.countCards("e") / 2); trigger.num += num; }, }, //李白 dclbjiuxian: { audio: 2, enable: "chooseToUse", locked: false, viewAs: { name: "jiu" }, check: card => 6.5 - get.value(card), filterCard(card) { var info = get.info(card); if (!info || (info.type != "trick" && info.type != "delay")) return false; if (info.notarget) return false; if (info.selectTarget != undefined) { if (Array.isArray(info.selectTarget)) { if (info.selectTarget[0] < 0) return !info.toself; return info.selectTarget[0] != 1 || info.selectTarget[1] != 1; } else { if (info.selectTarget < 0) return !info.toself; return info.selectTarget != 1; } } return false; }, viewAsFilter(player) { if (_status.connectMode && player.countCards("hs") > 0) return true; return player.hasCard(lib.skill.dclbjiuxian.filterCard, "hs"); }, ai: { order: (item, player) => get.order({ name: "jiu" }, player), }, mod: { cardUsable(card) { if (card.name == "jiu") return Infinity; }, }, }, dcshixian: { audio: 2, trigger: { player: "useCard" }, //frequent:true, //direct:true, locked: false, filter(event, player) { var history = player.getAllHistory("useCard"), index = history.indexOf(event); if (index < 1) return false; var evt = history[index - 1]; return get.is.yayun(get.translation(event.card.name), get.translation(evt.card.name)); }, filterx(event) { if (event.targets.length == 0) return false; var type = get.type(event.card); if (type != "basic" && type != "trick") return false; return true; }, prompt2(event, player) { if (lib.skill.dcshixian.filterx(event)) return "摸一张牌并令" + get.translation(event.card) + "额外结算一次?"; return "摸一张牌。"; }, check(event, player) { if (lib.skill.dcshixian.filterx(event)) return !get.tag(event.card, "norepeat"); return true; }, content() { player.draw(); if (lib.skill.dcshixian.filterx(trigger)) { trigger.effectCount++; game.log(trigger.card, "额外结算一次"); } }, mod: { aiOrder(player, card, num) { if (typeof card == "object" && !get.tag(card, "norepeat")) { var history = player.getAllHistory("useCard"); if (history.length > 0) { var cardx = history[history.length - 1].card; if (get.is.yayun(get.translation(cardx.name), get.translation(card.name))) return num + 20; } } }, }, init(player) { player.addSkill("dcshixian_yayun"); var history = player.getAllHistory("useCard"); if (history.length) { player.addGaintag( player.getCards("h", card => { return get.is.yayun(get.translation(card.name), get.translation(history[history.length - 1].card.name)); }), "dcshixian_yayun" ); } }, onremove(player) { player.removeSkill("dcshixian_yayun"); player.removeGaintag("dcshixian_yayun"); }, subSkill: { yayun: { charlotte: true, trigger: { player: "useCard1" }, filter(event, player) { return player.countCards("h") > 0; }, direct: true, priority: 11 + 45 + 14 + 19 + 19 + 810, content() { "step 0"; player.removeGaintag("dcshixian_yayun"); "step 1"; player.addGaintag( player.getCards("h", card => { return get.is.yayun(get.translation(card.name), get.translation(trigger.card.name)); }), "dcshixian_yayun" ); }, }, }, }, //龙王 dclonggong: { audio: 2, trigger: { player: "damageBegin4" }, usable: 1, filter(event, player) { return event.source && event.source.isIn(); }, logTarget: "source", check(event, player) { return get.attitude(player, event.source) >= 0 || player.hp <= Math.max(2, event.num); }, content() { "step 0"; trigger.cancel(); "step 1"; var card = get.cardPile2(function (card) { return get.type(card, null, false) == "equip"; }), source = trigger.source; if (card && source && source.isIn()) source.gain(card, "gain2"); }, ai: { filterDamage: true, skillTagFilter(player) { return !player.storage.counttrigger || !player.storage.counttrigger.dclonggong; }, }, }, dcsitian: { audio: 2, enable: "phaseUse", filter(event, player) { var colorx = false, hs = player.getCards("he"); if (hs.length < 2) return false; for (var card of hs) { if (!lib.filter.cardDiscardable(card, player)) continue; var color = get.color(card, player); if (color == "none") continue; if (!colorx) colorx = color; else if (colorx != color) return true; } return false; }, filterCard(card, player) { var color = get.color(card, player); if (color == "none") return false; return !ui.selected.cards.length || get.color(ui.selected.cards[0]) != color; }, selectCard: 2, complexCard: true, prompt: "弃置两张颜色不同的牌并改变天气", check: card => 4.5 - get.value(card), content() { "step 0"; var list = ["烈日", "雷电", "大浪", "暴雨", "大雾"].randomGets(2); player.chooseButton(true, ["请选择执行一个天气", [list.map(i => [i, '