From 5427da93cb5cbf64e4344f83dba159037fa5c25c Mon Sep 17 00:00:00 2001 From: Rintim Date: Tue, 16 Apr 2024 02:36:20 +0800 Subject: [PATCH] pref: format @/card. --- card/extra.js | 1837 ++++----- card/gujian.js | 3210 ++++++++-------- card/guozhan.js | 3345 ++++++++-------- card/gwent.js | 3574 ++++++++--------- card/hearth.js | 1497 ++++---- card/huanlekapai.js | 454 +-- card/mtg.js | 1494 ++++---- card/sp.js | 1107 +++--- card/standard.js | 6497 +++++++++++++++++-------------- card/swd.js | 8841 ++++++++++++++++++++++--------------------- card/yingbian.js | 1613 ++++---- card/yongjian.js | 1355 ++++--- card/yunchou.js | 1522 ++++---- card/zhenfa.js | 594 +-- card/zhulu.js | 1492 ++++---- 15 files changed, 20464 insertions(+), 17968 deletions(-) diff --git a/card/extra.js b/card/extra.js index 81fbc562b..175aa4119 100644 --- a/card/extra.js +++ b/card/extra.js @@ -1,726 +1,834 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card',function(){ +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'extra', - connect:true, - card:{ - muniu:{ - fullskin:true, - type:'equip', - subtype:'equip5', - nomod:true, - onEquip:function(){ - if(card&&card.cards&&card.cards.length){ - player.directgains(card.cards,null,'muniu'); + name: "extra", + connect: true, + card: { + muniu: { + fullskin: true, + type: "equip", + subtype: "equip5", + nomod: true, + onEquip: function () { + if (card && card.cards && card.cards.length) { + player.directgains(card.cards, null, "muniu"); } - player.markSkill('muniu_skill'); + player.markSkill("muniu_skill"); }, - forceDie:true, - onLose:function(){ - delete player.getStat('skill').muniu_skill; - player.unmarkSkill('muniu_skill'); - if(!card||!card.cards||!card.cards.length) return; - if((!event.getParent(2)||event.getParent(2).name!='swapEquip')&&(event.getParent().type!='equip'||event.getParent().swapEquip)){ - player.lose(card.cards,ui.discardPile); - player.$throw(card.cards,1000); - player.popup('muniu'); - game.log(card,'掉落了',card.cards); - card.cards.length=0; - } - else{ - player.lose(card.cards,ui.special); + forceDie: true, + onLose: function () { + delete player.getStat("skill").muniu_skill; + player.unmarkSkill("muniu_skill"); + if (!card || !card.cards || !card.cards.length) return; + if ( + (!event.getParent(2) || event.getParent(2).name != "swapEquip") && + (event.getParent().type != "equip" || event.getParent().swapEquip) + ) { + player.lose(card.cards, ui.discardPile); + player.$throw(card.cards, 1000); + player.popup("muniu"); + game.log(card, "掉落了", card.cards); + card.cards.length = 0; + } else { + player.lose(card.cards, ui.special); } }, - clearLose:true, - equipDelay:false, - loseDelay:false, - skills:['muniu_skill','muniu_skill7'], - ai:{ - equipValue:function(card){ - if(card.card) return 7+card.card.length; + clearLose: true, + equipDelay: false, + loseDelay: false, + skills: ["muniu_skill", "muniu_skill7"], + ai: { + equipValue: function (card) { + if (card.card) return 7 + card.card.length; return 7; }, - basic:{ - equipValue:7 - } - } + basic: { + equipValue: 7, + }, + }, }, - jiu:{ - audio:true, - fullskin:true, - type:"basic", - toself:true, - enable:function(event,player){ + jiu: { + audio: true, + fullskin: true, + type: "basic", + toself: true, + enable: function (event, player) { //return !player.hasSkill('jiu'); return true; }, - lianheng:true, - logv:false, - savable:function(card,player,dying){ - return dying==player||player.hasSkillTag('jiuOther',null,dying,true); + lianheng: true, + logv: false, + savable: function (card, player, dying) { + return dying == player || player.hasSkillTag("jiuOther", null, dying, true); }, - usable:1, - selectTarget:-1, - modTarget:true, - filterTarget:function(card,player,target){ - return target==player; + usable: 1, + selectTarget: -1, + modTarget: true, + filterTarget: function (card, player, target) { + return target == player; }, - content:function(){ - if(typeof event.baseDamage!='number') event.baseDamage=1; - if(target.isDying()||event.getParent(2).type=='dying'){ + content: function () { + if (typeof event.baseDamage != "number") event.baseDamage = 1; + if (target.isDying() || event.getParent(2).type == "dying") { target.recover(); - if(_status.currentPhase==target){ + if (_status.currentPhase == target) { target.getStat().card.jiu--; } - } - else{ - game.addVideo('jiuNode',target,true); - if(cards&&cards.length){ - card=cards[0]; + } else { + game.addVideo("jiuNode", target, true); + if (cards && cards.length) { + card = cards[0]; } - if(!target.storage.jiu) target.storage.jiu=0; - target.storage.jiu+=event.baseDamage; - game.broadcastAll(function(target,card,gain2){ - target.addSkill('jiu'); - if(!target.node.jiu&&lib.config.jiu_effect){ - target.node.jiu=ui.create.div('.playerjiu',target.node.avatar); - target.node.jiu2=ui.create.div('.playerjiu',target.node.avatar2); - } - if(gain2&&card.clone&&(card.clone.parentNode==target.parentNode||card.clone.parentNode==ui.arena)){ - card.clone.moveDelete(target); - } - },target,card,target==targets[0]&&cards.length==1); - if(target==targets[0]&&cards.length==1){ - if(card.clone&&(card.clone.parentNode==target.parentNode||card.clone.parentNode==ui.arena)){ - game.addVideo('gain2',target,get.cardsInfo([card])); + if (!target.storage.jiu) target.storage.jiu = 0; + target.storage.jiu += event.baseDamage; + game.broadcastAll( + function (target, card, gain2) { + target.addSkill("jiu"); + if (!target.node.jiu && lib.config.jiu_effect) { + target.node.jiu = ui.create.div(".playerjiu", target.node.avatar); + target.node.jiu2 = ui.create.div(".playerjiu", target.node.avatar2); + } + if ( + gain2 && + card.clone && + (card.clone.parentNode == target.parentNode || + card.clone.parentNode == ui.arena) + ) { + card.clone.moveDelete(target); + } + }, + target, + card, + target == targets[0] && cards.length == 1 + ); + if (target == targets[0] && cards.length == 1) { + if ( + card.clone && + (card.clone.parentNode == target.parentNode || + card.clone.parentNode == ui.arena) + ) { + game.addVideo("gain2", target, get.cardsInfo([card])); } } } }, - ai:{ - basic:{ - useful:(card,i)=>{ - if(_status.event.player.hp>1){ - if(i===0) return 4; + ai: { + basic: { + useful: (card, i) => { + if (_status.event.player.hp > 1) { + if (i === 0) return 4; return 1; } - if(i===0) return 7.3; + if (i === 0) return 7.3; return 3; }, - value:(card,player,i)=>{ - if(player.hp>1){ - if(i===0) return 5; + value: (card, player, i) => { + if (player.hp > 1) { + if (i === 0) return 5; return 1; } - if(i===0) return 7.3; + if (i === 0) return 7.3; return 3; - } + }, }, - order:()=>{ - if(_status.event.dying) return 9; - let sha=get.order({name:'sha'}); - if(sha>0) return sha+0.2; + order: () => { + if (_status.event.dying) return 9; + let sha = get.order({ name: "sha" }); + if (sha > 0) return sha + 0.2; return 0; }, - result:{ - target:(player,target,card)=>{ - if(target&&target.isDying()) return 2; - if(!target || target._jiu_temp || !target.isPhaseUsing()) return 0; - let usable=target.getCardUsable('sha'); - if(!usable || lib.config.mode==='stone'&&!player.isMin()&&player.getActCount()+1>=player.actcount || !target.mayHaveSha(player,'use',card)) return 0; - let effs={order:0},temp; - target.getCards('hs',i=>{ - if(get.name(i)!=='sha' || ui.selected.cards.includes(i)) return false; - temp=get.order(i,target); - if(tempeffs.order) effs={order:temp}; - effs[i.cardid]={ - card:i, - target:null, - eff:0 + result: { + target: (player, target, card) => { + if (target && target.isDying()) return 2; + if (!target || target._jiu_temp || !target.isPhaseUsing()) return 0; + let usable = target.getCardUsable("sha"); + if ( + !usable || + (lib.config.mode === "stone" && + !player.isMin() && + player.getActCount() + 1 >= player.actcount) || + !target.mayHaveSha(player, "use", card) + ) + return 0; + let effs = { order: 0 }, + temp; + target.getCards("hs", (i) => { + if (get.name(i) !== "sha" || ui.selected.cards.includes(i)) return false; + temp = get.order(i, target); + if (temp < effs.order) return false; + if (temp > effs.order) effs = { order: temp }; + effs[i.cardid] = { + card: i, + target: null, + eff: 0, }; }); delete effs.order; - for(let i in effs){ - if(!lib.filter.filterCard(effs[i].card,target)) continue; - game.filterPlayer(current=>{ - if(get.attitude(target,current)>=0 || !target.canUse(effs[i].card,current,null,true) || current.hasSkillTag('filterDamage',null,{ - player:target, - card:effs[i].card, - jiu:true - })) return false; - temp=get.effect(current,effs[i].card,target,player); - if(temp<=effs[i].eff) return false; - effs[i].target=current; - effs[i].eff=temp; + for (let i in effs) { + if (!lib.filter.filterCard(effs[i].card, target)) continue; + game.filterPlayer((current) => { + if ( + get.attitude(target, current) >= 0 || + !target.canUse(effs[i].card, current, null, true) || + current.hasSkillTag("filterDamage", null, { + player: target, + card: effs[i].card, + jiu: true, + }) + ) + return false; + temp = get.effect(current, effs[i].card, target, player); + if (temp <= effs[i].eff) return false; + effs[i].target = current; + effs[i].eff = temp; return false; }); - if(!effs[i].target) continue; - if(target.hasSkillTag('directHit_ai',true,{ - target:effs[i].target, - card:i - },true) || usable===1&&(target.needsToDiscard()>Math.max(0,3-target.hp) || !effs[i].target.mayHaveShan(player,'use',effs[i].target.getCards(i=>{ - return i.hasGaintag('sha_notshan'); - })))){ + if (!effs[i].target) continue; + if ( + target.hasSkillTag( + "directHit_ai", + true, + { + target: effs[i].target, + card: i, + }, + true + ) || + (usable === 1 && + (target.needsToDiscard() > Math.max(0, 3 - target.hp) || + !effs[i].target.mayHaveShan( + player, + "use", + effs[i].target.getCards((i) => { + return i.hasGaintag("sha_notshan"); + }) + ))) + ) { delete target._jiu_temp; return 1; } } delete target._jiu_temp; return 0; - } + }, + }, + tag: { + save: 1, + recover: 0.1, }, - tag:{ - save:1, - recover:0.1, - } - } - }, - huogong:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - //cardnature:'fire', - filterTarget:function(card,player,target){ - //if(player!=game.me&&player.countCards('h')<2) return false; - return target.countCards('h')>0; }, - content:function(){ - "step 0" - if(target.countCards('h')==0){ + }, + huogong: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + //cardnature:'fire', + filterTarget: function (card, player, target) { + //if(player!=game.me&&player.countCards('h')<2) return false; + return target.countCards("h") > 0; + }, + content: function () { + "step 0"; + if (target.countCards("h") == 0) { event.finish(); return; - } - else if(target.countCards('h')==1) event._result={cards:target.getCards('h')}; - else target.chooseCard(true).ai=function(card){ - if(_status.event.getRand()<0.5) return Math.random(); - return get.value(card); - }; - "step 1" - target.showCards(result.cards).setContent(function(){}); - event.dialog=ui.create.dialog(get.translation(target)+'展示的手牌',result.cards); - event.videoId=lib.status.videoId++; + } else if (target.countCards("h") == 1) event._result = { cards: target.getCards("h") }; + else + target.chooseCard(true).ai = function (card) { + if (_status.event.getRand() < 0.5) return Math.random(); + return get.value(card); + }; + "step 1"; + target.showCards(result.cards).setContent(function () {}); + event.dialog = ui.create.dialog(get.translation(target) + "展示的手牌", result.cards); + event.videoId = lib.status.videoId++; - game.broadcast('createDialog',event.videoId,get.translation(target)+'展示的手牌',result.cards); - game.addVideo('cardDialog',null,[get.translation(target)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]); - event.card2=result.cards[0]; - game.log(target,'展示了',event.card2); - game.addCardKnower(result.cards, 'everyone'); - event._result={}; - player.chooseToDiscard({suit:get.suit(event.card2)},function(card){ - var evt=_status.event.getParent(); - if(get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){ - return 6.2+Math.min(4,evt.player.hp)-get.value(card,evt.player); - } - return -1; - }).set('prompt',false); + game.broadcast( + "createDialog", + event.videoId, + get.translation(target) + "展示的手牌", + result.cards + ); + game.addVideo("cardDialog", null, [ + get.translation(target) + "展示的手牌", + get.cardsInfo(result.cards), + event.videoId, + ]); + event.card2 = result.cards[0]; + game.log(target, "展示了", event.card2); + game.addCardKnower(result.cards, "everyone"); + event._result = {}; + player + .chooseToDiscard({ suit: get.suit(event.card2) }, function (card) { + var evt = _status.event.getParent(); + if (get.damageEffect(evt.target, evt.player, evt.player, "fire") > 0) { + return 6.2 + Math.min(4, evt.player.hp) - get.value(card, evt.player); + } + return -1; + }) + .set("prompt", false); game.delay(2); - "step 2" - if(result.bool){ - target.damage('fire'); - } - else{ - target.addTempSkill('huogong2'); + "step 2"; + if (result.bool) { + target.damage("fire"); + } else { + target.addTempSkill("huogong2"); } event.dialog.close(); - game.addVideo('cardDialog',null,event.videoId); - game.broadcast('closeDialog',event.videoId); + game.addVideo("cardDialog", null, event.videoId); + game.broadcast("closeDialog", event.videoId); }, - ai:{ - basic:{ - order:9.2, - value:[3,1], - useful:0.6, + ai: { + basic: { + order: 9.2, + value: [3, 1], + useful: 0.6, }, - wuxie:function(target,card,player,viewer,status){ - if(get.attitude(viewer,player._trueMe||player)>0) return 0; - if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0; - if(_status.event.getRand('huogong_wuxie')*4>player.countCards('h')) return 0; + wuxie: function (target, card, player, viewer, status) { + if (get.attitude(viewer, player._trueMe || player) > 0) return 0; + if ( + status * + get.attitude(viewer, target) * + get.effect(target, card, player, target) >= + 0 + ) + return 0; + if (_status.event.getRand("huogong_wuxie") * 4 > player.countCards("h")) return 0; }, - result:{ - player:function(player){ - var nh=player.countCards('h'); - if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard(new lib.element.VCard({name:'huogong'}),player,_status.event)){ + result: { + player: function (player) { + var nh = player.countCards("h"); + if (nh <= player.hp && nh <= 4 && _status.event.name == "chooseToUse") { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard( + new lib.element.VCard({ name: "huogong" }), + player, + _status.event + ) + ) { return -10; } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='huogong') return -10; - if(viewAs&&viewAs.name=='huogong') return -10; + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "huogong") return -10; + if (viewAs && viewAs.name == "huogong") return -10; } } return 0; }, - target:function(player,target){ - if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; - if(player.countCards('h')<=1) return 0; - if(_status.event.player == player){ - if(target.isAllCardsKnown(player)){ - if(!target.countCards('h',card=>{ - return player.countCards('h',card2=>{ - return get.suit(card2) == get.suit(card); - }); - })){ + target: function (player, target) { + if (target.hasSkill("huogong2") || target.countCards("h") == 0) return 0; + if (player.countCards("h") <= 1) return 0; + if (_status.event.player == player) { + if (target.isAllCardsKnown(player)) { + if ( + !target.countCards("h", (card) => { + return player.countCards("h", (card2) => { + return get.suit(card2) == get.suit(card); + }); + }) + ) { return 0; } } } - if(target==player){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard(new lib.element.VCard({name:'huogong'}),player,_status.event)){ + if (target == player) { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard( + new lib.element.VCard({ name: "huogong" }), + player, + _status.event + ) + ) { return -1.15; } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='huogong') return -1.15; - if(viewAs&&viewAs.name=='huogong') return -1.15; + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "huogong") return -1.15; + if (viewAs && viewAs.name == "huogong") return -1.15; } return 0; } return -1.15; - } + }, }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1, - norepeat:1 - } - } + tag: { + damage: 1, + fireDamage: 1, + natureDamage: 1, + norepeat: 1, + }, + }, }, - tiesuo:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - selectTarget:[1,2], - complexTarget:true, - content:function(){ + tiesuo: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + selectTarget: [1, 2], + complexTarget: true, + content: function () { target.link(); }, - recastable:true, - ai:{ - wuxie:(target,card,player,viewer, status)=>{ - if(status*get.attitude(viewer,player._trueMe||player)>0 || target.hasSkillTag('nodamage') || target.hasSkillTag('nofire') || target.hasSkillTag('nothunder') || get.attitude(viewer,player)>0 || (1+target.countCards('hs'))*_status.event.getRand()>1.57) return 0; + recastable: true, + ai: { + wuxie: (target, card, player, viewer, status) => { + if ( + status * get.attitude(viewer, player._trueMe || player) > 0 || + target.hasSkillTag("nodamage") || + target.hasSkillTag("nofire") || + target.hasSkillTag("nothunder") || + get.attitude(viewer, player) > 0 || + (1 + target.countCards("hs")) * _status.event.getRand() > 1.57 + ) + return 0; }, - basic:{ - order:7.3, - useful:1.2, - value:4 + basic: { + order: 7.3, + useful: 1.2, + value: 4, }, - result:{ - target:(player,target)=>{ - if(target.hasSkillTag('link')) return 0; - let curs = game.filterPlayer(current=>{ - if(current.hasSkillTag('nodamage')) return false; - return !current.hasSkillTag('nofire') || !current.hasSkillTag('nothunder'); + result: { + target: (player, target) => { + if (target.hasSkillTag("link")) return 0; + let curs = game.filterPlayer((current) => { + if (current.hasSkillTag("nodamage")) return false; + return !current.hasSkillTag("nofire") || !current.hasSkillTag("nothunder"); }); - if(curs.length<2) return 0; - let f = target.hasSkillTag('nofire'), - t = target.hasSkillTag('nothunder'), + if (curs.length < 2) return 0; + let f = target.hasSkillTag("nofire"), + t = target.hasSkillTag("nothunder"), res = 0.9; - if(f&&t || target.hasSkillTag('nodamage')) return 0; - if(f || t) res = 0.45; - if(!f&&target.getEquip('tengjia')) res *= 2; - if(!target.isLinked()) res = -res; - if(ui.selected.targets.length) return res; + if ((f && t) || target.hasSkillTag("nodamage")) return 0; + if (f || t) res = 0.45; + if (!f && target.getEquip("tengjia")) res *= 2; + if (!target.isLinked()) res = -res; + if (ui.selected.targets.length) return res; let fs = 0, es = 0, - att = get.attitude(player,target), + att = get.attitude(player, target), linkf = false, alink = true; - curs.forEach(i=>{ - let atti = get.attitude(player,i); - if(atti>0){ + curs.forEach((i) => { + let atti = get.attitude(player, i); + if (atti > 0) { fs++; - if(i.isLinked()) linkf = true; - } - else if(atti<0){ + if (i.isLinked()) linkf = true; + } else if (atti < 0) { es++; - if(!i.isLinked()) alink = false; + if (!i.isLinked()) alink = false; } }); - if(es<2&&!alink) { - if(att<=0 || att>0 && linkf && fs<2) return 0; + if (es < 2 && !alink) { + if (att <= 0 || (att > 0 && linkf && fs < 2)) return 0; } return res; - } + }, + }, + tag: { + multitarget: 1, + multineg: 1, + norepeat: 1, }, - tag:{ - multitarget:1, - multineg:1, - norepeat:1 - } - } - }, - bingliang:{ - audio:true, - fullskin:true, - type:'delay', - range:{global:1}, - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player!=target); }, - judge:function(card){ - if(get.suit(card)=='club') return 1; + }, + bingliang: { + audio: true, + fullskin: true, + type: "delay", + range: { global: 1 }, + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player != target; + }, + judge: function (card) { + if (get.suit(card) == "club") return 1; return -2; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - effect:function(){ - if(result.bool==false){ - if(get.is.changban()) player.addTempSkill('bingliang_changban'); - else player.skip('phaseDraw'); + effect: function () { + if (result.bool == false) { + if (get.is.changban()) player.addTempSkill("bingliang_changban"); + else player.skip("phaseDraw"); } }, - ai:{ - basic:{ - order:1, - useful:1, - value:4, + ai: { + basic: { + order: 1, + useful: 1, + value: 4, }, - result:{ - target:function(player,target){ - if(target.hasJudge('caomu')) return 0; - return -2.7/Math.sqrt(target.countCards('h')+1); - } + result: { + target: function (player, target) { + if (target.hasJudge("caomu")) return 0; + return -2.7 / Math.sqrt(target.countCards("h") + 1); + }, + }, + tag: { + skip: "phaseDraw", }, - tag:{ - skip:'phaseDraw' - } - } - }, - hualiu:{ - fullskin:true, - type:'equip', - subtype:'equip3', - distance:{globalTo:1}, - }, - zhuque:{ - fullskin:true, - type:'equip', - subtype:'equip1', - //cardnature:'fire', - distance:{attackFrom:-3}, - ai:{ - basic:{ - equipValue:2 - } }, - skills:['zhuque_skill'] }, - guding:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-1}, - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['guding_skill'] + hualiu: { + fullskin: true, + type: "equip", + subtype: "equip3", + distance: { globalTo: 1 }, }, - tengjia:{ - fullskin:true, - type:'equip', - subtype:'equip2', + zhuque: { + fullskin: true, + type: "equip", + subtype: "equip1", //cardnature:'fire', - ai:{ - value:function(card,player,index,method){ - if(player.isDisabled(2)) return 0.01; - if(player.getEquips('tengjia').includes(card)){ - if(player.hasSkillTag('noDirectDamage')) return 10; - if(game.hasPlayer(function(current){ - return current!=player&&get.attitude(current,player)<0&¤t.hasSkillTag('fireAttack',null,null,true); - })) return 0; + distance: { attackFrom: -3 }, + ai: { + basic: { + equipValue: 2, + }, + }, + skills: ["zhuque_skill"], + }, + guding: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + ai: { + basic: { + equipValue: 2, + }, + }, + skills: ["guding_skill"], + }, + tengjia: { + fullskin: true, + type: "equip", + subtype: "equip2", + //cardnature:'fire', + ai: { + value: function (card, player, index, method) { + if (player.isDisabled(2)) return 0.01; + if (player.getEquips("tengjia").includes(card)) { + if (player.hasSkillTag("noDirectDamage")) return 10; + if ( + game.hasPlayer(function (current) { + return ( + current != player && + get.attitude(current, player) < 0 && + current.hasSkillTag("fireAttack", null, null, true) + ); + }) + ) + return 0; return 6; } - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); + var value = 0; + var info = get.info(card); + var current = player.getEquip(info.subtype); + if (current && card != current) { + value = get.value(current, player); } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; + var equipValue = info.ai.equipValue; + if (equipValue == undefined) { + equipValue = info.ai.basic.equipValue; } - if(typeof equipValue=='function'){ - if(method=='raw') return equipValue(card,player); - if(method=='raw2') return equipValue(card,player)-value; - return Math.max(0.1,equipValue(card,player)-value); + if (typeof equipValue == "function") { + if (method == "raw") return equipValue(card, player); + if (method == "raw2") return equipValue(card, player) - value; + return Math.max(0.1, equipValue(card, player) - value); } - if(typeof equipValue!='number') equipValue=0; - if(method=='raw') return equipValue; - if(method=='raw2') return equipValue-value; - return Math.max(0.1,equipValue-value); + if (typeof equipValue != "number") equipValue = 0; + if (method == "raw") return equipValue; + if (method == "raw2") return equipValue - value; + return Math.max(0.1, equipValue - value); }, - equipValue:function(card,player){ - if(player._tengjiaEv_temp) return Math.max(1,6-player.hp); - if(player.hasSkillTag('maixie')&&player.hp>1) return 0; - if(player.hasSkillTag('noDirectDamage')) return 10; - player._tengjiaEv_temp=true; - let eff=get.damageEffect(player,player,player,'fire'); + equipValue: function (card, player) { + if (player._tengjiaEv_temp) return Math.max(1, 6 - player.hp); + if (player.hasSkillTag("maixie") && player.hp > 1) return 0; + if (player.hasSkillTag("noDirectDamage")) return 10; + player._tengjiaEv_temp = true; + let eff = get.damageEffect(player, player, player, "fire"); delete player._tengjiaEv_temp; - if(eff>=0) return 10; - let num=4-game.countPlayer(function(current){ - if(get.attitude(current,player)<0){ - if(current.hasSkillTag('fireAttack',null,null,true)) return 3; - return 1; - } - return false; - }); - if(player.hp==1) num+=3; - if(player.hp==2) num+=1; + if (eff >= 0) return 10; + let num = + 4 - + game.countPlayer(function (current) { + if (get.attitude(current, player) < 0) { + if (current.hasSkillTag("fireAttack", null, null, true)) return 3; + return 1; + } + return false; + }); + if (player.hp == 1) num += 3; + if (player.hp == 2) num += 1; return num; }, - basic:{ - equipValue:3 + basic: { + equipValue: 3, }, }, - skills:['tengjia1','tengjia2','tengjia3'] + skills: ["tengjia1", "tengjia2", "tengjia3"], }, - baiyin:{ - fullskin:true, - type:'equip', - subtype:'equip2', - loseDelay:false, - onLose:function(){ - player.addTempSkill('baiyin_skill_lose') + baiyin: { + fullskin: true, + type: "equip", + subtype: "equip2", + loseDelay: false, + onLose: function () { + player.addTempSkill("baiyin_skill_lose"); }, - skills:['baiyin_skill'], - tag:{ - recover:1, + skills: ["baiyin_skill"], + tag: { + recover: 1, }, - ai:{ - order:9.5, - equipValue:function(card,player){ - if(player.hp==player.maxHp) return 5; - if(player.countCards('h','baiyin')) return 6; + ai: { + order: 9.5, + equipValue: function (card, player) { + if (player.hp == player.maxHp) return 5; + if (player.countCards("h", "baiyin")) return 6; return 0; }, - basic:{ - equipValue:5 - } - } + basic: { + equipValue: 5, + }, + }, }, }, - skill:{ - bingliang_changban:{ - cardSkill:true, - unique:true, - trigger:{player:'phaseDrawBegin'}, - silent:true, - content:function(){ + skill: { + bingliang_changban: { + cardSkill: true, + unique: true, + trigger: { player: "phaseDrawBegin" }, + silent: true, + content: function () { trigger.num--; }, - group:'bingliang_changban2' + group: "bingliang_changban2", }, - bingliang_changban2:{ - cardSkill:true, - trigger:{player:'phaseDrawAfter'}, - silent:true, - content:function(){ - if(player.enemy) player.enemy.draw(); - } - }, - muniu_skill:{ - equipSkill:true, - enable:'phaseUse', - usable:1, - filterCard:true, - check:function(card){ - if(card.name=='du') return 20; - var player=_status.event.player; - var nh=player.countCards('h'); - if(!player.needsToDiscard()){ - if(nh<3) return 0; - if(nh==3) return 5-get.value(card); - return 7-get.value(card); - } - return 10-get.useful(card); + bingliang_changban2: { + cardSkill: true, + trigger: { player: "phaseDrawAfter" }, + silent: true, + content: function () { + if (player.enemy) player.enemy.draw(); }, - discard:false, - lose:false, - delay:false, - sync:function(muniu){ - if(game.online){ + }, + muniu_skill: { + equipSkill: true, + enable: "phaseUse", + usable: 1, + filterCard: true, + check: function (card) { + if (card.name == "du") return 20; + var player = _status.event.player; + var nh = player.countCards("h"); + if (!player.needsToDiscard()) { + if (nh < 3) return 0; + if (nh == 3) return 5 - get.value(card); + return 7 - get.value(card); + } + return 10 - get.useful(card); + }, + discard: false, + lose: false, + delay: false, + sync: function (muniu) { + if (game.online) { return; } - if(!muniu.cards){ - muniu.cards=[]; + if (!muniu.cards) { + muniu.cards = []; } - for(var i=0;i0; + filter: function (event, player) { + return player.countCards("h") > 0; }, - prepare:function(cards,player){ - player.$give(1,player,false); + prepare: function (cards, player) { + player.$give(1, player, false); }, - content:function(){ - "step 0" - player.loseToSpecial(cards,'muniu'); - "step 1" - for(var i=0;i=3&&get.attitude(current,player)>=3){ + "step 2"; + var muniu = player.getEquip("muniu"); + var players = game.filterPlayer(function (current) { + if ( + current.canEquip(muniu) && + current != player && + !current.isTurnedOver() && + get.attitude(player, current) >= 3 && + get.attitude(current, player) >= 3 + ) { return true; } }); players.sort(lib.sort.seat); - var choice=players[0]; - var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){ - return !target.isMin()&&player!=target&&target.canEquip(_status.event.muniu); - }).set('muniu',muniu) - next.set('ai',function(target){ - return target==_status.event.choice?1:-1; + var choice = players[0]; + var next = player + .chooseTarget("是否移动木牛流马?", function (card, player, target) { + return ( + !target.isMin() && player != target && target.canEquip(_status.event.muniu) + ); + }) + .set("muniu", muniu); + next.set("ai", function (target) { + return target == _status.event.choice ? 1 : -1; }); - next.set('choice',choice); - "step 3" - if(result.bool){ - var card=player.getEquip('muniu'); + next.set("choice", choice); + "step 3"; + if (result.bool) { + var card = player.getEquip("muniu"); result.targets[0].equip(card); - player.$give(card,result.targets[0]); - player.line(result.targets,'green'); + player.$give(card, result.targets[0]); + player.line(result.targets, "green"); game.delay(); - } - else{ + } else { player.updateMarks(); } }, - ai:{ - order:1, - expose:0.1, - result:{ - player:1 - } + ai: { + order: 1, + expose: 0.1, + result: { + player: 1, + }, }, - mod:{ - cardEnabled2:function(card,player){ - if(!ui.selected.cards.length) return; - var muniu=player.getEquip('muniu'); - if(!muniu||!muniu.cards||!muniu.cards.length) return; - for(var i of ui.selected.cards){ - if(i==muniu&&muniu.cards.includes(card)) return false; - if(muniu.cards.includes(i)&&card==muniu) return false; + mod: { + cardEnabled2: function (card, player) { + if (!ui.selected.cards.length) return; + var muniu = player.getEquip("muniu"); + if (!muniu || !muniu.cards || !muniu.cards.length) return; + for (var i of ui.selected.cards) { + if (i == muniu && muniu.cards.includes(card)) return false; + if (muniu.cards.includes(i) && card == muniu) return false; } }, }, - mark:true, - markimage2:'image/card/muniu_small.png', - intro:{ - content:function(storage,player){ - var muniu=player.getEquip('muniu'); - if(!muniu||!muniu.cards||!muniu.cards.length) return '共有零张牌'; - if(player.isUnderControl(true)){ + mark: true, + markimage2: "image/card/muniu_small.png", + intro: { + content: function (storage, player) { + var muniu = player.getEquip("muniu"); + if (!muniu || !muniu.cards || !muniu.cards.length) return "共有零张牌"; + if (player.isUnderControl(true)) { return get.translation(muniu.cards); - } - else{ - return '共有'+get.cnNumber(muniu.cards.length)+'张牌'; + } else { + return "共有" + get.cnNumber(muniu.cards.length) + "张牌"; } }, - mark:function(dialog,storage,player){ - var muniu=player.getEquip('muniu'); - if(!muniu||!muniu.cards||!muniu.cards.length) return '共有零张牌'; - if(player.isUnderControl(true)){ + mark: function (dialog, storage, player) { + var muniu = player.getEquip("muniu"); + if (!muniu || !muniu.cards || !muniu.cards.length) return "共有零张牌"; + if (player.isUnderControl(true)) { dialog.addAuto(muniu.cards); - } - else{ - return '共有'+get.cnNumber(muniu.cards.length)+'张牌'; + } else { + return "共有" + get.cnNumber(muniu.cards.length) + "张牌"; } }, - markcount:function(storage,player){ - var muniu=player.getEquip('muniu'); - if(muniu&&muniu.cards) return muniu.cards.length; + markcount: function (storage, player) { + var muniu = player.getEquip("muniu"); + if (muniu && muniu.cards) return muniu.cards.length; return 0; - } - } - }, - muniu_skill7:{ - trigger:{player:'loseEnd'}, - firstDo:true, - forced:true, - //silent:true, - filter:function(event,player){ - if(!event.ss||!event.ss.length||event.parent.name=='lose_muniu') return false; - var muniu=player.getEquip('muniu'); - if(!muniu||!muniu.cards) return false; - return event.ss.filter(function(card){ - return muniu.cards.includes(card); - }).length>0; + }, }, - content:function(){ - var muniu=player.getEquip('muniu'); - if(muniu&&muniu.cards){ + }, + muniu_skill7: { + trigger: { player: "loseEnd" }, + firstDo: true, + forced: true, + //silent:true, + filter: function (event, player) { + if (!event.ss || !event.ss.length || event.parent.name == "lose_muniu") return false; + var muniu = player.getEquip("muniu"); + if (!muniu || !muniu.cards) return false; + return ( + event.ss.filter(function (card) { + return muniu.cards.includes(card); + }).length > 0 + ); + }, + content: function () { + var muniu = player.getEquip("muniu"); + if (muniu && muniu.cards) { muniu.cards.removeArray(trigger.ss); lib.skill.muniu_skill.sync(muniu); } player.updateMarks(); }, }, - huogong2:{charlotte:true}, - jiu:{ - trigger:{player:'useCard1'}, - filter:function(event){ - return event.card&&event.card.name=='sha'; + huogong2: { charlotte: true }, + jiu: { + trigger: { player: "useCard1" }, + filter: function (event) { + return event.card && event.card.name == "sha"; }, - forced:true, - charlotte:true, - firstDo:true, - content:function(){ - if(!trigger.baseDamage) trigger.baseDamage=1; - trigger.baseDamage+=player.storage.jiu; - trigger.jiu=true; - trigger.jiu_add=player.storage.jiu; - game.addVideo('jiuNode',player,false); - game.broadcastAll(function(player){ - player.removeSkill('jiu'); - },player); + forced: true, + charlotte: true, + firstDo: true, + content: function () { + if (!trigger.baseDamage) trigger.baseDamage = 1; + trigger.baseDamage += player.storage.jiu; + trigger.jiu = true; + trigger.jiu_add = player.storage.jiu; + game.addVideo("jiuNode", player, false); + game.broadcastAll(function (player) { + player.removeSkill("jiu"); + }, player); }, - temp:true, - vanish:true, - silent:true, - popup:false, - nopop:true, - onremove:function(player){ - if(player.node.jiu){ + temp: true, + vanish: true, + silent: true, + popup: false, + nopop: true, + onremove: function (player) { + if (player.node.jiu) { player.node.jiu.delete(); player.node.jiu2.delete(); delete player.node.jiu; @@ -728,361 +836,404 @@ game.import('card',function(){ } delete player.storage.jiu; }, - ai:{ - damageBonus:true, - skillTagFilter:function(player,tag,arg){ - if(tag==='damageBonus') return arg&&arg.card&&arg.card.name==='sha'; - } + ai: { + damageBonus: true, + skillTagFilter: function (player, tag, arg) { + if (tag === "damageBonus") return arg && arg.card && arg.card.name === "sha"; + }, }, - group:'jiu2' + group: "jiu2", }, - jiu2:{ - trigger:{player:'useCardAfter',global:'phaseAfter'}, - priority:2, - firstDo:true, - charlotte:true, - filter:function(event,player){ - if(player.hasSkillTag('jiuSustain',null,event.name)) return false; - if(event.name=='useCard') return (event.card&&(event.card.name=='sha')); + jiu2: { + trigger: { player: "useCardAfter", global: "phaseAfter" }, + priority: 2, + firstDo: true, + charlotte: true, + filter: function (event, player) { + if (player.hasSkillTag("jiuSustain", null, event.name)) return false; + if (event.name == "useCard") return event.card && event.card.name == "sha"; return true; }, - forced:true, - popup:false, - audio:false, - content:function(){ - game.broadcastAll(function(player){ - player.removeSkill('jiu'); - },player); - game.addVideo('jiuNode',player,false); + forced: true, + popup: false, + audio: false, + content: function () { + game.broadcastAll(function (player) { + player.removeSkill("jiu"); + }, player); + game.addVideo("jiuNode", player, false); }, }, - guding_skill:{ - equipSkill:true, - audio:true, - trigger:{source:'damageBegin1'}, - filter:function(event){ - if(event.parent.name=='_lianhuan'||event.parent.name=='_lianhuan2') return false; - if(event.card&&event.card.name=='sha'){ - if(event.player.countCards('h')==0) return true; + guding_skill: { + equipSkill: true, + audio: true, + trigger: { source: "damageBegin1" }, + filter: function (event) { + if (event.parent.name == "_lianhuan" || event.parent.name == "_lianhuan2") return false; + if (event.card && event.card.name == "sha") { + if (event.player.countCards("h") == 0) return true; } return false; }, - forced:true, - content:function(){ + forced: true, + content: function () { trigger.num++; }, - ai:{ - effect:{ - player:function(card,player,target,current,isLink){ - if(card.name=='sha'&&!isLink&&target.countCards('h')==0&&!target.hasSkillTag('filterDamage',null,{ - player:player, - card:card, - })) return [1,0,1,-3]; - } - } - } + ai: { + effect: { + player: function (card, player, target, current, isLink) { + if ( + card.name == "sha" && + !isLink && + target.countCards("h") == 0 && + !target.hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + return [1, 0, 1, -3]; + }, + }, + }, }, - tengjia1:{ - equipSkill:true, - trigger:{target:['useCardToBefore']}, - forced:true, - priority:6, - audio:true, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.player.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - if(event.card.name=='nanman') return true; - if(event.card.name=='wanjian') return true; + tengjia1: { + equipSkill: true, + trigger: { target: ["useCardToBefore"] }, + forced: true, + priority: 6, + audio: true, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.player.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + if (event.card.name == "nanman") return true; + if (event.card.name == "wanjian") return true; //if(event.card.name=='chuqibuyi') return true; return false; }, - content:function(){ + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(target.hasSkillTag('unequip2')) return; - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card - })||player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card - })) return; + ai: { + effect: { + target: function (card, player, target, current) { + if (target.hasSkillTag("unequip2")) return; + if ( + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) || + player.hasSkillTag("unequip_ai", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) + return; //if(card.name=='nanman'||card.name=='wanjian'||card.name=='chuqibuyi') return 'zerotarget'; - if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget'; - if(card.name=='sha'){ - var equip1=player.getEquip('zhuque'); - if(equip1&&equip1.name=='zhuque') return 1.9; - if(!game.hasNature(card)) return 'zerotarget'; + if (card.name == "nanman" || card.name == "wanjian") return "zerotarget"; + if (card.name == "sha") { + var equip1 = player.getEquip("zhuque"); + if (equip1 && equip1.name == "zhuque") return 1.9; + if (!game.hasNature(card)) return "zerotarget"; } - } - } - } + }, + }, + }, }, - tengjia2:{ - equipSkill:true, - trigger:{player:'damageBegin3'}, - filter:function(event,player){ - if(!event.hasNature('fire')) return false; - if(player.hasSkillTag('unequip2')) return false; - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; + tengjia2: { + equipSkill: true, + trigger: { player: "damageBegin3" }, + filter: function (event, player) { + if (!event.hasNature("fire")) return false; + if (player.hasSkillTag("unequip2")) return false; + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; return true; }, - audio:true, - forced:true, - content:function(){ + audio: true, + forced: true, + content: function () { trigger.num++; }, - ai:{ - fireAttack:true, - effect:{ - target:function(card,player,target,current){ - if(card.name=='sha'){ - if(game.hasNature(card,'fire')) return 2; - if(player.hasSkill('zhuque_skill')) return 1.9; + ai: { + fireAttack: true, + effect: { + target: function (card, player, target, current) { + if (card.name == "sha") { + if (game.hasNature(card, "fire")) return 2; + if (player.hasSkill("zhuque_skill")) return 1.9; } - if(get.tag(card,'fireDamage')&¤t<0) return 2; - } - } - } + if (get.tag(card, "fireDamage") && current < 0) return 2; + }, + }, + }, }, - tengjia3:{ - equipSkill:true, - audio:'tengjia1', - trigger:{target:'shaBefore'}, - forced:true, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.player.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - if(event.card.name=='sha'&&!game.hasNature(event.card)) return true; + tengjia3: { + equipSkill: true, + audio: "tengjia1", + trigger: { target: "shaBefore" }, + forced: true, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.player.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + if (event.card.name == "sha" && !game.hasNature(event.card)) return true; return false; }, - content:function(){ + content: function () { trigger.cancel(); }, }, - baiyin_skill:{ - equipSkill:true, - trigger:{player:'damageBegin4'}, - forced:true, - audio:true, - filter:function(event,player){ - if(event.num<=1) return false; - if(player.hasSkillTag('unequip2')) return false; - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; + baiyin_skill: { + equipSkill: true, + trigger: { player: "damageBegin4" }, + forced: true, + audio: true, + filter: function (event, player) { + if (event.num <= 1) return false; + if (player.hasSkillTag("unequip2")) return false; + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; return true; }, //priority:-10, - content:function(){ - trigger.num=1; + content: function () { + trigger.num = 1; }, - subSkill:{ - lose:{ - audio:'baiyin_skill', - forced:true, - charlotte:true, - equipSkill:true, - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], + subSkill: { + lose: { + audio: "baiyin_skill", + forced: true, + charlotte: true, + equipSkill: true, + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], }, - filter:(event,player)=>{ - if(player.isHealthy()||player.hasSkillTag('unequip2')) return false; - var evt=event.getl(player); - return evt&&evt.es.some(card=>card.name=='baiyin') + filter: (event, player) => { + if (player.isHealthy() || player.hasSkillTag("unequip2")) return false; + var evt = event.getl(player); + return evt && evt.es.some((card) => card.name == "baiyin"); }, - content:function(){ - var evt=trigger.getl(player); - evt.es.forEach(card=>{ - if(card.name=='baiyin'){ + content: function () { + var evt = trigger.getl(player); + evt.es.forEach((card) => { + if (card.name == "baiyin") { player.recover(); } - }) + }); }, }, }, - ai:{ - filterDamage:true, - skillTagFilter:function(player,tag,arg){ - if(player.hasSkillTag('unequip2')) return false; - if(arg&&arg.player){ - if(arg.player.hasSkillTag('unequip',false,{ - name:arg.card?arg.card.name:null, - target:player, - card:arg.card, - })) return false; - if(arg.player.hasSkillTag('unequip_ai',false,{ - name:arg.card?arg.card.name:null, - target:player, - card:arg.card, - })) return false; - if(arg.player.hasSkillTag('jueqing',false,player)) return false; + ai: { + filterDamage: true, + skillTagFilter: function (player, tag, arg) { + if (player.hasSkillTag("unequip2")) return false; + if (arg && arg.player) { + if ( + arg.player.hasSkillTag("unequip", false, { + name: arg.card ? arg.card.name : null, + target: player, + card: arg.card, + }) + ) + return false; + if ( + arg.player.hasSkillTag("unequip_ai", false, { + name: arg.card ? arg.card.name : null, + target: player, + card: arg.card, + }) + ) + return false; + if (arg.player.hasSkillTag("jueqing", false, player)) return false; } }, }, }, - zhuque_skill:{ - equipSkill:true, - trigger:{player:'useCard1'}, + zhuque_skill: { + equipSkill: true, + trigger: { player: "useCard1" }, //priority:7, - filter:function(event,player){ - if(event.card.name=='sha'&&!game.hasNature(event.card)) return true; + filter: function (event, player) { + if (event.card.name == "sha" && !game.hasNature(event.card)) return true; }, - audio:true, - check:function(event,player){ - var eff=0; - for(var i=0;i=0; + return eff >= 0; }, - prompt2:function(event,player){ - return '将'+get.translation(event.card)+'改为火属性'; + prompt2: function (event, player) { + return "将" + get.translation(event.card) + "改为火属性"; }, - content:function(){ - game.setNature(trigger.card,'fire'); - if(get.itemtype(trigger.card)=='card'){ - var next=game.createEvent('zhuque_clear'); - next.card=trigger.card; + content: function () { + game.setNature(trigger.card, "fire"); + if (get.itemtype(trigger.card) == "card") { + var next = game.createEvent("zhuque_clear"); + next.card = trigger.card; event.next.remove(next); trigger.after.push(next); - next.setContent(function(){ - game.setNature(trigger.card,[]); + next.setContent(function () { + game.setNature(trigger.card, []); }); } - } + }, }, - zhuque_skill2:{ - trigger:{player:'useCardAfter'}, - forced:true, - popup:false, - content:function(){ + zhuque_skill2: { + trigger: { player: "useCardAfter" }, + forced: true, + popup: false, + content: function () { delete player.storage.zhuque_skill.nature; - } + }, }, - huogon2:{}, + huogon2: {}, }, - translate:{ - jiu:'酒', - jiu_info:'①每回合限一次。出牌阶段,对你自己使用。本回合目标角色使用的下一张【杀】的伤害值基数+1。②当你处于濒死状态时,对你自己使用。目标角色回复1点体力。', - huogong:'火攻', - tiesuo:'铁索连环', - tiesuo_info:'此牌可被重铸。出牌阶段,对至多两名角色使用。目标角色横置。', - huogong_bg:'攻', - huogong_info:'出牌阶段,对一名有手牌的角色使用。目标角色展示一张手牌A,然后你可以弃置一张与A花色相同的手牌,对目标造成1点火属性伤害。', - tiesuo_bg:'索', - bingliang:'兵粮寸断', - hualiu:'骅骝', - zhuque:'朱雀羽扇', - bingliang_bg:'粮', - bingliang_info:'出牌阶段,对一名距离为1的其他角色使用。目标角色于其判定阶段进行判定:若判定结果不为梅花,则其跳过下一个摸牌阶段。', - hualiu_bg:'+马', - hualiu_info:'锁定技,其他角色计算与你的距离+1。', - zhuque_bg:'扇', - zhuque_skill:'朱雀羽扇', - zhuque_info:'当你声明使用普【杀】后,你可以为此【杀】赋予火属性。', - guding:'古锭刀', - guding_info:'锁定技,当你因执行【杀】的效果而对目标角色造成伤害时,若其没有手牌,则此伤害+1。', - guding_skill:'古锭刀', - tengjia:'藤甲', + translate: { + jiu: "酒", + jiu_info: + "①每回合限一次。出牌阶段,对你自己使用。本回合目标角色使用的下一张【杀】的伤害值基数+1。②当你处于濒死状态时,对你自己使用。目标角色回复1点体力。", + huogong: "火攻", + tiesuo: "铁索连环", + tiesuo_info: "此牌可被重铸。出牌阶段,对至多两名角色使用。目标角色横置。", + huogong_bg: "攻", + huogong_info: + "出牌阶段,对一名有手牌的角色使用。目标角色展示一张手牌A,然后你可以弃置一张与A花色相同的手牌,对目标造成1点火属性伤害。", + tiesuo_bg: "索", + bingliang: "兵粮寸断", + hualiu: "骅骝", + zhuque: "朱雀羽扇", + bingliang_bg: "粮", + bingliang_info: + "出牌阶段,对一名距离为1的其他角色使用。目标角色于其判定阶段进行判定:若判定结果不为梅花,则其跳过下一个摸牌阶段。", + hualiu_bg: "+马", + hualiu_info: "锁定技,其他角色计算与你的距离+1。", + zhuque_bg: "扇", + zhuque_skill: "朱雀羽扇", + zhuque_info: "当你声明使用普【杀】后,你可以为此【杀】赋予火属性。", + guding: "古锭刀", + guding_info: "锁定技,当你因执行【杀】的效果而对目标角色造成伤害时,若其没有手牌,则此伤害+1。", + guding_skill: "古锭刀", + tengjia: "藤甲", //tengjia_info:'锁定技,【南蛮入侵】、【万箭齐发】、【出其不意】和普通【杀】对你无效。当你受到火焰伤害时,该伤害+1。', - tengjia_info:'锁定技。①【南蛮入侵】、【万箭齐发】和普【杀】对你无效。②当你受到火属性伤害时,此伤害+1。', - tengjia1:'藤甲', - tengjia2:'藤甲', - tengjia3:'藤甲', - baiyin:'白银狮子', - baiyin_info:'锁定技。①当你受到伤害时,若此伤害大于1,则你将伤害值扣减至1点。②当你失去装备区内的【白银狮子】后,你回复1点体力。', - baiyin_skill:'白银狮子', + tengjia_info: + "锁定技。①【南蛮入侵】、【万箭齐发】和普【杀】对你无效。②当你受到火属性伤害时,此伤害+1。", + tengjia1: "藤甲", + tengjia2: "藤甲", + tengjia3: "藤甲", + baiyin: "白银狮子", + baiyin_info: + "锁定技。①当你受到伤害时,若此伤害大于1,则你将伤害值扣减至1点。②当你失去装备区内的【白银狮子】后,你回复1点体力。", + baiyin_skill: "白银狮子", - muniu:'木牛流马', - muniu_bg:'牛', - muniu_skill:'木牛', - muniu_skill7:'木牛流马', - muniu_skill_bg:'辎', - muniu_info:'①出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,然后你可以将【木牛流马】移动到一名其他角色的装备区里。②你可以将【木牛流马】下的牌如手牌般使用或打出。③当你失去装备区的【木牛流马】后,你刷新〖木牛流马①〗的使用次数限制。若此牌不是因置入其他角色的装备区而失去的,则你将【木牛流马】下的所有牌置入弃牌堆。', - muniu_skill_info:'将一张手牌扣置于你装备区里的【木牛流马】下,然后可以将此装备移动到一名其他角色的装备区里。', + muniu: "木牛流马", + muniu_bg: "牛", + muniu_skill: "木牛", + muniu_skill7: "木牛流马", + muniu_skill_bg: "辎", + muniu_info: + "①出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,然后你可以将【木牛流马】移动到一名其他角色的装备区里。②你可以将【木牛流马】下的牌如手牌般使用或打出。③当你失去装备区的【木牛流马】后,你刷新〖木牛流马①〗的使用次数限制。若此牌不是因置入其他角色的装备区而失去的,则你将【木牛流马】下的所有牌置入弃牌堆。", + muniu_skill_info: + "将一张手牌扣置于你装备区里的【木牛流马】下,然后可以将此装备移动到一名其他角色的装备区里。", }, - list:[ - ["heart",4,"sha","fire"], - ["heart",7,"sha","fire"], - ["heart",10,"sha","fire"], - ["diamond",4,"sha","fire"], - ["diamond",5,"sha","fire"], - ["spade",4,"sha","thunder"], - ["spade",5,"sha","thunder"], - ["spade",6,"sha","thunder"], - ["spade",7,"sha","thunder"], - ["spade",8,"sha","thunder"], - ["club",5,"sha","thunder"], - ["club",6,"sha","thunder"], - ["club",7,"sha","thunder"], - ["club",8,"sha","thunder"], - ["heart",8,"shan"], - ["heart",9,"shan"], - ["heart",11,"shan"], - ["heart",12,"shan"], - ["diamond",6,"shan"], - ["diamond",7,"shan"], - ["diamond",8,"shan"], - ["diamond",10,"shan"], - ["diamond",11,"shan"], - ["heart",5,"tao"], - ["heart",6,"tao"], - ["diamond",2,"tao"], - ["diamond",3,"tao"], - ["diamond",9,"jiu"], - ["spade",3,"jiu"], - ["spade",9,"jiu"], - ["club",3,"jiu"], - ["club",9,"jiu"], + list: [ + ["heart", 4, "sha", "fire"], + ["heart", 7, "sha", "fire"], + ["heart", 10, "sha", "fire"], + ["diamond", 4, "sha", "fire"], + ["diamond", 5, "sha", "fire"], + ["spade", 4, "sha", "thunder"], + ["spade", 5, "sha", "thunder"], + ["spade", 6, "sha", "thunder"], + ["spade", 7, "sha", "thunder"], + ["spade", 8, "sha", "thunder"], + ["club", 5, "sha", "thunder"], + ["club", 6, "sha", "thunder"], + ["club", 7, "sha", "thunder"], + ["club", 8, "sha", "thunder"], + ["heart", 8, "shan"], + ["heart", 9, "shan"], + ["heart", 11, "shan"], + ["heart", 12, "shan"], + ["diamond", 6, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 10, "shan"], + ["diamond", 11, "shan"], + ["heart", 5, "tao"], + ["heart", 6, "tao"], + ["diamond", 2, "tao"], + ["diamond", 3, "tao"], + ["diamond", 9, "jiu"], + ["spade", 3, "jiu"], + ["spade", 9, "jiu"], + ["club", 3, "jiu"], + ["club", 9, "jiu"], - ["diamond",13,"hualiu"], - ["club",1,"baiyin"], - ["spade",2,"tengjia"], - ["club",2,"tengjia"], - ["spade",1,"guding"], - ["diamond",1,"zhuque"], + ["diamond", 13, "hualiu"], + ["club", 1, "baiyin"], + ["spade", 2, "tengjia"], + ["club", 2, "tengjia"], + ["spade", 1, "guding"], + ["diamond", 1, "zhuque"], - ["heart",2,"huogong"], - ["heart",3,"huogong"], - ["diamond",12,"huogong"], - ["spade",11,"tiesuo"], - ["spade",12,"tiesuo"], - ["club",10,"tiesuo"], - ["club",11,"tiesuo"], - ["club",12,"tiesuo"], - ["club",13,"tiesuo"], - ["heart",1,"wuxie"], - ["heart",13,"wuxie"], - ["spade",13,"wuxie"], - ["spade",10,"bingliang"], - ["club",4,"bingliang"], + ["heart", 2, "huogong"], + ["heart", 3, "huogong"], + ["diamond", 12, "huogong"], + ["spade", 11, "tiesuo"], + ["spade", 12, "tiesuo"], + ["club", 10, "tiesuo"], + ["club", 11, "tiesuo"], + ["club", 12, "tiesuo"], + ["club", 13, "tiesuo"], + ["heart", 1, "wuxie"], + ["heart", 13, "wuxie"], + ["spade", 13, "wuxie"], + ["spade", 10, "bingliang"], + ["club", 4, "bingliang"], - ['diamond',5,'muniu'], + ["diamond", 5, "muniu"], ], - } + }; }); diff --git a/card/gujian.js b/card/gujian.js index 7d8619763..234f7738a 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -1,947 +1,972 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'gujian', - card:{ - luyugeng:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('luyugeng'); + name: "gujian", + card: { + luyugeng: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("luyugeng"); }, //range:{global:1}, - content:function(){ + content: function () { target.$gain2(cards); - target.storage.luyugeng=card; - target.storage.luyugeng_markcount=3; - target.addSkill('luyugeng'); + target.storage.luyugeng = card; + target.storage.luyugeng_markcount = 3; + target.addSkill("luyugeng"); + }, + ai: { + order: 2, + value: 4, + result: { + target: 1, + }, }, - ai:{ - order:2, - value:4, - result:{ - target:1 - } - } }, - jinlianzhu:{ - type:'trick', - fullskin:true, - filterTarget:true, - global:'g_jinlianzhu', - content:function(){ - var evt=event.getParent(3)._trigger; - evt.cancel() - if(evt.source){ + jinlianzhu: { + type: "trick", + fullskin: true, + filterTarget: true, + global: "g_jinlianzhu", + content: function () { + var evt = event.getParent(3)._trigger; + evt.cancel(); + if (evt.source) { evt.source.draw(); } }, - ai:{ - order:1, - value:[5,1], - useful:[6,1], - result:{ - target:function(player,target){ - var evt=_status.event.getTrigger(); - var eff=get.damageEffect(target,evt.source,target,evt.nature); - if(eff>0) return -1; - if(eff<0) return 2; + ai: { + order: 1, + value: [5, 1], + useful: [6, 1], + result: { + target: function (player, target) { + var evt = _status.event.getTrigger(); + var eff = get.damageEffect(target, evt.source, target, evt.nature); + if (eff > 0) return -1; + if (eff < 0) return 2; return 0; - } - } - } + }, + }, + }, }, - chunbing:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('chunbing'); + chunbing: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("chunbing"); }, //range:{global:1}, - content:function(){ + content: function () { target.$gain2(cards); - target.storage.chunbing=card; - target.storage.chunbing_markcount=5; - target.addSkill('chunbing'); + target.storage.chunbing = card; + target.storage.chunbing_markcount = 5; + target.addSkill("chunbing"); }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - var num=target.needsToDiscard(); - if(num){ - if(target==player&&num>1){ + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + var num = target.needsToDiscard(); + if (num) { + if (target == player && num > 1) { return num; } return Math.sqrt(num); } return 0; - } - } - } + }, + }, + }, }, - gudonggeng:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gudonggeng'); + gudonggeng: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gudonggeng"); }, //range:{global:1}, - content:function(){ + content: function () { target.$gain2(cards); - target.storage.gudonggeng=card; - target.storage.gudonggeng_markcount=3; - target.addSkill('gudonggeng'); + target.storage.gudonggeng = card; + target.storage.gudonggeng_markcount = 3; + target.addSkill("gudonggeng"); + }, + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + if (player == target && !player.hasShan()) return 2; + return 1 / Math.max(1, target.hp); + }, + }, }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - if(player==target&&!player.hasShan()) return 2; - return 1/Math.max(1,target.hp); - } - } - } }, - liyutang:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('liyutang'); + liyutang: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("liyutang"); }, //range:{global:1}, - content:function(){ + content: function () { target.$gain2(cards); - target.storage.liyutang=card; - target.storage.liyutang_markcount=2; - target.addSkill('liyutang'); + target.storage.liyutang = card; + target.storage.liyutang_markcount = 2; + target.addSkill("liyutang"); + }, + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + if (player == target && target.isMinHp()) return 2; + if (target.isMinHp()) return 1.5; + return 1 / Math.max(1, target.hp); + }, + }, }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - if(player==target&&target.isMinHp()) return 2; - if(target.isMinHp()) return 1.5; - return 1/Math.max(1,target.hp); - } - } - } }, - mizhilianou:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('mizhilianou'); + mizhilianou: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("mizhilianou"); }, //range:{global:1}, - content:function(){ + content: function () { target.$gain2(cards); - target.storage.mizhilianou=card; - target.storage.mizhilianou_markcount=4; - target.addSkill('mizhilianou'); + target.storage.mizhilianou = card; + target.storage.mizhilianou_markcount = 4; + target.addSkill("mizhilianou"); }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - if(target==player){ - if(target.countCards('he',{suit:'heart'})){ - if(target.isDamaged()) return 1.5; - } - else{ + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + if (target == player) { + if (target.countCards("he", { suit: "heart" })) { + if (target.isDamaged()) return 1.5; + } else { return 0.2; } - } - else if(target.isDamaged()){ + } else if (target.isDamaged()) { return 1; } return 0.5; - } - } - } - }, - xiajiao:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('xiajiao'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.xiajiao=card; - target.storage.xiajiao_markcount=3; - target.addSkill('xiajiao'); - target.addTempSkill('xiajiao3'); - }, - ai:{ - order:2, - value:5, - result:{ - target:1 - } - } - }, - tanhuadong:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('tanhuadong'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.tanhuadong=card; - target.storage.tanhuadong_markcount=3; - target.addSkill('tanhuadong'); - }, - ai:{ - order:2, - value:5, - result:{ - target:1 - } - } - }, - mapodoufu:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('mapodoufu'); - }, - //range:{global:1}, - content:function(){ - if(target==targets[0]&&cards.length) target.$gain2(cards); - target.storage.mapodoufu=card; - target.storage.mapodoufu_markcount=2; - target.addSkill('mapodoufu'); - }, - ai:{ - order:1, - value:5, - result:{ - target:function(player,target){ - return player==target?2:1; - } - } - } - }, - qingtuan:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('qingtuan'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.qingtuan=card; - target.storage.qingtuan_markcount=2; - target.addSkill('qingtuan'); - }, - ai:{ - order:4, - value:4, - result:{ - target:function(player,target){ - if(target==player){ - if(target.hasSha()) return 2; - } - else{ - var nh=target.countCards('h'); - if(nh>=3) return 1; - if(target.hasSha()) return 1; - if(nh&&Math.random()<0.5) return 1; - } - return player.needsToDiscard()?0.2:0; - } - } - } - }, - yougeng:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('yougeng'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.yougeng=card; - target.storage.yougeng_markcount=2; - target.addSkill('yougeng'); - }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - if(target.isHealthy()) return player.needsToDiscard()?0.1:0; - if(target.isMinHp()) return 1.5; - return 1/Math.max(1,target.hp); - } - } - } - }, - molicha:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('molicha'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.molicha=card; - target.storage.molicha_markcount=4; - target.addSkill('molicha'); - }, - ai:{ - order:2, - value:4, - result:{ - target:1 - } - } - }, - yuanbaorou:{ - fullskin:true, - type:'food', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('yuanbaorou'); - }, - //range:{global:1}, - content:function(){ - target.$gain2(cards); - target.storage.yuanbaorou=card; - target.storage.yuanbaorou_markcount=4; - target.addSkill('yuanbaorou'); - }, - ai:{ - order:2, - value:4, - result:{ - target:function(player,target){ - if(target==player){ - if(target.hasSha()) return 2; - } - else{ - var nh=target.countCards('h'); - if(nh>=3) return 1; - if(target.hasSha()) return 1; - if(nh&&Math.random()<0.5) return 1; - } - return player.needsToDiscard()?0.2:0; - } - } - } - }, - heilonglinpian:{ - fullskin:true, - type:'trick', - enable:true, - toself:true, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - modTarget:true, - content:function(){ - target.changeHujia(); - target.addTempSkill('heilonglinpian',{player:'phaseBegin'}); - }, - ai:{ - value:[6,1], - useful:1, - order:2, - result:{ - target:1 - } - } - }, - mutoumianju:{ - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['mutoumianju_skill'], - ai:{ - equipValue:4 - } - }, - yuheng:{fullskin:true}, - gjyuheng:{ - fullskin:true, - cardimage:'yuheng', - type:'equip', - subtype:'equip5', - nopower:true, - nomod:true, - unique:true, - skills:['gjyuheng_skill'], - ai:{ - equipValue:6 - } - }, - gjyuheng_plus:{ - fullskin:true, - type:'equip', - subtype:'equip5', - nopower:true, - unique:true, - nomod:true, - epic:true, - cardimage:'yuheng', - skills:['gjyuheng_plus_skill'], - ai:{ - equipValue:7 - } - }, - gjyuheng_pro:{ - fullskin:true, - type:'equip', - subtype:'equip5', - nopower:true, - unique:true, - nomod:true, - legend:true, - cardimage:'yuheng', - skills:['gjyuheng_pro_skill'], - ai:{ - equipValue:8 - } - }, - shatang:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - cardcolor:'red', - cardnature:'fire', - content:function(){ - 'step 0' - target.damage('fire'); - 'step 1' - target.changeHujia(); - }, - ai:{ - value:[4,1], - useful:2, - order:2, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nofire')) return 1.5; - if(target.hasSkillTag('maixie_hp')) return 0; - if(target.hp==1) return -1; - return -1/Math.sqrt(target.hp+1); - } - }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1 - } - } - }, - shujinsan:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - return target.countCards('he')>0; - }, - content:function(){ - 'step 0' - target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ - return 6-get.value(card); - } - 'step 1' - if(result.bool){ - target.draw(result.cards.length); - } - }, - ai:{ - order:1.5, - value:[4,1], - tag:{ - norepeat:1 - }, - result:{ - target:function(player,target){ - if(target==player){ - var cards=player.getCards('he'); - var num=-1; - for(var i=0;i2){ - if(player.needsToDiscard()) return 1/target.hp; - return 0; - } - if(target.hp>0){ - return 2/target.hp; - } - return 0; - } - } - } - }, - yunvyuanshen:{ - fullskin:true, - type:'basic', - enable:true, - logv:false, - filterTarget:function(card,player,target){ - return !target.hasSkill('yunvyuanshen_skill'); - }, - content:function(){ - target.storage.yunvyuanshen_skill=game.createCard('yunvyuanshen'); - target.addSkill('yunvyuanshen_skill'); - if(cards&&cards.length){ - card=cards[0]; - } - if(target==targets[0]&&card.clone&&(card.clone.parentNode==player.parentNode||card.clone.parentNode==ui.arena)){ - card.clone.moveDelete(target); - game.addVideo('gain2',target,get.cardsInfo([card])); - } - }, - ai:{ - basic:{ - value:9, - useful:4, - value:7 - }, - order:2, - result:{ - target:function(player,target){ - return 1/Math.sqrt(1+target.hp); }, }, - } - }, - bingpotong:{ - fullskin:true, - type:'jiguan', - enable:true, - wuxieable:true, - filterTarget:function(card,player,target){ - return target.countCards('h')>0; }, - selectTarget:[1,3], - content:function(){ - "step 0" - if(target.countCards('h')==0||player.countCards('h')==0){ + }, + xiajiao: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("xiajiao"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.xiajiao = card; + target.storage.xiajiao_markcount = 3; + target.addSkill("xiajiao"); + target.addTempSkill("xiajiao3"); + }, + ai: { + order: 2, + value: 5, + result: { + target: 1, + }, + }, + }, + tanhuadong: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("tanhuadong"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.tanhuadong = card; + target.storage.tanhuadong_markcount = 3; + target.addSkill("tanhuadong"); + }, + ai: { + order: 2, + value: 5, + result: { + target: 1, + }, + }, + }, + mapodoufu: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("mapodoufu"); + }, + //range:{global:1}, + content: function () { + if (target == targets[0] && cards.length) target.$gain2(cards); + target.storage.mapodoufu = card; + target.storage.mapodoufu_markcount = 2; + target.addSkill("mapodoufu"); + }, + ai: { + order: 1, + value: 5, + result: { + target: function (player, target) { + return player == target ? 2 : 1; + }, + }, + }, + }, + qingtuan: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("qingtuan"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.qingtuan = card; + target.storage.qingtuan_markcount = 2; + target.addSkill("qingtuan"); + }, + ai: { + order: 4, + value: 4, + result: { + target: function (player, target) { + if (target == player) { + if (target.hasSha()) return 2; + } else { + var nh = target.countCards("h"); + if (nh >= 3) return 1; + if (target.hasSha()) return 1; + if (nh && Math.random() < 0.5) return 1; + } + return player.needsToDiscard() ? 0.2 : 0; + }, + }, + }, + }, + yougeng: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("yougeng"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.yougeng = card; + target.storage.yougeng_markcount = 2; + target.addSkill("yougeng"); + }, + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + if (target.isHealthy()) return player.needsToDiscard() ? 0.1 : 0; + if (target.isMinHp()) return 1.5; + return 1 / Math.max(1, target.hp); + }, + }, + }, + }, + molicha: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("molicha"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.molicha = card; + target.storage.molicha_markcount = 4; + target.addSkill("molicha"); + }, + ai: { + order: 2, + value: 4, + result: { + target: 1, + }, + }, + }, + yuanbaorou: { + fullskin: true, + type: "food", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("yuanbaorou"); + }, + //range:{global:1}, + content: function () { + target.$gain2(cards); + target.storage.yuanbaorou = card; + target.storage.yuanbaorou_markcount = 4; + target.addSkill("yuanbaorou"); + }, + ai: { + order: 2, + value: 4, + result: { + target: function (player, target) { + if (target == player) { + if (target.hasSha()) return 2; + } else { + var nh = target.countCards("h"); + if (nh >= 3) return 1; + if (target.hasSha()) return 1; + if (nh && Math.random() < 0.5) return 1; + } + return player.needsToDiscard() ? 0.2 : 0; + }, + }, + }, + }, + heilonglinpian: { + fullskin: true, + type: "trick", + enable: true, + toself: true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + modTarget: true, + content: function () { + target.changeHujia(); + target.addTempSkill("heilonglinpian", { player: "phaseBegin" }); + }, + ai: { + value: [6, 1], + useful: 1, + order: 2, + result: { + target: 1, + }, + }, + }, + mutoumianju: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["mutoumianju_skill"], + ai: { + equipValue: 4, + }, + }, + yuheng: { fullskin: true }, + gjyuheng: { + fullskin: true, + cardimage: "yuheng", + type: "equip", + subtype: "equip5", + nopower: true, + nomod: true, + unique: true, + skills: ["gjyuheng_skill"], + ai: { + equipValue: 6, + }, + }, + gjyuheng_plus: { + fullskin: true, + type: "equip", + subtype: "equip5", + nopower: true, + unique: true, + nomod: true, + epic: true, + cardimage: "yuheng", + skills: ["gjyuheng_plus_skill"], + ai: { + equipValue: 7, + }, + }, + gjyuheng_pro: { + fullskin: true, + type: "equip", + subtype: "equip5", + nopower: true, + unique: true, + nomod: true, + legend: true, + cardimage: "yuheng", + skills: ["gjyuheng_pro_skill"], + ai: { + equipValue: 8, + }, + }, + shatang: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + cardcolor: "red", + cardnature: "fire", + content: function () { + "step 0"; + target.damage("fire"); + "step 1"; + target.changeHujia(); + }, + ai: { + value: [4, 1], + useful: 2, + order: 2, + result: { + target: function (player, target) { + if (target.hasSkillTag("nofire")) return 1.5; + if (target.hasSkillTag("maixie_hp")) return 0; + if (target.hp == 1) return -1; + return -1 / Math.sqrt(target.hp + 1); + }, + }, + tag: { + damage: 1, + fireDamage: 1, + natureDamage: 1, + }, + }, + }, + shujinsan: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("he") > 0; + }, + content: function () { + "step 0"; + target.chooseToDiscard( + "he", + [1, target.countCards("he")], + "弃置任意张牌并摸等量的牌" + ).ai = function (card) { + return 6 - get.value(card); + }; + "step 1"; + if (result.bool) { + target.draw(result.cards.length); + } + }, + ai: { + order: 1.5, + value: [4, 1], + tag: { + norepeat: 1, + }, + result: { + target: function (player, target) { + if (target == player) { + var cards = player.getCards("he"); + var num = -1; + for (var i = 0; i < cards.length; i++) { + if (get.value(cards[i]) < 6) num++; + } + if (player.needsToDiscard() && num < 1) { + num = 1; + } + return Math.max(0, num); + } else { + if (!player.needsToDiscard() && target.countCards("he") <= 3) { + return 0; + } + return target.countCards("he") / 2; + } + }, + }, + }, + }, + dinvxuanshuang: { + fullskin: true, + type: "basic", + savable: true, + selectTarget: -1, + content: function () { + "step 0"; + target.recover(); + "step 1"; + if (target.isIn()) { + target.chooseToDiscard([1, Infinity], "he", "弃置任意张牌并摸等量的牌"); + } else { + event.finish(); + } + "step 2"; + if (result.bool) { + target.draw(result.cards.length); + } + }, + ai: { + basic: { + order: 6, + useful: 10, + value: [8, 6.5, 5, 4], + }, + result: { + target: 2, + }, + tag: { + recover: 1, + save: 1, + }, + }, + }, + dinvxuanshuang_old: { + fullskin: true, + type: "basic", + enable: true, + // range:{global:1}, + filterTarget: function (card, player, target) { + return !target.hujia; + }, + content: function () { + target.storage.dinvxuanshuang_skill = game.createCard("dinvxuanshuang"); + target.addSkill("dinvxuanshuang_skill"); + if (cards && cards.length) { + card = cards[0]; + } + if ( + target == targets[0] && + card.clone && + (card.clone.parentNode == player.parentNode || card.clone.parentNode == ui.arena) + ) { + card.clone.moveDelete(target); + game.addVideo("gain2", target, get.cardsInfo([card])); + } + }, + ai: { + basic: { + order: 7, + useful: 5, + value: [8, 6.5, 5, 4], + }, + result: { + target: function (player, target) { + var num = + 1 / Math.sqrt(1 + target.hp) + 0.1 / Math.sqrt(target.countCards("h") + 1); + if (player == target) num *= 1.2; + return num; + }, + }, + }, + }, + ziyangdan: { + fullskin: true, + type: "basic", + enable: true, + filterTarget: true, + content: function () { + target.changeHujia(3); + if (target.hasSkill("ziyangdan")) { + target.storage.ziyangdan += 3; + } else { + target.addSkill("ziyangdan"); + } + }, + ai: { + order: 1.6, + value: [7, 1], + useful: 3, + tag: { + norepeat: 1, + }, + result: { + target: function (player, target) { + if (target.hp > 2) { + if (player.needsToDiscard()) return 1 / target.hp; + return 0; + } + if (target.hp > 0) { + return 2 / target.hp; + } + return 0; + }, + }, + }, + }, + yunvyuanshen: { + fullskin: true, + type: "basic", + enable: true, + logv: false, + filterTarget: function (card, player, target) { + return !target.hasSkill("yunvyuanshen_skill"); + }, + content: function () { + target.storage.yunvyuanshen_skill = game.createCard("yunvyuanshen"); + target.addSkill("yunvyuanshen_skill"); + if (cards && cards.length) { + card = cards[0]; + } + if ( + target == targets[0] && + card.clone && + (card.clone.parentNode == player.parentNode || card.clone.parentNode == ui.arena) + ) { + card.clone.moveDelete(target); + game.addVideo("gain2", target, get.cardsInfo([card])); + } + }, + ai: { + basic: { + value: 9, + useful: 4, + value: 7, + }, + order: 2, + result: { + target: function (player, target) { + return 1 / Math.sqrt(1 + target.hp); + }, + }, + }, + }, + bingpotong: { + fullskin: true, + type: "jiguan", + enable: true, + wuxieable: true, + filterTarget: function (card, player, target) { + return target.countCards("h") > 0; + }, + selectTarget: [1, 3], + content: function () { + "step 0"; + if (target.countCards("h") == 0 || player.countCards("h") == 0) { event.finish(); return; } - player.chooseCard('请展示一张手牌',true).set('ai',function(){ - var num=0; - var rand=_status.event.rand; - if(get.color(card)=='red'){ - if(rand) num-=6; - } - else{ - if(!rand) num-=6; - } - var value=get.value(card); - if(value>=8) return -100; - return num-value; - }).set('rand', Math.random()<0.5).prompt2='若与'+get.translation(target)+'展示的牌相同,你弃置展示的牌,'+get.translation(target)+'失去1点体力'; - "step 1" - event.card1=result.cards[0]; - target.chooseCard('请展示一张手牌',true).set('ai',function(card){ - var num=0; - var rand=_status.event.rand; - if(get.color(card)=='red'){ - if(rand) num-=6; - } - else{ - if(!rand) num-=6; - } - var value=get.value(card); - if(value>=8) return -100; - return num-value; - }).set('rand', Math.random()<0.5).prompt2='若与'+get.translation(player)+'展示的牌相同,'+get.translation(player)+'弃置展示的牌,你失去1点体力'; - "step 2" - event.card2=result.cards[0]; - ui.arena.classList.add('thrownhighlight'); - game.addVideo('thrownhighlight1'); - player.$compare(event.card1,target,event.card2); + player + .chooseCard("请展示一张手牌", true) + .set("ai", function () { + var num = 0; + var rand = _status.event.rand; + if (get.color(card) == "red") { + if (rand) num -= 6; + } else { + if (!rand) num -= 6; + } + var value = get.value(card); + if (value >= 8) return -100; + return num - value; + }) + .set("rand", Math.random() < 0.5).prompt2 = + "若与" + + get.translation(target) + + "展示的牌相同,你弃置展示的牌," + + get.translation(target) + + "失去1点体力"; + "step 1"; + event.card1 = result.cards[0]; + target + .chooseCard("请展示一张手牌", true) + .set("ai", function (card) { + var num = 0; + var rand = _status.event.rand; + if (get.color(card) == "red") { + if (rand) num -= 6; + } else { + if (!rand) num -= 6; + } + var value = get.value(card); + if (value >= 8) return -100; + return num - value; + }) + .set("rand", Math.random() < 0.5).prompt2 = + "若与" + + get.translation(player) + + "展示的牌相同," + + get.translation(player) + + "弃置展示的牌,你失去1点体力"; + "step 2"; + event.card2 = result.cards[0]; + ui.arena.classList.add("thrownhighlight"); + game.addVideo("thrownhighlight1"); + player.$compare(event.card1, target, event.card2); game.delay(4); - "step 3" - game.log(player,'展示了',event.card1); - game.log(target,'展示了',event.card2); - if(get.color(event.card2)==get.color(event.card1)){ - player.discard(event.card1).animate=false; + "step 3"; + game.log(player, "展示了", event.card1); + game.log(target, "展示了", event.card2); + if (get.color(event.card2) == get.color(event.card1)) { + player.discard(event.card1).animate = false; target.$gain2(event.card2); - var clone=event.card1.clone; - if(clone){ - clone.style.transition='all 0.5s'; - clone.style.transform='scale(1.2)'; + var clone = event.card1.clone; + if (clone) { + clone.style.transition = "all 0.5s"; + clone.style.transform = "scale(1.2)"; clone.delete(); - game.addVideo('deletenode',player,get.cardsInfo([clone])); + game.addVideo("deletenode", player, get.cardsInfo([clone])); } target.loseHp(); event.finish(); - event.parent.cancelled=true; - } - else{ + event.parent.cancelled = true; + } else { player.$gain2(event.card1); target.$gain2(event.card2); game.delay(); } - ui.arena.classList.remove('thrownhighlight'); - game.addVideo('thrownhighlight2'); - "step 4" + ui.arena.classList.remove("thrownhighlight"); + game.addVideo("thrownhighlight2"); + "step 4"; // if(cards&&cards.length){ // player.gain(cards,'gain2'); // target.addTempSkill('bingpotong'); // } }, - ai:{ - basic:{ - order:2, - value:[5,1], - useful:1, + ai: { + basic: { + order: 2, + value: [5, 1], + useful: 1, }, - result:{ - player:function(player,target){ - if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard(new lib.element.VCard({name:'bingpotong'}))){ + result: { + player: function (player, target) { + if ( + player.countCards("h") <= Math.min(5, Math.max(2, player.hp)) && + _status.event.name == "chooseToUse" + ) { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard(new lib.element.VCard({ name: "bingpotong" })) + ) { return -10; } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='bingpotong') return -10; - if(viewAs&&viewAs.name=='bingpotong') return -10; + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "bingpotong") return -10; + if (viewAs && viewAs.name == "bingpotong") return -10; } } return 0; }, - target:function(player,target){ - if(player.countCards('h')<=1) return 0; + target: function (player, target) { + if (player.countCards("h") <= 1) return 0; return -1.5; - } + }, + }, + tag: { + loseHp: 1, }, - tag:{ - loseHp:1 - } - } - }, - feibiao:{ - type:'jiguan', - enable:true, - fullskin:true, - wuxieable:true, - outrange:{globalFrom:2}, - filterTarget:function(card,player,target){ - return target!=player; }, - content:function(){ - "step 0" - if(!target.countCards('h',{color:'black'})){ + }, + feibiao: { + type: "jiguan", + enable: true, + fullskin: true, + wuxieable: true, + outrange: { globalFrom: 2 }, + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + if (!target.countCards("h", { color: "black" })) { target.loseHp(); event.finish(); + } else { + target.chooseToDiscard({ color: "black" }, "弃置一张黑色手牌或受失去1点体力").ai = + function (card) { + return 8 - get.value(card); + }; } - else{ - target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受失去1点体力').ai=function(card){ - return 8-get.value(card); - }; - } - "step 1" - if(!result.bool){ + "step 1"; + if (!result.bool) { target.loseHp(); } }, - ai:{ - basic:{ - order:9, - value:3, - useful:1, + ai: { + basic: { + order: 9, + value: 3, + useful: 1, }, - result:{ - target:-2 + result: { + target: -2, + }, + tag: { + discard: 1, + loseHp: 1, }, - tag:{ - discard:1, - loseHp:1 - } - } - }, - longxugou:{ - type:'jiguan', - enable:true, - fullskin:true, - wuxieable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countGainableCards(player,'e'); }, - content:function(){ - 'step 0' - var es=target.getGainableCards(player,'e') - if(es.length){ - player.choosePlayerCard('e',target,true).set('es',es).set('filterButton',function(button){ - return _status.event.es.includes(button.link); - }); - } - else{ + }, + longxugou: { + type: "jiguan", + enable: true, + fullskin: true, + wuxieable: true, + filterTarget: function (card, player, target) { + return target != player && target.countGainableCards(player, "e"); + }, + content: function () { + "step 0"; + var es = target.getGainableCards(player, "e"); + if (es.length) { + player + .choosePlayerCard("e", target, true) + .set("es", es) + .set("filterButton", function (button) { + return _status.event.es.includes(button.link); + }); + } else { event.finish(); } - 'step 1' - if(result.bool){ - target.$give(result.links[0],player); - target.lose(result.links[0],ui.special); - event.card=result.links[0]; + "step 1"; + if (result.bool) { + target.$give(result.links[0], player); + target.lose(result.links[0], ui.special); + event.card = result.links[0]; game.delay(); - } - else{ + } else { event.finish(); } - 'step 2' - if(event.card&&get.position(event.card)=='s'){ + "step 2"; + if (event.card && get.position(event.card) == "s") { player.equip(event.card); } }, - ai:{ - basic:{ - order:9, - value:6, - useful:4, + ai: { + basic: { + order: 9, + value: 6, + useful: 4, }, - result:{ - target:-1 + result: { + target: -1, }, - tag:{ - loseCard:1, - gain:1, - } - } + tag: { + loseCard: 1, + gain: 1, + }, + }, }, - qiankunbiao:{ - type:'jiguan', - enable:true, - fullskin:true, - wuxieable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('he')>0; + qiankunbiao: { + type: "jiguan", + enable: true, + fullskin: true, + wuxieable: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("he") > 0; }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1&¤t.countCards('he'); - },targets); + changeTarget: function (player, targets) { + game.filterPlayer(function (current) { + return get.distance(targets[0], current, "pure") == 1 && current.countCards("he"); + }, targets); }, - content:function(){ - var he=target.getCards('he'); - if(he.length){ - target.discard(he.randomGet()).delay=false; + content: function () { + var he = target.getCards("he"); + if (he.length) { + target.discard(he.randomGet()).delay = false; } }, - contentAfter:function(){ + contentAfter: function () { game.delay(0.5); }, - ai:{ - order:7, - tag:{ - loseCard:1, - discard:1, + ai: { + order: 7, + tag: { + loseCard: 1, + discard: 1, }, - wuxie:function(){ + wuxie: function () { return 0; }, - result:{ - target:-1, - } - } + result: { + target: -1, + }, + }, }, - shenhuofeiya:{ - type:'jiguan', - enable:true, - fullskin:true, - wuxieable:true, - filterTarget:function(card,player,target){ - return target!=player; + shenhuofeiya: { + type: "jiguan", + enable: true, + fullskin: true, + wuxieable: true, + filterTarget: function (card, player, target) { + return target != player; }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); + changeTarget: function (player, targets) { + game.filterPlayer(function (current) { + return get.distance(targets[0], current, "pure") == 1; + }, targets); }, - cardcolor:'red', - cardnature:'fire', - content:function(){ - "step 0" - var next=target.chooseToRespond({name:'shan'}); - next.ai=function(card){ - if(get.damageEffect(target,player,target,'fire')>=0) return 0; - if(player.hasSkillTag('notricksource')) return 0; - if(target.hasSkillTag('notrick')) return 0; - if(target.hasSkillTag('noShan')){ + cardcolor: "red", + cardnature: "fire", + content: function () { + "step 0"; + var next = target.chooseToRespond({ name: "shan" }); + next.ai = function (card) { + if (get.damageEffect(target, player, target, "fire") >= 0) return 0; + if (player.hasSkillTag("notricksource")) return 0; + if (target.hasSkillTag("notrick")) return 0; + if (target.hasSkillTag("noShan")) { return -1; } - return 11-get.value(card); + return 11 - get.value(card); }; - next.autochoose=lib.filter.autoRespondShan; - "step 1" - if(result.bool==false){ - target.damage('fire'); + next.autochoose = lib.filter.autoRespondShan; + "step 1"; + if (result.bool == false) { + target.damage("fire"); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ - if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.attitude(viewer, target) > 0 && target.countCards("h", "shan")) { + if (!target.countCards("h") || target.hp == 1 || Math.random() < 0.7) return 0; } - if(get.attitude(viewer,target)<=0){ + if (get.attitude(viewer, target) <= 0) { return 0; } }, - order:7, - tag:{ - respond:1, - respondShan:1, - damage:1, - natureDamage:1, - fireDamage:1, - multitarget:1, - multineg:1, + order: 7, + tag: { + respond: 1, + respondShan: 1, + damage: 1, + natureDamage: 1, + fireDamage: 1, + multitarget: 1, + multineg: 1, }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nofire')) return 0; - if(player.hasUnknown(2)) return 0; - var nh=target.countCards('h'); - if(lib.config.mode=='identity'){ - if(target.isZhu&&nh<=2&&target.hp<=1) return -100; + result: { + target: function (player, target) { + if (target.hasSkillTag("nofire")) return 0; + if (player.hasUnknown(2)) return 0; + var nh = target.countCards("h"); + if (lib.config.mode == "identity") { + if (target.isZhu && nh <= 2 && target.hp <= 1) return -100; } - if(nh==0) return -2; - if(nh==1) return -1.7 + if (nh == 0) return -2; + if (nh == 1) return -1.7; return -1.5; }, - } - } + }, + }, }, // wenhuangsan:{ // type:'jiguan', @@ -958,978 +983,1035 @@ game.import('card', function () { // enable:true, // fullskin:true, // }, - mianlijinzhen:{ - type:'jiguan', - enable:true, - fullskin:true, - filterTarget:function(card,player,target){ - return target.hp>=player.hp; + mianlijinzhen: { + type: "jiguan", + enable: true, + fullskin: true, + filterTarget: function (card, player, target) { + return target.hp >= player.hp; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; target.draw(); - 'step 1' + "step 1"; target.loseHp(); }, - ai:{ - order:2, - value:[5,1], - useful:[4,1], - result:{ - target:-1.5 + ai: { + order: 2, + value: [5, 1], + useful: [4, 1], + result: { + target: -1.5, }, - tag:{ + tag: { // damage:1 - } - } + }, + }, }, // longxugou:{ // type:'jiguan', // enable:true, // fullskin:true, // }, - liutouge:{ - type:'jiguan', - enable:true, - fullskin:true, - filterTarget:true, - wuxieable:true, - content:function(){ - if(player.getEnemies().includes(target)){ + liutouge: { + type: "jiguan", + enable: true, + fullskin: true, + filterTarget: true, + wuxieable: true, + content: function () { + if (player.getEnemies().includes(target)) { target.getDebuff(); - } - else{ + } else { target.getBuff(); } }, - ai:{ - order:4, - value:5, - result:{ - player:function(player,target){ - if(get.attitude(player,target)==0) return 0; + ai: { + order: 4, + value: 5, + result: { + player: function (player, target) { + if (get.attitude(player, target) == 0) return 0; return 1; - } - } - } - }, - liufengsan:{ - type:'trick', - enable:true, - fullskin:true, - filterTarget:true, - content:function(){ - var list=[]; - for(var i=0;i<2;i++){ - list.push(game.createCard('shan')); - } - target.gain(list,'gain2'); - }, - ai:{ - order:4.5, - value:[5,1], - tag:{ - gain:1, - norepeat:1 + }, }, - result:{ - target:function(player,target){ - if(target==player){ - if(!target.hasShan()) return 2; - var num=target.needsToDiscard(2); - if(num==0) return 1.5; - if(num==1) return 1; + }, + }, + liufengsan: { + type: "trick", + enable: true, + fullskin: true, + filterTarget: true, + content: function () { + var list = []; + for (var i = 0; i < 2; i++) { + list.push(game.createCard("shan")); + } + target.gain(list, "gain2"); + }, + ai: { + order: 4.5, + value: [5, 1], + tag: { + gain: 1, + norepeat: 1, + }, + result: { + target: function (player, target) { + if (target == player) { + if (!target.hasShan()) return 2; + var num = target.needsToDiscard(2); + if (num == 0) return 1.5; + if (num == 1) return 1; return 0.5; - } - else{ - switch(target.countCards('h')){ - case 0:return 2; - case 1:return 1.5; - case 2:return 1; - default:return 0.5; + } else { + switch (target.countCards("h")) { + case 0: + return 2; + case 1: + return 1.5; + case 2: + return 1; + default: + return 0.5; } } - } - } - } + }, + }, + }, }, - shihuifen:{ - type:'trick', - fullskin:true, - filterTarget:true, - global:'g_shihuifen', - content:function(){ - 'step 0' - var next=_status.currentPhase.chooseToRespond({name:'shan'}); - next.set('prompt2','否则本回合无法对其他角色使用卡牌'); - 'step 1' - if(!result.bool){ - _status.currentPhase.addTempSkill('shihuifen','phaseUseAfter'); + shihuifen: { + type: "trick", + fullskin: true, + filterTarget: true, + global: "g_shihuifen", + content: function () { + "step 0"; + var next = _status.currentPhase.chooseToRespond({ name: "shan" }); + next.set("prompt2", "否则本回合无法对其他角色使用卡牌"); + "step 1"; + if (!result.bool) { + _status.currentPhase.addTempSkill("shihuifen", "phaseUseAfter"); } }, - ai:{ - order:1, - value:[5,1], - useful:[5,1], - tag:{ - respond:1, - respondShan:1, + ai: { + order: 1, + value: [5, 1], + useful: [5, 1], + tag: { + respond: 1, + respondShan: 1, }, - result:{ - target:function(player,target){ - if(target.countCards('h')>=3||target.needsToDiscard()) return -1.5; + result: { + target: function (player, target) { + if (target.countCards("h") >= 3 || target.needsToDiscard()) return -1.5; return 0; - } - } - } + }, + }, + }, }, }, - skill:{ - ziyangdan:{ - trigger:{player:'phaseBegin'}, - silent:true, - init:function(player){ - player.storage.ziyangdan=3; + skill: { + ziyangdan: { + trigger: { player: "phaseBegin" }, + silent: true, + init: function (player) { + player.storage.ziyangdan = 3; }, - onremove:true, - content:function(){ - if(player.hujia>0){ + onremove: true, + content: function () { + if (player.hujia > 0) { player.changeHujia(-1); } player.storage.ziyangdan--; - if(player.hujia==0||player.storage.ziyangdan==0){ - player.removeSkill('ziyangdan'); + if (player.hujia == 0 || player.storage.ziyangdan == 0) { + player.removeSkill("ziyangdan"); } }, - ai:{ - threaten:0.8 - } + ai: { + threaten: 0.8, + }, }, - luyugeng:{ - mark:'card', - enable:'phaseUse', - usable:1, - nopop:true, - filterCard:{type:'basic'}, - filter:function(event,player){ - return player.countCards('h',{type:'basic'}); + luyugeng: { + mark: "card", + enable: "phaseUse", + usable: 1, + nopop: true, + filterCard: { type: "basic" }, + filter: function (event, player) { + return player.countCards("h", { type: "basic" }); }, - intro:{ - content:function(storage,player){ - return '出牌阶段限一次,你可以弃置一张基本牌并发现一张牌,持续两回合(剩余'+player.storage.luyugeng_markcount+'回合)' - } + intro: { + content: function (storage, player) { + return ( + "出牌阶段限一次,你可以弃置一张基本牌并发现一张牌,持续两回合(剩余" + + player.storage.luyugeng_markcount + + "回合)" + ); + }, }, - content:function(){ + content: function () { player.discoverCard(); }, - group:'luyugeng_count', - subSkill:{ - count:{ - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - content:function(){ + group: "luyugeng_count", + subSkill: { + count: { + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + content: function () { player.storage.luyugeng_markcount--; - if(player.storage.luyugeng_markcount==0){ + if (player.storage.luyugeng_markcount == 0) { delete player.storage.luyugeng; delete player.storage.luyugeng_markcount; - player.removeSkill('luyugeng'); - } - else{ + player.removeSkill("luyugeng"); + } else { player.updateMarks(); } }, - } - } + }, + }, }, - xiajiao:{ - mark:'card', - trigger:{player:['phaseUseBefore','phaseEnd']}, - forced:true, - popup:false, - nopop:true, - filter:function(event,player){ - return !player.hasSkill('xiajiao3'); + xiajiao: { + mark: "card", + trigger: { player: ["phaseUseBefore", "phaseEnd"] }, + forced: true, + popup: false, + nopop: true, + filter: function (event, player) { + return !player.hasSkill("xiajiao3"); }, - intro:{ - content:function(storage,player){ - return '你在摸牌阶段额外摸一张牌,然后弃置一张牌(剩余'+player.storage.xiajiao_markcount+'回合)' - } + intro: { + content: function (storage, player) { + return ( + "你在摸牌阶段额外摸一张牌,然后弃置一张牌(剩余" + + player.storage.xiajiao_markcount + + "回合)" + ); + }, }, - content:function(){ + content: function () { player.storage.xiajiao_markcount--; - if(player.storage.xiajiao_markcount==0){ + if (player.storage.xiajiao_markcount == 0) { delete player.storage.xiajiao; delete player.storage.xiajiao_markcount; - player.removeSkill('xiajiao'); - } - else{ + player.removeSkill("xiajiao"); + } else { player.updateMarks(); } - player.addTempSkill('xiajiao3'); + player.addTempSkill("xiajiao3"); }, - group:'xiajiao_draw', - subSkill:{ - draw:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - content:function(){ + group: "xiajiao_draw", + subSkill: { + draw: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + content: function () { trigger.num++; - player.addTempSkill('xiajiao2'); - } - } - } - }, - xiajiao2:{ - trigger:{player:'phaseDrawAfter'}, - silent:true, - content:function(){ - player.chooseToDiscard('he',true); - } - }, - xiajiao3:{}, - mizhilianou:{ - mark:'card', - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '你可以将一张红桃牌当作桃使用(剩余'+player.storage.mizhilianou_markcount+'回合)' - } + player.addTempSkill("xiajiao2"); + }, + }, }, - content:function(){ + }, + xiajiao2: { + trigger: { player: "phaseDrawAfter" }, + silent: true, + content: function () { + player.chooseToDiscard("he", true); + }, + }, + xiajiao3: {}, + mizhilianou: { + mark: "card", + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "你可以将一张红桃牌当作桃使用(剩余" + + player.storage.mizhilianou_markcount + + "回合)" + ); + }, + }, + content: function () { player.storage.mizhilianou_markcount--; - if(player.storage.mizhilianou_markcount==0){ + if (player.storage.mizhilianou_markcount == 0) { delete player.storage.mizhilianou; delete player.storage.mizhilianou_markcount; - player.removeSkill('mizhilianou'); - } - else{ + player.removeSkill("mizhilianou"); + } else { player.updateMarks(); } }, - group:'mizhilianou_use', - subSkill:{ - use:{ - enable:'chooseToUse', - filterCard:{suit:'heart'}, - position:'he', - viewAs:{name:'tao'}, - viewAsFilter:function(player){ - return player.countCards('he',{suit:'heart'})>0; + group: "mizhilianou_use", + subSkill: { + use: { + enable: "chooseToUse", + filterCard: { suit: "heart" }, + position: "he", + viewAs: { name: "tao" }, + viewAsFilter: function (player) { + return player.countCards("he", { suit: "heart" }) > 0; }, - prompt:'将一张红桃牌当桃使用', - check:function(card){return 10-get.value(card)}, - ai:{ - skillTagFilter:function(player){ - return player.countCards('he',{suit:'heart'})>0; + prompt: "将一张红桃牌当桃使用", + check: function (card) { + return 10 - get.value(card); + }, + ai: { + skillTagFilter: function (player) { + return player.countCards("he", { suit: "heart" }) > 0; }, - save:true, - respondTao:true, - } - } - } + save: true, + respondTao: true, + }, + }, + }, }, - chunbing:{ - mark:'card', - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '你的手牌上限+1(剩余'+player.storage.chunbing_markcount+'回合)' - } + chunbing: { + mark: "card", + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return "你的手牌上限+1(剩余" + player.storage.chunbing_markcount + "回合)"; + }, }, - mod:{ - maxHandcard:function(player,num){ - return num+1; - } + mod: { + maxHandcard: function (player, num) { + return num + 1; + }, }, - content:function(){ + content: function () { player.storage.chunbing_markcount--; - if(player.storage.chunbing_markcount==0){ + if (player.storage.chunbing_markcount == 0) { delete player.storage.chunbing; delete player.storage.chunbing_markcount; - player.removeSkill('chunbing'); - } - else{ + player.removeSkill("chunbing"); + } else { player.updateMarks(); } }, }, - gudonggeng:{ - mark:'card', - trigger:{player:'phaseBegin'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '当你下一次受到杀造成的伤害时,令伤害-1(剩余'+player.storage.gudonggeng_markcount+'回合)' - } + gudonggeng: { + mark: "card", + trigger: { player: "phaseBegin" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "当你下一次受到杀造成的伤害时,令伤害-1(剩余" + + player.storage.gudonggeng_markcount + + "回合)" + ); + }, }, - content:function(){ + content: function () { player.storage.gudonggeng_markcount--; - if(player.storage.gudonggeng_markcount==0){ + if (player.storage.gudonggeng_markcount == 0) { delete player.storage.gudonggeng; delete player.storage.gudonggeng_markcount; - player.removeSkill('gudonggeng'); - } - else{ + player.removeSkill("gudonggeng"); + } else { player.updateMarks(); } }, - group:'gudonggeng_damage', - subSkill:{ - damage:{ - trigger:{player:'damageBegin'}, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.num>0; + group: "gudonggeng_damage", + subSkill: { + damage: { + trigger: { player: "damageBegin" }, + filter: function (event, player) { + return event.card && event.card.name == "sha" && event.num > 0; }, - forced:true, - content:function(){ + forced: true, + content: function () { trigger.num--; delete player.storage.gudonggeng; delete player.storage.gudonggeng_markcount; - player.removeSkill('gudonggeng'); - } - } + player.removeSkill("gudonggeng"); + }, + }, + }, + ai: { + effect: { + target: function (card, player, target) { + if (card.name == "sha" && get.attitude(player, target) < 0) return 0.5; + }, + }, }, - ai:{ - effect:{ - target:function(card,player,target){ - if(card.name=='sha'&&get.attitude(player,target)<0) return 0.5; - } - } - } }, - qingtuan:{ - mark:'card', - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '你在回合内使用首张杀时摸一张牌(剩余'+player.storage.qingtuan_markcount+'回合)' - } + qingtuan: { + mark: "card", + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "你在回合内使用首张杀时摸一张牌(剩余" + + player.storage.qingtuan_markcount + + "回合)" + ); + }, }, - content:function(){ + content: function () { player.storage.qingtuan_markcount--; - if(player.storage.qingtuan_markcount==0){ + if (player.storage.qingtuan_markcount == 0) { delete player.storage.qingtuan; delete player.storage.qingtuan_markcount; - player.removeSkill('qingtuan'); - } - else{ + player.removeSkill("qingtuan"); + } else { player.updateMarks(); } }, - group:'qingtuan_draw', - subSkill:{ - draw:{ - trigger:{player:'useCard'}, - filter:function(event,player){ - return event.card.name=='sha'&&_status.currentPhase==player; + group: "qingtuan_draw", + subSkill: { + draw: { + trigger: { player: "useCard" }, + filter: function (event, player) { + return event.card.name == "sha" && _status.currentPhase == player; }, - usable:1, - forced:true, - content:function(){ + usable: 1, + forced: true, + content: function () { player.draw(); - } - } - } - }, - liyutang:{ - mark:'card', - trigger:{player:'phaseEnd'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '结束阶段,若你的体力值为全场最少或之一,你获得1点护甲(剩余'+player.storage.liyutang_markcount+'回合)' - } + }, + }, }, - content:function(){ - if(player.isMinHp()){ - player.logSkill('liyutang'); + }, + liyutang: { + mark: "card", + trigger: { player: "phaseEnd" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "结束阶段,若你的体力值为全场最少或之一,你获得1点护甲(剩余" + + player.storage.liyutang_markcount + + "回合)" + ); + }, + }, + content: function () { + if (player.isMinHp()) { + player.logSkill("liyutang"); player.changeHujia(); } player.storage.liyutang_markcount--; - if(player.storage.liyutang_markcount==0){ + if (player.storage.liyutang_markcount == 0) { delete player.storage.liyutang; delete player.storage.liyutang_markcount; - player.removeSkill('liyutang'); - } - else{ + player.removeSkill("liyutang"); + } else { player.updateMarks(); } }, }, - yougeng:{ - mark:'card', - trigger:{player:'phaseBegin'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '准备阶段,若你的体力值为全场最少或之一,你回复1点体力(剩余'+player.storage.yougeng_markcount+'回合)' - } + yougeng: { + mark: "card", + trigger: { player: "phaseBegin" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "准备阶段,若你的体力值为全场最少或之一,你回复1点体力(剩余" + + player.storage.yougeng_markcount + + "回合)" + ); + }, }, - content:function(){ - if(player.isDamaged()&&player.isMinHp()){ - player.logSkill('yougeng'); + content: function () { + if (player.isDamaged() && player.isMinHp()) { + player.logSkill("yougeng"); player.recover(); } player.storage.yougeng_markcount--; - if(player.storage.yougeng_markcount==0){ + if (player.storage.yougeng_markcount == 0) { delete player.storage.yougeng; delete player.storage.yougeng_markcount; - player.removeSkill('yougeng'); - } - else{ + player.removeSkill("yougeng"); + } else { player.updateMarks(); } }, }, - molicha:{ - mark:'card', - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '你不能成为其他角色的黑色牌的目标(剩余'+player.storage.molicha_markcount+'回合)' - } + molicha: { + mark: "card", + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "你不能成为其他角色的黑色牌的目标(剩余" + + player.storage.molicha_markcount + + "回合)" + ); + }, }, - mod:{ - targetEnabled:function(card,player,target){ - if(player!=target&&get.color(card)=='black'){ + mod: { + targetEnabled: function (card, player, target) { + if (player != target && get.color(card) == "black") { return false; } - } + }, }, - content:function(){ + content: function () { player.storage.molicha_markcount--; - if(player.storage.molicha_markcount==0){ + if (player.storage.molicha_markcount == 0) { delete player.storage.molicha; delete player.storage.molicha_markcount; - player.removeSkill('molicha'); - player.logSkill('molicha'); - } - else{ + player.removeSkill("molicha"); + player.logSkill("molicha"); + } else { player.updateMarks(); } - } + }, }, - yuanbaorou:{ - mark:'card', - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '你在出牌阶段可以额外使用一张杀(剩余'+player.storage.yuanbaorou_markcount+'回合)' - } + yuanbaorou: { + mark: "card", + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "你在出牌阶段可以额外使用一张杀(剩余" + + player.storage.yuanbaorou_markcount + + "回合)" + ); + }, }, - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+1; - } + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + 1; + }, }, - content:function(){ + content: function () { player.storage.yuanbaorou_markcount--; - if(player.storage.yuanbaorou_markcount==0){ + if (player.storage.yuanbaorou_markcount == 0) { delete player.storage.yuanbaorou; delete player.storage.yuanbaorou_markcount; - player.removeSkill('yuanbaorou'); - } - else{ + player.removeSkill("yuanbaorou"); + } else { player.updateMarks(); } }, }, - tanhuadong:{ - mark:'card', - trigger:{player:'phaseEnd'}, - forced:true, - popup:false, - nopop:true, - intro:{ - content:function(storage,player){ - return '出牌阶段结束时,你摸一张牌(剩余'+player.storage.tanhuadong_markcount+'回合)' - } + tanhuadong: { + mark: "card", + trigger: { player: "phaseEnd" }, + forced: true, + popup: false, + nopop: true, + intro: { + content: function (storage, player) { + return ( + "出牌阶段结束时,你摸一张牌(剩余" + + player.storage.tanhuadong_markcount + + "回合)" + ); + }, }, - content:function(){ + content: function () { player.storage.tanhuadong_markcount--; - if(player.storage.tanhuadong_markcount==0){ + if (player.storage.tanhuadong_markcount == 0) { delete player.storage.tanhuadong; delete player.storage.tanhuadong_markcount; - player.removeSkill('tanhuadong'); - } - else{ + player.removeSkill("tanhuadong"); + } else { player.updateMarks(); } }, - group:'tanhuadong_draw', - subSkill:{ - draw:{ - trigger:{player:'phaseUseEnd'}, - forced:true, - content:function(){ + group: "tanhuadong_draw", + subSkill: { + draw: { + trigger: { player: "phaseUseEnd" }, + forced: true, + content: function () { player.draw(); - } - } - } - }, - mapodoufu:{ - mark:'card', - trigger:{player:'phaseJieshuBegin'}, - forced:true, - popup:false, - nopop:true, - forceLoad:true, - intro:{ - content:function(storage,player){ - return '结束阶段,你随机弃置一名随机敌人的一张随机牌(剩余'+player.storage.mapodoufu_markcount+'回合)' - } + }, + }, }, - content:function(){ - var list=player.getEnemies(); - for(var i=0;i=3){ - card.init([card.suit,card.number,'gjyuheng_plus',card.nature]); - player.addTempSkill('gjyuheng_plus_temp'); + if (card.storage.gjyuheng >= 3) { + card.init([card.suit, card.number, "gjyuheng_plus", card.nature]); + player.addTempSkill("gjyuheng_plus_temp"); } } }, - ai:{ - order:9, - result:{ - player:1 - } - } - }, - gjyuheng_plus_temp:{}, - gjyuheng_plus_skill:{ - enable:'phaseUse', - usable:1, - filterCard:{color:'black'}, - check:function(card){ - return 8-get.value(card); + ai: { + order: 9, + result: { + player: 1, + }, }, - filter:function(event,player){ + }, + gjyuheng_plus_temp: {}, + gjyuheng_plus_skill: { + enable: "phaseUse", + usable: 1, + filterCard: { color: "black" }, + check: function (card) { + return 8 - get.value(card); + }, + filter: function (event, player) { // if(player.hasSkill('gjyuheng_plus_temp')) return false; - if(!player.countCards('h',{color:'black'})) return false; - var enemies=player.getEnemies(); - for(var i=0;i=7){ - card.init([card.suit,card.number,'gjyuheng_pro',card.nature]); + if (card.storage.gjyuheng >= 7) { + card.init([card.suit, card.number, "gjyuheng_pro", card.nature]); } } }, - ai:{ - order:9, - result:{ - player:1 - } - } - }, - gjyuheng_pro_skill:{ - enable:'phaseUse', - filterCard:{color:'black'}, - check:function(card){ - return 8-get.value(card); + ai: { + order: 9, + result: { + player: 1, + }, }, - filter:function(event,player){ - if(!player.countCards('h',{color:'black'})) return false; - var enemies=player.getEnemies(); - for(var i=0;i=3){ - card.init([card.suit,card.number,'gjyuheng_plus',card.nature]); - player.addTempSkill('gjyuheng_plus_temp'); + if (card.storage.gjyuheng >= 3) { + card.init([card.suit, card.number, "gjyuheng_plus", card.nature]); + player.addTempSkill("gjyuheng_plus_temp"); } } }, - ai:{ - order:9, - result:{ - player:1 - } - } - }, - shihuifen:{ - mark:true, - intro:{ - content:'使用卡牌无法指定其他角色为目标' + ai: { + order: 9, + result: { + player: 1, + }, }, - mod:{ - playerEnabled:function(card,player,target){ - if(player!=target) return false; - } - } }, - g_shihuifen:{ - trigger:{global:'phaseUseBegin'}, - direct:true, - filter:function(event,player){ - if(event.player.hasSkill('shihuifen')) return false; - if(event.player==player) return false; - if(!lib.filter.targetEnabled({name:'shihuifen'},player,event.player)) return false; - return player.hasCard('shihuifen')||player.hasSkillTag('shihuifen'); + shihuifen: { + mark: true, + intro: { + content: "使用卡牌无法指定其他角色为目标", + }, + mod: { + playerEnabled: function (card, player, target) { + if (player != target) return false; + }, }, - content:function(){ - player.chooseToUse(get.prompt('shihuifen',trigger.player).replace(/发动/,'使用'),function(card,player){ - if(card.name!='shihuifen') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - },trigger.player,-1).targetRequired=true; - } }, - g_jinlianzhu:{ - trigger:{global:'damageBefore'}, - direct:true, - filter:function(event,player){ - if(!lib.filter.targetEnabled({name:'jinlianzhu'},player,event.player)) return false; - return player.hasCard('jinlianzhu'); + g_shihuifen: { + trigger: { global: "phaseUseBegin" }, + direct: true, + filter: function (event, player) { + if (event.player.hasSkill("shihuifen")) return false; + if (event.player == player) return false; + if (!lib.filter.targetEnabled({ name: "shihuifen" }, player, event.player)) return false; + return player.hasCard("shihuifen") || player.hasSkillTag("shihuifen"); + }, + content: function () { + player.chooseToUse( + get.prompt("shihuifen", trigger.player).replace(/发动/, "使用"), + function (card, player) { + if (card.name != "shihuifen") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }, + trigger.player, + -1 + ).targetRequired = true; + }, + }, + g_jinlianzhu: { + trigger: { global: "damageBefore" }, + direct: true, + filter: function (event, player) { + if (!lib.filter.targetEnabled({ name: "jinlianzhu" }, player, event.player)) return false; + return player.hasCard("jinlianzhu"); + }, + content: function () { + player.chooseToUse( + get.prompt("jinlianzhu", trigger.player).replace(/发动/, "使用"), + function (card, player) { + if (card.name != "jinlianzhu") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }, + trigger.player, + -1 + ).targetRequired = true; }, - content:function(){ - player.chooseToUse(get.prompt('jinlianzhu',trigger.player).replace(/发动/,'使用'),function(card,player){ - if(card.name!='jinlianzhu') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - },trigger.player,-1).targetRequired=true; - } }, }, - cardType:{ - food:0.3 + cardType: { + food: 0.3, }, - translate:{ - jinlianzhu:'金莲珠', - jinlianzhu_info:'对一名即将受到伤害的角色使用,防止此伤害,并令伤害来源摸一张牌。', - shihuifen:'石灰粉', - shihuifen_info:'在一名其他角色的出牌阶段开始时对其使用,目标需打出一张闪,否则此阶段使用卡牌无法指定其他角色为目标。', - liufengsan:'流风散', - liufengsan_info:'出牌阶段对一名角色使用,目标获得两张闪。', - liutouge:'六骰格', - liutouge_info:'出牌阶段对一名角色使用,若目标是敌人,对目标施加一个随机的负面效果;否则对目标施加一个随机的正面效果。', - longxugou:'龙须钩', - longxugou_info:'出牌阶段对一名装备区内有牌的其他角色使用,获得其装备区内的一张牌并装备之。', - mianlijinzhen:'棉里针', - mianlijinzhen_info:'出牌阶段对一名体力值不小于你的角色使用,目标摸一张牌然后失去1点体力。', - shenhuofeiya:'神火飞鸦', - shenhuofeiya_info:'出牌阶段对一名其他角色和其相邻角色使用,目标需打出一张闪,否则受到1点火属性伤害。', + translate: { + jinlianzhu: "金莲珠", + jinlianzhu_info: "对一名即将受到伤害的角色使用,防止此伤害,并令伤害来源摸一张牌。", + shihuifen: "石灰粉", + shihuifen_info: + "在一名其他角色的出牌阶段开始时对其使用,目标需打出一张闪,否则此阶段使用卡牌无法指定其他角色为目标。", + liufengsan: "流风散", + liufengsan_info: "出牌阶段对一名角色使用,目标获得两张闪。", + liutouge: "六骰格", + liutouge_info: + "出牌阶段对一名角色使用,若目标是敌人,对目标施加一个随机的负面效果;否则对目标施加一个随机的正面效果。", + longxugou: "龙须钩", + longxugou_info: "出牌阶段对一名装备区内有牌的其他角色使用,获得其装备区内的一张牌并装备之。", + mianlijinzhen: "棉里针", + mianlijinzhen_info: "出牌阶段对一名体力值不小于你的角色使用,目标摸一张牌然后失去1点体力。", + shenhuofeiya: "神火飞鸦", + shenhuofeiya_info: + "出牌阶段对一名其他角色和其相邻角色使用,目标需打出一张闪,否则受到1点火属性伤害。", // tuhunsha:'土魂砂', // tuhunsha_info:'土魂砂', // wenhuangsan:'瘟癀伞', // wenhuangsan_info:'瘟癀伞', - qiankunbiao:'乾坤镖', - qiankunbiao_info:'随机弃置一名其他角色和其相邻角色的一张牌。', + qiankunbiao: "乾坤镖", + qiankunbiao_info: "随机弃置一名其他角色和其相邻角色的一张牌。", - bingpotong:'天女散花', - bingpotong_ab:'散花', - bingpotong_info:'出牌阶段对至多3名角色使用,你与每个目标依次同时展示一张手牌,若颜色相同,你弃置展示的手牌,目标失去1点体力并终止结算。', - feibiao:'飞镖', - feibiao_info:'出牌阶段,对一名距离1以外的角色使用,令其弃置一张黑色手牌或失去1点体力。', + bingpotong: "天女散花", + bingpotong_ab: "散花", + bingpotong_info: + "出牌阶段对至多3名角色使用,你与每个目标依次同时展示一张手牌,若颜色相同,你弃置展示的手牌,目标失去1点体力并终止结算。", + feibiao: "飞镖", + feibiao_info: "出牌阶段,对一名距离1以外的角色使用,令其弃置一张黑色手牌或失去1点体力。", - dinvxuanshuang:'帝女玄霜', - dinvxuanshuang_skill:'帝女玄霜', - dinvxuanshuang_info:'对一名濒死状态的角色使用,目标回复1点体力,然后可以弃置任意张牌并摸等量的牌。', - yunvyuanshen:'玉女元参', - yunvyuanshen_skill:'玉女元参', - yunvyuanshen_info:'出牌阶段对一名角色使用,目标在下一次进入濒死状态时回复1点体力。', - ziyangdan:'紫阳丹', - ziyangdan_info:'出牌阶段对一名角色使用,目标获得3点护甲,此后每个准备阶段失去1点护甲,直到首次失去所有护甲或累计以此法失去3点护甲。', - gjyuheng:'玉衡', - gjyuheng_plus:'玉衡', - gjyuheng_pro:'玉衡', - gjyuheng_skill:'玉衡', - gjyuheng_plus_skill:'玉衡', - gjyuheng_pro_skill:'玉衡', - gjyuheng_info:'出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑桃手牌,然后获得一名随机敌方角色的一张随机黑桃手牌(此牌在本局游戏中第三次和第七次发动效果后,分别自动获得一次强化)。', - gjyuheng_plus_info:'由普通玉衡强化得到,将玉衡技能描述中的“弃置一张黑桃手牌”改为“弃置一张黑色手牌”。', - gjyuheng_pro_info:'由普通玉衡二次强化得到,将玉横技能描述中的“弃置一张黑桃手牌”改为“弃置一张黑色手牌”,并去掉使用次数限制。', - gjyuheng_skill_info:'出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑桃手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。', - gjyuheng_plus_skill_info:'出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑色手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。', - gjyuheng_pro_skill_info:'出牌阶段限,若敌方角色有黑桃手牌,你可以弃置一张黑色手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。', - shujinsan:'舒筋散', - shujinsan_info:'出牌阶段对任意角色使用,目标可弃置任意张牌,并摸等量的牌。', - mutoumianju:'木头面具', - mutoumianju_info:'出牌阶段限一次,你可以将一张手牌当作杀使用。', - mutoumianju_skill:'木杀', - mutoumianju_skill_info:'出牌阶段限一次,你可以将一张手牌当作杀使用。', - heilonglinpian:'黑龙鳞片', - heilonglinpian_info:'出牌阶段对自己使用,获得1点护甲,直到下一回合开始,你的防御距离+1。', - shatang:'沙棠', - shatang_info:'出牌阶段对一名角色使用,对目标造成1点火焰伤害,然后目标获得1点护甲。', + dinvxuanshuang: "帝女玄霜", + dinvxuanshuang_skill: "帝女玄霜", + dinvxuanshuang_info: + "对一名濒死状态的角色使用,目标回复1点体力,然后可以弃置任意张牌并摸等量的牌。", + yunvyuanshen: "玉女元参", + yunvyuanshen_skill: "玉女元参", + yunvyuanshen_info: "出牌阶段对一名角色使用,目标在下一次进入濒死状态时回复1点体力。", + ziyangdan: "紫阳丹", + ziyangdan_info: + "出牌阶段对一名角色使用,目标获得3点护甲,此后每个准备阶段失去1点护甲,直到首次失去所有护甲或累计以此法失去3点护甲。", + gjyuheng: "玉衡", + gjyuheng_plus: "玉衡", + gjyuheng_pro: "玉衡", + gjyuheng_skill: "玉衡", + gjyuheng_plus_skill: "玉衡", + gjyuheng_pro_skill: "玉衡", + gjyuheng_info: + "出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑桃手牌,然后获得一名随机敌方角色的一张随机黑桃手牌(此牌在本局游戏中第三次和第七次发动效果后,分别自动获得一次强化)。", + gjyuheng_plus_info: + "由普通玉衡强化得到,将玉衡技能描述中的“弃置一张黑桃手牌”改为“弃置一张黑色手牌”。", + gjyuheng_pro_info: + "由普通玉衡二次强化得到,将玉横技能描述中的“弃置一张黑桃手牌”改为“弃置一张黑色手牌”,并去掉使用次数限制。", + gjyuheng_skill_info: + "出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑桃手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。", + gjyuheng_plus_skill_info: + "出牌阶段限一次,若敌方角色有黑桃手牌,你可以弃置一张黑色手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。", + gjyuheng_pro_skill_info: + "出牌阶段限,若敌方角色有黑桃手牌,你可以弃置一张黑色手牌,然后获得一名随机敌方角色的一张随机黑桃手牌。", + shujinsan: "舒筋散", + shujinsan_info: "出牌阶段对任意角色使用,目标可弃置任意张牌,并摸等量的牌。", + mutoumianju: "木头面具", + mutoumianju_info: "出牌阶段限一次,你可以将一张手牌当作杀使用。", + mutoumianju_skill: "木杀", + mutoumianju_skill_info: "出牌阶段限一次,你可以将一张手牌当作杀使用。", + heilonglinpian: "黑龙鳞片", + heilonglinpian_info: "出牌阶段对自己使用,获得1点护甲,直到下一回合开始,你的防御距离+1。", + shatang: "沙棠", + shatang_info: "出牌阶段对一名角色使用,对目标造成1点火焰伤害,然后目标获得1点护甲。", - food:'食物', - chunbing:'春饼', - chunbing_info:'你的手牌上限+1,持续五回合。', - gudonggeng:'骨董羹', - gudonggeng_info:'当你下一次受到杀造成的伤害时,令伤害-1,持续三回合。', - yougeng:'酉羹', - yougeng_info:'准备阶段,若你的体力值为全场最少或之一,你回复1点体力,持续两回合。', - liyutang:'鲤鱼汤', - liyutang_info:'结束阶段,若你的体力值为全场最少或之一,你获得1点护甲,持续两回合。', - mizhilianou:'蜜汁藕', - mizhilianou_info:'你可以将一张红桃牌当作桃使用,持续四回合。', - xiajiao:'虾饺', - xiajiao_info:'你在摸牌阶段额外摸一张牌,然后弃置一张牌,持续三回合。', - tanhuadong:'昙花冻', - tanhuadong_info:'出牌阶段结束时,你摸一张牌,持续三回合。', - qingtuan:'青团', - qingtuan_info:'你在回合内使用首张杀时摸一张牌,持续两回合。', - luyugeng:'鲈鱼羹', - luyugeng_info:'出牌阶段限一次,你可以弃置一张基本牌并发现一张牌,持续三回合。', - yuanbaorou:'元宝肉', - yuanbaorou_info:'你在出牌阶段可以额外使用一张杀,持续四回合。', - molicha:'茉莉茶', - molicha_info:'你不能成为其他角色的黑色牌的目标,持续四回合。', - mapodoufu:'麻婆豆腐', - mapodoufu_info:'结束阶段,你弃置一名随机敌人的一张随机牌,持续两回合。', + food: "食物", + chunbing: "春饼", + chunbing_info: "你的手牌上限+1,持续五回合。", + gudonggeng: "骨董羹", + gudonggeng_info: "当你下一次受到杀造成的伤害时,令伤害-1,持续三回合。", + yougeng: "酉羹", + yougeng_info: "准备阶段,若你的体力值为全场最少或之一,你回复1点体力,持续两回合。", + liyutang: "鲤鱼汤", + liyutang_info: "结束阶段,若你的体力值为全场最少或之一,你获得1点护甲,持续两回合。", + mizhilianou: "蜜汁藕", + mizhilianou_info: "你可以将一张红桃牌当作桃使用,持续四回合。", + xiajiao: "虾饺", + xiajiao_info: "你在摸牌阶段额外摸一张牌,然后弃置一张牌,持续三回合。", + tanhuadong: "昙花冻", + tanhuadong_info: "出牌阶段结束时,你摸一张牌,持续三回合。", + qingtuan: "青团", + qingtuan_info: "你在回合内使用首张杀时摸一张牌,持续两回合。", + luyugeng: "鲈鱼羹", + luyugeng_info: "出牌阶段限一次,你可以弃置一张基本牌并发现一张牌,持续三回合。", + yuanbaorou: "元宝肉", + yuanbaorou_info: "你在出牌阶段可以额外使用一张杀,持续四回合。", + molicha: "茉莉茶", + molicha_info: "你不能成为其他角色的黑色牌的目标,持续四回合。", + mapodoufu: "麻婆豆腐", + mapodoufu_info: "结束阶段,你弃置一名随机敌人的一张随机牌,持续两回合。", }, - list:[ - ['spade',2,'tanhuadong'], - ['club',1,'molicha'], - ['club',3,'chunbing'], - ['heart',12,'yougeng'], - ['heart',8,'gudonggeng'], - ['heart',1,'liyutang'], - ['diamond',4,'mizhilianou'], - ['diamond',6,'xiajiao'], - ['spade',3,'qingtuan'], - ['club',11,'luyugeng'], - ['heart',4,'mapodoufu'], - ['spade',8,'yuanbaorou'], + list: [ + ["spade", 2, "tanhuadong"], + ["club", 1, "molicha"], + ["club", 3, "chunbing"], + ["heart", 12, "yougeng"], + ["heart", 8, "gudonggeng"], + ["heart", 1, "liyutang"], + ["diamond", 4, "mizhilianou"], + ["diamond", 6, "xiajiao"], + ["spade", 3, "qingtuan"], + ["club", 11, "luyugeng"], + ["heart", 4, "mapodoufu"], + ["spade", 8, "yuanbaorou"], - ['spade',7,'gjyuheng'], - ['club',4,'mutoumianju'], - ['spade',2,'heilonglinpian'], - ['spade',1,'mianlijinzhen'], - ['heart',13,'yunvyuanshen'], + ["spade", 7, "gjyuheng"], + ["club", 4, "mutoumianju"], + ["spade", 2, "heilonglinpian"], + ["spade", 1, "mianlijinzhen"], + ["heart", 13, "yunvyuanshen"], - ['club',8,'feibiao','poison'], - ['diamond',9,'feibiao','poison'], + ["club", 8, "feibiao", "poison"], + ["diamond", 9, "feibiao", "poison"], - ['spade',3,'bingpotong','poison'], - ['club',12,'bingpotong','poison'], + ["spade", 3, "bingpotong", "poison"], + ["club", 12, "bingpotong", "poison"], - ['club',5,'shihuifen'], - ['club',1,'shihuifen'], - ['spade',13,'shihuifen'], + ["club", 5, "shihuifen"], + ["club", 1, "shihuifen"], + ["spade", 13, "shihuifen"], - ['diamond',6,'shujinsan'], - ['spade',2,'shujinsan'], + ["diamond", 6, "shujinsan"], + ["spade", 2, "shujinsan"], - ['diamond',6,'ziyangdan'], - ['heart',1,'ziyangdan'], + ["diamond", 6, "ziyangdan"], + ["heart", 1, "ziyangdan"], // ['diamond',7,'dinvxuanshuang'], - ['heart',9,'dinvxuanshuang'], + ["heart", 9, "dinvxuanshuang"], - ['spade',9,'qiankunbiao'], - ['club',13,'qiankunbiao'], + ["spade", 9, "qiankunbiao"], + ["club", 13, "qiankunbiao"], - ['diamond',9,'shenhuofeiya'], - ['spade',7,'longxugou'], + ["diamond", 9, "shenhuofeiya"], + ["spade", 7, "longxugou"], - ['heart',9,'jinlianzhu'], - ['spade',7,'jinlianzhu'], + ["heart", 9, "jinlianzhu"], + ["spade", 7, "jinlianzhu"], - ['heart',6,'liutouge'], - ['club',6,'liutouge'], + ["heart", 6, "liutouge"], + ["club", 6, "liutouge"], - ['club',6,'liufengsan'], - ['club',3,'liufengsan'], + ["club", 6, "liufengsan"], + ["club", 3, "liufengsan"], - ['heart',13,'shatang','fire'] - ] + ["heart", 13, "shatang", "fire"], + ], }; }); diff --git a/card/guozhan.js b/card/guozhan.js index da23d2cde..f23f18c56 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -1,665 +1,822 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'guozhan', - connect:true, - card:{ - zhaoshu:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['zhaoshu_skill'], - content:function(){ - cards=cards.filterInD(); - if(cards.length&&target.isAlive()){ - target.addToExpansion(cards,'gain2').gaintag.add('zhaoshu_skill'); - target.addSkill('zhaoshu_skill'); - game.addGlobalSkill('zhaoshu_global'); + name: "guozhan", + connect: true, + card: { + zhaoshu: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["zhaoshu_skill"], + content: function () { + cards = cards.filterInD(); + if (cards.length && target.isAlive()) { + target.addToExpansion(cards, "gain2").gaintag.add("zhaoshu_skill"); + target.addSkill("zhaoshu_skill"); + game.addGlobalSkill("zhaoshu_global"); } }, - onEquip:function(){ - if(player.isAlive()){ - player.addToExpansion(card,'giveAuto').gaintag.add('zhaoshu_skill'); - player.markAuto('zhaoshu_skill',[card]); - player.addSkill('zhaoshu_skill'); - game.addGlobalSkill('zhaoshu_global'); + onEquip: function () { + if (player.isAlive()) { + player.addToExpansion(card, "giveAuto").gaintag.add("zhaoshu_skill"); + player.markAuto("zhaoshu_skill", [card]); + player.addSkill("zhaoshu_skill"); + game.addGlobalSkill("zhaoshu_global"); } }, - ai:{ - order:12, - value:3, - useful:1, - result:{ - keepAI:true, - target:1, + ai: { + order: 12, + value: 3, + useful: 1, + result: { + keepAI: true, + target: 1, }, - } - }, - gz_haolingtianxia:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'trick', - enable:true, - filterTarget(card,player,target){ - return target!=player&&!target.isMinHp(); }, - async content(event,trigger,player){ - const target=event.target; - if(!target.isIn()) return; - const str=get.translation(target); - const card=new lib.element.VCard({name:'sha'}); - const targets=game.filterPlayer(current=>{ - return current!=target; - }).sortBySeat(); - for(const current of targets){ - if(!target.isIn()) return; - if(!current||!current.isIn()||current.hasSkill('diaohulishan')) continue; - let choiceList=[ - '弃置一张牌,视为对'+str+'使用一张【杀】', - '弃置'+str+'一张牌', - ],choices=['出杀','弃牌','cancel2']; - if(current.identity=='wei'){ - choiceList[0]=choiceList[0].slice(6); - choiceList[1]='获得'+choiceList[1].slice(2); - choices[1]='得牌'; + }, + gz_haolingtianxia: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "trick", + enable: true, + filterTarget(card, player, target) { + return target != player && !target.isMinHp(); + }, + async content(event, trigger, player) { + const target = event.target; + if (!target.isIn()) return; + const str = get.translation(target); + const card = new lib.element.VCard({ name: "sha" }); + const targets = game + .filterPlayer((current) => { + return current != target; + }) + .sortBySeat(); + for (const current of targets) { + if (!target.isIn()) return; + if (!current || !current.isIn() || current.hasSkill("diaohulishan")) continue; + let choiceList = [ + "弃置一张牌,视为对" + str + "使用一张【杀】", + "弃置" + str + "一张牌", + ], + choices = ["出杀", "弃牌", "cancel2"]; + if (current.identity == "wei") { + choiceList[0] = choiceList[0].slice(6); + choiceList[1] = "获得" + choiceList[1].slice(2); + choices[1] = "得牌"; } - if(!current.canUse(card,target,false)||(current.identity!='wei'&&!current.countDiscardableCards(current,'he'))){ - choiceList[0]=''+choiceList[0]+''; - choices.remove('出杀'); + if ( + !current.canUse(card, target, false) || + (current.identity != "wei" && !current.countDiscardableCards(current, "he")) + ) { + choiceList[0] = '' + choiceList[0] + ""; + choices.remove("出杀"); } - if(!target.countCards('he')){ - choiceList[1]=''+choiceList[1]+''; - choices.remove(current.identity=='wei'?'得牌':'弃牌'); + if (!target.countCards("he")) { + choiceList[1] = '' + choiceList[1] + ""; + choices.remove(current.identity == "wei" ? "得牌" : "弃牌"); } - if(choices.length>1){ - const {result:{control}}=await current.chooseControl(choices) - .set('prompt','号令天下:请选择其中一项').set('target',target) - .set('ai',()=>{ - const player=get.event('player'),target=get.event('target'),choices=get.event('controls'); - const guohe=new lib.element.VCard({name:'guohe_copy2'}),shunshou=new lib.element.VCard({name:'shunshou_copy2'}),sha=new lib.element.VCard({name:'sha'}); - const num=Math.max(0,choices.includes('弃牌')?get.effect(target,guohe,player):0,choices.includes('得牌')?get.effect(target,shunshou,player):0); - if(choices.includes('出杀')&&get.effect(player,guohe,player)+get.effect(target,sha,player)>num) return '出杀'; - if(choices.includes('得牌')&&num>0) return '得牌'; - if(choices.includes('弃牌')&&num>0) return '弃牌'; - return 'cancel2'; - }); - if(control!='cancel2'){ - if(control=='出杀'){ - if(current.identity!='wei') await current.chooseToDiscard('he',true); - await current.useCard(card,target,false); - } - else await current[current.identity=='wei'?'gainPlayerCard':'discardPlayerCard'](target,true,'he').set('boolline',true); + if (choices.length > 1) { + const { + result: { control }, + } = await current + .chooseControl(choices) + .set("prompt", "号令天下:请选择其中一项") + .set("target", target) + .set("ai", () => { + const player = get.event("player"), + target = get.event("target"), + choices = get.event("controls"); + const guohe = new lib.element.VCard({ name: "guohe_copy2" }), + shunshou = new lib.element.VCard({ name: "shunshou_copy2" }), + sha = new lib.element.VCard({ name: "sha" }); + const num = Math.max( + 0, + choices.includes("弃牌") ? get.effect(target, guohe, player) : 0, + choices.includes("得牌") ? get.effect(target, shunshou, player) : 0 + ); + if ( + choices.includes("出杀") && + get.effect(player, guohe, player) + get.effect(target, sha, player) > + num + ) + return "出杀"; + if (choices.includes("得牌") && num > 0) return "得牌"; + if (choices.includes("弃牌") && num > 0) return "弃牌"; + return "cancel2"; + }); + if (control != "cancel2") { + if (control == "出杀") { + if (current.identity != "wei") await current.chooseToDiscard("he", true); + await current.useCard(card, target, false); + } else + await current[ + current.identity == "wei" ? "gainPlayerCard" : "discardPlayerCard" + ](target, true, "he").set("boolline", true); } } } }, - ai:{ - order:6, - value:9, - useful:6, - tag:{ - damage:1, - discard:1, - loseCard:1, + ai: { + order: 6, + value: 9, + useful: 6, + tag: { + damage: 1, + discard: 1, + loseCard: 1, }, - result:{ - target(player,target){ - return -1.5*(game.countPlayer()-1); + result: { + target(player, target) { + return -1.5 * (game.countPlayer() - 1); }, }, }, }, - gz_kefuzhongyuan:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - selectTarget:[1,Infinity], - content:function(){ - 'step 0' - var p1='请选择【杀】的目标',p2='或点击「取消」摸一张牌'; - if(target.identity=='shu'){ - p1+='(伤害+1)'; - p2='或点击「取消」摸两张牌'; + gz_kefuzhongyuan: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + selectTarget: [1, Infinity], + content: function () { + "step 0"; + var p1 = "请选择【杀】的目标", + p2 = "或点击「取消」摸一张牌"; + if (target.identity == "shu") { + p1 += "(伤害+1)"; + p2 = "或点击「取消」摸两张牌"; } - var next=target.chooseUseTarget('sha',p1,p2,false); - if(target.identity=='shu') next.set('oncard',function(){ - _status.event.baseDamage++; - }); - 'step 1' - if(!result.bool){ - target.draw(target.identity=='shu'?2:1); + var next = target.chooseUseTarget("sha", p1, p2, false); + if (target.identity == "shu") + next.set("oncard", function () { + _status.event.baseDamage++; + }); + "step 1"; + if (!result.bool) { + target.draw(target.identity == "shu" ? 2 : 1); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.mode()=='guozhan'){ - if(!_status._aozhan){ - if(!player.isMajor()){ - if(!viewer.isMajor()) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.mode() == "guozhan") { + if (!_status._aozhan) { + if (!player.isMajor()) { + if (!viewer.isMajor()) return 0; } } } }, - order:4, - value:9, - useful:6, - tag:{ - gain:1, + order: 4, + value: 9, + useful: 6, + tag: { + gain: 1, }, - result:{target:1.5}, + result: { target: 1.5 }, }, }, - gz_guguoanbang:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - toself:true, - filterTarget:function(card,player,target){ - return target==player; + gz_guguoanbang: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + toself: true, + filterTarget: function (card, player, target) { + return target == player; }, - modTarget:true, - content:function(){ - 'step 0' + modTarget: true, + content: function () { + "step 0"; target.draw(8); - 'step 1' - target.chooseToDiscard('请弃置至少六张手牌',[6,target.countCards('h')],true,'h'); - if(target.identity!='wu') event.finish(); - 'step 2' - if(!result.cards||!result.cards.length) event.finish(); - event.give_cards=result.cards; - event.given_list=[]; - 'step 3' - event.give_cards=event.give_cards.filterInD('d'); - if(!event.give_cards.length||!game.hasPlayer(function(current){ - return current!=target&¤t.identity=='wu'&&!event.given_list.includes(current); - })) event.finish(); - else{ - target.chooseButton(['是否将弃置的牌交给其他吴势力角色?',event.give_cards],[1,2]); + "step 1"; + target.chooseToDiscard("请弃置至少六张手牌", [6, target.countCards("h")], true, "h"); + if (target.identity != "wu") event.finish(); + "step 2"; + if (!result.cards || !result.cards.length) event.finish(); + event.give_cards = result.cards; + event.given_list = []; + "step 3"; + event.give_cards = event.give_cards.filterInD("d"); + if ( + !event.give_cards.length || + !game.hasPlayer(function (current) { + return ( + current != target && + current.identity == "wu" && + !event.given_list.includes(current) + ); + }) + ) + event.finish(); + else { + target.chooseButton(["是否将弃置的牌交给其他吴势力角色?", event.give_cards], [1, 2]); } - 'step 4' - if(result.bool){ - event.cards2=result.links; - target.chooseTarget(true,'选择获得'+get.translation(event.cards2)+'的角色',function(card,player,target){ - return target!=player&&target.identity=='wu'&&!_status.event.targets.includes(target); - }).set('targets',event.given_list); - } - else event.finish(); - 'step 5' - if(result.bool&&result.targets&&result.targets.length){ - var current=result.targets[0]; - target.line(current,'green'); - current.gain(event.cards2,'gain2').giver=player; + "step 4"; + if (result.bool) { + event.cards2 = result.links; + target + .chooseTarget( + true, + "选择获得" + get.translation(event.cards2) + "的角色", + function (card, player, target) { + return ( + target != player && + target.identity == "wu" && + !_status.event.targets.includes(target) + ); + } + ) + .set("targets", event.given_list); + } else event.finish(); + "step 5"; + if (result.bool && result.targets && result.targets.length) { + var current = result.targets[0]; + target.line(current, "green"); + current.gain(event.cards2, "gain2").giver = player; event.given_list.push(current); event.goto(3); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.mode()=='guozhan'){ - if(!_status._aozhan){ - if(!player.isMajor()){ - if(!viewer.isMajor()) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.mode() == "guozhan") { + if (!_status._aozhan) { + if (!player.isMajor()) { + if (!viewer.isMajor()) return 0; } } } }, - order:6, - value:9, - useful:6, - tag:{ - draw:8, - loseCard:6, - discard:6, + order: 6, + value: 9, + useful: 6, + tag: { + draw: 8, + loseCard: 6, + discard: 6, }, - result:{ - target:function(player,target){ - if(target.identity!='wu') return 3; - return Math.max(3,Math.min(8,2*game.countPlayer(function(current){ - return current.identity=='wu'; - }))); + result: { + target: function (player, target) { + if (target.identity != "wu") return 3; + return Math.max( + 3, + Math.min( + 8, + 2 * + game.countPlayer(function (current) { + return current.identity == "wu"; + }) + ) + ); }, }, }, }, - gz_wenheluanwu:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - selectTarget:-1, - ignoreTarget:function(card,player,target){ - return target.countCards('h')==0; + gz_wenheluanwu: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + selectTarget: -1, + ignoreTarget: function (card, player, target) { + return target.countCards("h") == 0; }, - content:function(){ - 'step 0' - if(!target.countCards('h')||!player.isIn()) event.finish(); + content: function () { + "step 0"; + if (!target.countCards("h") || !player.isIn()) event.finish(); else target.showHandcards(); - 'step 1' - var str=get.translation(target); - player.chooseControl().set('prompt','文和乱武:请选择一项').set('choiceList',[ - '令'+str+'弃置两张类型不同的手牌', - '弃置'+str+'的一张手牌', - ]).set('ai',()=>{ - let target=_status.event.getParent().target,hs=target.getCards('h'),type=[],att=get.attitude(_status.event.player,target); - if(hs.length<2) return att>0?1:0; - hs.forEach(i=>{ - type.add(get.type2(i,target)); + "step 1"; + var str = get.translation(target); + player + .chooseControl() + .set("prompt", "文和乱武:请选择一项") + .set("choiceList", [ + "令" + str + "弃置两张类型不同的手牌", + "弃置" + str + "的一张手牌", + ]) + .set("ai", () => { + let target = _status.event.getParent().target, + hs = target.getCards("h"), + type = [], + att = get.attitude(_status.event.player, target); + if (hs.length < 2) return att > 0 ? 1 : 0; + hs.forEach((i) => { + type.add(get.type2(i, target)); + }); + if (target.identity !== "qun") { + if (Boolean(att > 0) === Boolean(type.length > 1)) return 1; + return 0; + } + if (type.length < 2 || target.hp < 3) return att > 0 ? 1 : 0; + if (hs.length === 2) return att > 0 ? 0 : 1; + return att > 0 ? 1 : 0; }); - if(target.identity!=='qun'){ - if(Boolean(att>0)===Boolean(type.length>1)) return 1; - return 0; + "step 2"; + if (result.index == 0) { + var list = [], + hs = target.getCards("h"); + for (var i of hs) { + if (lib.filter.cardDiscardable(i, target, "gz_wenheluanwu")) + list.add(get.type2(i, target)); + if (list.length > 1) break; } - if(type.length<2||target.hp<3) return att>0?1:0; - if(hs.length===2) return att>0?0:1; - return att>0?1:0; - }); - 'step 2' - if(result.index==0){ - var list=[],hs=target.getCards('h'); - for(var i of hs){ - if(lib.filter.cardDiscardable(i,target,'gz_wenheluanwu')) list.add(get.type2(i,target)); - if(list.length>1) break; - } - if(list.length>1) target.chooseToDiscard('h',true,'请弃置两张类型不同的手牌',2,function(card,player){ - if(!ui.selected.cards.length) return true; - return get.type2(card,target)!=get.type2(ui.selected.cards[0],target); - }).set('complexCard',true); - else if(list.length==1) target.chooseToDiscard('h',true); + if (list.length > 1) + target + .chooseToDiscard( + "h", + true, + "请弃置两张类型不同的手牌", + 2, + function (card, player) { + if (!ui.selected.cards.length) return true; + return ( + get.type2(card, target) != get.type2(ui.selected.cards[0], target) + ); + } + ) + .set("complexCard", true); + else if (list.length == 1) target.chooseToDiscard("h", true); else event.finish(); + } else { + player.discardPlayerCard(target, "h", true, "visible"); } - else{ - player.discardPlayerCard(target,'h',true,'visible'); - } - 'step 3' - if(target.identity!='qun'||!result.bool||!result.cards||!result.cards.length||target.countCards('h')>0||target.hp<1) event.finish(); - else target.draw(Math.min(5,target.hp)); + "step 3"; + if ( + target.identity != "qun" || + !result.bool || + !result.cards || + !result.cards.length || + target.countCards("h") > 0 || + target.hp < 1 + ) + event.finish(); + else target.draw(Math.min(5, target.hp)); }, - ai:{ - order:6, - value:10, - useful:6, - tag:{ - discard:1.5, - loseCard:1.5, + ai: { + order: 6, + value: 10, + useful: 6, + tag: { + discard: 1.5, + loseCard: 1.5, }, - result:{target:-1.5}, + result: { target: -1.5 }, }, }, - liulongcanjia:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip6', - subtypes:['equip3','equip4'], - nomod:true, - nopower:true, + liulongcanjia: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip6", + subtypes: ["equip3", "equip4"], + nomod: true, + nopower: true, //unique:true, - distance:{ - globalFrom:-1, - globalTo:+1, + distance: { + globalFrom: -1, + globalTo: +1, }, - skills:['liulongcanjia'], - ai:{ - equipValue:function(card,player){ - if(player.countCards('e',{subtype:['equip3','equip4']})>1) return 1; - if(player.hasSkill('gzzongyu')) return 9; - if(game.hasPlayer(function(current){ - return current.hasSkill('gzzongyu')&&get.attitude(player,current)<=0; - })) return 1; + skills: ["liulongcanjia"], + ai: { + equipValue: function (card, player) { + if (player.countCards("e", { subtype: ["equip3", "equip4"] }) > 1) return 1; + if (player.hasSkill("gzzongyu")) return 9; + if ( + game.hasPlayer(function (current) { + return current.hasSkill("gzzongyu") && get.attitude(player, current) <= 0; + }) + ) + return 1; return 7.2; }, - basic:{ - equipValue:7.2 - } + basic: { + equipValue: 7.2, + }, }, }, - minguangkai:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['minguangkai_cancel','minguangkai_link'], - ai:{ - basic:{ - equipValue:6 - } - } + minguangkai: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["minguangkai_cancel", "minguangkai_link"], + ai: { + basic: { + equipValue: 6, + }, + }, }, - dinglanyemingzhu:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip5', - nomod:true, - nopower:true, - unique:true, - global:'g_dinglanyemingzhu_ai', - skills:['dinglanyemingzhu_skill'], - ai:{ - equipValue:function(card,player){ - if(player.hasSkill('jubao')) return 8; - if(player.hasSkill('gzzhiheng')) return 6; - if(game.hasPlayer(function(current){ - return current.hasSkill('jubao')&&get.attitude(player,current)<=0; - })){ + dinglanyemingzhu: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip5", + nomod: true, + nopower: true, + unique: true, + global: "g_dinglanyemingzhu_ai", + skills: ["dinglanyemingzhu_skill"], + ai: { + equipValue: function (card, player) { + if (player.hasSkill("jubao")) return 8; + if (player.hasSkill("gzzhiheng")) return 6; + if ( + game.hasPlayer(function (current) { + return current.hasSkill("jubao") && get.attitude(player, current) <= 0; + }) + ) { return 0; } return 7; }, - basic:{ - equipValue:6.5 - } - } + basic: { + equipValue: 6.5, + }, + }, }, - feilongduofeng:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip1', - nomod:true, - nopower:true, - unique:true, - global:'g_feilongduofeng_ai', - distance:{attackFrom:-1}, - skills:['feilongduofeng','feilongduofeng3'], - ai:{ - equipValue:function(card,player){ - if(player.hasSkill('zhangwu')) return 9; - if(game.hasPlayer(function(current){ - return current.hasSkill('zhangwu')&&get.attitude(player,current)<=0; - })){ + feilongduofeng: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip1", + nomod: true, + nopower: true, + unique: true, + global: "g_feilongduofeng_ai", + distance: { attackFrom: -1 }, + skills: ["feilongduofeng", "feilongduofeng3"], + ai: { + equipValue: function (card, player) { + if (player.hasSkill("zhangwu")) return 9; + if ( + game.hasPlayer(function (current) { + return current.hasSkill("zhangwu") && get.attitude(player, current) <= 0; + }) + ) { return 1; } return 8; }, - basic:{ - equipValue:7 - } - } + basic: { + equipValue: 7, + }, + }, }, - taipingyaoshu:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip2', - nomod:true, - nopower:true, - unique:true, - global:['g_taipingyaoshu_ai'], - skills:['taipingyaoshu'], - ai:{ - equipValue:function(card,player){ - if(player.hasSkill('wendao')) return 9; - if(game.hasPlayer(function(current){ - return current.hasSkill('wendao')&&get.attitude(player,current)<=0; - })){ + taipingyaoshu: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip2", + nomod: true, + nopower: true, + unique: true, + global: ["g_taipingyaoshu_ai"], + skills: ["taipingyaoshu"], + ai: { + equipValue: function (card, player) { + if (player.hasSkill("wendao")) return 9; + if ( + game.hasPlayer(function (current) { + return current.hasSkill("wendao") && get.attitude(player, current) <= 0; + }) + ) { return 1; } return 6; }, - basic:{ - equipValue:6 - } + basic: { + equipValue: 6, + }, }, - filterLose:function(card,player){ - if(player.hasSkillTag('unequip2')) return false; + filterLose: function (card, player) { + if (player.hasSkillTag("unequip2")) return false; return true; }, - loseDelay:false, - onLose:function(){ - var next=game.createEvent('taipingyaoshu'); + loseDelay: false, + onLose: function () { + var next = game.createEvent("taipingyaoshu"); event.next.remove(next); - var evt=event.getParent(); - if(evt.getlx===false) evt=evt.getParent(); + var evt = event.getParent(); + if (evt.getlx === false) evt = evt.getParent(); evt.after.push(next); - next.player=player; + next.player = player; next.setContent(lib.card.taipingyaoshu.onLosex); }, - onLosex:function(){ - 'step 0' - player.logSkill('taipingyaoshu'); + onLosex: function () { + "step 0"; + player.logSkill("taipingyaoshu"); player.draw(2); - 'step 1' - if(player.hp>1) player.loseHp(); - } - }, - yuxi:{ - audio:true, - mode:['guozhan'], - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['yuxi_skill'], - ai:{ - equipValue:9 - } - }, - xietianzi:{ - audio:true, - fullskin:true, - type:'trick', - enable:function(card,player,event){ - if(get.mode()=='guozhan'&&!player.isMajor()) return false; - if(player.hasSkill('xietianzi')) return false; - if(_status.currentPhase!=player) return false; - var evt=event||_status.event; - if(evt.name!='chooseToUse') evt=evt.getParent('chooseToUse'); - return evt.type=='phase'; + "step 1"; + if (player.hp > 1) player.loseHp(); }, - filterTarget:function(card,player,target){ - return player==target; + }, + yuxi: { + audio: true, + mode: ["guozhan"], + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["yuxi_skill"], + ai: { + equipValue: 9, }, - selectTarget:-1, - content:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + }, + xietianzi: { + audio: true, + fullskin: true, + type: "trick", + enable: function (card, player, event) { + if (get.mode() == "guozhan" && !player.isMajor()) return false; + if (player.hasSkill("xietianzi")) return false; + if (_status.currentPhase != player) return false; + var evt = event || _status.event; + if (evt.name != "chooseToUse") evt = evt.getParent("chooseToUse"); + return evt.type == "phase"; + }, + filterTarget: function (card, player, target) { + return player == target; + }, + selectTarget: -1, + content: function () { + var evt = _status.event.getParent("phaseUse"); + if (evt && evt.name == "phaseUse") { + evt.skipped = true; } - target.addTempSkill('xietianzi'); + target.addTempSkill("xietianzi"); }, - ai:{ - order:0.5, - value:4, - useful:2, - result:{ - target:function(player,target){ - if(target.countCards('h')>=2) return 1; + ai: { + order: 0.5, + value: 4, + useful: 2, + result: { + target: function (player, target) { + if (target.countCards("h") >= 2) return 1; return 0; - } - } - } - }, - shuiyanqijunx:{ - audio:'shuiyanqijun', - fullskin:true, - type:'trick', - filterTarget:function(card,player,target){ - return target!=player&&(get.mode()!='guozhan'||_status.mode=='yingbian'||_status.mode=='free'||target.countCards('e')>0); + }, + }, }, - enable:true, - defaultYingbianEffect:'add', - content:function(){ - 'step 0' - if(event.card.yingbian_all){ - target.discard(target.getCards('e',function(card){ - return lib.filter.cardDiscardable(card,target,'shuiyanqijunx'); - })); - target.damage('thunder'); + }, + shuiyanqijunx: { + audio: "shuiyanqijun", + fullskin: true, + type: "trick", + filterTarget: function (card, player, target) { + return ( + target != player && + (get.mode() != "guozhan" || + _status.mode == "yingbian" || + _status.mode == "free" || + target.countCards("e") > 0) + ); + }, + enable: true, + defaultYingbianEffect: "add", + content: function () { + "step 0"; + if (event.card.yingbian_all) { + target.discard( + target.getCards("e", function (card) { + return lib.filter.cardDiscardable(card, target, "shuiyanqijunx"); + }) + ); + target.damage("thunder"); event.finish(); - } - else if(!target.countCards('e',function(card){ - return lib.filter.cardDiscardable(card,target,'shuiyanqijunx'); - })){ - var next=target.damage(); - if(!get.is.single()) game.setNature(next,'thunder',true); + } else if ( + !target.countCards("e", function (card) { + return lib.filter.cardDiscardable(card, target, "shuiyanqijunx"); + }) + ) { + var next = target.damage(); + if (!get.is.single()) game.setNature(next, "thunder", true); event.finish(); return; - } - else target.chooseControl('discard_card','take_damage',function(event,player){ - let eff=get.damageEffect(player,event.player,player,'thunder'); - if(eff>0) return 'take_damage'; - if(player.hasSkillTag('noe')) return 'discard_card'; - if(!eff) return 'take_damage'; - if(player.isDamaged()&&player.hasCard((card)=>get.name(card)=='baiyin'&&get.recoverEffect(player,player,_status.event.player)>0,'e')) return 'discard_card'; - if(player.hasCard((card)=>get.value(card,player)<=0,'e')&&!player.hasCard((card)=>get.value(card,player)>Math.max(7,12-player.hp),'e')) return 'discard_card'; - if(player.hp>2&&player.countCards('e')>2||player.hp>1&&player.countCards('e')>3) return 'take_damage'; - return 'discard_card'; - }).set('prompt','水淹七军').set('prompt2','请选择一项:⒈弃置装备区里的所有牌;⒉受到'+get.translation(player)+'造成的1点雷电伤害。'); - 'step 1' - if(result.control=='discard_card'){ - target.discard(target.getCards('e',function(card){ - return lib.filter.cardDiscardable(card,target,'shuiyanqijunx'); - })); - } - else{ - var next=target.damage(); - if(!get.is.single()) game.setNature(next,'thunder',true); + } else + target + .chooseControl("discard_card", "take_damage", function (event, player) { + let eff = get.damageEffect(player, event.player, player, "thunder"); + if (eff > 0) return "take_damage"; + if (player.hasSkillTag("noe")) return "discard_card"; + if (!eff) return "take_damage"; + if ( + player.isDamaged() && + player.hasCard( + (card) => + get.name(card) == "baiyin" && + get.recoverEffect(player, player, _status.event.player) > 0, + "e" + ) + ) + return "discard_card"; + if ( + player.hasCard((card) => get.value(card, player) <= 0, "e") && + !player.hasCard( + (card) => get.value(card, player) > Math.max(7, 12 - player.hp), + "e" + ) + ) + return "discard_card"; + if ( + (player.hp > 2 && player.countCards("e") > 2) || + (player.hp > 1 && player.countCards("e") > 3) + ) + return "take_damage"; + return "discard_card"; + }) + .set("prompt", "水淹七军") + .set( + "prompt2", + "请选择一项:⒈弃置装备区里的所有牌;⒉受到" + + get.translation(player) + + "造成的1点雷电伤害。" + ); + "step 1"; + if (result.control == "discard_card") { + target.discard( + target.getCards("e", function (card) { + return lib.filter.cardDiscardable(card, target, "shuiyanqijunx"); + }) + ); + } else { + var next = target.damage(); + if (!get.is.single()) game.setNature(next, "thunder", true); } event.finish(); }, - ai:{ - canLink:function(player,target,card){ - if(!target.isLinked()||player.hasSkill('jueqing')||target.hasSkill('gangzhi')||player.hasSkill('gangzhi')) return false; - let es=target.getCards('e'),val=0; - if(!es.length) return true; - for(let i of es){ - if(i.name=='baiyin'&&target.isDamaged()&&get.recoverEffect(target)) val+=get.value({name:'tao'},target); - else val-=get.value(i,target); + ai: { + canLink: function (player, target, card) { + if ( + !target.isLinked() || + player.hasSkill("jueqing") || + target.hasSkill("gangzhi") || + player.hasSkill("gangzhi") + ) + return false; + let es = target.getCards("e"), + val = 0; + if (!es.length) return true; + for (let i of es) { + if (i.name == "baiyin" && target.isDamaged() && get.recoverEffect(target)) + val += get.value({ name: "tao" }, target); + else val -= get.value(i, target); } - if(0.15*val>2*get.sgn(get.damageEffect(target,player,target,'thunder'))) return false; + if (0.15 * val > 2 * get.sgn(get.damageEffect(target, player, target, "thunder"))) + return false; return true; }, - order:6, - value:4, - useful:2, - tag:{ - damage:1, - thunderDamage:1, - natureDamage:1, - loseCard:1, + order: 6, + value: 4, + useful: 2, + tag: { + damage: 1, + thunderDamage: 1, + natureDamage: 1, + loseCard: 1, }, - yingbian:function(card,player,targets,viewer){ - if(get.attitude(viewer,player)<=0) return 0; - var base=0; - if(get.cardtag(card,'yingbian_all')){ - if(targets.filter(function(current){ - return get.damageEffect(current,player,player,'thunder')>0&¤t.countCards('e',function(card){ - return get.value(card,current)<=0; - })<2&¤t.countCards('e',function(card){ - return get.value(card,current)>0; - })>0; - }).length) base+=6; + yingbian: function (card, player, targets, viewer) { + if (get.attitude(viewer, player) <= 0) return 0; + var base = 0; + if (get.cardtag(card, "yingbian_all")) { + if ( + targets.filter(function (current) { + return ( + get.damageEffect(current, player, player, "thunder") > 0 && + current.countCards("e", function (card) { + return get.value(card, current) <= 0; + }) < 2 && + current.countCards("e", function (card) { + return get.value(card, current) > 0; + }) > 0 + ); + }).length + ) + base += 6; } - if(get.cardtag(card,'yingbian_add')){ - if(game.hasPlayer(function(current){ - return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; - })) base+=6; + if (get.cardtag(card, "yingbian_add")) { + if ( + game.hasPlayer(function (current) { + return ( + !targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + get.effect(current, card, player, player) > 0 + ); + }) + ) + base += 6; } return 0; }, - result:{ - target:function(player,target,card,isLink){ - let es=target.getCards('e'), eff=2*get.sgn(get.damageEffect(target,player,target,'thunder')); - if(isLink || !es.length) return eff; - let val=0; - for(let i of es){ - if(i.name=='baiyin'&&target.isDamaged()&&get.recoverEffect(target)) val+=6; - else val-=get.value(i,target); + result: { + target: function (player, target, card, isLink) { + let es = target.getCards("e"), + eff = 2 * get.sgn(get.damageEffect(target, player, target, "thunder")); + if (isLink || !es.length) return eff; + let val = 0; + for (let i of es) { + if (i.name == "baiyin" && target.isDamaged() && get.recoverEffect(target)) + val += 6; + else val -= get.value(i, target); } - return Math.max(eff,0.15*val); - } - } - } + return Math.max(eff, 0.15 * val); + }, + }, + }, }, - lulitongxin:{ - fullskin:true, - audio:true, - type:'trick', - enable:function(card,player){ - if(get.mode()=='versus') return true; - return game.hasPlayer(function(current){ + lulitongxin: { + fullskin: true, + audio: true, + type: "trick", + enable: function (card, player) { + if (get.mode() == "versus") return true; + return game.hasPlayer(function (current) { return current.isMajor(); }); }, - mode:['guozhan','versus'], - filterTarget:true, - recastable:true, - changeTarget:function(player,targets){ - var target=targets[0]; - game.filterPlayer(function(current){ - if(get.mode()=='versus') return current.isFriendOf(target); - return current.isMajor()==target.isMajor()&¤t!=target&&!current.hasSkill('diaohulishan'); - },targets); + mode: ["guozhan", "versus"], + filterTarget: true, + recastable: true, + changeTarget: function (player, targets) { + var target = targets[0]; + game.filterPlayer(function (current) { + if (get.mode() == "versus") return current.isFriendOf(target); + return ( + current.isMajor() == target.isMajor() && + current != target && + !current.hasSkill("diaohulishan") + ); + }, targets); }, - content:function(){ - if(get.mode()=='versus'){ - if(target.isEnemyOf(player)) target.link(true); - else if(target.isLinked()) target.draw(); - } - else if(target.isLinked()){ + content: function () { + if (get.mode() == "versus") { + if (target.isEnemyOf(player)) target.link(true); + else if (target.isLinked()) target.draw(); + } else if (target.isLinked()) { target.draw(); - } - else{ + } else { target.link(); } }, - ai:{ - order:7.5, - value:4, - useful:2, - result:{ - target:function(player,target){ - if(get.mode()=='versus'){ - if(target.isFriendOf(player)) return target.isLinked()?1:0; - return target.isLinked()?0:-1; + ai: { + order: 7.5, + value: 4, + useful: 2, + result: { + target: function (player, target) { + if (get.mode() == "versus") { + if (target.isFriendOf(player)) return target.isLinked() ? 1 : 0; + return target.isLinked() ? 0 : -1; } - return target.isLinked()?1:-1; - } - } - } + return target.isLinked() ? 1 : -1; + }, + }, + }, }, - lianjunshengyan:{ - fullskin:true, - audio:true, - type:'trick', - enable:function(card,player){ - if(get.mode()=='guozhan') return !player.isUnseen(); + lianjunshengyan: { + fullskin: true, + audio: true, + type: "trick", + enable: function (card, player) { + if (get.mode() == "guozhan") return !player.isUnseen(); return true; }, - mode:['guozhan','boss'], - filterTarget:function(card,player,target){ - if(get.mode()=='guozhan') return target!=player&&target.identity!='unknown'&&!target.isFriendOf(player); + mode: ["guozhan", "boss"], + filterTarget: function (card, player, target) { + if (get.mode() == "guozhan") + return target != player && target.identity != "unknown" && !target.isFriendOf(player); return true; }, - selectTarget:function(){ - return get.mode()=='guozhan'?1:-1; + selectTarget: function () { + return get.mode() == "guozhan" ? 1 : -1; }, - changeTarget:function(player,targets){ - if(get.mode()=='guozhan'){ - var target=targets[0]; + changeTarget: function (player, targets) { + if (get.mode() == "guozhan") { + var target = targets[0]; targets.push(player); - if(target.identity!='ye'){ - game.filterPlayer(function(current){ - return target!=current&&target.isFriendOf(current)&&!current.hasSkill('diaohulishan'); - },targets); + if (target.identity != "ye") { + game.filterPlayer(function (current) { + return ( + target != current && + target.isFriendOf(current) && + !current.hasSkill("diaohulishan") + ); + }, targets); } } - },/* + } /* contentBefore:function(){ if(get.mode()=='guozhan'){ var evt=event.getParent(); @@ -670,438 +827,457 @@ game.import('card', function () { evt.targets.push(player); } } - },*/ - content:function(){ - 'step 0' - if(get.mode()!='guozhan'){ - if(player==target) target.draw(game.filterPlayer().length); + },*/, + content: function () { + "step 0"; + if (get.mode() != "guozhan") { + if (player == target) target.draw(game.filterPlayer().length); else target.chooseDrawRecover(true); event.finish(); - } - else{ - if(target==player){ - var num=targets.length-1; - event.num=num; - var damaged=target.maxHp-target.hp; - if(damaged==0){ + } else { + if (target == player) { + var num = targets.length - 1; + event.num = num; + var damaged = target.maxHp - target.hp; + if (damaged == 0) { target.draw(num); event.finish(); - } - else{ - var list=[]; - for(var i=Math.min(num,damaged);i>=0;i--){ - list.push('摸'+(num-i)+'回'+i); + } else { + var list = []; + for (var i = Math.min(num, damaged); i >= 0; i--) { + list.push("摸" + (num - i) + "回" + i); } - target.chooseControl(list).set('prompt','请分配自己的摸牌数和回复量').ai=function(){ - return 0; - }; + target.chooseControl(list).set("prompt", "请分配自己的摸牌数和回复量").ai = + function () { + return 0; + }; } - } - else{ + } else { target.draw(); } } - 'step 1' - if(target!=player) target.link(false); - else if(typeof result.control=='string'){ - var index=result.control.indexOf('回'); - var draw=parseInt(result.control.slice(1,index)); - var recover=parseInt(result.control.slice(index+1)); - if(draw) target.draw(draw); - if(recover) target.recover(recover); + "step 1"; + if (target != player) target.link(false); + else if (typeof result.control == "string") { + var index = result.control.indexOf("回"); + var draw = parseInt(result.control.slice(1, index)); + var recover = parseInt(result.control.slice(index + 1)); + if (draw) target.draw(draw); + if (recover) target.recover(recover); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.mode()=='guozhan'){ - if(!_status._aozhan){ - if(!player.isMajor()){ - if(!viewer.isMajor()) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.mode() == "guozhan") { + if (!_status._aozhan) { + if (!player.isMajor()) { + if (!viewer.isMajor()) return 0; } } } }, - order:6, - value:4, - useful:2, - result:{ - target:function(player,target){ - if(player==target) return 2; + order: 6, + value: 4, + useful: 2, + result: { + target: function (player, target) { + if (player == target) return 2; return 1; }, }, }, }, - chiling:{ - fullskin:true, - audio:true, - type:'trick', - enable:function(){ - return game.hasPlayer(function(current){ + chiling: { + fullskin: true, + audio: true, + type: "trick", + enable: function () { + return game.hasPlayer(function (current) { return current.isUnseen(); }); }, - mode:['guozhan'], + mode: ["guozhan"], //global:['g_chiling1','g_chiling2','g_chiling3'], - filterTarget:function(card,player,target){ + filterTarget: function (card, player, target) { return target.isUnseen(); }, - selectTarget:-1, - chooseai:function(event,player){ - if(player.hasSkillTag('mingzhi_yes')) return '选项一'; - if(_status.event.controls.includes('选项三')){ - if(player.hasSkillTag('mingzhi_no')) return '选项三'; - return Math.random()<0.5?'选项一':'选项三'; - } - else{ - if(_status.event.getParent().nomingzhi){ - if(_status.event.controls.includes('选项二')) return '选项二'; - return '选项一'; + selectTarget: -1, + chooseai: function (event, player) { + if (player.hasSkillTag("mingzhi_yes")) return "选项一"; + if (_status.event.controls.includes("选项三")) { + if (player.hasSkillTag("mingzhi_no")) return "选项三"; + return Math.random() < 0.5 ? "选项一" : "选项三"; + } else { + if (_status.event.getParent().nomingzhi) { + if (_status.event.controls.includes("选项二")) return "选项二"; + return "选项一"; } - if(player.hasSkillTag('maixie_hp')||player.hp<=2) return '选项一'; - return Math.random()<0.5?'选项一':'选项二'; + if (player.hasSkillTag("maixie_hp") || player.hp <= 2) return "选项一"; + return Math.random() < 0.5 ? "选项一" : "选项二"; } }, - content:function(){ - 'step 0' - var choiceList=['明置一张武将牌,然后摸一张牌','失去1点体力']; - event.nomingzhi=target.hasSkillTag('nomingzhi',false,null,true); - if(event.nomingzhi){ + content: function () { + "step 0"; + var choiceList = ["明置一张武将牌,然后摸一张牌", "失去1点体力"]; + event.nomingzhi = target.hasSkillTag("nomingzhi", false, null, true); + if (event.nomingzhi) { choiceList.shift(); } - if(target.countCards('he',{type:'equip'})){ - choiceList.push('弃置一张装备牌'); + if (target.countCards("he", { type: "equip" })) { + choiceList.push("弃置一张装备牌"); } - target.chooseControl(lib.card.chiling.chooseai).set('prompt','敕令').set('choiceList',choiceList); - 'step 1' - var index=result.index; - if(event.nomingzhi){ + target + .chooseControl(lib.card.chiling.chooseai) + .set("prompt", "敕令") + .set("choiceList", choiceList); + "step 1"; + var index = result.index; + if (event.nomingzhi) { index++; } - if(index==0){ - target.chooseControl('主将','副将',function(){ - return Math.floor(Math.random()*2); - }).set('prompt','选择要明置的武将牌'); - } - else if(index==1){ + if (index == 0) { + target + .chooseControl("主将", "副将", function () { + return Math.floor(Math.random() * 2); + }) + .set("prompt", "选择要明置的武将牌"); + } else if (index == 1) { target.loseHp(); event.finish(); - } - else{ - target.chooseToDiscard('he',{type:'equip'},true); + } else { + target.chooseToDiscard("he", { type: "equip" }, true); event.finish(); } - 'step 2' - if(result.index==0){ + "step 2"; + if (result.index == 0) { target.showCharacter(0); - } - else{ + } else { target.showCharacter(1); } target.draw(); }, - destroy:function(card,targetPosition,player,event){ - if((event.name!='lose'&&event.name!='cardsDiscard')||targetPosition!='discardPile') return false; - var evt=event.getParent().relatedEvent; - if(evt&&evt.name=='useCard') return false; + destroy: function (card, targetPosition, player, event) { + if ( + (event.name != "lose" && event.name != "cardsDiscard") || + targetPosition != "discardPile" + ) + return false; + var evt = event.getParent().relatedEvent; + if (evt && evt.name == "useCard") return false; return true; }, - onDestroy:function(){ - var currentPhase=_status.currentPhase; - if(currentPhase){ - _status.chiling=true; - currentPhase.addTempSkill('g_chiling3'); + onDestroy: function () { + var currentPhase = _status.currentPhase; + if (currentPhase) { + _status.chiling = true; + currentPhase.addTempSkill("g_chiling3"); } - if(!lib.inpile.includes('zhaoshu')){ - lib.inpile.push('zhaoshu'); - var card=game.createCard2('zhaoshu','club',3); - game.log(card,'被置于了牌堆底'); + if (!lib.inpile.includes("zhaoshu")) { + lib.inpile.push("zhaoshu"); + var card = game.createCard2("zhaoshu", "club", 3); + game.log(card, "被置于了牌堆底"); ui.cardPile.appendChild(card); game.updateRoundNumber(); } }, - ai:{ - order:6, - result:{ - target:-1 + ai: { + order: 6, + result: { + target: -1, }, - tag:{ - multitarget:1, - multineg:1, - } - } + tag: { + multitarget: 1, + multineg: 1, + }, + }, }, - diaohulishan:{ - fullskin:true, - audio:true, - type:'trick', - enable:true, - global:'g_diaohulishan', - filterTarget:function(card,player,target){ - return target!=player; + diaohulishan: { + fullskin: true, + audio: true, + type: "trick", + enable: true, + global: "g_diaohulishan", + filterTarget: function (card, player, target) { + return target != player; }, - selectTarget:[1,2], - content:function(){ - target.addTempSkill('diaohulishan'); + selectTarget: [1, 2], + content: function () { + target.addTempSkill("diaohulishan"); }, - ai:{ - order:function(item, player){ - if(!player) player=get.player(); - if(player.hasCard(function(card){ - return ['gz_haolingtianxia','gz_guguoanbang','gz_kefuzhongyuan','wuzhong','yuanjiao','lianjunshengyan','lulitongxin','yiyi'].includes(get.name(card)); - },'hs')) return 3.5; - if(player.hasCard(function(card){ - return get.name(card)=='taoyuan'; - },'hs')) return get.order({name:'taoyuan'},player)-1; + ai: { + order: function (item, player) { + if (!player) player = get.player(); + if ( + player.hasCard(function (card) { + return [ + "gz_haolingtianxia", + "gz_guguoanbang", + "gz_kefuzhongyuan", + "wuzhong", + "yuanjiao", + "lianjunshengyan", + "lulitongxin", + "yiyi", + ].includes(get.name(card)); + }, "hs") + ) + return 3.5; + if ( + player.hasCard(function (card) { + return get.name(card) == "taoyuan"; + }, "hs") + ) + return get.order({ name: "taoyuan" }, player) - 1; return 9.5; }, - value:4, - useful:[2,1], - wuxie:function(){ + value: 4, + useful: [2, 1], + wuxie: function () { return 0; }, - result:{ - player:function(player,target){ - var att=get.attitude(player,target); - if(target.hp==1&&att<0) return 0; - if(game.hasPlayer(function(current){ - return get.attitude(player,current)1){ - player.chooseControl(controls).set('ai',function(){return 1}); + var controls = []; + if (target.countCards("h")) controls.push("手牌"); + if (target.isUnseen(0)) controls.push("主将"); + if (target.isUnseen(1)) controls.push("副将"); + if (controls.length > 1) { + player.chooseControl(controls).set("ai", function () { + return 1; + }); } - if(controls.length==0) event.finish(); - "step 1" + if (controls.length == 0) event.finish(); + "step 1"; var content; - var str=get.translation(target)+'的'; - if(result.control){ - if(result.control=='手牌'){ - content=[str+'手牌',target.getCards('h')]; - game.log(player,'观看了',target,'的手牌'); - } - else if(result.control=='主将'){ - content=[str+'主将',[[target.name1],'character']]; - game.log(player,'观看了',target,'的主将'); - } - else{ - content=[str+'副将',[[target.name2],'character']]; - game.log(player,'观看了',target,'的副将'); + var str = get.translation(target) + "的"; + if (result.control) { + if (result.control == "手牌") { + content = [str + "手牌", target.getCards("h")]; + game.log(player, "观看了", target, "的手牌"); + } else if (result.control == "主将") { + content = [str + "主将", [[target.name1], "character"]]; + game.log(player, "观看了", target, "的主将"); + } else { + content = [str + "副将", [[target.name2], "character"]]; + game.log(player, "观看了", target, "的副将"); } + } else if (target.countCards("h")) { + content = [str + "手牌", target.getCards("h")]; + game.log(player, "观看了", target, "的手牌"); + } else if (target.isUnseen(0)) { + content = [str + "主将", [[target.name1], "character"]]; + game.log(player, "观看了", target, "的主将"); + } else { + content = [str + "副将", [[target.name2], "character"]]; + game.log(player, "观看了", target, "的副将"); } - else if(target.countCards('h')){ - content=[str+'手牌',target.getCards('h')]; - game.log(player,'观看了',target,'的手牌'); - } - else if(target.isUnseen(0)){ - content=[str+'主将',[[target.name1],'character']]; - game.log(player,'观看了',target,'的主将'); - } - else{ - content=[str+'副将',[[target.name2],'character']]; - game.log(player,'观看了',target,'的副将'); - } - player.chooseControl('ok').set('dialog',content); + player.chooseControl("ok").set("dialog", content); }, - mode:['guozhan'], - ai:{ - order:9.5, - wuxie:function(){ + mode: ["guozhan"], + ai: { + order: 9.5, + wuxie: function () { return 0; }, - result:{ - player:function(player,target){ - if(player.countCards('h')<=player.hp) return 0; - if(player.storage.zhibi&&player.storage.zhibi.includes(target)) return 0; - return target.isUnseen()?1:0; - } - } - } + result: { + player: function (player, target) { + if (player.countCards("h") <= player.hp) return 0; + if (player.storage.zhibi && player.storage.zhibi.includes(target)) return 0; + return target.isUnseen() ? 1 : 0; + }, + }, + }, }, - yiyi:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - if(get.mode()=='guozhan'){ + yiyi: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + if (get.mode() == "guozhan") { return target.isFriendOf(player); - } - else if(get.is.versus()){ - return player.side==target.side; - } - else{ + } else if (get.is.versus()) { + return player.side == target.side; + } else { return true; } }, - selectTarget:function(){ - if(get.mode()=='guozhan') return -1; - return [1,3]; + selectTarget: function () { + if (get.mode() == "guozhan") return -1; + return [1, 3]; }, - content:function(){ + content: function () { target.draw(2); - target.chooseToDiscard(2,'he',true).ai=get.disvalue; + target.chooseToDiscard(2, "he", true).ai = get.disvalue; }, - ai:{ + ai: { wuxie: function () { return 0; }, basic: { order: 9, useful: 1.5, - value: 3 + value: 3, }, result: { target(player, target) { @@ -1112,839 +1288,964 @@ game.import('card', function () { if (!ui.selected.cards) y = 0; if (ui.selected.targets) tars = 0.01 * ui.selected.targets.length; else tars = 0; - if (target == player) i = player.countCards('h', function (card) { - if (y > 0 && ui.selected.cards.includes(card)) return false; - if (!y && get.name(card) === 'yiyi') { - y = -1; - return false; - } - return true; - }); - else i = target.countCards('he'); - if (target.hasSkillTag('noh')) add++; + if (target == player) + i = player.countCards("h", function (card) { + if (y > 0 && ui.selected.cards.includes(card)) return false; + if (!y && get.name(card) === "yiyi") { + y = -1; + return false; + } + return true; + }); + else i = target.countCards("he"); + if (target.hasSkillTag("noh")) add++; return add + Math.sqrt(i / 3.6 + tars) / 2; - } + }, }, tag: { draw: 2, loseCard: 2, discard: 2, multitarget: true, - norepeat: 1 - } - }, - }, - wuliu:{ - fullskin:true, - type:'equip', - subtype:'equip1', - global:'g_wuliu_skill', - distance:{attackFrom:-1}, - ai:{ - equipValue:function(card,player){ - if(player.identity=='unknown'||player.identity=='ye') return 2; - return 2+game.countPlayer(function(current){ - return current.isFriendOf(player); - })/2; + norepeat: 1, }, - basic:{ - equipValue:3 - } }, - skills:['wuliu_skill'], - mode:['guozhan'], }, - sanjian:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - basic:{ - equipValue:4 - } + wuliu: { + fullskin: true, + type: "equip", + subtype: "equip1", + global: "g_wuliu_skill", + distance: { attackFrom: -1 }, + ai: { + equipValue: function (card, player) { + if (player.identity == "unknown" || player.identity == "ye") return 2; + return ( + 2 + + game.countPlayer(function (current) { + return current.isFriendOf(player); + }) / + 2 + ); + }, + basic: { + equipValue: 3, + }, }, - skills:['sanjian_skill'] + skills: ["wuliu_skill"], + mode: ["guozhan"], }, - jingfanma:{ - fullskin:true, - type:'equip', - subtype:'equip4', - distance:{globalFrom:-1}, + sanjian: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + basic: { + equipValue: 4, + }, + }, + skills: ["sanjian_skill"], + }, + jingfanma: { + fullskin: true, + type: "equip", + subtype: "equip4", + distance: { globalFrom: -1 }, }, }, - skill:{ - zhaoshu_skill:{ - equipSkill:true, - charlotte:true, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - var cards=player.getExpansions('zhaoshu_cards'); - if(cards.length<4) return false; - var list=[]; - for(var i of cards){ - list.add(get.suit(i,false)); - if(list.length>=4) return true; + skill: { + zhaoshu_skill: { + equipSkill: true, + charlotte: true, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + var cards = player.getExpansions("zhaoshu_cards"); + if (cards.length < 4) return false; + var list = []; + for (var i of cards) { + list.add(get.suit(i, false)); + if (list.length >= 4) return true; } return false; }, - delay:false, - content:function(){ - 'step 0' - var cards=player.getExpansions('zhaoshu_cards'); + delay: false, + content: function () { + "step 0"; + var cards = player.getExpansions("zhaoshu_cards"); player.loseToDiscardpile(cards); game.delayx(); - 'step 1' - var list=[ - ['spade',12,'gz_haolingtianxia'], - ['diamond',1,'gz_kefuzhongyuan'], - ['heart',1,'gz_guguoanbang'], - ['club',12,'gz_wenheluanwu'], + "step 1"; + var list = [ + ["spade", 12, "gz_haolingtianxia"], + ["diamond", 1, "gz_kefuzhongyuan"], + ["heart", 1, "gz_guguoanbang"], + ["club", 12, "gz_wenheluanwu"], ]; - for(var i=0;i
  • 与你势力相同的角色的出牌阶段限一次,其可以将一张手牌(小势力角色改为至多两张)置于【诏书】上,称为“应”。
  • 出牌阶段限一次,若你的“应”中包含至少四种花色,则你可以发动“锦囊召唤”,将所有“应”置入弃牌堆,然后随机获得一张未加入游戏的势力锦囊牌。',false); - var cards=player.getExpansions('zhaoshu_cards'); - if(cards.length){ - dialog.addAuto(cards) + dialog.addText( + "
  • 与你势力相同的角色的出牌阶段限一次,其可以将一张手牌(小势力角色改为至多两张)置于【诏书】上,称为“应”。
  • 出牌阶段限一次,若你的“应”中包含至少四种花色,则你可以发动“锦囊召唤”,将所有“应”置入弃牌堆,然后随机获得一张未加入游戏的势力锦囊牌。", + false + ); + var cards = player.getExpansions("zhaoshu_cards"); + if (cards.length) { + dialog.addAuto(cards); } }, - content:'expansion', - markcount:function(content,player){ - return player.getExpansions('zhaoshu_cards').length; + content: "expansion", + markcount: function (content, player) { + return player.getExpansions("zhaoshu_cards").length; }, }, - onremove:function(player,skill){ - var cards=player.getExpansions(skill).concat(player.getExpansions('zhaoshu_cards')); - if(cards.length) player.loseToDiscardpile(cards); + onremove: function (player, skill) { + var cards = player.getExpansions(skill).concat(player.getExpansions("zhaoshu_cards")); + if (cards.length) player.loseToDiscardpile(cards); }, }, - zhaoshu_global:{ - enable:'phaseUse', - usable:1, - filter:function(event,player){ - if(!player.countCards('h')) return false; - return game.hasPlayer(function(current){ - return current.hasSkill('zhaoshu_skill')&¤t.isFriendOf(player); + zhaoshu_global: { + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + if (!player.countCards("h")) return false; + return game.hasPlayer(function (current) { + return current.hasSkill("zhaoshu_skill") && current.isFriendOf(player); }); }, - filterCard:true, - selectCard:function(){ - if(_status.event.player.isNotMajor()) return [1,2]; - return [1,1]; + filterCard: true, + selectCard: function () { + if (_status.event.player.isNotMajor()) return [1, 2]; + return [1, 1]; }, - position:'h', - discard:false, - lose:false, - delay:false, - check:function(card){ - var player=_status.event.player,cards=ui.selected.cards.concat(game.findPlayer(function(current){ - return current.hasSkill('zhaoshu_skill')&¤t.isFriendOf(player); - }).getExpansions('zhaoshu_cards')),suit=get.suit(card,false); - for(var i of cards){ - if(get.suit(i)==suit) return 0; + position: "h", + discard: false, + lose: false, + delay: false, + check: function (card) { + var player = _status.event.player, + cards = ui.selected.cards.concat( + game + .findPlayer(function (current) { + return current.hasSkill("zhaoshu_skill") && current.isFriendOf(player); + }) + .getExpansions("zhaoshu_cards") + ), + suit = get.suit(card, false); + for (var i of cards) { + if (get.suit(i) == suit) return 0; } - return 5+player.needsToDiscard()*1.5-get.value(card); + return 5 + player.needsToDiscard() * 1.5 - get.value(card); }, - filterTarget:function(card,player,target){ - return target.hasSkill('zhaoshu_skill')&&target.isFriendOf(player); + filterTarget: function (card, player, target) { + return target.hasSkill("zhaoshu_skill") && target.isFriendOf(player); }, - selectTarget:function(){ - if(game.countPlayer(function(current){ - return current.hasSkill('zhaoshu_skill')&¤t.isFriendOf(_status.event.player); - })==1) return -1; + selectTarget: function () { + if ( + game.countPlayer(function (current) { + return ( + current.hasSkill("zhaoshu_skill") && current.isFriendOf(_status.event.player) + ); + }) == 1 + ) + return -1; return 1; }, - prompt:function(){ - var player=_status.event.player; - return '将'+(player.isNotMajor()?'至多两':'一')+'张手牌置于'+get.translation(game.filterPlayer(function(current){ - return current.hasSkill('zhaoshu_skill')&¤t.isFriendOf(player); - }))+'的【诏书】上'; + prompt: function () { + var player = _status.event.player; + return ( + "将" + + (player.isNotMajor() ? "至多两" : "一") + + "张手牌置于" + + get.translation( + game.filterPlayer(function (current) { + return current.hasSkill("zhaoshu_skill") && current.isFriendOf(player); + }) + ) + + "的【诏书】上" + ); }, - content:function(){ - 'step 0' - target.addToExpansion(cards,player,'give').gaintag.add('zhaoshu_cards'); - 'step 1' - target.markSkill('zhaoshu_skill'); + content: function () { + "step 0"; + target.addToExpansion(cards, player, "give").gaintag.add("zhaoshu_cards"); + "step 1"; + target.markSkill("zhaoshu_skill"); }, - ai:{ - order:1, - result:{ - player:1, + ai: { + order: 1, + result: { + player: 1, }, }, }, - liulongcanjia:{ - equipSkill:true, - mod:{ - canBeReplaced:function(card,player){ - if(player.getEquips('liulongcanjia').includes(card)) return false; + liulongcanjia: { + equipSkill: true, + mod: { + canBeReplaced: function (card, player) { + if (player.getEquips("liulongcanjia").includes(card)) return false; }, }, }, - minguangkai_cancel:{ - equipSkill:true, - trigger:{target:'useCardToTarget'}, - forced:true, - check:function(event,player){ - return get.effect(event.target,event.card,event.player,player)<0; + minguangkai_cancel: { + equipSkill: true, + trigger: { target: "useCardToTarget" }, + forced: true, + check: function (event, player) { + return get.effect(event.target, event.card, event.player, player) < 0; }, - filter:function(event,player){ - if(['huoshaolianying','huogong'].includes(event.card.name)) return true; - if(event.card.name=='sha') return game.hasNature(event.card,'fire'); + filter: function (event, player) { + if (["huoshaolianying", "huogong"].includes(event.card.name)) return true; + if (event.card.name == "sha") return game.hasNature(event.card, "fire"); return false; }, - content:function(){ + content: function () { trigger.getParent().targets.remove(player); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(['huoshaolianying','huogong'].includes(card.name)||(card.name=='sha'&&game.hasNature(card,'fire'))){ - return 'zeroplayertarget'; + ai: { + effect: { + target: function (card, player, target, current) { + if ( + ["huoshaolianying", "huogong"].includes(card.name) || + (card.name == "sha" && game.hasNature(card, "fire")) + ) { + return "zeroplayertarget"; } }, - } - } - }, - minguangkai_link:{ - equipSkill:true, - trigger:{player:'linkBefore'}, - forced:true, - filter:function(event,player){ - return player.isNotMajor()&&!player.isLinked(); + }, }, - content:function(){ + }, + minguangkai_link: { + equipSkill: true, + trigger: { player: "linkBefore" }, + forced: true, + filter: function (event, player) { + return player.isNotMajor() && !player.isLinked(); + }, + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(target.isMinor()&&['tiesuo','lulitongxin'].includes(card.name)){ - return 'zeroplayertarget'; + ai: { + effect: { + target: function (card, player, target, current) { + if (target.isMinor() && ["tiesuo", "lulitongxin"].includes(card.name)) { + return "zeroplayertarget"; } }, - } - } + }, + }, }, - dinglanyemingzhu_skill:{ - equipSkill:true, - inherit:'zhiheng', - filter:function(event,player){ - return !player.hasSkill('gzzhiheng',true); + dinglanyemingzhu_skill: { + equipSkill: true, + inherit: "zhiheng", + filter: function (event, player) { + return !player.hasSkill("gzzhiheng", true); }, - selectCard:function(){ - var player=_status.event.player; - return [1,player.maxHp]; + selectCard: function () { + var player = _status.event.player; + return [1, player.maxHp]; }, - filterCard:function(card,player){ - var cards=player.getEquips('dinglanyemingzhu'); - if(cards.length) return cards.some(card2=>card2!=card&&!ui.selected.cards.includes(card2)) + filterCard: function (card, player) { + var cards = player.getEquips("dinglanyemingzhu"); + if (cards.length) + return cards.some((card2) => card2 != card && !ui.selected.cards.includes(card2)); return true; }, - prompt:'出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌' + prompt: "出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌", }, - g_dinglanyemingzhu_ai:{ - ai:{ - effect:{ - player:function(card,player){ - if(player.hasSkill('jubao')) return; - if(card.name=='dinglanyemingzhu'&&game.hasPlayer(function(current){ - return current.hasSkill('jubao')&&get.attitude(player,current)<=0; - })){ - return [0,0,0,0]; - } - } - } - } - }, - g_feilongduofeng_ai:{ - ai:{ - effect:{ - player:function(card,player){ - if(player.hasSkill('zhangwu')) return; - if(card.name=='feilongduofeng'&&game.hasPlayer(function(current){ - return current.hasSkill('zhangwu')&&get.attitude(player,current)<=0; - })){ - return [0,0,0,0]; - } - } - } - } - }, - g_taipingyaoshu_ai:{ - ai:{ - effect:{ - player:function(card,player){ - if(player.hasSkill('wendao')) return; - if(card.name=='taipingyaoshu'&&game.hasPlayer(function(current){ - return current.hasSkill('wendao')&&get.attitude(player,current)<=0; - })){ - return [0,0,0,0]; + g_dinglanyemingzhu_ai: { + ai: { + effect: { + player: function (card, player) { + if (player.hasSkill("jubao")) return; + if ( + card.name == "dinglanyemingzhu" && + game.hasPlayer(function (current) { + return current.hasSkill("jubao") && get.attitude(player, current) <= 0; + }) + ) { + return [0, 0, 0, 0]; } }, - target:(card,player,target)=>{ - if(target._g_taipingyaoshu_temp) return; - if(get.subtype(card)==='equip2'&&target.getEquip('taipingyaoshu')&&!target.countEmptySlot(2)){ - target._g_taipingyaoshu_temp=true; - let lose=get.effect(target,{name:'losehp'},target,target), - draw=2*get.effect(target,{name:'draw'},target,target); - delete target._g_taipingyaoshu_temp; - if(lose<0&&target.hp<=1&&!target.hasCard(i=>{ - return get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable'); - })) draw=0; - return [1,(lose+draw)/get.attitude(target,target)]; + }, + }, + }, + g_feilongduofeng_ai: { + ai: { + effect: { + player: function (card, player) { + if (player.hasSkill("zhangwu")) return; + if ( + card.name == "feilongduofeng" && + game.hasPlayer(function (current) { + return current.hasSkill("zhangwu") && get.attitude(player, current) <= 0; + }) + ) { + return [0, 0, 0, 0]; } - } - } - } - }, - feilongduofeng:{ - equipSkill:true, - trigger:{player:'useCardToPlayered'}, - logTarget:'target', - check:function(event,player){ - return get.attitude(player,event.target)<=0; - }, - filter:function(event,player){ - return event.card.name=='sha'&&event.target.countCards('he'); - }, - content:function(){ - trigger.target.chooseToDiscard('he',true); + }, + }, }, }, - feilongduofeng2:{ - equipSkill:true, - trigger:{source:'dieAfter'}, - filter:function(event,player){ - if(event.reason&&event.reason.card&&event.reason.card.name=='sha'){ - return event.player.isDead()&&lib.group.includes(player.identity)&&player.isMinor(); + g_taipingyaoshu_ai: { + ai: { + effect: { + player: function (card, player) { + if (player.hasSkill("wendao")) return; + if ( + card.name == "taipingyaoshu" && + game.hasPlayer(function (current) { + return current.hasSkill("wendao") && get.attitude(player, current) <= 0; + }) + ) { + return [0, 0, 0, 0]; + } + }, + target: (card, player, target) => { + if (target._g_taipingyaoshu_temp) return; + if ( + get.subtype(card) === "equip2" && + target.getEquip("taipingyaoshu") && + !target.countEmptySlot(2) + ) { + target._g_taipingyaoshu_temp = true; + let lose = get.effect(target, { name: "losehp" }, target, target), + draw = 2 * get.effect(target, { name: "draw" }, target, target); + delete target._g_taipingyaoshu_temp; + if ( + lose < 0 && + target.hp <= 1 && + !target.hasCard((i) => { + return ( + get.name(i) === "tao" && + lib.filter.cardEnabled(i, target, "forceEnable") + ); + }) + ) + draw = 0; + return [1, (lose + draw) / get.attitude(target, target)]; + } + }, + }, + }, + }, + feilongduofeng: { + equipSkill: true, + trigger: { player: "useCardToPlayered" }, + logTarget: "target", + check: function (event, player) { + return get.attitude(player, event.target) <= 0; + }, + filter: function (event, player) { + return event.card.name == "sha" && event.target.countCards("he"); + }, + content: function () { + trigger.target.chooseToDiscard("he", true); + }, + }, + feilongduofeng2: { + equipSkill: true, + trigger: { source: "dieAfter" }, + filter: function (event, player) { + if (event.reason && event.reason.card && event.reason.card.name == "sha") { + return ( + event.player.isDead() && lib.group.includes(player.identity) && player.isMinor() + ); } return false; }, - logTarget:'player', - content:function(){ - 'step 0' - var list=[]; - for(var i=0;i<_status.characterlist.length;i++){ - var info=lib.character[_status.characterlist[i]]; - if(info[4]&&info[4].includes('jun')) continue; - if(info[1]==player.identity){ + logTarget: "player", + content: function () { + "step 0"; + var list = []; + for (var i = 0; i < _status.characterlist.length; i++) { + var info = lib.character[_status.characterlist[i]]; + if (info[4] && info[4].includes("jun")) continue; + if (info[1] == player.identity) { list.push(_status.characterlist[i]); } } - event.identity=event.player.identity; - if(trigger.player==game.me&&!_status.auto){ - event.dialog=ui.create.dialog('是否选择一名角色重新加入游戏?',[list,'character']); - event.filterButton=function(){return true}; - event.player=game.me; - event.custom.replace.confirm=function(){ - if(!ui.selected.buttons.length){ - event.directresult='refuse'; - } - else{ - event.directresult=ui.selected.buttons[0].link; + event.identity = event.player.identity; + if (trigger.player == game.me && !_status.auto) { + event.dialog = ui.create.dialog("是否选择一名角色重新加入游戏?", [ + list, + "character", + ]); + event.filterButton = function () { + return true; + }; + event.player = game.me; + event.custom.replace.confirm = function () { + if (!ui.selected.buttons.length) { + event.directresult = "refuse"; + } else { + event.directresult = ui.selected.buttons[0].link; } event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; game.resume(); - } - event.switchToAuto=function(){ - event.directresult=list.randomGet(); + }; + event.switchToAuto = function () { + event.directresult = list.randomGet(); event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; }; game.check(); game.pause(); - } - else if(trigger.player.isOnline()){ - trigger.player.send(function(player,list){ - if(_status.auto){ - _status.event._result=list.randomGet(); - } - else{ - var next=game.createEvent('replacePlayer'); - next.source=player; - next.list=list; - next.setContent(function(){ - event.dialog=ui.create.dialog('是否选择一名角色重新加入游戏?',[event.list,'character']); - event.filterButton=function(){return true}; - event.player=event.source; - event.custom.replace.confirm=function(){ - if(!ui.selected.buttons.length){ - event.result='refuse'; - } - else{ - event.result=ui.selected.buttons[0].link; - } - event.dialog.close(); - if(ui.confirm) ui.confirm.close(); - delete event.player; - game.resume(); - game.uncheck(); - } - event.switchToAuto=function(){ - event.result=list.randomGet(); - event.dialog.close(); - if(ui.confirm) ui.confirm.close(); - delete event.player; - game.uncheck(); - }; - game.check(); - game.pause(); - }); - } - game.resume(); - },trigger.player,list); + } else if (trigger.player.isOnline()) { + trigger.player.send( + function (player, list) { + if (_status.auto) { + _status.event._result = list.randomGet(); + } else { + var next = game.createEvent("replacePlayer"); + next.source = player; + next.list = list; + next.setContent(function () { + event.dialog = ui.create.dialog("是否选择一名角色重新加入游戏?", [ + event.list, + "character", + ]); + event.filterButton = function () { + return true; + }; + event.player = event.source; + event.custom.replace.confirm = function () { + if (!ui.selected.buttons.length) { + event.result = "refuse"; + } else { + event.result = ui.selected.buttons[0].link; + } + event.dialog.close(); + if (ui.confirm) ui.confirm.close(); + delete event.player; + game.resume(); + game.uncheck(); + }; + event.switchToAuto = function () { + event.result = list.randomGet(); + event.dialog.close(); + if (ui.confirm) ui.confirm.close(); + delete event.player; + game.uncheck(); + }; + game.check(); + game.pause(); + }); + } + game.resume(); + }, + trigger.player, + list + ); trigger.player.wait(); game.pause(); + } else { + event.directresult = list.randomGet(); } - else{ - event.directresult=list.randomGet(); - } - event.list=list; - 'step 1' + event.list = list; + "step 1"; game.uncheck(); - if(!event.directresult){ - if(event.resultOL){ - event.directresult=event.resultOL[trigger.player.playerid]; + if (!event.directresult) { + if (event.resultOL) { + event.directresult = event.resultOL[trigger.player.playerid]; } - if(!event.directresult||event.directresult=='ai'){ - event.directresult=event.list.randomGet(); + if (!event.directresult || event.directresult == "ai") { + event.directresult = event.list.randomGet(); } } - if(event.directresult=='refuse'){ - game.log(trigger.player,'拒绝重新加入游戏'); + if (event.directresult == "refuse") { + game.log(trigger.player, "拒绝重新加入游戏"); return; } - game.log(trigger.player,'重新加入游戏'); - var name=event.directresult; - game.log(trigger.player,'将主将替换为','#b'+name); + game.log(trigger.player, "重新加入游戏"); + var name = event.directresult; + game.log(trigger.player, "将主将替换为", "#b" + name); _status.characterlist.remove(name); - game.broadcastAll(function(source,name,identity){ - source.revive(2,false); - source.identity=identity; - source._group=identity; - source.setIdentity(); - if(source==game.me){ - ui.arena.classList.remove('selecting'); - } - },trigger.player,name,event.identity); + game.broadcastAll( + function (source, name, identity) { + source.revive(2, false); + source.identity = identity; + source._group = identity; + source.setIdentity(); + if (source == game.me) { + ui.arena.classList.remove("selecting"); + } + }, + trigger.player, + name, + event.identity + ); trigger.player.draw(); - trigger.player.reinit(trigger.player.name1,name,false); + trigger.player.reinit(trigger.player.name1, name, false); trigger.player.removeCharacter(1); - trigger.getParent('damage').untrigger(false,trigger.player); - game.addVideo('setIdentity',trigger.player,event.identity); - } + trigger.getParent("damage").untrigger(false, trigger.player); + game.addVideo("setIdentity", trigger.player, event.identity); + }, }, - feilongduofeng3:{ - equipSkill:true, - trigger:{source:'dying'}, - filter:function(event,player){ - var evt=event.getParent('damage'); - return evt&&evt.card&&evt.card.name=='sha'&&event.player.countGainableCards(player,'h')>0; + feilongduofeng3: { + equipSkill: true, + trigger: { source: "dying" }, + filter: function (event, player) { + var evt = event.getParent("damage"); + return ( + evt && + evt.card && + evt.card.name == "sha" && + event.player.countGainableCards(player, "h") > 0 + ); }, //priority:7, - logTarget:'player', - prompt2:'获得该角色的一张手牌', - check:function(event,player){ - return get.attitude(player,event.player)<0; + logTarget: "player", + prompt2: "获得该角色的一张手牌", + check: function (event, player) { + return get.attitude(player, event.player) < 0; }, - content:function(){ - player.gainPlayerCard(trigger.player,'h',true); + content: function () { + player.gainPlayerCard(trigger.player, "h", true); }, }, - taipingyaoshu:{ - equipSkill:true, - mod:{ - maxHandcard:function(player,num){ - if(get.mode()=='guozhan'){ - if(player.hasSkill('huangjintianbingfu')){ - num+=player.getExpansions('huangjintianbingfu').length; + taipingyaoshu: { + equipSkill: true, + mod: { + maxHandcard: function (player, num) { + if (get.mode() == "guozhan") { + if (player.hasSkill("huangjintianbingfu")) { + num += player.getExpansions("huangjintianbingfu").length; } - return num+game.countPlayer(function(current){ - return current.isFriendOf(player); - }); + return ( + num + + game.countPlayer(function (current) { + return current.isFriendOf(player); + }) + ); } - return num+game.countGroup()-1; - } + return num + game.countGroup() - 1; + }, }, - trigger:{player:'damageBegin4'}, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - if(event.nature) return true; + trigger: { player: "damageBegin4" }, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + if (event.nature) return true; }, - forced:true, - content:function(){ + forced: true, + content: function () { trigger.cancel(); }, - ai:{ - nofire:true, - nothunder:true, - effect:{ - target:function(card,player,target,current){ - if(target.hasSkillTag('unequip2')) return; - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card - })||player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card - })) return; - if(get.tag(card,'natureDamage')) return 'zeroplayertarget'; - if(card.name=='tiesuo'){ - return [0,0]; + ai: { + nofire: true, + nothunder: true, + effect: { + target: function (card, player, target, current) { + if (target.hasSkillTag("unequip2")) return; + if ( + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) || + player.hasSkillTag("unequip_ai", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) + return; + if (get.tag(card, "natureDamage")) return "zeroplayertarget"; + if (card.name == "tiesuo") { + return [0, 0]; } - } - } - } - }, - g_taipingyaoshu:{}, - yuxi_skill:{ - equipSkill:true, - trigger:{player:'phaseDrawBegin2'}, - forced:true, - filter:function(event,player){ - return !player.isUnseen()&&!event.numFixed; + }, + }, }, - content:function(){ + }, + g_taipingyaoshu: {}, + yuxi_skill: { + equipSkill: true, + trigger: { player: "phaseDrawBegin2" }, + forced: true, + filter: function (event, player) { + return !player.isUnseen() && !event.numFixed; + }, + content: function () { trigger.num++; }, - ai:{ - threaten:1.3, - forceMajor:true, + ai: { + threaten: 1.3, + forceMajor: true, }, - group:'yuxi_skill2' + group: "yuxi_skill2", }, - yuxi_skill2:{ - equipSkill:true, - trigger:{player:'phaseUseBegin'}, - forced:true, - filter:function(event,player){ - if(player.isUnseen()) return false; - return game.hasPlayer(function(current){ - return player.canUse('zhibi',current); + yuxi_skill2: { + equipSkill: true, + trigger: { player: "phaseUseBegin" }, + forced: true, + filter: function (event, player) { + if (player.isUnseen()) return false; + return game.hasPlayer(function (current) { + return player.canUse("zhibi", current); }); }, - content:function(){ - player.chooseUseTarget('玉玺:选择知己知彼的目标',{name:'zhibi'}); - } + content: function () { + player.chooseUseTarget("玉玺:选择知己知彼的目标", { name: "zhibi" }); + }, }, - xietianzi:{ - forced:true, - popup:false, - filter:function(event,player){ - return player.countCards('h')>0; + xietianzi: { + forced: true, + popup: false, + filter: function (event, player) { + return player.countCards("h") > 0; }, - trigger:{ - player:'phaseDiscardAfter', + trigger: { + player: "phaseDiscardAfter", }, - content:function(){ - "step 0" - player.removeSkill('xietianzi'); - player.chooseToDiscard('h','是否弃置一张手牌并获得一个额外回合?').set('ai',function(card){ - return 10-get.value(card); - }); - "step 1" - if(result.bool){ + content: function () { + "step 0"; + player.removeSkill("xietianzi"); + player + .chooseToDiscard("h", "是否弃置一张手牌并获得一个额外回合?") + .set("ai", function (card) { + return 10 - get.value(card); + }); + "step 1"; + if (result.bool) { player.insertPhase(); } }, }, - g_chiling3:{ - mode:['guozhan'], - trigger:{player:'phaseEnd'}, - forced:true, - popup:false, - filter:function(){ - return _status.chiling==true; + g_chiling3: { + mode: ["guozhan"], + trigger: { player: "phaseEnd" }, + forced: true, + popup: false, + filter: function () { + return _status.chiling == true; }, - content:function(){ - 'step 0' - _status.chiling=false; - var targets=game.filterPlayer(function(target){ + content: function () { + "step 0"; + _status.chiling = false; + var targets = game.filterPlayer(function (target) { return target.isUnseen(); }); targets.sort(lib.sort.seat); - event.targets=targets; - 'step 1' - if(event.targets.length){ - var target=event.targets.shift(); - event.current=target; - var choiceList=['明置一张武将牌,然后摸一张牌','失去1点体力']; - if(target.countCards('he',{type:'equip'})){ - choiceList.push('弃置一张装备牌'); + event.targets = targets; + "step 1"; + if (event.targets.length) { + var target = event.targets.shift(); + event.current = target; + var choiceList = ["明置一张武将牌,然后摸一张牌", "失去1点体力"]; + if (target.countCards("he", { type: "equip" })) { + choiceList.push("弃置一张装备牌"); } - target.chooseControl(lib.card.chiling.chooseai).set('prompt','敕令').set('choiceList',choiceList); - } - else{ + target + .chooseControl(lib.card.chiling.chooseai) + .set("prompt", "敕令") + .set("choiceList", choiceList); + } else { event.finish(); } - 'step 2' - var target=event.current; - if(result.control=='选项一'){ - target.chooseControl('主将','副将',function(){ - return Math.floor(Math.random()*2); - }).set('prompt','选择要明置的武将牌'); - } - else if(result.control=='选项二'){ + "step 2"; + var target = event.current; + if (result.control == "选项一") { + target + .chooseControl("主将", "副将", function () { + return Math.floor(Math.random() * 2); + }) + .set("prompt", "选择要明置的武将牌"); + } else if (result.control == "选项二") { target.loseHp(); event.goto(1); - } - else{ - target.chooseToDiscard('he',{type:'equip'},true); + } else { + target.chooseToDiscard("he", { type: "equip" }, true); event.goto(1); } - 'step 3' - var target=event.current; - if(result.index==0){ + "step 3"; + var target = event.current; + if (result.index == 0) { target.showCharacter(0); - } - else{ + } else { target.showCharacter(1); } target.draw(); event.goto(1); - } + }, }, - g_diaohulishan:{}, - diaohulishan:{ - charlotte:true, - group:'undist', - init:function(player){ - if(player.isIn()){ - game.broadcastAll(function(player){ - player.classList.add('out'); - },player); - game.log(player,'移出了游戏'); + g_diaohulishan: {}, + diaohulishan: { + charlotte: true, + group: "undist", + init: function (player) { + if (player.isIn()) { + game.broadcastAll(function (player) { + player.classList.add("out"); + }, player); + game.log(player, "移出了游戏"); } }, - onremove:function(player){ - if(player.isOut()){ - game.broadcastAll(function(player){ - player.classList.remove('out'); - },player); - game.log(player,'移回了游戏'); + onremove: function (player) { + if (player.isOut()) { + game.broadcastAll(function (player) { + player.classList.remove("out"); + }, player); + game.log(player, "移回了游戏"); } }, }, - huxinjing:{ - equipSkill:true, - trigger:{player:'damageBegin4'}, + huxinjing: { + equipSkill: true, + trigger: { player: "damageBegin4" }, // forced:true, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - var cards=player.getEquips('huxinjing'); - if(!cards.length) return false; - if(get.mode()!='guozhan'&&event.num>1) return true; - return event.num>=player.hp; + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + var cards = player.getEquips("huxinjing"); + if (!cards.length) return false; + if (get.mode() != "guozhan" && event.num > 1) return true; + return event.num >= player.hp; }, - content:function(){ + content: function () { trigger.cancel(); - var e2=player.getEquips('huxinjing'); - if(e2.length){ + var e2 = player.getEquips("huxinjing"); + if (e2.length) { player.discard(e2); } - player.removeSkill('huxinjing'); - } + player.removeSkill("huxinjing"); + }, }, - wuliu_skill:{ - equipSkill:true, + wuliu_skill: { + equipSkill: true, }, - g_wuliu_skill:{ - equipSkill:true, - mod:{ - attackRange:function(player,distance){ - return distance+game.countPlayer(function(current){ - if(current==player||!current.isFriendOf(player)) return false; - if(current.hasSkill('wuliu_skill')) return true; - }); - } - } + g_wuliu_skill: { + equipSkill: true, + mod: { + attackRange: function (player, distance) { + return ( + distance + + game.countPlayer(function (current) { + if (current == player || !current.isFriendOf(player)) return false; + if (current.hasSkill("wuliu_skill")) return true; + }) + ); + }, + }, }, - sanjian_skill:{ - equipSkill:true, - audio:true, - trigger:{source:'damageSource'}, - direct:true, - filter:function(event,player){ - if(event.player.isDead()) return false; - if(player.countCards('h')==0) return false; - if(!event.card) return false; - if(event.card.name!='sha') return false; - if(!event.notLink()) return false; - return game.hasPlayer(function(current){ - return current!=event.player&&get.distance(event.player,current)<=1; + sanjian_skill: { + equipSkill: true, + audio: true, + trigger: { source: "damageSource" }, + direct: true, + filter: function (event, player) { + if (event.player.isDead()) return false; + if (player.countCards("h") == 0) return false; + if (!event.card) return false; + if (event.card.name != "sha") return false; + if (!event.notLink()) return false; + return game.hasPlayer(function (current) { + return current != event.player && get.distance(event.player, current) <= 1; }); }, - content:function(){ - "step 0" - var damaged=trigger.player; - player.chooseCardTarget({ - filterCard:lib.filter.cardDiscardable, - filterTarget:function(card,player,target){ - var damaged=_status.event.damaged; - return get.distance(damaged,target)<=1&&target!=damaged; - }, - ai1:function(card){ - return 9-get.value(card); - }, - ai2:function(target){ - var player=_status.event.player; - return get.damageEffect(target,player,player); - }, - prompt:get.prompt('sanjian') - }).set('damaged',damaged); - "step 1" - if(result.bool){ - player.logSkill('sanjian_skill',result.targets); + content: function () { + "step 0"; + var damaged = trigger.player; + player + .chooseCardTarget({ + filterCard: lib.filter.cardDiscardable, + filterTarget: function (card, player, target) { + var damaged = _status.event.damaged; + return get.distance(damaged, target) <= 1 && target != damaged; + }, + ai1: function (card) { + return 9 - get.value(card); + }, + ai2: function (target) { + var player = _status.event.player; + return get.damageEffect(target, player, player); + }, + prompt: get.prompt("sanjian"), + }) + .set("damaged", damaged); + "step 1"; + if (result.bool) { + player.logSkill("sanjian_skill", result.targets); player.discard(result.cards); result.targets[0].damage(); } - } + }, }, }, - translate:{ - liulongcanjia:'六龙骖驾', - liulongcanjia_info:'锁定技。此牌占用1个进攻坐骑和1个防御坐骑槽位,且不可被替换。你计算与其他角色的距离-1,其他角色计算与你的距离+1。', - minguangkai:'明光铠', - minguangkai_cancel:'明光铠', - minguangkai_link:'明光铠', - minguangkai_info:'锁定技。①当你成为【火烧连营】、【火攻】或火【杀】的目标时,取消之。②当你即将横置前,若你是小势力角色,取消之。', - dinglanyemingzhu:'定澜夜明珠', - dinglanyemingzhu_bg:'珠', - dinglanyemingzhu_info:'锁定技。若你拥有〖制衡〗,则你取消〖制衡〗的弃置牌数限制,否则你视为拥有〖制衡〗。', - dinglanyemingzhu_skill:'制衡', - dinglanyemingzhu_skill_info:'出牌阶段限一次。你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌。', - feilongduofeng:'飞龙夺凤', - feilongduofeng2:'飞龙夺凤', - feilongduofeng3:'飞龙夺凤', - feilongduofeng_info:'①当你使用【杀】指定目标后,你可令目标角色弃置一张牌。②当你因使用【杀】而令其他角色进入濒死状态时,你可以获得其一张手牌。', - taipingyaoshu:'太平要术', - taipingyaoshu_info:'锁定技。①当你即将受到属性伤害时,取消之。②你的手牌上限+X(X为场上势力数-1)。③当你失去装备区里的【太平要术】时,你摸两张牌,然后若你的体力值大于1,你失去1点体力。', - taipingyaoshu_info_guozhan:'锁定技。①当你即将受到属性伤害时,取消之。②你的手牌上限+X(X为与你势力相同的角色数)。③当你失去装备区里的【太平要术】时,你摸两张牌,然后若你的体力值大于1,你失去1点体力。', - yuxi_skill:'玉玺', - yuxi_skill2:'玉玺', - yuxi:'玉玺', - yuxi_info:'锁定技。若你有明置的武将牌,则:①你的势力视为唯一的大势力。②摸牌阶段开始时,你令额定摸牌数+1。③出牌阶段开始时,你视为使用【知己知彼】。', - xietianzi:'挟令', - xietianzi_info:'出牌阶段,对自己使用。你结束出牌阶段。本回合的弃牌阶段结束时,你可以弃置一张手牌,获得一个额外的回合。', - xietianzi_info_guozhan:'出牌阶段,对身为大势力角色的自己使用。你结束出牌阶段。本回合的弃牌阶段结束时,你可以弃置一张手牌,获得一个额外的回合。', - shuiyanqijunx:'水淹七军', - shuiyanqijunx_info:'出牌阶段,对一名其他角色使用。目标角色选择一项:⒈弃置装备区里的所有牌(至少一张)。⒉受到你造成的1点雷电伤害。', - shuiyanqijunx_info_guozhan:'出牌阶段,对一名装备区里有牌的其他角色使用。目标角色选择一项:⒈弃置装备区里的所有牌。⒉受到你造成的1点雷电伤害。', - lulitongxin:'勠力同心', - lulitongxin_info:'出牌阶段,对所有大势力角色或所有小势力角色使用。若目标角色:未横置,则其横置;已横置,则其摸一张牌。', - lulitongxin_info_versus:'出牌阶段,对所有己方角色或所有敌方角色使用。若目标角色:未横置,则其横置;已横置,则其摸一张牌。', - lianjunshengyan:'联军盛宴', - lianjunshengyan_info:'出牌阶段,对你和你选择的除你的势力外的一个势力的所有角色使用。若目标角色:为你,你选择摸Y张牌并回复X-Y点体力(X为该势力的角色数,Y∈[0,X]);不为你,其摸一张牌,然后重置。', - lianjunshengyan_info_boss:'出牌阶段,对场上所有角色使用。你摸X张牌(X为存活角色数),其他角色依次选择回复1点体力或摸一张牌。', - chiling:'敕令', - chiling_info:'①出牌阶段,对所有没有势力的角色使用。目标角色选择一项:1、明置一张武将牌,然后摸一张牌;2、弃置一张装备牌;3、失去1点体力。②当【敕令】因判定或弃置而置入弃牌堆时,系统将之移出游戏并将【诏书】置于牌堆底,然后系统于当前回合结束后视为对所有没有势力的角色使用【敕令】。', - diaohulishan:'调虎离山', - diaohulishan_info:'出牌阶段,对至多两名其他角色使用。目标角色于此回合视为移出游戏。', - huoshaolianying:'火烧连营', - huoshaolianying_bg:'烧', - huoshaolianying_info_guozhan:'出牌阶段,对你的下家及其队列中的所有角色使用。你对目标角色造成1点火属性伤害。', - huoshaolianying_info:'出牌阶段,对距离最小的一名横置角色使用(若无横置角色,则改为对距离最小的所有角色使用),你对目标造成1点火属性伤害。', - yuanjiao:'远交近攻', - yuanjiao_info:'出牌阶段,对一名与你势力不同的其他角色使用。其摸一张牌,然后你摸三张牌。', - yuanjiao_info_guozhan:'出牌阶段,对一名与你势力不同且已确定势力的其他角色使用。其摸一张牌,然后你摸三张牌。', - yuanjiao_bg:'交', - zhibi:'知己知彼', - zhibi_info:'出牌阶段,对一名有手牌或有暗置武将牌的其他角色使用。你选择一项:⒈观看其手牌。⒉观看其的一张暗置武将牌。', - yiyi:'以逸待劳', - yiyi_info_guozhan:'出牌阶段,对所有己方角色使用。目标角色摸两张牌,然后弃置两张牌。', - yiyi_info_combat:'出牌阶段,对所有己方角色使用。目标角色摸两张牌,然后弃置两张牌。', - yiyi_info:'出牌阶段,对至多三名角色使用。目标角色摸两张牌,然后弃置两张牌。', - yiyi_bg:'逸', - wuliu:'吴六剑', - wuliu_info:'锁定技。与你势力相同的所有其他角色的攻击范围+1。', - sanjian:'三尖两刃刀', - sanjian_info:'当你因执行【杀】而对A造成伤害后,你可以弃置一张牌并选择一名其他角色B(A至B的距离需为1)。你对B造成1点伤害。', - wuliu_skill:'吴六剑', - sanjian_skill:'三尖两刃刀', - jingfanma_bg:'-马', - jingfanma:'惊帆', - jingfanma_info:'锁定技,你计算与其他角色的距离-1。', - huxinjing_bg:'镜', - huxinjing:'护心镜', - huxinjing_info:'此牌可对其他角色使用。当你受到伤害时,若伤害值大于1或大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。', - huxinjing_info_guozhan:'当你受到伤害时,若伤害值大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。', - gz_haolingtianxia:'号令天下', - gz_haolingtianxia_info:'出牌阶段,对一名体力值不为全场最少的角色使用。所有其他角色依次可以选择一项:①弃置一张牌(魏势力角色无需弃牌),视为对目标角色使用一张【杀】;②弃置目标角色的一张牌(魏势力角色改为获得其一张牌)。', - gz_kefuzhongyuan:'克复中原', - gz_kefuzhongyuan_info:'出牌阶段,对任意名角色使用。目标角色选择一项:①视为使用一张【杀】(蜀势力角色以此法使用【杀】的伤害值基数+1);②摸一张牌(蜀势力角色改为摸两张牌)。', - gz_guguoanbang:'固国安邦', - gz_guguoanbang_info:'出牌阶段,对你自己使用。你摸八张牌,然后弃置至少六张手牌。然后若你的势力为吴,则你可以将你以此法弃置的牌交给其他吴势力角色(每名角色至多获得两张牌)。', - gz_wenheluanwu:'文和乱武', - gz_wenheluanwu_info:'出牌阶段,对所有角色使用。目标角色展示所有手牌,然后你选择一项:①令其弃置两张类型不同的手牌;②你弃置其一张手牌。然后若其为群势力角色且其没有手牌,则其将手牌摸至当前体力值(至多为5)。', - zhaoshu:'诏书', - zhaoshu_skill:'锦囊召唤', - zhaoshu_global:'诏书', - zhaoshu_info:'
  • 出牌阶段,对你自己使用。你将此牌置于目标的武将牌上。
  • 与你势力相同的角色的出牌阶段限一次,其可以将一张手牌(小势力角色改为至多两张)置于【诏书】上,称为“应”。
  • 出牌阶段限一次,若你的“应”中包含至少四种花色,则你可以发动“锦囊召唤”:将所有“应”置入弃牌堆,然后随机获得一张未加入游戏的势力锦囊牌。', + translate: { + liulongcanjia: "六龙骖驾", + liulongcanjia_info: + "锁定技。此牌占用1个进攻坐骑和1个防御坐骑槽位,且不可被替换。你计算与其他角色的距离-1,其他角色计算与你的距离+1。", + minguangkai: "明光铠", + minguangkai_cancel: "明光铠", + minguangkai_link: "明光铠", + minguangkai_info: + "锁定技。①当你成为【火烧连营】、【火攻】或火【杀】的目标时,取消之。②当你即将横置前,若你是小势力角色,取消之。", + dinglanyemingzhu: "定澜夜明珠", + dinglanyemingzhu_bg: "珠", + dinglanyemingzhu_info: + "锁定技。若你拥有〖制衡〗,则你取消〖制衡〗的弃置牌数限制,否则你视为拥有〖制衡〗。", + dinglanyemingzhu_skill: "制衡", + dinglanyemingzhu_skill_info: + "出牌阶段限一次。你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌。", + feilongduofeng: "飞龙夺凤", + feilongduofeng2: "飞龙夺凤", + feilongduofeng3: "飞龙夺凤", + feilongduofeng_info: + "①当你使用【杀】指定目标后,你可令目标角色弃置一张牌。②当你因使用【杀】而令其他角色进入濒死状态时,你可以获得其一张手牌。", + taipingyaoshu: "太平要术", + taipingyaoshu_info: + "锁定技。①当你即将受到属性伤害时,取消之。②你的手牌上限+X(X为场上势力数-1)。③当你失去装备区里的【太平要术】时,你摸两张牌,然后若你的体力值大于1,你失去1点体力。", + taipingyaoshu_info_guozhan: + "锁定技。①当你即将受到属性伤害时,取消之。②你的手牌上限+X(X为与你势力相同的角色数)。③当你失去装备区里的【太平要术】时,你摸两张牌,然后若你的体力值大于1,你失去1点体力。", + yuxi_skill: "玉玺", + yuxi_skill2: "玉玺", + yuxi: "玉玺", + yuxi_info: + "锁定技。若你有明置的武将牌,则:①你的势力视为唯一的大势力。②摸牌阶段开始时,你令额定摸牌数+1。③出牌阶段开始时,你视为使用【知己知彼】。", + xietianzi: "挟令", + xietianzi_info: + "出牌阶段,对自己使用。你结束出牌阶段。本回合的弃牌阶段结束时,你可以弃置一张手牌,获得一个额外的回合。", + xietianzi_info_guozhan: + "出牌阶段,对身为大势力角色的自己使用。你结束出牌阶段。本回合的弃牌阶段结束时,你可以弃置一张手牌,获得一个额外的回合。", + shuiyanqijunx: "水淹七军", + shuiyanqijunx_info: + "出牌阶段,对一名其他角色使用。目标角色选择一项:⒈弃置装备区里的所有牌(至少一张)。⒉受到你造成的1点雷电伤害。", + shuiyanqijunx_info_guozhan: + "出牌阶段,对一名装备区里有牌的其他角色使用。目标角色选择一项:⒈弃置装备区里的所有牌。⒉受到你造成的1点雷电伤害。", + lulitongxin: "勠力同心", + lulitongxin_info: + "出牌阶段,对所有大势力角色或所有小势力角色使用。若目标角色:未横置,则其横置;已横置,则其摸一张牌。", + lulitongxin_info_versus: + "出牌阶段,对所有己方角色或所有敌方角色使用。若目标角色:未横置,则其横置;已横置,则其摸一张牌。", + lianjunshengyan: "联军盛宴", + lianjunshengyan_info: + "出牌阶段,对你和你选择的除你的势力外的一个势力的所有角色使用。若目标角色:为你,你选择摸Y张牌并回复X-Y点体力(X为该势力的角色数,Y∈[0,X]);不为你,其摸一张牌,然后重置。", + lianjunshengyan_info_boss: + "出牌阶段,对场上所有角色使用。你摸X张牌(X为存活角色数),其他角色依次选择回复1点体力或摸一张牌。", + chiling: "敕令", + chiling_info: + "①出牌阶段,对所有没有势力的角色使用。目标角色选择一项:1、明置一张武将牌,然后摸一张牌;2、弃置一张装备牌;3、失去1点体力。②当【敕令】因判定或弃置而置入弃牌堆时,系统将之移出游戏并将【诏书】置于牌堆底,然后系统于当前回合结束后视为对所有没有势力的角色使用【敕令】。", + diaohulishan: "调虎离山", + diaohulishan_info: "出牌阶段,对至多两名其他角色使用。目标角色于此回合视为移出游戏。", + huoshaolianying: "火烧连营", + huoshaolianying_bg: "烧", + huoshaolianying_info_guozhan: + "出牌阶段,对你的下家及其队列中的所有角色使用。你对目标角色造成1点火属性伤害。", + huoshaolianying_info: + "出牌阶段,对距离最小的一名横置角色使用(若无横置角色,则改为对距离最小的所有角色使用),你对目标造成1点火属性伤害。", + yuanjiao: "远交近攻", + yuanjiao_info: "出牌阶段,对一名与你势力不同的其他角色使用。其摸一张牌,然后你摸三张牌。", + yuanjiao_info_guozhan: + "出牌阶段,对一名与你势力不同且已确定势力的其他角色使用。其摸一张牌,然后你摸三张牌。", + yuanjiao_bg: "交", + zhibi: "知己知彼", + zhibi_info: + "出牌阶段,对一名有手牌或有暗置武将牌的其他角色使用。你选择一项:⒈观看其手牌。⒉观看其的一张暗置武将牌。", + yiyi: "以逸待劳", + yiyi_info_guozhan: "出牌阶段,对所有己方角色使用。目标角色摸两张牌,然后弃置两张牌。", + yiyi_info_combat: "出牌阶段,对所有己方角色使用。目标角色摸两张牌,然后弃置两张牌。", + yiyi_info: "出牌阶段,对至多三名角色使用。目标角色摸两张牌,然后弃置两张牌。", + yiyi_bg: "逸", + wuliu: "吴六剑", + wuliu_info: "锁定技。与你势力相同的所有其他角色的攻击范围+1。", + sanjian: "三尖两刃刀", + sanjian_info: + "当你因执行【杀】而对A造成伤害后,你可以弃置一张牌并选择一名其他角色B(A至B的距离需为1)。你对B造成1点伤害。", + wuliu_skill: "吴六剑", + sanjian_skill: "三尖两刃刀", + jingfanma_bg: "-马", + jingfanma: "惊帆", + jingfanma_info: "锁定技,你计算与其他角色的距离-1。", + huxinjing_bg: "镜", + huxinjing: "护心镜", + huxinjing_info: + "此牌可对其他角色使用。当你受到伤害时,若伤害值大于1或大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。", + huxinjing_info_guozhan: + "当你受到伤害时,若伤害值大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。", + gz_haolingtianxia: "号令天下", + gz_haolingtianxia_info: + "出牌阶段,对一名体力值不为全场最少的角色使用。所有其他角色依次可以选择一项:①弃置一张牌(魏势力角色无需弃牌),视为对目标角色使用一张【杀】;②弃置目标角色的一张牌(魏势力角色改为获得其一张牌)。", + gz_kefuzhongyuan: "克复中原", + gz_kefuzhongyuan_info: + "出牌阶段,对任意名角色使用。目标角色选择一项:①视为使用一张【杀】(蜀势力角色以此法使用【杀】的伤害值基数+1);②摸一张牌(蜀势力角色改为摸两张牌)。", + gz_guguoanbang: "固国安邦", + gz_guguoanbang_info: + "出牌阶段,对你自己使用。你摸八张牌,然后弃置至少六张手牌。然后若你的势力为吴,则你可以将你以此法弃置的牌交给其他吴势力角色(每名角色至多获得两张牌)。", + gz_wenheluanwu: "文和乱武", + gz_wenheluanwu_info: + "出牌阶段,对所有角色使用。目标角色展示所有手牌,然后你选择一项:①令其弃置两张类型不同的手牌;②你弃置其一张手牌。然后若其为群势力角色且其没有手牌,则其将手牌摸至当前体力值(至多为5)。", + zhaoshu: "诏书", + zhaoshu_skill: "锦囊召唤", + zhaoshu_global: "诏书", + zhaoshu_info: + "
  • 出牌阶段,对你自己使用。你将此牌置于目标的武将牌上。
  • 与你势力相同的角色的出牌阶段限一次,其可以将一张手牌(小势力角色改为至多两张)置于【诏书】上,称为“应”。
  • 出牌阶段限一次,若你的“应”中包含至少四种花色,则你可以发动“锦囊召唤”:将所有“应”置入弃牌堆,然后随机获得一张未加入游戏的势力锦囊牌。", }, - list:[ - ['heart',9,'yuanjiao'], - ['club',3,'zhibi'], - ['club',4,'zhibi'], - ['diamond',4,'yiyi'], - ['heart',11,'yiyi'], - ['diamond',6,'wuliu'], - ['diamond',12,'sanjian'], - ['heart',3,'jingfanma'], - ["spade",4,'shunshou'], - ["spade",12,'guohe'], - ["spade",11,'wuxie'], - ['spade',3,'huoshaolianying','fire'], - ['club',11,'huoshaolianying','fire'], - ['heart',12,'huoshaolianying','fire'], - ['club',2,'huxinjing'], - ['heart',2,'diaohulishan'], - ['diamond',10,'diaohulishan'], - ['heart',1,'lianjunshengyan'], - ['club',3,'chiling'], - ['spade',12,'lulitongxin'], - ['club',10,'lulitongxin'], - ['club',12,'shuiyanqijunx'], - ['heart',13,'shuiyanqijunx'], - ['spade',1,'xietianzi'], - ['diamond',1,'xietianzi'], - ['diamond',4,'xietianzi'], - ['club',1,'yuxi'], + list: [ + ["heart", 9, "yuanjiao"], + ["club", 3, "zhibi"], + ["club", 4, "zhibi"], + ["diamond", 4, "yiyi"], + ["heart", 11, "yiyi"], + ["diamond", 6, "wuliu"], + ["diamond", 12, "sanjian"], + ["heart", 3, "jingfanma"], + ["spade", 4, "shunshou"], + ["spade", 12, "guohe"], + ["spade", 11, "wuxie"], + ["spade", 3, "huoshaolianying", "fire"], + ["club", 11, "huoshaolianying", "fire"], + ["heart", 12, "huoshaolianying", "fire"], + ["club", 2, "huxinjing"], + ["heart", 2, "diaohulishan"], + ["diamond", 10, "diaohulishan"], + ["heart", 1, "lianjunshengyan"], + ["club", 3, "chiling"], + ["spade", 12, "lulitongxin"], + ["club", 10, "lulitongxin"], + ["club", 12, "shuiyanqijunx"], + ["heart", 13, "shuiyanqijunx"], + ["spade", 1, "xietianzi"], + ["diamond", 1, "xietianzi"], + ["diamond", 4, "xietianzi"], + ["club", 1, "yuxi"], ], - } + }; }); diff --git a/card/gwent.js b/card/gwent.js index 351be5068..92d7ac812 100644 --- a/card/gwent.js +++ b/card/gwent.js @@ -1,787 +1,825 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'gwent', - card:{ - gw_dieyi:{ - fullskin:true + name: "gwent", + card: { + gw_dieyi: { + fullskin: true, }, - gw_dieyi_equip1:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip1', - onLose:function(){ + gw_dieyi_equip1: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + type: "equip", + subtype: "equip1", + onLose: function () { lib.skill.gw_dieyi.process(player); }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } + loseDelay: false, + skills: [], + ai: { + equipValue: 0, + }, }, - gw_dieyi_equip2:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip2', - onLose:function(){ + gw_dieyi_equip2: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + type: "equip", + subtype: "equip2", + onLose: function () { lib.skill.gw_dieyi.process(player); }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } + loseDelay: false, + skills: [], + ai: { + equipValue: 0, + }, }, - gw_dieyi_equip3:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip3', - onLose:function(){ + gw_dieyi_equip3: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + type: "equip", + subtype: "equip3", + onLose: function () { lib.skill.gw_dieyi.process(player); }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } + loseDelay: false, + skills: [], + ai: { + equipValue: 0, + }, }, - gw_dieyi_equip4:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip4', - onLose:function(){ + gw_dieyi_equip4: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + type: "equip", + subtype: "equip4", + onLose: function () { lib.skill.gw_dieyi.process(player); }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } + loseDelay: false, + skills: [], + ai: { + equipValue: 0, + }, }, - gw_dieyi_equip5:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip5', - onLose:function(){ + gw_dieyi_equip5: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + type: "equip", + subtype: "equip5", + onLose: function () { lib.skill.gw_dieyi.process(player); }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } + loseDelay: false, + skills: [], + ai: { + equipValue: 0, + }, }, - gw_dieyi_judge:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - enable:true, - type:'delay', - filterTarget:true, - effect:function(){ + gw_dieyi_judge: { + fullskin: true, + vanish: true, + hidden: true, + cardimage: "gw_dieyi", + enable: true, + type: "delay", + filterTarget: true, + effect: function () { lib.skill.gw_dieyi.process(player); }, }, - gw_hudiewu:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.countCards('ej'); + gw_hudiewu: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: function (card, player) { + return game.hasPlayer(function (current) { + return current != player && current.countCards("ej"); }); }, - notarget:true, - contentBefore:function(){ - player.$skill('蝴蝶舞','legend','metal'); + notarget: true, + contentBefore: function () { + player.$skill("蝴蝶舞", "legend", "metal"); game.delay(2); }, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return current.countCards('ej'); - }).sortBySeat(); + content: function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + return current.countCards("ej"); + }) + .sortBySeat(); event.targets.remove(player); - 'step 1' - if(event.targets.length){ - var target=event.targets.shift(); - var ej=target.getCards('ej'); + "step 1"; + if (event.targets.length) { + var target = event.targets.shift(); + var ej = target.getCards("ej"); player.line(target); target.removeEquipTrigger(); - for(var i=0;imax2){ - return get.damageEffect(get.max(enemies,func,'item'),player,player,'fire'); - } - else{ + var max2 = get.max(players, func); + if (max1 - 1 > max2) { + return get.damageEffect( + get.max(enemies, func, "item"), + player, + player, + "fire" + ); + } else { var num; - if(max1>max2){ - num=get.sgn(get.damageEffect(get.max(enemies,func,'item'),player,player,'fire')); + if (max1 > max2) { + num = get.sgn( + get.damageEffect( + get.max(enemies, func, "item"), + player, + player, + "fire" + ) + ); + } else if (max1 == max2) { + num = 0; + } else { + num = 1; } - else if(max1==max2){ - num=0; - } - else{ - num=1; - } - return num+game.countPlayer(function(current){ - if(current.hp>=max2){ - return get.sgn(get.damageEffect(current,player,player,'fire')); - } - }); + return ( + num + + game.countPlayer(function (current) { + if (current.hp >= max2) { + return get.sgn(get.damageEffect(current, player, player, "fire")); + } + }) + ); } - } + }, }, - order:0.7, - } + order: 0.7, + }, }, - gw_leizhoushu:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:true, - notarget:true, - contentBefore:function(){ - player.$skill('雷咒术','legend','metal'); + gw_leizhoushu: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: true, + notarget: true, + contentBefore: function () { + player.$skill("雷咒术", "legend", "metal"); game.delay(2); }, - content:function(){ - if(player.hasSkill('gw_leizhoushu')){ - if(typeof player.storage.gw_leizhoushu!='number'){ - player.storage.gw_leizhoushu=2; - } - else{ + content: function () { + if (player.hasSkill("gw_leizhoushu")) { + if (typeof player.storage.gw_leizhoushu != "number") { + player.storage.gw_leizhoushu = 2; + } else { player.storage.gw_leizhoushu++; } - player.syncStorage('gw_leizhoushu'); + player.syncStorage("gw_leizhoushu"); player.updateMarks(); - } - else{ - player.addSkill('gw_leizhoushu'); + } else { + player.addSkill("gw_leizhoushu"); } }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + contentAfter: function () { + var evt = _status.event.getParent("phaseUse"); + if (evt && evt.name == "phaseUse") { + evt.skipped = true; } }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:function(player){ - return 1+game.countPlayer(function(current){ - if(current!=player&¤t.isMaxHandcard()){ - return -get.sgn(get.attitude(player,current)); - } - }); - } + ai: { + value: 8, + useful: [6, 1], + result: { + player: function (player) { + return ( + 1 + + game.countPlayer(function (current) { + if (current != player && current.isMaxHandcard()) { + return -get.sgn(get.attitude(player, current)); + } + }) + ); + }, }, - order:0.5, - } - }, - gw_aerdeyin:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - var enemies=player.getEnemies(); - return enemies.length>0; + order: 0.5, }, - notarget:true, - contentBefore:function(){ - player.$skill('阿尔德印','legend','metal'); + }, + gw_aerdeyin: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: function (card, player) { + var enemies = player.getEnemies(); + return enemies.length > 0; + }, + notarget: true, + contentBefore: function () { + player.$skill("阿尔德印", "legend", "metal"); game.delay(2); }, - content:function(){ - 'step 0' - var enemies=player.getEnemies(); - event.list=[enemies.randomGet()]; - 'step 1' - if(event.list.length){ - var target=event.list.shift(); - event.target=target; - player.line(target,'green'); + content: function () { + "step 0"; + var enemies = player.getEnemies(); + event.list = [enemies.randomGet()]; + "step 1"; + if (event.list.length) { + var target = event.list.shift(); + event.target = target; + player.line(target, "green"); target.damage(); - } - else{ + } else { delete event.target; } - 'step 2' - if(event.target){ - if(!event.target.isTurnedOver()){ + "step 2"; + if (event.target) { + if (!event.target.isTurnedOver()) { event.target.turnOver(); - event.target.addSkill('gw_aerdeyin'); + event.target.addSkill("gw_aerdeyin"); } event.goto(1); } - 'step 3' + "step 3"; game.delay(); }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + contentAfter: function () { + var evt = _status.event.getParent("phaseUse"); + if (evt && evt.name == "phaseUse") { + evt.skipped = true; } }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:function(player){ - return game.countPlayer(function(current){ - if(get.distance(player,current,'pure')==1){ - var att=get.sgn(get.attitude(player,current)); - if(current==player.next){ - return -att*1.5; + ai: { + value: 8, + useful: [6, 1], + result: { + player: function (player) { + return game.countPlayer(function (current) { + if (get.distance(player, current, "pure") == 1) { + var att = get.sgn(get.attitude(player, current)); + if (current == player.next) { + return -att * 1.5; } return -att; } }); - } + }, }, - order:0.5, - } + order: 0.5, + }, }, - gw_ansha:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - var enemies=player.getEnemies(); - return game.hasPlayer(function(current){ - return current.hp==1&&enemies.includes(current); + gw_ansha: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: function (card, player) { + var enemies = player.getEnemies(); + return game.hasPlayer(function (current) { + return current.hp == 1 && enemies.includes(current); }); }, - notarget:true, - contentBefore:function(){ - player.$skill('暗杀','legend','metal'); + notarget: true, + contentBefore: function () { + player.$skill("暗杀", "legend", "metal"); game.delay(2); }, - content:function(){ - var enemies=player.getEnemies(); - var list=game.filterPlayer(function(current){ - return current.hp==1&&enemies.includes(current); + content: function () { + var enemies = player.getEnemies(); + var list = game.filterPlayer(function (current) { + return current.hp == 1 && enemies.includes(current); }); - if(list.length){ - var target=list.randomGet(); + if (list.length) { + var target = list.randomGet(); player.line(target); target.die(); } }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + contentAfter: function () { + var evt = _status.event.getParent("phaseUse"); + if (evt && evt.name == "phaseUse") { + evt.skipped = true; } }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:1 + ai: { + value: 8, + useful: [6, 1], + result: { + player: 1, }, - order:0.6, - } + order: 0.6, + }, }, - gw_xinsheng:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ + gw_xinsheng: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: function (card, player) { + return game.hasPlayer(function (current) { return !current.isUnseen(); }); }, - notarget:true, - contentBefore:function(){ - player.$skill('新生','legend','metal'); + notarget: true, + contentBefore: function () { + player.$skill("新生", "legend", "metal"); game.delay(2); }, - content:function(){ - 'step 0' - var target=get.max(game.filterPlayer(function(current){ - return !current.isUnseen(); - },'list').randomSort(),function(current){ - var att=get.attitude(player,current); - if(att<0&¤t.isDamaged()&¤t.hp<=3){ - return -10; - } - var rank=get.rank(current,true); - if(current.maxHp>=3){ - if(current.hp<=1){ - if(att>0) return att*3+2; - return att*3; + content: function () { + "step 0"; + var target = get.max( + game + .filterPlayer(function (current) { + return !current.isUnseen(); + }, "list") + .randomSort(), + function (current) { + var att = get.attitude(player, current); + if (att < 0 && current.isDamaged() && current.hp <= 3) { + return -10; } - else if(current.hp==2){ - if(att>0){ - att*=1.5; - } - else{ - att/=1.5; + var rank = get.rank(current, true); + if (current.maxHp >= 3) { + if (current.hp <= 1) { + if (att > 0) return att * 3 + 2; + return att * 3; + } else if (current.hp == 2) { + if (att > 0) { + att *= 1.5; + } else { + att /= 1.5; + } } } - } - if(rank>=7){ - if(att>0){ - return att/10; + if (rank >= 7) { + if (att > 0) { + return att / 10; + } + return -att / 5; + } else if (rank <= 4) { + if (att < 0) { + return -att / 10; + } + return att; } - return -att/5; - } - else if(rank<=4){ - if(att<0){ - return -att/10; - } - return att; - } - return Math.abs(att/2); - },'item'); - event.aitarget=target; - var list=[]; - for(var i in lib.character){ - if(!lib.filter.characterDisabled(i)&&!lib.filter.characterDisabled2(i)){ + return Math.abs(att / 2); + }, + "item" + ); + event.aitarget = target; + var list = []; + for (var i in lib.character) { + if (!lib.filter.characterDisabled(i) && !lib.filter.characterDisabled2(i)) { list.push(i); } } - var players=game.players.concat(game.dead); - for(var i=0;i0){ - return get.rank(button.link,true); - } - else{ - return -get.rank(button.link,true); + var dialog = ui.create.dialog("选择一张武将牌", "hidden"); + dialog.add([list.randomGets(12), "character"]); + player.chooseButton(dialog, true).ai = function (button) { + if (get.attitude(player, event.aitarget) > 0) { + return get.rank(button.link, true); + } else { + return -get.rank(button.link, true); } }; - 'step 1' - event.nametarget=result.links[0]; - player.chooseTarget(true,'使用'+get.translation(event.nametarget)+'替换一名角色的武将牌',function(card,player,target){ - return !target.isUnseen()&&!target.isMin(); - }).ai=function(target){ - if(target==event.aitarget){ - return 1; + "step 1"; + event.nametarget = result.links[0]; + player.chooseTarget( + true, + "使用" + get.translation(event.nametarget) + "替换一名角色的武将牌", + function (card, player, target) { + return !target.isUnseen() && !target.isMin(); } - else{ + ).ai = function (target) { + if (target == event.aitarget) { + return 1; + } else { return 0; } - } - 'step 2' - var target=result.targets[0]; - var hp=target.hp; - target.reinit(target.name,event.nametarget); - target.hp=Math.min(hp+1,target.maxHp); + }; + "step 2"; + var target = result.targets[0]; + var hp = target.hp; + target.reinit(target.name, event.nametarget); + target.hp = Math.min(hp + 1, target.maxHp); target.update(); - player.line(target,'green'); - 'step 3' + player.line(target, "green"); + "step 3"; game.triggerEnter(target); }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + contentAfter: function () { + var evt = _status.event.getParent("phaseUse"); + if (evt && evt.name == "phaseUse") { + evt.skipped = true; } }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:1 + ai: { + value: 8, + useful: [6, 1], + result: { + player: 1, }, - order:0.5, - } + order: 0.5, + }, }, - gw_niuquzhijing:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ - return current.hp!=player.hp; + gw_niuquzhijing: { + fullborder: "gold", + type: "spell", + subtype: "spell_gold", + vanish: true, + enable: function (card, player) { + return game.hasPlayer(function (current) { + return current.hp != player.hp; }); }, - notarget:true, - contentBefore:function(){ - var list1=game.filterPlayer(function(current){ + notarget: true, + contentBefore: function () { + var list1 = game.filterPlayer(function (current) { return current.isMaxHp(); }); - var list2=game.filterPlayer(function(current){ + var list2 = game.filterPlayer(function (current) { return current.isMinHp(); }); player.line(list1); - for(var i=0;ilist11.length){ + setTimeout(function () { + var list11 = list1.slice(0); + var list22 = list2.slice(0); + while (list22.length > list11.length) { list11.push(list1.randomGet()); } - while(list22.length0; + order: 0.2, }, - content:function(){ - 'step 0' - var cards=target.getCards('h'); - target.lose(cards,ui.special); - target.storage.gw_youer=cards; - target.addSkill('gw_youer'); - 'step 1' + }, + gw_youer: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + enable: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("h") > 0; + }, + content: function () { + "step 0"; + var cards = target.getCards("h"); + target.lose(cards, ui.special); + target.storage.gw_youer = cards; + target.addSkill("gw_youer"); + "step 1"; player.draw(); }, - ai:{ - basic:{ - order:10, - value:7, - useful:[3,1], + ai: { + basic: { + order: 10, + value: 7, + useful: [3, 1], }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('noh')) return 3; - var num=-Math.sqrt(target.countCards('h')); - if(player.hasSha()&&player.canUse('sha',target)){ - num-=2; + result: { + target: function (player, target) { + if (target.hasSkillTag("noh")) return 3; + var num = -Math.sqrt(target.countCards("h")); + if (player.hasSha() && player.canUse("sha", target)) { + num -= 2; } return num; }, }, - } - }, - gw_tongdi:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h'); }, - content:function(){ - 'step 0' - player.gainPlayerCard(target,'h',true,'visible').set('ai',function(button){ + }, + gw_tongdi: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + enable: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("h"); + }, + content: function () { + "step 0"; + player.gainPlayerCard(target, "h", true, "visible").set("ai", function (button) { return get.value(button.link); }); - 'step 1' - target.gain(game.createCard('sha'),'gain2'); + "step 1"; + target.gain(game.createCard("sha"), "gain2"); }, - ai:{ - basic:{ - order:8, - value:9.5, - useful:[5,1], + ai: { + basic: { + order: 8, + value: 9.5, + useful: [5, 1], }, - result:{ - target:function(player,target){ - if(target.getEquip(4)) return -2; + result: { + target: function (player, target) { + if (target.getEquip(4)) return -2; return -1; - } + }, }, - } + }, }, - gw_fuyuan:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - savable:true, - selectTarget:-1, - content:function(){ + gw_fuyuan: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + savable: true, + selectTarget: -1, + content: function () { target.recover(); target.draw(); }, - ai:{ - basic:{ - order:6, - useful:10, - value:[8,6.5,5,4], + ai: { + basic: { + order: 6, + useful: 10, + value: [8, 6.5, 5, 4], }, - result:{ - target:2 + result: { + target: 2, }, - tag:{ - recover:1, - save:1, - } - } + tag: { + recover: 1, + save: 1, + }, + }, }, - gw_zhuoshao:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ + gw_zhuoshao: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + enable: true, + filterTarget: function (card, player, target) { return target.isMaxHp(); }, - cardnature:'fire', - selectTarget:[1,Infinity], - content:function(){ - target.damage('fire'); + cardnature: "fire", + selectTarget: [1, Infinity], + content: function () { + target.damage("fire"); }, - ai:{ - basic:{ - order:8.5, - value:7.5, - useful:[4,1], + ai: { + basic: { + order: 8.5, + value: 7.5, + useful: [4, 1], }, - result:{ - target:-1 + result: { + target: -1, }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1, - } - } + tag: { + damage: 1, + fireDamage: 1, + natureDamage: 1, + }, + }, }, - gw_butianshu:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:true, + gw_butianshu: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + enable: true, + filterTarget: true, // contentBefore:function(){ // player.$skill('卜天术','legend','water'); // game.delay(2); // }, - content:function(){ - 'step 0' - var list=[]; - for(var i in lib.card){ - if(lib.card[i].mode&&lib.card[i].mode.includes(lib.config.mode)==false) continue; - if(lib.card[i].vanish) continue; - if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); + content: function () { + "step 0"; + var list = []; + for (var i in lib.card) { + if (lib.card[i].mode && lib.card[i].mode.includes(lib.config.mode) == false) continue; + if (lib.card[i].vanish) continue; + if (lib.card[i].type == "delay") list.push([cards[0].suit, cards[0].number, i]); } - var dialog=ui.create.dialog('卜天术',[list,'vcard']); - var bing=target.countCards('h')<=1; - player.chooseButton(dialog,true,function(button){ - if(get.effect(target,{name:button.link[2]},player,player)>0){ - if(button.link[2]=='bingliang'){ - if(bing) return 2; + var dialog = ui.create.dialog("卜天术", [list, "vcard"]); + var bing = target.countCards("h") <= 1; + player.chooseButton(dialog, true, function (button) { + if (get.effect(target, { name: button.link[2] }, player, player) > 0) { + if (button.link[2] == "bingliang") { + if (bing) return 2; return 0.7; } - if(button.link[2]=='lebu'){ + if (button.link[2] == "lebu") { return 1; } - if(button.link[2]=='guiyoujie'){ + if (button.link[2] == "guiyoujie") { return 0.5; } - if(button.link[2]=='caomu'){ + if (button.link[2] == "caomu") { return 0.3; } return 0.2; } return 0; - }).filterButton=function(button){ + }).filterButton = function (button) { return !target.hasJudge(button.link[2]); }; - 'step 1' - var card=game.createCard(result.links[0][2]); - event.judgecard=card; + "step 1"; + var card = game.createCard(result.links[0][2]); + event.judgecard = card; target.$draw(card); game.delay(0.7); - 'step 2' + "step 2"; target.addJudge(event.judgecard); }, - ai:{ - value:8, - useful:[5,1], - result:{ - player:function(player,target){ - var eff=0; - for(var i in lib.card){ - if(lib.card[i].type=='delay'){ - var current=get.effect(target,{name:i},player,player); - if(current>eff){ - eff=current; + ai: { + value: 8, + useful: [5, 1], + result: { + player: function (player, target) { + var eff = 0; + for (var i in lib.card) { + if (lib.card[i].type == "delay") { + var current = get.effect(target, { name: i }, player, player); + if (current > eff) { + eff = current; } } } return eff; - } + }, }, - order:6, - } - }, - gw_shizizhaohuan:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ - return target==player; + order: 6, }, - selectTarget:-1, + }, + gw_shizizhaohuan: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + vanish: true, + enable: true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, // contentBefore:function(){ // player.$skill('十字召唤','legend','water'); // game.delay(2); // }, - content:function(){ - var list=[]; - list.push(get.cardPile2('juedou')); - list.push(get.cardPile2('huogong')); - list.push(get.cardPile2('nanman')); - list.push(get.cardPile2('huoshaolianying')); - for(var i=0;i0; + var dialog = ui.create.dialog("自然馈赠", [list, "vcard"]); + var rand = get.rand(); + var aozu = game.hasPlayer(function (current) { + return ( + player.canUse("gw_aozuzhilei", current) && + current.hp <= 3 && + get.effect(current, { name: "gw_aozuzhilei" }, player, player) > 0 + ); }); - var aozu2=game.hasPlayer(function(current){ - return player.canUse('gw_aozuzhilei',current)&¤t.hp<=2&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; + var aozu2 = game.hasPlayer(function (current) { + return ( + player.canUse("gw_aozuzhilei", current) && + current.hp <= 2 && + get.effect(current, { name: "gw_aozuzhilei" }, player, player) > 0 + ); }); - var aozu3=game.hasPlayer(function(current){ - return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; + var aozu3 = game.hasPlayer(function (current) { + return ( + player.canUse("gw_aozuzhilei", current) && + get.effect(current, { name: "gw_aozuzhilei" }, player, player) > 0 + ); }); - var baoxue=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].includes(current.countCards('h'))&&!current.hasSkillTag('noh'); + var baoxue = game.hasPlayer(function (current) { + return ( + player.canUse("gw_baoxueyaoshui", current) && + get.attitude(player, current) < 0 && + [2, 3].includes(current.countCards("h")) && + !current.hasSkillTag("noh") + ); }); - var baoxue2=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].includes(current.countCards('h'))&&!current.hasSkillTag('noh'); + var baoxue2 = game.hasPlayer(function (current) { + return ( + player.canUse("gw_baoxueyaoshui", current) && + get.attitude(player, current) < 0 && + [2].includes(current.countCards("h")) && + !current.hasSkillTag("noh") + ); }); - var baoxue3=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&¤t.countCards('h')>=2&&!current.hasSkillTag('noh'); + var baoxue3 = game.hasPlayer(function (current) { + return ( + player.canUse("gw_baoxueyaoshui", current) && + get.attitude(player, current) < 0 && + current.countCards("h") >= 2 && + !current.hasSkillTag("noh") + ); }); - var nongwu=game.hasPlayer(function(current){ - return get.attitude(player,current)<0&&(get.attitude(player,current.getNext())<0||get.attitude(player,current.getPrevious())<0); + var nongwu = game.hasPlayer(function (current) { + return ( + get.attitude(player, current) < 0 && + (get.attitude(player, current.getNext()) < 0 || + get.attitude(player, current.getPrevious()) < 0) + ); }); - var nongwu2=game.hasPlayer(function(current){ - return get.attitude(player,current)<0&&get.attitude(player,current.getNext())<0&&get.attitude(player,current.getPrevious())<0; + var nongwu2 = game.hasPlayer(function (current) { + return ( + get.attitude(player, current) < 0 && + get.attitude(player, current.getNext()) < 0 && + get.attitude(player, current.getPrevious()) < 0 + ); }); - var yanzi=game.hasPlayer(function(current){ - return get.attitude(player,current)>0&¤t.isMinHandcard(); + var yanzi = game.hasPlayer(function (current) { + return get.attitude(player, current) > 0 && current.isMinHandcard(); }); - player.chooseButton(dialog,true,function(button){ - var name=button.link[2]; - switch(name){ - case 'gw_ciguhanshuang': - if(nongwu2) return 3; - if(nongwu) return 1; + player.chooseButton(dialog, true, function (button) { + var name = button.link[2]; + switch (name) { + case "gw_ciguhanshuang": + if (nongwu2) return 3; + if (nongwu) return 1; return 0; - case 'gw_baoxueyaoshui': - if(baoxue2) return 2; - if(baoxue) return 1.5; - if(baoxue3) return 0.5; + case "gw_baoxueyaoshui": + if (baoxue2) return 2; + if (baoxue) return 1.5; + if (baoxue3) return 0.5; return 0; - case 'gw_aozuzhilei': - if(aozu2) return 2.5; - if(aozu) return 1.2; - if(aozu3) return 0.2; + case "gw_aozuzhilei": + if (aozu2) return 2.5; + if (aozu) return 1.2; + if (aozu3) return 0.2; return 0; - case 'gw_yanziyaoshui': - if(yanzi) return 2; + case "gw_yanziyaoshui": + if (yanzi) return 2; return 0.6; } - if(game.hasPlayer(function(current){ - return player.canUse(name,current)&&get.effect(current,{name:name},player,player)>0; - })){ + if ( + game.hasPlayer(function (current) { + return ( + player.canUse(name, current) && + get.effect(current, { name: name }, player, player) > 0 + ); + }) + ) { return Math.random(); } return 0; - }).filterButton=function(button){ - var name=button.link[2]; - if(!lib.card[name].notarget){ - return game.hasPlayer(function(current){ - return player.canUse(name,current); - }) + }).filterButton = function (button) { + var name = button.link[2]; + if (!lib.card[name].notarget) { + return game.hasPlayer(function (current) { + return player.canUse(name, current); + }); } return true; }; - 'step 1' - player.chooseUseTarget(true,game.createCard(result.links[0][2],get.suit(card),get.number(card))); + "step 1"; + player.chooseUseTarget( + true, + game.createCard(result.links[0][2], get.suit(card), get.number(card)) + ); }, - ai:{ - value:7, - useful:[4,1], - result:{ - player:function(player){ + ai: { + value: 7, + useful: [4, 1], + result: { + player: function (player) { return 1; - } + }, }, - order:7, - } + order: 7, + }, }, - gw_nuhaifengbao:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_nuhaifengbao'); + gw_nuhaifengbao: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_nuhaifengbao"); }, - content:function(){ - target.addSkill('gw_nuhaifengbao'); + content: function () { + target.addSkill("gw_nuhaifengbao"); }, - ai:{ - value:[7,1], - useful:[4,1], - result:{ - target:function(player,target){ - return -2/Math.sqrt(1+target.hp); - } + ai: { + value: [7, 1], + useful: [4, 1], + result: { + target: function (player, target) { + return -2 / Math.sqrt(1 + target.hp); + }, }, - order:1.2, - } + order: 1.2, + }, }, - gw_baishuang:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_ciguhanshuang'); + gw_baishuang: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_ciguhanshuang"); }, - selectTarget:[1,3], - content:function(){ - target.addSkill('gw_ciguhanshuang'); + selectTarget: [1, 3], + content: function () { + target.addSkill("gw_ciguhanshuang"); }, - ai:{ - value:[7.5,1], - useful:[5,1], - result:{ - target:-1 + ai: { + value: [7.5, 1], + useful: [5, 1], + result: { + target: -1, }, - order:1.2, - } + order: 1.2, + }, }, - gw_baobaoshu:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_baobaoshu'); + gw_baobaoshu: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_baobaoshu"); }, - selectTarget:[1,2], - content:function(){ - target.addTempSkill('gw_baobaoshu',{player:'phaseAfter'}); + selectTarget: [1, 2], + content: function () { + target.addTempSkill("gw_baobaoshu", { player: "phaseAfter" }); }, - ai:{ - value:[7.5,1], - useful:[5,1], - result:{ - target:function(player,target){ - return -Math.sqrt(target.countCards('h'))-0.5; - } + ai: { + value: [7.5, 1], + useful: [5, 1], + result: { + target: function (player, target) { + return -Math.sqrt(target.countCards("h")) - 0.5; + }, }, - order:1.2, - } - }, - gw_guaiwuchaoxue:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - usable:1, - updateUsable:'phaseUse', - forceUsable:true, - filterTarget:function(card,player,target){ - return target==player; + order: 1.2, }, - selectTarget:-1, - content:function(){ - var list=get.gainableSkills(function(info,skill){ - return !info.notemp&&info.ai&&info.ai.maixie_hp&&!player.hasSkill(skill); + }, + gw_guaiwuchaoxue: { + fullborder: "silver", + type: "spell", + subtype: "spell_silver", + enable: true, + usable: 1, + updateUsable: "phaseUse", + forceUsable: true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + content: function () { + var list = get.gainableSkills(function (info, skill) { + return !info.notemp && info.ai && info.ai.maixie_hp && !player.hasSkill(skill); }); - list.remove('guixin'); - if(list.length){ - var skill=list.randomGet(); + list.remove("guixin"); + if (list.length) { + var skill = list.randomGet(); player.popup(skill); - player.addTempSkill(skill,{player:'phaseBegin'}); - var enemies=player.getEnemies(); - if(enemies.length){ - var source=enemies.randomGet(); + player.addTempSkill(skill, { player: "phaseBegin" }); + var enemies = player.getEnemies(); + if (enemies.length) { + var source = enemies.randomGet(); source.line(player); source.addExpose(0.1); player.damage(source); @@ -1363,966 +1443,1004 @@ game.import('card', function () { } } }, - ai:{ - value:[8,1], - useful:[3,1], - result:{ - target:function(player,target){ - if(target.hp<=1||target.hujia) return 0; + ai: { + value: [8, 1], + useful: [3, 1], + result: { + target: function (player, target) { + if (target.hp <= 1 || target.hujia) return 0; return 1; - } + }, }, - order:1, - } + order: 1, + }, }, - gw_qinpendayu:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_qinpendayu'); + gw_qinpendayu: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_qinpendayu"); }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); + changeTarget: function (player, targets) { + game.filterPlayer(function (current) { + return get.distance(targets[0], current, "pure") == 1; + }, targets); }, - content:function(){ - target.addSkill('gw_qinpendayu'); + content: function () { + target.addSkill("gw_qinpendayu"); }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - target:function(player,current){ - if(current.hasSkill('gw_qinpendayu')) return 0; - return Math.max(-1,-0.1-0.3*current.needsToDiscard(2)); - } + ai: { + value: [5, 1], + useful: [3, 1], + result: { + target: function (player, current) { + if (current.hasSkill("gw_qinpendayu")) return 0; + return Math.max(-1, -0.1 - 0.3 * current.needsToDiscard(2)); + }, }, - order:1.2, - } + order: 1.2, + }, }, - gw_birinongwu:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_birinongwu'); + gw_birinongwu: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_birinongwu"); }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); + changeTarget: function (player, targets) { + game.filterPlayer(function (current) { + return get.distance(targets[0], current, "pure") == 1; + }, targets); }, - content:function(){ - target.addSkill('gw_birinongwu'); + content: function () { + target.addSkill("gw_birinongwu"); }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - player:function(player,current){ - if(current.hasSkill('gw_birinongwu')) return 0; + ai: { + value: [5, 1], + useful: [3, 1], + result: { + player: function (player, current) { + if (current.hasSkill("gw_birinongwu")) return 0; return -1; - } + }, }, - order:1.2, - } + order: 1.2, + }, }, - gw_ciguhanshuang:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_ciguhanshuang'); + gw_ciguhanshuang: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + filterTarget: function (card, player, target) { + return !target.hasSkill("gw_ciguhanshuang"); }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); + changeTarget: function (player, targets) { + game.filterPlayer(function (current) { + return get.distance(targets[0], current, "pure") == 1; + }, targets); }, - content:function(){ - target.addSkill('gw_ciguhanshuang'); + content: function () { + target.addSkill("gw_ciguhanshuang"); }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - target:function(player,target){ - if(target.hasSkill('gw_ciguhanshuang')) return 0; + ai: { + value: [5, 1], + useful: [3, 1], + result: { + target: function (player, target) { + if (target.hasSkill("gw_ciguhanshuang")) return 0; return -1; - } + }, }, - order:1.2, - } + order: 1.2, + }, }, - gw_baoxueyaoshui:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:true, - content:function(){ - 'step 0' - target.chooseToDiscard('h',2,true).delay=false; - 'step 1' + gw_baoxueyaoshui: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + filterTarget: true, + content: function () { + "step 0"; + target.chooseToDiscard("h", 2, true).delay = false; + "step 1"; target.draw(); }, - ai:{ - value:6, - useful:[3,1], - result:{ - target:function(player,target){ - if(target.hasSkillTag('noh')) return 0.1; - switch(target.countCards('h')){ - case 0:return 0.5; - case 1:return 0; - case 2:return -1.5; - default:return -1; + ai: { + value: 6, + useful: [3, 1], + result: { + target: function (player, target) { + if (target.hasSkillTag("noh")) return 0.1; + switch (target.countCards("h")) { + case 0: + return 0.5; + case 1: + return 0; + case 2: + return -1.5; + default: + return -1; } - } + }, }, - order:8, - tag:{ - loseCard:1, - discard:1, - } - } + order: 8, + tag: { + loseCard: 1, + discard: 1, + }, + }, }, - gw_zhihuanjun:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ + gw_zhihuanjun: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + filterTarget: function (card, player, target) { return target.isDamaged(); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; target.loseMaxHp(true); - 'step 1' - if(target.isDamaged()&&target.countCards('h')=player.hp; + order: 9.5, }, - content:function(){ - 'step 0' - target.damage('thunder'); - 'step 1' - if(target.isIn()){ + }, + gw_aozuzhilei: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + cardnature: "thunder", + filterTarget: function (card, player, target) { + return target.hp >= player.hp; + }, + content: function () { + "step 0"; + target.damage("thunder"); + "step 1"; + if (target.isIn()) { target.draw(); } }, - ai:{ - basic:{ - order:1.8, - value:[5,1], - useful:[4,1], + ai: { + basic: { + order: 1.8, + value: [5, 1], + useful: [4, 1], }, - result:{ - target:-1 + result: { + target: -1, }, - tag:{ - damage:1, - thunderDamage:1, - natureDamage:1, - } - } + tag: { + damage: 1, + thunderDamage: 1, + natureDamage: 1, + }, + }, }, - gw_poxiao:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - notarget:true, - content:function(){ - 'step 0' - var choice=1; - if(game.countPlayer(function(current){ - if(current.countCards('j')||current.hasSkillTag('weather')){ - if(get.attitude(player,current)>0){ - choice=0; + gw_poxiao: { + fullborder: "bronze", + type: "spell", + subtype: "spell_bronze", + enable: true, + notarget: true, + content: function () { + "step 0"; + var choice = 1; + if ( + game.countPlayer(function (current) { + if (current.countCards("j") || current.hasSkillTag("weather")) { + if (get.attitude(player, current) > 0) { + choice = 0; + } + return true; } - return true; - } - })){ - player.chooseControl(function(){ - return choice; - }).set('choiceList',[ - '解除任意名角色的天气效果并移除其判定区内的牌', - '随机获得一张铜卡法术(破晓除外)并展示之' - ]); + }) + ) { + player + .chooseControl(function () { + return choice; + }) + .set("choiceList", [ + "解除任意名角色的天气效果并移除其判定区内的牌", + "随机获得一张铜卡法术(破晓除外)并展示之", + ]); + } else { + event.directfalse = true; } - else{ - event.directfalse=true; - } - 'step 1' - if(!event.directfalse&&result.index==0){ - player.chooseTarget(true,[1,Infinity],'解除任意名角色的天气效果并移除其判定区内的牌',function(card,player,target){ - return target.countCards('j')||target.hasSkillTag('weather'); - }).ai=function(target){ - return get.attitude(player,target); + "step 1"; + if (!event.directfalse && result.index == 0) { + player.chooseTarget( + true, + [1, Infinity], + "解除任意名角色的天气效果并移除其判定区内的牌", + function (card, player, target) { + return target.countCards("j") || target.hasSkillTag("weather"); + } + ).ai = function (target) { + return get.attitude(player, target); }; - } - else{ - var list=get.libCard(function(info,name){ - return name!='gw_poxiao'&&info.subtype=='spell_bronze'; + } else { + var list = get.libCard(function (info, name) { + return name != "gw_poxiao" && info.subtype == "spell_bronze"; }); - if(list.length){ - player.gain(game.createCard(list.randomGet()),'gain2'); - } - else{ + if (list.length) { + player.gain(game.createCard(list.randomGet()), "gain2"); + } else { player.draw(); } event.finish(); } - 'step 2' - event.list=result.targets.slice(0).sortBySeat(); - 'step 3' - if(event.list.length){ - var target=event.list.shift(); - player.line(target,'green'); - var cards=target.getCards('j'); - if(cards.length){ + "step 2"; + event.list = result.targets.slice(0).sortBySeat(); + "step 3"; + if (event.list.length) { + var target = event.list.shift(); + player.line(target, "green"); + var cards = target.getCards("j"); + if (cards.length) { target.discard(cards); } - if(target.hasSkillTag('weather')){ - var skills=target.getSkills(); - for(var i=0;i0){ + if (player.storage.gw_kunenfayin > 0) { player.updateMarks(); - } - else{ - player.removeSkill('gw_kunenfayin'); + } else { + player.removeSkill("gw_kunenfayin"); } }, - } + }, }, - group:'gw_kunenfayin_count', - onremove:true + group: "gw_kunenfayin_count", + onremove: true, }, - gw_baobaoshu:{ - mark:true, - nopop:true, - intro:{ - content:'每使用一张基本牌或锦囊牌,需弃置一张牌' + gw_baobaoshu: { + mark: true, + nopop: true, + intro: { + content: "每使用一张基本牌或锦囊牌,需弃置一张牌", }, - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - if(player.countCards('he')==0) return false; - var type=get.type(event.card,'trick'); - return type=='basic'||type=='trick'; + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + if (player.countCards("he") == 0) return false; + var type = get.type(event.card, "trick"); + return type == "basic" || type == "trick"; }, - content:function(){ - if(!event.isMine()) game.delay(0.5); - player.chooseToDiscard(true,'he'); + content: function () { + if (!event.isMine()) game.delay(0.5); + player.chooseToDiscard(true, "he"); + }, + ai: { + weather: true, + effect: { + player: function (card, player) { + if (!player.needsToDiscard()) return "zeroplayertarget"; + }, + }, }, - ai:{ - weather:true, - effect:{ - player:function(card,player){ - if(!player.needsToDiscard()) return 'zeroplayertarget'; - } - } - } }, - gw_nuhaifengbao:{ - mark:true, - intro:{ - content:'结束阶段随机弃置一张牌(剩余#回合)' + gw_nuhaifengbao: { + mark: true, + intro: { + content: "结束阶段随机弃置一张牌(剩余#回合)", }, - init:function(player){ - player.storage.gw_nuhaifengbao=2; + init: function (player) { + player.storage.gw_nuhaifengbao = 2; }, - trigger:{player:'phaseEnd'}, - forced:true, - nopop:true, - content:function(){ + trigger: { player: "phaseEnd" }, + forced: true, + nopop: true, + content: function () { player.randomDiscard(); player.storage.gw_nuhaifengbao--; - if(player.storage.gw_nuhaifengbao>0){ + if (player.storage.gw_nuhaifengbao > 0) { player.updateMarks(); - } - else{ - player.removeSkill('gw_nuhaifengbao'); + } else { + player.removeSkill("gw_nuhaifengbao"); } }, - onremove:true, - ai:{ - neg:true, - weather:true - } + onremove: true, + ai: { + neg: true, + weather: true, + }, }, - gw_youer:{ - trigger:{global:'phaseEnd',player:'dieBegin'}, - forced:true, - audio:false, - mark:true, - intro:{ - content:'cards' + gw_youer: { + trigger: { global: "phaseEnd", player: "dieBegin" }, + forced: true, + audio: false, + mark: true, + intro: { + content: "cards", }, - content:function(){ - if(player.storage.gw_youer){ - if(trigger.name=='phase'){ + content: function () { + if (player.storage.gw_youer) { + if (trigger.name == "phase") { player.gain(player.storage.gw_youer); - } - else{ - player.$throw(player.storage.gw_youer,1000); - for(var i=0;i0; + filter: function (event) { + return event.num > 0; }, - content:function(){ + content: function () { trigger.num--; - player.removeSkill('gw_ciguhanshuang'); + player.removeSkill("gw_ciguhanshuang"); + }, + ai: { + weather: true, }, - ai:{ - weather:true - } }, - gw_dieyi:{ - init:function(player){ - player.storage.gw_dieyi=1; + gw_dieyi: { + init: function (player) { + player.storage.gw_dieyi = 1; }, - onremove:true, - trigger:{global:'phaseEnd'}, - forced:true, - mark:true, - nopop:true, - process:function(player){ - if(player.hasSkill('gw_dieyi')){ + onremove: true, + trigger: { global: "phaseEnd" }, + forced: true, + mark: true, + nopop: true, + process: function (player) { + if (player.hasSkill("gw_dieyi")) { player.storage.gw_dieyi++; + } else { + player.addSkill("gw_dieyi"); } - else{ - player.addSkill('gw_dieyi'); - } - player.syncStorage('gw_dieyi'); + player.syncStorage("gw_dieyi"); player.updateMarks(); }, - intro:{ - content:'在当前回合的结束阶段,你随机弃置#张牌' + intro: { + content: "在当前回合的结束阶段,你随机弃置#张牌", }, - content:function(){ + content: function () { player.randomDiscard(player.storage.gw_dieyi); - player.removeSkill('gw_dieyi'); - } - }, - gw_leizhoushu:{ - mark:true, - intro:{ - content:function(storage,player){ - if(storage>=2){ - return '锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标(重复'+storage+'次)'; - } - else{ - return '锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标'; - } - } + player.removeSkill("gw_dieyi"); }, - nopop:true, - trigger:{player:'phaseBegin'}, - forced:true, - filter:function(event,player){ - var list=game.filterPlayer(); - for(var i=0;i= 2) { + return ( + "锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标(重复" + + storage + + "次)" + ); + } else { + return "锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标"; + } + }, + }, + nopop: true, + trigger: { player: "phaseBegin" }, + forced: true, + filter: function (event, player) { + var list = game.filterPlayer(); + for (var i = 0; i < list.length; i++) { + if (list[i] != player && list[i].isMaxHandcard()) return true; } return false; }, - content:function(){ - 'step 0' - if(typeof player.storage.gw_leizhoushu=='number'){ - event.num=player.storage.gw_leizhoushu; + content: function () { + "step 0"; + if (typeof player.storage.gw_leizhoushu == "number") { + event.num = player.storage.gw_leizhoushu; + } else { + event.num = 1; } - else{ - event.num=1; - } - 'step 1' - if(event.num){ - var max=0; - var maxp=null; - var list=game.filterPlayer(function(current){ - return current.isMaxHandcard(); - }).sortBySeat(); - var enemies=player.getEnemies(); - for(var i=0;i0&&event.parent.name=='phaseDraw'; }, - content:function(){ - if(!player.storage.spell_gain||Math.max.apply(null,player.storage.spell_gain)<0){ - var tmp=player.storage.spell_gain2; - player.storage.spell_gain=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].randomGets(3); - player.storage.spell_gain2=Math.floor((15-Math.max.apply(null,player.storage.spell_gain))/2); - if(tmp){ - for(var i=0;i<3;i++){ - player.storage.spell_gain[i]+=tmp; + }, + _gainspell: { + trigger: { player: "drawBegin" }, + silent: true, + priority: -11, + filter: function (event, player) { + if (_status.connectMode) return false; + if (!lib.config.cards.includes("gwent")) return false; + if (player.isMin()) return false; + if (game.fixedPile) return false; + return event.num > 0 && event.parent.name == "phaseDraw"; + }, + content: function () { + if (!player.storage.spell_gain || Math.max.apply(null, player.storage.spell_gain) < 0) { + var tmp = player.storage.spell_gain2; + player.storage.spell_gain = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + ].randomGets(3); + player.storage.spell_gain2 = Math.floor( + (15 - Math.max.apply(null, player.storage.spell_gain)) / 2 + ); + if (tmp) { + for (var i = 0; i < 3; i++) { + player.storage.spell_gain[i] += tmp; } } } - for(var i=0;i<3;i++){ - if(player.storage.spell_gain[i]==0){ + for (var i = 0; i < 3; i++) { + if (player.storage.spell_gain[i] == 0) { var list; - if(i==0){ - list=get.libCard(function(info){ - return info.subtype=='spell_gold'; + if (i == 0) { + list = get.libCard(function (info) { + return info.subtype == "spell_gold"; }); - if(get.mode()=='stone'){ - list.remove('gw_aerdeyin'); - list.remove('gw_niuquzhijing'); + if (get.mode() == "stone") { + list.remove("gw_aerdeyin"); + list.remove("gw_niuquzhijing"); + } + } else { + list = get.libCard(function (info) { + return info.subtype == "spell_silver"; + }); + if (get.mode() == "stone") { + list.remove("gw_butianshu"); } } - else{ - list=get.libCard(function(info){ - return info.subtype=='spell_silver'; - }); - if(get.mode()=='stone'){ - list.remove('gw_butianshu'); - } - } - if(list&&list.length){ - ui.cardPile.insertBefore(game.createCard(list.randomGet()),ui.cardPile.firstChild); + if (list && list.length) { + ui.cardPile.insertBefore( + game.createCard(list.randomGet()), + ui.cardPile.firstChild + ); } } player.storage.spell_gain[i]--; } - } - } + }, + }, }, - help:{ - '昆特牌':'
    • 法术为分金、银、铜三类,金卡和银卡不出现在牌堆中
    • '+ - '摸牌阶段有一定概率摸到银卡,在16个摸牌阶段中至少会摸到2张银卡
    • '+ - '摸牌阶段有一定概率摸到金卡,在16个摸牌阶段中至少会摸到1张金卡
    • '+ - '金卡无视调虎离山、潜行等免疫目标的效果
    • '+ - '进行洗牌时金卡、银卡将从弃牌堆中消失,不进入牌堆' + help: { + 昆特牌: + "
      • 法术为分金、银、铜三类,金卡和银卡不出现在牌堆中
      • " + + "摸牌阶段有一定概率摸到银卡,在16个摸牌阶段中至少会摸到2张银卡
      • " + + "摸牌阶段有一定概率摸到金卡,在16个摸牌阶段中至少会摸到1张金卡
      • " + + "金卡无视调虎离山、潜行等免疫目标的效果
      • " + + "进行洗牌时金卡、银卡将从弃牌堆中消失,不进入牌堆", }, - translate:{ - spell:'法术', - spell_gold:'金卡法术', - spell_silver:'银卡法术', - spell_bronze:'铜卡法术', + translate: { + spell: "法术", + spell_gold: "金卡法术", + spell_silver: "银卡法术", + spell_bronze: "铜卡法术", - gw_youlanzhimeng:'幽蓝之梦', - gw_guaiwuchaoxue:'怪物巢穴', - gw_guaiwuchaoxue_info:'出牌阶段限用一次,随机获得一个卖血技能直到下一回合开始;令一名随机敌方角色对你造成1点伤害,然后你回复1点体力。', - gw_baobaoshu:'雹暴术', - gw_baobaoshu_info:'天气牌,出牌阶段对至多两名角色使用,目标每使用一张基本牌或锦囊牌,需弃置一张牌,直到下一回合结束。', - gw_baishuang:'白霜', - gw_baishuang_info:'天气牌,出牌阶段对至多三名角色使用,目标下个摸牌阶段摸牌数-1。', - gw_nuhaifengbao:'怒海风暴', - gw_nuhaifengbao_bg:'海', - gw_nuhaifengbao_info:'天气牌,出牌阶段对一名角色使用,目标在结束阶段随机弃置一张牌,持续2回合。', - gw_ganhan:'干旱', - gw_ganhan_info:'所有角色减少1点体力上限(不触发技能),然后结束出牌阶段。', - gw_huangjiashenpan:'皇家审判', - gw_huangjiashenpan_info:'获得任意一张金卡法术(皇家审判除外),然后结束出牌阶段。', - gw_chongci:'冲刺', - gw_chongci_info:'弃置所有牌并随机获得一张非金法术牌,每弃置一张手牌,便随机获得一张类别相同的牌;每弃置一张装备区内的牌,随机装备一件类别相同的装备;获得潜行直到下一回合开始,然后结束出牌阶段。', - gw_tunshi:'吞噬', - gw_tunshi_info:'随机移除一名敌方角色的一个随机技能,你获得此技能并减少1点体力和体力上限,被移除技能的角色增加1点体力和体力上限,然后结束出牌阶段。', - gw_dieyi:'蝶翼', - gw_dieyi_equip1:'蝶翼·器', - gw_dieyi_equip2:'蝶翼·衣', - gw_dieyi_equip3:'蝶翼·攻', - gw_dieyi_equip4:'蝶翼·防', - gw_dieyi_equip5:'蝶翼·宝', - gw_dieyi_judge:'蝶翼·判', - gw_dieyi_equip1_info:'在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_dieyi_equip2_info:'在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_dieyi_equip3_info:'在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_dieyi_equip4_info:'在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_dieyi_equip5_info:'在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_dieyi_judge_info:'你在判定阶段移去此牌,并获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。', - gw_hudiewu:'蝴蝶舞', - gw_hudiewu_info:'将其他角色在场上的所有牌替换为蝶翼(每当你失去一张蝶翼,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌),然后结束出牌阶段。', - gw_yigeniyin:'伊格尼印', - gw_yigeniyin_info:'对敌方角色中体力值最高的一名随机角色造成1点火焰伤害,然后对场上体力值最高的所有角色各造成1点火焰伤害,然后结束出牌阶段。', - gw_leizhoushu:'雷咒术', - gw_leizhoushu_info:'获得技能雷咒术(在每个准备阶段令全场牌数最多的所有其他角色各随机弃置一张牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标,结算X次,X为本局获得此技能的次数),然后结束出牌阶段。', - gw_aerdeyin:'阿尔德印', - gw_aerdeyin_bg:'印', - gw_aerdeyin_info:'对一名随机敌方角色造成1点伤害,若目标武将牌正面朝上,则将其翻面;新的一轮开始时,若目标武将牌正面朝上,则在当前回合结束后进行一个额外回合,否则将武将牌翻回正面。', - gw_xinsheng:'新生', - gw_xinsheng_info:'选择一名角色,随机观看12张武将牌,选择一张替代其武将牌,并令其增加1点体力,然后结束出牌阶段。', - gw_zhongmozhizhan:'终末之战', - gw_zhongmozhizhan_info:'将所有角色区域内的所有牌置入弃牌堆(不触发技能),然后结束出牌阶段。', - gw_butianshu:'卜天术', - gw_butianshu_info:'出牌阶段对任意角色使用,将任意一张延时锦囊牌置入其判定区。', - gw_zhihuanjun:'致幻菌', - gw_zhihuanjun_info:'出牌阶段对一名已受伤角色使用,令其减少1点体力上限;若该角色仍处于受伤状态且手牌数小于体力上限,则重复此结算。', - gw_niuquzhijing:'纽曲之镜', - gw_niuquzhijing_info:'令全场体力最多的角色减少1点体力和体力上限,体力最少的角色增加1点体力和体力上限(不触发技能),然后结束出牌阶段。', - gw_ansha:'暗杀', - gw_ansha_info:'令一名体力为1的随机敌方角立即死亡,然后结束出牌阶段。', - gw_shizizhaohuan:'十字召唤', - gw_shizizhaohuan_info:'从牌堆中获得一张杀以及决斗、火攻、火烧连营、南蛮入侵四张牌中的随机一张。', - gw_zuihouyuanwang:'最后愿望', - gw_zuihouyuanwang_info:'摸X张牌并弃置X张牌,X为存活角色数。', - gw_zirankuizeng:'自然馈赠', - gw_zirankuizeng_info:'选择任意一张铜卡法术使用。', - gw_poxiao:'破晓', - gw_poxiao_info:'选择一项:解除任意名角色的天气效果并移除其判定区内的牌,或随机获得一张铜卡法术(破晓除外)并展示之。', - gw_zumoshoukao:'阻魔手铐', - gw_zumoshoukao_info:'令一名角色非锁定技失效直到下一回合结束。', - gw_aozuzhilei:'奥祖之雷', - gw_aozuzhilei_info:'对一名体力值不小于你的角色造成1点雷属性伤害,然后该角色摸一张牌。', - gw_zhuoshao:'灼烧', - gw_zhuoshao_info:'对任意名体力值为全场最高的角色使用,造成1点火属性伤害。', - gw_fuyuan:'复原', - gw_fuyuan_info:'对一名濒死状态角色使用,目标回复1点体力并摸一张牌。', - gw_youer:'诱饵', - gw_youer_bg:'饵', - gw_youer_info:'将一名其他角色的所有手牌移出游戏,然后摸一张牌,当前回合结束后该角色将以此法失去的牌收回手牌。', - gw_tongdi:'通敌', - gw_tongdi_info:'观看一名其他角色的手牌并获得其中一张,然后令目标获得一张杀。', - gw_baoxueyaoshui:'暴雪药水', - gw_baoxueyaoshui_info:'令一名角色弃置两张手牌并摸一张牌。', - gw_birinongwu:'蔽日浓雾', - gw_birinongwu_bg:'雾', - gw_birinongwu_info:'天气牌,出牌阶段对一名角色及其相邻角色使用,目标不能使用杀直到下一个出牌阶段结束。', - gw_qinpendayu:'倾盆大雨', - gw_qinpendayu_bg:'雨', - gw_qinpendayu_info:'天气牌,出牌阶段对一名角色及其相邻角色使用,目标手牌上限-1直到下一个弃牌阶段结束。', - gw_ciguhanshuang:'刺骨寒霜', - gw_ciguhanshuang_bg:'霜', - gw_ciguhanshuang_info:'天气牌,出牌阶段对一名角色及其相邻角色使用,目标下个摸牌阶段摸牌数-1。', - gw_wenyi:'瘟疫', - gw_wenyi_info:'令所有体力值为全场最少的角色随机弃置一张手牌;若没有手牌,改为失去1点体力。', - gw_yanziyaoshui:'燕子药水', - gw_yanziyaoshui_info:'令一名角色摸一张牌,若其手牌数为全场最少或之一,改为摸两张。', - gw_shanbengshu:'山崩术', - gw_shanbengshu_info:'出牌阶段对自己使用,随机弃置两件敌方角色场上的装备。', - gw_kunenfayin:'昆恩法印', - gw_kunenfayin_info:'出牌阶段对一名角色使用,目标防止所有非属性伤害,持续X个角色的回合(X为存活角色数且最多为5)。', + gw_youlanzhimeng: "幽蓝之梦", + gw_guaiwuchaoxue: "怪物巢穴", + gw_guaiwuchaoxue_info: + "出牌阶段限用一次,随机获得一个卖血技能直到下一回合开始;令一名随机敌方角色对你造成1点伤害,然后你回复1点体力。", + gw_baobaoshu: "雹暴术", + gw_baobaoshu_info: + "天气牌,出牌阶段对至多两名角色使用,目标每使用一张基本牌或锦囊牌,需弃置一张牌,直到下一回合结束。", + gw_baishuang: "白霜", + gw_baishuang_info: "天气牌,出牌阶段对至多三名角色使用,目标下个摸牌阶段摸牌数-1。", + gw_nuhaifengbao: "怒海风暴", + gw_nuhaifengbao_bg: "海", + gw_nuhaifengbao_info: "天气牌,出牌阶段对一名角色使用,目标在结束阶段随机弃置一张牌,持续2回合。", + gw_ganhan: "干旱", + gw_ganhan_info: "所有角色减少1点体力上限(不触发技能),然后结束出牌阶段。", + gw_huangjiashenpan: "皇家审判", + gw_huangjiashenpan_info: "获得任意一张金卡法术(皇家审判除外),然后结束出牌阶段。", + gw_chongci: "冲刺", + gw_chongci_info: + "弃置所有牌并随机获得一张非金法术牌,每弃置一张手牌,便随机获得一张类别相同的牌;每弃置一张装备区内的牌,随机装备一件类别相同的装备;获得潜行直到下一回合开始,然后结束出牌阶段。", + gw_tunshi: "吞噬", + gw_tunshi_info: + "随机移除一名敌方角色的一个随机技能,你获得此技能并减少1点体力和体力上限,被移除技能的角色增加1点体力和体力上限,然后结束出牌阶段。", + gw_dieyi: "蝶翼", + gw_dieyi_equip1: "蝶翼·器", + gw_dieyi_equip2: "蝶翼·衣", + gw_dieyi_equip3: "蝶翼·攻", + gw_dieyi_equip4: "蝶翼·防", + gw_dieyi_equip5: "蝶翼·宝", + gw_dieyi_judge: "蝶翼·判", + gw_dieyi_equip1_info: + "在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_dieyi_equip2_info: + "在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_dieyi_equip3_info: + "在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_dieyi_equip4_info: + "在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_dieyi_equip5_info: + "在你从装备区中失去此牌后,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_dieyi_judge_info: + "你在判定阶段移去此牌,并获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌。", + gw_hudiewu: "蝴蝶舞", + gw_hudiewu_info: + "将其他角色在场上的所有牌替换为蝶翼(每当你失去一张蝶翼,你获得一枚“蝶翼”标记;在任意角色的结束阶段,你移去所有“蝶翼”标记,并随机弃置等量的牌),然后结束出牌阶段。", + gw_yigeniyin: "伊格尼印", + gw_yigeniyin_info: + "对敌方角色中体力值最高的一名随机角色造成1点火焰伤害,然后对场上体力值最高的所有角色各造成1点火焰伤害,然后结束出牌阶段。", + gw_leizhoushu: "雷咒术", + gw_leizhoushu_info: + "获得技能雷咒术(在每个准备阶段令全场牌数最多的所有其他角色各随机弃置一张牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标,结算X次,X为本局获得此技能的次数),然后结束出牌阶段。", + gw_aerdeyin: "阿尔德印", + gw_aerdeyin_bg: "印", + gw_aerdeyin_info: + "对一名随机敌方角色造成1点伤害,若目标武将牌正面朝上,则将其翻面;新的一轮开始时,若目标武将牌正面朝上,则在当前回合结束后进行一个额外回合,否则将武将牌翻回正面。", + gw_xinsheng: "新生", + gw_xinsheng_info: + "选择一名角色,随机观看12张武将牌,选择一张替代其武将牌,并令其增加1点体力,然后结束出牌阶段。", + gw_zhongmozhizhan: "终末之战", + gw_zhongmozhizhan_info: "将所有角色区域内的所有牌置入弃牌堆(不触发技能),然后结束出牌阶段。", + gw_butianshu: "卜天术", + gw_butianshu_info: "出牌阶段对任意角色使用,将任意一张延时锦囊牌置入其判定区。", + gw_zhihuanjun: "致幻菌", + gw_zhihuanjun_info: + "出牌阶段对一名已受伤角色使用,令其减少1点体力上限;若该角色仍处于受伤状态且手牌数小于体力上限,则重复此结算。", + gw_niuquzhijing: "纽曲之镜", + gw_niuquzhijing_info: + "令全场体力最多的角色减少1点体力和体力上限,体力最少的角色增加1点体力和体力上限(不触发技能),然后结束出牌阶段。", + gw_ansha: "暗杀", + gw_ansha_info: "令一名体力为1的随机敌方角立即死亡,然后结束出牌阶段。", + gw_shizizhaohuan: "十字召唤", + gw_shizizhaohuan_info: "从牌堆中获得一张杀以及决斗、火攻、火烧连营、南蛮入侵四张牌中的随机一张。", + gw_zuihouyuanwang: "最后愿望", + gw_zuihouyuanwang_info: "摸X张牌并弃置X张牌,X为存活角色数。", + gw_zirankuizeng: "自然馈赠", + gw_zirankuizeng_info: "选择任意一张铜卡法术使用。", + gw_poxiao: "破晓", + gw_poxiao_info: + "选择一项:解除任意名角色的天气效果并移除其判定区内的牌,或随机获得一张铜卡法术(破晓除外)并展示之。", + gw_zumoshoukao: "阻魔手铐", + gw_zumoshoukao_info: "令一名角色非锁定技失效直到下一回合结束。", + gw_aozuzhilei: "奥祖之雷", + gw_aozuzhilei_info: "对一名体力值不小于你的角色造成1点雷属性伤害,然后该角色摸一张牌。", + gw_zhuoshao: "灼烧", + gw_zhuoshao_info: "对任意名体力值为全场最高的角色使用,造成1点火属性伤害。", + gw_fuyuan: "复原", + gw_fuyuan_info: "对一名濒死状态角色使用,目标回复1点体力并摸一张牌。", + gw_youer: "诱饵", + gw_youer_bg: "饵", + gw_youer_info: + "将一名其他角色的所有手牌移出游戏,然后摸一张牌,当前回合结束后该角色将以此法失去的牌收回手牌。", + gw_tongdi: "通敌", + gw_tongdi_info: "观看一名其他角色的手牌并获得其中一张,然后令目标获得一张杀。", + gw_baoxueyaoshui: "暴雪药水", + gw_baoxueyaoshui_info: "令一名角色弃置两张手牌并摸一张牌。", + gw_birinongwu: "蔽日浓雾", + gw_birinongwu_bg: "雾", + gw_birinongwu_info: + "天气牌,出牌阶段对一名角色及其相邻角色使用,目标不能使用杀直到下一个出牌阶段结束。", + gw_qinpendayu: "倾盆大雨", + gw_qinpendayu_bg: "雨", + gw_qinpendayu_info: + "天气牌,出牌阶段对一名角色及其相邻角色使用,目标手牌上限-1直到下一个弃牌阶段结束。", + gw_ciguhanshuang: "刺骨寒霜", + gw_ciguhanshuang_bg: "霜", + gw_ciguhanshuang_info: "天气牌,出牌阶段对一名角色及其相邻角色使用,目标下个摸牌阶段摸牌数-1。", + gw_wenyi: "瘟疫", + gw_wenyi_info: "令所有体力值为全场最少的角色随机弃置一张手牌;若没有手牌,改为失去1点体力。", + gw_yanziyaoshui: "燕子药水", + gw_yanziyaoshui_info: "令一名角色摸一张牌,若其手牌数为全场最少或之一,改为摸两张。", + gw_shanbengshu: "山崩术", + gw_shanbengshu_info: "出牌阶段对自己使用,随机弃置两件敌方角色场上的装备。", + gw_kunenfayin: "昆恩法印", + gw_kunenfayin_info: + "出牌阶段对一名角色使用,目标防止所有非属性伤害,持续X个角色的回合(X为存活角色数且最多为5)。", }, - cardType:{ - spell:0.5, - spell_bronze:0.2, - spell_silver:0.3, - spell_gold:0.4 + cardType: { + spell: 0.5, + spell_bronze: 0.2, + spell_silver: 0.3, + spell_gold: 0.4, }, - list:[ - ['club',3,'gw_zhihuanjun'], - ['spade',2,'gw_zhihuanjun'], + list: [ + ["club", 3, "gw_zhihuanjun"], + ["spade", 2, "gw_zhihuanjun"], - ['heart',7,'gw_poxiao'], - ['diamond',4,'gw_poxiao'], + ["heart", 7, "gw_poxiao"], + ["diamond", 4, "gw_poxiao"], - ['spade',9,'gw_aozuzhilei','thunder'], - ['club',7,'gw_aozuzhilei','thunder'], + ["spade", 9, "gw_aozuzhilei", "thunder"], + ["club", 7, "gw_aozuzhilei", "thunder"], - ['club',1,'gw_zumoshoukao'], - ['spade',1,'gw_zumoshoukao'], + ["club", 1, "gw_zumoshoukao"], + ["spade", 1, "gw_zumoshoukao"], - ['diamond',5,'gw_qinpendayu'], - ['club',7,'gw_qinpendayu'], + ["diamond", 5, "gw_qinpendayu"], + ["club", 7, "gw_qinpendayu"], - ['spade',9,'gw_birinongwu'], - ['heart',13,'gw_birinongwu'], + ["spade", 9, "gw_birinongwu"], + ["heart", 13, "gw_birinongwu"], - ['diamond',11,'gw_ciguhanshuang'], - ['club',7,'gw_ciguhanshuang'], + ["diamond", 11, "gw_ciguhanshuang"], + ["club", 7, "gw_ciguhanshuang"], - ['heart',4,'gw_baoxueyaoshui'], - ['spade',8,'gw_baoxueyaoshui'], + ["heart", 4, "gw_baoxueyaoshui"], + ["spade", 8, "gw_baoxueyaoshui"], - ['spade',8,'gw_shanbengshu'], - ['spade',2,'gw_kunenfayin'], - ['club',3,'gw_wenyi'], - ['heart',8,'gw_yanziyaoshui'], + ["spade", 8, "gw_shanbengshu"], + ["spade", 2, "gw_kunenfayin"], + ["club", 3, "gw_wenyi"], + ["heart", 8, "gw_yanziyaoshui"], ], }; }); diff --git a/card/hearth.js b/card/hearth.js index 18d8c7cae..37533bf55 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -1,741 +1,756 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { - return { - name:'hearth', - card:{ - linghunzhihuo:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - content:function(){ - 'step 0' - target.damage('fire'); - 'step 1' - var hs=player.getCards('h'); - if(hs.length){ - player.discard(hs.randomGet()); - } - }, - ai:{ - basic:{ - order:1.8, - value:[6,1], - useful:[4,1], - }, - result:{ - player:function(player,target){ - if(player==target) return -1; - if(player.countCards('h')>=player.hp) return -0.1; - if(player.countCards('h')>1) return -0.5; - return 0; - }, - target:-1 - }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1, - } - } - }, - jihuocard:{ - fullskin:true, - type:'trick', - enable:true, - toself:true, - filterTarget:function(card,player,target){ - return player==target; - }, - selectTarget:-1, - modTarget:true, - content:function(){ - if(_status.currentPhase==target){ - target.addTempSkill('jihuocard2'); - } - target.draw(); - }, - ai:{ - order:10, - result:{ - target:1 - } - } - }, - zhaomingdan:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - return player!=target&&target.countCards('hej')>0; - }, - content:function(){ - 'step 0' - if(target.countCards('hej')){ - var next=player.discardPlayerCard('hej',target,true); - next.visible=true; - next.delay=false; - } - else{ - event.goto(2); - } - 'step 1' - if(result.bool){ - game.delay(0.5); - } - 'step 2' - target.draw(false); - target.$draw(); - game.delay(0.5); - 'step 3' - player.draw(); - }, - ai:{ - order:9.5, - value:6, - useful:3, - result:{ - target:function(player,target){ - if(get.attitude(player,target)>0){ - var js=target.getCards('j'); - if(js.length){ - var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; - if(jj.name=='zhaomingdan') return 3; - if(js.length==1&&get.effect(target,jj,target,player)>=0){ - return 0; - } - return 3; - } - } - var es=target.getCards('e'); - var nh=target.countCards('h'); - var noe=(es.length==0||target.hasSkillTag('noe')); - var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp0; - }, - content:function(){ - "step 0" - if(target.countCards('h')==0){ - event.finish(); - return; - } - var rand=Math.random()<0.5; - target.chooseCard(true).ai=function(card){ - if(rand) return Math.random(); - return get.value(card); - }; - "step 1" - event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards); - event.card2=result.cards[0]; - event.videoId=lib.status.videoId++; - game.addVideo('cardDialog',null,[get.translation(target.name)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]); - game.log(target,'展示了',event.card2); - player.chooseToDiscard(function(card){ - return get.suit(card)==get.suit(_status.event.parent.card2); - },function(card){ - if(get.damageEffect(target,player,player,'thunder')>0){ - return 6-get.value(card,_status.event.player); - } - return -1; - }).prompt=false; - game.delay(2); - "step 2" - if(result.bool){ - target.damage('thunder'); - } - else{ - target.addTempSkill('huogong2'); - } - game.addVideo('cardDialog',null,event.videoId); - event.dialog.close(); - }, - ai:{ - basic:{ - order:4, - value:[3,1], - useful:1, - }, - wuxie:function(target,card,player,current,state){ - if(get.attitude(current,player)>=0&&state>0) return false; - }, - result:{ - player:function(player){ - var nh=player.countCards('h'); - if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard(new lib.element.VCard({name:'shandianjian'}))){ - return -10; - } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='shandianjian') return -10; - if(viewAs&&viewAs.name=='shandianjian') return -10; - } - } - return 0; - }, - target:function(player,target){ - if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; - if(player.countCards('h')<=1) return 0; - if(target==player){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard(new lib.element.VCard({name:'shandianjian'}))){ - return -1.5; - } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='shandianjian') return -1.5; - if(viewAs&&viewAs.name=='shandianjian') return -1.5; - } - return 0; - } - return -1.5; - } - }, - tag:{ - damage:1, - thunderDamage:1, - natureDamage:1, - norepeat:1 - } - } - }, - shihuawuqi:{ - fullskin:true, - type:'basic', - enable:true, - usable:1, - filterTarget:function(card,player,target){ - return player==target; - }, - selectTarget:-1, - content:function(){ - player.addTempSkill('shihuawuqi'); - if(!player.countCards('h','sha')){ - var card=get.cardPile('sha'); - if(card){ - player.gain(card,'gain2'); - } - } - }, - ai:{ - value:4, - useful:2, - order:8, - result:{ - target:function(player,target){ - return target.countCards('h','sha')?0:1; - } - } - } - }, - siwangchanrao:{ - enable:true, - type:'trick', - filterTarget:function(card,player,target){ - return player!=target&&target.countCards('h')>0; - }, - selectTarget:1, - content:function(){ - 'step 0' - var hs=target.getCards('h'); - if(hs.length){ - target.discard(hs.randomGet()); - } - 'step 1' - if(!target.countCards('h')){ - player.draw(); - } - }, - ai:{ - order:9, - value:4, - useful:1, - result:{ - target:-1, - player:function(player,target){ - if(target.countCards('h')==1) return 1; - } - } - } - }, - dunpaigedang:{ - fullskin:true, - enable:true, - type:'trick', - toself:true, - filterTarget:function(card,player,target){ - return player==target; - }, - selectTarget:-1, - modTarget:true, - content:function(){ - 'step 0' - target.changeHujia(); - target.draw(); - 'step 1' - if(target.countCards('he')){ - target.chooseToDiscard('he',true); - } - }, - ai:{ - order:8.5, - value:7, - useful:3, - result:{ - target:1 - } - } - }, - chuansongmen:{ - fullskin:true, - type:'trick', - enable:true, - discard:false, - toself:true, - selectTarget:-1, - filterTarget:function(card,player,target){ - return target==player; - }, - modTarget:true, - // usable:3, - // forceUsable:true, - content:function(){ - 'step 0' - var gained=get.cards()[0]; - target.gain(gained,'gain2'); - if(event.getParent(3).name=='phaseUse'&&_status.currentPhase==target&& - lib.filter.filterCard(gained,target,event.getParent(2))){ - var next=target.chooseToUse(); - next.filterCard=function(card){ - return card==gained; - }; - next.prompt='是否使用'+get.translation(gained)+'?'; - if(cards[0]){ - ui.special.appendChild(cards[0]); - } - else{ - event.finish(); - } - } - else{ - // if(cards[0]){ - // cards[0].discard(); - // } - event.finish(); - } - 'step 1' - if(result.bool&&!target.hasSkill('chuansongmen3')){ - if(target.hasSkill('chuansongmen2')){ - target.addTempSkill('chuansongmen3'); - } - else{ - target.addTempSkill('chuansongmen2'); - } - cards[0].fix(); - target.gain(cards,'gain2'); - } - else{ - cards[0].discard(); - } - }, - ai:{ - order:9.5, - value:7, - useful:3, - result:{ - target:1 - }, - tag:{ - norepeat:1 - } - } - }, - tanshezhiren:{ - fullskin:true, - type:'trick', - enable:true, - // recastable:true, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - modTarget:true, - content:function(){ - 'step 0' - event.current=target; - event.num=game.countPlayer(); - if(event.num%2==0){ - event.num--; - } - 'step 1' - if(event.num){ - var enemies=event.current.getEnemies(); - enemies.remove(player); - for(var i=0;i2) return 1; - return 0; - }, - }, - tag:{ - recover:1 - } - } - }, - shenenshu:{ - fullskin:true, - enable:true, - type:'trick', - selectTarget:-1, - filterTarget:function(card,player,target){ - return target==player; - }, - modTarget:true, - content:function(){ - 'step 0' - var cards=target.getCards('h'); - if(cards.length){ - target.lose(cards)._triggered=null; - } - event.num=1+cards.length; - 'step 1' - var cards=[]; - var list=get.typeCard('basic'); - list.remove('du'); - if(list.length){ - for(var i=0;i=6){ - return 0; - } - } - return 1; - } - } - } - }, - zhiliaobo:{ - fullskin:true, - enable:true, - filterTarget:function(card,player,target){ - return target.hp=0){ - if(target.hasSkillTag('maixie')){ - if(ui.selected.cards.length) return 0; - } - else{ - return 0; - } - } - if(player.hasSkillTag('notricksource')) return 0; - if(target.hasSkillTag('notrick')) return 0; - if(card.name=='tao') return 0; - if(target.hp==1&&card.name=='jiu') return 0; - if(get.type(card)!='basic'){ - return 10-get.value(card); - } - return 8-get.value(card); - }; - "step 1" - if(!result.bool||result.cards.length<2){ - if(result.bool) target.damage(2-result.cards.length,'thunder'); - else target.damage(2,'thunder'); - } - }, - ai:{ - basic:{ - order:7, - useful:[5,1] - }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nothunder')) return 0; - if(player.hasUnknown(2)) return 0; - var nh=target.countCards('he'); - if(target==player) nh--; - if(nh==2) return -2.5; - if(nh==1) return -3; - if(nh==0) return -4; - return -2; - }, - }, - tag:{ - damage:1, - natureDamage:1, - thunderDamage:1, - multitarget:1, - multineg:1, - discard:2, - loseCard:2, - } - } - } - }, - skill:{ - chuansongmen2:{}, - chuansongmen3:{}, - shihuawuqi:{ - mod:{ - attackFrom:function(from,to,distance){ - return distance-1; - } - } - }, - jihuocard2:{ - mod:{ - maxHandcard:function(player,num){ - return num+2; - } - } - } - }, - translate:{ - linghunzhihuo:'灵魂之火', - linghunzhihuo_info:'对一名角色造成1点火焰伤害,然后随机弃置一张手牌。', - shenenshu:'神恩术', - shenenshu_info:'出牌阶段对自己使用,将所有手牌(含此张)替换为基本牌。', - zhiliaobo:'治疗波', - zhiliaobo_info:'出牌阶段对一名受伤角色使用,目标进行一次判定,若结果为红色,则回复1点体力,否则获得1点护甲。', - yuansuhuimie:'元素毁灭', - yuansuhuimie_info:'对所有角色使用,令目标弃置0~2张牌,并受到2-X点雷电伤害,X为其弃置的手牌数。', - xingjiegoutong:'星界沟通', - xingjiegoutong_info:'增加1点体力上限并回复1点体力,弃置你的所有手牌。', - tanshezhiren:'弹射之刃', - tanshezhiren_info:'出牌阶段对自己使用,依次按敌方-友方-敌方-的顺序随机弃置阵营内一名随机角色的一张牌(目标不包含你),共结算X次,X为存活角色数,若X为偶数,改为X-1。', - chuansongmen:'传送门', - chuansongmen_info:'摸一张牌并展示,若发生在出牌阶段,你可以立即使用摸到的牌,若如此做,你将传送门收回手牌(每阶段最多收回2张传送门)。', - dunpaigedang:'盾牌格挡', - dunpaigedang_info:'获得1点护甲值,摸一张牌,然后弃置一张牌。', - siwangchanrao:'死亡缠绕', - siwangchanrao_infox:'弃置一名其他角色的一张手牌,若其此时没有手牌,则你摸一张牌。', - shihuawuqi:'石化武器', - shihuawuqi_infox:'本回合内攻击范围+1;若你手牌中没有杀,则从牌堆中获得一张杀。', - shandianjian:'闪电箭', - shandianjian_info:'目标角色展示一张手牌,然后若你能弃掉一张与所展示牌相同花色的手牌,则对该角色造成1点雷电伤害。', - shijieshu:'视界术', - shijieshu_info:'目标从牌堆或弃牌堆中随机装备两张类别不同的装备牌,然后弃置一张牌。', - zhaomingdan:'照明弹', - zhaomingdan_info:'观看一名其他角色的手牌,并弃置其区域内的一张牌,然后其与你各摸一张牌。', - jihuocard:'激活', - jihuocard_info:'摸一张牌,本回合手牌上限+2。', - }, - list:[ - ['heart',2,'shenenshu'], - ['diamond',12,'shenenshu'], - ['club',7,'zhiliaobo'], - ['spade',1,'zhiliaobo'], - ['spade',13,'yuansuhuimie'], - ['spade',13,'xingjiegoutong'], - ['diamond',2,'tanshezhiren'], - ['diamond',2,'chuansongmen'], - ['heart',2,'chuansongmen'], - ['club',3,'dunpaigedang'], - ['club',3,'shandianjian','thunder'], - ['spade',1,'shandianjian','thunder'], - ['spade',7,'shijieshu'], - ['diamond',5,'zhaomingdan'], - ['heart',10,'zhaomingdan'], - ['diamond',2,'jihuocard'], - ['diamond',1,'linghunzhihuo'], - ], - }; -}); +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { + return { + name: "hearth", + card: { + linghunzhihuo: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + content: function () { + "step 0"; + target.damage("fire"); + "step 1"; + var hs = player.getCards("h"); + if (hs.length) { + player.discard(hs.randomGet()); + } + }, + ai: { + basic: { + order: 1.8, + value: [6, 1], + useful: [4, 1], + }, + result: { + player: function (player, target) { + if (player == target) return -1; + if (player.countCards("h") >= player.hp) return -0.1; + if (player.countCards("h") > 1) return -0.5; + return 0; + }, + target: -1, + }, + tag: { + damage: 1, + fireDamage: 1, + natureDamage: 1, + }, + }, + }, + jihuocard: { + fullskin: true, + type: "trick", + enable: true, + toself: true, + filterTarget: function (card, player, target) { + return player == target; + }, + selectTarget: -1, + modTarget: true, + content: function () { + if (_status.currentPhase == target) { + target.addTempSkill("jihuocard2"); + } + target.draw(); + }, + ai: { + order: 10, + result: { + target: 1, + }, + }, + }, + zhaomingdan: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return player != target && target.countCards("hej") > 0; + }, + content: function () { + "step 0"; + if (target.countCards("hej")) { + var next = player.discardPlayerCard("hej", target, true); + next.visible = true; + next.delay = false; + } else { + event.goto(2); + } + "step 1"; + if (result.bool) { + game.delay(0.5); + } + "step 2"; + target.draw(false); + target.$draw(); + game.delay(0.5); + "step 3"; + player.draw(); + }, + ai: { + order: 9.5, + value: 6, + useful: 3, + result: { + target: function (player, target) { + if (get.attitude(player, target) > 0) { + var js = target.getCards("j"); + if (js.length) { + var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0]; + if (jj.name == "zhaomingdan") return 3; + if (js.length == 1 && get.effect(target, jj, target, player) >= 0) { + return 0; + } + return 3; + } + } + var es = target.getCards("e"); + var nh = target.countCards("h"); + var noe = es.length == 0 || target.hasSkillTag("noe"); + var noe2 = es.length == 1 && es[0].name == "baiyin" && target.hp < target.maxHp; + var noh = nh == 0 || target.hasSkillTag("noh"); + if (noh && noe) return 0; + if (noh && noe2) return 0.01; + if (get.attitude(player, target) <= 0) + return target.countCards("he") ? -1.5 : 1.5; + return 0.1; + }, + }, + }, + }, + shijieshu: { + fullskin: true, + enable: true, + type: "trick", + filterTarget: function (card, player, target) { + return !target.isMin(); + }, + content: function () { + "step 0"; + var cards = []; + var subtype = null; + for (var i = 0; i < 2; i++) { + var card = get.cardPile(function (card) { + if (get.type(card) == "equip") { + if (subtype) { + if (get.subtype(card) == subtype) { + return false; + } + } else { + subtype = get.subtype(card); + } + return true; + } + return false; + }); + if (card) { + ui.special.appendChild(card); + cards.push(card); + } + } + switch (cards.length) { + case 1: { + target.$gain(cards[0]); + game.delay(); + break; + } + case 2: { + target.$gain(cards[0]); + setTimeout(function () { + target.$gain(cards[1]); + }, 250); + game.delay(); + break; + } + } + event.cards = cards; + "step 1"; + if (event.cards.length) { + target.equip(event.cards.shift()); + game.delay(0.5); + if (event.cards.length) { + event.redo(); + } + } + "step 2"; + game.delay(0.5); + "step 3"; + if (target.countCards("he")) { + target.chooseToDiscard("he", true); + } + }, + ai: { + order: 9, + value: 6, + useful: 2, + result: { + target: function (player, target) { + return Math.max(0, 2 - target.countCards("e")); + }, + }, + tag: { + norepeat: 1, + }, + }, + }, + shandianjian: { + fullskin: true, + type: "trick", + enable: true, + cardnature: "thunder", + filterTarget: function (card, player, target) { + if (player != game.me && player.countCards("h") < 2) return false; + return target.countCards("h") > 0; + }, + content: function () { + "step 0"; + if (target.countCards("h") == 0) { + event.finish(); + return; + } + var rand = Math.random() < 0.5; + target.chooseCard(true).ai = function (card) { + if (rand) return Math.random(); + return get.value(card); + }; + "step 1"; + event.dialog = ui.create.dialog( + get.translation(target.name) + "展示的手牌", + result.cards + ); + event.card2 = result.cards[0]; + event.videoId = lib.status.videoId++; + game.addVideo("cardDialog", null, [ + get.translation(target.name) + "展示的手牌", + get.cardsInfo(result.cards), + event.videoId, + ]); + game.log(target, "展示了", event.card2); + player.chooseToDiscard( + function (card) { + return get.suit(card) == get.suit(_status.event.parent.card2); + }, + function (card) { + if (get.damageEffect(target, player, player, "thunder") > 0) { + return 6 - get.value(card, _status.event.player); + } + return -1; + } + ).prompt = false; + game.delay(2); + "step 2"; + if (result.bool) { + target.damage("thunder"); + } else { + target.addTempSkill("huogong2"); + } + game.addVideo("cardDialog", null, event.videoId); + event.dialog.close(); + }, + ai: { + basic: { + order: 4, + value: [3, 1], + useful: 1, + }, + wuxie: function (target, card, player, current, state) { + if (get.attitude(current, player) >= 0 && state > 0) return false; + }, + result: { + player: function (player) { + var nh = player.countCards("h"); + if (nh <= player.hp && nh <= 4 && _status.event.name == "chooseToUse") { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard(new lib.element.VCard({ name: "shandianjian" })) + ) { + return -10; + } + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "shandianjian") return -10; + if (viewAs && viewAs.name == "shandianjian") return -10; + } + } + return 0; + }, + target: function (player, target) { + if (target.hasSkill("huogong2") || target.countCards("h") == 0) return 0; + if (player.countCards("h") <= 1) return 0; + if (target == player) { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard(new lib.element.VCard({ name: "shandianjian" })) + ) { + return -1.5; + } + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "shandianjian") return -1.5; + if (viewAs && viewAs.name == "shandianjian") return -1.5; + } + return 0; + } + return -1.5; + }, + }, + tag: { + damage: 1, + thunderDamage: 1, + natureDamage: 1, + norepeat: 1, + }, + }, + }, + shihuawuqi: { + fullskin: true, + type: "basic", + enable: true, + usable: 1, + filterTarget: function (card, player, target) { + return player == target; + }, + selectTarget: -1, + content: function () { + player.addTempSkill("shihuawuqi"); + if (!player.countCards("h", "sha")) { + var card = get.cardPile("sha"); + if (card) { + player.gain(card, "gain2"); + } + } + }, + ai: { + value: 4, + useful: 2, + order: 8, + result: { + target: function (player, target) { + return target.countCards("h", "sha") ? 0 : 1; + }, + }, + }, + }, + siwangchanrao: { + enable: true, + type: "trick", + filterTarget: function (card, player, target) { + return player != target && target.countCards("h") > 0; + }, + selectTarget: 1, + content: function () { + "step 0"; + var hs = target.getCards("h"); + if (hs.length) { + target.discard(hs.randomGet()); + } + "step 1"; + if (!target.countCards("h")) { + player.draw(); + } + }, + ai: { + order: 9, + value: 4, + useful: 1, + result: { + target: -1, + player: function (player, target) { + if (target.countCards("h") == 1) return 1; + }, + }, + }, + }, + dunpaigedang: { + fullskin: true, + enable: true, + type: "trick", + toself: true, + filterTarget: function (card, player, target) { + return player == target; + }, + selectTarget: -1, + modTarget: true, + content: function () { + "step 0"; + target.changeHujia(); + target.draw(); + "step 1"; + if (target.countCards("he")) { + target.chooseToDiscard("he", true); + } + }, + ai: { + order: 8.5, + value: 7, + useful: 3, + result: { + target: 1, + }, + }, + }, + chuansongmen: { + fullskin: true, + type: "trick", + enable: true, + discard: false, + toself: true, + selectTarget: -1, + filterTarget: function (card, player, target) { + return target == player; + }, + modTarget: true, + // usable:3, + // forceUsable:true, + content: function () { + "step 0"; + var gained = get.cards()[0]; + target.gain(gained, "gain2"); + if ( + event.getParent(3).name == "phaseUse" && + _status.currentPhase == target && + lib.filter.filterCard(gained, target, event.getParent(2)) + ) { + var next = target.chooseToUse(); + next.filterCard = function (card) { + return card == gained; + }; + next.prompt = "是否使用" + get.translation(gained) + "?"; + if (cards[0]) { + ui.special.appendChild(cards[0]); + } else { + event.finish(); + } + } else { + // if(cards[0]){ + // cards[0].discard(); + // } + event.finish(); + } + "step 1"; + if (result.bool && !target.hasSkill("chuansongmen3")) { + if (target.hasSkill("chuansongmen2")) { + target.addTempSkill("chuansongmen3"); + } else { + target.addTempSkill("chuansongmen2"); + } + cards[0].fix(); + target.gain(cards, "gain2"); + } else { + cards[0].discard(); + } + }, + ai: { + order: 9.5, + value: 7, + useful: 3, + result: { + target: 1, + }, + tag: { + norepeat: 1, + }, + }, + }, + tanshezhiren: { + fullskin: true, + type: "trick", + enable: true, + // recastable:true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + modTarget: true, + content: function () { + "step 0"; + event.current = target; + event.num = game.countPlayer(); + if (event.num % 2 == 0) { + event.num--; + } + "step 1"; + if (event.num) { + var enemies = event.current.getEnemies(); + enemies.remove(player); + for (var i = 0; i < enemies.length; i++) { + if (!enemies[i].countCards("h")) { + enemies.splice(i--, 1); + } + } + if (enemies.length) { + var enemy = enemies.randomGet(); + event.current.line(enemy); + enemy.discard(enemy.getCards("h").randomGet()); + event.current = enemy; + event.num--; + event.redo(); + } + } + }, + ai: { + order: 8.5, + wuxie: function () { + return 0; + }, + result: { + player: 1, + }, + tag: { + multineg: 1, + multitarget: 1, + }, + }, + }, + xingjiegoutong: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + modTarget: true, + toself: true, + filterTarget: function (card, player, target) { + return player == target; + }, + content: function () { + target.gainMaxHp(); + target.recover(); + target.discard(target.getCards("h")); + }, + ai: { + basic: { + useful: [1, 1], + value: [1, 1], + }, + order: 1, + result: { + target: function (player, target) { + if (target.countCards("h", "tao")) return 0; + var nh = target.countCards("h"); + if (nh <= 2) return 1; + if (target.hp == 1 && target.maxHp > 2) return 1; + return 0; + }, + }, + tag: { + recover: 1, + }, + }, + }, + shenenshu: { + fullskin: true, + enable: true, + type: "trick", + selectTarget: -1, + filterTarget: function (card, player, target) { + return target == player; + }, + modTarget: true, + content: function () { + "step 0"; + var cards = target.getCards("h"); + if (cards.length) { + target.lose(cards)._triggered = null; + } + event.num = 1 + cards.length; + "step 1"; + var cards = []; + var list = get.typeCard("basic"); + list.remove("du"); + if (list.length) { + for (var i = 0; i < event.num; i++) { + cards.push(game.createCard(list.randomGet())); + } + target.directgain(cards); + } + }, + ai: { + order: 1, + result: { + target: function (player, target) { + var hs = target.getCards("h"); + for (var i = 0; i < hs.length; i++) { + if (get.type(hs[i]) != "basic" && get.useful(hs[i]) >= 6) { + return 0; + } + } + return 1; + }, + }, + }, + }, + zhiliaobo: { + fullskin: true, + enable: true, + filterTarget: function (card, player, target) { + return target.hp < target.maxHp; + }, + type: "trick", + content: function () { + "step 0"; + target.judge(function (card) { + return get.color(card) == "red" ? 1 : 0; + }); + "step 1"; + if (result.bool) { + target.recover(); + } else { + target.changeHujia(); + } + }, + ai: { + order: 4, + value: [7, 3], + useful: [6, 3], + result: { + target: function (player, target) { + var eff = get.recoverEffect(target, player, target); + if (eff <= 0) return 0; + var num = target.maxHp - target.hp; + if (num < 1) return 0; + if (num == 1) return 1; + if (target.hp == 1) return 2.5; + return 2; + }, + }, + tag: { + recover: 1, + }, + }, + }, + yuansuhuimie: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + filterTarget: true, + reverseOrder: true, + content: function () { + "step 0"; + target.chooseToDiscard([1, 2], "he").ai = function (card) { + if (get.damageEffect(target, player, target, "thunder") >= 0) { + if (target.hasSkillTag("maixie")) { + if (ui.selected.cards.length) return 0; + } else { + return 0; + } + } + if (player.hasSkillTag("notricksource")) return 0; + if (target.hasSkillTag("notrick")) return 0; + if (card.name == "tao") return 0; + if (target.hp == 1 && card.name == "jiu") return 0; + if (get.type(card) != "basic") { + return 10 - get.value(card); + } + return 8 - get.value(card); + }; + "step 1"; + if (!result.bool || result.cards.length < 2) { + if (result.bool) target.damage(2 - result.cards.length, "thunder"); + else target.damage(2, "thunder"); + } + }, + ai: { + basic: { + order: 7, + useful: [5, 1], + }, + result: { + target: function (player, target) { + if (target.hasSkillTag("nothunder")) return 0; + if (player.hasUnknown(2)) return 0; + var nh = target.countCards("he"); + if (target == player) nh--; + if (nh == 2) return -2.5; + if (nh == 1) return -3; + if (nh == 0) return -4; + return -2; + }, + }, + tag: { + damage: 1, + natureDamage: 1, + thunderDamage: 1, + multitarget: 1, + multineg: 1, + discard: 2, + loseCard: 2, + }, + }, + }, + }, + skill: { + chuansongmen2: {}, + chuansongmen3: {}, + shihuawuqi: { + mod: { + attackFrom: function (from, to, distance) { + return distance - 1; + }, + }, + }, + jihuocard2: { + mod: { + maxHandcard: function (player, num) { + return num + 2; + }, + }, + }, + }, + translate: { + linghunzhihuo: "灵魂之火", + linghunzhihuo_info: "对一名角色造成1点火焰伤害,然后随机弃置一张手牌。", + shenenshu: "神恩术", + shenenshu_info: "出牌阶段对自己使用,将所有手牌(含此张)替换为基本牌。", + zhiliaobo: "治疗波", + zhiliaobo_info: + "出牌阶段对一名受伤角色使用,目标进行一次判定,若结果为红色,则回复1点体力,否则获得1点护甲。", + yuansuhuimie: "元素毁灭", + yuansuhuimie_info: "对所有角色使用,令目标弃置0~2张牌,并受到2-X点雷电伤害,X为其弃置的手牌数。", + xingjiegoutong: "星界沟通", + xingjiegoutong_info: "增加1点体力上限并回复1点体力,弃置你的所有手牌。", + tanshezhiren: "弹射之刃", + tanshezhiren_info: + "出牌阶段对自己使用,依次按敌方-友方-敌方-的顺序随机弃置阵营内一名随机角色的一张牌(目标不包含你),共结算X次,X为存活角色数,若X为偶数,改为X-1。", + chuansongmen: "传送门", + chuansongmen_info: + "摸一张牌并展示,若发生在出牌阶段,你可以立即使用摸到的牌,若如此做,你将传送门收回手牌(每阶段最多收回2张传送门)。", + dunpaigedang: "盾牌格挡", + dunpaigedang_info: "获得1点护甲值,摸一张牌,然后弃置一张牌。", + siwangchanrao: "死亡缠绕", + siwangchanrao_infox: "弃置一名其他角色的一张手牌,若其此时没有手牌,则你摸一张牌。", + shihuawuqi: "石化武器", + shihuawuqi_infox: "本回合内攻击范围+1;若你手牌中没有杀,则从牌堆中获得一张杀。", + shandianjian: "闪电箭", + shandianjian_info: + "目标角色展示一张手牌,然后若你能弃掉一张与所展示牌相同花色的手牌,则对该角色造成1点雷电伤害。", + shijieshu: "视界术", + shijieshu_info: "目标从牌堆或弃牌堆中随机装备两张类别不同的装备牌,然后弃置一张牌。", + zhaomingdan: "照明弹", + zhaomingdan_info: "观看一名其他角色的手牌,并弃置其区域内的一张牌,然后其与你各摸一张牌。", + jihuocard: "激活", + jihuocard_info: "摸一张牌,本回合手牌上限+2。", + }, + list: [ + ["heart", 2, "shenenshu"], + ["diamond", 12, "shenenshu"], + ["club", 7, "zhiliaobo"], + ["spade", 1, "zhiliaobo"], + ["spade", 13, "yuansuhuimie"], + ["spade", 13, "xingjiegoutong"], + ["diamond", 2, "tanshezhiren"], + ["diamond", 2, "chuansongmen"], + ["heart", 2, "chuansongmen"], + ["club", 3, "dunpaigedang"], + ["club", 3, "shandianjian", "thunder"], + ["spade", 1, "shandianjian", "thunder"], + ["spade", 7, "shijieshu"], + ["diamond", 5, "zhaomingdan"], + ["heart", 10, "zhaomingdan"], + ["diamond", 2, "jihuocard"], + ["diamond", 1, "linghunzhihuo"], + ], + }; +}); diff --git a/card/huanlekapai.js b/card/huanlekapai.js index 212e84865..94360748e 100644 --- a/card/huanlekapai.js +++ b/card/huanlekapai.js @@ -1,290 +1,316 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { - return { - name:'huanlekapai', - connect:true, - card:{ - "monkey":{ - audio:true, - fullskin:true, - type:"equip", - subtype:"equip5", - skills:["monkey"], - ai:{ - basic:{ - equipValue:8, +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { + return { + name: "huanlekapai", + connect: true, + card: { + monkey: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["monkey"], + ai: { + basic: { + equipValue: 8, }, }, }, - "mianju":{ - audio:true, - fullskin:true, - type:"equip", - subtype:"equip2", - skills:["mianju"], - ai:{ - order:9.5, - basic:{ - equipValue:function (card,player){ - if(!player.isTurnedOver()) return 6; - if(player.isTurnedOver()) return -10; + mianju: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["mianju"], + ai: { + order: 9.5, + basic: { + equipValue: function (card, player) { + if (!player.isTurnedOver()) return 6; + if (player.isTurnedOver()) return -10; return 0; }, }, }, }, - "shoulijian":{ - audio:true, - type:"basic", - enable:true, - fullskin:true, - outrange:{ - global:2, + shoulijian: { + audio: true, + type: "basic", + enable: true, + fullskin: true, + outrange: { + global: 2, }, - filterTarget:lib.filter.notMe, - content:function (){ - "step 0" - if(!target.countCards('he',{type:'equip'})){ + filterTarget: lib.filter.notMe, + content: function () { + "step 0"; + if (!target.countCards("he", { type: "equip" })) { target.damage(); event.finish(); + } else { + target.chooseToDiscard("he", { type: "equip" }, "弃置一张装备牌或受到1点伤害").ai = + function (card) { + var player = _status.event.player; + var source = _status.event.getParent().player; + if (get.damageEffect(player, source, player) > 0) return -1; + return 7 - get.value(card); + }; } - else{ - target.chooseToDiscard('he',{type:'equip'},'弃置一张装备牌或受到1点伤害').ai=function(card){ - var player=_status.event.player; - var source=_status.event.getParent().player; - if(get.damageEffect(player,source,player)>0) return -1; - return 7-get.value(card); - }; - } - "step 1" - if(!result.bool){ + "step 1"; + if (!result.bool) { target.damage(); } }, - ai:{ - basic:{ - order:9, - value:6, - useful:2, + ai: { + basic: { + order: 9, + value: 6, + useful: 2, }, - result:{ - target:-2, + result: { + target: -2, }, - tag:{ - discard:1, - damage:1, + tag: { + discard: 1, + damage: 1, }, }, - selectTarget:1, + selectTarget: 1, }, - "kuwu":{ - audio:true, - fullskin:true, - type:"equip", - subtype:"equip1", - skills:["kuwu"], - nomod:true, - nopower:true, - unique:true, - distance:{ - attackFrom:-1, + kuwu: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + skills: ["kuwu"], + nomod: true, + nopower: true, + unique: true, + distance: { + attackFrom: -1, }, - ai:{ - equipValue:6, + ai: { + equipValue: 6, }, }, - "xuelunyang":{ - audio:true, - fullskin:true, - type:"equip", - subtype:"equip5", - skills:["xuelunyang"], - ai:{ - basic:{ - equipValue:8, + xuelunyang: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["xuelunyang"], + ai: { + basic: { + equipValue: 8, }, }, }, - "jiuwei":{ - audio:true, - fullskin:true, - type:"equip", - subtype:"equip5", - skills:["jiuwei"], - ai:{ - basic:{ - equipValue:8, + jiuwei: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["jiuwei"], + ai: { + basic: { + equipValue: 8, }, }, }, }, - skill:{ - "monkey":{ - trigger:{ - global:"useCardToBegin", + skill: { + monkey: { + trigger: { + global: "useCardToBegin", }, - audio:true, - filter:function (event,player){ - var card=player.getEquip(5); - if(card){ - var name=card.name; - if(name&&name.indexOf('monkey')!=-1&&event.name=='tao'&&event.player!=player&&event.cards.filterInD().length>0) return true; + audio: true, + filter: function (event, player) { + var card = player.getEquip(5); + if (card) { + var name = card.name; + if ( + name && + name.indexOf("monkey") != -1 && + event.name == "tao" && + event.player != player && + event.cards.filterInD().length > 0 + ) + return true; } return false; }, - check:function (event,player){ - return get.attitude(player,event.player)<=0; + check: function (event, player) { + return get.attitude(player, event.player) <= 0; }, - content:function (){ - "step 0" - player.$fullscreenpop('猴子偷桃','fire'); + content: function () { + "step 0"; + player.$fullscreenpop("猴子偷桃", "fire"); trigger.untrigger(); trigger.finish(); - "step 1" + "step 1"; player.discard(player.getEquip(5)); - "step 2" - player.gain(trigger.cards.filterInD(),'gain2','log'); + "step 2"; + player.gain(trigger.cards.filterInD(), "gain2", "log"); }, }, - "mianju":{ - audio:true, - trigger:{ - player:"turnOverBefore", + mianju: { + audio: true, + trigger: { + player: "turnOverBefore", }, - forced:true, - equipSkill:true, - content:function (){ + forced: true, + equipSkill: true, + content: function () { trigger.cancel(); }, - ai:{ - noturnOver:true, - effect:{ - target:function (card,player,target,current){ - if(get.tag(card,'turnOver')) return [0,0]; + ai: { + noturnOver: true, + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "turnOver")) return [0, 0]; }, }, }, }, - "kuwu":{ - audio:true, - trigger:{ - source:"damageSource", + kuwu: { + audio: true, + trigger: { + source: "damageSource", }, - forced:true, - equipSkill:true, - filter:function (event,player){ - if(event._notrigger.includes(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.countCards('he')>0; + forced: true, + equipSkill: true, + filter: function (event, player) { + if (event._notrigger.includes(event.player)) return false; + return ( + event.card && + event.card.name == "sha" && + event.notLink() && + event.player.countCards("he") > 0 + ); }, - content:function (){ - trigger.player.chooseToDiscard(true,'he'); + content: function () { + trigger.player.chooseToDiscard(true, "he"); }, }, - "xuelunyang":{ - audio:true, - trigger:{ - player:"phaseBegin", + xuelunyang: { + audio: true, + trigger: { + player: "phaseBegin", }, - equipSkill:true, - direct:true, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('xuelunyang'),function(card,player,target){ - var names=[]; - if(target.name&&!target.isUnseen(0)) names.add(target.name); - if(target.name1&&!target.isUnseen(0)) names.add(target.name1); - if(target.name2&&!target.isUnseen(1)) names.add(target.name2); - var pss=player.getSkills(); - for(var i=0;i锁定技 你的武将牌不能被翻面。", - "shoulijian":"手里剑", - "shoulijian_info":"出牌阶段,对一名距离1以外的角色使用,令其弃置一张装备牌或受到1点伤害。", - "kuwu":"苦无", - "kuwu_info":"锁定技 每当你使用【杀】造成一次伤害,受伤角色须弃置一张牌。", - "xuelunyang":"写轮眼", - "xuelunyang_info":"回合开始阶段,你可以选择一名角色,然后获得其一项技能,直到回合结束。", - "jiuwei":"九尾", - "jiuwei_info":"(收集查克拉)回合结束时,若你已受伤,你可回复1点体力,否则摸一张牌。", + translate: { + monkey: "猴子", + monkey_info: + "猴子偷桃:当场上有其他角色使用【桃】时,你可以弃掉【猴子】,阻止【桃】的结算并将其收为手牌。", + mianju: "漩涡面具", + mianju_info: "锁定技 你的武将牌不能被翻面。", + shoulijian: "手里剑", + shoulijian_info: "出牌阶段,对一名距离1以外的角色使用,令其弃置一张装备牌或受到1点伤害。", + kuwu: "苦无", + kuwu_info: "锁定技 每当你使用【杀】造成一次伤害,受伤角色须弃置一张牌。", + xuelunyang: "写轮眼", + xuelunyang_info: "回合开始阶段,你可以选择一名角色,然后获得其一项技能,直到回合结束。", + jiuwei: "九尾", + jiuwei_info: "(收集查克拉)回合结束时,若你已受伤,你可回复1点体力,否则摸一张牌。", }, - list:[ - ["diamond","5","monkey"], - ["heart","9","jiuwei"], - ["heart","2","xuelunyang"], - ["spade","6","kuwu"], - ["diamond","4","shoulijian"], - ["spade","4","shoulijian"], - ["club","3","mianju"], + list: [ + ["diamond", "5", "monkey"], + ["heart", "9", "jiuwei"], + ["heart", "2", "xuelunyang"], + ["spade", "6", "kuwu"], + ["diamond", "4", "shoulijian"], + ["spade", "4", "shoulijian"], + ["club", "3", "mianju"], ], - } + }; }); diff --git a/card/mtg.js b/card/mtg.js index f655faf8c..05e2921b8 100644 --- a/card/mtg.js +++ b/card/mtg.js @@ -1,726 +1,768 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { - return { - name:'mtg', - card:{ - mtg_lindixiliu:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_lindixiliu',player); - var card=get.cardPile2(function(card){ - return get.suit(card)=='heart'; - }); - if(card){ - player.gain(card,'draw'); - } - 'step 1' - player.chooseToDiscard('he',[1,Infinity],{suit:'heart'},'林地溪流').set('ai',function(card){ - return 8-get.value(card); - }).set('prompt2','弃置任意张红桃牌,每弃置一张牌,将一张延时锦囊牌置入一名随机敌方角色的判定区'); - 'step 2' - if(result.bool){ - event.num=result.cards.length; - event.targets=player.getEnemies(); - } - 'step 3' - if(event.num&&event.targets&&event.targets.length){ - var target=event.targets.randomGet(); - var list=get.inpile('delay'); - for(var i=0;i0){ - player.useCard({name:name},target); - return; - } - } - } - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:1 - } - } - }, - mtg_haidao:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_haidao',player); - if(player.isHealthy()){ - player.changeHujia(); - event.finish(); - } - else{ - player._temp_mtg_haidao=true; - player.chooseToDiscard('he','海岛').set('ai',function(card){ - return 5-get.value(card); - }).set('prompt2','弃置一张牌并回复1点体力,或取消并获得1点护甲'); - } - 'step 1' - if(result.bool){ - player.recover(); - } - else{ - player.changeHujia(); - } - 'step 2' - delete player._temp_mtg_haidao; - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:1 - } - } - }, - mtg_yixialan:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_yixialan',player); - player.chooseControl('基本牌','锦囊牌').set('prompt','选择一个类型获得该类型的一张牌').set('ai',function(){ - var player=_status.event.player; - if(!player.hasSha()||!player.hasShan()||player.hp==1) return 0; - return 1; - }); - 'step 1' - if(result.control=='基本牌'){ - player.gain(game.createCard(get.inpile('basic').randomGet()),'gain2'); - } - else{ - player.gain(game.createCard(get.inpile('trick','trick').randomGet()),'gain2'); - } - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:1 - } - } - }, - mtg_shuimomuxue:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_shuimomuxue',player); - if(player.countDiscardableCards('he')){ - player.chooseToDiscard('是否弃置一张牌并摸两张牌?','he').set('ai',function(card){ - return 8-get.value(card); - }); - } - else{ - event.finish(); - } - 'step 1' - if(result.bool){ - player.draw(2); - } - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:function(player){ - if(!player.countCards('h',function(card){ - return card.name!='mtg_shuimomuxue'&&get.value(card)<8; - })){ - return 0; - } - return 1; - } - } - } - }, - mtg_feixu:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - game.changeLand('mtg_feixu',player); - player.discoverCard(ui.discardPile.childNodes); - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:1 - } - } - }, - mtg_shamolvzhou:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - game.changeLand('mtg_shamolvzhou',player); - player.discoverCard(get.inpile('basic')); - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:1 - } - } - }, - mtg_duzhao:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_duzhao',player); - player.chooseTarget('选择一名角色令其获得一张毒',true).set('ai',function(target){ - if(target.hasSkillTag('nodu')) return 0; - return -get.attitude(_status.event.player,target)/Math.sqrt(target.hp+1); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - target.gain(game.createCard('du'),'gain2'); - } - }, - ai:{ - value:5, - useful:3, - order:4, - result:{ - player:function(player){ - if(game.countPlayer(function(current){ - if(current.hasSkillTag('nodu')) return false; - return get.attitude(player,current)<0; - })>game.countPlayer(function(current){ - if(current.hasSkillTag('nodu')) return false; - return get.attitude(player,current)>0; - })){ - return 1; - } - return 0; - } - } - } - }, - mtg_bingheyaosai:{ - type:'land', - fullborder:'wood', - enable:function(card,player){ - return !player.hasSkill('land_used'); - }, - notarget:true, - content:function(){ - 'step 0' - game.changeLand('mtg_bingheyaosai',player); - player.draw(2); - 'step 1' - player.chooseToDiscard('he',2,true); - }, - ai:{ - value:5, - useful:3, - order:2, - result:{ - player:1 - } - } - } - }, - skill:{ - mtg_bingheyaosai_skill:{ - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - if(player.countCards('he')==0) return false; - return event.card.name=='sha'; - }, - autodelay:true, - content:function(){ - player.chooseToDiscard(true,'he'); - }, - ai:{ - mapValue:-4 - } - }, - mtg_duzhao_skill:{ - trigger:{player:'phaseEnd'}, - forced:true, - content:function(){ - player.gain(game.createCard('du'),'gain2'); - }, - ai:{ - mapValue:-5 - } - }, - mtg_shamolvzhou_skill:{ - mod:{ - ignoredHandcard:function(card){ - if(get.type(card)=='basic'){ - return true; - } - } - }, - ai:{ - mapValue:3 - } - }, - mtg_haidao_skill:{ - trigger:{player:'changeHujiaBefore'}, - forced:true, - filter:function(event,player){ - return player.isDamaged()&&!player._temp_mtg_haidao&&event.num>0; - }, - content:function(){ - player.recover(trigger.num); - trigger.cancel(); - }, - ai:{ - mapValue:1 - } - }, - mtg_yixialan_skill:{ - enable:'phaseUse', - filter:(event,player)=>player.hasCard(card=>lib.skill.mtg_yixialan_skill.filterCard(card,player),'h'), - filterCard:(card,player)=>get.type(card)=='basic'&&player.canRecast(card), - discard:false, - lose:false, - check:function(card){ - return 7-get.value(card); - }, - usable:1, - content:function(){ - player.recast(cards,null,(player,cards)=>{ - var cardsToGain=[]; - for(var repetition=0;repetitionget.type(card,'trick')=='trick'); - if(card) cardsToGain.push(card); - } - if(cardsToGain.length) player.gain(cardsToGain,'draw'); - if(cards.length-cardsToGain.length) player.draw(cards.length-cardsToGain.length).log=false; - }); - }, - ai:{ - mapValue:2, - order:1, - result:{ - player:1 - } - } - }, - mtg_shuimomuxue_skill:{ - mod:{ - maxHandcard:function(player,num){ - return num-1; - } - }, - trigger:{player:'phaseDiscardEnd'}, - forced:true, - filter:function(event){ - return event.cards&&event.cards.length>0; - }, - content:function(){ - player.draw(); - }, - ai:{ - mapValue:2 - } - }, - mtg_feixu_skill:{ - trigger:{player:'phaseBegin'}, - silent:true, - content:function(){ - var num=ui.discardPile.childNodes.length; - if(num){ - var card=ui.discardPile.childNodes[get.rand(num)]; - if(card){ - ui.cardPile.insertBefore(card,ui.cardPile.firstChild); - } - } - }, - ai:{ - mapValue:0 - } - }, - mtg_youlin_skill:{ - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h',{type:['trick','delay']}); - }, - filterCard:function(card){ - return get.type(card,'trick')=='trick'; - }, - check:function(card){ - return 7-get.value(card); - }, - content:function(){ - player.discoverCard(); - }, - ai:{ - mapValue:1, - order:7, - result:{ - player:2 - } - } - }, - mtg_linzhongjianta_skill:{ - enable:'chooseToUse', - filterCard:function(card){ - return get.type(card)=='basic'; - }, - usable:1, - viewAs:{name:'sha'}, - viewAsFilter:function(player){ - if(!player.getEquip(1)) return false; - if(!player.countCards('h',{type:'basic'})) return false; - }, - prompt:'将一张基本牌当杀使用', - check:function(card){return 6-get.value(card)}, - ai:{ - mapValue:2, - respondSha:true, - order:function(){ - return get.order({name:'sha'})-0.1; - }, - skillTagFilter:function(player,tag,arg){ - if(arg!='use') return false; - if(!player.getEquip(1)) return false; - if(!player.countCards('h',{type:'basic'})) return false; - }, - } - }, - mtg_cangbaohaiwan_skill:{ - trigger:{player:'drawBegin'}, - silent:true, - content:function(){ - if(Math.random()<1/3){ - var list=[]; - for(var i=0;i
      • 地图牌可于出牌阶段使用,每阶段最多使用一张地图牌
      • '+ - '地图牌分为两部分:即时效果以及地图效果,即时效果由使用者在使用时选择;地图效果对所有角色有效
      • '+ - '当使用者死亡或下个回合开始时,当前地图效果消失
      • '+ - '新地图被使用时会覆盖当前地图效果' - }, - list:[ - ['club',12,'mtg_yixialan'], - ['spade',11,'mtg_shuimomuxue'], - ['diamond',5,'mtg_haidao'], - ['club',10,'mtg_youlin'], - ['club',8,'mtg_feixu'], - ['heart',6,'mtg_shamolvzhou'], - - ['club',12,'mtg_cangbaohaiwan'], - ['spade',11,'mtg_lindixiliu'], - ['diamond',5,'mtg_bingheyaosai'], - ['club',10,'mtg_longlushanfeng'], - ['club',8,'mtg_duzhao'], - ['heart',6,'mtg_linzhongjianta'], - ], - }; -}); +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { + return { + name: "mtg", + card: { + mtg_lindixiliu: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_lindixiliu", player); + var card = get.cardPile2(function (card) { + return get.suit(card) == "heart"; + }); + if (card) { + player.gain(card, "draw"); + } + "step 1"; + player + .chooseToDiscard("he", [1, Infinity], { suit: "heart" }, "林地溪流") + .set("ai", function (card) { + return 8 - get.value(card); + }) + .set( + "prompt2", + "弃置任意张红桃牌,每弃置一张牌,将一张延时锦囊牌置入一名随机敌方角色的判定区" + ); + "step 2"; + if (result.bool) { + event.num = result.cards.length; + event.targets = player.getEnemies(); + } + "step 3"; + if (event.num && event.targets && event.targets.length) { + var target = event.targets.randomGet(); + var list = get.inpile("delay"); + for (var i = 0; i < list.length; i++) { + if (target.hasJudge(list[i])) { + list.splice(i--, 1); + } + } + if (list.length) { + player.line(target); + var card = game.createCard(list.randomGet()); + target.addJudge(card); + target.$draw(card); + game.delay(); + event.num--; + } else { + event.targets.remove(target); + } + event.redo(); + } + }, + ai: { + value: 6, + useful: 3, + order: 7, + result: { + player: 1, + }, + }, + }, + mtg_longlushanfeng: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_longlushanfeng", player); + player + .chooseControl("获得杀", "获得闪") + .set("prompt", "选择一项") + .set("ai", function () { + var player = _status.event.player; + if (player.hasShan()) return 0; + return 1; + }); + "step 1"; + if (result.control == "获得杀") { + player.gain(game.createCard("sha"), "gain2"); + } else { + player.gain(game.createCard("shan"), "gain2"); + } + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_cangbaohaiwan: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + if (!lib.cardPack.mode_derivation || !lib.cardPack.mode_derivation.length) return false; + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_cangbaohaiwan", player); + event.map = {}; + var pack1 = []; + var pack2 = []; + for (var i = 0; i < lib.cardPack.mode_derivation.length; i++) { + var name = lib.cardPack.mode_derivation[i]; + var info = lib.card[name]; + if (info.gainable == false || info.destroy) continue; + if (info.derivationpack) { + var trans = lib.translate[info.derivationpack + "_card_config"] + "(卡牌包)"; + if (!event.map[trans]) { + event.map[trans] = []; + pack2.push(trans); + } + event.map[trans].push(name); + } else if (typeof info.derivation == "string") { + for (var j in lib.characterPack) { + if (lib.characterPack[j][info.derivation]) { + var trans = lib.translate[j + "_character_config"] + "(武将包)"; + if (!event.map[trans]) { + event.map[trans] = []; + pack1.push(trans); + } + event.map[trans].push(name); + break; + } + } + } + } + if (!pack1.length && !pack2.length) { + event.finish(); + return; + } + player + .chooseControl(pack1.concat(pack2), "dialogcontrol", function () { + return _status.event.controls.randomGet("轩辕剑(卡牌包)"); + }) + .set("prompt", "选择一个扩展包获得其中一张衍生牌"); + "step 1"; + if (result.control && event.map[result.control]) { + player.gain(game.createCard(event.map[result.control].randomGet()), "draw"); + } + }, + ai: { + value: 7, + useful: 3, + order: 9, + result: { + player: 1, + }, + }, + }, + mtg_linzhongjianta: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_linzhongjianta", player); + player.discoverCard( + function (card) { + return get.subtype(card) == "equip1"; + }, + "nogain", + "选择一个武器装备之" + ); + "step 1"; + if (result.choice) { + player.equip(game.createCard(result.choice), true); + } + }, + ai: { + value: 5, + useful: 3, + order: 9, + result: { + player: function (player) { + if (player.getEquip(1)) return 0; + return 1; + }, + }, + }, + }, + mtg_youlin: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + game.changeLand("mtg_youlin", player); + var list = get.inpile("trick"); + while (list.length) { + var name = list.randomRemove(); + if (lib.card[name].multitarget) continue; + var targets = game.filterPlayer(); + while (targets.length) { + var target = targets.randomRemove(); + if ( + player.canUse(name, target, false) && + get.effect(target, { name: name }, player, player) > 0 + ) { + player.useCard({ name: name }, target); + return; + } + } + } + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_haidao: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_haidao", player); + if (player.isHealthy()) { + player.changeHujia(); + event.finish(); + } else { + player._temp_mtg_haidao = true; + player + .chooseToDiscard("he", "海岛") + .set("ai", function (card) { + return 5 - get.value(card); + }) + .set("prompt2", "弃置一张牌并回复1点体力,或取消并获得1点护甲"); + } + "step 1"; + if (result.bool) { + player.recover(); + } else { + player.changeHujia(); + } + "step 2"; + delete player._temp_mtg_haidao; + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_yixialan: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_yixialan", player); + player + .chooseControl("基本牌", "锦囊牌") + .set("prompt", "选择一个类型获得该类型的一张牌") + .set("ai", function () { + var player = _status.event.player; + if (!player.hasSha() || !player.hasShan() || player.hp == 1) return 0; + return 1; + }); + "step 1"; + if (result.control == "基本牌") { + player.gain(game.createCard(get.inpile("basic").randomGet()), "gain2"); + } else { + player.gain(game.createCard(get.inpile("trick", "trick").randomGet()), "gain2"); + } + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_shuimomuxue: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_shuimomuxue", player); + if (player.countDiscardableCards("he")) { + player.chooseToDiscard("是否弃置一张牌并摸两张牌?", "he").set("ai", function (card) { + return 8 - get.value(card); + }); + } else { + event.finish(); + } + "step 1"; + if (result.bool) { + player.draw(2); + } + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: function (player) { + if ( + !player.countCards("h", function (card) { + return card.name != "mtg_shuimomuxue" && get.value(card) < 8; + }) + ) { + return 0; + } + return 1; + }, + }, + }, + }, + mtg_feixu: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + game.changeLand("mtg_feixu", player); + player.discoverCard(ui.discardPile.childNodes); + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_shamolvzhou: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + game.changeLand("mtg_shamolvzhou", player); + player.discoverCard(get.inpile("basic")); + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: 1, + }, + }, + }, + mtg_duzhao: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_duzhao", player); + player.chooseTarget("选择一名角色令其获得一张毒", true).set("ai", function (target) { + if (target.hasSkillTag("nodu")) return 0; + return -get.attitude(_status.event.player, target) / Math.sqrt(target.hp + 1); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + target.gain(game.createCard("du"), "gain2"); + } + }, + ai: { + value: 5, + useful: 3, + order: 4, + result: { + player: function (player) { + if ( + game.countPlayer(function (current) { + if (current.hasSkillTag("nodu")) return false; + return get.attitude(player, current) < 0; + }) > + game.countPlayer(function (current) { + if (current.hasSkillTag("nodu")) return false; + return get.attitude(player, current) > 0; + }) + ) { + return 1; + } + return 0; + }, + }, + }, + }, + mtg_bingheyaosai: { + type: "land", + fullborder: "wood", + enable: function (card, player) { + return !player.hasSkill("land_used"); + }, + notarget: true, + content: function () { + "step 0"; + game.changeLand("mtg_bingheyaosai", player); + player.draw(2); + "step 1"; + player.chooseToDiscard("he", 2, true); + }, + ai: { + value: 5, + useful: 3, + order: 2, + result: { + player: 1, + }, + }, + }, + }, + skill: { + mtg_bingheyaosai_skill: { + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + if (player.countCards("he") == 0) return false; + return event.card.name == "sha"; + }, + autodelay: true, + content: function () { + player.chooseToDiscard(true, "he"); + }, + ai: { + mapValue: -4, + }, + }, + mtg_duzhao_skill: { + trigger: { player: "phaseEnd" }, + forced: true, + content: function () { + player.gain(game.createCard("du"), "gain2"); + }, + ai: { + mapValue: -5, + }, + }, + mtg_shamolvzhou_skill: { + mod: { + ignoredHandcard: function (card) { + if (get.type(card) == "basic") { + return true; + } + }, + }, + ai: { + mapValue: 3, + }, + }, + mtg_haidao_skill: { + trigger: { player: "changeHujiaBefore" }, + forced: true, + filter: function (event, player) { + return player.isDamaged() && !player._temp_mtg_haidao && event.num > 0; + }, + content: function () { + player.recover(trigger.num); + trigger.cancel(); + }, + ai: { + mapValue: 1, + }, + }, + mtg_yixialan_skill: { + enable: "phaseUse", + filter: (event, player) => + player.hasCard((card) => lib.skill.mtg_yixialan_skill.filterCard(card, player), "h"), + filterCard: (card, player) => get.type(card) == "basic" && player.canRecast(card), + discard: false, + lose: false, + check: function (card) { + return 7 - get.value(card); + }, + usable: 1, + content: function () { + player.recast(cards, null, (player, cards) => { + var cardsToGain = []; + for (var repetition = 0; repetition < cards.length; repetition++) { + var card = get.cardPile((card) => get.type(card, "trick") == "trick"); + if (card) cardsToGain.push(card); + } + if (cardsToGain.length) player.gain(cardsToGain, "draw"); + if (cards.length - cardsToGain.length) + player.draw(cards.length - cardsToGain.length).log = false; + }); + }, + ai: { + mapValue: 2, + order: 1, + result: { + player: 1, + }, + }, + }, + mtg_shuimomuxue_skill: { + mod: { + maxHandcard: function (player, num) { + return num - 1; + }, + }, + trigger: { player: "phaseDiscardEnd" }, + forced: true, + filter: function (event) { + return event.cards && event.cards.length > 0; + }, + content: function () { + player.draw(); + }, + ai: { + mapValue: 2, + }, + }, + mtg_feixu_skill: { + trigger: { player: "phaseBegin" }, + silent: true, + content: function () { + var num = ui.discardPile.childNodes.length; + if (num) { + var card = ui.discardPile.childNodes[get.rand(num)]; + if (card) { + ui.cardPile.insertBefore(card, ui.cardPile.firstChild); + } + } + }, + ai: { + mapValue: 0, + }, + }, + mtg_youlin_skill: { + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.countCards("h", { type: ["trick", "delay"] }); + }, + filterCard: function (card) { + return get.type(card, "trick") == "trick"; + }, + check: function (card) { + return 7 - get.value(card); + }, + content: function () { + player.discoverCard(); + }, + ai: { + mapValue: 1, + order: 7, + result: { + player: 2, + }, + }, + }, + mtg_linzhongjianta_skill: { + enable: "chooseToUse", + filterCard: function (card) { + return get.type(card) == "basic"; + }, + usable: 1, + viewAs: { name: "sha" }, + viewAsFilter: function (player) { + if (!player.getEquip(1)) return false; + if (!player.countCards("h", { type: "basic" })) return false; + }, + prompt: "将一张基本牌当杀使用", + check: function (card) { + return 6 - get.value(card); + }, + ai: { + mapValue: 2, + respondSha: true, + order: function () { + return get.order({ name: "sha" }) - 0.1; + }, + skillTagFilter: function (player, tag, arg) { + if (arg != "use") return false; + if (!player.getEquip(1)) return false; + if (!player.countCards("h", { type: "basic" })) return false; + }, + }, + }, + mtg_cangbaohaiwan_skill: { + trigger: { player: "drawBegin" }, + silent: true, + content: function () { + if (Math.random() < 1 / 3) { + var list = []; + for (var i = 0; i < lib.cardPack.mode_derivation.length; i++) { + var name = lib.cardPack.mode_derivation[i]; + var info = lib.card[name]; + if (info.gainable == false || info.destroy) continue; + list.push(name); + } + if (list.length) { + ui.cardPile.insertBefore( + game.createCard(list.randomGet()), + ui.cardPile.firstChild + ); + } + } + }, + ai: { + mapValue: 5, + }, + }, + mtg_longlushanfeng_skill: { + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + 1; + }, + }, + ai: { + mapValue: 2, + }, + }, + mtg_lindixiliu_skill: { + trigger: { player: "phaseBegin" }, + direct: true, + filter: function (event, player) { + return player.countCards("he", { suit: "heart" }) && player.countCards("j"); + }, + content: function () { + "step 0"; + player + .chooseToDiscard("he", { suit: "heart" }, get.prompt2("mtg_lindixiliu_skill")) + .set("ai", function (card) { + return 8 - get.value(card); + }) + .set("logSkill", "mtg_lindixiliu_skill"); + "step 1"; + if (result.bool) { + player.discardPlayerCard(player, "j", true); + } + }, + ai: { + mapValue: 1.5, + }, + }, + }, + cardType: { + land: 0.6, + }, + translate: { + land: "地图", + mtg_yixialan: "依夏兰", + mtg_yixialan_skill: "依夏兰", + mtg_yixialan_info: + "选项一:随机获得一张基本牌;选项二:随机获得一张锦囊牌。地图效果:出牌阶段限一次,你可以将一张基本牌重铸为锦囊牌。", + mtg_yixialan_skill_info: "出牌阶段限一次,你可以将一张基本牌重铸为锦囊牌。", + mtg_shuimomuxue: "水没墓穴", + mtg_shuimomuxue_skill: "水没墓穴", + mtg_shuimomuxue_info: + "你可以弃置一张牌并摸两张牌。地图效果:锁定技,你的手牌上限-1;若弃牌阶段弃置了至少一张牌,则在此阶段结束时摸一张牌。", + mtg_shuimomuxue_skill_info: + "锁定技,你的手牌上限-1;若弃牌阶段弃置了至少一张牌,则在此阶段结束时摸一张牌。", + mtg_feixu: "废墟", + mtg_feixu_skill: "废墟", + mtg_feixu_info: "从弃牌堆中发现一张牌。地图效果:准备阶段,随机将弃牌堆的一张牌置于牌堆顶。", + mtg_feixu_skill_info: "准备阶段,随机将弃牌堆的一张牌置于牌堆顶。", + mtg_haidao: "海岛", + mtg_haidao_skill: "海岛", + mtg_haidao_info: + "选项一:获得1点护甲(无视地图效果);选项二:弃置一张牌并回复1点体力。地图效果:锁定技,当你获得护甲时,若你已受伤,改为回复等量体力。", + mtg_haidao_skill_info: "锁定技,当你获得护甲时,若你已受伤,改为回复等量体力。", + mtg_youlin: "幽林", + mtg_youlin_skill: "幽林", + mtg_youlin_info: + "随机使用一张普通锦囊牌,随机指定一个具有正收益的目标。地图效果:出牌阶段限一次,你可以弃置一张锦囊牌并发现一张牌。", + mtg_youlin_skill_info: "出牌阶段限一次,你可以弃置一张锦囊牌并发现一张牌。", + mtg_shamolvzhou: "沙漠绿洲", + mtg_shamolvzhou_skill: "沙漠绿洲", + mtg_shamolvzhou_info: "发现一张基本牌。地图效果:你的基本牌不计入手牌上限。", + mtg_shamolvzhou_skill_info: "你的基本牌不计入手牌上限。", + + mtg_duzhao: "毒沼", + mtg_duzhao_skill: "毒沼", + mtg_duzhao_info: "选择一名角色令其获得一张毒。地图效果:结束阶段,你获得一张毒。", + mtg_duzhao_skill_info: "结束阶段,你获得一张毒。", + mtg_linzhongjianta: "林中尖塔", + mtg_linzhongjianta_skill: "林中尖塔", + mtg_linzhongjianta_info: + "发现一张武器牌并装备之。地图效果:若你装备区内有武器牌,你可以将一张基本牌当作杀使用。", + mtg_linzhongjianta_skill_info: "若你装备区内有武器牌,你可以将一张基本牌当作杀使用。", + mtg_cangbaohaiwan: "藏宝海湾", + mtg_cangbaohaiwan_skill: "藏宝海湾", + mtg_cangbaohaiwan_info: + "选择一个扩展包,随机获得来自该扩展包的一张衍生牌。地图效果:你在摸牌时有可能摸到衍生牌。", + mtg_cangbaohaiwan_skill_info: "你在摸牌时有可能摸到衍生牌。", + mtg_longlushanfeng: "龙颅山峰", + mtg_longlushanfeng_skill: "龙颅山峰", + mtg_longlushanfeng_info: "选项一:获得一张杀;选项二:获得一张闪。地图效果:你出杀的次数上限+1。", + mtg_longlushanfeng_skill_info: "你出杀的次数上限+1。", + mtg_bingheyaosai: "冰河要塞", + mtg_bingheyaosai_skill: "冰河要塞", + mtg_bingheyaosai_info: + "摸两张牌,然后弃置两张牌。地图效果:锁定技,每当你使用一张杀,若你有牌,则需弃置一张牌。", + mtg_bingheyaosai_skill_info: "锁定技,每当你使用一张杀,若你有牌,则需弃置一张牌。", + mtg_lindixiliu: "林地溪流", + mtg_lindixiliu_skill: "林地溪流", + mtg_lindixiliu_info: + "从牌堆中摸一张红桃牌,然后弃置任意张红桃牌,每弃置一张牌,将一张延时锦囊牌置入一名随机敌方角色的判定区。地图效果:准备阶段,你可以弃置一张红桃牌,然后弃置判定区内的一张牌。", + mtg_lindixiliu_skill_info: "准备阶段,你可以弃置一张红桃牌,然后弃置判定区内的一张牌。", + }, + help: { + 万智牌: + "
        • 地图牌可于出牌阶段使用,每阶段最多使用一张地图牌
        • " + + "地图牌分为两部分:即时效果以及地图效果,即时效果由使用者在使用时选择;地图效果对所有角色有效
        • " + + "当使用者死亡或下个回合开始时,当前地图效果消失
        • " + + "新地图被使用时会覆盖当前地图效果", + }, + list: [ + ["club", 12, "mtg_yixialan"], + ["spade", 11, "mtg_shuimomuxue"], + ["diamond", 5, "mtg_haidao"], + ["club", 10, "mtg_youlin"], + ["club", 8, "mtg_feixu"], + ["heart", 6, "mtg_shamolvzhou"], + + ["club", 12, "mtg_cangbaohaiwan"], + ["spade", 11, "mtg_lindixiliu"], + ["diamond", 5, "mtg_bingheyaosai"], + ["club", 10, "mtg_longlushanfeng"], + ["club", 8, "mtg_duzhao"], + ["heart", 6, "mtg_linzhongjianta"], + ], + }; +}); diff --git a/card/sp.js b/card/sp.js index ed5698744..252fb9022 100644 --- a/card/sp.js +++ b/card/sp.js @@ -1,679 +1,718 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'sp', - connect:true, - card:{ - jinchan:{ - audio:true, - fullskin:true, - wuxieable:true, - type:'trick', - notarget:true, - global:['g_jinchan','g_jinchan2'], - content:function(){ - var evt=event.getParent(3)._trigger; - if(evt.jinchan){ - var type=get.type(evt.card,'trick'); - if(type=='basic'||type=='trick'){ + name: "sp", + connect: true, + card: { + jinchan: { + audio: true, + fullskin: true, + wuxieable: true, + type: "trick", + notarget: true, + global: ["g_jinchan", "g_jinchan2"], + content: function () { + var evt = event.getParent(3)._trigger; + if (evt.jinchan) { + var type = get.type(evt.card, "trick"); + if (type == "basic" || type == "trick") { evt.neutralize(); } } player.draw(2); }, - ai:{ - useful:function(){ - var player=_status.event.player; - var nj=player.countCards('h','jinchan'); - var num=player.getHandcardLimit(); - if(nj>=num){ + ai: { + useful: function () { + var player = _status.event.player; + var nj = player.countCards("h", "jinchan"); + var num = player.getHandcardLimit(); + if (nj >= num) { return 10; } - if(nj==num-1){ + if (nj == num - 1) { return 6; } return 1; }, - result:{ - player:1 + result: { + player: 1, }, - value:5 - } + value: 5, + }, }, - qijia:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - if(target==player) return false; - if(target.getEquips(5).length){ - return target.countCards('e')>1; - } - else{ - return target.countCards('e')>0; + qijia: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + if (target == player) return false; + if (target.getEquips(5).length) { + return target.countCards("e") > 1; + } else { + return target.countCards("e") > 0; } }, - content:function(){ - 'step 0' - var e1=[],e2=[]; - var he=target.getCards('he'); - for(var i=0;ie2.length||(target.hp>=3&&Math.random()<0.3)){ - choice=1; + if (e1.length && e2.length) { + var choice = 0; + if (e1.length > e2.length || (target.hp >= 3 && Math.random() < 0.3)) { + choice = 1; } - event.e1=e1; - event.e2=e2; - target.chooseControl(choice).set('choiceList',['弃置'+get.translation(e1),'弃置'+get.translation(e2)]); - } - else{ - if(e1.length){ + event.e1 = e1; + event.e2 = e2; + target + .chooseControl(choice) + .set("choiceList", ["弃置" + get.translation(e1), "弃置" + get.translation(e2)]); + } else { + if (e1.length) { target.discard(e1); - } - else if(e2.length){ + } else if (e2.length) { target.discard(e2); } event.finish(); } - 'step 1' - if(result.index==0){ + "step 1"; + if (result.index == 0) { target.discard(event.e1); - } - else{ + } else { target.discard(event.e2); } }, - ai:{ - order:9.01, - useful:1, - value:5, - result:{ - target:function(player,target){ - var num1=0,num2=0; - for(var i=1;i<=4;i++){ - var card=target.getEquip(i); - if(card){ - if(i==1||i==4){ - num1+=get.equipValue(card); - } - else{ - num2+=get.equipValue(card); + ai: { + order: 9.01, + useful: 1, + value: 5, + result: { + target: function (player, target) { + var num1 = 0, + num2 = 0; + for (var i = 1; i <= 4; i++) { + var card = target.getEquip(i); + if (card) { + if (i == 1 || i == 4) { + num1 += get.equipValue(card); + } else { + num2 += get.equipValue(card); } } } var num; - if(num1==0){ - num=num2; + if (num1 == 0) { + num = num2; + } else if (num2 == 0) { + num = num1; + } else { + num = Math.min(num1, num2); } - else if(num2==0){ - num=num1; - } - else{ - num=Math.min(num1,num2); - } - if(num>0){ - return -0.8-num/10; - } - else{ + if (num > 0) { + return -0.8 - num / 10; + } else { return 0; } - } + }, + }, + tag: { + loseCard: 1, + discard: 1, }, - tag:{ - loseCard:1, - discard:1 - } - } - }, - fulei:{ - audio:true, - fullskin:true, - type:'delay', - cardnature:'thunder', - modTarget:function(card,player,target){ - return lib.filter.judge(card,player,target); }, - enable:function(card,player){ + }, + fulei: { + audio: true, + fullskin: true, + type: "delay", + cardnature: "thunder", + modTarget: function (card, player, target) { + return lib.filter.judge(card, player, target); + }, + enable: function (card, player) { return player.canAddJudge(card); }, - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player==target); + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player == target; }, - selectTarget:[-1,-1], - toself:true, - judge:function(card){ - if(get.suit(card)=='spade') return -6; + selectTarget: [-1, -1], + toself: true, + judge: function (card) { + if (get.suit(card) == "spade") return -6; return 6; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - cardPrompt:function(card){ - var str='出牌阶段,对你使用。你将【浮雷】置入判定区。若判定结果为♠,则目标角色受到X点雷电伤害(X为此牌判定结果为♠的次数)。判定完成后,将此牌移动到下家的判定区里。'; - if(card.storage&&card.storage.fulei) str+=('
          此牌已判定命中过:'+card.storage.fulei+'次'); + cardPrompt: function (card) { + var str = + "出牌阶段,对你使用。你将【浮雷】置入判定区。若判定结果为♠,则目标角色受到X点雷电伤害(X为此牌判定结果为♠的次数)。判定完成后,将此牌移动到下家的判定区里。"; + if (card.storage && card.storage.fulei) + str += + '
          此牌已判定命中过:' + + card.storage.fulei + + "次"; return str; }, - effect:function(){ - 'step 0' - if(result.bool==false){ - var card=cards[0]; - if(card){ - if(!card.storage.fulei){ - card.storage.fulei=1; - } - else{ + effect: function () { + "step 0"; + if (result.bool == false) { + var card = cards[0]; + if (card) { + if (!card.storage.fulei) { + card.storage.fulei = 1; + } else { card.storage.fulei++; } - player.damage(card.storage.fulei,'thunder','nosource'); + player.damage(card.storage.fulei, "thunder", "nosource"); } } - 'step 1' + "step 1"; player.addJudgeNext(card); }, - cancel:function(){ + cancel: function () { player.addJudgeNext(card); }, - ai:{ - basic:{ - order:1, - useful:0, - value:0, + ai: { + basic: { + order: 1, + useful: 0, + value: 0, }, - result:{ - target:function(player,target){ - return lib.card.shandian.ai.result.target(player,target); - } + result: { + target: function (player, target) { + return lib.card.shandian.ai.result.target(player, target); + }, }, - tag:{ - damage:0.25, - natureDamage:0.25, - thunderDamage:0.25, - } - } + tag: { + damage: 0.25, + natureDamage: 0.25, + thunderDamage: 0.25, + }, + }, }, - qibaodao:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip1', - skills:['qibaodao','qibaodao2'], - distance:{attackFrom:-1}, - ai:{ - equipValue:function(card,player){ - if(game.hasPlayer(function(current){ - return player.canUse('sha',current)&¤t.isHealthy()&&get.attitude(player,current)<0; - })){ + qibaodao: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + skills: ["qibaodao", "qibaodao2"], + distance: { attackFrom: -1 }, + ai: { + equipValue: function (card, player) { + if ( + game.hasPlayer(function (current) { + return ( + player.canUse("sha", current) && + current.isHealthy() && + get.attitude(player, current) < 0 + ); + }) + ) { return 5; } return 3; }, - basic:{ - equipValue:5 - } + basic: { + equipValue: 5, + }, }, }, - zhungangshuo:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip1', - skills:['zhungangshuo'], - distance:{attackFrom:-2}, - ai:{ - equipValue:4 + zhungangshuo: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + skills: ["zhungangshuo"], + distance: { attackFrom: -2 }, + ai: { + equipValue: 4, }, }, - lanyinjia:{ - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['lanyinjia','lanyinjia2'], - ai:{ - equipValue:6 - } + lanyinjia: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["lanyinjia", "lanyinjia2"], + ai: { + equipValue: 6, + }, }, - yinyueqiang:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - basic:{ - equipValue:4 - } + yinyueqiang: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + basic: { + equipValue: 4, + }, }, - skills:['yinyueqiang'] + skills: ["yinyueqiang"], }, - shengdong:{ - audio:true, - fullskin:true, - enable:function(){ - return game.countPlayer()>2; + shengdong: { + audio: true, + fullskin: true, + enable: function () { + return game.countPlayer() > 2; }, - recastable:function(){ - return game.countPlayer()<=2; + recastable: function () { + return game.countPlayer() <= 2; }, - singleCard:true, - type:'trick', - complexTarget:true, - multitarget:true, - targetprompt:['给一张牌','得两张牌'], - filterTarget:function(card,player,target){ - return target!==player; + singleCard: true, + type: "trick", + complexTarget: true, + multitarget: true, + targetprompt: ["给一张牌", "得两张牌"], + filterTarget: function (card, player, target) { + return target !== player; }, - filterAddedTarget:function(card,player,target,preTarget){ - return target!==preTarget&&target!==player; + filterAddedTarget: function (card, player, target, preTarget) { + return target !== preTarget && target !== player; }, - content:function(){ - 'step 0' - if(!player.countCards('h')){ + content: function () { + "step 0"; + if (!player.countCards("h")) { event.finish(); + } else { + event.target1 = target; + event.target2 = event.addedTarget; + player.chooseCard("h", "将一张手牌交给" + get.translation(event.target1), true); } - else{ - event.target1=target; - event.target2=event.addedTarget; - player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true); - } - 'step 1' - player.give(result.cards,event.target1); - 'step 2' - if(!event.target1.countCards('h')){ + "step 1"; + player.give(result.cards, event.target1); + "step 2"; + if (!event.target1.countCards("h")) { event.finish(); - } - else{ - var he=event.target1.getCards('he'); - if(he.length<=2){ - event.directresult=he; - } - else{ - event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true); + } else { + var he = event.target1.getCards("he"); + if (he.length <= 2) { + event.directresult = he; + } else { + event.target1.chooseCard( + "he", + "将两张牌交给" + get.translation(event.target2), + 2, + true + ); } } - 'step 3' - if(!event.directresult){ - event.directresult=result.cards; + "step 3"; + if (!event.directresult) { + event.directresult = result.cards; } - event.target1.give(event.directresult,event.target2); + event.target1.give(event.directresult, event.target2); }, - ai:{ - order:2.5, - value:[4,1], - useful:1, - wuxie:function(){ + ai: { + order: 2.5, + value: [4, 1], + useful: 1, + wuxie: function () { return 0; }, - result:{ - target:function(player,target){ - let hs=player.getCards('h'); - if(hs.length<=1||!hs.some(i=>{ - return get.value(i)<5.5; - })) return 0; - let targets=get.copy(ui.selected.targets); - if(_status.event.preTarget) targets.add(_status.event.preTarget); - if(targets.length){ - if(target.hasSkillTag('nogain')) return 0.01; + result: { + target: function (player, target) { + let hs = player.getCards("h"); + if ( + hs.length <= 1 || + !hs.some((i) => { + return get.value(i) < 5.5; + }) + ) + return 0; + let targets = get.copy(ui.selected.targets); + if (_status.event.preTarget) targets.add(_status.event.preTarget); + if (targets.length) { + if (target.hasSkillTag("nogain")) return 0.01; return 2; } - if(!target.countCards('he')) return 0; - if(player.hasFriend()) return -1; + if (!target.countCards("he")) return 0; + if (player.hasFriend()) return -1; return 0; - } - } - } - }, - zengbin:{ - audio:true, - fullskin:true, - enable:true, - type:'trick', - filterTarget:true, - content:function(){ - 'step 0' - target.draw(3); - 'step 1' - if(target.countCards('he',{type:'basic'})1).set('prompt2','弃置一张非基本牌,或取消并弃置两张牌'); - event.more=true; - } - else{ - target.chooseToDiscard('he',2,true).set('ai',get.disvalue2); - } - 'step 2' - if(event.more&&!result.bool){ - target.chooseToDiscard('he',2,true).set('ai',get.disvalue2); - } - }, - ai:{ - order:7, - useful:4, - value:10, - tag:{ - draw:3, - discard:1 + }, }, - result:{ - target:function(player,target){ - if(target.hasJudge('lebu')) return 0; - return Math.max(1,2-target.countCards('h')/10); - } - } - } - }, - caomu:{ - audio:true, - fullskin:true, - enable:true, - type:'delay', - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player!=target); }, - judge:function(card){ - if(get.suit(card)=='club') return 1; + }, + zengbin: { + audio: true, + fullskin: true, + enable: true, + type: "trick", + filterTarget: true, + content: function () { + "step 0"; + target.draw(3); + "step 1"; + if (target.countCards("he", { type: "basic" }) < target.countCards("he")) { + target + .chooseToDiscard("增兵减灶", "he", function (card) { + return get.type(card) != "basic"; + }) + .set("ai", function (card) { + if (_status.event.goon) return 8 - get.value(card); + return 11 - get.value(card); + }) + .set( + "goon", + target.countCards("h", function (card) { + return get.value(card, target, "raw") < 8; + }) > 1 + ) + .set("prompt2", "弃置一张非基本牌,或取消并弃置两张牌"); + event.more = true; + } else { + target.chooseToDiscard("he", 2, true).set("ai", get.disvalue2); + } + "step 2"; + if (event.more && !result.bool) { + target.chooseToDiscard("he", 2, true).set("ai", get.disvalue2); + } + }, + ai: { + order: 7, + useful: 4, + value: 10, + tag: { + draw: 3, + discard: 1, + }, + result: { + target: function (player, target) { + if (target.hasJudge("lebu")) return 0; + return Math.max(1, 2 - target.countCards("h") / 10); + }, + }, + }, + }, + caomu: { + audio: true, + fullskin: true, + enable: true, + type: "delay", + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player != target; + }, + judge: function (card) { + if (get.suit(card) == "club") return 1; return -3; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - effect:function(){ - if(result.bool==false){ - player.addTempSkill('caomu_skill'); + effect: function () { + if (result.bool == false) { + player.addTempSkill("caomu_skill"); } }, - ai:{ - basic:{ - order:1, - useful:1, - value:4.5, + ai: { + basic: { + order: 1, + useful: 1, + value: 4.5, }, - result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(get.distance(target,current)<=1&¤t!=target){ - var att=get.attitude(player,current); - if(att>3){ + result: { + player: function (player, target) { + return game.countPlayer(function (current) { + if (get.distance(target, current) <= 1 && current != target) { + var att = get.attitude(player, current); + if (att > 3) { return 1.1; - } - else if(att>0){ + } else if (att > 0) { return 1; - } - else if(att<-3){ + } else if (att < -3) { return -1.1; - } - else if(att<0){ + } else if (att < 0) { return -1; } } }); }, - target:function(player,target){ - if(target.hasJudge('bingliang')) return 0; - return -1.5/Math.sqrt(target.countCards('h')+1); - } + target: function (player, target) { + if (target.hasJudge("bingliang")) return 0; + return -1.5 / Math.sqrt(target.countCards("h") + 1); + }, }, - } - } - }, - skill:{ - lanyinjia:{ - equipSkill:true, - enable:['chooseToUse','chooseToRespond'], - filterCard:true, - viewAs:{name:'shan'}, - viewAsFilter:function(player){ - if(!player.countCards('hs')) return false; }, - position:'hs', - prompt:'将一张手牌当闪使用或打出', - check:function(card){ - return 6-get.value(card); - }, - ai:{ - respondShan:true, - skillTagFilter:function(player){ - if(!player.countCards('hs')) return false; - }, - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0&&target.countCards('hs')) return 0.59 - } - }, - order:4, - useful:-0.5, - value:-0.5 - } }, - lanyinjia2:{ - equipSkill:true, - trigger:{player:'damageBegin4'}, - forced:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.getEquips('lanyinjia').length>0; + }, + skill: { + lanyinjia: { + equipSkill: true, + enable: ["chooseToUse", "chooseToRespond"], + filterCard: true, + viewAs: { name: "shan" }, + viewAsFilter: function (player) { + if (!player.countCards("hs")) return false; }, - content:function(){ - var card=player.getEquips('lanyinjia'); - if(card.length){ + position: "hs", + prompt: "将一张手牌当闪使用或打出", + check: function (card) { + return 6 - get.value(card); + }, + ai: { + respondShan: true, + skillTagFilter: function (player) { + if (!player.countCards("hs")) return false; + }, + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "respondShan") && current < 0 && target.countCards("hs")) + return 0.59; + }, + }, + order: 4, + useful: -0.5, + value: -0.5, + }, + }, + lanyinjia2: { + equipSkill: true, + trigger: { player: "damageBegin4" }, + forced: true, + filter: function (event, player) { + return event.card && event.card.name == "sha" && player.getEquips("lanyinjia").length > 0; + }, + content: function () { + var card = player.getEquips("lanyinjia"); + if (card.length) { player.discard(card); } }, }, - zhungangshuo:{ - equipSkill:true, - trigger:{player:'useCardToPlayered'}, - logTarget:'target', - filter:function(event,player){ - return event.card.name=='sha'&&(event.player.countCards('h')||player.countCards('h')); + zhungangshuo: { + equipSkill: true, + trigger: { player: "useCardToPlayered" }, + logTarget: "target", + filter: function (event, player) { + return ( + event.card.name == "sha" && (event.player.countCards("h") || player.countCards("h")) + ); }, - check:function(event,player){ - var target=event.target; - if(get.attitude(player,target)>=0) return false; - if(player.hasCard(function(card){ - return get.value(card)>=8; - })){ + check: function (event, player) { + var target = event.target; + if (get.attitude(player, target) >= 0) return false; + if ( + player.hasCard(function (card) { + return get.value(card) >= 8; + }) + ) { return false; } - var n1=event.target.countCards('h'); - return n1>0&&n1<=player.countCards('h'); + var n1 = event.target.countCards("h"); + return n1 > 0 && n1 <= player.countCards("h"); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; game.delayx(); - 'step 1' - trigger.target.discardPlayerCard('h',player,true); - 'step 2' - player.discardPlayerCard('h',trigger.target,true); - } - }, - qibaodao:{ - equipSkill:true, - trigger:{source:'damageBegin1'}, - forced:true, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.player.isHealthy(); + "step 1"; + trigger.target.discardPlayerCard("h", player, true); + "step 2"; + player.discardPlayerCard("h", trigger.target, true); }, - content:function(){ + }, + qibaodao: { + equipSkill: true, + trigger: { source: "damageBegin1" }, + forced: true, + filter: function (event) { + return event.card && event.card.name == "sha" && event.player.isHealthy(); + }, + content: function () { trigger.num++; }, - ai:{ - effect:{ - player:function(card,player,target){ - if(card.name=='sha'&&target.isHealthy()&&get.attitude(player,target)>0){ - return [1,-2]; + ai: { + effect: { + player: function (card, player, target) { + if ( + card.name == "sha" && + target.isHealthy() && + get.attitude(player, target) > 0 + ) { + return [1, -2]; } - } - } - } - }, - qibaodao2:{ - inherit:'qinggang_skill', - audio:true, - }, - g_jinchan:{ - cardSkill:true, - trigger:{target:'useCardToBefore'}, - forced:true, - popup:false, - filter:function(event,player){ - if(event.player==player) return false; - if(event.getParent().directHit.includes(player)) return false; - var num=player.countCards('h','jinchan'); - return num&&num==player.countCards('h'); + }, + }, }, - content:function(){ - 'step 0' - player.chooseToUse('是否对'+get.translation(trigger.card)+'使用【金蝉脱壳】?').set('ai1',function(card){ - return _status.event.bool; - }).set('bool',-get.effect(player,trigger.card,trigger.player,player)).set('respondTo',[trigger.player,trigger.card]).set('filterCard',function(card,player){ - if(get.name(card)!='jinchan') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - }); - trigger.jinchan=true; - 'step 1' + }, + qibaodao2: { + inherit: "qinggang_skill", + audio: true, + }, + g_jinchan: { + cardSkill: true, + trigger: { target: "useCardToBefore" }, + forced: true, + popup: false, + filter: function (event, player) { + if (event.player == player) return false; + if (event.getParent().directHit.includes(player)) return false; + var num = player.countCards("h", "jinchan"); + return num && num == player.countCards("h"); + }, + content: function () { + "step 0"; + player + .chooseToUse("是否对" + get.translation(trigger.card) + "使用【金蝉脱壳】?") + .set("ai1", function (card) { + return _status.event.bool; + }) + .set("bool", -get.effect(player, trigger.card, trigger.player, player)) + .set("respondTo", [trigger.player, trigger.card]) + .set("filterCard", function (card, player) { + if (get.name(card) != "jinchan") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }); + trigger.jinchan = true; + "step 1"; delete trigger.jinchan; - } - }, - g_jinchan2:{ - trigger:{ - player:'loseAfter', - global:'loseAsyncAfter', }, - forced:true, - cardSkill:true, - filter:function(event,player){ - if(event.type!='discard') return false; - var evt=event.getl(player); - if(!evt||!evt.cards2||!evt.cards2.length) return false; - for(var i of evt.cards2){ - if(i.name=='jinchan') return true; + }, + g_jinchan2: { + trigger: { + player: "loseAfter", + global: "loseAsyncAfter", + }, + forced: true, + cardSkill: true, + filter: function (event, player) { + if (event.type != "discard") return false; + var evt = event.getl(player); + if (!evt || !evt.cards2 || !evt.cards2.length) return false; + for (var i of evt.cards2) { + if (i.name == "jinchan") return true; } return false; }, - content:function(){ - var num=0,cards=trigger.getl(player).cards2; - for(var i=0;inatures.includes(n)); - if(linked.length) str+=get.translation(get.nature(linked))+'属性'; - str+='伤害。'; + str += "否则你对其造成1点"; + var linked = lib.linked.filter((n) => natures.includes(n)); + if (linked.length) str += get.translation(get.nature(linked)) + "属性"; + str += "伤害。"; return str; }, - defaultYingbianEffect:'add', - filterTarget:function(card,player,target){return player!=target}, - content:function(){ - "step 0" - if(typeof event.shanRequired!='number'||!event.shanRequired||event.shanRequired<0){ - event.shanRequired=1; + defaultYingbianEffect: "add", + filterTarget: function (card, player, target) { + return player != target; + }, + content: function () { + "step 0"; + if ( + typeof event.shanRequired != "number" || + !event.shanRequired || + event.shanRequired < 0 + ) { + event.shanRequired = 1; } - if(typeof event.baseDamage!='number') event.baseDamage=1; - if(typeof event.extraDamage!='number') event.extraDamage=0; - "step 1" - if(event.directHit||event.directHit2||(!_status.connectMode&&lib.config.skip_shan&&!target.hasShan())){ - event._result={bool:false}; - } - else if(event.skipShan){ - event._result={bool:true,result:'shaned'}; - } - else{ - var next=target.chooseToUse('请使用一张闪响应杀'); - next.set('type','respondShan'); - next.set('filterCard',function(card,player){ - if(get.name(card)!='shan') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); + if (typeof event.baseDamage != "number") event.baseDamage = 1; + if (typeof event.extraDamage != "number") event.extraDamage = 0; + "step 1"; + if ( + event.directHit || + event.directHit2 || + (!_status.connectMode && lib.config.skip_shan && !target.hasShan()) + ) { + event._result = { bool: false }; + } else if (event.skipShan) { + event._result = { bool: true, result: "shaned" }; + } else { + var next = target.chooseToUse("请使用一张闪响应杀"); + next.set("type", "respondShan"); + next.set("filterCard", function (card, player) { + if (get.name(card) != "shan") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); }); - if(event.shanRequired>1){ - next.set('prompt2','(共需使用'+event.shanRequired+'张闪)'); + if (event.shanRequired > 1) { + next.set("prompt2", "(共需使用" + event.shanRequired + "张闪)"); + } else if (game.hasNature(event.card, "stab")) { + next.set("prompt2", "(在此之后仍需弃置一张手牌)"); } - else if(game.hasNature(event.card,'stab')){ - next.set('prompt2','(在此之后仍需弃置一张手牌)'); - } - next.set('ai1',function(card){ - if(_status.event.useShan) return get.order(card); + next.set("ai1", function (card) { + if (_status.event.useShan) return get.order(card); return 0; - }).set('shanRequired',event.shanRequired); - next.set('respondTo',[player,card]); - next.set('useShan',(()=>{ - if(target.hasSkillTag('noShan',null,event)) return false; - if(target.hasSkillTag('useShan',null,event)) return true; - if(target.isLinked()&&game.hasNature(event.card)&&get.attitude(target,player._trueMe||player)>0) return false; - if(event.baseDamage+event.extraDamage<=0&&!game.hasNature(event.card,'ice')) return false; - if(event.baseDamage+event.extraDamage>=target.hp+ - ((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true; - if(!game.hasNature(event.card,'ice')&&get.damageEffect(target,player,target,get.nature(event.card))>=0) return false; - if(event.shanRequired>1&&target.mayHaveShan(target,'use',null,'count') { + if (target.hasSkillTag("noShan", null, event)) return false; + if (target.hasSkillTag("useShan", null, event)) return true; + if ( + target.isLinked() && + game.hasNature(event.card) && + get.attitude(target, player._trueMe || player) > 0 + ) + return false; + if ( + event.baseDamage + event.extraDamage <= 0 && + !game.hasNature(event.card, "ice") + ) + return false; + if ( + event.baseDamage + event.extraDamage >= + target.hp + + (player.hasSkillTag("jueqing", false, target) || + target.hasSkill("gangzhi") + ? target.hujia + : 0) + ) + return true; + if ( + !game.hasNature(event.card, "ice") && + get.damageEffect(target, player, target, get.nature(event.card)) >= 0 + ) + return false; + if ( + event.shanRequired > 1 && + target.mayHaveShan(target, "use", null, "count") < + event.shanRequired - (event.shanIgnored || 0) + ) + return false; + return true; + })() + ); //next.autochoose=lib.filter.autoRespondShan; } - "step 2" - if(!result||!result.bool||!result.result||result.result!='shaned'){ - event.trigger('shaHit'); - } - else{ + "step 2"; + if (!result || !result.bool || !result.result || result.result != "shaned") { + event.trigger("shaHit"); + } else { event.shanRequired--; - if(event.shanRequired>0){ + if (event.shanRequired > 0) { event.goto(1); - } - else if(game.hasNature(event.card,'stab')&&target.countCards('h')>0){ - event.responded=result; + } else if (game.hasNature(event.card, "stab") && target.countCards("h") > 0) { + event.responded = result; event.goto(4); - } - else{ - event.trigger('shaMiss'); - event.responded=result; + } else { + event.trigger("shaMiss"); + event.responded = result; } } - "step 3" - if((!result||!result.bool||!result.result||result.result!='shaned')&&!event.unhurt){ - if (!event.directHit&&!event.directHit2&&lib.filter.cardEnabled(new lib.element.VCard({name:'shan'}), target, 'forceEnable')&& - target.countCards('hs')>0&&get.damageEffect(target,player,target)<0) target.addGaintag(target.getCards('hs'),'sha_notshan'); + "step 3"; + if ( + (!result || !result.bool || !result.result || result.result != "shaned") && + !event.unhurt + ) { + if ( + !event.directHit && + !event.directHit2 && + lib.filter.cardEnabled( + new lib.element.VCard({ name: "shan" }), + target, + "forceEnable" + ) && + target.countCards("hs") > 0 && + get.damageEffect(target, player, target) < 0 + ) + target.addGaintag(target.getCards("hs"), "sha_notshan"); target.damage(get.nature(event.card)); - event.result={bool:true} - event.trigger('shaDamage'); - } - else{ - event.result={bool:false} - event.trigger('shaUnhirt'); + event.result = { bool: true }; + event.trigger("shaDamage"); + } else { + event.result = { bool: false }; + event.trigger("shaUnhirt"); } event.finish(); - "step 4" - target.chooseToDiscard('刺杀:请弃置一张牌,否则此【杀】依然造成伤害').set('ai',function(card){ - var target=_status.event.player; - var evt=_status.event.getParent(); - var bool=true; - if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) bool=false; - if(bool){ - return 8-get.useful(card); - } - return 0; - }); - "step 5" - if((!result||!result.bool)&&!event.unhurt){ + "step 4"; + target + .chooseToDiscard("刺杀:请弃置一张牌,否则此【杀】依然造成伤害") + .set("ai", function (card) { + var target = _status.event.player; + var evt = _status.event.getParent(); + var bool = true; + if (get.damageEffect(target, evt.player, target, evt.card.nature) >= 0) + bool = false; + if (bool) { + return 8 - get.useful(card); + } + return 0; + }); + "step 5"; + if ((!result || !result.bool) && !event.unhurt) { target.damage(get.nature(event.card)); - event.result={bool:true} - event.trigger('shaDamage'); + event.result = { bool: true }; + event.trigger("shaDamage"); event.finish(); + } else { + event.trigger("shaMiss"); } - else{ - event.trigger('shaMiss'); - } - "step 6" - if((!result||!result.bool)&&!event.unhurt){ + "step 6"; + if ((!result || !result.bool) && !event.unhurt) { target.damage(get.nature(event.card)); - event.result={bool:true} - event.trigger('shaDamage'); + event.result = { bool: true }; + event.trigger("shaDamage"); event.finish(); - } - else{ - event.result={bool:false} - event.trigger('shaUnhirt'); + } else { + event.result = { bool: false }; + event.trigger("shaUnhirt"); } }, - ai:{ - yingbian:function(card,player,targets,viewer){ - if(get.attitude(viewer,player)<=0) return 0; - var base=0,hit=false; - if(get.cardtag(card,'yingbian_hit')){ - hit=true; - if(targets.some(target=>{ - return target.mayHaveShan(viewer,'use',target.getCards('h',i=>{ - return i.hasGaintag('sha_notshan'); - }))&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0; - })) base+=5; - } - if(get.cardtag(card,'yingbian_add')){ - if(game.hasPlayer(function(current){ - return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; - })) base+=5; - } - if(get.cardtag(card,'yingbian_damage')){ - if(targets.some(target=>{ - return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use',target.getCards('h',i=>{ - return i.hasGaintag('sha_notshan'); - }))||player.hasSkillTag('directHit_ai',true,{ - target:target, - card:card, - },true))&&!target.hasSkillTag('filterDamage',null,{ - player:player, - card:card, - jiu:true, + ai: { + yingbian: function (card, player, targets, viewer) { + if (get.attitude(viewer, player) <= 0) return 0; + var base = 0, + hit = false; + if (get.cardtag(card, "yingbian_hit")) { + hit = true; + if ( + targets.some((target) => { + return ( + target.mayHaveShan( + viewer, + "use", + target.getCards("h", (i) => { + return i.hasGaintag("sha_notshan"); + }) + ) && + get.attitude(viewer, target) < 0 && + get.damageEffect(target, player, viewer, get.natureList(card)) > 0 + ); }) - })) base+=5; + ) + base += 5; + } + if (get.cardtag(card, "yingbian_add")) { + if ( + game.hasPlayer(function (current) { + return ( + !targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + get.effect(current, card, player, player) > 0 + ); + }) + ) + base += 5; + } + if (get.cardtag(card, "yingbian_damage")) { + if ( + targets.some((target) => { + return ( + get.attitude(player, target) < 0 && + (hit || + !target.mayHaveShan( + viewer, + "use", + target.getCards("h", (i) => { + return i.hasGaintag("sha_notshan"); + }) + ) || + player.hasSkillTag( + "directHit_ai", + true, + { + target: target, + card: card, + }, + true + )) && + !target.hasSkillTag("filterDamage", null, { + player: player, + card: card, + jiu: true, + }) + ); + }) + ) + base += 5; } return base; }, - canLink:function(player,target,card){ - if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false; - if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false; + canLink: function (player, target, card) { + if (!target.isLinked() && !player.hasSkill("wutiesuolian_skill")) return false; + if ( + player.hasSkill("jueqing") || + player.hasSkill("gangzhi") || + target.hasSkill("gangzhi") + ) + return false; return true; }, - basic:{ - useful:[5,3,1], - value:[5,3,1], + basic: { + useful: [5, 3, 1], + value: [5, 3, 1], }, order(item, player) { let res = 3.2; - if (player.hasSkillTag('presha', true, null, true)) res = 10; - if (typeof item !== 'object' || !game.hasNature(item, 'linked') || game.countPlayer(cur => cur.isLinked()) < 2) return res; + if (player.hasSkillTag("presha", true, null, true)) res = 10; + if ( + typeof item !== "object" || + !game.hasNature(item, "linked") || + game.countPlayer((cur) => cur.isLinked()) < 2 + ) + return res; //let used = player.getCardUsable('sha') - 1.5, natures = ['thunder', 'fire', 'ice', 'kami']; let uv = player.getUseValue(item, true); if (uv <= 0) return res; - let temp = player.getUseValue('sha', true) - uv; + let temp = player.getUseValue("sha", true) - uv; if (temp < 0) return res + 0.15; if (temp > 0) return res - 0.15; return res; }, - result:{ - target:function(player,target,card,isLink){ - let eff=-1.5,odds=1.35,num=1; - if(isLink){ - let cache=_status.event.getTempCache('sha_result','eff'); - if(typeof cache!=='object'||cache.card!==get.translation(card)) return eff; - if(cache.odds<1.35&&cache.bool) return 1.35*cache.eff; - return cache.odds*cache.eff; + result: { + target: function (player, target, card, isLink) { + let eff = -1.5, + odds = 1.35, + num = 1; + if (isLink) { + let cache = _status.event.getTempCache("sha_result", "eff"); + if (typeof cache !== "object" || cache.card !== get.translation(card)) + return eff; + if (cache.odds < 1.35 && cache.bool) return 1.35 * cache.eff; + return cache.odds * cache.eff; } - if(player.hasSkill('jiu')||player.hasSkillTag('damageBonus',true,{ - target:target, - card:card - })){ - if(target.hasSkillTag('filterDamage',null,{ - player:player, - card:card, - jiu:true, - })) eff=-0.5; - else{ - num=2; - if(get.attitude(player,target)>0) eff=-7; - else eff=-4; + if ( + player.hasSkill("jiu") || + player.hasSkillTag("damageBonus", true, { + target: target, + card: card, + }) + ) { + if ( + target.hasSkillTag("filterDamage", null, { + player: player, + card: card, + jiu: true, + }) + ) + eff = -0.5; + else { + num = 2; + if (get.attitude(player, target) > 0) eff = -7; + else eff = -4; } } - if(!player.hasSkillTag('directHit_ai',true,{ - target:target, - card:card, - },true)) odds-=0.7*target.mayHaveShan(player,'use',target.getCards('h',i=>{ - return i.hasGaintag('sha_notshan'); - }),'odds'); - _status.event.putTempCache('sha_result','eff',{ - bool:target.hp>num&&get.attitude(player,target)>0, - card:get.translation(card), - eff:eff, - odds:odds + if ( + !player.hasSkillTag( + "directHit_ai", + true, + { + target: target, + card: card, + }, + true + ) + ) + odds -= + 0.7 * + target.mayHaveShan( + player, + "use", + target.getCards("h", (i) => { + return i.hasGaintag("sha_notshan"); + }), + "odds" + ); + _status.event.putTempCache("sha_result", "eff", { + bool: target.hp > num && get.attitude(player, target) > 0, + card: get.translation(card), + eff: eff, + odds: odds, }); - return odds*eff; + return odds * eff; }, }, - tag:{ - respond:1, - respondShan:1, - damage:function(card){ - if(game.hasNature(card,'poison')) return; + tag: { + respond: 1, + respondShan: 1, + damage: function (card) { + if (game.hasNature(card, "poison")) return; return 1; }, - natureDamage:function(card){ - if(game.hasNature(card,'linked')) return 1; + natureDamage: function (card) { + if (game.hasNature(card, "linked")) return 1; }, - fireDamage:function(card,nature){ - if(game.hasNature(card,'fire')) return 1; + fireDamage: function (card, nature) { + if (game.hasNature(card, "fire")) return 1; }, - thunderDamage:function(card,nature){ - if(game.hasNature(card,'thunder')) return 1; + thunderDamage: function (card, nature) { + if (game.hasNature(card, "thunder")) return 1; }, - poisonDamage:function(card,nature){ - if(game.hasNature(card,'poison')) return 1; - } - } - } + poisonDamage: function (card, nature) { + if (game.hasNature(card, "poison")) return 1; + }, + }, + }, }, - shacopy:{ - ai:{ - basic:{ - useful:[5,3,1], - value:[5,3,1], + shacopy: { + ai: { + basic: { + useful: [5, 3, 1], + value: [5, 3, 1], }, - order:3, - result:{ - target:-1.5, + order: 3, + result: { + target: -1.5, }, - tag:{ - respond:1, - respondShan:1, - damage:function(card){ - if(game.hasNature(card,'poison')) return; + tag: { + respond: 1, + respondShan: 1, + damage: function (card) { + if (game.hasNature(card, "poison")) return; return 1; }, - natureDamage:function(card){ - if(game.hasNature(card)) return 1; + natureDamage: function (card) { + if (game.hasNature(card)) return 1; }, - fireDamage:function(card,nature){ - if(game.hasNature(card,'fire')) return 1; + fireDamage: function (card, nature) { + if (game.hasNature(card, "fire")) return 1; }, - thunderDamage:function(card,nature){ - if(game.hasNature(card,'thunder')) return 1; + thunderDamage: function (card, nature) { + if (game.hasNature(card, "thunder")) return 1; }, - poisonDamage:function(card,nature){ - if(game.hasNature(card,'poison')) return 1; - } - } - } + poisonDamage: function (card, nature) { + if (game.hasNature(card, "poison")) return 1; + }, + }, + }, }, - shan:{ - audio:true, - fullskin:true, - type:'basic', - cardcolor:'red', - notarget:true, - nodelay:true, - defaultYingbianEffect:'draw', - content:function(){ - event.result='shaned'; - event.getParent().delayx=false; + shan: { + audio: true, + fullskin: true, + type: "basic", + cardcolor: "red", + notarget: true, + nodelay: true, + defaultYingbianEffect: "draw", + content: function () { + event.result = "shaned"; + event.getParent().delayx = false; game.delay(0.5); }, - ai:{ - order:3, - basic:{ - useful:(card,i)=>{ - let player = _status.event.player, basic = [7, 5.1, 2], num = basic[Math.min(2, i)]; - if(player.hp>2&&player.hasSkillTag('maixie')) num *= 0.57; - if(player.hasSkillTag('freeShan',false,null,true) || player.getEquip('rewrite_renwang')) num *= 0.8; + ai: { + order: 3, + basic: { + useful: (card, i) => { + let player = _status.event.player, + basic = [7, 5.1, 2], + num = basic[Math.min(2, i)]; + if (player.hp > 2 && player.hasSkillTag("maixie")) num *= 0.57; + if ( + player.hasSkillTag("freeShan", false, null, true) || + player.getEquip("rewrite_renwang") + ) + num *= 0.8; return num; }, - value:[7,5.1,2], + value: [7, 5.1, 2], }, - result:{player:1}, + result: { player: 1 }, //expose:0.2 - } + }, }, - tao:{ - fullskin:true, - type:'basic', - cardcolor:'red', - toself:true, - enable:function(card,player){ - return player.hp{ - if(player.hasSkillTag('pretao')) return 9; + ai: { + basic: { + order: (card, player) => { + if (player.hasSkillTag("pretao")) return 9; return 2; }, - useful:(card,i)=>{ + useful: (card, i) => { let player = _status.event.player; - if(!game.checkMod(card,player,'unchanged','cardEnabled2',player)) return 2/(1+i); - let fs = game.filterPlayer(current=>{ - return get.attitude(player,current)>0&¤t.hp<=2; - }), damaged = 0, needs = 0; - fs.forEach(f=>{ - if(f.hp>3 || !lib.filter.cardSavable(card,player,f)) return; - if(f.hp>1) damaged++; + if (!game.checkMod(card, player, "unchanged", "cardEnabled2", player)) + return 2 / (1 + i); + let fs = game.filterPlayer((current) => { + return get.attitude(player, current) > 0 && current.hp <= 2; + }), + damaged = 0, + needs = 0; + fs.forEach((f) => { + if (f.hp > 3 || !lib.filter.cardSavable(card, player, f)) return; + if (f.hp > 1) damaged++; else needs++; }); - if(needs&&damaged) return 5*needs+3*damaged; - if(needs+damaged>1 || player.hasSkillTag('maixie')) return 8; - if(player.hp/player.maxHp<0.7) return 7+Math.abs(player.hp/player.maxHp-0.5); - if(needs) return 7; - if(damaged) return Math.max(3,7.8-i); - return Math.max(1,7.2-i); + if (needs && damaged) return 5 * needs + 3 * damaged; + if (needs + damaged > 1 || player.hasSkillTag("maixie")) return 8; + if (player.hp / player.maxHp < 0.7) + return 7 + Math.abs(player.hp / player.maxHp - 0.5); + if (needs) return 7; + if (damaged) return Math.max(3, 7.8 - i); + return Math.max(1, 7.2 - i); }, - value:(card,player)=>{ - let fs = game.filterPlayer(current=>{ - return get.attitude(_status.event.player,current)>0; - }), damaged = 0, needs = 0; - fs.forEach(f=>{ - if(!player.canUse('tao',f)) return; - if(f.hp<=1) needs++; - else if(f.hp==2) damaged++; + value: (card, player) => { + let fs = game.filterPlayer((current) => { + return get.attitude(_status.event.player, current) > 0; + }), + damaged = 0, + needs = 0; + fs.forEach((f) => { + if (!player.canUse("tao", f)) return; + if (f.hp <= 1) needs++; + else if (f.hp == 2) damaged++; }); - if(needs&&damaged || player.hasSkillTag('maixie')) return Math.max(9,5*needs+3*damaged); - if(needs || damaged>1) return 8; - if(damaged) return 7.5; - return Math.max(5,9.2-player.hp); - } + if ((needs && damaged) || player.hasSkillTag("maixie")) + return Math.max(9, 5 * needs + 3 * damaged); + if (needs || damaged > 1) return 8; + if (damaged) return 7.5; + return Math.max(5, 9.2 - player.hp); + }, }, - result:{ - target:(player,target)=>{ - if(target.hasSkillTag('maixie')) return 3; + result: { + target: (player, target) => { + if (target.hasSkillTag("maixie")) return 3; return 2; }, - target_use:(player,target,card)=>{ + target_use: (player, target, card) => { let mode = get.mode(), - taos = player.getCards('hs',i=>get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable')); - if(target!==_status.event.dying){ - if(!player.isPhaseUsing() || player.hasSkillTag('nokeep',true,{ - card:card, - target:target - },true)) return 2; - let min = 7.2-4*player.hp/player.maxHp, - nd = player.needsToDiscard(0,(i,player)=>{ - return !player.canIgnoreHandcard(i)&&(taos.includes(i)||get.value(i)>=min); + taos = player.getCards( + "hs", + (i) => + get.name(i) === "tao" && + lib.filter.cardEnabled(i, target, "forceEnable") + ); + if (target !== _status.event.dying) { + if ( + !player.isPhaseUsing() || + player.hasSkillTag( + "nokeep", + true, + { + card: card, + target: target, + }, + true + ) + ) + return 2; + let min = 7.2 - (4 * player.hp) / player.maxHp, + nd = player.needsToDiscard(0, (i, player) => { + return ( + !player.canIgnoreHandcard(i) && + (taos.includes(i) || get.value(i) >= min) + ); }), - keep = nd?0:2; - if(nd>2 || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&(nd||target.hp<3)&&(mode==='identity'||mode==='versus'||mode==='chess') || !player.hasFriend()) return 2; - if(game.hasPlayer(current=>{ - return player!==current&¤t.identity==='zhu'&¤t.hp<3&&(mode==='identity'||mode==='versus'||mode==='chess')&&get.attitude(player,current)>0; - })) keep = 3; - else if(nd===2||player.hp<2) return 2; - if(nd===2&&player.hp<=1) return 2; - if(keep===3) return 0; - if(taos.length<=player.hp/2) keep = 1; - if(keep&&game.countPlayer(current=>{ - if(player!==current&¤t.hp<3&&player.hp>current.hp&&get.attitude(player,current)>2){ - keep += player.hp-current.hp; - return true; - } - return false; - })){ - if(keep>2) return 0; + keep = nd ? 0 : 2; + if ( + nd > 2 || + (taos.length > 1 && (nd > 1 || (nd && player.hp < 1 + taos.length))) || + (target.identity === "zhu" && + (nd || target.hp < 3) && + (mode === "identity" || mode === "versus" || mode === "chess")) || + !player.hasFriend() + ) + return 2; + if ( + game.hasPlayer((current) => { + return ( + player !== current && + current.identity === "zhu" && + current.hp < 3 && + (mode === "identity" || mode === "versus" || mode === "chess") && + get.attitude(player, current) > 0 + ); + }) + ) + keep = 3; + else if (nd === 2 || player.hp < 2) return 2; + if (nd === 2 && player.hp <= 1) return 2; + if (keep === 3) return 0; + if (taos.length <= player.hp / 2) keep = 1; + if ( + keep && + game.countPlayer((current) => { + if ( + player !== current && + current.hp < 3 && + player.hp > current.hp && + get.attitude(player, current) > 2 + ) { + keep += player.hp - current.hp; + return true; + } + return false; + }) + ) { + if (keep > 2) return 0; } return 2; } - if(target.isZhu2() || target===game.boss) return 2; - if(player!==target){ - if(target.hp<0&&taos.length+target.hp<=0) return 0; - if(Math.abs(get.attitude(player,target))<1) return 0; + if (target.isZhu2() || target === game.boss) return 2; + if (player !== target) { + if (target.hp < 0 && taos.length + target.hp <= 0) return 0; + if (Math.abs(get.attitude(player, target)) < 1) return 0; } - if(!player.getFriends().length) return 2; + if (!player.getFriends().length) return 2; let tri = _status.event.getTrigger(), - num = game.countPlayer(current=>{ - if(get.attitude(current,target)>0) return current.countCards('hs',i=>get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable')); + num = game.countPlayer((current) => { + if (get.attitude(current, target) > 0) + return current.countCards( + "hs", + (i) => + get.name(i) === "tao" && + lib.filter.cardEnabled(i, target, "forceEnable") + ); }), dis = 1, - t = _status.currentPhase||game.me; - while(t!==target){ - let att = get.attitude(player,t); - if(att<-2) dis++; - else if(att<1) dis += 0.45; + t = _status.currentPhase || game.me; + while (t !== target) { + let att = get.attitude(player, t); + if (att < -2) dis++; + else if (att < 1) dis += 0.45; t = t.next; } - if(mode==='identity'){ - if(tri&&tri.name==='dying'){ - if(target.identity==='fan') { - if(!tri.source&&player!==target || tri.source&&tri.source!==target&&player.getFriends().includes(tri.source.identity)){ - if(num>dis || player===target&&player.countCards('hs',{type:'basic'})>1.6*dis) return 2; + if (mode === "identity") { + if (tri && tri.name === "dying") { + if (target.identity === "fan") { + if ( + (!tri.source && player !== target) || + (tri.source && + tri.source !== target && + player.getFriends().includes(tri.source.identity)) + ) { + if ( + num > dis || + (player === target && + player.countCards("hs", { type: "basic" }) > 1.6 * dis) + ) + return 2; return 0; } - } - else if(tri.source&&tri.source.isZhu&&(target.identity==='zhong'||target.identity==='mingzhong')&& - (tri.source.countCards('he')>2||player===tri.source&&player.hasCard((i)=>i.name!=='tao','he'))) return 2; + } else if ( + tri.source && + tri.source.isZhu && + (target.identity === "zhong" || target.identity === "mingzhong") && + (tri.source.countCards("he") > 2 || + (player === tri.source && + player.hasCard((i) => i.name !== "tao", "he"))) + ) + return 2; //if(player!==target&&!target.isZhu&&target.countCards('hs'){ - return current.identity==='fan'; - }))) return 0; + if (player.identity === "zhu") { + if ( + player.hp <= 1 && + player !== target && + taos + player.countCards("hs", "jiu") <= + Math.min( + dis, + game.countPlayer((current) => { + return current.identity === "fan"; + }) + ) + ) + return 0; } - } - else if(mode==='stone'&&target.isMin()&&player!==target&&tri&&tri.name==='dying'&&player.side===target.side&&tri.source!==target.getEnemy()) return 0; + } else if ( + mode === "stone" && + target.isMin() && + player !== target && + tri && + tri.name === "dying" && + player.side === target.side && + tri.source !== target.getEnemy() + ) + return 0; return 2; - } + }, + }, + tag: { + recover: 1, + save: 1, }, - tag:{ - recover:1, - save:1, - } - } - }, - bagua:{ - fullskin:true, - type:'equip', - subtype:'equip2', - ai:{ - basic:{ - equipValue:7.5 - } }, - skills:['bagua_skill'] }, - jueying:{ - fullskin:true, - type:'equip', - subtype:'equip3', - distance:{globalTo:1}, - }, - dilu:{ - fullskin:true, - type:'equip', - subtype:'equip3', - distance:{globalTo:1}, - }, - zhuahuang:{ - fullskin:true, - type:'equip', - subtype:'equip3', - distance:{globalTo:1}, - }, - chitu:{ - fullskin:true, - type:'equip', - subtype:'equip4', - distance:{globalFrom:-1}, - }, - dawan:{ - fullskin:true, - type:'equip', - subtype:'equip4', - distance:{globalFrom:-1}, - }, - zixin:{ - fullskin:true, - type:'equip', - subtype:'equip4', - distance:{globalFrom:-1}, - }, - zhuge:{ - fullskin:true, - type:'equip', - subtype:'equip1', - ai:{ - order:function(){ - return get.order({name:'sha'})-0.1; + bagua: { + fullskin: true, + type: "equip", + subtype: "equip2", + ai: { + basic: { + equipValue: 7.5, }, - equipValue:function(card,player){ - if(player._zhuge_temp) return 1; - player._zhuge_temp=true; - var result=function(){ - if(!game.hasPlayer(function(current){ - return get.distance(player,current)<=1&&player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)>0; - })){ + }, + skills: ["bagua_skill"], + }, + jueying: { + fullskin: true, + type: "equip", + subtype: "equip3", + distance: { globalTo: 1 }, + }, + dilu: { + fullskin: true, + type: "equip", + subtype: "equip3", + distance: { globalTo: 1 }, + }, + zhuahuang: { + fullskin: true, + type: "equip", + subtype: "equip3", + distance: { globalTo: 1 }, + }, + chitu: { + fullskin: true, + type: "equip", + subtype: "equip4", + distance: { globalFrom: -1 }, + }, + dawan: { + fullskin: true, + type: "equip", + subtype: "equip4", + distance: { globalFrom: -1 }, + }, + zixin: { + fullskin: true, + type: "equip", + subtype: "equip4", + distance: { globalFrom: -1 }, + }, + zhuge: { + fullskin: true, + type: "equip", + subtype: "equip1", + ai: { + order: function () { + return get.order({ name: "sha" }) - 0.1; + }, + equipValue: function (card, player) { + if (player._zhuge_temp) return 1; + player._zhuge_temp = true; + var result = (function () { + if ( + !game.hasPlayer(function (current) { + return ( + get.distance(player, current) <= 1 && + player.canUse("sha", current) && + get.effect(current, { name: "sha" }, player, player) > 0 + ); + }) + ) { return 1; } - if(player.hasSha()&&_status.currentPhase==player){ - if(player.getEquip('zhuge')&&player.countUsed('sha')||player.getCardUsable('sha')==0){ + if (player.hasSha() && _status.currentPhase == player) { + if ( + (player.getEquip("zhuge") && player.countUsed("sha")) || + player.getCardUsable("sha") == 0 + ) { return 10; } } - var num=player.countCards('h','sha'); - if(num>1) return 6+num; - return 3+num; - }(); + var num = player.countCards("h", "sha"); + if (num > 1) return 6 + num; + return 3 + num; + })(); delete player._zhuge_temp; return result; }, - basic:{ - equipValue:5 + basic: { + equipValue: 5, }, - tag:{ - valueswap:1 - } - }, - skills:['zhuge_skill'] - }, - cixiong:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-1}, - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['cixiong_skill'] - }, - qinggang:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-1}, - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['qinggang_skill'] - }, - qinglong:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - equipValue:function(card,player){ - return Math.min(2.5+player.countCards('h','sha'),4); + tag: { + valueswap: 1, }, - basic:{ - equipValue:3.5 - } }, - skills:['qinglong_skill','qinglong_guozhan'] + skills: ["zhuge_skill"], }, - zhangba:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - equipValue:function(card,player){ - var num=2.5+player.countCards('h')/3; - return Math.min(num,4); + cixiong: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + ai: { + basic: { + equipValue: 2, }, - basic:{ - equipValue:3.5 - } }, - skills:['zhangba_skill'] + skills: ["cixiong_skill"], }, - guanshi:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - equipValue:function(card,player){ - var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; - return Math.min(num,5); + qinggang: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + ai: { + basic: { + equipValue: 2, }, - basic:{ - equipValue:4.5, - } }, - skills:['guanshi_skill'] + skills: ["qinggang_skill"], }, - fangtian:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-3}, - ai:{ - basic:{ - equipValue:2.5 - } + qinglong: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + equipValue: function (card, player) { + return Math.min(2.5 + player.countCards("h", "sha"), 4); + }, + basic: { + equipValue: 3.5, + }, }, - skills:['fangtian_skill','fangtian_guozhan'] + skills: ["qinglong_skill", "qinglong_guozhan"], }, - qilin:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-4}, - ai:{ - basic:{ - equipValue:3 - } + zhangba: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + equipValue: function (card, player) { + var num = 2.5 + player.countCards("h") / 3; + return Math.min(num, 4); + }, + basic: { + equipValue: 3.5, + }, }, - skills:['qilin_skill'] + skills: ["zhangba_skill"], }, - wugu:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - cardcolor:'red', - selectTarget:-1, - filterTarget:true, - contentBefore:function(){ - "step 0" - if(!targets.length){ + guanshi: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + equipValue: function (card, player) { + var num = 2.5 + (player.countCards("h") + player.countCards("e")) / 2.5; + return Math.min(num, 5); + }, + basic: { + equipValue: 4.5, + }, + }, + skills: ["guanshi_skill"], + }, + fangtian: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -3 }, + ai: { + basic: { + equipValue: 2.5, + }, + }, + skills: ["fangtian_skill", "fangtian_guozhan"], + }, + qilin: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -4 }, + ai: { + basic: { + equipValue: 3, + }, + }, + skills: ["qilin_skill"], + }, + wugu: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + cardcolor: "red", + selectTarget: -1, + filterTarget: true, + contentBefore: function () { + "step 0"; + if (!targets.length) { event.finish(); return; } - if(card.storage&&card.storage.chooseDirection||get.is.versus()){ - player.chooseControl('顺时针','逆时针',function(event,player){ - if(get.event('isVersus')&&player.next.side==player.side||get.attitude(player,player.next)>get.attitude(player,player.previous)) return '逆时针'; - return '顺时针'; - }).set('prompt','选择'+get.translation(card)+'的结算方向').set('isVersus',get.is.versus()); - } - else{ + if ((card.storage && card.storage.chooseDirection) || get.is.versus()) { + player + .chooseControl("顺时针", "逆时针", function (event, player) { + if ( + (get.event("isVersus") && player.next.side == player.side) || + get.attitude(player, player.next) > get.attitude(player, player.previous) + ) + return "逆时针"; + return "顺时针"; + }) + .set("prompt", "选择" + get.translation(card) + "的结算方向") + .set("isVersus", get.is.versus()); + } else { event.goto(2); } - "step 1" - if(result&&result.control=='顺时针'){ - var evt=event.getParent(),sorter=(_status.currentPhase||player); - evt.fixedSeat=true; + "step 1"; + if (result && result.control == "顺时针") { + var evt = event.getParent(), + sorter = _status.currentPhase || player; + evt.fixedSeat = true; evt.targets.sortBySeat(sorter); evt.targets.reverse(); - if(evt.targets[evt.targets.length-1]==sorter){ + if (evt.targets[evt.targets.length - 1] == sorter) { evt.targets.unshift(evt.targets.pop()); } } - "step 2" + "step 2"; ui.clear(); var cards; - if(card.storage&&Array.isArray(card.storage.fixedShownCards)){ - cards=card.storage.fixedShownCards.slice(); - var lose_list=[],cards2=[]; - cards.forEach(card=>{ - var owner=get.owner(card); - if(owner){ - var arr=lose_list.find(i=>i[0]==owner); - if(arr) arr[1].push(card); - else lose_list.push([owner,[card]]); - } - else cards2.add(card); + if (card.storage && Array.isArray(card.storage.fixedShownCards)) { + cards = card.storage.fixedShownCards.slice(); + var lose_list = [], + cards2 = []; + cards.forEach((card) => { + var owner = get.owner(card); + if (owner) { + var arr = lose_list.find((i) => i[0] == owner); + if (arr) arr[1].push(card); + else lose_list.push([owner, [card]]); + } else cards2.add(card); }); - if(lose_list.length){ - lose_list.forEach(list=>{ + if (lose_list.length) { + lose_list.forEach((list) => { list[0].$throw(list[1]); - game.log(list[0],'将',list[1],'置于了处理区'); - }) + game.log(list[0], "将", list[1], "置于了处理区"); + }); game.loseAsync({ - lose_list:lose_list, - }).setContent('chooseToCompareLose'); + lose_list: lose_list, + }).setContent("chooseToCompareLose"); } - if(cards2.length) game.cardsGotoOrdering(cards2); + if (cards2.length) game.cardsGotoOrdering(cards2); game.delayex(); - } - else{ + } else { var num; - if(event.targets){ - num=event.targets.length; + if (event.targets) { + num = event.targets.length; + } else { + num = game.countPlayer(); } - else{ - num=game.countPlayer(); - } - if(card.storage&&typeof card.storage.extraCardsNum=='number') num+=card.storage.extraCardsNum; - cards=get.cards(num); - game.cardsGotoOrdering(cards).relatedEvent=event.getParent(); + if (card.storage && typeof card.storage.extraCardsNum == "number") + num += card.storage.extraCardsNum; + cards = get.cards(num); + game.cardsGotoOrdering(cards).relatedEvent = event.getParent(); } - var dialog=ui.create.dialog('五谷丰登',cards,true); + var dialog = ui.create.dialog("五谷丰登", cards, true); _status.dieClose.push(dialog); - dialog.videoId=lib.status.videoId++; - game.addVideo('cardDialog',null,['五谷丰登',get.cardsInfo(cards),dialog.videoId]); - event.getParent().preResult=dialog.videoId; - game.broadcast(function(cards,id){ - var dialog=ui.create.dialog('五谷丰登',cards,true); - _status.dieClose.push(dialog); - dialog.videoId=id; - },cards,dialog.videoId); - game.log(event.card,'亮出了',cards); + dialog.videoId = lib.status.videoId++; + game.addVideo("cardDialog", null, ["五谷丰登", get.cardsInfo(cards), dialog.videoId]); + event.getParent().preResult = dialog.videoId; + game.broadcast( + function (cards, id) { + var dialog = ui.create.dialog("五谷丰登", cards, true); + _status.dieClose.push(dialog); + dialog.videoId = id; + }, + cards, + dialog.videoId + ); + game.log(event.card, "亮出了", cards); }, - content:function(){ - "step 0" - for(var i=0;i1){ - var next=target.chooseButton(true,function(button){ - return get.value(button.link,_status.event.player); + if (event.dialog.buttons.length > 1) { + var next = target.chooseButton(true, function (button) { + return get.value(button.link, _status.event.player); }); - next.set('dialog',event.preResult); - next.set('closeDialog',false); - next.set('dialogdisplay',true); + next.set("dialog", event.preResult); + next.set("closeDialog", false); + next.set("dialogdisplay", true); + } else { + event.directButton = event.dialog.buttons[0]; } - else{ - event.directButton=event.dialog.buttons[0]; - } - "step 1" - var dialog=event.dialog; + "step 1"; + var dialog = event.dialog; var card; - if(event.directButton){ - card=event.directButton.link; - } - else{ - for(var i of dialog.buttons){ - if(i.link==result.links[0]){ - card=i.link; + if (event.directButton) { + card = event.directButton.link; + } else { + for (var i of dialog.buttons) { + if (i.link == result.links[0]) { + card = i.link; break; } } - if(!card) card=event.dialog.buttons[0].link; + if (!card) card = event.dialog.buttons[0].link; } var button; - for(var i=0;i0?0.5:0.7; - } + return (1 - get.distance(sorter, target, "absolute") / game.countPlayer()) * + get.attitude(player, target) > + 0 + ? 0.5 + : 0.7; + }, }, - tag:{ - draw:1, - multitarget:1 - } - } + tag: { + draw: 1, + multitarget: 1, + }, + }, }, - taoyuan:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - cardcolor:'red', - reverseOrder:true, - defaultYingbianEffect:'remove', - filterTarget:function(card,player,target){ + taoyuan: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + cardcolor: "red", + reverseOrder: true, + defaultYingbianEffect: "remove", + filterTarget: function (card, player, target) { //return target.hp{ - if(game.hasPlayer(current=>current.hp<=1&&get.recoverEffect(current,player,_status.event.player)<0)) return 1; + ai: { + basic: { + order: (item, player) => { + if ( + game.hasPlayer( + (current) => + current.hp <= 1 && + get.recoverEffect(current, player, _status.event.player) < 0 + ) + ) + return 1; return 10; }, - useful:[3,1], - value:0, + useful: [3, 1], + value: 0, }, - result:{ - target:function(player,target){ - return (target.hp1){ - next.set('prompt2','共需打出'+event.shaRequired+'张杀'); + }, + nanman: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + defaultYingbianEffect: "remove", + filterTarget: function (card, player, target) { + return target != player; + }, + reverseOrder: true, + content: function () { + "step 0"; + if (typeof event.shaRequired != "number" || !event.shaRequired || event.shaRequired < 0) + event.shaRequired = 1; + if (typeof event.baseDamage != "number") event.baseDamage = 1; + "step 1"; + if (event.directHit) event._result = { bool: false }; + else { + var next = target.chooseToRespond({ name: "sha" }); + if (event.shaRequired > 1) { + next.set("prompt2", "共需打出" + event.shaRequired + "张杀"); } - next.set('ai',function(card){ - var evt=_status.event.getParent(); - if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; - if(evt.player.hasSkillTag('notricksource')) return 0; - if(evt.target.hasSkillTag('notrick')) return 0; + next.set("ai", function (card) { + var evt = _status.event.getParent(); + if (get.damageEffect(evt.target, evt.player, evt.target) >= 0) return 0; + if (evt.player.hasSkillTag("notricksource")) return 0; + if (evt.target.hasSkillTag("notrick")) return 0; return get.order(card); }); - next.autochoose=lib.filter.autoRespondSha; + next.autochoose = lib.filter.autoRespondSha; } - "step 2" - if(result.bool==false){ + "step 2"; + if (result.bool == false) { target.damage(); - } - else{ + } else { event.shaRequired--; - if(event.shaRequired>0) event.goto(1); + if (event.shaRequired > 0) event.goto(1); } }, - ai:{ + ai: { wuxie(target, card, player, viewer, status) { - let att = get.attitude(viewer, target), eff = get.effect(target, card, player, target); + let att = get.attitude(viewer, target), + eff = get.effect(target, card, player, target); if (Math.abs(att) < 1 || status * eff * att >= 0) return 0; - let evt = _status.event.getParent('useCard'), pri = 1, bonus = player.hasSkillTag('damageBonus', true, { - target: target, - card: card - }), damage = 1, isZhu = function (tar) { - return tar.isZhu || tar === game.boss || tar === game.trueZhu || tar === game.falseZhu; - }, canSha = function (tar, blur) { - let known = tar.getKnownCards(viewer); - if (!blur) return known.some(card => { - let name = get.name(card, tar); - return (name === 'sha' || name === 'hufu' || name === 'yuchanqian') && lib.filter.cardRespondable(card, tar); - }); - if (tar.countCards('hs', i => !known.includes(i)) > 4.67 - 2 * tar.hp / tar.maxHp) return true; - if (!tar.hasSkillTag('respondSha', true, 'respond', true)) return false; - if (tar.hp <= damage) return false; - if (tar.hp <= damage + 1) return isZhu(tar); - return true; - }, self = false; + let evt = _status.event.getParent("useCard"), + pri = 1, + bonus = player.hasSkillTag("damageBonus", true, { + target: target, + card: card, + }), + damage = 1, + isZhu = function (tar) { + return ( + tar.isZhu || + tar === game.boss || + tar === game.trueZhu || + tar === game.falseZhu + ); + }, + canSha = function (tar, blur) { + let known = tar.getKnownCards(viewer); + if (!blur) + return known.some((card) => { + let name = get.name(card, tar); + return ( + (name === "sha" || name === "hufu" || name === "yuchanqian") && + lib.filter.cardRespondable(card, tar) + ); + }); + if ( + tar.countCards("hs", (i) => !known.includes(i)) > + 4.67 - (2 * tar.hp) / tar.maxHp + ) + return true; + if (!tar.hasSkillTag("respondSha", true, "respond", true)) return false; + if (tar.hp <= damage) return false; + if (tar.hp <= damage + 1) return isZhu(tar); + return true; + }, + self = false; if (canSha(target)) return 0; - if (bonus && !viewer.hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; - if ((viewer.hp <= damage || viewer.hp <= damage + 1 && isZhu(viewer)) && !canSha(viewer)) { + if ( + bonus && + !viewer.hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; + if ( + (viewer.hp <= damage || (viewer.hp <= damage + 1 && isZhu(viewer))) && + !canSha(viewer) + ) { if (viewer === target) return status; let fv = true; - if (evt && evt.targets) for (let i of evt.targets) { - if (fv) { - if (target === i) fv = false; - continue; + if (evt && evt.targets) + for (let i of evt.targets) { + if (fv) { + if (target === i) fv = false; + continue; + } + if (viewer == i) { + if (isZhu(viewer)) return 0; + self = true; + break; + } } - if (viewer == i) { - if (isZhu(viewer)) return 0; - self = true; - break; - } - } } let maySha = canSha(target, true); - if (bonus && !target.hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; + if ( + bonus && + !target.hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; else damage = 1; if (isZhu(target)) { if (eff < 0) { - if (target.hp <= damage + 1 || !maySha && target.hp <= damage + 2) return 1; + if (target.hp <= damage + 1 || (!maySha && target.hp <= damage + 2)) return 1; if (maySha && target.hp > damage + 2) return 0; else if (maySha || target.hp > damage + 2) pri = 3; else pri = 4; - } - else if (target.hp > damage + 1) pri = 2; + } else if (target.hp > damage + 1) pri = 2; else return 0; - } - else if (self) return 0; + } else if (self) return 0; else if (eff < 0) { if (!maySha && target.hp <= damage) pri = 5; else if (maySha) return 0; else if (target.hp > damage + 1) pri = 2; else if (target.hp === damage + 1) pri = 3; else pri = 4; - } - else if (target.hp <= damage) return 0; + } else if (target.hp <= damage) return 0; let find = false; - if (evt && evt.targets) for (let i = 0; i < evt.targets.length; i++) { - if (!find) { - if (evt.targets[i] === target) find = true; - continue; - } - let att1 = get.attitude(viewer, evt.targets[i]), eff1 = get.effect(evt.targets[i], card, player, evt.targets[i]), temp = 1; - if (Math.abs(att1) < 1 || att1 * eff1 >= 0 || canSha(evt.targets[i])) continue; - maySha = canSha(evt.targets[i], true); - if (bonus && !evt.targets[i].hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; - else damage = 1; - if (isZhu(evt.targets[i])) { - if (eff1 < 0) { - if (evt.targets[i].hp <= damage + 1 || !maySha && evt.targets[i].hp <= damage + 2) return 0; - if (maySha && evt.targets[i].hp > damage + 2) continue; - if (maySha || evt.targets[i].hp > damage + 2) temp = 3; - else temp = 4; + if (evt && evt.targets) + for (let i = 0; i < evt.targets.length; i++) { + if (!find) { + if (evt.targets[i] === target) find = true; + continue; } - else if (evt.targets[i].hp > damage + 1) temp = 2; - else continue; + let att1 = get.attitude(viewer, evt.targets[i]), + eff1 = get.effect(evt.targets[i], card, player, evt.targets[i]), + temp = 1; + if (Math.abs(att1) < 1 || att1 * eff1 >= 0 || canSha(evt.targets[i])) + continue; + maySha = canSha(evt.targets[i], true); + if ( + bonus && + !evt.targets[i].hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; + else damage = 1; + if (isZhu(evt.targets[i])) { + if (eff1 < 0) { + if ( + evt.targets[i].hp <= damage + 1 || + (!maySha && evt.targets[i].hp <= damage + 2) + ) + return 0; + if (maySha && evt.targets[i].hp > damage + 2) continue; + if (maySha || evt.targets[i].hp > damage + 2) temp = 3; + else temp = 4; + } else if (evt.targets[i].hp > damage + 1) temp = 2; + else continue; + } else if (eff1 < 0) { + if (!maySha && evt.targets[i].hp <= damage) temp = 5; + else if (maySha) continue; + else if (evt.targets[i].hp > damage + 1) temp = 2; + else if (evt.targets[i].hp === damage + 1) temp = 3; + else temp = 4; + } else if (evt.targets[i].hp > damage + 1) temp = 2; + if (temp > pri) return 0; } - else if (eff1 < 0) { - if (!maySha && evt.targets[i].hp <= damage) temp = 5; - else if (maySha) continue; - else if (evt.targets[i].hp > damage + 1) temp = 2; - else if (evt.targets[i].hp === damage + 1) temp = 3; - else temp = 4; - } - else if (evt.targets[i].hp > damage + 1) temp = 2; - if (temp > pri) return 0; - } return 1; }, basic: { order: 9, useful: [5, 1], - value: 5 + value: 5, }, result: { player(player, target) { - if (player._nanman_temp || player.hasSkillTag('jueqing', false, target)) return 0; + if (player._nanman_temp || player.hasSkillTag("jueqing", false, target)) return 0; player._nanman_temp = true; - let eff = get.effect(target, new lib.element.VCard({ name: 'nanman' }), player, target); + let eff = get.effect( + target, + new lib.element.VCard({ name: "nanman" }), + player, + target + ); delete player._nanman_temp; if (eff >= 0) return 0; - if (target.hp > 2 || target.hp > 1 && !target.isZhu && target != game.boss && target != game.trueZhu && target != game.falseZhu) return 0; - if (target.hp > 1 && target.hasSkillTag('respondSha', true, 'respond', true)) return 0; + if ( + target.hp > 2 || + (target.hp > 1 && + !target.isZhu && + target != game.boss && + target != game.trueZhu && + target != game.falseZhu) + ) + return 0; + if (target.hp > 1 && target.hasSkillTag("respondSha", true, "respond", true)) + return 0; let known = target.getKnownCards(player); - if (known.some(card => { - let name = get.name(card, target); - if (name === 'sha' || name === 'hufu' || name === 'yuchanqian') return lib.filter.cardRespondable(card, target); - if (name === 'wuxie') return lib.filter.cardEnabled(card, target, 'forceEnable'); - })) return 0; - if (target.hp > 1 || target.countCards('hs', i => !known.includes(i)) > 4.67 - 2 * target.hp / target.maxHp) return 0; - let res = 0, att = get.sgnAttitude(player, target); - res -= att * (0.8 * target.countCards('hs') + 0.6 * target.countCards('e') + 3.6); - if (get.mode() === 'identity' && target.identity === 'fan') res += 2.4; - if (get.mode() === 'guozhan' && player.identity !== 'ye' && player.identity === target.identity || - get.mode() === 'identity' && player.identity === 'zhu' && (target.identity === 'zhong' || target.identity === 'mingzhong')) res -= 0.8 * player.countCards('he'); + if ( + known.some((card) => { + let name = get.name(card, target); + if (name === "sha" || name === "hufu" || name === "yuchanqian") + return lib.filter.cardRespondable(card, target); + if (name === "wuxie") + return lib.filter.cardEnabled(card, target, "forceEnable"); + }) + ) + return 0; + if ( + target.hp > 1 || + target.countCards("hs", (i) => !known.includes(i)) > + 4.67 - (2 * target.hp) / target.maxHp + ) + return 0; + let res = 0, + att = get.sgnAttitude(player, target); + res -= att * (0.8 * target.countCards("hs") + 0.6 * target.countCards("e") + 3.6); + if (get.mode() === "identity" && target.identity === "fan") res += 2.4; + if ( + (get.mode() === "guozhan" && + player.identity !== "ye" && + player.identity === target.identity) || + (get.mode() === "identity" && + player.identity === "zhu" && + (target.identity === "zhong" || target.identity === "mingzhong")) + ) + res -= 0.8 * player.countCards("he"); return res; }, target(player, target) { - let zhu = (get.mode() === 'identity' && target.isZhu) || target.identity === 'zhu'; - if (!lib.filter.cardRespondable({ name: 'sha' }, target)) { + let zhu = + (get.mode() === "identity" && target.isZhu) || target.identity === "zhu"; + if (!lib.filter.cardRespondable({ name: "sha" }, target)) { if (zhu) { if (target.hp < 2) return -99; if (target.hp === 2) return -3.6; @@ -1159,12 +1476,17 @@ game.import('card', function () { return -2; } let known = target.getKnownCards(player); - if (known.some(card => { - let name = get.name(card, target); - if (name === 'sha' || name === 'hufu' || name === 'yuchanqian') return lib.filter.cardRespondable(card, target); - if (name === 'wuxie') return lib.filter.cardEnabled(card, target, 'forceEnable'); - })) return -1.2; - let nh = target.countCards('hs', i => !known.includes(i)); + if ( + known.some((card) => { + let name = get.name(card, target); + if (name === "sha" || name === "hufu" || name === "yuchanqian") + return lib.filter.cardRespondable(card, target); + if (name === "wuxie") + return lib.filter.cardEnabled(card, target, "forceEnable"); + }) + ) + return -1.2; + let nh = target.countCards("hs", (i) => !known.includes(i)); if (zhu && target.hp <= 1) { if (nh === 0) return -99; if (nh === 1) return -60; @@ -1173,197 +1495,274 @@ game.import('card', function () { if (nh === 4) return -8; return -5; } - if (target.hasSkillTag('respondSha', true, 'respond', true)) return -1.35; + if (target.hasSkillTag("respondSha", true, "respond", true)) return -1.35; if (!nh) return -2; if (nh === 1) return -1.8; return -1.5; - } + }, }, tag: { respond: 1, respondSha: 1, damage: 1, multitarget: 1, - multineg: 1 - } - } - }, - wanjian:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - reverseOrder:true, - defaultYingbianEffect:'remove', - filterTarget:function(card,player,target){ - return target!=player; + multineg: 1, + }, }, - content:function(){ - "step 0" - if(typeof event.shanRequired!='number'||!event.shanRequired||event.shanRequired<0) event.shanRequired=1; - if(typeof event.baseDamage!='number') event.baseDamage=1; - "step 1" - if(event.directHit) event._result={bool:false}; - else{ - var next=target.chooseToRespond({name:'shan'}); - if(event.shanRequired>1){ - next.set('prompt2','共需打出'+event.shanRequired+'张闪'); + }, + wanjian: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + reverseOrder: true, + defaultYingbianEffect: "remove", + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + if ( + typeof event.shanRequired != "number" || + !event.shanRequired || + event.shanRequired < 0 + ) + event.shanRequired = 1; + if (typeof event.baseDamage != "number") event.baseDamage = 1; + "step 1"; + if (event.directHit) event._result = { bool: false }; + else { + var next = target.chooseToRespond({ name: "shan" }); + if (event.shanRequired > 1) { + next.set("prompt2", "共需打出" + event.shanRequired + "张闪"); } - next.set('ai',function(card){ - var evt=_status.event.getParent(); - if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; - if(evt.player.hasSkillTag('notricksource')) return 0; - if(evt.target.hasSkillTag('notrick')) return 0; - if(evt.target.hasSkillTag('noShan')){ + next.set("ai", function (card) { + var evt = _status.event.getParent(); + if (get.damageEffect(evt.target, evt.player, evt.target) >= 0) return 0; + if (evt.player.hasSkillTag("notricksource")) return 0; + if (evt.target.hasSkillTag("notrick")) return 0; + if (evt.target.hasSkillTag("noShan")) { return -1; } - return get.order(card); + return get.order(card); }); - next.autochoose=lib.filter.autoRespondShan; + next.autochoose = lib.filter.autoRespondShan; } - "step 2" - if(result.bool==false){ + "step 2"; + if (result.bool == false) { target.damage(); - } - else{ + } else { event.shanRequired--; - if(event.shanRequired>0) event.goto(1); + if (event.shanRequired > 0) event.goto(1); } }, - ai:{ + ai: { wuxie(target, card, player, viewer, status) { - let att = get.attitude(viewer, target), eff = get.effect(target, card, player, target); + let att = get.attitude(viewer, target), + eff = get.effect(target, card, player, target); if (Math.abs(att) < 1 || status * eff * att >= 0) return 0; - let evt = _status.event.getParent('useCard'), pri = 1, bonus = player.hasSkillTag('damageBonus', true, { - target: target, - card: card - }), damage = 1, isZhu = function (tar) { - return tar.isZhu || tar === game.boss || tar === game.trueZhu || tar === game.falseZhu; - }, canShan = function (tar, blur) { - let known = tar.getKnownCards(viewer); - if (!blur) return known.some(card => { - let name = get.name(card, tar); - return (name === 'shan' || name === 'hufu') && lib.filter.cardRespondable(card, tar); - }); - if (tar.countCards('hs', i => !known.includes(i)) > 3.67 - 2 * tar.hp / tar.maxHp) return true; - if (!tar.hasSkillTag('respondShan', true, 'respond', true)) return false; - if (tar.hp <= damage) return false; - if (tar.hp <= damage + 1) return isZhu(tar); - return true; - }, self = false; + let evt = _status.event.getParent("useCard"), + pri = 1, + bonus = player.hasSkillTag("damageBonus", true, { + target: target, + card: card, + }), + damage = 1, + isZhu = function (tar) { + return ( + tar.isZhu || + tar === game.boss || + tar === game.trueZhu || + tar === game.falseZhu + ); + }, + canShan = function (tar, blur) { + let known = tar.getKnownCards(viewer); + if (!blur) + return known.some((card) => { + let name = get.name(card, tar); + return ( + (name === "shan" || name === "hufu") && + lib.filter.cardRespondable(card, tar) + ); + }); + if ( + tar.countCards("hs", (i) => !known.includes(i)) > + 3.67 - (2 * tar.hp) / tar.maxHp + ) + return true; + if (!tar.hasSkillTag("respondShan", true, "respond", true)) return false; + if (tar.hp <= damage) return false; + if (tar.hp <= damage + 1) return isZhu(tar); + return true; + }, + self = false; if (canShan(target)) return 0; - if (bonus && !viewer.hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; - if ((viewer.hp <= damage || viewer.hp <= damage + 1 && isZhu(viewer)) && !canShan(viewer)) { + if ( + bonus && + !viewer.hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; + if ( + (viewer.hp <= damage || (viewer.hp <= damage + 1 && isZhu(viewer))) && + !canShan(viewer) + ) { if (viewer === target) return status; let fv = true; - if (evt && evt.targets) for (let i of evt.targets) { - if (fv) { - if (target === i) fv = false; - continue; + if (evt && evt.targets) + for (let i of evt.targets) { + if (fv) { + if (target === i) fv = false; + continue; + } + if (viewer == i) { + if (isZhu(viewer)) return 0; + self = true; + break; + } } - if (viewer == i) { - if (isZhu(viewer)) return 0; - self = true; - break; - } - } } let mayShan = canShan(target, true); - if (bonus && !target.hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; + if ( + bonus && + !target.hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; else damage = 1; if (isZhu(target)) { if (eff < 0) { - if (target.hp <= damage + 1 || !mayShan && target.hp <= damage + 2) return 1; + if (target.hp <= damage + 1 || (!mayShan && target.hp <= damage + 2)) + return 1; if (mayShan && target.hp > damage + 2) return 0; else if (mayShan || target.hp > damage + 2) pri = 3; else pri = 4; - } - else if (target.hp > damage + 1) pri = 2; + } else if (target.hp > damage + 1) pri = 2; else return 0; - } - else if (self) return 0; + } else if (self) return 0; else if (eff < 0) { if (!mayShan && target.hp <= damage) pri = 5; else if (mayShan) return 0; else if (target.hp > damage + 1) pri = 2; else if (target.hp === damage + 1) pri = 3; else pri = 4; - } - else if (target.hp <= damage) return 0; + } else if (target.hp <= damage) return 0; let find = false; - if (evt && evt.targets) for (let i = 0; i < evt.targets.length; i++) { - if (!find) { - if (evt.targets[i] === target) find = true; - continue; - } - let att1 = get.attitude(viewer, evt.targets[i]), eff1 = get.effect(evt.targets[i], card, player, evt.targets[i]), temp = 1; - if (Math.abs(att1) < 1 || att1 * eff1 >= 0 || canShan(evt.targets[i])) continue; - mayShan = canShan(evt.targets[i], true); - if (bonus && !evt.targets[i].hasSkillTag('filterDamage', null, { - player: player, - card: card - })) damage = 2; - else damage = 1; - if (isZhu(evt.targets[i])) { - if (eff1 < 0) { - if (evt.targets[i].hp <= damage + 1 || !mayShan && evt.targets[i].hp <= damage + 2) return 0; - if (mayShan && evt.targets[i].hp > damage + 2) continue; - if (mayShan || evt.targets[i].hp > damage + 2) temp = 3; - else temp = 4; + if (evt && evt.targets) + for (let i = 0; i < evt.targets.length; i++) { + if (!find) { + if (evt.targets[i] === target) find = true; + continue; } - else if (evt.targets[i].hp > damage + 1) temp = 2; - else continue; + let att1 = get.attitude(viewer, evt.targets[i]), + eff1 = get.effect(evt.targets[i], card, player, evt.targets[i]), + temp = 1; + if (Math.abs(att1) < 1 || att1 * eff1 >= 0 || canShan(evt.targets[i])) + continue; + mayShan = canShan(evt.targets[i], true); + if ( + bonus && + !evt.targets[i].hasSkillTag("filterDamage", null, { + player: player, + card: card, + }) + ) + damage = 2; + else damage = 1; + if (isZhu(evt.targets[i])) { + if (eff1 < 0) { + if ( + evt.targets[i].hp <= damage + 1 || + (!mayShan && evt.targets[i].hp <= damage + 2) + ) + return 0; + if (mayShan && evt.targets[i].hp > damage + 2) continue; + if (mayShan || evt.targets[i].hp > damage + 2) temp = 3; + else temp = 4; + } else if (evt.targets[i].hp > damage + 1) temp = 2; + else continue; + } else if (eff1 < 0) { + if (!mayShan && evt.targets[i].hp <= damage) temp = 5; + else if (mayShan) continue; + else if (evt.targets[i].hp > damage + 1) temp = 2; + else if (evt.targets[i].hp === damage + 1) temp = 3; + else temp = 4; + } else if (evt.targets[i].hp > damage + 1) temp = 2; + if (temp > pri) return 0; } - else if (eff1 < 0) { - if (!mayShan && evt.targets[i].hp <= damage) temp = 5; - else if (mayShan) continue; - else if (evt.targets[i].hp > damage + 1) temp = 2; - else if (evt.targets[i].hp === damage + 1) temp = 3; - else temp = 4; - } - else if (evt.targets[i].hp > damage + 1) temp = 2; - if (temp > pri) return 0; - } return 1; }, basic: { order: 9, useful: 1, - value: 5 + value: 5, }, result: { player(player, target) { - if (player._wanjian_temp || player.hasSkillTag('jueqing', false, target)) return 0; + if (player._wanjian_temp || player.hasSkillTag("jueqing", false, target)) + return 0; player._wanjian_temp = true; - let eff = get.effect(target, new lib.element.VCard({ name: 'wanjian' }), player, target); + let eff = get.effect( + target, + new lib.element.VCard({ name: "wanjian" }), + player, + target + ); delete player._wanjian_temp; if (eff >= 0) return 0; - if (target.hp > 2 || target.hp > 1 && !target.isZhu && target != game.boss && target != game.trueZhu && target != game.falseZhu) return 0; - if (target.hp > 1 && target.hasSkillTag('respondShan', true, 'respond', true)) return 0; + if ( + target.hp > 2 || + (target.hp > 1 && + !target.isZhu && + target != game.boss && + target != game.trueZhu && + target != game.falseZhu) + ) + return 0; + if (target.hp > 1 && target.hasSkillTag("respondShan", true, "respond", true)) + return 0; let known = target.getKnownCards(player); - if (known.some(card => { - let name = get.name(card, target); - if (name === 'shan' || name === 'hufu') return lib.filter.cardRespondable(card, target); - if (name === 'wuxie') return lib.filter.cardEnabled(card, target, 'forceEnable'); - })) return 0; - if (target.hp > 1 || target.countCards('hs', i => !known.includes(i)) > 3.67 - 2 * target.hp / target.maxHp) return 0; - let res = 0, att = get.sgnAttitude(player, target); - res -= att * (0.8 * target.countCards('hs') + 0.6 * target.countCards('e') + 3.6); - if (get.mode() === 'identity' && target.identity === 'fan') res += 2.4; - if (get.mode() === 'guozhan' && player.identity !== 'ye' && player.identity === target.identity || - get.mode() === 'identity' && player.identity === 'zhu' && (target.identity === 'zhong' || target.identity === 'mingzhong')) res -= 0.8 * player.countCards('he'); + if ( + known.some((card) => { + let name = get.name(card, target); + if (name === "shan" || name === "hufu") + return lib.filter.cardRespondable(card, target); + if (name === "wuxie") + return lib.filter.cardEnabled(card, target, "forceEnable"); + }) + ) + return 0; + if ( + target.hp > 1 || + target.countCards("hs", (i) => !known.includes(i)) > + 3.67 - (2 * target.hp) / target.maxHp + ) + return 0; + let res = 0, + att = get.sgnAttitude(player, target); + res -= att * (0.8 * target.countCards("hs") + 0.6 * target.countCards("e") + 3.6); + if (get.mode() === "identity" && target.identity === "fan") res += 2.4; + if ( + (get.mode() === "guozhan" && + player.identity !== "ye" && + player.identity === target.identity) || + (get.mode() === "identity" && + player.identity === "zhu" && + (target.identity === "zhong" || target.identity === "mingzhong")) + ) + res -= 0.8 * player.countCards("he"); return res; }, target(player, target) { - let zhu = (get.mode() === 'identity' && target.isZhu) || target.identity === 'zhu'; - if (!lib.filter.cardRespondable({ name: 'shan' }, target)) { + let zhu = + (get.mode() === "identity" && target.isZhu) || target.identity === "zhu"; + if (!lib.filter.cardRespondable({ name: "shan" }, target)) { if (zhu) { if (target.hp < 2) return -99; if (target.hp === 2) return -3.6; @@ -1371,12 +1770,17 @@ game.import('card', function () { return -2; } let known = target.getKnownCards(player); - if (known.some(card => { - let name = get.name(card, target); - if (name === 'shan' || name === 'hufu') return lib.filter.cardRespondable(card, target); - if (name === 'wuxie') return lib.filter.cardEnabled(card, target, 'forceEnable'); - })) return -1.2; - let nh = target.countCards('hs', i => !known.includes(i)); + if ( + known.some((card) => { + let name = get.name(card, target); + if (name === "shan" || name === "hufu") + return lib.filter.cardRespondable(card, target); + if (name === "wuxie") + return lib.filter.cardEnabled(card, target, "forceEnable"); + }) + ) + return -1.2; + let nh = target.countCards("hs", (i) => !known.includes(i)); if (zhu && target.hp <= 1) { if (nh === 0) return -99; if (nh === 1) return -60; @@ -1384,186 +1788,218 @@ game.import('card', function () { if (nh === 3) return -8; return -5; } - if (target.hasSkillTag('respondShan', true, 'respond', true)) return -1.35; + if (target.hasSkillTag("respondShan", true, "respond", true)) return -1.35; if (!nh) return -2; if (nh === 1) return -1.65; return -1.5; - } + }, }, tag: { respond: 1, respondShan: 1, damage: 1, multitarget: 1, - multineg: 1 - } - } - }, - wuzhong:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - cardcolor:'red', - toself:true, - filterTarget:function(card,player,target){ - return target==player; + multineg: 1, + }, }, - modTarget:true, - content:function(){ - if(get.is.versus()){ - if(game.friend.includes(target)){ - if(game.friend.lengthgame.enemy.length){ - target.draw(3);return; + } else { + if (game.friend.length > game.enemy.length) { + target.draw(3); + return; } } } target.draw(2); }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.mode()=='guozhan'){ - if(!_status._aozhan){ - if(!player.isMajor()){ - if(!viewer.isMajor()) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.mode() == "guozhan") { + if (!_status._aozhan) { + if (!player.isMajor()) { + if (!viewer.isMajor()) return 0; } } } }, - basic:{ - order:7.2, - useful:4.5, - value:9.2 + basic: { + order: 7.2, + useful: 4.5, + value: 9.2, }, - result:{ - target:2, + result: { + target: 2, + }, + tag: { + draw: 2, }, - tag:{ - draw:2 - } - } - }, - juedou:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - defaultYingbianEffect:'hit', - filterTarget:function(card,player,target){ - return target!=player; }, - content:function(){ - "step 0" - if(event.turn==undefined) event.turn=target; - if(typeof event.baseDamage!='number') event.baseDamage=1; - if(typeof event.extraDamage!='number'){ - event.extraDamage=0; + }, + juedou: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + defaultYingbianEffect: "hit", + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + if (event.turn == undefined) event.turn = target; + if (typeof event.baseDamage != "number") event.baseDamage = 1; + if (typeof event.extraDamage != "number") { + event.extraDamage = 0; } - if(!event.shaReq) event.shaReq={}; - if(typeof event.shaReq[player.playerid]!='number') event.shaReq[player.playerid]=1; - if(typeof event.shaReq[target.playerid]!='number') event.shaReq[target.playerid]=1; - event.playerCards=[]; - event.targetCards=[]; - "step 1" - event.trigger('juedou'); - event.shaRequired=event.shaReq[event.turn.playerid]; - "step 2" - if(event.directHit){ - event._result={bool:false}; - } - else{ - var next=event.turn.chooseToRespond({name:'sha'}); - if(event.shaRequired>1) next.set('prompt2','共需打出'+event.shaRequired+'张杀'); - next.set('ai',function(card){ - let event=_status.event,player=event.splayer,target=event.starget; - if(player.hasSkillTag('notricksource')||target.hasSkillTag('notrick')) return 0; - if(event.shaRequired>1&&player.countCards('h','sha')=0||player.hasSkill('naman')) return -1; - if(get.attitude(target,player)<=0||event.player.hp<=1&&_status.event.tdamage<_status.event.pdamage){ + if (!event.shaReq) event.shaReq = {}; + if (typeof event.shaReq[player.playerid] != "number") event.shaReq[player.playerid] = 1; + if (typeof event.shaReq[target.playerid] != "number") event.shaReq[target.playerid] = 1; + event.playerCards = []; + event.targetCards = []; + "step 1"; + event.trigger("juedou"); + event.shaRequired = event.shaReq[event.turn.playerid]; + "step 2"; + if (event.directHit) { + event._result = { bool: false }; + } else { + var next = event.turn.chooseToRespond({ name: "sha" }); + if (event.shaRequired > 1) + next.set("prompt2", "共需打出" + event.shaRequired + "张杀"); + next.set("ai", function (card) { + let event = _status.event, + player = event.splayer, + target = event.starget; + if (player.hasSkillTag("notricksource") || target.hasSkillTag("notrick")) + return 0; + if (event.shaRequired > 1 && player.countCards("h", "sha") < event.shaRequired) + return 0; + if (event.player === target) { + if (_status.event.tdamage >= 0 || player.hasSkill("naman")) return -1; + if ( + get.attitude(target, player) <= 0 || + (event.player.hp <= 1 && _status.event.tdamage < _status.event.pdamage) + ) { return get.order(card); } return -1; - } - else{ - if(_status.event.pdamage>=0||target.hasSkill('naman')) return -1; - if(get.attitude(player,target)<=0||event.player.hp<=1&&_status.event.tdamage>_status.event.pdamage){ + } else { + if (_status.event.pdamage >= 0 || target.hasSkill("naman")) return -1; + if ( + get.attitude(player, target) <= 0 || + (event.player.hp <= 1 && _status.event.tdamage > _status.event.pdamage) + ) { return get.order(card); } return -1; } }); - next.set('splayer',player); - next.set('starget',target); - next.set('pdamage',get.damageEffect(player,target,event.turn)); - next.set('tdamage',get.damageEffect(target,player,event.turn)); - next.set('shaRequired',event.shaRequired); - next.autochoose=lib.filter.autoRespondSha; - if(event.turn==target){ - next.source=player; - } - else{ - next.source=target; + next.set("splayer", player); + next.set("starget", target); + next.set("pdamage", get.damageEffect(player, target, event.turn)); + next.set("tdamage", get.damageEffect(target, player, event.turn)); + next.set("shaRequired", event.shaRequired); + next.autochoose = lib.filter.autoRespondSha; + if (event.turn == target) { + next.source = player; + } else { + next.source = target; } } - "step 3" - if(result.bool){ + "step 3"; + if (result.bool) { event.shaRequired--; - if(event.turn==target){ - if(result.cards) event.targetCards.addArray(result.cards); - if(event.shaRequired>0) event.goto(2); - else{ - event.turn=player; + if (event.turn == target) { + if (result.cards) event.targetCards.addArray(result.cards); + if (event.shaRequired > 0) event.goto(2); + else { + event.turn = player; + event.goto(1); + } + } else { + if (result.cards) event.playerCards.addArray(result.cards); + if (event.shaRequired > 0) event.goto(2); + else { + event.turn = target; event.goto(1); } } - else{ - if(result.cards) event.playerCards.addArray(result.cards); - if(event.shaRequired>0) event.goto(2); - else{ - event.turn=target; - event.goto(1); - } - } - } - else{ - if(event.turn==target){ + } else { + if (event.turn == target) { target.damage(); - } - else{ + } else { player.damage(target); } } - event._result={}; + event._result = {}; }, - ai:{ - wuxie:function(target,card,player,viewer,status){ - if(player===game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0; - if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0; + ai: { + wuxie: function (target, card, player, viewer, status) { + if (player === game.me && get.attitude(viewer, player._trueMe || player) > 0) + return 0; + if ( + status * + get.attitude(viewer, target) * + get.effect(target, card, player, target) >= + 0 + ) + return 0; }, - basic:{ - order:5, - useful:1, - value:5.5 + basic: { + order: 5, + useful: 1, + value: 5.5, }, - result:{ + result: { player(player, target, card) { - if (player.hasSkillTag('directHit_ai', true, { - target: target, - card: card - }, true)) return 0; + if ( + player.hasSkillTag( + "directHit_ai", + true, + { + target: target, + card: card, + }, + true + ) + ) + return 0; if (get.damageEffect(target, player, target) >= 0) return 0; - let pd = get.damageEffect(player, target, player), att = get.attitude(player, target); + let pd = get.damageEffect(player, target, player), + att = get.attitude(player, target); if (att > 0 && get.damageEffect(target, player, player) > pd) return 0; - let ts = target.mayHaveSha(player, 'respond', null, 'count'), ps = player.mayHaveSha(player, 'respond', player.getCards('h', i => { - return card === i || card.cards && card.cards.includes(i) || ui.selected.cards.includes(i); - }), 'count'); + let ts = target.mayHaveSha(player, "respond", null, "count"), + ps = player.mayHaveSha( + player, + "respond", + player.getCards("h", (i) => { + return ( + card === i || + (card.cards && card.cards.includes(i)) || + ui.selected.cards.includes(i) + ); + }), + "count" + ); if (ts < 1 && ts << 3 < Math.pow(player.hp, 2)) return 0; if (att > 0) { if (ts < 1) return 0; @@ -1574,672 +2010,925 @@ game.import('card', function () { return -2 - ts; }, target(player, target, card) { - if (player.hasSkillTag('directHit_ai', true, { - target: target, - card: card - }, true)) return -2; + if ( + player.hasSkillTag( + "directHit_ai", + true, + { + target: target, + card: card, + }, + true + ) + ) + return -2; let td = get.damageEffect(target, player, target); if (td >= 0) return td / get.attitude(target, target); - let pd = get.damageEffect(player, target, player), att = get.attitude(player, target); + let pd = get.damageEffect(player, target, player), + att = get.attitude(player, target); if (att > 0 && get.damageEffect(target, player, player) > pd) return -2; - let ts = target.mayHaveSha(player, 'respond', null, 'count'), ps = player.mayHaveSha(player, 'respond', player.getCards('h', i => { - return card === i || card.cards && card.cards.includes(i) || ui.selected.cards.includes(i); - }), 'count'); + let ts = target.mayHaveSha(player, "respond", null, "count"), + ps = player.mayHaveSha( + player, + "respond", + player.getCards("h", (i) => { + return ( + card === i || + (card.cards && card.cards.includes(i)) || + ui.selected.cards.includes(i) + ); + }), + "count" + ); if (ts < 1) return -1.5; if (att > 0) return -2; if (ts - ps < 1) return -2 - ts; if (pd >= 0) return -1; return -ts; - } + }, }, - tag:{ - respond:2, - respondSha:2, - damage:1, - } - } + tag: { + respond: 2, + respondSha: 2, + damage: 1, + }, + }, }, - shunshou:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - range:{global:1}, - selectTarget:1, - postAi:function(targets){ - return targets.length==1&&targets[0].countCards('j'); + shunshou: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + range: { global: 1 }, + selectTarget: 1, + postAi: function (targets) { + return targets.length == 1 && targets[0].countCards("j"); }, - filterTarget:function(card,player,target){ - if(player==target) return false; - return target.hasCard(card=>lib.filter.canBeGained(card,player,target),get.is.single()?'he':'hej'); + filterTarget: function (card, player, target) { + if (player == target) return false; + return target.hasCard( + (card) => lib.filter.canBeGained(card, player, target), + get.is.single() ? "he" : "hej" + ); }, - content:function(){ - let pos=get.is.single()?'he':'hej'; - if(target.countGainableCards(player,pos)) player.gainPlayerCard(pos, target, true).set('target',target).set("complexSelect",false).set('ai',lib.card.shunshou.ai.button); + content: function () { + let pos = get.is.single() ? "he" : "hej"; + if (target.countGainableCards(player, pos)) + player + .gainPlayerCard(pos, target, true) + .set("target", target) + .set("complexSelect", false) + .set("ai", lib.card.shunshou.ai.button); }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.attitude(viewer,player._trueMe||player)>0) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.attitude(viewer, player._trueMe || player) > 0) return 0; }, - basic:{ - order:7.5, - useful:(card,i)=>8/(3+i), - value:(card,player)=>{ - let max=0; - game.countPlayer(cur=>{ - max=Math.max(max,lib.card.shunshou.ai.result.target(player,cur)*get.attitude(player,cur)); + basic: { + order: 7.5, + useful: (card, i) => 8 / (3 + i), + value: (card, player) => { + let max = 0; + game.countPlayer((cur) => { + max = Math.max( + max, + lib.card.shunshou.ai.result.target(player, cur) * + get.attitude(player, cur) + ); }); - if(max<=0) return 2; - return 0.53*max; - } + if (max <= 0) return 2; + return 0.53 * max; + }, }, - button:(button)=>{ - let player = _status.event.player, target = _status.event.target; - if(!lib.filter.canBeGained(button.link,player,target)) return 0; + button: (button) => { + let player = _status.event.player, + target = _status.event.target; + if (!lib.filter.canBeGained(button.link, player, target)) return 0; let att = get.attitude(player, target), - val = get.value(button.link,player)/60, + val = get.value(button.link, player) / 60, btv = get.buttonValue(button), pos = get.position(button.link), name = get.name(button.link); - if(pos=='j'){ - if(name=='lebu'){ - let needs=target.needsToDiscard(2); - btv*=1.08+0.2*needs; - } - else if(name=='shandian'||name=='fulei'||name=='plague') btv/=2; + if (pos == "j") { + if (name == "lebu") { + let needs = target.needsToDiscard(2); + btv *= 1.08 + 0.2 * needs; + } else if (name == "shandian" || name == "fulei" || name == "plague") btv /= 2; } - if(get.attitude(player,get.owner(button.link))>0) btv=-btv; - if(pos!='e'){ - if(pos=='h'&&!player.hasSkillTag('viewHandcard',null,target,true)) return btv+0.1; - return btv+val; + if (get.attitude(player, get.owner(button.link)) > 0) btv = -btv; + if (pos != "e") { + if (pos == "h" && !player.hasSkillTag("viewHandcard", null, target, true)) + return btv + 0.1; + return btv + val; } let sub = get.subtype(button.link); - if(sub=='equip1') return btv*Math.min(3.6,target.hp)/3; - if(sub=='equip2'){ - if(name=='baiyin'&&pos=='e'&&target.isDamaged()){ - let by=3-0.6*Math.min(5,target.hp); - return get.sgn(get.recoverEffect(target,player,player))*by; + if (sub == "equip1") return (btv * Math.min(3.6, target.hp)) / 3; + if (sub == "equip2") { + if (name == "baiyin" && pos == "e" && target.isDamaged()) { + let by = 3 - 0.6 * Math.min(5, target.hp); + return get.sgn(get.recoverEffect(target, player, player)) * by; } - return 1.57*btv+val; + return 1.57 * btv + val; } - if(att<=0&&(sub=='equip3'||sub=='equip4')&&(player.hasSkill('shouli')||player.hasSkill('psshouli'))) return 0; - if(sub=='equip3'&&!game.hasPlayer((cur)=>!cur.inRange(target)&&get.attitude(cur,target)<0)) return 0.4*btv+val; - if(sub=='equip4') return btv/2+val; - return btv+val; + if ( + att <= 0 && + (sub == "equip3" || sub == "equip4") && + (player.hasSkill("shouli") || player.hasSkill("psshouli")) + ) + return 0; + if ( + sub == "equip3" && + !game.hasPlayer((cur) => !cur.inRange(target) && get.attitude(cur, target) < 0) + ) + return 0.4 * btv + val; + if (sub == "equip4") return btv / 2 + val; + return btv + val; }, - result:{ - player:function(player,target){ - let att=get.attitude(player,target), - hs=target.hasCard((card)=>lib.filter.canBeGained(card,player,target),'h'), - lose=hs, - gain=att>0?0.52:1.28; - if(Math.abs(att)<5.03){ - let temp=0.015*att*att; - if(att<0) gain=0.9+temp; - else gain=0.9-temp; + result: { + player: function (player, target) { + let att = get.attitude(player, target), + hs = target.hasCard( + (card) => lib.filter.canBeGained(card, player, target), + "h" + ), + lose = hs, + gain = att > 0 ? 0.52 : 1.28; + if (Math.abs(att) < 5.03) { + let temp = 0.015 * att * att; + if (att < 0) gain = 0.9 + temp; + else gain = 0.9 - temp; } - target.countCards('e',function(card){ - if(card.name!='jinhe'&&lib.filter.canBeGained(card,player,target)&&att*get.value(card,target)<0){ - lose=true; - let val=get.value(card,player); - if(val>0) gain=Math.max(gain,val/7); + target.countCards("e", function (card) { + if ( + card.name != "jinhe" && + lib.filter.canBeGained(card, player, target) && + att * get.value(card, target) < 0 + ) { + lose = true; + let val = get.value(card, player); + if (val > 0) gain = Math.max(gain, val / 7); } }); - target.countCards('j',function(card){ - let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card; - if(lib.filter.canBeGained(card,player,target)&&att*get.effect(target,cardj,target,target)<0){ - lose=true; - if(cardj.name=='lebu'){ - let needs=target.needsToDiscard(2); - if(att>0) gain=Math.max(gain,1.6+needs/10); - } - else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') gain=Math.max(gain,1.5/Math.max(1,target.hp)); - else if(att>0) gain=Math.max(gain,1.7); + target.countCards("j", function (card) { + let cardj = card.viewAs ? new lib.element.VCard({ name: card.viewAs }) : card; + if ( + lib.filter.canBeGained(card, player, target) && + att * get.effect(target, cardj, target, target) < 0 + ) { + lose = true; + if (cardj.name == "lebu") { + let needs = target.needsToDiscard(2); + if (att > 0) gain = Math.max(gain, 1.6 + needs / 10); + } else if ( + cardj.name == "shandian" || + cardj.name == "fulei" || + cardj.name == "plague" + ) + gain = Math.max(gain, 1.5 / Math.max(1, target.hp)); + else if (att > 0) gain = Math.max(gain, 1.7); } }); - if(!lose) return 0; + if (!lose) return 0; return gain; }, - target:function(player,target){ - let att=get.attitude(player,target), - hs=target.countCards('h',(card)=>lib.filter.canBeGained(card,player,target)), - es=target.countCards('e',(card)=>lib.filter.canBeGained(card,player,target)), - js=target.countCards('j',(card)=>lib.filter.canBeGained(card,player,target)), - noh=!hs||target.hasSkillTag('noh'), - noe=!es||target.hasSkillTag('noe'), - check=[-1,att>0?-1.3:1.3,att>0?-2.5:2.5], - idx=-1; - if(hs){ - idx=0; - if(noh) check[0]=0.7; + target: function (player, target) { + let att = get.attitude(player, target), + hs = target.countCards("h", (card) => + lib.filter.canBeGained(card, player, target) + ), + es = target.countCards("e", (card) => + lib.filter.canBeGained(card, player, target) + ), + js = target.countCards("j", (card) => + lib.filter.canBeGained(card, player, target) + ), + noh = !hs || target.hasSkillTag("noh"), + noe = !es || target.hasSkillTag("noe"), + check = [-1, att > 0 ? -1.3 : 1.3, att > 0 ? -2.5 : 2.5], + idx = -1; + if (hs) { + idx = 0; + if (noh) check[0] = 0.7; } - if(es){ - if(idx<0) idx=1; - if(target.getEquip('baiyin')&&target.isDamaged()&&lib.filter.canBeGained(target.getEquip('baiyin'),player,target)){ - let rec=get.recoverEffect(target,player,target); - if(es==1||att*rec>0){ - let val=3-0.6*Math.min(5,target.hp); - if(rec>0) check[1]=val; - else if(rec<0) check[1]=-val; + if (es) { + if (idx < 0) idx = 1; + if ( + target.getEquip("baiyin") && + target.isDamaged() && + lib.filter.canBeGained(target.getEquip("baiyin"), player, target) + ) { + let rec = get.recoverEffect(target, player, target); + if (es == 1 || att * rec > 0) { + let val = 3 - 0.6 * Math.min(5, target.hp); + if (rec > 0) check[1] = val; + else if (rec < 0) check[1] = -val; } } - target.countCards('e',function(card){ - let val=get.value(card,target); - if(card.name=='jinhe'||att*val>=0||!lib.filter.canBeGained(card,player,target)) return false; - if(att>0){ - check[1]=Math.max(1.3,check[1]); + target.countCards("e", function (card) { + let val = get.value(card, target); + if ( + card.name == "jinhe" || + att * val >= 0 || + !lib.filter.canBeGained(card, player, target) + ) + return false; + if (att > 0) { + check[1] = Math.max(1.3, check[1]); return true; } - let sub=get.subtype(card); - if(sub=='equip2'||sub=='equip5') val+=4; - else if(sub=='equip1') val*=0.4*Math.min(3.6,target.hp); - else val*=0.6; - if(target.hp<3&&sub!='equip2'&&sub!='equip5') val*=0.4; - check[1]=Math.min(-0.16*val,check[1]); + let sub = get.subtype(card); + if (sub == "equip2" || sub == "equip5") val += 4; + else if (sub == "equip1") val *= 0.4 * Math.min(3.6, target.hp); + else val *= 0.6; + if (target.hp < 3 && sub != "equip2" && sub != "equip5") val *= 0.4; + check[1] = Math.min(-0.16 * val, check[1]); }); - if(noe) check[1]+=0.9; + if (noe) check[1] += 0.9; } - if(js){ - let func=function(num){ - if(att>0) check[2]=Math.max(check[2],num); - else check[2]=Math.min(check[2],0.6-num); + if (js) { + let func = function (num) { + if (att > 0) check[2] = Math.max(check[2], num); + else check[2] = Math.min(check[2], 0.6 - num); }; - if(idx<0) idx=2; - target.countCards('j',function(card){ - let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card; - if(!lib.filter.canBeGained(card,player,target)||att*get.effect(target,cardj,target,target)>=0) return false; - if(cardj.name=='lebu') func(2.1+0.4*target.needsToDiscard(2)); - else if(cardj.name=='bingliang') func(2.4); - else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') func(Math.abs(check[2])/(1+target.hp)); + if (idx < 0) idx = 2; + target.countCards("j", function (card) { + let cardj = card.viewAs + ? new lib.element.VCard({ name: card.viewAs }) + : card; + if ( + !lib.filter.canBeGained(card, player, target) || + att * get.effect(target, cardj, target, target) >= 0 + ) + return false; + if (cardj.name == "lebu") func(2.1 + 0.4 * target.needsToDiscard(2)); + else if (cardj.name == "bingliang") func(2.4); + else if ( + cardj.name == "shandian" || + cardj.name == "fulei" || + cardj.name == "plague" + ) + func(Math.abs(check[2]) / (1 + target.hp)); else func(2.1); }); } - if(idx<0) return 0; - for(let i=idx+1;i<3;i++){ - if(i==1&&!es||i==2&&!js) continue; - if(att>0&&check[i]>check[idx]||att<=0&&check[i] 0 && check[i] > check[idx]) || (att <= 0 && check[i] < check[idx])) + idx = i; } return check[idx]; - } - }, - tag:{ - loseCard:1, - gain:1, - } - } - }, - shunshou_copy:{ - ai:{ - basic:{ - order:7.5, - useful:4, - value:9 - }, - result:{ - target:function(player,target,card){ - let position='hej'; - if(card&&card.position) position=card.position; - const hs=position.includes('h')?target.getGainableCards(player,'h'):[]; - const es=position.includes('e')?target.getGainableCards(player,'e'):[]; - const js=position.includes('j')?target.getGainableCards(player,'j'):[]; - if(get.attitude(player,target)<=0){ - if(hs.length>0) return -1.5; - return (es.some(card=>{ - return get.value(card,target)>0&&card!=target.getEquip('jinhe'); - })||js.some(card=>{ - var cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - }))?-1.5:1.5; - } - return (es.some(card=>{ - return get.value(card,target)<=0; - })||js.some(card=>{ - var cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - }))?1.5:-1.5; }, - player:function(player,target,card){ - let position='hej'; - if(card&&card.position) position=card.position; - const hs=position.includes('h')?target.getGainableCards(player,'h'):[]; - const es=position.includes('e')?target.getGainableCards(player,'e'):[]; - const js=position.includes('j')?target.getGainableCards(player,'j'):[]; - const att=get.attitude(player,target); - if(att<0){ - if(!hs.length&&!es.some(card=>{ - return get.value(card,target)>0&&card!=target.getEquip('jinhe'); - })&&!js.some(card=>{ - var cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - })) return 0; + }, + tag: { + loseCard: 1, + gain: 1, + }, + }, + }, + shunshou_copy: { + ai: { + basic: { + order: 7.5, + useful: 4, + value: 9, + }, + result: { + target: function (player, target, card) { + let position = "hej"; + if (card && card.position) position = card.position; + const hs = position.includes("h") ? target.getGainableCards(player, "h") : []; + const es = position.includes("e") ? target.getGainableCards(player, "e") : []; + const js = position.includes("j") ? target.getGainableCards(player, "j") : []; + if (get.attitude(player, target) <= 0) { + if (hs.length > 0) return -1.5; + return es.some((card) => { + return get.value(card, target) > 0 && card != target.getEquip("jinhe"); + }) || + js.some((card) => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) + ? -1.5 + : 1.5; } - else if(att>1){ - return (es.some(card=>{ - return get.value(card,target)<=0; - })||js.some(card=>{ - var cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - }))?1.5:0; + return es.some((card) => { + return get.value(card, target) <= 0; + }) || + js.some((card) => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) + ? 1.5 + : -1.5; + }, + player: function (player, target, card) { + let position = "hej"; + if (card && card.position) position = card.position; + const hs = position.includes("h") ? target.getGainableCards(player, "h") : []; + const es = position.includes("e") ? target.getGainableCards(player, "e") : []; + const js = position.includes("j") ? target.getGainableCards(player, "j") : []; + const att = get.attitude(player, target); + if (att < 0) { + if ( + !hs.length && + !es.some((card) => { + return ( + get.value(card, target) > 0 && card != target.getEquip("jinhe") + ); + }) && + !js.some((card) => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) + ) + return 0; + } else if (att > 1) { + return es.some((card) => { + return get.value(card, target) <= 0; + }) || + js.some((card) => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) + ? 1.5 + : 0; } return 1; - } - }, - tag:{ - loseCard:1, - gain:1, - } - } - }, - shunshou_copy2:{ - ai:{ - basic:{ - order:7.5, - useful:4, - value:9 - }, - result:{ - target:function(player,target,card,isLink){ - return lib.card.shunshou_copy.ai.result.target(player,target,{ - name:'shunshou_copy', - position:'he', - },isLink) }, - player:function(player,target,card,isLink){ - return lib.card.shunshou_copy.ai.result.player(player,target,{ - name:'shunshou_copy', - position:'he', - },isLink) - } }, - tag:{ - loseCard:1, - gain:1, - } - } + tag: { + loseCard: 1, + gain: 1, + }, + }, }, - guohe:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:1, - postAi:function(targets){ - return targets.length==1&&targets[0].countCards('j'); - }, - filterTarget:function(card,player,target){ - if(player==target) return false; - return target.hasCard(card=>lib.filter.canBeDiscarded(card,player,target),get.is.single()?'he':'hej'); - }, - defaultYingbianEffect:'add', - content:function(){ - 'step 0' - if(get.is.single()){ - let bool1 = target.countDiscardableCards(player, 'h'), - bool2 = target.countDiscardableCards(player, 'e'); - if(bool1&&bool2) player.chooseControl('手牌区','装备区').set('ai',function(){ - return Math.random() < 0.5 ? 1 : 0; - }).set('prompt', '弃置'+get.translation(target)+'装备区的一张牌,或观看其手牌并弃置其中的一张牌。'); - else event._result={control:bool1?'手牌区':'装备区'}; - } - else event._result={control:'所有区域'}; - 'step 1' - let pos, vis='visible'; - if(result.control=='手牌区') pos='h'; - else if(result.control=='装备区') pos='e'; - else{ - pos='hej'; - vis=undefined; - } - if(target.countDiscardableCards(player,pos)) player.discardPlayerCard(pos, target, true, vis).set('target',target).set("complexSelect",false).set('ai',lib.card.guohe.ai.button); - }, - ai:{ - wuxie:(target,card,player,viewer,status)=>{ - if(status*get.attitude(viewer,player._trueMe||player)>0 || target.hp>2&&!target.hasCard(i=>{ - let val=get.value(i,target),subtypes=get.subtypes(i); - if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false; - return val>3+Math.min(5,target.hp); - },'e')&&target.countCards('h')*_status.event.getRand('guohe_wuxie')>1.57) return 0; + shunshou_copy2: { + ai: { + basic: { + order: 7.5, + useful: 4, + value: 9, }, - basic:{ - order:9, - useful:(card,i)=>10/(3+i), - value:(card,player)=>{ - let max=0; - game.countPlayer(cur=>{ - max=Math.max(max,lib.card.guohe.ai.result.target(player,cur)*get.attitude(player,cur)); + result: { + target: function (player, target, card, isLink) { + return lib.card.shunshou_copy.ai.result.target( + player, + target, + { + name: "shunshou_copy", + position: "he", + }, + isLink + ); + }, + player: function (player, target, card, isLink) { + return lib.card.shunshou_copy.ai.result.player( + player, + target, + { + name: "shunshou_copy", + position: "he", + }, + isLink + ); + }, + }, + tag: { + loseCard: 1, + gain: 1, + }, + }, + }, + guohe: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: 1, + postAi: function (targets) { + return targets.length == 1 && targets[0].countCards("j"); + }, + filterTarget: function (card, player, target) { + if (player == target) return false; + return target.hasCard( + (card) => lib.filter.canBeDiscarded(card, player, target), + get.is.single() ? "he" : "hej" + ); + }, + defaultYingbianEffect: "add", + content: function () { + "step 0"; + if (get.is.single()) { + let bool1 = target.countDiscardableCards(player, "h"), + bool2 = target.countDiscardableCards(player, "e"); + if (bool1 && bool2) + player + .chooseControl("手牌区", "装备区") + .set("ai", function () { + return Math.random() < 0.5 ? 1 : 0; + }) + .set( + "prompt", + "弃置" + + get.translation(target) + + "装备区的一张牌,或观看其手牌并弃置其中的一张牌。" + ); + else event._result = { control: bool1 ? "手牌区" : "装备区" }; + } else event._result = { control: "所有区域" }; + "step 1"; + let pos, + vis = "visible"; + if (result.control == "手牌区") pos = "h"; + else if (result.control == "装备区") pos = "e"; + else { + pos = "hej"; + vis = undefined; + } + if (target.countDiscardableCards(player, pos)) + player + .discardPlayerCard(pos, target, true, vis) + .set("target", target) + .set("complexSelect", false) + .set("ai", lib.card.guohe.ai.button); + }, + ai: { + wuxie: (target, card, player, viewer, status) => { + if ( + status * get.attitude(viewer, player._trueMe || player) > 0 || + (target.hp > 2 && + !target.hasCard((i) => { + let val = get.value(i, target), + subtypes = get.subtypes(i); + if ( + val < 8 && + target.hp < 2 && + !subtypes.includes("equip2") && + !subtypes.includes("equip5") + ) + return false; + return val > 3 + Math.min(5, target.hp); + }, "e") && + target.countCards("h") * _status.event.getRand("guohe_wuxie") > 1.57) + ) + return 0; + }, + basic: { + order: 9, + useful: (card, i) => 10 / (3 + i), + value: (card, player) => { + let max = 0; + game.countPlayer((cur) => { + max = Math.max( + max, + lib.card.guohe.ai.result.target(player, cur) * get.attitude(player, cur) + ); }); - if(max<=0) return 5; - return 0.42*max; - } + if (max <= 0) return 5; + return 0.42 * max; + }, }, - yingbian:function(card,player,targets,viewer){ - if(get.attitude(viewer,player)<=0) return 0; - if(game.hasPlayer(function(current){ - return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; - })) return 6; + yingbian: function (card, player, targets, viewer) { + if (get.attitude(viewer, player) <= 0) return 0; + if ( + game.hasPlayer(function (current) { + return ( + !targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + get.effect(current, card, player, player) > 0 + ); + }) + ) + return 6; return 0; }, - button:(button)=>{ - let player = _status.event.player, target = _status.event.target; - if(!lib.filter.canBeDiscarded(button.link,player,target)) return 0; + button: (button) => { + let player = _status.event.player, + target = _status.event.target; + if (!lib.filter.canBeDiscarded(button.link, player, target)) return 0; let att = get.attitude(player, target), val = get.buttonValue(button), pos = get.position(button.link), name = get.name(button.link); - if(pos==='j'){ - if(name==='lebu'){ - let needs=target.needsToDiscard(2); - val *= 1.08+0.2*needs; - } - else if(name=='shandian'||name=='fulei'||name=='plague') val /= 2; + if (pos === "j") { + if (name === "lebu") { + let needs = target.needsToDiscard(2); + val *= 1.08 + 0.2 * needs; + } else if (name == "shandian" || name == "fulei" || name == "plague") val /= 2; } - if(get.attitude(player,get.owner(button.link))>0) val = -val; - if(pos!=='e') return val; + if (get.attitude(player, get.owner(button.link)) > 0) val = -val; + if (pos !== "e") return val; let sub = get.subtypes(button.link); - if(sub.includes('equip1')) return val*Math.min(3.6,target.hp)/3; - if(sub.includes('equip2')){ - if(name==='baiyin'&&pos==='e'&&target.isDamaged()){ - let by=3-0.6*Math.min(5,target.hp); - return get.sgn(get.recoverEffect(target,player,player))*by; + if (sub.includes("equip1")) return (val * Math.min(3.6, target.hp)) / 3; + if (sub.includes("equip2")) { + if (name === "baiyin" && pos === "e" && target.isDamaged()) { + let by = 3 - 0.6 * Math.min(5, target.hp); + return get.sgn(get.recoverEffect(target, player, player)) * by; } - return 1.57*val; + return 1.57 * val; } - if(att<=0&&(sub.includes('equip3')||sub.includes('equip4'))&&(player.hasSkill('shouli')||player.hasSkill('psshouli'))) return 0; - if(sub.includes('equip6')) return val; - if(sub.includes('equip4')) return val/2; - if(sub.includes('equip3')&&!game.hasPlayer((cur)=>{ - return !cur.inRange(target)&&get.attitude(cur,target)<0; - })) return 0.4*val; + if ( + att <= 0 && + (sub.includes("equip3") || sub.includes("equip4")) && + (player.hasSkill("shouli") || player.hasSkill("psshouli")) + ) + return 0; + if (sub.includes("equip6")) return val; + if (sub.includes("equip4")) return val / 2; + if ( + sub.includes("equip3") && + !game.hasPlayer((cur) => { + return !cur.inRange(target) && get.attitude(cur, target) < 0; + }) + ) + return 0.4 * val; return val; }, - result:{ - target:function(player,target){ - let att=get.attitude(player, target), - hs=target.countCards('h',(card)=>lib.filter.canBeDiscarded(card,player,target)), - es=target.countCards('e',(card)=>lib.filter.canBeDiscarded(card,player,target)), - js=target.countCards('j',(card)=>lib.filter.canBeDiscarded(card,player,target)), - noh=!hs||target.hasSkillTag('noh'), - noe=!es||target.hasSkillTag('noe'), - check=[-1,att>0?-1.3:1.3,att>0?-2.5:2.5], - idx=-1; - if(hs){ - idx=0; - if(noh) check[0]=0.7; + result: { + target: function (player, target) { + let att = get.attitude(player, target), + hs = target.countCards("h", (card) => + lib.filter.canBeDiscarded(card, player, target) + ), + es = target.countCards("e", (card) => + lib.filter.canBeDiscarded(card, player, target) + ), + js = target.countCards("j", (card) => + lib.filter.canBeDiscarded(card, player, target) + ), + noh = !hs || target.hasSkillTag("noh"), + noe = !es || target.hasSkillTag("noe"), + check = [-1, att > 0 ? -1.3 : 1.3, att > 0 ? -2.5 : 2.5], + idx = -1; + if (hs) { + idx = 0; + if (noh) check[0] = 0.7; } - if(es){ - if(idx<0) idx=1; - if(target.getEquip('baiyin')&&target.isDamaged()&&lib.filter.canBeDiscarded(target.getEquip('baiyin'),player,target)){ - let rec=get.recoverEffect(target,player,target); - if(es==1||att*rec>0){ - let val=3-0.6*Math.min(5,target.hp); - if(rec>0) check[1]=val; - else if(rec<0) check[1]=-val; + if (es) { + if (idx < 0) idx = 1; + if ( + target.getEquip("baiyin") && + target.isDamaged() && + lib.filter.canBeDiscarded(target.getEquip("baiyin"), player, target) + ) { + let rec = get.recoverEffect(target, player, target); + if (es == 1 || att * rec > 0) { + let val = 3 - 0.6 * Math.min(5, target.hp); + if (rec > 0) check[1] = val; + else if (rec < 0) check[1] = -val; } } - target.countCards('e',function(card){ - let val=get.value(card,target); - if(card.name=='jinhe'||att*val>=0||!lib.filter.canBeDiscarded(card,player,target)) return false; - if(att>0){ - check[1]=Math.max(1.3,check[1]); + target.countCards("e", function (card) { + let val = get.value(card, target); + if ( + card.name == "jinhe" || + att * val >= 0 || + !lib.filter.canBeDiscarded(card, player, target) + ) + return false; + if (att > 0) { + check[1] = Math.max(1.3, check[1]); return true; } - let sub=get.subtype(card); - if(sub=='equip2'||sub=='equip5') val+=4; - else if(sub=='equip1') val*=0.4*Math.min(3.6,target.hp); - else val*=0.6; - if(target.hp<3&&sub!='equip2'&&sub!='equip5') val*=0.4; - check[1]=Math.min(-0.16*val,check[1]); + let sub = get.subtype(card); + if (sub == "equip2" || sub == "equip5") val += 4; + else if (sub == "equip1") val *= 0.4 * Math.min(3.6, target.hp); + else val *= 0.6; + if (target.hp < 3 && sub != "equip2" && sub != "equip5") val *= 0.4; + check[1] = Math.min(-0.16 * val, check[1]); }); - if(noe) check[1]+=0.9; + if (noe) check[1] += 0.9; } - if(js){ - let func=function(num){ - if(att>0) check[2]=Math.max(check[2],num); - else check[2]=Math.min(check[2],0.6-num); + if (js) { + let func = function (num) { + if (att > 0) check[2] = Math.max(check[2], num); + else check[2] = Math.min(check[2], 0.6 - num); }; - if(idx<0) idx=2; - target.countCards('j',function(card){ - let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card; - if(!lib.filter.canBeDiscarded(card,player,target)||att*get.effect(target,cardj,target,target)>=0) return false; - if(cardj.name=='lebu') func(2.1+0.4*target.needsToDiscard(2)); - else if(cardj.name=='bingliang') func(2.4); - else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') func(Math.abs(check[2])/(1+target.hp)); + if (idx < 0) idx = 2; + target.countCards("j", function (card) { + let cardj = card.viewAs + ? new lib.element.VCard({ name: card.viewAs }) + : card; + if ( + !lib.filter.canBeDiscarded(card, player, target) || + att * get.effect(target, cardj, target, target) >= 0 + ) + return false; + if (cardj.name == "lebu") func(2.1 + 0.4 * target.needsToDiscard(2)); + else if (cardj.name == "bingliang") func(2.4); + else if ( + cardj.name == "shandian" || + cardj.name == "fulei" || + cardj.name == "plague" + ) + func(Math.abs(check[2]) / (1 + target.hp)); else func(2.1); }); } - if(idx<0) return 0; - for(let i=idx+1;i<3;i++){ - if(i==1&&!es||i==2&&!js) continue; - if(att>0&&check[i]>check[idx]||att<=0&&check[i] 0 && check[i] > check[idx]) || (att <= 0 && check[i] < check[idx])) + idx = i; } return check[idx]; }, }, - tag:{ - loseCard:1, - discard:1 - } - } - }, - guohe_copy:{ - ai:{ - basic:{ - order:9, - useful:5, - value:5, + tag: { + loseCard: 1, + discard: 1, }, - result:{ - target:function(player,target,card){ - let position='hej'; - if(card&&card.position) position=card.position; - const att=get.attitude(player,target); - const hs=position.includes('h')?target.getDiscardableCards(player,'h'):[]; - const es=position.includes('e')?target.getDiscardableCards(player,'e'):[]; - const js=position.includes('j')?target.getDiscardableCards(player,'j'):[]; - if(!hs.length&&!es.length&&!js.length) return 0; - if(att>0){ - if(js.some(card=>{ - const cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - })) return 3; - if(target.isDamaged()&&es.some(card=>card.name=='baiyin')&& - get.recoverEffect(target,player,player)>0){ - if(target.hp==1&&!target.hujia) return 1.6; + }, + }, + guohe_copy: { + ai: { + basic: { + order: 9, + useful: 5, + value: 5, + }, + result: { + target: function (player, target, card) { + let position = "hej"; + if (card && card.position) position = card.position; + const att = get.attitude(player, target); + const hs = position.includes("h") ? target.getDiscardableCards(player, "h") : []; + const es = position.includes("e") ? target.getDiscardableCards(player, "e") : []; + const js = position.includes("j") ? target.getDiscardableCards(player, "j") : []; + if (!hs.length && !es.length && !js.length) return 0; + if (att > 0) { + if ( + js.some((card) => { + const cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) + ) + return 3; + if ( + target.isDamaged() && + es.some((card) => card.name == "baiyin") && + get.recoverEffect(target, player, player) > 0 + ) { + if (target.hp == 1 && !target.hujia) return 1.6; } - if(es.some(card=>{ - return get.value(card,target)<0; - })) return 1; + if ( + es.some((card) => { + return get.value(card, target) < 0; + }) + ) + return 1; return -1.5; - } - else{ - const noh=(hs.length==0||target.hasSkillTag('noh')); - const noe=(es.length==0||target.hasSkillTag('noe')); - const noe2=(noe||!es.some(card=>{ - return get.value(card,target)>0; - })); - const noj=(js.length==0||!js.some(card=>{ - const cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - })) - if(noh&&noe2&&noj) return 1.5; + } else { + const noh = hs.length == 0 || target.hasSkillTag("noh"); + const noe = es.length == 0 || target.hasSkillTag("noe"); + const noe2 = + noe || + !es.some((card) => { + return get.value(card, target) > 0; + }); + const noj = + js.length == 0 || + !js.some((card) => { + const cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }); + if (noh && noe2 && noj) return 1.5; return -1.5; } }, }, - tag:{ - loseCard:1, - discard:1 - } - } - }, - guohe_copy2:{ - ai:{ - basic:{ - order:9, - useful:5, - value:5, + tag: { + loseCard: 1, + discard: 1, }, - result:{ - target:function(player,target,card,isLink){ - return lib.card.guohe_copy.ai.result.target(player,target,{ - name:'guohe_copy', - position:'he', - },isLink) + }, + }, + guohe_copy2: { + ai: { + basic: { + order: 9, + useful: 5, + value: 5, + }, + result: { + target: function (player, target, card, isLink) { + return lib.card.guohe_copy.ai.result.target( + player, + target, + { + name: "guohe_copy", + position: "he", + }, + isLink + ); }, }, - tag:{ - loseCard:1, - discard:1 - } - } + tag: { + loseCard: 1, + discard: 1, + }, + }, }, - jiedao:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - singleCard:true, - targetprompt:['被借刀','出杀目标'], - complexSelect:true, - complexTarget:true, - multicheck:function(){ - var card={name:'sha',isCard:true}; - return game.hasPlayer(function(current){ - if(current.getEquips(1).length>0){ - return game.hasPlayer(function(current2){ - return current.inRange(current2)&&lib.filter.targetEnabled(card,current,current2); + jiedao: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + singleCard: true, + targetprompt: ["被借刀", "出杀目标"], + complexSelect: true, + complexTarget: true, + multicheck: function () { + var card = { name: "sha", isCard: true }; + return game.hasPlayer(function (current) { + if (current.getEquips(1).length > 0) { + return game.hasPlayer(function (current2) { + return ( + current.inRange(current2) && + lib.filter.targetEnabled(card, current, current2) + ); + }); + } + }); + }, + filterTarget: function (card, player, target) { + var card = { name: "sha", isCard: true }; + return ( + player != target && + target.getEquips(1).length > 0 && + game.hasPlayer(function (current) { + return ( + target != current && + target.inRange(current) && + lib.filter.targetEnabled(card, target, current) + ); + }) + ); + }, + filterAddedTarget: function (card, player, target, preTarget) { + var card = { name: "sha", isCard: true }; + return ( + target != preTarget && + preTarget.inRange(target) && + lib.filter.targetEnabled(card, preTarget, target) + ); + }, + content: function () { + "step 0"; + if ( + event.directHit || + !event.addedTarget || + (!_status.connectMode && lib.config.skip_shan && !target.hasSha()) + ) { + event.directfalse = true; + } else { + target + .chooseToUse( + "对" + + get.translation(event.addedTarget) + + "使用一张杀,或令" + + get.translation(player) + + "获得你的武器牌", + function (card, player) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + } + ) + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.filterTarget.apply(this, arguments); }) - } - }); - }, - filterTarget:function(card,player,target){ - var card={name:'sha',isCard:true}; - return player!=target&&target.getEquips(1).length>0&&game.hasPlayer(function(current){ - return target!=current&&target.inRange(current)&&lib.filter.targetEnabled(card,target,current); - }); - }, - filterAddedTarget:function(card,player,target,preTarget){ - var card={name:'sha',isCard:true}; - return target!=preTarget&&preTarget.inRange(target)&&lib.filter.targetEnabled(card,preTarget,target); - }, - content:function(){ - "step 0" - if(event.directHit||!event.addedTarget||(!_status.connectMode&&lib.config.skip_shan&&!target.hasSha())){ - event.directfalse=true; + .set("sourcex", event.addedTarget) + .set("addCount", false) + .set("respondTo", [player, card]); } - else{ - target.chooseToUse('对'+get.translation(event.addedTarget)+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌',function(card,player){ - if(get.name(card)!='sha') return false; - return lib.filter.filterCard.apply(this,arguments); - }).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.filterTarget.apply(this,arguments); - }).set('sourcex',event.addedTarget).set('addCount',false).set('respondTo',[player,card]); - } - "step 1" - if(event.directfalse||result.bool==false){ - var cards=target.getEquips(1); - if(cards.length) player.gain(cards,target,'give','bySelf'); + "step 1"; + if (event.directfalse || result.bool == false) { + var cards = target.getEquips(1); + if (cards.length) player.gain(cards, target, "give", "bySelf"); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(player==game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (player == game.me && get.attitude(viewer, player._trueMe || player) > 0) return 0; }, - basic:{ - order:8, - value:2, - useful:1, + basic: { + order: 8, + value: 2, + useful: 1, }, - result:{ - player:(player,target)=>{ - if(!target.hasSkillTag('noe')&&get.attitude(player,target)>0) return 0; - return (player.hasSkillTag('noe')?0.32:0.15)*target.getEquips(1).reduce((num,i)=>{ - return num+get.value(i,player); - },0); + result: { + player: (player, target) => { + if (!target.hasSkillTag("noe") && get.attitude(player, target) > 0) return 0; + return ( + (player.hasSkillTag("noe") ? 0.32 : 0.15) * + target.getEquips(1).reduce((num, i) => { + return num + get.value(i, player); + }, 0) + ); }, - target:(player,target,card)=>{ - let targets=[].concat(ui.selected.targets); - if(_status.event.preTarget) targets.add(_status.event.preTarget); - if(targets.length){ - let preTarget=targets.lastItem,pre=_status.event.getTempCache('jiedao_result',preTarget.playerid); - if(pre&&pre.card===card&&pre.target.isIn()) return target===pre.target?pre.eff:0; - return get.effect(target,{name:'sha'},preTarget,player)/get.attitude(player,target); + target: (player, target, card) => { + let targets = [].concat(ui.selected.targets); + if (_status.event.preTarget) targets.add(_status.event.preTarget); + if (targets.length) { + let preTarget = targets.lastItem, + pre = _status.event.getTempCache("jiedao_result", preTarget.playerid); + if (pre && pre.card === card && pre.target.isIn()) + return target === pre.target ? pre.eff : 0; + return ( + get.effect(target, { name: "sha" }, preTarget, player) / + get.attitude(player, target) + ); } - let arms=(target.hasSkillTag('noe')?0.32:-0.15)*target.getEquips(1).reduce((num,i)=>{ - return num+get.value(i,target); - },0); - if(!target.mayHaveSha(player,'use')) return arms; - let sha=game.filterPlayer(get.info({name:'jiedao'}).filterAddedTarget),addTar=null; - sha=sha.reduce((num,current)=>{ - let eff=get.effect(current,{name:'sha'},target,player); - if(eff<=num) return num; - addTar=current; + let arms = + (target.hasSkillTag("noe") ? 0.32 : -0.15) * + target.getEquips(1).reduce((num, i) => { + return num + get.value(i, target); + }, 0); + if (!target.mayHaveSha(player, "use")) return arms; + let sha = game.filterPlayer(get.info({ name: "jiedao" }).filterAddedTarget), + addTar = null; + sha = sha.reduce((num, current) => { + let eff = get.effect(current, { name: "sha" }, target, player); + if (eff <= num) return num; + addTar = current; return eff; - },-100); - if(!addTar) return arms; - sha/=get.attitude(player,target); - _status.event.putTempCache('jiedao_result',target.playerid,{ - card:card, - target:addTar, - eff:sha + }, -100); + if (!addTar) return arms; + sha /= get.attitude(player, target); + _status.event.putTempCache("jiedao_result", target.playerid, { + card: card, + target: addTar, + eff: sha, }); - return Math.max(arms,sha); - } + return Math.max(arms, sha); + }, }, - tag:{ - gain:1, - use:1, - useSha:1, - loseCard:1, - } - } + tag: { + gain: 1, + use: 1, + useSha: 1, + loseCard: 1, + }, + }, }, - wuxie:{ - audio:true, - fullskin:true, - type:'trick', - ai:{ - basic:{ - useful:[6,4,3], - value:[6,4,3], + wuxie: { + audio: true, + fullskin: true, + type: "trick", + ai: { + basic: { + useful: [6, 4, 3], + value: [6, 4, 3], }, - result:{player:1}, - expose:0.2 + result: { player: 1 }, + expose: 0.2, }, - notarget:true, - finalDelay:false, - defaultYingbianEffect:'draw', - contentBefore:function(){ - 'step 0' - if(get.mode()=='guozhan'&&get.cardtag(card,'guo')){ - var trigger=event.getParent(2)._trigger; - if(trigger.name!='phaseJudge'&&trigger.card.name!='wuxie'&&trigger.targets.length>1){ - player.chooseControl('对单体使用','对势力使用').set('prompt','请选择'+get.translation(card)+'的使用方式').set('ai',function(){ - return '对势力使用' - }); - } - else event.finish(); - } - else event.finish(); - 'step 1' - if(result.control=='对势力使用'){ - player.chat('对势力使用'); - event.getParent().guowuxie=true; + notarget: true, + finalDelay: false, + defaultYingbianEffect: "draw", + contentBefore: function () { + "step 0"; + if (get.mode() == "guozhan" && get.cardtag(card, "guo")) { + var trigger = event.getParent(2)._trigger; + if ( + trigger.name != "phaseJudge" && + trigger.card.name != "wuxie" && + trigger.targets.length > 1 + ) { + player + .chooseControl("对单体使用", "对势力使用") + .set("prompt", "请选择" + get.translation(card) + "的使用方式") + .set("ai", function () { + return "对势力使用"; + }); + } else event.finish(); + } else event.finish(); + "step 1"; + if (result.control == "对势力使用") { + player.chat("对势力使用"); + event.getParent().guowuxie = true; } }, - content:function(){ - var trigger=event.getParent(2)._trigger; - if(trigger.name=='phaseJudge'){ - trigger.untrigger('currentOnly'); - trigger.cancelled=true; - } - else{ + content: function () { + var trigger = event.getParent(2)._trigger; + if (trigger.name == "phaseJudge") { + trigger.untrigger("currentOnly"); + trigger.cancelled = true; + } else { trigger.neutralize(); - if(event.getParent().guowuxie==true){ - trigger.getParent().excluded.addArray(game.filterPlayer(function(current){ - return current.isFriendOf(trigger.target); - })); + if (event.getParent().guowuxie == true) { + trigger.getParent().excluded.addArray( + game.filterPlayer(function (current) { + return current.isFriendOf(trigger.target); + }) + ); } } /* @@ -2248,1073 +2937,1306 @@ game.import('card', function () { directHit:evt.directHit||[], nowuxie:evt.nowuxie, };*/ - if(player.isOnline()){ - player.send(function(player){ - if(ui.tempnowuxie&&!player.hasWuxie()){ + if (player.isOnline()) { + player.send(function (player) { + if (ui.tempnowuxie && !player.hasWuxie()) { ui.tempnowuxie.close(); delete ui.tempnowuxie; } - },player); - } - else if(player==game.me){ - if(ui.tempnowuxie&&!player.hasWuxie()){ + }, player); + } else if (player == game.me) { + if (ui.tempnowuxie && !player.hasWuxie()) { ui.tempnowuxie.close(); delete ui.tempnowuxie; } } - } - }, - lebu:{ - audio:true, - fullskin:true, - type:'delay', - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player!=target); }, - judge:function(card){ - if(get.suit(card)=='heart') return 1; + }, + lebu: { + audio: true, + fullskin: true, + type: "delay", + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player != target; + }, + judge: function (card) { + if (get.suit(card) == "heart") return 1; return -2; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - effect:function(){ - if(result.bool==false){ - player.skip('phaseUse'); + effect: function () { + if (result.bool == false) { + player.skip("phaseUse"); } }, - ai:{ - basic:{ - order:1, - useful:1, - value:8, + ai: { + basic: { + order: 1, + useful: 1, + value: 8, }, - result:{ - ignoreStatus:true, - target:(player,target)=>{ - if(target===_status.currentPhase&&target.skipList.includes('phaseUse')){ - let evt=_status.event.getParent('phase'); - if(evt&&evt.phaseList.indexOf('phaseJudge')<=evt.num) return 0; + result: { + ignoreStatus: true, + target: (player, target) => { + if (target === _status.currentPhase && target.skipList.includes("phaseUse")) { + let evt = _status.event.getParent("phase"); + if (evt && evt.phaseList.indexOf("phaseJudge") <= evt.num) return 0; } - let num=target.needsToDiscard(3),cf=Math.pow(get.threaten(target,player),2); - if(!num) return -0.01*cf; - if(target.hp>2) num--; - let dist=Math.sqrt(get.distance(player,target,'absolute')); - if(dist<1) dist=1; - if(target.isTurnedOver()) dist++; - return Math.min(-0.1,-num)*cf/dist; - } + let num = target.needsToDiscard(3), + cf = Math.pow(get.threaten(target, player), 2); + if (!num) return -0.01 * cf; + if (target.hp > 2) num--; + let dist = Math.sqrt(get.distance(player, target, "absolute")); + if (dist < 1) dist = 1; + if (target.isTurnedOver()) dist++; + return (Math.min(-0.1, -num) * cf) / dist; + }, + }, + tag: { + skip: "phaseUse", }, - tag:{ - skip:'phaseUse' - } - } - }, - shandian:{ - audio:true, - fullskin:true, - type:'delay', - cardnature:'thunder', - modTarget:function(card,player,target){ - return lib.filter.judge(card,player,target); }, - enable:function(card,player){ + }, + shandian: { + audio: true, + fullskin: true, + type: "delay", + cardnature: "thunder", + modTarget: function (card, player, target) { + return lib.filter.judge(card, player, target); + }, + enable: function (card, player) { return player.canAddJudge(card); }, - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player==target); + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player == target; }, - selectTarget:[-1,-1], - toself:true, - judge:function(card){ - if(get.suit(card)=='spade'&&get.number(card)>1&&get.number(card)<10) return -5; + selectTarget: [-1, -1], + toself: true, + judge: function (card) { + if (get.suit(card) == "spade" && get.number(card) > 1 && get.number(card) < 10) return -5; return 1; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - effect:function(){ - if(result.bool==false){ - player.damage(3,'thunder','nosource'); - } - else{ + effect: function () { + if (result.bool == false) { + player.damage(3, "thunder", "nosource"); + } else { player.addJudgeNext(card); } }, - cancel:function(){ + cancel: function () { player.addJudgeNext(card); }, - ai:{ - basic:{ - order:1, - useful:0, - value:0, + ai: { + basic: { + order: 1, + useful: 0, + value: 0, }, - result:{ - target:function(player,target){ - var num=game.countPlayer(function(current){ + result: { + target: function (player, target) { + var num = game.countPlayer(function (current) { //var skills=current.getSkills(); - for(var j=0;j0&& - get.attitude(current,target)>0){ + for (var j = 0; j < current.skills.length; j++) { + var rejudge = get.tag(current.skills[j], "rejudge", current); + if (rejudge != undefined) { + if ( + get.attitude(target, current) > 0 && + get.attitude(current, target) > 0 + ) { return rejudge; - } - else{ + } else { return -rejudge; } } } }); - if(num>0) return num; - if(num==0){ - var mode=get.mode(); - if(mode=='identity'){ - if(target.identity=='nei') return 1; - var situ=get.situation(); - if(target.identity=='fan'){ - if(situ>1) return 1; + if (num > 0) return num; + if (num == 0) { + var mode = get.mode(); + if (mode == "identity") { + if (target.identity == "nei") return 1; + var situ = get.situation(); + if (target.identity == "fan") { + if (situ > 1) return 1; + } else { + if (situ < -1) return 1; } - else{ - if(situ<-1) return 1; - } - } - else if(mode=='guozhan'){ - if(target.identity=='ye') return 1; - if(game.hasPlayer(function(current){ - return current.identity=='unknown'; - })){ + } else if (mode == "guozhan") { + if (target.identity == "ye") return 1; + if ( + game.hasPlayer(function (current) { + return current.identity == "unknown"; + }) + ) { return -1; } - if(get.population(target.identity)==1){ - if(target.maxHp>2&&target.hp<2) return 1; - if(game.countPlayer()<3) return -1; - if(target.hp<=2&&target.countCards('he')<=3) return 1; + if (get.population(target.identity) == 1) { + if (target.maxHp > 2 && target.hp < 2) return 1; + if (game.countPlayer() < 3) return -1; + if (target.hp <= 2 && target.countCards("he") <= 3) return 1; } } } return -1; - } + }, + }, + tag: { + damage: 0.16, + natureDamage: 0.16, + thunderDamage: 0.16, }, - tag:{ - damage:0.16, - natureDamage:0.16, - thunderDamage:0.16, - } - } - }, - hanbing:{ - fullskin:true, - type:"equip", - subtype:"equip1", - distance:{attackFrom:-1}, - skills:['hanbing_skill'], - ai:{ - basic:{ - equipValue:2 - } }, }, - renwang:{ - fullskin:true, - type:"equip", - subtype:"equip2", - skills:['renwang_skill'], - ai:{ - basic:{ - equipValue:7.5 + hanbing: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + skills: ["hanbing_skill"], + ai: { + basic: { + equipValue: 2, + }, + }, + }, + renwang: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["renwang_skill"], + ai: { + basic: { + equipValue: 7.5, }, }, }, }, - skill:{ - qinglong_guozhan:{ - equipSkill:true, - trigger:{player:'useCard'}, - forced:true, - audio:'qinglong_skill', - filter:function(event,player){ - return get.mode()=='guozhan'&&event.card.name=='sha'; + skill: { + qinglong_guozhan: { + equipSkill: true, + trigger: { player: "useCard" }, + forced: true, + audio: "qinglong_skill", + filter: function (event, player) { + return get.mode() == "guozhan" && event.card.name == "sha"; }, - content:function(){ - if(!_status.qinglong_guozhan) _status.qinglong_guozhan=[]; + content: function () { + if (!_status.qinglong_guozhan) _status.qinglong_guozhan = []; _status.qinglong_guozhan.add(trigger); - game.countPlayer2(function(current){ - current.addTempSkill('qinglong_guozhan_mingzhi'); + game.countPlayer2(function (current) { + current.addTempSkill("qinglong_guozhan_mingzhi"); }); - game.broadcast(function(list){ - _status.qinglong_guozhan=list; - },_status.qinglong_guozhan.map(function(i){ - return {targets:i.targets}; - })) - var next=game.createEvent('qinglong_guozhan'); + game.broadcast( + function (list) { + _status.qinglong_guozhan = list; + }, + _status.qinglong_guozhan.map(function (i) { + return { targets: i.targets }; + }) + ); + var next = game.createEvent("qinglong_guozhan"); event.next.remove(next); trigger.after.add(next); - next.setContent(function(){ + next.setContent(function () { _status.qinglong_guozhan.remove(event.parent); - game.broadcast(function(list){ - _status.qinglong_guozhan=list; - },_status.qinglong_guozhan.map(function(i){ - return {targets:i.targets}; - })); + game.broadcast( + function (list) { + _status.qinglong_guozhan = list; + }, + _status.qinglong_guozhan.map(function (i) { + return { targets: i.targets }; + }) + ); }); - } + }, }, - qinglong_guozhan_mingzhi:{ - ai:{ - nomingzhi:true, - skillTagFilter:function(player){ - if(_status.qinglong_guozhan){ - for(var i=0;i<_status.qinglong_guozhan.length;i++){ - if(_status.qinglong_guozhan[i].targets.includes(player)) return true; + qinglong_guozhan_mingzhi: { + ai: { + nomingzhi: true, + skillTagFilter: function (player) { + if (_status.qinglong_guozhan) { + for (var i = 0; i < _status.qinglong_guozhan.length; i++) { + if (_status.qinglong_guozhan[i].targets.includes(player)) return true; } } return false; }, - } + }, }, - hanbing_skill:{ - equipSkill:true, - trigger:{source:'damageBegin2'}, + hanbing_skill: { + equipSkill: true, + trigger: { source: "damageBegin2" }, //direct:true, - audio:true, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.getCards('he').length>0; + audio: true, + filter: function (event) { + return ( + event.card && + event.card.name == "sha" && + event.notLink() && + event.player.getCards("he").length > 0 + ); }, //priority:1, - check:function(event,player){ - var target=event.player; - var eff=get.damageEffect(target,player,player,event.nature); - if(get.attitude(player,target)>0){ - if(eff>=0) return false; + check: function (event, player) { + var target = event.player; + var eff = get.damageEffect(target, player, player, event.nature); + if (get.attitude(player, target) > 0) { + if (eff >= 0) return false; return true; } - if(eff<=0) return true; - if(target.hp==1) return false; - if(event.num>1||player.hasSkill('tianxianjiu')|| - player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false; - if(target.countCards('he')<2) return false; - var num=0; - var cards=target.getCards('he'); - for(var i=0;i6) num++; + if (eff <= 0) return true; + if (target.hp == 1) return false; + if ( + event.num > 1 || + player.hasSkill("tianxianjiu") || + player.hasSkill("luoyi2") || + player.hasSkill("reluoyi2") + ) + return false; + if (target.countCards("he") < 2) return false; + var num = 0; + var cards = target.getCards("he"); + for (var i = 0; i < cards.length; i++) { + if (get.value(cards[i]) > 6) num++; } - if(num>=2) return true; + if (num >= 2) return true; return false; }, - logTarget:"player", - content:function(){ - "step 0" + logTarget: "player", + content: function () { + "step 0"; trigger.cancel(); - "step 1" - if(trigger.player.countDiscardableCards(player,'he')){ + "step 1"; + if (trigger.player.countDiscardableCards(player, "he")) { player.line(trigger.player); - player.discardPlayerCard('he',trigger.player,true); + player.discardPlayerCard("he", trigger.player, true); } - "step 2" - if(trigger.player.countDiscardableCards(player,'he')){ + "step 2"; + if (trigger.player.countDiscardableCards(player, "he")) { player.line(trigger.player); - player.discardPlayerCard('he',trigger.player,true); + player.discardPlayerCard("he", trigger.player, true); } - } - }, - icesha_skill:{ - inherit:'hanbing_skill', - trigger:{source:'damageBegin3'}, - equipSkill:false, - ruleSkill:true, - filter:function(event){ - return event.hasNature('ice')&&event.notLink()&&event.player.getCards('he').length>0; }, }, - renwang_skill:{ - equipSkill:true, - trigger:{target:'shaBegin'}, - forced:true, - priority:6, - audio:true, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.player.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - return (event.card.name=='sha'&&get.color(event.card)=='black') + icesha_skill: { + inherit: "hanbing_skill", + trigger: { source: "damageBegin3" }, + equipSkill: false, + ruleSkill: true, + filter: function (event) { + return ( + event.hasNature("ice") && event.notLink() && event.player.getCards("he").length > 0 + ); }, - content:function(){ + }, + renwang_skill: { + equipSkill: true, + trigger: { target: "shaBegin" }, + forced: true, + priority: 6, + audio: true, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.player.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + return event.card.name == "sha" && get.color(event.card) == "black"; + }, + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target){ - if(typeof card!=='object'||target.hasSkillTag('unequip2')) return; - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card - })||player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card - })) return; - if(card.name=='sha'&&get.color(card)=='black') return 'zeroplayertarget'; - } - } - } + ai: { + effect: { + target: function (card, player, target) { + if (typeof card !== "object" || target.hasSkillTag("unequip2")) return; + if ( + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) || + player.hasSkillTag("unequip_ai", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) + return; + if (card.name == "sha" && get.color(card) == "black") return "zeroplayertarget"; + }, + }, + }, }, - zhuge_skill:{ - equipSkill:true, - audio:true, - firstDo:true, - trigger:{player:'useCard1'}, - forced:true, - filter:function(event,player){ - return !event.audioed&&event.card.name=='sha'&&player.countUsed('sha',true)>1&&event.getParent().type=='phase'; + zhuge_skill: { + equipSkill: true, + audio: true, + firstDo: true, + trigger: { player: "useCard1" }, + forced: true, + filter: function (event, player) { + return ( + !event.audioed && + event.card.name == "sha" && + player.countUsed("sha", true) > 1 && + event.getParent().type == "phase" + ); }, - content:function(){ - trigger.audioed=true; + content: function () { + trigger.audioed = true; }, - mod:{ - cardUsable:function(card,player,num){ - var cards=player.getEquips('zhuge') - if(card.name=='sha'){ - if(!cards.length||player.hasSkill('zhuge_skill',null,false)||cards.some(card=>(card!=_status.zhuge_temp&&!ui.selected.cards.includes(card)))){ - if(get.is.versus()||get.is.changban()){ - return num+3; + mod: { + cardUsable: function (card, player, num) { + var cards = player.getEquips("zhuge"); + if (card.name == "sha") { + if ( + !cards.length || + player.hasSkill("zhuge_skill", null, false) || + cards.some( + (card) => card != _status.zhuge_temp && !ui.selected.cards.includes(card) + ) + ) { + if (get.is.versus() || get.is.changban()) { + return num + 3; } return Infinity; } } }, - cardEnabled2:function(card,player){ - if(!_status.event.addCount_extra||player.hasSkill('zhuge_skill',null,false)) return; - var cards=player.getEquips('zhuge'); - if(card&&cards.includes(card)){ - try{ - var cardz=get.card(); - } - catch(e){ + cardEnabled2: function (card, player) { + if (!_status.event.addCount_extra || player.hasSkill("zhuge_skill", null, false)) + return; + var cards = player.getEquips("zhuge"); + if (card && cards.includes(card)) { + try { + var cardz = get.card(); + } catch (e) { return; } - if(!cardz||cardz.name!='sha') return; - _status.zhuge_temp=card; - var bool=lib.filter.cardUsable(get.autoViewAs({name:'sha'},ui.selected.cards.concat([card])),player); + if (!cardz || cardz.name != "sha") return; + _status.zhuge_temp = card; + var bool = lib.filter.cardUsable( + get.autoViewAs({ name: "sha" }, ui.selected.cards.concat([card])), + player + ); delete _status.zhuge_temp; - if(!bool) return false; + if (!bool) return false; } }, }, }, - cixiong_skill:{ - equipSkill:true, - trigger:{player:'useCardToPlayered'}, - audio:true, - logTarget:'target', - check:function(event,player){ - if(get.attitude(player,event.target)>0) return true; - var target=event.target; - return target.countCards('h')==0||!target.hasSkillTag('noh'); + cixiong_skill: { + equipSkill: true, + trigger: { player: "useCardToPlayered" }, + audio: true, + logTarget: "target", + check: function (event, player) { + if (get.attitude(player, event.target) > 0) return true; + var target = event.target; + return target.countCards("h") == 0 || !target.hasSkillTag("noh"); }, - filter:function(event,player){ - if(event.card.name!='sha') return false; + filter: function (event, player) { + if (event.card.name != "sha") return false; return player.differentSexFrom(event.target); }, - content:function(){ - "step 0" - if(!trigger.target.countCards('h')) event._result={bool:false}; - else trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ - var trigger=_status.event.getTrigger(); - return -get.attitude(trigger.target,trigger.player)-get.value(card)-Math.max(0,4-trigger.target.hp)*2; - }); - "step 1" - if(result.bool==false) player.draw(); - } + content: function () { + "step 0"; + if (!trigger.target.countCards("h")) event._result = { bool: false }; + else + trigger.target + .chooseToDiscard("弃置一张手牌,或令" + get.translation(player) + "摸一张牌") + .set("ai", function (card) { + var trigger = _status.event.getTrigger(); + return ( + -get.attitude(trigger.target, trigger.player) - + get.value(card) - + Math.max(0, 4 - trigger.target.hp) * 2 + ); + }); + "step 1"; + if (result.bool == false) player.draw(); + }, }, - qinggang_skill:{ - equipSkill:true, - audio:true, - trigger:{ - player:'useCardToPlayered', + qinggang_skill: { + equipSkill: true, + audio: true, + trigger: { + player: "useCardToPlayered", }, - filter:function(event){ - return event.card.name=='sha'; + filter: function (event) { + return event.card.name == "sha"; }, - forced:true, - logTarget:'target', - content:function(){ - trigger.target.addTempSkill('qinggang2'); + forced: true, + logTarget: "target", + content: function () { + trigger.target.addTempSkill("qinggang2"); trigger.target.storage.qinggang2.add(trigger.card); - trigger.target.markSkill('qinggang2'); + trigger.target.markSkill("qinggang2"); }, - ai:{ - unequip_ai:true, - skillTagFilter:function(player,tag,arg){ - if(arg&&arg.name=='sha') return true; + ai: { + unequip_ai: true, + skillTagFilter: function (player, tag, arg) { + if (arg && arg.name == "sha") return true; return false; - } - } - }, - qinggang2:{ - firstDo:true, - ai:{unequip2:true}, - init:function(player,skill){ - if(!player.storage[skill]) player.storage[skill]=[]; - }, - onremove:true, - trigger:{ - player:['damage','damageCancelled','damageZero'], - source:['damage','damageCancelled','damageZero'], - target:['shaMiss','useCardToExcluded','useCardToEnd','eventNeutralized'], - global:['useCardEnd'], - }, - charlotte:true, - filter:function(event,player){ - return player.storage.qinggang2&&event.card&&player.storage.qinggang2.includes(event.card)&&(event.name!='damage'||event.notLink()); - }, - silent:true, - forced:true, - popup:false, - priority:12, - content:function(){ - player.storage.qinggang2.remove(trigger.card); - if(!player.storage.qinggang2.length) player.removeSkill('qinggang2'); - }, - marktext:'※', - intro:{content:'当前防具技能已失效'}, - }, - qinglong_skill:{ - equipSkill:true, - trigger:{player:['shaMiss','eventNeutralized']}, - direct:true, - filter:function(event,player){ - if(get.mode()=='guozhan'||!event.card||event.card.name!='sha') return false; - return event.target.isIn()&&player.canUse('sha',event.target,false)&&(player.hasSha()||_status.connectMode&&player.countCards('hs')); - }, - content:function(){ - "step 0" - player.chooseToUse(get.prompt('qinglong',trigger.target),function(card,player,event){ - if(get.name(card)!='sha') return false; - if(!player.hasSkill('qinglong_skill',null,false)){ - var cards=player.getEquips('qinglong'); - if(!cards.some(card2=>card2!=card&&!ui.selected.cards.includes(card2))) return false; - } - return lib.filter.filterCard.apply(this,arguments); - },trigger.target,-1).set('addCount',false).logSkill='qinglong_skill'; - } - }, - zhangba_skill:{ - equipSkill:true, - enable:['chooseToUse','chooseToRespond'], - filterCard:true, - selectCard:2, - position:'hs', - viewAs:{name:'sha'}, - complexCard:true, - filter:function(event,player){ - return player.countCards('hs')>=2; - }, - audio:true, - prompt:'将两张手牌当杀使用或打出', - check:function(card){ - let player=_status.event.player; - if(player.hasCard(function(card){ - return get.name(card)=='sha'; - })) return 0; - if(_status.event&&_status.event.name=='chooseToRespond'&&player.hp<3&&!player.countCards('hs',function(card){ - return get.name(card)!='tao'&&get.name(card)!='jiu'; - })) return (player.hp>1?10:8)-get.value(card); - return Math.max(5,8-0.7*player.hp)-get.value(card); - }, - ai:{ - respondSha:true, - skillTagFilter:function(player){ - return player.countCards('hs')>=2; }, - } + }, }, - guanshi_skill:{ - equipSkill:true, - trigger:{ - player:['shaMiss','eventNeutralized'], + qinggang2: { + firstDo: true, + ai: { unequip2: true }, + init: function (player, skill) { + if (!player.storage[skill]) player.storage[skill] = []; }, - direct:true, - audio:true, - filter:function(event,player){ - if(event.type!='card'||event.card.name!='sha'||!event.target.isIn()) return false; - var min=2; - if(!player.hasSkill('guanshi_skill',null,false)) min+=get.sgn(player.getEquips('guanshi').length) - return player.countCards('he')>=min; + onremove: true, + trigger: { + player: ["damage", "damageCancelled", "damageZero"], + source: ["damage", "damageCancelled", "damageZero"], + target: ["shaMiss", "useCardToExcluded", "useCardToEnd", "eventNeutralized"], + global: ["useCardEnd"], }, - content:function(){ - "step 0" + charlotte: true, + filter: function (event, player) { + return ( + player.storage.qinggang2 && + event.card && + player.storage.qinggang2.includes(event.card) && + (event.name != "damage" || event.notLink()) + ); + }, + silent: true, + forced: true, + popup: false, + priority: 12, + content: function () { + player.storage.qinggang2.remove(trigger.card); + if (!player.storage.qinggang2.length) player.removeSkill("qinggang2"); + }, + marktext: "※", + intro: { content: "当前防具技能已失效" }, + }, + qinglong_skill: { + equipSkill: true, + trigger: { player: ["shaMiss", "eventNeutralized"] }, + direct: true, + filter: function (event, player) { + if (get.mode() == "guozhan" || !event.card || event.card.name != "sha") return false; + return ( + event.target.isIn() && + player.canUse("sha", event.target, false) && + (player.hasSha() || (_status.connectMode && player.countCards("hs"))) + ); + }, + content: function () { + "step 0"; + player + .chooseToUse( + get.prompt("qinglong", trigger.target), + function (card, player, event) { + if (get.name(card) != "sha") return false; + if (!player.hasSkill("qinglong_skill", null, false)) { + var cards = player.getEquips("qinglong"); + if ( + !cards.some( + (card2) => card2 != card && !ui.selected.cards.includes(card2) + ) + ) + return false; + } + return lib.filter.filterCard.apply(this, arguments); + }, + trigger.target, + -1 + ) + .set("addCount", false).logSkill = "qinglong_skill"; + }, + }, + zhangba_skill: { + equipSkill: true, + enable: ["chooseToUse", "chooseToRespond"], + filterCard: true, + selectCard: 2, + position: "hs", + viewAs: { name: "sha" }, + complexCard: true, + filter: function (event, player) { + return player.countCards("hs") >= 2; + }, + audio: true, + prompt: "将两张手牌当杀使用或打出", + check: function (card) { + let player = _status.event.player; + if ( + player.hasCard(function (card) { + return get.name(card) == "sha"; + }) + ) + return 0; + if ( + _status.event && + _status.event.name == "chooseToRespond" && + player.hp < 3 && + !player.countCards("hs", function (card) { + return get.name(card) != "tao" && get.name(card) != "jiu"; + }) + ) + return (player.hp > 1 ? 10 : 8) - get.value(card); + return Math.max(5, 8 - 0.7 * player.hp) - get.value(card); + }, + ai: { + respondSha: true, + skillTagFilter: function (player) { + return player.countCards("hs") >= 2; + }, + }, + }, + guanshi_skill: { + equipSkill: true, + trigger: { + player: ["shaMiss", "eventNeutralized"], + }, + direct: true, + audio: true, + filter: function (event, player) { + if (event.type != "card" || event.card.name != "sha" || !event.target.isIn()) + return false; + var min = 2; + if (!player.hasSkill("guanshi_skill", null, false)) + min += get.sgn(player.getEquips("guanshi").length); + return player.countCards("he") >= min; + }, + content: function () { + "step 0"; //装备区内可能有多个贯石斧 或者玩家可能通过其他渠道获得贯石斧技能 只要留一张贯石斧不扔掉即可 - var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card,player){ - if(_status.event.ignoreCard) return true; - var cards=player.getEquips('guanshi'); - if(!cards.includes(card)) return true; - return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.includes(cardx))); - }).set('ignoreCard',player.hasSkill('guanshi_skill',null,false)).set('complexCard',true) - next.logSkill='guanshi_skill'; - next.set('ai',function(card){ - var evt=_status.event.getTrigger(); - if(get.attitude(evt.player,evt.target)<0){ - if(evt.player.needsToDiscard()) return 15-get.value(card); - if(evt.baseDamage+evt.extraDamage>=Math.min(2,evt.target.hp)) return 8-get.value(card); - return 5-get.value(card); + var next = player + .chooseToDiscard(get.prompt("guanshi"), 2, "he", function (card, player) { + if (_status.event.ignoreCard) return true; + var cards = player.getEquips("guanshi"); + if (!cards.includes(card)) return true; + return cards.some((cardx) => cardx != card && !ui.selected.cards.includes(cardx)); + }) + .set("ignoreCard", player.hasSkill("guanshi_skill", null, false)) + .set("complexCard", true); + next.logSkill = "guanshi_skill"; + next.set("ai", function (card) { + var evt = _status.event.getTrigger(); + if (get.attitude(evt.player, evt.target) < 0) { + if (evt.player.needsToDiscard()) return 15 - get.value(card); + if (evt.baseDamage + evt.extraDamage >= Math.min(2, evt.target.hp)) + return 8 - get.value(card); + return 5 - get.value(card); } return -1; }); - "step 1" - if(result.bool){ - if(event.triggername=='shaMiss'){ + "step 1"; + if (result.bool) { + if (event.triggername == "shaMiss") { trigger.untrigger(); - trigger.trigger('shaHit'); - trigger._result.bool=false; - trigger._result.result=null; - } - else{ + trigger.trigger("shaHit"); + trigger._result.bool = false; + trigger._result.result = null; + } else { trigger.unneutralize(); } } }, - ai:{ - directHit_ai:true, - skillTagFilter:function(player,tag,arg){ - if(player._guanshi_temp) return; - player._guanshi_temp=true; - var bool=(get.attitude(player,arg.target)<0&&arg.card&&arg.card.name=='sha'&&player.countCards('he',function(card){ - return card!=player.getEquip('guanshi')&&card!=arg.card&&(!arg.card.cards||!arg.card.cards.includes(card))&&get.value(card)<5; - })>1); + ai: { + directHit_ai: true, + skillTagFilter: function (player, tag, arg) { + if (player._guanshi_temp) return; + player._guanshi_temp = true; + var bool = + get.attitude(player, arg.target) < 0 && + arg.card && + arg.card.name == "sha" && + player.countCards("he", function (card) { + return ( + card != player.getEquip("guanshi") && + card != arg.card && + (!arg.card.cards || !arg.card.cards.includes(card)) && + get.value(card) < 5 + ); + }) > 1; delete player._guanshi_temp; return bool; }, }, }, - fangtian_skill:{ - equipSkill:true, - audio:true, - trigger:{player:'useCard1'}, - forced:true, - firstDo:true, - filter:function(event,player){ - if(event.card.name!='sha'||get.mode()=='guozhan') return false; - var card=event.card; + fangtian_skill: { + equipSkill: true, + audio: true, + trigger: { player: "useCard1" }, + forced: true, + firstDo: true, + filter: function (event, player) { + if (event.card.name != "sha" || get.mode() == "guozhan") return false; + var card = event.card; var range; - var select=get.copy(get.info(card).selectTarget); - if(select==undefined){ - if(get.info(card).filterTarget==undefined) return false; - range=[1,1]; - } - else if(typeof select=='number') range=[select,select]; - else if(get.itemtype(select)=='select') range=select; - else if(typeof select=='function') range=select(card,player); - game.checkMod(card,player,range,'selectTarget',player); - return range[1]!=-1&&event.targets.length>range[1]; + var select = get.copy(get.info(card).selectTarget); + if (select == undefined) { + if (get.info(card).filterTarget == undefined) return false; + range = [1, 1]; + } else if (typeof select == "number") range = [select, select]; + else if (get.itemtype(select) == "select") range = select; + else if (typeof select == "function") range = select(card, player); + game.checkMod(card, player, range, "selectTarget", player); + return range[1] != -1 && event.targets.length > range[1]; }, - content:function(){}, - mod:{ - selectTarget:function(card,player,range){ - if(card.name!='sha') return; - if(get.mode()=='guozhan') return; - if(range[1]==-1) return; - var cards=player.getCards('h'); - if(!cards.length) return; - for(var i=0;i0 }, - direct:true, - audio:true, - content:function(){ - "step 0" - var att=(get.attitude(player,trigger.player)<=0); - var next=player.chooseButton(); - next.set('att',att); - next.set('createDialog',['是否发动【麒麟弓】,弃置'+get.translation(trigger.player)+'的一张坐骑牌?',trigger.player.getCards('e',{subtype:['equip3','equip4','equip6']})]); - next.set('ai',function(button){ - if(_status.event.att) return get.buttonValue(button); + }, + qilin_skill: { + equipSkill: true, + trigger: { source: "damageBegin2" }, + filter: function (event, player) { + return ( + event.card && + event.card.name == "sha" && + event.notLink() && + event.player.getCards("e", { subtype: ["equip3", "equip4", "equip6"] }).length > 0 + ); + }, + direct: true, + audio: true, + content: function () { + "step 0"; + var att = get.attitude(player, trigger.player) <= 0; + var next = player.chooseButton(); + next.set("att", att); + next.set("createDialog", [ + "是否发动【麒麟弓】,弃置" + get.translation(trigger.player) + "的一张坐骑牌?", + trigger.player.getCards("e", { subtype: ["equip3", "equip4", "equip6"] }), + ]); + next.set("ai", function (button) { + if (_status.event.att) return get.buttonValue(button); return 0; }); - "step 1" - if(result.bool){ - player.logSkill('qilin_skill',trigger.player); + "step 1"; + if (result.bool) { + player.logSkill("qilin_skill", trigger.player); trigger.player.discard(result.links[0]); } - } + }, }, - bagua_skill:{ - equipSkill:true, - trigger:{player:['chooseToRespondBegin','chooseToUseBegin']}, - filter:function(event,player){ - if(event.responded) return false; - if(event.bagua_skill) return false; - if(!event.filterCard||!event.filterCard({name:'shan'},player,event)) return false; - if(event.name=='chooseToRespond'&&!lib.filter.cardRespondable({name:'shan'},player,event)) return false; - if(player.hasSkillTag('unequip2')) return false; - var evt=event.getParent(); - if(evt.player&&evt.player.hasSkillTag('unequip',false,{ - name:evt.card?evt.card.name:null, - target:player, - card:evt.card - })) return false; + bagua_skill: { + equipSkill: true, + trigger: { player: ["chooseToRespondBegin", "chooseToUseBegin"] }, + filter: function (event, player) { + if (event.responded) return false; + if (event.bagua_skill) return false; + if (!event.filterCard || !event.filterCard({ name: "shan" }, player, event)) return false; + if ( + event.name == "chooseToRespond" && + !lib.filter.cardRespondable({ name: "shan" }, player, event) + ) + return false; + if (player.hasSkillTag("unequip2")) return false; + var evt = event.getParent(); + if ( + evt.player && + evt.player.hasSkillTag("unequip", false, { + name: evt.card ? evt.card.name : null, + target: player, + card: evt.card, + }) + ) + return false; return true; }, - audio:true, - check:function(event,player){ - if(!event) return true; - if(event.ai){ - var ai=event.ai; - var tmp=_status.event; - _status.event=event; - var result=ai({name:'shan'},_status.event.player,event); - _status.event=tmp; - return result>0; + audio: true, + check: function (event, player) { + if (!event) return true; + if (event.ai) { + var ai = event.ai; + var tmp = _status.event; + _status.event = event; + var result = ai({ name: "shan" }, _status.event.player, event); + _status.event = tmp; + return result > 0; } - let evt=event.getParent(); - if(player.hasSkillTag('noShan',null,evt)) return false; - if(!evt||!evt.card||!evt.player||player.hasSkillTag('useShan',null,evt)) return true; - if(evt.card&&evt.player&&player.isLinked()&&game.hasNature(evt.card)&&get.attitude(player,evt.player._trueMe||evt.player)>0) return false; + let evt = event.getParent(); + if (player.hasSkillTag("noShan", null, evt)) return false; + if (!evt || !evt.card || !evt.player || player.hasSkillTag("useShan", null, evt)) + return true; + if ( + evt.card && + evt.player && + player.isLinked() && + game.hasNature(evt.card) && + get.attitude(player, evt.player._trueMe || evt.player) > 0 + ) + return false; return true; }, - content:function(){ - "step 0" - trigger.bagua_skill=true; - player.judge('bagua',function(card){return (get.color(card)=='red')?1.5:-0.5}).judge2=function(result){ + content: function () { + "step 0"; + trigger.bagua_skill = true; + player.judge("bagua", function (card) { + return get.color(card) == "red" ? 1.5 : -0.5; + }).judge2 = function (result) { return result.bool; }; - "step 1" - if(result.judge>0){ + "step 1"; + if (result.judge > 0) { trigger.untrigger(); - trigger.set('responded',true); - trigger.result={bool:true,card:{name:'shan',isCard:true}} + trigger.set("responded", true); + trigger.result = { bool: true, card: { name: "shan", isCard: true } }; } }, - ai:{ - respondShan:true, - freeShan:true, - skillTagFilter(player,tag,arg){ - if(tag!=='respondShan'&&tag!=='freeShan') return; - if(player.hasSkillTag('unequip2')) return false; - if(!arg||!arg.player) return true; - if(arg.player.hasSkillTag('unequip',false,{ - target:player - })) return false; + ai: { + respondShan: true, + freeShan: true, + skillTagFilter(player, tag, arg) { + if (tag !== "respondShan" && tag !== "freeShan") return; + if (player.hasSkillTag("unequip2")) return false; + if (!arg || !arg.player) return true; + if ( + arg.player.hasSkillTag("unequip", false, { + target: player, + }) + ) + return false; return true; }, - effect:{ - target:function(card,player,target,effect){ - if(target.hasSkillTag('unequip2')) return; - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card - })||player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card - })) return; - if(get.tag(card,'respondShan')) return 0.5; - } - } - } + effect: { + target: function (card, player, target, effect) { + if (target.hasSkillTag("unequip2")) return; + if ( + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) || + player.hasSkillTag("unequip_ai", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) + return; + if (get.tag(card, "respondShan")) return 0.5; + }, + }, + }, }, - _wuxie:{ - trigger:{player:['useCardToBegin','phaseJudge']}, - priority:5, - popup:false, - forced:true, - silent:true, - filter:function(event,player){ - if(event.card.storage&&event.card.storage.nowuxie) return false; - var card=event.card; - if(event.name=='phaseJudge'&&card.viewAs) card={name:card.viewAs}; - var info=get.info(card); - if(info.wuxieable===false) return false; - if(event.name!='phaseJudge'){ - if(event.getParent().nowuxie) return false; - if(event.player.hasSkillTag('playernowuxie',false,event.card)) return false; - if(get.type(event.card)!='trick'&&!info.wuxieable) return false; + _wuxie: { + trigger: { player: ["useCardToBegin", "phaseJudge"] }, + priority: 5, + popup: false, + forced: true, + silent: true, + filter: function (event, player) { + if (event.card.storage && event.card.storage.nowuxie) return false; + var card = event.card; + if (event.name == "phaseJudge" && card.viewAs) card = { name: card.viewAs }; + var info = get.info(card); + if (info.wuxieable === false) return false; + if (event.name != "phaseJudge") { + if (event.getParent().nowuxie) return false; + if (event.player.hasSkillTag("playernowuxie", false, event.card)) return false; + if (get.type(event.card) != "trick" && !info.wuxieable) return false; } return true; }, - forceLoad:true, - forceDie:true, - content:function(){ - 'step 0' + forceLoad: true, + forceDie: true, + content: function () { + "step 0"; delete event.wuxieresult; delete event.wuxieresult2; //创建map存储各种信息,用于hasHiddenWuxie判断 - var map={}; - event._info_map=map; - var card=trigger.card; - var state=true; - if(trigger.name=='phaseJudge'){ - if(get.itemtype(card)=='card'&&card.viewAs) card=get.autoViewAs({name:card.viewAs},[card]); - map.target=trigger.player; - map.isJudge=true; - } - else{ - map.player=trigger.player; - if(trigger.multitarget) map.multitargets=true; - map.target=trigger.target; - map.targets=trigger.targets; - map.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget); - map.noai=Boolean(trigger.getParent().noai); + var map = {}; + event._info_map = map; + var card = trigger.card; + var state = true; + if (trigger.name == "phaseJudge") { + if (get.itemtype(card) == "card" && card.viewAs) + card = get.autoViewAs({ name: card.viewAs }, [card]); + map.target = trigger.player; + map.isJudge = true; + } else { + map.player = trigger.player; + if (trigger.multitarget) map.multitargets = true; + map.target = trigger.target; + map.targets = trigger.targets; + map.tempnowuxie = + trigger.targets && trigger.targets.length > 1 && !trigger.multitarget; + map.noai = Boolean(trigger.getParent().noai); //如果对拼无懈,获取历史数据 - if(card.name=='wuxie'){ - var evt=event; - while(true){ - evt=evt.getParent(5); - if(evt&&evt.name=='_wuxie'){ - state=!state; - var evtmap=evt._info_map; - if(evtmap.card.name!='wuxie'){ - map._source=evtmap; + if (card.name == "wuxie") { + var evt = event; + while (true) { + evt = evt.getParent(5); + if (evt && evt.name == "_wuxie") { + state = !state; + var evtmap = evt._info_map; + if (evtmap.card.name != "wuxie") { + map._source = evtmap; } - } - else break; + } else break; } } } - map.card=card; - map.state=state?1:-1; - map.id2=trigger.getParent().id; - event._global_waiting=true; + map.card = card; + map.state = state ? 1 : -1; + map.id2 = trigger.getParent().id; + event._global_waiting = true; //发送函数 - event.send=function(player,map,skillState){ + event.send = function (player, map, skillState) { //获取技能数据 - if(skillState){ + if (skillState) { player.applySkills(skillState); } //生成描述提示 - var prompt='',evtmap=map,state=map.state; - if(map._source) evtmap=map._source; - if(evtmap.isJudge){ - prompt+=(get.translation(evtmap.target)+'的'+get.translation(evtmap.card)+'即将'+(state>0?'生':'失')+'效。'); - } - else{ - prompt+=get.translation(evtmap.player); - if(evtmap.multitarget){ - if(evtmap.targets.length){ - prompt+='对'; - prompt+=get.translation(evtmap.targets); + var prompt = "", + evtmap = map, + state = map.state; + if (map._source) evtmap = map._source; + if (evtmap.isJudge) { + prompt += + get.translation(evtmap.target) + + "的" + + get.translation(evtmap.card) + + "即将" + + (state > 0 ? "生" : "失") + + "效。"; + } else { + prompt += get.translation(evtmap.player); + if (evtmap.multitarget) { + if (evtmap.targets.length) { + prompt += "对"; + prompt += get.translation(evtmap.targets); } + } else if (evtmap.target) { + prompt += "对"; + prompt += + evtmap.target == evtmap.player ? "自己" : get.translation(evtmap.target); } - else if(evtmap.target){ - prompt+='对'; - prompt+=(evtmap.target==evtmap.player?'自己':get.translation(evtmap.target)); - } - prompt+=('使用的'+get.translation(evtmap.card)); - prompt+=('即将'+(state>0?'生':'失')+'效。'); + prompt += "使用的" + get.translation(evtmap.card); + prompt += "即将" + (state > 0 ? "生" : "失") + "效。"; } - prompt+='是否使用【无懈可击】?'; - if(player.isUnderControl(true)&&!_status.auto&&!ui.tempnowuxie&&map.tempnowuxie){ - var translation=get.translation(map.card.name); - if(translation.length>=4){ - translation=lib.translate[map.card.name+'_ab']||translation.slice(0,2); + prompt += "是否使用【无懈可击】?"; + if ( + player.isUnderControl(true) && + !_status.auto && + !ui.tempnowuxie && + map.tempnowuxie + ) { + var translation = get.translation(map.card.name); + if (translation.length >= 4) { + translation = lib.translate[map.card.name + "_ab"] || translation.slice(0, 2); } - ui.tempnowuxie=ui.create.control('不无懈'+translation,ui.click.tempnowuxie,'stayleft'); - ui.tempnowuxie._origin=map.id2; + ui.tempnowuxie = ui.create.control( + "不无懈" + translation, + ui.click.tempnowuxie, + "stayleft" + ); + ui.tempnowuxie._origin = map.id2; } - var next=player.chooseToUse({ - filterCard:function(card,player){ - if(get.name(card)!='wuxie') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); + var next = player.chooseToUse({ + filterCard: function (card, player) { + if (get.name(card) != "wuxie") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); }, - prompt:prompt, - type:'wuxie', - _global_waiting:true, - ai1:function(){ - if(map.isJudge){ - var card=evtmap.card,source=evtmap.target; - var name=card.viewAs||card.name; - var info=lib.card[name]; - if(info&&info.ai&&info.ai.wuxie){ - var aiii=info.ai.wuxie(source,card,source,_status.event.player,state); - if(typeof aiii=='number') return aiii; + prompt: prompt, + type: "wuxie", + _global_waiting: true, + ai1: function () { + if (map.isJudge) { + var card = evtmap.card, + source = evtmap.target; + var name = card.viewAs || card.name; + var info = lib.card[name]; + if (info && info.ai && info.ai.wuxie) { + var aiii = info.ai.wuxie( + source, + card, + source, + _status.event.player, + state + ); + if (typeof aiii == "number") return aiii; } - if(Math.abs(get.attitude(_status.event.player,source))<3) return 0; - if(source.hasSkillTag('nowuxie_judge')||source.hasSkillTag('guanxing')&&(source!=player||!source.hasSkill('guanxing_fail'))) return 0; - if(name!='lebu'&&name!='bingliang'){ - if(source!=_status.event.player){ + if (Math.abs(get.attitude(_status.event.player, source)) < 3) return 0; + if ( + source.hasSkillTag("nowuxie_judge") || + (source.hasSkillTag("guanxing") && + (source != player || !source.hasSkill("guanxing_fail"))) + ) + return 0; + if (name != "lebu" && name != "bingliang") { + if (source != _status.event.player) { return 0; } } - if(name=='bingliang'&&source.countCards('j')>0&&source.countCards('h')>=source.hp-1){ + if ( + name == "bingliang" && + source.countCards("j") > 0 && + source.countCards("h") >= source.hp - 1 + ) { return 0; } var card2; - if(name!=card.name){ - card2={name:name}; + if (name != card.name) { + card2 = { name: name }; + } else { + card2 = card; } - else{ - card2=card; - } - var eff=get.effect(source,card2,source,source); - if(eff>=0) return 0; - return state*get.attitude(_status.event.player,source); - } - else if(evtmap.target){ - var triggerevent=_status.event.getTrigger(); - if(triggerevent&&triggerevent.parent&& - triggerevent.parent.postAi&& - triggerevent.player.isUnknown(_status.event.player)){ + var eff = get.effect(source, card2, source, source); + if (eff >= 0) return 0; + return state * get.attitude(_status.event.player, source); + } else if (evtmap.target) { + var triggerevent = _status.event.getTrigger(); + if ( + triggerevent && + triggerevent.parent && + triggerevent.parent.postAi && + triggerevent.player.isUnknown(_status.event.player) + ) { return 0; } - var card=evtmap.card,target=evtmap.target,source=evtmap.player; - var info=get.info(card); - if(info.ai&&info.ai.wuxie){ - var aiii=info.ai.wuxie(target,card,source,_status.event.player,state); - if(typeof aiii=='number') return aiii; + var card = evtmap.card, + target = evtmap.target, + source = evtmap.player; + var info = get.info(card); + if (info.ai && info.ai.wuxie) { + var aiii = info.ai.wuxie( + target, + card, + source, + _status.event.player, + state + ); + if (typeof aiii == "number") return aiii; } - if(info.multitarget&&targets){ - var eff=0; - for(var i=0;i这是一种十分含蓄的计谋。', - wuxie_info:'一张锦囊牌生效前,对此牌使用。抵消此牌对一名角色产生的效果,或抵消另一张【无懈可击】产生的效果。', - lebu_info:'出牌阶段,对一名其他角色使用。若判定结果不为红桃,跳过其出牌阶段。', - shandian_info:'出牌阶段,对自己使用。若判定结果为黑桃2~9,则目标角色受到3点雷电伤害。若判定不为黑桃2~9,将之移动到下家的判定区里。', - icesha_skill:'冰冻', - icesha_skill_info:'防止即将造成的伤害,改为依次弃置其两张牌。', - sha_notshan:'invisible', - qinggang2:'破防', + translate: { + sha: "杀", + huosha: "火杀", + leisha: "雷杀", + icesha: "冰杀", + kamisha: "神杀", + cisha: "刺杀", + shan: "闪", + tao: "桃", + bagua: "八卦阵", + bagua_bg: "卦", + bagua_skill: "八卦阵", + jueying: "绝影", + dilu: "的卢", + zhuahuang: "爪黄飞电", + jueying_bg: "+马", + dilu_bg: "+马", + zhuahuang_bg: "+马", + chitu: "赤兔", + chitu_bg: "-马", + dawan: "大宛", + dawan_bg: "-马", + zixin: "紫骍", + zixin_bg: "-马", + zhuge: "诸葛连弩", + cixiong: "雌雄双股剑", + zhuge_bg: "弩", + cixiong_bg: "双", + qinggang: "青釭剑", + qinglong: "青龙偃月刀", + zhangba: "丈八蛇矛", + qinglong_bg: "偃", + zhangba_bg: "蛇", + guanshi: "贯石斧", + fangtian: "方天画戟", + qilin: "麒麟弓", + qilin_bg: "弓", + zhuge_skill: "诸葛连弩", + cixiong_skill: "雌雄双股剑", + qinggang_skill: "青釭剑", + qinglong_skill: "青龙偃月刀", + qinglong_guozhan: "青龙偃月刀", + zhangba_skill: "丈八蛇矛", + guanshi_skill: "贯石斧", + fangtian_skill: "方天画戟", + qilin_skill: "麒麟弓", + wugu: "五谷丰登", + taoyuan: "桃园结义", + nanman: "南蛮入侵", + wanjian: "万箭齐发", + wuzhong: "无中生有", + juedou: "决斗", + wugu_bg: "谷", + taoyuan_bg: "园", + nanman_bg: "蛮", + wanjian_bg: "箭", + wuzhong_bg: "生", + juedou_bg: "斗", + shunshou: "顺手牵羊", + guohe: "过河拆桥", + guohe_bg: "拆", + jiedao: "借刀杀人", + wuxie: "无懈可击", + wuxie_bg: "懈", + lebu: "乐不思蜀", + shandian: "闪电", + shandian_bg: "电", + hanbing: "寒冰剑", + renwang: "仁王盾", + hanbing_bg: "冰", + renwang_bg: "盾", + hanbing_skill: "寒冰剑", + renwang_skill: "仁王盾", + hanbing_info: + "当你因执行【杀】的效果而造成伤害时,若目标角色有能被弃置的牌,则你可以防止此伤害,然后依次弃置目标角色的两张牌。", + hanbing_skill_info: + "当你因执行【杀】的效果而造成伤害时,若目标角色有能被弃置的牌,则你可以防止此伤害,然后依次弃置目标角色的两张牌。", + renwang_info: "锁定技,黑色【杀】对你无效。", + renwang_skill_info: "锁定技,黑色【杀】对你无效。", + sha_info: "出牌阶段,对你攻击范围内的一名角色使用。其须使用一张【闪】,否则你对其造成1点伤害。", + shan_info: "抵消一张【杀】。", + tao_info: + "①出牌阶段,对自己使用,目标角色回复1点体力。②当有角色处于濒死状态时,对该角色使用。目标角色回复1点体力。", + bagua_info: + "当你需要使用或打出一张【闪】时,你可以进行判定。若结果为红色,则你视为使用或打出一张【闪】。", + bagua_skill_info: + "当你需要使用或打出一张【闪】时,你可以进行判定。若结果为红色,则你视为使用或打出一张【闪】。", + jueying_info: "锁定技,其他角色计算与你的距离+1。", + dilu_info: "锁定技,其他角色计算与你的距离+1。", + zhuahuang_info: "锁定技,其他角色计算与你的距离+1。", + chitu_info: "锁定技,你计算与其他角色的距离-1。", + dawan_info: "锁定技,你计算与其他角色的距离-1。", + zixin_info: "锁定技,你计算与其他角色的距离-1。", + zhuge_skill_info: "锁定技,你于出牌阶段内使用【杀】无次数限制。", + zhuge_info: "锁定技,你于出牌阶段内使用【杀】无次数限制。", + cixiong_skill_info: + "当你使用【杀】指定一名异性的目标角色后,你可以令其选择一项:1.弃置一张手牌;2.令你摸一张牌。", + cixiong_info: + "当你使用【杀】指定一名异性的目标角色后,你可以令其选择一项:1.弃置一张手牌;2.令你摸一张牌。", + qinggang_skill_info: + "锁定技,当你使用【杀】指定一名目标角色后,你令其防具技能无效直到此【杀】被抵消或造成伤害。", + qinggang_info: + "锁定技,当你使用【杀】指定一名目标角色后,你令其防具技能无效直到此【杀】被抵消或造成伤害。", + qinglong_skill_info: + "当你使用的【杀】被目标角色使用的【闪】抵消时,你可以对其使用一张【杀】(无距离限制)。", + qinglong_guozhan_info: + "锁定技,当你使用【杀】指定目标后,所有目标角色不能明置武将牌直到此【杀】结算完毕为止。", + qinglong_info: + "当你使用的【杀】被目标角色使用的【闪】抵消时,你可以对其使用一张【杀】(无距离限制)。", + qinglong_info_guozhan: + "锁定技,当你使用【杀】指定目标后,所有目标角色不能明置武将牌直到此【杀】结算完毕为止。", + zhangba_skill_info: "你可以将两张手牌当【杀】使用或打出。", + zhangba_info: "你可以将两张手牌当【杀】使用或打出。", + guanshi_skill_info: + "当你使用的【杀】被目标角色使用的【闪】抵消时,你可以弃置两张牌,令此【杀】依然对其造成伤害。", + guanshi_info: + "当你使用的【杀】被目标角色使用的【闪】抵消时,你可以弃置两张牌,令此【杀】依然对其造成伤害。", + fangtian_skill_info: "你使用的【杀】若是你最后的手牌,你可以额外选择至多两个目标。", + fangtian_info: "你使用的【杀】若是你最后的手牌,你可以额外选择至多两个目标。", + fangtian_info_guozhan: + "你使用【杀】可以指定任意名角色为目标(不能包含势力相同的角色),若任意一名目标角色使用【闪】抵消了此【杀】,则此【杀】对剩余的目标角色无效。", + qilin_skill_info: "当你使用【杀】对目标角色造成伤害时,你可以弃置其装备区里的一张坐骑牌。", + qilin_info: "当你使用【杀】对目标角色造成伤害时,你可以弃置其装备区里的一张坐骑牌。", + wugu_info: + "出牌阶段,对所有角色使用。(选择目标后)你从牌堆顶亮出等同于目标数量的牌,每名目标角色获得这些牌中(剩余的)的任意一张。", + taoyuan_info: "出牌阶段,对所有角色使用。每名目标角色回复1点体力。", + nanman_info: "出牌阶段,对所有其他角色使用。每名目标角色需打出一张【杀】,否则受到1点伤害。", + wanjian_info: "出牌阶段,对所有其他角色使用。每名目标角色需打出一张【闪】,否则受到1点伤害。", + wuzhong_info: "出牌阶段,对你使用。你摸两张牌。", + juedou_info: + "出牌阶段,对一名其他角色使用。由其开始,其与你轮流打出一张【杀】,直到其中一方未打出【杀】为止。未打出【杀】的一方受到另一方对其造成的1点伤害。", + shunshou_info: "出牌阶段,对距离为1且区域里有牌的一名其他角色使用。你获得其区域里的一张牌。", + guohe_info: "出牌阶段,对区域里有牌的一名其他角色使用。你弃置其区域里的一张牌。", + jiedao_info: + "出牌阶段,对装备区里有武器牌且有使用【杀】的目标的一名其他角色使用。令其对你指定的一名角色使用一张【杀】,否则将其装备区里的武器牌交给你。", + jiedao_append: '这是一种十分含蓄的计谋。', + wuxie_info: + "一张锦囊牌生效前,对此牌使用。抵消此牌对一名角色产生的效果,或抵消另一张【无懈可击】产生的效果。", + lebu_info: "出牌阶段,对一名其他角色使用。若判定结果不为红桃,跳过其出牌阶段。", + shandian_info: + "出牌阶段,对自己使用。若判定结果为黑桃2~9,则目标角色受到3点雷电伤害。若判定不为黑桃2~9,将之移动到下家的判定区里。", + icesha_skill: "冰冻", + icesha_skill_info: "防止即将造成的伤害,改为依次弃置其两张牌。", + sha_notshan: "invisible", + qinggang2: "破防", }, - list:[ - ["spade",7,"sha"], - ["spade",8,"sha"], - ["spade",8,"sha"], - ["spade",9,"sha"], - ["spade",9,"sha"], - ["spade",10,"sha"], - ["spade",10,"sha"], - ["club",2,"sha"], - ["club",3,"sha"], - ["club",4,"sha"], - ["club",5,"sha"], - ["club",6,"sha"], - ["club",7,"sha"], - ["club",8,"sha"], - ["club",8,"sha"], - ["club",9,"sha"], - ["club",9,"sha"], - ["club",10,"sha"], - ["club",10,"sha"], - ["club",11,"sha"], - ["club",11,"sha"], - ["heart",10,"sha"], - ["heart",10,"sha"], - ["heart",11,"sha"], - ["diamond",6,"sha"], - ["diamond",7,"sha"], - ["diamond",8,"sha"], - ["diamond",9,"sha"], - ["diamond",10,"sha"], - ["diamond",13,"sha"], - ["heart",2,"shan"], - ["heart",2,"shan"], - ["heart",13,"shan"], - ["diamond",2,"shan"], - ["diamond",2,"shan"], - ["diamond",3,"shan"], - ["diamond",4,"shan"], - ["diamond",5,"shan"], - ["diamond",6,"shan"], - ["diamond",7,"shan"], - ["diamond",8,"shan"], - ["diamond",9,"shan"], - ["diamond",10,"shan"], - ["diamond",11,"shan"], - ["diamond",11,"shan"], - ["heart",3,"tao"], - ["heart",4,"tao"], - ["heart",6,"tao"], - ["heart",7,"tao"], - ["heart",8,"tao"], - ["heart",9,"tao"], - ["heart",12,"tao"], - ["diamond",12,"tao"], + list: [ + ["spade", 7, "sha"], + ["spade", 8, "sha"], + ["spade", 8, "sha"], + ["spade", 9, "sha"], + ["spade", 9, "sha"], + ["spade", 10, "sha"], + ["spade", 10, "sha"], + ["club", 2, "sha"], + ["club", 3, "sha"], + ["club", 4, "sha"], + ["club", 5, "sha"], + ["club", 6, "sha"], + ["club", 7, "sha"], + ["club", 8, "sha"], + ["club", 8, "sha"], + ["club", 9, "sha"], + ["club", 9, "sha"], + ["club", 10, "sha"], + ["club", 10, "sha"], + ["club", 11, "sha"], + ["club", 11, "sha"], + ["heart", 10, "sha"], + ["heart", 10, "sha"], + ["heart", 11, "sha"], + ["diamond", 6, "sha"], + ["diamond", 7, "sha"], + ["diamond", 8, "sha"], + ["diamond", 9, "sha"], + ["diamond", 10, "sha"], + ["diamond", 13, "sha"], + ["heart", 2, "shan"], + ["heart", 2, "shan"], + ["heart", 13, "shan"], + ["diamond", 2, "shan"], + ["diamond", 2, "shan"], + ["diamond", 3, "shan"], + ["diamond", 4, "shan"], + ["diamond", 5, "shan"], + ["diamond", 6, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "shan"], + ["diamond", 10, "shan"], + ["diamond", 11, "shan"], + ["diamond", 11, "shan"], + ["heart", 3, "tao"], + ["heart", 4, "tao"], + ["heart", 6, "tao"], + ["heart", 7, "tao"], + ["heart", 8, "tao"], + ["heart", 9, "tao"], + ["heart", 12, "tao"], + ["diamond", 12, "tao"], - ["spade",2,"bagua"], - ["club",2,"bagua"], - ["spade",5,"jueying"], - ["club",5,"dilu"], - ["heart",13,"zhuahuang"], - ["heart",5,"chitu"], - ["spade",13,"dawan"], - ["diamond",13,"zixin"], - ["club",1,"zhuge"], - ["diamond",1,"zhuge"], - ["spade",2,"cixiong"], - ["spade",6,"qinggang"], - ["spade",5,"qinglong"], - ["spade",12,"zhangba"], - ["diamond",5,"guanshi"], - ["diamond",12,"fangtian"], - ["heart",5,"qilin"], + ["spade", 2, "bagua"], + ["club", 2, "bagua"], + ["spade", 5, "jueying"], + ["club", 5, "dilu"], + ["heart", 13, "zhuahuang"], + ["heart", 5, "chitu"], + ["spade", 13, "dawan"], + ["diamond", 13, "zixin"], + ["club", 1, "zhuge"], + ["diamond", 1, "zhuge"], + ["spade", 2, "cixiong"], + ["spade", 6, "qinggang"], + ["spade", 5, "qinglong"], + ["spade", 12, "zhangba"], + ["diamond", 5, "guanshi"], + ["diamond", 12, "fangtian"], + ["heart", 5, "qilin"], - ["heart",3,"wugu"], - ["heart",4,"wugu"], - ["heart",1,"taoyuan"], - ["spade",7,"nanman"], - ["spade",13,"nanman"], - ["club",7,"nanman"], - ["heart",1,"wanjian"], - ["spade",1,"juedou"], - ["club",1,"juedou"], - ["diamond",1,"juedou"], - ["heart",7,"wuzhong"], - ["heart",8,"wuzhong"], - ["heart",9,"wuzhong"], - ["heart",11,"wuzhong"], - ["spade",3,'shunshou'], - ["spade",4,'shunshou'], - ["spade",11,'shunshou'], - ["diamond",3,'shunshou'], - ["diamond",4,'shunshou'], - ["spade",3,'guohe'], - ["spade",4,'guohe'], - ["spade",12,'guohe'], - ["club",3,'guohe'], - ["club",4,'guohe'], - ["heart",12,'guohe'], - ["club",12,'jiedao'], - ["club",13,'jiedao'], - ["spade",11,'wuxie'], - ["club",12,'wuxie'], - ["club",13,'wuxie'], - ["spade",6,'lebu'], - ["club",6,'lebu'], - ["heart",6,'lebu'], - ["spade",1,'shandian'], - ["spade",2,'hanbing'], - ["club",2,'renwang'], - ["heart",12,'shandian'], - ["diamond",12,'wuxie'], + ["heart", 3, "wugu"], + ["heart", 4, "wugu"], + ["heart", 1, "taoyuan"], + ["spade", 7, "nanman"], + ["spade", 13, "nanman"], + ["club", 7, "nanman"], + ["heart", 1, "wanjian"], + ["spade", 1, "juedou"], + ["club", 1, "juedou"], + ["diamond", 1, "juedou"], + ["heart", 7, "wuzhong"], + ["heart", 8, "wuzhong"], + ["heart", 9, "wuzhong"], + ["heart", 11, "wuzhong"], + ["spade", 3, "shunshou"], + ["spade", 4, "shunshou"], + ["spade", 11, "shunshou"], + ["diamond", 3, "shunshou"], + ["diamond", 4, "shunshou"], + ["spade", 3, "guohe"], + ["spade", 4, "guohe"], + ["spade", 12, "guohe"], + ["club", 3, "guohe"], + ["club", 4, "guohe"], + ["heart", 12, "guohe"], + ["club", 12, "jiedao"], + ["club", 13, "jiedao"], + ["spade", 11, "wuxie"], + ["club", 12, "wuxie"], + ["club", 13, "wuxie"], + ["spade", 6, "lebu"], + ["club", 6, "lebu"], + ["heart", 6, "lebu"], + ["spade", 1, "shandian"], + ["spade", 2, "hanbing"], + ["club", 2, "renwang"], + ["heart", 12, "shandian"], + ["diamond", 12, "wuxie"], ], }; }); diff --git a/card/swd.js b/card/swd.js index e98bbe7ca..37f12d477 100644 --- a/card/swd.js +++ b/card/swd.js @@ -1,19 +1,19 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'swd', - card:{ - hufu:{ - fullskin:true, - type:'basic', - global:['g_hufu_sha','g_hufu_shan','g_hufu_jiu'], - savable:function(card,player,dying){ - return dying==player; + name: "swd", + card: { + hufu: { + fullskin: true, + type: "basic", + global: ["g_hufu_sha", "g_hufu_shan", "g_hufu_jiu"], + savable: function (card, player, dying) { + return dying == player; + }, + ai: { + value: [7.5, 5, 2], + useful: [7.5, 5, 2], }, - ai:{ - value:[7.5,5,2], - useful:[7.5,5,2], - } }, // yihuajiemu:{ // fullskin:true, @@ -64,1143 +64,1175 @@ game.import('card', function () { // } // } // }, - liuxinghuoyu:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - cardcolor:'red', - cardnature:'fire', - content:function(){ - "step 0" - if(target.countCards('he')<2){ - event.directfalse=true; - } - else{ - target.chooseToDiscard('he',2).ai=function(card){ - if(target.hasSkillTag('nofire')) return 0; - if(get.damageEffect(target,player,target,'fire')>=0) return 0; - if(player.hasSkillTag('notricksource')) return 0; - if(target.hasSkillTag('notrick')) return 0; - if(card.name=='tao') return 0; - if(target.hp==1&&card.name=='jiu') return 0; - if(target.hp==1&&get.type(card)!='basic'){ - return 10-get.value(card); + liuxinghuoyu: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + cardcolor: "red", + cardnature: "fire", + content: function () { + "step 0"; + if (target.countCards("he") < 2) { + event.directfalse = true; + } else { + target.chooseToDiscard("he", 2).ai = function (card) { + if (target.hasSkillTag("nofire")) return 0; + if (get.damageEffect(target, player, target, "fire") >= 0) return 0; + if (player.hasSkillTag("notricksource")) return 0; + if (target.hasSkillTag("notrick")) return 0; + if (card.name == "tao") return 0; + if (target.hp == 1 && card.name == "jiu") return 0; + if (target.hp == 1 && get.type(card) != "basic") { + return 10 - get.value(card); } - return 8-get.value(card); + return 8 - get.value(card); }; } - "step 1" - if(event.directfalse||!result.bool){ - target.damage('fire'); + "step 1"; + if (event.directfalse || !result.bool) { + target.damage("fire"); } }, - ai:{ - basic:{ - order:4, - value:7, - useful:2, + ai: { + basic: { + order: 4, + value: 7, + useful: 2, }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nofire')) return 0; - if(get.damageEffect(target,player,player)<0&&get.attitude(player,target)>0){ + result: { + target: function (player, target) { + if (target.hasSkillTag("nofire")) return 0; + if ( + get.damageEffect(target, player, player) < 0 && + get.attitude(player, target) > 0 + ) { return -2; } - var nh=target.countCards('he'); - if(target==player) nh--; - switch(nh){ - case 0:case 1:return -2; - case 2:return -1.5; - case 3:return -1; - default:return -0.7; + var nh = target.countCards("he"); + if (target == player) nh--; + switch (nh) { + case 0: + case 1: + return -2; + case 2: + return -1.5; + case 3: + return -1; + default: + return -0.7; } - } + }, + }, + tag: { + damage: 1, + fireDamage: 1, + natureDamage: 1, + discard: 1, + loseCard: 1, + position: "he", }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1, - discard:1, - loseCard:1, - position:'he', - } - } - }, - dujian:{ - fullskin:true, - type:'basic', - enable:true, - filterTarget:function(card,player,target){ - return target.countCards('h')>0; }, - content:function(){ - "step 0" - if(target.countCards('h')==0||player.countCards('h')==0){ + }, + dujian: { + fullskin: true, + type: "basic", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("h") > 0; + }, + content: function () { + "step 0"; + if (target.countCards("h") == 0 || player.countCards("h") == 0) { event.finish(); return; } player.chooseCard(true); - "step 1" - event.card1=result.cards[0]; - var rand=Math.random()<0.5; - target.chooseCard(true).ai=function(card){ - if(rand) return Math.random(); + "step 1"; + event.card1 = result.cards[0]; + var rand = Math.random() < 0.5; + target.chooseCard(true).ai = function (card) { + if (rand) return Math.random(); return get.value(card); }; - "step 2" - event.card2=result.cards[0]; - ui.arena.classList.add('thrownhighlight'); - game.addVideo('thrownhighlight1'); - player.$compare(event.card1,target,event.card2); + "step 2"; + event.card2 = result.cards[0]; + ui.arena.classList.add("thrownhighlight"); + game.addVideo("thrownhighlight1"); + player.$compare(event.card1, target, event.card2); game.delay(4); - "step 3" - game.log(player,'展示了',event.card1); - game.log(target,'展示了',event.card2); - if(get.color(event.card2)==get.color(event.card1)){ - player.discard(event.card1).animate=false; + "step 3"; + game.log(player, "展示了", event.card1); + game.log(target, "展示了", event.card2); + if (get.color(event.card2) == get.color(event.card1)) { + player.discard(event.card1).animate = false; target.$gain2(event.card2); - var clone=event.card1.clone; - if(clone){ - clone.style.transition='all 0.5s'; - clone.style.transform='scale(1.2)'; + var clone = event.card1.clone; + if (clone) { + clone.style.transition = "all 0.5s"; + clone.style.transform = "scale(1.2)"; clone.delete(); - game.addVideo('deletenode',player,get.cardsInfo([clone])); + game.addVideo("deletenode", player, get.cardsInfo([clone])); } target.loseHp(); - } - else{ + } else { player.$gain2(event.card1); target.$gain2(event.card2); - target.addTempSkill('dujian2'); + target.addTempSkill("dujian2"); } - ui.arena.classList.remove('thrownhighlight'); - game.addVideo('thrownhighlight2'); + ui.arena.classList.remove("thrownhighlight"); + game.addVideo("thrownhighlight2"); }, - ai:{ - basic:{ - order:2, - value:3, - useful:1, + ai: { + basic: { + order: 2, + value: 3, + useful: 1, }, - result:{ - player:function(player,target){ - if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'dujian'})){ + result: { + player: function (player, target) { + if ( + player.countCards("h") <= Math.min(5, Math.max(2, player.hp)) && + _status.event.name == "chooseToUse" + ) { + if ( + typeof _status.event.filterCard == "function" && + _status.event.filterCard({ name: "dujian" }) + ) { return -10; } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='dujian') return -10; - if(viewAs&&viewAs.name=='dujian') return -10; + if (_status.event.skill) { + var viewAs = get.info(_status.event.skill).viewAs; + if (viewAs == "dujian") return -10; + if (viewAs && viewAs.name == "dujian") return -10; } } return 0; }, - target:function(player,target){ - if(target.hasSkill('dujian2')||target.countCards('h')==0) return 0; - if(player.countCards('h')<=1) return 0; + target: function (player, target) { + if (target.hasSkill("dujian2") || target.countCards("h") == 0) return 0; + if (player.countCards("h") <= 1) return 0; return -1.5; - } + }, + }, + tag: { + loseHp: 1, }, - tag:{ - loseHp:1 - } - } - }, - yangpijuan:{ - fullskin:true, - type:'trick', - enable:true, - toself:true, - filterTarget:function(card,player,target){ - return target==player; }, - modTarget:true, - content:function(){ - 'step 0' + }, + yangpijuan: { + fullskin: true, + type: "trick", + enable: true, + toself: true, + filterTarget: function (card, player, target) { + return target == player; + }, + modTarget: true, + content: function () { + "step 0"; var choice; - if(target.countCards('h','shan')==0||target.countCards('h','sha')==0||target.hp<=1){ - choice='basic'; - } - else{ - var e2=target.getEquip(2); - var e3=target.getEquip(3); - if((e2&&e3)||((e2||e3)&&target.needsToDiscard()<=1)||Math.random()<0.5){ - choice='trick'; - } - else{ - choice='equip'; + if ( + target.countCards("h", "shan") == 0 || + target.countCards("h", "sha") == 0 || + target.hp <= 1 + ) { + choice = "basic"; + } else { + var e2 = target.getEquip(2); + var e3 = target.getEquip(3); + if ( + (e2 && e3) || + ((e2 || e3) && target.needsToDiscard() <= 1) || + Math.random() < 0.5 + ) { + choice = "trick"; + } else { + choice = "equip"; } } - target.chooseControl('basic','trick','equip',function(){ - return choice; - }).set('prompt','选择一种卡牌类型'); - 'step 1' - var list=get.inpile(result.control,'trick'); - list=list.randomGets(3); - for(var i=0;i=0) return 0; + ai: { + order: 1, + useful: 5, + value: 6, + result: { + target: function (player, target) { + if (target == player) { + if (get.damageEffect(target, player, target) >= 0) return 0; return 1; - } - else{ - if(get.attitude(player,target)>0) return 0; - if(get.damageEffect(target,player,target)>=0) return 0; + } else { + if (get.attitude(player, target) > 0) return 0; + if (get.damageEffect(target, player, target) >= 0) return 0; return -1; } - } + }, }, - } - }, - yuruyi:{ - type:'equip', - subtype:'equip5', - skills:['yuruyi'], - fullskin:true, - ai:{ - basic:{ - equipValue:6 - } }, }, - fengyinzhidan:{ - type:'basic', - enable:true, - fullskin:true, - filterTarget:function(card,player,target){ - return target==player; + yuruyi: { + type: "equip", + subtype: "equip5", + skills: ["yuruyi"], + fullskin: true, + ai: { + basic: { + equipValue: 6, + }, }, - selectTarget:-1, - modTarget:true, + }, + fengyinzhidan: { + type: "basic", + enable: true, + fullskin: true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + modTarget: true, // usable:1, - content:function(){ - 'step 0' - event.num=2; - var list=[]; - event.list=list; - for(var i=0;i0&&info.selectTarget[1]>=info.selectTarget[0]){ + content: function () { + "step 0"; + event.num = 2; + var list = []; + event.list = list; + for (var i = 0; i < lib.inpile.length; i++) { + if (lib.filter.filterCard({ name: lib.inpile[i] }, target)) { + var info = lib.card[lib.inpile[i]]; + if (info.type == "trick" && !info.multitarget && !info.notarget) { + if (Array.isArray(info.selectTarget)) { + if ( + info.selectTarget[0] > 0 && + info.selectTarget[1] >= info.selectTarget[0] + ) { list.push(lib.inpile[i]); } - } - else if(typeof info.selectTarget=='number'){ + } else if (typeof info.selectTarget == "number") { list.push(lib.inpile[i]); } } } } - 'step 1' - var list=event.list; - while(list.length){ - var card={name:list.randomRemove()}; - var info=get.info(card); - var targets=game.filterPlayer(function(current){ - return lib.filter.filterTarget(card,target,current); + "step 1"; + var list = event.list; + while (list.length) { + var card = { name: list.randomRemove() }; + var info = get.info(card); + var targets = game.filterPlayer(function (current) { + return lib.filter.filterTarget(card, target, current); }); - if(targets.length){ + if (targets.length) { targets.sort(lib.sort.seat); - if(info.selectTarget==-1){ - target.useCard(card,targets,'noai'); - } - else{ - var num=info.selectTarget; - if(Array.isArray(num)){ - if(targets.length0){ + if (--event.num > 0) { event.redo(); } break; } } }, - ai:{ - order:9, - value:8, - useful:3, - result:{ - target:1 - } - } - }, - yuchanqian:{ - fullskin:true, - type:'jiqi', - addinfo:'杀', - autoViewAs:'sha', - global:['g_yuchan_swap','g_yuchan_equip'], - ai:{ - value:6, - useful:[5,1] - } - }, - yuchankun:{ - fullskin:true, - type:'jiqi', - addinfo:'药', - autoViewAs:'caoyao', - global:['g_yuchan_swap','g_yuchan_equip'], - ai:{ - value:6, - useful:[7,2] - } - }, - yuchanzhen:{ - fullskin:true, - type:'jiqi', - autoViewAs:'jiu', - addinfo:'酒', - global:['g_yuchan_swap','g_yuchan_equip'], - savable:function(card,player,dying){ - return dying==player; - }, - ai:{ - value:6, - useful:[4,1] - } - }, - yuchanxun:{ - fullskin:true, - type:'jiqi', - autoViewAs:'tao', - addinfo:'桃', - global:['g_yuchan_swap','g_yuchan_equip'], - savable:true, - ai:{ - value:6, - useful:[8,6.5] - } - }, - yuchankan:{ - fullskin:true, - type:'jiqi', - autoViewAs:'shenmiguo', - global:['g_yuchan_swap','g_yuchan_equip'], - addinfo:'果', - ai:{ - order:1, - useful:4, - value:6, - result:{ - player:function(){ - var cardname=_status.event.cardname; - if(cardname=='tiesuo') return 0; - if(cardname=='jiu') return 0; - if(cardname=='tianxianjiu') return 0; - if(cardname=='toulianghuanzhu') return 0; - if(cardname=='shijieshu') return 0; - if(cardname=='xietianzi') return 0; - if(cardname=='huogong') return 0; - if(cardname=='shandianjian') return 0; - return 1; - } + ai: { + order: 9, + value: 8, + useful: 3, + result: { + target: 1, }, - } - }, - yuchanli:{ - fullskin:true, - type:'jiqi', - autoViewAs:'tianxianjiu', - global:['g_yuchan_swap','g_yuchan_equip'], - addinfo:'仙', - savable:function(card,player,dying){ - return dying==player; }, - ai:{ - value:6, - useful:1 - } }, - yuchangen:{ - fullskin:true, - type:'jiqi', - addinfo:'蛋', - autoViewAs:'fengyinzhidan', - global:['g_yuchan_swap','g_yuchan_equip'], - ai:{ - value:6, - useful:1 - } - }, - yuchandui:{ - fullskin:true, - type:'jiqi', - addinfo:'雪', - autoViewAs:'xuejibingbao', - global:['g_yuchan_swap','g_yuchan_equip'], - ai:{ - value:6, - useful:4 - } - }, - mujiaren:{ - fullskin:true, - enable:true, - type:'jiguan', - usable:1, - updateUsable:'phaseUse', - forceUsable:true, - wuxieable:true, - selectTarget:-1, - filterTarget:function(card,player,target){ - return target==player; + yuchanqian: { + fullskin: true, + type: "jiqi", + addinfo: "杀", + autoViewAs: "sha", + global: ["g_yuchan_swap", "g_yuchan_equip"], + ai: { + value: 6, + useful: [5, 1], }, - content:function(){ - 'step 0' - var cards=target.getCards('h',function(card){ - return get.type(card)!='basic'; + }, + yuchankun: { + fullskin: true, + type: "jiqi", + addinfo: "药", + autoViewAs: "caoyao", + global: ["g_yuchan_swap", "g_yuchan_equip"], + ai: { + value: 6, + useful: [7, 2], + }, + }, + yuchanzhen: { + fullskin: true, + type: "jiqi", + autoViewAs: "jiu", + addinfo: "酒", + global: ["g_yuchan_swap", "g_yuchan_equip"], + savable: function (card, player, dying) { + return dying == player; + }, + ai: { + value: 6, + useful: [4, 1], + }, + }, + yuchanxun: { + fullskin: true, + type: "jiqi", + autoViewAs: "tao", + addinfo: "桃", + global: ["g_yuchan_swap", "g_yuchan_equip"], + savable: true, + ai: { + value: 6, + useful: [8, 6.5], + }, + }, + yuchankan: { + fullskin: true, + type: "jiqi", + autoViewAs: "shenmiguo", + global: ["g_yuchan_swap", "g_yuchan_equip"], + addinfo: "果", + ai: { + order: 1, + useful: 4, + value: 6, + result: { + player: function () { + var cardname = _status.event.cardname; + if (cardname == "tiesuo") return 0; + if (cardname == "jiu") return 0; + if (cardname == "tianxianjiu") return 0; + if (cardname == "toulianghuanzhu") return 0; + if (cardname == "shijieshu") return 0; + if (cardname == "xietianzi") return 0; + if (cardname == "huogong") return 0; + if (cardname == "shandianjian") return 0; + return 1; + }, + }, + }, + }, + yuchanli: { + fullskin: true, + type: "jiqi", + autoViewAs: "tianxianjiu", + global: ["g_yuchan_swap", "g_yuchan_equip"], + addinfo: "仙", + savable: function (card, player, dying) { + return dying == player; + }, + ai: { + value: 6, + useful: 1, + }, + }, + yuchangen: { + fullskin: true, + type: "jiqi", + addinfo: "蛋", + autoViewAs: "fengyinzhidan", + global: ["g_yuchan_swap", "g_yuchan_equip"], + ai: { + value: 6, + useful: 1, + }, + }, + yuchandui: { + fullskin: true, + type: "jiqi", + addinfo: "雪", + autoViewAs: "xuejibingbao", + global: ["g_yuchan_swap", "g_yuchan_equip"], + ai: { + value: 6, + useful: 4, + }, + }, + mujiaren: { + fullskin: true, + enable: true, + type: "jiguan", + usable: 1, + updateUsable: "phaseUse", + forceUsable: true, + wuxieable: true, + selectTarget: -1, + filterTarget: function (card, player, target) { + return target == player; + }, + content: function () { + "step 0"; + var cards = target.getCards("h", function (card) { + return get.type(card) != "basic"; }); - if(cards.length){ - target.lose(cards)._triggered=null; + if (cards.length) { + target.lose(cards)._triggered = null; } - event.num=1+cards.length; - 'step 1' - var cards=[]; - var list=get.typeCard('jiguan'); - for(var i=0;i=0) return 0; - return 8-get.useful(card); + content: function () { + target.storage.gouhunluo = 3; + target.storage.gouhunluo2 = player; + target.addSkill("gouhunluo"); + }, + ai: { + order: 2, + value: 5, + result: { + target: function (player, target) { + return -1 / Math.max(1, target.hp); + }, + }, + }, + }, + zhuquezhizhang: { + type: "jiqi", + fullskin: true, + global: "g_zhuquezhizhang", + ai: { + value: 8, + useful: 6.5, + }, + }, + xuanwuzhihuang: { + type: "jiqi", + fullskin: true, + global: "g_xuanwuzhihuang", + ai: { + value: 8, + useful: 6.5, + }, + }, + huanglinzhicong: { + type: "jiqi", + fullskin: true, + global: "g_huanglinzhicong", + ai: { + value: 8, + useful: 6.5, + }, + }, + cangchizhibi: { + type: "jiqi", + fullskin: true, + global: "g_cangchizhibi", + ai: { + value: 8, + useful: 6.5, + }, + }, + qinglongzhigui: { + type: "jiqi", + fullskin: true, + global: "g_qinglongzhigui", + ai: { + value: 8, + useful: 6.5, + }, + }, + baishouzhihu: { + type: "jiqi", + fullskin: true, + global: "g_baishouzhihu", + ai: { + value: 8, + useful: 6.5, + }, + }, + jiguantong: { + fullskin: true, + type: "jiguan", + enable: true, + wuxieable: true, + selectTarget: -1, + reverseOrder: true, + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + if (target.countCards("h")) { + var next = target.chooseToDiscard("机关火筒:弃置一张手牌或受到1点火焰伤害"); + next.set("ai", function (card) { + var evt = _status.event.getParent(); + if (get.damageEffect(evt.target, evt.player, evt.target, "fire") >= 0) return 0; + return 8 - get.useful(card); }); - } - else{ - target.damage('fire'); - event.parent.preResult=true; + } else { + target.damage("fire"); + event.parent.preResult = true; event.finish(); } - "step 1" - if(result.bool==false){ - target.damage('fire'); - event.parent.preResult=true; + "step 1"; + if (result.bool == false) { + target.damage("fire"); + event.parent.preResult = true; } }, - contentAfter:function(){ - if(!event.preResult) player.draw(); + contentAfter: function () { + if (!event.preResult) player.draw(); }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.attitude(viewer,target)>0){ - if(target.countCards('h')>0||target.hp>1) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.attitude(viewer, target) > 0) { + if (target.countCards("h") > 0 || target.hp > 1) return 0; } }, - basic:{ - order:9, - useful:1 + basic: { + order: 9, + useful: 1, }, - result:{ - target:function(player,target){ - if(player.hasUnknown(2)) return 0; - var nh=target.countCards('h'); - if(get.mode()=='identity'){ - if(target.isZhu&&nh<=1&&target.hp<=1) return -100; + result: { + target: function (player, target) { + if (player.hasUnknown(2)) return 0; + var nh = target.countCards("h"); + if (get.mode() == "identity") { + if (target.isZhu && nh <= 1 && target.hp <= 1) return -100; } - if(nh==0) return -1; - if(nh==1) return -0.7 + if (nh == 0) return -1; + if (nh == 1) return -0.7; return -0.5; }, }, - tag:{ - discard:1, - loseCard:1, - damage:1, - natureDamage:1, - fireDamage:1, - multitarget:1, - multineg:1, - } - } - }, - donghuangzhong:{ - fullskin:true, - type:'equip', - subtype:'equip5', - nomod:true, - nopower:true, - unique:true, - skills:['donghuangzhong'], - ai:{ - equipValue:7 - } - }, - xuanyuanjian:{ - fullskin:true, - type:'equip', - subtype:'equip1', - nomod:true, - nopower:true, - unique:true, - skills:['xuanyuanjian','xuanyuanjian2','xuanyuanjian3'], - enable:function(card,player){ - return player.hasSkill('xuanyuan')||player.hp>2; + tag: { + discard: 1, + loseCard: 1, + damage: 1, + natureDamage: 1, + fireDamage: 1, + multitarget: 1, + multineg: 1, + }, }, - distance:{attackFrom:-2}, - onEquip:function(){ - if(!player.hasSkill('xuanyuan')&&player.hp<=2){ + }, + donghuangzhong: { + fullskin: true, + type: "equip", + subtype: "equip5", + nomod: true, + nopower: true, + unique: true, + skills: ["donghuangzhong"], + ai: { + equipValue: 7, + }, + }, + xuanyuanjian: { + fullskin: true, + type: "equip", + subtype: "equip1", + nomod: true, + nopower: true, + unique: true, + skills: ["xuanyuanjian", "xuanyuanjian2", "xuanyuanjian3"], + enable: function (card, player) { + return player.hasSkill("xuanyuan") || player.hp > 2; + }, + distance: { attackFrom: -2 }, + onEquip: function () { + if (!player.hasSkill("xuanyuan") && player.hp <= 2) { player.discard(card); - } - else{ + } else { player.changeHujia(); } }, - ai:{ - equipValue:9 - } - }, - pangufu:{ - fullskin:true, - type:'equip', - subtype:'equip1', - skills:['pangufu'], - nomod:true, - nopower:true, - unique:true, - distance:{attackFrom:-3}, - ai:{ - equipValue:8 - } - }, - lianyaohu:{ - fullskin:true, - type:'equip', - subtype:'equip5', - equipDelay:false, - loseDelay:false, - nomod:true, - nopower:true, - unique:true, - onEquip:function(){ - player.markSkill('lianyaohu_skill'); + ai: { + equipValue: 9, }, - onLose:function(){ - player.unmarkSkill('lianyaohu_skill'); + }, + pangufu: { + fullskin: true, + type: "equip", + subtype: "equip1", + skills: ["pangufu"], + nomod: true, + nopower: true, + unique: true, + distance: { attackFrom: -3 }, + ai: { + equipValue: 8, }, - clearLose:true, - ai:{ - equipValue:6 + }, + lianyaohu: { + fullskin: true, + type: "equip", + subtype: "equip5", + equipDelay: false, + loseDelay: false, + nomod: true, + nopower: true, + unique: true, + onEquip: function () { + player.markSkill("lianyaohu_skill"); }, - skills:['lianhua','shouna','lianyaohu_skill'] + onLose: function () { + player.unmarkSkill("lianyaohu_skill"); + }, + clearLose: true, + ai: { + equipValue: 6, + }, + skills: ["lianhua", "shouna", "lianyaohu_skill"], }, - haotianta:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['haotianta'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:7 - } + haotianta: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["haotianta"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: 7, + }, }, - fuxiqin:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['kongxin'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:6 - } + fuxiqin: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["kongxin"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: 6, + }, }, - shennongding:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['shennongding'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:6 - } + shennongding: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["shennongding"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: 6, + }, }, - kongdongyin:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['kongdongyin'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:function(card,player){ - if(player.hp==2) return 7; - if(player.hp==1) return 10; + kongdongyin: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["kongdongyin"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: function (card, player) { + if (player.hp == 2) return 7; + if (player.hp == 1) return 10; return 5; }, - basic:{ - equipValue:7 - } - } + basic: { + equipValue: 7, + }, + }, }, - kunlunjingc:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['kunlunjingc'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:6 - } + kunlunjingc: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["kunlunjingc"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: 6, + }, }, - nvwashi:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['nvwashi'], - nomod:true, - nopower:true, - unique:true, - ai:{ - equipValue:5 - } + nvwashi: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["nvwashi"], + nomod: true, + nopower: true, + unique: true, + ai: { + equipValue: 5, + }, }, - guisheqi:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - content:function(){ + guisheqi: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + content: function () { target.changeHujia(); }, - ai:{ - basic:{ - order:5, - useful:3, - value:[6,2,1] + ai: { + basic: { + order: 5, + useful: 3, + value: [6, 2, 1], }, - result:{ - target:function(player,target){ - return 2/Math.max(1,Math.sqrt(target.hp)); + result: { + target: function (player, target) { + return 2 / Math.max(1, Math.sqrt(target.hp)); }, }, - } - }, - jiguanfeng:{ - fullskin:true, - type:'jiguan', - enable:true, - wuxieable:true, - filterTarget:function(card,player,target){ - return target!=player; }, - content:function(){ - "step 0" - var next=target.chooseToRespond({name:'shan'}); - next.autochoose=lib.filter.autoRespondShan; - "step 1" - if(result.bool==false){ - if(!target.hasSkill('fengyin')){ - target.addTempSkill('fengyin',{player:'phaseBegin'}); + }, + jiguanfeng: { + fullskin: true, + type: "jiguan", + enable: true, + wuxieable: true, + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + var next = target.chooseToRespond({ name: "shan" }); + next.autochoose = lib.filter.autoRespondShan; + "step 1"; + if (result.bool == false) { + if (!target.hasSkill("fengyin")) { + target.addTempSkill("fengyin", { player: "phaseBegin" }); } target.damage(); - } - else{ + } else { event.finish(); } }, - ai:{ - basic:{ - order:9, - useful:3, - value:6.5, + ai: { + basic: { + order: 9, + useful: 3, + value: 6.5, }, - result:{ - target:-2, + result: { + target: -2, }, - tag:{ - respond:1, - respondShan:1, + tag: { + respond: 1, + respondShan: 1, // damage:1, - } - } + }, + }, }, - jiguanyuan:{ - fullskin:true, - type:'jiguan', - wuxieable:true, - enable:function(card,player){ - var hs=player.getCards('he'); - return hs.length>1||(hs.length==1&&hs[0]!=card); + jiguanyuan: { + fullskin: true, + type: "jiguan", + wuxieable: true, + enable: function (card, player) { + var hs = player.getCards("he"); + return hs.length > 1 || (hs.length == 1 && hs[0] != card); }, - filterTarget:function(card,player,target){ - return target!=player&&!target.hasSkill('jiguanyuan'); + filterTarget: function (card, player, target) { + return target != player && !target.hasSkill("jiguanyuan"); }, - content:function(){ - 'step 0' - if(player.countCards('he')){ - player.chooseCard(true,'he').set('prompt2','你将'+ - get.translation(cards)+'和选择牌置于'+get.translation(target)+ - '的武将牌上,然后摸一张牌;'+get.translation(target)+ - '于下一结束阶段获得武将牌上的牌'); - } - else{ + content: function () { + "step 0"; + if (player.countCards("he")) { + player + .chooseCard(true, "he") + .set( + "prompt2", + "你将" + + get.translation(cards) + + "和选择牌置于" + + get.translation(target) + + "的武将牌上,然后摸一张牌;" + + get.translation(target) + + "于下一结束阶段获得武将牌上的牌" + ); + } else { event.finish(); } - 'step 1' + "step 1"; player.$throw(result.cards); - player.lose(result.cards,ui.special); + player.lose(result.cards, ui.special); ui.special.appendChild(cards[0]); - event.togive=[cards[0],result.cards[0]]; + event.togive = [cards[0], result.cards[0]]; game.delay(); - 'step 2' + "step 2"; // target.gain(event.togive).delay=false; target.$gain2(event.togive); - target.storage.jiguanyuan=event.togive; - target.addSkill('jiguanyuan'); - game.log(target,'从',player,'获得了',event.togive); + target.storage.jiguanyuan = event.togive; + target.addSkill("jiguanyuan"); + game.log(target, "从", player, "获得了", event.togive); player.draw(); }, - ai:{ - basic:{ - order:2, - useful:2, - value:7 + ai: { + basic: { + order: 2, + useful: 2, + value: 7, }, - result:{ - target:function(player,target){ - var players=game.filterPlayer(function(current){ - return (current!=player&&!current.isTurnedOver()&& - get.attitude(player,current)>=3&&get.attitude(current,player)>=3) + result: { + target: function (player, target) { + var players = game.filterPlayer(function (current) { + return ( + current != player && + !current.isTurnedOver() && + get.attitude(player, current) >= 3 && + get.attitude(current, player) >= 3 + ); }); players.sort(lib.sort.seat); - if(target==players[0]) return 2; + if (target == players[0]) return 2; return 0.5; }, }, - } - }, - shenmiguo_old:{ - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - filterTarget:function(card,player,target){ - return target==player; }, - modTarget:true, - content:function(){ - var list=[]; - for(var i in lib.card){ - if(lib.card[i].derivation){ + }, + shenmiguo_old: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + filterTarget: function (card, player, target) { + return target == player; + }, + modTarget: true, + content: function () { + var list = []; + for (var i in lib.card) { + if (lib.card[i].derivation) { list.push(i); } } - if(get.mode()=='stone'){ - list.remove('hslingjian_jinjilengdong'); + if (get.mode() == "stone") { + list.remove("hslingjian_jinjilengdong"); } - if(list.length){ - target.gain(game.createCard(list.randomGet()),'draw'); + if (list.length) { + target.gain(game.createCard(list.randomGet()), "draw"); } }, - ai:{ - basic:{ - order:7.3, - useful:2, - value:6 + ai: { + basic: { + order: 7.3, + useful: 2, + value: 6, }, - result:{ - target:2, + result: { + target: 2, }, - } + }, }, - shenmiguo:{ - fullskin:true, - type:'basic', - global:'g_shenmiguo', - content:function(){ - if(Array.isArray(player.storage.shenmiguo)){ - player.useCard(player.storage.shenmiguo[0],player.storage.shenmiguo[1]); + shenmiguo: { + fullskin: true, + type: "basic", + global: "g_shenmiguo", + content: function () { + if (Array.isArray(player.storage.shenmiguo)) { + player.useCard(player.storage.shenmiguo[0], player.storage.shenmiguo[1]); } }, - ai:{ - order:1, - useful:6, - value:6, - result:{ - player:function(){ - var cardname=_status.event.cardname; - if(get.tag({name:cardname},'norepeat')) return 0; + ai: { + order: 1, + useful: 6, + value: 6, + result: { + player: function () { + var cardname = _status.event.cardname; + if (get.tag({ name: cardname }, "norepeat")) return 0; return 1; - } + }, }, - } - }, - qinglianxindeng:{ - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['qinglianxindeng'], - ai:{ - basic:{ - equipValue:8 - } }, }, - lingjiandai:{ - fullskin:true, - enable:true, - type:'jiguan', - wuxieable:true, - filterTarget:function(card,player,target){ - return target==player; + qinglianxindeng: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["qinglianxindeng"], + ai: { + basic: { + equipValue: 8, + }, }, - selectTarget:-1, - modTarget:true, - content:function(){ - var list=get.typeCard('hslingjian'); - if(list.length){ - list=list.randomGets(3); - for(var i=0;i0; - }, - content:function(){ - target.discard(target.getCards('he').randomGet()); - }, - ai:{ - order:9, - result:{ - target:-1, + order: 10.1, + value: [5, 1], + result: { + target: function (player, target) { + return 1 / (1 + target.countCards("e")); + }, }, - useful:[2,0.5], - value:[2,0.5], - } + }, }, - hslingjian_zhongxinghujia:{ - type:'hslingjian', - fullimage:true, - vanish:true, - enable:true, - derivation:true, - derivationpack:'swd', - filterTarget:function(card,player,target){ + hslingjian_xuanfengzhiren: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { + return target.countCards("he") > 0; + }, + content: function () { + target.discard(target.getCards("he").randomGet()); + }, + ai: { + order: 9, + result: { + target: -1, + }, + useful: [2, 0.5], + value: [2, 0.5], + }, + }, + hslingjian_zhongxinghujia: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { return !target.isMin(); }, - content:function(){ - 'step 0' - var list=[]; - for(var i=0;i6) return num; + if (player == target) { + if (hs.length == 2) return num; + if (hs.length == 1) return num + 1; + if (hs.length <= 4) { + for (var i = 0; i < hs.length; i++) { + if (get.value(hs[i]) > 6) return num; } } - if(hs.length>4) return num+0.5; - } - else{ - if(hs.length){ - if(hs.length<=3) return num; - return num+0.5; + if (hs.length > 4) return num + 0.5; + } else { + if (hs.length) { + if (hs.length <= 3) return num; + return num + 0.5; } } - return num+1; + return num + 1; } - } + }, }, - useful:[2,0.5], - value:[2,0.5], - } - }, - hslingjian_xingtigaizao:{ - type:'hslingjian', - fullimage:true, - vanish:true, - enable:true, - derivation:true, - derivationpack:'swd', - filterTarget:function(card,player,target){ - return target==player; + useful: [2, 0.5], + value: [2, 0.5], }, - selectTarget:-1, - content:function(){ + }, + hslingjian_xingtigaizao: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + content: function () { target.draw(); - target.addSkill('hslingjian_xingtigaizao'); - if(typeof target.storage.hslingjian_xingtigaizao=='number'){ + target.addSkill("hslingjian_xingtigaizao"); + if (typeof target.storage.hslingjian_xingtigaizao == "number") { target.storage.hslingjian_xingtigaizao++; - } - else{ - target.storage.hslingjian_xingtigaizao=1; + } else { + target.storage.hslingjian_xingtigaizao = 1; } }, - ai:{ - order:9, - result:{ - target:function(player,target){ - if(!player.needsToDiscard()) return 1; + ai: { + order: 9, + result: { + target: function (player, target) { + if (!player.needsToDiscard()) return 1; return 0; - } + }, }, - useful:[2,0.5], - value:[2,0.5], - } - }, - hslingjian_shijianhuisu:{ - type:'hslingjian', - fullimage:true, - vanish:true, - enable:true, - derivation:true, - derivationpack:'swd', - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('e')>0; + useful: [2, 0.5], + value: [2, 0.5], }, - content:function(){ - var es=target.getCards('e'); + }, + hslingjian_shijianhuisu: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { + return target != player && target.countCards("e") > 0; + }, + content: function () { + var es = target.getCards("e"); target.gain(es); target.$gain2(es); }, - ai:{ - order:5, - result:{ - target:function(player,target){ - if(target.hasSkillTag('noe')||target.hasSkillTag('reverseEquip')) return target.countCards('e')*2; - if(target.getEquip('baiyin')&&target.isDamaged()) return 2; - if(target.getEquip('xuanyuanjian')||target.getEquip('qiankundai')) return 1; - if(target.hasSkill('jiguanyaoshu_skill')) return 0.5; - var num=0; - var es=target.getCards('e'); - for(var i=0;i4) return -1.2*num; - else if(target.hp==4) return -1*num; - else if(target.hp==3) return -0.9*num; - else if(target.hp==2) return -0.5*num; - else{ - if(target.maxHp>2){ - if(target.hujia) return 0.5*num; + ai: { + order: 2, + result: { + target: function (player, target) { + var num = get.threaten(target, player); + if (target.hasSkillTag("noturn")) return 2 * num; + if (target.hp > 4) return -1.2 * num; + else if (target.hp == 4) return -1 * num; + else if (target.hp == 3) return -0.9 * num; + else if (target.hp == 2) return -0.5 * num; + else { + if (target.maxHp > 2) { + if (target.hujia) return 0.5 * num; return num; } return 0; } }, }, - useful:[2,0.5], - value:[2,0.5], - } + useful: [2, 0.5], + value: [2, 0.5], + }, }, - hslingjian_shengxiuhaojiao:{ - type:'hslingjian', - fullimage:true, - vanish:true, - enable:true, - derivation:true, - derivationpack:'swd', - filterTarget:function(card,player,target){ - return !target.hasSkill('hslingjian_chaofeng'); + hslingjian_shengxiuhaojiao: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { + return !target.hasSkill("hslingjian_chaofeng"); }, - content:function(){ - target.addTempSkill('hslingjian_chaofeng',{player:'phaseBegin'}); + content: function () { + target.addTempSkill("hslingjian_chaofeng", { player: "phaseBegin" }); }, - ai:{ - order:2, - result:{ - target:function(player,target){ - if(get.distance(player,target,'absolute')<=1) return 0; - if(target.countCards('h')<=target.hp) return -0.1; + ai: { + order: 2, + result: { + target: function (player, target) { + if (get.distance(player, target, "absolute") <= 1) return 0; + if (target.countCards("h") <= target.hp) return -0.1; return -1; - } + }, }, - useful:[2,0.5], - value:[2,0.5], - } - }, - hslingjian_yinmilichang:{ - type:'hslingjian', - fullimage:true, - vanish:true, - enable:true, - derivation:true, - derivationpack:'swd', - filterTarget:function(card,player,target){ - return player!=target&&!target.hasSkill('qianxing'); + useful: [2, 0.5], + value: [2, 0.5], }, - content:function(){ + }, + hslingjian_yinmilichang: { + type: "hslingjian", + fullimage: true, + vanish: true, + enable: true, + derivation: true, + derivationpack: "swd", + filterTarget: function (card, player, target) { + return player != target && !target.hasSkill("qianxing"); + }, + content: function () { target.tempHide(); }, - ai:{ - order:2, - result:{ - target:function(player,target){ - if(get.distance(player,target,'absolute')<=1) return 0; - if(target.hp==1) return 2; - if(target.hp==2&&target.countCards('h')<=2) return 1.2; - return 1; - } - }, - useful:[2,0.5], - value:[2,0.5], - } - }, - xingjunyan:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['xingjunyan'], - ai:{ - basic:{ - equipValue:4 - }, - }, - }, - qinglonglingzhu:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['qinglonglingzhu'], - ai:{ - basic:{ - equipValue:5 - }, - }, - }, - baihupifeng:{ - fullskin:true, - type:"equip", - subtype:"equip2", - skills:['baihupifeng'], - ai:{ - equipValue:function(card,player){ - if(player.hp<=2) return 8; - return 6; - }, - basic:{ - equipValue:7 - }, - }, - }, - fengxueren:{ - fullskin:true, - type:"equip", - subtype:"equip1", - distance:{attackFrom:-1}, - skills:['fengxueren'], - ai:{ - basic:{ - equipValue:5 - }, - }, - }, - chilongya:{ - fullskin:true, - type:"equip", - subtype:"equip1", - distance:{attackFrom:-1}, - skills:['chilongya'], - ai:{ - basic:{ - equipValue:4 - }, - }, - }, - daihuofenglun:{ - type:'equip', - subtype:'equip4', - fullskin:true, - cardnature:'fire', - distance:{globalFrom:-2,globalTo:-1}, - ai:{ - basic:{ - equipValue:4 - }, - }, - }, - xiayuncailing:{ - type:'equip', - subtype:'equip3', - fullskin:true, - distance:{globalFrom:1,globalTo:2}, - }, - shentoumianju:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['shentou'], - ai:{ - basic:{ - equipValue:7, - } - } - }, - xianluhui:{ - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - reverseOrder:true, - filterTarget:function(card,player,target){ - return target.isDamaged(); - }, - content:function(){ - target.changeHujia(); - }, - ai:{ - tag:{ - multitarget:1, - }, - basic:{ - order:7, - useful:3, - value:3, - }, - result:{ - target:function(player,target){ - if(target.hp<=1) return 1.5; - if(target.hp==2) return 1.2; + ai: { + order: 2, + result: { + target: function (player, target) { + if (get.distance(player, target, "absolute") <= 1) return 0; + if (target.hp == 1) return 2; + if (target.hp == 2 && target.countCards("h") <= 2) return 1.2; return 1; }, }, - } - }, - xiangyuye:{ - type:'basic', - enable:true, - fullskin:true, - filterTarget:function(card,player,target){ - return get.distance(player,target,'attack')>1; + useful: [2, 0.5], + value: [2, 0.5], }, - content:function(){ - "step 0" - if(!target.countCards('h',{color:'black'})){ + }, + xingjunyan: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["xingjunyan"], + ai: { + basic: { + equipValue: 4, + }, + }, + }, + qinglonglingzhu: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["qinglonglingzhu"], + ai: { + basic: { + equipValue: 5, + }, + }, + }, + baihupifeng: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["baihupifeng"], + ai: { + equipValue: function (card, player) { + if (player.hp <= 2) return 8; + return 6; + }, + basic: { + equipValue: 7, + }, + }, + }, + fengxueren: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + skills: ["fengxueren"], + ai: { + basic: { + equipValue: 5, + }, + }, + }, + chilongya: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + skills: ["chilongya"], + ai: { + basic: { + equipValue: 4, + }, + }, + }, + daihuofenglun: { + type: "equip", + subtype: "equip4", + fullskin: true, + cardnature: "fire", + distance: { globalFrom: -2, globalTo: -1 }, + ai: { + basic: { + equipValue: 4, + }, + }, + }, + xiayuncailing: { + type: "equip", + subtype: "equip3", + fullskin: true, + distance: { globalFrom: 1, globalTo: 2 }, + }, + shentoumianju: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["shentou"], + ai: { + basic: { + equipValue: 7, + }, + }, + }, + xianluhui: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + reverseOrder: true, + filterTarget: function (card, player, target) { + return target.isDamaged(); + }, + content: function () { + target.changeHujia(); + }, + ai: { + tag: { + multitarget: 1, + }, + basic: { + order: 7, + useful: 3, + value: 3, + }, + result: { + target: function (player, target) { + if (target.hp <= 1) return 1.5; + if (target.hp == 2) return 1.2; + return 1; + }, + }, + }, + }, + xiangyuye: { + type: "basic", + enable: true, + fullskin: true, + filterTarget: function (card, player, target) { + return get.distance(player, target, "attack") > 1; + }, + content: function () { + "step 0"; + if (!target.countCards("h", { color: "black" })) { target.loseHp(); event.finish(); + } else { + target.chooseToDiscard({ color: "black" }, "弃置一张黑色手牌或受失去1点体力").ai = + function (card) { + return 8 - get.value(card); + }; } - else{ - target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受失去1点体力').ai=function(card){ - return 8-get.value(card); - }; - } - "step 1" - if(!result.bool){ + "step 1"; + if (!result.bool) { target.loseHp(); } }, - ai:{ - basic:{ - order:9, - value:3, - useful:1, + ai: { + basic: { + order: 9, + value: 3, + useful: 1, }, - result:{ - target:-2 + result: { + target: -2, + }, + tag: { + discard: 1, + loseHp: 1, }, - tag:{ - discard:1, - loseHp:1 - } - } - }, - caoyao:{ - fullskin:true, - type:'basic', - range:{global:1}, - enable:true, - filterTarget:function(card,player,target){ - return target.hp0}, - notarget:true, - mode:['identity','guozhan'], - fullskin:true, - content:function(){ - "step 0" - var list=[]; - for(var i=0;i 0; + }, + notarget: true, + mode: ["identity", "guozhan"], + fullskin: true, + content: function () { + "step 0"; + var list = []; + for (var i = 0; i < game.dead.length; i++) { list.push(game.dead[i].name); } - player.chooseButton(ui.create.dialog('选择要复活的角色',[list,'character']),function(button){ - for(var i=0;i3) return 7; + order: function (card, player) { + for (var i = 0; i < game.dead.length; i++) { + if (get.attitude(player, game.dead[i]) > 3) return 7; } return -10; }, - result:{ - player:function(player){ - for(var i=0;i3) return 2; + result: { + player: function (player) { + for (var i = 0; i < game.dead.length; i++) { + if (get.attitude(player, game.dead[i]) > 3) return 2; } return -10; - } + }, }, - } + }, }, - tianxianjiu:{ - fullskin:true, - type:'basic', - toself:true, - enable:function(event,player){ - return !player.hasSkill('tianxianjiu'); + tianxianjiu: { + fullskin: true, + type: "basic", + toself: true, + enable: function (event, player) { + return !player.hasSkill("tianxianjiu"); }, - savable:function(card,player,dying){ - return dying==player; + savable: function (card, player, dying) { + return dying == player; }, - usable:1, - selectTarget:-1, - logv:false, - modTarget:true, - filterTarget:function(card,player,target){ - return target==player; + usable: 1, + selectTarget: -1, + logv: false, + modTarget: true, + filterTarget: function (card, player, target) { + return target == player; }, - content:function(){ - "step 0" - if(target.isDying()) target.recover(); - else{ - target.addTempSkill('tianxianjiu',['phaseAfter','shaAfter']); - if(cards&&cards.length){ - card=cards[0]; + content: function () { + "step 0"; + if (target.isDying()) target.recover(); + else { + target.addTempSkill("tianxianjiu", ["phaseAfter", "shaAfter"]); + if (cards && cards.length) { + card = cards[0]; } - if(target==targets[0]&&card.clone&&(card.clone.parentNode==player.parentNode||card.clone.parentNode==ui.arena)){ + if ( + target == targets[0] && + card.clone && + (card.clone.parentNode == player.parentNode || card.clone.parentNode == ui.arena) + ) { card.clone.moveDelete(target); - game.addVideo('gain2',target,get.cardsInfo([card])); + game.addVideo("gain2", target, get.cardsInfo([card])); } - if(!target.node.jiu&&lib.config.jiu_effect){ - target.node.jiu=ui.create.div('.playerjiu',target.node.avatar); - target.node.jiu2=ui.create.div('.playerjiu',target.node.avatar2); + if (!target.node.jiu && lib.config.jiu_effect) { + target.node.jiu = ui.create.div(".playerjiu", target.node.avatar); + target.node.jiu2 = ui.create.div(".playerjiu", target.node.avatar2); } } }, - ai:{ - basic:{ - useful:function(card,i){ - if(_status.event.player.hp>1){ - if(i==0) return 5; + ai: { + basic: { + useful: function (card, i) { + if (_status.event.player.hp > 1) { + if (i == 0) return 5; return 1; } - if(i==0) return 7.3; + if (i == 0) return 7.3; return 3; }, - value:function(card,player,i){ - if(player.hp>1){ - if(i==0) return 5; + value: function (card, player, i) { + if (player.hp > 1) { + if (i == 0) return 5; return 1; } - if(i==0) return 7.3; + if (i == 0) return 7.3; return 3; }, }, - order:function(){ - return get.order({name:'sha'})+0.2; + order: function () { + return get.order({ name: "sha" }) + 0.2; }, - result:{ - target:function(player,target){ - if(target&&target.isDying()) return 2; - if(lib.config.mode=='stone'&&!player.isMin()){ - if(player.getActCount()+1>=player.actcount) return false; + result: { + target: function (player, target) { + if (target && target.isDying()) return 2; + if (lib.config.mode == "stone" && !player.isMin()) { + if (player.getActCount() + 1 >= player.actcount) return false; } - var shas=player.getCards('h','sha'); - if(shas.length>1&&player.getCardUsable('sha')>1){ + var shas = player.getCards("h", "sha"); + if (shas.length > 1 && player.getCardUsable("sha") > 1) { return 0; } var card; - if(shas.length){ - for(var i=0;i0); - })){ + if (card) { + if ( + game.hasPlayer(function (current) { + return ( + !current.hujia && + get.attitude(target, current) < 0 && + target.canUse(card, current, true, true) && + get.effect(current, card, target) > 0 + ); + }) + ) { return 1; } } return 0; }, }, - } + }, }, - huanpodan:{ - fullskin:true, - type:'basic', - enable:true, - logv:false, - filterTarget:function(card,player,target){ - return !target.hasSkill('huanpodan_skill'); + huanpodan: { + fullskin: true, + type: "basic", + enable: true, + logv: false, + filterTarget: function (card, player, target) { + return !target.hasSkill("huanpodan_skill"); }, - content:function(){ - target.addSkill('huanpodan_skill'); - if(cards&&cards.length){ - card=cards[0]; + content: function () { + target.addSkill("huanpodan_skill"); + if (cards && cards.length) { + card = cards[0]; } - if(target==targets[0]&&card.clone&&(card.clone.parentNode==player.parentNode||card.clone.parentNode==ui.arena)){ + if ( + target == targets[0] && + card.clone && + (card.clone.parentNode == player.parentNode || card.clone.parentNode == ui.arena) + ) { card.clone.moveDelete(target); - game.addVideo('gain2',target,get.cardsInfo([card])); + game.addVideo("gain2", target, get.cardsInfo([card])); } }, - ai:{ - basic:{ - value:8, - useful:4, + ai: { + basic: { + value: 8, + useful: 4, }, - order:2, - result:{ - target:function(player,target){ - return 1/Math.sqrt(1+target.hp); + order: 2, + result: { + target: function (player, target) { + return 1 / Math.sqrt(1 + target.hp); }, }, - } - }, - langeguaiyi:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['longfan'], - ai:{ - basic:{ - equipValue:7, - } - } - }, - guiyoujie:{ - fullskin:true, - type:'delay', - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player!=target); }, - judge:function(card){ - if(get.color(card)=='black') return -3; + }, + langeguaiyi: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["longfan"], + ai: { + basic: { + equipValue: 7, + }, + }, + }, + guiyoujie: { + fullskin: true, + type: "delay", + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player != target; + }, + judge: function (card) { + if (get.color(card) == "black") return -3; return 0; }, - effect:function(){ - if(result.bool==false){ + effect: function () { + if (result.bool == false) { player.loseHp(); player.randomDiscard(); } }, - ai:{ - basic:{ - order:1, - useful:1, - value:6, + ai: { + basic: { + order: 1, + useful: 1, + value: 6, }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('noturn')) return 0; + result: { + target: function (player, target) { + if (target.hasSkillTag("noturn")) return 0; return -3; - } + }, }, - } - }, - yufulu:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['touzhi'], - ai:{ - basic:{ - equipValue:5 - } - } - }, - xixueguizhihuan:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['xixue'], - ai:{ - basic:{ - equipValue:5 - } - } - }, - zhufangshenshi:{ - fullskin:true, - type:'trick', - enable:true, - global:'g_zhufangshenshi', - filterTarget:function(card,player,target){ - return target!=player; }, - content:function(){ - player.storage.zhufangshenshi=target; - player.addTempSkill('zhufangshenshi'); - }, - ai:{ - tag:{ - norepeat:1 + }, + yufulu: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["touzhi"], + ai: { + basic: { + equipValue: 5, }, - value:4, - wuxie:function(){ + }, + }, + xixueguizhihuan: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["xixue"], + ai: { + basic: { + equipValue: 5, + }, + }, + }, + zhufangshenshi: { + fullskin: true, + type: "trick", + enable: true, + global: "g_zhufangshenshi", + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + player.storage.zhufangshenshi = target; + player.addTempSkill("zhufangshenshi"); + }, + ai: { + tag: { + norepeat: 1, + }, + value: 4, + wuxie: function () { return 0; }, - useful:[2,1], - basic:{ - order:7, + useful: [2, 1], + basic: { + order: 7, }, - result:{ - player:function(player,target){ - if(get.attitude(player,target)<0){ - if(get.distance(player,target)>1) return 1; + result: { + player: function (player, target) { + if (get.attitude(player, target) < 0) { + if (get.distance(player, target) > 1) return 1; return 0.6; } return 0.3; - } - } + }, + }, }, }, - jingleishan:{ - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - reverseOrder:true, - cardcolor:'black', - cardnature:'thunder', - filterTarget:function(card,player,target){ - return target!=player; + jingleishan: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + reverseOrder: true, + cardcolor: "black", + cardnature: "thunder", + filterTarget: function (card, player, target) { + return target != player; }, - content:function(){ - "step 0" - var next=target.chooseToRespond({name:'sha'}); - next.ai=function(card){ - if(get.damageEffect(target,player,target,'thunder')>=0) return 0; - if(player.hasSkillTag('notricksource')) return 0; - if(target.hasSkillTag('notrick')) return 0; - return 11-get.value(card); + content: function () { + "step 0"; + var next = target.chooseToRespond({ name: "sha" }); + next.ai = function (card) { + if (get.damageEffect(target, player, target, "thunder") >= 0) return 0; + if (player.hasSkillTag("notricksource")) return 0; + if (target.hasSkillTag("notrick")) return 0; + return 11 - get.value(card); }; - next.autochoose=lib.filter.autoRespondSha; - "step 1" - if(result.bool==false){ - target.damage('thunder'); + next.autochoose = lib.filter.autoRespondSha; + "step 1"; + if (result.bool == false) { + target.damage("thunder"); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.attitude(viewer,target)>0&&target.countCards('h','sha')){ - if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.attitude(viewer, target) > 0 && target.countCards("h", "sha")) { + if (!target.countCards("h") || target.hp == 1 || Math.random() < 0.7) return 0; } }, - basic:{ - order:9, - useful:[5,1], - value:5 + basic: { + order: 9, + useful: [5, 1], + value: 5, }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nothunder')) return 0; - if(target.hasUnknown(2)) return 0; - var nh=target.countCards('h'); - if(lib.config.mode=='identity'){ - if(target.isZhu&&nh<=2&&target.hp<=1) return -100; + result: { + target: function (player, target) { + if (target.hasSkillTag("nothunder")) return 0; + if (target.hasUnknown(2)) return 0; + var nh = target.countCards("h"); + if (lib.config.mode == "identity") { + if (target.isZhu && nh <= 2 && target.hp <= 1) return -100; } - if(nh==0) return -2; - if(nh==1) return -1.7 + if (nh == 0) return -2; + if (nh == 1) return -1.7; return -1.5; }, }, - tag:{ - respond:1, - respondSha:1, - damage:1, - natureDamage:1, - thunderDamage:1, - multitarget:1, - multineg:1, - } - } - }, - chiyuxi:{ - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - reverseOrder:true, - cardcolor:'red', - cardnature:'fire', - filterTarget:function(card,player,target){ - return target!=player; + tag: { + respond: 1, + respondSha: 1, + damage: 1, + natureDamage: 1, + thunderDamage: 1, + multitarget: 1, + multineg: 1, + }, }, - content:function(){ - "step 0" - var next=target.chooseToRespond({name:'shan'}); - next.ai=function(card){ - if(get.damageEffect(target,player,target,'fire')>=0) return 0; - if(player.hasSkillTag('notricksource')) return 0; - if(target.hasSkillTag('notrick')) return 0; - if(target.hasSkillTag('noShan')){ + }, + chiyuxi: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + reverseOrder: true, + cardcolor: "red", + cardnature: "fire", + filterTarget: function (card, player, target) { + return target != player; + }, + content: function () { + "step 0"; + var next = target.chooseToRespond({ name: "shan" }); + next.ai = function (card) { + if (get.damageEffect(target, player, target, "fire") >= 0) return 0; + if (player.hasSkillTag("notricksource")) return 0; + if (target.hasSkillTag("notrick")) return 0; + if (target.hasSkillTag("noShan")) { return -1; } - return 11-get.value(card); + return 11 - get.value(card); }; - next.autochoose=lib.filter.autoRespondShan; - "step 1" - if(result.bool==false){ - target.damage('fire'); + next.autochoose = lib.filter.autoRespondShan; + "step 1"; + if (result.bool == false) { + target.damage("fire"); } }, - ai:{ - wuxie:function(target,card,player,viewer){ - if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ - if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; + ai: { + wuxie: function (target, card, player, viewer) { + if (get.attitude(viewer, target) > 0 && target.countCards("h", "shan")) { + if (!target.countCards("h") || target.hp == 1 || Math.random() < 0.7) return 0; } }, - basic:{ - order:9, - useful:1, - value:5 + basic: { + order: 9, + useful: 1, + value: 5, }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('nofire')) return 0; - if(player.hasUnknown(2)) return 0; - var nh=target.countCards('h'); - if(lib.config.mode=='identity'){ - if(target.isZhu&&nh<=2&&target.hp<=1) return -100; + result: { + target: function (player, target) { + if (target.hasSkillTag("nofire")) return 0; + if (player.hasUnknown(2)) return 0; + var nh = target.countCards("h"); + if (lib.config.mode == "identity") { + if (target.isZhu && nh <= 2 && target.hp <= 1) return -100; } - if(nh==0) return -2; - if(nh==1) return -1.7 + if (nh == 0) return -2; + if (nh == 1) return -1.7; return -1.5; }, }, - tag:{ - respond:1, - respondShan:1, - damage:1, - natureDamage:1, - fireDamage:1, - multitarget:1, - multineg:1, - } - } - }, - guangshatianyi:{ - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['guangshatianyi'], - ai:{ - basic:{ - equipValue:6 - } - } - }, - guilingzhitao:{ - type:'equip', - fullskin:true, - subtype:'equip5', - skills:['nigong'], - ai:{ - equipValue:function(card,player){ - if(!player.storage.nigong) return 5; - return 5+player.storage.nigong; + tag: { + respond: 1, + respondShan: 1, + damage: 1, + natureDamage: 1, + fireDamage: 1, + multitarget: 1, + multineg: 1, }, - basic:{ - equipValue:5 - } - }, - equipDelay:false, - loseDelay:false, - clearLose:true, - onLose:function(){ - player.storage.nigong=0; - player.unmarkSkill('nigong'); - }, - onEquip:function(){ - player.storage.nigong=0; - player.markSkill('nigong'); - } - }, - qipoguyu:{ - type:'equip', - subtype:'equip5', - skills:['xujin'], - equipDelay:false, - loseDelay:false, - clearLose:true, - onLose:function(){ - player.storage.xujin=0; - }, - onEquip:function(){ - player.storage.xujin=0; - } - }, - sadengjinhuan:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['sadengjinhuan'], - ai:{ - basic:{ - equipValue:5.5 - } }, }, - sifeizhenmian:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['yiluan'], - ai:{ - basic:{ - equipValue:6 - } + guangshatianyi: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["guangshatianyi"], + ai: { + basic: { + equipValue: 6, + }, }, }, - shuchui:{ - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['shuchui'], - ai:{ - basic:{ - equipValue:5.5 - } + guilingzhitao: { + type: "equip", + fullskin: true, + subtype: "equip5", + skills: ["nigong"], + ai: { + equipValue: function (card, player) { + if (!player.storage.nigong) return 5; + return 5 + player.storage.nigong; + }, + basic: { + equipValue: 5, + }, + }, + equipDelay: false, + loseDelay: false, + clearLose: true, + onLose: function () { + player.storage.nigong = 0; + player.unmarkSkill("nigong"); + }, + onEquip: function () { + player.storage.nigong = 0; + player.markSkill("nigong"); }, }, - ximohu:{ - type:'equip', - subtype:'equip5', - skills:['ximohu'], - ai:{ - basic:{ - equipValue:6 - } + qipoguyu: { + type: "equip", + subtype: "equip5", + skills: ["xujin"], + equipDelay: false, + loseDelay: false, + clearLose: true, + onLose: function () { + player.storage.xujin = 0; + }, + onEquip: function () { + player.storage.xujin = 0; }, }, - guiyanfadao:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-1}, - ai:{ - basic:{ - equipValue:3 - } + sadengjinhuan: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["sadengjinhuan"], + ai: { + basic: { + equipValue: 5.5, + }, }, - skills:['guiyanfadao'] }, - qiankundai:{ - fullskin:true, - type:'equip', - subtype:'equip5', - onLose:function(){ + sifeizhenmian: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["yiluan"], + ai: { + basic: { + equipValue: 6, + }, + }, + }, + shuchui: { + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["shuchui"], + ai: { + basic: { + equipValue: 5.5, + }, + }, + }, + ximohu: { + type: "equip", + subtype: "equip5", + skills: ["ximohu"], + ai: { + basic: { + equipValue: 6, + }, + }, + }, + guiyanfadao: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + ai: { + basic: { + equipValue: 3, + }, + }, + skills: ["guiyanfadao"], + }, + qiankundai: { + fullskin: true, + type: "equip", + subtype: "equip5", + onLose: function () { player.draw(); }, - skills:['qiankundai'], - ai:{ - order:9.5, - equipValue:function(card,player){ - if(player.countCards('h','qiankundai')) return 6; + skills: ["qiankundai"], + ai: { + order: 9.5, + equipValue: function (card, player) { + if (player.countCards("h", "qiankundai")) return 6; return 1; }, - basic:{ - equipValue:5, - } - } + basic: { + equipValue: 5, + }, + }, }, }, - skill:{ - qiankundai:{ - mod:{ - maxHandcard:function(player,num){ - return num+1; - } - }, - }, - g_hufu_sha:{ - enable:['chooseToRespond','chooseToUse'], - filter:function(event,player){ - return player.countCards('h','hufu')>0; - }, - filterCard:{name:'hufu'}, - viewAs:{name:'sha'}, - prompt:'将一张玉符当杀使用或打出', - check:function(card){return 1}, - ai:{ - order:1, - useful:7.5, - value:7.5 - } - }, - g_hufu_shan:{ - enable:['chooseToRespond','chooseToUse'], - filter:function(event,player){ - return player.countCards('h','hufu')>0; - }, - filterCard:{name:'hufu'}, - viewAs:{name:'shan'}, - prompt:'将一张玉符当闪使用或打出', - check:function(){return 1}, - ai:{ - order:1, - useful:7.5, - value:7.5 - } - }, - g_hufu_jiu:{ - enable:['chooseToRespond','chooseToUse'], - filter:function(event,player){ - return player.countCards('h','hufu')>0; - }, - filterCard:{name:'hufu'}, - viewAs:{name:'jiu'}, - prompt:'将一张玉符当酒使用', - check:function(){return 1}, - }, - zhiluxiaohu:{ - trigger:{source:'damageAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.getParent(3).name=='zhiluxiaohu'; - }, - content:function(){ - player.draw(); - } - }, - zhufangshenshi:{ - mod:{ - targetInRange:function(card,player,target,now){ - if(player.storage.zhufangshenshi==target) return true; + skill: { + qiankundai: { + mod: { + maxHandcard: function (player, num) { + return num + 1; }, }, - mark:true, - intro:{ - content:'player' - }, - onremove:true, }, - g_zhufangshenshi:{ - trigger:{player:'useCardAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.card.name=='zhufangshenshi'; + g_hufu_sha: { + enable: ["chooseToRespond", "chooseToUse"], + filter: function (event, player) { + return player.countCards("h", "hufu") > 0; }, - content:function(){ + filterCard: { name: "hufu" }, + viewAs: { name: "sha" }, + prompt: "将一张玉符当杀使用或打出", + check: function (card) { + return 1; + }, + ai: { + order: 1, + useful: 7.5, + value: 7.5, + }, + }, + g_hufu_shan: { + enable: ["chooseToRespond", "chooseToUse"], + filter: function (event, player) { + return player.countCards("h", "hufu") > 0; + }, + filterCard: { name: "hufu" }, + viewAs: { name: "shan" }, + prompt: "将一张玉符当闪使用或打出", + check: function () { + return 1; + }, + ai: { + order: 1, + useful: 7.5, + value: 7.5, + }, + }, + g_hufu_jiu: { + enable: ["chooseToRespond", "chooseToUse"], + filter: function (event, player) { + return player.countCards("h", "hufu") > 0; + }, + filterCard: { name: "hufu" }, + viewAs: { name: "jiu" }, + prompt: "将一张玉符当酒使用", + check: function () { + return 1; + }, + }, + zhiluxiaohu: { + trigger: { source: "damageAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.card && event.card.name == "sha" && event.getParent(3).name == "zhiluxiaohu"; + }, + content: function () { player.draw(); - } - }, - huanpodan_skill:{ - mark:true, - intro:{ - content:'防止一次死亡,改为弃置所有牌,将体力值变为1并摸一张牌' }, - trigger:{player:'dieBefore'}, - forced:true, - content:function(){ - 'step 0' + }, + zhufangshenshi: { + mod: { + targetInRange: function (card, player, target, now) { + if (player.storage.zhufangshenshi == target) return true; + }, + }, + mark: true, + intro: { + content: "player", + }, + onremove: true, + }, + g_zhufangshenshi: { + trigger: { player: "useCardAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.card.name == "zhufangshenshi"; + }, + content: function () { + player.draw(); + }, + }, + huanpodan_skill: { + mark: true, + intro: { + content: "防止一次死亡,改为弃置所有牌,将体力值变为1并摸一张牌", + }, + trigger: { player: "dieBefore" }, + forced: true, + content: function () { + "step 0"; trigger.cancel(); - player.discard(player.getCards('he')); - player.removeSkill('huanpodan_skill'); - 'step 1' - player.changeHp(1-player.hp); - 'step 2' + player.discard(player.getCards("he")); + player.removeSkill("huanpodan_skill"); + "step 1"; + player.changeHp(1 - player.hp); + "step 2"; player.draw(); - } + }, }, - dujian2:{}, - g_yuchan_swap:{ - trigger:{player:'useCardAfter'}, - silent:true, - priority:-1, - content:function(){ - var hs=player.getCards('h'); - var list=['yuchanqian','yuchankun','yuchanzhen','yuchanxun','yuchangen','yuchanli','yuchankan','yuchandui']; - for(var i=0;i0; + g_yuchan_equip: { + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + var skills = player.getSkills(); + for (var i = 0; i < skills.length; i++) { + if (skills[i].indexOf("yuchan") == 0 && skills[i].indexOf("_equip") != -1) { + return player.countCards("h", { type: "basic" }) > 0; } } return false; }, - filterCard:{type:'basic'}, - selectCard:[1,Infinity], - prompt:'弃置任意张基本牌并摸等量的牌', - check:function(card){ - return 6-get.value(card) + filterCard: { type: "basic" }, + selectCard: [1, Infinity], + prompt: "弃置任意张基本牌并摸等量的牌", + check: function (card) { + return 6 - get.value(card); }, - content:function(){ + content: function () { player.draw(cards.length); }, - ai:{ - order:1, - result:{ - player:1 + ai: { + order: 1, + result: { + player: 1, }, }, }, - yuchanqian_equip1:{}, - yuchanqian_equip2:{}, - yuchanqian_equip3:{}, - yuchanqian_equip4:{}, - yuchanqian_equip5:{}, - yuchankun_equip1:{}, - yuchankun_equip2:{}, - yuchankun_equip3:{}, - yuchankun_equip4:{}, - yuchankun_equip5:{}, - yuchanzhen_equip1:{}, - yuchanzhen_equip2:{}, - yuchanzhen_equip3:{}, - yuchanzhen_equip4:{}, - yuchanzhen_equip5:{}, - yuchanxun_equip1:{}, - yuchanxun_equip2:{}, - yuchanxun_equip3:{}, - yuchanxun_equip4:{}, - yuchanxun_equip5:{}, - yuchankan_equip1:{}, - yuchankan_equip2:{}, - yuchankan_equip3:{}, - yuchankan_equip4:{}, - yuchankan_equip5:{}, - yuchanli_equip1:{}, - yuchanli_equip2:{}, - yuchanli_equip3:{}, - yuchanli_equip4:{}, - yuchanli_equip5:{}, - yuchangen_equip1:{}, - yuchangen_equip2:{}, - yuchangen_equip3:{}, - yuchangen_equip4:{}, - yuchangen_equip5:{}, - yuchandui_equip1:{}, - yuchandui_equip2:{}, - yuchandui_equip3:{}, - yuchandui_equip4:{}, - yuchandui_equip5:{}, - lianyaohu_skill:{ - mark:true, - intro:{ - content:function(storage,player){ - var card=player.getEquip('lianyaohu'); - if(card&&card.storage.shouna&&card.storage.shouna.length){ - return '共有'+get.cnNumber(card.storage.shouna.length)+'张牌'; + yuchanqian_equip1: {}, + yuchanqian_equip2: {}, + yuchanqian_equip3: {}, + yuchanqian_equip4: {}, + yuchanqian_equip5: {}, + yuchankun_equip1: {}, + yuchankun_equip2: {}, + yuchankun_equip3: {}, + yuchankun_equip4: {}, + yuchankun_equip5: {}, + yuchanzhen_equip1: {}, + yuchanzhen_equip2: {}, + yuchanzhen_equip3: {}, + yuchanzhen_equip4: {}, + yuchanzhen_equip5: {}, + yuchanxun_equip1: {}, + yuchanxun_equip2: {}, + yuchanxun_equip3: {}, + yuchanxun_equip4: {}, + yuchanxun_equip5: {}, + yuchankan_equip1: {}, + yuchankan_equip2: {}, + yuchankan_equip3: {}, + yuchankan_equip4: {}, + yuchankan_equip5: {}, + yuchanli_equip1: {}, + yuchanli_equip2: {}, + yuchanli_equip3: {}, + yuchanli_equip4: {}, + yuchanli_equip5: {}, + yuchangen_equip1: {}, + yuchangen_equip2: {}, + yuchangen_equip3: {}, + yuchangen_equip4: {}, + yuchangen_equip5: {}, + yuchandui_equip1: {}, + yuchandui_equip2: {}, + yuchandui_equip3: {}, + yuchandui_equip4: {}, + yuchandui_equip5: {}, + lianyaohu_skill: { + mark: true, + intro: { + content: function (storage, player) { + var card = player.getEquip("lianyaohu"); + if (card && card.storage.shouna && card.storage.shouna.length) { + return "共有" + get.cnNumber(card.storage.shouna.length) + "张牌"; } - return '共有零张牌'; + return "共有零张牌"; }, - mark:function(dialog,storage,player){ - var card=player.getEquip('lianyaohu'); - if(card&&card.storage.shouna&&card.storage.shouna.length){ + mark: function (dialog, storage, player) { + var card = player.getEquip("lianyaohu"); + if (card && card.storage.shouna && card.storage.shouna.length) { dialog.addAuto(card.storage.shouna); - } - else{ - return '共有零张牌'; + } else { + return "共有零张牌"; } }, - markcount:function(storage,player){ - var card=player.getEquip('lianyaohu'); - if(card&&card.storage.shouna) return card.storage.shouna.length; + markcount: function (storage, player) { + var card = player.getEquip("lianyaohu"); + if (card && card.storage.shouna) return card.storage.shouna.length; return 0; - } - } + }, + }, }, - g_shencaojie:{ - trigger:{source:'damageBegin',player:'damageBegin'}, - direct:true, - filter:function(event,player){ - if(get.type(event.card)!='trick') return false; - if(player.hasCard('shencaojie')) return true; + g_shencaojie: { + trigger: { source: "damageBegin", player: "damageBegin" }, + direct: true, + filter: function (event, player) { + if (get.type(event.card) != "trick") return false; + if (player.hasCard("shencaojie")) return true; return false; }, - content:function(){ - player.chooseToUse(get.prompt('shencaojie',trigger.player).replace(/发动/,'使用'),function(card,player){ - if(card.name!='shencaojie') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - },trigger.player,-1).targetRequired=true; - } + content: function () { + player.chooseToUse( + get.prompt("shencaojie", trigger.player).replace(/发动/, "使用"), + function (card, player) { + if (card.name != "shencaojie") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }, + trigger.player, + -1 + ).targetRequired = true; + }, }, - g_shenmiguo:{ - trigger:{player:'useCardAfter'}, - direct:true, - filter:function(event,player){ - if(event.parent.name=='g_shenmiguo') return false; - if(_status.currentPhase!=player) return false; - if(event.parent.parent.name!='phaseUse') return false; - if(!event.targets||!event.card) return false; - if(event.card.name=='shenmiguo') return false; - if(event.card.name=='yuchankan') return false; - if(player.hasSkill('shenmiguo2')) return false; - if(get.info(event.card).complexTarget) return false; - if(!lib.filter.cardEnabled(event.card,player,event.parent)) return false; - var type=get.type(event.card); - if(type!='basic'&&type!='trick') return false; - var card=game.createCard(event.card.name,event.card.suit,event.card.number,event.card.nature); - var targets=event._targets||event.targets; - for(var i=0;i1; }, - content:function(){ - var value=get.value(ui.cardPile.firstChild); - var num=Math.min(20,ui.cardPile.childElementCount); - var list=[],list2=[],list3=[]; - for(var i=1;ivalue){ + }, + shenmiguo2: {}, + yuruyi: { + trigger: { player: "drawBegin" }, + silent: true, + filter: function () { + return ui.cardPile.childElementCount > 1; + }, + content: function () { + var value = get.value(ui.cardPile.firstChild); + var num = Math.min(20, ui.cardPile.childElementCount); + var list = [], + list2 = [], + list3 = []; + for (var i = 1; i < num; i++) { + var val = get.value(ui.cardPile.childNodes[i]); + if (val > value) { list.push(ui.cardPile.childNodes[i]); - if(val>value+1&&val>=7){ + if (val > value + 1 && val >= 7) { list2.push(ui.cardPile.childNodes[i]); } - if(val>value+1&&val>=8){ + if (val > value + 1 && val >= 8) { list3.push(ui.cardPile.childNodes[i]); } } } var card; - if(list3.length){ - card=list3.randomGet(); + if (list3.length) { + card = list3.randomGet(); + } else if (list2.length) { + card = list2.randomGet(); + } else if (list.length) { + card = list.randomGet(); } - else if(list2.length){ - card=list2.randomGet(); + if (card) { + ui.cardPile.insertBefore(card, ui.cardPile.firstChild); } - else if(list.length){ - card=list.randomGet(); - } - if(card){ - ui.cardPile.insertBefore(card,ui.cardPile.firstChild); - } - } + }, }, - shuchui:{ - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - return player.canUse('sha',target); + shuchui: { + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { + return player.canUse("sha", target); }, - filter:function(event,player){ - return player.countCards('h','sha')>0&&lib.filter.cardUsable({name:'sha'},player); + filter: function (event, player) { + return ( + player.countCards("h", "sha") > 0 && lib.filter.cardUsable({ name: "sha" }, player) + ); }, - content:function(){ - 'step 0' - player.addSkill('shuchui2'); - player.storage.shuchui2=false; - event.num=0; - 'step 1' - var card=player.getCards('h','sha')[0]; - if(card){ - player.useCard(card,target); - } - else{ - if(player.storage.shuchui2){ + content: function () { + "step 0"; + player.addSkill("shuchui2"); + player.storage.shuchui2 = false; + event.num = 0; + "step 1"; + var card = player.getCards("h", "sha")[0]; + if (card) { + player.useCard(card, target); + } else { + if (player.storage.shuchui2) { player.draw(); } - player.removeSkill('shuchui2'); + player.removeSkill("shuchui2"); event.finish(); } - 'step 2' - if(event.num++<2&&target.isAlive()){ + "step 2"; + if (event.num++ < 2 && target.isAlive()) { event.goto(1); - } - else{ - if(player.storage.shuchui2){ + } else { + if (player.storage.shuchui2) { player.draw(); } - player.removeSkill('shuchui2'); + player.removeSkill("shuchui2"); } }, - ai:{ - order:function(){ - return get.order({name:'sha'})+0.11; + ai: { + order: function () { + return get.order({ name: "sha" }) + 0.11; + }, + result: { + target: function (player, target) { + return get.effect(target, { name: "sha" }, player, target); + }, }, - result:{ - target:function(player,target){ - return get.effect(target,{name:'sha'},player,target); - } - } - } - }, - shuchui2:{ - trigger:{source:'damageEnd'}, - forced:true, - popup:false, - onremove:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&!player.storage.shuchui2; }, - content:function(){ - player.storage.shuchui2=true; - } }, - xuejibingbao:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - mark:true, - temp:true, - intro:{ - content:'摸牌阶段摸牌数+1' + shuchui2: { + trigger: { source: "damageEnd" }, + forced: true, + popup: false, + onremove: true, + filter: function (event, player) { + return event.card && event.card.name == "sha" && !player.storage.shuchui2; }, - nopop:true, - content:function(){ + content: function () { + player.storage.shuchui2 = true; + }, + }, + xuejibingbao: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + mark: true, + temp: true, + intro: { + content: "摸牌阶段摸牌数+1", + }, + nopop: true, + content: function () { trigger.num++; player.storage.xuejibingbao--; - if(player.storage.xuejibingbao<=0){ - player.removeSkill('xuejibingbao'); + if (player.storage.xuejibingbao <= 0) { + player.removeSkill("xuejibingbao"); delete player.storage.xuejibingbao; - } - else{ + } else { player.updateMarks(); } - } + }, }, - gouhunluo:{ - mark:true, - intro:{ - content:function(storage,player){ - if(storage==1){ - '在'+get.translation(player.storage.gouhunluo2)+'的下个准备阶段失去1点体力并弃置所有手牌' + gouhunluo: { + mark: true, + intro: { + content: function (storage, player) { + if (storage == 1) { + "在" + + get.translation(player.storage.gouhunluo2) + + "的下个准备阶段失去1点体力并弃置所有手牌"; } - return '在'+storage+'轮后'+get.translation(player.storage.gouhunluo2)+'的准备阶段失去1点体力并弃置所有手牌' - } + return ( + "在" + + storage + + "轮后" + + get.translation(player.storage.gouhunluo2) + + "的准备阶段失去1点体力并弃置所有手牌" + ); + }, }, - nopop:true, - temp:true, - trigger:{global:'phaseBegin'}, - forced:true, - popup:false, - filter:function(event,player){ - return player.storage.gouhunluo2==event.player; + nopop: true, + temp: true, + trigger: { global: "phaseBegin" }, + forced: true, + popup: false, + filter: function (event, player) { + return player.storage.gouhunluo2 == event.player; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.storage.gouhunluo--; - if(player.storage.gouhunluo<=0){ - player.logSkill('gouhunluo'); + if (player.storage.gouhunluo <= 0) { + player.logSkill("gouhunluo"); player.loseHp(); - player.removeSkill('gouhunluo'); + player.removeSkill("gouhunluo"); delete player.storage.gouhunluo; delete player.storage.gouhunluo2; - } - else{ + } else { player.updateMarks(); event.finish(); } - 'step 1' - var es=player.getCards('h'); - if(es.length){ + "step 1"; + var es = player.getCards("h"); + if (es.length) { player.discard(es); } }, - group:'gouhunluo2' + group: "gouhunluo2", }, - gouhunluo2:{ - trigger:{global:'dieBegin'}, - forced:true, - popup:false, - filter:function(event,player){ - return player.storage.gouhunluo2==event.player; + gouhunluo2: { + trigger: { global: "dieBegin" }, + forced: true, + popup: false, + filter: function (event, player) { + return player.storage.gouhunluo2 == event.player; }, - content:function(){ - player.removeSkill('gouhunluo'); + content: function () { + player.removeSkill("gouhunluo"); delete player.storage.gouhunluo; delete player.storage.gouhunluo2; - } - }, - jiguanyuan:{ - mark:'card', - intro:{ - content:'cards' }, - trigger:{player:'phaseEnd'}, - forced:true, - temp:true, - popup:false, - content:function(){ - player.gain(player.storage.jiguanyuan,'gain2'); - player.removeSkill('jiguanyuan'); + }, + jiguanyuan: { + mark: "card", + intro: { + content: "cards", + }, + trigger: { player: "phaseEnd" }, + forced: true, + temp: true, + popup: false, + content: function () { + player.gain(player.storage.jiguanyuan, "gain2"); + player.removeSkill("jiguanyuan"); delete player.storage.jiguanyuan; - } - }, - g_qinglongzhigui:{ - trigger:{player:'phaseBegin'}, - forced:true, - filter:function(event,player){ - return player.countCards('h','qinglongzhigui')>0; }, - content:function(){ - 'step 0' - player.showCards(get.translation(player)+'发动了【青龙之圭】',player.getCards('h','qinglongzhigui')); + }, + g_qinglongzhigui: { + trigger: { player: "phaseBegin" }, + forced: true, + filter: function (event, player) { + return player.countCards("h", "qinglongzhigui") > 0; + }, + content: function () { + "step 0"; + player.showCards( + get.translation(player) + "发动了【青龙之圭】", + player.getCards("h", "qinglongzhigui") + ); player.draw(2); - 'step 1' - player.chooseToDiscard('he',true); - } - }, - g_baishouzhihu:{ - trigger:{player:'discardEnd'}, - direct:true, - filter:function(event,player){ - return player.countCards('h','baishouzhihu')>0; + "step 1"; + player.chooseToDiscard("he", true); }, - content:function(){ - "step 0" - player.chooseTarget([1,1],get.prompt('baishouzhihu'),function(card,player,target){ - if(player==target) return false; - return target.countCards('he')>0; - }).ai=function(target){ - return -get.attitude(player,target); + }, + g_baishouzhihu: { + trigger: { player: "discardEnd" }, + direct: true, + filter: function (event, player) { + return player.countCards("h", "baishouzhihu") > 0; + }, + content: function () { + "step 0"; + player.chooseTarget([1, 1], get.prompt("baishouzhihu"), function (card, player, target) { + if (player == target) return false; + return target.countCards("he") > 0; + }).ai = function (target) { + return -get.attitude(player, target); }; - "step 1" - if(result.bool){ - player.showCards(get.translation(player)+'发动了【白兽之琥】',player.getCards('h','baishouzhihu')); - player.logSkill('_baishouzhihu',result.targets); + "step 1"; + if (result.bool) { + player.showCards( + get.translation(player) + "发动了【白兽之琥】", + player.getCards("h", "baishouzhihu") + ); + player.logSkill("_baishouzhihu", result.targets); result.targets[0].randomDiscard(); // player.discardPlayerCard(result.targets[0],'he',true); - } - else{ + } else { event.finish(); } }, }, - g_zhuquezhizhang:{ - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return event.source&&event.source!=player&&event.source.isAlive()&&player.countCards('h','zhuquezhizhang')>0; + g_zhuquezhizhang: { + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return ( + event.source && + event.source != player && + event.source.isAlive() && + player.countCards("h", "zhuquezhizhang") > 0 + ); }, - logTarget:'source', - check:function(event,player){ - return get.damageEffect(event.source,player,player,'fire')>0; + logTarget: "source", + check: function (event, player) { + return get.damageEffect(event.source, player, player, "fire") > 0; }, - content:function(){ - 'step 0' - player.showCards(get.translation(player)+'发动了【朱雀之璋】',player.getCards('h','zhuquezhizhang')); - trigger.source.damage('fire'); - 'step 1' + content: function () { + "step 0"; + player.showCards( + get.translation(player) + "发动了【朱雀之璋】", + player.getCards("h", "zhuquezhizhang") + ); + trigger.source.damage("fire"); + "step 1"; game.delay(); - } - }, - g_xuanwuzhihuang:{ - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event,player){ - return player.countCards('h','xuanwuzhihuang')>0&&event.num>0&&player.hp 0 && + event.num > 0 && + player.hp < player.maxHp + ); + }, + content: function () { + player.showCards( + get.translation(player) + "发动了【玄武之璜】", + player.getCards("h", "xuanwuzhihuang") + ); player.recover(trigger.num); - } - }, - g_huanglinzhicong:{ - trigger:{player:'phaseBegin'}, - forced:true, - filter:function(event,player){ - return !player.hujia&&player.countCards('h','huanglinzhicong')>0; }, - content:function(){ - player.showCards(get.translation(player)+'发动了【黄麟之琮】',player.getCards('h','huanglinzhicong')); + }, + g_huanglinzhicong: { + trigger: { player: "phaseBegin" }, + forced: true, + filter: function (event, player) { + return !player.hujia && player.countCards("h", "huanglinzhicong") > 0; + }, + content: function () { + player.showCards( + get.translation(player) + "发动了【黄麟之琮】", + player.getCards("h", "huanglinzhicong") + ); player.changeHujia(); player.update(); }, }, - g_cangchizhibi:{ - trigger:{player:'phaseBegin'}, - direct:true, - filter:function(event,player){ - return player.countCards('h','cangchizhibi')>0; + g_cangchizhibi: { + trigger: { player: "phaseBegin" }, + direct: true, + filter: function (event, player) { + return player.countCards("h", "cangchizhibi") > 0; }, - content:function(){ - 'step 0' - player.chooseTarget([1,3],get.prompt('cangchizhibi')).ai=function(target){ - var att=get.attitude(player,target); - if(target.isLinked()){ + content: function () { + "step 0"; + player.chooseTarget([1, 3], get.prompt("cangchizhibi")).ai = function (target) { + var att = get.attitude(player, target); + if (target.isLinked()) { return att; } return -att; }; - 'step 1' - if(result.bool){ - player.showCards(get.translation(player)+'发动了【苍螭之璧】',player.getCards('h','cangchizhibi')); - player.logSkill('_cangchizhibi',result.targets); - for(var i=0;i0&&player.hujia==0 }, - content:function(){ - 'step 0' - var next=player.chooseToDiscard('he',{color:'black'},get.prompt('huanglinzhicong_duanzao')); - next.ai=function(card){ - return 8-get.value(card); + }, + cangchizhibi_equip2: { + inherit: "cangchizhibi_equip1", + }, + cangchizhibi_equip3: { + inherit: "cangchizhibi_equip1", + }, + cangchizhibi_equip4: { + inherit: "cangchizhibi_equip1", + }, + cangchizhibi_equip5: { + inherit: "cangchizhibi_equip1", + }, + huanglinzhicong_equip1: { + trigger: { player: "phaseEnd" }, + direct: true, + filter: function (event, player) { + return player.countCards("he", { color: "black" }) > 0 && player.hujia == 0; + }, + content: function () { + "step 0"; + var next = player.chooseToDiscard( + "he", + { color: "black" }, + get.prompt("huanglinzhicong_duanzao") + ); + next.ai = function (card) { + return 8 - get.value(card); }; - next.logSkill='huanglinzhicong_equip1' - 'step 1' - if(result.bool){ + next.logSkill = "huanglinzhicong_equip1"; + "step 1"; + if (result.bool) { player.changeHujia(); } - } - }, - huanglinzhicong_equip2:{ - inherit:'huanglinzhicong_equip1' - }, - huanglinzhicong_equip3:{ - inherit:'huanglinzhicong_equip1' - }, - huanglinzhicong_equip4:{ - inherit:'huanglinzhicong_equip1' - }, - huanglinzhicong_equip5:{ - inherit:'huanglinzhicong_equip1' - }, - xuanwuzhihuang_equip1:{ - trigger:{player:'phaseEnd'}, - direct:true, - filter:function(event,player){ - return player.countCards('he',{color:'red'})>0&&player.hp 0 && player.hp < player.maxHp; + }, + content: function () { + "step 0"; + var next = player.chooseToDiscard( + "he", + { color: "red" }, + get.prompt("xuanwuzhihuang_duanzao") + ); + next.ai = function (card) { + if (get.recoverEffect(player, player, player) <= 0) return 0; + return 8 - get.value(card); }; - next.logSkill='xuanwuzhihuang_equip1' - 'step 1' - if(result.bool){ + next.logSkill = "xuanwuzhihuang_equip1"; + "step 1"; + if (result.bool) { player.recover(); } - } - }, - xuanwuzhihuang_equip2:{ - inherit:'xuanwuzhihuang_equip1' - }, - xuanwuzhihuang_equip3:{ - inherit:'xuanwuzhihuang_equip1' - }, - xuanwuzhihuang_equip4:{ - inherit:'xuanwuzhihuang_equip1' - }, - xuanwuzhihuang_equip5:{ - inherit:'xuanwuzhihuang_equip1' - }, - zhuquezhizhang_equip1:{ - trigger:{player:'phaseEnd'}, - direct:true, - filter:function(event,player){ - return player.countCards('he',{color:'red'})>0; }, - content:function(){ - "step 0" + }, + xuanwuzhihuang_equip2: { + inherit: "xuanwuzhihuang_equip1", + }, + xuanwuzhihuang_equip3: { + inherit: "xuanwuzhihuang_equip1", + }, + xuanwuzhihuang_equip4: { + inherit: "xuanwuzhihuang_equip1", + }, + xuanwuzhihuang_equip5: { + inherit: "xuanwuzhihuang_equip1", + }, + zhuquezhizhang_equip1: { + trigger: { player: "phaseEnd" }, + direct: true, + filter: function (event, player) { + return player.countCards("he", { color: "red" }) > 0; + }, + content: function () { + "step 0"; player.chooseCardTarget({ - position:'he', - filterTarget:function(card,player,target){ - return player!=target&&target.hp>=player.hp; + position: "he", + filterTarget: function (card, player, target) { + return player != target && target.hp >= player.hp; }, - filterCard:function(card,player){ - return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); + filterCard: function (card, player) { + return get.color(card) == "red" && lib.filter.cardDiscardable(card, player); }, - ai1:function(card){ - return 9-get.value(card); + ai1: function (card) { + return 9 - get.value(card); }, - ai2:function(target){ - return get.damageEffect(target,player,player,'fire'); + ai2: function (target) { + return get.damageEffect(target, player, player, "fire"); }, - prompt:get.prompt('zhuquezhizhang_duanzao') + prompt: get.prompt("zhuquezhizhang_duanzao"), }); - "step 1" - if(result.bool){ - event.target=result.targets[0]; - player.logSkill('zhuquezhizhang_equip1',event.target,'fire'); + "step 1"; + if (result.bool) { + event.target = result.targets[0]; + player.logSkill("zhuquezhizhang_equip1", event.target, "fire"); player.discard(result.cards); - } - else{ + } else { event.finish(); } - "step 2" - if(event.target){ - event.target.damage('fire'); + "step 2"; + if (event.target) { + event.target.damage("fire"); } }, }, - zhuquezhizhang_equip2:{ - inherit:'zhuquezhizhang_equip1' + zhuquezhizhang_equip2: { + inherit: "zhuquezhizhang_equip1", }, - zhuquezhizhang_equip3:{ - inherit:'zhuquezhizhang_equip1' + zhuquezhizhang_equip3: { + inherit: "zhuquezhizhang_equip1", }, - zhuquezhizhang_equip4:{ - inherit:'zhuquezhizhang_equip1' + zhuquezhizhang_equip4: { + inherit: "zhuquezhizhang_equip1", }, - zhuquezhizhang_equip5:{ - inherit:'zhuquezhizhang_equip1' + zhuquezhizhang_equip5: { + inherit: "zhuquezhizhang_equip1", }, - baishouzhihu_equip1:{ - trigger:{player:'phaseEnd'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget([1,1],get.prompt('baishouzhihu_duanzao'),function(card,player,target){ - if(player==target) return false; - return target.countCards('he')>0; - }).ai=function(target){ - return -get.attitude(player,target); + baishouzhihu_equip1: { + trigger: { player: "phaseEnd" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget( + [1, 1], + get.prompt("baishouzhihu_duanzao"), + function (card, player, target) { + if (player == target) return false; + return target.countCards("he") > 0; + } + ).ai = function (target) { + return -get.attitude(player, target); }; - "step 1" - if(result.bool){ - player.logSkill('baishouzhihu_equip1',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("baishouzhihu_equip1", result.targets); result.targets[0].randomDiscard(); // player.discardPlayerCard(result.targets[0],'he',true); - } - else{ + } else { event.finish(); } }, }, - baishouzhihu_equip2:{ - inherit:'baishouzhihu_equip1' + baishouzhihu_equip2: { + inherit: "baishouzhihu_equip1", }, - baishouzhihu_equip3:{ - inherit:'baishouzhihu_equip1' + baishouzhihu_equip3: { + inherit: "baishouzhihu_equip1", }, - baishouzhihu_equip4:{ - inherit:'baishouzhihu_equip1' + baishouzhihu_equip4: { + inherit: "baishouzhihu_equip1", }, - baishouzhihu_equip5:{ - inherit:'baishouzhihu_equip1' + baishouzhihu_equip5: { + inherit: "baishouzhihu_equip1", }, - qinglongzhigui_equip1:{ - trigger:{player:'phaseEnd'}, - forced:true, - content:function(){ + qinglongzhigui_equip1: { + trigger: { player: "phaseEnd" }, + forced: true, + content: function () { player.draw(); - } - }, - qinglongzhigui_equip2:{ - inherit:'qinglongzhigui_equip1' - }, - qinglongzhigui_equip3:{ - inherit:'qinglongzhigui_equip1' - }, - qinglongzhigui_equip4:{ - inherit:'qinglongzhigui_equip1' - }, - qinglongzhigui_equip5:{ - inherit:'qinglongzhigui_equip1' - }, - kunlunjingc:{ - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h')>0; }, - delay:false, - content:function(){ - 'step 0' - var cards=get.cards(3); - event.cards=cards; - player.chooseCardButton('选择一张牌',cards,true); - 'step 1' - event.card=result.links[0]; - player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)); - 'step 2' - if(result.bool){ - event.cards[event.cards.indexOf(event.card)]=result.cards[0]; - player.lose(result.cards,ui.special); - var cardx=ui.create.card(); - cardx.classList.add('infohidden'); - cardx.classList.add('infoflip'); - player.$throw(cardx,1000,'nobroadcast'); - } - else{ + }, + qinglongzhigui_equip2: { + inherit: "qinglongzhigui_equip1", + }, + qinglongzhigui_equip3: { + inherit: "qinglongzhigui_equip1", + }, + qinglongzhigui_equip4: { + inherit: "qinglongzhigui_equip1", + }, + qinglongzhigui_equip5: { + inherit: "qinglongzhigui_equip1", + }, + kunlunjingc: { + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.countCards("h") > 0; + }, + delay: false, + content: function () { + "step 0"; + var cards = get.cards(3); + event.cards = cards; + player.chooseCardButton("选择一张牌", cards, true); + "step 1"; + event.card = result.links[0]; + player.chooseCard("h", true, "用一张手牌替换" + get.translation(event.card)); + "step 2"; + if (result.bool) { + event.cards[event.cards.indexOf(event.card)] = result.cards[0]; + player.lose(result.cards, ui.special); + var cardx = ui.create.card(); + cardx.classList.add("infohidden"); + cardx.classList.add("infoflip"); + player.$throw(cardx, 1000, "nobroadcast"); + } else { event.finish(); } - 'step 3' + "step 3"; player.gain(event.card); player.$draw(); - for(var i=event.cards.length-1;i>=0;i--){ + for (var i = event.cards.length - 1; i >= 0; i--) { event.cards[i].fix(); - ui.cardPile.insertBefore(event.cards[i],ui.cardPile.firstChild); + ui.cardPile.insertBefore(event.cards[i], ui.cardPile.firstChild); } game.delay(); }, - ai:{ - order:10, - result:{ - player:1 - } - } + ai: { + order: 10, + result: { + player: 1, + }, + }, }, - lianhua:{ - enable:'phaseUse', - filter:function(event,player){ - var hu=player.getEquip('lianyaohu'); - if(hu&&hu.storage.shouna&&hu.storage.shouna.length>1){ + lianhua: { + enable: "phaseUse", + filter: function (event, player) { + var hu = player.getEquip("lianyaohu"); + if (hu && hu.storage.shouna && hu.storage.shouna.length > 1) { return true; } return false; }, - usable:1, - delay:false, - content:function(){ - "step 0" - event.hu=player.getEquip('lianyaohu'); - player.chooseCardButton('弃置两张壶中的牌,然后从牌堆中获得一张类别不同的牌',2,event.hu.storage.shouna).ai=function(){ + usable: 1, + delay: false, + content: function () { + "step 0"; + event.hu = player.getEquip("lianyaohu"); + player.chooseCardButton( + "弃置两张壶中的牌,然后从牌堆中获得一张类别不同的牌", + 2, + event.hu.storage.shouna + ).ai = function () { return 1; - } - "step 1" - if(result.bool){ - var type=[]; + }; + "step 1"; + if (result.bool) { + var type = []; player.$throw(result.links); - game.log(player,'弃置了',result.links); - for(var i=0;i0; + shouna: { + enable: "phaseUse", + filter: function (event, player) { + return player.countCards("h") > 0; }, - usable:1, - filterCard:true, - check:function(card){ - return 6-get.value(card); + usable: 1, + filterCard: true, + check: function (card) { + return 6 - get.value(card); }, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h')>0; + filterTarget: function (card, player, target) { + return target != player && target.countCards("h") > 0; }, - content:function(){ - 'step 0' - var card=target.getCards('h').randomGet(); - var hu=player.getEquip('lianyaohu'); - if(card&&hu){ - if(!hu.storage.shouna){ - hu.storage.shouna=[]; + content: function () { + "step 0"; + var card = target.getCards("h").randomGet(); + var hu = player.getEquip("lianyaohu"); + if (card && hu) { + if (!hu.storage.shouna) { + hu.storage.shouna = []; } - target.$give(card,player); - target.lose(card,ui.special); - event.card=card; - event.hu=hu; + target.$give(card, player); + target.lose(card, ui.special); + event.card = card; + event.hu = hu; } - 'step 1' - if(!event.card._selfDestroyed){ + "step 1"; + if (!event.card._selfDestroyed) { event.hu.storage.shouna.push(event.card); player.updateMarks(); } }, - ai:{ - order:5, - result:{ - target:function(player,target){ - return -1/Math.sqrt(1+target.countCards('h')); - } - } - } + ai: { + order: 5, + result: { + target: function (player, target) { + return -1 / Math.sqrt(1 + target.countCards("h")); + }, + }, + }, }, - shouna_old:{ - trigger:{global:'discardAfter'}, - filter:function(event,player){ - if(player.hasSkill('shouna2')) return false; - if(_status.currentPhase==event.player) return false; - if(event.player==player) return false; - for(var i=0;i0; + shouna2: {}, + donghuangzhong: { + trigger: { player: "phaseEnd" }, + direct: true, + filter: function (event, player) { + return player.countCards("h", { color: "red" }) > 0; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.chooseCardTarget({ - filterTarget:true, - filterCard:function(card,player,event){ - if(get.color(card)!='red') return false; - return lib.filter.cardDiscardable(card,player,event); + filterTarget: true, + filterCard: function (card, player, event) { + if (get.color(card) != "red") return false; + return lib.filter.cardDiscardable(card, player, event); }, - ai1:function(card){ - return 8-get.useful(card); + ai1: function (card) { + return 8 - get.useful(card); }, - ai2:function(target){ - return -get.attitude(player,target); + ai2: function (target) { + return -get.attitude(player, target); }, - prompt:get.prompt('donghuangzhong') + prompt: get.prompt("donghuangzhong"), }); - 'step 1' - if(result.bool){ - player.logSkill('donghuangzhong',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("donghuangzhong", result.targets); player.discard(result.cards); - event.target=result.targets[0]; - } - else{ + event.target = result.targets[0]; + } else { event.finish(); } - 'step 2' - var target=event.target; - var list=[]; - for(var i=0;i0; + pangufu: { + trigger: { source: "damageEnd" }, + forced: true, + priority: 55, + filter: function (event) { + if (event._notrigger.includes(event.player)) return false; + return event.player.countCards("he") > 0; + }, + content: function () { + trigger.player.chooseToDiscard(true, "he"); }, - content:function(){ - trigger.player.chooseToDiscard(true,'he'); - } }, - shouhua:{ - mode:['identity','infinity'], - enable:'phaseUse', - filter:function(event,player){ - return player==game.me; + shouhua: { + mode: ["identity", "infinity"], + enable: "phaseUse", + filter: function (event, player) { + return player == game.me; }, - usable:1, - filterTarget:function(card,player,target){ - return target!=game.zhu&&target!=game.me&&target.hp0){ - return 1+trigger.judge(button.link); + haotianta: { + trigger: { global: "judgeBefore" }, + direct: true, + content: function () { + "step 0"; + event.cards = get.cards(2); + player.chooseCardButton( + true, + event.cards, + "昊天塔:选择一张牌作为" + + get.translation(trigger.player) + + "的" + + trigger.judgestr + + "判定结果" + ).ai = function (button) { + if (get.attitude(player, trigger.player) > 0) { + return 1 + trigger.judge(button.link); } - if(get.attitude(player,trigger.player)<0){ - return 1-trigger.judge(button.link); + if (get.attitude(player, trigger.player) < 0) { + return 1 - trigger.judge(button.link); } return 0; }; - "step 1" - if(!result.bool){ + "step 1"; + if (!result.bool) { event.finish(); return; } - player.logSkill('haotianta',trigger.player); - var card=result.links[0]; + player.logSkill("haotianta", trigger.player); + var card = result.links[0]; event.cards.remove(card); - var judgestr=get.translation(trigger.player)+'的'+trigger.judgestr+'判定'; - event.videoId=lib.status.videoId++; - event.dialog=ui.create.dialog(judgestr); - event.dialog.classList.add('center'); - event.dialog.videoId=event.videoId; + var judgestr = get.translation(trigger.player) + "的" + trigger.judgestr + "判定"; + event.videoId = lib.status.videoId++; + event.dialog = ui.create.dialog(judgestr); + event.dialog.classList.add("center"); + event.dialog.videoId = event.videoId; - game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); - for(var i=0;i0){ - trigger.result.bool=true; - trigger.player.popup('判定生效'); + if (trigger.result.judge > 0) { + trigger.result.bool = true; + trigger.player.popup("判定生效"); } - if(trigger.result.judge<0){ - trigger.result.bool=false; - trigger.player.popup('判定失效'); + if (trigger.result.judge < 0) { + trigger.result.bool = false; + trigger.player.popup("判定失效"); } - game.log(trigger.player,'的判定结果为',card); - trigger.direct=true; + game.log(trigger.player, "的判定结果为", card); + trigger.direct = true; trigger.position.appendChild(card); game.delay(2); - } - else{ + } else { event.finish(); } - "step 2" - ui.arena.classList.remove('thrownhighlight'); + "step 2"; + ui.arena.classList.remove("thrownhighlight"); event.dialog.close(); - game.addVideo('judge2',null,event.videoId); + game.addVideo("judge2", null, event.videoId); ui.clear(); - var card=trigger.result.card; + var card = trigger.result.card; trigger.position.appendChild(card); trigger.result.node.delete(); game.delay(); }, - ai:{ - tag:{ - rejudge:1 - } - } + ai: { + tag: { + rejudge: 1, + }, + }, }, - shennongding:{ - enable:'phaseUse', - usable:1, - filterCard:true, - selectCard:2, - check:function(card){ - if(get.tag(card,'recover')>=1) return 0; - return 7-get.value(card); + shennongding: { + enable: "phaseUse", + usable: 1, + filterCard: true, + selectCard: 2, + check: function (card) { + if (get.tag(card, "recover") >= 1) return 0; + return 7 - get.value(card); }, - filter:function(event,player){ - return player.hp=2; + filter: function (event, player) { + return player.hp < player.maxHp && player.countCards("h") >= 2; }, - content:function(){ + content: function () { player.recover(); }, - ai:{ - result:{ - player:function(player){ + ai: { + result: { + player: function (player) { return get.recoverEffect(player); - } + }, }, - order:2.5 - } - }, - kongdongyin:{ - trigger:{player:'dieBefore'}, - forced:true, - filter:function(event,player){ - return player.maxHp>0; + order: 2.5, }, - content:function(){ + }, + kongdongyin: { + trigger: { player: "dieBefore" }, + forced: true, + filter: function (event, player) { + return player.maxHp > 0; + }, + content: function () { trigger.cancel(); - player.hp=1; + player.hp = 1; player.draw(); - player.discard(player.getCards('e',{subtype:'equip5'})); + player.discard(player.getCards("e", { subtype: "equip5" })); game.delay(); - } + }, }, - nvwashi:{ - trigger:{global:'dying'}, - priority:6, - filter:function(event,player){ - return event.player.hp<=0&&player.hp>1; + nvwashi: { + trigger: { global: "dying" }, + priority: 6, + filter: function (event, player) { + return event.player.hp <= 0 && player.hp > 1; }, - check:function(event,player){ - return get.attitude(player,event.player)>=3&&!event.player.hasSkillTag('nosave'); + check: function (event, player) { + return get.attitude(player, event.player) >= 3 && !event.player.hasSkillTag("nosave"); }, - logTarget:'player', - content:function(){ - "step 0" + logTarget: "player", + content: function () { + "step 0"; trigger.player.recover(); - "step 1" + "step 1"; player.loseHp(); }, - ai:{ - threaten:1.2, - expose:0.2 - } + ai: { + threaten: 1.2, + expose: 0.2, + }, }, - kongxin:{ - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ + kongxin: { + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { return player.canCompare(target); }, - filter:function(event,player){ - return player.countCards('h')&&game.hasPlayer(function(current){ - return player.canCompare(current); - }); + filter: function (event, player) { + return ( + player.countCards("h") && + game.hasPlayer(function (current) { + return player.canCompare(current); + }) + ); }, - content:function(){ - "step 0" + content: function () { + "step 0"; player.chooseToCompare(target); - "step 1" - if(result.bool){ - event.bool=true; - player.chooseTarget('选择一个目标视为'+get.translation(target)+'对其使用一张杀',function(card,player,target2){ - return player!=target2&&target.canUse('sha',target2); - }).ai=function(target2){ - return get.effect(target2,{name:'sha'},target,player); - } - } - else{ + "step 1"; + if (result.bool) { + event.bool = true; + player.chooseTarget( + "选择一个目标视为" + get.translation(target) + "对其使用一张杀", + function (card, player, target2) { + return player != target2 && target.canUse("sha", target2); + } + ).ai = function (target2) { + return get.effect(target2, { name: "sha" }, target, player); + }; + } else { target.discardPlayerCard(player); } - "step 2" - if(event.bool&&result.bool){ - target.useCard({name:'sha'},result.targets); + "step 2"; + if (event.bool && result.bool) { + target.useCard({ name: "sha" }, result.targets); } }, - ai:{ - order:7, - result:{ - target:function(player,target){ - if(player.countCards('h')<=1) return 0; - if(get.attitude(player,target)>=0) return 0; - if(game.hasPlayer(function(current){ - return (player!=current&&target.canUse('sha',current)&& - get.effect(current,{name:'sha'},target,player)>0) - })){ + ai: { + order: 7, + result: { + target: function (player, target) { + if (player.countCards("h") <= 1) return 0; + if (get.attitude(player, target) >= 0) return 0; + if ( + game.hasPlayer(function (current) { + return ( + player != current && + target.canUse("sha", current) && + get.effect(current, { name: "sha" }, target, player) > 0 + ); + }) + ) { return -1; } return 0; - } - } - } - }, - kongxin2:{ - trigger:{player:'dying'}, - priority:10, - forced:true, - popup:false, - filter:function(event,player){ - return player==game.me; + }, + }, }, - content:function(){ - player.removeSkill('kongxin2'); + }, + kongxin2: { + trigger: { player: "dying" }, + priority: 10, + forced: true, + popup: false, + filter: function (event, player) { + return player == game.me; + }, + content: function () { + player.removeSkill("kongxin2"); game.swapPlayer(player); - player.storage.kongxin.lockOut=false; + player.storage.kongxin.lockOut = false; player.storage.kongxin.out(); - if(player==game.me) game.swapPlayer(player.storage.kongxin); - if(lib.config.mode=='identity') player.storage.kongxin.setIdentity(); + if (player == game.me) game.swapPlayer(player.storage.kongxin); + if (lib.config.mode == "identity") player.storage.kongxin.setIdentity(); delete player.storage.kongxin; }, }, - qinglianxindeng:{ - trigger:{player:'damageBefore'}, - forced:true, - priority:15, - filter:function(event,player){ - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - return get.type(event.card,'trick')=='trick'; + qinglianxindeng: { + trigger: { player: "damageBefore" }, + forced: true, + priority: 15, + filter: function (event, player) { + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + return get.type(event.card, "trick") == "trick"; }, - content:function(){ + content: function () { trigger.cancel(); }, - ai:{ - notrick:true, - effect:{ - target:function(card,player,target,current){ - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:player, - card:card - })) return; - if(get.type(card)=='trick'&&get.tag(card,'damage')){ - return 'zeroplayertarget'; + ai: { + notrick: true, + effect: { + target: function (card, player, target, current) { + if ( + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: player, + card: card, + }) + ) + return; + if (get.type(card) == "trick" && get.tag(card, "damage")) { + return "zeroplayertarget"; } }, - } - } - }, - yiluan:{ - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h'); + }, }, - content:function(){ - 'step 0' + }, + yiluan: { + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { + return target != player && target.countCards("h"); + }, + content: function () { + "step 0"; target.judge(); - 'step 1' - if(result.suit!='heart'){ - var hs=target.getCards('h'); - while(hs.length){ - var chosen=hs.randomRemove(); - if(target.hasUseTarget(chosen)&&!get.info(chosen).multitarget){ - var list=game.filterPlayer(function(current){ - return lib.filter.targetEnabled2(chosen,target,current); + "step 1"; + if (result.suit != "heart") { + var hs = target.getCards("h"); + while (hs.length) { + var chosen = hs.randomRemove(); + if (target.hasUseTarget(chosen) && !get.info(chosen).multitarget) { + var list = game.filterPlayer(function (current) { + return lib.filter.targetEnabled2(chosen, target, current); }); - if(list.length){ - target.useCard(chosen,list.randomGet()); + if (list.length) { + target.useCard(chosen, list.randomGet()); event.finish(); break; } @@ -3626,1073 +3795,1152 @@ game.import('card', function () { } } }, - ai:{ - order:10, - result:{ - target:function(player,target){ - if(!target.countCards('h')) return 0; + ai: { + order: 10, + result: { + target: function (player, target) { + if (!target.countCards("h")) return 0; return -1; - } - } - } + }, + }, + }, }, - hslingjian_xuanfengzhiren_equip1:{ - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event){ - if(event._notrigger.includes(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.player.countCards('he'); + hslingjian_xuanfengzhiren_equip1: { + trigger: { source: "damageEnd" }, + forced: true, + filter: function (event) { + if (event._notrigger.includes(event.player)) return false; + return event.card && event.card.name == "sha" && event.player.countCards("he"); + }, + content: function () { + trigger.player.discard(trigger.player.getCards("he").randomGet()); }, - content:function(){ - trigger.player.discard(trigger.player.getCards('he').randomGet()); - } }, - hslingjian_xuanfengzhiren_equip2:{ - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.source&&event.source.countCards('he'); + hslingjian_xuanfengzhiren_equip2: { + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event) { + return ( + event.card && + event.card.name == "sha" && + event.source && + event.source.countCards("he") + ); + }, + content: function () { + trigger.source.discard(trigger.source.getCards("he").randomGet()); }, - content:function(){ - trigger.source.discard(trigger.source.getCards('he').randomGet()); - } }, - hslingjian_xuanfengzhiren_equip3:{ - trigger:{player:'loseAfter'}, - forced:true, - filter:function(event,player){ - return _status.currentPhase!=player&&!player.hasSkill('hslingjian_xuanfengzhiren_equip3_dist'); + hslingjian_xuanfengzhiren_equip3: { + trigger: { player: "loseAfter" }, + forced: true, + filter: function (event, player) { + return ( + _status.currentPhase != player && + !player.hasSkill("hslingjian_xuanfengzhiren_equip3_dist") + ); + }, + content: function () { + player.addTempSkill("hslingjian_xuanfengzhiren_equip3_dist"); }, - content:function(){ - player.addTempSkill('hslingjian_xuanfengzhiren_equip3_dist'); - } }, - hslingjian_xuanfengzhiren_equip3_dist:{ - mod:{ - globalTo:function(from,to,distance){ - return distance+1; - } - } + hslingjian_xuanfengzhiren_equip3_dist: { + mod: { + globalTo: function (from, to, distance) { + return distance + 1; + }, + }, }, - hslingjian_xuanfengzhiren_equip4:{ - trigger:{player:'loseAfter'}, - forced:true, - filter:function(event,player){ - return _status.currentPhase==player&&!player.hasSkill('hslingjian_xuanfengzhiren_equip4_dist'); + hslingjian_xuanfengzhiren_equip4: { + trigger: { player: "loseAfter" }, + forced: true, + filter: function (event, player) { + return ( + _status.currentPhase == player && + !player.hasSkill("hslingjian_xuanfengzhiren_equip4_dist") + ); + }, + content: function () { + player.addTempSkill("hslingjian_xuanfengzhiren_equip4_dist"); }, - content:function(){ - player.addTempSkill('hslingjian_xuanfengzhiren_equip4_dist'); - } }, - hslingjian_xuanfengzhiren_equip4_dist:{ - mod:{ - globalFrom:function(from,to,distance){ - return distance-1; - } - } + hslingjian_xuanfengzhiren_equip4_dist: { + mod: { + globalFrom: function (from, to, distance) { + return distance - 1; + }, + }, }, - hslingjian_xuanfengzhiren_equip5:{ - enable:'phaseUse', - usable:1, - filterCard:true, - position:'he', - filter:function(event,player){ - return player.countCards('he')>0; + hslingjian_xuanfengzhiren_equip5: { + enable: "phaseUse", + usable: 1, + filterCard: true, + position: "he", + filter: function (event, player) { + return player.countCards("he") > 0; }, - filterTarget:function(card,player,target){ - return target.countCards('he')>0; + filterTarget: function (card, player, target) { + return target.countCards("he") > 0; }, - check:function(card){ - return 5-get.value(card); + check: function (card) { + return 5 - get.value(card); }, - content:function(){ - target.discard(target.getCards('he').randomGet()); + content: function () { + target.discard(target.getCards("he").randomGet()); }, - ai:{ - order:5, - result:{ - target:function(player,target){ - var dh=player.countCards('he')-target.countCards('he'); - if(dh>0){ + ai: { + order: 5, + result: { + target: function (player, target) { + var dh = player.countCards("he") - target.countCards("he"); + if (dh > 0) { return -Math.sqrt(dh); } return 0; - } - } - } + }, + }, + }, }, - hslingjian_zhongxinghujia_equip1:{ - trigger:{source:'damageEnd'}, - check:function(event,player){ + hslingjian_zhongxinghujia_equip1: { + trigger: { source: "damageEnd" }, + check: function (event, player) { return !player.getEquip(2); }, - filter:function(event){ - return event.card&&event.card.name=='sha'; + filter: function (event) { + return event.card && event.card.name == "sha"; }, - content:function(){ - var card=game.createCard(get.inpile('equip2').randomGet()); + content: function () { + var card = game.createCard(get.inpile("equip2").randomGet()); player.equip(card); player.$draw(card); game.delay(); - } + }, }, - hslingjian_zhongxinghujia_equip2:{ - trigger:{player:'damageEnd'}, - check:function(event,player){ - return get.attitude(player,event.source)<0; + hslingjian_zhongxinghujia_equip2: { + trigger: { player: "damageEnd" }, + check: function (event, player) { + return get.attitude(player, event.source) < 0; }, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.source&&event.source.getEquip(2); + filter: function (event) { + return event.card && event.card.name == "sha" && event.source && event.source.getEquip(2); }, - content:function(){ - player.line(trigger.source,'green'); + content: function () { + player.line(trigger.source, "green"); trigger.source.discard(trigger.source.getEquip(2)); - } - }, - hslingjian_zhongxinghujia_equip3:{ - mod:{ - globalTo:function(from,to,distance){ - if(to.getEquip(2)) return distance+1; - } - } - }, - hslingjian_zhongxinghujia_equip4:{ - mod:{ - globalFrom:function(from,to,distance){ - if(from.getEquip(2)) return distance-1; - } - } - }, - hslingjian_zhongxinghujia_equip5:{ - enable:'phaseUse', - usable:1, - filterCard:true, - position:'he', - filterTarget:true, - selectCard:2, - filter:function(event,player){ - return player.countCards('he')>=2; }, - check:function(card){ - return 5-get.value(card); + }, + hslingjian_zhongxinghujia_equip3: { + mod: { + globalTo: function (from, to, distance) { + if (to.getEquip(2)) return distance + 1; + }, }, - content:function(){ - var card=game.createCard(get.inpile('equip2').randomGet()); + }, + hslingjian_zhongxinghujia_equip4: { + mod: { + globalFrom: function (from, to, distance) { + if (from.getEquip(2)) return distance - 1; + }, + }, + }, + hslingjian_zhongxinghujia_equip5: { + enable: "phaseUse", + usable: 1, + filterCard: true, + position: "he", + filterTarget: true, + selectCard: 2, + filter: function (event, player) { + return player.countCards("he") >= 2; + }, + check: function (card) { + return 5 - get.value(card); + }, + content: function () { + var card = game.createCard(get.inpile("equip2").randomGet()); target.equip(card); target.$draw(card); game.delay(); }, - ai:{ - order:1, - result:{ - target:function(player,target){ - if(target.getEquip(2)) return 0; + ai: { + order: 1, + result: { + target: function (player, target) { + if (target.getEquip(2)) return 0; return 1; - } - } - } + }, + }, + }, }, - hslingjian_jinjilengdong_equip1:{ - trigger:{source:'damageEnd'}, - check:function(event,player){ - if(event.player.hasSkillTag('noturn')) return 0; - if(event.player.isTurnedOver()){ - return get.attitude(player,event.player)>0; + hslingjian_jinjilengdong_equip1: { + trigger: { source: "damageEnd" }, + check: function (event, player) { + if (event.player.hasSkillTag("noturn")) return 0; + if (event.player.isTurnedOver()) { + return get.attitude(player, event.player) > 0; } - return get.attitude(player,event.player)<=0; + return get.attitude(player, event.player) <= 0; }, - filter:function(event){ - if(event._notrigger.includes(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive(); + filter: function (event) { + if (event._notrigger.includes(event.player)) return false; + return event.card && event.card.name == "sha" && event.player && event.player.isAlive(); }, - logTarget:'player', - content:function(){ + logTarget: "player", + content: function () { trigger.player.draw(2); trigger.player.turnOver(); - } + }, }, - hslingjian_jinjilengdong_equip2:{ - trigger:{player:'damageEnd'}, - check:function(event,player){ - if(event.player.hasSkillTag('noturn')) return 0; - if(event.player.isTurnedOver()){ - return get.attitude(player,event.source)>0; + hslingjian_jinjilengdong_equip2: { + trigger: { player: "damageEnd" }, + check: function (event, player) { + if (event.player.hasSkillTag("noturn")) return 0; + if (event.player.isTurnedOver()) { + return get.attitude(player, event.source) > 0; } - return get.attitude(player,event.source)<=0; + return get.attitude(player, event.source) <= 0; }, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.source&&event.source.isAlive(); + filter: function (event) { + return event.card && event.card.name == "sha" && event.source && event.source.isAlive(); }, - logTarget:'source', - content:function(){ - player.line(trigger.source,'green'); + logTarget: "source", + content: function () { + player.line(trigger.source, "green"); trigger.source.draw(2); trigger.source.turnOver(); - } + }, }, - hslingjian_jinjilengdong_equip3:{ - mod:{ - globalTo:function(from,to,distance){ - if(to.isTurnedOver()) return distance+2; - } - } + hslingjian_jinjilengdong_equip3: { + mod: { + globalTo: function (from, to, distance) { + if (to.isTurnedOver()) return distance + 2; + }, + }, }, - hslingjian_jinjilengdong_equip4:{ - mod:{ - globalFrom:function(from,to,distance){ - if(from.isTurnedOver()) return distance-2; - } - } + hslingjian_jinjilengdong_equip4: { + mod: { + globalFrom: function (from, to, distance) { + if (from.isTurnedOver()) return distance - 2; + }, + }, }, - hslingjian_jinjilengdong_equip5:{ - trigger:{player:'phaseAfter'}, - direct:true, - filter:function(event,player){ + hslingjian_jinjilengdong_equip5: { + trigger: { player: "phaseAfter" }, + direct: true, + filter: function (event, player) { return !player.isTurnedOver(); }, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('hslingjian_jinjilengdong_duanzao'),function(card,player,target){ - return player!=target&&!target.isTurnedOver(); - }).ai=function(target){ - if(target.hasSkillTag('noturn')) return 0; - return Math.max(0,-get.attitude(player,target)-2); + content: function () { + "step 0"; + player.chooseTarget( + get.prompt("hslingjian_jinjilengdong_duanzao"), + function (card, player, target) { + return player != target && !target.isTurnedOver(); + } + ).ai = function (target) { + if (target.hasSkillTag("noturn")) return 0; + return Math.max(0, -get.attitude(player, target) - 2); }; - "step 1" - if(result.bool){ - player.logSkill('hslingjian_jinjilengdong_equip5',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("hslingjian_jinjilengdong_equip5", result.targets); player.turnOver(); result.targets[0].turnOver(); - game.asyncDraw([player,result.targets[0]],2); + game.asyncDraw([player, result.targets[0]], 2); } }, }, - hslingjian_yinmilichang_equip1:{ - trigger:{source:'damageEnd'}, - direct:true, - filter:function(event){ - return event.card&&event.card.name=='sha'; + hslingjian_yinmilichang_equip1: { + trigger: { source: "damageEnd" }, + direct: true, + filter: function (event) { + return event.card && event.card.name == "sha"; }, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt('hslingjian_yinmilichang_duanzao'),function(card,player,target){ - return target!=player&&!target.hasSkill('qianxing'); - }).ai=function(target){ - var att=get.attitude(player,target); - if(get.distance(player,target,'absolute')<=1) return 0; - if(target.hp==1) return 2*att; - if(target.hp==2&&target.countCards('h')<=2) return 1.2*att; + content: function () { + "step 0"; + player.chooseTarget( + get.prompt("hslingjian_yinmilichang_duanzao"), + function (card, player, target) { + return target != player && !target.hasSkill("qianxing"); + } + ).ai = function (target) { + var att = get.attitude(player, target); + if (get.distance(player, target, "absolute") <= 1) return 0; + if (target.hp == 1) return 2 * att; + if (target.hp == 2 && target.countCards("h") <= 2) return 1.2 * att; return att; - } - 'step 1' - if(result.bool){ - player.logSkill('hslingjian_yinmilichang_equip1',result.targets); + }; + "step 1"; + if (result.bool) { + player.logSkill("hslingjian_yinmilichang_equip1", result.targets); result.targets[0].tempHide(); } - } - }, - hslingjian_yinmilichang_equip2:{ - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return !player.hasSkill('qianxing'); }, - content:function(){ - player.addTempSkill('qianxing'); - } }, - hslingjian_yinmilichang_equip3:{ - mod:{ - globalTo:function(from,to,distance){ - if(to.hp==1) return distance+1; - } - } - }, - hslingjian_yinmilichang_equip4:{ - mod:{ - globalFrom:function(from,to,distance){ - if(from.hp==1) return distance-1; - } - } - }, - hslingjian_yinmilichang_equip5:{ - mod:{ - targetEnabled:function(card,player,target,now){ - if(target.countCards('h')==0){ - if(card.name=='sha'||card.name=='juedou') return false; - } - } + hslingjian_yinmilichang_equip2: { + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return !player.hasSkill("qianxing"); }, - ai:{ - noh:true, - skillTagFilter:function(player,tag){ - if(tag=='noh'){ - if(player.countCards('h')!=1) return false; - } - } - } - }, - hslingjian_xingtigaizao_equip1:{ - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event){ - return event.card&&event.card.name=='sha'; + content: function () { + player.addTempSkill("qianxing"); }, - content:function(){ - player.draw(); - } }, - hslingjian_xingtigaizao_equip2:{ - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event){ - return event.card&&event.card.name=='sha'; - }, - content:function(){ - player.draw(); - } - }, - hslingjian_xingtigaizao_equip3:{ - mod:{ - globalTo:function(from,to,distance){ - return distance+1; + hslingjian_yinmilichang_equip3: { + mod: { + globalTo: function (from, to, distance) { + if (to.hp == 1) return distance + 1; }, - globalFrom:function(from,to,distance){ - return distance+1; - } - } - }, - hslingjian_xingtigaizao_equip4:{ - mod:{ - globalTo:function(from,to,distance){ - return distance-1; - }, - globalFrom:function(from,to,distance){ - return distance-1; - } - } - }, - hslingjian_xingtigaizao_equip5:{ - mod:{ - maxHandcard:function(player,num){ - return num-1; - } }, - trigger:{player:'phaseDrawBegin'}, - forced:true, - content:function(){ + }, + hslingjian_yinmilichang_equip4: { + mod: { + globalFrom: function (from, to, distance) { + if (from.hp == 1) return distance - 1; + }, + }, + }, + hslingjian_yinmilichang_equip5: { + mod: { + targetEnabled: function (card, player, target, now) { + if (target.countCards("h") == 0) { + if (card.name == "sha" || card.name == "juedou") return false; + } + }, + }, + ai: { + noh: true, + skillTagFilter: function (player, tag) { + if (tag == "noh") { + if (player.countCards("h") != 1) return false; + } + }, + }, + }, + hslingjian_xingtigaizao_equip1: { + trigger: { source: "damageEnd" }, + forced: true, + filter: function (event) { + return event.card && event.card.name == "sha"; + }, + content: function () { + player.draw(); + }, + }, + hslingjian_xingtigaizao_equip2: { + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event) { + return event.card && event.card.name == "sha"; + }, + content: function () { + player.draw(); + }, + }, + hslingjian_xingtigaizao_equip3: { + mod: { + globalTo: function (from, to, distance) { + return distance + 1; + }, + globalFrom: function (from, to, distance) { + return distance + 1; + }, + }, + }, + hslingjian_xingtigaizao_equip4: { + mod: { + globalTo: function (from, to, distance) { + return distance - 1; + }, + globalFrom: function (from, to, distance) { + return distance - 1; + }, + }, + }, + hslingjian_xingtigaizao_equip5: { + mod: { + maxHandcard: function (player, num) { + return num - 1; + }, + }, + trigger: { player: "phaseDrawBegin" }, + forced: true, + content: function () { trigger.num++; - } - }, - hslingjian_shengxiuhaojiao_equip1:{ - trigger:{player:'shaBegin'}, - forced:true, - filter:function(event,player){ - return event.target.hasSkill('hslingjian_chaofeng'); }, - content:function(){ - trigger.directHit=true; - } }, - hslingjian_shengxiuhaojiao_equip2:{ - mod:{ - targetEnabled:function(card,player,target){ - if(player.hasSkill('hslingjian_chaofeng')) return false; - } - } - }, - hslingjian_shengxiuhaojiao_equip3:{ - mod:{ - globalTo:function(from,to,distance){ - if(to.hp0; + hslingjian_shijianhuisu_equip3: { + mod: { + globalTo: function (from, to, distance) { + if (to.countCards("e") == 1) return distance + 1; + }, }, - position:'he', - content:function(){ - var es=target.getCards('e'); + }, + hslingjian_shijianhuisu_equip4: { + mod: { + globalFrom: function (from, to, distance) { + if (from.countCards("e") == 1) return distance - 1; + }, + }, + }, + hslingjian_shijianhuisu_equip5: { + enable: "phaseUse", + usable: 1, + filterCard: true, + selectCard: 1, + filterTarget: function (card, player, target) { + return player != target && target.countCards("he") > 0; + }, + position: "he", + content: function () { + var es = target.getCards("e"); target.gain(es); target.$gain2(es); }, - check:function(card){ - return 4-get.value(card); + check: function (card) { + return 4 - get.value(card); }, - ai:{ - order:5, - result:{ - target:function(player,target){ - if(target.hasSkillTag('noe')) return target.countCards('e')*2; - return -target.countCards('e'); - } + ai: { + order: 5, + result: { + target: function (player, target) { + if (target.hasSkillTag("noe")) return target.countCards("e") * 2; + return -target.countCards("e"); + }, }, - } - }, - jiguanyaoshu_skill_old:{ - enable:'phaseUse', - filter:function(event,player){ - return player.countCards('h',{type:['trick','delay']})>0; }, - filterCard:{type:['trick','delay']}, - check:function(card){ - return 5-get.value(card); - }, - viewAs:{name:'jiguanshu'} }, - jiguanyaoshu_skill:{ - trigger:{player:'loseEnd'}, - forced:true, - filter:function(event,player){ - if(_status.currentPhase==player) return false; - for(var i=0;i 0; + }, + filterCard: { type: ["trick", "delay"] }, + check: function (card) { + return 5 - get.value(card); + }, + viewAs: { name: "jiguanshu" }, + }, + jiguanyaoshu_skill: { + trigger: { player: "loseEnd" }, + forced: true, + filter: function (event, player) { + if (_status.currentPhase == player) return false; + for (var i = 0; i < event.cards.length; i++) { + if (event.cards[i].original == "e") return true; } return false; }, - content:function(){ - var num=0; - for(var i=0;i10) return 10+(value-10)/10; - if(value<9) return 8+value/10; + var dvalue = type == "jiqi" ? 3 : 1; + var getValue = function (value, dvalue) { + if (dvalue == 1) return Math.min(10, value + dvalue); + value += dvalue; + if (value > 10) return 10 + (value - 10) / 10; + if (value < 9) return 8 + value / 10; return value; }; - if(typeof lib.card[name].ai.equipValue=='number'){ - lib.card[name].ai.equipValue=getValue(lib.card[name].ai.equipValue,dvalue); - } - else if(typeof lib.card[name].ai.equipValue=='function'){ - lib.card[name].ai.equipValue=function(){ - return getValue(lib.card[equipname].ai.equipValue.apply(this,arguments),dvalue); + if (typeof lib.card[name].ai.equipValue == "number") { + lib.card[name].ai.equipValue = getValue(lib.card[name].ai.equipValue, dvalue); + } else if (typeof lib.card[name].ai.equipValue == "function") { + lib.card[name].ai.equipValue = function () { + return getValue(lib.card[equipname].ai.equipValue.apply(this, arguments), dvalue); + }; + } else if ( + lib.card[name].ai.basic && + typeof lib.card[name].ai.basic.equipValue == "number" + ) { + lib.card[name].ai.basic.equipValue = getValue( + lib.card[name].ai.basic.equipValue, + dvalue + ); + } else if ( + lib.card[name].ai.basic && + typeof lib.card[name].ai.basic.equipValue == "function" + ) { + lib.card[name].ai.basic.equipValue = function () { + return getValue( + lib.card[equipname].ai.basic.equipValue.apply(this, arguments), + dvalue + ); + }; + } else { + if (dvalue == 3) { + lib.card[name].ai.equipValue = 7; + } else { + lib.card[name].ai.equipValue = dvalue; } } - else if(lib.card[name].ai.basic&&typeof lib.card[name].ai.basic.equipValue=='number'){ - lib.card[name].ai.basic.equipValue=getValue(lib.card[name].ai.basic.equipValue,dvalue); - } - else if(lib.card[name].ai.basic&&typeof lib.card[name].ai.basic.equipValue=='function'){ - lib.card[name].ai.basic.equipValue=function(){ - return getValue(lib.card[equipname].ai.basic.equipValue.apply(this,arguments),dvalue); - } - } - else{ - if(dvalue==3){ - lib.card[name].ai.equipValue=7; - } - else{ - lib.card[name].ai.equipValue=dvalue; - } - } - if(Array.isArray(lib.card[name].skills)){ - lib.card[name].skills=lib.card[name].skills.slice(0); - } - else{ - lib.card[name].skills=[]; + if (Array.isArray(lib.card[name].skills)) { + lib.card[name].skills = lib.card[name].skills.slice(0); + } else { + lib.card[name].skills = []; } // lib.card[name].filterTarget=function(card,player,target){ // return !target.isMin(); // }; // lib.card[name].selectTarget=1; // lib.card[name].range={global:1}; - var str=lib.translate[cards[0].name+'_duanzao']; - var str2=get.translation(equip.name,'skill'); - lib.translate[name]=str+str2; - str2=lib.translate[equip.name+'_info']||''; - if(str2[str2.length-1]=='.'||str2[str2.length-1]=='。'){ - str2=str2.slice(0,str2.length-1); + var str = lib.translate[cards[0].name + "_duanzao"]; + var str2 = get.translation(equip.name, "skill"); + lib.translate[name] = str + str2; + str2 = lib.translate[equip.name + "_info"] || ""; + if (str2[str2.length - 1] == "." || str2[str2.length - 1] == "。") { + str2 = str2.slice(0, str2.length - 1); } - for(var i=0;i'; + str += + '
          ' + + lib.translate[lingjians[i]] + + "
          "; + for (var j = 0; j < types.length; j++) { + str += + '
          ' + + (type != "jiqi" ? lib.translate[types[j]] + ":" : "") + + lib.translate[lingjians[i] + "_" + types[j] + "_info"] + + "
          "; + if (type == "jiqi") break; } - str+='
          '; - str+='
          '+lib.translate[lingjians[i]]+'
          '; - for(var j=0;j'; - if(type=='jiqi') break; - } - str+='
          '; + str += ""; } return str; }, - check:function(card){ - if(get.type(card)=='jiqi'){ - if(_status.event.player.needsToDiscard()){ + check: function (card) { + if (get.type(card) == "jiqi") { + if (_status.event.player.needsToDiscard()) { return 0.5; } return 0; } - var num=1+get.value(card); - if(get.position(card)=='e'){ - num+=0.1; + var num = 1 + get.value(card); + if (get.position(card) == "e") { + num += 0.1; } return num; }, - filterCard:function(card){ - var type=get.type(card); - if(type=='equip'){ - if(!lib.inpile.includes(card.name)) return false; - if(lib.card[card.name].nopower) return false; - if(lib.card[card.name].unique) return false; - if(card.nopower) return false; + filterCard: function (card) { + var type = get.type(card); + if (type == "equip") { + if (!lib.inpile.includes(card.name)) return false; + if (lib.card[card.name].nopower) return false; + if (lib.card[card.name].unique) return false; + if (card.nopower) return false; } - if(ui.selected.cards.length){ - var type2=get.type(ui.selected.cards[0]); - if(type2=='equip'){ - return type=='hslingjian'||type=='jiqi'; + if (ui.selected.cards.length) { + var type2 = get.type(ui.selected.cards[0]); + if (type2 == "equip") { + return type == "hslingjian" || type == "jiqi"; + } else { + return type == "equip"; } - else{ - return type=='equip'; - } - } - else{ - return type=='equip'||type=='hslingjian'||type=='jiqi'; + } else { + return type == "equip" || type == "hslingjian" || type == "jiqi"; } }, - selectCard:2, - complexCard:true, - filter:function(event,player){ - if(!player.countCards('h',{type:['hslingjian','jiqi']})) return false; - var es=player.getCards('he',{type:'equip'}); - for(var i=0;i0; - if(event.target.hp==1) return att>0; - if(event.target.hasSkillTag('maixie')){ - return att<=0; + fengxueren: { + trigger: { player: "shaHit" }, + check: function (event, player) { + var att = get.attitude(player, event.target); + if (player.hasSkill("jiu")) return att > 0; + if (event.target.hp == 1) return att > 0; + if (event.target.hasSkillTag("maixie")) { + return att <= 0; } - if(player.hasSkill('tianxianjiu')) return false; - return att<=0; + if (player.hasSkill("tianxianjiu")) return false; + return att <= 0; }, - filter:function(event,player){ + filter: function (event, player) { return !event.target.isTurnedOver(); }, - logTarget:'target', - content:function(){ - trigger.unhurt=true; + logTarget: "target", + content: function () { + trigger.unhurt = true; trigger.target.turnOver(); trigger.target.draw(); - } - }, - chilongya:{ - trigger:{source:'damageBegin'}, - forced:true, - filter:function(event){ - return event.hasNature('fire')&&event.notLink(); }, - content:function(){ + }, + chilongya: { + trigger: { source: "damageBegin" }, + forced: true, + filter: function (event) { + return event.hasNature("fire") && event.notLink(); + }, + content: function () { trigger.num++; - } - }, - chilongya2:{ - trigger:{source:'damageBegin'}, - filter:function(event,player){ - return (event.card&&event.card.name=='sha'); }, - popup:false, - forced:true, - content:function(){ - if(Math.random()<0.5){ + }, + chilongya2: { + trigger: { source: "damageBegin" }, + filter: function (event, player) { + return event.card && event.card.name == "sha"; + }, + popup: false, + forced: true, + content: function () { + if (Math.random() < 0.5) { trigger.num++; - trigger.player.addSkill('chilongfengxue'); + trigger.player.addSkill("chilongfengxue"); } - } + }, }, - chilongfengxue:{ - trigger:{global:'shaAfter'}, - forced:true, - popup:false, - content:function(){ + chilongfengxue: { + trigger: { global: "shaAfter" }, + forced: true, + popup: false, + content: function () { player.draw(); - player.removeSkill('chilongfengxue'); - } + player.removeSkill("chilongfengxue"); + }, }, - shentou:{ - enable:'phaseUse', - usable:1, - filterCard:true, - filter:function(event,player){ - var nh=player.countCards('h'); - if(nh==0) return false; - return game.hasPlayer(function(current){ - return current!=player&¤t.countCards('h')>nh; + shentou: { + enable: "phaseUse", + usable: 1, + filterCard: true, + filter: function (event, player) { + var nh = player.countCards("h"); + if (nh == 0) return false; + return game.hasPlayer(function (current) { + return current != player && current.countCards("h") > nh; }); }, - check:function(card){ - return 8-get.value(card); + check: function (card) { + return 8 - get.value(card); }, - filterTarget:function(card,player,target){ - if(target.countCards('h')==0) return false; - if(target==player) return false; - if(target.countCards('h')<=player.countCards('h')) return false; + filterTarget: function (card, player, target) { + if (target.countCards("h") == 0) return false; + if (target == player) return false; + if (target.countCards("h") <= player.countCards("h")) return false; return true; }, - content:function(){ - "step 0" - player.judge(function(card){ - if(get.suit(card)=='club') return -1; + content: function () { + "step 0"; + player.judge(function (card) { + if (get.suit(card) == "club") return -1; return 1; }); - "step 1" - if(result.bool){ - var card=target.getCards('h').randomGet(); - if(card){ - player.gain(card,target); - target.$giveAuto(card,player); + "step 1"; + if (result.bool) { + var card = target.getCards("h").randomGet(); + if (card) { + player.gain(card, target); + target.$giveAuto(card, player); } } }, - ai:{ - basic:{ - order:5 + ai: { + basic: { + order: 5, }, - result:{ - player:0.3, - target:-1, - } - } + result: { + player: 0.3, + target: -1, + }, + }, }, - old_longfan:{ - enable:'phaseUse', - usable:1, - prompt:'?', - filterTarget:true, - content:function(){ - "step 0" - if(event.isMine()){ - event.longfan=ui.create.control('零','零','零','零',function(){ + old_longfan: { + enable: "phaseUse", + usable: 1, + prompt: "?", + filterTarget: true, + content: function () { + "step 0"; + if (event.isMine()) { + event.longfan = ui.create.control("零", "零", "零", "零", function () { event.longfan.status--; }); - event.longfan.status=4; - for(var i=0;i1) event.count(1); - if(event.longfan.status>2) event.count(2); - if(event.longfan.status>3) event.count(3); - },200); - event.count=function(num){ - event.longfan.childNodes[num].num=(event.longfan.childNodes[num].num+1)%10; - if(event.longfan.childNodes[num].num==2) event.longfan.childNodes[num].innerHTML='二'; - else event.longfan.childNodes[num].innerHTML=get.cnNumber(event.longfan.childNodes[num].num); - } + if (event.longfan.status > 1) event.count(1); + if (event.longfan.status > 2) event.count(2); + if (event.longfan.status > 3) event.count(3); + }, 200); + event.count = function (num) { + event.longfan.childNodes[num].num = (event.longfan.childNodes[num].num + 1) % 10; + if (event.longfan.childNodes[num].num == 2) + event.longfan.childNodes[num].innerHTML = "二"; + else + event.longfan.childNodes[num].innerHTML = get.cnNumber( + event.longfan.childNodes[num].num + ); + }; game.pause(); - } - else{ + } else { event.finish(); - var x=Math.random(); - if(x<0.1) target.draw(); - else if(x<0.2) target.chooseToDiscard(true); - else if(x<0.3) target.loseHp(); - else if(x<0.4) target.recover(); - else if(x<0.6){ - if(get.attitude(player,target)>0) target.draw(); + var x = Math.random(); + if (x < 0.1) target.draw(); + else if (x < 0.2) target.chooseToDiscard(true); + else if (x < 0.3) target.loseHp(); + else if (x < 0.4) target.recover(); + else if (x < 0.6) { + if (get.attitude(player, target) > 0) target.draw(); else target.chooseToDiscard(true); - } - else if(x<0.8){ - if(get.attitude(player,target)>0) target.recover(); + } else if (x < 0.8) { + if (get.attitude(player, target) > 0) target.recover(); else target.loseHp(); } } - "step 1" - var str=''; - for(var i=0;iplayer.hp?2:0; - case 'diamond':return 1; - case 'club':return 1; - case 'spade':return 0; + longfan: { + enable: "phaseUse", + usable: 1, + content: function () { + "step 0"; + player.judge(function (card) { + switch (get.suit(card)) { + case "heart": + return player.maxHp > player.hp ? 2 : 0; + case "diamond": + return 1; + case "club": + return 1; + case "spade": + return 0; } }); - "step 1" - switch(result.suit){ - case 'heart':player.recover();break; - case 'diamond':player.draw();break; - case 'club':{ - var targets=player.getEnemies(); - for(var i=0;i0; + filter: function (event, player) { + return player.countCards("he", { subtype: "equip1" }) > 0; }, - discard:false, - prepare:'give', - filterTarget:function(card,player,target){ - if(player==target) return false; + discard: false, + prepare: "give", + filterTarget: function (card, player, target) { + if (player == target) return false; return true; }, - content:function(){ + content: function () { target.damage(); - target.gain(cards,player); + target.gain(cards, player); // game.delay(); }, - check:function(card){ - return 10-get.value(card); + check: function (card) { + return 10 - get.value(card); }, - position:'he', - ai:{ - basic:{ - order:8 + position: "he", + ai: { + basic: { + order: 8, + }, + result: { + target: -1, }, - result:{ - target:-1 - } - } - }, - xixue:{ - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.hp1/3) return false; + xixue: { + trigger: { source: "damageEnd" }, + forced: true, + filter: function (event, player) { + return event.card && event.card.name == "sha" && player.hp < player.maxHp; + }, + content: function () { + player.recover(trigger.num); + }, + }, + guangshatianyi: { + trigger: { player: "damageBegin" }, + forced: true, + filter: function (event, player) { + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + if (Math.random() > 1 / 3) return false; return true; }, - content:function(){ + content: function () { trigger.num--; - } + }, }, - nigong:{ - trigger:{player:'damageAfter'}, - group:['nigong2','nigong3'], - forced:true, - content:function(){ - player.storage.nigong+=trigger.num; - if(player.storage.nigong>4){ - player.storage.nigong=4; + nigong: { + trigger: { player: "damageAfter" }, + group: ["nigong2", "nigong3"], + forced: true, + content: function () { + player.storage.nigong += trigger.num; + if (player.storage.nigong > 4) { + player.storage.nigong = 4; } player.updateMarks(); }, - ai:{ - effect:function(card,player,target){ - if(get.tag(card,'damage')&&!target.hujia) return [1,0.5]; - } + ai: { + effect: function (card, player, target) { + if (get.tag(card, "damage") && !target.hujia) return [1, 0.5]; + }, + }, + intro: { + content: "已积攒#点伤害", }, - intro:{ - content:'已积攒#点伤害' - } }, - nigong2:{ - enable:'phaseUse', - filter:function(event,player){ - return player.storage.nigong>1; + nigong2: { + enable: "phaseUse", + filter: function (event, player) { + return player.storage.nigong > 1; }, - filterTarget:function(card,player,target){ - return player!=target; + filterTarget: function (card, player, target) { + return player != target; }, - prompt:function(event){ - var str='弃置所有逆攻标记,'; - if(event.player.storage.nigong%2!=0){ - str+='摸一张牌,'; + prompt: function (event) { + var str = "弃置所有逆攻标记,"; + if (event.player.storage.nigong % 2 != 0) { + str += "摸一张牌,"; } - str+='并对一名其他角色造成'+get.cnNumber(Math.floor(event.player.storage.nigong/2))+'点伤害'; + str += + "并对一名其他角色造成" + + get.cnNumber(Math.floor(event.player.storage.nigong / 2)) + + "点伤害"; return str; }, - content:function(){ - if(player.storage.nigong%2!=0){ + content: function () { + if (player.storage.nigong % 2 != 0) { player.draw(); } - target.damage(Math.floor(player.storage.nigong/2)); - player.storage.nigong=0; + target.damage(Math.floor(player.storage.nigong / 2)); + player.storage.nigong = 0; player.updateMarks(); }, - ai:{ - order:10, - result:{ - target:function(player,target){ - var num=get.damageEffect(target,player,target); - if(player.storage.nigong>=4&&num>0){ - num=0; + ai: { + order: 10, + result: { + target: function (player, target) { + var num = get.damageEffect(target, player, target); + if (player.storage.nigong >= 4 && num > 0) { + num = 0; } return num; - } - } - } - }, - nigong3:{ - enable:'phaseUse', - filter:function(event,player){ - return player.storage.nigong==1; + }, + }, }, - content:function(){ + }, + nigong3: { + enable: "phaseUse", + filter: function (event, player) { + return player.storage.nigong == 1; + }, + content: function () { player.draw(); - player.storage.nigong=0; + player.storage.nigong = 0; player.updateMarks(); }, - ai:{ - order:10, - result:{ - player:1 - } - } - }, - sadengjinhuan:{ - trigger:{player:'shaMiss'}, - check:function(event,player){ - return get.attitude(player,event.target)<0; + ai: { + order: 10, + result: { + player: 1, + }, }, - content:function(){ - "step 0" - player.judge(function(card){ - return get.color(card)=='red'?1:0; - }) - "step 1" - if(result.bool){ - trigger.target.chooseToRespond({name:'shan'},'萨登荆环:请额外打出一张闪响应杀').autochoose=lib.filter.autoRespondShan; - } - else{ + }, + sadengjinhuan: { + trigger: { player: "shaMiss" }, + check: function (event, player) { + return get.attitude(player, event.target) < 0; + }, + content: function () { + "step 0"; + player.judge(function (card) { + return get.color(card) == "red" ? 1 : 0; + }); + "step 1"; + if (result.bool) { + trigger.target.chooseToRespond( + { name: "shan" }, + "萨登荆环:请额外打出一张闪响应杀" + ).autochoose = lib.filter.autoRespondShan; + } else { event.finish(); } - "step 2" - if(!result.bool){ + "step 2"; + if (!result.bool) { trigger.untrigger(); - trigger.trigger('shaHit'); - trigger._result.bool=false; + trigger.trigger("shaHit"); + trigger._result.bool = false; } - } - }, - ximohu:{ - trigger:{player:'damageBefore'}, - forced:true, - filter:function(event){ - return event.hasNature('thunder'); }, - content:function(){ + }, + ximohu: { + trigger: { player: "damageBefore" }, + forced: true, + filter: function (event) { + return event.hasNature("thunder"); + }, + content: function () { trigger.cancel(); player.recover(trigger.num); }, - ai:{ - effect:function(card){ - if(get.tag(card,'thunderDamage')) return [0,2]; - } - } + ai: { + effect: function (card) { + if (get.tag(card, "thunderDamage")) return [0, 2]; + }, + }, }, - guiyanfadao:{ - trigger:{player:'shaHit'}, - check:function(event,player){ - var att=get.attitude(player,event.target); - if(player.hasSkill('jiu')) return att>0; - if(event.target.hasSkillTag('maixie_hp')||event.target.hasSkillTag('maixie_defend')){ - return att<=0; + guiyanfadao: { + trigger: { player: "shaHit" }, + check: function (event, player) { + var att = get.attitude(player, event.target); + if (player.hasSkill("jiu")) return att > 0; + if (event.target.hasSkillTag("maixie_hp") || event.target.hasSkillTag("maixie_defend")) { + return att <= 0; } - if(player.hasSkill('tianxianjiu')) return false; - if(event.target.hujia>0) return att<0; - if(event.target.hp==1) return att>0; + if (player.hasSkill("tianxianjiu")) return false; + if (event.target.hujia > 0) return att < 0; + if (event.target.hp == 1) return att > 0; return false; }, - content:function(){ - trigger.unhurt=true; + content: function () { + trigger.unhurt = true; trigger.target.loseHp(); - } - }, - guiyanfadao2:{ - trigger:{player:'useCardAfter'}, - forced:true, - popup:false, - content:function(){ - delete player.storage.zhuque_skill.nature; - } - }, - tianxianjiu:{ - trigger:{source:'damageEnd'}, - filter:function(event){ - return (event.card&&(event.card.name=='sha')); }, - forced:true, - temp:true, - vanish:true, - onremove:function(player){ - if(player.node.jiu){ + }, + guiyanfadao2: { + trigger: { player: "useCardAfter" }, + forced: true, + popup: false, + content: function () { + delete player.storage.zhuque_skill.nature; + }, + }, + tianxianjiu: { + trigger: { source: "damageEnd" }, + filter: function (event) { + return event.card && event.card.name == "sha"; + }, + forced: true, + temp: true, + vanish: true, + onremove: function (player) { + if (player.node.jiu) { player.node.jiu.delete(); player.node.jiu2.delete(); delete player.node.jiu; delete player.node.jiu2; } }, - content:function(){ + content: function () { player.draw(2); - player.removeSkill('tianxianjiu'); + player.removeSkill("tianxianjiu"); + }, + ai: { + damageBonus: true, }, - ai:{ - damageBonus:true - } }, }, - cardType:{ - hslingjian:0.5, - jiqi:0.4, - jiguan:0.45 + cardType: { + hslingjian: 0.5, + jiqi: 0.4, + jiguan: 0.45, }, - help:{ - '轩辕剑':'
          • 零件、祭器牌可用于煅造装备,煅造得到强化装备,并装备给距离1以内的角色
          • '+ - '煅造装备时失去牌以及装备牌的过程不触发任何技能(如枭姬、祈禳)
          • '+ - '进行洗牌时强化装备将从弃牌堆中消失,不进入牌堆
          • '+ - '专属、特殊装备无法被强化' + help: { + 轩辕剑: + "
            • 零件、祭器牌可用于煅造装备,煅造得到强化装备,并装备给距离1以内的角色
            • " + + "煅造装备时失去牌以及装备牌的过程不触发任何技能(如枭姬、祈禳)
            • " + + "进行洗牌时强化装备将从弃牌堆中消失,不进入牌堆
            • " + + "专属、特殊装备无法被强化", }, - translate:{ - qiankundai:'乾坤袋', - qiankundai_info:'你的手牌上限+1。当你失去该装备时,你摸一张牌。', - hufu:'玉符', - hufu_bg:'符', - g_hufu_sha:'符杀', - g_hufu_shan:'符闪', - g_hufu_jiu:'符酒', - hufu_info:'你可以将一张玉符当作杀、闪或酒使用或打出。', + translate: { + qiankundai: "乾坤袋", + qiankundai_info: "你的手牌上限+1。当你失去该装备时,你摸一张牌。", + hufu: "玉符", + hufu_bg: "符", + g_hufu_sha: "符杀", + g_hufu_shan: "符闪", + g_hufu_jiu: "符酒", + hufu_info: "你可以将一张玉符当作杀、闪或酒使用或打出。", // yihuajiemu:'移花接木', // yihuajiemu_info:'对一名装备区内有宝物的角色使用,将其宝物牌转移至另一名角色。', - liuxinghuoyu:'流星火羽', - liuxinghuoyu_info:'出牌阶段,对一名角色使用,令目标弃置两张牌,或受到1点火焰伤害。', - g_yuchan_equip:'玉蝉', - yuchanqian_duanzao:'玉蝉', - yuchanqian_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanqian_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanqian_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanqian_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanqian_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankun_duanzao:'玉蝉', - yuchankun_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankun_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankun_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankun_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankun_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanzhen_duanzao:'玉蝉', - yuchanzhen_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanzhen_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanzhen_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanzhen_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanzhen_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanxun_duanzao:'玉蝉', - yuchanxun_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanxun_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanxun_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanxun_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanxun_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankan_duanzao:'玉蝉', - yuchankan_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankan_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankan_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankan_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchankan_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanli_duanzao:'玉蝉', - yuchanli_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanli_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanli_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanli_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanli_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchangen_duanzao:'玉蝉', - yuchangen_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchangen_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchangen_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchangen_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchangen_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchandui_duanzao:'玉蝉', - yuchandui_equip1_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchandui_equip2_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchandui_equip3_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchandui_equip4_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchandui_equip5_info:'出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。', - yuchanqian:'乾玉蝉', - yuchanqian_info:'在你行动时可当作杀使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchankun:'坤玉蝉', - yuchankun_info:'在你行动时可当作草药使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchanzhen:'震玉蝉', - yuchanzhen_info:'在你行动时可当作酒使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchanxun:'巽玉蝉', - yuchanxun_info:'在你行动时可当作桃使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchankan:'坎玉蝉', - yuchankan_info:'在你行动时可当作神秘果使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchanli:'离玉蝉', - yuchanli_info:'在你行动时可当作天仙酒使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchangen:'艮玉蝉', - yuchangen_info:'在你行动时可当作封印之蛋使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yuchandui:'兑玉蝉', - yuchandui_info:'在你行动时可当作雪肌冰鲍使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。', - yangpijuan:'羊皮卷', - yangpijuan_info:'出牌阶段对自己使用,选择一种卡牌类别,发现一张该类别的卡牌。', + liuxinghuoyu: "流星火羽", + liuxinghuoyu_info: "出牌阶段,对一名角色使用,令目标弃置两张牌,或受到1点火焰伤害。", + g_yuchan_equip: "玉蝉", + yuchanqian_duanzao: "玉蝉", + yuchanqian_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanqian_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanqian_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanqian_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanqian_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankun_duanzao: "玉蝉", + yuchankun_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankun_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankun_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankun_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankun_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanzhen_duanzao: "玉蝉", + yuchanzhen_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanzhen_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanzhen_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanzhen_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanzhen_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanxun_duanzao: "玉蝉", + yuchanxun_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanxun_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanxun_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanxun_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanxun_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankan_duanzao: "玉蝉", + yuchankan_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankan_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankan_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankan_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchankan_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanli_duanzao: "玉蝉", + yuchanli_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanli_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanli_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanli_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanli_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchangen_duanzao: "玉蝉", + yuchangen_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchangen_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchangen_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchangen_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchangen_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchandui_duanzao: "玉蝉", + yuchandui_equip1_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchandui_equip2_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchandui_equip3_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchandui_equip4_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchandui_equip5_info: "出牌阶段限一次,你可以弃置任意张基本牌并摸等量的牌。", + yuchanqian: "乾玉蝉", + yuchanqian_info: "在你行动时可当作杀使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchankun: "坤玉蝉", + yuchankun_info: + "在你行动时可当作草药使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchanzhen: "震玉蝉", + yuchanzhen_info: "在你行动时可当作酒使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchanxun: "巽玉蝉", + yuchanxun_info: "在你行动时可当作桃使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchankan: "坎玉蝉", + yuchankan_info: + "在你行动时可当作神秘果使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchanli: "离玉蝉", + yuchanli_info: + "在你行动时可当作天仙酒使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchangen: "艮玉蝉", + yuchangen_info: + "在你行动时可当作封印之蛋使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yuchandui: "兑玉蝉", + yuchandui_info: + "在你行动时可当作雪肌冰鲍使用;可用于煅造装备;在你使用一张牌后,此牌会随机切换形态。", + yangpijuan: "羊皮卷", + yangpijuan_info: "出牌阶段对自己使用,选择一种卡牌类别,发现一张该类别的卡牌。", // pantao:'蟠桃', // pantao_info:'出牌阶段对自己使用,或对濒死角色使用,目标回复2点体力并获得1点护甲。', - shencaojie:'神草结', - shencaojie_info:'你的锦囊牌即将造成伤害时对目标使用,令此伤害+1;你即将受到锦囊牌伤害时对自己使用,令此伤害-1。', - yuruyi:'玉如意', - yuruyi_ab:'如意', - yuruyi_info:'你有更高的机率摸到好牌。', - fengyinzhidan:'封印之蛋', - fengyinzhidan_info:'随机使用两张普通锦囊牌(随机指定目标)。', - shuchui:'鼠槌', - shuchui_info:'出牌阶段限一次,你可以指定一名攻击范围内的角色,依次将手牌中的至多3张杀对该角色使用,若杀造成了伤害,你摸一张牌。', - zhiluxiaohu:'指路小狐', - zhiluxiaohu_info:'出牌阶段对自己使用,视为对一名随机敌方角色使用一张杀,若此杀造成伤害,你摸一张牌。', - xuejibingbao:'雪肌冰鲍', - xuejibingbao_info:'出牌阶段对一名角色使用,该角色摸牌阶段摸牌数+1,持续2个回合。', - gouhunluo:'勾魂锣', - gouhunluo_info:'出牌阶段对一名角色使用,在3轮后你的准备阶段令该角色失去1点体力并弃置所有手牌。', - jiguan:'机关', - jiqi:'祭器', - qinglongzhigui:'青龙之圭', - g_qinglongzhigui:'青龙之圭', - qinglongzhigui_info:'可用于煅造装备;此牌在你手牌中时,准备阶段,你摸两张牌然后弃置一张牌。', - qinglongzhigui_duanzao:'云屏', - qinglongzhigui_equip1_info:'结束阶段,你摸一张牌。', - qinglongzhigui_equip2_info:'结束阶段,你摸一张牌。', - qinglongzhigui_equip3_info:'结束阶段,你摸一张牌。', - qinglongzhigui_equip4_info:'结束阶段,你摸一张牌。', - qinglongzhigui_equip5_info:'结束阶段,你摸一张牌。', - baishouzhihu:'白兽之琥', - g_baishouzhihu:'白兽之琥', - baishouzhihu_info:'可用于煅造装备;此牌在你手牌中时,每当你弃置卡牌,你可以弃置一名其他角色的一张随机牌。', - baishouzhihu_duanzao:'风牙', - baishouzhihu_equip1_info:'结束阶段,你可以弃置一名其他角色的一张随机牌。', - baishouzhihu_equip2_info:'结束阶段,你可以弃置一名其他角色的一张随机牌。', - baishouzhihu_equip3_info:'结束阶段,你可以弃置一名其他角色的一张随机牌。', - baishouzhihu_equip4_info:'结束阶段,你可以弃置一名其他角色的一张随机牌。', - baishouzhihu_equip5_info:'结束阶段,你可以弃置一名其他角色的一张随机牌。', - zhuquezhizhang:'朱雀之璋', - g_zhuquezhizhang:'朱雀之璋', - zhuquezhizhang_info:'可用于煅造装备;此牌在你手牌中时,每当你受到其他角色造成的伤害,你对伤害来源造成1点火属性伤害。', - zhuquezhizhang_duanzao:'炽翎', - zhuquezhizhang_equip1_info:'结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。', - zhuquezhizhang_equip2_info:'结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。', - zhuquezhizhang_equip3_info:'结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。', - zhuquezhizhang_equip4_info:'结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。', - zhuquezhizhang_equip5_info:'结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。', - xuanwuzhihuang:'玄武之璜', - g_xuanwuzhihuang:'玄武之璜', - xuanwuzhihuang_duanzao:'寒晶', - xuanwuzhihuang_info:'可用于煅造装备;此牌在你手牌中时,每当你造成伤害,你回复等量的体力。', - xuanwuzhihuang_equip1_info:'结束阶段,你可以弃置一张红色牌并回复1点体力。', - xuanwuzhihuang_equip2_info:'结束阶段,你可以弃置一张红色牌并回复1点体力。', - xuanwuzhihuang_equip3_info:'结束阶段,你可以弃置一张红色牌并回复1点体力。', - xuanwuzhihuang_equip4_info:'结束阶段,你可以弃置一张红色牌并回复1点体力。', - xuanwuzhihuang_equip5_info:'结束阶段,你可以弃置一张红色牌并回复1点体力。', - huanglinzhicong:'黄麟之琮', - g_huanglinzhicong:'黄麟之琮', - huanglinzhicong_duanzao:'玄甲', - huanglinzhicong_info:'可用于煅造装备;此牌在你手牌中时,准备阶段,若你没有护甲,你获得1点护甲。', - huanglinzhicong_equip1_info:'结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。', - huanglinzhicong_equip2_info:'结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。', - huanglinzhicong_equip3_info:'结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。', - huanglinzhicong_equip4_info:'结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。', - huanglinzhicong_equip5_info:'结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。', - cangchizhibi:'苍螭之璧', - g_cangchizhibi:'苍螭之璧', - cangchizhibi_duanzao:'灵枢', - cangchizhibi_info:'可用于煅造装备;此牌在你手牌中时,准备阶段,你可以选择至多3名角色横置或重置之。', - cangchizhibi_equip1_info:'结束阶段,你可以横置或重置一名角色。', - cangchizhibi_equip2_info:'结束阶段,你可以横置或重置一名角色。', - cangchizhibi_equip3_info:'结束阶段,你可以横置或重置一名角色。', - cangchizhibi_equip4_info:'结束阶段,你可以横置或重置一名角色。', - cangchizhibi_equip5_info:'结束阶段,你可以横置或重置一名角色。', + shencaojie: "神草结", + shencaojie_info: + "你的锦囊牌即将造成伤害时对目标使用,令此伤害+1;你即将受到锦囊牌伤害时对自己使用,令此伤害-1。", + yuruyi: "玉如意", + yuruyi_ab: "如意", + yuruyi_info: "你有更高的机率摸到好牌。", + fengyinzhidan: "封印之蛋", + fengyinzhidan_info: "随机使用两张普通锦囊牌(随机指定目标)。", + shuchui: "鼠槌", + shuchui_info: + "出牌阶段限一次,你可以指定一名攻击范围内的角色,依次将手牌中的至多3张杀对该角色使用,若杀造成了伤害,你摸一张牌。", + zhiluxiaohu: "指路小狐", + zhiluxiaohu_info: + "出牌阶段对自己使用,视为对一名随机敌方角色使用一张杀,若此杀造成伤害,你摸一张牌。", + xuejibingbao: "雪肌冰鲍", + xuejibingbao_info: "出牌阶段对一名角色使用,该角色摸牌阶段摸牌数+1,持续2个回合。", + gouhunluo: "勾魂锣", + gouhunluo_info: "出牌阶段对一名角色使用,在3轮后你的准备阶段令该角色失去1点体力并弃置所有手牌。", + jiguan: "机关", + jiqi: "祭器", + qinglongzhigui: "青龙之圭", + g_qinglongzhigui: "青龙之圭", + qinglongzhigui_info: "可用于煅造装备;此牌在你手牌中时,准备阶段,你摸两张牌然后弃置一张牌。", + qinglongzhigui_duanzao: "云屏", + qinglongzhigui_equip1_info: "结束阶段,你摸一张牌。", + qinglongzhigui_equip2_info: "结束阶段,你摸一张牌。", + qinglongzhigui_equip3_info: "结束阶段,你摸一张牌。", + qinglongzhigui_equip4_info: "结束阶段,你摸一张牌。", + qinglongzhigui_equip5_info: "结束阶段,你摸一张牌。", + baishouzhihu: "白兽之琥", + g_baishouzhihu: "白兽之琥", + baishouzhihu_info: + "可用于煅造装备;此牌在你手牌中时,每当你弃置卡牌,你可以弃置一名其他角色的一张随机牌。", + baishouzhihu_duanzao: "风牙", + baishouzhihu_equip1_info: "结束阶段,你可以弃置一名其他角色的一张随机牌。", + baishouzhihu_equip2_info: "结束阶段,你可以弃置一名其他角色的一张随机牌。", + baishouzhihu_equip3_info: "结束阶段,你可以弃置一名其他角色的一张随机牌。", + baishouzhihu_equip4_info: "结束阶段,你可以弃置一名其他角色的一张随机牌。", + baishouzhihu_equip5_info: "结束阶段,你可以弃置一名其他角色的一张随机牌。", + zhuquezhizhang: "朱雀之璋", + g_zhuquezhizhang: "朱雀之璋", + zhuquezhizhang_info: + "可用于煅造装备;此牌在你手牌中时,每当你受到其他角色造成的伤害,你对伤害来源造成1点火属性伤害。", + zhuquezhizhang_duanzao: "炽翎", + zhuquezhizhang_equip1_info: + "结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。", + zhuquezhizhang_equip2_info: + "结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。", + zhuquezhizhang_equip3_info: + "结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。", + zhuquezhizhang_equip4_info: + "结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。", + zhuquezhizhang_equip5_info: + "结束阶段,你可以弃置一张红色牌并对一名体力值不小于你的角色造成1点火属性伤害。", + xuanwuzhihuang: "玄武之璜", + g_xuanwuzhihuang: "玄武之璜", + xuanwuzhihuang_duanzao: "寒晶", + xuanwuzhihuang_info: "可用于煅造装备;此牌在你手牌中时,每当你造成伤害,你回复等量的体力。", + xuanwuzhihuang_equip1_info: "结束阶段,你可以弃置一张红色牌并回复1点体力。", + xuanwuzhihuang_equip2_info: "结束阶段,你可以弃置一张红色牌并回复1点体力。", + xuanwuzhihuang_equip3_info: "结束阶段,你可以弃置一张红色牌并回复1点体力。", + xuanwuzhihuang_equip4_info: "结束阶段,你可以弃置一张红色牌并回复1点体力。", + xuanwuzhihuang_equip5_info: "结束阶段,你可以弃置一张红色牌并回复1点体力。", + huanglinzhicong: "黄麟之琮", + g_huanglinzhicong: "黄麟之琮", + huanglinzhicong_duanzao: "玄甲", + huanglinzhicong_info: "可用于煅造装备;此牌在你手牌中时,准备阶段,若你没有护甲,你获得1点护甲。", + huanglinzhicong_equip1_info: "结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。", + huanglinzhicong_equip2_info: "结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。", + huanglinzhicong_equip3_info: "结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。", + huanglinzhicong_equip4_info: "结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。", + huanglinzhicong_equip5_info: "结束阶段,若你没有护甲,你可以弃置一张黑色牌并获得1点护甲。", + cangchizhibi: "苍螭之璧", + g_cangchizhibi: "苍螭之璧", + cangchizhibi_duanzao: "灵枢", + cangchizhibi_info: + "可用于煅造装备;此牌在你手牌中时,准备阶段,你可以选择至多3名角色横置或重置之。", + cangchizhibi_equip1_info: "结束阶段,你可以横置或重置一名角色。", + cangchizhibi_equip2_info: "结束阶段,你可以横置或重置一名角色。", + cangchizhibi_equip3_info: "结束阶段,你可以横置或重置一名角色。", + cangchizhibi_equip4_info: "结束阶段,你可以横置或重置一名角色。", + cangchizhibi_equip5_info: "结束阶段,你可以横置或重置一名角色。", - guisheqi:'龟蛇旗', - guisheqi_info:'出牌阶段对一名角色使用,目标获得1点护甲。', - jiguanfeng:'机关蜂', - jiguanfeng_info:'出牌阶段对一名其他角色使用,目标需打出一张闪,否则非锁定技失效直到下一回合开始,并受到1点伤害。', - jiguanyuan:'机关鸢', - jiguanyuan_info:'出牌阶段对一名其他角色使用,你将此牌和一张其它牌置于一名其他角色的武将牌上,然后摸一张牌;该角色于下一结束阶段获得武将牌上的牌。', - jiguantong:'机关火筒', - jiguantong_ab:'火筒', - jiguantong_info:'出牌阶段对所有其他角色使用,目标弃置一张手牌,或受到1点火焰伤害;若没有人选择受到伤害,使用者摸一张牌。', - jiutiansuanchi:'九天算尺', - jiutiansuanchi_info:'每当你使用杀造成伤害,你可以弃置一张牌并展示受伤害角色的一张手牌,若此牌与你弃置的牌花色或点数相同,此杀的伤害+2。', - shenmiguo:'神秘果', - shenmiguo_info:'出牌阶段内,当你使用一张基本牌或普通锦囊牌后使用,令此牌再结算一次。每阶段限用一次。', - qinglianxindeng:'青莲心灯', - qinglianxindeng_info:'你防止锦囊牌造成的伤害。', - hslingjian_xuanfengzhiren_duanzao:'风刃', - hslingjian_xuanfengzhiren_duanzao2:'风', - hslingjian_xuanfengzhiren_equip1_info:'每当你用杀造成一次伤害,受伤害角色随机弃置一张牌。', - hslingjian_xuanfengzhiren_equip2_info:'每当你受到杀造成的伤害,伤害来源随机弃置一张牌。', - hslingjian_xuanfengzhiren_equip3_info:'当你于回合外失去牌后,你本回合的防御距离+1。', - hslingjian_xuanfengzhiren_equip4_info:'当你于回合内失去牌后,你本回合的进攻距离+1。', - hslingjian_xuanfengzhiren_equip5_info:'出牌阶段限一次,你可以弃置一张牌,然后随机弃置一名其他角色的一张牌。', - hslingjian_zhongxinghujia_duanzao:'重甲', - hslingjian_zhongxinghujia_duanzao2:'护', - hslingjian_zhongxinghujia_equip1_info:'每当你用杀造成一次伤害,你可以随机装备一件防具牌。', - hslingjian_zhongxinghujia_equip2_info:'每当你受到杀造成的伤害,你可以弃置伤害来源的防具牌。', - hslingjian_zhongxinghujia_equip3_info:'当你的装备区内有防具牌时,你的防御距离+1。', - hslingjian_zhongxinghujia_equip4_info:'当你的装备区内有防具牌时,你的进攻距离+1。', - hslingjian_zhongxinghujia_equip5_info:'出牌阶段限一次,你可以弃置两张牌,然后令一名角色随机装备一件防具。', - hslingjian_jinjilengdong_duanzao:'冰冻', - hslingjian_jinjilengdong_duanzao2:'冰', - hslingjian_jinjilengdong_equip1_info:'每当你用杀造成一次伤害,你可以令目标摸两张牌并翻面。', - hslingjian_jinjilengdong_equip2_info:'每当你受到杀造成的伤害,你可以令伤害来源摸两张牌并翻面。', - hslingjian_jinjilengdong_equip3_info:'你的武将牌背面朝上时防御距离+2。', - hslingjian_jinjilengdong_equip4_info:'你的武将牌背面朝上时进攻距离+2。', - hslingjian_jinjilengdong_equip5_info:'回合结束后,若你的武将牌正面朝上,你可以与一名武将牌正面朝上的其他角色同时翻面,然后各摸两张牌。', - hslingjian_yinmilichang_duanzao:'隐力', - hslingjian_yinmilichang_duanzao2:'隐', - hslingjian_yinmilichang_equip1_info:'每当你用杀造成一次伤害,你可以令一名其他角色获得潜行直到其下一回合开始。', - hslingjian_yinmilichang_equip2_info:'每当你受到一次伤害,你本回合内获得潜行。', - hslingjian_yinmilichang_equip3_info:'当你的体力值为1时,你的防御距离+1。', - hslingjian_yinmilichang_equip4_info:'当你的体力值为1时,你的进攻距离+1。', - hslingjian_yinmilichang_equip5_info:'当你没有手牌时,你不能成为杀或决斗的目标。', - hslingjian_xingtigaizao_duanzao:'移形', - hslingjian_xingtigaizao_duanzao2:'形', - hslingjian_xingtigaizao_equip1_info:'每当你用杀造成一次伤害,你摸一张牌。', - hslingjian_xingtigaizao_equip2_info:'每当你受到杀造成的伤害,你摸一张牌。', - hslingjian_xingtigaizao_equip3_info:'你的防御距离+1,进攻距离-1。', - hslingjian_xingtigaizao_equip4_info:'你的防御距离-1,进攻距离+1。', - hslingjian_xingtigaizao_equip5_info:'你于摸牌阶段额外摸一张牌;你的手牌上限-1。', - hslingjian_shengxiuhaojiao_duanzao:'号角', - hslingjian_shengxiuhaojiao_duanzao2:'角', - hslingjian_shengxiuhaojiao_equip1_info:'有嘲讽的角色不能闪避你的杀。', - hslingjian_shengxiuhaojiao_equip2_info:'有嘲讽的角色不能对你使用杀。', - hslingjian_shengxiuhaojiao_equip3_info:'若你的手牌数大于你的体力值,你的防御距离+1。', - hslingjian_shengxiuhaojiao_equip4_info:'若你的手牌数大于你的体力值,你的进攻距离+1。', - hslingjian_shengxiuhaojiao_equip5_info:'出牌阶段限一次,你可以弃置两张牌,然后令一名角色获得或解除嘲讽。', - hslingjian_shijianhuisu_duanzao:'回溯', - hslingjian_shijianhuisu_duanzao2:'溯', - hslingjian_shijianhuisu_equip1_info:'当你装备一张防具牌时,你摸一张牌。', - hslingjian_shijianhuisu_equip2_info:'当你装备一张武器牌时,你摸一张牌。', - hslingjian_shijianhuisu_equip3_info:'当你的装备区内没有其他牌时,你的防御距离+1。', - hslingjian_shijianhuisu_equip4_info:'当你的装备区内没有其他牌时,你的进攻距离+1。', - hslingjian_shijianhuisu_equip5_info:'出牌阶段限一次,你可以弃置一张牌,然后令一名其他角色将其装备区内的牌收回手牌。', - _lingjianduanzao:'煅造', - _lingjianduanzao_info:'出牌阶段,你可以将一张装备牌和一张可煅造的牌合成为一件强化装备,并装备给距离1以内的一名角色。', - jiguanshu:'机关鼠', - jiguanshu_info:'出牌阶段对自己使用,用随机祭器强化装备区内的一张随机装备,然后用随机零件强化其余的装备。', - lingjiandai:'零件袋', - lingjiandai_info:'出牌阶段对自己使用,获得3张随机零件。', - mujiaren:'木甲人', - mujiaren_info:'出牌阶段限用一次,将你手牌中的非基本牌(含此张)替换为随机的机关牌。', - jiguanyaoshu:'机关要术', - jiguanyaoshu_skill:'巧匠', - jiguanyaoshu_skill_info:'每当你于回合外失去装备区内的牌,你获得一个随机零件。', - jiguanyaoshu_info:'出牌阶段对距离1以内的一名角色使用,目标随机装备一件装备牌并获得技能巧匠(每当你于回合外失去装备区内的牌,你获得一个随机零件)。', - hslingjian:'零件', - hslingjian_xuanfengzhiren:'旋风之刃', - hslingjian_xuanfengzhiren_info:'可用于煅造装备;随机弃置一名角色的一张牌。', - hslingjian_zhongxinghujia:'重型护甲', - hslingjian_zhongxinghujia_info:'可用于煅造装备;令一名角色装备一件随机防具,然后随机弃置其一张手牌。', - hslingjian_jinjilengdong:'紧急冷冻', - hslingjian_jinjilengdong_bg:'冻', - hslingjian_jinjilengdong_info:'可用于煅造装备;令一名武将牌正面朝上的其他角色获得2点护甲并翻面,该角色不能使用卡牌,也不能成为卡牌的目标直到武将牌翻回正面。', - hslingjian_yinmilichang:'隐秘力场', - hslingjian_yinmilichang_info:'可用于煅造装备;令一名其他角色获得技能潜行,直到其下一回合开始。', - hslingjian_xingtigaizao:'型体改造', - hslingjian_xingtigaizao_info:'可用于煅造装备;摸一张牌,本回合手牌上限-1。', - hslingjian_shengxiuhaojiao:'生锈号角', - hslingjian_shengxiuhaojiao_info:'可用于煅造装备;令一名角色获得技能嘲讽,直到其下一回合开始。', - hslingjian_shijianhuisu:'时间回溯', - hslingjian_shijianhuisu_info:'可用于煅造装备;令一名其他角色将其装备牌收回手牌。', - hslingjian_chaofeng:'嘲讽', - hslingjian_chaofeng_info:'锁定技,与你相邻的角色只能选择你为出杀目标。', - qinglonglingzhu:'青龙灵珠', - qinglonglingzhu_ab:'灵珠', - qinglonglingzhu_info:'每当你造成一次属性伤害,你可以获得对方的一张牌。', - xingjunyan:'星君眼', - xingjunyan_info:'你的杀造成的伤害+1;杀对你造成的伤害+1。', - guiyanfadao:'鬼眼法刀', - guiyanfadao_bg:'眼', - guiyanfadao_info:'每当你使用杀命中目标,你可以防止伤害,改为令目标失去1点体力。', - tianxianjiu:'天仙酒', - tianxianjiu_bg:'仙', - tianxianjiu_info:'出牌阶段对自己使用,你使用的下一张杀造成伤害后可以摸两张牌;濒死阶段,对自己使用,回复1点体力。', + guisheqi: "龟蛇旗", + guisheqi_info: "出牌阶段对一名角色使用,目标获得1点护甲。", + jiguanfeng: "机关蜂", + jiguanfeng_info: + "出牌阶段对一名其他角色使用,目标需打出一张闪,否则非锁定技失效直到下一回合开始,并受到1点伤害。", + jiguanyuan: "机关鸢", + jiguanyuan_info: + "出牌阶段对一名其他角色使用,你将此牌和一张其它牌置于一名其他角色的武将牌上,然后摸一张牌;该角色于下一结束阶段获得武将牌上的牌。", + jiguantong: "机关火筒", + jiguantong_ab: "火筒", + jiguantong_info: + "出牌阶段对所有其他角色使用,目标弃置一张手牌,或受到1点火焰伤害;若没有人选择受到伤害,使用者摸一张牌。", + jiutiansuanchi: "九天算尺", + jiutiansuanchi_info: + "每当你使用杀造成伤害,你可以弃置一张牌并展示受伤害角色的一张手牌,若此牌与你弃置的牌花色或点数相同,此杀的伤害+2。", + shenmiguo: "神秘果", + shenmiguo_info: + "出牌阶段内,当你使用一张基本牌或普通锦囊牌后使用,令此牌再结算一次。每阶段限用一次。", + qinglianxindeng: "青莲心灯", + qinglianxindeng_info: "你防止锦囊牌造成的伤害。", + hslingjian_xuanfengzhiren_duanzao: "风刃", + hslingjian_xuanfengzhiren_duanzao2: "风", + hslingjian_xuanfengzhiren_equip1_info: "每当你用杀造成一次伤害,受伤害角色随机弃置一张牌。", + hslingjian_xuanfengzhiren_equip2_info: "每当你受到杀造成的伤害,伤害来源随机弃置一张牌。", + hslingjian_xuanfengzhiren_equip3_info: "当你于回合外失去牌后,你本回合的防御距离+1。", + hslingjian_xuanfengzhiren_equip4_info: "当你于回合内失去牌后,你本回合的进攻距离+1。", + hslingjian_xuanfengzhiren_equip5_info: + "出牌阶段限一次,你可以弃置一张牌,然后随机弃置一名其他角色的一张牌。", + hslingjian_zhongxinghujia_duanzao: "重甲", + hslingjian_zhongxinghujia_duanzao2: "护", + hslingjian_zhongxinghujia_equip1_info: "每当你用杀造成一次伤害,你可以随机装备一件防具牌。", + hslingjian_zhongxinghujia_equip2_info: "每当你受到杀造成的伤害,你可以弃置伤害来源的防具牌。", + hslingjian_zhongxinghujia_equip3_info: "当你的装备区内有防具牌时,你的防御距离+1。", + hslingjian_zhongxinghujia_equip4_info: "当你的装备区内有防具牌时,你的进攻距离+1。", + hslingjian_zhongxinghujia_equip5_info: + "出牌阶段限一次,你可以弃置两张牌,然后令一名角色随机装备一件防具。", + hslingjian_jinjilengdong_duanzao: "冰冻", + hslingjian_jinjilengdong_duanzao2: "冰", + hslingjian_jinjilengdong_equip1_info: "每当你用杀造成一次伤害,你可以令目标摸两张牌并翻面。", + hslingjian_jinjilengdong_equip2_info: "每当你受到杀造成的伤害,你可以令伤害来源摸两张牌并翻面。", + hslingjian_jinjilengdong_equip3_info: "你的武将牌背面朝上时防御距离+2。", + hslingjian_jinjilengdong_equip4_info: "你的武将牌背面朝上时进攻距离+2。", + hslingjian_jinjilengdong_equip5_info: + "回合结束后,若你的武将牌正面朝上,你可以与一名武将牌正面朝上的其他角色同时翻面,然后各摸两张牌。", + hslingjian_yinmilichang_duanzao: "隐力", + hslingjian_yinmilichang_duanzao2: "隐", + hslingjian_yinmilichang_equip1_info: + "每当你用杀造成一次伤害,你可以令一名其他角色获得潜行直到其下一回合开始。", + hslingjian_yinmilichang_equip2_info: "每当你受到一次伤害,你本回合内获得潜行。", + hslingjian_yinmilichang_equip3_info: "当你的体力值为1时,你的防御距离+1。", + hslingjian_yinmilichang_equip4_info: "当你的体力值为1时,你的进攻距离+1。", + hslingjian_yinmilichang_equip5_info: "当你没有手牌时,你不能成为杀或决斗的目标。", + hslingjian_xingtigaizao_duanzao: "移形", + hslingjian_xingtigaizao_duanzao2: "形", + hslingjian_xingtigaizao_equip1_info: "每当你用杀造成一次伤害,你摸一张牌。", + hslingjian_xingtigaizao_equip2_info: "每当你受到杀造成的伤害,你摸一张牌。", + hslingjian_xingtigaizao_equip3_info: "你的防御距离+1,进攻距离-1。", + hslingjian_xingtigaizao_equip4_info: "你的防御距离-1,进攻距离+1。", + hslingjian_xingtigaizao_equip5_info: "你于摸牌阶段额外摸一张牌;你的手牌上限-1。", + hslingjian_shengxiuhaojiao_duanzao: "号角", + hslingjian_shengxiuhaojiao_duanzao2: "角", + hslingjian_shengxiuhaojiao_equip1_info: "有嘲讽的角色不能闪避你的杀。", + hslingjian_shengxiuhaojiao_equip2_info: "有嘲讽的角色不能对你使用杀。", + hslingjian_shengxiuhaojiao_equip3_info: "若你的手牌数大于你的体力值,你的防御距离+1。", + hslingjian_shengxiuhaojiao_equip4_info: "若你的手牌数大于你的体力值,你的进攻距离+1。", + hslingjian_shengxiuhaojiao_equip5_info: + "出牌阶段限一次,你可以弃置两张牌,然后令一名角色获得或解除嘲讽。", + hslingjian_shijianhuisu_duanzao: "回溯", + hslingjian_shijianhuisu_duanzao2: "溯", + hslingjian_shijianhuisu_equip1_info: "当你装备一张防具牌时,你摸一张牌。", + hslingjian_shijianhuisu_equip2_info: "当你装备一张武器牌时,你摸一张牌。", + hslingjian_shijianhuisu_equip3_info: "当你的装备区内没有其他牌时,你的防御距离+1。", + hslingjian_shijianhuisu_equip4_info: "当你的装备区内没有其他牌时,你的进攻距离+1。", + hslingjian_shijianhuisu_equip5_info: + "出牌阶段限一次,你可以弃置一张牌,然后令一名其他角色将其装备区内的牌收回手牌。", + _lingjianduanzao: "煅造", + _lingjianduanzao_info: + "出牌阶段,你可以将一张装备牌和一张可煅造的牌合成为一件强化装备,并装备给距离1以内的一名角色。", + jiguanshu: "机关鼠", + jiguanshu_info: + "出牌阶段对自己使用,用随机祭器强化装备区内的一张随机装备,然后用随机零件强化其余的装备。", + lingjiandai: "零件袋", + lingjiandai_info: "出牌阶段对自己使用,获得3张随机零件。", + mujiaren: "木甲人", + mujiaren_info: "出牌阶段限用一次,将你手牌中的非基本牌(含此张)替换为随机的机关牌。", + jiguanyaoshu: "机关要术", + jiguanyaoshu_skill: "巧匠", + jiguanyaoshu_skill_info: "每当你于回合外失去装备区内的牌,你获得一个随机零件。", + jiguanyaoshu_info: + "出牌阶段对距离1以内的一名角色使用,目标随机装备一件装备牌并获得技能巧匠(每当你于回合外失去装备区内的牌,你获得一个随机零件)。", + hslingjian: "零件", + hslingjian_xuanfengzhiren: "旋风之刃", + hslingjian_xuanfengzhiren_info: "可用于煅造装备;随机弃置一名角色的一张牌。", + hslingjian_zhongxinghujia: "重型护甲", + hslingjian_zhongxinghujia_info: + "可用于煅造装备;令一名角色装备一件随机防具,然后随机弃置其一张手牌。", + hslingjian_jinjilengdong: "紧急冷冻", + hslingjian_jinjilengdong_bg: "冻", + hslingjian_jinjilengdong_info: + "可用于煅造装备;令一名武将牌正面朝上的其他角色获得2点护甲并翻面,该角色不能使用卡牌,也不能成为卡牌的目标直到武将牌翻回正面。", + hslingjian_yinmilichang: "隐秘力场", + hslingjian_yinmilichang_info: "可用于煅造装备;令一名其他角色获得技能潜行,直到其下一回合开始。", + hslingjian_xingtigaizao: "型体改造", + hslingjian_xingtigaizao_info: "可用于煅造装备;摸一张牌,本回合手牌上限-1。", + hslingjian_shengxiuhaojiao: "生锈号角", + hslingjian_shengxiuhaojiao_info: "可用于煅造装备;令一名角色获得技能嘲讽,直到其下一回合开始。", + hslingjian_shijianhuisu: "时间回溯", + hslingjian_shijianhuisu_info: "可用于煅造装备;令一名其他角色将其装备牌收回手牌。", + hslingjian_chaofeng: "嘲讽", + hslingjian_chaofeng_info: "锁定技,与你相邻的角色只能选择你为出杀目标。", + qinglonglingzhu: "青龙灵珠", + qinglonglingzhu_ab: "灵珠", + qinglonglingzhu_info: "每当你造成一次属性伤害,你可以获得对方的一张牌。", + xingjunyan: "星君眼", + xingjunyan_info: "你的杀造成的伤害+1;杀对你造成的伤害+1。", + guiyanfadao: "鬼眼法刀", + guiyanfadao_bg: "眼", + guiyanfadao_info: "每当你使用杀命中目标,你可以防止伤害,改为令目标失去1点体力。", + tianxianjiu: "天仙酒", + tianxianjiu_bg: "仙", + tianxianjiu_info: + "出牌阶段对自己使用,你使用的下一张杀造成伤害后可以摸两张牌;濒死阶段,对自己使用,回复1点体力。", // xiangyuye:'翔羽叶', // xiangyuye_info:'出牌阶段,对一名攻击范围外的角色使用,令其弃置一张黑色手牌或失去1点体力。', // huanpodan:'还魄丹', @@ -5210,268 +5501,286 @@ game.import('card', function () { // huanpodan_skill:'还魄丹', // huanpodan_skill_bg:'丹', // huanpodan_skill_info:'防止一次死亡,改为弃置所有牌,将体力值变为1并摸一张牌。', - ximohu:'吸魔壶', - ximohu_bg:'魔', + ximohu: "吸魔壶", + ximohu_bg: "魔", // ximohu_info:'锁定技,你将即将受到的雷属性伤害转化为你的体力值。', - sadengjinhuan:'萨登荆环', - sadengjinhuan_ab:'荆环', - sadengjinhuan_info:'当你的杀被闪避后,可以进行一次判定,若结果为红色目标需再打出一张闪。', - sadengjinhuan_bg:'荆', - qipoguyu:'奇魄古玉', - xujin:'蓄劲', - xujin2:'蓄劲', + sadengjinhuan: "萨登荆环", + sadengjinhuan_ab: "荆环", + sadengjinhuan_info: "当你的杀被闪避后,可以进行一次判定,若结果为红色目标需再打出一张闪。", + sadengjinhuan_bg: "荆", + qipoguyu: "奇魄古玉", + xujin: "蓄劲", + xujin2: "蓄劲", // qipoguyu_info:'装备后获得蓄劲技能。', - xujin_info:'回合开始前,若你的蓄劲标记数小于当前的体力值,你可以跳过此回合,并获得一枚蓄劲标记。锁定技,每当你即将造成伤害,你令此伤害+X,然后弃置一枚蓄劲标记,X为你拥有的蓄劲标记数。', - guilingzhitao:'归灵指套', - nigong:'逆攻', - nigong2:'逆攻', - nigong3:'逆攻', - nigong4:'逆攻', - guilingzhitao_info:'每当你受到1点伤害,你获得一个逆攻标记,标记数不能超过4。出牌阶段,你可以弃置所有逆攻标记并令对一名其他角色造成标记数一半的伤害(若非整数则向下取整并摸一张牌)。', - nigong_info:'每当你受到1点伤害,你获得一个逆攻标记,标记数不能超过4。出牌阶段,你可以弃置所有逆攻标记并令对一名其他角色造成标记数一半的伤害(若非整数则向下取整并摸一张牌)。', - baihupifeng:'白狐披风', - baihupifeng_bg:'狐', - baihupifeng_info:'结束阶段,若你的体力值是全场最小的之一,你可以回复1点体力。', - fengxueren:'封雪刃', - fengxueren_bg:'雪', - fengxueren_info:'你使用杀击中目标后,若目标武将牌正面朝上,你可以防止伤害,然后令目标摸一张牌并翻面。', - chilongya:'赤龙牙', - chilongya_info:'锁定技,你的火属性伤害+1。', - daihuofenglun:'带火风轮', - daihuofenglun_ab:'风轮', - daihuofenglun_bg:'轮', - daihuofenglun_info:'你的进攻距离+2,你的防御距离-1。', - xiayuncailing:'霞云彩绫', - xiayuncailing_ab:'彩绫', - xiayuncailing_bg:'云', - xiayuncailing_info:'你的进攻距离-1,你的防御距离+2。', - shentoumianju:'神偷面具', - shentoumianju_bg:'偷', - shentoumianju_info:'出牌阶段,你可以指定一名手牌比你多的角色,弃置一张手牌并进行一次判定,若结果不为梅花,你获得其一张手牌。', - shentou:'神偷', - shentou_info:'出牌阶段,你可以进行一次判定,若结果不为梅花,你获得任意一名角色的一张手牌。', - xianluhui:'仙炉灰', - xianluhui_info:'令所有已受伤角色获得1点护甲。', - caoyao:'草药', - caoyao_info:'出牌阶段,对距离为1以内的角色使用,回复1点体力。', - langeguaiyi:'蓝格怪衣', - langeguaiyi_bg:'格', - langeguaiyi_info:'出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复1点体力;方片:你摸一张牌;梅花:你令一名随机敌方角色随机弃置一张牌;黑桃:无事发生。', - longfan:'龙帆', - longfan_info:'出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复1点体力;方片:你摸一张牌;梅花:你令一名随机敌方角色随机弃置一张牌;黑桃:无事发生。', + xujin_info: + "回合开始前,若你的蓄劲标记数小于当前的体力值,你可以跳过此回合,并获得一枚蓄劲标记。锁定技,每当你即将造成伤害,你令此伤害+X,然后弃置一枚蓄劲标记,X为你拥有的蓄劲标记数。", + guilingzhitao: "归灵指套", + nigong: "逆攻", + nigong2: "逆攻", + nigong3: "逆攻", + nigong4: "逆攻", + guilingzhitao_info: + "每当你受到1点伤害,你获得一个逆攻标记,标记数不能超过4。出牌阶段,你可以弃置所有逆攻标记并令对一名其他角色造成标记数一半的伤害(若非整数则向下取整并摸一张牌)。", + nigong_info: + "每当你受到1点伤害,你获得一个逆攻标记,标记数不能超过4。出牌阶段,你可以弃置所有逆攻标记并令对一名其他角色造成标记数一半的伤害(若非整数则向下取整并摸一张牌)。", + baihupifeng: "白狐披风", + baihupifeng_bg: "狐", + baihupifeng_info: "结束阶段,若你的体力值是全场最小的之一,你可以回复1点体力。", + fengxueren: "封雪刃", + fengxueren_bg: "雪", + fengxueren_info: + "你使用杀击中目标后,若目标武将牌正面朝上,你可以防止伤害,然后令目标摸一张牌并翻面。", + chilongya: "赤龙牙", + chilongya_info: "锁定技,你的火属性伤害+1。", + daihuofenglun: "带火风轮", + daihuofenglun_ab: "风轮", + daihuofenglun_bg: "轮", + daihuofenglun_info: "你的进攻距离+2,你的防御距离-1。", + xiayuncailing: "霞云彩绫", + xiayuncailing_ab: "彩绫", + xiayuncailing_bg: "云", + xiayuncailing_info: "你的进攻距离-1,你的防御距离+2。", + shentoumianju: "神偷面具", + shentoumianju_bg: "偷", + shentoumianju_info: + "出牌阶段,你可以指定一名手牌比你多的角色,弃置一张手牌并进行一次判定,若结果不为梅花,你获得其一张手牌。", + shentou: "神偷", + shentou_info: "出牌阶段,你可以进行一次判定,若结果不为梅花,你获得任意一名角色的一张手牌。", + xianluhui: "仙炉灰", + xianluhui_info: "令所有已受伤角色获得1点护甲。", + caoyao: "草药", + caoyao_info: "出牌阶段,对距离为1以内的角色使用,回复1点体力。", + langeguaiyi: "蓝格怪衣", + langeguaiyi_bg: "格", + langeguaiyi_info: + "出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复1点体力;方片:你摸一张牌;梅花:你令一名随机敌方角色随机弃置一张牌;黑桃:无事发生。", + longfan: "龙帆", + longfan_info: + "出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复1点体力;方片:你摸一张牌;梅花:你令一名随机敌方角色随机弃置一张牌;黑桃:无事发生。", // longfan_info:'0000:翻面;1111:弃手牌;2222:弃装备牌;3333:受伤害;4444:失去体力;5555:连环;6666:摸牌;7777:回复体力;8888:弃置判定牌;9999:置衡。', - guiyoujie:'鬼幽结', - guiyoujie_bg:'结', - guiyoujie_info:'出牌阶段,对一名其他角色使用。若判定结果为黑色,其失去1点体力并随机弃置一张牌。', - yufulu:'御夫录', - yufulu_info:'出牌阶段,可弃置一张武器牌令一名角色受到1点伤害,然后该角色获得此武器牌。', - touzhi:'投掷', - touzhi_info:'出牌阶段,可弃置一张武器牌令一名角色受到1点伤害,然后该角色获得此武器牌。', - xixueguizhihuan:'吸血鬼指环', - xixueguizhihuan_ab:'血环', - xixueguizhihuan_info:'锁定技,每当你使用杀造成1点伤害,你回复1点体力。', - xixue:'吸血', - xixue_info:'锁定技,每当你使用杀造成1点伤害,你回复1点体力。', - zhufangshenshi:'祠符', - zhufangshenshi_info:'出牌阶段,对一名其他角色使用,本回合内对其使用卡牌无视距离,结算后摸一张牌。', - jingleishan:'惊雷闪', - jingleishan_info:'出牌阶段,对所有其他角色使用。每名目标角色需打出一张【杀】,否则受到1点雷电伤害。', - chiyuxi:'炽羽袭', - chiyuxi_info:'出牌阶段,对所有其他角色使用。每名目标角色需打出一张【闪】,否则受到1点火焰伤害。', - guangshatianyi:'光纱天衣', - guangshatianyi_bg:'纱', - guangshatianyi_info:'锁定技,每当你即将受到伤害,有三分之一的概率令伤害减一。', - sifeizhenmian:'四非真面', - sifeizhenmian_info:'出牌阶段限一次,你可以令一名有手牌的其他角色进行一次判定,若结果为不为红桃且目标有可用的手牌,目标随机使用一张手牌(随机指定目标)。', - yiluan:'意乱', - yiluan_info:'出牌阶段限一次,你可以令一名有手牌的其他角色进行一次判定,若结果为不为红桃且目标有可用的手牌,目标随机使用一张手牌(随机指定目标)。', - donghuangzhong:'东皇钟', - xuanyuanjian:'轩辕剑', - xuanyuanjian2:'轩辕剑', - pangufu:'盘古斧', - lianyaohu:'炼妖壶', - lianyaohu_skill:'炼妖壶', - lianyaohu_skill_bg:'壶', - haotianta:'昊天塔', - fuxiqin:'伏羲琴', - shennongding:'神农鼎', - kongdongyin:'崆峒印', - kunlunjingc:'昆仑镜', - nvwashi:'女娲石', - donghuangzhong_bg:'钟', - lianyaohu_bg:'壶', - haotianta_bg:'塔', - fuxiqin_bg:'琴', - shennongding_bg:'鼎', - kongdongyin_bg:'印', - kunlunjingc_bg:'镜', - nvwashi_bg:'石', - kongxin:'控心', - lianhua:'炼化', + guiyoujie: "鬼幽结", + guiyoujie_bg: "结", + guiyoujie_info: "出牌阶段,对一名其他角色使用。若判定结果为黑色,其失去1点体力并随机弃置一张牌。", + yufulu: "御夫录", + yufulu_info: "出牌阶段,可弃置一张武器牌令一名角色受到1点伤害,然后该角色获得此武器牌。", + touzhi: "投掷", + touzhi_info: "出牌阶段,可弃置一张武器牌令一名角色受到1点伤害,然后该角色获得此武器牌。", + xixueguizhihuan: "吸血鬼指环", + xixueguizhihuan_ab: "血环", + xixueguizhihuan_info: "锁定技,每当你使用杀造成1点伤害,你回复1点体力。", + xixue: "吸血", + xixue_info: "锁定技,每当你使用杀造成1点伤害,你回复1点体力。", + zhufangshenshi: "祠符", + zhufangshenshi_info: + "出牌阶段,对一名其他角色使用,本回合内对其使用卡牌无视距离,结算后摸一张牌。", + jingleishan: "惊雷闪", + jingleishan_info: + "出牌阶段,对所有其他角色使用。每名目标角色需打出一张【杀】,否则受到1点雷电伤害。", + chiyuxi: "炽羽袭", + chiyuxi_info: "出牌阶段,对所有其他角色使用。每名目标角色需打出一张【闪】,否则受到1点火焰伤害。", + guangshatianyi: "光纱天衣", + guangshatianyi_bg: "纱", + guangshatianyi_info: "锁定技,每当你即将受到伤害,有三分之一的概率令伤害减一。", + sifeizhenmian: "四非真面", + sifeizhenmian_info: + "出牌阶段限一次,你可以令一名有手牌的其他角色进行一次判定,若结果为不为红桃且目标有可用的手牌,目标随机使用一张手牌(随机指定目标)。", + yiluan: "意乱", + yiluan_info: + "出牌阶段限一次,你可以令一名有手牌的其他角色进行一次判定,若结果为不为红桃且目标有可用的手牌,目标随机使用一张手牌(随机指定目标)。", + donghuangzhong: "东皇钟", + xuanyuanjian: "轩辕剑", + xuanyuanjian2: "轩辕剑", + pangufu: "盘古斧", + lianyaohu: "炼妖壶", + lianyaohu_skill: "炼妖壶", + lianyaohu_skill_bg: "壶", + haotianta: "昊天塔", + fuxiqin: "伏羲琴", + shennongding: "神农鼎", + kongdongyin: "崆峒印", + kunlunjingc: "昆仑镜", + nvwashi: "女娲石", + donghuangzhong_bg: "钟", + lianyaohu_bg: "壶", + haotianta_bg: "塔", + fuxiqin_bg: "琴", + shennongding_bg: "鼎", + kongdongyin_bg: "印", + kunlunjingc_bg: "镜", + nvwashi_bg: "石", + kongxin: "控心", + lianhua: "炼化", // dujian:'毒箭', // dujian_info:'出牌阶段,对一名有手牌或装备牌的角色使用,令其展示一张手牌,若与你选择的手牌颜色相同,其失去1点体力。', - lianhua_info:'出牌阶段限一次,你可以弃置两张炼妖壶中的牌,从牌堆中获得一张与弃置的牌类别均不相同的牌。', - shouna:'收纳', - shouna_info:'出牌阶段限一次,你可以弃置一张手牌,并将一名其他角色的一张手牌置入炼妖壶。', - donghuangzhong_info:'结束阶段,你可以弃置一张红色手牌,并选择一名角色将一张随机单体延时锦囊置入其判定区。', - xuanyuanjian_info:'装备时获得1点护甲;每当你即将造成一次伤害,你令此伤害加一并变为雷属性,并在伤害结算后失去1点体力。任何时候,若你体力值不超过2,则立即失去轩辕剑。', - pangufu_info:'锁定技,每当你造成一次伤害,受伤角色须弃置一张牌。', - haotianta_info:'锁定技,任意一名角色进行判定前,你观看牌堆顶的2张牌,并选择一张作为判定结果,此结果不可被更改,也不能触发技能。', - shennongding_info:'出牌阶段,你可以弃置两张手牌,然后回复1点体力。每阶段限一次。', - kongdongyin_info:'令你抵挡一次死亡,将体力回复至1,并摸一张牌,发动后进入弃牌堆。', - kunlunjingc_info:'出牌阶段限一次,你可以观看牌堆顶的三张牌,然后用一张手牌替换其中的一张。', - nvwashi_info:'当一名角色濒死时,若你的体力值大于1,你可以失去1点体力并令其回复1点体力。', - kongxin_info:'出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你可以指定另一名角色视为对方对该角色使用一张杀,否则对方可弃置你一张牌。', - fuxiqin_info:'出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你可以指定另一名角色视为对方对该角色使用一张杀,否则对方可弃置你一张牌。', - lianyaohu_info:'出牌阶段各限一次,你可以选择一项:1.弃置一张手牌,并将一名其他角色的一张手牌置入炼妖壶;2.弃置两张炼妖壶中的牌,从牌堆中获得一张与弃置的牌类别均不相同的牌。', + lianhua_info: + "出牌阶段限一次,你可以弃置两张炼妖壶中的牌,从牌堆中获得一张与弃置的牌类别均不相同的牌。", + shouna: "收纳", + shouna_info: "出牌阶段限一次,你可以弃置一张手牌,并将一名其他角色的一张手牌置入炼妖壶。", + donghuangzhong_info: + "结束阶段,你可以弃置一张红色手牌,并选择一名角色将一张随机单体延时锦囊置入其判定区。", + xuanyuanjian_info: + "装备时获得1点护甲;每当你即将造成一次伤害,你令此伤害加一并变为雷属性,并在伤害结算后失去1点体力。任何时候,若你体力值不超过2,则立即失去轩辕剑。", + pangufu_info: "锁定技,每当你造成一次伤害,受伤角色须弃置一张牌。", + haotianta_info: + "锁定技,任意一名角色进行判定前,你观看牌堆顶的2张牌,并选择一张作为判定结果,此结果不可被更改,也不能触发技能。", + shennongding_info: "出牌阶段,你可以弃置两张手牌,然后回复1点体力。每阶段限一次。", + kongdongyin_info: "令你抵挡一次死亡,将体力回复至1,并摸一张牌,发动后进入弃牌堆。", + kunlunjingc_info: "出牌阶段限一次,你可以观看牌堆顶的三张牌,然后用一张手牌替换其中的一张。", + nvwashi_info: "当一名角色濒死时,若你的体力值大于1,你可以失去1点体力并令其回复1点体力。", + kongxin_info: + "出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你可以指定另一名角色视为对方对该角色使用一张杀,否则对方可弃置你一张牌。", + fuxiqin_info: + "出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你可以指定另一名角色视为对方对该角色使用一张杀,否则对方可弃置你一张牌。", + lianyaohu_info: + "出牌阶段各限一次,你可以选择一项:1.弃置一张手牌,并将一名其他角色的一张手牌置入炼妖壶;2.弃置两张炼妖壶中的牌,从牌堆中获得一张与弃置的牌类别均不相同的牌。", }, - list:[ - ['heart',1,'hufu'], - ['spade',1,'hufu'], - ['club',1,'qiankundai'], + list: [ + ["heart", 1, "hufu"], + ["spade", 1, "hufu"], + ["club", 1, "qiankundai"], // ['heart',3,'yihuajiemu'], // ['diamond',1,'yihuajiemu'], // ['diamond',7,'yihuajiemu'], - ['diamond',3,'liuxinghuoyu','fire'], - ['heart',6,'liuxinghuoyu','fire'], - ['heart',9,'liuxinghuoyu','fire'], + ["diamond", 3, "liuxinghuoyu", "fire"], + ["heart", 6, "liuxinghuoyu", "fire"], + ["heart", 9, "liuxinghuoyu", "fire"], - ['spade',1,'baihupifeng'], - ['club',1,'fengxueren'], - ['diamond',1,'langeguaiyi'], - ['heart',1,'daihuofenglun','fire'], + ["spade", 1, "baihupifeng"], + ["club", 1, "fengxueren"], + ["diamond", 1, "langeguaiyi"], + ["heart", 1, "daihuofenglun", "fire"], - ['diamond',2,'xiayuncailing'], + ["diamond", 2, "xiayuncailing"], // ['heart',2,'pantao'], // ['heart',2,'huanpodan'], - ['club',3,'caoyao'], - ['diamond',3,'chilongya','fire'], - ['spade',3,'guiyoujie'], + ["club", 3, "caoyao"], + ["diamond", 3, "chilongya", "fire"], + ["spade", 3, "guiyoujie"], - ['club',4,'caoyao'], - ['spade',4,'zhufangshenshi'], + ["club", 4, "caoyao"], + ["spade", 4, "zhufangshenshi"], // ['spade',4,'huanpodan'], - ['club',5,'caoyao'], - ['spade',5,'xixueguizhihuan'], + ["club", 5, "caoyao"], + ["spade", 5, "xixueguizhihuan"], // ['diamond',5,'huanpodan'], - ['club',6,'shentoumianju'], - ['spade',6,'yufulu'], + ["club", 6, "shentoumianju"], + ["spade", 6, "yufulu"], - ['diamond',7,'chiyuxi','fire'], - ['club',7,'jingleishan','thunder'], - ['spade',7,'guilingzhitao'], + ["diamond", 7, "chiyuxi", "fire"], + ["club", 7, "jingleishan", "thunder"], + ["spade", 7, "guilingzhitao"], - ['spade',8,'zhufangshenshi'], + ["spade", 8, "zhufangshenshi"], // ['club',8,'xiangyuye','poison'], - ['spade',9,'yangpijuan'], - ['club',9,'guiyoujie'], + ["spade", 9, "yangpijuan"], + ["club", 9, "guiyoujie"], // ['diamond',9,'xiangyuye','poison'], // ['diamond',9,'tianxianjiu'], - ['heart',9,'tianxianjiu'], - ['diamond',2,'tianxianjiu'], + ["heart", 9, "tianxianjiu"], + ["diamond", 2, "tianxianjiu"], - ['spade',2,'qinglonglingzhu'], - ['spade',7,'xingjunyan'], + ["spade", 2, "qinglonglingzhu"], + ["spade", 7, "xingjunyan"], //['spade',10,'qipoguyu'], //['diamond',10,'xiangyuye','poison'], - ['club',7,'yangpijuan'], + ["club", 7, "yangpijuan"], // ['spade',11,'xiangyuye','poison'], - ['spade',12,'guiyanfadao','poison'], + ["spade", 12, "guiyanfadao", "poison"], - ['spade',13,'xianluhui'], - ['diamond',3,'guangshatianyi'], - ['club',13,'sadengjinhuan'], + ["spade", 13, "xianluhui"], + ["diamond", 3, "guangshatianyi"], + ["club", 13, "sadengjinhuan"], - ['club',2,'lingjiandai'], + ["club", 2, "lingjiandai"], // ['spade',3,'lingjiandai'], // ['heart',5,'lingjiandai'], - ['diamond',8,'lingjiandai'], + ["diamond", 8, "lingjiandai"], - ['club',2,'jiguanshu'], + ["club", 2, "jiguanshu"], // ['spade',2,'jiguanshu'], // ['heart',2,'jiguanshu'], - ['diamond',2,'jiguanshu'], + ["diamond", 2, "jiguanshu"], - ['club',3,'jiguanyaoshu'], - ['spade',3,'jiguanyaoshu'], + ["club", 3, "jiguanyaoshu"], + ["spade", 3, "jiguanyaoshu"], // ['heart',3,'jiguanyaoshu'], // ['diamond',3,'jiguanyaoshu'], - ['spade',4,'sifeizhenmian'], - ['heart',13,'qinglianxindeng'], - ['club',3,'jiguanyuan'], - ['diamond',2,'jiguanyuan'], - ['diamond',4,'jiguantong'], - ['club',7,'jiguantong'], + ["spade", 4, "sifeizhenmian"], + ["heart", 13, "qinglianxindeng"], + ["club", 3, "jiguanyuan"], + ["diamond", 2, "jiguanyuan"], + ["diamond", 4, "jiguantong"], + ["club", 7, "jiguantong"], // ['spade',1,'shenmiguo'], - ['spade',2,'shenmiguo'], - ['heart',1,'shenmiguo'], - ['club',3,'jiguanfeng'], - ['spade',4,'jiguanfeng'], - ['spade',9,'guisheqi'], - ['club',7,'guisheqi'], + ["spade", 2, "shenmiguo"], + ["heart", 1, "shenmiguo"], + ["club", 3, "jiguanfeng"], + ["spade", 4, "jiguanfeng"], + ["spade", 9, "guisheqi"], + ["club", 7, "guisheqi"], - ['diamond',13,'donghuangzhong'], - ['diamond',13,'fuxiqin'], - ['spade',13,'kunlunjingc'], - ['spade',13,'xuanyuanjian'], - ['spade',13,'pangufu'], - ['club',13,'lianyaohu'], - ['diamond',13,'haotianta'], - ['club',13,'shennongding'], - ['heart',13,'nvwashi'], - ['heart',13,'kongdongyin'], + ["diamond", 13, "donghuangzhong"], + ["diamond", 13, "fuxiqin"], + ["spade", 13, "kunlunjingc"], + ["spade", 13, "xuanyuanjian"], + ["spade", 13, "pangufu"], + ["club", 13, "lianyaohu"], + ["diamond", 13, "haotianta"], + ["club", 13, "shennongding"], + ["heart", 13, "nvwashi"], + ["heart", 13, "kongdongyin"], - ['heart',6,'qinglongzhigui'], - ['diamond',6,'zhuquezhizhang'], - ['spade',6,'baishouzhihu'], - ['club',6,'xuanwuzhihuang'], - ['spade',7,'cangchizhibi'], - ['heart',5,'huanglinzhicong'], + ["heart", 6, "qinglongzhigui"], + ["diamond", 6, "zhuquezhizhang"], + ["spade", 6, "baishouzhihu"], + ["club", 6, "xuanwuzhihuang"], + ["spade", 7, "cangchizhibi"], + ["heart", 5, "huanglinzhicong"], - ['spade',9,'gouhunluo'], - ['club',7,'gouhunluo'], + ["spade", 9, "gouhunluo"], + ["club", 7, "gouhunluo"], - ['spade',1,'xuejibingbao'], - ['club',1,'xuejibingbao'], + ["spade", 1, "xuejibingbao"], + ["club", 1, "xuejibingbao"], - ['heart',3,'zhiluxiaohu'], - ['diamond',4,'zhiluxiaohu'], + ["heart", 3, "zhiluxiaohu"], + ["diamond", 4, "zhiluxiaohu"], - ['club',7,'mujiaren'], - ['heart',6,'mujiaren'], - ['diamond',11,'mujiaren'], + ["club", 7, "mujiaren"], + ["heart", 6, "mujiaren"], + ["diamond", 11, "mujiaren"], - ['club',6,'shuchui'], + ["club", 6, "shuchui"], // ['club',1,'fengyinzhidan'], // ['diamond',1,'fengyinzhidan'], // ['heart',1,'fengyinzhidan'], - ['spade',1,'fengyinzhidan'], + ["spade", 1, "fengyinzhidan"], - ['heart',9,'yuruyi'], + ["heart", 9, "yuruyi"], - ['club',4,'shencaojie'], - ['diamond',4,'shencaojie'], - ['spade',4,'shencaojie'], + ["club", 4, "shencaojie"], + ["diamond", 4, "shencaojie"], + ["spade", 4, "shencaojie"], - ['spade',1,'yuchanqian'], - ['club',2,'yuchankun'], - ['diamond',3,'yuchanzhen'], - ['heart',4,'yuchanxun'], - ['spade',5,'yuchankan'], - ['club',6,'yuchanli'], - ['diamond',7,'yuchangen'], - ['heart',8,'yuchandui'], + ["spade", 1, "yuchanqian"], + ["club", 2, "yuchankun"], + ["diamond", 3, "yuchanzhen"], + ["heart", 4, "yuchanxun"], + ["spade", 5, "yuchankan"], + ["club", 6, "yuchanli"], + ["diamond", 7, "yuchangen"], + ["heart", 8, "yuchandui"], // ['spade',3,'dujian','poison'], // ['club',11,'dujian','poison'], diff --git a/card/yingbian.js b/card/yingbian.js index 89678ca9b..1f83bb44d 100644 --- a/card/yingbian.js +++ b/card/yingbian.js @@ -1,109 +1,167 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'yingbian', - connect:true, - card:{ - suijiyingbian:{ - global:'suijiyingbian_skill', - fullskin:true, - type:'trick', + name: "yingbian", + connect: true, + card: { + suijiyingbian: { + global: "suijiyingbian_skill", + fullskin: true, + type: "trick", }, - zhujinqiyuan:{ - type:'trick', - enable:true, - audio:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('hej')>0; + zhujinqiyuan: { + type: "trick", + enable: true, + audio: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("hej") > 0; }, - defaultYingbianEffect:'add', - content:function(){ - var dist=get.distance(player,target); - if(dist>1||card.yingbian_all) player.discardPlayerCard(target,'hej',true).set('target',target).set('ai',lib.card.guohe.ai.button); - if(dist<=1||card.yingbian_all) player.gainPlayerCard(target,'hej',true).set('target',target).set('ai',lib.card.shunshou.ai.button); + defaultYingbianEffect: "add", + content: function () { + var dist = get.distance(player, target); + if (dist > 1 || card.yingbian_all) + player + .discardPlayerCard(target, "hej", true) + .set("target", target) + .set("ai", lib.card.guohe.ai.button); + if (dist <= 1 || card.yingbian_all) + player + .gainPlayerCard(target, "hej", true) + .set("target", target) + .set("ai", lib.card.shunshou.ai.button); }, - fullskin:true, - postAi:function(targets){ - return targets.length==1&&targets[0].countCards('j'); + fullskin: true, + postAi: function (targets) { + return targets.length == 1 && targets[0].countCards("j"); }, - ai:{ - wuxie:function(target,card,player,viewer,status){ - if(get.attitude(viewer,player._trueMe||player)>0) return 0; - if(!card.yingbian_all&&get.distance(player,target)>1&&!target.hasCard(i=>{ - let val=get.value(i,target),subtypes=get.subtypes(i); - if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false; - return val>3+Math.min(5,target.hp); - },'e')&&target.countCards('h')*_status.event.getRand('guohe_wuxie')>1.57) return 0; + ai: { + wuxie: function (target, card, player, viewer, status) { + if (get.attitude(viewer, player._trueMe || player) > 0) return 0; + if ( + !card.yingbian_all && + get.distance(player, target) > 1 && + !target.hasCard((i) => { + let val = get.value(i, target), + subtypes = get.subtypes(i); + if ( + val < 8 && + target.hp < 2 && + !subtypes.includes("equip2") && + !subtypes.includes("equip5") + ) + return false; + return val > 3 + Math.min(5, target.hp); + }, "e") && + target.countCards("h") * _status.event.getRand("guohe_wuxie") > 1.57 + ) + return 0; }, - yingbian:function(card,player,targets,viewer){ - if(get.attitude(viewer,player)<=0) return 0; - var base=0; - if(get.cardtag(card,'yingbian_all')){ - if(targets.filter(function(current){ - var att=get.attitude(player,current); - if(att<=0) return current.countCards('he',function(card){ - return get.value(card,current)>0; - })>1; - return current.countCards('ej',function(card){ - return get.position(card)=='j'||get.value(card,current)<=0; - })>1; - }).length) base+=6; + yingbian: function (card, player, targets, viewer) { + if (get.attitude(viewer, player) <= 0) return 0; + var base = 0; + if (get.cardtag(card, "yingbian_all")) { + if ( + targets.filter(function (current) { + var att = get.attitude(player, current); + if (att <= 0) + return ( + current.countCards("he", function (card) { + return get.value(card, current) > 0; + }) > 1 + ); + return ( + current.countCards("ej", function (card) { + return get.position(card) == "j" || get.value(card, current) <= 0; + }) > 1 + ); + }).length + ) + base += 6; } - if(get.cardtag(card,'yingbian_add')){ - if(game.hasPlayer(function(current){ - return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; - })) base+=5; + if (get.cardtag(card, "yingbian_add")) { + if ( + game.hasPlayer(function (current) { + return ( + !targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + get.effect(current, card, player, player) > 0 + ); + }) + ) + base += 5; } - if(get.cardtag(card,'yingbian_hit')){ - if(game.hasPlayer(function(current){ - return get.attitude(current,player)<0&¤t.hasWuxie(); - })) base+=3*targets.length; + if (get.cardtag(card, "yingbian_hit")) { + if ( + game.hasPlayer(function (current) { + return get.attitude(current, player) < 0 && current.hasWuxie(); + }) + ) + base += 3 * targets.length; } return base; }, - basic:{ - order:7.5, - useful:(card,i)=>9.6/(2+i), - value:(card,player)=>{ - let max=0; - game.countPlayer(cur=>{ - let dist=get.distance(player,cur); - if(dist>1||card.yingbian_all) max=Math.max(max,lib.card.shunshou.ai.result.target(player,cur)*get.attitude(player,cur)); - else max=Math.max(max,lib.card.guohe.ai.result.target(player,cur)*get.attitude(player,cur)); + basic: { + order: 7.5, + useful: (card, i) => 9.6 / (2 + i), + value: (card, player) => { + let max = 0; + game.countPlayer((cur) => { + let dist = get.distance(player, cur); + if (dist > 1 || card.yingbian_all) + max = Math.max( + max, + lib.card.shunshou.ai.result.target(player, cur) * + get.attitude(player, cur) + ); + else + max = Math.max( + max, + lib.card.guohe.ai.result.target(player, cur) * + get.attitude(player, cur) + ); }); - if(max<=0) return 7; - if(card.yingbian_all) return 0.75*max; - return 0.6*max; - } + if (max <= 0) return 7; + if (card.yingbian_all) return 0.75 * max; + return 0.6 * max; + }, }, - result:{ - target:function(player,target){ - var discard=get.distance(player,target)>1; - if(get.attitude(player,target)<=0) return (target.countCards('he',function(card){ - return get.value(card,target)>0&&(discard||card!=target.getEquip('jinhe')); - })>0)?-1.5:1.5; - var js=target.getCards('j'); - if(js.length){ - var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; - if(js.length==1&&get.effect(target,jj,target,player)>=0){ + result: { + target: function (player, target) { + var discard = get.distance(player, target) > 1; + if (get.attitude(player, target) <= 0) + return target.countCards("he", function (card) { + return ( + get.value(card, target) > 0 && + (discard || card != target.getEquip("jinhe")) + ); + }) > 0 + ? -1.5 + : 1.5; + var js = target.getCards("j"); + if (js.length) { + var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0]; + if (js.length == 1 && get.effect(target, jj, target, player) >= 0) { return -1.5; } return 3; } return -1.5; }, - player:function(player,target){ - if(get.distance(player,target)>1) return 0; - if(get.attitude(player,target)<0&&!target.countCards('he',function(card){ - return get.value(card,target)>0&&card!=target.getEquip('jinhe'); - })){ + player: function (player, target) { + if (get.distance(player, target) > 1) return 0; + if ( + get.attitude(player, target) < 0 && + !target.countCards("he", function (card) { + return get.value(card, target) > 0 && card != target.getEquip("jinhe"); + }) + ) { return 0; } - if(get.attitude(player,target)>1){ - var js=target.getCards('j'); - if(js.length){ - var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; - if(js.length==1&&get.effect(target,jj,target,player)>=0){ + if (get.attitude(player, target) > 1) { + var js = target.getCards("j"); + if (js.length) { + var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0]; + if (js.length == 1 && get.effect(target, jj, target, player) >= 0) { return 0; } return 1; @@ -111,762 +169,869 @@ game.import('card', function () { return 0; } return 1; - } + }, + }, + tag: { + loseCard: 1, + gain: 1, }, - tag:{ - loseCard:1, - gain:1, - } }, }, - dongzhuxianji:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - toself:true, - filterTarget:function(card,player,target){ - return target==player; + dongzhuxianji: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + toself: true, + filterTarget: function (card, player, target) { + return target == player; }, - modTarget:true, - content:function(){ + modTarget: true, + content: function () { target.chooseToGuanxing(2); target.draw(2); }, - ai:{ - basic:{ - order:7.2, - useful:4.5, - value:9.2 + ai: { + basic: { + order: 7.2, + useful: 4.5, + value: 9.2, }, - result:{ - target:2.5, + result: { + target: 2.5, + }, + tag: { + draw: 2, }, - tag:{ - draw:2 - } - } - }, - chuqibuyi:{ - audio:true, - enable:true, - type:'trick', - fullskin:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h')>0; }, - defaultYingbianEffect:'add', - content:function(){ - 'step 0' - if(player.isDead()||!target.countCards('h')){ + }, + chuqibuyi: { + audio: true, + enable: true, + type: "trick", + fullskin: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("h") > 0; + }, + defaultYingbianEffect: "add", + content: function () { + "step 0"; + if (player.isDead() || !target.countCards("h")) { event.finish(); return; } - player.choosePlayerCard(target,'h',true); - 'step 1' - if(result.bool){ + player.choosePlayerCard(target, "h", true); + "step 1"; + if (result.bool) { target.showCards(result.cards); - if(get.suit(card)!=get.suit(result.cards[0])) target.damage(); + if (get.suit(card) != get.suit(result.cards[0])) target.damage(); } }, - ai:{ - basic:{ - order:5, - useful:2, - value:6 + ai: { + basic: { + order: 5, + useful: 2, + value: 6, }, - yingbian:function(card,player,targets,viewer){ - if(get.attitude(viewer,player)<=0) return 0; - if(game.hasPlayer(function(current){ - return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; - })) return 6; + yingbian: function (card, player, targets, viewer) { + if (get.attitude(viewer, player) <= 0) return 0; + if ( + game.hasPlayer(function (current) { + return ( + !targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + get.effect(current, card, player, player) > 0 + ); + }) + ) + return 6; return 0; }, - result:{ - target:(player,target,card)=>{ + result: { + target: (player, target, card) => { //if(typeof card!=='object') return -2; - let suit=get.suit(card), - view=player.hasSkillTag('viewHandcard',null,target,true), - fz=0, - fm=0; - target.getCards('h',i=>{ - if(i.isKnownBy(player)){ - if(suit!==get.suit(i)){ - if(view||get.is.shownCard(i)) return -2; + let suit = get.suit(card), + view = player.hasSkillTag("viewHandcard", null, target, true), + fz = 0, + fm = 0; + target.getCards("h", (i) => { + if (i.isKnownBy(player)) { + if (suit !== get.suit(i)) { + if (view || get.is.shownCard(i)) return -2; fz++; fm++; - } - else if(!view&&!get.is.shownCard(i)) fm++; - } - else{ - fz+=0.75; + } else if (!view && !get.is.shownCard(i)) fm++; + } else { + fz += 0.75; fm++; } }); - if(!fm) return 0; - return -2*fz/fm; - } + if (!fm) return 0; + return (-2 * fz) / fm; + }, }, - tag:{ - damage:1, - } - } - }, - wuxinghelingshan:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-3}, - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['wuxinghelingshan_skill'] - }, - wutiesuolian:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['wutiesuolian_skill'] - }, - heiguangkai:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip2', - ai:{ - basic:{ - equipValue:2 - } - }, - skills:['heiguangkai_skill'], - }, - tongque:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip5', - ai:{ - basic:{ - equipValue:6.5 - } - }, - skills:['tongque_skill'] - }, - tianjitu:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip5', - skills:['tianjitu_skill'], - onLose:function(){ - player.addTempSkill('tianjitu_skill_lose') - }, - loseDelay:false, - ai:{ - value:function(card,player){ - if(player.countCards('h')>3||get.position(card)!='e') return 0.5; - return (player.countCards('h')-4)*5; + tag: { + damage: 1, }, - equipValue:function(card,player){ - if(player.countCards('h')>3||get.position(card)!='e') return 0.5; - return (player.countCards('h')-4)*5; - }, - basic:{ - equipValue:0.5 - } }, }, - taigongyinfu:{ - audio:true, - fullskin:true, - type:'equip', - subtype:'equip5', - ai:{ - basic:{ - equipValue:3 - } + wuxinghelingshan: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -3 }, + ai: { + basic: { + equipValue: 2, + }, }, - skills:['taigongyinfu_skill','taigongyinfu_link'], + skills: ["wuxinghelingshan_skill"], + }, + wutiesuolian: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -2 }, + ai: { + basic: { + equipValue: 2, + }, + }, + skills: ["wutiesuolian_skill"], + }, + heiguangkai: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip2", + ai: { + basic: { + equipValue: 2, + }, + }, + skills: ["heiguangkai_skill"], + }, + tongque: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + ai: { + basic: { + equipValue: 6.5, + }, + }, + skills: ["tongque_skill"], + }, + tianjitu: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + skills: ["tianjitu_skill"], + onLose: function () { + player.addTempSkill("tianjitu_skill_lose"); + }, + loseDelay: false, + ai: { + value: function (card, player) { + if (player.countCards("h") > 3 || get.position(card) != "e") return 0.5; + return (player.countCards("h") - 4) * 5; + }, + equipValue: function (card, player) { + if (player.countCards("h") > 3 || get.position(card) != "e") return 0.5; + return (player.countCards("h") - 4) * 5; + }, + basic: { + equipValue: 0.5, + }, + }, + }, + taigongyinfu: { + audio: true, + fullskin: true, + type: "equip", + subtype: "equip5", + ai: { + basic: { + equipValue: 3, + }, + }, + skills: ["taigongyinfu_skill", "taigongyinfu_link"], }, }, - skill:{ - suijiyingbian_skill:{ - mod:{ - cardname:function(card,player){ - if(card.name=='suijiyingbian'&&player.storage.suijiyingbian) return player.storage.suijiyingbian; + skill: { + suijiyingbian_skill: { + mod: { + cardname: function (card, player) { + if (card.name == "suijiyingbian" && player.storage.suijiyingbian) + return player.storage.suijiyingbian; }, - cardnature:function(card,player){ - if(card.name=='suijiyingbian'&&player.storage.suijiyingbian_nature) return player.storage.suijiyingbian_nature; + cardnature: function (card, player) { + if (card.name == "suijiyingbian" && player.storage.suijiyingbian_nature) + return player.storage.suijiyingbian_nature; }, }, - trigger:{ - player:['useCard1','respond'], - global:'phaseBeginStart', + trigger: { + player: ["useCard1", "respond"], + global: "phaseBeginStart", }, - silent:true, - firstDo:true, - filter:function(event,player,name){ - if(name=='phaseBeginStart') return true; - var type=get.type(event.card); - return type=='basic'||type=='trick'; + silent: true, + firstDo: true, + filter: function (event, player, name) { + if (name == "phaseBeginStart") return true; + var type = get.type(event.card); + return type == "basic" || type == "trick"; }, - content:function(){ - if(event.triggername=='phaseBeginStart'){ + content: function () { + if (event.triggername == "phaseBeginStart") { delete player.storage.suijiyingbian; delete player.storage.suijiyingbian_nature; - } - else{ - player.storage.suijiyingbian=trigger.card.name; - player.storage.suijiyingbian_nature=trigger.card.nature; + } else { + player.storage.suijiyingbian = trigger.card.name; + player.storage.suijiyingbian_nature = trigger.card.nature; } }, }, - wuxinghelingshan_skill:{ - equipSkill:true, - trigger:{player:'useCard1'}, - filter:function(event,player){ - return (event.card.name=='sha'&&lib.linked.some(n=>n!='kami'&&game.hasNature(event.card,n))); + wuxinghelingshan_skill: { + equipSkill: true, + trigger: { player: "useCard1" }, + filter: function (event, player) { + return ( + event.card.name == "sha" && + lib.linked.some((n) => n != "kami" && game.hasNature(event.card, n)) + ); }, - audio:true, - direct:true, - content:function(){ - 'step 0' - var list=lib.linked.slice(0); - list.remove('kami'); + audio: true, + direct: true, + content: function () { + "step 0"; + var list = lib.linked.slice(0); + list.remove("kami"); list.removeArray(get.natureList(trigger.card)); - list.push('cancel2'); - player.chooseControl(list).set('prompt',get.prompt('wuxinghelingshan_skill')).set('prompt2','将'+get.translation(trigger.card)+'转换为以下属性之一'); - 'step 1' - if(result.control!='cancel2'){ - player.logSkill('wuxinghelingshan_skill'); - player.popup(get.translation(result.control)+'杀',result.control); - game.log(trigger.card,'被转为了','#y'+get.translation(result.control),'属性'); - game.setNature(trigger.card,result.control); + list.push("cancel2"); + player + .chooseControl(list) + .set("prompt", get.prompt("wuxinghelingshan_skill")) + .set("prompt2", "将" + get.translation(trigger.card) + "转换为以下属性之一"); + "step 1"; + if (result.control != "cancel2") { + player.logSkill("wuxinghelingshan_skill"); + player.popup(get.translation(result.control) + "杀", result.control); + game.log(trigger.card, "被转为了", "#y" + get.translation(result.control), "属性"); + game.setNature(trigger.card, result.control); } - } - }, - wutiesuolian_skill:{ - trigger:{player:'useCardToPlayered'}, - forced:true, - equipSkill:true, - audio:true, - filter:function(event,player){ - return event.card.name=='sha'&&!event.target.isLinked();//||event.target.countCards('h')); }, - logTarget:'target', - content:function(){ - var target=trigger.target; - if(!target.isLinked()) target.link(); + }, + wutiesuolian_skill: { + trigger: { player: "useCardToPlayered" }, + forced: true, + equipSkill: true, + audio: true, + filter: function (event, player) { + return event.card.name == "sha" && !event.target.isLinked(); //||event.target.countCards('h')); + }, + logTarget: "target", + content: function () { + var target = trigger.target; + if (!target.isLinked()) target.link(); //else player.viewHandcards(target); }, }, - heiguangkai_skill:{ - equipSkill:true, - trigger:{target:'useCardToTargeted'}, - forced:true, - audio:true, - filter:function(event,player){ - if(event.targets.length<2) return false; - if(event.card.name!='sha'){ - var type=get.type(event.card); - if(type!='trick') return false; - if(get.color(event.card)!='black'&&!get.tag(event.card,'damage')) return false; + heiguangkai_skill: { + equipSkill: true, + trigger: { target: "useCardToTargeted" }, + forced: true, + audio: true, + filter: function (event, player) { + if (event.targets.length < 2) return false; + if (event.card.name != "sha") { + var type = get.type(event.card); + if (type != "trick") return false; + if (get.color(event.card) != "black" && !get.tag(event.card, "damage")) return false; } - if(player.hasSkillTag('unequip2')) return false; - if(event.player.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; + if (player.hasSkillTag("unequip2")) return false; + if ( + event.player.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; return true; }, - content:function(){ + content: function () { trigger.excluded.add(player); }, - global:'heiguangkai_ai', + global: "heiguangkai_ai", }, - tongque_skill:{ - trigger:{player:'yingbian'}, - equipSkill:true, - forced:true, - filter:(event,player)=>get.is.yingbianConditional(event.card)&&player.getHistory('useCard',evt=>get.is.yingbianConditional(evt.card)).length<2, - content:()=>{ - trigger.forceYingbian=true; - } - }, - tianjitu_skill:{ - audio:true, - trigger:{player:'equipAfter'}, - forced:true, - equipSkill:true, - filter:(event,player)=>event.card.name=='tianjitu'&&player.hasCard(card=>card!=event.card,'he'), - content:()=>{ - player.chooseToDiscard(true,card=>card!=_status.event.getTrigger().card,'he'); + tongque_skill: { + trigger: { player: "yingbian" }, + equipSkill: true, + forced: true, + filter: (event, player) => + get.is.yingbianConditional(event.card) && + player.getHistory("useCard", (evt) => get.is.yingbianConditional(evt.card)).length < 2, + content: () => { + trigger.forceYingbian = true; }, - subSkill:{ - lose:{ - audio:'tianjitu_skill', - forced:true, - charlotte:true, - equipSkill:true, - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], + }, + tianjitu_skill: { + audio: true, + trigger: { player: "equipAfter" }, + forced: true, + equipSkill: true, + filter: (event, player) => + event.card.name == "tianjitu" && player.hasCard((card) => card != event.card, "he"), + content: () => { + player.chooseToDiscard(true, (card) => card != _status.event.getTrigger().card, "he"); + }, + subSkill: { + lose: { + audio: "tianjitu_skill", + forced: true, + charlotte: true, + equipSkill: true, + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], }, - filter:(event,player)=>{ - if(player.countCards('h')>=5) return false; - var evt=event.getl(player); - return evt&&evt.es.some(card=>card.name=='tianjitu') + filter: (event, player) => { + if (player.countCards("h") >= 5) return false; + var evt = event.getl(player); + return evt && evt.es.some((card) => card.name == "tianjitu"); }, - content:function(){ + content: function () { player.drawTo(5); }, }, }, }, - taigongyinfu_skill:{ - equipSkill:true, - audio:true, - trigger:{player:'phaseUseEnd'}, - direct:true, - filter:function(event,player){ - return player.countCards('h')>0; + taigongyinfu_skill: { + equipSkill: true, + audio: true, + trigger: { player: "phaseUseEnd" }, + direct: true, + filter: function (event, player) { + return player.countCards("h") > 0; }, - content:function(){ - 'step 0' - player.chooseCard('h','是否发动【太公阴符】重铸一张手牌?',lib.filter.cardRecastable).set('ai',function(card){ - return 5-get.value(card); - }); - 'step 1' - if(result.bool){ - player.logSkill('taigongyinfu_skill'); + content: function () { + "step 0"; + player + .chooseCard("h", "是否发动【太公阴符】重铸一张手牌?", lib.filter.cardRecastable) + .set("ai", function (card) { + return 5 - get.value(card); + }); + "step 1"; + if (result.bool) { + player.logSkill("taigongyinfu_skill"); player.recast(result.cards); } }, }, - taigongyinfu_link:{ - audio:'taigongyinfu_skill', - trigger:{player:'phaseUseBegin'}, - equipSkill:true, + taigongyinfu_link: { + audio: "taigongyinfu_skill", + trigger: { player: "phaseUseBegin" }, + equipSkill: true, //filter:function(event,player){ // return game.hasPlayer(function(current){ // return !current.isLinked(); // }); //}, - direct:true, - content:function(){ - 'step 0' - player.chooseTarget( - //function(card,player,target){ - // return !target.isLinked(); - //}, - '是否发动【太公阴符】横置或重置一名角色?').set('ai',function(target){ - return get.effect(target,{name:'tiesuo'},_status.event.player,_status.event.player); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('taigongyinfu_link',target); + direct: true, + content: function () { + "step 0"; + player + .chooseTarget( + //function(card,player,target){ + // return !target.isLinked(); + //}, + "是否发动【太公阴符】横置或重置一名角色?" + ) + .set("ai", function (target) { + return get.effect( + target, + { name: "tiesuo" }, + _status.event.player, + _status.event.player + ); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("taigongyinfu_link", target); target.link(); } }, - ai:{ - expose:0.2, + ai: { + expose: 0.2, }, }, - _yingbian:{ - trigger:{player:'yingbian'}, - forced:true, - popup:false, - ruleSkill:true, - forceLoad:true, - filter:(event,player)=>{ - if(event.card.yingbian) return false; - const temporaryYingbian=event.temporaryYingbian||[],card=event.card; - if(temporaryYingbian.includes('force')||get.cardtag(card,'yingbian_force')) return true; - const forceYingbian=event.forceYingbian||player.hasSkillTag('forceYingbian'); - for(const entry of lib.yingbian.condition.simple){ - const key=entry[0]; - if((temporaryYingbian.includes(key)||get.cardtag(card,`yingbian_${key}`))&&(forceYingbian||entry[1](event))) return true; + _yingbian: { + trigger: { player: "yingbian" }, + forced: true, + popup: false, + ruleSkill: true, + forceLoad: true, + filter: (event, player) => { + if (event.card.yingbian) return false; + const temporaryYingbian = event.temporaryYingbian || [], + card = event.card; + if (temporaryYingbian.includes("force") || get.cardtag(card, "yingbian_force")) + return true; + const forceYingbian = event.forceYingbian || player.hasSkillTag("forceYingbian"); + for (const entry of lib.yingbian.condition.simple) { + const key = entry[0]; + if ( + (temporaryYingbian.includes(key) || get.cardtag(card, `yingbian_${key}`)) && + (forceYingbian || entry[1](event)) + ) + return true; } - const complexYingbianConditions=get.complexYingbianConditions(); - return temporaryYingbian.some(value=>complexYingbianConditions.includes(value))||get.is.complexlyYingbianConditional(card); + const complexYingbianConditions = get.complexYingbianConditions(); + return ( + temporaryYingbian.some((value) => complexYingbianConditions.includes(value)) || + get.is.complexlyYingbianConditional(card) + ); }, - content:()=>{ - 'step 0' - event.card=trigger.card; - event.temporaryYingbian=trigger.temporaryYingbian||[]; - var yingbianConditionSatisfied=false; - lib.yingbian.condition.simple.forEach((value,key)=>{ - if(!event.temporaryYingbian.includes(key)&&!get.cardtag(event.card,`yingbian_${key}`)||!value(trigger)) return; - player.popup(`yingbian_${key}_tag`,lib.yingbian.condition.color.get(key)); - if(!yingbianConditionSatisfied) yingbianConditionSatisfied=true; + content: () => { + "step 0"; + event.card = trigger.card; + event.temporaryYingbian = trigger.temporaryYingbian || []; + var yingbianConditionSatisfied = false; + lib.yingbian.condition.simple.forEach((value, key) => { + if ( + (!event.temporaryYingbian.includes(key) && + !get.cardtag(event.card, `yingbian_${key}`)) || + !value(trigger) + ) + return; + player.popup(`yingbian_${key}_tag`, lib.yingbian.condition.color.get(key)); + if (!yingbianConditionSatisfied) yingbianConditionSatisfied = true; }); - if(event.temporaryYingbian.includes('force')||get.cardtag(event.card,'yingbian_force')||trigger.forceYingbian||player.hasSkillTag('forceYingbian')){ - player.popup('yingbian_force_tag',lib.yingbian.condition.color.get('force')); - if(!yingbianConditionSatisfied) yingbianConditionSatisfied=true; + if ( + event.temporaryYingbian.includes("force") || + get.cardtag(event.card, "yingbian_force") || + trigger.forceYingbian || + player.hasSkillTag("forceYingbian") + ) { + player.popup("yingbian_force_tag", lib.yingbian.condition.color.get("force")); + if (!yingbianConditionSatisfied) yingbianConditionSatisfied = true; } - if(yingbianConditionSatisfied){ - game.log(player,'触发了',event.card,'的应变条件'); + if (yingbianConditionSatisfied) { + game.log(player, "触发了", event.card, "的应变条件"); event.goto(4); - } - else if((event.num=0)>=(event.yingbianConditions=get.complexYingbianConditions()).length) event.finish(); - 'step 1' - var yingbianCondition=event.yingbianConditions[num]; - if(event.temporaryYingbian.includes(yingbianCondition)||get.cardtag(card,`yingbian_${yingbianCondition}`)) lib.yingbian.condition.complex.get(yingbianCondition)(trigger); + } else if ( + (event.num = 0) >= (event.yingbianConditions = get.complexYingbianConditions()).length + ) + event.finish(); + "step 1"; + var yingbianCondition = event.yingbianConditions[num]; + if ( + event.temporaryYingbian.includes(yingbianCondition) || + get.cardtag(card, `yingbian_${yingbianCondition}`) + ) + lib.yingbian.condition.complex.get(yingbianCondition)(trigger); else event.goto(3); - 'step 2' - if(result.bool) event.goto(4); - 'step 3' + "step 2"; + if (result.bool) event.goto(4); + "step 3"; event.num++; - if(event.num{ - if(!event.temporaryYingbian.includes(key)&&!get.cardtag(card,`yingbian_${key}`)) return; - game.yingbianEffect(trigger,value); - if(!yingbianEffectExecuted) yingbianEffectExecuted=true; + "step 4"; + trigger.card.yingbian = true; + var yingbianEffectExecuted = false; + lib.yingbian.effect.forEach((value, key) => { + if (!event.temporaryYingbian.includes(key) && !get.cardtag(card, `yingbian_${key}`)) + return; + game.yingbianEffect(trigger, value); + if (!yingbianEffectExecuted) yingbianEffectExecuted = true; }); - if(!yingbianEffectExecuted){ - var defaultYingbianEffect=get.defaultYingbianEffect(card); - if(lib.yingbian.effect.has(defaultYingbianEffect)){ - game.yingbianEffect(trigger,lib.yingbian.effect.get(defaultYingbianEffect)); - if(!yingbianEffectExecuted) yingbianEffectExecuted=true; + if (!yingbianEffectExecuted) { + var defaultYingbianEffect = get.defaultYingbianEffect(card); + if (lib.yingbian.effect.has(defaultYingbianEffect)) { + game.yingbianEffect(trigger, lib.yingbian.effect.get(defaultYingbianEffect)); + if (!yingbianEffectExecuted) yingbianEffectExecuted = true; } } - if(yingbianEffectExecuted) player.addTempSkill('yingbian_changeTarget'); - } + if (yingbianEffectExecuted) player.addTempSkill("yingbian_changeTarget"); + }, }, - yingbian_changeTarget:{ - trigger:{player:'useCard2'}, - forced:true, - popup:false, - charlotte:true, - filter:function(event,player){ - if(event.yingbian_removeTarget&&event.targets&&event.targets.length>1) return true; - if(!event.yingbian_addTarget) return false; - var info=get.info(event.card); - if(info.allowMultiple==false) return false; - if(event.targets&&!info.multitarget){ - if(game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); - })){ + yingbian_changeTarget: { + trigger: { player: "useCard2" }, + forced: true, + popup: false, + charlotte: true, + filter: function (event, player) { + if (event.yingbian_removeTarget && event.targets && event.targets.length > 1) return true; + if (!event.yingbian_addTarget) return false; + var info = get.info(event.card); + if (info.allowMultiple == false) return false; + if (event.targets && !info.multitarget) { + if ( + game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(event.card, player, current) && + lib.filter.targetInRange(event.card, player, current) + ); + }) + ) { return true; } } return false; }, - content:function(){ - 'step 0' - if(trigger.yingbian_addTarget) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'增加一个目标?',function(card,player,target){ - var trigger=_status.event.getTrigger(); - var card=trigger.card; - return !trigger.targets.includes(target)&&lib.filter.targetEnabled2(card,player,target)&&lib.filter.targetInRange(card,player,target); - }).set('ai',function(target){ - var player=_status.event.player; - var card=_status.event.getTrigger().card; - return get.effect(target,card,player,player); - }); + content: function () { + "step 0"; + if (trigger.yingbian_addTarget) + player + .chooseTarget( + "应变:是否为" + get.translation(trigger.card) + "增加一个目标?", + function (card, player, target) { + var trigger = _status.event.getTrigger(); + var card = trigger.card; + return ( + !trigger.targets.includes(target) && + lib.filter.targetEnabled2(card, player, target) && + lib.filter.targetInRange(card, player, target) + ); + } + ) + .set("ai", function (target) { + var player = _status.event.player; + var card = _status.event.getTrigger().card; + return get.effect(target, card, player, player); + }); else event.goto(2); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - game.log(player,'发动应变效果,令',target,'也成为了',trigger.card,'的目标'); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + game.log(player, "发动应变效果,令", target, "也成为了", trigger.card, "的目标"); trigger.targets.add(target); } - 'step 2' - if(trigger.yingbian_removeTarget&&trigger.targets.length>1) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'减少一个目标?',function(card,player,target){ - var trigger=_status.event.getTrigger(); - return trigger.targets.includes(target); - }).set('ai',function(target){ - var player=_status.event.player; - var card=_status.event.getTrigger().card; - return -get.effect(target,card,player,player); - }); + "step 2"; + if (trigger.yingbian_removeTarget && trigger.targets.length > 1) + player + .chooseTarget( + "应变:是否为" + get.translation(trigger.card) + "减少一个目标?", + function (card, player, target) { + var trigger = _status.event.getTrigger(); + return trigger.targets.includes(target); + } + ) + .set("ai", function (target) { + var player = _status.event.player; + var card = _status.event.getTrigger().card; + return -get.effect(target, card, player, player); + }); else event.finish(); - 'step 3' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - game.log(player,'发动应变效果,将',target,'从',trigger.card,'的目标中移除了'); + "step 3"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + game.log(player, "发动应变效果,将", target, "从", trigger.card, "的目标中移除了"); trigger.targets.remove(target); } }, }, - heiguangkai_ai:{ - ai:{ - effect:{ - player:function(card,player,target){ - if(typeof card!=='object'||!target||get.name(card)!=='sha'&&(get.type(card)!=='trick'||get.color(card)!=='black'&&!get.tag(card,'damage'))) return; - if(!target.hasSkill('heiguangkai_skill')||target.hasSkillTag('unequip2')||player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card, - })||player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card, - })) return; - let targets=[],evt=_status.event.getParent('useCard'); + heiguangkai_ai: { + ai: { + effect: { + player: function (card, player, target) { + if ( + typeof card !== "object" || + !target || + (get.name(card) !== "sha" && + (get.type(card) !== "trick" || + (get.color(card) !== "black" && !get.tag(card, "damage")))) + ) + return; + if ( + !target.hasSkill("heiguangkai_skill") || + target.hasSkillTag("unequip2") || + player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) || + player.hasSkillTag("unequip_ai", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) + return; + let targets = [], + evt = _status.event.getParent("useCard"); targets.addArray(ui.selected.targets); - if(evt&&evt.card==card) targets.addArray(evt.targets); - if(targets.length){ - if(targets.length>1||!targets.includes(target)) return 'zeroplayertarget'; + if (evt && evt.card == card) targets.addArray(evt.targets); + if (targets.length) { + if (targets.length > 1 || !targets.includes(target)) + return "zeroplayertarget"; return; } - let info=get.info(card); - if(!info||info.notarget||!info.filterTarget) return; - let range,select=get.copy(info.selectTarget),filter; - if(select===undefined) range=[1,1]; - else if(typeof select==='number') range=[select,select]; - else if(get.itemtype(select)==='select') range=select; - else if(typeof select==='function') range=select(card,player); - if(info.singleCard) range=[1,1]; - game.checkMod(card,player,range,'selectTarget',player); - if(range[1]<-1) range=[1, 1]; - else if(range[0]<0){ - if(info.filterTarget===true) filter=game.players.length; - else filter=game.countPlayer(current=>{ - return info.filterTarget(card,player,current); - }); - range=[filter,filter]; + let info = get.info(card); + if (!info || info.notarget || !info.filterTarget) return; + let range, + select = get.copy(info.selectTarget), + filter; + if (select === undefined) range = [1, 1]; + else if (typeof select === "number") range = [select, select]; + else if (get.itemtype(select) === "select") range = select; + else if (typeof select === "function") range = select(card, player); + if (info.singleCard) range = [1, 1]; + game.checkMod(card, player, range, "selectTarget", player); + if (range[1] < -1) range = [1, 1]; + else if (range[0] < 0) { + if (info.filterTarget === true) filter = game.players.length; + else + filter = game.countPlayer((current) => { + return info.filterTarget(card, player, current); + }); + range = [filter, filter]; } - if(!range) return; - if(range[0]>1&&range[1]>1) return 'zeroplayertarget'; - return [1,0,0.7,0]; + if (!range) return; + if (range[0] > 1 && range[1] > 1) return "zeroplayertarget"; + return [1, 0, 0.7, 0]; }, }, }, }, }, - translate:{ - suijiyingbian:'随机应变', - suijiyingbian_info:'此牌的牌名视为你本回合内使用或打出的上一张基本牌或普通锦囊牌的牌名。', - zhujinqiyuan:'逐近弃远', - zhujinqiyuan_info:'出牌阶段,对一名有牌的其他角色使用。若你至其距离的大于1,你弃置其区域内的一张牌。若你至其的距离等于1,你获得其区域内的一张牌。', - dongzhuxianji:'洞烛先机', - dongzhuxianji_info:'出牌阶段,对包含你在内的一名角色使用。目标角色卜算2,然后摸两张牌。', - chuqibuyi:'出其不意', - chuqibuyi_info:'出牌阶段,对一名有手牌的其他角色使用。你展示其一张手牌,若此牌与【出其不意】的花色不同,则你对其造成1点伤害。', - wuxinghelingshan:'五行鹤翎扇', - wuxinghelingshan_skill:'五行鹤翎扇', - wuxinghelingshan_info:'当你声明使用不为神属性的属性【杀】后,你可将此【杀】的属性改为不为神属性的其他属性。', - wutiesuolian:'乌铁锁链', - wutiesuolian_skill:'乌铁锁链', - wutiesuolian_info:'锁定技,当你使用【杀】指定目标后,若其未横置,则其横置。', - heiguangkai:'黑光铠', - heiguangkai_skill:'黑光铠', - heiguangkai_info:'锁定技,当你成为【杀】或伤害类锦囊牌或黑色普通锦囊牌的目标后,若此牌的目标数大于1,则你令此牌对你无效。', - tongque:'铜雀', - tongque_skill:'铜雀', - tongque_info:'锁定技,你于一回合内使用的第一张带有“应变”效果的牌无视条件直接生效。', - tianjitu:'天机图', - tianjitu_skill:'天机图', - tianjitu_info:'锁定技,当此牌进入你的装备区时,你弃置一张不为此【天机图】的牌。当此牌离开你的装备区时,你将手牌摸至五张。', - taigongyinfu:'太公阴符', - taigongyinfu_info:'出牌阶段开始时,你可以横置或重置一名角色。出牌阶段结束时,你可以重铸一张手牌。', - taigongyinfu_skill:'太公阴符', - taigongyinfu_link:'太公阴符', - yingbian_zhuzhan_tag:'助战', - yingbian_kongchao_tag:'空巢', - yingbian_fujia_tag:'富甲', - yingbian_canqu_tag:'残躯', - yingbian_force_tag:'应变', - _yingbian:'应变', - yingbian_changeTarget:'应变', - yingbian_add_tag:'(目标+)', - yingbian_remove_tag:'(目标-)', - yingbian_damage_tag:'(伤害+)', - yingbian_draw_tag:'(摸牌)', - yingbian_gain_tag:'(反甲)', - yingbian_hit_tag:'(强命)', - yingbian_all_tag:'(双项)' + translate: { + suijiyingbian: "随机应变", + suijiyingbian_info: "此牌的牌名视为你本回合内使用或打出的上一张基本牌或普通锦囊牌的牌名。", + zhujinqiyuan: "逐近弃远", + zhujinqiyuan_info: + "出牌阶段,对一名有牌的其他角色使用。若你至其距离的大于1,你弃置其区域内的一张牌。若你至其的距离等于1,你获得其区域内的一张牌。", + dongzhuxianji: "洞烛先机", + dongzhuxianji_info: "出牌阶段,对包含你在内的一名角色使用。目标角色卜算2,然后摸两张牌。", + chuqibuyi: "出其不意", + chuqibuyi_info: + "出牌阶段,对一名有手牌的其他角色使用。你展示其一张手牌,若此牌与【出其不意】的花色不同,则你对其造成1点伤害。", + wuxinghelingshan: "五行鹤翎扇", + wuxinghelingshan_skill: "五行鹤翎扇", + wuxinghelingshan_info: + "当你声明使用不为神属性的属性【杀】后,你可将此【杀】的属性改为不为神属性的其他属性。", + wutiesuolian: "乌铁锁链", + wutiesuolian_skill: "乌铁锁链", + wutiesuolian_info: "锁定技,当你使用【杀】指定目标后,若其未横置,则其横置。", + heiguangkai: "黑光铠", + heiguangkai_skill: "黑光铠", + heiguangkai_info: + "锁定技,当你成为【杀】或伤害类锦囊牌或黑色普通锦囊牌的目标后,若此牌的目标数大于1,则你令此牌对你无效。", + tongque: "铜雀", + tongque_skill: "铜雀", + tongque_info: "锁定技,你于一回合内使用的第一张带有“应变”效果的牌无视条件直接生效。", + tianjitu: "天机图", + tianjitu_skill: "天机图", + tianjitu_info: + "锁定技,当此牌进入你的装备区时,你弃置一张不为此【天机图】的牌。当此牌离开你的装备区时,你将手牌摸至五张。", + taigongyinfu: "太公阴符", + taigongyinfu_info: + "出牌阶段开始时,你可以横置或重置一名角色。出牌阶段结束时,你可以重铸一张手牌。", + taigongyinfu_skill: "太公阴符", + taigongyinfu_link: "太公阴符", + yingbian_zhuzhan_tag: "助战", + yingbian_kongchao_tag: "空巢", + yingbian_fujia_tag: "富甲", + yingbian_canqu_tag: "残躯", + yingbian_force_tag: "应变", + _yingbian: "应变", + yingbian_changeTarget: "应变", + yingbian_add_tag: "(目标+)", + yingbian_remove_tag: "(目标-)", + yingbian_damage_tag: "(伤害+)", + yingbian_draw_tag: "(摸牌)", + yingbian_gain_tag: "(反甲)", + yingbian_hit_tag: "(强命)", + yingbian_all_tag: "(双项)", }, - list:[ - ['spade',1,'juedou'], - ['spade',1,'taigongyinfu'], - ['spade',1,'guding'], - ['spade',2,'cixiong'], - ['spade',2,'bagua'], - ['spade',2,'tengjia'], - ['spade',2,'suijiyingbian'], - ['spade',3,'jiu'], - ['spade',3,'zhujinqiyuan'], - ['spade',3,'shuiyanqijunx',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',4,'sha','thunder'], - ['spade',4,'guohe'], - ['spade',4,'shuiyanqijunx',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',5,'sha','thunder'], - ['spade',5,'qinglong'], - ['spade',5,'jueying'], - ['spade',6,'sha','thunder'], - ['spade',6,'lebu'], - ['spade',6,'qinggang'], - ['spade',7,'sha','ice'], - ['spade',7,'sha','ice'], - ['spade',7,'nanman',null,['yingbian_fujia','yingbian_remove']], - ['spade',8,'sha','ice'], - ['spade',8,'sha','ice'], - ['spade',8,'sha','ice'], - ['spade',9,'sha',null,['yingbian_canqu','yingbian_add']], - ['spade',9,'sha',null,['yingbian_canqu','yingbian_add']], - ['spade',9,'jiu'], - ['spade',10,'sha'], - ['spade',10,'sha',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',10,'bingliang'], - ['spade',11,'wuxie'], - ['spade',11,'shunshou'], - ['spade',11,'tiesuo'], - ['spade',12,'zhujinqiyuan',null,['yingbian_fujia','yingbian_hit']], - ['spade',12,'tiesuo'], - ['spade',12,'zhangba'], - ['spade',13,'wuxie',null,['yingbian_kongchao','yingbian_draw']], - ['spade',13,'nanman',null,['yingbian_fujia','yingbian_remove']], - ['spade',13,'dawan'], + list: [ + ["spade", 1, "juedou"], + ["spade", 1, "taigongyinfu"], + ["spade", 1, "guding"], + ["spade", 2, "cixiong"], + ["spade", 2, "bagua"], + ["spade", 2, "tengjia"], + ["spade", 2, "suijiyingbian"], + ["spade", 3, "jiu"], + ["spade", 3, "zhujinqiyuan"], + ["spade", 3, "shuiyanqijunx", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 4, "sha", "thunder"], + ["spade", 4, "guohe"], + ["spade", 4, "shuiyanqijunx", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 5, "sha", "thunder"], + ["spade", 5, "qinglong"], + ["spade", 5, "jueying"], + ["spade", 6, "sha", "thunder"], + ["spade", 6, "lebu"], + ["spade", 6, "qinggang"], + ["spade", 7, "sha", "ice"], + ["spade", 7, "sha", "ice"], + ["spade", 7, "nanman", null, ["yingbian_fujia", "yingbian_remove"]], + ["spade", 8, "sha", "ice"], + ["spade", 8, "sha", "ice"], + ["spade", 8, "sha", "ice"], + ["spade", 9, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["spade", 9, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["spade", 9, "jiu"], + ["spade", 10, "sha"], + ["spade", 10, "sha", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 10, "bingliang"], + ["spade", 11, "wuxie"], + ["spade", 11, "shunshou"], + ["spade", 11, "tiesuo"], + ["spade", 12, "zhujinqiyuan", null, ["yingbian_fujia", "yingbian_hit"]], + ["spade", 12, "tiesuo"], + ["spade", 12, "zhangba"], + ["spade", 13, "wuxie", null, ["yingbian_kongchao", "yingbian_draw"]], + ["spade", 13, "nanman", null, ["yingbian_fujia", "yingbian_remove"]], + ["spade", 13, "dawan"], - ['heart',1,'taoyuan',null,['yingbian_fujia','yingbian_remove']], - ['heart',1,'wanjian',null,['yingbian_fujia','yingbian_remove']], - ['heart',1,'wuxie'], - ['heart',2,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['heart',2,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['heart',2,'guohe',null,['yingbian_zhuzhan','yingbian_add']], - ['heart',3,'wugu'], - ['heart',3,'tao'], - ['heart',3,'chuqibuyi'], - ['heart',4,'sha','fire'], - ['heart',4,'tao'], - ['heart',4,'wugu'], - ['heart',5,'chitu'], - ['heart',5,'tao'], - ['heart',5,'qilin'], - ['heart',6,'tao'], - ['heart',6,'tao'], - ['heart',6,'lebu'], - ['heart',7,'sha','fire'], - ['heart',7,'tao'], - ['heart',7,'dongzhuxianji'], - ['heart',8,'tao'], - ['heart',8,'shan'], - ['heart',8,'dongzhuxianji'], - ['heart',9,'tao'], - ['heart',9,'shan'], - ['heart',9,'dongzhuxianji'], - ['heart',10,'sha','fire',['yingbian_kongchao','yingbian_damage']], - ['heart',10,'sha'], - ['heart',10,'sha'], - ['heart',11,'sha'], - ['heart',11,'shan'], - ['heart',11,'dongzhuxianji'], - ['heart',12,'tao'], - ['heart',12,'shan'], - ['heart',12,'guohe'], - ['heart',12,'shandian'], - ['heart',13,'wuxie',null,['yingbian_kongchao','yingbian_gain']], - ['heart',13,'shan'], - ['heart',13,'zhuahuang'], + ["heart", 1, "taoyuan", null, ["yingbian_fujia", "yingbian_remove"]], + ["heart", 1, "wanjian", null, ["yingbian_fujia", "yingbian_remove"]], + ["heart", 1, "wuxie"], + ["heart", 2, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["heart", 2, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["heart", 2, "guohe", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["heart", 3, "wugu"], + ["heart", 3, "tao"], + ["heart", 3, "chuqibuyi"], + ["heart", 4, "sha", "fire"], + ["heart", 4, "tao"], + ["heart", 4, "wugu"], + ["heart", 5, "chitu"], + ["heart", 5, "tao"], + ["heart", 5, "qilin"], + ["heart", 6, "tao"], + ["heart", 6, "tao"], + ["heart", 6, "lebu"], + ["heart", 7, "sha", "fire"], + ["heart", 7, "tao"], + ["heart", 7, "dongzhuxianji"], + ["heart", 8, "tao"], + ["heart", 8, "shan"], + ["heart", 8, "dongzhuxianji"], + ["heart", 9, "tao"], + ["heart", 9, "shan"], + ["heart", 9, "dongzhuxianji"], + ["heart", 10, "sha", "fire", ["yingbian_kongchao", "yingbian_damage"]], + ["heart", 10, "sha"], + ["heart", 10, "sha"], + ["heart", 11, "sha"], + ["heart", 11, "shan"], + ["heart", 11, "dongzhuxianji"], + ["heart", 12, "tao"], + ["heart", 12, "shan"], + ["heart", 12, "guohe"], + ["heart", 12, "shandian"], + ["heart", 13, "wuxie", null, ["yingbian_kongchao", "yingbian_gain"]], + ["heart", 13, "shan"], + ["heart", 13, "zhuahuang"], - ['club',1,'juedou'], - ['club',1,'zhuge'], - ['club',1,'huxinjing'], - ['club',2,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',2,'heiguangkai'], - ['club',2,'tengjia'], - ['club',2,'renwang'], - ['club',3,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',3,'jiu'], - ['club',3,'zhujinqiyuan',null,['yingbian_zhuzhan','yingbian_add']], - ['club',4,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',4,'bingliang'], - ['club',4,'zhujinqiyuan',null,['yingbian_zhuzhan','yingbian_add']], - ['club',5,'sha'], - ['club',5,'sha','thunder'], - ['club',5,'dilu'], - ['club',6,'sha'], - ['club',6,'sha','thunder'], - ['club',6,'lebu'], - ['club',7,'sha'], - ['club',7,'sha','thunder'], - ['club',7,'nanman',null,['yingbian_fujia','yingbian_remove']], - ['club',8,'sha'], - ['club',8,'sha','thunder'], - ['club',8,'sha'], - ['club',9,'sha','thunder'], - ['club',9,'sha','thunder'], - ['club',9,'jiu'], - ['club',10,'sha','thunder'], - ['club',10,'sha','thunder'], - ['club',10,'tiesuo'], - ['club',11,'sha'], - ['club',11,'sha',null,['yingbian_canqu','yingbian_add']], - ['club',11,'tiesuo'], - ['club',12,'wuxie'], - ['club',12,'tianjitu'], - ['club',12,'tiesuo'], - ['club',13,'wuxie',null,['yingbian_canqu','yingbian_draw']], - ['club',13,'tongque'], - ['club',13,'tiesuo'], + ["club", 1, "juedou"], + ["club", 1, "zhuge"], + ["club", 1, "huxinjing"], + ["club", 2, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 2, "heiguangkai"], + ["club", 2, "tengjia"], + ["club", 2, "renwang"], + ["club", 3, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 3, "jiu"], + ["club", 3, "zhujinqiyuan", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["club", 4, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 4, "bingliang"], + ["club", 4, "zhujinqiyuan", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["club", 5, "sha"], + ["club", 5, "sha", "thunder"], + ["club", 5, "dilu"], + ["club", 6, "sha"], + ["club", 6, "sha", "thunder"], + ["club", 6, "lebu"], + ["club", 7, "sha"], + ["club", 7, "sha", "thunder"], + ["club", 7, "nanman", null, ["yingbian_fujia", "yingbian_remove"]], + ["club", 8, "sha"], + ["club", 8, "sha", "thunder"], + ["club", 8, "sha"], + ["club", 9, "sha", "thunder"], + ["club", 9, "sha", "thunder"], + ["club", 9, "jiu"], + ["club", 10, "sha", "thunder"], + ["club", 10, "sha", "thunder"], + ["club", 10, "tiesuo"], + ["club", 11, "sha"], + ["club", 11, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["club", 11, "tiesuo"], + ["club", 12, "wuxie"], + ["club", 12, "tianjitu"], + ["club", 12, "tiesuo"], + ["club", 13, "wuxie", null, ["yingbian_canqu", "yingbian_draw"]], + ["club", 13, "tongque"], + ["club", 13, "tiesuo"], - ['diamond',1,'juedou'], - ['diamond',1,'zhuge'], - ['diamond',1,'wuxinghelingshan'], - ['diamond',2,'tao'], - ['diamond',2,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',2,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',3,'tao'], - ['diamond',3,'shan'], - ['diamond',3,'shunshou'], - ['diamond',4,'sha','fire',['yingbian_kongchao','yingbian_damage']], - ['diamond',4,'shan',null,['yingbian_canqu','yingbian_gain']], - ['diamond',4,'shunshou'], - ['diamond',5,'sha','fire'], - ['diamond',5,'shan'], - ['diamond',5,'guanshi'], - ['diamond',6,'sha'], - ['diamond',6,'shan'], - ['diamond',6,'shan'], - ['diamond',7,'sha'], - ['diamond',7,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'sha',null,['yingbian_canqu','yingbian_hit']], - ['diamond',8,'shan'], - ['diamond',8,'shan'], - ['diamond',9,'sha'], - ['diamond',9,'shan'], - ['diamond',9,'jiu'], - ['diamond',10,'sha','fire'], - ['diamond',10,'shan'], - ['diamond',10,'shan'], - ['diamond',11,'shan'], - ['diamond',11,'shan'], - ['diamond',11,'shan'], - ['diamond',12,'tao'], - ['diamond',12,'chuqibuyi'], - ['diamond',12,'wutiesuolian'], - ['diamond',12,'wuxie'], - ['diamond',13,'sha'], - ['diamond',13,'zixin'], - ['diamond',13,'hualiu'], + ["diamond", 1, "juedou"], + ["diamond", 1, "zhuge"], + ["diamond", 1, "wuxinghelingshan"], + ["diamond", 2, "tao"], + ["diamond", 2, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 2, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 3, "tao"], + ["diamond", 3, "shan"], + ["diamond", 3, "shunshou"], + ["diamond", 4, "sha", "fire", ["yingbian_kongchao", "yingbian_damage"]], + ["diamond", 4, "shan", null, ["yingbian_canqu", "yingbian_gain"]], + ["diamond", 4, "shunshou"], + ["diamond", 5, "sha", "fire"], + ["diamond", 5, "shan"], + ["diamond", 5, "guanshi"], + ["diamond", 6, "sha"], + ["diamond", 6, "shan"], + ["diamond", 6, "shan"], + ["diamond", 7, "sha"], + ["diamond", 7, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "sha", null, ["yingbian_canqu", "yingbian_hit"]], + ["diamond", 8, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "sha"], + ["diamond", 9, "shan"], + ["diamond", 9, "jiu"], + ["diamond", 10, "sha", "fire"], + ["diamond", 10, "shan"], + ["diamond", 10, "shan"], + ["diamond", 11, "shan"], + ["diamond", 11, "shan"], + ["diamond", 11, "shan"], + ["diamond", 12, "tao"], + ["diamond", 12, "chuqibuyi"], + ["diamond", 12, "wutiesuolian"], + ["diamond", 12, "wuxie"], + ["diamond", 13, "sha"], + ["diamond", 13, "zixin"], + ["diamond", 13, "hualiu"], - ['diamond',5,'muniu'], + ["diamond", 5, "muniu"], ], - help:{ - '应变篇':('
              应变机制
                '+ - '
              • 当一名角色声明使用右下角标注了应变条件的卡牌后,若其满足应变条件,则其触发此牌的“应变”效果。
              • 长按或鼠标右键点击卡牌,即可查看此牌所拥有的应变效果。'+ - '
              • 应变条件
                • 空巢:该角色声明使用此牌后,其手牌数为0。
                • 富甲:该角色声明使用此牌后,其手牌数为全场最多或之一。
                • 残躯:该角色声明使用此牌后,其体力值为1。
                • 助战:该角色声明使用此牌后,其发起“助战”。其他角色可弃置一张与此牌类型相同的卡牌,响应此“助战”。若有角色响应,则视为其应变成功。
              '), + help: { + 应变篇: + '
              应变机制
                ' + + "
              • 当一名角色声明使用右下角标注了应变条件的卡牌后,若其满足应变条件,则其触发此牌的“应变”效果。
              • 长按或鼠标右键点击卡牌,即可查看此牌所拥有的应变效果。" + + '
              • 应变条件
                • 空巢:该角色声明使用此牌后,其手牌数为0。
                • 富甲:该角色声明使用此牌后,其手牌数为全场最多或之一。
                • 残躯:该角色声明使用此牌后,其体力值为1。
                • 助战:该角色声明使用此牌后,其发起“助战”。其他角色可弃置一张与此牌类型相同的卡牌,响应此“助战”。若有角色响应,则视为其应变成功。
              ', }, - } + }; }); diff --git a/card/yongjian.js b/card/yongjian.js index 84c9050cc..bdda92dc4 100644 --- a/card/yongjian.js +++ b/card/yongjian.js @@ -1,798 +1,925 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'yongjian', - connect:true, - card:{ - du:{ - type:'basic', - fullskin:true, - global:['g_du','g_du_give'], - content:function(){}, - ai:{ - value:-5, - useful:6, - result:{ - player:function(player,target){ - if(player.hasSkillTag('usedu')) return 5; + name: "yongjian", + connect: true, + card: { + du: { + type: "basic", + fullskin: true, + global: ["g_du", "g_du_give"], + content: function () {}, + ai: { + value: -5, + useful: 6, + result: { + player: function (player, target) { + if (player.hasSkillTag("usedu")) return 5; return -1; - } + }, }, - order:7.5 + order: 7.5, }, }, - guaguliaodu:{ - type:'trick', - fullskin:true, - enable:true, - filterTarget:function(card,player,target){ + guaguliaodu: { + type: "trick", + fullskin: true, + enable: true, + filterTarget: function (card, player, target) { return target.isDamaged(); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; target.recover(); - 'step 1' - if(target.hasCard(function(card){ - return _status.connectMode||get.name(card,target)=='du'; - },'h')) target.chooseToDiscard('h',{name:'du'},'是否弃置一张【毒】?(不失去体力)').set('ai',()=>1); + "step 1"; + if ( + target.hasCard(function (card) { + return _status.connectMode || get.name(card, target) == "du"; + }, "h") + ) + target + .chooseToDiscard("h", { name: "du" }, "是否弃置一张【毒】?(不失去体力)") + .set("ai", () => 1); }, - ai:{ - order:2, - tag:{ - recover:1, + ai: { + order: 2, + tag: { + recover: 1, + }, + result: { + target: 1.5, }, - result:{ - target:1.5, - } }, }, - chenghuodajie:{ - type:'trick', - fullskin:true, - enable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h')>0; + chenghuodajie: { + type: "trick", + fullskin: true, + enable: true, + filterTarget: function (card, player, target) { + return target != player && target.countCards("h") > 0; }, - content:function(){ - 'step 0' - if(typeof event.baseDamage!='number') event.baseDamage=1; - if(typeof event.extraDamage!='number') event.extraDamage=0; - if(!target.countCards('h')||!player.isIn()) event.finish(); - else player.choosePlayerCard(target,'h',true); - 'step 1' - if(result.bool){ - event.show_card=result.cards[0]; - var str=get.translation(player); + content: function () { + "step 0"; + if (typeof event.baseDamage != "number") event.baseDamage = 1; + if (typeof event.extraDamage != "number") event.extraDamage = 0; + if (!target.countCards("h") || !player.isIn()) event.finish(); + else player.choosePlayerCard(target, "h", true); + "step 1"; + if (result.bool) { + event.show_card = result.cards[0]; + var str = get.translation(player); player.showCards(event.show_card); - target.chooseControl().set('choiceList',[ - `令${str}获得${get.translation(event.show_card)}`, - `受到${str}造成的${event.baseDamage+event.extraDamage}点伤害`, - ]).set('ai',function(){ - var evt=_status.event.getParent(),player=evt.target,source=evt.player,card=evt.show_card; - if(get.damageEffect(player,source,player)>0) return 1; - if(get.attitude(player,source)*get.value(card,source)>=0) return 0; - if(card.name=='tao') return 1; - return get.value(card,player)>(6+(Math.max(player.maxHp,3)-player.hp)*1.5)?1:0; - }); - } - else event.finish(); - 'step 2' - if(result.index==0) target.give(event.show_card,player); + target + .chooseControl() + .set("choiceList", [ + `令${str}获得${get.translation(event.show_card)}`, + `受到${str}造成的${event.baseDamage + event.extraDamage}点伤害`, + ]) + .set("ai", function () { + var evt = _status.event.getParent(), + player = evt.target, + source = evt.player, + card = evt.show_card; + if (get.damageEffect(player, source, player) > 0) return 1; + if (get.attitude(player, source) * get.value(card, source) >= 0) return 0; + if (card.name == "tao") return 1; + return get.value(card, player) > + 6 + (Math.max(player.maxHp, 3) - player.hp) * 1.5 + ? 1 + : 0; + }); + } else event.finish(); + "step 2"; + if (result.index == 0) target.give(event.show_card, player); else target.damage(); }, - ai:{ - order:6, - tag:{ - damage:1, - loseCard:1, - gain:1, + ai: { + order: 6, + tag: { + damage: 1, + loseCard: 1, + gain: 1, }, - result:{ - player:0.1, - target:-1.2, + result: { + player: 0.1, + target: -1.2, }, }, }, - tuixinzhifu:{ - type:'trick', - fullskin:true, - enable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countGainableCards(player,'hej')>0; + tuixinzhifu: { + type: "trick", + fullskin: true, + enable: true, + filterTarget: function (card, player, target) { + return target != player && target.countGainableCards(player, "hej") > 0; }, - range:{global:1}, - content:function(){ - 'step 0' - player.gainPlayerCard(target,'hej',true,[1,2]); - 'step 1' - if(result.bool&&target.isIn()){ - var num=result.cards.length,hs=player.getCards('h'); - if(!hs.length) event.finish(); - else if(hs.length0&&get.attitude(viewer,player)>0){ + wuxie: function (target, card, player, viewer) { + if (get.attitude(player, target) > 0 && get.attitude(viewer, player) > 0) { return 0; } }, - result:{ - target:function(player,target){ - if(get.attitude(player,target)<=0) return ((target.countCards('he',function(card){ - return get.value(card,target)>0&&card!=target.getEquip('jinhe'); - })>0)?-0.3:0.3)*Math.sqrt(player.countCards('h')); - return ((target.countCards('ej',function(card){ - if(get.position(card)=='e') return get.value(card,target)<=0; - var cardj=card.viewAs?{name:card.viewAs}:card; - return get.effect(target,cardj,target,player)<0; - })>0)?1.5:-0.3)*Math.sqrt(player.countCards('h')); + result: { + target: function (player, target) { + if (get.attitude(player, target) <= 0) + return ( + (target.countCards("he", function (card) { + return ( + get.value(card, target) > 0 && card != target.getEquip("jinhe") + ); + }) > 0 + ? -0.3 + : 0.3) * Math.sqrt(player.countCards("h")) + ); + return ( + (target.countCards("ej", function (card) { + if (get.position(card) == "e") return get.value(card, target) <= 0; + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + }) > 0 + ? 1.5 + : -0.3) * Math.sqrt(player.countCards("h")) + ); }, }, }, }, - yitianjian:{ - type:'equip', - subtype:'equip1', - fullskin:true, - distance:{attackFrom:-1}, - skills:['yitianjian'], - ai:{ - equipValue:1.5, - basic:{ - equipValue:1.5, + yitianjian: { + type: "equip", + subtype: "equip1", + fullskin: true, + distance: { attackFrom: -1 }, + skills: ["yitianjian"], + ai: { + equipValue: 1.5, + basic: { + equipValue: 1.5, }, - } + }, }, - qixingbaodao:{ - type:'equip', - subtype:'equip1', - distance:{attackFrom:-1}, - fullskin:true, - global:'qixingbaodao', - ai:{ - order:9, - value:function(card,player){ - if(player.getEquips(1).includes(card)) return 0.4; + qixingbaodao: { + type: "equip", + subtype: "equip1", + distance: { attackFrom: -1 }, + fullskin: true, + global: "qixingbaodao", + ai: { + order: 9, + value: function (card, player) { + if (player.getEquips(1).includes(card)) return 0.4; return 4; }, - equipValue:function(card,player){ - if(player.getCards('e').includes(card)) return 0.4; - return -get.value(player.getCards('e')); + equipValue: function (card, player) { + if (player.getCards("e").includes(card)) return 0.4; + return -get.value(player.getCards("e")); }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target){ - var cards=target.getCards('e'),js=target.getCards('j'); - var val=get.value(cards,target); - for(var card of js) val-=get.effect(target,card.viewAs?{name:card.viewAs}:card,target,player); + result: { + keepAI: true, + target: function (player, target) { + var cards = target.getCards("e"), + js = target.getCards("j"); + var val = get.value(cards, target); + for (var card of js) + val -= get.effect( + target, + card.viewAs ? { name: card.viewAs } : card, + target, + player + ); return -val; }, }, }, }, - duanjian:{ - type:'equip', - subtype:'equip1', - fullskin:true, - distance:{attackFrom:1}, - selectTarget:[-1,-2], - ai:{ - order:9, - equipValue:function(card,player){ - if(get.position(card)=='e') return -2; + duanjian: { + type: "equip", + subtype: "equip1", + fullskin: true, + distance: { attackFrom: 1 }, + selectTarget: [-1, -2], + ai: { + order: 9, + equipValue: function (card, player) { + if (get.position(card) == "e") return -2; return 2; }, - value:function(card,player){ - if(player.getEquips(1).includes(card)) return -3; + value: function (card, player) { + if (player.getEquips(1).includes(card)) return -3; return 3; }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target){ - var val=2.5; - var val2=0; - var card=target.getEquip(1); - if(card){ - val2=get.value(card,target); - if(val2<0) return 0; + result: { + keepAI: true, + target: function (player, target) { + var val = 2.5; + var val2 = 0; + var card = target.getEquip(1); + if (card) { + val2 = get.value(card, target); + if (val2 < 0) return 0; } - return -val-val2; + return -val - val2; }, }, }, }, - serafuku:{ - type:'equip', - subtype:'equip2', - fullskin:true, - skills:['serafuku'], - selectTarget:[-1,-2], - ai:{ - order:9, - equipValue:function(card,player){ - if(get.position(card)=='e'){ - if(player.hasSex('male')) return -7; + serafuku: { + type: "equip", + subtype: "equip2", + fullskin: true, + skills: ["serafuku"], + selectTarget: [-1, -2], + ai: { + order: 9, + equipValue: function (card, player) { + if (get.position(card) == "e") { + if (player.hasSex("male")) return -7; return 0; } return 2; }, - value:function(card,player){ - if(player.getEquips(2).includes(card)){ - if(player.hasSex('male')) return -8; + value: function (card, player) { + if (player.getEquips(2).includes(card)) { + if (player.hasSex("male")) return -8; return 0; } return 3; }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target){ - var val=(target.hasSex('male')?2.5:0); - var val2=0; - var card=target.getEquip(1); - if(card){ - val2=get.value(card,target); - if(val2<0) return 0; + result: { + keepAI: true, + target: function (player, target) { + var val = target.hasSex("male") ? 2.5 : 0; + var val2 = 0; + var card = target.getEquip(1); + if (card) { + val2 = get.value(card, target); + if (val2 < 0) return 0; } - return -val-val2; + return -val - val2; }, }, }, }, - yinfengyi:{ - type:'equip', - subtype:'equip2', - fullskin:true, - skills:['yinfengyi'], - selectTarget:[-1,-2], - ai:{ - order:9, - equipValue:function(card,player){ - if(get.position(card)=='e') return -8; + yinfengyi: { + type: "equip", + subtype: "equip2", + fullskin: true, + skills: ["yinfengyi"], + selectTarget: [-1, -2], + ai: { + order: 9, + equipValue: function (card, player) { + if (get.position(card) == "e") return -8; return 1; }, - value:function(card,player){ - if(player.getEquips(2).includes(card)) return -10; + value: function (card, player) { + if (player.getEquips(2).includes(card)) return -10; return 2.5; }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target){ - var val=2; - var val2=0; - var card=target.getEquip(2); - if(card){ - val2=get.value(card,target); - if(val2<0) return 0; + result: { + keepAI: true, + target: function (player, target) { + var val = 2; + var val2 = 0; + var card = target.getEquip(2); + if (card) { + val2 = get.value(card, target); + if (val2 < 0) return 0; } - return -val-val2; + return -val - val2; }, }, }, }, - yonglv:{ - type:'equip', - subtype:'equip4', - fullskin:true, - selectTarget:[-1,-2], - distance:{ - globalFrom:-1, - globalTo:-Infinity, + yonglv: { + type: "equip", + subtype: "equip4", + fullskin: true, + selectTarget: [-1, -2], + distance: { + globalFrom: -1, + globalTo: -Infinity, }, - ai:{ - order:9, - equipValue:0, - value:function(card,player){ - if(player.getEquips(2).includes(card)) return 0; + ai: { + order: 9, + equipValue: 0, + value: function (card, player) { + if (player.getEquips(2).includes(card)) return 0; return 0.5; }, - basic:{ - equipValue:0, + basic: { + equipValue: 0, }, }, }, - zhanxiang:{ - type:'equip', - subtype:'equip3', - fullskin:true, - distance:{globalTo:1}, - skills:['zhanxiang'], - ai:{ - equipValue:3.5, - basic:{ - equipValue:3.5, + zhanxiang: { + type: "equip", + subtype: "equip3", + fullskin: true, + distance: { globalTo: 1 }, + skills: ["zhanxiang"], + ai: { + equipValue: 3.5, + basic: { + equipValue: 3.5, }, - } + }, }, - xinge:{ - type:'equip', - subtype:'equip5', - fullskin:true, - skills:['xinge'], - ai:{ - equipValue:2, - basic:{ - equipValue:2, + xinge: { + type: "equip", + subtype: "equip5", + fullskin: true, + skills: ["xinge"], + ai: { + equipValue: 2, + basic: { + equipValue: 2, }, - } + }, }, }, - skill:{ - yitianjian:{ - audio:true, - trigger:{source:'damageSource'}, - direct:true, - equipSkill:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.getParent().name=='sha'&&player.isDamaged()&&player.countCards('h')>0; + skill: { + yitianjian: { + audio: true, + trigger: { source: "damageSource" }, + direct: true, + equipSkill: true, + filter: function (event, player) { + return ( + event.card && + event.card.name == "sha" && + event.getParent().name == "sha" && + player.isDamaged() && + player.countCards("h") > 0 + ); }, - content:function(){ - 'step 0' - player.chooseToDiscard('h',get.prompt('yitianjian'),'弃置一张手牌并回复1点体力').set('ai',(card)=>7-get.value(card)).logSkill='yitianjian'; - 'step 1' - if(result.bool) player.recover(); + content: function () { + "step 0"; + player + .chooseToDiscard("h", get.prompt("yitianjian"), "弃置一张手牌并回复1点体力") + .set("ai", (card) => 7 - get.value(card)).logSkill = "yitianjian"; + "step 1"; + if (result.bool) player.recover(); }, }, - serafuku:{ - audio:true, - trigger:{target:'useCardToTargeted'}, - forced:true, - equipSkill:true, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.player.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - return event.card.name=='sha'&&player.hasSex('male'); + serafuku: { + audio: true, + trigger: { target: "useCardToTargeted" }, + forced: true, + equipSkill: true, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if ( + event.player.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + return event.card.name == "sha" && player.hasSex("male"); }, - content:function(){ - 'step 0' - player.judge(function(card){ - return get.color(card)=='black'?-2:0; - }).judge2=function(result){ - return result.bool==false?true:false; + content: function () { + "step 0"; + player.judge(function (card) { + return get.color(card) == "black" ? -2 : 0; + }).judge2 = function (result) { + return result.bool == false ? true : false; }; - 'step 1' - if(result.bool===false){ - var map=trigger.customArgs,id=player.playerid; - if(!map[id]) map[id]={}; - if(!map[id].extraDamage) map[id].extraDamage=0; + "step 1"; + if (result.bool === false) { + var map = trigger.customArgs, + id = player.playerid; + if (!map[id]) map[id] = {}; + if (!map[id].extraDamage) map[id].extraDamage = 0; map[id].extraDamage++; - game.log(trigger.card,'对',player,'的伤害+1'); + game.log(trigger.card, "对", player, "的伤害+1"); } }, }, - yinfengyi:{ - audio:true, - equipSkill:true, - forced:true, - trigger:{player:['damageBegin3','loseHpBegin']}, - filter:function(event,player){ - if(player.hasSkillTag('unequip2')) return false; - if(event.name=='damage'){ - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; - return event.card&&get.type2(event.card)=='trick'; + yinfengyi: { + audio: true, + equipSkill: true, + forced: true, + trigger: { player: ["damageBegin3", "loseHpBegin"] }, + filter: function (event, player) { + if (player.hasSkillTag("unequip2")) return false; + if (event.name == "damage") { + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; + return event.card && get.type2(event.card) == "trick"; } - return event.type=='du'; + return event.type == "du"; }, - content:function(){ + content: function () { trigger.num++; }, }, - zhanxiang:{ - audio:true, - equipSkill:true, - forced:true, - trigger:{target:'gift'}, - filter:(event,player)=>event.player!=player, - logTarget:'player', - content:()=>{ + zhanxiang: { + audio: true, + equipSkill: true, + forced: true, + trigger: { target: "gift" }, + filter: (event, player) => event.player != player, + logTarget: "player", + content: () => { trigger.deniedGifts.add(trigger.card); }, - ai:{ - refuseGifts:true - } + ai: { + refuseGifts: true, + }, }, - xinge:{ - audio:true, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h')>0; + xinge: { + audio: true, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.countCards("h") > 0; }, - filterCard:true, - position:'h', - filterTarget:lib.filter.notMe, - check:function(card){ - var player=_status.event.player; - var val=5; - if(player.needsToDiscard()) val=15; - return val-get.value(card); + filterCard: true, + position: "h", + filterTarget: lib.filter.notMe, + check: function (card) { + var player = _status.event.player; + var val = 5; + if (player.needsToDiscard()) val = 15; + return val - get.value(card); }, - discard:false, - lose:false, - delay:false, - equipSkill:true, - content:function(){ - player.give(cards,target); + discard: false, + lose: false, + delay: false, + equipSkill: true, + content: function () { + player.give(cards, target); }, - ai:{ - expose:0.1, - order:1, - result:{ - target:function(player,target){ - if(!ui.selected.cards.length) return 0; - if(get.value(ui.selected.cards[0],false,'raw')<0) return -1; + ai: { + expose: 0.1, + order: 1, + result: { + target: function (player, target) { + if (!ui.selected.cards.length) return 0; + if (get.value(ui.selected.cards[0], false, "raw") < 0) return -1; return 1; - } - } - } - }, - qixingbaodao:{ - trigger:{player:'equipBegin'}, - forced:true, - equipSkill:true, - filter:function(event,player){ - return event.card.name=='qixingbaodao'&&player.hasCard(function(card){ - return card!=event.card; - },'ej'); + }, + }, }, - content:function(){ - var cards=player.getCards('ej',function(card){ - return card!=trigger.card&&lib.filter.cardDiscardable(card,player,'qixingbaodao'); + }, + qixingbaodao: { + trigger: { player: "equipBegin" }, + forced: true, + equipSkill: true, + filter: function (event, player) { + return ( + event.card.name == "qixingbaodao" && + player.hasCard(function (card) { + return card != event.card; + }, "ej") + ); + }, + content: function () { + var cards = player.getCards("ej", function (card) { + return ( + card != trigger.card && lib.filter.cardDiscardable(card, player, "qixingbaodao") + ); }); - if(cards.length) player.discard(cards); + if (cards.length) player.discard(cards); }, }, - g_du:{ - trigger:{ - player:['loseAfter','compare'], - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], - target:'compare', + g_du: { + trigger: { + player: ["loseAfter", "compare"], + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], + target: "compare", }, - cardSkill:true, - filter:function(event,player,name){ - if(name=='compare'){ - if(player==event.player){ - if(event.iwhile>0) return false; - return event.card1.name=='du'; + cardSkill: true, + filter: function (event, player, name) { + if (name == "compare") { + if (player == event.player) { + if (event.iwhile > 0) return false; + return event.card1.name == "du"; } - return event.card2.name=='du'; + return event.card2.name == "du"; } - if(event.name!='equip'&&!event.visible) return false; - var evt=event.getl(player); - if(!evt||!evt.hs||!evt.hs.filter(function(i){ - return get.name(i,player)=='du'; - }).length) return false; - for(var i of lib.skill.g_du.whiteListFilter){ - if(i(event,player)) return false; + if (event.name != "equip" && !event.visible) return false; + var evt = event.getl(player); + if ( + !evt || + !evt.hs || + !evt.hs.filter(function (i) { + return get.name(i, player) == "du"; + }).length + ) + return false; + for (var i of lib.skill.g_du.whiteListFilter) { + if (i(event, player)) return false; } return true; }, - whiteListFilter:[ - (event)=>event.getParent().name=='g_du_give', - (event)=>event.getParent(3).name=='guaguliaodu', + whiteListFilter: [ + (event) => event.getParent().name == "g_du_give", + (event) => event.getParent(3).name == "guaguliaodu", ], - forced:true, - popup:false, - content:function(){ - 'step 0' - if(trigger.delay===false) game.delayx(); - 'step 1' - game.log(player,'触发了','#g【毒】','的效果'); - var num=1; - if(typeof trigger.getl=='function'){ - num=trigger.getl(player).hs.filter(function(i){ - return get.name(i,player)=='du'; + forced: true, + popup: false, + content: function () { + "step 0"; + if (trigger.delay === false) game.delayx(); + "step 1"; + game.log(player, "触发了", "#g【毒】", "的效果"); + var num = 1; + if (typeof trigger.getl == "function") { + num = trigger.getl(player).hs.filter(function (i) { + return get.name(i, player) == "du"; }).length; } - player.loseHp(num).type='du'; + player.loseHp(num).type = "du"; }, }, - g_du_give:{ - trigger:{ - player:'gainAfter', - global:'phaseBefore', + g_du_give: { + trigger: { + player: "gainAfter", + global: "phaseBefore", }, - cardSkill:true, - direct:true, - filter:function(event,player){ - if(event.name=='phase'){ - if(game.phaseNumber!=0) return false; - if(!player._start_cards) return false; - let hs=player.getCards('h'); - for(let card of player._start_cards){ - if(get.name(card,player)=='du'&&hs.includes(card)) return true; + cardSkill: true, + direct: true, + filter: function (event, player) { + if (event.name == "phase") { + if (game.phaseNumber != 0) return false; + if (!player._start_cards) return false; + let hs = player.getCards("h"); + for (let card of player._start_cards) { + if (get.name(card, player) == "du" && hs.includes(card)) return true; } - } - else{ - if(event.getParent().name!='draw') return false; - let hs=player.getCards('h'); - for(let card of event.getg(player)){ - if(get.name(card,player)=='du'&&hs.includes(card)) return true; + } else { + if (event.getParent().name != "draw") return false; + let hs = player.getCards("h"); + for (let card of event.getg(player)) { + if (get.name(card, player) == "du" && hs.includes(card)) return true; } } return false; }, - content:function(){ - 'step 0' - var hs=player.getCards('h'); - if(trigger.name=='phase'){ - event.cards=player._start_cards.filter(function(card){ - return (get.name(card,player)=='du'&&hs.includes(card)); + content: function () { + "step 0"; + var hs = player.getCards("h"); + if (trigger.name == "phase") { + event.cards = player._start_cards.filter(function (card) { + return get.name(card, player) == "du" && hs.includes(card); + }); + } else { + event.cards = trigger.cards.filter(function (card) { + return get.name(card, player) == "du" && hs.includes(card); }); } - else{ - event.cards=trigger.cards.filter(function(card){ - return (get.name(card,player)=='du'&&hs.includes(card)); + if (_status.connectMode) + game.broadcastAll(function () { + _status.noclearcountdown = true; }); - } - if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true}); - event.given_map={}; - 'step 1' + event.given_map = {}; + "step 1"; player.chooseCardTarget({ - filterCard:function(card){ + filterCard: function (card) { return _status.event.cards.includes(card); }, - filterTarget:lib.filter.notMe, - selectCard:[1,cards.length], - cards:event.cards, - prompt:'是否发动【赠毒】?', - prompt2:'将本次获得的【毒】交给其他角色', - ai1:function(card){ - var player=get.player(); - if(['usedu','keepdu'].some(tag=>player.hasSkillTag(tag))||get.effect(player,{name:"losehp"},player,player)>0) return 0; - if(!ui.selected.cards.length) return 1; + filterTarget: lib.filter.notMe, + selectCard: [1, cards.length], + cards: event.cards, + prompt: "是否发动【赠毒】?", + prompt2: "将本次获得的【毒】交给其他角色", + ai1: function (card) { + var player = get.player(); + if ( + ["usedu", "keepdu"].some((tag) => player.hasSkillTag(tag)) || + get.effect(player, { name: "losehp" }, player, player) > 0 + ) + return 0; + if (!ui.selected.cards.length) return 1; return 0; }, - ai2:function(target){ - if(['usedu','keepdu'].some(tag=>target.hasSkillTag(tag))) return get.attitude(_status.event.player,target)-0.01; - return -get.attitude(_status.event.player,target)+0.01; + ai2: function (target) { + if (["usedu", "keepdu"].some((tag) => target.hasSkillTag(tag))) + return get.attitude(_status.event.player, target) - 0.01; + return -get.attitude(_status.event.player, target) + 0.01; }, }); - 'step 2' - if(result.bool){ - event.given=true; - var res=result.cards,target=result.targets[0].playerid; - player.addGaintag(res,'du_given'); + "step 2"; + if (result.bool) { + event.given = true; + var res = result.cards, + target = result.targets[0].playerid; + player.addGaintag(res, "du_given"); cards.removeArray(res); - if(!event.given_map[target]) event.given_map[target]=[]; + if (!event.given_map[target]) event.given_map[target] = []; event.given_map[target].addArray(res); - if(cards.length) event.goto(1); - } - else if(!event.given){ - if(_status.connectMode){ - game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()}); + if (cards.length) event.goto(1); + } else if (!event.given) { + if (_status.connectMode) { + game.broadcastAll(function () { + delete _status.noclearcountdown; + game.stopCountChoose(); + }); } event.finish(); } - 'step 3' - if(_status.connectMode){ - game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()}); + "step 3"; + if (_status.connectMode) { + game.broadcastAll(function () { + delete _status.noclearcountdown; + game.stopCountChoose(); + }); } - var logs=[]; - var map=[],cards=[]; - for(var i in event.given_map){ - var source=(_status.connectMode?lib.playerOL:game.playerMap)[i]; + var logs = []; + var map = [], + cards = []; + for (var i in event.given_map) { + var source = (_status.connectMode ? lib.playerOL : game.playerMap)[i]; logs.push(source); - map.push([source,event.given_map[i]]); + map.push([source, event.given_map[i]]); cards.addArray(event.given_map[i]); } - player.showCards(cards,`${get.translation(player)}对${(targets=>{ - if(get.itemtype(targets)=='player') targets=[targets]; - if(targets[0]!=player) return get.translation(targets); - var selfTargets=targets.slice(); - selfTargets[0]='自己'; - return get.translation(selfTargets); - })(logs)}发动了【${get.skillTranslation(event.name,player)}】`); + player.showCards( + cards, + `${get.translation(player)}对${((targets) => { + if (get.itemtype(targets) == "player") targets = [targets]; + if (targets[0] != player) return get.translation(targets); + var selfTargets = targets.slice(); + selfTargets[0] = "自己"; + return get.translation(selfTargets); + })(logs)}发动了【${get.skillTranslation(event.name, player)}】` + ); game.loseAsync({ - gain_list:map, - player:player, - cards:cards, - giver:player, - animate:'giveAuto', - }).setContent('gaincardMultiple'); - player.logSkill('g_du_give',logs); + gain_list: map, + player: player, + cards: cards, + giver: player, + animate: "giveAuto", + }).setContent("gaincardMultiple"); + player.logSkill("g_du_give", logs); }, - ai:{expose:0.1}, + ai: { expose: 0.1 }, }, - _gifting:{ - enable:'phaseUse', - forceLoad:true, - filter:(event,player)=>player.hasCard(card=>lib.skill._gifting.filterCard(card,player),lib.skill._gifting.position), - filterCard:(card,player)=>game.hasPlayer(current=>player.canGift(card,current,true)), - filterTarget:(card,player,target)=>ui.selected.cards.every(value=>player.canGift(value,target,true)), - position:'he', - discard:false, - lose:false, - delay:false, - check:card=>{ - const player=_status.event.player; - if(game.hasPlayer(current=>player.canGift(card,current,true)&&!current.refuseGifts(card,player)&&get.effect(current,card,player,player)>0)) return 2; - if(!player.needsToDiscard()&&get.position(card)=='h') return 0; - return 1+Math.random(); + _gifting: { + enable: "phaseUse", + forceLoad: true, + filter: (event, player) => + player.hasCard( + (card) => lib.skill._gifting.filterCard(card, player), + lib.skill._gifting.position + ), + filterCard: (card, player) => + game.hasPlayer((current) => player.canGift(card, current, true)), + filterTarget: (card, player, target) => + ui.selected.cards.every((value) => player.canGift(value, target, true)), + position: "he", + discard: false, + lose: false, + delay: false, + check: (card) => { + const player = _status.event.player; + if ( + game.hasPlayer( + (current) => + player.canGift(card, current, true) && + !current.refuseGifts(card, player) && + get.effect(current, card, player, player) > 0 + ) + ) + return 2; + if (!player.needsToDiscard() && get.position(card) == "h") return 0; + return 1 + Math.random(); }, - content:()=>{ - player.gift(cards,target); + content: () => { + player.gift(cards, target); + }, + ai: { + order: (item, player) => + player.hasCard( + (card) => + game.hasPlayer( + (current) => + player.canGift(card, current, true) && + !current.refuseGifts(card, player) && + get.effect(current, card, player, player) > 0 + ), + "h" + ) + ? 7 + : 0.51, + result: { + target: (player, target) => { + const result = ui.selected.cards.map((value) => + player.getGiftAIResultTarget(value, target) + ); + return ( + result.reduce( + (previousValue, currentValue) => previousValue + currentValue, + 0 + ) / result.length + ); + }, + }, }, - ai:{ - order:(item,player)=>player.hasCard(card=>game.hasPlayer(current=>player.canGift(card,current,true)&&!current.refuseGifts(card,player)&&get.effect(current,card,player,player)>0),'h')?7:0.51, - result:{ - target:(player,target)=>{ - const result=ui.selected.cards.map(value=>player.getGiftAIResultTarget(value,target)); - return result.reduce((previousValue,currentValue)=>previousValue+currentValue,0)/result.length; - } - } - } }, /** * @deprecated */ - _yongjian_zengyu:{ - get forceLoad(){ + _yongjian_zengyu: { + get forceLoad() { return lib.skill._gifting.forceLoad; }, - set forceLoad(forceLoad){ - lib.skill._gifting.forceLoad=forceLoad; + set forceLoad(forceLoad) { + lib.skill._gifting.forceLoad = forceLoad; }, - get filter(){ + get filter() { return lib.skill._gifting.filter; }, - set filter(filter){ - lib.skill._gifting.filter=filter; + set filter(filter) { + lib.skill._gifting.filter = filter; }, - get filterCard(){ + get filterCard() { return lib.skill._gifting.filterCard; }, - set filterCard(filterCard){ - lib.skill._gifting.filterCard=filterCard; + set filterCard(filterCard) { + lib.skill._gifting.filterCard = filterCard; }, - get filterTarget(){ + get filterTarget() { return lib.skill._gifting.filterTarget; }, - set filterTarget(filterTarget){ - lib.skill._gifting.filterTarget=filterTarget; + set filterTarget(filterTarget) { + lib.skill._gifting.filterTarget = filterTarget; }, - get check(){ + get check() { return lib.skill._gifting.check; }, - set check(check){ - lib.skill._gifting.check=check; + set check(check) { + lib.skill._gifting.check = check; }, - get content(){ + get content() { return lib.skill._gifting.content; }, - set content(content){ - lib.skill._gifting.content=content; + set content(content) { + lib.skill._gifting.content = content; }, - get ai(){ + get ai() { return lib.skill._gifting.ai; }, - set ai(ai){ - lib.skill._gifting.ai=ai; - } - } + set ai(ai) { + lib.skill._gifting.ai = ai; + }, + }, }, - translate:{ - gifts_tag:'赠', - du:'毒', - du_info:'①当此牌正面向上离开你的手牌区,或作为你的拼点牌而亮出时,你失去1点体力。②当你因摸牌或分发起始手牌而获得【毒】后,你可展示之并交给其他角色(不触发〖毒①〗)。', - g_du:'毒', - g_du_give:'赠毒', - du_given:'已分配', - guaguliaodu:'刮骨疗毒', - guaguliaodu_info:'出牌阶段,对一名已受伤的角色使用。目标角色回复1点体力,然后其可以弃置一张【毒】(不触发〖毒①〗失去体力的效果)。', - chenghuodajie:'趁火打劫', - chenghuodajie_info:'出牌阶段,对一名有手牌的其他角色使用。你展示其一张手牌,然后令其选择一项:①将此牌交给你。②你对其造成1点伤害。', - tuixinzhifu:'推心置腹', - tuixinzhifu_info:'出牌阶段,对一名距离为1的其他角色使用。你获得其区域内的至多两张牌,然后交给其等量的牌。', - yitianjian:'倚天剑', - yitianjian_info:'当你因执行【杀】的效果而造成伤害后,若你已受伤,则你可弃置一张手牌,然后回复1点体力。', - qixingbaodao:'七星宝刀', - qixingbaodao_info:'锁定技。当此牌进入你的装备区时,你弃置装备区和判定区内的所有其他牌。', - duanjian:'断剑', - duanjian_info:'这是一把坏掉的武器…', - duanjian_append:'不要因为手快而装给自己。', - serafuku:'水手服', - serafuku_info:'锁定技。当你成为【杀】的目标后,若你的性别包含男性,则你进行判定:若结果为黑色,则此牌对你的伤害值基数+1。', - serafuku_append:'セーラー服だからです、
              結論!
              ', - yinfengyi:'引蜂衣', - yinfengyi_info:'锁定技。当你受到渠道为锦囊牌的伤害时,此伤害+1。当你因〖毒①〗而失去体力时,失去体力的量值+1。', - yonglv:'庸驴', - yonglv_info:'锁定技。①你至其他角色的距离-1。②其他角色至你的距离视为1。', - yonglv_append:'它旁边的就是王仲宣。', - zhanxiang:'战象', - zhanxiang_info:'锁定技。①其他角色至你的距离+1。②其他角色对你赠予的牌视为赠予失败。', - xinge:'信鸽', - xinge_info:'出牌阶段限一次。你可以将一张手牌交给一名其他角色。', - xinge_append:'咕咕咕。', + translate: { + gifts_tag: "赠", + du: "毒", + du_info: + "①当此牌正面向上离开你的手牌区,或作为你的拼点牌而亮出时,你失去1点体力。②当你因摸牌或分发起始手牌而获得【毒】后,你可展示之并交给其他角色(不触发〖毒①〗)。", + g_du: "毒", + g_du_give: "赠毒", + du_given: "已分配", + guaguliaodu: "刮骨疗毒", + guaguliaodu_info: + "出牌阶段,对一名已受伤的角色使用。目标角色回复1点体力,然后其可以弃置一张【毒】(不触发〖毒①〗失去体力的效果)。", + chenghuodajie: "趁火打劫", + chenghuodajie_info: + "出牌阶段,对一名有手牌的其他角色使用。你展示其一张手牌,然后令其选择一项:①将此牌交给你。②你对其造成1点伤害。", + tuixinzhifu: "推心置腹", + tuixinzhifu_info: + "出牌阶段,对一名距离为1的其他角色使用。你获得其区域内的至多两张牌,然后交给其等量的牌。", + yitianjian: "倚天剑", + yitianjian_info: + "当你因执行【杀】的效果而造成伤害后,若你已受伤,则你可弃置一张手牌,然后回复1点体力。", + qixingbaodao: "七星宝刀", + qixingbaodao_info: "锁定技。当此牌进入你的装备区时,你弃置装备区和判定区内的所有其他牌。", + duanjian: "断剑", + duanjian_info: "这是一把坏掉的武器…", + duanjian_append: '不要因为手快而装给自己。', + serafuku: "水手服", + serafuku_info: + "锁定技。当你成为【杀】的目标后,若你的性别包含男性,则你进行判定:若结果为黑色,则此牌对你的伤害值基数+1。", + serafuku_append: + 'セーラー服だからです、
              結論!
              ', + yinfengyi: "引蜂衣", + yinfengyi_info: + "锁定技。当你受到渠道为锦囊牌的伤害时,此伤害+1。当你因〖毒①〗而失去体力时,失去体力的量值+1。", + yonglv: "庸驴", + yonglv_info: "锁定技。①你至其他角色的距离-1。②其他角色至你的距离视为1。", + yonglv_append: '它旁边的就是王仲宣。', + zhanxiang: "战象", + zhanxiang_info: "锁定技。①其他角色至你的距离+1。②其他角色对你赠予的牌视为赠予失败。", + xinge: "信鸽", + xinge_info: "出牌阶段限一次。你可以将一张手牌交给一名其他角色。", + xinge_append: '咕咕咕。', - _gifting:'赠予', - _gifting_info:'出牌阶段,你可将一张拥有“赠”标签的手牌区装备牌置于一名其他角色的装备区内,或将一张拥有“赠”标签的手牌区非装备牌正面朝上交给一名其他角色。', + _gifting: "赠予", + _gifting_info: + "出牌阶段,你可将一张拥有“赠”标签的手牌区装备牌置于一名其他角色的装备区内,或将一张拥有“赠”标签的手牌区非装备牌正面朝上交给一名其他角色。", }, - list:[ - ['spade',1,'guaguliaodu'], - ['spade',2,'qixingbaodao',null,['gifts']], - ['spade',3,'shunshou',null,['gifts']], - ['spade',4,'du',null,['gifts']], - ['spade',5,'du',null,['gifts']], - ['spade',6,'sha','stab'], - ['spade',7,'sha','stab'], - ['spade',8,'sha','stab'], - ['spade',9,'du',null,['gifts']], - ['spade',10,'du',null,['gifts']], - ['spade',11,'wuxie'], - ['spade',12,'chenghuodajie'], - ['spade',13,'chenghuodajie'], + list: [ + ["spade", 1, "guaguliaodu"], + ["spade", 2, "qixingbaodao", null, ["gifts"]], + ["spade", 3, "shunshou", null, ["gifts"]], + ["spade", 4, "du", null, ["gifts"]], + ["spade", 5, "du", null, ["gifts"]], + ["spade", 6, "sha", "stab"], + ["spade", 7, "sha", "stab"], + ["spade", 8, "sha", "stab"], + ["spade", 9, "du", null, ["gifts"]], + ["spade", 10, "du", null, ["gifts"]], + ["spade", 11, "wuxie"], + ["spade", 12, "chenghuodajie"], + ["spade", 13, "chenghuodajie"], - ['heart',1,'guaguliaodu'], - ['heart',2,'shan',null,['gifts']], - ['heart',3,'wugu',null,['gifts']], - ['heart',4,'xinge',null,['gifts']], - ['heart',5,'sha',null,['gifts']], - ['heart',6,'chenghuodajie'], - ['heart',7,'tao'], - ['heart',8,'tao'], - ['heart',9,'serafuku',null,['gifts']], - ['heart',10,'sha',null,['gifts']], - ['heart',11,'sha',null,['gifts']], - ['heart',12,'sha',null,['gifts']], - ['heart',13,'zhanxiang',null,['gifts']], + ["heart", 1, "guaguliaodu"], + ["heart", 2, "shan", null, ["gifts"]], + ["heart", 3, "wugu", null, ["gifts"]], + ["heart", 4, "xinge", null, ["gifts"]], + ["heart", 5, "sha", null, ["gifts"]], + ["heart", 6, "chenghuodajie"], + ["heart", 7, "tao"], + ["heart", 8, "tao"], + ["heart", 9, "serafuku", null, ["gifts"]], + ["heart", 10, "sha", null, ["gifts"]], + ["heart", 11, "sha", null, ["gifts"]], + ["heart", 12, "sha", null, ["gifts"]], + ["heart", 13, "zhanxiang", null, ["gifts"]], - ['club',1,'duanjian',null,['gifts']], - ['club',2,'sha','stab'], - ['club',3,'yinfengyi',null,['gifts']], - ['club',4,'du'], - ['club',5,'yitianjian'], - ['club',6,'sha','stab'], - ['club',7,'sha','stab'], - ['club',8,'sha','stab'], - ['club',9,'sha','stab'], - ['club',10,'sha','stab'], - ['club',11,'wuxie'], - ['club',12,'wuxie'], - ['club',13,'yonglv',null,['gifts']], + ["club", 1, "duanjian", null, ["gifts"]], + ["club", 2, "sha", "stab"], + ["club", 3, "yinfengyi", null, ["gifts"]], + ["club", 4, "du"], + ["club", 5, "yitianjian"], + ["club", 6, "sha", "stab"], + ["club", 7, "sha", "stab"], + ["club", 8, "sha", "stab"], + ["club", 9, "sha", "stab"], + ["club", 10, "sha", "stab"], + ["club", 11, "wuxie"], + ["club", 12, "wuxie"], + ["club", 13, "yonglv", null, ["gifts"]], - ['diamond',1,'juedou',null,['gifts']], - ['diamond',2,'shan'], - ['diamond',3,'kaihua',null,['gifts']], - ['diamond',4,'kaihua',null,['gifts']], - ['diamond',5,'shan'], - ['diamond',6,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'shan'], - ['diamond',9,'tuixinzhifu'], - ['diamond',10,'tuixinzhifu'], - ['diamond',11,'tao',null,['gifts']], - ['diamond',12,'shan'], - ['diamond',13,'sha','stab'], + ["diamond", 1, "juedou", null, ["gifts"]], + ["diamond", 2, "shan"], + ["diamond", 3, "kaihua", null, ["gifts"]], + ["diamond", 4, "kaihua", null, ["gifts"]], + ["diamond", 5, "shan"], + ["diamond", 6, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "tuixinzhifu"], + ["diamond", 10, "tuixinzhifu"], + ["diamond", 11, "tao", null, ["gifts"]], + ["diamond", 12, "shan"], + ["diamond", 13, "sha", "stab"], ], - } + }; }); diff --git a/card/yunchou.js b/card/yunchou.js index caebac9b3..4c9799cfc 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -1,218 +1,230 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'yunchou', - card:{ - diaobingqianjiang:{ - fullskin:true, - type:'trick', - enable:true, - selectTarget:-1, - filterTarget:function(card,player,target){ - return player==target||target.countCards('h'); + name: "yunchou", + card: { + diaobingqianjiang: { + fullskin: true, + type: "trick", + enable: true, + selectTarget: -1, + filterTarget: function (card, player, target) { + return player == target || target.countCards("h"); }, - contentBefore:function(){ - "step 0" + contentBefore: function () { + "step 0"; game.delay(); player.draw(); - "step 1" - if(get.is.versus()){ - player.chooseControl('顺时针','逆时针',function(event,player){ - if(player.next.side==player.side) return '逆时针'; - return '顺时针'; - }).set('prompt','选择'+get.translation(card)+'的结算方向'); - } - else{ + "step 1"; + if (get.is.versus()) { + player + .chooseControl("顺时针", "逆时针", function (event, player) { + if (player.next.side == player.side) return "逆时针"; + return "顺时针"; + }) + .set("prompt", "选择" + get.translation(card) + "的结算方向"); + } else { event.goto(3); } - "step 2" - if(result&&result.control=='顺时针'){ - var evt=event.getParent(); - evt.fixedSeat=true; + "step 2"; + if (result && result.control == "顺时针") { + var evt = event.getParent(); + evt.fixedSeat = true; evt.targets.sortBySeat(); evt.targets.reverse(); - if(evt.targets[evt.targets.length-1]==player){ + if (evt.targets[evt.targets.length - 1] == player) { evt.targets.unshift(evt.targets.pop()); } } - "step 3" + "step 3"; ui.clear(); - var cards=get.cards(Math.ceil(game.countPlayer()/2)); - var dialog=ui.create.dialog('调兵遣将',cards,true); + var cards = get.cards(Math.ceil(game.countPlayer() / 2)); + var dialog = ui.create.dialog("调兵遣将", cards, true); _status.dieClose.push(dialog); - dialog.videoId=lib.status.videoId++; - game.addVideo('cardDialog',null,['调兵遣将',get.cardsInfo(cards),dialog.videoId]); - event.getParent().preResult=dialog.videoId; + dialog.videoId = lib.status.videoId++; + game.addVideo("cardDialog", null, ["调兵遣将", get.cardsInfo(cards), dialog.videoId]); + event.getParent().preResult = dialog.videoId; }, - content:function(){ - "step 0" - for(var i=0;i0){ - return get.value(button.link,nextSeat)-5; + var next = player.chooseButton([1, event.dialog.buttons.length], event.dialog); + next.ai = function (button) { + if (att > 0) { + return get.value(button.link, nextSeat) - 5; + } else { + return 5 - get.value(button.link, nextSeat); } - else{ - return 5-get.value(button.link,nextSeat); - } - } - next.set('closeDialog',false); - next.set('dialogdisplay',true); - 'step 1' - if(result&&result.bool&&result.links&&result.links.length){ - for(var i=0;i0&&target!=player; }, - content:function(){ - 'step 0' - if(target.countCards('h','sha')){ - var name=get.translation(player.name); - target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[ - '将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张' - ],function(){ - if(get.effect(player,{name:'sha'},target,target)<0) return 1; - if(target.countCards('h','sha')>=3) return 1; - return 0; - }); + }, + caochuanjiejian: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("h") > 0 && target != player; + }, + content: function () { + "step 0"; + if (target.countCards("h", "sha")) { + var name = get.translation(player.name); + target + .chooseControl() + .set("prompt", get.translation("caochuanjiejian")) + .set( + "choiceList", + [ + "将手牌中的所有杀交给" + name + ",并视为对" + name + "使用一张杀", + "展示手牌并令" + name + "弃置任意一张", + ], + function () { + if (get.effect(player, { name: "sha" }, target, target) < 0) return 1; + if (target.countCards("h", "sha") >= 3) return 1; + return 0; + } + ); + } else { + event.directfalse = true; } - else{ - event.directfalse=true; - } - 'step 1' - if(event.directfalse||result.control=='选项二'){ - if(target.countCards('h')){ - if(!player.isUnderControl(true)){ + "step 1"; + if (event.directfalse || result.control == "选项二") { + if (target.countCards("h")) { + if (!player.isUnderControl(true)) { target.showHandcards(); + } else { + game.log(target, "展示了", target.getCards("h")); } - else{ - game.log(target,'展示了',target.getCards('h')); - } - player.discardPlayerCard(target,'h',true,'visible'); + player.discardPlayerCard(target, "h", true, "visible"); } event.finish(); + } else { + var hs = target.getCards("h", "sha"); + player.gain(hs, target); + target.$give(hs, player); } - else{ - var hs=target.getCards('h','sha'); - player.gain(hs,target); - target.$give(hs,player); - } - 'step 2' - target.useCard({name:'sha'},player); + "step 2"; + target.useCard({ name: "sha" }, player); }, - ai:{ - order:4, - value:[5,1], - result:{ - target:function(player,target){ - if(player.hasShan()) return -1; + ai: { + order: 4, + value: [5, 1], + result: { + target: function (player, target) { + if (player.hasShan()) return -1; return 0; - } - } - } + }, + }, + }, }, // xiaolicangdao:{ // fullskin:true, @@ -259,767 +271,803 @@ game.import('card', function () { // } // } // }, - geanguanhuo:{ - fullskin:true, - type:'trick', - filterTarget:function(card,player,target){ - if(target==player) return false; - return target.countCards('h')>0&&game.hasPlayer(function(current){ - return target.canCompare(current); - }); + geanguanhuo: { + fullskin: true, + type: "trick", + filterTarget: function (card, player, target) { + if (target == player) return false; + return ( + target.countCards("h") > 0 && + game.hasPlayer(function (current) { + return target.canCompare(current); + }) + ); //return ui.selected.targets[0].canCompare(target); }, - filterAddedTarget:function(card,player,target,preTarget){ - return target!=player&&preTarget.canCompare(target); + filterAddedTarget: function (card, player, target, preTarget) { + return target != player && preTarget.canCompare(target); }, - enable:function(){ - return game.countPlayer()>2; + enable: function () { + return game.countPlayer() > 2; }, - recastable:function(){ - return game.countPlayer()<=2; + recastable: function () { + return game.countPlayer() <= 2; }, - multicheck:function(card,player){ - return game.countPlayer(function(current){ - return current!=player&¤t.countCards('h'); - })>1; + multicheck: function (card, player) { + return ( + game.countPlayer(function (current) { + return current != player && current.countCards("h"); + }) > 1 + ); }, - multitarget:true, - multiline:true, - singleCard:true, - complexSelect:true, - content:function(){ - 'step 0' - if(!event.addedTarget||!target.canCompare(event.addedTarget)){ + multitarget: true, + multiline: true, + singleCard: true, + complexSelect: true, + content: function () { + "step 0"; + if (!event.addedTarget || !target.canCompare(event.addedTarget)) { event.finish(); return; } target.chooseToCompare(event.addedTarget); - 'step 1' - if(!result.tie){ - if(result.bool){ - if(event.addedTarget.countCards('he')){ + "step 1"; + if (!result.tie) { + if (result.bool) { + if (event.addedTarget.countCards("he")) { target.line(event.addedTarget); - target.gainPlayerCard(event.addedTarget,true); + target.gainPlayerCard(event.addedTarget, true); } - } - else{ - if(target.countCards('he')){ + } else { + if (target.countCards("he")) { event.addedTarget.line(target); - event.addedTarget.gainPlayerCard(target,true); + event.addedTarget.gainPlayerCard(target, true); } } event.finish(); } - 'step 2' + "step 2"; target.discardPlayerCard(player); target.line(player); }, - ai:{ - order:5, - value:[7,1], - useful:[4,1], - result:{ - target:-1, - } - } - }, - shezhanqunru:{ - fullskin:true, - type:'trick', - enable:true, - toself:true, - filterTarget:function(card,player,target){ - return target==player; + ai: { + order: 5, + value: [7, 1], + useful: [4, 1], + result: { + target: -1, + }, }, - selectTarget:-1, - modTarget:true, - content:function(){ - 'step 0' - var list=game.filterPlayer(function(current){ - return current!=target&&target.canCompare(current); + }, + shezhanqunru: { + fullskin: true, + type: "trick", + enable: true, + toself: true, + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + modTarget: true, + content: function () { + "step 0"; + var list = game.filterPlayer(function (current) { + return current != target && target.canCompare(current); }); - if(!list.length){ + if (!list.length) { target.draw(3); event.finish(); - } - else{ + } else { list.sortBySeat(target); - event.list=list; - event.torespond=[]; + event.list = list; + event.torespond = []; } - 'step 1' - if(event.list.length){ - event.current=event.list.shift(); - event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ - if(get.attitude(player,_status.event.source)>=0) return false; - var hs=player.getCards('h'); - var dutag=player.hasSkillTag('nodu'); - for(var i=0;i=8&&value<=7) return true; - if(value<=3) return true; + "step 1"; + if (event.list.length) { + event.current = event.list.shift(); + event.current + .chooseBool( + "是否响应" + get.translation(target) + "的舌战群儒?", + function (event, player) { + if (get.attitude(player, _status.event.source) >= 0) return false; + var hs = player.getCards("h"); + var dutag = player.hasSkillTag("nodu"); + for (var i = 0; i < hs.length; i++) { + var value = get.value(hs[i], player); + if (hs[i].name == "du" && dutag) continue; + if (value < 0) return true; + if (!_status.event.hasTarget) { + if (hs[i].number >= 8 && value <= 7) return true; + if (value <= 3) return true; + } else if (_status.event.hasTarget % 2 == 1) { + if (hs[i].number >= 11 && value <= 6) return true; + } + } + return false; } - else if(_status.event.hasTarget%2==1){ - if(hs[i].number>=11&&value<=6) return true; - } - } - return false; - }).set('source',target).set('hasTarget',event.torespond.length); - } - else{ + ) + .set("source", target) + .set("hasTarget", event.torespond.length); + } else { event.goto(3); } - 'step 2' - if(result.bool){ + "step 2"; + if (result.bool) { event.torespond.push(event.current); - event.current.line(target,'green'); - event.current.popup('响应'); - game.log(event.current,'响应了舌战群儒'); + event.current.line(target, "green"); + event.current.popup("响应"); + game.log(event.current, "响应了舌战群儒"); game.delayx(0.5); } event.goto(1); - 'step 3' - if(event.torespond.length==0){ - event.num=1; + "step 3"; + if (event.torespond.length == 0) { + event.num = 1; + } else { + event.num = 0; + target.chooseToCompare(event.torespond).callback = lib.card.shezhanqunru.callback; } - else{ - event.num=0; - target.chooseToCompare(event.torespond).callback=lib.card.shezhanqunru.callback; - } - 'step 4' - if(event.num>0){ + "step 4"; + if (event.num > 0) { target.draw(3); } }, - callback:function(){ - if(event.card1.number>event.card2.number){ + callback: function () { + if (event.card1.number > event.card2.number) { event.parent.parent.num++; - } - else{ + } else { event.parent.parent.num--; } }, - ai:{ - order:8.5, - value:[6,1], - useful:[3,1], - tag:{ - draw:3 + ai: { + order: 8.5, + value: [6, 1], + useful: [3, 1], + tag: { + draw: 3, }, - result:{ - target:function(player,target){ - var hs=target.getCards('h'); - for(var i=0;i=7&&value<=6) return 1; - if(value<=3) return 1; + result: { + target: function (player, target) { + var hs = target.getCards("h"); + for (var i = 0; i < hs.length; i++) { + var value = get.value(hs[i]); + if (hs[i].number >= 7 && value <= 6) return 1; + if (value <= 3) return 1; } return 0; - } - } - } + }, + }, + }, }, - youdishenru:{ - fullskin:true, - type:'trick', - notarget:true, - wuxieable:true, - global:'g_youdishenru', - content:function(){ - 'step 0' - var info=event.getParent(2).youdiinfo||event.getParent(3).youdiinfo; - if(!info){ + youdishenru: { + fullskin: true, + type: "trick", + notarget: true, + wuxieable: true, + global: "g_youdishenru", + content: function () { + "step 0"; + var info = event.getParent(2).youdiinfo || event.getParent(3).youdiinfo; + if (!info) { event.finish(); return; } info.evt.cancel(); - event.source=info.source; - event.source.storage.youdishenru=player; - event.source.addSkill('youdishenru'); - 'step 1' - var next=event.source.chooseToUse({name:'sha'},player,-1,'对'+get.translation(player)+'使用一张杀,或受到1点伤害').set('addCount',false); - next.ai2=function(){ + event.source = info.source; + event.source.storage.youdishenru = player; + event.source.addSkill("youdishenru"); + "step 1"; + var next = event.source + .chooseToUse( + { name: "sha" }, + player, + -1, + "对" + get.translation(player) + "使用一张杀,或受到1点伤害" + ) + .set("addCount", false); + next.ai2 = function () { return 1; }; - 'step 2' - if(result.bool){ - if(event.source.storage.youdishenru){ + "step 2"; + if (result.bool) { + if (event.source.storage.youdishenru) { event.goto(1); + } else { + event.source.removeSkill("youdishenru"); } - else{ - event.source.removeSkill('youdishenru'); - } - } - else{ + } else { event.source.damage(player); - event.source.removeSkill('youdishenru'); + event.source.removeSkill("youdishenru"); } }, - ai:{ - value:[5,1], - useful:[5,1], - order:1, - wuxie:function(target,card,player,current,state){ - return -state*get.attitude(player,current); + ai: { + value: [5, 1], + useful: [5, 1], + order: 1, + wuxie: function (target, card, player, current, state) { + return -state * get.attitude(player, current); }, - result:{ - player:function(player){ - if(_status.event.parent.youdiinfo&& - get.attitude(player,_status.event.parent.youdiinfo.source)<=0){ + result: { + player: function (player) { + if ( + _status.event.parent.youdiinfo && + get.attitude(player, _status.event.parent.youdiinfo.source) <= 0 + ) { return 1; } return 0; - } - } - } - }, - wangmeizhike:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:true, - content(){ - 'step 0' - if(target.isMinHp()&&target.isDamaged()){ - target.recover(); - event.rec=true; - } - 'step 1' - if(target.isMinHandcard()) target.draw(event.rec?1:2); + }, + }, }, - ai:{ - order(){ - let player=_status.event.player, - nan=player.hasCard(card=>{ - return get.name(card)==='nanman'; - },'hs'), - wan=player.hasCard(card=>{ - return get.name(card)==='wanjian'; - },'hs'), - aoe=0, - max=0; - game.countPlayer(current=>{ - if(get.attitude(player,current)<=0) return false; - let hp=current.isMinHp(), - hc=current.isMinHandcard(); - if((nan || wan)&&(hp || hc)) aoe=1; - if(hp&&hc&&max!==1) max=current===player?1:-1; + }, + wangmeizhike: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: true, + content() { + "step 0"; + if (target.isMinHp() && target.isDamaged()) { + target.recover(); + event.rec = true; + } + "step 1"; + if (target.isMinHandcard()) target.draw(event.rec ? 1 : 2); + }, + ai: { + order() { + let player = _status.event.player, + nan = player.hasCard((card) => { + return get.name(card) === "nanman"; + }, "hs"), + wan = player.hasCard((card) => { + return get.name(card) === "wanjian"; + }, "hs"), + aoe = 0, + max = 0; + game.countPlayer((current) => { + if (get.attitude(player, current) <= 0) return false; + let hp = current.isMinHp(), + hc = current.isMinHandcard(); + if ((nan || wan) && (hp || hc)) aoe = 1; + if (hp && hc && max !== 1) max = current === player ? 1 : -1; }); - if(aoe){ - if(nan) aoe=Math.max(aoe,get.order('nanman')); - if(wan) aoe=Math.max(aoe,get.order('wanjian')); - return aoe+0.2; + if (aoe) { + if (nan) aoe = Math.max(aoe, get.order("nanman")); + if (wan) aoe = Math.max(aoe, get.order("wanjian")); + return aoe + 0.2; } - if(max) return 5.8; - if(player.isDamaged()&&player.isMinHp()&&player.countCards('hs','tao')) return get.order('tao')+0.2; + if (max) return 5.8; + if (player.isDamaged() && player.isMinHp() && player.countCards("hs", "tao")) + return get.order("tao") + 0.2; return 0.5; }, - value:7, - result:{ - target(player,target){ - let num=0, - current=player.next, - mei=1, - draw=target.hasSkillTag('nogain')?0.1:1; - if(!ui.selected.cards) mei=0; - let mine=player.countCards('h',card=>{ - if(mei>0&& ui.selected.cards.includes(card)) return false; - if(!mei&&get.name(card)==='phd_wmzk'){ - mei=-1; + value: 7, + result: { + target(player, target) { + let num = 0, + current = player.next, + mei = 1, + draw = target.hasSkillTag("nogain") ? 0.1 : 1; + if (!ui.selected.cards) mei = 0; + let mine = player.countCards("h", (card) => { + if (mei > 0 && ui.selected.cards.includes(card)) return false; + if (!mei && get.name(card) === "phd_wmzk") { + mei = -1; return false; } return true; }); - if(player.hasSkillTag('noh')&&player.countCards('h')) mine++; - let min=mine; - while(current!==player){ - if(current.countCards('h')0){ - if(target.hp===1) num+=3; - else num+=2; + if (target.isMinHp() && target.isDamaged() && get.recoverEffect(target) > 0) { + if (target.hp === 1) num += 3; + else num += 2; } - if(player===target){ - if(mine<=min) num+=(num?2:1)*draw; - } - else if(target.countCards('h')<=min) num+=(num?2:1)*draw; + if (player === target) { + if (mine <= min) num += (num ? 2 : 1) * draw; + } else if (target.countCards("h") <= min) num += (num ? 2 : 1) * draw; return num; - } + }, }, - tag:{ - draw:1.2, - recover:0.5 - } - } - }, - suolianjia:{ - fullskin:true, - type:"equip", - subtype:"equip2", - skills:['suolianjia'], - onEquip:function(){ - if(player.isLinked()==false) player.link(); - }, - onLose:function(){ - if(player.isLinked()) player.link(); - }, - ai:{ - basic:{ - equipValue:5 + tag: { + draw: 1.2, + recover: 0.5, }, }, }, - chenhuodajie:{ - fullskin:true, - type:'trick', - filterTarget:true, - global:'g_chenhuodajie', - content:function(){ - if(target.countCards('he')){ - player.gainPlayerCard('he',target,true); + suolianjia: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["suolianjia"], + onEquip: function () { + if (player.isLinked() == false) player.link(); + }, + onLose: function () { + if (player.isLinked()) player.link(); + }, + ai: { + basic: { + equipValue: 5, + }, + }, + }, + chenhuodajie: { + fullskin: true, + type: "trick", + filterTarget: true, + global: "g_chenhuodajie", + content: function () { + if (target.countCards("he")) { + player.gainPlayerCard("he", target, true); } }, - ai:{ - order:1, - useful:6, - value:6, - result:{ - target:-1 + ai: { + order: 1, + useful: 6, + value: 6, + result: { + target: -1, }, - tag:{ - loseCard:1 - } - } + tag: { + loseCard: 1, + }, + }, }, - fudichouxin:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ + fudichouxin: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { return player.canCompare(target); }, - content:function(){ - "step 0" - player.chooseToCompare(target).set('preserve','win').clear=false; - "step 1" - if(result.bool){ - player.gain([result.player,result.target]); + content: function () { + "step 0"; + player.chooseToCompare(target).set("preserve", "win").clear = false; + "step 1"; + if (result.bool) { + player.gain([result.player, result.target]); result.player.clone.moveDelete(player); result.target.clone.moveDelete(player); - game.addVideo('gain2',player,get.cardsInfo([result.player,result.target])); - } - else if(!result.cancelled){ + game.addVideo("gain2", player, get.cardsInfo([result.player, result.target])); + } else if (!result.cancelled) { result.player.clone.delete(); result.target.clone.delete(); - game.addVideo('deletenode',player,get.cardsInfo([result.player,result.target])); + game.addVideo("deletenode", player, get.cardsInfo([result.player, result.target])); } }, - ai:{ - order:4, - value:[4,1], - result:{ - target:function(player){ - if(player.countCards('h')<=1) return 0; + ai: { + order: 4, + value: [4, 1], + result: { + target: function (player) { + if (player.countCards("h") <= 1) return 0; return -1; }, - player:function(player){ - if(player.countCards('h')<=1) return 0; + player: function (player) { + if (player.countCards("h") <= 1) return 0; return 0.5; - } + }, }, - tag:{ - loseCard:1 - } - } + tag: { + loseCard: 1, + }, + }, }, - shuiyanqijun:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - return target.countCards('e'); + shuiyanqijun: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("e"); }, - selectTarget:-1, - content:function(){ - if(target.countCards('e')) target.chooseToDiscard('e',true); + selectTarget: -1, + content: function () { + if (target.countCards("e")) target.chooseToDiscard("e", true); }, - reverseOrder:true, - ai:{ - order:9, - result:{ - target:function(player,target){ - if(target.countCards('e')) return -1; + reverseOrder: true, + ai: { + order: 9, + result: { + target: function (player, target) { + if (target.countCards("e")) return -1; return 0; - } + }, + }, + tag: { + multitarget: 1, + multineg: 1, }, - tag:{ - multitarget:1, - multineg:1 - } - } - }, - toulianghuanzhu:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - return target.countCards('h')>0; }, - content:function(){ - 'step 0' - if(!target.countCards('h')){ + }, + toulianghuanzhu: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("h") > 0; + }, + content: function () { + "step 0"; + if (!target.countCards("h")) { event.finish(); return; } - var hs=player.getCards('h'); - if(hs.length){ - var minval=get.value(hs[0]); - var colors=[get.color(hs[0])]; - for(var i=1;i=0){ - if(colors.includes(get.color(button.link))){ - val+=3; + player.chooseCardButton("偷梁换柱", target.getCards("h")).ai = function (button) { + var val = get.value(button.link, player, "raw") - minval; + if (val >= 0) { + if (colors.includes(get.color(button.link))) { + val += 3; } } return val; - } - } - else{ + }; + } else { player.viewHandcards(target); event.finish(); } - 'step 1' - if(result.bool){ - event.card=result.links[[0]]; - player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)).ai=function(card){ - return -get.value(card); - }; - } - else{ + "step 1"; + if (result.bool) { + event.card = result.links[[0]]; + player.chooseCard("h", true, "用一张手牌替换" + get.translation(event.card)).ai = + function (card) { + return -get.value(card); + }; + } else { event.finish(); } - 'step 2' - if(result.bool){ - player.gain(event.card,target); - target.gain(result.cards,player); - player.$giveAuto(result.cards,target); - target.$giveAuto(event.card,player); - game.log(player,'与',target,'交换了一张手牌'); - if(get.color(event.card)==get.color(result.cards[0])){ + "step 2"; + if (result.bool) { + player.gain(event.card, target); + target.gain(result.cards, player); + player.$giveAuto(result.cards, target); + target.$giveAuto(event.card, player); + game.log(player, "与", target, "交换了一张手牌"); + if (get.color(event.card) == get.color(result.cards[0])) { player.draw(); } - target.addTempSkill('toulianghuanzhu_ai1'); - } - else{ - target.addTempSkill('toulianghuanzhu_ai2'); + target.addTempSkill("toulianghuanzhu_ai1"); + } else { + target.addTempSkill("toulianghuanzhu_ai2"); } }, - ai:{ - order:8, - tag:{ - loseCard:1, - norepeat:1, + ai: { + order: 8, + tag: { + loseCard: 1, + norepeat: 1, }, - result:{ - target:function(player,target){ - if(player.countCards('h')<=1) return 0; - if(target.hasSkill('toulianghuanzhu_ai2')) return 0; - if(target.hasSkill('toulianghuanzhu_ai1')) return 0.5; + result: { + target: function (player, target) { + if (player.countCards("h") <= 1) return 0; + if (target.hasSkill("toulianghuanzhu_ai2")) return 0; + if (target.hasSkill("toulianghuanzhu_ai1")) return 0.5; return -1; - } + }, }, - useful:[4,1], - value:[6,1] - } - }, - huoshan:{ - fullskin:true, - type:'delay', - cardcolor:'red', - cardnature:'fire', - toself:true, - modTarget:function(card,player,target){ - return lib.filter.judge(card,player,target); + useful: [4, 1], + value: [6, 1], }, - enable:function(card,player){ + }, + huoshan: { + fullskin: true, + type: "delay", + cardcolor: "red", + cardnature: "fire", + toself: true, + modTarget: function (card, player, target) { + return lib.filter.judge(card, player, target); + }, + enable: function (card, player) { return player.canAddJudge(card); }, - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player==target); + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player == target; }, - selectTarget:[-1,-1], - judge:function(card){ - if(get.suit(card)=='heart'&&get.number(card)>1&&get.number(card)<10) return -6; + selectTarget: [-1, -1], + judge: function (card) { + if (get.suit(card) == "heart" && get.number(card) > 1 && get.number(card) < 10) return -6; return 1; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - effect:function(){ - if(result.bool==false){ - player.damage(2,'fire','nosource'); - var players=game.filterPlayer(function(current){ - return get.distance(player,current)<=1&&player!=current; + effect: function () { + if (result.bool == false) { + player.damage(2, "fire", "nosource"); + var players = game.filterPlayer(function (current) { + return get.distance(player, current) <= 1 && player != current; }); players.sort(lib.sort.seat); - for(var i=0;i1&&get.number(card)<10) return -3; + selectTarget: [-1, -1], + judge: function (card) { + if (get.suit(card) == "club" && get.number(card) > 1 && get.number(card) < 10) return -3; return 1; }, - judge2:function(result){ - if(result.bool==false) return true; + judge2: function (result) { + if (result.bool == false) return true; return false; }, - fullskin:true, - effect:function(){ - if(result.bool==false){ - if(player.countCards('he')==0) player.loseHp(); - else{ - player.discard(player.getCards('he').randomGets(3)); + fullskin: true, + effect: function () { + if (result.bool == false) { + if (player.countCards("he") == 0) player.loseHp(); + else { + player.discard(player.getCards("he").randomGets(3)); } - var players=get.players(); - for(var i=0;i0; + filterTarget: function (card, player, target) { + return target.isMajor() && target.countCards("he") > 0; }, - selectTarget:-1, - content:function(){ - target.chooseToDiscard('he',true).delay=false; + selectTarget: -1, + content: function () { + target.chooseToDiscard("he", true).delay = false; }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:-1, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: -1, }, - tag:{ - discard:1 - } - } + tag: { + discard: 1, + }, + }, }, - dizaizhen:{ - type:'zhenfa', - recastable:true, - enable:function(){ - return game.hasPlayer(function(current){ + dizaizhen: { + type: "zhenfa", + recastable: true, + enable: function () { + return game.hasPlayer(function (current) { return current.isNotMajor(); }); }, - filterTarget:function(card,player,target){ + filterTarget: function (card, player, target) { return target.isNotMajor(); }, - selectTarget:-1, - content:function(){ + selectTarget: -1, + content: function () { target.draw(false); target.$draw(); }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:1, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: 1, }, - tag:{ - draw:1 - } - } + tag: { + draw: 1, + }, + }, }, - fengyangzhen:{ - type:'zhenfa', - recastable:true, - enable:true, - filterTarget:function(card,player,target){ + fengyangzhen: { + type: "zhenfa", + recastable: true, + enable: true, + filterTarget: function (card, player, target) { return target.sieged(); }, - selectTarget:-1, - content:function(){ - target.addTempSkill('feiying',{player:'damageAfter'}); - target.popup('feiying'); - game.log(target,'获得了技能','【飞影】'); + selectTarget: -1, + content: function () { + target.addTempSkill("feiying", { player: "damageAfter" }); + target.popup("feiying"); + game.log(target, "获得了技能", "【飞影】"); }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:2, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: 2, }, - } + }, }, - yunchuizhen:{ - type:'zhenfa', - recastable:true, - enable:true, - filterTarget:function(card,player,target){ + yunchuizhen: { + type: "zhenfa", + recastable: true, + enable: true, + filterTarget: function (card, player, target) { return target.siege(); }, - selectTarget:-1, - content:function(){ - target.addTempSkill('wushuang',{source:'damageAfter'}); - target.popup('wushuang'); - game.log(target,'获得了技能','【无双】'); + selectTarget: -1, + content: function () { + target.addTempSkill("wushuang", { source: "damageAfter" }); + target.popup("wushuang"); + game.log(target, "获得了技能", "【无双】"); }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:2, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: 2, }, - } + }, }, - qixingzhen:{ - type:'zhenfa', - recastable:true, - enable:function(card,player){ - return player.siege()||player.sieged(); + qixingzhen: { + type: "zhenfa", + recastable: true, + enable: function (card, player) { + return player.siege() || player.sieged(); }, - filterTarget:function(card,player,target){ - return target==player; + filterTarget: function (card, player, target) { + return target == player; }, - selectTarget:-1, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ + selectTarget: -1, + content: function () { + "step 0"; + event.targets = game.filterPlayer(function (current) { return current.siege(player); }); - 'step 1' - if(event.targets.length){ - var current=event.targets.shift(); - player.line(current,'green'); - player.discardPlayerCard(current,true); + "step 1"; + if (event.targets.length) { + var current = event.targets.shift(); + player.line(current, "green"); + player.discardPlayerCard(current, true); event.redo(); } - 'step 2' - var card={name:'sha',isCard:true}; - var list=game.filterPlayer(function(current){ - return current.siege(player)&&player.canUse(card,current); + "step 2"; + var card = { name: "sha", isCard: true }; + var list = game.filterPlayer(function (current) { + return current.siege(player) && player.canUse(card, current); }); - if(list.length){ - player.useCard(card,list,false); + if (list.length) { + player.useCard(card, list, false); } }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:1, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: 1, }, - } + }, }, - shepanzhen:{ - type:'zhenfa', - recastable:true, - enable:function(card,player){ - if(player.identity=='unknown'||player.identity=='ye') return false; - if(get.population(player.identity)<=1) return false; - return game.hasPlayer(function(current){ - return current!=player&¤t.identity==player.identity&&!player.inline(current); + shepanzhen: { + type: "zhenfa", + recastable: true, + enable: function (card, player) { + if (player.identity == "unknown" || player.identity == "ye") return false; + if (get.population(player.identity) <= 1) return false; + return game.hasPlayer(function (current) { + return ( + current != player && + current.identity == player.identity && + !player.inline(current) + ); }); }, - notarget:true, - content:function(){ - var targets=game.filterPlayer(function(current){ - return current.identity==player.identity; + notarget: true, + content: function () { + var targets = game.filterPlayer(function (current) { + return current.identity == player.identity; }); targets.sortBySeat(); - for(var i=1;i0){ - return 6-get.value(card); + selectTarget: -1, + content: function () { + "step 0"; + player.chooseCard( + "将一张非基本牌当作杀对" + get.translation(target) + "使用", + "he", + function (card) { + return get.type(card) != "basic"; + } + ).ai = function (card) { + if (get.effect(target, { name: "sha" }, player, player) > 0) { + return 6 - get.value(card); } return 0; }; - "step 1" - if(result.bool){ - player.useCard({name:'sha'},result.cards,target,false); + "step 1"; + if (result.bool) { + player.useCard({ name: "sha" }, result.cards, target, false); } - "step 2" - if(target==player.next) event.player2=player.next.next; - else event.player2=player.previous.previous; - event.player2.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ - return get.type(card)!='basic'; - }).ai=function(card){ - if(get.effect(target,{name:'sha'},event.player2,event.player2)>0){ - return 6-get.value(card); + "step 2"; + if (target == player.next) event.player2 = player.next.next; + else event.player2 = player.previous.previous; + event.player2.chooseCard( + "将一张非基本牌当作杀对" + get.translation(target) + "使用", + "he", + function (card) { + return get.type(card) != "basic"; + } + ).ai = function (card) { + if (get.effect(target, { name: "sha" }, event.player2, event.player2) > 0) { + return 6 - get.value(card); } return 0; }; - "step 3" - if(result.bool){ - event.player2.useCard({name:'sha'},result.cards,target,false); + "step 3"; + if (result.bool) { + event.player2.useCard({ name: "sha" }, result.cards, target, false); } }, - mode:['guozhan'], - ai:{ - order:7, - result:{ - target:-2, + mode: ["guozhan"], + ai: { + order: 7, + result: { + target: -2, }, - } - }, - niaoxiangzhen:{ - type:'zhenfa', - recastable:true, - enable:true, - filterTarget:function(card,player,target){ - if(player.identity==target.identity) return false; - if(target.identity=='unknown'||target.identity=='ye') return false; - return target.identity==target.next.identity||target.identity==target.previous.identity }, - selectTarget:-1, - content:function(){ - "step 0" - var next=target.chooseToRespond({name:'shan'}); - next.ai=function(card){ - if(get.damageEffect(target,player,target)>=0) return 0; + }, + niaoxiangzhen: { + type: "zhenfa", + recastable: true, + enable: true, + filterTarget: function (card, player, target) { + if (player.identity == target.identity) return false; + if (target.identity == "unknown" || target.identity == "ye") return false; + return ( + target.identity == target.next.identity || target.identity == target.previous.identity + ); + }, + selectTarget: -1, + content: function () { + "step 0"; + var next = target.chooseToRespond({ name: "shan" }); + next.ai = function (card) { + if (get.damageEffect(target, player, target) >= 0) return 0; return 1; }; - next.autochoose=lib.filter.autoRespondShan; - "step 1" - if(result.bool==false){ + next.autochoose = lib.filter.autoRespondShan; + "step 1"; + if (result.bool == false) { target.damage(); } }, - ai:{ - basic:{ - order:9, - useful:1 + ai: { + basic: { + order: 9, + useful: 1, }, - result:{ - target:-1.5, + result: { + target: -1.5, + }, + tag: { + respond: 1, + respondShan: 1, + damage: 1, }, - tag:{ - respond:1, - respondShan:1, - damage:1, - } }, - mode:['guozhan'], + mode: ["guozhan"], }, }, - skill:{ - }, - translate:{ - zhenfa:'阵法', - changshezhen:'长蛇阵', - pozhenjue:'破阵决', - tianfuzhen:'天覆阵', - dizaizhen:'地载阵', - fengyangzhen:'风扬阵', - yunchuizhen:'云垂阵', - qixingzhen:'七星阵', - shepanzhen:'蛇蟠阵', - shepanzhen_bg:'列', - yunchuizhen_bg:'垂', - longfeizhen:'龙飞阵', - huyizhen:'虎翼阵', - niaoxiangzhen:'鸟翔阵', - niaoxiangzhen_info:'令所有非你阵营的队列的角色今次打出一张闪,或者受到1点伤害。', - qixingzhen_info:'弃置所有围攻你的角色各一张牌,然后视为对所有你围攻的角色使用一张不计入出杀次数的杀。', + skill: {}, + translate: { + zhenfa: "阵法", + changshezhen: "长蛇阵", + pozhenjue: "破阵决", + tianfuzhen: "天覆阵", + dizaizhen: "地载阵", + fengyangzhen: "风扬阵", + yunchuizhen: "云垂阵", + qixingzhen: "七星阵", + shepanzhen: "蛇蟠阵", + shepanzhen_bg: "列", + yunchuizhen_bg: "垂", + longfeizhen: "龙飞阵", + huyizhen: "虎翼阵", + niaoxiangzhen: "鸟翔阵", + niaoxiangzhen_info: "令所有非你阵营的队列的角色今次打出一张闪,或者受到1点伤害。", + qixingzhen_info: + "弃置所有围攻你的角色各一张牌,然后视为对所有你围攻的角色使用一张不计入出杀次数的杀。", // longfeizhen_info:'弃置围攻你的角色各一张牌,然后摸一张牌。', // qixingzhen_info:'令我方所有角色进入围攻状态。', // shepanzhen_info:'令我方所有角色进入队列状态。', // yunchuizhen_info:'令所有围攻角色获得技能〖无双〗,直到其首次造成伤害。', // fengyangzhen_info:'令所有被围攻角色获得技能〖飞影〗,直到其首次受到伤害。', - dizaizhen_info:'所有小势力角色摸一张牌。', - changshezhen_info:'若你处于队列中,与你同一队列的所有角色摸一张牌,否则将与你逆时针距离最近的同势力角色移至你下家。', + dizaizhen_info: "所有小势力角色摸一张牌。", + changshezhen_info: + "若你处于队列中,与你同一队列的所有角色摸一张牌,否则将与你逆时针距离最近的同势力角色移至你下家。", // pozhenjue_info:'将所有角色的顺序随机重排。', - tianfuzhen_info:'所有大势力角色弃置一张牌。' + tianfuzhen_info: "所有大势力角色弃置一张牌。", }, - list:[ - ["diamond",1,'changshezhen'], - ["club",1,'changshezhen'], + list: [ + ["diamond", 1, "changshezhen"], + ["club", 1, "changshezhen"], // ["spade",1,'changshezhen'], // ["heart",1,'changshezhen'], - ["diamond",2,'tianfuzhen'], + ["diamond", 2, "tianfuzhen"], // ["club",2,'tianfuzhen'], - ["spade",2,'tianfuzhen'], - ["heart",2,'tianfuzhen'], + ["spade", 2, "tianfuzhen"], + ["heart", 2, "tianfuzhen"], - ["diamond",3,'dizaizhen'], + ["diamond", 3, "dizaizhen"], // ["club",3,'dizaizhen'], - ["spade",3,'dizaizhen'], - ["heart",3,'dizaizhen'], + ["spade", 3, "dizaizhen"], + ["heart", 3, "dizaizhen"], // ["diamond",4,'fengyangzhen'], // ["club",4,'fengyangzhen'], @@ -407,9 +423,9 @@ game.import('card', function () { // ["spade",6,'huyizhen'], // ["heart",6,'huyizhen'], - ["diamond",7,'qixingzhen'], - ["club",7,'qixingzhen'], - ["spade",7,'qixingzhen'], + ["diamond", 7, "qixingzhen"], + ["club", 7, "qixingzhen"], + ["spade", 7, "qixingzhen"], // ["heart",7,'qixingzhen'], // ["diamond",8,'shepanzhen'], @@ -422,10 +438,10 @@ game.import('card', function () { // ["spade",9,'longfeizhen'], // ["heart",9,'longfeizhen'], - ["diamond",11,'niaoxiangzhen'], + ["diamond", 11, "niaoxiangzhen"], // ["club",11,'niaoxiangzhen'], - ["spade",11,'niaoxiangzhen'], - ["heart",11,'niaoxiangzhen'], + ["spade", 11, "niaoxiangzhen"], + ["heart", 11, "niaoxiangzhen"], // ["diamond",12,'yunchuizhen'], // ["club",12,'yunchuizhen'], diff --git a/card/zhulu.js b/card/zhulu.js index 6865a722d..ecbce8ed8 100644 --- a/card/zhulu.js +++ b/card/zhulu.js @@ -1,936 +1,1050 @@ -import { lib, game, ui, get, ai, _status } from '../noname.js'; -game.import('card', function () { +import { lib, game, ui, get, ai, _status } from "../noname.js"; +game.import("card", function () { return { - name:'zhulu', - connect:true, - card:{ - zhulu_card:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - cardcolor:'red', - selectTarget:-1, - filterTarget:true, - contentBefore:function(){ - "step 0" - if(get.is.versus()){ - player.chooseControl('顺时针','逆时针',function(event,player){ - if(player.next.side==player.side) return '逆时针'; - return '顺时针'; - }).set('prompt','选择'+get.translation(card)+'的结算方向'); - } - else{ + name: "zhulu", + connect: true, + card: { + zhulu_card: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + cardcolor: "red", + selectTarget: -1, + filterTarget: true, + contentBefore: function () { + "step 0"; + if (get.is.versus()) { + player + .chooseControl("顺时针", "逆时针", function (event, player) { + if (player.next.side == player.side) return "逆时针"; + return "顺时针"; + }) + .set("prompt", "选择" + get.translation(card) + "的结算方向"); + } else { event.goto(2); } - "step 1" - if(result&&result.control=='顺时针'){ - var evt=event.getParent(); - evt.fixedSeat=true; + "step 1"; + if (result && result.control == "顺时针") { + var evt = event.getParent(); + evt.fixedSeat = true; evt.targets.sortBySeat(); evt.targets.reverse(); - if(evt.targets[evt.targets.length-1]==player){ + if (evt.targets[evt.targets.length - 1] == player) { evt.targets.unshift(evt.targets.pop()); } } - "step 2" + "step 2"; ui.clear(); var num; - if(event.targets){ - num=event.targets.length; + if (event.targets) { + num = event.targets.length; + } else { + num = game.countPlayer(); } - else{ - num=game.countPlayer(); - } - var cards=[]; - for(var i=0;i1){ - var next=target.chooseButton(true,function(button){ - var player=_status.event.player; - return get.effect(player,button.link,player,player); + if (equips.length > 1) { + var next = target.chooseButton(true, function (button) { + var player = _status.event.player; + return get.effect(player, button.link, player, player); }); - next.set('equips',equips); - next.set('filterButton',function(button){ + next.set("equips", equips); + next.set("filterButton", function (button) { return _status.event.equips.includes(button.link); }); - next.set('dialog',event.preResult); - next.set('closeDialog',false); - next.set('dialogdisplay',true); - } - else if(equips.length){ - event.directButton=equips[0]; - } - else event.finish(); - "step 1" - var dialog=event.dialog; + next.set("dialog", event.preResult); + next.set("closeDialog", false); + next.set("dialogdisplay", true); + } else if (equips.length) { + event.directButton = equips[0]; + } else event.finish(); + "step 1"; + var dialog = event.dialog; var card; - if(event.directButton){ - card=event.directButton; - } - else{ - card=result.links[0]; + if (event.directButton) { + card = event.directButton; + } else { + card = result.links[0]; } var button; - for(var i=0;i0?0.4:0.7; - } + return (1 - get.distance(player, target, "absolute") / game.countPlayer()) * + get.attitude(player, target) > + 0 + ? 0.4 + : 0.7; + }, }, - tag:{ - draw:1, - multitarget:1 - } - } + tag: { + draw: 1, + multitarget: 1, + }, + }, }, - kaihua:{ - enable:true, - fullskin:true, - type:'trick', - selectTarget:-1, - toself:true, - filterTarget:function(card,player,target){ - return target==player; + kaihua: { + enable: true, + fullskin: true, + type: "trick", + selectTarget: -1, + toself: true, + filterTarget: function (card, player, target) { + return target == player; }, - modTarget:true, - content:function(){ - 'step 0' - if(!target.countCards('he')){ - event.finish();return; + modTarget: true, + content: function () { + "step 0"; + if (!target.countCards("he")) { + event.finish(); + return; } - target.chooseToDiscard(true,'he',[1,2]).set('ai',function(card){ - if(!ui.selected.cards.length&&get.type(card)=='equip') return 8-get.value(card); - return 6-get.value(card); + target.chooseToDiscard(true, "he", [1, 2]).set("ai", function (card) { + if (!ui.selected.cards.length && get.type(card) == "equip") + return 8 - get.value(card); + return 6 - get.value(card); }); - 'step 1' - if(result.bool&&result.cards){ - var bool=0; - for(var i=0;iget.value(card); - return 6>get.value(card); + result: { + target: function (player, target, card) { + var cards = ui.selected.cards.concat(card.cards || []); + var num = player.countCards("he", function (card) { + if (cards.includes(card)) return false; + if (get.type(card) == "equip") return 8 > get.value(card); + return 6 > get.value(card); }); - if(!num) return 0; - if(player.countCards('he',function(card){ - if(cards.includes(card)) return false; - if(get.type(card)=='equip') return 4>get.value(card); - return false; - })) return 1.6; - if(num<2) return 0.5; + if (!num) return 0; + if ( + player.countCards("he", function (card) { + if (cards.includes(card)) return false; + if (get.type(card) == "equip") return 4 > get.value(card); + return false; + }) + ) + return 1.6; + if (num < 2) return 0.5; return 1.2; }, }, - tag:{ - loseCard:1, - discard:1, - norepeat:1 - } + tag: { + loseCard: 1, + discard: 1, + norepeat: 1, + }, }, }, - jiejia:{ - fullskin:true, - type:'trick', - enable:true, - filterTarget:function(card,player,target){ - return target.countCards('e')>0; + jiejia: { + fullskin: true, + type: "trick", + enable: true, + filterTarget: function (card, player, target) { + return target.countCards("e") > 0; }, - content:function(){ - var es=target.getCards('e'); - if(es.length) target.gain(es,'gain2','log'); + content: function () { + var es = target.getCards("e"); + if (es.length) target.gain(es, "gain2", "log"); }, - ai:{ - order:10, - tag:{ - gain:1, + ai: { + order: 10, + tag: { + gain: 1, //loseCard:1, }, - basic:{ - useful:0.5, - value:0.5, + basic: { + useful: 0.5, + value: 0.5, }, - result:{ - target:function(player,target){ - var e5=target.getEquip('muniu'); - if(e5&&e5.name=='muniu'&&e5.cards&&e5.cards.length>1) return -1; - if(target.countCards('e',function(card){ - return get.value(card,target)<=0; - })||target.hasSkillTag('noe')) return 1; + result: { + target: function (player, target) { + var e5 = target.getEquip("muniu"); + if (e5 && e5.name == "muniu" && e5.cards && e5.cards.length > 1) return -1; + if ( + target.countCards("e", function (card) { + return get.value(card, target) <= 0; + }) || + target.hasSkillTag("noe") + ) + return 1; return 0; }, }, }, }, - caochuan:{ - fullskin:true, - type:'trick', - wuxieable:true, - global:['caochuan_skill'], - notarget:true, - content:function(){ - var evt2=event.getParent(3)._trigger; + caochuan: { + fullskin: true, + type: "trick", + wuxieable: true, + global: ["caochuan_skill"], + notarget: true, + content: function () { + var evt2 = event.getParent(3)._trigger; evt2.neutralize(); - var evt=evt2.getParent(); - var next=game.createEvent('caochuan_gain'); + var evt = evt2.getParent(); + var next = game.createEvent("caochuan_gain"); _status.event.next.remove(next); evt.after.unshift(next); - next.player=player; - next.setContent(function(){ - var cards=event.getParent().cards.filterInD(); - if(cards.length) player.gain(cards,'gain2','log'); + next.player = player; + next.setContent(function () { + var cards = event.getParent().cards.filterInD(); + if (cards.length) player.gain(cards, "gain2", "log"); }); }, - ai:{ - basic:{ - useful:[6,4], - value:[6,4], + ai: { + basic: { + useful: [6, 4], + value: [6, 4], }, - result:{player:1}, + result: { player: 1 }, }, }, - numa:{ - fullskin:true, - type:'equip', - subtype:'equip4', - filterTarget:function(card,player,target){ - if(player==target) return false; - return target.canEquip(card,true) + numa: { + fullskin: true, + type: "equip", + subtype: "equip4", + filterTarget: function (card, player, target) { + if (player == target) return false; + return target.canEquip(card, true); }, - selectTarget:1, - toself:false, - loseThrow:true, - customSwap:function(){ + selectTarget: 1, + toself: false, + loseThrow: true, + customSwap: function () { return true; }, - ai:{ - order:9, - value:function(card,player){ - if(player.getEquips(4).includes(card)) return 0; + ai: { + order: 9, + value: function (card, player) { + if (player.getEquips(4).includes(card)) return 0; return 4; }, - equipValue:function(card,player){ - if(player.getCards('e').includes(card)) return 0; - return -get.value(player.getCards('e')); + equipValue: function (card, player) { + if (player.getCards("e").includes(card)) return 0; + return -get.value(player.getCards("e")); }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target){ - var cards=target.getCards('e'); - if(cards.length==1&&cards[0].name=='nvzhuang') return 0; - var val=get.value(cards,target); - if(val>0) return -val; + result: { + keepAI: true, + target: function (player, target) { + var cards = target.getCards("e"); + if (cards.length == 1 && cards[0].name == "nvzhuang") return 0; + var val = get.value(cards, target); + if (val > 0) return -val; return 0; }, }, }, }, - yajiaoqiang:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-2}, - skills:['yajiaoqiang_skill'], - ai:{ - equipValue:function(card,player){ - var skills=['longdan','kanpo','rekanpo','qingguo','reqingguo','ollongdan','refanghun']; - for(var i=0;i0) val+=4/num; + if (num > 0) val += 4 / num; return -val; } - if(card){ - var val2=get.value(card,target); - if(val2>0) return -val2/4; + if (card) { + var val2 = get.value(card, target); + if (val2 > 0) return -val2 / 4; } return 0; }, }, - } - }, - yexingyi:{ - fullskin:true, - type:'equip', - subtype:'equip2', - skills:['yexingyi_skill'], - ai:{ - equipValue:4, - basic:{ - equipValue:4, - }, - } - }, - jinhe:{ - fullskin:true, - type:'equip', - subtype:'equip5', - filterTarget:function(card,player,target){ - if(player==target) return false; - return target.canEquip(card,true) }, - selectTarget:1, - toself:false, - skills:['jinhe_skill'], - global:['jinhe_lose'], - loseDelay:false, - onEquip:function(){ - "step 0" - player.markSkill('jinhe_skill'); - if(event.getParent(2).name!='jinhe') event.finish(); - else{ - event.target=player; - event.player=event.getParent(2).player; + }, + yexingyi: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["yexingyi_skill"], + ai: { + equipValue: 4, + basic: { + equipValue: 4, + }, + }, + }, + jinhe: { + fullskin: true, + type: "equip", + subtype: "equip5", + filterTarget: function (card, player, target) { + if (player == target) return false; + return target.canEquip(card, true); + }, + selectTarget: 1, + toself: false, + skills: ["jinhe_skill"], + global: ["jinhe_lose"], + loseDelay: false, + onEquip: function () { + "step 0"; + player.markSkill("jinhe_skill"); + if (event.getParent(2).name != "jinhe") event.finish(); + else { + event.target = player; + event.player = event.getParent(2).player; } - "step 1" - var id=card.cardid; - event.cardid=id; - if(!_status.jinhe) _status.jinhe={}; - if(_status.jinhe[id]){ + "step 1"; + var id = card.cardid; + event.cardid = id; + if (!_status.jinhe) _status.jinhe = {}; + if (_status.jinhe[id]) { game.cardsDiscard(_status.jinhe[id].card); delete _status.jinhe[id]; } - var cards2=get.cards(2); - event.cards2=cards2; - player.chooseButton(['选择一张牌作为「礼」',cards2],true); - "step 2" - var id=event.cardid; - _status.jinhe[id]={ - player:player, - card:result.links[0], + var cards2 = get.cards(2); + event.cards2 = cards2; + player.chooseButton(["选择一张牌作为「礼」", cards2], true); + "step 2"; + var id = event.cardid; + _status.jinhe[id] = { + player: player, + card: result.links[0], }; - game.broadcast(function(jinhe){ - _status.jinhe=jinhe; - },_status.jinhe); + game.broadcast(function (jinhe) { + _status.jinhe = jinhe; + }, _status.jinhe); game.cardsGotoSpecial(result.links[0]); event.cards2.remove(result.links[0]); event.cards2[0].fix(); - ui.cardPile.insertBefore(event.cards2[0],ui.cardPile.firstChild); + ui.cardPile.insertBefore(event.cards2[0], ui.cardPile.firstChild); game.updateRoundNumber(); - target.markSkill('jinhe_skill'); + target.markSkill("jinhe_skill"); }, - onLose:function(){ - player.unmarkSkill('jinhe_skill'); - var id=card.cardid; - if((event.getParent(2)&&event.getParent(2).name!='swapEquip')&&get.position(card)!='d'&&event.parent.type!='equip'&&_status.jinhe&&_status.jinhe[id]){ - var card2=_status.jinhe[id].card; - player.$throw(card2,1000); - game.log(card,'掉落了',card2); + onLose: function () { + player.unmarkSkill("jinhe_skill"); + var id = card.cardid; + if ( + event.getParent(2) && + event.getParent(2).name != "swapEquip" && + get.position(card) != "d" && + event.parent.type != "equip" && + _status.jinhe && + _status.jinhe[id] + ) { + var card2 = _status.jinhe[id].card; + player.$throw(card2, 1000); + game.log(card, "掉落了", card2); game.cardsDiscard(card2); delete _status.jinhe[id]; } }, - ai:{ - order:9.5, - equipValue:function(card,player){ - if(!player.getEquips(5).includes(card)) return 5; - if(_status.jinhe&&_status.jinhe[card.cardid]&&_status.event.name!='gainPlayerCard') return 3*player.countCards('h'); + ai: { + order: 9.5, + equipValue: function (card, player) { + if (!player.getEquips(5).includes(card)) return 5; + if ( + _status.jinhe && + _status.jinhe[card.cardid] && + _status.event.name != "gainPlayerCard" + ) + return 3 * player.countCards("h"); return 0; }, - value:function(){ - return lib.card.jinhe.ai.equipValue.apply(this,arguments); + value: function () { + return lib.card.jinhe.ai.equipValue.apply(this, arguments); }, - basic:{ - equipValue:5, + basic: { + equipValue: 5, }, - result:{ - keepAI:true, - target:function(player,target,cardx){ - if(_status.jinhe&&_status.jinhe[cardx.cardid]) return -0.5-2*target.countCards('h'); - var card=target.getEquip(5); - if(!card) return 0; - return -get.value(card,target); + result: { + keepAI: true, + target: function (player, target, cardx) { + if (_status.jinhe && _status.jinhe[cardx.cardid]) + return -0.5 - 2 * target.countCards("h"); + var card = target.getEquip(5); + if (!card) return 0; + return -get.value(card, target); }, - target_use:function(player,target){ - return -0.5-2*target.countCards('h'); + target_use: function (player, target) { + return -0.5 - 2 * target.countCards("h"); }, }, - } + }, }, }, - skill:{ - jinhe_lose:{ - trigger:{ - player:['loseAfter','equipAfter'], - global:'loseAsyncAfter', + skill: { + jinhe_lose: { + trigger: { + player: ["loseAfter", "equipAfter"], + global: "loseAsyncAfter", }, - equipSkill:true, - forced:true, - filter:function(event,player){ - if(event.getl===false) return false; - if(!event.getd(player).length||!_status.jinhe||event.getParent(2).name=='jinhe_skill'&&event.getParent(2).player==player) return false; - var evt=event.getl(player); - if(!evt) return false; - for(var i=0;icard.cards.includes(cardx)||ui.selected.cards.includes(cardx))) return false; + yexingyi_skill: { + equipSkill: true, + mod: { + targetEnabled: function (card, player, target) { + if ( + get.color(card) == "black" && + get.type(card, "trick") == "trick" && + !target.hasSkillTag("unequip2") && + !player.hasSkillTag("unequip", false, { + name: card ? card.name : null, + target: target, + card: card, + }) + ) { + const cards = player.getEquips("yexingyi"); + if ( + player.hasSkill("yexingyi_skill", null, false) || + !card.cards || + !cards.some( + (cardx) => card.cards.includes(cardx) || ui.selected.cards.includes(cardx) + ) + ) + return false; } }, }, }, - yinfengjia_skill:{ - trigger:{player:'damageBegin3'}, - forced:true, - equipSkill:true, - filter:function(event,player){ - if(get.type(event.card,'trick')!='trick') return false; - if(player.hasSkillTag('unequip2')) return false; - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return false; + yinfengjia_skill: { + trigger: { player: "damageBegin3" }, + forced: true, + equipSkill: true, + filter: function (event, player) { + if (get.type(event.card, "trick") != "trick") return false; + if (player.hasSkillTag("unequip2")) return false; + if ( + event.source && + event.source.hasSkillTag("unequip", false, { + name: event.card ? event.card.name : null, + target: player, + card: event.card, + }) + ) + return false; return true; }, - content:function(){trigger.num++}, + content: function () { + trigger.num++; + }, }, - wufengjian_skill:{ - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - if(event.card.name!='sha') return false; - var cards=player.getEquips('wufengjian'); - return player.hasCard(function(card){ + wufengjian_skill: { + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + if (event.card.name != "sha") return false; + var cards = player.getEquips("wufengjian"); + return player.hasCard(function (card) { return !cards.includes(card); - },'he'); + }, "he"); }, - content:function(){ - if(player!=game.me&&!player.isUnderControl()&&!player.isOnline()) game.delayx(); - player.chooseToDiscard(true,'he',function(card){ - return !_status.event.cards.includes(card); - }).set('cards',player.getEquips('wufengjian')); + content: function () { + if (player != game.me && !player.isUnderControl() && !player.isOnline()) game.delayx(); + player + .chooseToDiscard(true, "he", function (card) { + return !_status.event.cards.includes(card); + }) + .set("cards", player.getEquips("wufengjian")); }, }, - yajiaoqiang_skill:{ - trigger:{player:'useCardAfter'}, - filter:function(event,player){ - if(_status.currentPhase==player||get.color(event.card)!='black'||event.cards.filterInD().length==0) return false; - return player.getHistory('useCard',function(evt){ - return get.color(evt.card)=='black'; - }).indexOf(event)==0; + yajiaoqiang_skill: { + trigger: { player: "useCardAfter" }, + filter: function (event, player) { + if ( + _status.currentPhase == player || + get.color(event.card) != "black" || + event.cards.filterInD().length == 0 + ) + return false; + return ( + player + .getHistory("useCard", function (evt) { + return get.color(evt.card) == "black"; + }) + .indexOf(event) == 0 + ); }, - prompt2:function(event,player){ - return '获得'+get.translation(event.cards.filterInD()); + prompt2: function (event, player) { + return "获得" + get.translation(event.cards.filterInD()); }, - content:function(){ - player.gain(trigger.cards.filterInD(),'gain2','log'); + content: function () { + player.gain(trigger.cards.filterInD(), "gain2", "log"); }, }, - caochuan_skill:{ - trigger:{target:'useCardToBegin'}, - forced:true, - priority:6, - filter:function(event,player){ - if(event.directHit||!get.tag(event.card,'damage')||!['basic','trick'].includes(get.type(event.card))) return false; - return player.hasUsableCard('caochuan'); + caochuan_skill: { + trigger: { target: "useCardToBegin" }, + forced: true, + priority: 6, + filter: function (event, player) { + if ( + event.directHit || + !get.tag(event.card, "damage") || + !["basic", "trick"].includes(get.type(event.card)) + ) + return false; + return player.hasUsableCard("caochuan"); }, - content:function(){ - var next=player.chooseToUse(); - next.set('prompt','是否使用【草船借箭】响应'+get.translation(trigger.player)+'使用的'+get.translation(trigger.card)+'?'); - next.set('filterCard',function(card,player){ - if(get.name(card)!='caochuan') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); + content: function () { + var next = player.chooseToUse(); + next.set( + "prompt", + "是否使用【草船借箭】响应" + + get.translation(trigger.player) + + "使用的" + + get.translation(trigger.card) + + "?" + ); + next.set("filterCard", function (card, player) { + if (get.name(card) != "caochuan") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); }); - next.set('respondTo',[trigger.player,trigger.card]); - next.set('goon',-get.effect(player,trigger.card,trigger.player,player)); - next.set('ai1',function(card){ + next.set("respondTo", [trigger.player, trigger.card]); + next.set("goon", -get.effect(player, trigger.card, trigger.player, player)); + next.set("ai1", function (card) { return _status.event.goon; - }) + }); }, }, }, - translate:{ - jinhe:'锦盒', - jinhe_info:'此牌的使用目标为其他角色。当你使用【锦盒】时,你将原有的与此牌对应的「礼」置入弃牌堆(若有),然后观看牌堆顶的两张牌并将其中一张置于游戏外与此牌对应,称之为「礼」。
              出牌阶段,你可以将与此牌对应的「礼」置入弃牌堆,然后弃置【锦盒】以及所有与「礼」花色相同的手牌。当此牌因其他原因进入弃牌堆后,你将与此牌对应的「礼」置入弃牌堆并弃置所有手牌。', - jinhe_skill:'锦盒', - jinhe_lose:'锦盒', - yexingyi:'夜行衣', - yexingyi_info:'锁定技,你不是黑色锦囊牌的合法目标。', - nvzhuang:'女装', - nvzhuang_info:'此牌的使用目标为其他角色。锁定技,当此牌进入或离开你的装备区时,若你的性别为男性,你弃置一张不为此牌的牌。', - yinfengjia:'引蜂甲', - yinfengjia_info:'此牌的使用目标为其他角色。锁定技,当你受到锦囊牌造成的伤害时,此伤害+1。', - yinfengjia_skill:'引蜂甲', - zheji:'折戟', - zheji_info:'此牌的使用目标为其他角色。这是一把坏掉的武器...', - wufengjian:'无锋剑', - wufengjian_info:'此牌的使用目标为其他角色。锁定技,当你使用【杀】时,你弃置一张不为装备区内【无锋剑】的牌。', - wufengjian_skill:'无锋剑', - yajiaoqiang_skill:'涯角枪', - yajiaoqiang:'涯角枪', - yajiaoqiang_info:'当你于一名其他角色的回合内第一次使用的黑色牌结算完成后,你可以获得此牌对应的所有实体牌。', - numa:'驽马', - numa_info:'此牌的使用目标为其他角色。锁定技,当此牌进入你的装备区时,你弃置装备区内的所有其他牌。', - caochuan:'草船借箭', - caochuan_info:'当带有「伤害」标签的基本牌或普通锦囊牌对你生效前,对此牌使用。抵消此牌对你产生的效果。当此牌结算完成后,你获得此牌对应的所有实体牌。', - jiejia:'解甲归田', - jiejia_info:'出牌阶段,对一名装备区内有牌的角色使用。该角色获得其装备区内的所有牌。', - kaihua:'树上开花', - kaihua_info:'出牌阶段,对包含你自己在内的一名角色使用。目标角色弃置一至两张牌,然后摸等量的牌。若其以此法弃置了装备牌,则多摸一张牌。', - zhulu_card:'逐鹿天下', - zhulu_card_info:'出牌阶段,对所有角色使用。你从牌堆和弃牌堆亮出等同于目标角色数的装备牌,每名目标角色将其中一张牌置于自己的装备区。', + translate: { + jinhe: "锦盒", + jinhe_info: + "此牌的使用目标为其他角色。当你使用【锦盒】时,你将原有的与此牌对应的「礼」置入弃牌堆(若有),然后观看牌堆顶的两张牌并将其中一张置于游戏外与此牌对应,称之为「礼」。
              出牌阶段,你可以将与此牌对应的「礼」置入弃牌堆,然后弃置【锦盒】以及所有与「礼」花色相同的手牌。当此牌因其他原因进入弃牌堆后,你将与此牌对应的「礼」置入弃牌堆并弃置所有手牌。", + jinhe_skill: "锦盒", + jinhe_lose: "锦盒", + yexingyi: "夜行衣", + yexingyi_info: "锁定技,你不是黑色锦囊牌的合法目标。", + nvzhuang: "女装", + nvzhuang_info: + "此牌的使用目标为其他角色。锁定技,当此牌进入或离开你的装备区时,若你的性别为男性,你弃置一张不为此牌的牌。", + yinfengjia: "引蜂甲", + yinfengjia_info: "此牌的使用目标为其他角色。锁定技,当你受到锦囊牌造成的伤害时,此伤害+1。", + yinfengjia_skill: "引蜂甲", + zheji: "折戟", + zheji_info: "此牌的使用目标为其他角色。这是一把坏掉的武器...", + wufengjian: "无锋剑", + wufengjian_info: + "此牌的使用目标为其他角色。锁定技,当你使用【杀】时,你弃置一张不为装备区内【无锋剑】的牌。", + wufengjian_skill: "无锋剑", + yajiaoqiang_skill: "涯角枪", + yajiaoqiang: "涯角枪", + yajiaoqiang_info: + "当你于一名其他角色的回合内第一次使用的黑色牌结算完成后,你可以获得此牌对应的所有实体牌。", + numa: "驽马", + numa_info: + "此牌的使用目标为其他角色。锁定技,当此牌进入你的装备区时,你弃置装备区内的所有其他牌。", + caochuan: "草船借箭", + caochuan_info: + "当带有「伤害」标签的基本牌或普通锦囊牌对你生效前,对此牌使用。抵消此牌对你产生的效果。当此牌结算完成后,你获得此牌对应的所有实体牌。", + jiejia: "解甲归田", + jiejia_info: "出牌阶段,对一名装备区内有牌的角色使用。该角色获得其装备区内的所有牌。", + kaihua: "树上开花", + kaihua_info: + "出牌阶段,对包含你自己在内的一名角色使用。目标角色弃置一至两张牌,然后摸等量的牌。若其以此法弃置了装备牌,则多摸一张牌。", + zhulu_card: "逐鹿天下", + zhulu_card_info: + "出牌阶段,对所有角色使用。你从牌堆和弃牌堆亮出等同于目标角色数的装备牌,每名目标角色将其中一张牌置于自己的装备区。", }, - list:[ - ['diamond',3,'jiejia'], - ['diamond',4,'shan'], - ['diamond',5,'yajiaoqiang'], - ['diamond',6,'sha'], - ['diamond',8,'shan'], - ['diamond',9,'kaihua'], - ['diamond',10,'yinfengjia'], - ['diamond',11,'sha'], + list: [ + ["diamond", 3, "jiejia"], + ["diamond", 4, "shan"], + ["diamond", 5, "yajiaoqiang"], + ["diamond", 6, "sha"], + ["diamond", 8, "shan"], + ["diamond", 9, "kaihua"], + ["diamond", 10, "yinfengjia"], + ["diamond", 11, "sha"], - ['club',3,'jiejia'], - ['club',4,'sha','thunder'], - ['club',5,'zheji'], - ['club',6,'jiu'], - ['club',8,'jiu'], - ['club',9,'zhulu_card'], - ['club',10,'jinhe'], - ['club',11,'sha'], + ["club", 3, "jiejia"], + ["club", 4, "sha", "thunder"], + ["club", 5, "zheji"], + ["club", 6, "jiu"], + ["club", 8, "jiu"], + ["club", 9, "zhulu_card"], + ["club", 10, "jinhe"], + ["club", 11, "sha"], - ['heart',3,'sha','fire'], - ['heart',4,'shan'], - ['heart',5,'numa'], - ['heart',6,'tao'], - ['heart',8,'shan'], - ['heart',9,'kaihua'], - ['heart',10,'nvzhuang'], - ['heart',11,'kaihua'], + ["heart", 3, "sha", "fire"], + ["heart", 4, "shan"], + ["heart", 5, "numa"], + ["heart", 6, "tao"], + ["heart", 8, "shan"], + ["heart", 9, "kaihua"], + ["heart", 10, "nvzhuang"], + ["heart", 11, "kaihua"], - ['spade',3,'caochuan'], - ['spade',4,'sha','thunder'], - ['spade',5,'wufengjian'], - ['spade',6,'caochuan'], - ['spade',8,'sha'], - ['spade',9,'sha'], - ['spade',10,'yexingyi'], - ['spade',11,'sha'], + ["spade", 3, "caochuan"], + ["spade", 4, "sha", "thunder"], + ["spade", 5, "wufengjian"], + ["spade", 6, "caochuan"], + ["spade", 8, "sha"], + ["spade", 9, "sha"], + ["spade", 10, "yexingyi"], + ["spade", 11, "sha"], ], - } + }; });