diff --git a/card/extra.js b/card/extra.js index da4226fad..1c448da2b 100644 --- a/card/extra.js +++ b/card/extra.js @@ -67,7 +67,7 @@ card.extra={ }, }, order:function(){ - return ai.get.order({name:'sha'})+0.2; + return get.order({name:'sha'})+0.2; }, result:{ target:function(player,target){ @@ -94,10 +94,10 @@ card.extra={ } if(card){ if(game.hasPlayer(function(current){ - return (ai.get.attitude(target,current)<0&& + return (get.attitude(target,current)<0&& target.canUse(card,current,true,true)&& !current.getEquip('baiyin')&& - ai.get.effect(current,card,target)>0); + get.effect(current,card,target)>0); })){ return 1; } @@ -128,7 +128,7 @@ card.extra={ var rand=Math.random()<0.5; target.chooseCard(true).ai=function(card){ if(rand) return Math.random(); - return ai.get.value(card); + return get.value(card); }; "step 1" event.dialog=ui.create.dialog(get.translation(target)+'展示的手牌',result.cards); @@ -140,8 +140,8 @@ card.extra={ game.log(target,'展示了',event.card2); player.chooseToDiscard({suit:get.suit(event.card2)},function(card){ var evt=_status.event.getParent(); - if(ai.get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){ - return 7-ai.get.value(card,evt.player); + if(get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){ + return 7-get.value(card,evt.player); } return -1; }).prompt=false; @@ -164,7 +164,7 @@ card.extra={ useful:1, }, wuxie:function(target,card,player,current,state){ - if(ai.get.attitude(current,player)>=0&&state>0) return false; + if(get.attitude(current,player)>=0&&state>0) return false; }, result:{ player:function(player){ @@ -231,10 +231,10 @@ card.extra={ result:{ target:function(player,target){ if(target.isLinked()) return 1; - if(ai.get.attitude(player,target)>=0) return -1; + if(get.attitude(player,target)>=0) return -1; if(ui.selected.targets.length) return -1; if(game.hasPlayer(function(current){ - return ai.get.attitude(player,current)<=-1&¤t!=target&&!current.isLinked(); + return get.attitude(player,current)<=-1&¤t!=target&&!current.isLinked(); })){ return -1; } @@ -320,9 +320,9 @@ card.extra={ equipValue:function(card,player){ if(player.hasSkillTag('maixie')&&player.hp>1) return 0; if(player.hasSkillTag('noDirectDamage')) return 10; - if(ai.get.damageEffect(player,player,player,'fire')>=0) return 10; + if(get.damageEffect(player,player,player,'fire')>=0) return 10; var num=3-game.countPlayer(function(current){ - return ai.get.attitude(current,player)<0; + return get.attitude(current,player)<0; }); if(player.hp==1) num+=4; if(player.hp==2) num+=1; @@ -491,7 +491,7 @@ card.extra={ }, audio:true, check:function(event,player){ - var att=ai.get.attitude(player,event.target); + var att=get.attitude(player,event.target); if(event.target.hasSkillTag('nofire')){ return att>0; } diff --git a/card/gujian.js b/card/gujian.js index 39d65fa2b..16d86c82d 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -42,7 +42,7 @@ card.gujian={ result:{ target:function(player,target){ var evt=_status.event.getTrigger(); - var eff=ai.get.damageEffect(target,evt.source,target,evt.nature); + var eff=get.damageEffect(target,evt.source,target,evt.nature); if(eff>0) return -1; if(eff<0) return 2; return 0; @@ -450,7 +450,7 @@ card.gujian={ content:function(){ 'step 0' target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); } 'step 1' if(result.bool){ @@ -466,7 +466,7 @@ card.gujian={ var cards=player.getCards('he'); var num=-1; for(var i=0;i=8) return -100; return num-value; }; @@ -635,7 +635,7 @@ card.gujian={ } else{ target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }; } "step 1" @@ -693,7 +693,7 @@ card.gujian={ player:function(player,target){ return game.countPlayer(function(current){ if(current==target||(get.distance(target,current,'pure')==1&¤t.countCards('he'))){ - var att=ai.get.attitude(player,current); + var att=get.attitude(player,current); if(att>0){ return -1; } @@ -830,7 +830,7 @@ card.gujian={ value:5, result:{ player:function(player,target){ - if(ai.get.attitude(player,target)==0) return 0; + if(get.attitude(player,target)==0) return 0; return 1; } } @@ -1016,7 +1016,7 @@ card.gujian={ return player.countCards('he',{suit:'heart'})>0; }, prompt:'将一张红桃牌当桃使用', - check:function(card){return 10-ai.get.value(card)}, + check:function(card){return 10-get.value(card)}, ai:{ skillTagFilter:function(player){ return player.countCards('he',{suit:'heart'})>0; @@ -1092,7 +1092,7 @@ card.gujian={ ai:{ effect:{ target:function(card,player,target){ - if(card.name=='sha'&&ai.get.attitude(player,target)<0) return 0.5; + if(card.name=='sha'&&get.attitude(player,target)<0) return 0.5; } } } @@ -1357,10 +1357,10 @@ card.gujian={ if(!player.countCards('h')) return false; }, prompt:'将一张手牌当杀使用', - check:function(card){return 5-ai.get.value(card)}, + check:function(card){return 5-get.value(card)}, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; @@ -1409,7 +1409,7 @@ card.gujian={ order:6, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; @@ -1464,7 +1464,7 @@ card.gujian={ order:6, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; @@ -1502,7 +1502,7 @@ card.gujian={ order:6, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; diff --git a/card/guozhan.js b/card/guozhan.js index 0e5dfe2ed..3718e2c2f 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -16,7 +16,7 @@ card.guozhan={ equipValue:function(card,player){ if(player.hasSkill('zhangwu')) return 9; if(game.hasPlayer(function(current){ - return current.hasSkill('zhangwu')&&ai.get.attitude(player,current)<=0; + return current.hasSkill('zhangwu')&&get.attitude(player,current)<=0; })){ return 1; } @@ -37,7 +37,7 @@ card.guozhan={ equipValue:function(card,player){ if(player.hasSkill('wendao')) return 9; if(game.hasPlayer(function(current){ - return current.hasSkill('wendao')&&ai.get.attitude(player,current)<=0; + return current.hasSkill('wendao')&&get.attitude(player,current)<=0; })){ return 1; } @@ -103,7 +103,7 @@ card.guozhan={ content:function(){ 'step 0' target.chooseControl('discard_card','take_damage',function(event,player){ - if(ai.get.damageEffect(player,event.player,player,'thunder')>=0){ + if(get.damageEffect(player,event.player,player,'thunder')>=0){ return 'take_damage'; } if(player.hp>=3&&player.countCards('e')>=2){ @@ -172,10 +172,10 @@ card.guozhan={ return game.countPlayer(function(current){ if(target.isMajor()==current.isMajor()){ if(current.isLinked()){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } else{ - return -ai.get.attitude(player,target)*0.8; + return -get.attitude(player,target)*0.8; } } }); @@ -299,10 +299,10 @@ card.guozhan={ }, result:{ player:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target.hp==1&&att<0) return 0; if(game.hasPlayer(function(current){ - return ai.get.attitude(player,current)0){ player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }); } else{ @@ -1086,11 +1086,11 @@ card.guozhan={ return get.distance(damaged,target)<=1&&target!=damaged; }, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ var player=_status.event.player; - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }, prompt:get.prompt('sanjian') }).set('damaged',damaged); diff --git a/card/hearth.js b/card/hearth.js index dadaca374..a83d83274 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -100,12 +100,12 @@ card.hearth={ var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&noe) return 0; if(noh&&noe2) return 0.01; - if(ai.get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; + if(get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; 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&&ai.get.effect(target,jj,target,player)>=0){ + if(js.length==1&&get.effect(target,jj,target,player)>=0){ return 0; } return 3; @@ -196,7 +196,7 @@ card.hearth={ var rand=Math.random()<0.5; target.chooseCard(true).ai=function(card){ if(rand) return Math.random(); - return ai.get.value(card); + return get.value(card); }; "step 1" event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards); @@ -207,8 +207,8 @@ card.hearth={ player.chooseToDiscard(function(card){ return get.suit(card)==get.suit(_status.event.parent.card2); },function(card){ - if(ai.get.damageEffect(target,player,player,'thunder')>0){ - return 6-ai.get.value(card,_status.event.player); + if(get.damageEffect(target,player,player,'thunder')>0){ + return 6-get.value(card,_status.event.player); } return -1; }).prompt=false; @@ -230,7 +230,7 @@ card.hearth={ useful:1, }, wuxie:function(target,card,player,current,state){ - if(ai.get.attitude(current,player)>=0&&state>0) return false; + if(get.attitude(current,player)>=0&&state>0) return false; }, result:{ player:function(player){ @@ -571,7 +571,7 @@ card.hearth={ useful:[6,3], result:{ target:function(player,target){ - var eff=ai.get.recoverEffect(target,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; @@ -595,7 +595,7 @@ card.hearth={ content:function(){ "step 0" target.chooseToDiscard([1,2],'he').ai=function(card){ - if(ai.get.damageEffect(target,player,target,'thunder')>=0){ + if(get.damageEffect(target,player,target,'thunder')>=0){ if(target.hasSkillTag('maixie')){ if(ui.selected.cards.length) return 0; } @@ -608,9 +608,9 @@ card.hearth={ if(card.name=='tao') return 0; if(target.hp==1&&card.name=='jiu') return 0; if(get.type(card)!='basic'){ - return 10-ai.get.value(card); + return 10-get.value(card); } - return 8-ai.get.value(card); + return 8-get.value(card); }; "step 1" if(!result.bool||result.cards.length<2){ diff --git a/card/sp.js b/card/sp.js index 3dcb41572..a6d86be87 100644 --- a/card/sp.js +++ b/card/sp.js @@ -85,10 +85,10 @@ card.sp={ var card=target.getEquip(i); if(card){ if(i==1||i==4){ - num1+=ai.get.equipValue(card); + num1+=get.equipValue(card); } else{ - num2+=ai.get.equipValue(card); + num2+=get.equipValue(card); } } } @@ -170,7 +170,7 @@ card.sp={ ai:{ equipValue:function(card,player){ if(game.hasPlayer(function(current){ - return player.canUse('sha',current)&¤t.isHealthy()&&ai.get.attitude(player,current)<0; + return player.canUse('sha',current)&¤t.isHealthy()&&get.attitude(player,current)<0; })){ return 5; } @@ -326,7 +326,7 @@ card.sp={ var hs=player.getCards('h'); if(hs.length<=1) return 0; for(var i=0;i2); event.more=true; } @@ -407,7 +407,7 @@ card.sp={ player:function(player,target){ return game.countPlayer(function(current){ if(get.distance(target,current)<=1&¤t!=target){ - var att=ai.get.attitude(player,current); + var att=get.attitude(player,current); if(att>3){ return 1.1; } @@ -438,7 +438,7 @@ card.sp={ }, prompt:'将一张手牌当闪打出', check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ respondShan:true, @@ -476,9 +476,9 @@ card.sp={ }, check:function(event,player){ var target=event.target; - if(ai.get.attitude(player,target)>=0) return false; + if(get.attitude(player,target)>=0) return false; if(player.hasCard(function(card){ - return ai.get.value(card)>=8; + return get.value(card)>=8; })){ return false; } @@ -511,7 +511,7 @@ card.sp={ }, effect:{ player:function(card,player,target){ - if(card.name=='sha'&&target.isHealthy()&&ai.get.attitude(player,target)>0){ + if(card.name=='sha'&&target.isHealthy()&&get.attitude(player,target)>0){ return [1,-2]; } } @@ -589,10 +589,10 @@ card.sp={ var nh=player.countCards('h'); if(!player.needsToDiscard()){ if(nh<3) return 0; - if(nh==3) return 5-ai.get.value(card); - return 7-ai.get.value(card); + if(nh==3) return 5-get.value(card); + return 7-get.value(card); } - return 10-ai.get.useful(card); + return 10-get.useful(card); }, discard:false, lose:true, @@ -638,7 +638,7 @@ card.sp={ },muniu,muniu.cards); var players=game.filterPlayer(function(current){ if(!current.getEquip(5)&¤t!=player&&!current.isTurnedOver()&& - ai.get.attitude(player,current)>=3&&ai.get.attitude(current,player)>=3){ + get.attitude(player,current)>=3&&get.attitude(current,player)>=3){ return true; } }); @@ -774,14 +774,14 @@ card.sp={ if(get.type(button.link)=='delay') return -1; if(get.type(button.link)=='equip'){ var current=player.getCards('e',{subtype:get.subtype(button.link)})[0]; - if(current&&ai.get.equipValue(current)>=ai.get.equipValue(button.link)) return -1; + if(current&&get.equipValue(current)>=get.equipValue(button.link)) return -1; return 1; } if(get.tag(button.link,'multitarget')) return -1; if(button.link.name=='huoshaolianying') return -1; } if(button.link.name=='jiu'){ - if(ai.get.effect(player,{name:'jiu'},player)>0){ + if(get.effect(player,{name:'jiu'},player)>0){ return 1; } return -1; @@ -811,7 +811,7 @@ card.sp={ order:4, result:{ player:function(player){ - if(_status.event.dying) return ai.get.attitude(player,_status.event.dying); + if(_status.event.dying) return get.attitude(player,_status.event.dying); return 1; } }, diff --git a/card/standard.js b/card/standard.js index a2be651e6..6b12b3293 100644 --- a/card/standard.js +++ b/card/standard.js @@ -82,10 +82,10 @@ card.standard={ var target=_status.event.player; var evt=_status.event.getParent(); if(target.hasSkillTag('useShan')){ - return 11-ai.get.value(card); + return 11-get.value(card); } - if(ai.get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1; - return 11-ai.get.value(card); + if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1; + return 11-get.value(card); }); next.autochoose=lib.filter.autoRespondShan; } @@ -120,7 +120,7 @@ card.standard={ result:{ target:function(player,target){ if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){ - if(ai.get.attitude(player,target)>0){ + if(get.attitude(player,target)>0){ return -6; } else{ @@ -237,7 +237,7 @@ card.standard={ if(target.hp>2||nd==0) return 0; if(target.hp==2){ if(game.hasPlayer(function(current){ - if(target!=current&&ai.get.attitude(target,current)>=3){ + 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; } @@ -247,7 +247,7 @@ card.standard={ } } if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; - var att=ai.get.attitude(player,target); + 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'){ @@ -335,7 +335,7 @@ card.standard={ basic:{ equipValue:function(card,player){ if(!game.hasPlayer(function(current){ - return player.canUse('sha',current)&&ai.get.effect(current,{name:'sha'},player,player)<0; + return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0; })){ return 1; } @@ -504,7 +504,7 @@ card.standard={ } if(event.dialog.buttons.length>1){ var next=target.chooseButton(true,function(button){ - return ai.get.value(button.link,_status.event.player); + return get.value(button.link,_status.event.player); }); next.set('dialog',event.preResult); next.set('closeDialog',false); @@ -651,10 +651,10 @@ card.standard={ var next=target.chooseToRespond({name:'sha'}); next.set('ai',function(card){ var evt=_status.event.getParent(); - if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; + 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 11-ai.get.value(card); + return 11-get.value(card); }); next.autochoose=lib.filter.autoRespondSha; "step 1" @@ -664,7 +664,7 @@ card.standard={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,target)>0&&target.countCards('h','sha')){ + if(get.attitude(viewer,target)>0&&target.countCards('h','sha')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, @@ -709,10 +709,10 @@ card.standard={ var next=target.chooseToRespond({name:'shan'}); next.set('ai',function(card){ var evt=_status.event.getParent(); - if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; + 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 11-ai.get.value(card); + return 11-get.value(card); }); next.autochoose=lib.filter.autoRespondShan; "step 1" @@ -722,7 +722,7 @@ card.standard={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,target)>0&&target.countCards('h','shan')){ + if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, @@ -818,15 +818,15 @@ card.standard={ if(target.hasSkillTag('notrick')) return 0; if(event.player==target){ if(player.hasSkill('naman')) return -1; - if(ai.get.attitude(target,player)<0||event.player.hp<=1){ - return ai.get.unuseful2(card) + if(get.attitude(target,player)<0||event.player.hp<=1){ + return get.unuseful2(card) } return -1; } else{ if(target.hasSkill('naman')) return -1; - if(ai.get.attitude(player,target)<0||event.player.hp<=1){ - return ai.get.unuseful2(card) + if(get.attitude(player,target)<0||event.player.hp<=1){ + return get.unuseful2(card) } return -1; } @@ -870,7 +870,7 @@ card.standard={ result:{ target:-1.5, player:function(player,target){ - if(ai.get.damageEffect(target,player,target)>0&&ai.get.attitude(player,target)>0&&ai.get.attitude(target,player)>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'); @@ -919,7 +919,7 @@ card.standard={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,player)>0&&ai.get.attitude(viewer,target)>0){ + if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){ return 0; } }, @@ -930,12 +930,12 @@ card.standard={ }, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)<=0) return (target.countCards('he')>0)?-1.5:1.5; + if(get.attitude(player,target)<=0) return (target.countCards('he')>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(jj.name=='shunshou') return 3; - if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + if(js.length==1&&get.effect(target,jj,target,player)>=0){ return -1.5; } return 3; @@ -943,15 +943,15 @@ card.standard={ return -1.5; }, player:function(player,target){ - if(ai.get.attitude(player,target)<0&&!target.countCards('he')){ + if(get.attitude(player,target)<0&&!target.countCards('he')){ return 0; } - if(ai.get.attitude(player,target)>1){ + 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(jj.name=='shunshou') return 1; - if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + if(js.length==1&&get.effect(target,jj,target,player)>=0){ return 0; } return 1; @@ -1000,12 +1000,12 @@ card.standard={ var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&noe) return 0; if(noh&&noe2) return 0.01; - if(ai.get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; + if(get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; var js=target.getCards('j'); if(js.length){ var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; if(jj.name=='guohe') return 3; - if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + if(js.length==1&&get.effect(target,jj,target,player)>=0){ return -1.5; } return 2; @@ -1186,8 +1186,8 @@ card.standard={ for(var j=0;j0&& - ai.get.attitude(current,target)>0){ + if(get.attitude(target,current)>0&& + get.attitude(current,target)>0){ return rejudge; } else{ @@ -1201,7 +1201,7 @@ card.standard={ var mode=get.mode(); if(mode=='identity'){ if(target.identity=='nei') return 1; - var situ=ai.get.situation(); + var situ=get.situation(); if(target.identity=='fan'){ if(situ>1) return 1; } @@ -1270,21 +1270,21 @@ card.standard={ player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.countCards('he')),function(button){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - var eff=ai.get.damageEffect(trigger.target,player,player); - if(ai.get.attitude(player,trigger.target)>0){ + var eff=get.damageEffect(trigger.target,player,player); + if(get.attitude(player,trigger.target)>0){ if(eff>=0) return false; - return 10-ai.get.buttonValue(button); + return 10-get.buttonValue(button); } - if(eff<=0) return ai.get.buttonValue(button); + if(eff<=0) return get.buttonValue(button); if(trigger.target.hp==1) return false; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')|| player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false; if(_status.event.dialog.buttons.length<2) return -1; var num=0; for(var i=0;i<_status.event.dialog.buttons.length;i++){ - if(ai.get.buttonValue(_status.event.dialog.buttons[i])>1.5) num++; + if(get.buttonValue(_status.event.dialog.buttons[i])>1.5) num++; } - if(num>=2) return ai.get.buttonValue(button)-1.5; + if(num>=2) return get.buttonValue(button)-1.5; }).set('logSkill','hanbing_skill'); "step 1" if(result.bool){ @@ -1341,7 +1341,7 @@ card.standard={ "step 0" trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ var trigger=_status.event.getTrigger(); - return -ai.get.attitude(trigger.target,trigger.player)-ai.get.value(card); + return -get.attitude(trigger.target,trigger.player)-get.value(card); }); "step 1" if(result.bool==false) player.draw(); @@ -1397,7 +1397,7 @@ card.standard={ prompt:'将两张手牌当杀使用或打出', check:function(card){ if(card.name=='sha') return 0; - return 6-ai.get.useful(card) + return 6-get.useful(card) }, ai:{ respondSha:true, @@ -1421,13 +1421,13 @@ card.standard={ next.logSkill='guanshi_skill'; next.set('ai',function(card){ var evt=_status.event.getParent(); - if(ai.get.attitude(evt.player,evt._trigger.target)<0){ + if(get.attitude(evt.player,evt._trigger.target)<0){ if(evt.player.hasSkill('jiu')|| evt.player.hasSkill('tianxianjiu')|| evt._trigger.target.hp==1){ - return 8-ai.get.value(card) + return 8-get.value(card) } - return 5-ai.get.value(card) + return 5-get.value(card) } return -1; }); @@ -1462,12 +1462,12 @@ card.standard={ audio:true, content:function(){ "step 0" - var att=(ai.get.attitude(player,trigger.target)<=0); + var att=(get.attitude(player,trigger.target)<=0); var next=player.chooseButton(); next.set('att',att); next.set('createDialog',['选择要弃置的马',trigger.target.getCards('e',{subtype:['equip3','equip4']})]); next.set('ai',function(button){ - if(_status.event.att) return ai.get.buttonValue(button); + if(_status.event.att) return get.buttonValue(button); return 0; }); "step 1" @@ -1488,7 +1488,7 @@ card.standard={ }, audio:true, check:function(event,player){ - if(ai.get.damageEffect(player,event.player,player)>=0) return false; + if(get.damageEffect(player,event.player,player)>=0) return false; return true; }, content:function(){ @@ -1594,7 +1594,7 @@ card.standard={ var aiii=info.ai.wuxie(source,card,source,_status.event.player,state); if(typeof aiii=='number') return aiii; } - if(Math.abs(ai.get.attitude(_status.event.player,source))<3) return 0; + if(Math.abs(get.attitude(_status.event.player,source))<3) return 0; if(source.hasSkill('guanxing')) return 0; if(name!='lebu'&&name!='bingliang'){ if(source!=_status.event.player){ @@ -1608,9 +1608,9 @@ card.standard={ else{ card2=card; } - var eff=ai.get.effect(source,card2,source,source); + var eff=get.effect(source,card2,source,source); if(eff>=0) return 0; - return state*ai.get.attitude(_status.event.player,source); + return state*get.attitude(_status.event.player,source); } else{ var triggerevent=_status.event.getTrigger(); @@ -1627,12 +1627,12 @@ card.standard={ if(info.multitarget&&targets){ var eff=0; for(var i=0;i0) return 0; - if(ai.get.damageEffect(target,player,target)>=0) return 0; + if(get.attitude(player,target)>0) return 0; + if(get.damageEffect(target,player,target)>=0) return 0; return -1; } }, @@ -403,7 +403,7 @@ card.swd={ target:1 }, order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, } }, @@ -517,8 +517,8 @@ card.swd={ var next=target.chooseToDiscard('机关火筒:弃置一张手牌或受到一点火焰伤害'); next.set('ai',function(card){ var evt=_status.event.getParent(); - if(ai.get.damageEffect(evt.target,evt.player,evt.target,'fire')>=0) return 0; - return 8-ai.get.useful(card); + if(get.damageEffect(evt.target,evt.player,evt.target,'fire')>=0) return 0; + return 8-get.useful(card); }); } else{ @@ -537,7 +537,7 @@ card.swd={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,target)>0){ + if(get.attitude(viewer,target)>0){ if(target.countCards('h')>0||target.hp>1) return 0; } }, @@ -818,7 +818,7 @@ card.swd={ target:function(player,target){ var players=game.filterPlayer(function(current){ return (current!=player&&!current.isTurnedOver()&& - ai.get.attitude(player,current)>=3&&ai.get.attitude(current,player)>=3) + get.attitude(player,current)>=3&&get.attitude(current,player)>=3) }); players.sort(lib.sort.seat); if(target==players[0]) return 2; @@ -1132,7 +1132,7 @@ card.swd={ if(hs.length==1) return num+1; if(hs.length<=4){ for(var i=0;i6) return num; + if(get.value(hs[i])>6) return num; } } if(hs.length>4) return num+0.5; @@ -1455,7 +1455,7 @@ card.swd={ } else{ target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }; } "step 1" @@ -1517,7 +1517,7 @@ card.swd={ } player.chooseButton(ui.create.dialog('选择要复活的角色',[list,'character']),function(button){ for(var i=0;i3) return 7; + if(get.attitude(player,game.dead[i])>3) return 7; } return -10; }, result:{ player:function(player){ for(var i=0;i3) return 2; + if(get.attitude(player,game.dead[i])>3) return 2; } return -10; } @@ -1604,7 +1604,7 @@ card.swd={ }, }, order:function(){ - return ai.get.order({name:'sha'})+0.2; + return get.order({name:'sha'})+0.2; }, result:{ target:function(player,target){ @@ -1629,9 +1629,9 @@ card.swd={ } if(card){ if(game.hasPlayer(function(current){ - return (ai.get.attitude(target,current)<0&& + return (get.attitude(target,current)<0&& target.canUse(card,current,true,true)&& - ai.get.effect(current,card,target)>0); + get.effect(current,card,target)>0); })){ return 1; } @@ -1754,7 +1754,7 @@ card.swd={ }, result:{ player:function(player,target){ - if(ai.get.attitude(player,target)<0){ + if(get.attitude(player,target)<0){ if(get.distance(player,target)>1) return 1; return 0.6; } @@ -1776,10 +1776,10 @@ card.swd={ "step 0" var next=target.chooseToRespond({name:'sha'}); next.ai=function(card){ - if(ai.get.damageEffect(target,player,target,'thunder')>=0) return 0; + if(get.damageEffect(target,player,target,'thunder')>=0) return 0; if(player.hasSkillTag('notricksource')) return 0; if(target.hasSkillTag('notrick')) return 0; - return 11-ai.get.value(card); + return 11-get.value(card); }; next.autochoose=lib.filter.autoRespondSha; "step 1" @@ -1789,7 +1789,7 @@ card.swd={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,target)>0&&target.countCards('h','sha')){ + if(get.attitude(viewer,target)>0&&target.countCards('h','sha')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, @@ -1835,10 +1835,10 @@ card.swd={ "step 0" var next=target.chooseToRespond({name:'shan'}); next.ai=function(card){ - if(ai.get.damageEffect(target,player,target,'fire')>=0) return 0; + if(get.damageEffect(target,player,target,'fire')>=0) return 0; if(player.hasSkillTag('notricksource')) return 0; if(target.hasSkillTag('notrick')) return 0; - return 11-ai.get.value(card); + return 11-get.value(card); }; next.autochoose=lib.filter.autoRespondShan; "step 1" @@ -1848,7 +1848,7 @@ card.swd={ }, ai:{ wuxie:function(target,card,player,viewer){ - if(ai.get.attitude(viewer,target)>0&&target.countCards('h','shan')){ + if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, @@ -2072,7 +2072,7 @@ card.swd={ selectCard:[1,Infinity], prompt:'弃置任意张基本牌并摸等量的牌', check:function(card){ - return 6-ai.get.value(card) + return 6-get.value(card) }, content:function(){ player.draw(cards.length); @@ -2217,11 +2217,11 @@ card.swd={ return ui.cardPile.childElementCount>1; }, content:function(){ - var value=ai.get.value(ui.cardPile.firstChild); + var value=get.value(ui.cardPile.firstChild); var num=Math.min(20,ui.cardPile.childElementCount); var list=[],list2=[],list3=[]; for(var i=1;ivalue){ list.push(ui.cardPile.childNodes[i]); if(val>value+1&&val>=7){ @@ -2286,11 +2286,11 @@ card.swd={ }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.11; + return get.order({name:'sha'})+0.11; }, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } } } @@ -2422,7 +2422,7 @@ card.swd={ if(player==target) return false; return target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.bool){ @@ -2443,7 +2443,7 @@ card.swd={ }, logTarget:'source', check:function(event,player){ - return ai.get.damageEffect(event.source,player,player,'fire')>0; + return get.damageEffect(event.source,player,player,'fire')>0; }, content:function(){ 'step 0' @@ -2485,7 +2485,7 @@ card.swd={ content:function(){ 'step 0' player.chooseTarget([1,3],get.prompt('cangchizhibi')).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target.isLinked()){ return att; } @@ -2507,7 +2507,7 @@ card.swd={ content:function(){ 'step 0' player.chooseTarget(get.prompt('cangchizhibi_duanzao')).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target.isLinked()){ return att; } @@ -2542,7 +2542,7 @@ card.swd={ 'step 0' var next=player.chooseToDiscard('he',{color:'black'},get.prompt('huanglinzhicong_duanzao')); next.ai=function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }; next.logSkill='huanglinzhicong_equip1' 'step 1' @@ -2573,8 +2573,8 @@ card.swd={ 'step 0' var next=player.chooseToDiscard('he',{color:'red'},get.prompt('xuanwuzhihuang_duanzao')); next.ai=function(card){ - if(ai.get.recoverEffect(player,player,player)<=0) return 0; - return 8-ai.get.value(card); + if(get.recoverEffect(player,player,player)<=0) return 0; + return 8-get.value(card); }; next.logSkill='xuanwuzhihuang_equip1' 'step 1' @@ -2612,10 +2612,10 @@ card.swd={ return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); }, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); }, prompt:get.prompt('zhuquezhizhang_duanzao') }); @@ -2655,7 +2655,7 @@ card.swd={ if(player==target) return false; return target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.bool){ @@ -2794,7 +2794,7 @@ card.swd={ usable:1, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filterTarget:function(card,player,target){ return target!=player&&target.countCards('h')>0; @@ -2870,10 +2870,10 @@ card.swd={ filterTarget:true, filterCard:lib.filter.cardDiscardable, ai1:function(card){ - return 8-ai.get.useful(card); + return 8-get.useful(card); }, ai2:function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }, prompt:get.prompt('donghuangzhong') }); @@ -2920,7 +2920,7 @@ card.swd={ if(game.dead.length){ player.chooseButton(ui.create.dialog([list,'character']),function(button){ for(var i=0;i0){ + if(get.attitude(player,trigger.player)>0){ return 1+trigger.judge(button.link); } - if(ai.get.attitude(player,trigger.player)<0){ + if(get.attitude(player,trigger.player)<0){ return 1-trigger.judge(button.link); } return 0; @@ -3155,7 +3155,7 @@ card.swd={ selectCard:2, check:function(card){ if(get.tag(card,'recover')>=1) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); }, filter:function(event,player){ return player.hp=2; @@ -3166,7 +3166,7 @@ card.swd={ ai:{ result:{ player:function(player){ - return ai.get.recoverEffect(player); + return get.recoverEffect(player); } }, order:2.5 @@ -3195,7 +3195,7 @@ card.swd={ return event.player.hp<=0&&player.hp>1; }, check:function(event,player){ - return ai.get.attitude(player,event.player)>=3; + return get.attitude(player,event.player)>=3; }, logTarget:'player', content:function(){ @@ -3227,7 +3227,7 @@ card.swd={ player.chooseTarget('选择一个目标视为'+get.translation(target)+'对其使用一张杀',function(card,player,target2){ return player!=target2&&target.canUse('sha',target2); }).ai=function(target2){ - return ai.get.effect(target2,{name:'sha'},target,player); + return get.effect(target2,{name:'sha'},target,player); } } else{ @@ -3243,10 +3243,10 @@ card.swd={ result:{ target:function(player,target){ if(player.countCards('h')<=1) return 0; - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; if(game.hasPlayer(function(current){ return (player!=current&&target.canUse('sha',current)&& - ai.get.effect(current,{name:'sha'},target,player)>0) + get.effect(current,{name:'sha'},target,player)>0) })){ return -1; } @@ -3366,7 +3366,7 @@ card.swd={ filterCard:true, position:'he', check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filter:function(event,player){ return !player.isTurnedOver(); @@ -3463,7 +3463,7 @@ card.swd={ return target.countCards('he')>0; }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ target.discard(target.getCards('he').randomGet()); @@ -3499,7 +3499,7 @@ card.swd={ hslingjian_zhongxinghujia_equip2:{ trigger:{player:'damageEnd'}, check:function(event,player){ - return ai.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.getEquip(2); @@ -3534,7 +3534,7 @@ card.swd={ return player.countCards('he')>=2; }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ var card=game.createCard(get.inpile('equip2').randomGet()); @@ -3556,9 +3556,9 @@ card.swd={ trigger:{source:'damageEnd'}, check:function(event,player){ if(event.player.isTurnedOver()){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; } - return ai.get.attitude(player,event.player)<=0; + return get.attitude(player,event.player)<=0; }, filter:function(event){ return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive(); @@ -3573,9 +3573,9 @@ card.swd={ trigger:{player:'damageEnd'}, check:function(event,player){ if(event.player.isTurnedOver()){ - return ai.get.attitude(player,event.source)>0; + return get.attitude(player,event.source)>0; } - return ai.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(); @@ -3612,7 +3612,7 @@ card.swd={ player.chooseTarget(get.prompt('hslingjian_jinjilengdong_duanzao'),function(card,player,target){ return player!=target&&!target.isTurnedOver(); }).ai=function(target){ - return Math.max(0,-ai.get.attitude(player,target)-2); + return Math.max(0,-get.attitude(player,target)-2); }; "step 1" if(result.bool){ @@ -3634,7 +3634,7 @@ card.swd={ player.chooseTarget(get.prompt('hslingjian_yinmilichang_duanzao'),function(card,player,target){ return target!=player&&!target.hasSkill('qianxing'); }).ai=function(target){ - var att=ai.get.attitude(player,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; @@ -3777,7 +3777,7 @@ card.swd={ filterCard:true, selectCard:2, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, position:'he', filterTarget:true, @@ -3850,7 +3850,7 @@ card.swd={ target.$gain2(es); }, check:function(card){ - return 4-ai.get.value(card); + return 4-get.value(card); }, ai:{ order:5, @@ -3869,7 +3869,7 @@ card.swd={ }, filterCard:{type:['trick','delay']}, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, viewAs:{name:'jiguanshu'} }, @@ -3946,7 +3946,7 @@ card.swd={ } return 0; } - var num=1+ai.get.value(card); + var num=1+get.value(card); if(get.position(card)=='e'){ num+=0.1; } @@ -4100,7 +4100,7 @@ card.swd={ player.chooseTarget(function(card,player,target){ return !target.isMin()&&get.distance(player,target)<=1; },'选择一个目标装备'+get.translation(card.name)).ai=function(target){ - return ai.get.effect(target,card,player,player); + return get.effect(target,card,player,player); } event.card=card; 'step 1' @@ -4180,8 +4180,8 @@ card.swd={ }, content:function(){ player.gainPlayerCard(get.prompt('qinglonglingzhu',trigger.player),trigger.player,function(button){ - if(ai.get.attitude(player,trigger.player)<=0){ - return ai.get.buttonValue(button); + if(get.attitude(player,trigger.player)<=0){ + return get.buttonValue(button); } return 0; },'he').logSkill=['qinglonglingzhu',trigger.player]; @@ -4210,7 +4210,7 @@ card.swd={ fengxueren:{ trigger:{player:'shaHit'}, check:function(event,player){ - var att=ai.get.attitude(player,event.target); + 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')){ @@ -4274,7 +4274,7 @@ card.swd={ }); }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterTarget:function(card,player,target){ if(target.countCards('h')==0) return false; @@ -4364,11 +4364,11 @@ card.swd={ else if(x<0.3) target.loseHp(); else if(x<0.4) target.recover(); else if(x<0.6){ - if(ai.get.attitude(player,target)>0) target.draw(); + if(get.attitude(player,target)>0) target.draw(); else target.chooseToDiscard(true); } else if(x<0.8){ - if(ai.get.attitude(player,target)>0) target.recover(); + if(get.attitude(player,target)>0) target.recover(); else target.loseHp(); } } @@ -4430,7 +4430,7 @@ card.swd={ player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ return player!=target&&target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; break; } @@ -4472,7 +4472,7 @@ card.swd={ // game.delay(); }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, position:'he', ai:{ @@ -4554,7 +4554,7 @@ card.swd={ order:10, result:{ target:function(player,target){ - var num=ai.get.damageEffect(target,player,target); + var num=get.damageEffect(target,player,target); if(player.storage.nigong>=4&&num>0){ num=0; } @@ -4583,7 +4583,7 @@ card.swd={ sadengjinhuan:{ trigger:{player:'shaMiss'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ "step 0" @@ -4625,7 +4625,7 @@ card.swd={ guiyanfadao:{ trigger:{player:'shaHit'}, check:function(event,player){ - var att=ai.get.attitude(player,event.target); + var att=get.attitude(player,event.target); if(player.hasSkill('jiu')) return att>0; if(event.target.hasSkillTag('maixie_hp')){ return att<=0; diff --git a/card/yunchou.js b/card/yunchou.js index f1d02dea7..3d738600b 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -55,13 +55,13 @@ card.yunchou={ var minValue=20; var hs=target.getCards('h'); for(var i=0;i0){ - return ai.get.value(button.link,nextSeat)-5; + return get.value(button.link,nextSeat)-5; } else{ - return 5-ai.get.value(button.link,nextSeat); + return 5-get.value(button.link,nextSeat); } } next.set('closeDialog',false); @@ -172,7 +172,7 @@ card.yunchou={ target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[ '将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张' ],function(){ - if(ai.get.effect(player,{name:'sha'},target,target)<0) return 1; + if(get.effect(player,{name:'sha'},target,target)<0) return 1; if(target.countCards('h','sha')>=3) return 1; return 0; }); @@ -325,11 +325,11 @@ card.yunchou={ if(event.list.length){ event.current=event.list.shift(); event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ - if(ai.get.attitude(player,_status.event.source)>=0) return false; + 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=7&&value<=6) return 1; if(value<=3) return 1; } @@ -437,12 +437,12 @@ card.yunchou={ useful:[5,1], order:1, wuxie:function(target,card,player,current,state){ - return -state*ai.get.attitude(player,current); + return -state*get.attitude(player,current); }, result:{ player:function(player){ if(_status.event.parent.youdiinfo&& - ai.get.attitude(player,_status.event.parent.youdiinfo.source)<=0){ + get.attitude(player,_status.event.parent.youdiinfo.source)<=0){ return 1; } return 0; @@ -469,7 +469,7 @@ card.yunchou={ result:{ target:function(player,target){ var num=0; - if(target.isLowestHp()&&ai.get.recoverEffect(target)>0){ + if(target.isLowestHp()&&get.recoverEffect(target)>0){ if(target.hp==1){ num+=3; } @@ -552,7 +552,7 @@ card.yunchou={ result:{ target:function(player,target){ if(target.getCards('e',{subtype:'equip5'}).length){ - if(ai.get.attitude(target,player)>0){ + if(get.attitude(target,player)>0){ return -0.5; } return -1; @@ -661,7 +661,7 @@ card.yunchou={ if(_status.auto&&event.addedTarget==game.me){ game.delay(); } - event.addedTarget.chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(target)).ai=ai.get.disvalue; + event.addedTarget.chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(target)).ai=get.disvalue; } else{ event.finish(); @@ -875,15 +875,15 @@ card.yunchou={ else{ target.chooseToDiscard('he',2).ai=function(card){ if(target.hasSkillTag('nofire')) return 0; - if(ai.get.damageEffect(target,player,target,'fire')>=0) 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-ai.get.value(card); + return 10-get.value(card); } - return 8-ai.get.value(card); + return 8-get.value(card); }; } "step 1" @@ -900,7 +900,7 @@ card.yunchou={ result:{ target:function(player,target){ if(target.hasSkillTag('nofire')) return 0; - if(ai.get.damageEffect(target,player,player)<0&&ai.get.attitude(player,target)>0){ + if(get.damageEffect(target,player,player)<0&&get.attitude(player,target)>0){ return -2; } var nh=target.countCards('he'); diff --git a/card/zhenfa.js b/card/zhenfa.js index aa4568dd8..70f87a025 100644 --- a/card/zhenfa.js +++ b/card/zhenfa.js @@ -275,8 +275,8 @@ card.zhenfa={ player.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ return get.type(card)!='basic'; }).ai=function(card){ - if(ai.get.effect(target,{name:'sha'},player,player)>0){ - return 6-ai.get.value(card); + if(get.effect(target,{name:'sha'},player,player)>0){ + return 6-get.value(card); } return 0; }; @@ -290,8 +290,8 @@ card.zhenfa={ event.player2.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ return get.type(card)!='basic'; }).ai=function(card){ - if(ai.get.effect(target,{name:'sha'},event.player2,event.player2)>0){ - return 6-ai.get.value(card); + if(get.effect(target,{name:'sha'},event.player2,event.player2)>0){ + return 6-get.value(card); } return 0; }; @@ -322,7 +322,7 @@ card.zhenfa={ "step 0" var next=target.chooseToRespond({name:'shan'}); next.ai=function(card){ - if(ai.get.damageEffect(target,player,target)>=0) return 0; + if(get.damageEffect(target,player,target)>=0) return 0; return 1; }; next.autochoose=lib.filter.autoRespondShan; diff --git a/character/diy.js b/character/diy.js index 368c52a33..42a9b10ef 100644 --- a/character/diy.js +++ b/character/diy.js @@ -48,7 +48,7 @@ character.diy={ return player.countCards('h',{type:'basic'})>0; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, group:'liangce2' }, @@ -67,7 +67,7 @@ character.diy={ var dialog=ui.create.dialog(get.prompt('liangce'),trigger.remained,'hidden'); dialog.classList.add('noselect'); player.chooseTarget(dialog).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(du>=trigger.remained.length/2) return -att; return att; } @@ -97,8 +97,8 @@ character.diy={ return _status.event.getTrigger().targets.contains(target); }).set('ai',function(target){ var trigger=_status.event.getTrigger(); - var eff=-ai.get.effect(target,trigger.card,trigger.player,_status.event.player); - if(trigger.card.name=='wugu'&&eff==0&&ai.get.attitude(player,target)<0){ + var eff=-get.effect(target,trigger.card,trigger.player,_status.event.player); + if(trigger.card.name=='wugu'&&eff==0&&get.attitude(player,target)<0){ return 0.01; } return eff; @@ -148,14 +148,14 @@ character.diy={ var player=_status.event.player; var he=player.getCards('he'); var subtype=get.subtype(card); - var value=ai.get.equipValue(card); + var value=get.equipValue(card); for(var i=0;i=value){ + if(he[i]!=card&&get.subtype(he[i])==subtype&&get.equipValue(he[i])>=value){ return 10; } } if(!player.needsToDiscard()){ - return 4-ai.get.equipValue(card); + return 4-get.equipValue(card); } return 0; }, @@ -186,7 +186,7 @@ character.diy={ return lib.filter.cardEnabled({name:'diaobingqianjiang'},target); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ var list=game.filterPlayer(); @@ -197,9 +197,9 @@ character.diy={ order:1, result:{ player:function(player,target){ - if(ai.get.attitude(player,target)<=1) return 0; + if(get.attitude(player,target)<=1) return 0; return game.countPlayer(function(current){ - return ai.get.effect(current,{name:'diaobingqianjiang'},target,player); + return get.effect(current,{name:'diaobingqianjiang'},target,player); }); } } @@ -215,7 +215,7 @@ character.diy={ }, logTarget:'player', check:function(event,player){ - var att=ai.get.attitude(player,event.player); + var att=get.attitude(player,event.player); var subtype=get.subtype(event.cards[0]); if(att>0){ if(event.player.countCards('h')>=player.countCards('h')+2) return true; @@ -230,13 +230,13 @@ character.diy={ var bool=false; var subtype=get.subtype(trigger.cards[0]); var current=trigger.player.getEquip('e',parseInt(subtype[5])); - var att=ai.get.attitude(trigger.player,player); + var att=get.attitude(trigger.player,player); if(current){ if(att>0){ bool=true; } else{ - if(ai.get.equipValue(current)>ai.get.equipValue(trigger.cards[0])){ + if(get.equipValue(current)>get.equipValue(trigger.cards[0])){ bool=true; } } @@ -244,14 +244,14 @@ character.diy={ trigger.player.chooseCard('立断:将一张手牌交给'+get.translation(player)+',或取消并使用'+get.translation(trigger.cards)).ai=function(card){ if(bool){ if(att>0){ - return 8-ai.get.value(card); + return 8-get.value(card); } else{ - return 4-ai.get.value(card); + return 4-get.value(card); } } else{ - if(att<=0) return -ai.get.value(card); + if(att<=0) return -get.value(card); return 0; } } @@ -312,18 +312,18 @@ character.diy={ content:function(){ 'step 0' var bool=false; - if(!player.hasShan()&&ai.get.effect(player,trigger.card,trigger.player,player)<0){ + if(!player.hasShan()&&get.effect(player,trigger.card,trigger.player,player)<0){ bool=true; } player.chooseCard('he',get.prompt('fuchou',trigger.player)).ai=function(card){ if(bool){ if(player.hp<=1){ if(get.tag(card,'save')) return 0; - return 8-ai.get.value(card); + return 8-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); } - return -ai.get.value(card); + return -get.value(card); } 'step 1' if(result.bool){ @@ -397,11 +397,11 @@ character.diy={ }, content:function(){ 'step 0' - var bool=(ai.get.attitude(player,trigger.player)<0&&ai.get.attitude(player,trigger.target)>0); + var bool=(get.attitude(player,trigger.player)<0&&get.attitude(player,trigger.target)>0); var next=player.chooseToDiscard('he',{type:'equip'},get.prompt('youzhan',trigger.target)); next.ai=function(card){ if(bool){ - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; }; @@ -432,7 +432,7 @@ character.diy={ if(get.type(result.links[0])=='basic'){ player.chooseTarget([1,player.maxHp-player.hp], '选择至多'+get.cnNumber(player.maxHp-player.hp)+'名角色各摸一张牌').ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } } else{ @@ -490,7 +490,7 @@ character.diy={ content:function(){ 'step 0' var bool=false; - if(ai.get.attitude(player,trigger.player)<0&&trigger.player.needsToDiscard()){ + if(get.attitude(player,trigger.player)<0&&trigger.player.needsToDiscard()){ bool=true; } player.chooseCardButton(get.prompt('zhucheng',_status.currentPhase),player.storage.zhucheng).ai=function(button){ @@ -562,7 +562,7 @@ character.diy={ sha=true; } else{ - if(ai.get.value(he[i])<=6){ + if(get.value(he[i])<=6){ return [1,0,1,-0.5]; } } @@ -577,8 +577,8 @@ character.diy={ zhucheng2:{ trigger:{target:'shaBefore'}, check:function(event,player){ - if(ai.get.attitude(event.player,player)<=0) return true; - return ai.get.effect(player,event.card,event.player,player)<=0; + if(get.attitude(event.player,player)<=0) return true; + return get.effect(player,event.card,event.player,player)<=0; }, filter:function(event,player){ return player.storage.zhucheng&&player.storage.zhucheng.length>0; @@ -586,13 +586,13 @@ character.diy={ content:function(){ 'step 0' var bool=false; - if(ai.get.effect(player,trigger.card,trigger.player,trigger.player)>=0){ + if(get.effect(player,trigger.card,trigger.player,trigger.player)>=0){ bool=true; } var num=player.storage.zhucheng.length; trigger.player.chooseToDiscard('弃置'+get.cnNumber(num)+'张牌,或令杀无效',num).ai=function(card){ if(bool){ - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; } @@ -764,7 +764,7 @@ character.diy={ return lib.filter.filterTarget({name:'bingliang'},player,target); }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ player.useCard({name:'bingliang'},target,cards).animate=false; @@ -773,7 +773,7 @@ character.diy={ ai:{ result:{ target:function(player,target){ - return ai.get.effect(target,{name:'bingliang'},player,target); + return get.effect(target,{name:'bingliang'},player,target); } }, order:9, @@ -856,7 +856,7 @@ character.diy={ }, viewAs:{name:'shuiyanqijun'}, prompt:'将一张非基本牌当水淹七军使用', - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, group:'luweiyan2' }, luweiyan2:{ @@ -876,7 +876,7 @@ character.diy={ player.chooseTarget('是否视为使用一张杀?',function(card,player,target){ return trigger.targets.contains(target)&&player.canUse('sha',target,false); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); } 'step 1' if(result.bool){ @@ -897,7 +897,7 @@ character.diy={ honglian:{ trigger:{player:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, filter:function(event,player){ return event.source&&event.source!=player&&event.source.countCards('he',{color:'red'})>0; @@ -910,7 +910,7 @@ character.diy={ result:{ threaten:0.8, target:function(card,player,target){ - if(get.tag(card,'damage')&&ai.get.attitude(target,player)<0){ + if(get.tag(card,'damage')&&get.attitude(target,player)<0){ return [1,0,0,-player.countCards('he',{color:'red'})]; } } @@ -930,7 +930,7 @@ character.diy={ next=player.discardPlayerCard(player,'hej',2,true); next.ai=function(button){ if(get.position(button.link)=='j') return 10; - return -ai.get.value(button.link); + return -get.value(button.link); }; next.filterButton=function(button){ return lib.filter.cardDiscardable(button.link,player); @@ -977,13 +977,13 @@ character.diy={ content:function(){ "step 0" player.chooseToDiscard(get.prompt('zonghuo')).ai=function(card){ - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); if(trigger.player.hasSkillTag('nofire')){ - if(att>0) return 8-ai.get.value(card); + if(att>0) return 8-get.value(card); return -1; } if(att<0){ - return 7-ai.get.value(card); + return 7-get.value(card); } return -1; } @@ -1005,7 +1005,7 @@ character.diy={ player.chooseTarget(get.prompt('shaoying'),function(card,player,target){ return get.distance(trigger.player,target)<=1&&trigger.player!=target; }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); } "step 1" if(result.bool){ @@ -1082,7 +1082,7 @@ character.diy={ }, content:function(){ "step 0" - var att=ai.get.attitude(trigger.player,player); + var att=get.attitude(trigger.player,player); var bool=0; if(att<0){ if(trigger.player.countCards('e')==0&&trigger.player.countCards('h')>2) bool=1; @@ -1168,7 +1168,7 @@ character.diy={ }, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ if(player.isLinked()==false) player.link(); @@ -1263,7 +1263,7 @@ character.diy={ } }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, position:'he', ai:{ @@ -1277,7 +1277,7 @@ character.diy={ }, target:function(player,target){ if(player.hp<=1) return 0; - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } } }, diff --git a/character/extra.js b/character/extra.js index ebe36256b..67cc1a2fd 100644 --- a/character/extra.js +++ b/character/extra.js @@ -32,7 +32,7 @@ character.extra={ var recover=0,lose=0,players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if(players[i].hp<2){ lose--; recover+=0.5; @@ -40,7 +40,7 @@ character.extra={ lose--; recover++; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; @@ -50,10 +50,10 @@ character.extra={ } } else{ - if(ai.get.attitude(player,players[i])>0){ + if(get.attitude(player,players[i])>0){ lose--; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ lose++; } } @@ -183,7 +183,7 @@ character.extra={ player:function(player){ return game.countPlayer(function(current){ if(current!=player){ - return get.sgn(ai.get.damageEffect(current,player,player)); + return get.sgn(get.damageEffect(current,player,player)); } }); } @@ -210,7 +210,7 @@ character.extra={ if(cards.length){ if(game.hasPlayer(function(current){ return (player.canUse('sha',current)&& - ai.get.effect(current,cards[0],player,player)>0&¤t.hasShan()); + get.effect(current,cards[0],player,player)>0&¤t.hasShan()); })){ return 1; } @@ -312,13 +312,13 @@ character.extra={ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ - return result-ai.get.value(card)/2; + return result-get.value(card)/2; } else{ - return -result-ai.get.value(card)/2; + return -result-get.value(card)/2; } }; "step 1" @@ -364,11 +364,11 @@ character.extra={ return player!=target }).ai=function(target){ if(target.isTurnedOver()){ - return ai.get.attitude(player,target)-1; + return get.attitude(player,target)-1; } else{ if(player.maxHp-player.hp==1){ - return -ai.get.attitude(player,target)-1; + return -get.attitude(player,target)-1; } } return 0; @@ -407,7 +407,7 @@ character.extra={ filterCard:true, selectCard:[1,Infinity], prompt:'弃置一枚“忍”,然后弃置任意张牌并摸等量的牌', - check:function(card){return 6-ai.get.value(card)}, + check:function(card){return 6-get.value(card)}, content:function(){ player.storage.renjie--; player.updateMarks(); @@ -420,7 +420,7 @@ character.extra={ var num=0; var cards=player.getCards('he'); for(var i=0;i2&&ai.get.attitude(player,target)<=0) return [0,2]; + if(player.hp>2&&get.attitude(player,target)<=0) return [0,2]; return [1,0,0,-player.hp]; } } @@ -525,10 +525,10 @@ character.extra={ check:function(event,player){ if(player.isTurnedOver()) return true; var num=game.countPlayer(function(current){ - if(current.countCards('he')&¤t!=player&&ai.get.attitude(player,current)<=0){ + if(current.countCards('he')&¤t!=player&&get.attitude(player,current)<=0){ return true; } - if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ + if(current.countCards('j')&¤t!=player&&get.attitude(player,current)>0){ return true; } }); @@ -575,10 +575,10 @@ character.extra={ if(target.hp==1) return 0.8; if(target.isTurnedOver()) return [0,3]; var num=game.countPlayer(function(current){ - if(current.countCards('he')&¤t!=player&&ai.get.attitude(player,current)<=0){ + if(current.countCards('he')&¤t!=player&&get.attitude(player,current)<=0){ return true; } - if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ + if(current.countCards('j')&¤t!=player&&get.attitude(player,current)>0){ return true; } }); @@ -608,7 +608,7 @@ character.extra={ game.addVideo('delay',null); } player.chooseCard('选择七张牌作为星',7,true).ai=function(card){ - return ai.get.value(card); + return get.value(card); }; "step 2" player.lose(result.cards,ui.special)._triggered=null; @@ -663,9 +663,9 @@ character.extra={ "step 2" player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ if(player.skipList.contains('phaseUse')&&button.link!='du'){ - return -ai.get.value(button.link); + return -get.value(button.link); } - return ai.get.value(button.link); + return get.value(button.link); } if(player==game.me&&_status.auto){ game.delay(0.5); @@ -696,7 +696,7 @@ character.extra={ [1,Math.min(game.countPlayer(),player.storage.qixing.length)]).ai=function(target){ if(target.isMin()) return 0; if(target.hasSkill('biantian2')) return 0; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>=4){ if(target.hp==1&&target.maxHp>2) return att; if(target.hp==2&&target.maxHp>3&&target.countCards('he')==0) return att*0.7; @@ -884,7 +884,7 @@ character.extra={ if(target.hasSkillTag('nofire')) return 0; if(lib.config.mode=='versus') return -1; if(player.hasUnknown()) return 0; - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } } } @@ -934,7 +934,7 @@ character.extra={ position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; - return 10-ai.get.value(card); + return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); @@ -956,7 +956,7 @@ character.extra={ position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; - return 10-ai.get.value(card); + return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); @@ -978,7 +978,7 @@ character.extra={ position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); @@ -1000,7 +1000,7 @@ character.extra={ position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; - return 10-ai.get.value(card); + return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); diff --git a/character/gujian.js b/character/gujian.js index 686fb11b1..413f91e36 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -42,7 +42,7 @@ character.gujian={ }, prompt:'将一张手牌或装备牌当酒使用', check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, ai:{ threaten:1.2 @@ -51,7 +51,7 @@ character.gujian={ manwu:{ trigger:{global:'phaseEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, filter:function(event,player){ return event.player.isFewestHandcard(); @@ -181,7 +181,7 @@ character.gujian={ if(!player.storage.yunyin) return true; return !player.storage.yunyin.contains(get.suit(card)); }).set('logSkill','yunyin').ai=function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); } 'step 1' if(!result.bool){ @@ -204,8 +204,8 @@ character.gujian={ var taoyuan=0,nanman=0; var players=game.filterPlayer(); for(var i=0;i0){ taoyuan++; } @@ -253,7 +253,7 @@ character.gujian={ var next=player.chooseTarget('选择'+get.translation(name)+'的目标'); next._get_card=card; next.filterTarget=lib.filter.filterTarget; - next.ai=ai.get.effect; + next.ai=get.effect; if(typeof info.selectTarget=='function'){ next.selectTarget=info.selectTarget; } @@ -282,7 +282,7 @@ character.gujian={ }, forced:true, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, content:function(){ 'step 0' @@ -329,7 +329,7 @@ character.gujian={ player.chooseTarget('是否视为使用一张决斗?',function(card,player,target){ return lib.filter.targetEnabled({name:'juedou'},player,target); }).set('ai',function(target){ - return ai.get.effect(target,{name:'juedou'},_status.event.player); + return get.effect(target,{name:'juedou'},_status.event.player); }); } else{ @@ -395,7 +395,7 @@ character.gujian={ player.chooseTarget(get.prompt('liuying'),function(card,player,target){ return event.list.contains(target); }).ai=function(target){ - return ai.get.effect(target,trigger.card,player,player); + return get.effect(target,trigger.card,player,player); }; } else{ @@ -442,7 +442,7 @@ character.gujian={ selectCard:2, position:'he', check:function(card){ - return ai.get.value(card); + return get.value(card); }, content:function(){ var name=cards[0].name+'_'+cards[1].name; @@ -475,7 +475,7 @@ character.gujian={ var info=get.info(card); var current=player.getEquip(info.subtype); if(current&&card!=current){ - value=ai.get.value(current,player); + value=get.value(current,player); } var equipValue=info.ai.equipValue||info.ai.basic.equipValue; if(typeof equipValue=='function') return equipValue(card,player)-value; @@ -483,7 +483,7 @@ character.gujian={ }, result:{ target:function(player,target){ - return ai.get.equipResult(player,target,name); + return get.equipResult(player,target,name); } } } @@ -580,10 +580,10 @@ character.gujian={ "step 0" var next=player.chooseToDiscard('he','魅影:是否弃置一张红色牌视为对'+get.translation(trigger.player)+'使用一张杀?'); next.logSkill=['meiying',trigger.player]; - var eff=ai.get.effect(trigger.player,{name:'sha'},player,player); + var eff=get.effect(trigger.player,{name:'sha'},player,player); next.ai=function(card){ if(eff>0){ - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; } @@ -652,7 +652,7 @@ character.gujian={ "step 0" var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.countCards('h')-player.hp)]); next.ai=function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); } next.logSkill='xidie'; "step 1" @@ -676,7 +676,7 @@ character.gujian={ meihu:{ trigger:{player:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.source)<4; + return get.attitude(player,event.source)<4; }, filter:function(event,player){ return event.source&&event.source!=player&&event.source.countCards('h')>0; @@ -685,7 +685,7 @@ character.gujian={ content:function(){ "step 0" trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){ - return -ai.get.value(card); + return -get.value(card); }; "step 1" if(result.bool){ @@ -736,15 +736,15 @@ character.gujian={ content:function(){ "step 0" var next=player.chooseToDiscard(get.prompt('fumo',trigger.source),2,function(card){ - if(ai.get.damageEffect(trigger.source,player,player,'thunder')<=0) return 0; + if(get.damageEffect(trigger.source,player,player,'thunder')<=0) return 0; if(ui.selected.cards.length){ return get.color(card)==get.color(ui.selected.cards[0]); } return player.countCards('h',{color:get.color(card)})>1; }).set('complexCard',true); next.ai=function(card){ - if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){ - return 8-ai.get.value(card); + if(get.damageEffect(trigger.source,player,player,'thunder')>0){ + return 8-get.value(card); } return 0; }; @@ -772,7 +772,7 @@ character.gujian={ return target.isLowestHp(); }).ai=function(target){ var num=0; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0){ if(target.isLowestHp()){ num+=5; @@ -896,22 +896,22 @@ character.gujian={ next.logSkill=['qinglan',trigger.player]; next.ai=function(card){ if(trigger.num>1||!trigger.source){ - if(ai.get.attitude(player,trigger.player)>0){ - return 9-ai.get.value(card); + if(get.attitude(player,trigger.player)>0){ + return 9-get.value(card); } return -1; } - else if(ai.get.attitude(player,trigger.player)>0){ + else if(get.attitude(player,trigger.player)>0){ if(trigger.player.hp==1){ - return 8-ai.get.value(card); + return 8-get.value(card); } if(trigger.source.hp==trigger.source.maxHp){ - return 6-ai.get.value(card); + return 6-get.value(card); } } - else if(ai.get.attitude(player,trigger.source)>0&& + else if(get.attitude(player,trigger.source)>0&& trigger.source.hp1){ - if(get.color(card)=='red') return 5-ai.get.value(card); + if(get.color(card)=='red') return 5-get.value(card); } return -1; } @@ -970,10 +970,10 @@ character.gujian={ return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); }, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); }, prompt:get.prompt('xuelu') }); @@ -1103,12 +1103,12 @@ character.gujian={ check:function(card){ var player=_status.currentPhase; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } if(player.countCards('h')=0) return -1; - if(_status.event.player.hp==1) return 9-ai.get.value(card); - return 8-ai.get.value(card); + if(get.damageEffect(_status.event.player,player,_status.event.player)>=0) return -1; + if(_status.event.player.hp==1) return 9-get.value(card); + return 8-get.value(card); }; next.autochoose=function(){ return this.player.countCards('he')==0; @@ -1311,7 +1311,7 @@ character.gujian={ game.addVideo('storage',player,['yangming2',player.storage.yangming2]); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ result:{ @@ -1417,8 +1417,8 @@ character.gujian={ player:function(player,target){ if(player.hp>1) return false; if(target.hp>2) return false; - if(ai.get.attitude(player,target)>=0) return false; - return ai.get.damageEffect(target,player,player,'fire'); + if(get.attitude(player,target)>=0) return false; + return get.damageEffect(target,player,player,'fire'); } } } diff --git a/character/gwent.js b/character/gwent.js index 7eb5a9246..f0439a69c 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -58,7 +58,7 @@ character.gwent={ } else{ game.countPlayer(function(current){ - var att=ai.get.attitude(player,current); + var att=get.attitude(player,current); if(att>0){ num1++; } @@ -121,7 +121,7 @@ character.gwent={ filterTarget:function(card,player,target){ return target.isHighestHp(); }, - check:function(card){return 7-ai.get.value(card);}, + check:function(card){return 7-get.value(card);}, position:'he', filterCard:true, content:function(){ @@ -130,7 +130,7 @@ character.gwent={ ai:{ result:{ target:function(player,target){ - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); }, }, order:7 @@ -173,7 +173,7 @@ character.gwent={ result:{ target:function(player,target){ if(player.getEquip('tengjia')||player.getEquip('bagua')) return -1; - if(ai.get.effect(player,{name:'sha'},target,player)>=0) return -1; + if(get.effect(player,{name:'sha'},target,player)>=0) return -1; if(!player.hasShan()){ if(ui.selected.targets.length) return 0; if(player.hp>=4) return -1; @@ -198,7 +198,7 @@ character.gwent={ position:'he', filterCard:true, check:function(card){ - return 7-ai.get.value(card) + return 7-get.value(card) }, content:function(){ 'step 0' @@ -232,19 +232,19 @@ character.gwent={ selectCard:[1,3], check:function(card){ if(!ui.selected.cards.length){ - return 6-ai.get.value(card) + return 6-get.value(card) } var player=_status.event.player; if(player.isDamaged()){ var hs=player.getCards('h'); var num=0; for(var i=0;i=3){ - return 6-ai.get.value(card); + return 6-get.value(card); } } return 0; @@ -283,14 +283,14 @@ character.gwent={ }, content:function(){ 'step 0' - var bool=(ai.get.effect(trigger.player,{name:'sha'},player,player)>0&& - Math.abs(ai.get.attitude(player,trigger.player))>1&& + var bool=(get.effect(trigger.player,{name:'sha'},player,player)>0&& + Math.abs(get.attitude(player,trigger.player))>1&& game.hasPlayer(function(current){ - return ai.get.attitude(current,player)>0&¤t.hasSha(); + return get.attitude(current,player)>0&¤t.hasSha(); })); var next=player.chooseToDiscard(get.prompt('gwzhanjiang',trigger.player),'he'); next.ai=function(card){ - if(bool) return 7-ai.get.value(card); + if(bool) return 7-get.value(card); return 0; }; next.logSkill=['gwzhanjiang',trigger.player]; @@ -352,7 +352,7 @@ character.gwent={ return event.target.isAlive(); }, check:function(event,player){ - return ai.get.effect(event.target,{name:'sha'},player,player)>0 + return get.effect(event.target,{name:'sha'},player,player)>0 }, logTarget:'target', logLine:false, @@ -381,7 +381,7 @@ character.gwent={ player.chooseTarget(get.prompt('fengjian'),function(card,player,target){ return player.canUse('sha',target,false)&&!trigger.targets.contains(target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha',nature:'thunder'},player,player); + return get.effect(target,{name:'sha',nature:'thunder'},player,player); } "step 1" if(result.bool){ @@ -418,7 +418,7 @@ character.gwent={ player.chooseTarget(get.prompt('huandie'),[0,game.countPlayer()],function(card,player,target){ return target!=player; }).ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } 'step 1' if(result.bool){ @@ -546,10 +546,10 @@ character.gwent={ content:function(){ 'step 0' var target=trigger.target; - var bool=ai.get.attitude(player,target)<0; + var bool=get.attitude(player,target)<0; var next=player.chooseToDiscard('he',get.prompt('fayin',target)); next.ai=function(card){ - if(bool) return 7-ai.get.value(card); + if(bool) return 7-get.value(card); return 0; }; next.logSkill=['fayin',target]; @@ -583,11 +583,11 @@ character.gwent={ target.$giveAuto(hs,player); event.hs=hs; 'step 1' - var damage=(target.hp>=player.hp&&ai.get.damageEffect(target,player,player)>0); + var damage=(target.hp>=player.hp&&get.damageEffect(target,player,player)>0); var hs=event.hs; if(damage&&target.hp>1){ for(var i=0;i=8){ + if(get.value(hs[i],player,'raw')>=8){ damage=false;break; } } @@ -597,7 +597,7 @@ character.gwent={ return hs.contains(card)?1:0; } else{ - return -ai.get.value(card,player,'raw'); + return -get.value(card,player,'raw'); } } if(!event.isMine()) game.delay(); @@ -649,7 +649,7 @@ character.gwent={ target:function(player,target){ var dh=Math.min(3,player.hp)-target.countCards('h'); if(dh<0){ - dh+=get.sgn(ai.get.effect(target,{name:'sha'},player,target)); + dh+=get.sgn(get.effect(target,{name:'sha'},player,target)); } return dh; } @@ -664,7 +664,7 @@ character.gwent={ player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){ return target.countCards('h')!=Math.min(3,target.hp); }).ai=function(target){ - return ai.get.attitude(player,target)*(Math.min(3,target.hp)-target.countCards('h')); + return get.attitude(player,target)*(Math.min(3,target.hp)-target.countCards('h')); } 'step 1' if(result.bool){ @@ -776,7 +776,7 @@ character.gwent={ return false; }, check:function(button){ - return ai.get.value(button.link); + return get.value(button.link); }, backup:function(links,player){ return { diff --git a/character/hearth.js b/character/hearth.js index 49a6b5904..ef460be29 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -192,14 +192,14 @@ character.hearth={ if(target.identity=='zhu'||get.is.jun(target)) return false; return true; }).ai=function(target){ - var att=-ai.get.attitude(player,target); + var att=-get.attitude(player,target); if(att<=0) return 0; if(target.needsToDiscard()) att+=3; else if(target.needsToDiscard(1)) att++; else if(target.countCards()<=3){ return 0; } - return att+target.countCards('h')+ai.get.threaten(target); + return att+target.countCards('h')+get.threaten(target); }; 'step 1' if(result.bool){ @@ -241,7 +241,7 @@ character.hearth={ }, init:function(player){ player.ai.modAttitudeFrom=function(from,to){ - return ai.get.attitude(player.storage.mengye2,to); + return get.attitude(player.storage.mengye2,to); } player.ai.modAttitudeTo=function(from,to,att){ if(from!=to) return 0; @@ -302,7 +302,7 @@ character.hearth={ var nh=target.countCards('h'); return nh&&nh>=player.countCards('h'); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target.hasSkillTag('noe')){ att/=3; } @@ -336,7 +336,7 @@ character.hearth={ 'step 0' target.gain(cards,player); var choice=1; - if(ai.get.attitude(target,player)>0||(target.hp<=1&&!target.hasSha())){ + if(get.attitude(target,player)>0||(target.hp<=1&&!target.hasSha())){ choice=0; } target.chooseControl(function(){ @@ -359,8 +359,8 @@ character.hearth={ expos:0.2, result:{ player:function(player,target){ - if(ai.get.attitude(target,player)>0) return 1; - if(ai.get.effect(target,{name:'juedou'},player,player)>0) return 1.5; + if(get.attitude(target,player)>0) return 1; + if(get.effect(target,{name:'juedou'},player,player)>0) return 1.5; return 0; } } @@ -473,8 +473,8 @@ character.hearth={ event.target=event.targets.shift(); if(event.target.countCards('he',{color:'black'})){ event.target.chooseCard('he','交给'+get.translation(player)+'一张黑色牌,或失去一点体力',{color:'black'}).ai=function(card){ - if(ai.get.attitude(event.target,player)>0) return 10-ai.get.value(card); - return 7-ai.get.value(card); + if(get.attitude(event.target,player)>0) return 10-get.value(card); + return 7-get.value(card); } } else{ @@ -512,7 +512,7 @@ character.hearth={ player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){ return target!=player&&target.countCards('h')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } 'step 1' if(result.bool){ @@ -605,8 +605,8 @@ character.hearth={ var next=player.chooseToDiscard(get.prompt('zhongji',trigger.player),{color:'black'}); next.logSkill=['zhongji',trigger.player]; next.ai=function(card){ - if(ai.get.attitude(player,trigger.player)<0){ - return 7-ai.get.value(card); + if(get.attitude(player,trigger.player)<0){ + return 7-get.value(card); } return -1; } @@ -645,13 +645,13 @@ character.hearth={ player.chooseTarget(get.prompt('jinzhou'),function(card,player,target){ return target!=player&&!target.hasSkill('fengyin'); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>=0) return 0; var skills=target.getSkills(); for(var i=0;inh; }).ai=function(target){ - return 0.5-ai.get.attitude(player,target); + return 0.5-get.attitude(player,target); } 'step 1' if(result.bool){ @@ -735,7 +735,7 @@ character.hearth={ 'step 4' if(event.cards.length){ player.chooseCardButton('选择一张加入手牌',event.cards).ai=function(button){ - return ai.get.value(button.link); + return get.value(button.link); }; } else{ @@ -759,7 +759,7 @@ character.hearth={ filterCard:{color:'black'}, position:'he', check:function(card){ - return 11-ai.get.value(card); + return 11-get.value(card); }, filterTarget:function(card,player,target){ return target==_status.event.dying; @@ -786,7 +786,7 @@ character.hearth={ filterCard:true, position:'he', check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, filter:function(event,player){ if(player.hasSkill('yushou_misha')&&player.hasSkill('yushou_huofu')&&player.hasSkill('yushou_leiouke')) return false; @@ -871,7 +871,7 @@ character.hearth={ if(!player.countCards('he',{color:'black'})) return false; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ basic:{ @@ -986,7 +986,7 @@ character.hearth={ if(!player.countCards('he',{suit:'spade'})) return false; }, prompt:'将一张黑桃手牌当作无中生有使用', - check:function(card){return 7-ai.get.value(card)}, + check:function(card){return 7-get.value(card)}, ai:{ threaten:1.4, order:9, @@ -995,7 +995,7 @@ character.hearth={ bzhuiji:{ trigger:{global:'dieAfter'}, check:function(event,player){ - return ai.get.attitude(player,event.source)<=0; + return get.attitude(player,event.source)<=0; }, filter:function(event,player){ return event.source&&event.source.isAlive()&&event.source!=player; @@ -1014,7 +1014,7 @@ character.hearth={ usable:2, filterCard:true, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ 'step 0' @@ -1044,7 +1044,7 @@ character.hearth={ return get.type(card)!='hsyaoshui'; }, check:function(card){ - return 8-ai.get.value(card) + return 8-get.value(card) }, discard:false, lose:false, @@ -1173,7 +1173,7 @@ character.hearth={ for(var i=0;i0){ num++; } @@ -1241,10 +1241,10 @@ character.hearth={ }, position:'he', ai1:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, ai2:function(target){ - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); } }); 'step 1' @@ -1268,7 +1268,7 @@ character.hearth={ guimou:{ trigger:{player:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.source)<=0; + return get.attitude(player,event.source)<=0; }, filter:function(event,player){ return event.source&&event.source.isAlive()&&event.source!=player&&event.source.countCards('h')>0; @@ -1310,10 +1310,10 @@ character.hearth={ } return true; }).ai=function(target){ - if(player==target&&ai.get.attitude(player,target)>0&&event.parent.triggername=='phaseBegin'){ - return ai.get.attitude(player,target)+10; + if(player==target&&get.attitude(player,target)>0&&event.parent.triggername=='phaseBegin'){ + return get.attitude(player,target)+10; } - return ai.get.attitude(player,target); + return get.attitude(player,target); } 'step 1' if(result.bool){ @@ -1339,7 +1339,7 @@ character.hearth={ position:'he', filterTarget:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ 'step 0' @@ -1593,7 +1593,7 @@ character.hearth={ var players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if(players[i].hp<2){ lose--; recover+=0.5; @@ -1601,7 +1601,7 @@ character.hearth={ lose--; recover++; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; @@ -1611,10 +1611,10 @@ character.hearth={ } } else{ - if(ai.get.attitude(player,players[i])>0){ + if(get.attitude(player,players[i])>0){ lose--; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ lose++; } } @@ -1684,7 +1684,7 @@ character.hearth={ var players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if(players[i].hp<2){ lose--; recover+=0.5; @@ -1692,7 +1692,7 @@ character.hearth={ lose--; recover++; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; @@ -1702,10 +1702,10 @@ character.hearth={ } } else{ - if(ai.get.attitude(player,players[i])>0){ + if(get.attitude(player,players[i])>0){ lose--; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ lose++; } } @@ -1729,7 +1729,7 @@ character.hearth={ popname:true, viewAs:{name:links[0][2]}, ai1:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, onuse:function(result,player){ player.storage.nuyan.add(result.card.name); @@ -1990,7 +1990,7 @@ character.hearth={ selectTarget:-1, selectCard:[1,3], check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterCard:{color:'black'}, line:'thunder', @@ -2002,7 +2002,7 @@ character.hearth={ threaten:0.7, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'thunder'); + return get.damageEffect(target,player,target,'thunder'); } } }, @@ -2055,8 +2055,8 @@ character.hearth={ }); if(event.target){ player.chooseToDiscard([1,2],'献祭:是否弃置1~2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.getParent().target)>1){ - return 6-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.getParent().target)>1){ + return 6-get.value(card); } return 0; }).set('logSkill',['xianji',event.target]); @@ -2118,7 +2118,7 @@ character.hearth={ return event.card&&event.card.name=='sha'&&event.player.isAlive(); }, check:function(event,player){ - if(ai.get.attitude(player,event.player)>=0) return false; + if(get.attitude(player,event.player)>=0) return false; if(player.hp>2) return true; if(player.hp<2) return false; return player.hp>=event.player.hp; @@ -2354,9 +2354,9 @@ character.hearth={ position:'he', check:function(card){ if(_status.event.player.hp==1){ - return 7-ai.get.value(card); + return 7-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }, selectCard:3, filter:function(event,player){ @@ -2406,7 +2406,7 @@ character.hearth={ complexCard:true, position:'he', check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, selectCard:[1,Infinity], content:function(){ @@ -2416,14 +2416,14 @@ character.hearth={ var list=game.findCards(function(name){ if(cards[i].name==name) return; if(get.type({name:name},'trick')==type){ - return ai.get.value({name:name})>ai.get.value(cards[i]); + return get.value({name:name})>get.value(cards[i]); } }); if(!list.length){ list=game.findCards(function(name){ if(cards[i].name==name) return; if(get.type({name:name},'trick')==type){ - return ai.get.value({name:name})==ai.get.value(cards[i]); + return get.value({name:name})==get.value(cards[i]); } }); } @@ -2450,7 +2450,7 @@ character.hearth={ selectCard:[1,Infinity], check:function(card){ if(ui.selected.cards.length) return 0; - return 6-ai.get.value(card) + return 6-get.value(card) }, content:function(){ 'step 0' @@ -2479,7 +2479,7 @@ character.hearth={ priority:1, // filterCard:true, // check:function(card){ - // return 6-ai.get.value(card); + // return 6-get.value(card); // }, // position:'he', content:function(){ @@ -2529,7 +2529,7 @@ character.hearth={ player.chooseToDiscard('是否弃置一张点数为'+player.storage.xunbao2.number+'的牌获得藏宝图?','he',function(card){ return card.number==player.storage.xunbao2.number; }).ai=function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }; 'step 1' if(result.bool){ @@ -2612,7 +2612,7 @@ character.hearth={ player.chooseTarget(get.prompt('fbeifa'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); } "step 1" if(result.bool){ @@ -2657,7 +2657,7 @@ character.hearth={ player.chooseTarget(get.prompt('yufa'),function(card,player,target){ return target!=trigger.player; }).ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); }; 'step 1' if(result.bool){ @@ -2714,7 +2714,7 @@ character.hearth={ position:'he', log:'notarget', check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, multitarget:true, content:function(){ @@ -2731,9 +2731,9 @@ character.hearth={ target:function(player,target){ var card=ui.selected.cards[0]; if(card&&get.color(card)=='black'){ - return ai.get.effect(target,{name:'jingleishan'},player,target); + return get.effect(target,{name:'jingleishan'},player,target); } - return ai.get.effect(target,{name:'chiyuxi'},player,target); + return get.effect(target,{name:'chiyuxi'},player,target); } } } @@ -2799,7 +2799,7 @@ character.hearth={ content:function(){ 'step 0' player.chooseControl('draw_card','出杀','cancel2',function(){ - if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){ + if(get.effect(trigger.target,{name:'sha'},player,player)>0){ return '出杀'; } return 'draw_card'; @@ -2941,7 +2941,7 @@ character.hearth={ player.chooseTarget(get.prompt('duzhang'),function(card,player,target){ return target!=player; }).ai=function(target){ - return -ai.get.attitude(player,target)*Math.sqrt(target.countCards('h')); + return -get.attitude(player,target)*Math.sqrt(target.countCards('h')); } 'step 1' if(result.bool){ @@ -3188,7 +3188,7 @@ character.hearth={ trigger:{global:'phaseEnd'}, forced:true, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, filter:function(event,player){ return typeof event.player.storage.shixu=='number'&& @@ -3279,7 +3279,7 @@ character.hearth={ "step 0" var effect=0; for(var i=0;i0; } @@ -3493,7 +3493,7 @@ character.hearth={ content:function(){ 'step 0' player.chooseTarget(get.prompt('jiaohui')).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>1){ if(target.hp<=1) att+=2; if(target.hp<=2) att++; @@ -3590,7 +3590,7 @@ character.hearth={ var dialog=ui.create.dialog('选择一张锦囊牌加入你的手牌',[list,'vcard'],'hidden'); player.chooseButton(dialog,true).ai=function(button){ var card={name:button.link[2]}; - var value=ai.get.value(card); + var value=get.value(card); if(get.tag(card,'damage')) value++; return value; }; @@ -3609,7 +3609,7 @@ character.hearth={ content:function(){ "step 0" player.chooseTarget(get.prompt('lingzhou')).ai=function(target){ - var num=ai.get.attitude(player,target); + var num=get.attitude(player,target); if(num>0){ if(target==player){ num++; @@ -3664,7 +3664,7 @@ character.hearth={ player.chooseTarget(get.prompt('xmojian'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); } "step 1" if(result.bool){ @@ -3723,7 +3723,7 @@ character.hearth={ var players=game.filterPlayer(); for(var i=0;inum){ if(att>0){ @@ -3740,7 +3740,7 @@ character.hearth={ }, result:{ player:function(player,target){ - return (player.countCards('h')-target.countCards('h'))*ai.get.attitude(player,target); + return (player.countCards('h')-target.countCards('h'))*get.attitude(player,target); } }, expose:0.2 @@ -4055,7 +4055,7 @@ character.hearth={ return target!=player&&Math.abs(target.countCards('h')-nh)<=nm; }).ai=function(target){ if(!check) return 0; - if(ai.get.attitude(player,target)<0){ + if(get.attitude(player,target)<0){ return target.countCards('h')-nh; } return 0; @@ -4098,9 +4098,9 @@ character.hearth={ }, check:function(event,player){ if(event.player.isTurnedOver()){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; } - return ai.get.attitude(player,event.player)<=0; + return get.attitude(player,event.player)<=0; }, logTarget:'player', content:function(){ @@ -4133,7 +4133,7 @@ character.hearth={ return get.type(card)!='basic'; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ var card=cards[0]; @@ -4158,7 +4158,7 @@ character.hearth={ }, logTarget:'player', check:function(event,player){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, content:function(){ trigger.player.recover(); @@ -4256,7 +4256,7 @@ character.hearth={ order:9, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player,target)+0.5; + var eff=get.damageEffect(target,player,target)+0.5; if(eff>0&&eff<=0.5) return 0; return eff; } @@ -4275,7 +4275,7 @@ character.hearth={ 'step 1' player.addTempSkill('fengxing2','phaseAfter'); player.chooseToDiscard('he',get.prompt('fengxing')).set('ai',function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }).logSkill='fengxing'; 'step 2' if(result.bool){ @@ -4354,7 +4354,7 @@ character.hearth={ return player.countCards('he',{subtype:'equip2'})>0; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ player.changeHujia(); @@ -4384,7 +4384,7 @@ character.hearth={ player.chooseTarget(get.prompt('shijie'),function(card,player,target){ return player!=target&&target.countCards('h')>0; }).ai=function(target){ - return 11-ai.get.attitude(player,target); + return 11-get.attitude(player,target); }; 'step 1' if(result.bool){ @@ -4410,7 +4410,7 @@ character.hearth={ position:'he', usable:1, check:function(card){ - return 9-ai.get.value(card) + return 9-get.value(card) }, filterTarget:function(card,player,target){ if(player.storage.anying) return true; @@ -4452,7 +4452,7 @@ character.hearth={ content:'已进入暗影形态' }, check:function(card){ - return 9-ai.get.value(card) + return 9-get.value(card) }, filterTarget:true, content:function(){ @@ -4479,7 +4479,7 @@ character.hearth={ filterCard:{color:'black'}, position:'he', check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ player.storage.anying=true; @@ -4493,7 +4493,7 @@ character.hearth={ player:function(player){ if(player.hasUnknown()) return 0; return !game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>0&¤t.isDamaged()&¤t.hp<=2; + return get.attitude(player,current)>0&¤t.isDamaged()&¤t.hp<=2; }); } } @@ -4522,8 +4522,8 @@ character.hearth={ direct:true, content:function(){ 'step 0' - var eff=ai.get.effect(trigger.targets[0],trigger.card,trigger.player,player); - var att=ai.get.attitude(player,trigger.player); + var eff=get.effect(trigger.targets[0],trigger.card,trigger.player,player); + var att=get.attitude(player,trigger.player); player.chooseCard(get.prompt('bianxing'),function(card){ if(card.name!=trigger.card.name){ if(get.type(card)=='basic'&&get.info(card).enable){ @@ -4537,7 +4537,7 @@ character.hearth={ if(trigger.targets[0].hp==trigger.targets[0].maxHp) return 0; } if(eff>=0) return 0; - return ai.get.effect(trigger.targets[0],card,trigger.player,player); + return get.effect(trigger.targets[0],card,trigger.player,player); }; 'step 1' if(result.bool){ @@ -4575,7 +4575,7 @@ character.hearth={ }, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, discard:false, prepare:function(cards,player){ @@ -4702,7 +4702,7 @@ character.hearth={ }, check:function(card){ if(get.suit(card)=='spade'&&card.number>=2&&card.number<=9){ - return 6-ai.get.value(card); + return 6-get.value(card); } return -1; }, @@ -4757,7 +4757,7 @@ character.hearth={ trigger:{player:'damageEnd',source:'damageEnd'}, check:function(event,player){ var target=(player==event.player)?event.source:event.player; - return ai.get.attitude(player,target)<0; + return get.attitude(player,target)<0; }, filter:function(event,player){ var target=(player==event.player)?event.source:event.player; @@ -4800,7 +4800,7 @@ character.hearth={ else str=get.translation(trigger.parent.name); var cards=[ui.cardPile.childNodes[0],ui.cardPile.childNodes[1]]; - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); var delta=trigger.judge(ui.cardPile.childNodes[1])-trigger.judge(ui.cardPile.childNodes[0]); player.chooseControl('调换顺序','cancel2', ui.create.dialog('先知:'+get.translation(trigger.player)+'的'+str+'判定',cards,'hidden')).ai=function(){ @@ -4844,7 +4844,7 @@ character.hearth={ } return true; }).ai=function(target){ - return 1-ai.get.attitude(player,target); + return 1-get.attitude(player,target); }; "step 1" if(result.bool){ @@ -4913,16 +4913,16 @@ character.hearth={ direct:true, content:function(){ "step 0" - var val=ai.get.value(trigger.card); + var val=get.value(trigger.card); var suit=get.suit(trigger.card); - var eff=ai.get.effect(trigger.target,trigger.card,trigger.player,player); + var eff=get.effect(trigger.target,trigger.card,trigger.player,player); var next=player.chooseToDiscard('是否对'+get.translation(trigger.player)+'使用的'+get.translation(trigger.card)+'发动【闷棍】?',function(card){ return get.suit(card)==suit; }); next.logSkill=['mengun',trigger.player]; next.ai=function(card){ if(eff>=0) return 0; - return Math.min(8,1+val)-ai.get.value(card); + return Math.min(8,1+val)-get.value(card); } "step 1" if(result.bool){ @@ -4981,7 +4981,7 @@ character.hearth={ order:9, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -4996,7 +4996,7 @@ character.hearth={ content:function(){ "step 0" var next=player.chooseToDiscard(get.prompt('jihuo')); - next.ai=ai.get.unuseful2; + next.ai=get.unuseful2; next.logSkill='jihuo'; "step 1" if(result.bool){ @@ -5024,8 +5024,8 @@ character.hearth={ content:function(){ "step 0"; player.chooseTarget(get.prompt('tzhenji')).ai=function(target){ - var bool=ai.get.attitude(player,target)>0; - return ai.get.damageEffect(target,player,player,'thunder')-(bool?1:0); + var bool=get.attitude(player,target)>0; + return get.damageEffect(target,player,player,'thunder')-(bool?1:0); }; "step 1" if(result.bool){ @@ -5062,7 +5062,7 @@ character.hearth={ content:function(){ "step 0"; player.chooseTarget(get.prompt('tzhenji_old')).ai=function(target){ - return ai.get.damageEffect(target,player,player,'thunder')-1; + return get.damageEffect(target,player,player,'thunder')-1; }; "step 1" if(result.bool){ @@ -5096,7 +5096,7 @@ character.hearth={ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var hastarget=game.hasPlayer(function(current){ - return ai.get.attitude(player,current)<0; + return get.attitude(player,current)<0; }); var ns=target.countCards('h','shan'); var nh=target.countCards('h'); @@ -5465,7 +5465,7 @@ character.hearth={ player.chooseTarget('活力图腾:令一名其他角色回复一点体力',function(card,player,target){ return target!=player&&target.hp0; + return get.attitude(player,event.player)>0; }, filter:function(event,player){ if(event.num<=1) return false; @@ -237,7 +237,7 @@ character.jiange={ player.chooseTarget(get.prompt('juechen'),function(card,player,target){ return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } "step 1" if(result.bool){ @@ -251,7 +251,7 @@ character.jiange={ check:function(event,player){ for(var i=0;i0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } } "step 2" @@ -321,7 +321,7 @@ character.jiange={ return player!=target; }).ai=function(target){ if(target.hasSkillTag('nofire')) return 0; - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; } else{ @@ -434,7 +434,7 @@ character.jiange={ if(player.hasJudge('lebu')){ if(target==player) return 0.1; } - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(player.countCards('h')>player.hp){ if(target==player) return Math.max(1,att-2); } @@ -475,7 +475,7 @@ character.jiange={ player.chooseTarget(get.prompt('tianyu'),[1,num],function(card,player,target){ return !target.isLinked()&&player!=target; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } "step 1" if(result.bool){ @@ -518,7 +518,7 @@ character.jiange={ player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){ return target.hp0; + return player.canUse(card,current)&&get.effect(current,card,player,player)>0; })){ if(card.name=='sha'){ if(card.nature=='fire') return 2.95; @@ -118,7 +118,7 @@ character.old={ player.chooseTarget('选择交换手牌的目标',function(card,player,target){ return target.countCards('h')0&¤t.countCards('h')0&¤t.countCards('h')0){ + if(target.hasSkill('qianggu2')&&get.attitude(player,target)>0){ return [0,num]; } if(target.hp==1&&!target.hasShan()) return; @@ -177,7 +177,7 @@ character.ow={ selectCard:2, position:'he', check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filter:function(event,player){ return player.countCards('he')>=2; @@ -207,16 +207,16 @@ character.ow={ "step 0" var eff; if(player.hasSkill('woliu2')){ - eff=-ai.get.attitude(trigger.player,player); + eff=-get.attitude(trigger.player,player); } else{ - eff=ai.get.effect(player,trigger.card,trigger.player,trigger.player); + eff=get.effect(player,trigger.card,trigger.player,trigger.player); } trigger.player.chooseToDiscard('享乐:弃置一张基本牌,否则杀对'+get.translation(player)+'无效',function(card){ return get.type(card)=='basic'; }).set('ai',function(card){ if(_status.event.eff>0){ - return 10-ai.get.value(card); + return 10-get.value(card); } return 0; }).set('eff',eff); @@ -231,13 +231,13 @@ character.ow={ target:function(card,player,target,current){ if(card.name=='sha'){ if(_status.event.name=='qianggu2') return; - if(ai.get.attitude(player,target)>0) return; + if(get.attitude(player,target)>0) return; var bs=player.getCards('h',{type:'basic'}); if(bs.length<2) return 0; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(bs.length<=3&&player.countCards('h','sha')<=1){ for(var i=0;i=0) return 0; if(!target.countCards('he')) return -0.01; var dist=get.distance(player,target); @@ -477,8 +477,8 @@ character.ow={ var suit=(player==trigger.player)?'heart':'spade'; var next=player.chooseToDiscard(position,{suit:suit},get.prompt('pingzhang',trigger.player)); next.ai=function(card){ - if(ai.get.damageEffect(trigger.player,trigger.source,player)<0){ - return 8-ai.get.value(card); + if(get.damageEffect(trigger.player,trigger.source,player)<0){ + return 8-get.value(card); } return 0; } @@ -542,7 +542,7 @@ character.ow={ filterCard:true, position:'he', check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ 'step 0' @@ -560,7 +560,7 @@ character.ow={ expose:0.2, result:{ target:function(player,target){ - if(ai.get.damageEffect(target,player,target)<0&&player.hasCard(function(card){ + if(get.damageEffect(target,player,target)<0&&player.hasCard(function(card){ return get.tag(card,'damage')?true:false; })){ return -1; @@ -628,7 +628,7 @@ character.ow={ }, logTarget:'target', check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, intro:{ content:'players' @@ -674,10 +674,10 @@ character.ow={ var next=player.chooseToDiscard(get.prompt('yinshen'),'he',{type:'equip'}); next.logSkill='yinshen'; next.ai=function(card){ - if(player.hp==1) return 8-ai.get.value(card); - if(player.isZhu) return 7-ai.get.value(card); - if(player.hp==2) return 6-ai.get.value(card); - return 5-ai.get.value(card); + if(player.hp==1) return 8-get.value(card); + if(player.isZhu) return 7-get.value(card); + if(player.hp==2) return 6-get.value(card); + return 5-get.value(card); }; "step 1" if(result.bool){ @@ -772,11 +772,11 @@ character.ow={ check:function(card){ var player=_status.event.player; if(game.hasPlayer(function(current){ - return current.hp==1&&ai.get.attitude(player,current)>2; + return current.hp==1&&get.attitude(player,current)>2; })){ - return 7-ai.get.value(card); + return 7-get.value(card); } - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ player.changeHujia(-1); @@ -910,7 +910,7 @@ character.ow={ forced:true, alter:true, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, filter:function(event,player){ var num=0.2; @@ -931,7 +931,7 @@ character.ow={ trigger:{source:'damageBegin'}, forced:true, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, filter:function(event,player){ var num=0.2; @@ -951,7 +951,7 @@ character.ow={ return player.countCards('he',{suit:'spade'})>0; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ 'step 0' @@ -1010,7 +1010,7 @@ character.ow={ order:2.1, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)<3) return 0; + if(get.attitude(player,target)<3) return 0; if(target.hasJudge('lebu')) return 0; if(target.hasSkill('aqianghua2')) return 0.1; return 1; @@ -1049,7 +1049,7 @@ character.ow={ }, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, discard:false, prepare:'give2', @@ -1131,7 +1131,7 @@ character.ow={ return game.countPlayer(function(current){ if(event.targets.contains(current)==false&¤t!=player&& lib.filter.targetEnabled(event.card,player,current)){ - return ai.get.effect(current,event.card,player,player); + return get.effect(current,event.card,player,player); } })>=0; }, @@ -1205,7 +1205,7 @@ character.ow={ return target!=player&&get.distance(player,target,'attack')<=1; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ target.addTempSkill('shanguang2','phaseAfter'); @@ -1215,9 +1215,9 @@ character.ow={ result:{ target:function(player,target){ var nh=target.countCards('h'); - if(ai.get.attitude(player,target)<0&&nh>=3&& + if(get.attitude(player,target)<0&&nh>=3&& player.canUse('sha',target)&&player.countCards('h','sha')&& - ai.get.effect(target,{name:'sha'},player,player)>0){ + get.effect(target,{name:'sha'},player,player)>0){ return -nh-5; } return -nh; @@ -1302,7 +1302,7 @@ character.ow={ ai:{ order:function(skill,player){ var num=game.countPlayer(function(current){ - return ai.get.attitude(player,current)<0; + return get.attitude(player,current)<0; }); var nh=player.countCards('he',{color:'black'}); if(nh==1&&num>1) return 0; @@ -1329,7 +1329,7 @@ character.ow={ filterCard:true, position:'he', check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, content:function(){ 'step 0' @@ -1379,8 +1379,8 @@ character.ow={ trigger:{source:'damageBefore'}, check:function(event,player){ player.disableSkill('tmp','zhiyuan'); - var eff=ai.get.damageEffect(event.player,player,player); - var att=ai.get.attitude(player,event.player); + var eff=get.damageEffect(event.player,player,player); + var att=get.attitude(player,event.player); var bool=false; if(att>0){ if(eff<=0||event.player.hp0){ + if(get.tag(card,'damage')&&get.attitude(player,target)>0){ if(target.hp==target.maxHp) return [0,0,0,0]; return [0,0,0,1]; } @@ -1418,7 +1418,7 @@ character.ow={ duwen:{ trigger:{source:'damageBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<=0; + return get.attitude(player,event.player)<=0; }, forced:true, filter:function(event,player){ @@ -1461,7 +1461,7 @@ character.ow={ }, check:function(card){ if(ui.selected.cards.length>1) return 0; - return 5-ai.get.value(card); + return 5-get.value(card); }, selectCard:[1,4], content:function(){ @@ -1496,7 +1496,7 @@ character.ow={ var players=game.filterPlayer(); for(var i=0;inum){ min.length=0; min.push(players[i]); @@ -1505,7 +1505,7 @@ character.ow={ } } for(var i=0;i0) return 0; + if(get.attitude(player,min[i])>0) return 0; if(min[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0; } if(min.contains(target)) return -1; @@ -1554,7 +1554,7 @@ character.ow={ }, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, discard:false, prepare:function(cards,player){ @@ -1668,7 +1668,7 @@ character.ow={ }, filterCard:true, check:function(card){ - return 4-ai.get.value(card); + return 4-get.value(card); }, content:function(){ while(player.next!=target){ @@ -1679,9 +1679,9 @@ character.ow={ order:5, result:{ player:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target==player.previous&&att>0) return 1; - if(target==player.next.next&&ai.get.attitude(player,player.next)<0) return 1; + if(target==player.next.next&&get.attitude(player,player.next)<0) return 1; return 0; } } @@ -1719,13 +1719,13 @@ character.ow={ } } if(max==-min){ - return 5-ai.get.value(card); + return 5-get.value(card); } else if(max>-min){ - if(get.color(card)=='red') return 5-ai.get.value(card); + if(get.color(card)=='red') return 5-get.value(card); } else{ - if(get.color(card)=='black') return 5-ai.get.value(card); + if(get.color(card)=='black') return 5-get.value(card); } return 0; }, @@ -1761,7 +1761,7 @@ character.ow={ }); var num=0; for(var i=0;i0){ if(trigger.player.hp==1) goon=true; } @@ -1816,8 +1816,8 @@ character.ow={ if(Math.random()<0.3) goon2=true; player.chooseToDiscard([1,player.countCards('h')],'he',get.prompt('bingqiang',trigger.player)).set('logSkill',['bingqiang',trigger.player]).ai=function(card){ if(ui.selected.cards.length) return 0; - if(goon) return 6-ai.get.value(card); - if(goon2) return 4-ai.get.value(card); + if(goon) return 6-get.value(card); + if(goon2) return 4-get.value(card); return 0; } 'step 1' @@ -1825,7 +1825,7 @@ character.ow={ var num=result.cards.length; event.num=num; player.chooseControl('选项一','选项二','选项三','选项四',function(){ - if(ai.get.attitude(player,trigger.player)>0){ + if(get.attitude(player,trigger.player)>0){ if(Math.random()<0.7) return '选项一'; return '选项三'; } @@ -1917,7 +1917,7 @@ character.ow={ shuangqiang:{ trigger:{source:'damageBegin'}, check:function(event,player){ - var att=ai.get.attitude(player,event.player); + var att=get.attitude(player,event.player); if(event.player.hp==1) return att>0; return att<=0; }, @@ -2020,7 +2020,7 @@ character.ow={ order:11, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)<0){ + if(get.attitude(player,target)<0){ if(get.distance(player,target)>2) return -1.5; return -1; } @@ -2104,12 +2104,12 @@ character.ow={ } target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌,或受到2点火焰伤害').ai=function(card){ if(target.hasSkillTag('nofire')) return 0; - if(get.type(card)!='basic') return 11-ai.get.value(card); - if(target.hp>4) return 7-ai.get.value(card); - if(target.hp==4&&num>=3) return 7-ai.get.value(card); - if(target.hp==3&&num>=4) return 7-ai.get.value(card); - if(num>1) return 8-ai.get.value(card); - return 10-ai.get.value(card); + if(get.type(card)!='basic') return 11-get.value(card); + if(target.hp>4) return 7-get.value(card); + if(target.hp==4&&num>=3) return 7-get.value(card); + if(target.hp==3&&num>=4) return 7-get.value(card); + if(num>1) return 8-get.value(card); + return 10-get.value(card); }; 'step 1' if(!result.bool){ @@ -2129,7 +2129,7 @@ character.ow={ for(var i=0;i2) continue; var nh=players[i].countCards('h'); - var att=ai.get.attitude(player,players[i]); + var att=get.attitude(player,players[i]); if(nh2; var next=player.chooseToDiscard(get.prompt('xiandan')); next.ai=function(card){ - if(dis) return 7-ai.get.value(card); + if(dis) return 7-get.value(card); return 0; } next.logSkill='xiandan'; @@ -2224,7 +2224,7 @@ character.ow={ if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当杀使用或打出', - check:function(card){return 4-ai.get.value(card)}, + check:function(card){return 4-get.value(card)}, ai:{ skillTagFilter:function(player){ if(!player.countCards('he',{color:'black'})) return false; @@ -2256,7 +2256,7 @@ character.ow={ var next=player.chooseToDiscard(get.prompt('lichang'),'he',{color:'red'}); next.logSkill='lichang'; next.ai=function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }; "step 1" if(result.bool){ @@ -2276,7 +2276,7 @@ character.ow={ player.chooseTarget(get.prompt('lichang'),function(card,player,target){ return get.distance(player,target)<=1; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0){ if(target.hp==1&&target.maxHp>1) return att*2; } @@ -2421,7 +2421,7 @@ character.ow={ }, filterCard:{suit:'heart'}, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ var current=game.findPlayer(function(player){ @@ -2443,10 +2443,10 @@ character.ow={ var current=game.findPlayer(function(player){ return player.hasSkill('xie2'); }); - if(current&&ai.get.recoverEffect(current,player,player)>0){ + if(current&&get.recoverEffect(current,player,player)>0){ return 0; } - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -2527,7 +2527,7 @@ character.ow={ }, filterCard:{suit:'spade'}, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ var current=game.findPlayer(function(player){ @@ -2549,7 +2549,7 @@ character.ow={ var current=game.findPlayer(function(player){ return player.hasSkill('luan2'); }); - if(current&&ai.get.attitude(player,current)<0){ + if(current&&get.attitude(player,current)<0){ return 0; } if(target.hp==1) return 0.5; @@ -2677,12 +2677,12 @@ character.ow={ order:1, result:{ target:function(player,target){ - var eff=ai.get.recoverEffect(target,player,target); + var eff=get.recoverEffect(target,player,target); if(player.hp==1) return eff; if(player.hasUnknown()) return 0; var num1=0,num2=0,num3=0,players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ num1++; if(players[i].isDamaged()){ num2++; @@ -2731,10 +2731,10 @@ character.ow={ return get.color(card)=='black'&&lib.filter.cardDiscardable(card,player); }, ai1:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai2:function(target){ - var att=-ai.get.attitude(player,target); + var att=-get.attitude(player,target); if(target==player.next){ att/=10; } @@ -2803,7 +2803,7 @@ character.ow={ selectCard:2, position:'he', check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, selectTarget:-1, multitarget:true, @@ -2823,7 +2823,7 @@ character.ow={ result:{ target:function(player,target){ if(player.hasUnknown()) return 0; - return ai.get.effect(target,{name:'chiyuxi'},player,target); + return get.effect(target,{name:'chiyuxi'},player,target); } }, }, @@ -2847,13 +2847,13 @@ character.ow={ var eff=0; var targets=game.filterPlayer(function(current){ if(current!=trigger.player&&get.distance(trigger.player,current)<=1){ - eff+=ai.get.damageEffect(current,player,player); + eff+=get.damageEffect(current,player,player); return true; } }); event.targets=targets; player.chooseToDiscard(get.prompt('feidan',targets)).set('ai',function(card){ - if(eff>0) return 7-ai.get.value(card); + if(eff>0) return 7-get.value(card); return 0; }).set('logSkill',['feidan',targets]); "step 1" @@ -2891,9 +2891,9 @@ character.ow={ return true; }).set('ai',function(target){ if(player.storage.yuedong_recover){ - return ai.get.recoverEffect(target,player,player); + return get.recoverEffect(target,player,player); } - var att=ai.get.attitude(player,target)/Math.sqrt(2+target.countCards('h')); + var att=get.attitude(player,target)/Math.sqrt(2+target.countCards('h')); if(player==target){ var num2=player.needsToDiscard(num); if(num2>1) return att/5; @@ -2934,7 +2934,7 @@ character.ow={ return player.countCards('he')>1&&!player.storage.yuedong_recover; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ player.storage.yuedong_recover=true; @@ -2945,7 +2945,7 @@ character.ow={ player:function(player){ var num1=0,num2=0,players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ num2++; if(players[i].hp<=2&&players[i].maxHp>2){ num1++; @@ -2983,7 +2983,7 @@ character.ow={ var player=_status.event.player; var num1=0,num2=0,players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ num2++; if(players[i].hp<=2&&players[i].maxHp>2){ num1++; @@ -2993,19 +2993,19 @@ character.ow={ if(player.storage.yuedong_recover){ if(num1>1&&!player.storage.yuedong_num){ if(ui.selected.cards.length) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; } else{ if(num2>1&&!player.storage.yuedong_num){ if(ui.selected.cards.length) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); } if(num2>2){ - return 6-ai.get.value(card); + return 6-get.value(card); } - return 5-ai.get.value(card); + return 5-get.value(card); } }, content:function(){ @@ -3043,13 +3043,13 @@ character.ow={ var suit=get.suit(card); if(suit=='heart'){ if(game.hasPlayer(function(current){ - return current.hp==1&&ai.get.attitude(player,current)>0 + return current.hp==1&&get.attitude(player,current)>0 })); } else if(suit=='spade'){ - return 7-ai.get.value(card); + return 7-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }, filter:function(event,player){ return player.countCards('he')>0; @@ -3076,7 +3076,7 @@ character.ow={ case 'heart':if(target.hp==1) return 1;return 0.1; case 'diamond':return 1+Math.sqrt(target.countCards('h')); case 'club':return -target.countCards('h')-Math.sqrt(target.countCards('h','sha')); - case 'spade':return ai.get.damageEffect(target,player,target,'thunder'); + case 'spade':return get.damageEffect(target,player,target,'thunder'); default:return 0; } } @@ -3171,7 +3171,7 @@ character.ow={ threaten:2, result:{ target:function(player,target){ - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -3182,7 +3182,7 @@ character.ow={ return event.player!=player&&!player.isTurnedOver()&&!player.storage.shanxian; }, check:function(event,player){ - return ai.get.attitude(player,event.player)<0&& + return get.attitude(player,event.player)<0&& ((player.countCards('h')>player.hp&&player.countCards('h','lebu')==0)||get.distance(player,event.player)>1); }, alter:true, diff --git a/character/refresh.js b/character/refresh.js index 239c4d136..298cf09d7 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -54,16 +54,16 @@ character.refresh={ if(players[i].hasSkill('haoshi')&& !players[i].isTurnedOver()&& !players[i].hasJudge('lebu')&& - ai.get.attitude(player,players[i])>=3&& - ai.get.attitude(players[i],player)>=3){ - return 11-ai.get.value(card); + get.attitude(player,players[i])>=3&& + get.attitude(players[i],player)>=3){ + return 11-get.value(card); } } - if(player.countCards('h')>player.hp) return 10-ai.get.value(card); - if(player.countCards('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-get.value(card); + if(player.countCards('h')>2) return 6-get.value(card); return -1; } - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ 'step 0' @@ -106,7 +106,7 @@ character.refresh={ } if(card.name=='sha'){ if(game.hasPlayer(function(current){ - return player.canUse(card,current)&&ai.get.effect(current,card,player,player)>0 + return player.canUse(card,current)&&get.effect(current,card,player,player)>0 })){ if(card.nature=='fire') return 2.95; if(card.nature=='thunder') return 2.92; @@ -141,7 +141,7 @@ character.refresh={ return player.canUse(_status.event.fakecard,target,true,true); },true,'选择出杀目标').set('ai',function(target){ var player=_status.event.player; - return ai.get.effect(target,_status.event.fakecard,player,player); + return get.effect(target,_status.event.fakecard,player,player); }).set('fakecard',card); } else{ @@ -184,7 +184,7 @@ character.refresh={ if(player==target&&get.type(card)=='equip'){ if(player.countCards('e',{subtype:get.subtype(card)})){ if(game.hasPlayer(function(current){ - return current!=player&&ai.get.attitude(player,current)>0; + return current!=player&&get.attitude(player,current)>0; })){ return 0; } @@ -222,7 +222,7 @@ character.refresh={ return evt.player.canUse({name:'juedou'},target)&&target!=_status.event.player; },get.prompt('liyu')).set('ai',function(target){ var evt=_status.event.getParent(); - return ai.get.effect(target,{name:'juedou'},evt.player,_status.event.player)-2; + return get.effect(target,{name:'juedou'},evt.player,_status.event.player)-2; }); 'step 1' if(result.bool){ @@ -284,7 +284,7 @@ character.refresh={ player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){ return target.countCards('h')>0&&player!=target&&target.countCards('h')>=player.countCards('h'); },function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(target.hasSkill('tuntian')) return att/10; return 1-att; }); @@ -320,13 +320,13 @@ character.refresh={ var player=_status.event.player; var judging=_status.event.judging; var result=trigger.judge(card)-trigger.judge(judging); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ - return result-ai.get.value(card)/2; + return result-get.value(card)/2; } else{ - return -result-ai.get.value(card)/2; + return -result-get.value(card)/2; } }).set('judging',trigger.player.judging[0]); "step 1" @@ -371,14 +371,14 @@ character.refresh={ return (event.source&&event.source.countCards('he')&&event.num>0&&event.source!=player); }, content:function(){ - player.gainPlayerCard([1,trigger.num],get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['refankui',trigger.source]); + player.gainPlayerCard([1,trigger.num],get.prompt('fankui',trigger.source),trigger.source,get.buttonValue,'he').set('logSkill',['refankui',trigger.source]); }, ai:{ effect:{ target:function(card,player,target){ if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1.5]; - if(ai.get.attitude(target,player)<0) return [1,1]; + if(get.attitude(target,player)<0) return [1,1]; } } } @@ -427,7 +427,7 @@ character.refresh={ return (event.source!=undefined&&event.num>0); }, check:function(event,player){ - return (ai.get.attitude(player,event.source)<=0); + return (get.attitude(player,event.source)<=0); }, logTarget:'source', content:function(){ @@ -511,7 +511,7 @@ character.refresh={ return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(target.hasSkillTag('nodu')) return 0; return 1-att; @@ -569,7 +569,7 @@ character.refresh={ }, filterCard:true, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, discard:false, prepare:'give', @@ -588,7 +588,7 @@ character.refresh={ } if(player.hp==1) return 0; for(var i=0;i=8) return 1; + if(get.value(cards[i])>=8) return 1; } if(cards.length>2&&player.hp>2) return 1; if(cards.length>3) return 1; @@ -693,8 +693,8 @@ character.refresh={ } player.chooseTarget('选择发动连营的目标',[1,num]).ai=function(target){ var player=_status.event.player; - if(player==target) return ai.get.attitude(player,target)+10; - return ai.get.attitude(player,target); + if(player==target) return get.attitude(player,target)+10; + return get.attitude(player,target); } "step 1" if(result.bool){ @@ -790,7 +790,7 @@ character.refresh={ game.addVideo('centernode',null,get.cardInfo(event.card)); if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){ player.chooseTarget('选择获得此牌的角色').set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(_status.event.du){ if(target.hasSkillTag('nodu')) return 0; return -att; @@ -925,7 +925,7 @@ character.refresh={ return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(target.hasSkillTag('nodu')) return 0; return 1-att; @@ -1022,7 +1022,7 @@ character.refresh={ } else if(target.hp0; + return get.recoverEffect(target,player,player)>0; }; } else{ @@ -1040,13 +1040,13 @@ character.refresh={ if(hs.length<3) return 0; var bool=false; for(var i=0;i=9&&ai.get.value(hs[i])<7){ + if(hs[i].number>=9&&get.value(hs[i])<7){ bool=true; break; } } if(!bool) return 0; - if(target.countCards('h')>target.hp+1&&ai.get.recoverEffect(target)>0){ + if(target.countCards('h')>target.hp+1&&get.recoverEffect(target)>0){ return 1; } if(player.canUse('sha',target)&&(player.countCards('h','sha')||player.countCards('he',{color:'red'}))){ @@ -1082,7 +1082,7 @@ character.refresh={ audio:2, trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, logTarget:'target', content:function(){ @@ -1101,7 +1101,7 @@ character.refresh={ var num=_status.event.num; if(num==0) return 0; if(card.name=='shan') return num>1?2:0; - return 8-ai.get.value(card); + return 8-get.value(card); }).set('num',num).set('suit',suit); "step 2" if(!result.bool){ @@ -1157,7 +1157,7 @@ character.refresh={ usable:1, filterCard:true, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, position:'he', content:function(){ @@ -1313,7 +1313,7 @@ character.refresh={ return lib.filter.targetEnabled({name:'lebu'},player,target); }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ if(target.hasJudge('lebu')){ @@ -1329,8 +1329,8 @@ character.refresh={ ai:{ result:{ target:function(player,target){ - if(target.hasJudge('lebu')) return -ai.get.effect(target,{name:'lebu'},player,target); - return ai.get.effect(target,{name:'lebu'},player,target); + if(target.hasJudge('lebu')) return -get.effect(target,{name:'lebu'},player,target); + return get.effect(target,{name:'lebu'},player,target); } }, order:9, @@ -1362,7 +1362,7 @@ character.refresh={ }).set('ai',function(target){ var trigger=_status.event.getTrigger(); if(game.phaseNumber>game.players.length*2&&trigger.targets.length>=game.players.length-1){ - return -ai.get.effect(target,trigger.card,trigger.player,_status.event.player); + return -get.effect(target,trigger.card,trigger.player,_status.event.player); } return -1; }); @@ -1400,8 +1400,8 @@ character.refresh={ position:'he', selectTarget:[1,Infinity], check:function(card){ - if(get.suit(card)=='spade') return 8-ai.get.value(card); - return 5-ai.get.value(card); + if(get.suit(card)=='spade') return 8-get.value(card); + return 5-get.value(card); }, content:function(){ "step 0" @@ -1432,7 +1432,7 @@ character.refresh={ trigger.untrigger(); trigger.finish(); event.cards=get.cards(4); - player.chooseCardButton(event.cards,2,'选择获得两张牌').set('ai',ai.get.buttonValue); + player.chooseCardButton(event.cards,2,'选择获得两张牌').set('ai',get.buttonValue); "step 1" if(result.bool){ var choice=[]; @@ -1456,8 +1456,8 @@ character.refresh={ event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; }, check:function(event,player){ - if(event.player==player) return ai.get.attitude(player,event.source)>-3; - return ai.get.attitude(player,event.player)>-3; + if(event.player==player) return get.attitude(player,event.source)>-3; + return get.attitude(player,event.player)>-3; }, logTarget:function(event,player){ if(event.player==player) return event.source; diff --git a/character/shenhua.js b/character/shenhua.js index b107b7075..e6d1c70ba 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -90,9 +90,9 @@ character.shenhua={ 'step 0' player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target)).set('ai',function(button){ if(!_status.event.att) return 0; - if(get.position(button.link)=='e') return ai.get.value(button.link); + if(get.position(button.link)=='e') return get.value(button.link); return 1; - }).set('logSkill',['jianchu',trigger.target]).set('att',ai.get.attitude(player,trigger.target)<=0); + }).set('logSkill',['jianchu',trigger.target]).set('att',get.attitude(player,trigger.target)<=0); 'step 1' if(result.bool&&result.links&&result.links.length){ if(get.type(result.links[0])=='equip'){ @@ -159,7 +159,7 @@ character.shenhua={ 'step 1' if(event.dialog.buttons.length>1){ var next=event.current.chooseButton(true,function(button){ - return ai.get.value(button.link,_status.event.player); + return get.value(button.link,_status.event.player); }); next.set('dialog',event.dialog.videoId); next.set('closeDialog',false); @@ -247,11 +247,11 @@ character.shenhua={ targetprompt:['先拿牌','后拿牌'], find:function(type){ var list=game.filterPlayer(function(current){ - return current!=player&&ai.get.attitude(player,current)>3; + return current!=player&&get.attitude(player,current)>3; }); var player=_status.event.player; var num=player.countCards('he',function(card){ - return ai.get.value(card)<7; + return get.value(card)<7; }); var count=null; var from,nh; @@ -264,7 +264,7 @@ character.shenhua={ nh=from.countCards('h'); list=game.filterPlayer(function(current){ - return current!=player&&ai.get.attitude(player,current)<1; + return current!=player&&get.attitude(player,current)<1; }); if(list.length==0) return null; list.sort(function(a,b){ @@ -283,7 +283,7 @@ character.shenhua={ check:function(card){ var count=lib.skill.redimeng.find(3); if(count==null) return -1; - if(ui.selected.cards.length0); + get.effect(current,card,player,player)>0); })){ return 1; } @@ -528,7 +528,7 @@ character.shenhua={ trigger:{player:'shaBegin'}, logTarget:'target', check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, filter:function(event,player){ if(event.target.countCards('h')<=player.countCards('h')) return true; @@ -632,12 +632,12 @@ character.shenhua={ }, content:function(){ "step 0" - var eff=ai.get.effect(player,trigger.card,trigger.player,trigger.player); + var eff=get.effect(player,trigger.card,trigger.player,trigger.player); trigger.player.chooseToDiscard('享乐:弃置一张基本牌,否则杀对'+get.translation(player)+'无效',function(card){ return get.type(card)=='basic'; }).set('ai',function(card){ if(_status.event.eff>0){ - return 10-ai.get.value(card); + return 10-get.value(card); } return 0; }).set('eff',eff); @@ -657,7 +657,7 @@ character.shenhua={ if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(bs.length<=3&&player.countCards('h','sha')<=1){ for(var i=0;i0; @@ -863,7 +863,7 @@ character.shenhua={ content:function(){ "step 0" var check=game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>0&¤t.countCards('j'); + return get.attitude(player,current)>0&¤t.countCards('j'); }); if(!check){ if(player.countCards('h')>player.hp+1){ @@ -879,28 +879,28 @@ character.shenhua={ player.chooseCardTarget({ ai1:function(card){ if(!_status.event.check) return 0; - return 7-ai.get.useful(card); + return 7-get.useful(card); }, ai2:function(target){ if(!_status.event.check) return 0; var player=_status.event.player; if(ui.selected.targets.length==0){ - if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 10; - if(ai.get.attitude(player,target)<0){ + if(target.countCards('j')&&get.attitude(player,target)>0) return 10; + if(get.attitude(player,target)<0){ var players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if((target.getEquip(1)&&!players[i].getEquip(1))|| (target.getEquip(2)&&!players[i].getEquip(2))|| (target.getEquip(3)&&!players[i].getEquip(3))|| (target.getEquip(4)&&!players[i].getEquip(4))|| - (target.getEquip(5)&&!players[i].getEquip(5))) return -ai.get.attitude(player,target); + (target.getEquip(5)&&!players[i].getEquip(5))) return -get.attitude(player,target); } } } return 0; } - return -ai.get.attitude(player,target)*ai.get.attitude(player,ui.selected.targets[0]); + return -get.attitude(player,target)*get.attitude(player,ui.selected.targets[0]); }, multitarget:true, filterTarget:function(card,player,target){ @@ -948,12 +948,12 @@ character.shenhua={ var player=_status.event.player; var targets0=_status.event.targets0; var targets1=_status.event.targets1; - if(ai.get.attitude(player,targets0)>ai.get.attitude(player,targets1)){ + if(get.attitude(player,targets0)>get.attitude(player,targets1)){ return get.position(button.link)=='j'?10:0; } else{ if(get.position(button.link)=='j') return -10; - return ai.get.equipValue(button.link); + return get.equipValue(button.link); } },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ var targets1=_status.event.targets1; @@ -1002,7 +1002,7 @@ character.shenhua={ next.logSkill='qiaobian'; next.ai=function(card){ if(discard){ - return 100-ai.get.useful(card); + return 100-get.useful(card); } else{ return -1; @@ -1084,7 +1084,7 @@ character.shenhua={ } } else if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ - if(ai.get.attitude(player,target)>0&&card.name=='juedou') return; + if(get.attitude(player,target)>0&&card.name=='juedou') return; if(get.tag(card,'damage')&&target.hasSkillTag('maixie')) return; if(target.countCards('h')==0) return 2; if(target.hasSkill('ziliang')) return 0.7; @@ -1238,7 +1238,7 @@ character.shenhua={ content:function(){ "step 0" if(target.storage.hunzi){ - target.chooseControl('拒绝','不拒绝').set('prompt','是否拒绝制霸拼点?').set('choice',ai.get.attitude(target,player)<=0); + target.chooseControl('拒绝','不拒绝').set('prompt','是否拒绝制霸拼点?').set('choice',get.attitude(target,player)<=0); } else{ event.forced=true; @@ -1254,7 +1254,7 @@ character.shenhua={ if(card.name=='du') return 20; var player=get.owner(card); var target=_status.event.getParent().target; - if(player!=target&&ai.get.attitude(player,target)>0){ + if(player!=target&&get.attitude(player,target)>0){ return -get.number(card); } return get.number(card); @@ -1272,7 +1272,7 @@ character.shenhua={ expose:0.2, result:{ target:function(player,target){ - if(player.countCards('h','du')&&ai.get.attitude(player,target)<0) return -1; + if(player.countCards('h','du')&&get.attitude(player,target)<0) return -1; if(player.countCards('h')<=player.hp) return 0; var maxnum=0; var cards2=target.getCards('h'); @@ -1304,9 +1304,9 @@ character.shenhua={ check:function(card){ var player=_status.currentPhase; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }, filterTarget:function(card,player,target){ if(target.isMin()) return false; @@ -1357,7 +1357,7 @@ character.shenhua={ } } } - if(ai.get.attitude(player,event.player)>0){ + if(get.attitude(player,event.player)>0){ if(du&&num<=3){ return false; } @@ -1382,7 +1382,7 @@ character.shenhua={ var check=lib.skill.guzheng.checkx(trigger,player); player.chooseCardButton(event.cards,'固政:选择令'+get.translation(trigger.player)+'收回的牌').set('ai',function(button){ if(_status.event.check){ - return 20-ai.get.value(button.link); + return 20-get.value(button.link); } return 0; }).set('check',check); @@ -1416,8 +1416,8 @@ character.shenhua={ }, direct:true, checkx:function(event,player){ - var att1=ai.get.attitude(player,event.player); - var att2=ai.get.attitude(player,event.source); + var att1=get.attitude(player,event.player); + var att2=get.attitude(player,event.source); return att1>0&&att2<=0; }, content:function(){ @@ -1425,7 +1425,7 @@ character.shenhua={ var next=player.chooseToDiscard('he',get.prompt('beige')); var check=lib.skill.beige.checkx(trigger,player); next.set('ai',function(card){ - if(_status.event.goon) return 8-ai.get.value(card); + if(_status.event.goon) return 8-get.value(card); return 0; }); next.set('logSkill','beige'); @@ -1876,7 +1876,7 @@ character.shenhua={ event.player.countCards('h')&&player.countCards('h'))&&event.player!=player; }, check:function(event,player){ - return ai.get.attitude(player,event.player)<0&&player.countCards('h')>1; + return get.attitude(player,event.player)<0&&player.countCards('h')>1; }, priority:5, content:function(){ @@ -1925,8 +1925,8 @@ character.shenhua={ return player!=target }).ai=function(target){ var player=_status.event.player; - if(ai.get.attitude(_status.event.player,target)==0) return 0; - if(ai.get.attitude(_status.event.player,target)>0){ + if(get.attitude(_status.event.player,target)==0) return 0; + if(get.attitude(_status.event.player,target)>0){ if(target.classList.contains('turnedover')) return 1000-target.countCards('h'); if(player.maxHp-player.hp<3) return -1; return 100-target.countCards('h'); @@ -1957,15 +1957,15 @@ character.shenhua={ var turnfriend=false; var players=game.filterPlayer(); for(var i=0;i0&&players[i].isTurnedOver()){ + if(get.attitude(target,players[i])>0&&players[i].isTurnedOver()){ hastarget=true; turnfriend=true; } } - if(ai.get.attitude(player,target)>0&&!hastarget) return; + if(get.attitude(player,target)>0&&!hastarget) return; if(turnfriend||target.hp==target.maxHp) return [0.5,1]; if(target.hp>1) return [1,0.5]; } @@ -2000,7 +2000,7 @@ character.shenhua={ if(event.list.length){ var current=event.list.shift(); event.current=current; - player.chooseBool(get.prompt('songwei',current)).set('choice',ai.get.attitude(player,current)>0); + player.chooseBool(get.prompt('songwei',current)).set('choice',get.attitude(player,current)>0); } else{ event.finish(); @@ -2032,7 +2032,7 @@ character.shenhua={ position:'he', viewAs:{name:'bingliang'}, prompt:'将一黑色的基本牌或装备牌当兵粮寸断使用', - check:function(card){return 6-ai.get.value(card)}, + check:function(card){return 6-get.value(card)}, ai:{ order:9 } @@ -2066,7 +2066,7 @@ character.shenhua={ } } for(var i=0;i0) return true; + if(get.attitude(player,min[i])>0) return true; } return false; }, @@ -2105,7 +2105,7 @@ character.shenhua={ }, forced:true, ai2:function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); } }); "step 1" @@ -2144,7 +2144,7 @@ character.shenhua={ var count; var players=game.filterPlayer(); for(var i=0;i3) list.push(players[i]); + if(players[i]!=player&&get.attitude(player,players[i])>3) list.push(players[i]); } list.sort(function(a,b){ return a.countCards('h')-b.countCards('h'); @@ -2154,7 +2154,7 @@ character.shenhua={ list.length=0; for(var i=0;i=2) return -1; - if(ui.selected.cards.length3) list.push(players[i]); + if(players[i]!=player&&get.attitude(player,players[i])>3) list.push(players[i]); } list.sort(function(a,b){ return a.countCards('h')-b.countCards('h'); }); - if(target==list[0]) return ai.get.attitude(player,target); - return -ai.get.attitude(player,target); + if(target==list[0]) return get.attitude(player,target); + return -get.attitude(player,target); } else{ var from=ui.selected.targets[0]; for(var i=0;i=list[0].countCards('h')) return -ai.get.attitude(player,target); + if(from.countCards('h')>=list[0].countCards('h')) return -get.attitude(player,target); for(var i=0;i=2) return -ai.get.attitude(player,target); - if(target==list[i]) return ai.get.attitude(player,target); - return -ai.get.attitude(player,target); + if(count<2&&from.countCards('h')>=2) return -get.attitude(player,target); + if(target==list[i]) return get.attitude(player,target); + return -get.attitude(player,target); } } } @@ -2228,8 +2228,8 @@ character.shenhua={ if(player.maxHp-player.hp==1&&target.countCards('he')==0){ return 0; } - if(ai.get.attitude(_status.event.player,target)>0){ - return 10+ai.get.attitude(_status.event.player,target); + if(get.attitude(_status.event.player,target)>0){ + return 10+get.attitude(_status.event.player,target); } if(player.maxHp-player.hp==1){ return -1; @@ -2252,7 +2252,7 @@ character.shenhua={ var str2='摸一弃'+get.cnNumber(event.num,true); player.chooseControl(str1,str2,function(event,player){ return _status.event.choice; - }).set('choice',ai.get.attitude(player,event.target)>0?str1:str2); + }).set('choice',get.attitude(player,event.target)>0?str1:str2); event.str=str1; } } @@ -2305,8 +2305,8 @@ character.shenhua={ if(player.maxHp-player.hp==1&&target.countCards('he')==0){ return 0; } - if(ai.get.attitude(_status.event.player,target)>0){ - return 10+ai.get.attitude(_status.event.player,target); + if(get.attitude(_status.event.player,target)>0){ + return 10+get.attitude(_status.event.player,target); } if(player.maxHp-player.hp==1){ return -1; @@ -2326,7 +2326,7 @@ character.shenhua={ var str2='摸一弃'+get.cnNumber(event.num,true); player.chooseControl(str1,str2,function(event,player){ return _status.event.choice; - }).set('choice',ai.get.attitude(player,event.target)>0?str1:str2); + }).set('choice',get.attitude(player,event.target)>0?str1:str2); event.str=str1; } } @@ -2375,7 +2375,7 @@ character.shenhua={ prompt:'将一张黑桃手牌当酒使用', check:function(card){ if(_status.event.type=='dying') return 1; - return 4-ai.get.value(card); + return 4-get.value(card); }, ai:{ skillTagFilter:function(player){ @@ -2405,7 +2405,7 @@ character.shenhua={ next.autochoose=lib.filter.autoRespondShan; next.ai=function(card){ if(trigger.target.countCards('h','shan')>1){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return -1; }; @@ -2471,7 +2471,7 @@ character.shenhua={ if(event.list.length){ var current=event.list.shift(); event.current=current; - player.chooseBool(get.prompt('baonue',current)).set('choice',ai.get.attitude(player,current)>0); + player.chooseBool(get.prompt('baonue',current)).set('choice',get.attitude(player,current)>0); } else{ event.finish(); @@ -2552,7 +2552,7 @@ character.shenhua={ var num=0; var players=game.filterPlayer(); for(var i=0;i0) att=1; if(att<0) att=-1; if(players[i]!=player&&players[i].hp<=3){ @@ -2609,9 +2609,9 @@ character.shenhua={ check:function(card){ var player=_status.currentPhase; if(player.countCards('h')>player.hp){ - return 6-ai.get.value(card); + return 6-get.value(card); } - return 4-ai.get.value(card) + return 4-get.value(card) } }, bazhen:{ @@ -2626,7 +2626,7 @@ character.shenhua={ effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ - if(ai.get.equipValue(card)<=7.5) return 0; + if(get.equipValue(card)<=7.5) return 0; } if(target.getEquip(2)) return; return lib.skill.bagua_skill.ai.effect.target.apply(this,arguments); @@ -2645,7 +2645,7 @@ character.shenhua={ }, viewAs:{name:'wuxie'}, prompt:'将一张黑色手牌当无懈可击使用', - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, threaten:1.2 }, lianhuan:{ @@ -2662,7 +2662,7 @@ character.shenhua={ }, viewAs:{name:'tiesuo'}, prompt:'将一张梅花牌当铁锁连环使用', - check:function(card){return 4-ai.get.value(card)} + check:function(card){return 4-get.value(card)} }, lianhuan2:{ audio:2, @@ -2674,7 +2674,7 @@ character.shenhua={ return get.suit(card)=='club'; }, check:function(card){ - return 5-ai.get.useful(card); + return 5-get.useful(card); }, content:function(){ player.draw(); @@ -2828,7 +2828,7 @@ character.shenhua={ var source=_status.event.source; return target!=source&&get.distance(source,target,'attack')<=1; },true).set('ai',function(target){ - return ai.get.damageEffect(target,_status.event.source,player); + return get.damageEffect(target,_status.event.source,player); }).set('source',target); } else{ @@ -2849,14 +2849,14 @@ character.shenhua={ order:0.5, result:{ target:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); var oc=(target.countCards('h')==1); if(att>0&&oc) return 0; var players=game.filterPlayer(); for(var i=0;i0){ + if(get.damageEffect(players[i],target,player)>0){ return att>0?att/2:att-(oc?5:0); } } @@ -2874,7 +2874,7 @@ character.shenhua={ var max=player.maxHp-hs.length; var players=game.filterPlayer(); for(var i=0;i2){ + if(get.attitude(player,players[i])>2){ max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); } } @@ -2899,7 +2899,7 @@ character.shenhua={ player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){ return target.countCards('h')2){ return Math.min(5,target.maxHp)-target.countCards('h'); } @@ -2923,7 +2923,7 @@ character.shenhua={ var max=0; var players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(target,players[i])>0){ max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); } } @@ -2961,7 +2961,7 @@ character.shenhua={ target.damage(); }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, position:'he', ai:{ @@ -2979,7 +2979,7 @@ character.shenhua={ if(player.hp==2&&target.hp>=2) return 0; if(target.hp>player.hp) return 0; } - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } } }, @@ -3027,7 +3027,7 @@ character.shenhua={ target.damage(); }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, position:'he', ai:{ @@ -3038,7 +3038,7 @@ character.shenhua={ if(player.hp<2) return 0; if(target.hp>=player.hp) return 0; } - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } } }, @@ -3074,11 +3074,11 @@ character.shenhua={ return 1; } for(var i=0;i11&&ai.get.value(cards[i])<7){ + if(cards[i].name!='sha'&&cards[i].number>11&&get.value(cards[i])<7){ return 9; } } - return ai.get.order({name:'sha'})-1; + return get.order({name:'sha'})-1; }, result:{ player:function(player){ @@ -3145,7 +3145,7 @@ character.shenhua={ return get.color(card)!=player.storage.shuangxiong; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ basic:{ @@ -3172,7 +3172,7 @@ character.shenhua={ selectCard:2, complexCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ basic:{ @@ -3201,7 +3201,7 @@ character.shenhua={ return event.target.countCards('he')>0; }, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ player.discardPlayerCard('he',trigger.target,true); @@ -3241,10 +3241,10 @@ character.shenhua={ }); next.set('ai',function(target){ if(type=='equip'){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } else{ - return ai.get.attitude(player,target); + return get.attitude(player,target); } }); next.set('type',type); @@ -3280,7 +3280,7 @@ character.shenhua={ "step 0"; player.chooseTarget(get.prompt('releiji')).ai=function(target){ if(target.hasSkill('hongyan')) return 0; - return ai.get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); + return get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); }; "step 1" if(result.bool){ @@ -3311,7 +3311,7 @@ character.shenhua={ target:function(card,player,target,current){ if(get.tag(card,'respondShan')){ var hastarget=game.hasPlayer(function(current){ - return ai.get.attitude(target,current)<0; + return get.attitude(target,current)<0; }); var be=target.countCards('e',{color:'black'}); if(target.countCards('h','shan')&&be){ @@ -3356,7 +3356,7 @@ character.shenhua={ return player.canUse({name:'sha'},target,false); }).set('check',check).set('ai',function(target){ if(!_status.event.check) return 0; - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); "step 1" if(result.bool){ @@ -3389,11 +3389,11 @@ character.shenhua={ }, ai1:function(card){ if(_status.event.check) return 0; - return 6-ai.get.value(card); + return 6-get.value(card); }, ai2:function(target){ if(_status.event.check) return 0; - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }, check:check }); @@ -3419,7 +3419,7 @@ character.shenhua={ return player.canUse({name:'sha'},target,false); }).set('check',check).set('ai',function(target){ if(!_status.event.check) return 0; - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); "step 1" if(result.bool){ @@ -3450,7 +3450,7 @@ character.shenhua={ audio:2, trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, logTarget:'target', filter:function(event,player){ @@ -3494,10 +3494,10 @@ character.shenhua={ return player!=target; }, ai1:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); var trigger=_status.event.getTrigger(); var da=0; if(_status.event.player.hp==1){ @@ -3507,7 +3507,7 @@ character.shenhua={ if(target.maxHp>5&&target.hp>1) return -att/10+da; return -att+da; } - var eff=ai.get.damageEffect(target,trigger.source,target,trigger.nature); + var eff=get.damageEffect(target,trigger.source,target,trigger.nature); if(att==0) return 0.1+da; if(eff>=0&&trigger.num==1){ return att+da; @@ -3586,10 +3586,10 @@ character.shenhua={ }, position:'he', ai1:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); var trigger=_status.event.getTrigger(); var da=0; if(_status.event.player.hp==1){ @@ -3599,7 +3599,7 @@ character.shenhua={ if(target.maxHp>5&&target.hp>1) return -att/10+da; return -att+da; } - var eff=ai.get.damageEffect(target,trigger.source,target,trigger.nature); + var eff=get.damageEffect(target,trigger.source,target,trigger.nature); if(att==0) return 0.1+da; if(eff>=0&&trigger.num==1){ return att+da; @@ -3662,7 +3662,7 @@ character.shenhua={ var num=player.maxHp-player.hp||0; var str1='令'+get.translation(player)+'摸'+get.cnNumber(num)+'张牌'; var str2='令'+get.translation(player)+'防止造成和受到的所有伤害且天香失效直到你下一回合开始'; - var att=ai.get.attitude(source,player); + var att=get.attitude(source,player); var choice='选项一'; if(att<0){ if(num>=2){ @@ -3907,7 +3907,7 @@ character.shenhua={ return false; }, check:function(event,player){ - return ai.get.attitude(player,event.player)>2; + return get.attitude(player,event.player)>2; }, content:function(){ "step 0" @@ -3928,7 +3928,7 @@ character.shenhua={ "step 0"; player.chooseTarget(get.prompt('leiji')).ai=function(target){ if(target.hasSkill('hongyan')) return 0; - return ai.get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); + return get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); }; "step 1" if(result.bool){ @@ -3954,7 +3954,7 @@ character.shenhua={ target:function(card,player,target,current){ if(get.tag(card,'respondShan')){ var hastarget=game.hasPlayer(function(current){ - return ai.get.attitude(target,current)<0; + return get.attitude(target,current)<0; }); if(target.countCards('h','shan')&&target.countCards('e',{suit:'spade'})){ return [0,hastarget?target.countCards('he')/2:0]; @@ -3985,7 +3985,7 @@ character.shenhua={ var player=_status.event.player; var judging=_status.event.judging; var result=trigger.judge(card)-trigger.judge(judging); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result; @@ -4079,7 +4079,7 @@ character.shenhua={ var cards=player.getCards('h'); if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i=9&&ai.get.value(card)<=5)||ai.get.value(card)<=3; + if(get.attitude(player,target)<0&&player.hasCard(function(card){ + return (card.number>=9&&get.value(card)<=5)||get.value(card)<=3; })){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } else{ return 0; @@ -305,11 +305,11 @@ character.sp={ check:function(card){ var player=_status.event.player; if(game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>2&¤t.isTurnedOver(); + return get.attitude(player,current)>2&¤t.isTurnedOver(); })){ - return 10-ai.get.value(card,player); + return 10-get.value(card,player); } - return 6-ai.get.value(card,player); + return 6-get.value(card,player); }, content:function(){ 'step 0' @@ -336,7 +336,7 @@ character.sp={ logTarget:'target', check:function(event,player){ if(event.target.hasSkillTag('noe')) return false; - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ trigger.target.chooseToDiscard('e',true); @@ -363,7 +363,7 @@ character.sp={ }, logTarget:'player', check:function(event,player){ - if(ai.get.attitude(player,event.player)<0){ + if(get.attitude(player,event.player)<0){ if(event.player.hp==1) return false; return true; } @@ -413,7 +413,7 @@ character.sp={ hengjiang:{ trigger:{player:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.source)<0||!event.source.needsToDiscard(2); + return get.attitude(player,event.source)<0||!event.source.needsToDiscard(2); }, filter:function(event){ return event.source&&event.source.isIn()&&event.num>0; @@ -465,20 +465,20 @@ character.sp={ var goon; if(player.needsToDiscard()>1){ goon=player.hasCard(function(card){ - return card.number>10&&ai.get.value(card)<=5; + return card.number>10&&get.value(card)<=5; }); } else{ goon=player.hasCard(function(card){ - return (card.number>=9&&ai.get.value(card)<=5)||ai.get.value(card)<=3; + return (card.number>=9&&get.value(card)<=5)||get.value(card)<=3; }); } player.chooseTarget(get.prompt('shuangren'),function(card,player,target){ return target!=player&&target.countCards('h'); }).set('ai',function(target){ var player=_status.event.player; - if(_status.event.goon&&ai.get.attitude(player,target)<0){ - return ai.get.effect(target,{name:'sha'},player,player); + if(_status.event.goon&&get.attitude(player,target)<0){ + return get.effect(target,{name:'sha'},player,player); } return 0; }).set('goon',goon); @@ -515,7 +515,7 @@ character.sp={ return true; }).set('ai',function(target){ var player=_status.event.player; - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); }).set('identity',target.identity); } else{ @@ -540,7 +540,7 @@ character.sp={ content:function(){ 'step 0' player.chooseTarget(get.prompt('kuanshi')).set('ai',function(target){ - if(ai.get.attitude(_status.event.player,target)>0){ + if(get.attitude(_status.event.player,target)>0){ return 1/Math.sqrt(target.hp+1); } return 0; @@ -598,13 +598,13 @@ character.sp={ var maxval=0; var hs=player.getCards('h'); for(var i=0;i0) return 0.1; @@ -636,14 +636,14 @@ character.sp={ return; } hs.sort(function(a,b){ - return ai.get.value(b,player,'raw')-ai.get.value(a,player,'raw'); + return get.value(b,player,'raw')-get.value(a,player,'raw'); }); event.target.chooseCard([1,hs.length],'展示至少一张手牌',true).set('ai',function(card){ var rand=_status.event.rand; var list=_status.event.list; if(_status.event.att){ if(ui.selected.cards.length>=Math.ceil(list.length/2)) return 0; - var value=ai.get.value(card); + var value=get.value(card); if(_status.event.getParent().player.isHealthy()){ value+=(get.tag(card,'damage')?1.5:0)+(get.tag(card,'draw'?2:0)); } @@ -651,7 +651,7 @@ character.sp={ } if(ui.selected.cards.length>=Math.floor(list.length/2)) return 0; return (list.indexOf(card)%2==rand)?1:0; - }).set('rand',(Math.random()<0.6)?1:0).set('list',hs).set('att',ai.get.attitude(event.target,player)>0); + }).set('rand',(Math.random()<0.6)?1:0).set('list',hs).set('att',get.attitude(event.target,player)>0); 'step 3' event.target.showCards(result.cards); event.cards1=result.cards; @@ -662,7 +662,7 @@ character.sp={ var choice; var num1=event.cards1.length; var num2=event.cards2.length; - if(ai.get.attitude(event.target,player)>0&&num1>=num2){ + if(get.attitude(event.target,player)>0&&num1>=num2){ choice=0; } else if(num1==num2){ @@ -720,7 +720,7 @@ character.sp={ return !trigger.targets.contains(target)&&lib.filter.targetEnabled2(trigger.card,trigger.player,target); }).set('ai',function(target){ var trigger=_status.event.getTrigger(); - return ai.get.effect(target,trigger.card,trigger.player,player); + return get.effect(target,trigger.card,trigger.player,player); }); 'step 1' if(result.bool){ @@ -747,7 +747,7 @@ character.sp={ return target.countCards('h')!=target.hp; }).set('ai',function(target){ var player=_status.event.player; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); var nh=target.countCards('h'); if(att>0){ if(nh==target.hp-1){ @@ -770,7 +770,7 @@ character.sp={ if(event.target.countCards('h')){ player.chooseControl(function(event,player){ var target=event.target; - if(ai.get.attitude(player,target)<0) return 1; + if(get.attitude(player,target)<0) return 1; if(target.countCards('h')==target.hp+1) return 1; return 0; }).set('choiceList',['令'+get.translation(event.target)+'摸一张牌', @@ -804,15 +804,15 @@ character.sp={ return card.name=='shan'?1:0; } if(_status.event.goon){ - return 10-ai.get.value(card); + return 10-get.value(card); } - return -ai.get.value(card,_status.event.player,'raw'); + return -get.value(card,_status.event.player,'raw'); }); - if(ai.get.attitude(player,event.target)>1&& + if(get.attitude(player,event.target)>1&& player.countCards('h','shan')>1&&player.countCards('h')>event.target.countCards('h')){ next.set('shan',true); } - if(ai.get.attitude(player,event.target)>0&&player.needsToDiscard()){ + if(get.attitude(player,event.target)>0&&player.needsToDiscard()){ next.set('goon',true); } } @@ -848,7 +848,7 @@ character.sp={ target.addTempSkill('fuman2',{player:'phaseAfter'}); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai:{ order:2, @@ -887,7 +887,7 @@ character.sp={ effect:{ player:function(card,player,target,current){ if(card.name=='sha'&&card!=player.storage.fuman3&& - player.storage.fuman2.isIn()&&ai.get.attitude(player,player.storage.fuman2)>0){ + player.storage.fuman2.isIn()&&get.attitude(player,player.storage.fuman2)>0){ return 'zeroplayertarget'; } } @@ -939,7 +939,7 @@ character.sp={ return target!=player&&target.countCards('he')&&get.distance(player,target,'attack')<=1; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ 'step 0' @@ -980,7 +980,7 @@ character.sp={ }, check:function(card){ if(card.name=='sha'&&_status.event.player.countCards('h','sha')<=1) return 0; - return 6-ai.get.value(card); + return 6-get.value(card); }, filterCard:true, ai:{ @@ -993,7 +993,7 @@ character.sp={ return 1; } var geteff=function(current){ - return ai.get.effect(current,{name:'sha'},player,player)>0; + return get.effect(current,{name:'sha'},player,player)>0; } if(player.hasSha()&&geteff(target)){ var num=game.countPlayer(function(current){ @@ -1044,7 +1044,7 @@ character.sp={ return !_status.event.source.contains(target)&&get.distance(player,target)<=1&&player.canUse('sha',target); }).set('source',trigger.targets).set('ai',function(target){ var player=_status.event.player; - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); }); 'step 1' if(result.bool){ @@ -1064,13 +1064,13 @@ character.sp={ if(card.name=='sha'){ if(player._duanbingtmp) return; player._duanbingtmp=true; - if(ai.get.effect(target,{name:'sha'},player,player)<=0){ + if(get.effect(target,{name:'sha'},player,player)<=0){ delete player._duanbingtmp; return; } if(game.hasPlayer(function(current){ return current!=target&&get.distance(player,current)<=1&& - player.canUse('sha',current)&&ai.get.effect(current,{name:'sha'},player,player)>0; + player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)>0; })){ delete player._duanbingtmp; return [1,1]; @@ -1202,7 +1202,7 @@ character.sp={ if(!player.countCards('h','shan')) return false; }, order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, useful:-1, value:-1 @@ -1350,7 +1350,7 @@ character.sp={ content:function(){ 'step 0' player.chooseToDiscard('he','庸肆:弃置一张牌,或取消并失去一点体力').ai=function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }; 'step 1' if(!result.bool){ @@ -1367,7 +1367,7 @@ character.sp={ return target!=player; }, check:function(card){ - var num=ai.get.value(card); + var num=get.value(card); if(get.color(card)=='black'){ if(num>=6) return 0; return 20-num; @@ -1386,9 +1386,9 @@ character.sp={ target.gain(cards,player); if(get.color(cards[0])=='black'){ target.chooseToDiscard(2,'he','弃置两张牌,或令'+get.translation(player)+'摸两张牌').set('ai',function(card){ - if(_status.event.goon) return 7-ai.get.value(card); + if(_status.event.goon) return 7-get.value(card); return 0; - }).set('goon',ai.get.attitude(target,player)<0); + }).set('goon',get.attitude(target,player)<0); } else{ event.finish(); @@ -1535,7 +1535,7 @@ character.sp={ player.chooseTarget('是否视为使用一张杀?',function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).set('ai',function(target){ - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); } else{ @@ -1577,15 +1577,15 @@ character.sp={ if(player.hp<3) return 0; var type=get.type(card,'trick'); if(type=='trick'){ - return 6-ai.get.value(card); + return 6-get.value(card); } else if(type=='equip'){ if(player.hasSha()&&game.hasPlayer(function(current){ return (player.canUse('sha',current)&& - ai.get.attitude(player,current)<0&& - ai.get.effect(current,{name:'sha'},player,player)>0) + get.attitude(player,current)<0&& + get.effect(current,{name:'sha'},player,player)>0) })){ - return 6-ai.get.value(card); + return 6-get.value(card); } } return 0; @@ -1617,7 +1617,7 @@ character.sp={ }, prompt:'将一张基本牌当桃使用', check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, ai:{ skillTagFilter:function(player){ @@ -1634,7 +1634,7 @@ character.sp={ if(!player.countCards('h',{type:'basic'})) return false; }, prompt:'将一张基本牌当杀使用', - check:function(card){return 4-ai.get.value(card)}, + check:function(card){return 4-get.value(card)}, ai:{ skillTagFilter:function(player){ if(!player.countCards('h',{type:'basic'})) return false; @@ -1652,7 +1652,7 @@ character.sp={ prompt:'将一张基本牌当酒使用', check:function(card){ if(_status.event.type=='dying') return 1; - return 4-ai.get.value(card); + return 4-get.value(card); }, ai:{ skillTagFilter:function(player){ @@ -1668,7 +1668,7 @@ character.sp={ return event.target.countCards('he')>0; }, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ trigger.target.chooseToDiscard('he',true,2); @@ -1704,7 +1704,7 @@ character.sp={ filterCard:true, position:'he', check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, discard:false, prepare:'give', @@ -1724,7 +1724,7 @@ character.sp={ result:{ player:function(player,target){ if(player.hasUnknown()) return 0; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att<=0){ if(target.hp==1) return (10-att)/2; return 10-att; @@ -1755,8 +1755,8 @@ character.sp={ target:function(card,player,target,current){ if(get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-2]; - if(ai.get.attitude(player,target)>0) return [0,0]; - var eff=ai.get.damageEffect(target.storage.shichou_target,player,target); + if(get.attitude(player,target)>0) return [0,0]; + var eff=get.damageEffect(target.storage.shichou_target,player,target); if(eff>0){ return [0,1]; } @@ -1806,8 +1806,8 @@ character.sp={ return target!=player&&get.distance(player,target,'attack')<=1; }).set('ai',function(target){ var player=_status.event.player; - if(ai.get.attitude(player,target)>0) return 0; - return ai.get.damageEffect(target,player,player); + if(get.attitude(player,target)>0) return 0; + return get.damageEffect(target,player,player); }); 'step 1' if(result.bool){ @@ -1853,7 +1853,7 @@ character.sp={ var source=_status.event.source; return target==source||target==source.storage.zhaolie; },true,'选择一个目标获得'+get.translation(event.basic)).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }).set('source',player); } else{ @@ -1861,9 +1861,9 @@ character.sp={ '张牌并令'+get.translation(player)+'拿牌,或受到'+get.cnNumber(num)+'点伤害并拿牌').set('ai',function(card){ var player=_status.event.player; switch(_status.event.num){ - case 1:return player.hp>1?0:7-ai.get.value(card); - case 2:return 8-ai.get.value(card); - case 3:return 10-ai.get.value(card); + case 1:return player.hp>1?0:7-get.value(card); + case 2:return 8-get.value(card); + case 3:return 10-get.value(card); default:return 0; } }).set('num',num); @@ -1913,7 +1913,7 @@ character.sp={ player.chooseTarget(get.prompt('yingjian'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).set('ai',function(target){ - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); "step 1" if(result.bool){ @@ -1947,11 +1947,11 @@ character.sp={ 'step 0' target.draw(); 'step 1' - var goon=ai.get.damageEffect(target,player,target)>=0; - if(!goon&&target.hp>=4&&ai.get.attitude(player,target)<0){ + var goon=get.damageEffect(target,player,target)>=0; + if(!goon&&target.hp>=4&&get.attitude(player,target)<0){ var es=target.getCards('e'); for(var i=0;i=8){ + if(get.equipValue(es[i],target)>=8){ goon=true;break; } } @@ -1976,12 +1976,12 @@ character.sp={ order:7, result:{ target:function(player,target){ - if(ai.get.damageEffect(target,player,target)>=0) return 2; - var att=ai.get.attitude(player,target); + if(get.damageEffect(target,player,target)>=0) return 2; + var att=get.attitude(player,target); if(att==0) return 0; var es=target.getCards('e'); for(var i=0;i0){ return 1; @@ -2009,7 +2009,7 @@ character.sp={ player.chooseTarget(get.prompt('hongde'),function(card,player,target){ return target!=player; }).set('ai',function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); }); 'step 1' if(result.bool){ @@ -2047,13 +2047,13 @@ character.sp={ for(var i=0;i0); + get.recoverEffect(current,player,player)>0); })){ return 10; } @@ -2076,7 +2076,7 @@ character.sp={ }, result:{ player:function(player,target){ - var eff=ai.get.recoverEffect(target,player,player); + var eff=get.recoverEffect(target,player,player); if(eff<0) return 0; if(eff>0){ if(target.hp==1) return 3; @@ -2115,7 +2115,7 @@ character.sp={ 'step 0' player.chooseCard(get.prompt('tuifeng'),'he',[1,trigger.num]).set('ai',function(card){ if(card.name=='du') return 20; - return 7-ai.get.useful(card); + return 7-get.useful(card); }); 'step 1' if(result.bool){ @@ -2217,7 +2217,7 @@ character.sp={ mark:true, discard:false, delay:0, - check:function(card){return 6-ai.get.value(card);}, + check:function(card){return 6-get.value(card);}, selectTarget:2, multitarget:true, content:function(){ @@ -2273,7 +2273,7 @@ character.sp={ }).set('ai',function(target){ if(!_status.event.goon) return 0; var player=_status.event.player; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att<=1) return 0; var mode=get.mode(); if(mode=='identity'||(mode=='versus'&&_status.mode=='four')){ @@ -2346,9 +2346,9 @@ character.sp={ 'step 0' if(event.num1>event.num2){ target.chooseToDiscard('he','弃置一张牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ - if(_status.event.goon) return 6-ai.get.value(card); + if(_status.event.goon) return 6-get.value(card); return 0; - }).set('goon',ai.get.attitude(target,player)<0); + }).set('goon',get.attitude(target,player)<0); } else{ target.chat(lib.skill.gushe.chat[player.storage.gushe]); @@ -2373,12 +2373,12 @@ character.sp={ result:{ target:function(player,target){ var num=game.countPlayer(function(current){ - return ai.get.attitude(player,current)<0&¤t!=player&¤t.countCards('h'); + return get.attitude(player,current)<0&¤t!=player&¤t.countCards('h'); }); if(num>3) num=3; var hs=player.getCards('h'); for(var i=0;i=_status.event.num){ return -1; } - if(ai.get.damageEffect(trigger.source,player,player)>0&&_status.event.num<=2){ - return 8-ai.get.value(card); + if(get.damageEffect(trigger.source,player,player)>0&&_status.event.num<=2){ + return 8-get.value(card); } return -1; }); @@ -2692,7 +2692,7 @@ character.sp={ trigger:{global:'useCard'}, forced:true, check:function(event,player){ - return ai.get.effect(player,event.card,event.player,player)>0; + return get.effect(player,event.card,event.player,player)>0; }, filter:function(event,player){ if(get.color(event.card)!='red') return false; @@ -2875,7 +2875,7 @@ character.sp={ }).set('ai',function(target){ var player=_status.event.player; if(target==player) return 2; - if(ai.get.attitude(player,target)<=0){ + if(get.attitude(player,target)<=0){ return 1 } return 0.5; @@ -3013,7 +3013,7 @@ character.sp={ if(hs.length<3) return 0; var bool=false; for(var i=0;i=9&&ai.get.value(hs[i])<7){ + if(hs[i].number>=9&&get.value(hs[i])<7){ bool=true; break; } @@ -3059,7 +3059,7 @@ character.sp={ return get.type(card)=='equip'; }).set('ai',function(card){ if(card.name=='bagua') return 10; - return 7-ai.get.value(card); + return 7-get.value(card); }); 'step 1' if(result.bool){ @@ -3097,7 +3097,7 @@ character.sp={ effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ - if(ai.get.equipValue(card)<=7.5) return 0; + if(get.equipValue(card)<=7.5) return 0; } if(target.getEquip(2)) return; return lib.skill.bagua_skill.ai.effect.target.apply(this,arguments); @@ -3156,7 +3156,7 @@ character.sp={ player.chooseControl('弃牌','出杀',function(){ var player=_status.event.player; var trigger=_status.event.getTrigger(); - if(ai.get.attitude(player,trigger.player)<0){ + if(get.attitude(player,trigger.player)<0){ var he=trigger.player.countCards('he'); if(he<2) return '出杀'; if(player.maxHp-player.hp>=2&&he<=3){ @@ -3183,7 +3183,7 @@ character.sp={ player.chooseTarget('选择一个出杀目标',function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); },true).set('ai',function(target){ - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); event.sha=true; } @@ -3212,7 +3212,7 @@ character.sp={ content:function(){ "step 0" var save=false; - if(ai.get.attitude(player,trigger.target)>2){ + if(get.attitude(player,trigger.target)>2){ if(trigger.card.name=='sha'){ if(player.countCards('h','shan')||player.getEquip(2)|| trigger.target.hp==1||player.hp>trigger.target.hp+1){ @@ -3225,8 +3225,8 @@ character.sp={ save=true; } else if(trigger.card.name=='shunshou'&& - ai.get.attitude(player,trigger.player)<0&& - ai.get.attitude(trigger.player,trigger.target)<0){ + get.attitude(player,trigger.player)<0&& + get.attitude(trigger.player,trigger.target)<0){ save=true; } } @@ -3234,7 +3234,7 @@ character.sp={ next.logSkill=['zhenwei',trigger.target]; next.set('ai',function(card){ if(_status.event.aisave){ - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; }); @@ -3332,7 +3332,7 @@ character.sp={ player.chooseTarget('将'+get.translation(result.target)+'交给一名角色',function(card,player,target){ return target.hp<=player.hp; }).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(_status.event.du) return -att; return att; }).set('du',event.card.name=='du'); @@ -3360,7 +3360,7 @@ character.sp={ if(hs.length<3) return 0; var bool=false; for(var i=0;i=9&&ai.get.value(hs[i])<7){ + if(hs[i].number>=9&&get.value(hs[i])<7){ bool=true; break; } @@ -3491,7 +3491,7 @@ character.sp={ player.chooseTarget(true,function(card,player,target){ return player!=target; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target)/Math.sqrt(1+target.hp); + return -get.attitude(_status.event.player,target)/Math.sqrt(1+target.hp); }); } else{ @@ -3529,7 +3529,7 @@ character.sp={ player.chooseTarget('将闪交给一名角色',true,function(card,player,target){ return target!=_status.event.getParent().target; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target)/(target.countCards('h','shan')+1); + return get.attitude(_status.event.player,target)/(target.countCards('h','shan')+1); }); } else{ @@ -3604,7 +3604,7 @@ character.sp={ player.storage.yinling=[]; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ 'step 0' @@ -3631,12 +3631,12 @@ character.sp={ var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&noe) return 0; if(noh&&noe2) return 0.01; - if(ai.get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; + if(get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5; var js=target.getCards('j'); if(js.length){ var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; if(jj.name=='guohe') return 3; - if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + if(js.length==1&&get.effect(target,jj,target,player)>=0){ return -1.5; } return 2; @@ -3651,7 +3651,7 @@ character.sp={ filterCard:{suit:'diamond'}, filterTarget:true, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, position:'he', filter:function(event,player){ @@ -3712,7 +3712,7 @@ character.sp={ return event.card&&event.card.name=='sha'; }, check:function(event,player){ - if(ai.get.damageEffect(event.player,player,player)<=0) return true; + if(get.damageEffect(event.player,player,player)<=0) return true; return false; }, content:function(){ @@ -3738,11 +3738,11 @@ character.sp={ next.set('ai',function(card){ var player=_status.event.player; var trigger=_status.event.getTrigger(); - if(ai.get.attitude(player,trigger.player)>0){ - return 9-ai.get.value(card); + if(get.attitude(player,trigger.player)>0){ + return 9-get.value(card); } if(player.countCards('h',{name:'shan'})) return -1; - return 7-ai.get.value(card); + return 7-get.value(card); }); next.logSkill='anxian'; "step 1" @@ -3830,11 +3830,11 @@ character.sp={ if(player.storage.xingwu.length==2){ if(!game.hasPlayer(function(current){ return (current!=player&¤t.sex=='male'&& - ai.get.damageEffect(current,player,player)>0&& - ai.get.attitude(player,current)<0) + get.damageEffect(current,player,player)>0&& + get.attitude(player,current)<0) })) return 0; } - return 7-ai.get.value(card); + return 7-get.value(card); }); 'step 1' if(result.bool){ @@ -3861,8 +3861,8 @@ character.sp={ return target!=player&&target.sex=='male'; },'对一名男性角色造成两点伤害并弃置其装备区内的牌').set('ai',function(target){ var player=_status.event.player; - if(ai.get.attitude(player,target)>0) return -1; - return ai.get.damageEffect(target,player,player)+target.countCards('e')/2; + if(get.attitude(player,target)>0) return -1; + return get.damageEffect(target,player,player)+target.countCards('e')/2; }); } else{ @@ -3906,7 +3906,7 @@ character.sp={ player.chooseCard([1,player.countCards('he')-player.countCards('he',{type:'basic'})],'he',get.prompt('yinbing'),function(card){ return get.type(card)!='basic'; }).set('ai',function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }); "step 1" if(result.bool){ @@ -3983,7 +3983,7 @@ character.sp={ return player.hp>=target.hp; }).set('ai',function(target){ var player=_status.event.player; - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att<2) return att-10; var num=att/10; if(target==player){ @@ -4040,7 +4040,7 @@ character.sp={ }, logTarget:'player', check:function(event,player){ - if(ai.get.attitude(player,event.player)>=0) return false; + if(get.attitude(player,event.player)>=0) return false; var e2=player.getEquip(2); if(e2){ if(e2.name=='tengjia') return true; @@ -4137,7 +4137,7 @@ character.sp={ return card.name=='sha'||(get.type(card,'trick')=='trick'&&get.color(card)=='black'); }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, filterTarget:function(card,player,target){ if(target==player) return false; @@ -4211,7 +4211,7 @@ character.sp={ player.chooseTarget('焚天:选择一名攻击范围内的角色,将其一张牌置于你的武将牌上',true,function(card,player,target){ return player!=target&&get.distance(player,target,'attack')<=1&&target.countCards('he')>0; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target) + return -get.attitude(_status.event.player,target) }); 'step 1' if(result.bool){ @@ -4393,7 +4393,7 @@ character.sp={ }, content:function(){ 'step 0' - var goon=(ai.get.attitude(player,trigger.player)>0); + var goon=(get.attitude(player,trigger.player)>0); player.chooseCardButton(get.prompt('shuliang',trigger.player),player.storage.tunchu).set('ai',function(){ if(_status.event.goon) return 1; return 0; @@ -4425,11 +4425,11 @@ character.sp={ }, content:function(){ 'step 0' - var goon=(ai.get.attitude(player,trigger.player)<0); + var goon=(get.attitude(player,trigger.player)<0); var next=player.chooseToDiscard(get.prompt('jieyuan',trigger.player),{color:'black'}); next.set('ai',function(card){ if(_status.event.goon){ - return 8-ai.get.value(card); + return 8-get.value(card); } return 0; }); @@ -4455,12 +4455,12 @@ character.sp={ next.set('ai',function(card){ var player=_status.event.player; if(player.hp==1||_status.event.getTrigger().num>1){ - return 9-ai.get.value(card); + return 9-get.value(card); } if(player.hp==2){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 7-ai.get.value(card); + return 7-get.value(card); }); next.logSkill='jieyuan_less'; "step 1" @@ -4495,7 +4495,7 @@ character.sp={ }, check:function(event,player){ if(player.identity==event.player.identity) return Math.random()<0.5; - var stat=ai.get.situation(); + var stat=get.situation(); switch(player.identity){ case 'fan': if(stat<0) return false; @@ -4545,7 +4545,7 @@ character.sp={ return player.canUse({name:'sha'},target); }).ai=function(target){ if(!check) return 0; - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); } "step 1" if(result.bool){ @@ -4580,11 +4580,11 @@ character.sp={ }, ai1:function(card){ if(!_status.event.check) return 0; - return 6-ai.get.value(card); + return 6-get.value(card); }, ai2:function(target){ if(!_status.event.check) return 0; - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }, check:check }); @@ -4733,16 +4733,16 @@ character.sp={ }).set('ai',function(target){ var player=_status.event.player; var trigger=_status.event.getTrigger(); - if(ai.get.attitude(player,trigger.player)>0){ - var att1=ai.get.attitude(target,player); - var att2=ai.get.attitude(target,trigger.player); - var att3=ai.get.attitude(player,target); + if(get.attitude(player,trigger.player)>0){ + var att1=get.attitude(target,player); + var att2=get.attitude(target,trigger.player); + var att3=get.attitude(player,target); if(att3<0) return 0; return att1/2+att2+att3; } else{ return 0; - // return ai.get.attitude(player,target); + // return get.attitude(player,target); } }); 'step 1' @@ -4758,7 +4758,7 @@ character.sp={ 'step 2' var target=event.target; var tosave=trigger.player; - var att=ai.get.attitude(target,tosave); + var att=get.attitude(target,tosave); var hastao=target.countCards('h','tao'); target.chooseToDiscard(4,true,'he').set('ai',function(card){ var hastao=_status.event.hastao; @@ -4767,7 +4767,7 @@ character.sp={ var suit=get.suit(card); for(var i=0;i0&&ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.source)>0&&get.attitude(player,event.player)<0; }, prompt:function(event){ return get.translation(event.source)+'即将对'+get.translation(event.player)+'造成伤害,'+get.prompt('fuji'); @@ -5232,7 +5232,7 @@ character.sp={ viewAs:{name:'sha',nature:'thunder'}, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; } } }, @@ -5384,7 +5384,7 @@ character.sp={ return player.canUse({name:'sha'},target); }).set('ai',function(target){ var player=_status.event.player; - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); }); "step 1" if(result.bool){ @@ -5409,7 +5409,7 @@ character.sp={ 'step 0' player.chooseControl('basic','trick','equip','cancel2',function(){ var source=_status.event.source; - if(ai.get.attitude(_status.event.player,source)>0) return 'cancel2'; + if(get.attitude(_status.event.player,source)>0) return 'cancel2'; if(_status.currentPhase!=source) return 'trick'; if(lib.filter.cardUsable({name:'sha'},source)&&source.countCards('h')>=2) return 'basic'; return 'trick'; @@ -5460,7 +5460,7 @@ character.sp={ return event.player!=player&&get.type(event.card)=='trick'&&event.targets&&event.targets.length>1; }, check:function(event,player){ - return get.tag(event.card,'multineg')||ai.get.effect(player,event.card,event.player,player)<=0; + return get.tag(event.card,'multineg')||get.effect(player,event.card,event.player,player)<=0; }, trigger:{target:'useCardToBefore'}, content:function(){ @@ -5496,7 +5496,7 @@ character.sp={ result:{ target:function(player,target){ if(player.hp>2&&player.hp>target.hp&&target.countCards('he')<4){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } return 0; } @@ -5534,7 +5534,7 @@ character.sp={ if(cards.length){ var maxval=0; for(var i=0;imaxval){ maxval=tempval; } @@ -5542,7 +5542,7 @@ character.sp={ maxval+=cards.length-1; var next=player.chooseToDiscard('he',{suit:suits}); next.set('ai',function(card){ - return _status.event.maxval-ai.get.value(card); + return _status.event.maxval-get.value(card); }); next.set('maxval',maxval); next.set('dialog',[get.prompt(event.name),'hidden',cards]) @@ -5710,7 +5710,7 @@ character.sp={ "step 0" var next=player.chooseToDiscard('协穆:是否弃置一张杀并摸两张牌?',{name:'sha'}); next.set('ai',function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }); next.logSkill='xiemu'; "step 1" @@ -5736,9 +5736,9 @@ character.sp={ direct:true, content:function(){ "step 0" - var att=ai.get.attitude(player,trigger.target); + var att=get.attitude(player,trigger.target); player.choosePlayerCard(get.prompt('spmengjin',trigger.target),'he',trigger.target).ai=function(button){ - var val=ai.get.buttonValue(button); + var val=get.buttonValue(button); if(att>0) return -val; return val; }; @@ -5770,12 +5770,12 @@ character.sp={ return lib.filter.targetEnabled(trigger.card,player,target)&&target!=trigger.targets[0]; }, ai1:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai2:function(target){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - return ai.get.effect(target,trigger.card,player,player); + return get.effect(target,trigger.card,player,player); }, prompt:get.prompt('fenxun') }); @@ -5806,7 +5806,7 @@ character.sp={ target.syncStorage('zhoufu2'); }, check:function(card){ - return 3-ai.get.value(card) + return 3-get.value(card) }, ai:{ expose:0.1, @@ -5937,7 +5937,7 @@ character.sp={ position:'e', viewAs:{name:'wuxie'}, prompt:'将一张装备区内的牌当无懈可击使用', - check:function(card){return 8-ai.get.equipValue(card)}, + check:function(card){return 8-get.equipValue(card)}, threaten:1.2 }, tongji:{ @@ -5967,9 +5967,9 @@ character.sp={ audio:2, trigger:{global:'phaseBegin'}, check:function(event,player){ - var att=ai.get.attitude(player,event.player); + var att=get.attitude(player,event.player); return !game.hasPlayer(function(current){ - return ai.get.attitude(player,current)=0; + return get.attitude(player,event.target)>=0; }, content:function(){ "step 0" @@ -6041,7 +6041,7 @@ character.sp={ trigger.target.chooseBool('是否装备'+get.translation(event.card)+'?').set('ai',function(){ var current=_status.event.player.getCards('e',{subtype:get.subtype(_status.event.card)}); if(current&¤t.length){ - return ai.get.equipValue(event.card)>ai.get.equipValue(current[0]); + return get.equipValue(event.card)>get.equipValue(current[0]); } return true; }).set('card',event.card); @@ -6079,7 +6079,7 @@ character.sp={ }).set('target',trigger.player).set('ai',function(target){ var player=_status.event.player; if(player==target) return 1; - return ai.get.attitude(player,target)-1.5; + return get.attitude(player,target)-1.5; }); } 'step 1' @@ -6151,7 +6151,7 @@ character.sp={ "step 0" var next=player.chooseToDiscard(get.prompt('mingshi'),{color:'black'}); next.set('ai',function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }); next.set('logSkill','mingshi'); "step 1" @@ -6196,7 +6196,7 @@ character.sp={ } if(!goon){ goon=game.hasPlayer(function(current){ - return player!=current&&ai.get.attitude(player,current)>1; + return player!=current&&get.attitude(player,current)>1; }); } player.chooseCardButton(get.prompt('lirang'),event.cards,[1,event.cards.length]).set('ai',function(button){ @@ -6214,7 +6214,7 @@ character.sp={ player.chooseTarget('将'+get.translation(result.links)+'交给一名角色',true,function(card,player,target){ return target!=player; }).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(_status.event.enemy){ return -att; } @@ -6222,7 +6222,7 @@ character.sp={ if(att>2) return att/Math.sqrt(1+target.countCards('h')); return att/Math.sqrt(1+target.countCards('h'))/5; } - }).set('enemy',ai.get.value(event.togive[0])<0); + }).set('enemy',get.value(event.togive[0])<0); } else{ for(var i=0;i2){ @@ -6407,7 +6407,7 @@ character.sp={ var next=player.chooseToDiscard(get.prompt('zhendu',trigger.player)); next.set('ai',function(card){ if(_status.event.nono) return -1; - return 7-ai.get.useful(card); + return 7-get.useful(card); }); next.set('logSkill',['zhendu',trigger.player]); next.set('nono',nono); @@ -6521,7 +6521,7 @@ character.sp={ trigger:{global:'loseEnd'}, audio:2, check:function(event,player){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, filter:function(event,player){ if(event.player.countCards('h')) return false; @@ -6549,10 +6549,10 @@ character.sp={ }, check:function(event,player){ var num=game.countPlayer(function(current){ - if(current.countCards('he')&¤t!=player&&ai.get.attitude(player,current)<=0){ + if(current.countCards('he')&¤t!=player&&get.attitude(player,current)<=0){ return true; } - if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ + if(current.countCards('j')&¤t!=player&&get.attitude(player,current)>0){ return true; } }); @@ -6661,9 +6661,9 @@ character.sp={ if(player.hp>1){ if(game.phaseNumber2) return 0; - if(ai.get.attitude(player,target)<5) return 0; + if(get.attitude(player,target)<5) return 0; } - if(ai.get.attitude(player,target)<5) return 0; + if(get.attitude(player,target)<5) return 0; if(target.hp==1&&target.maxHp>2) return 0.2; if(target==game.me) return 1.2; return 1; @@ -6679,7 +6679,7 @@ character.sp={ check:function(event,player){ var num=game.countPlayer(function(current){ if(current.isLinked()&¤t.countCards('he')){ - return ai.get.attitude(player,current); + return get.attitude(player,current); } }); return num<0; @@ -6750,26 +6750,26 @@ character.sp={ direct:true, content:function(){ "step 0" - var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3); - if(ai.get.damageEffect(trigger.player,player,player)<=0){ + var nono=(Math.abs(get.attitude(player,trigger.player))<3); + if(get.damageEffect(trigger.player,player,player)<=0){ nono=true; } var next=player.chooseToDiscard(get.prompt('xiaoguo',trigger.player),{type:'basic'}); next.set('ai',function(card){ if(_status.event.nono) return 0; - return 8-ai.get.useful(card); + return 8-get.useful(card); }); next.set('logSkill',['xiaoguo',trigger.player]); next.set('nono',nono); "step 1" if(result.bool){ - var nono=(ai.get.damageEffect(trigger.player,player,trigger.player)>=0); + var nono=(get.damageEffect(trigger.player,player,trigger.player)>=0); trigger.player.chooseToDiscard('he',{type:'equip'}).set('ai',function(card){ if(_status.event.nono){ return 0; } - if(_status.event.player.hp==1) return 10-ai.get.value(card); - return 9-ai.get.value(card); + if(_status.event.player.hp==1) return 10-get.value(card); + return 9-get.value(card); }).set('nono',nono); } else{ @@ -6809,7 +6809,7 @@ character.sp={ str='随势:是否令'+get.translation(player)+'摸一张牌?' } trigger.parent.source.chooseBool(str).set('ai',function(){ - return ai.get.attitude(_status.event.player,_status.event.target)>0; + return get.attitude(_status.event.player,_status.event.target)>0; }).set('target',player); 'step 1' if(result.bool){ @@ -6840,7 +6840,7 @@ character.sp={ str='随势:是否令'+get.translation(player)+'流失一点体力?' } trigger.source.chooseBool(str).set('ai',function(){ - return ai.get.attitude(_status.event.player,_status.event.target)<0; + return get.attitude(_status.event.player,_status.event.target)<0; }).set('target',player); 'step 1' if(result.bool){ @@ -6866,7 +6866,7 @@ character.sp={ player.chooseTarget(get.prompt('sijian'),function(card,player,target){ return player!=target&&target.countCards('he')>0; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -6906,12 +6906,12 @@ character.sp={ check:function(card){ var player=_status.event.player; if(ui.selected.cards.length>=game.countPlayer(function(current){ - return ai.get.attitude(player,current)>0&¤t.isDamaged(); + return get.attitude(player,current)>0&¤t.isDamaged(); })){ return -1; } if(get.color(card)=='black') return -1; - return 9-ai.get.value(card); + return 9-get.value(card); }, content:function(){ "step 0" @@ -6947,7 +6947,7 @@ character.sp={ }); if(target){ var num=target.countCards('h'); - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(num==0) return true; if(num==1) return att>-1; if(num==2) return att>0; @@ -7069,7 +7069,7 @@ character.sp={ player.chooseTarget(get.prompt('shushen'),function(card,player,target){ return target!=player; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -7091,7 +7091,7 @@ character.sp={ if(cards.length3) return false; for(var i=0;i7||get.tag(cards[i],'recover')>=1) return false; + if(get.value(cards[i])>7||get.tag(cards[i],'recover')>=1) return false; } return true; }, @@ -7150,7 +7150,7 @@ character.sp={ return get.color(card)=='red'; }, check:function(card){ - return 8-ai.get.useful(card); + return 8-get.useful(card); }, content:function(){ "step 0" @@ -7162,7 +7162,7 @@ character.sp={ order:7, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } }, threaten:function(player,target){ @@ -7198,7 +7198,7 @@ character.sp={ position:'he', filterCard:{color:'red'}, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, multitarget:true, multiline:true, @@ -7224,7 +7224,7 @@ character.sp={ order:7, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player,target,'fire'); + var eff=get.damageEffect(target,player,target,'fire'); if(target.isLinked()){ return eff/10; } @@ -7402,7 +7402,7 @@ character.sp={ result:{ player:function(player){ if(player.tempSkills.aocai4) return 0; - if(_status.event.dying) return ai.get.attitude(player,_status.event.dying); + if(_status.event.dying) return get.attitude(player,_status.event.dying); return 1; } } @@ -7420,7 +7420,7 @@ character.sp={ } else{ check=(game.countPlayer(function(current){ - return player!=current&&ai.get.attitude(player,current)>1; + return player!=current&&get.attitude(player,current)>1; })>=2); } if(get.is.versus()){ @@ -7432,7 +7432,7 @@ character.sp={ return player!=target; },function(target){ if(!_status.event.check) return 0; - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }).set('check',check); } "step 1" @@ -7460,12 +7460,12 @@ character.sp={ }, logTarget:'player', check:function(event,player){ - if(ai.get.attitude(player,event.player)<=0) return false; + if(get.attitude(player,event.player)<=0) return false; var cards=player.getCards('he'); var judge=event.judge(event.player.judging[0]); for(var i=0;ijudge) return true; } return false; @@ -7475,7 +7475,7 @@ character.sp={ var target=trigger.player; player.line(target,'green'); var judge=trigger.judge(target.judging[0]); - var attitude=ai.get.attitude(target,player); + var attitude=get.attitude(target,player); target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).set('ai',function(button){ var card=button.link; var judge=_status.event.judge; @@ -7488,10 +7488,10 @@ character.sp={ if(result==0){ if(_status.currentPhase==player) return 0; if(attitude>=0){ - return get.color(card)=='red'?7:0-ai.get.value(card); + return get.color(card)=='red'?7:0-get.value(card); } else{ - return get.color(card)=='black'?10:0+ai.get.value(card); + return get.color(card)=='black'?10:0+get.value(card); } } if(attitude>=0){ @@ -7575,9 +7575,9 @@ character.sp={ }, check:function(card){ switch(ui.selected.cards.length){ - case 0:return 7-ai.get.value(card); - case 1:return 6-ai.get.value(card); - case 2:return 3-ai.get.value(card); + case 0:return 7-get.value(card); + case 1:return 6-get.value(card); + case 2:return 3-get.value(card); default:return 0; } }, @@ -7595,7 +7595,7 @@ character.sp={ order:2, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } }, threaten:1.5, @@ -7681,11 +7681,11 @@ character.sp={ return player!=target&&!target.storage.bifa; }, ai1:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai2:function(target){ var num=target.hasSkillTag('maixie')?2:0; - return -ai.get.attitude(_status.event.player,target)-num; + return -get.attitude(_status.event.player,target)-num; }, prompt:get.prompt('bifa') }); @@ -7715,7 +7715,7 @@ character.sp={ '的笔伐牌为'+get.translation(player.storage.bifa[0]),function(card){ return get.type(card,'trick')==_status.event.type; }).set('ai',function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }).set('type',get.type(player.storage.bifa[0],'trick')); } else{ @@ -7826,7 +7826,7 @@ character.sp={ effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')||get.tag(card,'respondSha')){ - if(ai.get.attitude(target,player)<=0){ + if(get.attitude(target,player)<=0){ if(current>0) return; if(target.countCards('h')==0) return 1.6; if(target.countCards('h')==1) return 1.2; @@ -7885,7 +7885,7 @@ character.sp={ player.addSkill('lihun2'); player.storage.lihun=target; }, - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, ai:{ order:10, result:{ @@ -7943,10 +7943,10 @@ character.sp={ return !target.getEquip(card); }, ai1:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, ai2:function(target){ - return ai.get.attitude(_status.event.player,target)-3; + return get.attitude(_status.event.player,target)-3; }, prompt:get.prompt('yuanhu') }); @@ -7972,7 +7972,7 @@ character.sp={ player.chooseTarget(true,function(card,player,target){ return get.distance(_status.event.thisTarget,target)<=1&&target.countCards('hej'); }).set('ai',function(target){ - var attitude=ai.get.attitude(_status.event.player,target); + var attitude=get.attitude(_status.event.player,target); if(attitude>0&&target.countCards('j')){ return attitude*1.5; } @@ -8065,7 +8065,7 @@ character.sp={ } var players=game.filterPlayer(); for(var i=0;i0){ return eff-10; } @@ -8196,7 +8196,7 @@ character.sp={ position:'he', viewAs:{name:'sha'}, prompt:'将一张♦牌当杀使用或打出', - check:function(card){return 5-ai.get.value(card)}, + check:function(card){return 5-get.value(card)}, ai:{ respondSha:true, } @@ -8207,7 +8207,7 @@ character.sp={ viewAs:{name:'shan'}, position:'he', prompt:'将一张♦牌当闪打出', - check:function(card){return 5-ai.get.value(card)}, + check:function(card){return 5-get.value(card)}, ai:{ respondShan:true, effect:{ @@ -8251,7 +8251,7 @@ character.sp={ var check=(player.hp==1||(player.hp==2&&player.countCards('h')<=1)); player.chooseTarget(get.prompt('suiren')).set('ai',function(target){ if(!_status.event.check) return 0; - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }).set('check',check); "step 1" if(result.bool){ @@ -8274,10 +8274,10 @@ character.sp={ }, content:function(){ "step 0" - var neg=ai.get.attitude(player,trigger.player)<=0; + var neg=get.attitude(player,trigger.player)<=0; player.choosePlayerCard('e',trigger.player).set('ai',function(button){ if(_status.event.neg){ - return ai.get.buttonValue(button); + return get.buttonValue(button); } return 0; }).set('neg',neg); diff --git a/character/standard.js b/character/standard.js index 5d71d132a..4d443c889 100644 --- a/character/standard.js +++ b/character/standard.js @@ -87,7 +87,7 @@ character.standard={ }); }, check:function(event,player){ - if(ai.get.damageEffect(player,event.player,player)>=0) return false; + if(get.damageEffect(player,event.player,player)>=0) return false; return true; }, content:function(){ @@ -98,13 +98,13 @@ character.standard={ } else if(event.current.group=='wei'){ if((event.current==game.me&&!_status.auto)||( - ai.get.attitude(event.current,player)>2)|| + get.attitude(event.current,player)>2)|| event.current.isOnline()){ player.storage.hujiaing=true; var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张闪?',{name:'shan'}); next.set('ai',function(){ var event=_status.event; - return (ai.get.attitude(event.player,event.source)-2); + return (get.attitude(event.player,event.source)-2); }); next.autochoose=lib.filter.autoRespondShan; next.set('source',player); @@ -157,14 +157,14 @@ character.standard={ return (event.source&&event.source.countCards('he')&&event.source!=player); }, content:function(){ - player.gainPlayerCard(get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['fankui',trigger.source]); + player.gainPlayerCard(get.prompt('fankui',trigger.source),trigger.source,get.buttonValue,'he').set('logSkill',['fankui',trigger.source]); }, ai:{ effect:{ target:function(card,player,target){ if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1.5]; - if(ai.get.attitude(target,player)<0) return [1,1]; + if(get.attitude(target,player)<0) return [1,1]; } } } @@ -185,13 +185,13 @@ character.standard={ var player=_status.event.player; var judging=_status.event.judging; var result=trigger.judge(card)-trigger.judge(judging); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ - return result-ai.get.value(card)/2; + return result-get.value(card)/2; } else{ - return -result-ai.get.value(card)/2; + return -result-get.value(card)/2; } }).set('judging',trigger.player.judging[0]); "step 1" @@ -235,7 +235,7 @@ character.standard={ return (event.source!=undefined); }, check:function(event,player){ - return (ai.get.attitude(player,event.source)<=0); + return (get.attitude(player,event.source)<=0); }, content:function(){ "step 0" @@ -250,7 +250,7 @@ character.standard={ trigger.source.chooseToDiscard(2).set('ai',function(card){ if(card.name=='tao') return -10; if(card.name=='jiu'&&_status.event.player.hp==1) return -10; - return ai.get.unuseful(card)+2.5*(5-get.owner(card).hp); + return get.unuseful(card)+2.5*(5-get.owner(card).hp); }); "step 2" if(result.bool==false){ @@ -261,7 +261,7 @@ character.standard={ result:{ target:function(card,player,target){ if(player.hasSkillTag('jueqing')) return [1,-1]; - if(get.tag(card,'damage')&&ai.get.damageEffect(target,player,player)>0) return [1,0,0,-1.5]; + if(get.tag(card,'damage')&&get.damageEffect(target,player,player)>0) return [1,0,0,-1.5]; } } } @@ -274,14 +274,14 @@ character.standard={ "step 0" var check; var i,num=game.countPlayer(function(current){ - return current!=player&¤t.countCards('h')&&ai.get.attitude(player,current)<=0; + return current!=player&¤t.countCards('h')&&get.attitude(player,current)<=0; }); check=(num>=2); player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){ return target.countCards('h')>0&&player!=target; },function(target){ if(!_status.event.aicheck) return 0; - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(target.hasSkill('tuntian')) return att/10; return 1-att; }).set('aicheck',check); @@ -310,7 +310,7 @@ character.standard={ if(player.countCards('h')<3) return false; if(!player.hasSha()) return false; return game.hasPlayer(function(current){ - return ai.get.attitude(player,current)<0&&player.canUse('sha',current); + return get.attitude(player,current)<0&&player.canUse('sha',current); }); }, content:function(){ @@ -377,7 +377,7 @@ character.standard={ return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(target.hasSkillTag('nodu')) return 0; return 1-att; @@ -507,16 +507,16 @@ character.standard={ if(players[i].hasSkill('haoshi')&& !players[i].isTurnedOver()&& !players[i].hasJudge('lebu')&& - ai.get.attitude(player,players[i])>=3&& - ai.get.attitude(players[i],player)>=3){ - return 11-ai.get.value(card); + get.attitude(player,players[i])>=3&& + get.attitude(players[i],player)>=3){ + return 11-get.value(card); } } - if(player.countCards('h')>player.hp) return 10-ai.get.value(card); - if(player.countCards('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-get.value(card); + if(player.countCards('h')>2) return 6-get.value(card); return -1; } - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ target.gain(cards,player); @@ -559,7 +559,7 @@ character.standard={ if(player.countCards('e',{subtype:get.subtype(card)})){ var players=game.filterPlayer(); for(var i=0;i0){ + if(players[i]!=player&&get.attitude(player,players[i])>0){ return 0; } } @@ -608,7 +608,7 @@ character.standard={ var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'}); next.set('ai',function(){ var event=_status.event; - return (ai.get.attitude(event.player,event.source)-2); + return (get.attitude(event.player,event.source)-2); }); next.set('source',player); next.autochoose=lib.filter.autoRespondSha; @@ -672,7 +672,7 @@ character.standard={ }); next.set('ai',function(card){ var event=_status.event; - return ai.get.effect(event.target,card,event.source,event.player); + return get.effect(event.target,card,event.source,event.player); }); next.set('source',player); next.set('target',target); @@ -705,11 +705,11 @@ character.standard={ result:{ target:function(player,target){ if(player.hasSkill('jijiang3')) return 0; - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } }, order:function(){ - return ai.get.order({name:'sha'})-0.1; + return get.order({name:'sha'})-0.1; }, } }, @@ -743,7 +743,7 @@ character.standard={ } }, prompt:'将一张红色牌当杀使用或打出', - check:function(card){return 4-ai.get.value(card)}, + check:function(card){return 4-get.value(card)}, ai:{ skillTagFilter:function(player){ if(get.zhu(player,'shouyue')){ @@ -811,10 +811,10 @@ character.standard={ var bottom; if(!stopped){ cards.sort(function(a,b){ - return ai.get.value(b,player)-ai.get.value(a,player); + return get.value(b,player)-get.value(a,player); }); while(cards.length){ - if(ai.get.value(cards[0],player)<=5) break; + if(get.value(cards[0],player)<=5) break; top.unshift(cards.shift()); } } @@ -1031,7 +1031,7 @@ character.standard={ if(!player.countCards('h','shan')) return false; }, order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, useful:-1, value:-1 @@ -1082,7 +1082,7 @@ character.standard={ audio:2, trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, logTarget:'target', content:function(){ @@ -1135,7 +1135,7 @@ character.standard={ selectCard:[1,Infinity], prompt:'弃置任意张牌并摸等量的牌', check:function(card){ - return 6-ai.get.value(card) + return 6-get.value(card) }, content:function(){ player.draw(cards.length); @@ -1177,7 +1177,7 @@ character.standard={ if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当过河拆桥使用', - check:function(card){return 4-ai.get.value(card)} + check:function(card){return 4-get.value(card)} }, keji:{ audio:4, @@ -1259,12 +1259,12 @@ character.standard={ order:1, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player); + var eff=get.damageEffect(target,player); if(eff>=0) return 1+eff; var value=0,i; var cards=player.getCards('h'); for(i=0;i0; + var friend=get.attitude(player,target)>0; var vcard={name:'shacopy',nature:card.nature,suit:card.suit}; var players=game.filterPlayer(); for(var i=0;i0){ + if(get.effect(players[i],vcard,player,player)>0){ if(!player.canUse(card,players[0])){ return [0,0.1]; } @@ -1450,10 +1450,10 @@ character.standard={ check:function(card){ var player=get.owner(card); if(player.countCards('h')>player.hp) - return 8-ai.get.value(card) + return 8-get.value(card) if(player.hp=target.maxHp) return false; @@ -1518,7 +1518,7 @@ character.standard={ position:'he', viewAs:{name:'tao'}, prompt:'将一张红色牌当桃使用', - check:function(card){return 15-ai.get.value(card)}, + check:function(card){return 15-get.value(card)}, ai:{ skillTagFilter:function(player){ return player.countCards('he',{color:'red'})>0&&_status.currentPhase!=player; @@ -1544,7 +1544,7 @@ character.standard={ next.autochoose=lib.filter.autoRespondShan; next.set('ai',function(card){ if(_status.event.player.countCards('h','shan')>1){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return -1; }); @@ -1569,8 +1569,8 @@ character.standard={ next.set('ai',function(card){ var player=_status.event.player; var trigger=_status.event.getTrigger(); - if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ - return ai.get.unuseful2(card); + if(get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ + return get.unuseful2(card); } return -1; }); @@ -1596,7 +1596,7 @@ character.standard={ return current!=player&¤t.sex=='male'; })>1; }, - check:function(card){return 10-ai.get.value(card)}, + check:function(card){return 10-get.value(card)}, filterCard:true, position:'he', filterTarget:function(card,player,target){ @@ -1622,7 +1622,7 @@ character.standard={ return -3; } else{ - return ai.get.effect(target,{name:'juedou'},ui.selected.targets[0],target); + return get.effect(target,{name:'juedou'},ui.selected.targets[0],target); } } }, diff --git a/character/swd.js b/character/swd.js index 0e97c3e09..ccead0e32 100644 --- a/character/swd.js +++ b/character/swd.js @@ -231,7 +231,7 @@ character.swd={ filterCard:{color:'black'}, position:'he', check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai:{ threaten:1.5 @@ -267,7 +267,7 @@ character.swd={ } if(target.isDamaged()){ player.chooseControl(function(){ - if(ai.get.attitude(player,target)>0) return 1; + if(get.attitude(player,target)>0) return 1; return 0; }).set('choiceList',[ '对'+get.translation(target)+'造成一点伤害', @@ -290,12 +290,12 @@ character.swd={ order:7, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)>0){ - if(target.isDamaged()) return ai.get.recoverEffect(target,player,target); + if(get.attitude(player,target)>0){ + if(target.isDamaged()) return get.recoverEffect(target,player,target); return 0; } else{ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -350,10 +350,10 @@ character.swd={ }, filterCard:true, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.attitude(player,target)/Math.sqrt(target.countCards('h')+1); + return get.attitude(player,target)/Math.sqrt(target.countCards('h')+1); }, prompt:'交给一名手牌数少于你的角色一张牌' }); @@ -412,7 +412,7 @@ character.swd={ selectTarget:[1,2], position:'he', check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, contentBefore:function(){ player.loseHp(); @@ -434,9 +434,9 @@ character.swd={ result:{ target:function(player,target){ if(player.hp<2) return 0; - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; if(target.hp>player.hp) return 0; - var eff=ai.get.damageEffect(target,player,target,'fire'); + var eff=get.damageEffect(target,player,target,'fire'); if(eff<0){ if(ui.selected.targets.length&&target.hp>1&&ui.selected.targets[0].hp>1){ return 0; @@ -471,7 +471,7 @@ character.swd={ return !suits.contains(get.suit(card)); }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, discard:false, prepare:function(cards,player){ @@ -585,9 +585,9 @@ character.swd={ }, check:function(card){ switch(ui.selected.cards.length){ - case 0: return 8-ai.get.value(card); - case 1: return 6-ai.get.value(card); - case 2: return 3-ai.get.value(card); + case 0: return 8-get.value(card); + case 1: return 6-get.value(card); + case 2: return 3-get.value(card); } return 0; }, @@ -628,7 +628,7 @@ character.swd={ 'step 5' if(event.suits.contains('spade')){ player.chooseTarget('令一名角色受到一点无来源的雷属性伤害').ai=function(target){ - return ai.get.damageEffect(target,target,player,'thunder'); + return get.damageEffect(target,target,player,'thunder'); } } else{ @@ -672,7 +672,7 @@ character.swd={ player.removeSkill('kbolan2'); if(player.countCards('h')){ player.chooseCard('h',true,'将一张手牌置于牌堆顶').ai=function(card){ - return -ai.get.value(card); + return -get.value(card); }; } else{ @@ -814,12 +814,12 @@ character.swd={ content:function(){ "step 0" var next=player.chooseToDiscard(get.prompt('tiebi',trigger.target),{color:'black'}); - var goon=(ai.get.attitude(player,trigger.target)>2&& - ai.get.damageEffect(trigger.target,trigger.player,player)<0); + var goon=(get.attitude(player,trigger.target)>2&& + get.damageEffect(trigger.target,trigger.player,player)<0); next.ai=function(card){ if(goon){ - if(trigger.target.hp==1) return 10-ai.get.value(card); - return 7-ai.get.value(card); + if(trigger.target.hp==1) return 10-get.value(card); + return 7-get.value(card); } return 0; }; @@ -849,14 +849,14 @@ character.swd={ player.storage.shenyan=false; }, check:function(event,player){ - if(ai.get.attitude(player,event.player)>=0) return 0; + if(get.attitude(player,event.player)>=0) return 0; if(player.hasUnknown()) return 0; var num=0,players=game.filterPlayer(); for(var i=0;i0){ num++; } @@ -965,7 +965,7 @@ character.swd={ return true; }, check:function(event,player){ - if(ai.get.damageEffect(player,event.player,player)>=0) return false; + if(get.damageEffect(player,event.player,player)>=0) return false; return true; }, content:function(){ @@ -984,7 +984,7 @@ character.swd={ return [0.5,Math.max(2,target.countCards('h'))]; } if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ - if(ai.get.attitude(player,target)>0&&card.name=='juedou') return; + if(get.attitude(player,target)>0&&card.name=='juedou') return; return [0.5,target.countCards('h','sha')+target.countCards('h','shan')]; } } @@ -997,7 +997,7 @@ character.swd={ lib.filter.targetEnabled({name:'sha'},player,event.source); }, check:function(event,player){ - return ai.get.effect(event.source,{name:'sha'},player,player)>0; + return get.effect(event.source,{name:'sha'},player,player)>0; }, logTarget:'source', content:function(){ @@ -1018,7 +1018,7 @@ character.swd={ player.chooseTarget(get.prompt('xuanying'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).set('ai',function(target){ - return ai.get.effect(target,{name:'sha'},_status.event.player); + return get.effect(target,{name:'sha'},_status.event.player); }); 'step 1' if(result.bool){ @@ -1041,7 +1041,7 @@ character.swd={ hwendao:{ trigger:{player:['useCardAfter','respondAfter',]}, check:function(event,player){ - return ai.get.attitude(player,_status.currentPhase)<=0; + return get.attitude(player,_status.currentPhase)<=0; }, logTarget:function(){ return _status.currentPhase; @@ -1054,10 +1054,10 @@ character.swd={ content:function(){ 'step 0' var suit=get.suit(trigger.cards[0]); - var goon=(ai.get.attitude(_status.currentPhase,player)<=0); + var goon=(get.attitude(_status.currentPhase,player)<=0); _status.currentPhase.chooseToDiscard('弃置一张'+get.translation(suit+'2')+ '牌,或令'+get.translation(player)+'获得你的一张牌',{suit:suit}).ai=function(card){ - if(goon) return 8-ai.get.value(card); + if(goon) return 8-get.value(card); return 0; } 'step 1' @@ -1082,7 +1082,7 @@ character.swd={ }).ai=function(target){ if(player.hp==1) return 0; if(player.hp==2&&target.hp>=3) return 0; - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); } 'step 1' if(result.bool){ @@ -1157,7 +1157,7 @@ character.swd={ if(num<2) return 0; for(var i=0;i0&& + get.effect(enemies[i],{name:'sha'},player,player)>0&& !enemies[i].getEquip(2)&&num>enemies[i].hp&&enemies[i].hp<=2){ return 1; } @@ -1187,7 +1187,7 @@ character.swd={ prepare:'throw2', usable:1, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filterCard:true, content:function(){ @@ -1220,7 +1220,7 @@ character.swd={ content:function(){ 'step 0' player.chooseToDiscard('he','祭风:是否弃置一张装备牌并获得一张祭器牌?',{type:'equip'}).set('ai',function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }).logSkill='hjifeng'; 'step 1' if(result.bool){ @@ -1244,7 +1244,7 @@ character.swd={ return !target.hasSkill('lmazui2'); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, discard:false, prepare:'give', @@ -1386,7 +1386,7 @@ character.swd={ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result; @@ -1453,7 +1453,7 @@ character.swd={ var num=0; var players=game.filterPlayer(); for(var i=0;i2){ + if(get.attitude(player,players[i])>2){ if(players[i].hp==1) return 1; if(players[i].hp==2) num++; } @@ -1486,7 +1486,7 @@ character.swd={ lingyue:{ trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, logTarget:'target', filter:function(event,player){ @@ -1509,7 +1509,7 @@ character.swd={ audio:true, prompt:'将一张黑色牌当作桃园结义使用', check:function(card){ - return 7-ai.get.useful(card) + return 7-get.useful(card) }, ai:{ threaten:1.5 @@ -1524,7 +1524,7 @@ character.swd={ filterCard:{suit:['spade','heart']}, viewAs:{name:'fengyinzhidan'}, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai:{ order:8.5, @@ -1541,10 +1541,10 @@ character.swd={ if(!player.countCards('he',{color:'red'})) return false; }, prompt:'将一张红色牌当杀使用', - check:function(card){return 5-ai.get.value(card)}, + check:function(card){return 5-get.value(card)}, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; @@ -1704,7 +1704,7 @@ character.swd={ case 'identity':{ switch(player.identity){ case 'zhu':{ - if(ai.get.situation()>=0) return 0; + if(get.situation()>=0) return 0; if(get.population('fan')<3) return 0; return -1; } @@ -1786,7 +1786,7 @@ character.swd={ }, respondSha:true, order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, useful:-1, value:-1 @@ -1813,7 +1813,7 @@ character.swd={ alter:true, check:function(event,player){ return game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>2&¤t.countCards('h')==1 + return get.attitude(player,current)>2&¤t.countCards('h')==1 }); }, filter:function(event,player){ @@ -1845,17 +1845,17 @@ character.swd={ var next=player.chooseTarget(true,dialog,function(card,player,target){ return target.countCards('h')>0&&get.distance(player,target)<=dist; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); var hs=target.getCards('h'); var num=hs.length; if(num<=1) return att*2; if(num==2){ for(var i=0;i6,target,'raw') return att; + if(get.value(cards[i])>6,target,'raw') return att; } if(target==player){ for(var i=0;i<2;i++){ - if(ai.get.value(cards[i])>6,target,'raw') return -1; + if(get.value(cards[i])>6,target,'raw') return -1; } } return att/2; @@ -1864,8 +1864,8 @@ character.swd={ if(target==player){ var num2=0; for(var i=0;i<3;i++){ - num2+=ai.get.value(cards[i],player,'raw'); - num2-=ai.get.value(hs[i],player,'raw'); + num2+=get.value(cards[i],player,'raw'); + num2-=get.value(hs[i],player,'raw'); } if(num2>0) return 0.5; if(num2<0) return -0.5; @@ -1911,9 +1911,9 @@ character.swd={ if(nh>4) return 0; if(nh==4&&pos=='e') return 0; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 11-ai.get.equipValue(card)+(pos=='e'?0.4:0); + return 11-get.equipValue(card)+(pos=='e'?0.4:0); } - return 5.5-ai.get.value(card)+(pos=='e'?0.4:0); + return 5.5-get.value(card)+(pos=='e'?0.4:0); }, content:function(){ "step 0" @@ -1956,7 +1956,7 @@ character.swd={ return num%2==1; }, prompt:'将一张手牌当作杀打出', - check:function(card){return 6-ai.get.value(card)} + check:function(card){return 6-get.value(card)} }, yaotong2:{ enable:['chooseToRespond','chooseToUse'], @@ -1969,7 +1969,7 @@ character.swd={ return num%2==1; }, prompt:'将一张手牌当作闪打出', - check:function(card){return 6-ai.get.value(card)} + check:function(card){return 6-get.value(card)} }, yaotong3:{ enable:'chooseToUse', @@ -1986,7 +1986,7 @@ character.swd={ return num%2==0; }, prompt:'将一张手牌当作无懈可击使用', - check:function(card){return 7-ai.get.value(card)}, + check:function(card){return 7-get.value(card)}, }, yaotong4:{ enable:'chooseToUse', @@ -2003,7 +2003,7 @@ character.swd={ return num%2==0; }, prompt:'将一张手牌当作桃使用', - check:function(card){return 9-ai.get.value(card)}, + check:function(card){return 9-get.value(card)}, }, pojian:{ trigger:{player:'loseEnd'}, @@ -2047,7 +2047,7 @@ character.swd={ player.addSkill('huajin2'); }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, ai:{ order:10, @@ -2058,7 +2058,7 @@ character.swd={ var players=game.filterPlayer(); for(var i=0;i0){ + get.effect(players[i],{name:'sha'},player,player)>0){ return 1; } } @@ -2101,7 +2101,7 @@ character.swd={ player.chooseTarget(get.prompt('yuchen'),function(card,player,target){ return player!=target&&target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.bool){ @@ -2142,7 +2142,7 @@ character.swd={ order:5, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'thunder'); + return get.damageEffect(target,player,target,'thunder'); } }, expose:0.2 @@ -2156,7 +2156,7 @@ character.swd={ }, content:function(){ "step 0" - var yep=ai.get.attitude(player,trigger.player)<0&& + var yep=get.attitude(player,trigger.player)<0&& trigger.player.countCards('h')>2; var next=player.chooseToDiscard(function(card){ return get.type(card)!='basic'; @@ -2164,14 +2164,14 @@ character.swd={ next.logSkill=['rumeng',trigger.player]; next.ai=function(card){ if(yep){ - return 6-ai.get.value(card); + return 6-get.value(card); } return 0; } "step 1" if(result.bool){ trigger.player.chooseToDiscard({type:'basic'},'入梦:弃置一张基本牌或跳过出牌及弃牌阶段').ai=function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); } } else{ @@ -2198,8 +2198,8 @@ character.swd={ "step 0" var next=player.chooseToDiscard('he',get.prompt('lianda')); next.ai=function(card){ - if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){ - return 7-ai.get.value(card); + if(get.effect(trigger.target,{name:'sha'},player,player)>0){ + return 7-get.value(card); } return 0; } @@ -2223,7 +2223,7 @@ character.swd={ player.chooseTarget(get.prompt('huiqi'),function(card,player,target){ return player!=target; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(player.hp<=0){ if(player==target){ return 1; @@ -2285,7 +2285,7 @@ character.swd={ return '令'+get.translation(targets)+'回复一点体力'; }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterTarget:function(card,player,target){ return target.isDamaged()&&target.isLowestHp(); @@ -2308,7 +2308,7 @@ character.swd={ } for(var i=0;i2){ + if(get.attitude(player,trigger.target)>2){ if(player.countCards('h','shan')||player.getEquip(2)|| trigger.target.hp==1||player.hp>trigger.target.hp+1){ if(!trigger.target.countCards('h','shan')||trigger.target.countCards('h')3){ return 100-target.countCards('h'); @@ -2434,10 +2434,10 @@ character.swd={ }, filterCard:lib.filter.cardDiscardable, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }, prompt:get.prompt('shangxi') }); @@ -2463,8 +2463,8 @@ character.swd={ player.chooseTarget(get.prompt('fuyan'),function(card,player,target){ return !target.hujia; }).ai=function(target){ - if(ai.get.attitude(player,target)<=0) return 0; - var eff=-ai.get.damageEffect(target,target,player)+(player==target?2:0); + if(get.attitude(player,target)<=0) return 0; + var eff=-get.damageEffect(target,target,player)+(player==target?2:0); if(target.hp==1) eff+=2; return Math.min(1,eff); }; @@ -2539,7 +2539,7 @@ character.swd={ player.turnOver(); player.addSkill('pingshen3'); }, - check:function(card){return 8-ai.get.value(card);}, + check:function(card){return 8-get.value(card);}, intro:{ content:'limited' }, @@ -2548,7 +2548,7 @@ character.swd={ result:{ player:function(player){ if(player.classList.contains('turnedover')) return 10; - if(ai.get.attitude(player,player.storage.pingshen)>=0){ + if(get.attitude(player,player.storage.pingshen)>=0){ return 0; } if(player.storage.pingshen.countCards('h')>player.storage.pingshen.hp) return 1; @@ -2617,17 +2617,17 @@ character.swd={ if(distance.attackFrom<0||distance.globalFrom<0) return 10; } } - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ "step 0" event.type=get.type(cards[0],'trick'); - var dme=ai.get.damageEffect(target,player,target); + var dme=get.damageEffect(target,player,target); target.chooseToDiscard('he',function(card){ return get.type(card,'trick')==event.type; },'弃置一张牌'+get.translation(event.type)+'牌,或受到1点伤害').ai=function(card){ if(dme<0){ - return 8-ai.get.value(card); + return 8-get.value(card); } return 0; } @@ -2640,7 +2640,7 @@ character.swd={ order:9, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } }, threaten:2, @@ -2662,7 +2662,7 @@ character.swd={ player.chooseTarget(get.prompt('lingxian'),function(card,player,target){ return get.distance(player,target,'attack')>1&&player!=target; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att<=-0.5) return 0; if(att<=3) return att+0.5; return att+Math.min(0.5,5-target.countCards('h')); @@ -2678,7 +2678,7 @@ character.swd={ effect:{ target:function(card,player,target){ if(!game.hasPlayer(function(current){ - return get.distance(player,current,'attack')>1&&player!=current&&ai.get.attitude(player,current)>=0; + return get.distance(player,current,'attack')>1&&player!=current&&get.attitude(player,current)>=0; })){ return; } @@ -2760,13 +2760,13 @@ character.swd={ save:true, result:{ player:function(player){ - if(_status.event.dying!=player&&ai.get.attitude(player,_status.event.dying)<=0){ + if(_status.event.dying!=player&&get.attitude(player,_status.event.dying)<=0){ return 0; } var num=0; var players=game.filterPlayer(); for(var i=0;i0){ @@ -2801,12 +2801,12 @@ character.swd={ viewAs:{name:'sha'}, prompt:'将两张牌当杀使用', check:function(card){ - if(_status.event.player.countCards('h')<4) return 6-ai.get.useful(card); - return 7-ai.get.useful(card); + if(_status.event.player.countCards('h')<4) return 6-get.useful(card); + return 7-get.useful(card); }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; } }, group:['linyun2'] @@ -2824,7 +2824,7 @@ character.swd={ next.autochoose=lib.filter.autoRespondShan; next.ai=function(card){ if(trigger.target.countCards('h','shan')>1){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return -1; }; @@ -2861,7 +2861,7 @@ character.swd={ }, trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ "step 0" @@ -2903,7 +2903,7 @@ character.swd={ filterCard:true, selectCard:[1,player.countCards('he')], ai1:function(card){ - var useful=ai.get.useful(card); + var useful=get.useful(card); if(card.name=='du'){ useful=-5; } @@ -2915,7 +2915,7 @@ character.swd={ if(target.hp>ui.selected.cards.length){ return 0; } - return ai.get.attitude(player,target); + return get.attitude(player,target); }, position:'he', prompt:get.prompt('hutian') @@ -2992,7 +2992,7 @@ character.swd={ chengjian:{ trigger:{global:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.source)>0; + return get.attitude(player,event.source)>0; }, filter:function(event,player){ return event.source&&event.card&&event.card.name=='sha'&&event.source!=player; @@ -3037,7 +3037,7 @@ character.swd={ }, ai1:function(card){ if(player.additionalSkills.huanxing&&player.additionalSkills.huanxing.length>0) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); }, ai2:function(target){ if(target.isMin()) return 0; @@ -3102,7 +3102,7 @@ character.swd={ prompt:'将一张黑色牌当作偷梁换柱使用', check:function(card){ if(_status.event.player.countCards('h')>_status.event.player.hp){ - return 5-ai.get.value(card) + return 5-get.value(card) } return 0; }, @@ -3115,10 +3115,10 @@ character.swd={ }, content:function(){ "step 0" - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); var next=player.chooseToDiscard('he',get.prompt('suiyan')); next.ai=function(card){ - if(att<0) return 7-ai.get.value(card); + if(att<0) return 7-get.value(card); return -1; } next.logSkill=['suiyan',trigger.player]; @@ -3140,7 +3140,7 @@ character.swd={ content:function(){ "step 0" var enemy=game.countPlayer(function(current){ - return current!=player&&ai.get.damageEffect(current,player,player)>0; + return current!=player&&get.damageEffect(current,player,player)>0; }); var next=player.chooseCardTarget({ position:'he', @@ -3159,10 +3159,10 @@ character.swd={ }, ai1:function(card){ if(ui.selected.cards.length>=enemy) return 0; - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }, prompt:get.prompt('ningxian') }); @@ -3246,7 +3246,7 @@ character.swd={ player:function(card,player){ if(player.hasSkill('xuanyuan')) return; if(card.name=='xuanyuanjian'&&game.hasPlayer(function(current){ - return current.hasSkill('xuanyuan')&&ai.get.attitude(player,current)<=0; + return current.hasSkill('xuanyuan')&&get.attitude(player,current)<=0; })){ return [0,0,0,0]; } @@ -3350,7 +3350,7 @@ character.swd={ result:{ player:function(player){ if(player.tempSkills.jilve3) return 0; - if(_status.event.dying) return ai.get.attitude(player,_status.event.dying); + if(_status.event.dying) return get.attitude(player,_status.event.dying); return 1; } }, @@ -3457,7 +3457,7 @@ character.swd={ for(var i=0;i0&&player!=event.player; @@ -3552,9 +3552,9 @@ character.swd={ check:function(card){ var player=_status.currentPhase; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 12-ai.get.equipValue(card); + return 12-get.equipValue(card); } - return 8-ai.get.equipValue(card); + return 8-get.equipValue(card); }, filter:function(event,player){ return player.countCards('he',{type:'equip'}); @@ -3570,7 +3570,7 @@ character.swd={ expose:0.2, result:{ player:function(player,target){ - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); } } } @@ -3585,7 +3585,7 @@ character.swd={ alter:true, logTarget:'player', check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, content:function(){ var hs=trigger.player.getCards('h',function(card){ @@ -3600,7 +3600,7 @@ character.swd={ mojian:{ trigger:{player:'shaBegin'}, check:function(event,player){ - if(ai.get.attitude(player,event.target)>0) return true; + if(get.attitude(player,event.target)>0) return true; return player.hp1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } - return 6-ai.get.equipValue(card); + return 6-get.equipValue(card); }, discard:false, prepare:'throw', @@ -3688,12 +3688,12 @@ character.swd={ }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, result:{ target:function(player,target){ player.addAdditionalSkill('jianji_ai','unequip'); - var eff=ai.get.effect(target,{name:'sha'},player,target); + var eff=get.effect(target,{name:'sha'},player,target); player.removeAdditionalSkill('jianji_ai'); return eff; } @@ -3727,7 +3727,7 @@ character.swd={ lib.filter.filterCard({name:'sha'},player)){ return 0; } - return 6-ai.get.value(card) + return 6-get.value(card) }, ai:{ order:8, @@ -3749,7 +3749,7 @@ character.swd={ "step 0" var effect=0; for(var i=0;i0&&!target.hasSkill('duishi3'); }, filterCard:true, - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, content:function(){ "step 0" var suit=get.suit(cards[0]); target.chooseToDiscard({suit:suit},'h','对诗:弃置一张'+get.translation(suit)+ '牌,或令'+get.translation(player)+'获得你一张牌').ai=function(card){ - if(ai.get.attitude(target,player)>0) return 0; - return 9-ai.get.value(card); + if(get.attitude(target,player)>0) return 0; + return 9-get.value(card); } "step 1" @@ -3974,11 +3974,11 @@ character.swd={ content:function(){ "step 0" player.chooseCard('是否交给'+get.translation(trigger.player)+'一张牌并取消此杀?').ai=function(card){ - if(ai.get.attitude(player,trigger.player)>0){ - return 9-ai.get.value(card); + if(get.attitude(player,trigger.player)>0){ + return 9-get.value(card); } if(player.countCards('h',{name:'shan'})) return -1; - return 7-ai.get.value(card); + return 7-get.value(card); } "step 1" if(result.bool){ @@ -4020,7 +4020,7 @@ character.swd={ }, check:function(card){ if(card.name=='du') return 20; - return Math.max(7-ai.get.value(card),7-ai.get.useful(card)); + return Math.max(7-get.value(card),7-get.useful(card)); }, content:function(){ target.addJudge('guiyoujie',cards); @@ -4028,7 +4028,7 @@ character.swd={ ai:{ result:{ target:function(player,target){ - return ai.get.effect(target,{name:'guiyoujie'},player,target); + return get.effect(target,{name:'guiyoujie'},player,target); } }, order:8, @@ -4145,9 +4145,9 @@ character.swd={ touxi:{ trigger:{global:'phaseEnd'}, check:function(event,player){ - if(ai.get.damageEffect(event.player,player,player,'thunder')>0){ + if(get.damageEffect(event.player,player,player,'thunder')>0){ if(get.is.altered('touxi')){ - if(ai.get.attitude(player,event.player)<0&&event.player.hp==1&&player.hp>1){ + if(get.attitude(player,event.player)<0&&event.player.hp==1&&player.hp>1){ return true; } } @@ -4180,10 +4180,10 @@ character.swd={ } else{ if(player.countCards('he')){ - var att=ai.get.attitude(trigger.player,player); + var att=get.attitude(trigger.player,player); trigger.player.discardPlayerCard(player,'he',function(button){ if(att>0) return 0; - return ai.get.buttonValue(button); + return get.buttonValue(button); }); } } @@ -4220,7 +4220,7 @@ character.swd={ discard:false, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ "step 0" @@ -4360,9 +4360,9 @@ character.swd={ filterCard:true, check:function(card){ if(ui.selected.cards.length==0){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ "step 0" @@ -4374,7 +4374,7 @@ character.swd={ order:9, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } }, threaten:function(player,target){ @@ -4414,9 +4414,9 @@ character.swd={ }, check:function(card){ if(ui.selected.cards.length==0){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }, line:'fire', content:function(){ @@ -4429,7 +4429,7 @@ character.swd={ order:9, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'fire'); + return get.damageEffect(target,player,target,'fire'); } }, threaten:function(player,target){ @@ -4452,7 +4452,7 @@ character.swd={ trigger:{player:'damageEnd'}, priority:9, check:function(event,player){ - return ai.get.attitude(player,event.source)<0; + return get.attitude(player,event.source)<0; }, filter:function(event){ return event&&event.source; @@ -4513,9 +4513,9 @@ character.swd={ "step 0" player.chooseTarget(get.prompt('wangchen')).ai=function(target){ if(get.is.altered('wangchen')){ - return -ai.get.attitude(player,target)/Math.sqrt(target.hp); + return -get.attitude(player,target)/Math.sqrt(target.hp); } - return ai.get.attitude(player,target)*(target.isTurnedOver()?1:-1); + return get.attitude(player,target)*(target.isTurnedOver()?1:-1); } "step 1" if(result.bool){ @@ -4572,9 +4572,9 @@ character.swd={ "step 0" var next=player.chooseToDiscard(get.prompt('yihua',trigger.player),2); next.ai=function(card){ - if(ai.get.effect(player,trigger.card)<0){ - if(card.name=='liuxinghuoyu') return 7-ai.get.value(card); - return 5-ai.get.value(card); + if(get.effect(player,trigger.card)<0){ + if(card.name=='liuxinghuoyu') return 7-get.value(card); + return 5-get.value(card); } return 0; }; @@ -4694,7 +4694,7 @@ character.swd={ return player.countCards('he',{suit:'spade'})>0; }, check:function(card){ - return 10-ai.get.value(card) + return 10-get.value(card) }, filterTarget:function(card,player,target){ if(target.hp>=target.maxHp) return false; @@ -4709,7 +4709,7 @@ character.swd={ result:{ target:function(player,target){ if(player==target&&player.countCards('h')>player.hp) return 20; - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } }, threaten:2 @@ -4727,7 +4727,7 @@ character.swd={ if(!player.countCards('he',{suit:'heart'})) return false; }, prompt:'将一张红桃手牌当作流星火羽使用', - check:function(card){return 6-ai.get.value(card)}, + check:function(card){return 6-get.value(card)}, ai:{ threaten:1.4, order:9, @@ -4755,7 +4755,7 @@ character.swd={ }, viewAs:{name:'caoyao'}, prompt:'将一张黑色手牌当作草药使用', - check:function(card){return 6-ai.get.value(card)}, + check:function(card){return 6-get.value(card)}, ai:{ threaten:1.6 } @@ -4774,7 +4774,7 @@ character.swd={ if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当作冰魄针使用', - check:function(card){return 5-ai.get.value(card)}, + check:function(card){return 5-get.value(card)}, ai:{ threaten:1.1 } @@ -4789,7 +4789,7 @@ character.swd={ position:'he', prompt:'将三张牌当作惊雷闪使用', check:function(card){ - return 4-ai.get.value(card); + return 4-get.value(card); }, group:'benlei2', ai:{ @@ -4834,7 +4834,7 @@ character.swd={ }, content:function(){ "step 0" - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); var nh=player.countCards('h'); var next; if(get.is.altered('susheng')){ @@ -4846,7 +4846,7 @@ character.swd={ next.logSkill=['susheng',trigger.player]; next.ai=function(card){ if(att>3||(att>1&&nh>2)){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return 0; }; @@ -4922,7 +4922,7 @@ character.swd={ var num=0; for(var i=0;i0){ num+=num2; @@ -5097,7 +5097,7 @@ character.swd={ prepare:'throw', // selectTarget:[1,2], selectCard:[2,2], - check:function(card){return 6-ai.get.useful(card)}, + check:function(card){return 6-get.useful(card)}, prompt:'弃置两张相同花色的手牌,选择一名角色弃置其一张牌,并视为对其使用一张火杀', content:function(){ "step 0" @@ -5111,7 +5111,7 @@ character.swd={ order:3, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha',nature:'fire'},player,target)-1; + return get.effect(target,{name:'sha',nature:'fire'},player,target)-1; } }, expose:0.2 @@ -5141,7 +5141,7 @@ character.swd={ delay:false, discard:false, selectCard:[2,2], - check:function(card){return 7-ai.get.value(card)}, + check:function(card){return 7-get.value(card)}, content:function(){ "step 0" player.useCard({name:'sha'},[cards[0]],target,false,'liaoyuan'); @@ -5152,7 +5152,7 @@ character.swd={ order:6, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha'},player,target)*2; + return get.effect(target,{name:'sha'},player,target)*2; } }, expose:0.2 @@ -5177,7 +5177,7 @@ character.swd={ complexCard:true, selectCard:[1,4], check:function(card){ - return 7-ai.get.value(card) + return 7-get.value(card) }, content:function(){ "step 0" @@ -5211,7 +5211,7 @@ character.swd={ } target.chooseToDiscard(cards.length,true,'he').ai=function(card){ var num=choice.contains(card)?20:0; - return num-ai.get.value(card); + return num-get.value(card); } "step 1" var damage=false; @@ -5228,7 +5228,7 @@ character.swd={ order:6, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player); + var eff=get.damageEffect(target,player); var num=target.countCards('he'); var length=ui.selected.cards.length; if(num==length) return -2+eff; @@ -5258,9 +5258,9 @@ character.swd={ player.chooseCard('he',get.prompt('liaoyuan'),function(card,player){ return get.suit(card)==suit&&lib.filter.cardDiscardable(card,player); }).ai=function(card){ - if(ai.get.attitude(player,trigger.target)>=0) return 0; - if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){ - return 7-ai.get.value(card); + if(get.attitude(player,trigger.target)>=0) return 0; + if(get.effect(trigger.target,{name:'sha'},player,player)>0){ + return 7-get.value(card); } return 0; } @@ -5277,7 +5277,7 @@ character.swd={ } "step 3" if(event.num){ - trigger.target.chooseToRespond({name:'shan'}).ai=ai.get.unuseful2; + trigger.target.chooseToRespond({name:'shan'}).ai=get.unuseful2; } else{ event.finish(); @@ -5329,8 +5329,8 @@ character.swd={ next.logSkill=event.name; next.ai=function(card){ if(get.tag(trigger.card,'multitarget')&&!get.tag(card,'multineg')) return 0; - if(ai.get.effect(player,trigger.card,trigger.player,player)<0){ - return 7-ai.get.value(card); + if(get.effect(player,trigger.card,trigger.player,player)<0){ + return 7-get.value(card); } return 0; } @@ -5395,7 +5395,7 @@ character.swd={ player.chooseTarget(get.prompt('duanxing'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); } "step 1" if(result.bool){ @@ -5424,7 +5424,7 @@ character.swd={ if(player==target) return false; return target.countCards('he')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.bool){ @@ -5468,7 +5468,7 @@ character.swd={ if(player==target) return false; return target.countCards('he')>0; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att<=0){ return 1-att+(target.countCards('e')?2:0); } @@ -5480,7 +5480,7 @@ character.swd={ player.logSkill('meihuo',event.target); player.choosePlayerCard(event.target,'he',true).ai=function(button){ var card=button.link; - if(get.position(card)=='e') return ai.get.equipValue(card); + if(get.position(card)=='e') return get.equipValue(card); return 5; }; } @@ -5617,7 +5617,7 @@ character.swd={ chuanyang:{ trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, filter:function(event,player){ // if(event.card&&get.color(event.card)=='red') return true; @@ -5663,8 +5663,8 @@ character.swd={ next.logSkill=['huanhun',trigger.player]; next.ai=function(card){ if(card.name=='tao') return 0; - if(ai.get.attitude(player,trigger.player)>0){ - return 8-ai.get.value(card); + if(get.attitude(player,trigger.player)>0){ + return 8-get.value(card); } return 0; }; @@ -5706,7 +5706,7 @@ character.swd={ } player.chooseButton(ui.create.dialog([list,'character']),function(button){ for(var i=0;i2) return 3; + if(get.attitude(player,game.dead[i])>2) return 3; } return 0; } @@ -5739,7 +5739,7 @@ character.swd={ yinyue:{ trigger:{global:'recoverAfter'}, check:function(event,player){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, logTarget:'player', alter:true, @@ -5766,7 +5766,7 @@ character.swd={ daofa:{ trigger:{global:'damageAfter'}, check:function(event,player){ - return event.source&&ai.get.attitude(player,event.source)<0; + return event.source&&get.attitude(player,event.source)<0; }, filter:function(event,player){ return event.source&&event.source!=player&&event.source.countCards('he'); @@ -5792,11 +5792,11 @@ character.swd={ if(ui.selected.cards.length>=2) return 0; if(ui.selected.cards.length==1){ if(player.countCards('h')>player.hp){ - return 3-ai.get.value(card); + return 3-get.value(card); } return 0; } - return 6-ai.get.value(card); + return 6-get.value(card); }; "step 1" if(result.bool){ @@ -5949,7 +5949,7 @@ character.swd={ player.storage.xianjiang=[]; }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, prompt:'将一张装备牌永久转化为任意一张装备牌', content:function(){ @@ -5960,12 +5960,12 @@ character.swd={ for(var i in lib.card){ if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; if(lib.card[i].type=='equip'&&cards[0].name!=i){ - if(ai.get.equipValue({name:i})<10) list.push([suit,number,i]); + if(get.equipValue({name:i})<10) list.push([suit,number,i]); } } var dialog=ui.create.dialog([list,'vcard']); player.chooseButton(dialog,true,function(button){ - return ai.get.value({name:button.link[2]},player); + return get.value({name:button.link[2]},player); }); "step 1" cards[0].init(result.buttons[0].link); @@ -6008,7 +6008,7 @@ character.swd={ }, selectCard:1, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, content:function(){ var card=game.createCard(get.inpile('equip').randomGet()); @@ -6066,12 +6066,12 @@ character.swd={ player.chooseButton(dialog,function(button){ var player=get.owner(button.link); if(get.subtype(button.link)=='equip2'&&!player.hasShan()){ - return 11-ai.get.attitude(_status.event.player,player); + return 11-get.attitude(_status.event.player,player); } if(get.subtype(button.link)=='equip1'&&!player.hasSha()){ - return 11-ai.get.attitude(_status.event.player,player); + return 11-get.attitude(_status.event.player,player); } - return 5-ai.get.attitude(_status.event.player,player); + return 5-get.attitude(_status.event.player,player); }); "step 1" if(result.bool){ @@ -6095,14 +6095,14 @@ character.swd={ if(he<=1) return; if(get.tag(card,'respondShan')){ if(game.hasPlayer(function(current){ - return current!=target&¤t.getEquip(2)&&ai.get.attitude(target,current)<=0; + return current!=target&¤t.getEquip(2)&&get.attitude(target,current)<=0; })){ return 0.6/he; } } if(get.tag(card,'respondSha')){ if(game.hasPlayer(function(current){ - return current!=target&¤t.getEquip(2)&&ai.get.attitude(target,current)<=0; + return current!=target&¤t.getEquip(2)&&get.attitude(target,current)<=0; })){ return 0.6/he; } @@ -6126,10 +6126,10 @@ character.swd={ }, filterCard:true, ai1:function(card){ - return ai.get.unuseful(card)+9; + return get.unuseful(card)+9; }, ai2:function(target){ - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); }, prompt:get.prompt('huajian') }); @@ -6175,7 +6175,7 @@ character.swd={ player.chooseTarget(get.prompt('jikong'),function(card,player,target){ return lib.filter.targetEnabled({name:'sha',nature:'thunder'},player,target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha',nature:'thunder'},player); + return get.effect(target,{name:'sha',nature:'thunder'},player); } "step 1" if(result.bool){ @@ -6216,10 +6216,10 @@ character.swd={ } }, ai1:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player,'thunder'); + return get.damageEffect(target,player,player,'thunder'); } }); "step 1" @@ -6268,7 +6268,7 @@ character.swd={ player:function(player){ var num=0,players=game.filterPlayer(); for(var i=0;i0){ num-=players[i].countCards('he')-2; } @@ -6300,7 +6300,7 @@ character.swd={ viewAs:{name:'sha'}, position:'he', prompt:'将一张黑色牌当杀打出', - check:function(card){return 6-ai.get.value(card)} + check:function(card){return 6-get.value(card)} }, ningjian2:{ enable:['chooseToRespond','chooseToUse'], @@ -6308,7 +6308,7 @@ character.swd={ viewAs:{name:'shan'}, position:'he', prompt:'将一张红色牌当闪打出', - check:function(card){return 6-ai.get.value(card)} + check:function(card){return 6-get.value(card)} }, duoren:{ trigger:{target:'shaMiss'}, @@ -6316,7 +6316,7 @@ character.swd={ return event.player.getEquip(1)!=undefined; }, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, priority:5, content:function(){ @@ -6338,7 +6338,7 @@ character.swd={ // content:function(){ // "step 0" // player.choosePlayerCard('是否获得'+get.translation(trigger.player)+'的一张装备牌?', - // 'e',trigger.player).ai=ai.get.buttonValue; + // 'e',trigger.player).ai=get.buttonValue; // "step 1" // if(result.bool){ // var card=result.buttons[0].link; @@ -6386,7 +6386,7 @@ character.swd={ }, alter:true, // check:function(event,player){ - // return ai.get.attitude(player,event.source)<0; + // return get.attitude(player,event.source)<0; // }, direct:true, content:function(){ @@ -6397,15 +6397,15 @@ character.swd={ var next=player.chooseToDiscard(num,'是否弃置'+num+'张手牌,并对'+get.translation(trigger.source)+'造成一点伤害?'); next.logSkill=['pozhen',trigger.source]; next.ai=function(card){ - if(ai.get.damageEffect(trigger.source,player,player)>0&&num<=2){ - return 6-ai.get.value(card); + if(get.damageEffect(trigger.source,player,player)>0&&num<=2){ + return 6-get.value(card); } return -1; } } else if(num<0){ player.chooseBool('是否弃置'+get.translation(trigger.source)+(-num)+'张手牌?').ai=function(){ - return ai.get.attitude(player,trigger.source)<0; + return get.attitude(player,trigger.source)<0; } } else{ @@ -6451,8 +6451,8 @@ character.swd={ "step 0" player.chooseToDiscard([1,trigger.source.countCards('h')],'弃置任意张手牌并令伤害来源弃置等量手牌').ai=function(card){ if(ui.selected.cards.length>=trigger.source.countCards('h')) return -1; - if(ui.selected.cards.length==0) return 8-ai.get.value(card); - return 4-ai.get.value(card); + if(ui.selected.cards.length==0) return 8-get.value(card); + return 4-get.value(card); } "step 1" if(result.bool){ @@ -6590,7 +6590,7 @@ character.swd={ }, check:function(card){ if(ui.selected.cards.length) return 0; - return 4-ai.get.value(card); + return 4-get.value(card); }, ai:{ order:5, @@ -6641,7 +6641,7 @@ character.swd={ } }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai:{ order:5, @@ -6740,8 +6740,8 @@ character.swd={ content:function(){ 'step 0' player.chooseToDiscard('he',get.prompt('tianshu')).ai=function(card){ - if(get.position(card)=='h') return 5-ai.get.useful(card); - return 4-ai.get.value(card); + if(get.position(card)=='h') return 5-get.useful(card); + return 4-get.value(card); }.logSkill='tianshu'; 'step 1' if(result.bool){ @@ -6962,7 +6962,7 @@ character.swd={ return dialog; }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ "step 0" @@ -7132,7 +7132,7 @@ character.swd={ return player!=target&&target.countCards('he')>0; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, selectTarget:[1,2], content:function(){ @@ -7163,12 +7163,12 @@ character.swd={ next.logSkill='yulin'; next.ai=function(card){ if(player.hp==1||trigger.num>1){ - return 9-ai.get.value(card); + return 9-get.value(card); } if(player.hp==2){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 7-ai.get.value(card); + return 7-get.value(card); }; "step 1" if(result.bool){ @@ -7192,7 +7192,7 @@ character.swd={ filterCard:true, check:function(card){ if(card.name=='du') return 20; - return 7-ai.get.value(card); + return 7-get.value(card); }, discard:false, content:function(){ @@ -7225,7 +7225,7 @@ character.swd={ check:function(card){ if(card.name=='du') return 20; if(get.owner(card).countCards('h')8; + return get.color(card)=='red'&&get.value(card)>8; })){ return 0; } @@ -7366,14 +7366,14 @@ character.swd={ var num=game.countPlayer(function(current){ if(current.isLinked()){ if(trigger.nature){ - return get.sgn(ai.get.damageEffect(current,player,player,'fire')); + return get.sgn(get.damageEffect(current,player,player,'fire')); } else{ if(current==trigger.player){ - return get.sgn(ai.get.damageEffect(current,player,player,'fire')); + return get.sgn(get.damageEffect(current,player,player,'fire')); } else{ - return 2*get.sgn(ai.get.damageEffect(current,player,player,'fire')); + return 2*get.sgn(get.damageEffect(current,player,player,'fire')); } } } @@ -7381,7 +7381,7 @@ character.swd={ next.ai=function(card){ if(trigger.player.hasSkillTag('nofire')) return 0; if(num>0){ - return 9-ai.get.value(card); + return 9-get.value(card); } return 0; }; @@ -7410,8 +7410,8 @@ character.swd={ }); next.logSkill=['ningshuang',trigger.player]; next.ai=function(card){ - if(ai.get.attitude(player,trigger.player)<0){ - return 9-ai.get.value(card); + if(get.attitude(player,trigger.player)<0){ + return 9-get.value(card); } return 0; }; @@ -7432,7 +7432,7 @@ character.swd={ ai:{ effect:{ target:function(card,player,target){ - if(get.color(card)=='black'&&ai.get.attitude(target,player)<0&&target.countCards('h')>0){ + if(get.color(card)=='black'&&get.attitude(target,player)<0&&target.countCards('h')>0){ return [1,0.1,0,-target.countCards('h')/4]; } } @@ -7452,7 +7452,7 @@ character.swd={ }, selectCard:3, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ "step 0" @@ -7461,12 +7461,12 @@ character.swd={ var number=Math.floor(Math.random()*13)+1; for(var i in lib.card){ if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; - if(ai.get.value({name:i})>=10) continue; + if(get.value({name:i})>=10) continue; if(i!='list') list.push([suit,number,i]); } var dialog=ui.create.dialog([list,'vcard']); player.chooseButton(dialog,2,true,function(button){ - return ai.get.value({name:button.link[2]},player); + return get.value({name:button.link[2]},player); }); "step 1" var cards=[ui.create.card(),ui.create.card()]; @@ -7501,7 +7501,7 @@ character.swd={ check:function(event,player){ if(player.isDamaged()) return true; return game.countPlayer(function(current){ - if(current.countCards('j')) return get.sgn(ai.get.attitude(player,current)); + if(current.countCards('j')) return get.sgn(get.attitude(player,current)); })>0; }, content:function(){ @@ -7586,7 +7586,7 @@ character.swd={ player.chooseTarget('选择至多'+num+'名角色各摸一张牌',[1,num],function(card,player,target){ return true; }).ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } "step 3" if(result.bool){ @@ -7648,7 +7648,7 @@ character.swd={ order:1, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player,target,'fire'); + var eff=get.damageEffect(target,player,target,'fire'); if(eff>=0) return eff+1; var judges=target.getCards('j'); if(!judges.length) return 0; @@ -7669,7 +7669,7 @@ character.swd={ }, content:function(){ "step 0" - var effect=ai.get.effect(player,trigger.card,trigger.player,player); + var effect=get.effect(player,trigger.card,trigger.player,player); player.judge(function(card){ switch(get.suit(card)){ case 'spade':return -effect; @@ -7713,7 +7713,7 @@ character.swd={ return player!=target; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ "step 0" @@ -7774,7 +7774,7 @@ character.swd={ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); return result*attitude; }); "step 1" @@ -7809,7 +7809,7 @@ character.swd={ logTarget:'player', check:function(event,player){ if(player.hp==1&&event.player.hp>1) return true; - var eff=ai.get.damageEffect(event.player,player,player); + var eff=get.damageEffect(event.player,player,player); if(player.hp==player.maxHp) return eff<0; return eff<=0; }, @@ -7841,7 +7841,7 @@ character.swd={ }); var num=0; for(var i=0;i0){ num++; } @@ -7884,7 +7884,7 @@ character.swd={ return player!=target; }, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ "step 0" @@ -7900,7 +7900,7 @@ character.swd={ expose:0.3, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player)-(target.maxHp-target.hp)/2; + return get.damageEffect(target,player)-(target.maxHp-target.hp)/2; } }, order:5 @@ -7942,11 +7942,11 @@ character.swd={ ai:{ order:function(){ if(_status.event.player.countCards('h')==1) return 10; - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } }, threaten:function(player,target){ @@ -8066,8 +8066,8 @@ character.swd={ content:function(){ "step 0" player.chooseToDiscard('是否弃置一张牌使伤害+1?','he').ai=function(card){ - if(ai.get.attitude(player,trigger.player)<0){ - return 7-ai.get.value(card); + if(get.attitude(player,trigger.player)<0){ + return 7-get.value(card); } } "step 1" @@ -8331,7 +8331,7 @@ character.swd={ return !player.hasSkill('yueren2'); }, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, logTarget:'target', content:function(){ @@ -8432,15 +8432,15 @@ character.swd={ }, content:function(){ "step 0" - var go=ai.get.attitude(player,trigger.player)>0&& - ai.get.attitude(player,trigger.source)<0&& - ai.get.damageEffect(trigger.player,trigger.source,player)< - ai.get.damageEffect(trigger.source,trigger.player,player); + var go=get.attitude(player,trigger.player)>0&& + get.attitude(player,trigger.source)<0&& + get.damageEffect(trigger.player,trigger.source,player)< + get.damageEffect(trigger.source,trigger.player,player); var next=player.chooseToDiscard('是否将伤害来源('+get.translation(trigger.source)+ ')和目标('+get.translation(trigger.player)+')对调?','he'); next.ai=function(card){ if(go){ - return 10-ai.get.value(card); + return 10-get.value(card); } return 0; }; @@ -8471,7 +8471,7 @@ character.swd={ return current.hasSkill('yinguo'); }); if(source&&source.countCards('he')){ - if(ai.get.attitude(source,player)<0&&ai.get.attitude(source,target)>0){ + if(get.attitude(source,player)<0&&get.attitude(source,target)>0){ return [0,0,0,-1]; } } @@ -8582,7 +8582,7 @@ character.swd={ "step 2" if(event.target.countCards('h')){ event.target.chooseCard('选择一张手牌交给'+get.translation(player),true).ai=function(card){ - return -ai.get.value(card); + return -get.value(card); } } else{ @@ -8602,8 +8602,8 @@ character.swd={ var num=0,players=game.filterPlayer(); for(var i=0;i=0&& - ai.get.attitude(players[i],player)>=0){ + if(get.attitude(player,players[i])>=0&& + get.attitude(players[i],player)>=0){ num++; } else{ @@ -8856,7 +8856,7 @@ character.swd={ result:{ target:function(player,target){ if(target.hp1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } if(player.countCards('h')0){ return att+5; @@ -8971,11 +8971,11 @@ character.swd={ selectTarget:[1,2], ai1:function(card){ if(!check) return 0; - return 8-ai.get.value(card); + return 8-get.value(card); }, ai2:function(target){ if(!check) return 0; - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); } }); "step 1" @@ -8997,7 +8997,7 @@ character.swd={ player.chooseTarget(function(card,player,target){ return player.canUse('sha',target); },get.prompt('lxianglong')).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); } "step 1" if(result.bool){ @@ -9022,7 +9022,7 @@ character.swd={ return !target.hasSkill('zhenjiu2'); }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, discard:false, prepare:'give', @@ -9067,7 +9067,7 @@ character.swd={ var dis=trigger.target.countCards('h','shan')||trigger.target.getEquip('bagua')||trigger.target.countCards('h')>2; var next=player.chooseToDiscard(get.prompt('shoulie',trigger.target)); next.ai=function(card){ - if(dis) return 7-ai.get.value(card); + if(dis) return 7-get.value(card); return 0; } next.logSkill='shoulie'; @@ -9099,7 +9099,7 @@ character.swd={ }, filterCard:{suit:'spade'}, check:function(card){ - return 10-ai.get.value(card); + return 10-get.value(card); }, position:'he', line:'fire', @@ -9123,7 +9123,7 @@ character.swd={ ai:{ result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'fire'); + return get.damageEffect(target,player,target,'fire'); } }, order:10, @@ -9144,7 +9144,7 @@ character.swd={ target:function(card,player,target){ if(player!=target) return; if(get.subtype(card)=='equip5'){ - if(ai.get.equipValue(card)<=7) return 0; + if(get.equipValue(card)<=7) return 0; } } }, @@ -9169,19 +9169,19 @@ character.swd={ viewAs:{name:'sha'}, prompt:'将一张闪当杀使用或打出', check:function(card){ - if(get.subtype(card)=='equip1') return 10-ai.get.value(card); - return 7-ai.get.equipValue(card); + if(get.subtype(card)=='equip1') return 10-get.value(card); + return 7-get.equipValue(card); }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, effect:{ target:function(card,player){ if(get.subtype(card)=='equip1'){ var num=0,players=game.filterPlayer(); for(var i=0;i1) return [0,0,0,0]; } diff --git a/character/xiake.js b/character/xiake.js index ef1a5be16..ba65ae52c 100644 --- a/character/xiake.js +++ b/character/xiake.js @@ -12,8 +12,8 @@ character.xiake={ trigger:{source:'damageBegin'}, logTarget:'player', check:function(event,player){ - if(ai.get.damageEffect(event.player,player,player)>0&& - ai.get.attitude(player,event.player)<0){ + if(get.damageEffect(event.player,player,player)>0&& + get.attitude(player,event.player)<0){ return player.hp>event.player.hp&&player.hp>=2; } return false; @@ -39,11 +39,11 @@ character.xiake={ discard:false, delay:0.5, check:function(card,player){ - var val=ai.get.equipValue(card); + var val=get.equipValue(card); var player=_status.event.player; var cards=player.getCards('h',{subtype:get.subtype(card)}); for(var i=0;i=val){ + if(get.equipValue(cards[i])>=val){ return 1; } } diff --git a/character/xianjian.js b/character/xianjian.js index 215f37c98..9b993e0b6 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -99,7 +99,7 @@ character.xianjian={ check:function(event,player){ if(player.hp==1&&player.hujia==0) return false; var num=game.countPlayer(function(current){ - var eff=get.sgn(ai.get.damageEffect(current,player,player,'fire')); + var eff=get.sgn(get.damageEffect(current,player,player,'fire')); if(current.hp==1&¤t.hujia==0) eff*=1.5; return eff; }); @@ -129,8 +129,8 @@ character.xianjian={ }, filterCard:{color:'red'}, check:function(card){ - if(get.suit(card)=='heart') return 7-ai.get.value(card); - return 5-ai.get.value(card); + if(get.suit(card)=='heart') return 7-get.value(card); + return 5-get.value(card); }, onuse:function(result){ if(result.targets){ @@ -142,7 +142,7 @@ character.xianjian={ group:'yanzhan2', ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.15; + return get.order({name:'sha'})+0.15; }, }, }, @@ -197,7 +197,7 @@ character.xianjian={ return player.countCards('he',{color:'red'})>0; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ var targets=player.getEnemies(); @@ -243,7 +243,7 @@ character.xianjian={ trigger.target.chooseTarget(function(card,player,target){ return target!=player&&target!=_status.event.parent.player&&target.countCards('he')>0; },'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }; } else{ @@ -367,7 +367,7 @@ character.xianjian={ return event.target.countCards('h')>player.countCards('h'); }, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, logTarget:'target', content:function(){ @@ -407,7 +407,7 @@ character.xianjian={ return type=='basic'||type=='equip'||type=='trick'; }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filter:function(event,player){ return player.countCards('h')>0; @@ -465,7 +465,7 @@ character.xianjian={ player.storage.danqing.length=0; player.updateMarks(); player.chooseTarget(get.prompt('danqing'),[1,get.is.altered('danqing')?2:4]).ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } 'step 1' if(result.bool){ @@ -520,7 +520,7 @@ character.xianjian={ player.chooseTarget('令一名角色摸一张牌',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0){ return att+1/Math.sqrt(1+target.countCards('h')); } @@ -538,7 +538,7 @@ character.xianjian={ player.chooseTarget('令一名角色获得一点护甲',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0){ return att+1/Math.sqrt(1+target.hp); } @@ -562,7 +562,7 @@ character.xianjian={ player.chooseTarget('令一名角色装备一件随机装备',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0&&!target.getEquip(5)){ return att; } @@ -594,7 +594,7 @@ character.xianjian={ player.chooseTarget('令一名角色获得潜行',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0){ return att+1/Math.sqrt(1+target.hp); } @@ -649,11 +649,11 @@ character.xianjian={ }, check:function(event,player){ if(player.isUnseen()) return false; - if(ai.get.attitude(player,event.player)>=0) return false; + if(get.attitude(player,event.player)>=0) return false; var hs=player.getCards('h'); if(hs.length=10&&val<=6) return true; if(hs[i].number>=8&&val<=3) return true; } @@ -712,7 +712,7 @@ character.xianjian={ usable:1, content:function(){ "step 0" - var goon=(ai.get.damageEffect(player,trigger.player,player)<=0); + var goon=(get.damageEffect(player,trigger.player,player)<=0); player.chooseCard(get.prompt('zhangmu'),{name:'shan'}).ai=function(){ return goon?1:0; } @@ -775,7 +775,7 @@ character.xianjian={ var num2=0; for(var i=0;i0){ num2++; @@ -787,7 +787,7 @@ character.xianjian={ var next=player.chooseToDiscard(get.prompt('leiyu',player.storage.leiyu),{color:'black'}); next.ai=function(card){ if(num>0&&num2>=2){ - return 7-ai.get.value(card); + return 7-get.value(card); } return 0; }; @@ -873,7 +873,7 @@ character.xianjian={ }); for(var i=0;i0; @@ -924,7 +924,7 @@ character.xianjian={ return player.countCards('h',{color:'black'}); }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ target.addSkill('guijiang2'); @@ -1042,7 +1042,7 @@ character.xianjian={ player.chooseTarget('灵愈:令一名其他角色回复一点体力',function(card,player,target){ return target!=player&&target.hp0; + return get.attitude(player,event.player)>0; }, logTarget:'player', content:function(){ @@ -1224,9 +1224,9 @@ character.xianjian={ var players=game.filterPlayer(); for(var i=0;i0){ + get.effect(players[i],{name:'sha'},player)>0){ num++; - if(num>1) return 8-ai.get.value(card); + if(num>1) return 8-get.value(card); } } return 0; @@ -1238,7 +1238,7 @@ character.xianjian={ }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, effect:{ player:function(card,player){ @@ -1249,7 +1249,7 @@ character.xianjian={ var players=game.filterPlayer(); for(var i=0;i1) return [0,0,0,0]; } @@ -1284,8 +1284,8 @@ character.xianjian={ return target!=player&&!target.hasSkill('ctianfu2'); }, check:function(card){ - if(_status.event.player.hp>=3) return 8-ai.get.value(card); - return 7-ai.get.value(card); + if(_status.event.player.hp>=3) return 8-get.value(card); + return 7-get.value(card); }, content:function(){ target.storage.ctianfu2=cards[0]; @@ -1297,9 +1297,9 @@ character.xianjian={ order:2, result:{ target:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>=0) return 0; - return ai.get.damageEffect(target,player,target,'thunder'); + return get.damageEffect(target,player,target,'thunder'); } }, expose:0.2 @@ -1381,7 +1381,7 @@ character.xianjian={ player.chooseCard(get.prompt('shuiyun'),function(card){ return !types.contains(get.type(card,'trick')); }).ai=function(card){ - return 11-ai.get.value(card); + return 11-get.value(card); }; "step 1" if(result.bool){ @@ -1442,7 +1442,7 @@ character.xianjian={ content:function(){ "step 0" player.chooseCardButton(player.storage.shuiyun,get.prompt('shuiyun',trigger.player)).ai=function(button){ - return ai.get.attitude(player,trigger.player)>2?1:0; + return get.attitude(player,trigger.player)>2?1:0; } "step 1" if(result.bool){ @@ -1490,7 +1490,7 @@ character.xianjian={ var players=game.filterPlayer(); for(var i=0;i0) num++; else if(att<0) num--; targets.push(players[i]); @@ -1502,9 +1502,9 @@ character.xianjian={ next.ai=function(card){ if(num<=0) return 0; switch(num){ - case 1:return 5-ai.get.value(card); - case 2:return 7-ai.get.value(card); - default:return 8-ai.get.value(card); + case 1:return 5-get.value(card); + case 2:return 7-get.value(card); + default:return 8-get.value(card); } } "step 1" @@ -1546,7 +1546,7 @@ character.xianjian={ player.chooseTarget(get.prompt('changnian'),function(card,player,target){ return player!=target; }).ai=function(target){ - return ai.get.attitude(player,target); + return get.attitude(player,target); }; "step 1" if(result.bool){ @@ -1597,9 +1597,9 @@ character.xianjian={ check:function(card){ var player=_status.currentPhase; if(player.countCards('h')>player.hp){ - return 7-ai.get.value(card); + return 7-get.value(card); } - return 4-ai.get.value(card); + return 4-get.value(card); }, content:function(){ "step 0" @@ -1616,7 +1616,7 @@ character.xianjian={ order:3, result:{ target:function(player,target){ - return ai.get.recoverEffect(target); + return get.recoverEffect(target); } }, threaten:1.5 @@ -1672,7 +1672,7 @@ character.xianjian={ player.chooseTarget(get.prompt('duci'),function(card,player,target){ return player!=target&&get.distance(player,target)<=1; }).ai=function(target){ - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }; "step 1" if(result.bool){ @@ -1689,7 +1689,7 @@ character.xianjian={ var players=game.filterPlayer(); for(var i=0;i0){ + get.damageEffect(players[i],player,player)>0){ return [1,3]; } } @@ -1793,7 +1793,7 @@ character.xianjian={ player.chooseTarget([1,trigger.cards.length],get.prompt('qijian'),function(card,player,target){ return player.canUse({name:'sha'},target,false); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},player); + return get.effect(target,{name:'sha'},player); }; "step 1" if(result.bool){ @@ -1809,11 +1809,11 @@ character.xianjian={ return event.player.hp<=0&&player.countCards('h',{color:'red'}); }, check:function(event,player){ - if(ai.get.attitude(player,event.player)<=0) return false; + if(get.attitude(player,event.player)<=0) return false; var cards=player.getCards('h',{color:'red'}); for(var i=0;i7&&cards.length>2) return false; + if(get.value(cards[i])>7&&cards.length>2) return false; } }, content:function(){ @@ -1848,7 +1848,7 @@ character.xianjian={ for(var i=0;i=0){ switch(num){ - case 1:return 8-ai.get.value(card); - case 2:return 6-ai.get.value(card); - case 3:return 4-ai.get.value(card); + case 1:return 8-get.value(card); + case 2:return 6-get.value(card); + case 3:return 4-get.value(card); } } return -1; @@ -1965,7 +1965,7 @@ character.xianjian={ usable:1, locked:false, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, multitarget:true, multiline:true, @@ -2081,7 +2081,7 @@ character.xianjian={ return !player.storage.guanri&&player.countCards('h',{color:'red'})>=2; }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterCard:function(card){ return get.color(card)=='red'; @@ -2109,7 +2109,7 @@ character.xianjian={ order:1, result:{ target:function(player,target){ - var eff=ai.get.damageEffect(target,player,target,'fire'); + var eff=get.damageEffect(target,player,target,'fire'); if(player.hp>2) return eff; if(player.hp==2&&target.hp==2) return eff; return 0; @@ -2165,7 +2165,7 @@ character.xianjian={ player.chooseTarget(get.prompt('runxin'),function(card,player,target){ return target.hp0){ if(noneed&&player==target){ num=0.5; @@ -2203,7 +2203,7 @@ character.xianjian={ player.chooseTarget(get.prompt('zhimeng'),function(card,player,target){ return player!=target; }).ai=function(target){ - var num=ai.get.attitude(player,target); + var num=get.attitude(player,target); if(num>0){ if(player==target){ num++; @@ -2308,12 +2308,12 @@ character.xianjian={ check:function(card){ var player=_status.currentPhase; if(player.countCards('h',{subtype:get.subtype(card)})>1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } if(player.countCards('h')3&&(event.player==player.next||event.player==player.previous); }, check:function(event,player){ - return ai.get.effect(player,event.card,event.player,player)<0 + return get.effect(player,event.card,event.player,player)<0 }, changeSeat:true, trigger:{target:'useCardToBefore'}, @@ -2380,7 +2380,7 @@ character.xianjian={ }, filterCard:true, check:function(card){ - return 4-ai.get.value(card); + return 4-get.value(card); }, content:function(){ while(player.next!=target){ @@ -2391,9 +2391,9 @@ character.xianjian={ order:5, result:{ player:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target==player.previous&&att>0) return 1; - if(target==player.next.next&&ai.get.attitude(player,player.next)<0) return 1; + if(target==player.next.next&&get.attitude(player,player.next)<0) return 1; return 0; } } diff --git a/character/yijiang.js b/character/yijiang.js index 6b237aafe..335dae391 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -227,7 +227,7 @@ character.yijiang={ content:function(){ 'step 0' var goon=true; - if(ai.get.attitude(player,trigger.player)>=-0.8) goon=false; + if(get.attitude(player,trigger.player)>=-0.8) goon=false; else if(trigger.player.countCards('h')<=3) goon=false; else if(player.countCards('h','shan')==0) goon=false; var es=player.getCards('e'); @@ -242,7 +242,7 @@ character.yijiang={ if(_status.event.color=='all') return true; return get.color(card)==_status.event.color; }).set('ai',function(card){ - if(_status.event.goon) return 6-ai.get.value(card); + if(_status.event.goon) return 6-get.value(card); return 0; }).set('goon',goon).set('color',color).set('logSkill',['xinsidi',trigger.player]); 'step 1' @@ -357,7 +357,7 @@ character.yijiang={ } if(button.link=='shunshou'){ for(var i=0;i0){ + if(get.effect(player,{name:'jiu'})>0){ return 1+Math.random(); } return 0; @@ -376,7 +376,7 @@ character.yijiang={ var eff=0; for(var i=0;i0){ @@ -411,7 +411,7 @@ character.yijiang={ if(players[i].ai.shown==0){ allshown=false; } - if(players[i]!=player&&players[i].countCards('h')&&ai.get.attitude(player,players[i])>0){ + if(players[i]!=player&&players[i].countCards('h')&&get.attitude(player,players[i])>0){ return 1; } } @@ -436,8 +436,8 @@ character.yijiang={ return target!=player; },'滔乱

令一名其他角色选择一项:1.交给你一张与你以此法使用的牌类别相同的牌;2.你失去1点体力').set('ai',function(target){ var player=_status.event.player; - if(ai.get.attitude(player,target)>0){ - if(ai.get.attitude(target,player)>0){ + if(get.attitude(player,target)>0){ + if(get.attitude(target,player)>0){ return target.countCards('h'); } return target.countCards('h')/2; @@ -453,10 +453,10 @@ character.yijiang={ return get.type(card,'trick')==_status.event.cardType; }).set('cardType',type).set('ai',function(card){ if(_status.event.att){ - return 11-ai.get.value(card); + return 11-get.value(card); } return 0; - }).set('att',ai.get.attitude(target,player)>0); + }).set('att',get.attitude(target,player)>0); 'step 2' var target=event.target; if(result.bool){ @@ -481,7 +481,7 @@ character.yijiang={ check:function(event,player){ var allshown=true,players=game.filterPlayer(); for(var i=0;i1&&ai.get.attitude(player,players[i])>0){ + if(players[i]!=player&&players[i].countCards('h')>1&&get.attitude(player,players[i])>0){ return 1; } } @@ -573,7 +573,7 @@ character.yijiang={ player.chooseTarget(get.prompt('jishe'),[1,Math.min(num,player.hp)],function(card,player,target){ return !target.isLinked(); }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -616,7 +616,7 @@ character.yijiang={ }, content:function(){ 'step 0' - var att=(ai.get.attitude(player,trigger.source)>0); + var att=(get.attitude(player,trigger.source)>0); var goon=false; if(player.hp==1){ goon=true; @@ -625,7 +625,7 @@ character.yijiang={ var he=player.getCards('he'); var num=0; for(var i=0;i=2){ goon=true;break; @@ -635,10 +635,10 @@ character.yijiang={ } player.chooseCard('he',[1,player.countCards('he')],get.prompt('huisheng',trigger.source)).set('ai',function(card){ if(_status.event.att){ - return 10-ai.get.value(card); + return 10-get.value(card); } if(_status.event.goon){ - return 8-ai.get.value(card); + return 8-get.value(card); } return 0; }).set('goon',goon).set('att',att); @@ -647,7 +647,7 @@ character.yijiang={ player.logSkill('huisheng'); event.num=result.cards.length; var goon=false; - if(event.num>2||ai.get.attitude(trigger.source,player)>=0){ + if(event.num>2||get.attitude(trigger.source,player)>=0){ goon=true; } var forced=false; @@ -664,9 +664,9 @@ character.yijiang={ trigger.source.storage.huisheng.push(player); trigger.source.chooseButton([str,result.cards],forced).set('ai',function(button){ if(_status.event.goon){ - return ai.get.value(button.link); + return get.value(button.link); } - return ai.get.value(button.link)-8; + return get.value(button.link)-8; }).set('goon',goon); } else{ @@ -714,7 +714,7 @@ character.yijiang={ }).set('ai',function(target){ var player=_status.event.player; var zhu=_status.event.zhu; - if(ai.get.attitude(player,target)>0) return 0; + if(get.attitude(player,target)>0) return 0; var nh=target.countCards('h'); var nh2=zhu.countCards('h'); if(nh>nh2) return 2; @@ -782,22 +782,22 @@ character.yijiang={ content:function(){ 'step 0' var spade=true; - if(player.isTurnedOver()||ai.get.attitude(target,player)>0||target.hp<=2){ + if(player.isTurnedOver()||get.attitude(target,player)>0||target.hp<=2){ spade=false; } target.chooseToDiscard('h',true).set('ai',function(card){ if(get.suit(card)=='spade'){ if(_status.event.spade){ - return 10-ai.get.value(card); + return 10-get.value(card); } else{ - return -10-ai.get.value(card); + return -10-get.value(card); } } if(_status.event.getParent().player.storage.jiyu2.contains(get.suit(card))){ - return -3-ai.get.value(card); + return -3-get.value(card); } - return -ai.get.value(card); + return -get.value(card); }).set('spade',spade); 'step 1' var card=result.cards[0]; @@ -839,7 +839,7 @@ character.yijiang={ usable:1, audio:2, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterCard:true, discard:false, @@ -866,7 +866,7 @@ character.yijiang={ player.chooseTarget(true,function(card,player,target){ return _status.event.targets.contains(target); }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }).set('targets',targets); } 'step 2' @@ -891,7 +891,7 @@ character.yijiang={ } } var choice; - if(ai.get.attitude(event.target,player)<=0){ + if(get.attitude(event.target,player)<=0){ choice='shan'; } else{ @@ -912,7 +912,7 @@ character.yijiang={ for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if(players[i].hp<2){ lose--; recover+=0.5; @@ -920,7 +920,7 @@ character.yijiang={ lose--; recover++; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; @@ -930,10 +930,10 @@ character.yijiang={ } } else{ - if(ai.get.attitude(player,players[i])>0){ + if(get.attitude(player,players[i])>0){ lose--; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ lose++; } } @@ -999,7 +999,7 @@ character.yijiang={ return lib.filter.filterTarget({name:player.storage.jiaozhao_card},player,target); }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, ai:{ order:6 @@ -1152,10 +1152,10 @@ character.yijiang={ content:function(){ 'step 0' target.chooseCard('he',[1,3],'匡弼:将1~3张牌置于'+get.translation(player)+'的武将牌上',true).set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.getParent().player)>0){ - return 7-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.getParent().player)>0){ + return 7-get.value(card); } - return -ai.get.value(card); + return -get.value(card); }); 'step 1' if(result.bool){ @@ -1171,7 +1171,7 @@ character.yijiang={ order:1, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)>0){ + if(get.attitude(player,target)>0){ return Math.sqrt(target.countCards('he')); } return 0; @@ -1348,15 +1348,15 @@ character.yijiang={ if(event.targets.length){ var target=event.targets.shift(); event.target=target; - var res=ai.get.damageEffect(target,player,target,'fire'); + var res=get.damageEffect(target,player,target,'fire'); target.chooseToDiscard('he','弃置至少'+get.cnNumber(event.num)+'张牌或受到2点火焰伤害',[num,Infinity]).set('ai',function(card){ if(ui.selected.cards.length>=_status.event.getParent().num) return -1; if(_status.event.player.hasSkillTag('nofire')) return -1; - if(_status.event.res>=0) return 6-ai.get.value(card); + if(_status.event.res>=0) return 6-get.value(card); if(get.type(card)!='basic'){ - return 10-ai.get.value(card); + return 10-get.value(card); } - return 8-ai.get.value(card); + return 8-get.value(card); }).set('res',res); } else{ @@ -1378,8 +1378,8 @@ character.yijiang={ player:function(player){ var num=0,players=game.filterPlayer(); for(var i=0;i0){ num--; } @@ -1419,7 +1419,7 @@ character.yijiang={ return target.countCards('h')==0; }).set('ai',function(target){ var player=_status.event.player; - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }); 'step 1' if(result.bool){ @@ -1441,7 +1441,7 @@ character.yijiang={ discard:false, delay:false, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, content:function(){ 'step 0' @@ -1468,9 +1468,9 @@ character.yijiang={ return true; }).set('ai',function(card){ if(get.type(card,'trick')=='trick'){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return -ai.get.value(card); + return -get.value(card); }).set('selectCard',function(){ if(ui.selected.cards.length==1&&get.type(ui.selected.cards[0],'trick')=='trick'){ return 1; @@ -1504,7 +1504,7 @@ character.yijiang={ qingxi:{ trigger:{source:'damageBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, filter:function(event,player){ return event.card&&event.card.name=='sha'&&player.getEquip(1); @@ -1524,17 +1524,17 @@ character.yijiang={ var player=_status.event.player; if(player.hp==1){ if(get.type(card)=='basic'){ - return 8-ai.get.value(card); + return 8-get.value(card); } else{ - return 10-ai.get.value(card); + return 10-get.value(card); } } else{ if(num>2){ return 0; } - return 8-ai.get.value(card); + return 8-get.value(card); } }); } @@ -1565,10 +1565,10 @@ character.yijiang={ }, filterCard:lib.filter.cardDiscardable, ai1:function(card){ - return 7-ai.get.useful(card); + return 7-get.useful(card); }, ai2:function(target){ - return 1-ai.get.attitude(_status.event.player,target); + return 1-get.attitude(_status.event.player,target); }, prompt:get.prompt('jieyue') }); @@ -1581,15 +1581,15 @@ character.yijiang={ target.chooseCard('将一张牌置于'+get.translation(player)+'的武将牌上,或令其弃置你的一张牌','he').set('ai',function(card){ if(card.name=='du') return 20; var player=_status.event.player; - if(ai.get.attitude(player,_status.event.getParent().player)>0){ - return 8-ai.get.value(card); + if(get.attitude(player,_status.event.getParent().player)>0){ + return 8-get.value(card); } var nh=player.countCards('h'); if(nh<=2){ - return 6-ai.get.value(card); + return 6-get.value(card); } if(nh<=3){ - return 2-ai.get.value(card); + return 2-get.value(card); } return 0; }); @@ -1628,7 +1628,7 @@ character.yijiang={ }, viewAs:{name:'wuxie'}, prompt:'将一张黑色手牌当无懈可击使用', - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, threaten:1.2, group:['jieyue3','jieyue4'] }, @@ -1729,11 +1729,11 @@ character.yijiang={ return 1; } for(var i=0;i11&&ai.get.value(cards[i])<7){ + if(cards[i].name!='sha'&&cards[i].number>11&&get.value(cards[i])<7){ return 9; } } - return ai.get.order({name:'sha'})-1; + return get.order({name:'sha'})-1; }, result:{ player:function(player){ @@ -1866,7 +1866,7 @@ character.yijiang={ direct:true, content:function(){ "step 0" - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); player.chooseCardButton(get.prompt('chunlao',trigger.player),player.storage.chunlao).set('ai',function(button){ if(_status.event.att>0) return 1; return 0; @@ -1924,7 +1924,7 @@ character.yijiang={ return player.canUse({name:'bingliang'},target,false); }).set('ai',function(target){ var player=_status.event.player; - return ai.get.effect(target,{name:'bingliang'},player,player); + return get.effect(target,{name:'bingliang'},player,player); }); } else{ @@ -1969,9 +1969,9 @@ character.yijiang={ }, content:function(){ 'step 0' - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); var nh=trigger.player.countCards('h'); - var eff=ai.get.effect(trigger.player,{name:'sha'},player,player); + var eff=get.effect(trigger.player,{name:'sha'},player,player); player.chooseCardButton(get.prompt('yonglve',trigger.player),trigger.player.getCards('j')).set('ai',function(button){ var name=button.link.viewAs||button.link.name; var att=_status.event.att; @@ -2078,13 +2078,13 @@ character.yijiang={ return true; }, check:function(event,player){ - if(ai.get.attitude(player,event.player)>=0) return false; + if(get.attitude(player,event.player)>=0) return false; if(event.player.getEquip('zhuge')) return false; if(event.player.hasSkill('paoxiao')) return false; var players=game.filterPlayer(); for(var i=0;i0) break; + get.attitude(player,players[i])>0) break; } if(i==players.length) return false; var nh=event.player.countCards('h'); @@ -2158,7 +2158,7 @@ character.yijiang={ player.chooseTarget('忠勇:将'+get.translation(trigger.responded.cards)+'交给一名角色',function(card,player,target){ return target!=_status.event.getTrigger().target; }).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(target.countCards('h','shan')&&target.countCards('h')>=2){ att/=1.5; } @@ -2210,7 +2210,7 @@ character.yijiang={ player.chooseTarget('忠勇:将杀或闪交给一名其他角色',function(card,player,target){ return target!=_status.event.getTrigger().target&&target!=player; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -2270,7 +2270,7 @@ character.yijiang={ content:function(){ 'step 0' var go=false; - if(ai.get.attitude(player,trigger.player)>0){ + if(get.attitude(player,trigger.player)>0){ if(get.color(trigger.card)=='red'){ go=true; } @@ -2308,7 +2308,7 @@ character.yijiang={ next.logSkill=['longyin',trigger.player]; next.set('ai',function(card){ if(_status.event.go){ - return 6-ai.get.value(card); + return 6-get.value(card); } return 0; }); @@ -2360,12 +2360,12 @@ character.yijiang={ return true; }, check:function(event,player){ - if(ai.get.attitude(player,_status.currentPhase)>0) return true; + if(get.attitude(player,_status.currentPhase)>0) return true; var nh=_status.currentPhase.countCards('h')+1; var players=game.filterPlayer(); for(var i=0;inh){ - if(!player.hasShan()||ai.get.attitude(player,players[i])<=0) return true; + if(!player.hasShan()||get.attitude(player,players[i])<=0) return true; } } return false; @@ -2397,7 +2397,7 @@ character.yijiang={ player.chooseTarget('选择一名角色弃置其一张牌',true,function(card,player,target){ return _status.event.targets.contains(target); }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }).set('targets',targets); } else{ @@ -2466,7 +2466,7 @@ character.yijiang={ player.chooseTarget([1,event.num],function(card,player,target){ return target!=player&&target.countCards('he')>0; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target)+0.5; + return -get.attitude(_status.event.player,target)+0.5; }); 'step 4' if(result.bool&&result.targets){ @@ -2516,7 +2516,7 @@ character.yijiang={ player.chooseTarget(get.prompt('yaoming'),function(card,player,target){ return _status.event.nh!=target.countCards('h'); }).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(target.countCards('h')>_status.event.nh) return -att; return att; }).set('nh',nh); @@ -2615,7 +2615,7 @@ character.yijiang={ num=player.maxHp; } player.chooseTarget([1,num],get.prompt('xingxue')).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(target.countCards('he')) return att; return att/10; }); @@ -3003,14 +3003,14 @@ character.yijiang={ var players=game.filterPlayer(); for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){ + if(players[i].group=='shu'&&get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){ yep=true;break; } } } var next=player.chooseToDiscard(get.prompt('qinwang'),'he'); next.set('ai',function(card){ - if(_status.event.yep) return 5-ai.get.value(card); + if(_status.event.yep) return 5-get.value(card); return 0; }); next.set('yep',yep); @@ -3029,7 +3029,7 @@ character.yijiang={ var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'}); next.set('ai',function(){ var event=_status.event; - return (ai.get.attitude(event.player,event.source)-2); + return (get.attitude(event.player,event.source)-2); }); next.set('source',player); next.autochoose=lib.filter.autoRespondSha; @@ -3074,8 +3074,8 @@ character.yijiang={ var player=_status.event.player,players=game.filterPlayer(); for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){ - return 5-ai.get.value(card); + if(players[i].group=='shu'&&get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){ + return 5-get.value(card); } } return 0; @@ -3104,7 +3104,7 @@ character.yijiang={ }); next.set('ai',function(card){ var event=_status.event; - return ai.get.effect(event.target,card,event.source,event.player); + return get.effect(event.target,card,event.source,event.player); }); next.set('source',player); next.set('target',target); @@ -3138,11 +3138,11 @@ character.yijiang={ result:{ target:function(player,target){ if(player.hasSkill('jijiang3')) return 0; - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } }, order:function(){ - return ai.get.order({name:'sha'})-0.1; + return get.order({name:'sha'})-0.1; }, } }, @@ -3159,7 +3159,7 @@ character.yijiang={ player.chooseTarget(get.prompt('zuoding'),function(card,player,target){ return _status.event.getTrigger().targets.contains(target); }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }); 'step 1' if(result.bool){ @@ -3206,9 +3206,9 @@ character.yijiang={ return get.type(card)!='basic'&&get.color(card)=='black'; }).set('ai',function(card){ if(!_status.event.player.countCards('h','shan')){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }); "step 1" if(result.bool){ @@ -3295,7 +3295,7 @@ character.yijiang={ var player=_status.event.player; var card={name:button.link[2],nature:button.link[3]}; if(game.hasPlayer(function(current){ - return player.canUse(card,current)&&ai.get.effect(current,card,player,player)>0; + return player.canUse(card,current)&&get.effect(current,card,player,player)>0; })){ switch(button.link[2]){ case 'tao':return 5; @@ -3339,7 +3339,7 @@ character.yijiang={ order:function(){ var player=_status.event.player; var event=_status.event; - if(!player.storage.huomo.jiu&&event.filterCard({name:'jiu'},player,event)&&ai.get.effect(player,{name:'jiu'})>0){ + if(!player.storage.huomo.jiu&&event.filterCard({name:'jiu'},player,event)&&get.effect(player,{name:'jiu'})>0){ return 3.1; } return 2.9; @@ -3373,7 +3373,7 @@ character.yijiang={ event.target.countCards('h')>0&&!player.hasSkill('taoxi4')&&player!=event.target; }, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, intro:{ content:'card' @@ -3433,7 +3433,7 @@ character.yijiang={ order:8, result:{ target:function(player,target){ - return ai.get.effect(target,player.storage.taoxi,player,target); + return get.effect(target,player.storage.taoxi,player,target); }, player:1 } @@ -3493,7 +3493,7 @@ character.yijiang={ var current=event.targets.shift(); if(current.group=='wei'){ current.chooseBool('是否令'+get.translation(player)+'回复一点体力?').set('ai',function(){ - return ai.get.attitude(_status.event.player,_status.event.target)>2; + return get.attitude(_status.event.player,_status.event.target)>2; }).set('target',player); event.current=current; } @@ -3549,7 +3549,7 @@ character.yijiang={ if(player.countCards('h')==1&&player.countCards('h','du')) return -1; if(player.hp<=2&&player.countCards('h','shan')) return 0; if(target.countCards('h')+player.countCards('h')>target.hp+2) return 0; - if(ai.get.attitude(player,target)>3) return 1; + if(get.attitude(player,target)>3) return 1; return 0; } } @@ -3582,7 +3582,7 @@ character.yijiang={ player.chooseTarget(get.prompt('mingjian'),function(card,player,target){ return player!=target }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>3){ if(player.countCards('h')>player.hp) return att; if(go) return att; @@ -3630,8 +3630,8 @@ character.yijiang={ 'step 0' player.chooseTarget(get.prompt('huituo')).set('ai',function(target){ var player=_status.event.player; - if(ai.get.attitude(player,target)>0){ - return ai.get.recoverEffect(target,player,player)+1; + if(get.attitude(player,target)>0){ + return get.recoverEffect(target,player,player)+1; } return 0; }); @@ -3676,8 +3676,8 @@ character.yijiang={ var next=player.chooseToDiscard('he',get.prompt('duodao')); next.logSkill=['duodao',trigger.source]; next.set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.getTrigger().source)<=0){ - return 6-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.getTrigger().source)<=0){ + return 6-get.value(card); } return 0; }); @@ -3692,7 +3692,7 @@ character.yijiang={ audio:2, trigger:{source:'damageBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<=0; + return get.attitude(player,event.player)<=0; }, forced:true, filter:function(event,player){ @@ -3771,7 +3771,7 @@ character.yijiang={ return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isAlive(); }, check:function(event,player){ - return ai.get.attitude(player,event.player)>=0; + return get.attitude(player,event.player)>=0; }, priority:-5, logTarget:'player', @@ -3823,7 +3823,7 @@ character.yijiang={ player.chooseTarget(get.prompt('yanyu'),function(card,player,target){ return target.sex=='male'&&target!=player; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }); 'step 1' if(result.bool){ @@ -3846,7 +3846,7 @@ character.yijiang={ }).set('ai',function(target){ if(!_status.event.goon) return 0; if(target.countCards('he')==0) return 0; - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }).set('goon',player.countCards('h','sha')<=player.countCards('h')/3); "step 1" if(result.bool){ @@ -3878,8 +3878,8 @@ character.yijiang={ viewAs:{name:'sha'}, prompt:'将两张手牌当杀使用或打出', check:function(card){ - if(_status.event.player.countCards('h')<4) return 6-ai.get.useful(card); - return 7-ai.get.useful(card); + if(_status.event.player.countCards('h')<4) return 6-get.useful(card); + return 7-get.useful(card); }, ai:{ respondSha:true, @@ -3925,7 +3925,7 @@ character.yijiang={ "step 0" player.storage.fencheng=true; player.awakenSkill('fencheng'); - var res=ai.get.damageEffect(target,player,target,'fire'); + var res=get.damageEffect(target,player,target,'fire'); var num=Math.max(1,target.countCards('e')); target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到1点火焰伤害').set('ai',function(card){ var res=_status.event.res; @@ -3935,9 +3935,9 @@ character.yijiang={ if(num>2&&player.hp>1) return -1; if(num>1&&player.hp>2) return -1; if(get.position(card)=='e'){ - return 10-ai.get.value(card); + return 10-get.value(card); } - return 6-ai.get.value(card); + return 6-get.value(card); }).set('res',res).set('num',num); "step 1" if(!result.bool){ @@ -3950,8 +3950,8 @@ character.yijiang={ player:function(player){ var num=0,players=game.filterPlayer(); for(var i=0;i0){ num-=Math.max(1,players[i].countCards('e')); } @@ -3992,7 +3992,7 @@ character.yijiang={ }).set('ai',function(target){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - return ai.get.effect(target,trigger.card,player,player); + return get.effect(target,trigger.card,player,player); }); "step 1" if(result.bool){ @@ -4012,9 +4012,9 @@ character.yijiang={ }, check:function(card){ if(ui.selected.cards.length) return -1; - var val=ai.get.value(card); - if(get.type(card)=='basic') return 8-ai.get.value(card); - return 5-ai.get.value(card); + var val=get.value(card); + if(get.type(card)=='basic') return 8-get.value(card); + return 5-get.value(card); }, filterTarget:function(card,player,target){ return player!=target; @@ -4029,7 +4029,7 @@ character.yijiang={ return !_status.event.types.contains(get.type(card,'trick')); }).set('ai',function(card){ if(_status.event.player.isTurnedOver()) return -1; - return 8-ai.get.value(card); + return 8-get.value(card); }).set('types',types).set('dialog',['弃置一张与'+get.translation(player)+'弃置的牌类别均不同的牌,或将武将牌翻面','hidden',cards]); "step 1" if(!result.bool){ @@ -4053,7 +4053,7 @@ character.yijiang={ audio:2, trigger:{global:'loseEnd'}, check:function(event,player){ - return ai.get.damageEffect(event.player,player,player)>0; + return get.damageEffect(event.player,player,player)>0; }, filter:function(event,player){ if(event.player.countCards('h')) return false; @@ -4104,7 +4104,7 @@ character.yijiang={ if(event.current.countCards('he')&&target.isAlive()){ event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+ get.translation(target)+'摸一张牌').set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.target)<0) return 7-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.target)<0) return 7-get.value(card); return -1; }).set('target',target); event.tempbool=false; @@ -4192,7 +4192,7 @@ character.yijiang={ player.chooseTarget(function(card,player,target){ return player!=target&&get.distance(player,target)<=1; },true).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }); "step 2" if(result.bool&&result.targets.length){ @@ -4236,8 +4236,8 @@ character.yijiang={ audio:2, trigger:{source:'damageBefore'}, check:function(event,player){ - if(ai.get.damageEffect(event.player,player,player)<0) return true; - var att=ai.get.attitude(player,event.player); + if(get.damageEffect(event.player,player,player)<0) return true; + var att=get.attitude(player,event.player); if(att>0&&event.player.countCards('j')) return true; if(event.num>1){ if(att<0) return false; @@ -4245,7 +4245,7 @@ character.yijiang={ } var cards=event.player.getCards('e'); for(var i=0;i=6) return true; + if(get.equipValue(cards[i])>=6) return true; } return false; }, @@ -4264,7 +4264,7 @@ character.yijiang={ filterTarget:function(card,player,target){ return target.isHighestHp(); }, - check:function(card){return 7-ai.get.value(card);}, + check:function(card){return 7-get.value(card);}, position:'he', filterCard:true, content:function(){ @@ -4273,13 +4273,13 @@ character.yijiang={ ai:{ result:{ target:function(player,target){ - if(target.countCards('j')&&ai.get.attitude(player,target)>0){ + if(target.countCards('j')&&get.attitude(player,target)>0){ return 1; } if(target.countCards('e')){ return -1; } - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); }, }, order:7 @@ -4297,7 +4297,7 @@ character.yijiang={ player.chooseTarget(get.prompt('qiaoshui'),function(card,player,target){ return player!=target&&target.countCards('h')>0; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target)/target.countCards('h'); + return -get.attitude(_status.event.player,target)/target.countCards('h'); }); "step 1" if(result.bool){ @@ -4354,7 +4354,7 @@ character.yijiang={ }).set('ai',function(target){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - return ai.get.effect(target,trigger.card,player,player); + return get.effect(target,trigger.card,player,player); }); } else{ @@ -4381,7 +4381,7 @@ character.yijiang={ return _status.event.getTrigger().targets.contains(target); }).set('ai',function(target){ var trigger=_status.event.getTrigger(); - return -ai.get.effect(target,trigger.card,trigger.player,_status.event.player); + return -get.effect(target,trigger.card,trigger.player,_status.event.player); }); 'step 4' if(result.bool){ @@ -4426,7 +4426,7 @@ character.yijiang={ filterCard:true, selectCard:2, prompt:'弃置两张牌并摸一张牌', - check:function(card){return 4-ai.get.useful(card)}, + check:function(card){return 4-get.useful(card)}, content:function(){ player.draw(); }, @@ -4455,7 +4455,7 @@ character.yijiang={ player.chooseTarget(get.prompt('bingyi'),[1,player.countCards('h')],function(card,player,target){ return true; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -4487,7 +4487,7 @@ character.yijiang={ }, logTarget:'player', check:function(event,player){ - if(ai.get.attitude(player,event.player)<5) return false; + if(get.attitude(player,event.player)<5) return false; if(player.maxHp-player.hp>=2) return false; if(player.hp==1) return false; if(player.hp==2&&player.countCards('h')<2) return false; @@ -4615,7 +4615,7 @@ character.yijiang={ }, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ "step 0" @@ -4651,7 +4651,7 @@ character.yijiang={ return true; }, check:function(event,player){ - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, logTarget:'player', content:function(){ @@ -4676,12 +4676,12 @@ character.yijiang={ next.set('ai',function(card){ var player=_status.event.player; if(player.hp==1||_status.event.getTrigger().num>1){ - return 9-ai.get.value(card); + return 9-get.value(card); } if(player.hp==2){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 7-ai.get.value(card); + return 7-get.value(card); }); next.logSkill='jiaojin'; "step 1" @@ -4713,7 +4713,7 @@ character.yijiang={ }).set('ai',function(target){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - return ai.get.effect(target,trigger.card,player,player)+1; + return get.effect(target,trigger.card,player,player)+1; }); "step 1" if(result.bool){ @@ -4729,7 +4729,7 @@ character.yijiang={ player.logSkill('chanhui',event.target); event.target.chooseCard('交给'+get.translation(player)+'一张手牌,或成为'+ get.translation(trigger.card)+'的额外目标').set('ai',function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); }); "step 3" if(result.bool){ @@ -4904,10 +4904,10 @@ character.yijiang={ }).set('ai',function(target2){ var target=_status.event.player; var player=_status.event.getParent().player; - if(ai.get.attitude(target,player)>0){ + if(get.attitude(target,player)>0){ if(player.hp+event.num<=player.maxHp||player.hp==1) return -1; } - return ai.get.damageEffect(target2,target,target); + return get.damageEffect(target2,target,target); }); "step 2" if(result.bool){ @@ -4936,7 +4936,7 @@ character.yijiang={ player:function(player){ var bool=true,players=game.filterPlayer(); for(var i=0;i2&&ai.get.attitude(players[i],player)>2){ + if(players[i]!=player&&get.attitude(player,players[i])>2&&get.attitude(players[i],player)>2){ bool=false;break; } } @@ -4966,7 +4966,7 @@ character.yijiang={ },'e')){ next=player.chooseControl('移动装备','draw_card','cancel2',function(event,player){ var source=_status.event.source; - var att=ai.get.attitude(player,source); + var att=get.attitude(player,source); if(source.hasSkillTag('noe')){ if(att>0){ return '移动装备'; @@ -5025,11 +5025,11 @@ character.yijiang={ audio:2, trigger:{global:'phaseBegin'}, check:function(event,player){ - if(ai.get.attitude(player,event.player)<-2){ + if(get.attitude(player,event.player)<-2){ var cards=player.getCards('h'); if(cards.length>player.hp) return true; for(var i=0;i9&&useful<7) return true; } @@ -5062,7 +5062,7 @@ character.yijiang={ }).set('ai',function(target){ var trigger=_status.event.getTrigger(); var player=_status.event.player; - return ai.get.effect(target,trigger.card,trigger.player,player)+0.1; + return get.effect(target,trigger.card,trigger.player,player)+0.1; }); "step 1" if(result.bool){ @@ -5071,7 +5071,7 @@ character.yijiang={ event.target=target; target.chooseCard({name:'shan'},'交给'+get.translation(player)+ '一张闪,或成为此杀的额外目标').set('ai',function(card){ - return ai.get.attitude(target,_status.event.source)>=0?1:-1; + return get.attitude(target,_status.event.source)>=0?1:-1; }).set('source',player); game.delay(); } @@ -5098,7 +5098,7 @@ character.yijiang={ for(var i=0;i1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } - return 6-ai.get.equipValue(card); + return 6-get.equipValue(card); }, content:function(){ "step 0" @@ -5130,8 +5130,8 @@ character.yijiang={ return player!=target&&target.countCards('he')>0; }).set('ai',function(target){ var player=_status.event.player; - if(ai.get.attitude(player,target)<0){ - return Math.max(0.5,ai.get.effect(target,{name:'sha'},player,player)); + if(get.attitude(player,target)<0){ + return Math.max(0.5,get.effect(target,{name:'sha'},player,player)); } return 0; }); @@ -5143,7 +5143,7 @@ character.yijiang={ if(result.bool){ player.line(result.targets,'green'); event.target=result.targets[0]; - player.discardPlayerCard(event.target,'he',true).ai=ai.get.buttonValue; + player.discardPlayerCard(event.target,'he',true).ai=get.buttonValue; } }, ai:{ @@ -5169,7 +5169,7 @@ character.yijiang={ player.chooseTarget(get.prompt('zhuiyi'),function(card,player,target){ return player!=target&&_status.event.source!=target; }).set('ai',function(target){ - var num=ai.get.attitude(_status.event.player,target); + var num=get.attitude(_status.event.player,target); if(num>0){ if(target.hp==1){ num+=2; @@ -5239,13 +5239,13 @@ character.yijiang={ result:{ target:function(player,target){ var num=target.countCards('h'); - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(ui.selected.targets.length==0){ if(att>0) return -1; var players=game.filterPlayer(); for(var i=0;i=0&&num20||player.countCards('he',{type:'equip'})>0; }, - check:function(card){return 8-ai.get.value(card)}, + check:function(card){return 8-get.value(card)}, selectTarget:2, multitarget:true, discard:false, @@ -5290,7 +5290,7 @@ character.yijiang={ targets[0].chooseControl('draw_card','出杀',function(){ var player=_status.event.player; var target=_status.event.target; - if(ai.get.effect(_status.event.target,{name:'sha'},player,player)>0){ + if(get.effect(_status.event.target,{name:'sha'},player,player)>0){ return 1; } return 0; @@ -5308,7 +5308,7 @@ character.yijiang={ player:function(player){ var players=game.filterPlayer(); for(var i=0;i1&&ai.get.attitude(players[i],player)>1){ + if(players[i]!=player&&get.attitude(player,players[i])>1&&get.attitude(players[i],player)>1){ return 1; } } @@ -5334,7 +5334,7 @@ character.yijiang={ player.chooseTarget(get.prompt('xinxuanhuo'),function(card,player,target){ return player!=target; }).set('ai',function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(att>0){ if(target.countCards('h')1&&check<2) return 0; - return ai.get.unuseful(card)+9; + return get.unuseful(card)+9; }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length==1&&ui.selected.cards[0].name=='du') return 1-att; return att-2; }, @@ -5548,7 +5548,7 @@ character.yijiang={ }, logTarget:'player', check:function(event,player){ - if(ai.get.attitude(player,event.player)>0){ + if(get.attitude(player,event.player)>0){ return false; } if(get.tag(event.card,'respondSha')){ @@ -5592,7 +5592,7 @@ character.yijiang={ forced:true, priority:15, check:function(event,player){ - return ai.get.effect(event.target,event.card,event.player,player)<0; + return get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ if(!event.target) return false; @@ -5667,10 +5667,10 @@ character.yijiang={ if(get.tag(card,'damage')&&get.type(card)=='trick'){ return 20; } - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(att>0){ if(target.isTurnedOver()) att+=3; if(target.hp==1) att+=3; @@ -5747,9 +5747,9 @@ character.yijiang={ var player=get.owner(card); if(get.type(card)=='trick') return 10; if(player.countCards('h')-player.hp-ui.selected.cards.length>0){ - return 8-ai.get.value(card); + return 8-get.value(card); } - return 4-ai.get.value(card); + return 4-get.value(card); }, filterTarget:function(card,player,target){ return player!=target; @@ -5787,7 +5787,7 @@ character.yijiang={ effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ - if(ai.get.equipValue(card)<=8) return 0; + if(get.equipValue(card)<=8) return 0; } if(target.getEquip(2)) return; if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget'; @@ -5932,7 +5932,7 @@ character.yijiang={ var target; var players=game.filterPlayer(); for(var i=0;inum){ target=targets[i]; num=num2; @@ -6086,7 +6086,7 @@ character.yijiang={ trigger:{source:'damageEnd'}, priority:9, check:function(event,player){ - return ai.get.attitude(player,event.player)<=0; + return get.attitude(player,event.player)<=0; }, content:function(){ "step 0" @@ -6115,7 +6115,7 @@ character.yijiang={ return player.countCards('he')>=num; }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, selectCard:function(card){ var num=_status.event.player.getStat().skill.danshou; @@ -6162,7 +6162,7 @@ character.yijiang={ num=1; } if(num>3) return 0; - if(num==3) return ai.get.damageEffect(target,player,target); + if(num==3) return get.damageEffect(target,player,target); return -1; } } @@ -6192,7 +6192,7 @@ character.yijiang={ for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if(players[i].hp<2){ lose--; recover+=0.5; @@ -6200,7 +6200,7 @@ character.yijiang={ lose--; recover++; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; @@ -6210,10 +6210,10 @@ character.yijiang={ } } else{ - if(ai.get.attitude(player,players[i])>0){ + if(get.attitude(player,players[i])>0){ lose--; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ lose++; } } @@ -6244,7 +6244,7 @@ character.yijiang={ var cards=player.getCards('h'); if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i2) return true; @@ -6438,11 +6438,11 @@ character.yijiang={ event.num=trigger.num; "step 1" trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌或流失一点体力').set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.getParent().player)>0){ - return 11-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.getParent().player)>0){ + return 11-get.value(card); } else{ - return 7-ai.get.value(card); + return 7-get.value(card); } }); "step 2" @@ -6476,7 +6476,7 @@ character.yijiang={ }, logTarget:'source', check:function(event,player){ - return ai.get.attitude(player,event.source)>0; + return get.attitude(player,event.source)>0; }, content:function(){ trigger.source.draw(); @@ -6518,11 +6518,11 @@ character.yijiang={ trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){ return get.suit(card)=='heart'; }).set('ai',function(card){ - if(ai.get.attitude(_status.event.player,_status.event.getParent().player)>0){ - return 11-ai.get.value(card); + if(get.attitude(_status.event.player,_status.event.getParent().player)>0){ + return 11-get.value(card); } else{ - return 7-ai.get.value(card); + return 7-get.value(card); } }); "step 1" @@ -6555,10 +6555,10 @@ character.yijiang={ var player=get.owner(card); var players=game.filterPlayer(); for(var i=0;i3) break; + if(players[i]!=player&&get.attitude(player,players[i])>3) break; } if(i==players.length) return -1; - return 5-ai.get.value(card); + return 5-get.value(card); }, content:function(){ "step 0" @@ -6572,7 +6572,7 @@ character.yijiang={ player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){ return target!=_status.event.source&&target!=player; }).set('ai',function(target){ - return ai.get.attitude(_status.event.player,target); + return get.attitude(_status.event.player,target); }).set('source',target); "step 3" if(result.bool){ @@ -6629,8 +6629,8 @@ character.yijiang={ var num=player.maxHp-player.hp; var players=game.filterPlayer(); for(var i=0;i0) list1.push(players[i]); - else if(ai.get.attitude(player,players[i])<0) list2.push(players[i]); + if(get.attitude(player,players[i])>0) list1.push(players[i]); + else if(get.attitude(player,players[i])<0) list2.push(players[i]); } list1.sort(function(a,b){ return a.countCards('e')-b.countCards('e'); @@ -6645,7 +6645,7 @@ character.yijiang={ if(delta<=0) continue; if(delta<=num){ if(target==list1[i]||target==list2[j]){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } return 0; } @@ -6678,13 +6678,13 @@ character.yijiang={ }); } else{ - check=(ai.get.attitude(player,trigger.player)>0); + check=(get.attitude(player,trigger.player)>0); } player.choosePlayerCard(trigger.player,get.prompt('buyi',trigger.player),'h').set('ai',function(button){ if(!_status.event.check) return 0; if(_status.event.target.isUnderControl(true,_status.event.player)){ if(get.type(button.link)!='basic'){ - return 10-ai.get.value(button.link); + return 10-get.value(button.link); } return 0; } @@ -6720,11 +6720,11 @@ character.yijiang={ audio:2, trigger:{source:'damageEnd'}, check:function(event,player){ - if(event.player.isTurnedOver()) return ai.get.attitude(player,event.player)>0; + if(event.player.isTurnedOver()) return get.attitude(player,event.player)>0; if(event.player.hp<3){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; } - return ai.get.attitude(player,event.player)>0; + return get.attitude(player,event.player)>0; }, filter:function(event){ return event.card&&event.card.name=='sha'&&event.player.isAlive(); @@ -6787,7 +6787,7 @@ character.yijiang={ return (num+get.number(button.link)<=13); }); next.set('ai',function(button){ - return ai.get.value(button.link,_status.event.player); + return get.value(button.link,_status.event.player); }); "step 2" if(result.bool&&result.links){ @@ -6846,8 +6846,8 @@ character.yijiang={ next.logSkill=['renxin',trigger.player]; next.set('ai',function(card){ var player=_status.event.player; - if(ai.get.attitude(player,_status.event.getTrigger().player)>3){ - return 11-ai.get.value(card); + if(get.attitude(player,_status.event.getTrigger().player)>3){ + return 11-get.value(card); } return -1; }); @@ -6878,7 +6878,7 @@ character.yijiang={ var next=player.chooseToDiscard(get.prompt('yuce')); next.logSkill='yuce'; next.set('ai',function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }); "step 1" if(result.bool){ @@ -6887,8 +6887,8 @@ character.yijiang={ trigger.source.chooseToDiscard('弃置一张'+get.translation(type)+'牌或令'+get.translation(player)+'回复一点体力',function(card){ return get.type(card,'trick')==_status.event.type; }).set('ai',function(card){ - if(ai.get.recoverEffect(_status.event.getParent().player,_status.event.player,_status.event.player)<0){ - return 7-ai.get.value(card); + if(get.recoverEffect(_status.event.getParent().player,_status.event.player,_status.event.player)<0){ + return 7-get.value(card); } return 0; }).set('type',type); @@ -6935,7 +6935,7 @@ character.yijiang={ player.chooseTarget(get.prompt('xiansi'),[1,2],function(card,player,target){ return target.countCards('he')>0; },function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ @@ -7028,7 +7028,7 @@ character.yijiang={ }, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.05; + return get.order({name:'sha'})+0.05; }, result:{ player:function(player){ @@ -7036,7 +7036,7 @@ character.yijiang={ return current.storage.xiansi; }); if(target){ - return ai.get.effect(target,{name:'sha'},player,player); + return get.effect(target,{name:'sha'},player,player); } } } @@ -7121,10 +7121,10 @@ character.yijiang={ }, content:function(){ "step 0" - var att=ai.get.attitude(player,trigger.source); + var att=get.attitude(player,trigger.source); player.choosePlayerCard('e',get.prompt('zzhenggong'),trigger.source).ai=function(button){ if(att<=0){ - return ai.get.equipValue(button.link); + return get.equipValue(button.link); } return 0; } @@ -7140,7 +7140,7 @@ character.yijiang={ trigger:{global:'phaseBegin'}, priority:15, check:function(event,player){ - var att=ai.get.attitude(player,event.player); + var att=get.attitude(player,event.player); if(att<0){ var nh1=event.player.countCards('h'); var nh2=player.countCards('h'); @@ -7225,7 +7225,7 @@ character.yijiang={ player.lose(cards,ui.special)._triggered=null; player.storage.zyexin=player.storage.zyexin.concat(cards); player.chooseCardButton(player.storage.zyexin,'选择'+cards.length+'张牌作为手牌',cards.length,true).ai=function(button){ - return ai.get.value(button.link); + return get.value(button.link); } if(player==game.me&&_status.auto){ game.delay(); @@ -7285,7 +7285,7 @@ character.yijiang={ return false; }; next.ai=function(button){ - return ai.get.value(button.link); + return get.value(button.link); } "step 1" if(result.bool){ @@ -7300,7 +7300,7 @@ character.yijiang={ return !target.isMin(); } }).ai=function(target){ - return ai.get.effect(target,card,player,player); + return get.effect(target,card,player,player); } } else{ diff --git a/character/yxs.js b/character/yxs.js index 8df7b5e70..41fbe8e1e 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -154,7 +154,7 @@ character.yxs={ return event.source&&event.source.isIn()&&event.source!=player&&!event.source.hasJudge('lebu'); }, check:function(event,player){ - return ai.get.attitude(player,event.source)<=0; + return get.attitude(player,event.source)<=0; }, logTarget:'source', content:function(){ @@ -177,13 +177,13 @@ character.yxs={ order:function(){ var player=_status.event.player; if(player.hasCard(function(card){ - return ai.get.value(card)>=8; + return get.value(card)>=8; })){ return 0; } var nh=player.countCards('h'); if(game.hasPlayer(function(current){ - return ai.get.attitude(player,current)<=0&¤t.countCards('h')==nh+1; + return get.attitude(player,current)<=0&¤t.countCards('h')==nh+1; })){ return 9; } @@ -191,10 +191,10 @@ character.yxs={ }, result:{ player:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0) return 0; if(player.hasCard(function(card){ - return ai.get.value(card)>=8; + return get.value(card)>=8; })){ return 0; } @@ -236,7 +236,7 @@ character.yxs={ order:8, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -251,8 +251,8 @@ character.yxs={ 'step 0' var next=player.chooseToDiscard('e',get.prompt('wlianhuan',trigger.player),'弃置一张装备区内的牌使伤害+1'); next.ai=function(card){ - if(ai.get.attitude(player,trigger.player)<0){ - return 7-ai.get.value(card); + if(get.attitude(player,trigger.player)<0){ + return 7-get.value(card); } return 0; } @@ -270,7 +270,7 @@ character.yxs={ return get.distance(player,target)<=1&&lib.filter.cardEnabled({name:'tao'},target,target); }, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, discard:false, filter:function(event,player){ @@ -287,7 +287,7 @@ character.yxs={ order:9.5, result:{ target:function(player,target){ - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } }, threaten:1.6 @@ -314,7 +314,7 @@ character.yxs={ position:'he', selectCard:2, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ player.awakenSkill('yixin'); @@ -330,7 +330,7 @@ character.yxs={ result:{ target:function(player,target){ if(target.hp==1&&target.maxHp>=3){ - return ai.get.recoverEffect(target,player,player); + return get.recoverEffect(target,player,player); } return 0; } @@ -382,7 +382,7 @@ character.yxs={ return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ return 1-att; } @@ -463,7 +463,7 @@ character.yxs={ return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ return 1-att; } @@ -499,7 +499,7 @@ character.yxs={ player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){ return target.countCards('h')&&target.group!='qun'&&target!=player; }).set('ai',function(target){ - return 0.5-ai.get.attitude(_status.event.player,target); + return 0.5-get.attitude(_status.event.player,target); }); 'step 1' if(result.bool){ @@ -513,7 +513,7 @@ character.yxs={ if(event.targets&&event.targets.length){ event.target=event.targets.shift(); event.target.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){ - return -ai.get.value(card); + return -get.value(card); } } else{ @@ -538,7 +538,7 @@ character.yxs={ var players=game.filterPlayer(); for(var i=0;i=4) return [1,get.tag(card,'damage')*2]; if(target.hp==3) return [1,get.tag(card,'damage')*1.5]; if(target.hp==2) return [1,get.tag(card,'damage')*0.5]; @@ -556,7 +556,7 @@ character.yxs={ return event.player!=player&&event.player.hp<=0&&event.player.group=='qun'; }, check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, forced:true, logTarget:'player', @@ -657,7 +657,7 @@ character.yxs={ filterCard:true, position:'he', check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, content:function(){ player.setAvatar('yxs_luobinhan','yxs_luobinhan'); @@ -689,7 +689,7 @@ character.yxs={ viewAs:{name:'wuzhong'}, filterCard:{suit:'heart'}, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); } }, dili:{ @@ -745,7 +745,7 @@ character.yxs={ usable:1, selectCard:2, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filterTarget:function(card,player,target){ return target.hp=0) return false; + if(get.attitude(player,event.target)>=0) return false; if(event.target.getEquip('bagua')) return false; if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false; return true; @@ -981,7 +981,7 @@ character.yxs={ var next=trigger.target.chooseToRespond({name:'shan'}); next.autochoose=lib.filter.autoRespondShan; next.ai=function(card){ - return ai.get.unuseful2(card); + return get.unuseful2(card); }; player.storage.sanbanfu=false; player.storage.sanbanfu2=false; @@ -1032,7 +1032,7 @@ character.yxs={ complexCard:true, selectCard:2, check:function(card){ - return 8-ai.get.value(card); + return 8-get.value(card); }, filterTarget:function(card,player,target){ if(target.hp==Infinity) return false; @@ -1083,7 +1083,7 @@ character.yxs={ return target.countCards('h')>0&&get.distance(player,target)<=2; }, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, position:'he', content:function(){ @@ -1102,7 +1102,7 @@ character.yxs={ player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){ return target!=player; }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>3&&player.countCards('h')>target.countCards('h')){ return att; } @@ -1121,7 +1121,7 @@ character.yxs={ result:{ target:-1, player:function(player,target){ - if(ai.get.attitude(player,target)>0){ + if(get.attitude(player,target)>0){ return 0; } return 1; @@ -1279,10 +1279,10 @@ character.yxs={ return player.canUse({name:'lebu'},target); }, ai1:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, ai2:function(target){ - return ai.get.effect(target,{name:'lebu'},player,player); + return get.effect(target,{name:'lebu'},player,player); } }); 'step 1' @@ -1302,7 +1302,7 @@ character.yxs={ return event.target.countCards('he')>0; }, check:function(event,player){ - return ai.get.attitude(player,event.target)<0; + return get.attitude(player,event.target)<0; }, content:function(){ 'step 0' @@ -1356,12 +1356,12 @@ character.yxs={ content:function(){ 'step 0' var nh=trigger.player.countCards('h'); - var att=ai.get.attitude(player,trigger.player); + var att=get.attitude(player,trigger.player); player.chooseTarget(get.prompt('xiadao'),function(card,player,target){ return target!=player&&target!=trigger.player&&target.countCards('h')<=nh; }).ai=function(target){ if(att>0) return 0; - return ai.get.attitude(player,target); + return get.attitude(player,target); } 'step 1' if(result.bool){ @@ -1404,7 +1404,7 @@ character.yxs={ player.chooseTarget(get.prompt('lzhangyi'),function(card,player,target){ return player!=target }).set('du',(trigger.cards.length==1&&trigger.cards[0].name=='du')).ai=function(target){ - var att=ai.get.attitude(_status.event.player,target); + var att=get.attitude(_status.event.player,target); if(_status.event.du) return -att; return att; }; @@ -1461,7 +1461,7 @@ character.yxs={ }, ai1:function(card){ if(player.additionalSkills.yizhuang&&player.additionalSkills.yizhuang.length>0) return 0; - return 7-ai.get.value(card); + return 7-get.value(card); }, ai2:function(target){ if(target.isMin()) return 0; @@ -1565,7 +1565,7 @@ character.yxs={ direct:true, content:function(){ 'step 0' - var goon=(ai.get.attitude(player,trigger.player)<0); + var goon=(get.attitude(player,trigger.player)<0); var next=player.chooseToDiscard('鸠杀:是否弃置一张酒或两张黑色手牌令'+get.translation(trigger.player)+'立即死亡?'); next.ai=function(card){ if(ui.selected.cards.length){ @@ -1615,7 +1615,7 @@ character.yxs={ forceunique:true, check:function(card){ if(_status.event.player.countCards('h')>=3){ - return 5-ai.get.value(card); + return 5-get.value(card); } return 0; }, @@ -1748,7 +1748,7 @@ character.yxs={ return 0; } else{ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -1766,12 +1766,12 @@ character.yxs={ check:function(card){ var player=_status.currentPhase; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 11-ai.get.equipValue(card); + return 11-get.equipValue(card); } if(player.countCards('h')1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1]; - if(ai.get.attitude(target,player)<0) return [1,0,0,-1.5]; + if(get.attitude(target,player)<0) return [1,0,0,-1.5]; } } } @@ -2200,7 +2200,7 @@ character.yxs={ }, filterCard:{color:'black'}, check:function(card){ - return 4-ai.get.value(card); + return 4-get.value(card); }, content:function(){ game.swapSeat(player,target); @@ -2209,10 +2209,10 @@ character.yxs={ order:5, result:{ player:function(player,target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target==player.previous&&att>0) return att; if(target==player.next&&att<0) return -att; - var att2=ai.get.attitude(player,player.next); + var att2=get.attitude(player,player.next); if(target==player.next.next&&att<0&&att2<0) return -att-att2; return 0; } @@ -2234,7 +2234,7 @@ character.yxs={ next.autochoose=lib.filter.autoRespondShan; next.ai=function(card){ if(trigger.target.countCards('h','shan')>1){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return -1; }; @@ -2256,8 +2256,8 @@ character.yxs={ var next=trigger.turn.chooseToRespond({name:'sha'}); next.autochoose=lib.filter.autoRespondSha; next.ai=function(card){ - if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ - return ai.get.unuseful2(card); + if(get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ + return get.unuseful2(card); } return -1; }; @@ -2295,7 +2295,7 @@ character.yxs={ "step 0" var effect=0; for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ num+=eff; } - else if(ai.get.attitude(player,players[i])<0){ + else if(get.attitude(player,players[i])<0){ num-=eff; } } @@ -2408,7 +2408,7 @@ character.yxs={ "step 0" var next=player.chooseToDiscard('he','是否弃置一张黑色牌并收回'+get.translation(trigger.card)+'?',{color:'black'}); next.ai=function(card){ - return ai.get.value(trigger.card)-ai.get.value(card); + return get.value(trigger.card)-get.value(card); } next.logSkill='jieyong'; "step 1" @@ -2450,12 +2450,12 @@ character.yxs={ }, content:function(){ "step 0" - var val=ai.get.value(trigger.card); + var val=get.value(trigger.card); var suit=get.suit(trigger.card); var next=player.chooseToDiscard('he','逐鹿:是否弃置一张'+get.translation(suit)+ '牌并获得'+get.translation(trigger.card)+'?',{suit:suit}); next.ai=function(card){ - return val-ai.get.value(card); + return val-get.value(card); }; next.logSkill='zhulu'; "step 1" @@ -2475,7 +2475,7 @@ character.yxs={ filterCard:true, selectCard:2, check:function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }, multitarget:true, targetprompt:['被移走','移动目标'], @@ -2503,12 +2503,12 @@ character.yxs={ "step 0" if(targets.length==2){ player.choosePlayerCard('ej',function(button){ - if(ai.get.attitude(player,targets[0])>ai.get.attitude(player,targets[1])){ + if(get.attitude(player,targets[0])>get.attitude(player,targets[1])){ return get.position(button.link)=='j'?10:0; } else{ if(get.position(button.link)=='j') return -10; - return ai.get.equipValue(button.link); + return get.equipValue(button.link); } },targets[0]); } @@ -2535,11 +2535,11 @@ character.yxs={ result:{ target:function(player,target){ if(ui.selected.targets.length==0){ - if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 1; - if(ai.get.attitude(player,target)<0){ + if(target.countCards('j')&&get.attitude(player,target)>0) return 1; + if(get.attitude(player,target)<0){ var players=game.filterPlayer(); for(var i=0;i0){ + if(get.attitude(player,players[i])>0){ if((target.getEquip(1)&&!players[i].getEquip(1))|| (target.getEquip(2)&&!players[i].getEquip(2))|| (target.getEquip(3)&&!players[i].getEquip(3))|| @@ -2552,7 +2552,7 @@ character.yxs={ return 0; } else{ - return ai.get.attitude(player,ui.selected.targets[0])>0?-1:1; + return get.attitude(player,ui.selected.targets[0])>0?-1:1; } }, }, @@ -2584,7 +2584,7 @@ character.yxs={ cike:{ trigger:{player:'shaBegin'}, check:function(event,player){ - return ai.get.attitude(player,event.target)<=0; + return get.attitude(player,event.target)<=0; }, logTarget:'target', content:function(){ @@ -2695,7 +2695,7 @@ character.yxs={ },'e'); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filterCard:function(card){ var info=lib.card[card.name]; @@ -2707,7 +2707,7 @@ character.yxs={ content:function(){ 'step 0' var next=player.choosePlayerCard(target,'e',true); - next.ai=ai.get.buttonValue; + next.ai=get.buttonValue; next.filterButton=function(button){ return !get.info(button.link).unique; } @@ -2719,7 +2719,7 @@ character.yxs={ return !target.isMin(); }).ai=function(target){ if(!target.countCards('e',{subtype:get.subtype(event.card)})){ - return ai.get.attitude(player,target); + return get.attitude(player,target); } return 0; } diff --git a/character/zhuogui.js b/character/zhuogui.js index cf5c6cb50..48c6c23b4 100644 --- a/character/zhuogui.js +++ b/character/zhuogui.js @@ -82,7 +82,7 @@ character.zhuogui={ enable:'phaseUse', usable:1, filterCard:{color:'red'}, - check:function(card){return 6-ai.get.value(card)}, + check:function(card){return 6-get.value(card)}, filterTarget:true, selectTarget:-1, line:'fire', @@ -95,7 +95,7 @@ character.zhuogui={ var eff=0; for(var i=0;i0; + return get.damageEffect(players[0],player,player,'fire')>0; }, prompt:function(){ var players=game.players.slice(0); @@ -220,7 +220,7 @@ character.zhuogui={ player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){ return player!=target&&target.countCards('h')>0; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.targets&&result.targets.length){ @@ -280,9 +280,9 @@ character.zhuogui={ }, check:function(card){ if(_status.event.player.hp==_status.event.player.maxHp){ - return 5-ai.get.value(card); + return 5-get.value(card); } - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ "step 0" @@ -294,7 +294,7 @@ character.zhuogui={ order:9.5, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player); + return get.damageEffect(target,player); } }, expose:0.2 diff --git a/extension/wuxing/extension.js b/extension/wuxing/extension.js index 75b1d08f5..6eaaf9ade 100644 --- a/extension/wuxing/extension.js +++ b/extension/wuxing/extension.js @@ -71,7 +71,7 @@ play.wuxing={ case 'wood': if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); - player.chooseToDiscard('你被金属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('金克木')};return; + player.chooseToDiscard('你被金属性卡牌克制,需弃置一张牌',true,'he').ai=get.disvalue;player.popup('金克木')};return; case 'water': game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); player.draw();player.popup('金生水'); @@ -83,7 +83,7 @@ play.wuxing={ case 'soil': if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); - player.chooseToDiscard('你被木属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('木克土')};return; + player.chooseToDiscard('你被木属性卡牌克制,需弃置一张牌',true,'he').ai=get.disvalue;player.popup('木克土')};return; case 'fire': game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); player.draw();player.popup('木生火'); @@ -95,7 +95,7 @@ play.wuxing={ case 'fire': if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); - player.chooseToDiscard('你被水属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('水克火')};return; + player.chooseToDiscard('你被水属性卡牌克制,需弃置一张牌',true,'he').ai=get.disvalue;player.popup('水克火')};return; case 'wood': game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); player.draw();player.popup('水生木'); @@ -107,7 +107,7 @@ play.wuxing={ case 'metal': if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); - player.chooseToDiscard('你被火属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('火克金')};return; + player.chooseToDiscard('你被火属性卡牌克制,需弃置一张牌',true,'he').ai=get.disvalue;player.popup('火克金')};return; case 'soil': game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); player.draw();player.popup('火生土'); @@ -119,7 +119,7 @@ play.wuxing={ case 'water': if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); - player.chooseToDiscard('你被土属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('土克水')};return; + player.chooseToDiscard('你被土属性卡牌克制,需弃置一张牌',true,'he').ai=get.disvalue;player.popup('土克水')};return; case 'metal': game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); player.draw();player.popup('土生金'); diff --git a/game/game.js b/game/game.js index 0ea69fe87..fd614ded7 100644 --- a/game/game.js +++ b/game/game.js @@ -7614,8 +7614,8 @@ } game.saveConfig('change_skin',false); game.saveConfig('show_favourite',false); - game.saveConfig('characters',lib.config.all.characters); - game.saveConfig('cards',lib.config.all.cards); + // game.saveConfig('characters',lib.config.all.characters); + // game.saveConfig('cards',lib.config.all.cards); game.saveConfig('plays',['cardpile']); game.saveConfig('tao_enemy',true); game.saveConfig('layout','long2'); @@ -7625,6 +7625,9 @@ game.saveConfig('show_volumn',false); game.saveConfig('debug',true); game.saveConfig('dev',true); + if(!lib.device){ + game.saveConfig('sync_speed',false); + } game.reload(); }, o:function(){ @@ -10033,7 +10036,7 @@ } else{ var choice; - if(player.isDamaged()&&ai.get.recoverEffect(player)>0&&( + if(player.isDamaged()&&get.recoverEffect(player)>0&&( player.hp==1||player.needsToDiscard()|| player.hasSkillTag('maixie_hp')||event.num2>event.num1|| (event.num2==event.num1&&player.needsToDiscard(1)) @@ -13223,8 +13226,8 @@ if(next.selectTarget==undefined){ next.selectTarget=lib.filter.selectTarget; } - if(next.ai1==undefined) next.ai1=ai.get.order; - if(next.ai2==undefined) next.ai2=ai.get.effect; + if(next.ai1==undefined) next.ai1=get.order; + if(next.ai2==undefined) next.ai2=get.effect; next.setContent('chooseToUse'); next._args=Array.from(arguments); return next; @@ -13264,7 +13267,7 @@ if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.selectCard==undefined) next.selectCard=[1,1]; if(next.source==undefined&&!next.nosource) next.source=_status.event.player; - if(next.ai==undefined) next.ai=ai.get.unuseful2; + if(next.ai==undefined) next.ai=get.unuseful2; if(next.prompt!=false){ if(typeof next.prompt=='string'){ next.dialog=next.prompt; @@ -13333,7 +13336,7 @@ if(next.isMine()==false&&next.dialog) next.dialog.style.display='none'; if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.selectCard==undefined) next.selectCard=[1,1]; - if(next.ai==undefined) next.ai=ai.get.unuseful; + if(next.ai==undefined) next.ai=get.unuseful; next.autochoose=function(){ if(!this.forced) return false; if(typeof this.selectCard=='function') return false; @@ -13355,14 +13358,14 @@ next.targets=target; if(check) next.ai=check; else next.ai=function(card){ - var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0; + var addi=(get.value(card)>=8&&get.type(card)!='equip')?-10:0; if(card.name=='du') addi+=5; var source=_status.event.source; var player=_status.event.player; - if(source&&source!=player&&ai.get.attitude(player,source)>1){ - return -get.number(card)-ai.get.value(card)/2+addi; + if(source&&source!=player&&get.attitude(player,source)>1){ + return -get.number(card)-get.value(card)/2+addi; } - return get.number(card)-ai.get.value(card)/2+addi; + return get.number(card)-get.value(card)/2+addi; } next.setContent('chooseToCompareMultiple'); } @@ -13373,19 +13376,19 @@ var player=get.owner(card); var event=_status.event.getParent(); var to=(player==event.player?event.target:event.player); - var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0; + var addi=(get.value(card)>=8&&get.type(card)!='equip')?-10:0; if(card.name=='du') addi+=5; if(player==event.player){ - if(ai.get.attitude(player,to)>0&&event.small){ - return -get.number(card)-ai.get.value(card)/2+addi; + if(get.attitude(player,to)>0&&event.small){ + return -get.number(card)-get.value(card)/2+addi; } - return get.number(card)-ai.get.value(card)/2+addi; + return get.number(card)-get.value(card)/2+addi; } else{ - if(ai.get.attitude(player,to)>0&&!event.small){ - return -get.number(card)-ai.get.value(card)/2+addi; + if(get.attitude(player,to)>0&&!event.small){ + return -get.number(card)-get.value(card)/2+addi; } - return get.number(card)-ai.get.value(card)/2+addi; + return get.number(card)-get.value(card)/2+addi; } } next.setContent('chooseToCompare'); @@ -13494,7 +13497,7 @@ } if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.selectCard==undefined) next.selectCard=[1,1]; - if(next.ai==undefined) next.ai=ai.get.unuseful3; + if(next.ai==undefined) next.ai=get.unuseful3; next.setContent('chooseCard'); next._args=Array.from(arguments); return next; @@ -13526,7 +13529,7 @@ } if(next.filterTarget==undefined) next.filterTarget=lib.filter.all; if(next.selectTarget==undefined) next.selectTarget=[1,1]; - if(next.ai==undefined) next.ai=ai.get.attitude2; + if(next.ai==undefined) next.ai=get.attitude2; next.setContent('chooseTarget'); next._args=Array.from(arguments); return next; @@ -13557,8 +13560,8 @@ if(next.selectTarget==undefined){ next.selectTarget=1; } - if(next.ai1==undefined) next.ai1=ai.get.unuseful2; - if(next.ai2==undefined) next.ai2=ai.get.attitude2; + if(next.ai1==undefined) next.ai1=get.unuseful2; + if(next.ai2==undefined) next.ai2=get.attitude2; next.setContent('chooseCardTarget'); next._args=Array.from(arguments); return next; @@ -13687,8 +13690,8 @@ if(next.position==undefined) next.position='he'; if(next.selectButton==undefined) next.selectButton=[1,1]; if(next.ai==undefined) next.ai=function(button){ - var val=ai.get.buttonValue(button); - if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val; + var val=get.buttonValue(button); + if(get.attitude(_status.event.player,get.owner(button.link))>0) return -val; return val; }; next.setContent('choosePlayerCard'); @@ -13732,8 +13735,8 @@ if(next.position==undefined) next.position='he'; if(next.selectButton==undefined) next.selectButton=[1,1]; if(next.ai==undefined) next.ai=function(button){ - var val=ai.get.buttonValue(button); - if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val; + var val=get.buttonValue(button); + if(get.attitude(_status.event.player,get.owner(button.link))>0) return -val; return val; }; next.setContent('discardPlayerCard'); @@ -13777,8 +13780,8 @@ if(next.position==undefined) next.position='he'; if(next.selectButton==undefined) next.selectButton=[1,1]; if(next.ai==undefined) next.ai=function(button){ - var val=ai.get.buttonValue(button); - if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val; + var val=get.buttonValue(button); + if(get.attitude(_status.event.player,get.owner(button.link))>0) return -val; return val; }; next.setContent('gainPlayerCard'); @@ -13916,7 +13919,7 @@ } } for(var i=0;i=-1&&ai.get.attitude(this,next.targets[i])<0){ + if(get.attitude(this,next.targets[i])>=-1&&get.attitude(this,next.targets[i])<0){ if(!this.ai.tempIgnore) this.ai.tempIgnore=[]; this.ai.tempIgnore.add(next.targets[i]); } @@ -13962,7 +13965,7 @@ } if(next.targets){ for(var i=0;i=-1&&ai.get.attitude(this,next.targets[i])<0){ + if(get.attitude(this,next.targets[i])>=-1&&get.attitude(this,next.targets[i])<0){ if(!this.ai.tempIgnore) this.ai.tempIgnore=[]; this.ai.tempIgnore.add(next.targets[i]); } @@ -15484,7 +15487,7 @@ return skill; }, attitudeTo:function(target){ - if(typeof ai.get.attitude=='function') return ai.get.attitude(this,target); + if(typeof get.attitude=='function') return get.attitude(this,target); return 0; }, clearSkills:function(all){ @@ -15922,7 +15925,7 @@ hasFriend:function(){ for(var i=0;i0){ + if(game.players[i]!=this&&get.attitude(game.players[i],this)>0){ return true; } } @@ -18935,7 +18938,7 @@ } return 1; }, - ai2:ai.get.effect, + ai2:get.effect, type:'dying', targetRequired:true, dying:event.dying @@ -19511,6 +19514,17 @@ ai[i]=lib.init.eval(mode.ai[i]); } } + for(var i in mode.get){ + if(typeof mode.get[i]=='object'){ + if(get[i]==undefined) get[i]={}; + for(var j in mode.get[i]){ + get[i][j]=lib.init.eval(mode.get[i][j]); + } + } + else{ + get[i]=lib.init.eval(mode.get[i]); + } + } for(var i in mode.translate){ lib.translate[i]=mode.translate[i]; } @@ -19588,6 +19602,17 @@ ai[i]=lib.init.eval(mode.ai[i]); } } + for(var i in mode.get){ + if(typeof mode.get[i]=='object'){ + if(get[i]==undefined) get[i]={}; + for(var j in mode.get[i]){ + get[i][j]=lib.init.eval(mode.get[i][j]); + } + } + else{ + get[i]=lib.init.eval(mode.get[i]); + } + } for(var i in mode.translate){ lib.translate[i]=mode.translate[i]; } @@ -25144,7 +25169,7 @@ if(card.ai.basic==undefined) card.ai.basic={}; if(card.ai.result==undefined) card.ai.result={target:1.5}; if(card.ai.basic.order==undefined) card.ai.basic.order=function(card,player){ - return 8+ai.get.equipValue(card,player)/20; + return 8+get.equipValue(card,player)/20; }; if(card.ai.basic.useful==undefined) card.ai.basic.useful=2; if(card.subtype=='equip3'){ @@ -25161,7 +25186,7 @@ var info=get.info(card); var current=player.getEquip(info.subtype); if(current&&card!=current){ - value=ai.get.value(current,player); + value=get.value(current,player); } var equipValue=info.ai.equipValue; if(equipValue==undefined){ @@ -25173,7 +25198,7 @@ } card.ai.result.target=(function(name){ return (function(player,target){ - return ai.get.equipResult(player,target,name); + return get.equipResult(player,target,name); }); }(i)); } @@ -40492,7 +40517,370 @@ if(buttons[i].link!=undefined) links.push(buttons[i].link); } return links; - } + }, + threaten:function(target,player){ + var threaten=1; + var skills=target.getSkills(); + for(var i=0;i0) att=0; + if(!_status.tempnofake){ + _status.tempnofake=true; + if(from.ai.modAttitudeFrom){ + att=from.ai.modAttitudeFrom(from,to,att); + } + if(to.ai.modAttitudeTo){ + att=to.ai.modAttitudeTo(from,to,att); + } + delete _status.tempnofake; + } + return att; + }, + useful:function(card){ + if(get.position(card)=='j') return -1; + if(get.position(card)=='e') return get.equipValue(card); + if(!lib.temp) lib.temp={}; + if(lib.temp[card.name]==undefined) lib.temp[card.name]=[card]; + else lib.temp[card.name].add(card); + var i=lib.temp[card.name].find(card); + var aii=get.info(card).ai; + var useful; + if(aii&&aii.useful) useful=aii.useful; + else if(aii&&aii.basic) useful=aii.basic.useful; + if(useful==undefined) return -1; + if(typeof useful=='function'){ + return useful(card,i); + } + if(typeof useful=='number') return useful; + if(i0&&!target.needsToDiscard()&&!get.tag(card,'valueswap')){ + return 0; + } + } + return Math.max(0,value1-value2)/5; + }, + equipValue:function(card,player){ + if(player==undefined||get.itemtype(player)!='player') player=get.owner(card); + if(player==undefined||get.itemtype(player)!='player') player=_status.event.player; + var info=get.info(card); + if(!info.ai) return 0; + var value=info.ai.equipValue; + if(value==undefined){ + if(info.ai.basic&&info.ai.basic.equipValue!=undefined){ + value=info.ai.basic.equipValue; + } + else return 0; + } + if(typeof value=='number') return value; + if(typeof value=='function') return value(card,player); + return 0; + }, + disvalue:function(card,player){ + return -get.value(card,player); + }, + skillthreaten:function(skill,player,target){ + if(!lib.skill[skill]) return 1; + if(!lib.skill[skill].ai) return 1; + var threaten=lib.skill[skill].ai.threaten; + if(typeof threaten=='number') return threaten; + if(typeof threaten=='function'){ + player=player||_status.event.player; + target=target||player; + return threaten(player,target); + } + return 1; + }, + order:function(item){ + var aii=get.info(item).ai; + var order; + if(aii&&aii.order) order=aii.order; + else if(aii&&aii.basic) order=aii.basic.order; + if(order==undefined) return -1; + if(typeof(order)=='function'){ + return order(item,_status.event.player); + } + return order; + }, + result:function(item,skill){ + var result; + var info=get.info(item); + if(info.ai) result=get.copy(info.ai.result); + if(typeof(result)=='function') result=result(item); + if(!result) result={}; + if(skill){ + var info2=get.info(skill); + if(info2.ai){ + info2=info2.ai.result; + for(var i in info2){ + result[i]=info2[i]; + } + } + } + return result; + }, + effect:function(target,card,player,player2){ + var event=_status.event; + var eventskill=null; + if(player==undefined) player=_status.event.player; + if(typeof card!='string'&&(typeof card!='object'||!card.name)){ + var skillinfo=get.info(event.skill); + if(event.skill&&skillinfo.viewAs==undefined) card=_status.event.skill; + else{ + card=get.card(); + if(skillinfo&&card===skillinfo.viewAs){ + eventskill=event.skill; + } + } + } + var result=get.result(card,eventskill); + var result1=result.player,result2=result.target; + if(typeof result1=='function') result1=result1(player,target,card); + if(typeof result2=='function') result2=result2(player,target,card); + if(typeof result1!='number') result1=0; + if(typeof result2!='number') result2=0; + var temp1,temp2,temp3,temp01=0,temp02=0,threaten=1; + var skills1=player.getSkills().concat(lib.skill.global); + game.expandSkills(skills1); + var zerotarget=false,zeroplayer=false; + for(var i=0;i3) result2*=0.9; + if(target.hp==4) result2*=0.9; + if(target.hp==5) result2*=0.8; + if(target.hp>5) result2*=0.6; + } + else{ + result2+=temp02; + result1+=temp01; + } + if(zeroplayer) result1=0; + if(zerotarget) result2=0; + if(player2){ + return (result1*get.attitude(player2,player)+(target?result2*get.attitude(player2,target):0)); + } + return (result1*get.attitude(player,player)+(target?result2*get.attitude(player,target):0)); + }, + damageEffect:function(target,player,viewer,nature){ + if(!player){ + player=target; + } + if(!viewer){ + viewer=target; + } + var name='damage'; + if(nature=='fire'){ + name='firedamage'; + } + else if(nature=='thunder'){ + name='thunderdamage'; + } + return get.effect(target,{name:name},player,viewer); + }, + recoverEffect:function(target,player,viewer){ + if(target.hp==target.maxHp) return 0; + if(!player){ + player=target; + } + if(!viewer){ + viewer=target; + } + return get.effect(target,{name:'recover'},player,viewer); + }, + buttonValue:function(button){ + var card=button.link; + var player=get.owner(card); + if(!player) player=_status.event.player; + if(player.getCards('j').contains(card)){ + var efff=get.effect(player,card,player,player); + if(efff>0) return 0.5; + if(efff==0) return 0; + return -1.5; + } + if(player.getCards('e').contains(card)){ + var evalue=get.equipValue(card); + if(player.hasSkillTag('noe')){ + if(evalue>=7){ + return evalue/6; + } + return evalue/10; + } + return evalue/3; + } + if(player.hasSkillTag('noh')) return 0.1; + var nh=player.countCards('h'); + switch(nh){ + case 1:return 2; + case 2:return 1.6; + case 3:return 1; + case 4:return 0.8; + case 5:return 0.6; + default:return 0.4; + } + }, + attitude2:function(to){ + return get.attitude(_status.event.player,to); + }, }; var ai={ basic:{ @@ -40595,7 +40983,7 @@ ui.click.skill(cards[ix]); var info=get.info(event.skill); if(info.filterCard){ - check=info.check||ai.get.unuseful2; + check=info.check||get.unuseful2; return (ai.basic.chooseCard(check)); } else{ @@ -40670,385 +41058,7 @@ } } }, - get:{ - threaten:function(target,player){ - var threaten=1; - var skills=target.getSkills(); - for(var i=0;i0) att=0; - if(!_status.tempnofake){ - _status.tempnofake=true; - if(from.ai.modAttitudeFrom){ - att=from.ai.modAttitudeFrom(from,to,att); - } - if(to.ai.modAttitudeTo){ - att=to.ai.modAttitudeTo(from,to,att); - } - delete _status.tempnofake; - } - return att; - }, - useful:function(card){ - if(get.position(card)=='j') return -1; - if(get.position(card)=='e') return ai.get.equipValue(card); - if(!lib.temp) lib.temp={}; - if(lib.temp[card.name]==undefined) lib.temp[card.name]=[card]; - else lib.temp[card.name].add(card); - var i=lib.temp[card.name].find(card); - var aii=get.info(card).ai; - var useful; - if(aii&&aii.useful) useful=aii.useful; - else if(aii&&aii.basic) useful=aii.basic.useful; - if(useful==undefined) return -1; - if(typeof useful=='function'){ - return useful(card,i); - } - if(typeof useful=='number') return useful; - if(i0&&!target.needsToDiscard()&&!get.tag(card,'valueswap')){ - return 0; - } - } - return Math.max(0,value1-value2)/5; - }, - equipValue:function(card,player){ - if(player==undefined||get.itemtype(player)!='player') player=get.owner(card); - if(player==undefined||get.itemtype(player)!='player') player=_status.event.player; - var info=get.info(card); - if(!info.ai) return 0; - var value=info.ai.equipValue; - if(value==undefined){ - if(info.ai.basic&&info.ai.basic.equipValue!=undefined){ - value=info.ai.basic.equipValue; - } - else return 0; - } - if(typeof value=='number') return value; - if(typeof value=='function') return value(card,player); - return 0; - }, - disvalue:function(card,player){ - return -ai.get.value(card,player); - }, - skillthreaten:function(skill,player,target){ - if(!lib.skill[skill]) return 1; - if(!lib.skill[skill].ai) return 1; - var threaten=lib.skill[skill].ai.threaten; - if(typeof threaten=='number') return threaten; - if(typeof threaten=='function'){ - player=player||_status.event.player; - target=target||player; - return threaten(player,target); - } - return 1; - }, - order:function(item){ - var aii=get.info(item).ai; - var order; - if(aii&&aii.order) order=aii.order; - else if(aii&&aii.basic) order=aii.basic.order; - if(order==undefined) return -1; - if(typeof(order)=='function'){ - return order(item,_status.event.player); - } - return order; - }, - result:function(item,skill){ - var result; - var info=get.info(item); - if(info.ai) result=get.copy(info.ai.result); - if(typeof(result)=='function') result=result(item); - if(!result) result={}; - if(skill){ - var info2=get.info(skill); - if(info2.ai){ - info2=info2.ai.result; - for(var i in info2){ - result[i]=info2[i]; - } - } - } - return result; - }, - effect:function(target,card,player,player2){ - var event=_status.event; - var eventskill=null; - if(player==undefined) player=_status.event.player; - if(typeof card!='string'&&(typeof card!='object'||!card.name)){ - var skillinfo=get.info(event.skill); - if(event.skill&&skillinfo.viewAs==undefined) card=_status.event.skill; - else{ - card=get.card(); - if(skillinfo&&card===skillinfo.viewAs){ - eventskill=event.skill; - } - } - } - var result=ai.get.result(card,eventskill); - var result1=result.player,result2=result.target; - if(typeof result1=='function') result1=result1(player,target,card); - if(typeof result2=='function') result2=result2(player,target,card); - if(typeof result1!='number') result1=0; - if(typeof result2!='number') result2=0; - var temp1,temp2,temp3,temp01=0,temp02=0,threaten=1; - var skills1=player.getSkills().concat(lib.skill.global); - game.expandSkills(skills1); - var zerotarget=false,zeroplayer=false; - for(var i=0;i3) result2*=0.9; - if(target.hp==4) result2*=0.9; - if(target.hp==5) result2*=0.8; - if(target.hp>5) result2*=0.6; - } - else{ - result2+=temp02; - result1+=temp01; - } - if(zeroplayer) result1=0; - if(zerotarget) result2=0; - if(player2){ - return (result1*ai.get.attitude(player2,player)+(target?result2*ai.get.attitude(player2,target):0)); - } - return (result1*ai.get.attitude(player,player)+(target?result2*ai.get.attitude(player,target):0)); - }, - damageEffect:function(target,player,viewer,nature){ - if(!player){ - player=target; - } - if(!viewer){ - viewer=target; - } - var name='damage'; - if(nature=='fire'){ - name='firedamage'; - } - else if(nature=='thunder'){ - name='thunderdamage'; - } - return ai.get.effect(target,{name:name},player,viewer); - }, - recoverEffect:function(target,player,viewer){ - if(target.hp==target.maxHp) return 0; - if(!player){ - player=target; - } - if(!viewer){ - viewer=target; - } - return ai.get.effect(target,{name:'recover'},player,viewer); - }, - buttonValue:function(button){ - var card=button.link; - var player=get.owner(card); - if(!player) player=_status.event.player; - if(player.getCards('j').contains(card)){ - var efff=ai.get.effect(player,card,player,player); - if(efff>0) return 0.5; - if(efff==0) return 0; - return -1.5; - } - if(player.getCards('e').contains(card)){ - var evalue=ai.get.equipValue(card); - if(player.hasSkillTag('noe')){ - if(evalue>=7){ - return evalue/6; - } - return evalue/10; - } - return evalue/3; - } - if(player.hasSkillTag('noh')) return 0.1; - var nh=player.countCards('h'); - switch(nh){ - case 1:return 2; - case 2:return 1.6; - case 3:return 1; - case 4:return 0.8; - case 5:return 0.6; - default:return 0.4; - } - }, - attitude2:function(to){ - return ai.get.attitude(_status.event.player,to); - }, - players:function(range,sort){ - var players=[]; - if(range.max==undefined) range.max=Infinity; - if(range.min==undefined) range.min=-Infinity; - if(range.player==undefined) range.player=_status.event.player; - for(var i=0;i=range.min){ - players.push(game.players[i]); - } - } - if(sort) players.sort(sort); - return players; - } - }, + get:get }; lib.init.init(); }()); diff --git a/mode/boss.js b/mode/boss.js index d4e200d11..b9b6ceb35 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -915,8 +915,8 @@ mode.boss={ direct:true, content:function(){ 'step 0' - var att1=ai.get.attitude(player,trigger.player); - var att2=ai.get.attitude(player,trigger.source); + var att1=get.attitude(player,trigger.player); + var att2=get.attitude(player,trigger.source); var targets=player.getEnemies(); var stop=false; for(var i=0;i0; + return event.source&&get.damageEffect(event.source,player,player)>0; }, filter:function(event){ return event.source&&event.source.isAlive(); @@ -1116,7 +1116,7 @@ mode.boss={ } else{ target.chooseControl('discard_card','get_damage',function(){ - if(ai.get.damageEffect(target,player,target)>=0) return 'get_damage'; + if(get.damageEffect(target,player,target)>=0) return 'get_damage'; var nh=target.countCards('h'); if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card'; return 'get_damage'; @@ -1142,7 +1142,7 @@ mode.boss={ target:function(card,player,target){ if(get.tag(card,'recover')&&card.name!='recover'){ for(var i=0;i0){ + if(get.attitude(player,trigger.player)>0){ return 1+trigger.judge(button.link); } - if(ai.get.attitude(player,trigger.player)<0){ + if(get.attitude(player,trigger.player)<0){ return 1-trigger.judge(button.link); } return 0; @@ -1454,7 +1454,7 @@ mode.boss={ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); - var attitude=ai.get.attitude(player,trigger.player); + var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result; @@ -1507,7 +1507,7 @@ mode.boss={ discard:false, filterCard:true, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, content:function(){ "step 0" @@ -1547,7 +1547,7 @@ mode.boss={ return !target.hasSkill('mazui2'); }, check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, discard:false, prepare:'give', @@ -1745,7 +1745,7 @@ mode.boss={ } next.selectCard=[num,num]; next.ai=function(card){ - return ai.get.value(card); + return get.value(card); }; 'step 1' if(result.bool){ @@ -2063,7 +2063,7 @@ mode.boss={ player.chooseTarget(true,'选择一个目标对其造成两点火焰伤害',function(card,player,target){ return player!=target; }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); } } else{ @@ -2161,7 +2161,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_xixing'),function(card,player,target){ return player!=target&&target.isLinked(); }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'thunder'); + return get.damageEffect(target,player,player,'thunder'); } "step 1" if(result.bool){ @@ -2187,7 +2187,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){ return !target.isLinked()&&player!=target; }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } "step 1" if(result.bool){ @@ -2228,7 +2228,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_xiaoshou'),function(card,player,target){ return player!=target&&target.hp>=player.hp; }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); } "step 1" if(result.bool){ @@ -2351,7 +2351,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_guihuo'),function(card,player,target){ return player!=target; }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'fire'); + return get.damageEffect(target,player,player,'fire'); } "step 1" if(result.bool){ @@ -2368,7 +2368,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_luolei'),function(card,player,target){ return player!=target; }).ai=function(target){ - return ai.get.damageEffect(target,player,player,'thunder'); + return get.damageEffect(target,player,player,'thunder'); } "step 1" if(result.bool){ @@ -2423,7 +2423,7 @@ mode.boss={ player.chooseTarget(get.prompt('boss_didong'),function(card,player,target){ return target.isEnemyOf(player); }).ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(target.isTurnedOver()){ if(att>0){ return att+5; @@ -2519,7 +2519,7 @@ mode.boss={ content:function(){ "step 0"; player.chooseTarget(get.prompt('boss_leiji')).ai=function(target){ - return ai.get.damageEffect(target,player,player,'thunder'); + return get.damageEffect(target,player,player,'thunder'); }; "step 1" if(result.bool){ @@ -2548,7 +2548,7 @@ mode.boss={ if(get.tag(card,'respondShan')){ var hastarget=false,players=game.filterPlayer(); for(var i=0;i1) break; } @@ -4632,7 +4632,7 @@ mode.chess={ target:function(player){ var num=0; for(var i=0;i1) break; } @@ -4737,7 +4737,7 @@ mode.chess={ var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]); var eff=0; for(var i=0;i0; }, @@ -4761,9 +4761,9 @@ mode.chess={ var player=_status.event.player; for(var i=0;i0){ + get.effect(game.players[i],{name:'sha'},player)>0){ num++; - if(num>1) return 8-ai.get.value(card); + if(num>1) return 8-get.value(card); } } return 0; @@ -4782,11 +4782,11 @@ mode.chess={ multitarget:true, ai:{ order:function(){ - return ai.get.order({name:'sha'})+0.1; + return get.order({name:'sha'})+0.1; }, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } }, effect:{ @@ -4797,7 +4797,7 @@ mode.chess={ var player=_status.event.player; for(var i=0;i1) return [0,0,0,0]; } @@ -5091,7 +5091,7 @@ mode.chess={ usable:1, filterCard:{color:'red'}, nodelay:true, - check:function(card){return 8-ai.get.value(card);}, + check:function(card){return 8-get.value(card);}, filterTarget:function(card,player,target){ return get.distance(player,target)<=5&&player!=target; }, @@ -5107,7 +5107,7 @@ mode.chess={ order:1, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'fire'); + return get.damageEffect(target,player,target,'fire'); } } } @@ -5123,9 +5123,9 @@ mode.chess={ check:function(card){ var player=_status.currentPhase; if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 12-ai.get.equipValue(card); + return 12-get.equipValue(card); } - return 8-ai.get.equipValue(card); + return 8-get.equipValue(card); }, filter:function(event,player){ return player.countCards('he',{type:'equip'}); @@ -5140,7 +5140,7 @@ mode.chess={ order:9, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'fire'); + return get.damageEffect(target,player,target,'fire'); } } } @@ -5432,12 +5432,8 @@ mode.chess={ var txy=to.getXY(); return Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]); }, - }, - ai:{ - get:{ - rawAttitude:function(from,to){ - return (from.side===to.side?6:-6); - } + rawAttitude:function(from,to){ + return (from.side===to.side?6:-6); } }, card:{ diff --git a/mode/guozhan.js b/mode/guozhan.js index ab6d8de8e..6e46a3a8e 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -362,7 +362,7 @@ mode.guozhan={ return false; }, order:function(){ - return ai.get.order({name:'sha'})-0.1; + return get.order({name:'sha'})-0.1; }, result:{ player:function(player){ @@ -429,7 +429,7 @@ mode.guozhan={ filterCard:{color:'red'}, position:'he', check:function(card){ - return 6-ai.get.value(card); + return 6-get.value(card); }, filter:function(event,player){ for(var i=0;i1){ - return ai.get.unuseful2(card); + return get.unuseful2(card); } return -1; }); @@ -1257,7 +1257,7 @@ mode.guozhan={ player.chooseTarget(function(card,player,target){ return player!=target&&get.distance(player,target)<=1; },true).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target); + return -get.attitude(_status.event.player,target); }); "step 2" if(result.bool&&result.targets.length){ @@ -1342,7 +1342,7 @@ mode.guozhan={ forced:true, priority:15, check:function(event,player){ - return ai.get.effect(event.target,event.card,event.player,player)<0; + return get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ return get.type(event.card,'trick')=='trick'&&get.color(event.card)=='black'; @@ -1365,7 +1365,7 @@ mode.guozhan={ forced:true, priority:15, check:function(event,player){ - return ai.get.effect(event.target,event.card,event.player,player)<0; + return get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ return event.card.name=='shunshou'||event.card.name=='lebu'; @@ -1388,7 +1388,7 @@ mode.guozhan={ forced:true, priority:15, check:function(event,player){ - return ai.get.effect(event.target,event.card,event.player,player)<0; + return get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); @@ -1436,16 +1436,16 @@ mode.guozhan={ if(players[i].hasSkill('haoshi')&& !players[i].isTurnedOver()&& !players[i].hasJudge('lebu')&& - ai.get.attitude(player,players[i])>=3&& - ai.get.attitude(players[i],player)>=3){ - return 11-ai.get.value(card); + get.attitude(player,players[i])>=3&& + get.attitude(players[i],player)>=3){ + return 11-get.value(card); } } - if(player.countCards('h')>player.hp) return 10-ai.get.value(card); - if(player.countCards('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-get.value(card); + if(player.countCards('h')>2) return 6-get.value(card); return -1; } - return 10-ai.get.value(card); + return 10-get.value(card); }, content:function(){ target.gain(cards,player); @@ -1487,7 +1487,7 @@ mode.guozhan={ if(player.countCards('e',{subtype:get.subtype(card)})){ var players=game.filterPlayer(); for(var i=0;i0){ + if(players[i]!=player&&get.attitude(player,players[i])>0){ return 0; } } @@ -1548,7 +1548,7 @@ mode.guozhan={ return !target.isUnseen(2); }, check:function(card){ - return 6-ai.get.value(card,_status.event.player); + return 6-get.value(card,_status.event.player); }, content:function(){ 'step 0' @@ -1590,7 +1590,7 @@ mode.guozhan={ if(target.hp<=0) return -5; if(player.getStat().skill.qingcheng) return 0; if(!target.hasSkillTag('maixie')) return 0; - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; if(player.hasCard(function(card){ return get.tag(card,'damage')&&player.canUse(card,target,true,true); })){ @@ -1620,33 +1620,33 @@ mode.guozhan={ return player.countCards('h',{color:'red'})>0; }, check:function(card){ - return 5-ai.get.value(card); + return 5-get.value(card); } }, gzxiaoguo:{ inherit:'xiaoguo', content:function(){ "step 0" - var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3); - if(ai.get.damageEffect(trigger.player,player,player)<=0){ + var nono=(Math.abs(get.attitude(player,trigger.player))<3); + if(get.damageEffect(trigger.player,player,player)<=0){ nono=true; } var next=player.chooseToDiscard(get.prompt('gzxiaoguo',trigger.player),{type:'basic'}); next.set('ai',function(card){ if(_status.event.nono) return 0; - return 8-ai.get.useful(card); + return 8-get.useful(card); }); next.set('logSkill',['gzxiaoguo',trigger.player]); next.set('nono',nono); "step 1" if(result.bool){ - var nono=(ai.get.damageEffect(trigger.player,player,trigger.player)>=0); + var nono=(get.damageEffect(trigger.player,player,trigger.player)>=0); trigger.player.chooseToDiscard('he',{type:'equip'}).set('ai',function(card){ if(_status.event.nono){ return 0; } - if(_status.event.player.hp==1) return 10-ai.get.value(card); - return 9-ai.get.value(card); + if(_status.event.player.hp==1) return 10-get.value(card); + return 9-get.value(card); }).set('nono',nono); } else{ @@ -3514,7 +3514,7 @@ mode.guozhan={ else if(shown<0.4) c=0.5; else if(shown<0.6) c=0.8; else c=1; - effect+=ai.get.effect(targets[i],card,this)*c; + effect+=get.effect(targets[i],card,this)*c; } } if(effect>0){ @@ -3530,91 +3530,89 @@ mode.guozhan={ }, } }, - ai:{ - get:{ - realAttitude:function(from,toidentity,difficulty){ - if(from.identity==toidentity&&toidentity!='ye'){ - return 4+difficulty; - } - if(from.identity=='unknown'&&lib.character[from.name1][1]==toidentity){ - if(from.wontYe()) return 4+difficulty; - } - var groups=[]; - for(var i=0;i=game.players.length/2){ - if(to_p<=from_p){ - return 0.5; - } + if(to_p==max) return -5; + if(from_p==max) return -2-get.population(toidentity); + if(max>=game.players.length/2){ + if(to_p<=from_p){ + return 0.5; + } + return 0; + } + if(to_p=get.population()-2){ + toidentity='ye'; + } + } + var att=get.realAttitude(from,toidentity,difficulty); + if(from.storage.zhibi&&from.storage.zhibi.contains(to)){ + return att; + } + if(to.ai.shown>=0.5) return att*to.ai.shown; + + var nshown=0; + for(var i=0;i=game.players.length/2&&att>=0){ return 0; } - if(to_p=get.population()-2){ - toidentity='ye'; - } - } - var att=ai.get.realAttitude(from,toidentity,difficulty); - if(from.storage.zhibi&&from.storage.zhibi.contains(to)){ - return att; - } - if(to.ai.shown>=0.5) return att*to.ai.shown; - - var nshown=0; - for(var i=0;i=game.players.length/2&&att>=0){ - return 0; - } - return Math.min(0,Math.random()-0.5)+difficulty; - } - if(to.ai.shown>=0.2){ - if(att>2){ - return Math.max(0,Math.random()-0.5)+difficulty; - } - if(att>=0){ - return 0; - } - return Math.min(0,Math.random()-0.7)+difficulty; - } + return Math.min(0,Math.random()-0.5)+difficulty; + } + if(to.ai.shown>=0.2){ if(att>2){ - return Math.max(0,Math.random()-0.7)+difficulty; + return Math.max(0,Math.random()-0.5)+difficulty; } if(att>=0){ - return Math.min(0,Math.random()-0.3)+difficulty; + return 0; } - return Math.min(0,Math.random()-0.5)+difficulty; - }, - } - }, + return Math.min(0,Math.random()-0.7)+difficulty; + } + if(att>2){ + return Math.max(0,Math.random()-0.7)+difficulty; + } + if(att>=0){ + return Math.min(0,Math.random()-0.3)+difficulty; + } + return Math.min(0,Math.random()-0.5)+difficulty; + }, + } } diff --git a/mode/identity.js b/mode/identity.js index 3225b8e21..3d69d35d8 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -1477,7 +1477,7 @@ mode.identity={ else if(shown<0.4) c=0.5; else if(shown<0.6) c=0.8; else c=1; - var eff=ai.get.effect(targets[i],card,this); + var eff=get.effect(targets[i],card,this); effect+=eff*c; if(eff==0&&shown==0&&this.identity=='zhong'&&targets[i]!=this){ effect+=0.1; @@ -1538,7 +1538,7 @@ mode.identity={ else if(shown<0.4) c=0.5; else if(shown<0.6) c=0.8; else c=1; - effect+=ai.get.effect(targets[i],card,this,zhu)*c; + effect+=get.effect(targets[i],card,this,zhu)*c; } } if(this.identity=='nei'){ @@ -1578,286 +1578,281 @@ mode.identity={ }, } }, - ai:{ - get:{ - rawAttitude:function(from,to){ - var x=0,num=0,temp,i; - if(_status.ai.customAttitude){ - for(i=0;i<_status.ai.customAttitude.length;i++){ - temp=_status.ai.customAttitude[i](from,to); - if(temp!=undefined){ - x+=temp; - num++; - } + get:{ + rawAttitude:function(from,to){ + var x=0,num=0,temp,i; + if(_status.ai.customAttitude){ + for(i=0;i<_status.ai.customAttitude.length;i++){ + temp=_status.ai.customAttitude[i](from,to); + if(temp!=undefined){ + x+=temp; + num++; } } - if(num){ - return x/num; - } - var difficulty=0; - if(to==game.me) difficulty=2-get.difficulty(); - if(from==to||to.identityShown||(from.storage.dongcha==to)){ - return ai.get.realAttitude(from,to)+difficulty*1.5; - } - else{ - if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&& - !from.ai.tempIgnore.contains(to)){ - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ - return -3; - } - } - return 0; - } - if(situation>1) return 0; - return Math.min(3,get.population('fan')); - case 'fan': - if(get.population('fan')==1&&get.population('nei')==1&&game.players.length==3){ - var nei; - for(var i=0;i1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){ - return 0; - } - } - return -3; - } - return -4; - } - break; - case 'zhong':case 'mingzhong': - switch(identity2){ - case 'zhu': return 10; - case 'zhong':case 'mingzhong': return 4; - case 'nei': - if(get.population('fan')==0) return -2; - if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6; - return Math.min(3,-situation); - case 'fan': return -8; - } - break; - case 'nei': - if(identity2=='zhu'&&game.players.length==2) return -10; - var strategy=get.aiStrategy(); - if(strategy==4){ - if(from==to) return 10; - return 0; - } - var num; - switch(identity2){ - case 'zhu': - if(strategy==6) return -1; - if(strategy==5) return 10; - if(to.hp<=0) return 10; - if(get.population('fan')==1){ - var fan; - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ - return -3; - } - } - return 0; - } - else{ - if(situation>1||get.population('fan')==0) num=0; - else num=get.population('fan')+Math.max(0,3-game.zhu.hp); - } - if(strategy==2) num--; - if(strategy==3) num++; - return num; - case 'zhong': - if(strategy==5) return Math.min(0,-situation); - if(strategy==6) return Math.max(-1,-situation); - if(get.population('fan')==0) num=-5; - else if(situation<=0) num=0; - else if(game.zhu&&game.zhu.hp<2) num=0; - else if(game.zhu&&game.zhu.hp==2) num=-1; - else if(game.zhu&&game.zhu.hp<=2&&situation>1) num=-1; - else num=-2; - if(zhongmode&&situation<2){ - num=4; - } - if(strategy==2) num--; - if(strategy==3) num++; - return num; - case 'mingzhong': - if(zhongmode){ - if(from.ai.sizhong==undefined){ - from.ai.sizhong=(Math.random()<0.5); - } - if(from.ai.sizhong) return 6; - } - if(strategy==5) return Math.min(0,-situation); - if(strategy==6) return Math.max(-1,-situation); - if(get.population('fan')==0) num=-5; - else if(situation<=0) num=0; - else num=-3; - if(strategy==2) num--; - if(strategy==3) num++; - return num; - case 'nei': - if(from==to) return 10; - if(from.ai.friend.contains(to)) return 5; - if(get.population('fan')+get.population('zhong')>0) return 0; - return -5; - case 'fan': - if(strategy==5) return Math.max(-1,situation); - if(strategy==6) return Math.min(0,situation); - if((game.zhu&&game.zhu.hp<=2&&situation<0)||situation<-1) num=-3; - else if(situation<0||get.population('zhong')+get.population('mingzhong')==0) num=-2; - else if((game.zhu&&game.zhu.hp>=4&&situation>0)||situation>1) num=1; - else num=0; - if(strategy==2) num++; - if(strategy==3) num--; - return num; - } - break; - case 'fan': - switch(identity2){ - case 'zhu': - if(get.population('nei')>0){ - if(situation==1) return -6; - if(situation>1) return -5; - } - return -8; - case 'zhong': - if(!zhongmode&&game.zhu.hp>=3&&to.hp==1){ - return -10; - } - return -7; - case 'mingzhong':return -5; - case 'nei': - if(zhongmode&&to.ai.sizhong) return -7; - if(get.population('fan')==1) return 0; - if(get.population('zhong')+get.population('mingzhong')==0) return -7; - if(game.zhu&&game.zhu.hp<=2) return -1; - return Math.min(3,situation); - case 'fan': return 5; - } - } - }, - situation:function(absolute){ - var i,j,player; - var zhuzhong=0,total=0,zhu,fan=0; - for(i=0;i4){ - php=4; - } - else if(php>6){ - php=6; - } - j=player.countCards('h')+player.countCards('e')*1.5+php*2; - if(player.identity=='zhu'){ - zhuzhong+=j*1.2+5; - total+=j*1.2+5; - zhu=j; - } - else if(player.identity=='zhong'||player.identity=='mingzhong'){ - zhuzhong+=j*0.8+3; - total+=j*0.8+3; - } - else if(player.identity=='fan'){ - zhuzhong-=j+4; - total+=j+4; - fan+=j+4; - } - } - if(absolute) return zhuzhong; - var result=parseInt(10*Math.abs(zhuzhong/total)); - if(zhuzhong<0) result=-result; - if(!game.zhong){ - if(zhu<12&&fan>30) result--; - if(zhu<6&&fan>15) result--; - if(zhu<4) result--; - } - return result; - }, - population:function(identity){ - return get.population(identity); } - } + if(num){ + return x/num; + } + var difficulty=0; + if(to==game.me) difficulty=2-get.difficulty(); + if(from==to||to.identityShown||(from.storage.dongcha==to)){ + return get.realAttitude(from,to)+difficulty*1.5; + } + else{ + if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&& + !from.ai.tempIgnore.contains(to)){ + for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + return -3; + } + } + return 0; + } + if(situation>1) return 0; + return Math.min(3,get.population('fan')); + case 'fan': + if(get.population('fan')==1&&get.population('nei')==1&&game.players.length==3){ + var nei; + for(var i=0;i1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){ + return 0; + } + } + return -3; + } + return -4; + } + break; + case 'zhong':case 'mingzhong': + switch(identity2){ + case 'zhu': return 10; + case 'zhong':case 'mingzhong': return 4; + case 'nei': + if(get.population('fan')==0) return -2; + if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6; + return Math.min(3,-situation); + case 'fan': return -8; + } + break; + case 'nei': + if(identity2=='zhu'&&game.players.length==2) return -10; + var strategy=get.aiStrategy(); + if(strategy==4){ + if(from==to) return 10; + return 0; + } + var num; + switch(identity2){ + case 'zhu': + if(strategy==6) return -1; + if(strategy==5) return 10; + if(to.hp<=0) return 10; + if(get.population('fan')==1){ + var fan; + for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + return -3; + } + } + return 0; + } + else{ + if(situation>1||get.population('fan')==0) num=0; + else num=get.population('fan')+Math.max(0,3-game.zhu.hp); + } + if(strategy==2) num--; + if(strategy==3) num++; + return num; + case 'zhong': + if(strategy==5) return Math.min(0,-situation); + if(strategy==6) return Math.max(-1,-situation); + if(get.population('fan')==0) num=-5; + else if(situation<=0) num=0; + else if(game.zhu&&game.zhu.hp<2) num=0; + else if(game.zhu&&game.zhu.hp==2) num=-1; + else if(game.zhu&&game.zhu.hp<=2&&situation>1) num=-1; + else num=-2; + if(zhongmode&&situation<2){ + num=4; + } + if(strategy==2) num--; + if(strategy==3) num++; + return num; + case 'mingzhong': + if(zhongmode){ + if(from.ai.sizhong==undefined){ + from.ai.sizhong=(Math.random()<0.5); + } + if(from.ai.sizhong) return 6; + } + if(strategy==5) return Math.min(0,-situation); + if(strategy==6) return Math.max(-1,-situation); + if(get.population('fan')==0) num=-5; + else if(situation<=0) num=0; + else num=-3; + if(strategy==2) num--; + if(strategy==3) num++; + return num; + case 'nei': + if(from==to) return 10; + if(from.ai.friend.contains(to)) return 5; + if(get.population('fan')+get.population('zhong')>0) return 0; + return -5; + case 'fan': + if(strategy==5) return Math.max(-1,situation); + if(strategy==6) return Math.min(0,situation); + if((game.zhu&&game.zhu.hp<=2&&situation<0)||situation<-1) num=-3; + else if(situation<0||get.population('zhong')+get.population('mingzhong')==0) num=-2; + else if((game.zhu&&game.zhu.hp>=4&&situation>0)||situation>1) num=1; + else num=0; + if(strategy==2) num++; + if(strategy==3) num--; + return num; + } + break; + case 'fan': + switch(identity2){ + case 'zhu': + if(get.population('nei')>0){ + if(situation==1) return -6; + if(situation>1) return -5; + } + return -8; + case 'zhong': + if(!zhongmode&&game.zhu.hp>=3&&to.hp==1){ + return -10; + } + return -7; + case 'mingzhong':return -5; + case 'nei': + if(zhongmode&&to.ai.sizhong) return -7; + if(get.population('fan')==1) return 0; + if(get.population('zhong')+get.population('mingzhong')==0) return -7; + if(game.zhu&&game.zhu.hp<=2) return -1; + return Math.min(3,situation); + case 'fan': return 5; + } + } + }, + situation:function(absolute){ + var i,j,player; + var zhuzhong=0,total=0,zhu,fan=0; + for(i=0;i4){ + php=4; + } + else if(php>6){ + php=6; + } + j=player.countCards('h')+player.countCards('e')*1.5+php*2; + if(player.identity=='zhu'){ + zhuzhong+=j*1.2+5; + total+=j*1.2+5; + zhu=j; + } + else if(player.identity=='zhong'||player.identity=='mingzhong'){ + zhuzhong+=j*0.8+3; + total+=j*0.8+3; + } + else if(player.identity=='fan'){ + zhuzhong-=j+4; + total+=j+4; + fan+=j+4; + } + } + if(absolute) return zhuzhong; + var result=parseInt(10*Math.abs(zhuzhong/total)); + if(zhuzhong<0) result=-result; + if(!game.zhong){ + if(zhu<12&&fan>30) result--; + if(zhu<6&&fan>15) result--; + if(zhu<4) result--; + } + return result; + }, }, skill:{ dongcha:{ @@ -1871,7 +1866,7 @@ mode.identity={ return target.countCards('hej')>0; }).set('ai',function(target){ var player=_status.event.player; - return ai.get.attitude(player,target)*lib.card.guohe.ai.result.target(player,target); + return get.attitude(player,target)*lib.card.guohe.ai.result.target(player,target); }); 'step 1' if(result.bool){ diff --git a/mode/stone.js b/mode/stone.js index 5a0f48f54..19a5815c1 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -1680,6 +1680,16 @@ mode.stone={ }, }, get:{ + rawAttitude:function(from,to){ + var num; + if(to.isMin()&&!to.hasSkill('chaofeng')){ + num=5; + } + else{ + num=6; + } + return num*(from.side==to.side?1:-1); + }, stonecard:function(type,career){ var list=[]; for(var i in lib.card){ @@ -2422,7 +2432,7 @@ mode.stone={ if(player.hasFellowSkill('priest_hunwu')){ return -2 } - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -3668,7 +3678,7 @@ mode.stone={ if(player.hasFellowSkill('priest_hunwu')){ return -2 } - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -3704,7 +3714,7 @@ mode.stone={ if(player.hasFellowSkill('priest_hunwu')){ return -1; } - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -4460,7 +4470,7 @@ mode.stone={ 'step 0' if(player.countCards('e')){ player.chooseToDiscard('e','是否弃置一张装备区内的牌令伤害+1?').ai=function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); } } else{ @@ -5966,7 +5976,7 @@ mode.stone={ event.chooser.chooseTarget('陪练:令一名随从获得嘲讽',function(card,playerx,target){ return player!=target&&target.isMin()&&!target.hasSkill('chaofeng'); }).ai=function(target){ - return ai.get.attitude(event.chooser,target)*target.hp; + return get.attitude(event.chooser,target)*target.hp; }; player.line(event.chooser); "step 1" @@ -6032,7 +6042,7 @@ mode.stone={ event.chooser.chooseTarget('普照:选择一名己方随从增加两点体力和体力上限',function(card,playerx,target){ return player!=target&&player.side==target.side&&target.isMin(); }).ai=function(target){ - return ai.get.attitude(event.chooser,target)*Math.max(1,10-target.hp); + return get.attitude(event.chooser,target)*Math.max(1,10-target.hp); }; player.line(event.chooser); "step 1" @@ -6060,7 +6070,7 @@ mode.stone={ event.chooser.chooseTarget('缩小:令一名随从减少两点体力上限',function(card,playerx,target){ return player!=target&&target.isMin()&&target.maxHp>1; }).ai=function(target){ - if(ai.get.attitude(player,target)>=0) return 0; + if(get.attitude(player,target)>=0) return 0; if(target.hp==1) return 0.01; if(target.maxHp-target.hp>=2) return 0.01; if(target.maxHp-target.hp==1){ @@ -6281,7 +6291,7 @@ mode.stone={ 'he',function(card){ return get.type(card)=='equip'; }).ai=function(card){ - return 7-ai.get.value(card); + return 7-get.value(card); }; "step 1" if(result.bool){ @@ -6478,9 +6488,9 @@ mode.stone={ return player!=target&&target.isMin()&&(target.hp!=2||target.maxHp!=2); }).ai=function(target){ if(target.hp==2&&target.maxHp>2){ - return ai.get.attitude(event.chooser,target)*(2-target.maxHp)/100; + return get.attitude(event.chooser,target)*(2-target.maxHp)/100; } - return ai.get.attitude(event.chooser,target)*(2-target.hp); + return get.attitude(event.chooser,target)*(2-target.hp); }; player.line(event.chooser); "step 1" @@ -6509,7 +6519,7 @@ mode.stone={ event.chooser.chooseTarget('保卫:令一名友方随从获得一点护甲',function(card,playerx,target){ return player!=target&&player.side==target.side&&target.isMin(); }).ai=function(target){ - return ai.get.attitude(event.chooser,target); + return get.attitude(event.chooser,target); }; player.line(event.chooser); "step 1" @@ -7369,10 +7379,10 @@ mode.stone={ }, filterCard:true, ai1:function(card){ - return 9-ai.get.value(card); + return 9-get.value(card); }, ai2:function(target){ - return ai.get.damageEffect(target,player,player); + return get.damageEffect(target,player,player); }, prompt:'偷袭:弃置一张装备区内的牌并对一名敌方角色一点伤害' }); @@ -7524,7 +7534,7 @@ mode.stone={ event.chooser.chooseTarget('监工:对一名随从造成一点伤害然后令其摸两张牌',function(card,playerx,target){ return player!=target&&target.isMin(); }).ai=function(target){ - var att=ai.get.attitude(event.chooser,target); + var att=get.attitude(event.chooser,target); if(target.hp==1) return -att; if(target.hp==2) return 0; return att; @@ -7854,7 +7864,7 @@ mode.stone={ event.chooser.chooseTarget('驯兽:选择一名己方随从增加一点体力和体力上限并摸两张牌',function(card,playerx,target){ return player!=target&&player.side==target.side&&target.isMin(); }).ai=function(target){ - return ai.get.attitude(event.chooser,target); + return get.attitude(event.chooser,target); }; player.line(event.chooser); "step 1" @@ -8198,7 +8208,7 @@ mode.stone={ if(player.hasFellowSkill('priest_hunwu')){ return -1; } - return ai.get.recoverEffect(target,player,target); + return get.recoverEffect(target,player,target); } } } @@ -8230,7 +8240,7 @@ mode.stone={ order:2, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -8257,7 +8267,7 @@ mode.stone={ order:2, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target,'fire'); + return get.damageEffect(target,player,target,'fire'); } } } @@ -8345,7 +8355,7 @@ mode.stone={ order:2, result:{ target:function(player,target){ - return ai.get.damageEffect(target,player,target); + return get.damageEffect(target,player,target); } } } @@ -8448,11 +8458,11 @@ mode.stone={ }, ai:{ order:function(){ - return ai.get.order({name:'sha'})-0.1; + return get.order({name:'sha'})-0.1; }, result:{ target:function(player,target){ - return ai.get.effect(target,{name:'sha'},player,target); + return get.effect(target,{name:'sha'},player,target); } } } @@ -8763,7 +8773,7 @@ mode.stone={ event.chooser.chooseTarget('暗影:选择敌方一名角色视为对其使用一张杀',function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},event.chooser,target); }).ai=function(target){ - return ai.get.effect(target,{name:'sha'},event.chooser); + return get.effect(target,{name:'sha'},event.chooser); } player.line(event.chooser); "step 1" @@ -8790,7 +8800,7 @@ mode.stone={ event.chooser.chooseTarget('发明:选择己方一名角色摸一张牌',function(card,playerx,target){ return player!=target&&player.side==target.side; }).ai=function(target){ - return ai.get.attitude(event.chooser,target); + return get.attitude(event.chooser,target); }; player.line(event.chooser); "step 1" @@ -10198,20 +10208,6 @@ mode.stone={ mode_stone_card_config:'炉石模式', mode_stone_character_config:'炉石模式', }, - ai:{ - get:{ - rawAttitude:function(from,to){ - var num; - if(to.isMin()&&!to.hasSkill('chaofeng')){ - num=5; - } - else{ - num=6; - } - return num*(from.side==to.side?1:-1); - } - } - }, help:{ '炉石模式': '
构筑
  • 点击右上角的卡组管理构建卡组
  • 一套卡组共30张牌,由法术和随从牌构成,每个同名卡牌最多带两张'+ diff --git a/mode/tafang.js b/mode/tafang.js index f9704f254..94503f215 100644 --- a/mode/tafang.js +++ b/mode/tafang.js @@ -20,7 +20,7 @@ mode.tafang={ } } get.chessDistance=lib.init.eval(result.get.chessDistance); - ai.get.rawAttitude=lib.init.eval(result.ai.get.rawAttitude); + get.rawAttitude=lib.init.eval(result.get.rawAttitude); var toLoad=['addChessPlayer','addObstacle','removeObstacle','isChessNeighbour', 'draw2','updateCanvas2','setChessInfo','modeSwapPlayer']; for(var i=0;i0){ return att+5; @@ -3345,7 +3345,7 @@ mode.versus={ player.chooseTarget(get.prompt('boss_qiwu'),function(card,player,target){ return target.hp0){ if(noneed&&player==target){ num=0.5; @@ -3428,7 +3428,7 @@ mode.versus={ return !target.isFriendOf(player); }).ai=function(target){ if(target.isTurnedOver()) return 0; - return -ai.get.attitude(player,target); + return -get.attitude(player,target); }; "step 1" if(result.bool){ @@ -3449,7 +3449,7 @@ mode.versus={ player.chooseTarget(get.prompt('boss_chuanyun'),function(card,player,target){ return player.hp0){ + players[i].isFriendOf(player)&&get.recoverEffect(players[i])>0){ if(players[i].hp==1){ return true; } @@ -3861,7 +3861,7 @@ mode.versus={ }, logTarget:'player', check:function(event,player){ - return ai.get.attitude(player,event.player)<0; + return get.attitude(player,event.player)<0; }, content:function(){ player.line(trigger.player,'green'); @@ -3907,7 +3907,7 @@ mode.versus={ return target.isFriendOf(player); }); next.ai=function(target){ - var att=ai.get.attitude(player,target); + var att=get.attitude(player,target); if(att>0&&target.hasJudge('lebu')){ return 0.1; } @@ -4086,7 +4086,7 @@ mode.versus={ player.chooseTarget('是否令一名敌方角色失去1点体力?',function(card,player,target){ return !target.isFriendOf(player); }).ai=function(target){ - return -ai.get.attitude(player,target); + return -get.attitude(player,target); } } "step 2" @@ -4132,8 +4132,8 @@ mode.versus={ return target.isEnemyOf(player); }).ai=function(target){ if(player.hp<=1) return 0; - if(ai.get.attitude(player,target)>-3) return 0; - var eff=ai.get.damageEffect(target,player,player,'fire'); + if(get.attitude(player,target)>-3) return 0; + var eff=get.damageEffect(target,player,player,'fire'); if(eff>0){ return eff+target.countCards('e')/2; } @@ -4767,33 +4767,31 @@ mode.versus={ } } }, - ai:{ - get:{ - rawAttitude:function(from,to){ - if(from.side==to.side){ - if(to.identity=='zhu'){ - if(_status.connectMode){ - if(_status.mode=='4v4') return 10; - } - else{ - if(lib.storage.main_zhu||_status.mode=='four') return 10; - } + get:{ + rawAttitude:function(from,to){ + if(from.side==to.side){ + if(to.identity=='zhu'){ + if(_status.connectMode){ + if(_status.mode=='4v4') return 10; } - return 6; - } - else{ - if(to.identity=='zhu'){ - if(_status.connectMode){ - if(_status.mode=='4v4') return -10; - } - else{ - if(lib.storage.main_zhu||_status.mode=='four') return -10; - } + else{ + if(lib.storage.main_zhu||_status.mode=='four') return 10; } - return -6; } - }, - } + return 6; + } + else{ + if(to.identity=='zhu'){ + if(_status.connectMode){ + if(_status.mode=='4v4') return -10; + } + else{ + if(lib.storage.main_zhu||_status.mode=='four') return -10; + } + } + return -6; + } + }, }, help:{ '对决模式':