'use strict'; game.import('card',function(lib,game,ui,get,ai,_status){ return { name:'standard', connect:true, card:{ damage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1 } } }, losehp:{ ai:{ result:{ target:-1.5 }, tag:{ loseHp:1 } } }, recover:{ ai:{ result:{ target:1.5 }, tag:{ recover:1 } } }, firedamage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1, fireDamage:1, natureDamage:1, } } }, thunderdamage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1, thunderDamage:1, natureDamage:1, } } }, icedamage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1, iceDamage:1, natureDamage:1, } } }, respondShan:{ ai:{ result:{ target:-1.5, }, tag:{ respond:1, respondShan:1, damage:1 } } }, sha:{ audio:true, fullskin:true, nature:['thunder','fire','kami','ice'], type:'basic', enable:true, usable:1, updateUsable:'phaseUse', global:'icesha_skill', range:function(card,player,target){ return player.inRange(target); }, selectTarget:1, cardPrompt:function(card){ var natures=get.natureList(Array.isArray(card)?card[3]:card); if(lib.translate['sha_nature_'+natures[0]+'_info']) return lib.translate['sha_nature_'+natures[0]+'_info']; var str='出牌阶段,对你攻击范围内的一名角色使用。其须使用一张【闪】,'; if(natures.includes('stab')){ 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; } 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+'张闪)'); } else if(event.card.hasNature('stab')){ next.set('prompt2','(在此之后仍需弃置一张手牌)'); } next.set('ai1',function(card){ var target=_status.event.player; var evt=_status.event.getParent(); var bool=true; if(_status.event.shanRequired>1&&!get.is.object(card)&&target.countCards('h','shan')<_status.event.shanRequired){ bool=false; } else if(target.hasSkillTag('useShan')){ bool=true; } else if(target.hasSkillTag('noShan')){ bool=false; } else if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) bool=false; if(bool){ return get.order(card); } return 0; }).set('shanRequired',event.shanRequired); next.set('respondTo',[player,card]); //next.autochoose=lib.filter.autoRespondShan; } "step 2" if(!result||!result.bool||!result.result||result.result!='shaned'){ event.trigger('shaHit'); } else{ event.shanRequired--; if(event.shanRequired>0){ event.goto(1); } else if(event.card.hasNature('stab')&&target.countCards('h')>0){ event.responded=result; event.goto(4); } else{ event.trigger('shaMiss'); event.responded=result; } } "step 3" if((!result||!result.bool||!result.result||result.result!='shaned')&&!event.unhurt){ target.damage(get.nature(event.card)); 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){ target.damage(get.nature(event.card)); event.result={bool:true} event.trigger('shaDamage'); event.finish(); } else{ event.trigger('shaMiss'); } "step 6" if((!result||!result.bool)&&!event.unhurt){ target.damage(get.nature(event.card)); event.result={bool:true} event.trigger('shaDamage'); event.finish(); } 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.filter(function(target){ return target.hasShan()&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.nature(card))>0; })) base+=5; } if(get.cardtag(card,'yingbian_all')){ if(game.hasPlayer(function(current){ return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; })) base+=5; } if(get.cardtag(card,'yingbian_damage')){ if(targets.filter(function(target){ return get.attitude(player,target)<0&&(hit||!target.mayHaveShan()||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(target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{ target:target, card:card, },true)) 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], }, order:function(item,player){ if(player.hasSkillTag('presha',true,null,true)) return 10; if(item.hasNature('linked')){ if(game.hasPlayer(function(current){ return current!=player&¤t.isLinked()&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0&&lib.card.sha.ai.canLink(player,current,item); })&&game.countPlayer(function(current){ return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0; })>1) return 3.1; return 3; } return 3.05; }, result:{ target:function(player,target,card,isLink){ var eff=function(){ if(!isLink&&player.hasSkill('jiu')){ if(!target.hasSkillTag('filterDamage',null,{ player:player, card:card, jiu:true, })){ if(get.attitude(player,target)>0){ return -7; } else{ return -4; } } return -0.5; } return -1.5; }(); if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{ target:target, card:card, },true)) return eff/1.2; return eff; }, }, tag:{ respond:1, respondShan:1, damage:function(card){ if(card.hasNature('poison')) return; return 1; }, natureDamage:function(card){ if(card.hasNature()) return 1; }, fireDamage:function(card,nature){ if(card.hasNature('fire')) return 1; }, thunderDamage:function(card,nature){ if(card.hasNature('thunder')) return 1; }, poisonDamage:function(card,nature){ if(card.hasNature('poison')) return 1; } } } }, shacopy:{ ai:{ basic:{ useful:[5,3,1], value:[5,3,1], }, order:3, result:{ target:-1.5, }, tag:{ respond:1, respondShan:1, damage:function(card){ if(card.hasNature('poison')) return; return 1; }, natureDamage:function(card){ if(card.hasNature()) return 1; }, fireDamage:function(card,nature){ if(card.hasNature('fire')) return 1; }, thunderDamage:function(card,nature){ if(card.hasNature('thunder')) return 1; }, poisonDamage:function(card,nature){ if(card.hasNature('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; game.delay(0.5); }, ai:{ order:3, basic:{ useful:[7,5.1,2], value:[7,5.1,2], }, result:{player:1}, //expose:0.2 } }, tao:{ fullskin:true, type:'basic', cardcolor:'red', toself:true, enable:function(card,player){ return player.hp=2&&target.countCards('h','tao')<=1){ keep=true; } var mode=get.mode(); if(target.hp>=2&&keep&&target.hasFriend()){ if(target.hp>2||nd==0) return 0; if(target.hp==2){ if(game.hasPlayer(function(current){ if(target!=current&&get.attitude(target,current)>=3){ if(current.hp<=1) return true; if((mode=='identity'||mode=='versus'||mode=='chess')&¤t.identity=='zhu'&¤t.hp<=2) return true; } })){ return 0; } } } if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; var att=get.attitude(player,target); if(att<3&&att>=0&&player!=target) return 0; var tri=_status.event.getTrigger(); if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){ var num=game.countPlayer(function(current){ if(current.identity=='fan'){ return current.countCards('h','tao'); } }); if(num>1&&player==target) return 2; return 0; } } if(mode=='identity'&&player.identity=='zhu'&&target.identity=='nei'){ if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='zhong'){ return 0; } } 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, } } }, 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; }, 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){ return 10; } } var num=player.countCards('h','sha'); if(num>1) return 6+num; return 3+num; }(); delete player._zhuge_temp; return result; }, 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); }, basic:{ equipValue:3.5 } }, skills:['qinglong_skill','qinglong_guozhan'] }, 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:['zhangba_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); }, 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(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(),sorter=(_status.currentPhase||player); evt.fixedSeat=true; evt.targets.sortBySeat(sorter); evt.targets.reverse(); if(evt.targets[evt.targets.length-1]==sorter){ evt.targets.unshift(evt.targets.pop()); } } "step 2" ui.clear(); var num; if(event.targets){ num=event.targets.length; } else{ num=game.countPlayer(); } if(card.storage&&typeof card.storage.extraCardsNum=='number') num+=card.storage.extraCardsNum; var cards=get.cards(num); game.cardsGotoOrdering(cards).relatedEvent=event.getParent(); 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); }, content:function(){ "step 0" for(var i=0;i1){ 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); } else{ event.directButton=event.dialog.buttons[0]; } "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; break; } } if(!card) card=event.dialog.buttons[0].link; } var button; for(var i=0;i0?0.5:0.7; } }, 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){ //return target.hp=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; } "step 1" if(result.bool==false){ target.damage(); } }, 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 }, result:{ target_use:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 return -1.5; }, target:function(player,target){ var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 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; }, content:function(){ "step 0" if(typeof event.baseDamage!='number') event.baseDamage=1; if(event.directHit) event._result={bool:false}; else{ var next=target.chooseToRespond({name:'shan'}); 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); }); next.autochoose=lib.filter.autoRespondShan; } "step 1" if(result.bool==false){ target.damage(); } }, 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 }, result:{ target_use:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 return -1.5; }, target:function(player,target){ var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 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; }, modTarget:true, content:function(){ if(get.is.versus()){ if(game.friend.contains(target)){ if(game.friend.lengthgame.enemy.length){ target.draw(3);return; } } } target.draw(2); }, ai:{ basic:{ order:7.2, useful:4.5, value:9.2 }, result:{ target: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; } 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){ var event=_status.event; var player=event.splayer; var target=event.starget; if(player.hasSkillTag('notricksource')) return 0; if(target.hasSkillTag('notrick')) return 0; if(event.shaRequired>1&&player.countCards('h','sha')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(event.turn==target){ target.damage(); } else{ player.damage(target); } } } }, ai:{ wuxie:function(target,card,player,viewer){ if(player==game.me&&get.attitude(viewer,player)>0){ return 0; } }, basic:{ order:5, useful:1, value:5.5 }, result:{ target:-1.5, player:function(player,target,card){ if(player.hasSkillTag('directHit_ai',true,{ target:target, card:card, },true)){ return 0; } if(get.damageEffect(target,player,target)>0&&get.attitude(player,target)>0&&get.attitude(target,player)>0){ return 0; } var hs1=target.getCards('h','sha'); var hs2=player.getCards('h','sha'); if(hs1.length>hs2.length+1){ return -2; } var hsx=target.getCards('h'); if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){ return -2; } if(hsx.length>3&&hs2.length==0){ return -2; } if(hs1.length>hs2.length&&(!hs2.length||hs1[0].number>hs2[0].number)){ return -2; } return -0.5; } }, 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'); }, filterTarget:function(card,player,target){ if(player==target) return false; return target.countGainableCards(player,get.is.single()?'he':'hej')>0; }, content:function(){ var position=get.is.single()?'he':'hej'; if(target.countGainableCards(player,position)){ player.gainPlayerCard(position,target,true); } }, ai:{ wuxie:function(target,card,player,viewer){ if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){ return 0; } }, basic:{ order:7.5, useful:4, value:9 }, 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)?-1.5:1.5; 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:-1.5; }, player:function(player,target){ 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){ 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:-1.5; } return 1; } }, tag:{ loseCard:1, gain:1, } } }, shunshou_copy:{ ai:{ basic:{ order:7.5, useful:4, value:9 }, 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)?-1.5:1.5; 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:-1.5; }, player:function(player,target){ 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){ 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:-1.5; } return 1; } }, tag:{ loseCard:1, gain:1, } } }, shunshou_copy2:{ ai:{ basic:{ order:7.5, useful:4, value:9 }, 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)?-1.5:1.5; return (target.countCards('e',function(card){ return get.value(card,target)<=0; })>0)?1.5:-1.5; }, player:function(player,target){ 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){ 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:-1.5; } return 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.countDiscardableCards(player,get.is.single()?'he':'hej'); }, defaultYingbianEffect:'add', content:function(){ 'step 0' if(!get.is.single()&&target.countDiscardableCards(player,'hej')){ player.discardPlayerCard('hej',target,true); event.finish(); } else{ var bool1=target.countDiscardableCards(player,'h'); var 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?'手牌区':'装备区'}; } 'step 1' var pos=result.control=='手牌区'?'h':'e'; player.discardPlayerCard(target,pos,true,'visible'); }, ai:{ basic:{ order:9, useful:5, value:5, }, yingbian:function(card,player,targets,viewer){ if(get.attitude(viewer,player)<=0) return 0; if(game.hasPlayer(function(current){ return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; })) return 6; return 0; }, result:{ target:function(player,target){ var att=get.attitude(player,target); var nh=target.countCards('h'); if(att>0){ if(target.countCards('j',function(card){ var cardj=card.viewAs?{name:card.viewAs}:card; return get.effect(target,cardj,target,player)<0; })>0) return 3; if(target.getEquip('baiyin')&&target.isDamaged()&& get.recoverEffect(target,player,player)>0){ if(target.hp==1&&!target.hujia) return 1.6; } if(target.countCards('e',function(card){ if(get.position(card)=='e') return get.value(card,target)<0; })>0) return 1; } var es=target.getCards('e'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.filter(function(esx){ return get.value(esx,target)>0; }).length==0); var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&(noe||noe2)) return 0; if(att<=0&&!target.countCards('he')) return 1.5; return -1.5; }, }, tag:{ loseCard:1, discard:1 } } }, guohe_copy:{ ai:{ basic:{ order:9, useful:5, value:5, }, result:{ target:function(player,target){ var att=get.attitude(player,target); var nh=target.countCards('h'); if(att>0){ if(target.countCards('j',function(card){ var cardj=card.viewAs?{name:card.viewAs}:card; return get.effect(target,cardj,target,player)<0; })>0) return 3; if(target.getEquip('baiyin')&&target.isDamaged()&& get.recoverEffect(target,player,player)>0){ if(target.hp==1&&!target.hujia) return 1.6; } if(target.countCards('e',function(card){ if(get.position(card)=='e') return get.value(card,target)<0; })>0) return 1; } var es=target.getCards('e'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.filter(function(esx){ return get.value(esx,target)>0; }).length==0); var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&(noe||noe2)) return 0; if(att<=0&&!target.countCards('he')) return 1.5; return -1.5; }, }, tag:{ loseCard:1, discard:1 } } }, guohe_copy2:{ ai:{ basic:{ order:9, useful:5, value:5, }, result:{ target:function(player,target){ var att=get.attitude(player,target); var nh=target.countCards('h'); if(att>0){ if(target.getEquip('baiyin')&&target.isDamaged()&& get.recoverEffect(target,player,player)>0){ if(target.hp==1&&!target.hujia) return 1.6; } if(target.countCards('e',function(card){ if(get.position(card)=='e') return get.value(card,target)<0; })>0) return 1; } var es=target.getCards('e'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.filter(function(esx){ return get.value(esx,target)>0; }).length==0); var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&(noe||noe2)) return 0; if(att<=0&&!target.countCards('he')) return 1.5; return -1.5; }, }, 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); }) } }); }, 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.contains(_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'); } }, ai:{ wuxie:function(target,card,player,viewer){ if(player==game.me&&get.attitude(viewer,player)>0){ return 0; } }, basic:{ order:8, value:2, useful:1, }, result:{ target:-1.5, player:function(player){ if(player.getCards('he',{subtype:'equip1'}).length) return 0; return 1.5; }, }, 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], }, 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; } }, content:function(){ var trigger=event.getParent(2)._trigger; if(trigger.name=='phaseJudge'){ trigger.untrigger(); trigger.cancelled=true; } else{ trigger.neutralize(); if(event.getParent().guowuxie==true){ trigger.getParent().excluded.addArray(game.filterPlayer(function(current){ return current.isFriendOf(trigger.target); })); } } /* event.result={ wuxied:true, directHit:evt.directHit||[], nowuxie:evt.nowuxie, };*/ 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()){ 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; return -2; }, judge2:function(result){ if(result.bool==false) return true; return false; }, effect:function(){ if(result.bool==false){ player.skip('phaseUse'); } }, ai:{ basic:{ order:1, useful:1, value:8, }, result:{ ignoreStatus:true, target:function(player,target){ var num=target.hp-target.countCards('h')-2; if(num>-1) return -0.01; if(target.hp<3) num--; if(target.isTurnedOver()) num/=2; var dist=get.distance(player,target,'absolute'); if(dist<1) dist=1; return num/Math.sqrt(dist)*get.threaten(target,player); } }, 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){ return player.canAddJudge(card); }, 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; return 1; }, judge2:function(result){ if(result.bool==false) return true; return false; }, effect:function(){ if(result.bool==false){ player.damage(3,'thunder','nosource'); } else{ player.addJudgeNext(card); } }, cancel:function(){ player.addJudgeNext(card); }, ai:{ basic:{ order:1, useful:0, value:0, }, 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){ return rejudge; } 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; } 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'; })){ 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:1, // natureDamage:1, // thunderDamage:1, } } }, 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'; }, content:function(){ if(!_status.qinglong_guozhan) _status.qinglong_guozhan=[]; _status.qinglong_guozhan.add(trigger); 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'); event.next.remove(next); trigger.after.add(next); 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}; })); }); } }, 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.contains(player)) return true; } } return false; }, } }, 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; }, //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; 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(num>=2) return true; return false; }, logTarget:"player", content:function(){ "step 0" trigger.cancel(); "step 1" if(trigger.player.countDiscardableCards(player,'he')){ player.line(trigger.player); player.discardPlayerCard('he',trigger.player,true); } "step 2" if(trigger.player.countDiscardableCards(player,'he')){ player.line(trigger.player); player.discardPlayerCard('he',trigger.player,true); } } }, icesha_skill:{ inherit:'hanbing_skill', trigger:{source:'damageBegin2'}, 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') }, content:function(){ trigger.cancel(); }, ai:{ effect:{ target:function(card,player,target){ 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=='sha'&&get.color(card)=='black') return 'zerotarget'; } } } }, 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; }, 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.contains(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.contains(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); delete _status.zhuge_temp; 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'); }, 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(); } }, qinggang_skill:{ equipSkill:true, audio:true, trigger:{ player:'useCardToPlayered', }, filter:function(event){ return event.card.name=='sha'; }, forced:true, logTarget:'target', content:function(){ trigger.target.addTempSkill('qinggang2'); trigger.target.storage.qinggang2.add(trigger.card); trigger.target.markSkill('qinggang2'); }, 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.contains(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.contains(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){ if(card.name=='sha') return 0; return 5-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.contains(card)) return true; return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.contains(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.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'){ trigger.untrigger(); 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.contains(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; 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]; }, 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); return 0; }); "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; return true; }, audio:true, check:function(event,player){ if(event&&(event.ai||event.ai1)){ var ai=event.ai||event.ai1; var tmp=_status.event; _status.event=event; var result=ai({name:'shan'},_status.event.player,event); _status.event=tmp; return result>0; } 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){ return result.bool; }; "step 1" if(result.judge>0){ trigger.untrigger(); trigger.set('responded',true); trigger.result={bool:true,card:{name:'shan',isCard:true}} } }, ai:{ respondShan: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; } } } }, _wuxie:{ trigger:{player:['useCardToBegin','phaseJudge']}, priority:5, popup:false, forced: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, 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); //如果对拼无懈,获取历史数据 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; } } } map.card=card; map.state=state?1:-1; map.id2=trigger.getParent().id; event._global_waiting=true; //发送函数 event.send=function(player,map,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); } } else if(evtmap.target){ prompt+='对'; prompt+=(evtmap.target==evtmap.player?'自己':get.translation(evtmap.target)); } 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); } 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'); }, 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){ return 0; } } if(name=='bingliang'&&source.countCards('j')>0&&source.countCards('h')>=source.hp-1){ return 0; } var card2; if(name!=card.name){ card2={name:name}; } 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)){ 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; } if(info.multitarget&&targets){ var eff=0; for(var i=0;i1&&!trigger.multitarget); event.filterCard=function(card,player){ if(get.name(card)!='wuxie') return false; return lib.filter.cardEnabled(card,player,'forceEnable'); }; event.send=function(player,state,isJudge,card,source,target,targets,id,id2,tempnowuxie,skillState,respondInfo){ if(skillState){ player.applySkills(skillState); } state=state?1:-1; var str=''; if(isJudge){ str+=get.translation(source)+'的'; } if(isJudge){ str+=get.translation(card,'viewAs'); } else{ str+=get.translation(card); } if((targets||target)&&!isJudge){ str+='对'+get.translation(targets||target); } str+='将'+(state>0?'生效':'失效')+',是否无懈?'; if(player.isUnderControl(true)&&!_status.auto&&!ui.tempnowuxie&&tempnowuxie){ var translation=get.translation(card.name); if(translation.length>=4){ translation=lib.translate[card.name+'_ab']||translation.slice(0,2); } ui.tempnowuxie=ui.create.control('不无懈'+translation,ui.click.tempnowuxie,'stayleft'); ui.tempnowuxie._origin=id2; } var next=player.chooseToUse({ filterCard:function(card,player){ if(get.name(card)!='wuxie') return false; return lib.filter.cardEnabled(card,player,'forceEnable'); }, prompt:str, type:'wuxie', state:state, _global_waiting:true, ai1:function(){ if(isJudge){ 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){ return 0; } } var card2; if(name!=card.name){ card2={name:name}; } 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(target){ var triggerevent=_status.event.getTrigger(); if(triggerevent&&triggerevent.parent&& triggerevent.parent.postAi&& triggerevent.player.isUnknown(_status.event.player)){ return 0; } 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:'防止即将造成的伤害,改为依次弃置其两张牌。', 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"], ["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'], ], }; });