This commit is contained in:
libccy 2017-04-02 17:33:42 +08:00
parent 319025fd5c
commit 39c57b72c6
36 changed files with 2576 additions and 2585 deletions

View File

@ -67,7 +67,7 @@ card.extra={
}, },
}, },
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.2; return get.order({name:'sha'})+0.2;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
@ -94,10 +94,10 @@ card.extra={
} }
if(card){ if(card){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (ai.get.attitude(target,current)<0&& return (get.attitude(target,current)<0&&
target.canUse(card,current,true,true)&& target.canUse(card,current,true,true)&&
!current.getEquip('baiyin')&& !current.getEquip('baiyin')&&
ai.get.effect(current,card,target)>0); get.effect(current,card,target)>0);
})){ })){
return 1; return 1;
} }
@ -128,7 +128,7 @@ card.extra={
var rand=Math.random()<0.5; var rand=Math.random()<0.5;
target.chooseCard(true).ai=function(card){ target.chooseCard(true).ai=function(card){
if(rand) return Math.random(); if(rand) return Math.random();
return ai.get.value(card); return get.value(card);
}; };
"step 1" "step 1"
event.dialog=ui.create.dialog(get.translation(target)+'展示的手牌',result.cards); event.dialog=ui.create.dialog(get.translation(target)+'展示的手牌',result.cards);
@ -140,8 +140,8 @@ card.extra={
game.log(target,'展示了',event.card2); game.log(target,'展示了',event.card2);
player.chooseToDiscard({suit:get.suit(event.card2)},function(card){ player.chooseToDiscard({suit:get.suit(event.card2)},function(card){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
if(ai.get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){ if(get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){
return 7-ai.get.value(card,evt.player); return 7-get.value(card,evt.player);
} }
return -1; return -1;
}).prompt=false; }).prompt=false;
@ -164,7 +164,7 @@ card.extra={
useful:1, useful:1,
}, },
wuxie:function(target,card,player,current,state){ 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:{ result:{
player:function(player){ player:function(player){
@ -231,10 +231,10 @@ card.extra={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.isLinked()) return 1; 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(ui.selected.targets.length) return -1;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)<=-1&&current!=target&&!current.isLinked(); return get.attitude(player,current)<=-1&&current!=target&&!current.isLinked();
})){ })){
return -1; return -1;
} }
@ -320,9 +320,9 @@ card.extra={
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hasSkillTag('maixie')&&player.hp>1) return 0; if(player.hasSkillTag('maixie')&&player.hp>1) return 0;
if(player.hasSkillTag('noDirectDamage')) return 10; 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){ 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==1) num+=4;
if(player.hp==2) num+=1; if(player.hp==2) num+=1;
@ -491,7 +491,7 @@ card.extra={
}, },
audio:true, audio:true,
check:function(event,player){ check:function(event,player){
var att=ai.get.attitude(player,event.target); var att=get.attitude(player,event.target);
if(event.target.hasSkillTag('nofire')){ if(event.target.hasSkillTag('nofire')){
return att>0; return att>0;
} }

View File

@ -42,7 +42,7 @@ card.gujian={
result:{ result:{
target:function(player,target){ target:function(player,target){
var evt=_status.event.getTrigger(); 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 -1;
if(eff<0) return 2; if(eff<0) return 2;
return 0; return 0;
@ -450,7 +450,7 @@ card.gujian={
content:function(){ content:function(){
'step 0' 'step 0'
target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){
return 6-ai.get.value(card); return 6-get.value(card);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -466,7 +466,7 @@ card.gujian={
var cards=player.getCards('he'); var cards=player.getCards('he');
var num=-1; var num=-1;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.value(cards[i])<6) num++; if(get.value(cards[i])<6) num++;
} }
if(player.needsToDiscard()&&num<1){ if(player.needsToDiscard()&&num<1){
num=1; num=1;
@ -549,7 +549,7 @@ card.gujian={
else{ else{
if(!rand) num-=6; if(!rand) num-=6;
} }
var value=ai.get.value(card); var value=get.value(card);
if(value>=8) return -100; if(value>=8) return -100;
return num-value; return num-value;
}; };
@ -635,7 +635,7 @@ card.gujian={
} }
else{ else{
target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){ target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}; };
} }
"step 1" "step 1"
@ -693,7 +693,7 @@ card.gujian={
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current==target||(get.distance(target,current,'pure')==1&&current.countCards('he'))){ if(current==target||(get.distance(target,current,'pure')==1&&current.countCards('he'))){
var att=ai.get.attitude(player,current); var att=get.attitude(player,current);
if(att>0){ if(att>0){
return -1; return -1;
} }
@ -830,7 +830,7 @@ card.gujian={
value:5, value:5,
result:{ result:{
player:function(player,target){ player:function(player,target){
if(ai.get.attitude(player,target)==0) return 0; if(get.attitude(player,target)==0) return 0;
return 1; return 1;
} }
} }
@ -1016,7 +1016,7 @@ card.gujian={
return player.countCards('he',{suit:'heart'})>0; return player.countCards('he',{suit:'heart'})>0;
}, },
prompt:'将一张红桃牌当桃使用', prompt:'将一张红桃牌当桃使用',
check:function(card){return 10-ai.get.value(card)}, check:function(card){return 10-get.value(card)},
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
return player.countCards('he',{suit:'heart'})>0; return player.countCards('he',{suit:'heart'})>0;
@ -1092,7 +1092,7 @@ card.gujian={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ 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; if(!player.countCards('h')) return false;
}, },
prompt:'将一张手牌当杀使用', prompt:'将一张手牌当杀使用',
check:function(card){return 5-ai.get.value(card)}, check:function(card){return 5-get.value(card)},
ai:{ ai:{
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg!='use') return false; if(arg!='use') return false;
@ -1409,7 +1409,7 @@ card.gujian={
order:6, order:6,
result:{ result:{
target:function(player,target){ 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 nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;
@ -1464,7 +1464,7 @@ card.gujian={
order:6, order:6,
result:{ result:{
target:function(player,target){ 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 nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;
@ -1502,7 +1502,7 @@ card.gujian={
order:6, order:6,
result:{ result:{
target:function(player,target){ 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 nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;

View File

@ -16,7 +16,7 @@ card.guozhan={
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hasSkill('zhangwu')) return 9; if(player.hasSkill('zhangwu')) return 9;
if(game.hasPlayer(function(current){ 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; return 1;
} }
@ -37,7 +37,7 @@ card.guozhan={
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hasSkill('wendao')) return 9; if(player.hasSkill('wendao')) return 9;
if(game.hasPlayer(function(current){ 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; return 1;
} }
@ -103,7 +103,7 @@ card.guozhan={
content:function(){ content:function(){
'step 0' 'step 0'
target.chooseControl('discard_card','take_damage',function(event,player){ 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'; return 'take_damage';
} }
if(player.hp>=3&&player.countCards('e')>=2){ if(player.hp>=3&&player.countCards('e')>=2){
@ -172,10 +172,10 @@ card.guozhan={
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(target.isMajor()==current.isMajor()){ if(target.isMajor()==current.isMajor()){
if(current.isLinked()){ if(current.isLinked()){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
else{ else{
return -ai.get.attitude(player,target)*0.8; return -get.attitude(player,target)*0.8;
} }
} }
}); });
@ -299,10 +299,10 @@ card.guozhan={
}, },
result:{ result:{
player:function(player,target){ 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(target.hp==1&&att<0) return 0;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)<att; return get.attitude(player,current)<att;
})){ })){
var num=1; var num=1;
if(target==player.next||target==player.previous){ if(target==player.next||target==player.previous){
@ -380,11 +380,11 @@ card.guozhan={
if(target.hasSkillTag('nofire')||target.hasSkillTag('nodamage')) return 0; if(target.hasSkillTag('nofire')||target.hasSkillTag('nodamage')) return 0;
if(target.hasSkill('xuying')&&target.countCards('h')==0) return 0; if(target.hasSkill('xuying')&&target.countCards('h')==0) return 0;
if(!target.isLinked()){ if(!target.isLinked()){
return ai.get.damageEffect(target,player,target,'fire'); return get.damageEffect(target,player,target,'fire');
} }
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current.isLinked()){ if(current.isLinked()){
return get.sgn(ai.get.damageEffect(current,player,target,'fire')); return get.sgn(get.damageEffect(current,player,target,'fire'));
} }
}); });
} }
@ -514,7 +514,7 @@ card.guozhan={
}, },
content:function(){ content:function(){
target.draw(2); target.draw(2);
target.chooseToDiscard(2,'he',true).ai=ai.get.disvalue; target.chooseToDiscard(2,'he',true).ai=get.disvalue;
}, },
ai:{ ai:{
wuxie:function(){ wuxie:function(){
@ -588,7 +588,7 @@ card.guozhan={
player:function(card,player){ player:function(card,player){
if(player.hasSkill('zhangwu')) return; if(player.hasSkill('zhangwu')) return;
if(card.name=='feilongduofeng'&&game.hasPlayer(function(current){ if(card.name=='feilongduofeng'&&game.hasPlayer(function(current){
return current.hasSkill('zhangwu')&&ai.get.attitude(player,current)<=0; return current.hasSkill('zhangwu')&&get.attitude(player,current)<=0;
})){ })){
return [0,0,0,0]; return [0,0,0,0];
} }
@ -602,7 +602,7 @@ card.guozhan={
player:function(card,player){ player:function(card,player){
if(player.hasSkill('wendao')) return; if(player.hasSkill('wendao')) return;
if(card.name=='taipingyaoshu'&&game.hasPlayer(function(current){ if(card.name=='taipingyaoshu'&&game.hasPlayer(function(current){
return current.hasSkill('wendao')&&ai.get.attitude(player,current)<=0; return current.hasSkill('wendao')&&get.attitude(player,current)<=0;
})){ })){
return [0,0,0,0]; return [0,0,0,0];
} }
@ -817,7 +817,7 @@ card.guozhan={
return player.canUse({name:'zhibi'},target); return player.canUse({name:'zhibi'},target);
},true).set('ai',function(target){ },true).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
return ai.get.effect(target,{name:'zhibi'},player,player); return get.effect(target,{name:'zhibi'},player,player);
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -838,7 +838,7 @@ card.guozhan={
player.removeSkill('xietianzi'); player.removeSkill('xietianzi');
if(player.countCards('he')>0){ if(player.countCards('he')>0){
player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){ player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}); });
} }
else{ else{
@ -1086,11 +1086,11 @@ card.guozhan={
return get.distance(damaged,target)<=1&&target!=damaged; return get.distance(damaged,target)<=1&&target!=damaged;
}, },
ai1:function(card){ ai1:function(card){
return 9-ai.get.value(card); return 9-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
var player=_status.event.player; var player=_status.event.player;
return ai.get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
}, },
prompt:get.prompt('sanjian') prompt:get.prompt('sanjian')
}).set('damaged',damaged); }).set('damaged',damaged);

View File

@ -100,12 +100,12 @@ card.hearth={
var noh=(nh==0||target.hasSkillTag('noh')); var noh=(nh==0||target.hasSkillTag('noh'));
if(noh&&noe) return 0; if(noh&&noe) return 0;
if(noh&&noe2) return 0.01; 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'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='zhaomingdan') return 3; 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 0;
} }
return 3; return 3;
@ -196,7 +196,7 @@ card.hearth={
var rand=Math.random()<0.5; var rand=Math.random()<0.5;
target.chooseCard(true).ai=function(card){ target.chooseCard(true).ai=function(card){
if(rand) return Math.random(); if(rand) return Math.random();
return ai.get.value(card); return get.value(card);
}; };
"step 1" "step 1"
event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards); event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards);
@ -207,8 +207,8 @@ card.hearth={
player.chooseToDiscard(function(card){ player.chooseToDiscard(function(card){
return get.suit(card)==get.suit(_status.event.parent.card2); return get.suit(card)==get.suit(_status.event.parent.card2);
},function(card){ },function(card){
if(ai.get.damageEffect(target,player,player,'thunder')>0){ if(get.damageEffect(target,player,player,'thunder')>0){
return 6-ai.get.value(card,_status.event.player); return 6-get.value(card,_status.event.player);
} }
return -1; return -1;
}).prompt=false; }).prompt=false;
@ -230,7 +230,7 @@ card.hearth={
useful:1, useful:1,
}, },
wuxie:function(target,card,player,current,state){ 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:{ result:{
player:function(player){ player:function(player){
@ -571,7 +571,7 @@ card.hearth={
useful:[6,3], useful:[6,3],
result:{ result:{
target:function(player,target){ target:function(player,target){
var eff=ai.get.recoverEffect(target,player,target); var eff=get.recoverEffect(target,player,target);
if(eff<=0) return 0; if(eff<=0) return 0;
var num=target.maxHp-target.hp; var num=target.maxHp-target.hp;
if(num<1) return 0; if(num<1) return 0;
@ -595,7 +595,7 @@ card.hearth={
content:function(){ content:function(){
"step 0" "step 0"
target.chooseToDiscard([1,2],'he').ai=function(card){ 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(target.hasSkillTag('maixie')){
if(ui.selected.cards.length) return 0; if(ui.selected.cards.length) return 0;
} }
@ -608,9 +608,9 @@ card.hearth={
if(card.name=='tao') return 0; if(card.name=='tao') return 0;
if(target.hp==1&&card.name=='jiu') return 0; if(target.hp==1&&card.name=='jiu') return 0;
if(get.type(card)!='basic'){ 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" "step 1"
if(!result.bool||result.cards.length<2){ if(!result.bool||result.cards.length<2){

View File

@ -85,10 +85,10 @@ card.sp={
var card=target.getEquip(i); var card=target.getEquip(i);
if(card){ if(card){
if(i==1||i==4){ if(i==1||i==4){
num1+=ai.get.equipValue(card); num1+=get.equipValue(card);
} }
else{ else{
num2+=ai.get.equipValue(card); num2+=get.equipValue(card);
} }
} }
} }
@ -170,7 +170,7 @@ card.sp={
ai:{ ai:{
equipValue:function(card,player){ equipValue:function(card,player){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return player.canUse('sha',current)&&current.isHealthy()&&ai.get.attitude(player,current)<0; return player.canUse('sha',current)&&current.isHealthy()&&get.attitude(player,current)<0;
})){ })){
return 5; return 5;
} }
@ -326,7 +326,7 @@ card.sp={
var hs=player.getCards('h'); var hs=player.getCards('h');
if(hs.length<=1) return 0; if(hs.length<=1) return 0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<=5){ if(get.value(hs[i])<=5){
ok=true; ok=true;
break; break;
} }
@ -353,8 +353,8 @@ card.sp={
target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){ target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){
return get.type(card)!='basic'; return get.type(card)!='basic';
}).set('ai',function(card){ }).set('ai',function(card){
if(_status.event.goon) return 7-ai.get.value(card); if(_status.event.goon) return 7-get.value(card);
return 9-ai.get.value(card); return 9-get.value(card);
}).set('goon',target.countCards('h',{type:'basic'})>2); }).set('goon',target.countCards('h',{type:'basic'})>2);
event.more=true; event.more=true;
} }
@ -407,7 +407,7 @@ card.sp={
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(get.distance(target,current)<=1&&current!=target){ if(get.distance(target,current)<=1&&current!=target){
var att=ai.get.attitude(player,current); var att=get.attitude(player,current);
if(att>3){ if(att>3){
return 1.1; return 1.1;
} }
@ -438,7 +438,7 @@ card.sp={
}, },
prompt:'将一张手牌当闪打出', prompt:'将一张手牌当闪打出',
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
respondShan:true, respondShan:true,
@ -476,9 +476,9 @@ card.sp={
}, },
check:function(event,player){ check:function(event,player){
var target=event.target; 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){ if(player.hasCard(function(card){
return ai.get.value(card)>=8; return get.value(card)>=8;
})){ })){
return false; return false;
} }
@ -511,7 +511,7 @@ card.sp={
}, },
effect:{ effect:{
player:function(card,player,target){ 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]; return [1,-2];
} }
} }
@ -589,10 +589,10 @@ card.sp={
var nh=player.countCards('h'); var nh=player.countCards('h');
if(!player.needsToDiscard()){ if(!player.needsToDiscard()){
if(nh<3) return 0; if(nh<3) return 0;
if(nh==3) return 5-ai.get.value(card); if(nh==3) return 5-get.value(card);
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 10-ai.get.useful(card); return 10-get.useful(card);
}, },
discard:false, discard:false,
lose:true, lose:true,
@ -638,7 +638,7 @@ card.sp={
},muniu,muniu.cards); },muniu,muniu.cards);
var players=game.filterPlayer(function(current){ var players=game.filterPlayer(function(current){
if(!current.getEquip(5)&&current!=player&&!current.isTurnedOver()&& if(!current.getEquip(5)&&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){
return true; return true;
} }
}); });
@ -774,14 +774,14 @@ card.sp={
if(get.type(button.link)=='delay') return -1; if(get.type(button.link)=='delay') return -1;
if(get.type(button.link)=='equip'){ if(get.type(button.link)=='equip'){
var current=player.getCards('e',{subtype:get.subtype(button.link)})[0]; 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; return 1;
} }
if(get.tag(button.link,'multitarget')) return -1; if(get.tag(button.link,'multitarget')) return -1;
if(button.link.name=='huoshaolianying') return -1; if(button.link.name=='huoshaolianying') return -1;
} }
if(button.link.name=='jiu'){ 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;
} }
return -1; return -1;
@ -811,7 +811,7 @@ card.sp={
order:4, order:4,
result:{ result:{
player:function(player){ 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; return 1;
} }
}, },

View File

@ -82,10 +82,10 @@ card.standard={
var target=_status.event.player; var target=_status.event.player;
var evt=_status.event.getParent(); var evt=_status.event.getParent();
if(target.hasSkillTag('useShan')){ 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; if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1;
return 11-ai.get.value(card); return 11-get.value(card);
}); });
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
} }
@ -120,7 +120,7 @@ card.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){ if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){
if(ai.get.attitude(player,target)>0){ if(get.attitude(player,target)>0){
return -6; return -6;
} }
else{ else{
@ -237,7 +237,7 @@ card.standard={
if(target.hp>2||nd==0) return 0; if(target.hp>2||nd==0) return 0;
if(target.hp==2){ if(target.hp==2){
if(game.hasPlayer(function(current){ 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(current.hp<=1) return true;
if((mode=='identity'||mode=='versus'||mode=='chess')&&current.identity=='zhu'&&current.hp<=2) return true; if((mode=='identity'||mode=='versus'||mode=='chess')&&current.identity=='zhu'&&current.hp<=2) return true;
} }
@ -247,7 +247,7 @@ card.standard={
} }
} }
if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; 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; if(att<3&&att>=0&&player!=target) return 0;
var tri=_status.event.getTrigger(); var tri=_status.event.getTrigger();
if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){
@ -335,7 +335,7 @@ card.standard={
basic:{ basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(!game.hasPlayer(function(current){ 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; return 1;
} }
@ -504,7 +504,7 @@ card.standard={
} }
if(event.dialog.buttons.length>1){ if(event.dialog.buttons.length>1){
var next=target.chooseButton(true,function(button){ 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('dialog',event.preResult);
next.set('closeDialog',false); next.set('closeDialog',false);
@ -651,10 +651,10 @@ card.standard={
var next=target.chooseToRespond({name:'sha'}); var next=target.chooseToRespond({name:'sha'});
next.set('ai',function(card){ next.set('ai',function(card){
var evt=_status.event.getParent(); 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.player.hasSkillTag('notricksource')) return 0;
if(evt.target.hasSkillTag('notrick')) 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; next.autochoose=lib.filter.autoRespondSha;
"step 1" "step 1"
@ -664,7 +664,7 @@ card.standard={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; 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'}); var next=target.chooseToRespond({name:'shan'});
next.set('ai',function(card){ next.set('ai',function(card){
var evt=_status.event.getParent(); 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.player.hasSkillTag('notricksource')) return 0;
if(evt.target.hasSkillTag('notrick')) 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; next.autochoose=lib.filter.autoRespondShan;
"step 1" "step 1"
@ -722,7 +722,7 @@ card.standard={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; 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(target.hasSkillTag('notrick')) return 0;
if(event.player==target){ if(event.player==target){
if(player.hasSkill('naman')) return -1; if(player.hasSkill('naman')) return -1;
if(ai.get.attitude(target,player)<0||event.player.hp<=1){ if(get.attitude(target,player)<0||event.player.hp<=1){
return ai.get.unuseful2(card) return get.unuseful2(card)
} }
return -1; return -1;
} }
else{ else{
if(target.hasSkill('naman')) return -1; if(target.hasSkill('naman')) return -1;
if(ai.get.attitude(player,target)<0||event.player.hp<=1){ if(get.attitude(player,target)<0||event.player.hp<=1){
return ai.get.unuseful2(card) return get.unuseful2(card)
} }
return -1; return -1;
} }
@ -870,7 +870,7 @@ card.standard={
result:{ result:{
target:-1.5, target:-1.5,
player:function(player,target){ 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; return 0;
} }
var hs1=target.getCards('h','sha'); var hs1=target.getCards('h','sha');
@ -919,7 +919,7 @@ card.standard={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; return 0;
} }
}, },
@ -930,12 +930,12 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ 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'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 3; 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 -1.5;
} }
return 3; return 3;
@ -943,15 +943,15 @@ card.standard={
return -1.5; return -1.5;
}, },
player:function(player,target){ 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; return 0;
} }
if(ai.get.attitude(player,target)>1){ if(get.attitude(player,target)>1){
var js=target.getCards('j'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 1; 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 0;
} }
return 1; return 1;
@ -1000,12 +1000,12 @@ card.standard={
var noh=(nh==0||target.hasSkillTag('noh')); var noh=(nh==0||target.hasSkillTag('noh'));
if(noh&&noe) return 0; if(noh&&noe) return 0;
if(noh&&noe2) return 0.01; 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'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='guohe') return 3; 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 -1.5;
} }
return 2; return 2;
@ -1186,8 +1186,8 @@ card.standard={
for(var j=0;j<current.skills.length;j++){ for(var j=0;j<current.skills.length;j++){
var rejudge=get.tag(current.skills[j],'rejudge',current); var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){ if(rejudge!=undefined){
if(ai.get.attitude(target,current)>0&& if(get.attitude(target,current)>0&&
ai.get.attitude(current,target)>0){ get.attitude(current,target)>0){
return rejudge; return rejudge;
} }
else{ else{
@ -1201,7 +1201,7 @@ card.standard={
var mode=get.mode(); var mode=get.mode();
if(mode=='identity'){ if(mode=='identity'){
if(target.identity=='nei') return 1; if(target.identity=='nei') return 1;
var situ=ai.get.situation(); var situ=get.situation();
if(target.identity=='fan'){ if(target.identity=='fan'){
if(situ>1) return 1; 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){ player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.countCards('he')),function(button){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
var player=_status.event.player; var player=_status.event.player;
var eff=ai.get.damageEffect(trigger.target,player,player); var eff=get.damageEffect(trigger.target,player,player);
if(ai.get.attitude(player,trigger.target)>0){ if(get.attitude(player,trigger.target)>0){
if(eff>=0) return false; 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(trigger.target.hp==1) return false;
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')|| if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')||
player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false; player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false;
if(_status.event.dialog.buttons.length<2) return -1; if(_status.event.dialog.buttons.length<2) return -1;
var num=0; var num=0;
for(var i=0;i<_status.event.dialog.buttons.length;i++){ 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'); }).set('logSkill','hanbing_skill');
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1341,7 +1341,7 @@ card.standard={
"step 0" "step 0"
trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){
var trigger=_status.event.getTrigger(); 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" "step 1"
if(result.bool==false) player.draw(); if(result.bool==false) player.draw();
@ -1397,7 +1397,7 @@ card.standard={
prompt:'将两张手牌当杀使用或打出', prompt:'将两张手牌当杀使用或打出',
check:function(card){ check:function(card){
if(card.name=='sha') return 0; if(card.name=='sha') return 0;
return 6-ai.get.useful(card) return 6-get.useful(card)
}, },
ai:{ ai:{
respondSha:true, respondSha:true,
@ -1421,13 +1421,13 @@ card.standard={
next.logSkill='guanshi_skill'; next.logSkill='guanshi_skill';
next.set('ai',function(card){ next.set('ai',function(card){
var evt=_status.event.getParent(); 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')|| if(evt.player.hasSkill('jiu')||
evt.player.hasSkill('tianxianjiu')|| evt.player.hasSkill('tianxianjiu')||
evt._trigger.target.hp==1){ 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; return -1;
}); });
@ -1462,12 +1462,12 @@ card.standard={
audio:true, audio:true,
content:function(){ content:function(){
"step 0" "step 0"
var att=(ai.get.attitude(player,trigger.target)<=0); var att=(get.attitude(player,trigger.target)<=0);
var next=player.chooseButton(); var next=player.chooseButton();
next.set('att',att); next.set('att',att);
next.set('createDialog',['选择要弃置的马',trigger.target.getCards('e',{subtype:['equip3','equip4']})]); next.set('createDialog',['选择要弃置的马',trigger.target.getCards('e',{subtype:['equip3','equip4']})]);
next.set('ai',function(button){ next.set('ai',function(button){
if(_status.event.att) return ai.get.buttonValue(button); if(_status.event.att) return get.buttonValue(button);
return 0; return 0;
}); });
"step 1" "step 1"
@ -1488,7 +1488,7 @@ card.standard={
}, },
audio:true, audio:true,
check:function(event,player){ 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; return true;
}, },
content:function(){ content:function(){
@ -1594,7 +1594,7 @@ card.standard={
var aiii=info.ai.wuxie(source,card,source,_status.event.player,state); var aiii=info.ai.wuxie(source,card,source,_status.event.player,state);
if(typeof aiii=='number') return aiii; 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(source.hasSkill('guanxing')) return 0;
if(name!='lebu'&&name!='bingliang'){ if(name!='lebu'&&name!='bingliang'){
if(source!=_status.event.player){ if(source!=_status.event.player){
@ -1608,9 +1608,9 @@ card.standard={
else{ else{
card2=card; card2=card;
} }
var eff=ai.get.effect(source,card2,source,source); var eff=get.effect(source,card2,source,source);
if(eff>=0) return 0; if(eff>=0) return 0;
return state*ai.get.attitude(_status.event.player,source); return state*get.attitude(_status.event.player,source);
} }
else{ else{
var triggerevent=_status.event.getTrigger(); var triggerevent=_status.event.getTrigger();
@ -1627,12 +1627,12 @@ card.standard={
if(info.multitarget&&targets){ if(info.multitarget&&targets){
var eff=0; var eff=0;
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
eff+=ai.get.effect(targets[i],card,source,_status.event.player) eff+=get.effect(targets[i],card,source,_status.event.player)
} }
return -eff*state; return -eff*state;
} }
if(Math.abs(ai.get.attitude(_status.event.player,target))<3) return 0; if(Math.abs(get.attitude(_status.event.player,target))<3) return 0;
return -ai.get.effect(target,card,source,_status.event.player)*state; return -get.effect(target,card,source,_status.event.player)*state;
} }
}, },
source:target, source:target,

View File

@ -19,7 +19,7 @@ card.swd={
var rand=Math.random()<0.5; var rand=Math.random()<0.5;
target.chooseCard(true).ai=function(card){ target.chooseCard(true).ai=function(card){
if(rand) return Math.random(); if(rand) return Math.random();
return ai.get.value(card); return get.value(card);
}; };
"step 2" "step 2"
event.card2=result.cards[0]; event.card2=result.cards[0];
@ -117,7 +117,7 @@ card.swd={
} }
var dialog=ui.create.dialog('选择一张加入你的手牌',[list,'vcard'],'hidden'); var dialog=ui.create.dialog('选择一张加入你的手牌',[list,'vcard'],'hidden');
target.chooseButton(dialog,true).ai=function(button){ target.chooseButton(dialog,true).ai=function(button){
return ai.get.value({name:button.link[2]}); return get.value({name:button.link[2]});
}; };
'step 2' 'step 2'
if(result.buttons){ if(result.buttons){
@ -147,8 +147,8 @@ card.swd={
value:5, value:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)>0) return 0; if(get.attitude(player,target)>0) return 0;
if(ai.get.damageEffect(target,player,target)>=0) return 0; if(get.damageEffect(target,player,target)>=0) return 0;
return -1; return -1;
} }
}, },
@ -403,7 +403,7 @@ card.swd={
target:1 target:1
}, },
order:function(){ 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('机关火筒:弃置一张手牌或受到一点火焰伤害'); var next=target.chooseToDiscard('机关火筒:弃置一张手牌或受到一点火焰伤害');
next.set('ai',function(card){ next.set('ai',function(card){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
if(ai.get.damageEffect(evt.target,evt.player,evt.target,'fire')>=0) return 0; if(get.damageEffect(evt.target,evt.player,evt.target,'fire')>=0) return 0;
return 8-ai.get.useful(card); return 8-get.useful(card);
}); });
} }
else{ else{
@ -537,7 +537,7 @@ card.swd={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; if(target.countCards('h')>0||target.hp>1) return 0;
} }
}, },
@ -818,7 +818,7 @@ card.swd={
target:function(player,target){ target:function(player,target){
var players=game.filterPlayer(function(current){ var players=game.filterPlayer(function(current){
return (current!=player&&!current.isTurnedOver()&& 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); players.sort(lib.sort.seat);
if(target==players[0]) return 2; if(target==players[0]) return 2;
@ -1132,7 +1132,7 @@ card.swd={
if(hs.length==1) return num+1; if(hs.length==1) return num+1;
if(hs.length<=4){ if(hs.length<=4){
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])>6) return num; if(get.value(hs[i])>6) return num;
} }
} }
if(hs.length>4) return num+0.5; if(hs.length>4) return num+0.5;
@ -1455,7 +1455,7 @@ card.swd={
} }
else{ else{
target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){ target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}; };
} }
"step 1" "step 1"
@ -1517,7 +1517,7 @@ card.swd={
} }
player.chooseButton(ui.create.dialog('选择要复活的角色',[list,'character']),function(button){ player.chooseButton(ui.create.dialog('选择要复活的角色',[list,'character']),function(button){
for(var i=0;i<game.dead.length&&game.dead[i].name!=button.link;i++); for(var i=0;i<game.dead.length&&game.dead[i].name!=button.link;i++);
return ai.get.attitude(_status.event.player,game.dead[i]); return get.attitude(_status.event.player,game.dead[i]);
},true); },true);
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1540,14 +1540,14 @@ card.swd={
}, },
order:function(card,player){ order:function(card,player){
for(var i=0;i<game.dead.length;i++){ for(var i=0;i<game.dead.length;i++){
if(ai.get.attitude(player,game.dead[i])>3) return 7; if(get.attitude(player,game.dead[i])>3) return 7;
} }
return -10; return -10;
}, },
result:{ result:{
player:function(player){ player:function(player){
for(var i=0;i<game.dead.length;i++){ for(var i=0;i<game.dead.length;i++){
if(ai.get.attitude(player,game.dead[i])>3) return 2; if(get.attitude(player,game.dead[i])>3) return 2;
} }
return -10; return -10;
} }
@ -1604,7 +1604,7 @@ card.swd={
}, },
}, },
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.2; return get.order({name:'sha'})+0.2;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
@ -1629,9 +1629,9 @@ card.swd={
} }
if(card){ if(card){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (ai.get.attitude(target,current)<0&& return (get.attitude(target,current)<0&&
target.canUse(card,current,true,true)&& target.canUse(card,current,true,true)&&
ai.get.effect(current,card,target)>0); get.effect(current,card,target)>0);
})){ })){
return 1; return 1;
} }
@ -1754,7 +1754,7 @@ card.swd={
}, },
result:{ result:{
player:function(player,target){ 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; if(get.distance(player,target)>1) return 1;
return 0.6; return 0.6;
} }
@ -1776,10 +1776,10 @@ card.swd={
"step 0" "step 0"
var next=target.chooseToRespond({name:'sha'}); var next=target.chooseToRespond({name:'sha'});
next.ai=function(card){ 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(player.hasSkillTag('notricksource')) return 0;
if(target.hasSkillTag('notrick')) return 0; if(target.hasSkillTag('notrick')) return 0;
return 11-ai.get.value(card); return 11-get.value(card);
}; };
next.autochoose=lib.filter.autoRespondSha; next.autochoose=lib.filter.autoRespondSha;
"step 1" "step 1"
@ -1789,7 +1789,7 @@ card.swd={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
@ -1835,10 +1835,10 @@ card.swd={
"step 0" "step 0"
var next=target.chooseToRespond({name:'shan'}); var next=target.chooseToRespond({name:'shan'});
next.ai=function(card){ 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(player.hasSkillTag('notricksource')) return 0;
if(target.hasSkillTag('notrick')) return 0; if(target.hasSkillTag('notrick')) return 0;
return 11-ai.get.value(card); return 11-get.value(card);
}; };
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
"step 1" "step 1"
@ -1848,7 +1848,7 @@ card.swd={
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ 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; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
@ -2072,7 +2072,7 @@ card.swd={
selectCard:[1,Infinity], selectCard:[1,Infinity],
prompt:'弃置任意张基本牌并摸等量的牌', prompt:'弃置任意张基本牌并摸等量的牌',
check:function(card){ check:function(card){
return 6-ai.get.value(card) return 6-get.value(card)
}, },
content:function(){ content:function(){
player.draw(cards.length); player.draw(cards.length);
@ -2217,11 +2217,11 @@ card.swd={
return ui.cardPile.childElementCount>1; return ui.cardPile.childElementCount>1;
}, },
content:function(){ 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 num=Math.min(20,ui.cardPile.childElementCount);
var list=[],list2=[],list3=[]; var list=[],list2=[],list3=[];
for(var i=1;i<num;i++){ for(var i=1;i<num;i++){
var val=ai.get.value(ui.cardPile.childNodes[i]); var val=get.value(ui.cardPile.childNodes[i]);
if(val>value){ if(val>value){
list.push(ui.cardPile.childNodes[i]); list.push(ui.cardPile.childNodes[i]);
if(val>value+1&&val>=7){ if(val>value+1&&val>=7){
@ -2286,11 +2286,11 @@ card.swd={
}, },
ai:{ ai:{
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.11; return get.order({name:'sha'})+0.11;
}, },
result:{ result:{
target:function(player,target){ 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; if(player==target) return false;
return target.countCards('he')>0; return target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2443,7 +2443,7 @@ card.swd={
}, },
logTarget:'source', logTarget:'source',
check:function(event,player){ 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(){ content:function(){
'step 0' 'step 0'
@ -2485,7 +2485,7 @@ card.swd={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget([1,3],get.prompt('cangchizhibi')).ai=function(target){ 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()){ if(target.isLinked()){
return att; return att;
} }
@ -2507,7 +2507,7 @@ card.swd={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('cangchizhibi_duanzao')).ai=function(target){ 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()){ if(target.isLinked()){
return att; return att;
} }
@ -2542,7 +2542,7 @@ card.swd={
'step 0' 'step 0'
var next=player.chooseToDiscard('he',{color:'black'},get.prompt('huanglinzhicong_duanzao')); var next=player.chooseToDiscard('he',{color:'black'},get.prompt('huanglinzhicong_duanzao'));
next.ai=function(card){ next.ai=function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}; };
next.logSkill='huanglinzhicong_equip1' next.logSkill='huanglinzhicong_equip1'
'step 1' 'step 1'
@ -2573,8 +2573,8 @@ card.swd={
'step 0' 'step 0'
var next=player.chooseToDiscard('he',{color:'red'},get.prompt('xuanwuzhihuang_duanzao')); var next=player.chooseToDiscard('he',{color:'red'},get.prompt('xuanwuzhihuang_duanzao'));
next.ai=function(card){ next.ai=function(card){
if(ai.get.recoverEffect(player,player,player)<=0) return 0; if(get.recoverEffect(player,player,player)<=0) return 0;
return 8-ai.get.value(card); return 8-get.value(card);
}; };
next.logSkill='xuanwuzhihuang_equip1' next.logSkill='xuanwuzhihuang_equip1'
'step 1' 'step 1'
@ -2612,10 +2612,10 @@ card.swd={
return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player);
}, },
ai1:function(card){ ai1:function(card){
return 9-ai.get.value(card); return 9-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
}, },
prompt:get.prompt('zhuquezhizhang_duanzao') prompt:get.prompt('zhuquezhizhang_duanzao')
}); });
@ -2655,7 +2655,7 @@ card.swd={
if(player==target) return false; if(player==target) return false;
return target.countCards('he')>0; return target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2794,7 +2794,7 @@ card.swd={
usable:1, usable:1,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0; return target!=player&&target.countCards('h')>0;
@ -2870,10 +2870,10 @@ card.swd={
filterTarget:true, filterTarget:true,
filterCard:lib.filter.cardDiscardable, filterCard:lib.filter.cardDiscardable,
ai1:function(card){ ai1:function(card){
return 8-ai.get.useful(card); return 8-get.useful(card);
}, },
ai2:function(target){ ai2:function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}, },
prompt:get.prompt('donghuangzhong') prompt:get.prompt('donghuangzhong')
}); });
@ -2920,7 +2920,7 @@ card.swd={
if(game.dead.length){ if(game.dead.length){
player.chooseButton(ui.create.dialog([list,'character']),function(button){ player.chooseButton(ui.create.dialog([list,'character']),function(button){
for(var i=0;i<game.dead.length&&game.dead[i].name!=button.link;i++); for(var i=0;i<game.dead.length&&game.dead[i].name!=button.link;i++);
return -ai.get.attitude(_status.event.player,game.dead[i]); return -get.attitude(_status.event.player,game.dead[i]);
},true); },true);
if(game.players.length+game.dead.length<8){ if(game.players.length+game.dead.length<8){
event.control=ui.create.control('新角色',ui.click.cancel) event.control=ui.create.control('新角色',ui.click.cancel)
@ -3019,7 +3019,7 @@ card.swd={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return ai.get.value(card); return get.value(card);
}, },
discard:false, discard:false,
prepare:'throw', prepare:'throw',
@ -3031,7 +3031,7 @@ card.swd={
game.delay(0,2500); game.delay(0,2500);
"step 1" "step 1"
target.removeAttribute('style'); target.removeAttribute('style');
if(Math.random()<(ai.get.value(cards[0])+1)*(target.maxHp-target.hp)/(60*target.maxHp)){ if(Math.random()<(get.value(cards[0])+1)*(target.maxHp-target.hp)/(60*target.maxHp)){
event.position=target.dataset.position; event.position=target.dataset.position;
target.dataset.position=player.dataset.position; target.dataset.position=player.dataset.position;
target.delete(); target.delete();
@ -3071,10 +3071,10 @@ card.swd={
"step 0" "step 0"
event.cards=get.cards(2); event.cards=get.cards(2);
player.chooseCardButton(true,event.cards,'昊天塔:选择一张牌作为'+get.translation(trigger.player)+'的'+trigger.judgestr+'判定结果').ai=function(button){ player.chooseCardButton(true,event.cards,'昊天塔:选择一张牌作为'+get.translation(trigger.player)+'的'+trigger.judgestr+'判定结果').ai=function(button){
if(ai.get.attitude(player,trigger.player)>0){ if(get.attitude(player,trigger.player)>0){
return 1+trigger.judge(button.link); 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 1-trigger.judge(button.link);
} }
return 0; return 0;
@ -3155,7 +3155,7 @@ card.swd={
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
if(get.tag(card,'recover')>=1) return 0; if(get.tag(card,'recover')>=1) return 0;
return 7-ai.get.value(card); return 7-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.hp<player.maxHp&&player.countCards('h')>=2; return player.hp<player.maxHp&&player.countCards('h')>=2;
@ -3166,7 +3166,7 @@ card.swd={
ai:{ ai:{
result:{ result:{
player:function(player){ player:function(player){
return ai.get.recoverEffect(player); return get.recoverEffect(player);
} }
}, },
order:2.5 order:2.5
@ -3195,7 +3195,7 @@ card.swd={
return event.player.hp<=0&&player.hp>1; return event.player.hp<=0&&player.hp>1;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>=3; return get.attitude(player,event.player)>=3;
}, },
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
@ -3227,7 +3227,7 @@ card.swd={
player.chooseTarget('选择一个目标视为'+get.translation(target)+'对其使用一张杀',function(card,player,target2){ player.chooseTarget('选择一个目标视为'+get.translation(target)+'对其使用一张杀',function(card,player,target2){
return player!=target2&&target.canUse('sha',target2); return player!=target2&&target.canUse('sha',target2);
}).ai=function(target2){ }).ai=function(target2){
return ai.get.effect(target2,{name:'sha'},target,player); return get.effect(target2,{name:'sha'},target,player);
} }
} }
else{ else{
@ -3243,10 +3243,10 @@ card.swd={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.countCards('h')<=1) return 0; 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){ if(game.hasPlayer(function(current){
return (player!=current&&target.canUse('sha',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; return -1;
} }
@ -3366,7 +3366,7 @@ card.swd={
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return !player.isTurnedOver(); return !player.isTurnedOver();
@ -3463,7 +3463,7 @@ card.swd={
return target.countCards('he')>0; return target.countCards('he')>0;
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
target.discard(target.getCards('he').randomGet()); target.discard(target.getCards('he').randomGet());
@ -3499,7 +3499,7 @@ card.swd={
hslingjian_zhongxinghujia_equip2:{ hslingjian_zhongxinghujia_equip2:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<0; return get.attitude(player,event.source)<0;
}, },
filter:function(event){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.source&&event.source.getEquip(2); return event.card&&event.card.name=='sha'&&event.source&&event.source.getEquip(2);
@ -3534,7 +3534,7 @@ card.swd={
return player.countCards('he')>=2; return player.countCards('he')>=2;
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
var card=game.createCard(get.inpile('equip2').randomGet()); var card=game.createCard(get.inpile('equip2').randomGet());
@ -3556,9 +3556,9 @@ card.swd={
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
check:function(event,player){ check:function(event,player){
if(event.player.isTurnedOver()){ 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){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive(); return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive();
@ -3573,9 +3573,9 @@ card.swd={
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
if(event.player.isTurnedOver()){ 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){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.source&&event.source.isAlive(); 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){ player.chooseTarget(get.prompt('hslingjian_jinjilengdong_duanzao'),function(card,player,target){
return player!=target&&!target.isTurnedOver(); return player!=target&&!target.isTurnedOver();
}).ai=function(target){ }).ai=function(target){
return Math.max(0,-ai.get.attitude(player,target)-2); return Math.max(0,-get.attitude(player,target)-2);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3634,7 +3634,7 @@ card.swd={
player.chooseTarget(get.prompt('hslingjian_yinmilichang_duanzao'),function(card,player,target){ player.chooseTarget(get.prompt('hslingjian_yinmilichang_duanzao'),function(card,player,target){
return target!=player&&!target.hasSkill('qianxing'); return target!=player&&!target.hasSkill('qianxing');
}).ai=function(target){ }).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(get.distance(player,target,'absolute')<=1) return 0;
if(target.hp==1) return 2*att; if(target.hp==1) return 2*att;
if(target.hp==2&&target.countCards('h')<=2) return 1.2*att; if(target.hp==2&&target.countCards('h')<=2) return 1.2*att;
@ -3777,7 +3777,7 @@ card.swd={
filterCard:true, filterCard:true,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
position:'he', position:'he',
filterTarget:true, filterTarget:true,
@ -3850,7 +3850,7 @@ card.swd={
target.$gain2(es); target.$gain2(es);
}, },
check:function(card){ check:function(card){
return 4-ai.get.value(card); return 4-get.value(card);
}, },
ai:{ ai:{
order:5, order:5,
@ -3869,7 +3869,7 @@ card.swd={
}, },
filterCard:{type:['trick','delay']}, filterCard:{type:['trick','delay']},
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
viewAs:{name:'jiguanshu'} viewAs:{name:'jiguanshu'}
}, },
@ -3946,7 +3946,7 @@ card.swd={
} }
return 0; return 0;
} }
var num=1+ai.get.value(card); var num=1+get.value(card);
if(get.position(card)=='e'){ if(get.position(card)=='e'){
num+=0.1; num+=0.1;
} }
@ -4100,7 +4100,7 @@ card.swd={
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
return !target.isMin()&&get.distance(player,target)<=1; return !target.isMin()&&get.distance(player,target)<=1;
},'选择一个目标装备'+get.translation(card.name)).ai=function(target){ },'选择一个目标装备'+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; event.card=card;
'step 1' 'step 1'
@ -4180,8 +4180,8 @@ card.swd={
}, },
content:function(){ content:function(){
player.gainPlayerCard(get.prompt('qinglonglingzhu',trigger.player),trigger.player,function(button){ player.gainPlayerCard(get.prompt('qinglonglingzhu',trigger.player),trigger.player,function(button){
if(ai.get.attitude(player,trigger.player)<=0){ if(get.attitude(player,trigger.player)<=0){
return ai.get.buttonValue(button); return get.buttonValue(button);
} }
return 0; return 0;
},'he').logSkill=['qinglonglingzhu',trigger.player]; },'he').logSkill=['qinglonglingzhu',trigger.player];
@ -4210,7 +4210,7 @@ card.swd={
fengxueren:{ fengxueren:{
trigger:{player:'shaHit'}, trigger:{player:'shaHit'},
check:function(event,player){ 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(player.hasSkill('jiu')) return att>0;
if(event.target.hp==1) return att>0; if(event.target.hp==1) return att>0;
if(event.target.hasSkillTag('maixie')){ if(event.target.hasSkillTag('maixie')){
@ -4274,7 +4274,7 @@ card.swd={
}); });
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.countCards('h')==0) return false; if(target.countCards('h')==0) return false;
@ -4364,11 +4364,11 @@ card.swd={
else if(x<0.3) target.loseHp(); else if(x<0.3) target.loseHp();
else if(x<0.4) target.recover(); else if(x<0.4) target.recover();
else if(x<0.6){ 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 target.chooseToDiscard(true);
} }
else if(x<0.8){ 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(); else target.loseHp();
} }
} }
@ -4430,7 +4430,7 @@ card.swd={
player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){
return player!=target&&target.countCards('he')>0; return player!=target&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
break; break;
} }
@ -4472,7 +4472,7 @@ card.swd={
// game.delay(); // game.delay();
}, },
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
position:'he', position:'he',
ai:{ ai:{
@ -4554,7 +4554,7 @@ card.swd={
order:10, order:10,
result:{ result:{
target:function(player,target){ 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){ if(player.storage.nigong>=4&&num>0){
num=0; num=0;
} }
@ -4583,7 +4583,7 @@ card.swd={
sadengjinhuan:{ sadengjinhuan:{
trigger:{player:'shaMiss'}, trigger:{player:'shaMiss'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -4625,7 +4625,7 @@ card.swd={
guiyanfadao:{ guiyanfadao:{
trigger:{player:'shaHit'}, trigger:{player:'shaHit'},
check:function(event,player){ 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(player.hasSkill('jiu')) return att>0;
if(event.target.hasSkillTag('maixie_hp')){ if(event.target.hasSkillTag('maixie_hp')){
return att<=0; return att<=0;

View File

@ -55,13 +55,13 @@ card.yunchou={
var minValue=20; var minValue=20;
var hs=target.getCards('h'); var hs=target.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
minValue=Math.min(minValue,ai.get.value(hs[i],target)); minValue=Math.min(minValue,get.value(hs[i],target));
} }
if(target.isUnderControl(true)){ if(target.isUnderControl(true)){
event.dialog.setCaption('选择一张牌并用一张手牌替换之'); event.dialog.setCaption('选择一张牌并用一张手牌替换之');
} }
var next=target.chooseButton(function(button){ var next=target.chooseButton(function(button){
return ai.get.value(button.link,_status.event.player)-minValue; return get.value(button.link,_status.event.player)-minValue;
}); });
next.set('dialog',event.preResult); next.set('dialog',event.preResult);
next.set('closeDialog',false); next.set('closeDialog',false);
@ -71,7 +71,7 @@ card.yunchou={
if(result.bool){ if(result.bool){
event.button=result.buttons[0]; event.button=result.buttons[0];
target.chooseCard('用一张牌牌替换'+get.translation(result.links),true).ai=function(card){ target.chooseCard('用一张牌牌替换'+get.translation(result.links),true).ai=function(card){
return -ai.get.value(card); return -get.value(card);
} }
} }
else{ else{
@ -101,17 +101,17 @@ card.yunchou={
return; return;
} }
var nextSeat=_status.currentPhase.next; var nextSeat=_status.currentPhase.next;
var att=ai.get.attitude(player,nextSeat); var att=get.attitude(player,nextSeat);
if(player.isUnderControl(true)&&!_status.auto){ if(player.isUnderControl(true)&&!_status.auto){
event.dialog.setCaption('将任意张牌以任意顺序置于牌堆顶(先选择的在上)'); event.dialog.setCaption('将任意张牌以任意顺序置于牌堆顶(先选择的在上)');
} }
var next=player.chooseButton([1,event.dialog.buttons.length],event.dialog); var next=player.chooseButton([1,event.dialog.buttons.length],event.dialog);
next.ai=function(button){ next.ai=function(button){
if(att>0){ if(att>0){
return ai.get.value(button.link,nextSeat)-5; return get.value(button.link,nextSeat)-5;
} }
else{ else{
return 5-ai.get.value(button.link,nextSeat); return 5-get.value(button.link,nextSeat);
} }
} }
next.set('closeDialog',false); next.set('closeDialog',false);
@ -172,7 +172,7 @@ card.yunchou={
target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[ target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[
'将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张' '将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张'
],function(){ ],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; if(target.countCards('h','sha')>=3) return 1;
return 0; return 0;
}); });
@ -325,11 +325,11 @@ card.yunchou={
if(event.list.length){ if(event.list.length){
event.current=event.list.shift(); event.current=event.list.shift();
event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ 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 hs=player.getCards('h');
var dutag=player.hasSkillTag('nodu'); var dutag=player.hasSkillTag('nodu');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var value=ai.get.value(hs[i],player); var value=get.value(hs[i],player);
if(hs[i].name=='du'&&dutag) continue; if(hs[i].name=='du'&&dutag) continue;
if(value<0) return true; if(value<0) return true;
if(!_status.event.hasTarget){ if(!_status.event.hasTarget){
@ -387,7 +387,7 @@ card.yunchou={
target:function(player,target){ target:function(player,target){
var hs=target.getCards('h'); var hs=target.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var value=ai.get.value(hs[i]); var value=get.value(hs[i]);
if(hs[i].number>=7&&value<=6) return 1; if(hs[i].number>=7&&value<=6) return 1;
if(value<=3) return 1; if(value<=3) return 1;
} }
@ -437,12 +437,12 @@ card.yunchou={
useful:[5,1], useful:[5,1],
order:1, order:1,
wuxie:function(target,card,player,current,state){ wuxie:function(target,card,player,current,state){
return -state*ai.get.attitude(player,current); return -state*get.attitude(player,current);
}, },
result:{ result:{
player:function(player){ player:function(player){
if(_status.event.parent.youdiinfo&& 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 1;
} }
return 0; return 0;
@ -469,7 +469,7 @@ card.yunchou={
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=0; var num=0;
if(target.isLowestHp()&&ai.get.recoverEffect(target)>0){ if(target.isLowestHp()&&get.recoverEffect(target)>0){
if(target.hp==1){ if(target.hp==1){
num+=3; num+=3;
} }
@ -552,7 +552,7 @@ card.yunchou={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.getCards('e',{subtype:'equip5'}).length){ if(target.getCards('e',{subtype:'equip5'}).length){
if(ai.get.attitude(target,player)>0){ if(get.attitude(target,player)>0){
return -0.5; return -0.5;
} }
return -1; return -1;
@ -661,7 +661,7 @@ card.yunchou={
if(_status.auto&&event.addedTarget==game.me){ if(_status.auto&&event.addedTarget==game.me){
game.delay(); 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{ else{
event.finish(); event.finish();
@ -875,15 +875,15 @@ card.yunchou={
else{ else{
target.chooseToDiscard('he',2).ai=function(card){ target.chooseToDiscard('he',2).ai=function(card){
if(target.hasSkillTag('nofire')) return 0; 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(player.hasSkillTag('notricksource')) return 0;
if(target.hasSkillTag('notrick')) return 0; if(target.hasSkillTag('notrick')) return 0;
if(card.name=='tao') return 0; if(card.name=='tao') return 0;
if(target.hp==1&&card.name=='jiu') return 0; if(target.hp==1&&card.name=='jiu') return 0;
if(target.hp==1&&get.type(card)!='basic'){ 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" "step 1"
@ -900,7 +900,7 @@ card.yunchou={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nofire')) return 0; 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; return -2;
} }
var nh=target.countCards('he'); var nh=target.countCards('he');

View File

@ -275,8 +275,8 @@ card.zhenfa={
player.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ player.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){
return get.type(card)!='basic'; return get.type(card)!='basic';
}).ai=function(card){ }).ai=function(card){
if(ai.get.effect(target,{name:'sha'},player,player)>0){ if(get.effect(target,{name:'sha'},player,player)>0){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 0; return 0;
}; };
@ -290,8 +290,8 @@ card.zhenfa={
event.player2.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ event.player2.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){
return get.type(card)!='basic'; return get.type(card)!='basic';
}).ai=function(card){ }).ai=function(card){
if(ai.get.effect(target,{name:'sha'},event.player2,event.player2)>0){ if(get.effect(target,{name:'sha'},event.player2,event.player2)>0){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 0; return 0;
}; };
@ -322,7 +322,7 @@ card.zhenfa={
"step 0" "step 0"
var next=target.chooseToRespond({name:'shan'}); var next=target.chooseToRespond({name:'shan'});
next.ai=function(card){ 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; return 1;
}; };
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;

View File

@ -48,7 +48,7 @@ character.diy={
return player.countCards('h',{type:'basic'})>0; return player.countCards('h',{type:'basic'})>0;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
group:'liangce2' group:'liangce2'
}, },
@ -67,7 +67,7 @@ character.diy={
var dialog=ui.create.dialog(get.prompt('liangce'),trigger.remained,'hidden'); var dialog=ui.create.dialog(get.prompt('liangce'),trigger.remained,'hidden');
dialog.classList.add('noselect'); dialog.classList.add('noselect');
player.chooseTarget(dialog).ai=function(target){ 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; if(du>=trigger.remained.length/2) return -att;
return att; return att;
} }
@ -97,8 +97,8 @@ character.diy={
return _status.event.getTrigger().targets.contains(target); return _status.event.getTrigger().targets.contains(target);
}).set('ai',function(target){ }).set('ai',function(target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
var eff=-ai.get.effect(target,trigger.card,trigger.player,_status.event.player); var eff=-get.effect(target,trigger.card,trigger.player,_status.event.player);
if(trigger.card.name=='wugu'&&eff==0&&ai.get.attitude(player,target)<0){ if(trigger.card.name=='wugu'&&eff==0&&get.attitude(player,target)<0){
return 0.01; return 0.01;
} }
return eff; return eff;
@ -148,14 +148,14 @@ character.diy={
var player=_status.event.player; var player=_status.event.player;
var he=player.getCards('he'); var he=player.getCards('he');
var subtype=get.subtype(card); var subtype=get.subtype(card);
var value=ai.get.equipValue(card); var value=get.equipValue(card);
for(var i=0;i<he.length;i++){ for(var i=0;i<he.length;i++){
if(he[i]!=card&&get.subtype(he[i])==subtype&&ai.get.equipValue(he[i])>=value){ if(he[i]!=card&&get.subtype(he[i])==subtype&&get.equipValue(he[i])>=value){
return 10; return 10;
} }
} }
if(!player.needsToDiscard()){ if(!player.needsToDiscard()){
return 4-ai.get.equipValue(card); return 4-get.equipValue(card);
} }
return 0; return 0;
}, },
@ -186,7 +186,7 @@ character.diy={
return lib.filter.cardEnabled({name:'diaobingqianjiang'},target); return lib.filter.cardEnabled({name:'diaobingqianjiang'},target);
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
var list=game.filterPlayer(); var list=game.filterPlayer();
@ -197,9 +197,9 @@ character.diy={
order:1, order:1,
result:{ result:{
player:function(player,target){ 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 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', logTarget:'player',
check:function(event,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]); var subtype=get.subtype(event.cards[0]);
if(att>0){ if(att>0){
if(event.player.countCards('h')>=player.countCards('h')+2) return true; if(event.player.countCards('h')>=player.countCards('h')+2) return true;
@ -230,13 +230,13 @@ character.diy={
var bool=false; var bool=false;
var subtype=get.subtype(trigger.cards[0]); var subtype=get.subtype(trigger.cards[0]);
var current=trigger.player.getEquip('e',parseInt(subtype[5])); 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(current){
if(att>0){ if(att>0){
bool=true; bool=true;
} }
else{ else{
if(ai.get.equipValue(current)>ai.get.equipValue(trigger.cards[0])){ if(get.equipValue(current)>get.equipValue(trigger.cards[0])){
bool=true; bool=true;
} }
} }
@ -244,14 +244,14 @@ character.diy={
trigger.player.chooseCard('立断:将一张手牌交给'+get.translation(player)+',或取消并使用'+get.translation(trigger.cards)).ai=function(card){ trigger.player.chooseCard('立断:将一张手牌交给'+get.translation(player)+',或取消并使用'+get.translation(trigger.cards)).ai=function(card){
if(bool){ if(bool){
if(att>0){ if(att>0){
return 8-ai.get.value(card); return 8-get.value(card);
} }
else{ else{
return 4-ai.get.value(card); return 4-get.value(card);
} }
} }
else{ else{
if(att<=0) return -ai.get.value(card); if(att<=0) return -get.value(card);
return 0; return 0;
} }
} }
@ -312,18 +312,18 @@ character.diy={
content:function(){ content:function(){
'step 0' 'step 0'
var bool=false; 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; bool=true;
} }
player.chooseCard('he',get.prompt('fuchou',trigger.player)).ai=function(card){ player.chooseCard('he',get.prompt('fuchou',trigger.player)).ai=function(card){
if(bool){ if(bool){
if(player.hp<=1){ if(player.hp<=1){
if(get.tag(card,'save')) return 0; 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' 'step 1'
if(result.bool){ if(result.bool){
@ -397,11 +397,11 @@ character.diy={
}, },
content:function(){ content:function(){
'step 0' '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)); var next=player.chooseToDiscard('he',{type:'equip'},get.prompt('youzhan',trigger.target));
next.ai=function(card){ next.ai=function(card){
if(bool){ if(bool){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
}; };
@ -432,7 +432,7 @@ character.diy={
if(get.type(result.links[0])=='basic'){ if(get.type(result.links[0])=='basic'){
player.chooseTarget([1,player.maxHp-player.hp], player.chooseTarget([1,player.maxHp-player.hp],
'选择至多'+get.cnNumber(player.maxHp-player.hp)+'名角色各摸一张牌').ai=function(target){ '选择至多'+get.cnNumber(player.maxHp-player.hp)+'名角色各摸一张牌').ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
} }
else{ else{
@ -490,7 +490,7 @@ character.diy={
content:function(){ content:function(){
'step 0' 'step 0'
var bool=false; 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; bool=true;
} }
player.chooseCardButton(get.prompt('zhucheng',_status.currentPhase),player.storage.zhucheng).ai=function(button){ player.chooseCardButton(get.prompt('zhucheng',_status.currentPhase),player.storage.zhucheng).ai=function(button){
@ -562,7 +562,7 @@ character.diy={
sha=true; sha=true;
} }
else{ else{
if(ai.get.value(he[i])<=6){ if(get.value(he[i])<=6){
return [1,0,1,-0.5]; return [1,0,1,-0.5];
} }
} }
@ -577,8 +577,8 @@ character.diy={
zhucheng2:{ zhucheng2:{
trigger:{target:'shaBefore'}, trigger:{target:'shaBefore'},
check:function(event,player){ check:function(event,player){
if(ai.get.attitude(event.player,player)<=0) return true; if(get.attitude(event.player,player)<=0) return true;
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){ filter:function(event,player){
return player.storage.zhucheng&&player.storage.zhucheng.length>0; return player.storage.zhucheng&&player.storage.zhucheng.length>0;
@ -586,13 +586,13 @@ character.diy={
content:function(){ content:function(){
'step 0' 'step 0'
var bool=false; 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; bool=true;
} }
var num=player.storage.zhucheng.length; var num=player.storage.zhucheng.length;
trigger.player.chooseToDiscard('弃置'+get.cnNumber(num)+'张牌,或令杀无效',num).ai=function(card){ trigger.player.chooseToDiscard('弃置'+get.cnNumber(num)+'张牌,或令杀无效',num).ai=function(card){
if(bool){ if(bool){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
} }
@ -764,7 +764,7 @@ character.diy={
return lib.filter.filterTarget({name:'bingliang'},player,target); return lib.filter.filterTarget({name:'bingliang'},player,target);
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
player.useCard({name:'bingliang'},target,cards).animate=false; player.useCard({name:'bingliang'},target,cards).animate=false;
@ -773,7 +773,7 @@ character.diy={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.effect(target,{name:'bingliang'},player,target); return get.effect(target,{name:'bingliang'},player,target);
} }
}, },
order:9, order:9,
@ -856,7 +856,7 @@ character.diy={
}, },
viewAs:{name:'shuiyanqijun'}, viewAs:{name:'shuiyanqijun'},
prompt:'将一张非基本牌当水淹七军使用', prompt:'将一张非基本牌当水淹七军使用',
check:function(card){return 8-ai.get.value(card)}, check:function(card){return 8-get.value(card)},
group:'luweiyan2' group:'luweiyan2'
}, },
luweiyan2:{ luweiyan2:{
@ -876,7 +876,7 @@ character.diy={
player.chooseTarget('是否视为使用一张杀?',function(card,player,target){ player.chooseTarget('是否视为使用一张杀?',function(card,player,target){
return trigger.targets.contains(target)&&player.canUse('sha',target,false); return trigger.targets.contains(target)&&player.canUse('sha',target,false);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -897,7 +897,7 @@ character.diy={
honglian:{ honglian:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0; return get.attitude(player,event.player)<0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source!=player&&event.source.countCards('he',{color:'red'})>0; return event.source&&event.source!=player&&event.source.countCards('he',{color:'red'})>0;
@ -910,7 +910,7 @@ character.diy={
result:{ result:{
threaten:0.8, threaten:0.8,
target:function(card,player,target){ 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'})]; return [1,0,0,-player.countCards('he',{color:'red'})];
} }
} }
@ -930,7 +930,7 @@ character.diy={
next=player.discardPlayerCard(player,'hej',2,true); next=player.discardPlayerCard(player,'hej',2,true);
next.ai=function(button){ next.ai=function(button){
if(get.position(button.link)=='j') return 10; if(get.position(button.link)=='j') return 10;
return -ai.get.value(button.link); return -get.value(button.link);
}; };
next.filterButton=function(button){ next.filterButton=function(button){
return lib.filter.cardDiscardable(button.link,player); return lib.filter.cardDiscardable(button.link,player);
@ -977,13 +977,13 @@ character.diy={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseToDiscard(get.prompt('zonghuo')).ai=function(card){ 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(trigger.player.hasSkillTag('nofire')){
if(att>0) return 8-ai.get.value(card); if(att>0) return 8-get.value(card);
return -1; return -1;
} }
if(att<0){ if(att<0){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return -1; return -1;
} }
@ -1005,7 +1005,7 @@ character.diy={
player.chooseTarget(get.prompt('shaoying'),function(card,player,target){ player.chooseTarget(get.prompt('shaoying'),function(card,player,target){
return get.distance(trigger.player,target)<=1&&trigger.player!=target; return get.distance(trigger.player,target)<=1&&trigger.player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1082,7 +1082,7 @@ character.diy={
}, },
content:function(){ content:function(){
"step 0" "step 0"
var att=ai.get.attitude(trigger.player,player); var att=get.attitude(trigger.player,player);
var bool=0; var bool=0;
if(att<0){ if(att<0){
if(trigger.player.countCards('e')==0&&trigger.player.countCards('h')>2) bool=1; if(trigger.player.countCards('e')==0&&trigger.player.countCards('h')>2) bool=1;
@ -1168,7 +1168,7 @@ character.diy={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
if(player.isLinked()==false) player.link(); if(player.isLinked()==false) player.link();
@ -1263,7 +1263,7 @@ character.diy={
} }
}, },
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
position:'he', position:'he',
ai:{ ai:{
@ -1277,7 +1277,7 @@ character.diy={
}, },
target:function(player,target){ target:function(player,target){
if(player.hp<=1) return 0; if(player.hp<=1) return 0;
return ai.get.damageEffect(target,player); return get.damageEffect(target,player);
} }
} }
}, },

View File

@ -32,7 +32,7 @@ character.extra={
var recover=0,lose=0,players=game.filterPlayer(); var recover=0,lose=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp<players[i].maxHp){ if(players[i].hp<players[i].maxHp){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
if(players[i].hp<2){ if(players[i].hp<2){
lose--; lose--;
recover+=0.5; recover+=0.5;
@ -40,7 +40,7 @@ character.extra={
lose--; lose--;
recover++; recover++;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
if(players[i].hp<2){ if(players[i].hp<2){
lose++; lose++;
recover-=0.5; recover-=0.5;
@ -50,10 +50,10 @@ character.extra={
} }
} }
else{ else{
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
lose--; lose--;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
lose++; lose++;
} }
} }
@ -183,7 +183,7 @@ character.extra={
player:function(player){ player:function(player){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current!=player){ 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(cards.length){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (player.canUse('sha',current)&& return (player.canUse('sha',current)&&
ai.get.effect(current,cards[0],player,player)>0&&current.hasShan()); get.effect(current,cards[0],player,player)>0&&current.hasShan());
})){ })){
return 1; return 1;
} }
@ -312,13 +312,13 @@ character.extra={
var trigger=_status.event.parent._trigger; var trigger=_status.event.parent._trigger;
var player=_status.event.player; var player=_status.event.player;
var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); 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||result==0) return 0;
if(attitude>0){ if(attitude>0){
return result-ai.get.value(card)/2; return result-get.value(card)/2;
} }
else{ else{
return -result-ai.get.value(card)/2; return -result-get.value(card)/2;
} }
}; };
"step 1" "step 1"
@ -364,11 +364,11 @@ character.extra={
return player!=target return player!=target
}).ai=function(target){ }).ai=function(target){
if(target.isTurnedOver()){ if(target.isTurnedOver()){
return ai.get.attitude(player,target)-1; return get.attitude(player,target)-1;
} }
else{ else{
if(player.maxHp-player.hp==1){ if(player.maxHp-player.hp==1){
return -ai.get.attitude(player,target)-1; return -get.attitude(player,target)-1;
} }
} }
return 0; return 0;
@ -407,7 +407,7 @@ character.extra={
filterCard:true, filterCard:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
prompt:'弃置一枚“忍”,然后弃置任意张牌并摸等量的牌', prompt:'弃置一枚“忍”,然后弃置任意张牌并摸等量的牌',
check:function(card){return 6-ai.get.value(card)}, check:function(card){return 6-get.value(card)},
content:function(){ content:function(){
player.storage.renjie--; player.storage.renjie--;
player.updateMarks(); player.updateMarks();
@ -420,7 +420,7 @@ character.extra={
var num=0; var num=0;
var cards=player.getCards('he'); var cards=player.getCards('he');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.value(cards[i])<6){ if(get.value(cards[i])<6){
num++; num++;
} }
} }
@ -501,7 +501,7 @@ character.extra={
if(target.hp<=1&&get.tag(card,'damage')){ if(target.hp<=1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-5]; if(player.hasSkillTag('jueqing')) return [1,-5];
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
if(player.hp>2&&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]; return [1,0,0,-player.hp];
} }
} }
@ -525,10 +525,10 @@ character.extra={
check:function(event,player){ check:function(event,player){
if(player.isTurnedOver()) return true; if(player.isTurnedOver()) return true;
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current.countCards('he')&&current!=player&&ai.get.attitude(player,current)<=0){ if(current.countCards('he')&&current!=player&&get.attitude(player,current)<=0){
return true; return true;
} }
if(current.countCards('j')&&current!=player&&ai.get.attitude(player,current)>0){ if(current.countCards('j')&&current!=player&&get.attitude(player,current)>0){
return true; return true;
} }
}); });
@ -575,10 +575,10 @@ character.extra={
if(target.hp==1) return 0.8; if(target.hp==1) return 0.8;
if(target.isTurnedOver()) return [0,3]; if(target.isTurnedOver()) return [0,3];
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current.countCards('he')&&current!=player&&ai.get.attitude(player,current)<=0){ if(current.countCards('he')&&current!=player&&get.attitude(player,current)<=0){
return true; return true;
} }
if(current.countCards('j')&&current!=player&&ai.get.attitude(player,current)>0){ if(current.countCards('j')&&current!=player&&get.attitude(player,current)>0){
return true; return true;
} }
}); });
@ -608,7 +608,7 @@ character.extra={
game.addVideo('delay',null); game.addVideo('delay',null);
} }
player.chooseCard('选择七张牌作为星',7,true).ai=function(card){ player.chooseCard('选择七张牌作为星',7,true).ai=function(card){
return ai.get.value(card); return get.value(card);
}; };
"step 2" "step 2"
player.lose(result.cards,ui.special)._triggered=null; player.lose(result.cards,ui.special)._triggered=null;
@ -663,9 +663,9 @@ character.extra={
"step 2" "step 2"
player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){
if(player.skipList.contains('phaseUse')&&button.link!='du'){ 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){ if(player==game.me&&_status.auto){
game.delay(0.5); game.delay(0.5);
@ -696,7 +696,7 @@ character.extra={
[1,Math.min(game.countPlayer(),player.storage.qixing.length)]).ai=function(target){ [1,Math.min(game.countPlayer(),player.storage.qixing.length)]).ai=function(target){
if(target.isMin()) return 0; if(target.isMin()) return 0;
if(target.hasSkill('biantian2')) 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(att>=4){
if(target.hp==1&&target.maxHp>2) return att; if(target.hp==1&&target.maxHp>2) return att;
if(target.hp==2&&target.maxHp>3&&target.countCards('he')==0) return att*0.7; 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(target.hasSkillTag('nofire')) return 0;
if(lib.config.mode=='versus') return -1; if(lib.config.mode=='versus') return -1;
if(player.hasUnknown()) return 0; if(player.hasUnknown()) return 0;
return ai.get.damageEffect(target,player); return get.damageEffect(target,player);
} }
} }
} }
@ -934,7 +934,7 @@ character.extra={
position:'he', position:'he',
check:function(card,event){ check:function(card,event){
if(_status.event.player.hp>1) return 0; if(_status.event.player.hp>1) return 0;
return 10-ai.get.value(card); return 10-get.value(card);
}, },
selectCard:function(){ selectCard:function(){
return Math.max(1,_status.event.player.hp); return Math.max(1,_status.event.player.hp);
@ -956,7 +956,7 @@ character.extra={
position:'he', position:'he',
check:function(card,event){ check:function(card,event){
if(_status.event.player.hp>1) return 0; if(_status.event.player.hp>1) return 0;
return 10-ai.get.value(card); return 10-get.value(card);
}, },
selectCard:function(){ selectCard:function(){
return Math.max(1,_status.event.player.hp); return Math.max(1,_status.event.player.hp);
@ -978,7 +978,7 @@ character.extra={
position:'he', position:'he',
check:function(card,event){ check:function(card,event){
if(_status.event.player.hp>1) return 0; if(_status.event.player.hp>1) return 0;
return 7-ai.get.value(card); return 7-get.value(card);
}, },
selectCard:function(){ selectCard:function(){
return Math.max(1,_status.event.player.hp); return Math.max(1,_status.event.player.hp);
@ -1000,7 +1000,7 @@ character.extra={
position:'he', position:'he',
check:function(card,event){ check:function(card,event){
if(_status.event.player.hp>1) return 0; if(_status.event.player.hp>1) return 0;
return 10-ai.get.value(card); return 10-get.value(card);
}, },
selectCard:function(){ selectCard:function(){
return Math.max(1,_status.event.player.hp); return Math.max(1,_status.event.player.hp);

View File

@ -42,7 +42,7 @@ character.gujian={
}, },
prompt:'将一张手牌或装备牌当酒使用', prompt:'将一张手牌或装备牌当酒使用',
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
ai:{ ai:{
threaten:1.2 threaten:1.2
@ -51,7 +51,7 @@ character.gujian={
manwu:{ manwu:{
trigger:{global:'phaseEnd'}, trigger:{global:'phaseEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>0; return get.attitude(player,event.player)>0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.player.isFewestHandcard(); return event.player.isFewestHandcard();
@ -181,7 +181,7 @@ character.gujian={
if(!player.storage.yunyin) return true; if(!player.storage.yunyin) return true;
return !player.storage.yunyin.contains(get.suit(card)); return !player.storage.yunyin.contains(get.suit(card));
}).set('logSkill','yunyin').ai=function(card){ }).set('logSkill','yunyin').ai=function(card){
return 9-ai.get.value(card); return 9-get.value(card);
} }
'step 1' 'step 1'
if(!result.bool){ if(!result.bool){
@ -204,8 +204,8 @@ character.gujian={
var taoyuan=0,nanman=0; var taoyuan=0,nanman=0;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
var eff1=ai.get.effect(players[i],{name:'taoyuan'},player,player); var eff1=get.effect(players[i],{name:'taoyuan'},player,player);
var eff2=ai.get.effect(players[i],{name:'nanman'},player,player); var eff2=get.effect(players[i],{name:'nanman'},player,player);
if(eff1>0){ if(eff1>0){
taoyuan++; taoyuan++;
} }
@ -253,7 +253,7 @@ character.gujian={
var next=player.chooseTarget('选择'+get.translation(name)+'的目标'); var next=player.chooseTarget('选择'+get.translation(name)+'的目标');
next._get_card=card; next._get_card=card;
next.filterTarget=lib.filter.filterTarget; next.filterTarget=lib.filter.filterTarget;
next.ai=ai.get.effect; next.ai=get.effect;
if(typeof info.selectTarget=='function'){ if(typeof info.selectTarget=='function'){
next.selectTarget=info.selectTarget; next.selectTarget=info.selectTarget;
} }
@ -282,7 +282,7 @@ character.gujian={
}, },
forced:true, forced:true,
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0; return get.attitude(player,event.player)<0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -329,7 +329,7 @@ character.gujian={
player.chooseTarget('是否视为使用一张决斗?',function(card,player,target){ player.chooseTarget('是否视为使用一张决斗?',function(card,player,target){
return lib.filter.targetEnabled({name:'juedou'},player,target); return lib.filter.targetEnabled({name:'juedou'},player,target);
}).set('ai',function(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{ else{
@ -395,7 +395,7 @@ character.gujian={
player.chooseTarget(get.prompt('liuying'),function(card,player,target){ player.chooseTarget(get.prompt('liuying'),function(card,player,target){
return event.list.contains(target); return event.list.contains(target);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,trigger.card,player,player); return get.effect(target,trigger.card,player,player);
}; };
} }
else{ else{
@ -442,7 +442,7 @@ character.gujian={
selectCard:2, selectCard:2,
position:'he', position:'he',
check:function(card){ check:function(card){
return ai.get.value(card); return get.value(card);
}, },
content:function(){ content:function(){
var name=cards[0].name+'_'+cards[1].name; var name=cards[0].name+'_'+cards[1].name;
@ -475,7 +475,7 @@ character.gujian={
var info=get.info(card); var info=get.info(card);
var current=player.getEquip(info.subtype); var current=player.getEquip(info.subtype);
if(current&&card!=current){ if(current&&card!=current){
value=ai.get.value(current,player); value=get.value(current,player);
} }
var equipValue=info.ai.equipValue||info.ai.basic.equipValue; var equipValue=info.ai.equipValue||info.ai.basic.equipValue;
if(typeof equipValue=='function') return equipValue(card,player)-value; if(typeof equipValue=='function') return equipValue(card,player)-value;
@ -483,7 +483,7 @@ character.gujian={
}, },
result:{ result:{
target:function(player,target){ 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" "step 0"
var next=player.chooseToDiscard('he','魅影:是否弃置一张红色牌视为对'+get.translation(trigger.player)+'使用一张杀?'); var next=player.chooseToDiscard('he','魅影:是否弃置一张红色牌视为对'+get.translation(trigger.player)+'使用一张杀?');
next.logSkill=['meiying',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){ next.ai=function(card){
if(eff>0){ if(eff>0){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
} }
@ -652,7 +652,7 @@ character.gujian={
"step 0" "step 0"
var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.countCards('h')-player.hp)]); var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.countCards('h')-player.hp)]);
next.ai=function(card){ next.ai=function(card){
return 6-ai.get.value(card); return 6-get.value(card);
} }
next.logSkill='xidie'; next.logSkill='xidie';
"step 1" "step 1"
@ -676,7 +676,7 @@ character.gujian={
meihu:{ meihu:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<4; return get.attitude(player,event.source)<4;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source!=player&&event.source.countCards('h')>0; return event.source&&event.source!=player&&event.source.countCards('h')>0;
@ -685,7 +685,7 @@ character.gujian={
content:function(){ content:function(){
"step 0" "step 0"
trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){ trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){
return -ai.get.value(card); return -get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -736,15 +736,15 @@ character.gujian={
content:function(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard(get.prompt('fumo',trigger.source),2,function(card){ 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){ if(ui.selected.cards.length){
return get.color(card)==get.color(ui.selected.cards[0]); return get.color(card)==get.color(ui.selected.cards[0]);
} }
return player.countCards('h',{color:get.color(card)})>1; return player.countCards('h',{color:get.color(card)})>1;
}).set('complexCard',true); }).set('complexCard',true);
next.ai=function(card){ next.ai=function(card){
if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){ if(get.damageEffect(trigger.source,player,player,'thunder')>0){
return 8-ai.get.value(card); return 8-get.value(card);
} }
return 0; return 0;
}; };
@ -772,7 +772,7 @@ character.gujian={
return target.isLowestHp(); return target.isLowestHp();
}).ai=function(target){ }).ai=function(target){
var num=0; var num=0;
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0){ if(att>0){
if(target.isLowestHp()){ if(target.isLowestHp()){
num+=5; num+=5;
@ -896,22 +896,22 @@ character.gujian={
next.logSkill=['qinglan',trigger.player]; next.logSkill=['qinglan',trigger.player];
next.ai=function(card){ next.ai=function(card){
if(trigger.num>1||!trigger.source){ if(trigger.num>1||!trigger.source){
if(ai.get.attitude(player,trigger.player)>0){ if(get.attitude(player,trigger.player)>0){
return 9-ai.get.value(card); return 9-get.value(card);
} }
return -1; return -1;
} }
else if(ai.get.attitude(player,trigger.player)>0){ else if(get.attitude(player,trigger.player)>0){
if(trigger.player.hp==1){ if(trigger.player.hp==1){
return 8-ai.get.value(card); return 8-get.value(card);
} }
if(trigger.source.hp==trigger.source.maxHp){ 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.hp<trigger.source.maxHp&&trigger.num<=1&&trigger.player.hp>1){ trigger.source.hp<trigger.source.maxHp&&trigger.num<=1&&trigger.player.hp>1){
if(get.color(card)=='red') return 5-ai.get.value(card); if(get.color(card)=='red') return 5-get.value(card);
} }
return -1; return -1;
} }
@ -970,10 +970,10 @@ character.gujian={
return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player);
}, },
ai1:function(card){ ai1:function(card){
return 9-ai.get.value(card); return 9-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
}, },
prompt:get.prompt('xuelu') prompt:get.prompt('xuelu')
}); });
@ -1103,12 +1103,12 @@ character.gujian={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('he',{subtype:get.subtype(card)})>1){ if(player.countCards('he',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-get.equipValue(card);
} }
if(player.countCards('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-get.equipValue(card);
}, },
ai:{ ai:{
order:9, order:9,
@ -1133,7 +1133,7 @@ character.gujian={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.effect(target,{name:'sha'},player,target); return get.effect(target,{name:'sha'},player,target);
}, },
}, },
order:4, order:4,
@ -1159,13 +1159,13 @@ character.gujian={
}); });
var num=0; var num=0;
for(var i=0;i<event.targets.length;i++){ for(var i=0;i<event.targets.length;i++){
num+=ai.get.effect(event.targets[i],{name:'sha'},player,player); num+=get.effect(event.targets[i],{name:'sha'},player,player);
} }
var next=player.chooseToDiscard(get.prompt('qianjun',event.targets),'he'); var next=player.chooseToDiscard(get.prompt('qianjun',event.targets),'he');
next.logSkill=['qianjun',event.targets]; next.logSkill=['qianjun',event.targets];
next.ai=function(card){ next.ai=function(card){
if(num<=0) return -1; if(num<=0) return -1;
return 7-ai.get.value(card); return 7-get.value(card);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1195,7 +1195,7 @@ character.gujian={
return get.type(card)=='basic'; return get.type(card)=='basic';
}, },
check:function(card){ check:function(card){
return 7-ai.get.useful(card); return 7-get.useful(card);
}, },
content:function(){ content:function(){
player.storage.xuanning=3; player.storage.xuanning=3;
@ -1250,7 +1250,7 @@ character.gujian={
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
return player!=target; return player!=target;
},get.prompt('liuguang'),[1,3]).ai=function(target){ },get.prompt('liuguang'),[1,3]).ai=function(target){
return ai.get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1271,9 +1271,9 @@ character.gujian={
var target=event.targets.shift(); var target=event.targets.shift();
var next=target.chooseToDiscard('流光:弃置一张牌或受到一点伤害','he'); var next=target.chooseToDiscard('流光:弃置一张牌或受到一点伤害','he');
next.ai=function(card){ next.ai=function(card){
if(ai.get.damageEffect(_status.event.player,player,_status.event.player)>=0) return -1; if(get.damageEffect(_status.event.player,player,_status.event.player)>=0) return -1;
if(_status.event.player.hp==1) return 9-ai.get.value(card); if(_status.event.player.hp==1) return 9-get.value(card);
return 8-ai.get.value(card); return 8-get.value(card);
}; };
next.autochoose=function(){ next.autochoose=function(){
return this.player.countCards('he')==0; return this.player.countCards('he')==0;
@ -1311,7 +1311,7 @@ character.gujian={
game.addVideo('storage',player,['yangming2',player.storage.yangming2]); game.addVideo('storage',player,['yangming2',player.storage.yangming2]);
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
result:{ result:{
@ -1417,8 +1417,8 @@ character.gujian={
player:function(player,target){ player:function(player,target){
if(player.hp>1) return false; if(player.hp>1) return false;
if(target.hp>2) return false; if(target.hp>2) return false;
if(ai.get.attitude(player,target)>=0) return false; if(get.attitude(player,target)>=0) return false;
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
} }
} }
} }

View File

@ -58,7 +58,7 @@ character.gwent={
} }
else{ else{
game.countPlayer(function(current){ game.countPlayer(function(current){
var att=ai.get.attitude(player,current); var att=get.attitude(player,current);
if(att>0){ if(att>0){
num1++; num1++;
} }
@ -121,7 +121,7 @@ character.gwent={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isHighestHp(); return target.isHighestHp();
}, },
check:function(card){return 7-ai.get.value(card);}, check:function(card){return 7-get.value(card);},
position:'he', position:'he',
filterCard:true, filterCard:true,
content:function(){ content:function(){
@ -130,7 +130,7 @@ character.gwent={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.damageEffect(target,player); return get.damageEffect(target,player);
}, },
}, },
order:7 order:7
@ -173,7 +173,7 @@ character.gwent={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.getEquip('tengjia')||player.getEquip('bagua')) return -1; 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(!player.hasShan()){
if(ui.selected.targets.length) return 0; if(ui.selected.targets.length) return 0;
if(player.hp>=4) return -1; if(player.hp>=4) return -1;
@ -198,7 +198,7 @@ character.gwent={
position:'he', position:'he',
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 7-ai.get.value(card) return 7-get.value(card)
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -232,19 +232,19 @@ character.gwent={
selectCard:[1,3], selectCard:[1,3],
check:function(card){ check:function(card){
if(!ui.selected.cards.length){ if(!ui.selected.cards.length){
return 6-ai.get.value(card) return 6-get.value(card)
} }
var player=_status.event.player; var player=_status.event.player;
if(player.isDamaged()){ if(player.isDamaged()){
var hs=player.getCards('h'); var hs=player.getCards('h');
var num=0; var num=0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<6){ if(get.value(hs[i])<6){
num++; num++;
} }
} }
if(num>=3){ if(num>=3){
return 6-ai.get.value(card); return 6-get.value(card);
} }
} }
return 0; return 0;
@ -283,14 +283,14 @@ character.gwent={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var bool=(ai.get.effect(trigger.player,{name:'sha'},player,player)>0&& var bool=(get.effect(trigger.player,{name:'sha'},player,player)>0&&
Math.abs(ai.get.attitude(player,trigger.player))>1&& Math.abs(get.attitude(player,trigger.player))>1&&
game.hasPlayer(function(current){ game.hasPlayer(function(current){
return ai.get.attitude(current,player)>0&&current.hasSha(); return get.attitude(current,player)>0&&current.hasSha();
})); }));
var next=player.chooseToDiscard(get.prompt('gwzhanjiang',trigger.player),'he'); var next=player.chooseToDiscard(get.prompt('gwzhanjiang',trigger.player),'he');
next.ai=function(card){ next.ai=function(card){
if(bool) return 7-ai.get.value(card); if(bool) return 7-get.value(card);
return 0; return 0;
}; };
next.logSkill=['gwzhanjiang',trigger.player]; next.logSkill=['gwzhanjiang',trigger.player];
@ -352,7 +352,7 @@ character.gwent={
return event.target.isAlive(); return event.target.isAlive();
}, },
check:function(event,player){ 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', logTarget:'target',
logLine:false, logLine:false,
@ -381,7 +381,7 @@ character.gwent={
player.chooseTarget(get.prompt('fengjian'),function(card,player,target){ player.chooseTarget(get.prompt('fengjian'),function(card,player,target){
return player.canUse('sha',target,false)&&!trigger.targets.contains(target); return player.canUse('sha',target,false)&&!trigger.targets.contains(target);
}).ai=function(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" "step 1"
if(result.bool){ if(result.bool){
@ -418,7 +418,7 @@ character.gwent={
player.chooseTarget(get.prompt('huandie'),[0,game.countPlayer()],function(card,player,target){ player.chooseTarget(get.prompt('huandie'),[0,game.countPlayer()],function(card,player,target){
return target!=player; return target!=player;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -546,10 +546,10 @@ character.gwent={
content:function(){ content:function(){
'step 0' 'step 0'
var target=trigger.target; 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)); var next=player.chooseToDiscard('he',get.prompt('fayin',target));
next.ai=function(card){ next.ai=function(card){
if(bool) return 7-ai.get.value(card); if(bool) return 7-get.value(card);
return 0; return 0;
}; };
next.logSkill=['fayin',target]; next.logSkill=['fayin',target];
@ -583,11 +583,11 @@ character.gwent={
target.$giveAuto(hs,player); target.$giveAuto(hs,player);
event.hs=hs; event.hs=hs;
'step 1' '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; var hs=event.hs;
if(damage&&target.hp>1){ if(damage&&target.hp>1){
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i],player,'raw')>=8){ if(get.value(hs[i],player,'raw')>=8){
damage=false;break; damage=false;break;
} }
} }
@ -597,7 +597,7 @@ character.gwent={
return hs.contains(card)?1:0; return hs.contains(card)?1:0;
} }
else{ else{
return -ai.get.value(card,player,'raw'); return -get.value(card,player,'raw');
} }
} }
if(!event.isMine()) game.delay(); if(!event.isMine()) game.delay();
@ -649,7 +649,7 @@ character.gwent={
target:function(player,target){ target:function(player,target){
var dh=Math.min(3,player.hp)-target.countCards('h'); var dh=Math.min(3,player.hp)-target.countCards('h');
if(dh<0){ 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; return dh;
} }
@ -664,7 +664,7 @@ character.gwent={
player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){ player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){
return target.countCards('h')!=Math.min(3,target.hp); return target.countCards('h')!=Math.min(3,target.hp);
}).ai=function(target){ }).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' 'step 1'
if(result.bool){ if(result.bool){
@ -776,7 +776,7 @@ character.gwent={
return false; return false;
}, },
check:function(button){ check:function(button){
return ai.get.value(button.link); return get.value(button.link);
}, },
backup:function(links,player){ backup:function(links,player){
return { return {

View File

@ -192,14 +192,14 @@ character.hearth={
if(target.identity=='zhu'||get.is.jun(target)) return false; if(target.identity=='zhu'||get.is.jun(target)) return false;
return true; return true;
}).ai=function(target){ }).ai=function(target){
var att=-ai.get.attitude(player,target); var att=-get.attitude(player,target);
if(att<=0) return 0; if(att<=0) return 0;
if(target.needsToDiscard()) att+=3; if(target.needsToDiscard()) att+=3;
else if(target.needsToDiscard(1)) att++; else if(target.needsToDiscard(1)) att++;
else if(target.countCards()<=3){ else if(target.countCards()<=3){
return 0; return 0;
} }
return att+target.countCards('h')+ai.get.threaten(target); return att+target.countCards('h')+get.threaten(target);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -241,7 +241,7 @@ character.hearth={
}, },
init:function(player){ init:function(player){
player.ai.modAttitudeFrom=function(from,to){ 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){ player.ai.modAttitudeTo=function(from,to,att){
if(from!=to) return 0; if(from!=to) return 0;
@ -302,7 +302,7 @@ character.hearth={
var nh=target.countCards('h'); var nh=target.countCards('h');
return nh&&nh>=player.countCards('h'); return nh&&nh>=player.countCards('h');
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(target.hasSkillTag('noe')){ if(target.hasSkillTag('noe')){
att/=3; att/=3;
} }
@ -336,7 +336,7 @@ character.hearth={
'step 0' 'step 0'
target.gain(cards,player); target.gain(cards,player);
var choice=1; 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; choice=0;
} }
target.chooseControl(function(){ target.chooseControl(function(){
@ -359,8 +359,8 @@ character.hearth={
expos:0.2, expos:0.2,
result:{ result:{
player:function(player,target){ player:function(player,target){
if(ai.get.attitude(target,player)>0) return 1; if(get.attitude(target,player)>0) return 1;
if(ai.get.effect(target,{name:'juedou'},player,player)>0) return 1.5; if(get.effect(target,{name:'juedou'},player,player)>0) return 1.5;
return 0; return 0;
} }
} }
@ -473,8 +473,8 @@ character.hearth={
event.target=event.targets.shift(); event.target=event.targets.shift();
if(event.target.countCards('he',{color:'black'})){ if(event.target.countCards('he',{color:'black'})){
event.target.chooseCard('he','交给'+get.translation(player)+'一张黑色牌,或失去一点体力',{color:'black'}).ai=function(card){ 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); if(get.attitude(event.target,player)>0) return 10-get.value(card);
return 7-ai.get.value(card); return 7-get.value(card);
} }
} }
else{ else{
@ -512,7 +512,7 @@ character.hearth={
player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){ player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){
return target!=player&&target.countCards('h')>0; return target!=player&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -605,8 +605,8 @@ character.hearth={
var next=player.chooseToDiscard(get.prompt('zhongji',trigger.player),{color:'black'}); var next=player.chooseToDiscard(get.prompt('zhongji',trigger.player),{color:'black'});
next.logSkill=['zhongji',trigger.player]; next.logSkill=['zhongji',trigger.player];
next.ai=function(card){ next.ai=function(card){
if(ai.get.attitude(player,trigger.player)<0){ if(get.attitude(player,trigger.player)<0){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return -1; return -1;
} }
@ -645,13 +645,13 @@ character.hearth={
player.chooseTarget(get.prompt('jinzhou'),function(card,player,target){ player.chooseTarget(get.prompt('jinzhou'),function(card,player,target){
return target!=player&&!target.hasSkill('fengyin'); return target!=player&&!target.hasSkill('fengyin');
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
var skills=target.getSkills(); var skills=target.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(!get.is.locked(skills[i])){ if(!get.is.locked(skills[i])){
if(target.hasSkillTag('maixie')) return 2; if(target.hasSkillTag('maixie')) return 2;
return ai.get.threaten(target); return get.threaten(target);
} }
} }
return 0; return 0;
@ -675,7 +675,7 @@ character.hearth={
}, },
filterCard:{type:['trick','delay']}, filterCard:{type:['trick','delay']},
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
content:function(){ content:function(){
var list=get.inpile('trick','trick'); var list=get.inpile('trick','trick');
@ -708,7 +708,7 @@ character.hearth={
player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){
return target.countCards('h')>nh; return target.countCards('h')>nh;
}).ai=function(target){ }).ai=function(target){
return 0.5-ai.get.attitude(player,target); return 0.5-get.attitude(player,target);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -735,7 +735,7 @@ character.hearth={
'step 4' 'step 4'
if(event.cards.length){ if(event.cards.length){
player.chooseCardButton('选择一张加入手牌',event.cards).ai=function(button){ player.chooseCardButton('选择一张加入手牌',event.cards).ai=function(button){
return ai.get.value(button.link); return get.value(button.link);
}; };
} }
else{ else{
@ -759,7 +759,7 @@ character.hearth={
filterCard:{color:'black'}, filterCard:{color:'black'},
position:'he', position:'he',
check:function(card){ check:function(card){
return 11-ai.get.value(card); return 11-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target==_status.event.dying; return target==_status.event.dying;
@ -786,7 +786,7 @@ character.hearth={
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('yushou_misha')&&player.hasSkill('yushou_huofu')&&player.hasSkill('yushou_leiouke')) return false; 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; if(!player.countCards('he',{color:'black'})) return false;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
basic:{ basic:{
@ -986,7 +986,7 @@ character.hearth={
if(!player.countCards('he',{suit:'spade'})) return false; if(!player.countCards('he',{suit:'spade'})) return false;
}, },
prompt:'将一张黑桃手牌当作无中生有使用', prompt:'将一张黑桃手牌当作无中生有使用',
check:function(card){return 7-ai.get.value(card)}, check:function(card){return 7-get.value(card)},
ai:{ ai:{
threaten:1.4, threaten:1.4,
order:9, order:9,
@ -995,7 +995,7 @@ character.hearth={
bzhuiji:{ bzhuiji:{
trigger:{global:'dieAfter'}, trigger:{global:'dieAfter'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<=0; return get.attitude(player,event.source)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source.isAlive()&&event.source!=player; return event.source&&event.source.isAlive()&&event.source!=player;
@ -1014,7 +1014,7 @@ character.hearth={
usable:2, usable:2,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1044,7 +1044,7 @@ character.hearth={
return get.type(card)!='hsyaoshui'; return get.type(card)!='hsyaoshui';
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card) return 8-get.value(card)
}, },
discard:false, discard:false,
lose:false, lose:false,
@ -1173,7 +1173,7 @@ character.hearth={
for(var i=0;i<names.length;i++){ for(var i=0;i<names.length;i++){
var info2=lib.card[names[i]]; var info2=lib.card[names[i]];
if(get.select(info2.selectTarget)[0]==-1&&!info2.modTarget) continue; if(get.select(info2.selectTarget)[0]==-1&&!info2.modTarget) continue;
var eff=ai.get.effect(target,{name:names[i]},player,target); var eff=get.effect(target,{name:names[i]},player,target);
if(eff>0){ if(eff>0){
num++; num++;
} }
@ -1241,10 +1241,10 @@ character.hearth={
}, },
position:'he', position:'he',
ai1:function(card){ ai1:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
} }
}); });
'step 1' 'step 1'
@ -1268,7 +1268,7 @@ character.hearth={
guimou:{ guimou:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<=0; return get.attitude(player,event.source)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source.isAlive()&&event.source!=player&&event.source.countCards('h')>0; return event.source&&event.source.isAlive()&&event.source!=player&&event.source.countCards('h')>0;
@ -1310,10 +1310,10 @@ character.hearth={
} }
return true; return true;
}).ai=function(target){ }).ai=function(target){
if(player==target&&ai.get.attitude(player,target)>0&&event.parent.triggername=='phaseBegin'){ if(player==target&&get.attitude(player,target)>0&&event.parent.triggername=='phaseBegin'){
return ai.get.attitude(player,target)+10; return get.attitude(player,target)+10;
} }
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -1339,7 +1339,7 @@ character.hearth={
position:'he', position:'he',
filterTarget:true, filterTarget:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1593,7 +1593,7 @@ character.hearth={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp<players[i].maxHp){ if(players[i].hp<players[i].maxHp){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
if(players[i].hp<2){ if(players[i].hp<2){
lose--; lose--;
recover+=0.5; recover+=0.5;
@ -1601,7 +1601,7 @@ character.hearth={
lose--; lose--;
recover++; recover++;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
if(players[i].hp<2){ if(players[i].hp<2){
lose++; lose++;
recover-=0.5; recover-=0.5;
@ -1611,10 +1611,10 @@ character.hearth={
} }
} }
else{ else{
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
lose--; lose--;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
lose++; lose++;
} }
} }
@ -1684,7 +1684,7 @@ character.hearth={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp<players[i].maxHp){ if(players[i].hp<players[i].maxHp){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
if(players[i].hp<2){ if(players[i].hp<2){
lose--; lose--;
recover+=0.5; recover+=0.5;
@ -1692,7 +1692,7 @@ character.hearth={
lose--; lose--;
recover++; recover++;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
if(players[i].hp<2){ if(players[i].hp<2){
lose++; lose++;
recover-=0.5; recover-=0.5;
@ -1702,10 +1702,10 @@ character.hearth={
} }
} }
else{ else{
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
lose--; lose--;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
lose++; lose++;
} }
} }
@ -1729,7 +1729,7 @@ character.hearth={
popname:true, popname:true,
viewAs:{name:links[0][2]}, viewAs:{name:links[0][2]},
ai1:function(card){ ai1:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
onuse:function(result,player){ onuse:function(result,player){
player.storage.nuyan.add(result.card.name); player.storage.nuyan.add(result.card.name);
@ -1990,7 +1990,7 @@ character.hearth={
selectTarget:-1, selectTarget:-1,
selectCard:[1,3], selectCard:[1,3],
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filterCard:{color:'black'}, filterCard:{color:'black'},
line:'thunder', line:'thunder',
@ -2002,7 +2002,7 @@ character.hearth={
threaten:0.7, threaten:0.7,
result:{ result:{
target:function(player,target){ 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){ if(event.target){
player.chooseToDiscard([1,2],'献祭是否弃置1~2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){ 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){ if(get.attitude(_status.event.player,_status.event.getParent().target)>1){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 0; return 0;
}).set('logSkill',['xianji',event.target]); }).set('logSkill',['xianji',event.target]);
@ -2118,7 +2118,7 @@ character.hearth={
return event.card&&event.card.name=='sha'&&event.player.isAlive(); return event.card&&event.card.name=='sha'&&event.player.isAlive();
}, },
check:function(event,player){ 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 true;
if(player.hp<2) return false; if(player.hp<2) return false;
return player.hp>=event.player.hp; return player.hp>=event.player.hp;
@ -2354,9 +2354,9 @@ character.hearth={
position:'he', position:'he',
check:function(card){ check:function(card){
if(_status.event.player.hp==1){ 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, selectCard:3,
filter:function(event,player){ filter:function(event,player){
@ -2406,7 +2406,7 @@ character.hearth={
complexCard:true, complexCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
selectCard:[1,Infinity], selectCard:[1,Infinity],
content:function(){ content:function(){
@ -2416,14 +2416,14 @@ character.hearth={
var list=game.findCards(function(name){ var list=game.findCards(function(name){
if(cards[i].name==name) return; if(cards[i].name==name) return;
if(get.type({name:name},'trick')==type){ 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){ if(!list.length){
list=game.findCards(function(name){ list=game.findCards(function(name){
if(cards[i].name==name) return; if(cards[i].name==name) return;
if(get.type({name:name},'trick')==type){ 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], selectCard:[1,Infinity],
check:function(card){ check:function(card){
if(ui.selected.cards.length) return 0; if(ui.selected.cards.length) return 0;
return 6-ai.get.value(card) return 6-get.value(card)
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2479,7 +2479,7 @@ character.hearth={
priority:1, priority:1,
// filterCard:true, // filterCard:true,
// check:function(card){ // check:function(card){
// return 6-ai.get.value(card); // return 6-get.value(card);
// }, // },
// position:'he', // position:'he',
content:function(){ content:function(){
@ -2529,7 +2529,7 @@ character.hearth={
player.chooseToDiscard('是否弃置一张点数为'+player.storage.xunbao2.number+'的牌获得藏宝图?','he',function(card){ player.chooseToDiscard('是否弃置一张点数为'+player.storage.xunbao2.number+'的牌获得藏宝图?','he',function(card){
return card.number==player.storage.xunbao2.number; return card.number==player.storage.xunbao2.number;
}).ai=function(card){ }).ai=function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -2612,7 +2612,7 @@ character.hearth={
player.chooseTarget(get.prompt('fbeifa'),function(card,player,target){ player.chooseTarget(get.prompt('fbeifa'),function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,{name:'sha'},player); return get.effect(target,{name:'sha'},player);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2657,7 +2657,7 @@ character.hearth={
player.chooseTarget(get.prompt('yufa'),function(card,player,target){ player.chooseTarget(get.prompt('yufa'),function(card,player,target){
return target!=trigger.player; return target!=trigger.player;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -2714,7 +2714,7 @@ character.hearth={
position:'he', position:'he',
log:'notarget', log:'notarget',
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
multitarget:true, multitarget:true,
content:function(){ content:function(){
@ -2731,9 +2731,9 @@ character.hearth={
target:function(player,target){ target:function(player,target){
var card=ui.selected.cards[0]; var card=ui.selected.cards[0];
if(card&&get.color(card)=='black'){ 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(){ content:function(){
'step 0' 'step 0'
player.chooseControl('draw_card','出杀','cancel2',function(){ 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 '出杀';
} }
return 'draw_card'; return 'draw_card';
@ -2941,7 +2941,7 @@ character.hearth={
player.chooseTarget(get.prompt('duzhang'),function(card,player,target){ player.chooseTarget(get.prompt('duzhang'),function(card,player,target){
return target!=player; return target!=player;
}).ai=function(target){ }).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' 'step 1'
if(result.bool){ if(result.bool){
@ -3188,7 +3188,7 @@ character.hearth={
trigger:{global:'phaseEnd'}, trigger:{global:'phaseEnd'},
forced:true, forced:true,
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0; return get.attitude(player,event.player)<0;
}, },
filter:function(event,player){ filter:function(event,player){
return typeof event.player.storage.shixu=='number'&& return typeof event.player.storage.shixu=='number'&&
@ -3279,7 +3279,7 @@ character.hearth={
"step 0" "step 0"
var effect=0; var effect=0;
for(var i=0;i<trigger.targets.length;i++){ for(var i=0;i<trigger.targets.length;i++){
effect+=ai.get.effect(trigger.targets[i],trigger.card,trigger.player,player); effect+=get.effect(trigger.targets[i],trigger.card,trigger.player,player);
} }
var str='蔽日:是否弃置一张闪令'+get.translation(trigger.player); var str='蔽日:是否弃置一张闪令'+get.translation(trigger.player);
if(trigger.targets&&trigger.targets.length){ if(trigger.targets&&trigger.targets.length){
@ -3294,7 +3294,7 @@ character.hearth={
},str); },str);
next.ai=function(card){ next.ai=function(card){
if(effect<0){ if(effect<0){
return 9-ai.get.value(card); return 9-get.value(card);
} }
return -1; return -1;
} }
@ -3390,7 +3390,7 @@ character.hearth={
expose:0.2, expose:0.2,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)<-3&&player.identity!='zhu'){ if(get.attitude(player,target)<-3&&player.identity!='zhu'){
return -1; return -1;
} }
return 0; return 0;
@ -3426,7 +3426,7 @@ character.hearth={
if(event.card.name=='sha'&&!event.card.nature) return true; if(event.card.name=='sha'&&!event.card.nature) return true;
}, },
check:function(event,player){ check:function(event,player){
var att=ai.get.attitude(player,event.target); var att=get.attitude(player,event.target);
if(event.target.hasSkillTag('nofire')){ if(event.target.hasSkillTag('nofire')){
return att>0; return att>0;
} }
@ -3493,7 +3493,7 @@ character.hearth={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('jiaohui')).ai=function(target){ 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(att>1){
if(target.hp<=1) att+=2; if(target.hp<=1) att+=2;
if(target.hp<=2) att++; if(target.hp<=2) att++;
@ -3590,7 +3590,7 @@ character.hearth={
var dialog=ui.create.dialog('选择一张锦囊牌加入你的手牌',[list,'vcard'],'hidden'); var dialog=ui.create.dialog('选择一张锦囊牌加入你的手牌',[list,'vcard'],'hidden');
player.chooseButton(dialog,true).ai=function(button){ player.chooseButton(dialog,true).ai=function(button){
var card={name:button.link[2]}; var card={name:button.link[2]};
var value=ai.get.value(card); var value=get.value(card);
if(get.tag(card,'damage')) value++; if(get.tag(card,'damage')) value++;
return value; return value;
}; };
@ -3609,7 +3609,7 @@ character.hearth={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('lingzhou')).ai=function(target){ 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(num>0){
if(target==player){ if(target==player){
num++; num++;
@ -3664,7 +3664,7 @@ character.hearth={
player.chooseTarget(get.prompt('xmojian'),function(card,player,target){ player.chooseTarget(get.prompt('xmojian'),function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,{name:'sha'},player); return get.effect(target,{name:'sha'},player);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3723,7 +3723,7 @@ character.hearth={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]==player) continue; if(players[i]==player) continue;
var att=ai.get.attitude(player,players[i]); var att=get.attitude(player,players[i]);
var dh=player.countCards('h')-players[i].countCards('h'); var dh=player.countCards('h')-players[i].countCards('h');
if(att*dh>num){ if(att*dh>num){
if(att>0){ if(att>0){
@ -3740,7 +3740,7 @@ character.hearth={
}, },
result:{ result:{
player:function(player,target){ 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 expose:0.2
@ -4055,7 +4055,7 @@ character.hearth={
return target!=player&&Math.abs(target.countCards('h')-nh)<=nm; return target!=player&&Math.abs(target.countCards('h')-nh)<=nm;
}).ai=function(target){ }).ai=function(target){
if(!check) return 0; if(!check) return 0;
if(ai.get.attitude(player,target)<0){ if(get.attitude(player,target)<0){
return target.countCards('h')-nh; return target.countCards('h')-nh;
} }
return 0; return 0;
@ -4098,9 +4098,9 @@ character.hearth={
}, },
check:function(event,player){ check:function(event,player){
if(event.player.isTurnedOver()){ 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', logTarget:'player',
content:function(){ content:function(){
@ -4133,7 +4133,7 @@ character.hearth={
return get.type(card)!='basic'; return get.type(card)!='basic';
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
var card=cards[0]; var card=cards[0];
@ -4158,7 +4158,7 @@ character.hearth={
}, },
logTarget:'player', logTarget:'player',
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>0; return get.attitude(player,event.player)>0;
}, },
content:function(){ content:function(){
trigger.player.recover(); trigger.player.recover();
@ -4256,7 +4256,7 @@ character.hearth={
order:9, order:9,
result:{ result:{
target:function(player,target){ 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; if(eff>0&&eff<=0.5) return 0;
return eff; return eff;
} }
@ -4275,7 +4275,7 @@ character.hearth={
'step 1' 'step 1'
player.addTempSkill('fengxing2','phaseAfter'); player.addTempSkill('fengxing2','phaseAfter');
player.chooseToDiscard('he',get.prompt('fengxing')).set('ai',function(card){ player.chooseToDiscard('he',get.prompt('fengxing')).set('ai',function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}).logSkill='fengxing'; }).logSkill='fengxing';
'step 2' 'step 2'
if(result.bool){ if(result.bool){
@ -4354,7 +4354,7 @@ character.hearth={
return player.countCards('he',{subtype:'equip2'})>0; return player.countCards('he',{subtype:'equip2'})>0;
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
player.changeHujia(); player.changeHujia();
@ -4384,7 +4384,7 @@ character.hearth={
player.chooseTarget(get.prompt('shijie'),function(card,player,target){ player.chooseTarget(get.prompt('shijie'),function(card,player,target){
return player!=target&&target.countCards('h')>0; return player!=target&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return 11-ai.get.attitude(player,target); return 11-get.attitude(player,target);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -4410,7 +4410,7 @@ character.hearth={
position:'he', position:'he',
usable:1, usable:1,
check:function(card){ check:function(card){
return 9-ai.get.value(card) return 9-get.value(card)
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player.storage.anying) return true; if(player.storage.anying) return true;
@ -4452,7 +4452,7 @@ character.hearth={
content:'已进入暗影形态' content:'已进入暗影形态'
}, },
check:function(card){ check:function(card){
return 9-ai.get.value(card) return 9-get.value(card)
}, },
filterTarget:true, filterTarget:true,
content:function(){ content:function(){
@ -4479,7 +4479,7 @@ character.hearth={
filterCard:{color:'black'}, filterCard:{color:'black'},
position:'he', position:'he',
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
player.storage.anying=true; player.storage.anying=true;
@ -4493,7 +4493,7 @@ character.hearth={
player:function(player){ player:function(player){
if(player.hasUnknown()) return 0; if(player.hasUnknown()) return 0;
return !game.hasPlayer(function(current){ return !game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.isDamaged()&&current.hp<=2; return get.attitude(player,current)>0&&current.isDamaged()&&current.hp<=2;
}); });
} }
} }
@ -4522,8 +4522,8 @@ character.hearth={
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
var eff=ai.get.effect(trigger.targets[0],trigger.card,trigger.player,player); var eff=get.effect(trigger.targets[0],trigger.card,trigger.player,player);
var att=ai.get.attitude(player,trigger.player); var att=get.attitude(player,trigger.player);
player.chooseCard(get.prompt('bianxing'),function(card){ player.chooseCard(get.prompt('bianxing'),function(card){
if(card.name!=trigger.card.name){ if(card.name!=trigger.card.name){
if(get.type(card)=='basic'&&get.info(card).enable){ 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(trigger.targets[0].hp==trigger.targets[0].maxHp) return 0;
} }
if(eff>=0) 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' 'step 1'
if(result.bool){ if(result.bool){
@ -4575,7 +4575,7 @@ character.hearth={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:function(cards,player){
@ -4702,7 +4702,7 @@ character.hearth={
}, },
check:function(card){ check:function(card){
if(get.suit(card)=='spade'&&card.number>=2&&card.number<=9){ if(get.suit(card)=='spade'&&card.number>=2&&card.number<=9){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return -1; return -1;
}, },
@ -4757,7 +4757,7 @@ character.hearth={
trigger:{player:'damageEnd',source:'damageEnd'}, trigger:{player:'damageEnd',source:'damageEnd'},
check:function(event,player){ check:function(event,player){
var target=(player==event.player)?event.source: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){ filter:function(event,player){
var target=(player==event.player)?event.source:event.player; var target=(player==event.player)?event.source:event.player;
@ -4800,7 +4800,7 @@ character.hearth={
else str=get.translation(trigger.parent.name); else str=get.translation(trigger.parent.name);
var cards=[ui.cardPile.childNodes[0],ui.cardPile.childNodes[1]]; 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]); var delta=trigger.judge(ui.cardPile.childNodes[1])-trigger.judge(ui.cardPile.childNodes[0]);
player.chooseControl('调换顺序','cancel2', player.chooseControl('调换顺序','cancel2',
ui.create.dialog('先知:'+get.translation(trigger.player)+'的'+str+'判定',cards,'hidden')).ai=function(){ ui.create.dialog('先知:'+get.translation(trigger.player)+'的'+str+'判定',cards,'hidden')).ai=function(){
@ -4844,7 +4844,7 @@ character.hearth={
} }
return true; return true;
}).ai=function(target){ }).ai=function(target){
return 1-ai.get.attitude(player,target); return 1-get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -4913,16 +4913,16 @@ character.hearth={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var val=ai.get.value(trigger.card); var val=get.value(trigger.card);
var suit=get.suit(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){ var next=player.chooseToDiscard('是否对'+get.translation(trigger.player)+'使用的'+get.translation(trigger.card)+'发动【闷棍】?',function(card){
return get.suit(card)==suit; return get.suit(card)==suit;
}); });
next.logSkill=['mengun',trigger.player]; next.logSkill=['mengun',trigger.player];
next.ai=function(card){ next.ai=function(card){
if(eff>=0) return 0; 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" "step 1"
if(result.bool){ if(result.bool){
@ -4981,7 +4981,7 @@ character.hearth={
order:9, order:9,
result:{ result:{
target:function(player,target){ 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(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard(get.prompt('jihuo')); var next=player.chooseToDiscard(get.prompt('jihuo'));
next.ai=ai.get.unuseful2; next.ai=get.unuseful2;
next.logSkill='jihuo'; next.logSkill='jihuo';
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -5024,8 +5024,8 @@ character.hearth={
content:function(){ content:function(){
"step 0"; "step 0";
player.chooseTarget(get.prompt('tzhenji')).ai=function(target){ player.chooseTarget(get.prompt('tzhenji')).ai=function(target){
var bool=ai.get.attitude(player,target)>0; var bool=get.attitude(player,target)>0;
return ai.get.damageEffect(target,player,player,'thunder')-(bool?1:0); return get.damageEffect(target,player,player,'thunder')-(bool?1:0);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -5062,7 +5062,7 @@ character.hearth={
content:function(){ content:function(){
"step 0"; "step 0";
player.chooseTarget(get.prompt('tzhenji_old')).ai=function(target){ 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" "step 1"
if(result.bool){ if(result.bool){
@ -5096,7 +5096,7 @@ character.hearth={
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var hastarget=game.hasPlayer(function(current){ 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 ns=target.countCards('h','shan');
var nh=target.countCards('h'); var nh=target.countCards('h');
@ -5465,7 +5465,7 @@ character.hearth={
player.chooseTarget('活力图腾:令一名其他角色回复一点体力',function(card,player,target){ player.chooseTarget('活力图腾:令一名其他角色回复一点体力',function(card,player,target){
return target!=player&&target.hp<target.maxHp; return target!=player&&target.hp<target.maxHp;
}).ai=function(target){ }).ai=function(target){
return ai.get.recoverEffect(target,player,player); return get.recoverEffect(target,player,player);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -6077,7 +6077,7 @@ character.hearth={
useful:[7,4], useful:[7,4],
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.recoverEffect(target,player,target); return get.recoverEffect(target,player,target);
} }
} }
} }

View File

@ -35,7 +35,7 @@ character.jiange={
player.chooseTarget(get.prompt('konghun'),function(card,player,target){ player.chooseTarget(get.prompt('konghun'),function(card,player,target){
return player!=target; return player!=target;
},[1,Math.min(4,Math.floor((game.players.length-1)/2))]).ai=function(target){ },[1,Math.min(4,Math.floor((game.players.length-1)/2))]).ai=function(target){
return ai.get.damageEffect(target,player,player,'thunder')+1; return get.damageEffect(target,player,player,'thunder')+1;
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -92,8 +92,8 @@ character.jiange={
"step 0" "step 0"
var next=player.chooseToDiscard('he','是否弃置一张牌令'+get.translation(trigger.player)+'的摸牌数-1'); var next=player.chooseToDiscard('he','是否弃置一张牌令'+get.translation(trigger.player)+'的摸牌数-1');
next.ai=function(card){ next.ai=function(card){
if(ai.get.attitude(player,trigger.player)<0){ if(get.attitude(player,trigger.player)<0){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 0; return 0;
} }
@ -119,7 +119,7 @@ character.jiange={
player.chooseTarget(get.prompt('huodi'),function(card,player,target){ player.chooseTarget(get.prompt('huodi'),function(card,player,target){
return target.countCards('he')&&player!=target; return target.countCards('he')&&player!=target;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -162,7 +162,7 @@ character.jiange={
player.chooseTarget('选择至多'+get.cnNumber(event.num)+'名角色令其进攻距离+1',[1,event.num],function(card,player,target){ player.chooseTarget('选择至多'+get.cnNumber(event.num)+'名角色令其进攻距离+1',[1,event.num],function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
} }
else{ else{
@ -203,7 +203,7 @@ character.jiange={
chiying:{ chiying:{
trigger:{global:'damageBegin'}, trigger:{global:'damageBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>0; return get.attitude(player,event.player)>0;
}, },
filter:function(event,player){ filter:function(event,player){
if(event.num<=1) return false; if(event.num<=1) return false;
@ -237,7 +237,7 @@ character.jiange={
player.chooseTarget(get.prompt('juechen'),function(card,player,target){ player.chooseTarget(get.prompt('juechen'),function(card,player,target){
return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0; return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -251,7 +251,7 @@ character.jiange={
check:function(event,player){ check:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(player!=game.players[i]){ if(player!=game.players[i]){
if(ai.get.attitude(player,game.players[i])<0) return true; if(get.attitude(player,game.players[i])<0) return true;
} }
} }
return false; return false;
@ -267,7 +267,7 @@ character.jiange={
player.chooseTarget('是否弃置一名角色一张牌?',function(card,player,target){ player.chooseTarget('是否弃置一名角色一张牌?',function(card,player,target){
return player!=target&&target.countCards('he')>0; return player!=target&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
} }
"step 2" "step 2"
@ -321,7 +321,7 @@ character.jiange={
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
if(target.hasSkillTag('nofire')) return 0; if(target.hasSkillTag('nofire')) return 0;
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
} }
else{ else{
@ -434,7 +434,7 @@ character.jiange={
if(player.hasJudge('lebu')){ if(player.hasJudge('lebu')){
if(target==player) return 0.1; 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(player.countCards('h')>player.hp){
if(target==player) return Math.max(1,att-2); 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){ player.chooseTarget(get.prompt('tianyu'),[1,num],function(card,player,target){
return !target.isLinked()&&player!=target; return !target.isLinked()&&player!=target;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -518,7 +518,7 @@ character.jiange={
player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){
return target.hp<target.maxHp&&player!=target; return target.hp<target.maxHp&&player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){

View File

@ -38,7 +38,7 @@ character.old={
player.chooseTarget(get.prompt('zhenshan'),function(card,player,target){ player.chooseTarget(get.prompt('zhenshan'),function(card,player,target){
return target.countCards('h')<player.countCards('h'); return target.countCards('h')<player.countCards('h');
}).set('ai',function(target){ }).set('ai',function(target){
return ai.get.attitude(player,target) return get.attitude(player,target)
}); });
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -93,7 +93,7 @@ character.old={
var card={name:button.link[2],nature:button.link[3]}; var card={name:button.link[2],nature:button.link[3]};
if(card.name=='jiu') return 0; if(card.name=='jiu') return 0;
if(game.hasPlayer(function(current){ 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.name=='sha'){ if(card.name=='sha'){
if(card.nature=='fire') return 2.95; if(card.nature=='fire') return 2.95;
@ -118,7 +118,7 @@ character.old={
player.chooseTarget('选择交换手牌的目标',function(card,player,target){ player.chooseTarget('选择交换手牌的目标',function(card,player,target){
return target.countCards('h')<player.countCards('h') return target.countCards('h')<player.countCards('h')
},true).ai=function(target){ },true).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
player.addTempSkill('zhenshan2','phaseAfter'); player.addTempSkill('zhenshan2','phaseAfter');
'step 1' 'step 1'
@ -139,7 +139,7 @@ character.old={
var event=_status.event; var event=_status.event;
var nh=player.countCards('h'); var nh=player.countCards('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.countCards('h')<nh; return get.attitude(player,current)>0&&current.countCards('h')<nh;
})){ })){
if(event.type=='dying'){ if(event.type=='dying'){
if(event.filterCard({name:'tao'},player,event)){ if(event.filterCard({name:'tao'},player,event)){
@ -209,7 +209,7 @@ character.old={
var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden'); var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden');
dialog.classList.add('noselect'); dialog.classList.add('noselect');
player.chooseTarget(true,dialog).ai=function(target){ player.chooseTarget(true,dialog).ai=function(target){
return ai.get.attitude(player,target)/Math.sqrt(1+target.countCards('h')); return get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
} }
} }
else{ else{
@ -252,7 +252,7 @@ character.old={
oldqianxi:{ oldqianxi:{
trigger:{source:'damageBefore'}, trigger:{source:'damageBefore'},
check:function(event,player){ check:function(event,player){
var att=ai.get.attitude(player,event.player); var att=get.attitude(player,event.player);
if(event.player.hp==event.player.maxHp) return att<0; if(event.player.hp==event.player.maxHp) return att<0;
if(event.player.hp==event.player.maxHp-1&& if(event.player.hp==event.player.maxHp-1&&
(event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0; (event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0;
@ -292,10 +292,10 @@ character.old={
return get.distance(player,target)<=1||player.canUse('sha',target,false); return get.distance(player,target)<=1||player.canUse('sha',target,false);
}).set('ai',function(target){ }).set('ai',function(target){
if(get.distance(player,target)<=1){ if(get.distance(player,target)<=1){
return ai.get.damageEffect(target,player,player)*2; return get.damageEffect(target,player,player)*2;
} }
else{ else{
return ai.get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
} }
}); });
"step 1" "step 1"

View File

@ -63,8 +63,8 @@ character.ow={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('woliu'),lib.filter.notMe,[1,2]).ai=function(target){ player.chooseTarget(get.prompt('woliu'),lib.filter.notMe,[1,2]).ai=function(target){
if(ai.get.attitude(player,target)<0){ if(get.attitude(player,target)<0){
return ai.get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
} }
return 0; return 0;
} }
@ -156,11 +156,11 @@ character.ow={
_status.woliu2_temp=true; _status.woliu2_temp=true;
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current!=player&&current!=target&&target.storage.woliu2.contains(current)){ if(current!=player&&current!=target&&target.storage.woliu2.contains(current)){
return get.sgn(ai.get.effect(current,card,player,target)); return get.sgn(get.effect(current,card,player,target));
} }
}); });
delete _status.woliu2_temp; delete _status.woliu2_temp;
if(target.hasSkill('qianggu2')&&ai.get.attitude(player,target)>0){ if(target.hasSkill('qianggu2')&&get.attitude(player,target)>0){
return [0,num]; return [0,num];
} }
if(target.hp==1&&!target.hasShan()) return; if(target.hp==1&&!target.hasShan()) return;
@ -177,7 +177,7 @@ character.ow={
selectCard:2, selectCard:2,
position:'he', position:'he',
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.countCards('he')>=2; return player.countCards('he')>=2;
@ -207,16 +207,16 @@ character.ow={
"step 0" "step 0"
var eff; var eff;
if(player.hasSkill('woliu2')){ if(player.hasSkill('woliu2')){
eff=-ai.get.attitude(trigger.player,player); eff=-get.attitude(trigger.player,player);
} }
else{ 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){ trigger.player.chooseToDiscard('享乐:弃置一张基本牌,否则杀对'+get.translation(player)+'无效',function(card){
return get.type(card)=='basic'; return get.type(card)=='basic';
}).set('ai',function(card){ }).set('ai',function(card){
if(_status.event.eff>0){ if(_status.event.eff>0){
return 10-ai.get.value(card); return 10-get.value(card);
} }
return 0; return 0;
}).set('eff',eff); }).set('eff',eff);
@ -231,13 +231,13 @@ character.ow={
target:function(card,player,target,current){ target:function(card,player,target,current){
if(card.name=='sha'){ if(card.name=='sha'){
if(_status.event.name=='qianggu2') return; 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'}); var bs=player.getCards('h',{type:'basic'});
if(bs.length<2) return 0; if(bs.length<2) return 0;
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return;
if(bs.length<=3&&player.countCards('h','sha')<=1){ if(bs.length<=3&&player.countCards('h','sha')<=1){
for(var i=0;i<bs.length;i++){ for(var i=0;i<bs.length;i++){
if(bs[i].name!='sha'&&ai.get.value(bs[i])<7){ if(bs[i].name!='sha'&&get.value(bs[i])<7){
return [1,0,1,-0.5]; return [1,0,1,-0.5];
} }
} }
@ -258,7 +258,7 @@ character.ow={
usable:1, usable:1,
viewAs:{name:'jingleishan',nature:'thunder'}, viewAs:{name:'jingleishan',nature:'thunder'},
check:function(card){ check:function(card){
return 8-ai.get.value(card) return 8-get.value(card)
}, },
ai:{ ai:{
order:8, order:8,
@ -284,10 +284,10 @@ character.ow={
position:'he', position:'he',
filterCard:true, filterCard:true,
ai1:function(card){ ai1:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
if(!target.countCards('he')) return -0.01; if(!target.countCards('he')) return -0.01;
var dist=get.distance(player,target); var dist=get.distance(player,target);
@ -477,8 +477,8 @@ character.ow={
var suit=(player==trigger.player)?'heart':'spade'; var suit=(player==trigger.player)?'heart':'spade';
var next=player.chooseToDiscard(position,{suit:suit},get.prompt('pingzhang',trigger.player)); var next=player.chooseToDiscard(position,{suit:suit},get.prompt('pingzhang',trigger.player));
next.ai=function(card){ next.ai=function(card){
if(ai.get.damageEffect(trigger.player,trigger.source,player)<0){ if(get.damageEffect(trigger.player,trigger.source,player)<0){
return 8-ai.get.value(card); return 8-get.value(card);
} }
return 0; return 0;
} }
@ -542,7 +542,7 @@ character.ow={
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -560,7 +560,7 @@ character.ow={
expose:0.2, expose:0.2,
result:{ result:{
target:function(player,target){ 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 get.tag(card,'damage')?true:false;
})){ })){
return -1; return -1;
@ -628,7 +628,7 @@ character.ow={
}, },
logTarget:'target', logTarget:'target',
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
intro:{ intro:{
content:'players' content:'players'
@ -674,10 +674,10 @@ character.ow={
var next=player.chooseToDiscard(get.prompt('yinshen'),'he',{type:'equip'}); var next=player.chooseToDiscard(get.prompt('yinshen'),'he',{type:'equip'});
next.logSkill='yinshen'; next.logSkill='yinshen';
next.ai=function(card){ next.ai=function(card){
if(player.hp==1) return 8-ai.get.value(card); if(player.hp==1) return 8-get.value(card);
if(player.isZhu) return 7-ai.get.value(card); if(player.isZhu) return 7-get.value(card);
if(player.hp==2) return 6-ai.get.value(card); if(player.hp==2) return 6-get.value(card);
return 5-ai.get.value(card); return 5-get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -772,11 +772,11 @@ character.ow={
check:function(card){ check:function(card){
var player=_status.event.player; var player=_status.event.player;
if(game.hasPlayer(function(current){ 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(){ content:function(){
player.changeHujia(-1); player.changeHujia(-1);
@ -910,7 +910,7 @@ character.ow={
forced:true, forced:true,
alter:true, alter:true,
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
var num=0.2; var num=0.2;
@ -931,7 +931,7 @@ character.ow={
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
forced:true, forced:true,
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
var num=0.2; var num=0.2;
@ -951,7 +951,7 @@ character.ow={
return player.countCards('he',{suit:'spade'})>0; return player.countCards('he',{suit:'spade'})>0;
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1010,7 +1010,7 @@ character.ow={
order:2.1, order:2.1,
result:{ result:{
target:function(player,target){ 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.hasJudge('lebu')) return 0;
if(target.hasSkill('aqianghua2')) return 0.1; if(target.hasSkill('aqianghua2')) return 0.1;
return 1; return 1;
@ -1049,7 +1049,7 @@ character.ow={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
discard:false, discard:false,
prepare:'give2', prepare:'give2',
@ -1131,7 +1131,7 @@ character.ow={
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(event.targets.contains(current)==false&&current!=player&& if(event.targets.contains(current)==false&&current!=player&&
lib.filter.targetEnabled(event.card,player,current)){ 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; })>=0;
}, },
@ -1205,7 +1205,7 @@ character.ow={
return target!=player&&get.distance(player,target,'attack')<=1; return target!=player&&get.distance(player,target,'attack')<=1;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
target.addTempSkill('shanguang2','phaseAfter'); target.addTempSkill('shanguang2','phaseAfter');
@ -1215,9 +1215,9 @@ character.ow={
result:{ result:{
target:function(player,target){ target:function(player,target){
var nh=target.countCards('h'); 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')&& 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-5;
} }
return -nh; return -nh;
@ -1302,7 +1302,7 @@ character.ow={
ai:{ ai:{
order:function(skill,player){ order:function(skill,player){
var num=game.countPlayer(function(current){ 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'}); var nh=player.countCards('he',{color:'black'});
if(nh==1&&num>1) return 0; if(nh==1&&num>1) return 0;
@ -1329,7 +1329,7 @@ character.ow={
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1379,8 +1379,8 @@ character.ow={
trigger:{source:'damageBefore'}, trigger:{source:'damageBefore'},
check:function(event,player){ check:function(event,player){
player.disableSkill('tmp','zhiyuan'); player.disableSkill('tmp','zhiyuan');
var eff=ai.get.damageEffect(event.player,player,player); var eff=get.damageEffect(event.player,player,player);
var att=ai.get.attitude(player,event.player); var att=get.attitude(player,event.player);
var bool=false; var bool=false;
if(att>0){ if(att>0){
if(eff<=0||event.player.hp<event.player.maxHp){ if(eff<=0||event.player.hp<event.player.maxHp){
@ -1407,7 +1407,7 @@ character.ow={
ai:{ ai:{
effect:{ effect:{
player:function(card,player,target){ player:function(card,player,target){
if(get.tag(card,'damage')&&ai.get.attitude(player,target)>0){ if(get.tag(card,'damage')&&get.attitude(player,target)>0){
if(target.hp==target.maxHp) return [0,0,0,0]; if(target.hp==target.maxHp) return [0,0,0,0];
return [0,0,0,1]; return [0,0,0,1];
} }
@ -1418,7 +1418,7 @@ character.ow={
duwen:{ duwen:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<=0; return get.attitude(player,event.player)<=0;
}, },
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
@ -1461,7 +1461,7 @@ character.ow={
}, },
check:function(card){ check:function(card){
if(ui.selected.cards.length>1) return 0; if(ui.selected.cards.length>1) return 0;
return 5-ai.get.value(card); return 5-get.value(card);
}, },
selectCard:[1,4], selectCard:[1,4],
content:function(){ content:function(){
@ -1496,7 +1496,7 @@ character.ow={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&player.canUse('sha',players[i],false)){ if(players[i]!=player&&player.canUse('sha',players[i],false)){
var eff=ai.get.effect(players[i],{name:'sha'},player,player); var eff=get.effect(players[i],{name:'sha'},player,player);
if(eff>num){ if(eff>num){
min.length=0; min.length=0;
min.push(players[i]); min.push(players[i]);
@ -1505,7 +1505,7 @@ character.ow={
} }
} }
for(var i=0;i<min.length;i++){ for(var i=0;i<min.length;i++){
if(ai.get.attitude(player,min[i])>0) 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[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0;
} }
if(min.contains(target)) return -1; if(min.contains(target)) return -1;
@ -1554,7 +1554,7 @@ character.ow={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:function(cards,player){
@ -1668,7 +1668,7 @@ character.ow={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 4-ai.get.value(card); return 4-get.value(card);
}, },
content:function(){ content:function(){
while(player.next!=target){ while(player.next!=target){
@ -1679,9 +1679,9 @@ character.ow={
order:5, order:5,
result:{ result:{
player:function(player,target){ 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.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; return 0;
} }
} }
@ -1719,13 +1719,13 @@ character.ow={
} }
} }
if(max==-min){ if(max==-min){
return 5-ai.get.value(card); return 5-get.value(card);
} }
else if(max>-min){ 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{ else{
if(get.color(card)=='black') return 5-ai.get.value(card); if(get.color(card)=='black') return 5-get.value(card);
} }
return 0; return 0;
}, },
@ -1761,7 +1761,7 @@ character.ow={
}); });
var num=0; var num=0;
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
num+=ai.get.attitude(player,targets[i]); num+=get.attitude(player,targets[i]);
} }
return num; return num;
}, },
@ -1806,7 +1806,7 @@ character.ow={
'step 0' 'step 0'
var goon=false; var goon=false;
var goon2=false; var goon2=false;
var att=ai.get.attitude(player,trigger.player); var att=get.attitude(player,trigger.player);
if(att>0){ if(att>0){
if(trigger.player.hp==1) goon=true; if(trigger.player.hp==1) goon=true;
} }
@ -1816,8 +1816,8 @@ character.ow={
if(Math.random()<0.3) goon2=true; 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){ 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(ui.selected.cards.length) return 0;
if(goon) return 6-ai.get.value(card); if(goon) return 6-get.value(card);
if(goon2) return 4-ai.get.value(card); if(goon2) return 4-get.value(card);
return 0; return 0;
} }
'step 1' 'step 1'
@ -1825,7 +1825,7 @@ character.ow={
var num=result.cards.length; var num=result.cards.length;
event.num=num; event.num=num;
player.chooseControl('选项一','选项二','选项三','选项四',function(){ player.chooseControl('选项一','选项二','选项三','选项四',function(){
if(ai.get.attitude(player,trigger.player)>0){ if(get.attitude(player,trigger.player)>0){
if(Math.random()<0.7) return '选项一'; if(Math.random()<0.7) return '选项一';
return '选项三'; return '选项三';
} }
@ -1917,7 +1917,7 @@ character.ow={
shuangqiang:{ shuangqiang:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
check:function(event,player){ 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; if(event.player.hp==1) return att>0;
return att<=0; return att<=0;
}, },
@ -2020,7 +2020,7 @@ character.ow={
order:11, order:11,
result:{ result:{
target:function(player,target){ 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; if(get.distance(player,target)>2) return -1.5;
return -1; return -1;
} }
@ -2104,12 +2104,12 @@ character.ow={
} }
target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到2点火焰伤害').ai=function(card){ target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到2点火焰伤害').ai=function(card){
if(target.hasSkillTag('nofire')) return 0; if(target.hasSkillTag('nofire')) return 0;
if(get.type(card)!='basic') return 11-ai.get.value(card); if(get.type(card)!='basic') return 11-get.value(card);
if(target.hp>4) return 7-ai.get.value(card); if(target.hp>4) return 7-get.value(card);
if(target.hp==4&&num>=3) return 7-ai.get.value(card); if(target.hp==4&&num>=3) return 7-get.value(card);
if(target.hp==3&&num>=4) return 7-ai.get.value(card); if(target.hp==3&&num>=4) return 7-get.value(card);
if(num>1) return 8-ai.get.value(card); if(num>1) return 8-get.value(card);
return 10-ai.get.value(card); return 10-get.value(card);
}; };
'step 1' 'step 1'
if(!result.bool){ if(!result.bool){
@ -2129,7 +2129,7 @@ character.ow={
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]==player||players[i].hasSkillTag('nofire')||get.distance(player,players[i])>2) continue; if(players[i]==player||players[i].hasSkillTag('nofire')||get.distance(player,players[i])>2) continue;
var nh=players[i].countCards('h'); var nh=players[i].countCards('h');
var att=ai.get.attitude(player,players[i]); var att=get.attitude(player,players[i]);
if(nh<player.storage.jijia){ if(nh<player.storage.jijia){
if(att<0){ if(att<0){
if(players[i].hp<=2){ if(players[i].hp<=2){
@ -2171,7 +2171,7 @@ character.ow={
var dis=trigger.target.countCards('h','shan')||trigger.target.getEquip('bagua')||trigger.target.countCards('h')>2; var dis=trigger.target.countCards('h','shan')||trigger.target.getEquip('bagua')||trigger.target.countCards('h')>2;
var next=player.chooseToDiscard(get.prompt('xiandan')); var next=player.chooseToDiscard(get.prompt('xiandan'));
next.ai=function(card){ next.ai=function(card){
if(dis) return 7-ai.get.value(card); if(dis) return 7-get.value(card);
return 0; return 0;
} }
next.logSkill='xiandan'; next.logSkill='xiandan';
@ -2224,7 +2224,7 @@ character.ow={
if(!player.countCards('he',{color:'black'})) return false; if(!player.countCards('he',{color:'black'})) return false;
}, },
prompt:'将一张黑色牌当杀使用或打出', prompt:'将一张黑色牌当杀使用或打出',
check:function(card){return 4-ai.get.value(card)}, check:function(card){return 4-get.value(card)},
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
if(!player.countCards('he',{color:'black'})) return false; if(!player.countCards('he',{color:'black'})) return false;
@ -2256,7 +2256,7 @@ character.ow={
var next=player.chooseToDiscard(get.prompt('lichang'),'he',{color:'red'}); var next=player.chooseToDiscard(get.prompt('lichang'),'he',{color:'red'});
next.logSkill='lichang'; next.logSkill='lichang';
next.ai=function(card){ next.ai=function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2276,7 +2276,7 @@ character.ow={
player.chooseTarget(get.prompt('lichang'),function(card,player,target){ player.chooseTarget(get.prompt('lichang'),function(card,player,target){
return get.distance(player,target)<=1; return get.distance(player,target)<=1;
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0){ if(att>0){
if(target.hp==1&&target.maxHp>1) return att*2; if(target.hp==1&&target.maxHp>1) return att*2;
} }
@ -2421,7 +2421,7 @@ character.ow={
}, },
filterCard:{suit:'heart'}, filterCard:{suit:'heart'},
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
var current=game.findPlayer(function(player){ var current=game.findPlayer(function(player){
@ -2443,10 +2443,10 @@ character.ow={
var current=game.findPlayer(function(player){ var current=game.findPlayer(function(player){
return player.hasSkill('xie2'); return player.hasSkill('xie2');
}); });
if(current&&ai.get.recoverEffect(current,player,player)>0){ if(current&&get.recoverEffect(current,player,player)>0){
return 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'}, filterCard:{suit:'spade'},
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
var current=game.findPlayer(function(player){ var current=game.findPlayer(function(player){
@ -2549,7 +2549,7 @@ character.ow={
var current=game.findPlayer(function(player){ var current=game.findPlayer(function(player){
return player.hasSkill('luan2'); return player.hasSkill('luan2');
}); });
if(current&&ai.get.attitude(player,current)<0){ if(current&&get.attitude(player,current)<0){
return 0; return 0;
} }
if(target.hp==1) return 0.5; if(target.hp==1) return 0.5;
@ -2677,12 +2677,12 @@ character.ow={
order:1, order:1,
result:{ result:{
target:function(player,target){ 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.hp==1) return eff;
if(player.hasUnknown()) return 0; if(player.hasUnknown()) return 0;
var num1=0,num2=0,num3=0,players=game.filterPlayer(); var num1=0,num2=0,num3=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
num1++; num1++;
if(players[i].isDamaged()){ if(players[i].isDamaged()){
num2++; num2++;
@ -2731,10 +2731,10 @@ character.ow={
return get.color(card)=='black'&&lib.filter.cardDiscardable(card,player); return get.color(card)=='black'&&lib.filter.cardDiscardable(card,player);
}, },
ai1:function(card){ ai1:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
var att=-ai.get.attitude(player,target); var att=-get.attitude(player,target);
if(target==player.next){ if(target==player.next){
att/=10; att/=10;
} }
@ -2803,7 +2803,7 @@ character.ow={
selectCard:2, selectCard:2,
position:'he', position:'he',
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
selectTarget:-1, selectTarget:-1,
multitarget:true, multitarget:true,
@ -2823,7 +2823,7 @@ character.ow={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasUnknown()) return 0; 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 eff=0;
var targets=game.filterPlayer(function(current){ var targets=game.filterPlayer(function(current){
if(current!=trigger.player&&get.distance(trigger.player,current)<=1){ 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; return true;
} }
}); });
event.targets=targets; event.targets=targets;
player.chooseToDiscard(get.prompt('feidan',targets)).set('ai',function(card){ 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; return 0;
}).set('logSkill',['feidan',targets]); }).set('logSkill',['feidan',targets]);
"step 1" "step 1"
@ -2891,9 +2891,9 @@ character.ow={
return true; return true;
}).set('ai',function(target){ }).set('ai',function(target){
if(player.storage.yuedong_recover){ 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){ if(player==target){
var num2=player.needsToDiscard(num); var num2=player.needsToDiscard(num);
if(num2>1) return att/5; if(num2>1) return att/5;
@ -2934,7 +2934,7 @@ character.ow={
return player.countCards('he')>1&&!player.storage.yuedong_recover; return player.countCards('he')>1&&!player.storage.yuedong_recover;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
player.storage.yuedong_recover=true; player.storage.yuedong_recover=true;
@ -2945,7 +2945,7 @@ character.ow={
player:function(player){ player:function(player){
var num1=0,num2=0,players=game.filterPlayer(); var num1=0,num2=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
num2++; num2++;
if(players[i].hp<=2&&players[i].maxHp>2){ if(players[i].hp<=2&&players[i].maxHp>2){
num1++; num1++;
@ -2983,7 +2983,7 @@ character.ow={
var player=_status.event.player; var player=_status.event.player;
var num1=0,num2=0,players=game.filterPlayer(); var num1=0,num2=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
num2++; num2++;
if(players[i].hp<=2&&players[i].maxHp>2){ if(players[i].hp<=2&&players[i].maxHp>2){
num1++; num1++;
@ -2993,19 +2993,19 @@ character.ow={
if(player.storage.yuedong_recover){ if(player.storage.yuedong_recover){
if(num1>1&&!player.storage.yuedong_num){ if(num1>1&&!player.storage.yuedong_num){
if(ui.selected.cards.length) return 0; if(ui.selected.cards.length) return 0;
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
} }
else{ else{
if(num2>1&&!player.storage.yuedong_num){ if(num2>1&&!player.storage.yuedong_num){
if(ui.selected.cards.length) return 0; if(ui.selected.cards.length) return 0;
return 7-ai.get.value(card); return 7-get.value(card);
} }
if(num2>2){ 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(){ content:function(){
@ -3043,13 +3043,13 @@ character.ow={
var suit=get.suit(card); var suit=get.suit(card);
if(suit=='heart'){ if(suit=='heart'){
if(game.hasPlayer(function(current){ 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'){ 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){ filter:function(event,player){
return player.countCards('he')>0; return player.countCards('he')>0;
@ -3076,7 +3076,7 @@ character.ow={
case 'heart':if(target.hp==1) return 1;return 0.1; case 'heart':if(target.hp==1) return 1;return 0.1;
case 'diamond':return 1+Math.sqrt(target.countCards('h')); case 'diamond':return 1+Math.sqrt(target.countCards('h'));
case 'club':return -target.countCards('h')-Math.sqrt(target.countCards('h','sha')); 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; default:return 0;
} }
} }
@ -3171,7 +3171,7 @@ character.ow={
threaten:2, threaten:2,
result:{ result:{
target:function(player,target){ 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; return event.player!=player&&!player.isTurnedOver()&&!player.storage.shanxian;
}, },
check:function(event,player){ 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); ((player.countCards('h')>player.hp&&player.countCards('h','lebu')==0)||get.distance(player,event.player)>1);
}, },
alter:true, alter:true,

View File

@ -54,16 +54,16 @@ character.refresh={
if(players[i].hasSkill('haoshi')&& if(players[i].hasSkill('haoshi')&&
!players[i].isTurnedOver()&& !players[i].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& get.attitude(player,players[i])>=3&&
ai.get.attitude(players[i],player)>=3){ get.attitude(players[i],player)>=3){
return 11-ai.get.value(card); return 11-get.value(card);
} }
} }
if(player.countCards('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-get.value(card);
if(player.countCards('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -106,7 +106,7 @@ character.refresh={
} }
if(card.name=='sha'){ if(card.name=='sha'){
if(game.hasPlayer(function(current){ 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=='fire') return 2.95;
if(card.nature=='thunder') return 2.92; if(card.nature=='thunder') return 2.92;
@ -141,7 +141,7 @@ character.refresh={
return player.canUse(_status.event.fakecard,target,true,true); return player.canUse(_status.event.fakecard,target,true,true);
},true,'选择出杀目标').set('ai',function(target){ },true,'选择出杀目标').set('ai',function(target){
var player=_status.event.player; 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); }).set('fakecard',card);
} }
else{ else{
@ -184,7 +184,7 @@ character.refresh={
if(player==target&&get.type(card)=='equip'){ if(player==target&&get.type(card)=='equip'){
if(player.countCards('e',{subtype:get.subtype(card)})){ if(player.countCards('e',{subtype:get.subtype(card)})){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current!=player&&ai.get.attitude(player,current)>0; return current!=player&&get.attitude(player,current)>0;
})){ })){
return 0; return 0;
} }
@ -222,7 +222,7 @@ character.refresh={
return evt.player.canUse({name:'juedou'},target)&&target!=_status.event.player; return evt.player.canUse({name:'juedou'},target)&&target!=_status.event.player;
},get.prompt('liyu')).set('ai',function(target){ },get.prompt('liyu')).set('ai',function(target){
var evt=_status.event.getParent(); 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' 'step 1'
if(result.bool){ if(result.bool){
@ -284,7 +284,7 @@ character.refresh={
player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){
return target.countCards('h')>0&&player!=target&&target.countCards('h')>=player.countCards('h'); return target.countCards('h')>0&&player!=target&&target.countCards('h')>=player.countCards('h');
},function(target){ },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; if(target.hasSkill('tuntian')) return att/10;
return 1-att; return 1-att;
}); });
@ -320,13 +320,13 @@ character.refresh={
var player=_status.event.player; var player=_status.event.player;
var judging=_status.event.judging; var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(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||result==0) return 0;
if(attitude>0){ if(attitude>0){
return result-ai.get.value(card)/2; return result-get.value(card)/2;
} }
else{ else{
return -result-ai.get.value(card)/2; return -result-get.value(card)/2;
} }
}).set('judging',trigger.player.judging[0]); }).set('judging',trigger.player.judging[0]);
"step 1" "step 1"
@ -371,14 +371,14 @@ character.refresh={
return (event.source&&event.source.countCards('he')&&event.num>0&&event.source!=player); return (event.source&&event.source.countCards('he')&&event.num>0&&event.source!=player);
}, },
content:function(){ 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:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1.5]; 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); return (event.source!=undefined&&event.num>0);
}, },
check:function(event,player){ check:function(event,player){
return (ai.get.attitude(player,event.source)<=0); return (get.attitude(player,event.source)<=0);
}, },
logTarget:'source', logTarget:'source',
content:function(){ content:function(){
@ -511,7 +511,7 @@ character.refresh={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ 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(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return 1-att; return 1-att;
@ -569,7 +569,7 @@ character.refresh={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
discard:false, discard:false,
prepare:'give', prepare:'give',
@ -588,7 +588,7 @@ character.refresh={
} }
if(player.hp==1) return 0; if(player.hp==1) return 0;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.value(cards[i])>=8) return 1; if(get.value(cards[i])>=8) return 1;
} }
if(cards.length>2&&player.hp>2) return 1; if(cards.length>2&&player.hp>2) return 1;
if(cards.length>3) return 1; if(cards.length>3) return 1;
@ -693,8 +693,8 @@ character.refresh={
} }
player.chooseTarget('选择发动连营的目标',[1,num]).ai=function(target){ player.chooseTarget('选择发动连营的目标',[1,num]).ai=function(target){
var player=_status.event.player; var player=_status.event.player;
if(player==target) return ai.get.attitude(player,target)+10; if(player==target) return get.attitude(player,target)+10;
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -790,7 +790,7 @@ character.refresh={
game.addVideo('centernode',null,get.cardInfo(event.card)); game.addVideo('centernode',null,get.cardInfo(event.card));
if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){ if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){
player.chooseTarget('选择获得此牌的角色').set('ai',function(target){ 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(_status.event.du){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return -att; return -att;
@ -925,7 +925,7 @@ character.refresh={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ 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(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return 1-att; return 1-att;
@ -1022,7 +1022,7 @@ character.refresh={
} }
else if(target.hp<target.maxHp){ else if(target.hp<target.maxHp){
player.chooseBool('是否让目标回复一点体力?').ai=function(event,player){ player.chooseBool('是否让目标回复一点体力?').ai=function(event,player){
return ai.get.recoverEffect(target,player,player)>0; return get.recoverEffect(target,player,player)>0;
}; };
} }
else{ else{
@ -1040,13 +1040,13 @@ character.refresh={
if(hs.length<3) return 0; if(hs.length<3) return 0;
var bool=false; var bool=false;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(hs[i].number>=9&&ai.get.value(hs[i])<7){ if(hs[i].number>=9&&get.value(hs[i])<7){
bool=true; bool=true;
break; break;
} }
} }
if(!bool) return 0; 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; return 1;
} }
if(player.canUse('sha',target)&&(player.countCards('h','sha')||player.countCards('he',{color:'red'}))){ if(player.canUse('sha',target)&&(player.countCards('h','sha')||player.countCards('he',{color:'red'}))){
@ -1082,7 +1082,7 @@ character.refresh={
audio:2, audio:2,
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
@ -1101,7 +1101,7 @@ character.refresh={
var num=_status.event.num; var num=_status.event.num;
if(num==0) return 0; if(num==0) return 0;
if(card.name=='shan') return num>1?2: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); }).set('num',num).set('suit',suit);
"step 2" "step 2"
if(!result.bool){ if(!result.bool){
@ -1157,7 +1157,7 @@ character.refresh={
usable:1, usable:1,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
position:'he', position:'he',
content:function(){ content:function(){
@ -1313,7 +1313,7 @@ character.refresh={
return lib.filter.targetEnabled({name:'lebu'},player,target); return lib.filter.targetEnabled({name:'lebu'},player,target);
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
if(target.hasJudge('lebu')){ if(target.hasJudge('lebu')){
@ -1329,8 +1329,8 @@ character.refresh={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasJudge('lebu')) return -ai.get.effect(target,{name:'lebu'},player,target); if(target.hasJudge('lebu')) return -get.effect(target,{name:'lebu'},player,target);
return ai.get.effect(target,{name:'lebu'},player,target); return get.effect(target,{name:'lebu'},player,target);
} }
}, },
order:9, order:9,
@ -1362,7 +1362,7 @@ character.refresh={
}).set('ai',function(target){ }).set('ai',function(target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
if(game.phaseNumber>game.players.length*2&&trigger.targets.length>=game.players.length-1){ 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; return -1;
}); });
@ -1400,8 +1400,8 @@ character.refresh={
position:'he', position:'he',
selectTarget:[1,Infinity], selectTarget:[1,Infinity],
check:function(card){ check:function(card){
if(get.suit(card)=='spade') return 8-ai.get.value(card); if(get.suit(card)=='spade') return 8-get.value(card);
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1432,7 +1432,7 @@ character.refresh={
trigger.untrigger(); trigger.untrigger();
trigger.finish(); trigger.finish();
event.cards=get.cards(4); 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" "step 1"
if(result.bool){ if(result.bool){
var choice=[]; var choice=[];
@ -1456,8 +1456,8 @@ character.refresh={
event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player;
}, },
check:function(event,player){ check:function(event,player){
if(event.player==player) return ai.get.attitude(player,event.source)>-3; if(event.player==player) return get.attitude(player,event.source)>-3;
return ai.get.attitude(player,event.player)>-3; return get.attitude(player,event.player)>-3;
}, },
logTarget:function(event,player){ logTarget:function(event,player){
if(event.player==player) return event.source; if(event.player==player) return event.source;

View File

@ -90,9 +90,9 @@ character.shenhua={
'step 0' 'step 0'
player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target)).set('ai',function(button){ player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target)).set('ai',function(button){
if(!_status.event.att) return 0; 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; 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' 'step 1'
if(result.bool&&result.links&&result.links.length){ if(result.bool&&result.links&&result.links.length){
if(get.type(result.links[0])=='equip'){ if(get.type(result.links[0])=='equip'){
@ -159,7 +159,7 @@ character.shenhua={
'step 1' 'step 1'
if(event.dialog.buttons.length>1){ if(event.dialog.buttons.length>1){
var next=event.current.chooseButton(true,function(button){ 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('dialog',event.dialog.videoId);
next.set('closeDialog',false); next.set('closeDialog',false);
@ -247,11 +247,11 @@ character.shenhua={
targetprompt:['先拿牌','后拿牌'], targetprompt:['先拿牌','后拿牌'],
find:function(type){ find:function(type){
var list=game.filterPlayer(function(current){ 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 player=_status.event.player;
var num=player.countCards('he',function(card){ var num=player.countCards('he',function(card){
return ai.get.value(card)<7; return get.value(card)<7;
}); });
var count=null; var count=null;
var from,nh; var from,nh;
@ -264,7 +264,7 @@ character.shenhua={
nh=from.countCards('h'); nh=from.countCards('h');
list=game.filterPlayer(function(current){ 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; if(list.length==0) return null;
list.sort(function(a,b){ list.sort(function(a,b){
@ -283,7 +283,7 @@ character.shenhua={
check:function(card){ check:function(card){
var count=lib.skill.redimeng.find(3); var count=lib.skill.redimeng.find(3);
if(count==null) return -1; if(count==null) return -1;
if(ui.selected.cards.length<count) return 7-ai.get.value(card); if(ui.selected.cards.length<count) return 7-get.value(card);
return -1; return -1;
}, },
ai:{ ai:{
@ -315,7 +315,7 @@ character.shenhua={
filterCard:{suit:'club'}, filterCard:{suit:'club'},
viewAs:{name:'tiesuo'}, viewAs:{name:'tiesuo'},
prompt:'将一张梅花牌当铁锁连环使用', prompt:'将一张梅花牌当铁锁连环使用',
check:function(card){return 6-ai.get.value(card)}, check:function(card){return 6-get.value(card)},
ai:{ ai:{
order:7.5, order:7.5,
result:{ result:{
@ -348,7 +348,7 @@ character.shenhua={
}, },
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
basic:{ basic:{
@ -471,7 +471,7 @@ character.shenhua={
return (current.hp<=mindist-1&& return (current.hp<=mindist-1&&
get.distance(player,current,'attack')<=mindist&& get.distance(player,current,'attack')<=mindist&&
player.canUse(card,current,false)&& player.canUse(card,current,false)&&
ai.get.effect(current,card,player,player)>0); get.effect(current,card,player,player)>0);
})){ })){
return 1; return 1;
} }
@ -528,7 +528,7 @@ character.shenhua={
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
logTarget:'target', logTarget:'target',
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
if(event.target.countCards('h')<=player.countCards('h')) return true; if(event.target.countCards('h')<=player.countCards('h')) return true;
@ -632,12 +632,12 @@ character.shenhua={
}, },
content:function(){ content:function(){
"step 0" "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){ trigger.player.chooseToDiscard('享乐:弃置一张基本牌,否则杀对'+get.translation(player)+'无效',function(card){
return get.type(card)=='basic'; return get.type(card)=='basic';
}).set('ai',function(card){ }).set('ai',function(card){
if(_status.event.eff>0){ if(_status.event.eff>0){
return 10-ai.get.value(card); return 10-get.value(card);
} }
return 0; return 0;
}).set('eff',eff); }).set('eff',eff);
@ -657,7 +657,7 @@ character.shenhua={
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return;
if(bs.length<=3&&player.countCards('h','sha')<=1){ if(bs.length<=3&&player.countCards('h','sha')<=1){
for(var i=0;i<bs.length;i++){ for(var i=0;i<bs.length;i++){
if(bs[i].name!='sha'&&ai.get.value(bs[i])<7){ if(bs[i].name!='sha'&&get.value(bs[i])<7){
return [1,0,1,-0.5]; return [1,0,1,-0.5];
} }
} }
@ -684,7 +684,7 @@ character.shenhua={
}).set('ai',function(target){ }).set('ai',function(target){
if(!_status.event.fang) return -1; if(!_status.event.fang) return -1;
if(target.hasJudge('lebu')) return -1; if(target.hasJudge('lebu')) return -1;
return ai.get.attitude(player,target)-4; return get.attitude(player,target)-4;
}).set('fang',fang); }).set('fang',fang);
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -780,7 +780,7 @@ character.shenhua={
} }
else{ else{
var next=player.chooseToDiscard('是否发动巧变跳过判定阶段?'); var next=player.chooseToDiscard('是否发动巧变跳过判定阶段?');
next.set('ai',ai.get.unuseful2); next.set('ai',get.unuseful2);
next.set('logSkill','qiaobian'); next.set('logSkill','qiaobian');
} }
"step 1" "step 1"
@ -802,7 +802,7 @@ character.shenhua={
var check,i,num=0,num2=0,players=game.filterPlayer(); var check,i,num=0,num2=0,players=game.filterPlayer();
for(i=0;i<players.length;i++){ for(i=0;i<players.length;i++){
if(player!=players[i]&&players[i].countCards('h')){ if(player!=players[i]&&players[i].countCards('h')){
var att=ai.get.attitude(player,players[i]); var att=get.attitude(player,players[i]);
if(att<=0){ if(att<=0){
num++; num++;
} }
@ -817,12 +817,12 @@ character.shenhua={
ai1:function(card){ ai1:function(card){
var evt=_status.event; var evt=_status.event;
if(!evt.check) return 0; if(!evt.check) return 0;
return 6-ai.get.useful(card); return 6-get.useful(card);
}, },
ai2:function(target){ ai2:function(target){
var evt=_status.event; var evt=_status.event;
if(!evt.check) return 0; if(!evt.check) return 0;
return 1-ai.get.attitude(evt.player,target); return 1-get.attitude(evt.player,target);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.countCards('h')>0; return target.countCards('h')>0;
@ -863,7 +863,7 @@ character.shenhua={
content:function(){ content:function(){
"step 0" "step 0"
var check=game.hasPlayer(function(current){ var check=game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.countCards('j'); return get.attitude(player,current)>0&&current.countCards('j');
}); });
if(!check){ if(!check){
if(player.countCards('h')>player.hp+1){ if(player.countCards('h')>player.hp+1){
@ -879,28 +879,28 @@ character.shenhua={
player.chooseCardTarget({ player.chooseCardTarget({
ai1:function(card){ ai1:function(card){
if(!_status.event.check) return 0; if(!_status.event.check) return 0;
return 7-ai.get.useful(card); return 7-get.useful(card);
}, },
ai2:function(target){ ai2:function(target){
if(!_status.event.check) return 0; if(!_status.event.check) return 0;
var player=_status.event.player; var player=_status.event.player;
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 10; if(target.countCards('j')&&get.attitude(player,target)>0) return 10;
if(ai.get.attitude(player,target)<0){ if(get.attitude(player,target)<0){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
if((target.getEquip(1)&&!players[i].getEquip(1))|| if((target.getEquip(1)&&!players[i].getEquip(1))||
(target.getEquip(2)&&!players[i].getEquip(2))|| (target.getEquip(2)&&!players[i].getEquip(2))||
(target.getEquip(3)&&!players[i].getEquip(3))|| (target.getEquip(3)&&!players[i].getEquip(3))||
(target.getEquip(4)&&!players[i].getEquip(4))|| (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 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, multitarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -948,12 +948,12 @@ character.shenhua={
var player=_status.event.player; var player=_status.event.player;
var targets0=_status.event.targets0; var targets0=_status.event.targets0;
var targets1=_status.event.targets1; 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; return get.position(button.link)=='j'?10:0;
} }
else{ else{
if(get.position(button.link)=='j') return -10; 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){ },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){
var targets1=_status.event.targets1; var targets1=_status.event.targets1;
@ -1002,7 +1002,7 @@ character.shenhua={
next.logSkill='qiaobian'; next.logSkill='qiaobian';
next.ai=function(card){ next.ai=function(card){
if(discard){ if(discard){
return 100-ai.get.useful(card); return 100-get.useful(card);
} }
else{ else{
return -1; return -1;
@ -1084,7 +1084,7 @@ character.shenhua={
} }
} }
else if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ 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(get.tag(card,'damage')&&target.hasSkillTag('maixie')) return;
if(target.countCards('h')==0) return 2; if(target.countCards('h')==0) return 2;
if(target.hasSkill('ziliang')) return 0.7; if(target.hasSkill('ziliang')) return 0.7;
@ -1238,7 +1238,7 @@ character.shenhua={
content:function(){ content:function(){
"step 0" "step 0"
if(target.storage.hunzi){ 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{ else{
event.forced=true; event.forced=true;
@ -1254,7 +1254,7 @@ character.shenhua={
if(card.name=='du') return 20; if(card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
var target=_status.event.getParent().target; 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);
} }
return get.number(card); return get.number(card);
@ -1272,7 +1272,7 @@ character.shenhua={
expose:0.2, expose:0.2,
result:{ result:{
target:function(player,target){ 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; if(player.countCards('h')<=player.hp) return 0;
var maxnum=0; var maxnum=0;
var cards2=target.getCards('h'); var cards2=target.getCards('h');
@ -1304,9 +1304,9 @@ character.shenhua={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('he',{subtype:get.subtype(card)})>1){ 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){ filterTarget:function(card,player,target){
if(target.isMin()) return false; 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){ if(du&&num<=3){
return false; return false;
} }
@ -1382,7 +1382,7 @@ character.shenhua={
var check=lib.skill.guzheng.checkx(trigger,player); var check=lib.skill.guzheng.checkx(trigger,player);
player.chooseCardButton(event.cards,'固政:选择令'+get.translation(trigger.player)+'收回的牌').set('ai',function(button){ player.chooseCardButton(event.cards,'固政:选择令'+get.translation(trigger.player)+'收回的牌').set('ai',function(button){
if(_status.event.check){ if(_status.event.check){
return 20-ai.get.value(button.link); return 20-get.value(button.link);
} }
return 0; return 0;
}).set('check',check); }).set('check',check);
@ -1416,8 +1416,8 @@ character.shenhua={
}, },
direct:true, direct:true,
checkx:function(event,player){ checkx:function(event,player){
var att1=ai.get.attitude(player,event.player); var att1=get.attitude(player,event.player);
var att2=ai.get.attitude(player,event.source); var att2=get.attitude(player,event.source);
return att1>0&&att2<=0; return att1>0&&att2<=0;
}, },
content:function(){ content:function(){
@ -1425,7 +1425,7 @@ character.shenhua={
var next=player.chooseToDiscard('he',get.prompt('beige')); var next=player.chooseToDiscard('he',get.prompt('beige'));
var check=lib.skill.beige.checkx(trigger,player); var check=lib.skill.beige.checkx(trigger,player);
next.set('ai',function(card){ 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; return 0;
}); });
next.set('logSkill','beige'); next.set('logSkill','beige');
@ -1876,7 +1876,7 @@ character.shenhua={
event.player.countCards('h')&&player.countCards('h'))&&event.player!=player; event.player.countCards('h')&&player.countCards('h'))&&event.player!=player;
}, },
check:function(event,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, priority:5,
content:function(){ content:function(){
@ -1925,8 +1925,8 @@ character.shenhua={
return player!=target return player!=target
}).ai=function(target){ }).ai=function(target){
var player=_status.event.player; var player=_status.event.player;
if(ai.get.attitude(_status.event.player,target)==0) return 0; if(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){
if(target.classList.contains('turnedover')) return 1000-target.countCards('h'); if(target.classList.contains('turnedover')) return 1000-target.countCards('h');
if(player.maxHp-player.hp<3) return -1; if(player.maxHp-player.hp<3) return -1;
return 100-target.countCards('h'); return 100-target.countCards('h');
@ -1957,15 +1957,15 @@ character.shenhua={
var turnfriend=false; var turnfriend=false;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,players[i])<0&&!players[i].isTurnedOver()){ if(get.attitude(target,players[i])<0&&!players[i].isTurnedOver()){
hastarget=true; hastarget=true;
} }
if(ai.get.attitude(target,players[i])>0&&players[i].isTurnedOver()){ if(get.attitude(target,players[i])>0&&players[i].isTurnedOver()){
hastarget=true; hastarget=true;
turnfriend=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(turnfriend||target.hp==target.maxHp) return [0.5,1];
if(target.hp>1) return [1,0.5]; if(target.hp>1) return [1,0.5];
} }
@ -2000,7 +2000,7 @@ character.shenhua={
if(event.list.length){ if(event.list.length){
var current=event.list.shift(); var current=event.list.shift();
event.current=current; 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{ else{
event.finish(); event.finish();
@ -2032,7 +2032,7 @@ character.shenhua={
position:'he', position:'he',
viewAs:{name:'bingliang'}, viewAs:{name:'bingliang'},
prompt:'将一黑色的基本牌或装备牌当兵粮寸断使用', prompt:'将一黑色的基本牌或装备牌当兵粮寸断使用',
check:function(card){return 6-ai.get.value(card)}, check:function(card){return 6-get.value(card)},
ai:{ ai:{
order:9 order:9
} }
@ -2066,7 +2066,7 @@ character.shenhua={
} }
} }
for(var i=0;i<min.length;i++){ for(var i=0;i<min.length;i++){
if(ai.get.attitude(player,min[i])>0) return true; if(get.attitude(player,min[i])>0) return true;
} }
return false; return false;
}, },
@ -2105,7 +2105,7 @@ character.shenhua={
}, },
forced:true, forced:true,
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target); return get.attitude(_status.event.player,target);
} }
}); });
"step 1" "step 1"
@ -2144,7 +2144,7 @@ character.shenhua={
var count; var count;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]); if(players[i]!=player&&get.attitude(player,players[i])>3) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return a.countCards('h')-b.countCards('h'); return a.countCards('h')-b.countCards('h');
@ -2154,7 +2154,7 @@ character.shenhua={
list.length=0; list.length=0;
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])<1) list.push(players[i]); if(players[i]!=player&&get.attitude(player,players[i])<1) list.push(players[i]);
} }
if(list.length==0) return -1; if(list.length==0) return -1;
list.sort(function(a,b){ list.sort(function(a,b){
@ -2167,7 +2167,7 @@ character.shenhua={
} }
} }
if(count<2&&from.countCards('h')>=2) return -1; if(count<2&&from.countCards('h')>=2) return -1;
if(ui.selected.cards.length<count) return 11-ai.get.value(card); if(ui.selected.cards.length<count) return 11-get.value(card);
return -1; return -1;
}, },
ai:{ ai:{
@ -2181,29 +2181,29 @@ character.shenhua={
var players=game.filterPlayer(); var players=game.filterPlayer();
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]); if(players[i]!=player&&get.attitude(player,players[i])>3) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return a.countCards('h')-b.countCards('h'); return a.countCards('h')-b.countCards('h');
}); });
if(target==list[0]) return ai.get.attitude(player,target); if(target==list[0]) return get.attitude(player,target);
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
else{ else{
var from=ui.selected.targets[0]; var from=ui.selected.targets[0];
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])<1) list.push(players[i]); if(players[i]!=player&&get.attitude(player,players[i])<1) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return b.countCards('h')-a.countCards('h'); return b.countCards('h')-a.countCards('h');
}); });
if(from.countCards('h')>=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<list.length&&from.countCards('h')<list[i].countCards('h');i++){ for(var i=0;i<list.length&&from.countCards('h')<list[i].countCards('h');i++){
if(list[i].countCards('h')-from.countCards('h')<=num){ if(list[i].countCards('h')-from.countCards('h')<=num){
var count=list[i].countCards('h')-from.countCards('h'); var count=list[i].countCards('h')-from.countCards('h');
if(count<2&&from.countCards('h')>=2) return -ai.get.attitude(player,target); if(count<2&&from.countCards('h')>=2) return -get.attitude(player,target);
if(target==list[i]) return ai.get.attitude(player,target); if(target==list[i]) return get.attitude(player,target);
return -ai.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){ if(player.maxHp-player.hp==1&&target.countCards('he')==0){
return 0; return 0;
} }
if(ai.get.attitude(_status.event.player,target)>0){ if(get.attitude(_status.event.player,target)>0){
return 10+ai.get.attitude(_status.event.player,target); return 10+get.attitude(_status.event.player,target);
} }
if(player.maxHp-player.hp==1){ if(player.maxHp-player.hp==1){
return -1; return -1;
@ -2252,7 +2252,7 @@ character.shenhua={
var str2='摸一弃'+get.cnNumber(event.num,true); var str2='摸一弃'+get.cnNumber(event.num,true);
player.chooseControl(str1,str2,function(event,player){ player.chooseControl(str1,str2,function(event,player){
return _status.event.choice; 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; event.str=str1;
} }
} }
@ -2305,8 +2305,8 @@ character.shenhua={
if(player.maxHp-player.hp==1&&target.countCards('he')==0){ if(player.maxHp-player.hp==1&&target.countCards('he')==0){
return 0; return 0;
} }
if(ai.get.attitude(_status.event.player,target)>0){ if(get.attitude(_status.event.player,target)>0){
return 10+ai.get.attitude(_status.event.player,target); return 10+get.attitude(_status.event.player,target);
} }
if(player.maxHp-player.hp==1){ if(player.maxHp-player.hp==1){
return -1; return -1;
@ -2326,7 +2326,7 @@ character.shenhua={
var str2='摸一弃'+get.cnNumber(event.num,true); var str2='摸一弃'+get.cnNumber(event.num,true);
player.chooseControl(str1,str2,function(event,player){ player.chooseControl(str1,str2,function(event,player){
return _status.event.choice; 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; event.str=str1;
} }
} }
@ -2375,7 +2375,7 @@ character.shenhua={
prompt:'将一张黑桃手牌当酒使用', prompt:'将一张黑桃手牌当酒使用',
check:function(card){ check:function(card){
if(_status.event.type=='dying') return 1; if(_status.event.type=='dying') return 1;
return 4-ai.get.value(card); return 4-get.value(card);
}, },
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
@ -2405,7 +2405,7 @@ character.shenhua={
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){ next.ai=function(card){
if(trigger.target.countCards('h','shan')>1){ if(trigger.target.countCards('h','shan')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}; };
@ -2471,7 +2471,7 @@ character.shenhua={
if(event.list.length){ if(event.list.length){
var current=event.list.shift(); var current=event.list.shift();
event.current=current; 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{ else{
event.finish(); event.finish();
@ -2552,7 +2552,7 @@ character.shenhua={
var num=0; var num=0;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
var att=ai.get.attitude(player,players[i]); var att=get.attitude(player,players[i]);
if(att>0) att=1; if(att>0) att=1;
if(att<0) att=-1; if(att<0) att=-1;
if(players[i]!=player&&players[i].hp<=3){ if(players[i]!=player&&players[i].hp<=3){
@ -2609,9 +2609,9 @@ character.shenhua={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('h')>player.hp){ 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:{ bazhen:{
@ -2626,7 +2626,7 @@ character.shenhua={
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player==target&&get.subtype(card)=='equip2'){ 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; if(target.getEquip(2)) return;
return lib.skill.bagua_skill.ai.effect.target.apply(this,arguments); return lib.skill.bagua_skill.ai.effect.target.apply(this,arguments);
@ -2645,7 +2645,7 @@ character.shenhua={
}, },
viewAs:{name:'wuxie'}, viewAs:{name:'wuxie'},
prompt:'将一张黑色手牌当无懈可击使用', prompt:'将一张黑色手牌当无懈可击使用',
check:function(card){return 8-ai.get.value(card)}, check:function(card){return 8-get.value(card)},
threaten:1.2 threaten:1.2
}, },
lianhuan:{ lianhuan:{
@ -2662,7 +2662,7 @@ character.shenhua={
}, },
viewAs:{name:'tiesuo'}, viewAs:{name:'tiesuo'},
prompt:'将一张梅花牌当铁锁连环使用', prompt:'将一张梅花牌当铁锁连环使用',
check:function(card){return 4-ai.get.value(card)} check:function(card){return 4-get.value(card)}
}, },
lianhuan2:{ lianhuan2:{
audio:2, audio:2,
@ -2674,7 +2674,7 @@ character.shenhua={
return get.suit(card)=='club'; return get.suit(card)=='club';
}, },
check:function(card){ check:function(card){
return 5-ai.get.useful(card); return 5-get.useful(card);
}, },
content:function(){ content:function(){
player.draw(); player.draw();
@ -2828,7 +2828,7 @@ character.shenhua={
var source=_status.event.source; var source=_status.event.source;
return target!=source&&get.distance(source,target,'attack')<=1; return target!=source&&get.distance(source,target,'attack')<=1;
},true).set('ai',function(target){ },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); }).set('source',target);
} }
else{ else{
@ -2849,14 +2849,14 @@ character.shenhua={
order:0.5, order:0.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
var oc=(target.countCards('h')==1); var oc=(target.countCards('h')==1);
if(att>0&&oc) return 0; if(att>0&&oc) return 0;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=target&&players[i]!=player&& if(players[i]!=target&&players[i]!=player&&
get.distance(target,players[i],'attack')<=1){ get.distance(target,players[i],'attack')<=1){
if(ai.get.damageEffect(players[i],target,player)>0){ if(get.damageEffect(players[i],target,player)>0){
return att>0?att/2:att-(oc?5:0); return att>0?att/2:att-(oc?5:0);
} }
} }
@ -2874,7 +2874,7 @@ character.shenhua={
var max=player.maxHp-hs.length; var max=player.maxHp-hs.length;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>2){ if(get.attitude(player,players[i])>2){
max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); 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){ player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){
return target.countCards('h')<Math.min(target.maxHp,5); return target.countCards('h')<Math.min(target.maxHp,5);
}).set('ai',function(target){ }).set('ai',function(target){
var att=ai.get.attitude(_status.event.player,target); var att=get.attitude(_status.event.player,target);
if(att>2){ if(att>2){
return Math.min(5,target.maxHp)-target.countCards('h'); return Math.min(5,target.maxHp)-target.countCards('h');
} }
@ -2923,7 +2923,7 @@ character.shenhua={
var max=0; var max=0;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,players[i])>0){ if(get.attitude(target,players[i])>0){
max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max);
} }
} }
@ -2961,7 +2961,7 @@ character.shenhua={
target.damage(); target.damage();
}, },
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
position:'he', position:'he',
ai:{ ai:{
@ -2979,7 +2979,7 @@ character.shenhua={
if(player.hp==2&&target.hp>=2) return 0; if(player.hp==2&&target.hp>=2) return 0;
if(target.hp>player.hp) 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(); target.damage();
}, },
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
position:'he', position:'he',
ai:{ ai:{
@ -3038,7 +3038,7 @@ character.shenhua={
if(player.hp<2) return 0; if(player.hp<2) return 0;
if(target.hp>=player.hp) 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; return 1;
} }
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].name!='sha'&&cards[i].number>11&&ai.get.value(cards[i])<7){ if(cards[i].name!='sha'&&cards[i].number>11&&get.value(cards[i])<7){
return 9; return 9;
} }
} }
return ai.get.order({name:'sha'})-1; return get.order({name:'sha'})-1;
}, },
result:{ result:{
player:function(player){ player:function(player){
@ -3145,7 +3145,7 @@ character.shenhua={
return get.color(card)!=player.storage.shuangxiong; return get.color(card)!=player.storage.shuangxiong;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
basic:{ basic:{
@ -3172,7 +3172,7 @@ character.shenhua={
selectCard:2, selectCard:2,
complexCard:true, complexCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
basic:{ basic:{
@ -3201,7 +3201,7 @@ character.shenhua={
return event.target.countCards('he')>0; return event.target.countCards('he')>0;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
content:function(){ content:function(){
player.discardPlayerCard('he',trigger.target,true); player.discardPlayerCard('he',trigger.target,true);
@ -3241,10 +3241,10 @@ character.shenhua={
}); });
next.set('ai',function(target){ next.set('ai',function(target){
if(type=='equip'){ if(type=='equip'){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
else{ else{
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
}); });
next.set('type',type); next.set('type',type);
@ -3280,7 +3280,7 @@ character.shenhua={
"step 0"; "step 0";
player.chooseTarget(get.prompt('releiji')).ai=function(target){ player.chooseTarget(get.prompt('releiji')).ai=function(target){
if(target.hasSkill('hongyan')) return 0; 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" "step 1"
if(result.bool){ if(result.bool){
@ -3311,7 +3311,7 @@ character.shenhua={
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var hastarget=game.hasPlayer(function(current){ 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'}); var be=target.countCards('e',{color:'black'});
if(target.countCards('h','shan')&&be){ if(target.countCards('h','shan')&&be){
@ -3356,7 +3356,7 @@ character.shenhua={
return player.canUse({name:'sha'},target,false); return player.canUse({name:'sha'},target,false);
}).set('check',check).set('ai',function(target){ }).set('check',check).set('ai',function(target){
if(!_status.event.check) return 0; 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" "step 1"
if(result.bool){ if(result.bool){
@ -3389,11 +3389,11 @@ character.shenhua={
}, },
ai1:function(card){ ai1:function(card){
if(_status.event.check) return 0; if(_status.event.check) return 0;
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
if(_status.event.check) return 0; 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 check:check
}); });
@ -3419,7 +3419,7 @@ character.shenhua={
return player.canUse({name:'sha'},target,false); return player.canUse({name:'sha'},target,false);
}).set('check',check).set('ai',function(target){ }).set('check',check).set('ai',function(target){
if(!_status.event.check) return 0; 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" "step 1"
if(result.bool){ if(result.bool){
@ -3450,7 +3450,7 @@ character.shenhua={
audio:2, audio:2,
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
logTarget:'target', logTarget:'target',
filter:function(event,player){ filter:function(event,player){
@ -3494,10 +3494,10 @@ character.shenhua={
return player!=target; return player!=target;
}, },
ai1:function(card){ ai1:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
ai2:function(target){ 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 trigger=_status.event.getTrigger();
var da=0; var da=0;
if(_status.event.player.hp==1){ if(_status.event.player.hp==1){
@ -3507,7 +3507,7 @@ character.shenhua={
if(target.maxHp>5&&target.hp>1) return -att/10+da; if(target.maxHp>5&&target.hp>1) return -att/10+da;
return -att+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(att==0) return 0.1+da;
if(eff>=0&&trigger.num==1){ if(eff>=0&&trigger.num==1){
return att+da; return att+da;
@ -3586,10 +3586,10 @@ character.shenhua={
}, },
position:'he', position:'he',
ai1:function(card){ ai1:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
ai2:function(target){ 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 trigger=_status.event.getTrigger();
var da=0; var da=0;
if(_status.event.player.hp==1){ if(_status.event.player.hp==1){
@ -3599,7 +3599,7 @@ character.shenhua={
if(target.maxHp>5&&target.hp>1) return -att/10+da; if(target.maxHp>5&&target.hp>1) return -att/10+da;
return -att+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(att==0) return 0.1+da;
if(eff>=0&&trigger.num==1){ if(eff>=0&&trigger.num==1){
return att+da; return att+da;
@ -3662,7 +3662,7 @@ character.shenhua={
var num=player.maxHp-player.hp||0; var num=player.maxHp-player.hp||0;
var str1='令'+get.translation(player)+'摸'+get.cnNumber(num)+'张牌'; var str1='令'+get.translation(player)+'摸'+get.cnNumber(num)+'张牌';
var str2='令'+get.translation(player)+'防止造成和受到的所有伤害且天香失效直到你下一回合开始'; var str2='令'+get.translation(player)+'防止造成和受到的所有伤害且天香失效直到你下一回合开始';
var att=ai.get.attitude(source,player); var att=get.attitude(source,player);
var choice='选项一'; var choice='选项一';
if(att<0){ if(att<0){
if(num>=2){ if(num>=2){
@ -3907,7 +3907,7 @@ character.shenhua={
return false; return false;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>2; return get.attitude(player,event.player)>2;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3928,7 +3928,7 @@ character.shenhua={
"step 0"; "step 0";
player.chooseTarget(get.prompt('leiji')).ai=function(target){ player.chooseTarget(get.prompt('leiji')).ai=function(target){
if(target.hasSkill('hongyan')) return 0; 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" "step 1"
if(result.bool){ if(result.bool){
@ -3954,7 +3954,7 @@ character.shenhua={
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var hastarget=game.hasPlayer(function(current){ 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'})){ if(target.countCards('h','shan')&&target.countCards('e',{suit:'spade'})){
return [0,hastarget?target.countCards('he')/2:0]; return [0,hastarget?target.countCards('he')/2:0];
@ -3985,7 +3985,7 @@ character.shenhua={
var player=_status.event.player; var player=_status.event.player;
var judging=_status.event.judging; var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(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||result==0) return 0;
if(attitude>0){ if(attitude>0){
return result; return result;
@ -4079,7 +4079,7 @@ character.shenhua={
var cards=player.getCards('h'); var cards=player.getCards('h');
if(cards.length>=3&&player.hp>=3) return 0; if(cards.length>=3&&player.hp>=3) return 0;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
num+=Math.max(0,ai.get.value(cards[i],player,'raw')); num+=Math.max(0,get.value(cards[i],player,'raw'));
} }
num/=cards.length; num/=cards.length;
num*=Math.min(cards.length,player.hp); num*=Math.min(cards.length,player.hp);

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,7 @@ character.standard={
}); });
}, },
check:function(event,player){ 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; return true;
}, },
content:function(){ content:function(){
@ -98,13 +98,13 @@ character.standard={
} }
else if(event.current.group=='wei'){ else if(event.current.group=='wei'){
if((event.current==game.me&&!_status.auto)||( if((event.current==game.me&&!_status.auto)||(
ai.get.attitude(event.current,player)>2)|| get.attitude(event.current,player)>2)||
event.current.isOnline()){ event.current.isOnline()){
player.storage.hujiaing=true; player.storage.hujiaing=true;
var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张闪?',{name:'shan'}); var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张闪?',{name:'shan'});
next.set('ai',function(){ next.set('ai',function(){
var event=_status.event; 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.autochoose=lib.filter.autoRespondShan;
next.set('source',player); next.set('source',player);
@ -157,14 +157,14 @@ character.standard={
return (event.source&&event.source.countCards('he')&&event.source!=player); return (event.source&&event.source.countCards('he')&&event.source!=player);
}, },
content:function(){ 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:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1.5]; 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 player=_status.event.player;
var judging=_status.event.judging; var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(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||result==0) return 0;
if(attitude>0){ if(attitude>0){
return result-ai.get.value(card)/2; return result-get.value(card)/2;
} }
else{ else{
return -result-ai.get.value(card)/2; return -result-get.value(card)/2;
} }
}).set('judging',trigger.player.judging[0]); }).set('judging',trigger.player.judging[0]);
"step 1" "step 1"
@ -235,7 +235,7 @@ character.standard={
return (event.source!=undefined); return (event.source!=undefined);
}, },
check:function(event,player){ check:function(event,player){
return (ai.get.attitude(player,event.source)<=0); return (get.attitude(player,event.source)<=0);
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -250,7 +250,7 @@ character.standard={
trigger.source.chooseToDiscard(2).set('ai',function(card){ trigger.source.chooseToDiscard(2).set('ai',function(card){
if(card.name=='tao') return -10; if(card.name=='tao') return -10;
if(card.name=='jiu'&&_status.event.player.hp==1) 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" "step 2"
if(result.bool==false){ if(result.bool==false){
@ -261,7 +261,7 @@ character.standard={
result:{ result:{
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('jueqing')) return [1,-1]; 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" "step 0"
var check; var check;
var i,num=game.countPlayer(function(current){ var i,num=game.countPlayer(function(current){
return current!=player&&current.countCards('h')&&ai.get.attitude(player,current)<=0; return current!=player&&current.countCards('h')&&get.attitude(player,current)<=0;
}); });
check=(num>=2); check=(num>=2);
player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){
return target.countCards('h')>0&&player!=target; return target.countCards('h')>0&&player!=target;
},function(target){ },function(target){
if(!_status.event.aicheck) return 0; 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; if(target.hasSkill('tuntian')) return att/10;
return 1-att; return 1-att;
}).set('aicheck',check); }).set('aicheck',check);
@ -310,7 +310,7 @@ character.standard={
if(player.countCards('h')<3) return false; if(player.countCards('h')<3) return false;
if(!player.hasSha()) return false; if(!player.hasSha()) return false;
return game.hasPlayer(function(current){ 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(){ content:function(){
@ -377,7 +377,7 @@ character.standard={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ 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(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return 1-att; return 1-att;
@ -507,16 +507,16 @@ character.standard={
if(players[i].hasSkill('haoshi')&& if(players[i].hasSkill('haoshi')&&
!players[i].isTurnedOver()&& !players[i].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& get.attitude(player,players[i])>=3&&
ai.get.attitude(players[i],player)>=3){ get.attitude(players[i],player)>=3){
return 11-ai.get.value(card); return 11-get.value(card);
} }
} }
if(player.countCards('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-get.value(card);
if(player.countCards('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-get.value(card);
}, },
content:function(){ content:function(){
target.gain(cards,player); target.gain(cards,player);
@ -559,7 +559,7 @@ character.standard={
if(player.countCards('e',{subtype:get.subtype(card)})){ if(player.countCards('e',{subtype:get.subtype(card)})){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>0){ if(players[i]!=player&&get.attitude(player,players[i])>0){
return 0; return 0;
} }
} }
@ -608,7 +608,7 @@ character.standard={
var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'}); var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'});
next.set('ai',function(){ next.set('ai',function(){
var event=_status.event; 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.set('source',player);
next.autochoose=lib.filter.autoRespondSha; next.autochoose=lib.filter.autoRespondSha;
@ -672,7 +672,7 @@ character.standard={
}); });
next.set('ai',function(card){ next.set('ai',function(card){
var event=_status.event; 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('source',player);
next.set('target',target); next.set('target',target);
@ -705,11 +705,11 @@ character.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasSkill('jijiang3')) return 0; 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(){ order:function(){
return ai.get.order({name:'sha'})-0.1; return get.order({name:'sha'})-0.1;
}, },
} }
}, },
@ -743,7 +743,7 @@ character.standard={
} }
}, },
prompt:'将一张红色牌当杀使用或打出', prompt:'将一张红色牌当杀使用或打出',
check:function(card){return 4-ai.get.value(card)}, check:function(card){return 4-get.value(card)},
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
if(get.zhu(player,'shouyue')){ if(get.zhu(player,'shouyue')){
@ -811,10 +811,10 @@ character.standard={
var bottom; var bottom;
if(!stopped){ if(!stopped){
cards.sort(function(a,b){ 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){ while(cards.length){
if(ai.get.value(cards[0],player)<=5) break; if(get.value(cards[0],player)<=5) break;
top.unshift(cards.shift()); top.unshift(cards.shift());
} }
} }
@ -1031,7 +1031,7 @@ character.standard={
if(!player.countCards('h','shan')) return false; if(!player.countCards('h','shan')) return false;
}, },
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
useful:-1, useful:-1,
value:-1 value:-1
@ -1082,7 +1082,7 @@ character.standard={
audio:2, audio:2,
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
@ -1135,7 +1135,7 @@ character.standard={
selectCard:[1,Infinity], selectCard:[1,Infinity],
prompt:'弃置任意张牌并摸等量的牌', prompt:'弃置任意张牌并摸等量的牌',
check:function(card){ check:function(card){
return 6-ai.get.value(card) return 6-get.value(card)
}, },
content:function(){ content:function(){
player.draw(cards.length); player.draw(cards.length);
@ -1177,7 +1177,7 @@ character.standard={
if(!player.countCards('he',{color:'black'})) return false; if(!player.countCards('he',{color:'black'})) return false;
}, },
prompt:'将一张黑色牌当过河拆桥使用', prompt:'将一张黑色牌当过河拆桥使用',
check:function(card){return 4-ai.get.value(card)} check:function(card){return 4-get.value(card)}
}, },
keji:{ keji:{
audio:4, audio:4,
@ -1259,12 +1259,12 @@ character.standard={
order:1, order:1,
result:{ result:{
target:function(player,target){ target:function(player,target){
var eff=ai.get.damageEffect(target,player); var eff=get.damageEffect(target,player);
if(eff>=0) return 1+eff; if(eff>=0) return 1+eff;
var value=0,i; var value=0,i;
var cards=player.getCards('h'); var cards=player.getCards('h');
for(i=0;i<cards.length;i++){ for(i=0;i<cards.length;i++){
value+=ai.get.value(cards[i]); value+=get.value(cards[i]);
} }
value/=player.countCards('h'); value/=player.countCards('h');
if(target.hp==1) return Math.min(0,value-7); if(target.hp==1) return Math.min(0,value-7);
@ -1285,7 +1285,7 @@ character.standard={
position:'he', position:'he',
viewAs:{name:'lebu'}, viewAs:{name:'lebu'},
prompt:'将一张方片牌当乐不思蜀使用', prompt:'将一张方片牌当乐不思蜀使用',
check:function(card){return 6-ai.get.value(card)}, check:function(card){return 6-get.value(card)},
ai:{ ai:{
threaten:1.5 threaten:1.5
} }
@ -1316,20 +1316,20 @@ character.standard={
return false; return false;
}, },
ai1:function(card){ ai1:function(card){
return ai.get.unuseful(card)+9; return get.unuseful(card)+9;
}, },
ai2:function(target){ ai2:function(target){
if(_status.event.player.countCards('h','shan')){ if(_status.event.player.countCards('h','shan')){
return -ai.get.attitude(_status.event.player,target); return -get.attitude(_status.event.player,target);
} }
if(ai.get.attitude(_status.event.player,target)<5){ if(get.attitude(_status.event.player,target)<5){
return 6-ai.get.attitude(_status.event.player,target); return 6-get.attitude(_status.event.player,target);
} }
if(_status.event.player.hp==1&&player.countCards('h','shan')==0){ if(_status.event.player.hp==1&&player.countCards('h','shan')==0){
return 10-ai.get.attitude(_status.event.player,target); return 10-get.attitude(_status.event.player,target);
} }
if(_status.event.player.hp==2&&player.countCards('h','shan')==0){ if(_status.event.player.hp==2&&player.countCards('h','shan')==0){
return 8-ai.get.attitude(_status.event.player,target); return 8-get.attitude(_status.event.player,target);
} }
return -1; return -1;
}, },
@ -1358,15 +1358,15 @@ character.standard={
if(target.countCards('he')==0) return; if(target.countCards('he')==0) return;
if(card.name!='sha') return; if(card.name!='sha') return;
var min=1; var min=1;
var friend=ai.get.attitude(player,target)>0; var friend=get.attitude(player,target)>0;
var vcard={name:'shacopy',nature:card.nature,suit:card.suit}; var vcard={name:'shacopy',nature:card.nature,suit:card.suit};
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&& if(player!=players[i]&&
ai.get.attitude(target,players[i])<0&& get.attitude(target,players[i])<0&&
target.canUse(card,players[i])){ target.canUse(card,players[i])){
if(!friend) return 0; if(!friend) return 0;
if(ai.get.effect(players[i],vcard,player,player)>0){ if(get.effect(players[i],vcard,player,player)>0){
if(!player.canUse(card,players[0])){ if(!player.canUse(card,players[0])){
return [0,0.1]; return [0,0.1];
} }
@ -1450,10 +1450,10 @@ character.standard={
check:function(card){ check:function(card){
var player=get.owner(card); var player=get.owner(card);
if(player.countCards('h')>player.hp) if(player.countCards('h')>player.hp)
return 8-ai.get.value(card) return 8-get.value(card)
if(player.hp<player.maxHp) if(player.hp<player.maxHp)
return 6-ai.get.value(card) return 6-get.value(card)
return 4-ai.get.value(card) return 4-get.value(card)
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -1485,7 +1485,7 @@ character.standard={
filterCard:true, filterCard:true,
usable:1, usable:1,
check:function(card){ check:function(card){
return 9-ai.get.value(card) return 9-get.value(card)
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.hp>=target.maxHp) return false; if(target.hp>=target.maxHp) return false;
@ -1518,7 +1518,7 @@ character.standard={
position:'he', position:'he',
viewAs:{name:'tao'}, viewAs:{name:'tao'},
prompt:'将一张红色牌当桃使用', prompt:'将一张红色牌当桃使用',
check:function(card){return 15-ai.get.value(card)}, check:function(card){return 15-get.value(card)},
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
return player.countCards('he',{color:'red'})>0&&_status.currentPhase!=player; return player.countCards('he',{color:'red'})>0&&_status.currentPhase!=player;
@ -1544,7 +1544,7 @@ character.standard={
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
next.set('ai',function(card){ next.set('ai',function(card){
if(_status.event.player.countCards('h','shan')>1){ if(_status.event.player.countCards('h','shan')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}); });
@ -1569,8 +1569,8 @@ character.standard={
next.set('ai',function(card){ next.set('ai',function(card){
var player=_status.event.player; var player=_status.event.player;
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ if(get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}); });
@ -1596,7 +1596,7 @@ character.standard={
return current!=player&&current.sex=='male'; return current!=player&&current.sex=='male';
})>1; })>1;
}, },
check:function(card){return 10-ai.get.value(card)}, check:function(card){return 10-get.value(card)},
filterCard:true, filterCard:true,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -1622,7 +1622,7 @@ character.standard={
return -3; return -3;
} }
else{ else{
return ai.get.effect(target,{name:'juedou'},ui.selected.targets[0],target); return get.effect(target,{name:'juedou'},ui.selected.targets[0],target);
} }
} }
}, },

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@ character.xiake={
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
logTarget:'player', logTarget:'player',
check:function(event,player){ check:function(event,player){
if(ai.get.damageEffect(event.player,player,player)>0&& if(get.damageEffect(event.player,player,player)>0&&
ai.get.attitude(player,event.player)<0){ get.attitude(player,event.player)<0){
return player.hp>event.player.hp&&player.hp>=2; return player.hp>event.player.hp&&player.hp>=2;
} }
return false; return false;
@ -39,11 +39,11 @@ character.xiake={
discard:false, discard:false,
delay:0.5, delay:0.5,
check:function(card,player){ check:function(card,player){
var val=ai.get.equipValue(card); var val=get.equipValue(card);
var player=_status.event.player; var player=_status.event.player;
var cards=player.getCards('h',{subtype:get.subtype(card)}); var cards=player.getCards('h',{subtype:get.subtype(card)});
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.equipValue(cards[i])>=val){ if(get.equipValue(cards[i])>=val){
return 1; return 1;
} }
} }

View File

@ -99,7 +99,7 @@ character.xianjian={
check:function(event,player){ check:function(event,player){
if(player.hp==1&&player.hujia==0) return false; if(player.hp==1&&player.hujia==0) return false;
var num=game.countPlayer(function(current){ 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&&current.hujia==0) eff*=1.5; if(current.hp==1&&current.hujia==0) eff*=1.5;
return eff; return eff;
}); });
@ -129,8 +129,8 @@ character.xianjian={
}, },
filterCard:{color:'red'}, filterCard:{color:'red'},
check:function(card){ check:function(card){
if(get.suit(card)=='heart') return 7-ai.get.value(card); if(get.suit(card)=='heart') return 7-get.value(card);
return 5-ai.get.value(card); return 5-get.value(card);
}, },
onuse:function(result){ onuse:function(result){
if(result.targets){ if(result.targets){
@ -142,7 +142,7 @@ character.xianjian={
group:'yanzhan2', group:'yanzhan2',
ai:{ ai:{
order:function(){ 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; return player.countCards('he',{color:'red'})>0;
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
var targets=player.getEnemies(); var targets=player.getEnemies();
@ -243,7 +243,7 @@ character.xianjian={
trigger.target.chooseTarget(function(card,player,target){ trigger.target.chooseTarget(function(card,player,target){
return target!=player&&target!=_status.event.parent.player&&target.countCards('he')>0; return target!=player&&target!=_status.event.parent.player&&target.countCards('he')>0;
},'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){ },'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){
return -ai.get.attitude(_status.event.player,target); return -get.attitude(_status.event.player,target);
}; };
} }
else{ else{
@ -367,7 +367,7 @@ character.xianjian={
return event.target.countCards('h')>player.countCards('h'); return event.target.countCards('h')>player.countCards('h');
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
@ -407,7 +407,7 @@ character.xianjian={
return type=='basic'||type=='equip'||type=='trick'; return type=='basic'||type=='equip'||type=='trick';
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.countCards('h')>0; return player.countCards('h')>0;
@ -465,7 +465,7 @@ character.xianjian={
player.storage.danqing.length=0; player.storage.danqing.length=0;
player.updateMarks(); player.updateMarks();
player.chooseTarget(get.prompt('danqing'),[1,get.is.altered('danqing')?2:4]).ai=function(target){ 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' 'step 1'
if(result.bool){ if(result.bool){
@ -520,7 +520,7 @@ character.xianjian={
player.chooseTarget('令一名角色摸一张牌',function(card,player,target){ player.chooseTarget('令一名角色摸一张牌',function(card,player,target){
return !event.targets.contains(target); return !event.targets.contains(target);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0){ if(att>0){
return att+1/Math.sqrt(1+target.countCards('h')); return att+1/Math.sqrt(1+target.countCards('h'));
} }
@ -538,7 +538,7 @@ character.xianjian={
player.chooseTarget('令一名角色获得一点护甲',function(card,player,target){ player.chooseTarget('令一名角色获得一点护甲',function(card,player,target){
return !event.targets.contains(target); return !event.targets.contains(target);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0){ if(att>0){
return att+1/Math.sqrt(1+target.hp); return att+1/Math.sqrt(1+target.hp);
} }
@ -562,7 +562,7 @@ character.xianjian={
player.chooseTarget('令一名角色装备一件随机装备',function(card,player,target){ player.chooseTarget('令一名角色装备一件随机装备',function(card,player,target){
return !event.targets.contains(target); return !event.targets.contains(target);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0&&!target.getEquip(5)){ if(att>0&&!target.getEquip(5)){
return att; return att;
} }
@ -594,7 +594,7 @@ character.xianjian={
player.chooseTarget('令一名角色获得潜行',function(card,player,target){ player.chooseTarget('令一名角色获得潜行',function(card,player,target){
return !event.targets.contains(target); return !event.targets.contains(target);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0){ if(att>0){
return att+1/Math.sqrt(1+target.hp); return att+1/Math.sqrt(1+target.hp);
} }
@ -649,11 +649,11 @@ character.xianjian={
}, },
check:function(event,player){ check:function(event,player){
if(player.isUnseen()) return false; 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'); var hs=player.getCards('h');
if(hs.length<event.player.countCards('h')) return false; if(hs.length<event.player.countCards('h')) return false;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var val=ai.get.value(hs[0]); var val=get.value(hs[0]);
if(hs[i].number>=10&&val<=6) return true; if(hs[i].number>=10&&val<=6) return true;
if(hs[i].number>=8&&val<=3) return true; if(hs[i].number>=8&&val<=3) return true;
} }
@ -712,7 +712,7 @@ character.xianjian={
usable:1, usable:1,
content:function(){ content:function(){
"step 0" "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(){ player.chooseCard(get.prompt('zhangmu'),{name:'shan'}).ai=function(){
return goon?1:0; return goon?1:0;
} }
@ -775,7 +775,7 @@ character.xianjian={
var num2=0; var num2=0;
for(var i=0;i<player.storage.leiyu.length;i++){ for(var i=0;i<player.storage.leiyu.length;i++){
if(!player.storage.leiyu[i].isIn()) continue; if(!player.storage.leiyu[i].isIn()) continue;
var eff=ai.get.effect(player.storage.leiyu[i],{name:'jingleishan',nature:'thunder'},player,player); var eff=get.effect(player.storage.leiyu[i],{name:'jingleishan',nature:'thunder'},player,player);
num+=eff; num+=eff;
if(eff>0){ if(eff>0){
num2++; num2++;
@ -787,7 +787,7 @@ character.xianjian={
var next=player.chooseToDiscard(get.prompt('leiyu',player.storage.leiyu),{color:'black'}); var next=player.chooseToDiscard(get.prompt('leiyu',player.storage.leiyu),{color:'black'});
next.ai=function(card){ next.ai=function(card){
if(num>0&&num2>=2){ if(num>0&&num2>=2){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
}; };
@ -873,7 +873,7 @@ character.xianjian={
}); });
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){ if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){
num+=ai.get.effect(players[i],{name:'sha'},player,player); num+=get.effect(players[i],{name:'sha'},player,player);
} }
} }
return num>0; return num>0;
@ -924,7 +924,7 @@ character.xianjian={
return player.countCards('h',{color:'black'}); return player.countCards('h',{color:'black'});
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
}, },
content:function(){ content:function(){
target.addSkill('guijiang2'); target.addSkill('guijiang2');
@ -1042,7 +1042,7 @@ character.xianjian={
player.chooseTarget('灵愈:令一名其他角色回复一点体力',function(card,player,target){ player.chooseTarget('灵愈:令一名其他角色回复一点体力',function(card,player,target){
return target!=player&&target.hp<target.maxHp; return target!=player&&target.hp<target.maxHp;
}).ai=function(target){ }).ai=function(target){
return ai.get.recoverEffect(target,player,player); return get.recoverEffect(target,player,player);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -1065,7 +1065,7 @@ character.xianjian={
'step 0' 'step 0'
if(player.countCards('h')){ if(player.countCards('h')){
player.chooseCardButton('读心',target.getCards('h')).ai=function(button){ player.chooseCardButton('读心',target.getCards('h')).ai=function(button){
return ai.get.value(button.link)-5; return get.value(button.link)-5;
} }
} }
else{ else{
@ -1076,7 +1076,7 @@ character.xianjian={
if(result.bool){ if(result.bool){
event.card=result.links[[0]]; event.card=result.links[[0]];
player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)).ai=function(card){ player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)).ai=function(card){
return -ai.get.value(card); return -get.value(card);
}; };
} }
else{ else{
@ -1108,7 +1108,7 @@ character.xianjian={
return event.card&&event.card.name=='shan'; return event.card&&event.card.name=='shan';
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)>0; return get.attitude(player,event.player)>0;
}, },
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
@ -1224,9 +1224,9 @@ character.xianjian={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(lib.filter.targetEnabled({name:'sha'},player,players[i])&& if(lib.filter.targetEnabled({name:'sha'},player,players[i])&&
ai.get.effect(players[i],{name:'sha'},player)>0){ get.effect(players[i],{name:'sha'},player)>0){
num++; num++;
if(num>1) return 8-ai.get.value(card); if(num>1) return 8-get.value(card);
} }
} }
return 0; return 0;
@ -1238,7 +1238,7 @@ character.xianjian={
}, },
ai:{ ai:{
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
effect:{ effect:{
player:function(card,player){ player:function(card,player){
@ -1249,7 +1249,7 @@ character.xianjian={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(lib.filter.targetEnabled({name:'sha'},player,players[i])&& if(lib.filter.targetEnabled({name:'sha'},player,players[i])&&
ai.get.attitude(player,players[i])<0){ get.attitude(player,players[i])<0){
num++; num++;
if(num>1) return [0,0,0,0]; if(num>1) return [0,0,0,0];
} }
@ -1284,8 +1284,8 @@ character.xianjian={
return target!=player&&!target.hasSkill('ctianfu2'); return target!=player&&!target.hasSkill('ctianfu2');
}, },
check:function(card){ check:function(card){
if(_status.event.player.hp>=3) return 8-ai.get.value(card); if(_status.event.player.hp>=3) return 8-get.value(card);
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
target.storage.ctianfu2=cards[0]; target.storage.ctianfu2=cards[0];
@ -1297,9 +1297,9 @@ character.xianjian={
order:2, order:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
return ai.get.damageEffect(target,player,target,'thunder'); return get.damageEffect(target,player,target,'thunder');
} }
}, },
expose:0.2 expose:0.2
@ -1381,7 +1381,7 @@ character.xianjian={
player.chooseCard(get.prompt('shuiyun'),function(card){ player.chooseCard(get.prompt('shuiyun'),function(card){
return !types.contains(get.type(card,'trick')); return !types.contains(get.type(card,'trick'));
}).ai=function(card){ }).ai=function(card){
return 11-ai.get.value(card); return 11-get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1442,7 +1442,7 @@ character.xianjian={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseCardButton(player.storage.shuiyun,get.prompt('shuiyun',trigger.player)).ai=function(button){ 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" "step 1"
if(result.bool){ if(result.bool){
@ -1490,7 +1490,7 @@ character.xianjian={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hasSkill('wangyou3')){ if(players[i].hasSkill('wangyou3')){
var att=ai.get.attitude(player,players[i]); var att=get.attitude(player,players[i]);
if(att>0) num++; if(att>0) num++;
else if(att<0) num--; else if(att<0) num--;
targets.push(players[i]); targets.push(players[i]);
@ -1502,9 +1502,9 @@ character.xianjian={
next.ai=function(card){ next.ai=function(card){
if(num<=0) return 0; if(num<=0) return 0;
switch(num){ switch(num){
case 1:return 5-ai.get.value(card); case 1:return 5-get.value(card);
case 2:return 7-ai.get.value(card); case 2:return 7-get.value(card);
default:return 8-ai.get.value(card); default:return 8-get.value(card);
} }
} }
"step 1" "step 1"
@ -1546,7 +1546,7 @@ character.xianjian={
player.chooseTarget(get.prompt('changnian'),function(card,player,target){ player.chooseTarget(get.prompt('changnian'),function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1597,9 +1597,9 @@ character.xianjian={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('h')>player.hp){ 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(){ content:function(){
"step 0" "step 0"
@ -1616,7 +1616,7 @@ character.xianjian={
order:3, order:3,
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.recoverEffect(target); return get.recoverEffect(target);
} }
}, },
threaten:1.5 threaten:1.5
@ -1672,7 +1672,7 @@ character.xianjian={
player.chooseTarget(get.prompt('duci'),function(card,player,target){ player.chooseTarget(get.prompt('duci'),function(card,player,target){
return player!=target&&get.distance(player,target)<=1; return player!=target&&get.distance(player,target)<=1;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1689,7 +1689,7 @@ character.xianjian={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&get.distance(player,players[i])<=1&& if(player!=players[i]&&get.distance(player,players[i])<=1&&
ai.get.damageEffect(players[i],player,player)>0){ get.damageEffect(players[i],player,player)>0){
return [1,3]; return [1,3];
} }
} }
@ -1793,7 +1793,7 @@ character.xianjian={
player.chooseTarget([1,trigger.cards.length],get.prompt('qijian'),function(card,player,target){ player.chooseTarget([1,trigger.cards.length],get.prompt('qijian'),function(card,player,target){
return player.canUse({name:'sha'},target,false); return player.canUse({name:'sha'},target,false);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,{name:'sha'},player); return get.effect(target,{name:'sha'},player);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -1809,11 +1809,11 @@ character.xianjian={
return event.player.hp<=0&&player.countCards('h',{color:'red'}); return event.player.hp<=0&&player.countCards('h',{color:'red'});
}, },
check:function(event,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('h',{color:'red'}); var cards=player.getCards('h',{color:'red'});
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].name=='tao') return false; if(cards[i].name=='tao') return false;
if(ai.get.value(cards[i])>7&&cards.length>2) return false; if(get.value(cards[i])>7&&cards.length>2) return false;
} }
}, },
content:function(){ content:function(){
@ -1848,7 +1848,7 @@ character.xianjian={
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&!players[i].isOut()&& if(players[i]!=player&&!players[i].isOut()&&
lib.filter.targetEnabled({name:'wanjian'},player,players[i])){ lib.filter.targetEnabled({name:'wanjian'},player,players[i])){
ainum+=ai.get.effect(players[i],{name:'wanjian'}); ainum+=get.effect(players[i],{name:'wanjian'});
event.targets.push(players[i]); event.targets.push(players[i]);
} }
} }
@ -1857,9 +1857,9 @@ character.xianjian={
next.ai=function(card){ next.ai=function(card){
if(ainum>=0){ if(ainum>=0){
switch(num){ switch(num){
case 1:return 8-ai.get.value(card); case 1:return 8-get.value(card);
case 2:return 6-ai.get.value(card); case 2:return 6-get.value(card);
case 3:return 4-ai.get.value(card); case 3:return 4-get.value(card);
} }
} }
return -1; return -1;
@ -1965,7 +1965,7 @@ character.xianjian={
usable:1, usable:1,
locked:false, locked:false,
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
multitarget:true, multitarget:true,
multiline:true, multiline:true,
@ -2081,7 +2081,7 @@ character.xianjian={
return !player.storage.guanri&&player.countCards('h',{color:'red'})>=2; return !player.storage.guanri&&player.countCards('h',{color:'red'})>=2;
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filterCard:function(card){ filterCard:function(card){
return get.color(card)=='red'; return get.color(card)=='red';
@ -2109,7 +2109,7 @@ character.xianjian={
order:1, order:1,
result:{ result:{
target:function(player,target){ 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) return eff;
if(player.hp==2&&target.hp==2) return eff; if(player.hp==2&&target.hp==2) return eff;
return 0; return 0;
@ -2165,7 +2165,7 @@ character.xianjian={
player.chooseTarget(get.prompt('runxin'),function(card,player,target){ player.chooseTarget(get.prompt('runxin'),function(card,player,target){
return target.hp<target.maxHp return target.hp<target.maxHp
}).ai=function(target){ }).ai=function(target){
var num=ai.get.attitude(player,target); var num=get.attitude(player,target);
if(num>0){ if(num>0){
if(noneed&&player==target){ if(noneed&&player==target){
num=0.5; num=0.5;
@ -2203,7 +2203,7 @@ character.xianjian={
player.chooseTarget(get.prompt('zhimeng'),function(card,player,target){ player.chooseTarget(get.prompt('zhimeng'),function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
var num=ai.get.attitude(player,target); var num=get.attitude(player,target);
if(num>0){ if(num>0){
if(player==target){ if(player==target){
num++; num++;
@ -2308,12 +2308,12 @@ character.xianjian={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('h',{subtype:get.subtype(card)})>1){ if(player.countCards('h',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-get.equipValue(card);
} }
if(player.countCards('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-get.equipValue(card);
}, },
mod:{ mod:{
targetInRange:function(card,player,target,now){ targetInRange:function(card,player,target,now){
@ -2345,7 +2345,7 @@ character.xianjian={
return game.players.length>3&&(event.player==player.next||event.player==player.previous); return game.players.length>3&&(event.player==player.next||event.player==player.previous);
}, },
check:function(event,player){ 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, changeSeat:true,
trigger:{target:'useCardToBefore'}, trigger:{target:'useCardToBefore'},
@ -2380,7 +2380,7 @@ character.xianjian={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 4-ai.get.value(card); return 4-get.value(card);
}, },
content:function(){ content:function(){
while(player.next!=target){ while(player.next!=target){
@ -2391,9 +2391,9 @@ character.xianjian={
order:5, order:5,
result:{ result:{
player:function(player,target){ 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.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; return 0;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -154,7 +154,7 @@ character.yxs={
return event.source&&event.source.isIn()&&event.source!=player&&!event.source.hasJudge('lebu'); return event.source&&event.source.isIn()&&event.source!=player&&!event.source.hasJudge('lebu');
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<=0; return get.attitude(player,event.source)<=0;
}, },
logTarget:'source', logTarget:'source',
content:function(){ content:function(){
@ -177,13 +177,13 @@ character.yxs={
order:function(){ order:function(){
var player=_status.event.player; var player=_status.event.player;
if(player.hasCard(function(card){ if(player.hasCard(function(card){
return ai.get.value(card)>=8; return get.value(card)>=8;
})){ })){
return 0; return 0;
} }
var nh=player.countCards('h'); var nh=player.countCards('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)<=0&&current.countCards('h')==nh+1; return get.attitude(player,current)<=0&&current.countCards('h')==nh+1;
})){ })){
return 9; return 9;
} }
@ -191,10 +191,10 @@ character.yxs={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0) return 0; if(att>0) return 0;
if(player.hasCard(function(card){ if(player.hasCard(function(card){
return ai.get.value(card)>=8; return get.value(card)>=8;
})){ })){
return 0; return 0;
} }
@ -236,7 +236,7 @@ character.yxs={
order:8, order:8,
result:{ result:{
target:function(player,target){ 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' 'step 0'
var next=player.chooseToDiscard('e',get.prompt('wlianhuan',trigger.player),'弃置一张装备区内的牌使伤害+1'); var next=player.chooseToDiscard('e',get.prompt('wlianhuan',trigger.player),'弃置一张装备区内的牌使伤害+1');
next.ai=function(card){ next.ai=function(card){
if(ai.get.attitude(player,trigger.player)<0){ if(get.attitude(player,trigger.player)<0){
return 7-ai.get.value(card); return 7-get.value(card);
} }
return 0; return 0;
} }
@ -270,7 +270,7 @@ character.yxs={
return get.distance(player,target)<=1&&lib.filter.cardEnabled({name:'tao'},target,target); return get.distance(player,target)<=1&&lib.filter.cardEnabled({name:'tao'},target,target);
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
discard:false, discard:false,
filter:function(event,player){ filter:function(event,player){
@ -287,7 +287,7 @@ character.yxs={
order:9.5, order:9.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.recoverEffect(target,player,target); return get.recoverEffect(target,player,target);
} }
}, },
threaten:1.6 threaten:1.6
@ -314,7 +314,7 @@ character.yxs={
position:'he', position:'he',
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
player.awakenSkill('yixin'); player.awakenSkill('yixin');
@ -330,7 +330,7 @@ character.yxs={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hp==1&&target.maxHp>=3){ if(target.hp==1&&target.maxHp>=3){
return ai.get.recoverEffect(target,player,player); return get.recoverEffect(target,player,player);
} }
return 0; return 0;
} }
@ -382,7 +382,7 @@ character.yxs={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ 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(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return 1-att; return 1-att;
} }
@ -463,7 +463,7 @@ character.yxs={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ 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(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return 1-att; return 1-att;
} }
@ -499,7 +499,7 @@ character.yxs={
player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){
return target.countCards('h')&&target.group!='qun'&&target!=player; return target.countCards('h')&&target.group!='qun'&&target!=player;
}).set('ai',function(target){ }).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' 'step 1'
if(result.bool){ if(result.bool){
@ -513,7 +513,7 @@ character.yxs={
if(event.targets&&event.targets.length){ if(event.targets&&event.targets.length){
event.target=event.targets.shift(); event.target=event.targets.shift();
event.target.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){ event.target.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){
return -ai.get.value(card); return -get.value(card);
} }
} }
else{ else{
@ -538,7 +538,7 @@ character.yxs={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].group!='qun'&& if(players[i].group!='qun'&&
ai.get.attitude(player,players[i])<=0&&players[i]!=player){ get.attitude(player,players[i])<=0&&players[i]!=player){
if(target.hp>=4) return [1,get.tag(card,'damage')*2]; if(target.hp>=4) return [1,get.tag(card,'damage')*2];
if(target.hp==3) return [1,get.tag(card,'damage')*1.5]; if(target.hp==3) return [1,get.tag(card,'damage')*1.5];
if(target.hp==2) return [1,get.tag(card,'damage')*0.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'; return event.player!=player&&event.player.hp<=0&&event.player.group=='qun';
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0; return get.attitude(player,event.player)<0;
}, },
forced:true, forced:true,
logTarget:'player', logTarget:'player',
@ -657,7 +657,7 @@ character.yxs={
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
player.setAvatar('yxs_luobinhan','yxs_luobinhan'); player.setAvatar('yxs_luobinhan','yxs_luobinhan');
@ -689,7 +689,7 @@ character.yxs={
viewAs:{name:'wuzhong'}, viewAs:{name:'wuzhong'},
filterCard:{suit:'heart'}, filterCard:{suit:'heart'},
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
} }
}, },
dili:{ dili:{
@ -745,7 +745,7 @@ character.yxs={
usable:1, usable:1,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.hp<target.maxHp; return target.hp<target.maxHp;
@ -788,7 +788,7 @@ character.yxs={
} }
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
ai:{ ai:{
order:1, order:1,
@ -817,7 +817,7 @@ character.yxs={
target.link(); target.link();
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai:{ ai:{
order:2, order:2,
@ -876,7 +876,7 @@ character.yxs={
return (_status.event.player.countCards('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-4; return get.attitude(_status.event.player,target)-4;
}, },
prompt:'请选择要送人的卡牌' prompt:'请选择要送人的卡牌'
}); });
@ -935,7 +935,7 @@ character.yxs={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.damageEffect(target,player,target); return get.damageEffect(target,player,target);
} }
} }
} }
@ -970,7 +970,7 @@ character.yxs={
return !event.directHit; return !event.directHit;
}, },
check:function(event,player){ check:function(event,player){
if(ai.get.attitude(player,event.target)>=0) return false; if(get.attitude(player,event.target)>=0) return false;
if(event.target.getEquip('bagua')) return false; if(event.target.getEquip('bagua')) return false;
if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false; if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false;
return true; return true;
@ -981,7 +981,7 @@ character.yxs={
var next=trigger.target.chooseToRespond({name:'shan'}); var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){ next.ai=function(card){
return ai.get.unuseful2(card); return get.unuseful2(card);
}; };
player.storage.sanbanfu=false; player.storage.sanbanfu=false;
player.storage.sanbanfu2=false; player.storage.sanbanfu2=false;
@ -1032,7 +1032,7 @@ character.yxs={
complexCard:true, complexCard:true,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.hp==Infinity) return false; if(target.hp==Infinity) return false;
@ -1083,7 +1083,7 @@ character.yxs={
return target.countCards('h')>0&&get.distance(player,target)<=2; return target.countCards('h')>0&&get.distance(player,target)<=2;
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
position:'he', position:'he',
content:function(){ content:function(){
@ -1102,7 +1102,7 @@ character.yxs={
player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){ player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){
return target!=player; return target!=player;
}).ai=function(target){ }).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')){ if(att>3&&player.countCards('h')>target.countCards('h')){
return att; return att;
} }
@ -1121,7 +1121,7 @@ character.yxs={
result:{ result:{
target:-1, target:-1,
player:function(player,target){ player:function(player,target){
if(ai.get.attitude(player,target)>0){ if(get.attitude(player,target)>0){
return 0; return 0;
} }
return 1; return 1;
@ -1279,10 +1279,10 @@ character.yxs={
return player.canUse({name:'lebu'},target); return player.canUse({name:'lebu'},target);
}, },
ai1:function(card){ ai1:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.effect(target,{name:'lebu'},player,player); return get.effect(target,{name:'lebu'},player,player);
} }
}); });
'step 1' 'step 1'
@ -1302,7 +1302,7 @@ character.yxs={
return event.target.countCards('he')>0; return event.target.countCards('he')>0;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return get.attitude(player,event.target)<0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1356,12 +1356,12 @@ character.yxs={
content:function(){ content:function(){
'step 0' 'step 0'
var nh=trigger.player.countCards('h'); 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){ player.chooseTarget(get.prompt('xiadao'),function(card,player,target){
return target!=player&&target!=trigger.player&&target.countCards('h')<=nh; return target!=player&&target!=trigger.player&&target.countCards('h')<=nh;
}).ai=function(target){ }).ai=function(target){
if(att>0) return 0; if(att>0) return 0;
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -1404,7 +1404,7 @@ character.yxs={
player.chooseTarget(get.prompt('lzhangyi'),function(card,player,target){ player.chooseTarget(get.prompt('lzhangyi'),function(card,player,target){
return player!=target return player!=target
}).set('du',(trigger.cards.length==1&&trigger.cards[0].name=='du')).ai=function(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; if(_status.event.du) return -att;
return att; return att;
}; };
@ -1461,7 +1461,7 @@ character.yxs={
}, },
ai1:function(card){ ai1:function(card){
if(player.additionalSkills.yizhuang&&player.additionalSkills.yizhuang.length>0) return 0; 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){ ai2:function(target){
if(target.isMin()) return 0; if(target.isMin()) return 0;
@ -1565,7 +1565,7 @@ character.yxs={
direct:true, direct:true,
content:function(){ content:function(){
'step 0' '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)+'立即死亡?'); var next=player.chooseToDiscard('鸠杀:是否弃置一张酒或两张黑色手牌令'+get.translation(trigger.player)+'立即死亡?');
next.ai=function(card){ next.ai=function(card){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
@ -1615,7 +1615,7 @@ character.yxs={
forceunique:true, forceunique:true,
check:function(card){ check:function(card){
if(_status.event.player.countCards('h')>=3){ if(_status.event.player.countCards('h')>=3){
return 5-ai.get.value(card); return 5-get.value(card);
} }
return 0; return 0;
}, },
@ -1748,7 +1748,7 @@ character.yxs={
return 0; return 0;
} }
else{ else{
return ai.get.damageEffect(target,player,target); return get.damageEffect(target,player,target);
} }
} }
} }
@ -1766,12 +1766,12 @@ character.yxs={
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('he',{subtype:get.subtype(card)})>1){ if(player.countCards('he',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-get.equipValue(card);
} }
if(player.countCards('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-get.equipValue(card);
}, },
ai:{ ai:{
order:9, order:9,
@ -1835,7 +1835,7 @@ character.yxs={
return player!=target; return player!=target;
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-get.value(card);
}, },
content:function(){ content:function(){
target.draw(2); target.draw(2);
@ -1852,7 +1852,7 @@ character.yxs={
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
check:function(event,player){ check:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return ai.get.attitude(player,current)<0&&current.countCards('h'); return get.attitude(player,current)<0&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
@ -1872,7 +1872,7 @@ character.yxs={
player.chooseTarget('婉歌:获得至多'+get.cnNumber(num)+'名角色的一张手牌',[1,num],function(card,player,target){ player.chooseTarget('婉歌:获得至多'+get.cnNumber(num)+'名角色的一张手牌',[1,num],function(card,player,target){
return target.countCards('h')&&target!=player; return target.countCards('h')&&target!=player;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
player.removeSkill('wange2'); player.removeSkill('wange2');
"step 1" "step 1"
@ -1952,7 +1952,7 @@ character.yxs={
var effect=0; var effect=0;
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].sex=='male'&&players[i]!=target&&players[i]!=player&&players[i].countCards('he')) if(players[i].sex=='male'&&players[i]!=target&&players[i]!=player&&players[i].countCards('he'))
effect+=ai.get.effect(target,{name:'sha'},players[i],target); effect+=get.effect(target,{name:'sha'},players[i],target);
} }
return effect; return effect;
} }
@ -2173,7 +2173,7 @@ character.yxs={
return (event.source&&event.source.countCards('he')); return (event.source&&event.source.countCards('he'));
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<0; return get.attitude(player,event.source)<0;
}, },
content:function(){ content:function(){
trigger.source.chooseToDiscard(2,'he',true); trigger.source.chooseToDiscard(2,'he',true);
@ -2185,7 +2185,7 @@ character.yxs={
target:function(card,player,target){ target:function(card,player,target){
if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1]; 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'}, filterCard:{color:'black'},
check:function(card){ check:function(card){
return 4-ai.get.value(card); return 4-get.value(card);
}, },
content:function(){ content:function(){
game.swapSeat(player,target); game.swapSeat(player,target);
@ -2209,10 +2209,10 @@ character.yxs={
order:5, order:5,
result:{ result:{
player:function(player,target){ 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.previous&&att>0) return att;
if(target==player.next&&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; if(target==player.next.next&&att<0&&att2<0) return -att-att2;
return 0; return 0;
} }
@ -2234,7 +2234,7 @@ character.yxs={
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){ next.ai=function(card){
if(trigger.target.countCards('h','shan')>1){ if(trigger.target.countCards('h','shan')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}; };
@ -2256,8 +2256,8 @@ character.yxs={
var next=trigger.turn.chooseToRespond({name:'sha'}); var next=trigger.turn.chooseToRespond({name:'sha'});
next.autochoose=lib.filter.autoRespondSha; next.autochoose=lib.filter.autoRespondSha;
next.ai=function(card){ next.ai=function(card){
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){ if(get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}; };
@ -2295,7 +2295,7 @@ character.yxs={
"step 0" "step 0"
var effect=0; var effect=0;
for(var i=0;i<trigger.targets.length;i++){ for(var i=0;i<trigger.targets.length;i++){
effect+=ai.get.effect(trigger.targets[i],trigger.card,trigger.player,player); effect+=get.effect(trigger.targets[i],trigger.card,trigger.player,player);
} }
var str='非攻:是否弃置一张杀令'+get.translation(trigger.player); var str='非攻:是否弃置一张杀令'+get.translation(trigger.player);
if(trigger.targets&&trigger.targets.length){ if(trigger.targets&&trigger.targets.length){
@ -2307,7 +2307,7 @@ character.yxs={
} }
player.chooseToDiscard('h',{name:'sha'},str).ai=function(card){ player.chooseToDiscard('h',{name:'sha'},str).ai=function(card){
if(effect<0){ if(effect<0){
return 9-ai.get.value(card); return 9-get.value(card);
} }
return -1; return -1;
} }
@ -2326,7 +2326,7 @@ character.yxs={
feiming:{ feiming:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<=0; return get.attitude(player,event.source)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source!=player; return event.source&&event.source!=player;
@ -2336,7 +2336,7 @@ character.yxs={
trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){ trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){
return get.suit(card)=='heart'; return get.suit(card)=='heart';
}).ai=function(card){ }).ai=function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2373,10 +2373,10 @@ character.yxs={
eff+=0.5; eff+=0.5;
} }
} }
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
num+=eff; num+=eff;
} }
else if(ai.get.attitude(player,players[i])<0){ else if(get.attitude(player,players[i])<0){
num-=eff; num-=eff;
} }
} }
@ -2408,7 +2408,7 @@ character.yxs={
"step 0" "step 0"
var next=player.chooseToDiscard('he','是否弃置一张黑色牌并收回'+get.translation(trigger.card)+'',{color:'black'}); var next=player.chooseToDiscard('he','是否弃置一张黑色牌并收回'+get.translation(trigger.card)+'',{color:'black'});
next.ai=function(card){ 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'; next.logSkill='jieyong';
"step 1" "step 1"
@ -2450,12 +2450,12 @@ character.yxs={
}, },
content:function(){ content:function(){
"step 0" "step 0"
var val=ai.get.value(trigger.card); var val=get.value(trigger.card);
var suit=get.suit(trigger.card); var suit=get.suit(trigger.card);
var next=player.chooseToDiscard('he','逐鹿:是否弃置一张'+get.translation(suit)+ var next=player.chooseToDiscard('he','逐鹿:是否弃置一张'+get.translation(suit)+
'牌并获得'+get.translation(trigger.card)+'',{suit:suit}); '牌并获得'+get.translation(trigger.card)+'',{suit:suit});
next.ai=function(card){ next.ai=function(card){
return val-ai.get.value(card); return val-get.value(card);
}; };
next.logSkill='zhulu'; next.logSkill='zhulu';
"step 1" "step 1"
@ -2475,7 +2475,7 @@ character.yxs={
filterCard:true, filterCard:true,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
multitarget:true, multitarget:true,
targetprompt:['被移走','移动目标'], targetprompt:['被移走','移动目标'],
@ -2503,12 +2503,12 @@ character.yxs={
"step 0" "step 0"
if(targets.length==2){ if(targets.length==2){
player.choosePlayerCard('ej',function(button){ 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; return get.position(button.link)=='j'?10:0;
} }
else{ else{
if(get.position(button.link)=='j') return -10; if(get.position(button.link)=='j') return -10;
return ai.get.equipValue(button.link); return get.equipValue(button.link);
} }
},targets[0]); },targets[0]);
} }
@ -2535,11 +2535,11 @@ character.yxs={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 1; if(target.countCards('j')&&get.attitude(player,target)>0) return 1;
if(ai.get.attitude(player,target)<0){ if(get.attitude(player,target)<0){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>0){ if(get.attitude(player,players[i])>0){
if((target.getEquip(1)&&!players[i].getEquip(1))|| if((target.getEquip(1)&&!players[i].getEquip(1))||
(target.getEquip(2)&&!players[i].getEquip(2))|| (target.getEquip(2)&&!players[i].getEquip(2))||
(target.getEquip(3)&&!players[i].getEquip(3))|| (target.getEquip(3)&&!players[i].getEquip(3))||
@ -2552,7 +2552,7 @@ character.yxs={
return 0; return 0;
} }
else{ 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:{ cike:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<=0; return get.attitude(player,event.target)<=0;
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
@ -2695,7 +2695,7 @@ character.yxs={
},'e'); },'e');
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
filterCard:function(card){ filterCard:function(card){
var info=lib.card[card.name]; var info=lib.card[card.name];
@ -2707,7 +2707,7 @@ character.yxs={
content:function(){ content:function(){
'step 0' 'step 0'
var next=player.choosePlayerCard(target,'e',true); var next=player.choosePlayerCard(target,'e',true);
next.ai=ai.get.buttonValue; next.ai=get.buttonValue;
next.filterButton=function(button){ next.filterButton=function(button){
return !get.info(button.link).unique; return !get.info(button.link).unique;
} }
@ -2719,7 +2719,7 @@ character.yxs={
return !target.isMin(); return !target.isMin();
}).ai=function(target){ }).ai=function(target){
if(!target.countCards('e',{subtype:get.subtype(event.card)})){ if(!target.countCards('e',{subtype:get.subtype(event.card)})){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
return 0; return 0;
} }

View File

@ -82,7 +82,7 @@ character.zhuogui={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterCard:{color:'red'}, filterCard:{color:'red'},
check:function(card){return 6-ai.get.value(card)}, check:function(card){return 6-get.value(card)},
filterTarget:true, filterTarget:true,
selectTarget:-1, selectTarget:-1,
line:'fire', line:'fire',
@ -95,7 +95,7 @@ character.zhuogui={
var eff=0; var eff=0;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(!game.players[i].isOut()){ if(!game.players[i].isOut()){
eff+=ai.get.damageEffect(game.players[i],player,player,'fire'); eff+=get.damageEffect(game.players[i],player,player,'fire');
} }
} }
return eff; return eff;
@ -164,7 +164,7 @@ character.zhuogui={
players.sort(function(a,b){ players.sort(function(a,b){
return b.hp-a.hp; return b.hp-a.hp;
}); });
return ai.get.damageEffect(players[0],player,player,'fire')>0; return get.damageEffect(players[0],player,player,'fire')>0;
}, },
prompt:function(){ prompt:function(){
var players=game.players.slice(0); var players=game.players.slice(0);
@ -220,7 +220,7 @@ character.zhuogui={
player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){ player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){
return player!=target&&target.countCards('h')>0; return player!=target&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.targets&&result.targets.length){ if(result.targets&&result.targets.length){
@ -280,9 +280,9 @@ character.zhuogui={
}, },
check:function(card){ check:function(card){
if(_status.event.player.hp==_status.event.player.maxHp){ 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(){ content:function(){
"step 0" "step 0"
@ -294,7 +294,7 @@ character.zhuogui={
order:9.5, order:9.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.damageEffect(target,player); return get.damageEffect(target,player);
} }
}, },
expose:0.2 expose:0.2

View File

@ -71,7 +71,7 @@ play.wuxing={
case 'wood': case 'wood':
if(player.countCards('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); 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': case 'water':
game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成');
player.draw();player.popup('金生水'); player.draw();player.popup('金生水');
@ -83,7 +83,7 @@ play.wuxing={
case 'soil': case 'soil':
if(player.countCards('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); 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': case 'fire':
game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成');
player.draw();player.popup('木生火'); player.draw();player.popup('木生火');
@ -95,7 +95,7 @@ play.wuxing={
case 'fire': case 'fire':
if(player.countCards('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); 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': case 'wood':
game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成');
player.draw();player.popup('水生木'); player.draw();player.popup('水生木');
@ -107,7 +107,7 @@ play.wuxing={
case 'metal': case 'metal':
if(player.countCards('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); 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': case 'soil':
game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成');
player.draw();player.popup('火生土'); player.draw();player.popup('火生土');
@ -119,7 +119,7 @@ play.wuxing={
case 'water': case 'water':
if(player.countCards('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); 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': case 'metal':
game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成'); game.log(player,'得到'+get.translation(trigger.card.wunature)+'属性卡牌的加成');
player.draw();player.popup('土生金'); player.draw();player.popup('土生金');

File diff suppressed because it is too large Load Diff

View File

@ -915,8 +915,8 @@ mode.boss={
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
var att1=ai.get.attitude(player,trigger.player); var att1=get.attitude(player,trigger.player);
var att2=ai.get.attitude(player,trigger.source); var att2=get.attitude(player,trigger.source);
var targets=player.getEnemies(); var targets=player.getEnemies();
var stop=false; var stop=false;
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
@ -958,8 +958,8 @@ mode.boss={
'若判定结果为红色,'+playername+'回复一点体力,否则'+sourcename+'回复一点体力' '若判定结果为红色,'+playername+'回复一点体力,否则'+sourcename+'回复一点体力'
]); ]);
'step 1' 'step 1'
var att1=ai.get.attitude(player,trigger.player); var att1=get.attitude(player,trigger.player);
var att2=ai.get.attitude(player,trigger.source); var att2=get.attitude(player,trigger.source);
if(result.control=='选项一'){ if(result.control=='选项一'){
event.type=1; event.type=1;
player.judge(function(card){ player.judge(function(card){
@ -1101,7 +1101,7 @@ mode.boss={
global:'boss_zhangwu_ai', global:'boss_zhangwu_ai',
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
check:function(event,player){ check:function(event,player){
return event.source&&ai.get.damageEffect(event.source,player,player)>0; return event.source&&get.damageEffect(event.source,player,player)>0;
}, },
filter:function(event){ filter:function(event){
return event.source&&event.source.isAlive(); return event.source&&event.source.isAlive();
@ -1116,7 +1116,7 @@ mode.boss={
} }
else{ else{
target.chooseControl('discard_card','get_damage',function(){ 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'); var nh=target.countCards('h');
if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card'; if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card';
return 'get_damage'; return 'get_damage';
@ -1142,7 +1142,7 @@ mode.boss={
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'recover')&&card.name!='recover'){ if(get.tag(card,'recover')&&card.name!='recover'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].hasSkill('xiaoxiong')&&ai.get.attitude(target,game.players[i])<0){ if(game.players[i].hasSkill('xiaoxiong')&&get.attitude(target,game.players[i])<0){
return 'zeroplayertarget'; return 'zeroplayertarget';
} }
} }
@ -1331,7 +1331,7 @@ mode.boss={
var next=player.chooseTarget('选择'+get.translation(name)+'的目标'); var next=player.chooseTarget('选择'+get.translation(name)+'的目标');
next._get_card=card; next._get_card=card;
next.filterTarget=lib.filter.filterTarget; next.filterTarget=lib.filter.filterTarget;
next.ai=ai.get.effect; next.ai=get.effect;
if(typeof info.selectTarget=='function'){ if(typeof info.selectTarget=='function'){
next.selectTarget=info.selectTarget; next.selectTarget=info.selectTarget;
} }
@ -1368,10 +1368,10 @@ mode.boss={
"step 0" "step 0"
event.cards=get.cards(7); event.cards=get.cards(7);
player.chooseCardButton(true,event.cards,'改命:选择一张牌作为你的'+trigger.judgestr+'判定结果').ai=function(button){ player.chooseCardButton(true,event.cards,'改命:选择一张牌作为你的'+trigger.judgestr+'判定结果').ai=function(button){
if(ai.get.attitude(player,trigger.player)>0){ if(get.attitude(player,trigger.player)>0){
return 1+trigger.judge(button.link); 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 1-trigger.judge(button.link);
} }
return 0; return 0;
@ -1454,7 +1454,7 @@ mode.boss={
var trigger=_status.event.parent._trigger; var trigger=_status.event.parent._trigger;
var player=_status.event.player; var player=_status.event.player;
var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); 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||result==0) return 0;
if(attitude>0){ if(attitude>0){
return result; return result;
@ -1507,7 +1507,7 @@ mode.boss={
discard:false, discard:false,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1547,7 +1547,7 @@ mode.boss={
return !target.hasSkill('mazui2'); return !target.hasSkill('mazui2');
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
discard:false, discard:false,
prepare:'give', prepare:'give',
@ -1745,7 +1745,7 @@ mode.boss={
} }
next.selectCard=[num,num]; next.selectCard=[num,num];
next.ai=function(card){ next.ai=function(card){
return ai.get.value(card); return get.value(card);
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -2063,7 +2063,7 @@ mode.boss={
player.chooseTarget(true,'选择一个目标对其造成两点火焰伤害',function(card,player,target){ player.chooseTarget(true,'选择一个目标对其造成两点火焰伤害',function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
} }
} }
else{ else{
@ -2161,7 +2161,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_xixing'),function(card,player,target){ player.chooseTarget(get.prompt('boss_xixing'),function(card,player,target){
return player!=target&&target.isLinked(); return player!=target&&target.isLinked();
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'thunder'); return get.damageEffect(target,player,player,'thunder');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2187,7 +2187,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
return !target.isLinked()&&player!=target; return !target.isLinked()&&player!=target;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2228,7 +2228,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_xiaoshou'),function(card,player,target){ player.chooseTarget(get.prompt('boss_xiaoshou'),function(card,player,target){
return player!=target&&target.hp>=player.hp; return player!=target&&target.hp>=player.hp;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2351,7 +2351,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_guihuo'),function(card,player,target){ player.chooseTarget(get.prompt('boss_guihuo'),function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2368,7 +2368,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_luolei'),function(card,player,target){ player.chooseTarget(get.prompt('boss_luolei'),function(card,player,target){
return player!=target; return player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'thunder'); return get.damageEffect(target,player,player,'thunder');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2423,7 +2423,7 @@ mode.boss={
player.chooseTarget(get.prompt('boss_didong'),function(card,player,target){ player.chooseTarget(get.prompt('boss_didong'),function(card,player,target){
return target.isEnemyOf(player); return target.isEnemyOf(player);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(target.isTurnedOver()){ if(target.isTurnedOver()){
if(att>0){ if(att>0){
return att+5; return att+5;
@ -2519,7 +2519,7 @@ mode.boss={
content:function(){ content:function(){
"step 0"; "step 0";
player.chooseTarget(get.prompt('boss_leiji')).ai=function(target){ 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" "step 1"
if(result.bool){ if(result.bool){
@ -2548,7 +2548,7 @@ mode.boss={
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var hastarget=false,players=game.filterPlayer(); var hastarget=false,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,players[i])<0){ if(get.attitude(target,players[i])<0){
hastarget=true;break; hastarget=true;break;
} }
} }
@ -2819,7 +2819,7 @@ mode.boss={
player.chooseTarget(get.prompt('jidian'),function(card,player,target){ player.chooseTarget(get.prompt('jidian'),function(card,player,target){
return get.distance(trigger.player,target)<=1&&trigger.player!=target; return get.distance(trigger.player,target)<=1&&trigger.player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'thunder')+0.1; return get.damageEffect(target,player,player,'thunder')+0.1;
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -2864,7 +2864,7 @@ mode.boss={
}, },
filterCard:lib.filter.cardDiscardable, filterCard:lib.filter.cardDiscardable,
ai1:function(card){ ai1:function(card){
return ai.get.unuseful(card)+9; return get.unuseful(card)+9;
}, },
ai2:function(target){ ai2:function(target){
if(target.storage.boss_hujia) return Math.max(1,10-target.maxHp); if(target.storage.boss_hujia) return Math.max(1,10-target.maxHp);
@ -3260,7 +3260,7 @@ mode.boss={
next.ai=function(button){ next.ai=function(button){
var card=button.link; var card=button.link;
if(get.position(card)=='h'){ if(get.position(card)=='h'){
return 11-ai.get.value(card); return 11-get.value(card);
} }
if(card.name=='lebu') return 5; if(card.name=='lebu') return 5;
if(card.name=='bingliang') return 4; if(card.name=='bingliang') return 4;
@ -3471,7 +3471,7 @@ mode.boss={
player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){
return target.hp<target.maxHp&&player!=target; return target.hp<target.maxHp&&player!=target;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target); return get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3517,7 +3517,7 @@ mode.boss={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -3537,7 +3537,7 @@ mode.boss={
if(list.contains('wansha')||list.contains('qiangxi')){ if(list.contains('wansha')||list.contains('qiangxi')){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0){ if(players[i].hp==1&&get.attitude(player,players[i])<0){
if(list.contains('wansha')) return 'wansha'; if(list.contains('wansha')) return 'wansha';
if(list.contains('qiangxi')) return 'qiangxi'; if(list.contains('qiangxi')) return 'qiangxi';
} }
@ -3562,7 +3562,7 @@ mode.boss={
if(player.hasSkill('wansha')) return 1; if(player.hasSkill('wansha')) return 1;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0) return 10; if(players[i].hp==1&&get.attitude(player,players[i])<0) return 10;
} }
} }
return 1; return 1;
@ -3574,7 +3574,7 @@ mode.boss={
if(!player.hasSkill('wansha')||!player.hasSkill('qiangxi')){ if(!player.hasSkill('wansha')||!player.hasSkill('qiangxi')){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0) return 1; if(players[i].hp==1&&get.attitude(player,players[i])<0) return 1;
} }
} }
} }
@ -3846,11 +3846,9 @@ mode.boss={
mode_boss_character_config:'挑战武将', mode_boss_character_config:'挑战武将',
}, },
ai:{
get:{ get:{
rawAttitude:function(from,to){ rawAttitude:function(from,to){
return (from.side===to.side?6:-6); return (from.side===to.side?6:-6);
} }
} }
},
} }

View File

@ -4593,7 +4593,7 @@ mode.chess={
complexCard:true, complexCard:true,
selectCard:4, selectCard:4,
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target; return player!=target;
@ -4612,7 +4612,7 @@ mode.chess={
player:function(card,player){ player:function(card,player){
var num=0; var num=0;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(ai.get.attitude(player,game.players[i])<0){ if(get.attitude(player,game.players[i])<0){
num++; num++;
if(num>1) break; if(num>1) break;
} }
@ -4632,7 +4632,7 @@ mode.chess={
target:function(player){ target:function(player){
var num=0; var num=0;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(ai.get.attitude(player,game.players[i])<0){ if(get.attitude(player,game.players[i])<0){
num++; num++;
if(num>1) break; if(num>1) break;
} }
@ -4737,7 +4737,7 @@ mode.chess={
var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]); var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]);
var eff=0; var eff=0;
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
eff+=ai.get.effect(targets[i],event.card,player,player); eff+=get.effect(targets[i],event.card,player,player);
} }
return eff>0; return eff>0;
}, },
@ -4761,9 +4761,9 @@ mode.chess={
var player=_status.event.player; var player=_status.event.player;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(lib.filter.targetEnabled({name:'sha'},player,game.players[i])&& if(lib.filter.targetEnabled({name:'sha'},player,game.players[i])&&
ai.get.effect(game.players[i],{name:'sha'},player)>0){ get.effect(game.players[i],{name:'sha'},player)>0){
num++; num++;
if(num>1) return 8-ai.get.value(card); if(num>1) return 8-get.value(card);
} }
} }
return 0; return 0;
@ -4782,11 +4782,11 @@ mode.chess={
multitarget:true, multitarget:true,
ai:{ ai:{
order:function(){ order:function(){
return ai.get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.effect(target,{name:'sha'},player,target); return get.effect(target,{name:'sha'},player,target);
} }
}, },
effect:{ effect:{
@ -4797,7 +4797,7 @@ mode.chess={
var player=_status.event.player; var player=_status.event.player;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(lib.filter.targetEnabled({name:'sha'},player,game.players[i])&& if(lib.filter.targetEnabled({name:'sha'},player,game.players[i])&&
ai.get.attitude(player,game.players[i])<0){ get.attitude(player,game.players[i])<0){
num++; num++;
if(num>1) return [0,0,0,0]; if(num>1) return [0,0,0,0];
} }
@ -5091,7 +5091,7 @@ mode.chess={
usable:1, usable:1,
filterCard:{color:'red'}, filterCard:{color:'red'},
nodelay:true, nodelay:true,
check:function(card){return 8-ai.get.value(card);}, check:function(card){return 8-get.value(card);},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return get.distance(player,target)<=5&&player!=target; return get.distance(player,target)<=5&&player!=target;
}, },
@ -5107,7 +5107,7 @@ mode.chess={
order:1, order:1,
result:{ result:{
target:function(player,target){ 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){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.countCards('he',{subtype:get.subtype(card)})>1){ 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){ filter:function(event,player){
return player.countCards('he',{type:'equip'}); return player.countCards('he',{type:'equip'});
@ -5140,7 +5140,7 @@ mode.chess={
order:9, order:9,
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.damageEffect(target,player,target,'fire'); return get.damageEffect(target,player,target,'fire');
} }
} }
} }
@ -5432,13 +5432,9 @@ mode.chess={
var txy=to.getXY(); var txy=to.getXY();
return Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]); return Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]);
}, },
},
ai:{
get:{
rawAttitude:function(from,to){ rawAttitude:function(from,to){
return (from.side===to.side?6:-6); return (from.side===to.side?6:-6);
} }
}
}, },
card:{ card:{
chess_shezhang:{ chess_shezhang:{

View File

@ -362,7 +362,7 @@ mode.guozhan={
return false; return false;
}, },
order:function(){ order:function(){
return ai.get.order({name:'sha'})-0.1; return get.order({name:'sha'})-0.1;
}, },
result:{ result:{
player:function(player){ player:function(player){
@ -429,7 +429,7 @@ mode.guozhan={
filterCard:{color:'red'}, filterCard:{color:'red'},
position:'he', position:'he',
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<ui.discardPile.childElementCount;i++){ for(var i=0;i<ui.discardPile.childElementCount;i++){
@ -506,7 +506,7 @@ mode.guozhan={
num+=player.storage.huangjintianbingfu.length; num+=player.storage.huangjintianbingfu.length;
} }
player.chooseCardButton(num,true,get.cards(num),'按顺将卡牌置于牌堆顶(先选择的在上)').set('ai',function(button){ player.chooseCardButton(num,true,get.cards(num),'按顺将卡牌置于牌堆顶(先选择的在上)').set('ai',function(button){
return ai.get.value(button.link); return get.value(button.link);
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -852,7 +852,7 @@ mode.guozhan={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseCardButton(get.prompt('ziliang',trigger.player),player.storage.tuntian).set('ai',function(button){ player.chooseCardButton(get.prompt('ziliang',trigger.player),player.storage.tuntian).set('ai',function(button){
return ai.get.value(button.link); return get.value(button.link);
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -894,10 +894,10 @@ mode.guozhan={
return !target.getEquip(card); return !target.getEquip(card);
}, },
ai1:function(card){ ai1:function(card){
return 6-ai.get.value(card); return 6-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-3; return get.attitude(_status.event.player,target)-3;
}, },
prompt:get.prompt('yuanhu') prompt:get.prompt('yuanhu')
}); });
@ -915,7 +915,7 @@ mode.guozhan={
var source=_status.event.source; var source=_status.event.source;
return get.distance(source,target)<=1&&source!=target&&target.countCards('he'); return get.distance(source,target)<=1&&source!=target&&target.countCards('he');
}).set('ai',function(target){ }).set('ai',function(target){
return -ai.get.attitude(_status.event.player,target); return -get.attitude(_status.event.player,target);
}).set('source',target); }).set('source',target);
} }
else{ else{
@ -1028,7 +1028,7 @@ mode.guozhan={
next.autochoose=lib.filter.autoRespondShan; next.autochoose=lib.filter.autoRespondShan;
next.set('ai',function(card){ next.set('ai',function(card){
if(_status.event.player.countCards('h','shan')>1){ if(_status.event.player.countCards('h','shan')>1){
return ai.get.unuseful2(card); return get.unuseful2(card);
} }
return -1; return -1;
}); });
@ -1257,7 +1257,7 @@ mode.guozhan={
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
return player!=target&&get.distance(player,target)<=1; return player!=target&&get.distance(player,target)<=1;
},true).set('ai',function(target){ },true).set('ai',function(target){
return -ai.get.attitude(_status.event.player,target); return -get.attitude(_status.event.player,target);
}); });
"step 2" "step 2"
if(result.bool&&result.targets.length){ if(result.bool&&result.targets.length){
@ -1342,7 +1342,7 @@ mode.guozhan={
forced:true, forced:true,
priority:15, priority:15,
check:function(event,player){ 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){ filter:function(event,player){
return get.type(event.card,'trick')=='trick'&&get.color(event.card)=='black'; return get.type(event.card,'trick')=='trick'&&get.color(event.card)=='black';
@ -1365,7 +1365,7 @@ mode.guozhan={
forced:true, forced:true,
priority:15, priority:15,
check:function(event,player){ 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){ filter:function(event,player){
return event.card.name=='shunshou'||event.card.name=='lebu'; return event.card.name=='shunshou'||event.card.name=='lebu';
@ -1388,7 +1388,7 @@ mode.guozhan={
forced:true, forced:true,
priority:15, priority:15,
check:function(event,player){ 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){ filter:function(event,player){
return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou');
@ -1436,16 +1436,16 @@ mode.guozhan={
if(players[i].hasSkill('haoshi')&& if(players[i].hasSkill('haoshi')&&
!players[i].isTurnedOver()&& !players[i].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& get.attitude(player,players[i])>=3&&
ai.get.attitude(players[i],player)>=3){ get.attitude(players[i],player)>=3){
return 11-ai.get.value(card); return 11-get.value(card);
} }
} }
if(player.countCards('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-get.value(card);
if(player.countCards('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-get.value(card);
}, },
content:function(){ content:function(){
target.gain(cards,player); target.gain(cards,player);
@ -1487,7 +1487,7 @@ mode.guozhan={
if(player.countCards('e',{subtype:get.subtype(card)})){ if(player.countCards('e',{subtype:get.subtype(card)})){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>0){ if(players[i]!=player&&get.attitude(player,players[i])>0){
return 0; return 0;
} }
} }
@ -1548,7 +1548,7 @@ mode.guozhan={
return !target.isUnseen(2); return !target.isUnseen(2);
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card,_status.event.player); return 6-get.value(card,_status.event.player);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1590,7 +1590,7 @@ mode.guozhan={
if(target.hp<=0) return -5; if(target.hp<=0) return -5;
if(player.getStat().skill.qingcheng) return 0; if(player.getStat().skill.qingcheng) return 0;
if(!target.hasSkillTag('maixie')) 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){ if(player.hasCard(function(card){
return get.tag(card,'damage')&&player.canUse(card,target,true,true); return get.tag(card,'damage')&&player.canUse(card,target,true,true);
})){ })){
@ -1620,33 +1620,33 @@ mode.guozhan={
return player.countCards('h',{color:'red'})>0; return player.countCards('h',{color:'red'})>0;
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-get.value(card);
} }
}, },
gzxiaoguo:{ gzxiaoguo:{
inherit:'xiaoguo', inherit:'xiaoguo',
content:function(){ content:function(){
"step 0" "step 0"
var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3); var nono=(Math.abs(get.attitude(player,trigger.player))<3);
if(ai.get.damageEffect(trigger.player,player,player)<=0){ if(get.damageEffect(trigger.player,player,player)<=0){
nono=true; nono=true;
} }
var next=player.chooseToDiscard(get.prompt('gzxiaoguo',trigger.player),{type:'basic'}); var next=player.chooseToDiscard(get.prompt('gzxiaoguo',trigger.player),{type:'basic'});
next.set('ai',function(card){ next.set('ai',function(card){
if(_status.event.nono) return 0; 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('logSkill',['gzxiaoguo',trigger.player]);
next.set('nono',nono); next.set('nono',nono);
"step 1" "step 1"
if(result.bool){ 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){ trigger.player.chooseToDiscard('he',{type:'equip'}).set('ai',function(card){
if(_status.event.nono){ if(_status.event.nono){
return 0; return 0;
} }
if(_status.event.player.hp==1) return 10-ai.get.value(card); if(_status.event.player.hp==1) return 10-get.value(card);
return 9-ai.get.value(card); return 9-get.value(card);
}).set('nono',nono); }).set('nono',nono);
} }
else{ else{
@ -3514,7 +3514,7 @@ mode.guozhan={
else if(shown<0.4) c=0.5; else if(shown<0.4) c=0.5;
else if(shown<0.6) c=0.8; else if(shown<0.6) c=0.8;
else c=1; else c=1;
effect+=ai.get.effect(targets[i],card,this)*c; effect+=get.effect(targets[i],card,this)*c;
} }
} }
if(effect>0){ if(effect>0){
@ -3530,7 +3530,6 @@ mode.guozhan={
}, },
} }
}, },
ai:{
get:{ get:{
realAttitude:function(from,toidentity,difficulty){ realAttitude:function(from,toidentity,difficulty){
if(from.identity==toidentity&&toidentity!='ye'){ if(from.identity==toidentity&&toidentity!='ye'){
@ -3580,7 +3579,7 @@ mode.guozhan={
toidentity='ye'; toidentity='ye';
} }
} }
var att=ai.get.realAttitude(from,toidentity,difficulty); var att=get.realAttitude(from,toidentity,difficulty);
if(from.storage.zhibi&&from.storage.zhibi.contains(to)){ if(from.storage.zhibi&&from.storage.zhibi.contains(to)){
return att; return att;
} }
@ -3616,5 +3615,4 @@ mode.guozhan={
return Math.min(0,Math.random()-0.5)+difficulty; return Math.min(0,Math.random()-0.5)+difficulty;
}, },
} }
},
} }

View File

@ -1477,7 +1477,7 @@ mode.identity={
else if(shown<0.4) c=0.5; else if(shown<0.4) c=0.5;
else if(shown<0.6) c=0.8; else if(shown<0.6) c=0.8;
else c=1; else c=1;
var eff=ai.get.effect(targets[i],card,this); var eff=get.effect(targets[i],card,this);
effect+=eff*c; effect+=eff*c;
if(eff==0&&shown==0&&this.identity=='zhong'&&targets[i]!=this){ if(eff==0&&shown==0&&this.identity=='zhong'&&targets[i]!=this){
effect+=0.1; effect+=0.1;
@ -1538,7 +1538,7 @@ mode.identity={
else if(shown<0.4) c=0.5; else if(shown<0.4) c=0.5;
else if(shown<0.6) c=0.8; else if(shown<0.6) c=0.8;
else c=1; 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'){ if(this.identity=='nei'){
@ -1578,7 +1578,6 @@ mode.identity={
}, },
} }
}, },
ai:{
get:{ get:{
rawAttitude:function(from,to){ rawAttitude:function(from,to){
var x=0,num=0,temp,i; var x=0,num=0,temp,i;
@ -1597,7 +1596,7 @@ mode.identity={
var difficulty=0; var difficulty=0;
if(to==game.me) difficulty=2-get.difficulty(); if(to==game.me) difficulty=2-get.difficulty();
if(from==to||to.identityShown||(from.storage.dongcha==to)){ if(from==to||to.identityShown||(from.storage.dongcha==to)){
return ai.get.realAttitude(from,to)+difficulty*1.5; return get.realAttitude(from,to)+difficulty*1.5;
} }
else{ else{
if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&& if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&&
@ -1621,7 +1620,7 @@ mode.identity={
} }
if(fanshown) aishown=0.3; if(fanshown) aishown=0.3;
} }
return ai.get.realAttitude(from,to)*aishown+difficulty*1.5; return get.realAttitude(from,to)*aishown+difficulty*1.5;
} }
}, },
realAttitude:function(from,to){ realAttitude:function(from,to){
@ -1630,7 +1629,7 @@ mode.identity={
if(from.identity==to.identity) return 6; if(from.identity==to.identity) return 6;
return -6; return -6;
} }
var situation=ai.get.situation(); var situation=get.situation();
var identity=from.identity; var identity=from.identity;
var identity2=to.identity; var identity2=to.identity;
if(identity2=='zhu'&&!to.isZhu){ if(identity2=='zhu'&&!to.isZhu){
@ -1854,10 +1853,6 @@ mode.identity={
} }
return result; return result;
}, },
population:function(identity){
return get.population(identity);
}
}
}, },
skill:{ skill:{
dongcha:{ dongcha:{
@ -1871,7 +1866,7 @@ mode.identity={
return target.countCards('hej')>0; return target.countCards('hej')>0;
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; 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' 'step 1'
if(result.bool){ if(result.bool){

View File

@ -1680,6 +1680,16 @@ mode.stone={
}, },
}, },
get:{ 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){ stonecard:function(type,career){
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
@ -2422,7 +2432,7 @@ mode.stone={
if(player.hasFellowSkill('priest_hunwu')){ if(player.hasFellowSkill('priest_hunwu')){
return -2 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')){ if(player.hasFellowSkill('priest_hunwu')){
return -2 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')){ if(player.hasFellowSkill('priest_hunwu')){
return -1; return -1;
} }
return ai.get.recoverEffect(target,player,target); return get.recoverEffect(target,player,target);
} }
} }
} }
@ -4460,7 +4470,7 @@ mode.stone={
'step 0' 'step 0'
if(player.countCards('e')){ if(player.countCards('e')){
player.chooseToDiscard('e','是否弃置一张装备区内的牌令伤害+1').ai=function(card){ player.chooseToDiscard('e','是否弃置一张装备区内的牌令伤害+1').ai=function(card){
return 7-ai.get.value(card); return 7-get.value(card);
} }
} }
else{ else{
@ -5966,7 +5976,7 @@ mode.stone={
event.chooser.chooseTarget('陪练:令一名随从获得嘲讽',function(card,playerx,target){ event.chooser.chooseTarget('陪练:令一名随从获得嘲讽',function(card,playerx,target){
return player!=target&&target.isMin()&&!target.hasSkill('chaofeng'); return player!=target&&target.isMin()&&!target.hasSkill('chaofeng');
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(event.chooser,target)*target.hp; return get.attitude(event.chooser,target)*target.hp;
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
@ -6032,7 +6042,7 @@ mode.stone={
event.chooser.chooseTarget('普照:选择一名己方随从增加两点体力和体力上限',function(card,playerx,target){ event.chooser.chooseTarget('普照:选择一名己方随从增加两点体力和体力上限',function(card,playerx,target){
return player!=target&&player.side==target.side&&target.isMin(); return player!=target&&player.side==target.side&&target.isMin();
}).ai=function(target){ }).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); player.line(event.chooser);
"step 1" "step 1"
@ -6060,7 +6070,7 @@ mode.stone={
event.chooser.chooseTarget('缩小:令一名随从减少两点体力上限',function(card,playerx,target){ event.chooser.chooseTarget('缩小:令一名随从减少两点体力上限',function(card,playerx,target){
return player!=target&&target.isMin()&&target.maxHp>1; return player!=target&&target.isMin()&&target.maxHp>1;
}).ai=function(target){ }).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.hp==1) return 0.01;
if(target.maxHp-target.hp>=2) return 0.01; if(target.maxHp-target.hp>=2) return 0.01;
if(target.maxHp-target.hp==1){ if(target.maxHp-target.hp==1){
@ -6281,7 +6291,7 @@ mode.stone={
'he',function(card){ 'he',function(card){
return get.type(card)=='equip'; return get.type(card)=='equip';
}).ai=function(card){ }).ai=function(card){
return 7-ai.get.value(card); return 7-get.value(card);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -6478,9 +6488,9 @@ mode.stone={
return player!=target&&target.isMin()&&(target.hp!=2||target.maxHp!=2); return player!=target&&target.isMin()&&(target.hp!=2||target.maxHp!=2);
}).ai=function(target){ }).ai=function(target){
if(target.hp==2&&target.maxHp>2){ 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); player.line(event.chooser);
"step 1" "step 1"
@ -6509,7 +6519,7 @@ mode.stone={
event.chooser.chooseTarget('保卫:令一名友方随从获得一点护甲',function(card,playerx,target){ event.chooser.chooseTarget('保卫:令一名友方随从获得一点护甲',function(card,playerx,target){
return player!=target&&player.side==target.side&&target.isMin(); return player!=target&&player.side==target.side&&target.isMin();
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(event.chooser,target); return get.attitude(event.chooser,target);
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
@ -7369,10 +7379,10 @@ mode.stone={
}, },
filterCard:true, filterCard:true,
ai1:function(card){ ai1:function(card){
return 9-ai.get.value(card); return 9-get.value(card);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
}, },
prompt:'偷袭:弃置一张装备区内的牌并对一名敌方角色一点伤害' prompt:'偷袭:弃置一张装备区内的牌并对一名敌方角色一点伤害'
}); });
@ -7524,7 +7534,7 @@ mode.stone={
event.chooser.chooseTarget('监工:对一名随从造成一点伤害然后令其摸两张牌',function(card,playerx,target){ event.chooser.chooseTarget('监工:对一名随从造成一点伤害然后令其摸两张牌',function(card,playerx,target){
return player!=target&&target.isMin(); return player!=target&&target.isMin();
}).ai=function(target){ }).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==1) return -att;
if(target.hp==2) return 0; if(target.hp==2) return 0;
return att; return att;
@ -7854,7 +7864,7 @@ mode.stone={
event.chooser.chooseTarget('驯兽:选择一名己方随从增加一点体力和体力上限并摸两张牌',function(card,playerx,target){ event.chooser.chooseTarget('驯兽:选择一名己方随从增加一点体力和体力上限并摸两张牌',function(card,playerx,target){
return player!=target&&player.side==target.side&&target.isMin(); return player!=target&&player.side==target.side&&target.isMin();
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(event.chooser,target); return get.attitude(event.chooser,target);
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
@ -8198,7 +8208,7 @@ mode.stone={
if(player.hasFellowSkill('priest_hunwu')){ if(player.hasFellowSkill('priest_hunwu')){
return -1; return -1;
} }
return ai.get.recoverEffect(target,player,target); return get.recoverEffect(target,player,target);
} }
} }
} }
@ -8230,7 +8240,7 @@ mode.stone={
order:2, order:2,
result:{ result:{
target:function(player,target){ 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, order:2,
result:{ result:{
target:function(player,target){ 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, order:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.damageEffect(target,player,target); return get.damageEffect(target,player,target);
} }
} }
} }
@ -8448,11 +8458,11 @@ mode.stone={
}, },
ai:{ ai:{
order:function(){ order:function(){
return ai.get.order({name:'sha'})-0.1; return get.order({name:'sha'})-0.1;
}, },
result:{ result:{
target:function(player,target){ 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){ event.chooser.chooseTarget('暗影:选择敌方一名角色视为对其使用一张杀',function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},event.chooser,target); return lib.filter.targetEnabled({name:'sha'},event.chooser,target);
}).ai=function(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); player.line(event.chooser);
"step 1" "step 1"
@ -8790,7 +8800,7 @@ mode.stone={
event.chooser.chooseTarget('发明:选择己方一名角色摸一张牌',function(card,playerx,target){ event.chooser.chooseTarget('发明:选择己方一名角色摸一张牌',function(card,playerx,target){
return player!=target&&player.side==target.side; return player!=target&&player.side==target.side;
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(event.chooser,target); return get.attitude(event.chooser,target);
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
@ -10198,20 +10208,6 @@ mode.stone={
mode_stone_card_config:'炉石模式', mode_stone_card_config:'炉石模式',
mode_stone_character_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:{ help:{
'炉石模式': '炉石模式':
'<div style="margin:10px">构筑</div><ul style="margin-top:0"><li>点击右上角的卡组管理构建卡组<li>一套卡组共30张牌由法术和随从牌构成每个同名卡牌最多带两张'+ '<div style="margin:10px">构筑</div><ul style="margin-top:0"><li>点击右上角的卡组管理构建卡组<li>一套卡组共30张牌由法术和随从牌构成每个同名卡牌最多带两张'+

View File

@ -20,7 +20,7 @@ mode.tafang={
} }
} }
get.chessDistance=lib.init.eval(result.get.chessDistance); 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', var toLoad=['addChessPlayer','addObstacle','removeObstacle','isChessNeighbour',
'draw2','updateCanvas2','setChessInfo','modeSwapPlayer']; 'draw2','updateCanvas2','setChessInfo','modeSwapPlayer'];
for(var i=0;i<toLoad.length;i++){ for(var i=0;i<toLoad.length;i++){

View File

@ -3272,7 +3272,7 @@ mode.versus={
player.chooseTarget(get.prompt('boss_didongjg'),function(card,player,target){ player.chooseTarget(get.prompt('boss_didongjg'),function(card,player,target){
return target.isEnemyOf(player); return target.isEnemyOf(player);
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(target.isTurnedOver()){ if(target.isTurnedOver()){
if(att>0){ if(att>0){
return att+5; return att+5;
@ -3345,7 +3345,7 @@ mode.versus={
player.chooseTarget(get.prompt('boss_qiwu'),function(card,player,target){ player.chooseTarget(get.prompt('boss_qiwu'),function(card,player,target){
return target.hp<target.maxHp&&target.isFriendOf(player); return target.hp<target.maxHp&&target.isFriendOf(player);
}).ai=function(target){ }).ai=function(target){
var num=ai.get.attitude(player,target); var num=get.attitude(player,target);
if(num>0){ if(num>0){
if(noneed&&player==target){ if(noneed&&player==target){
num=0.5; num=0.5;
@ -3428,7 +3428,7 @@ mode.versus={
return !target.isFriendOf(player); return !target.isFriendOf(player);
}).ai=function(target){ }).ai=function(target){
if(target.isTurnedOver()) return 0; if(target.isTurnedOver()) return 0;
return -ai.get.attitude(player,target); return -get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3449,7 +3449,7 @@ mode.versus={
player.chooseTarget(get.prompt('boss_chuanyun'),function(card,player,target){ player.chooseTarget(get.prompt('boss_chuanyun'),function(card,player,target){
return player.hp<target.hp; return player.hp<target.hp;
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3471,7 +3471,7 @@ mode.versus={
if(target==trigger.player) return false; if(target==trigger.player) return false;
return target.isEnemyOf(player); return target.isEnemyOf(player);
}).ai=function(target){ }).ai=function(target){
return ai.get.damageEffect(target,player,player,'thunder'); return get.damageEffect(target,player,player,'thunder');
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3494,7 +3494,7 @@ mode.versus={
if(target.isFriendOf(player)) return false; if(target.isFriendOf(player)) return false;
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,{name:'sha'},player); return get.effect(target,{name:'sha'},player);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3617,7 +3617,7 @@ mode.versus={
var num=0,players=game.filterPlayer(); var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hp<players[i].maxHp&& if(players[i].hp<players[i].maxHp&&
players[i].isFriendOf(player)&&ai.get.recoverEffect(players[i])>0){ players[i].isFriendOf(player)&&get.recoverEffect(players[i])>0){
if(players[i].hp==1){ if(players[i].hp==1){
return true; return true;
} }
@ -3861,7 +3861,7 @@ mode.versus={
}, },
logTarget:'player', logTarget:'player',
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0; return get.attitude(player,event.player)<0;
}, },
content:function(){ content:function(){
player.line(trigger.player,'green'); player.line(trigger.player,'green');
@ -3907,7 +3907,7 @@ mode.versus={
return target.isFriendOf(player); return target.isFriendOf(player);
}); });
next.ai=function(target){ next.ai=function(target){
var att=ai.get.attitude(player,target); var att=get.attitude(player,target);
if(att>0&&target.hasJudge('lebu')){ if(att>0&&target.hasJudge('lebu')){
return 0.1; return 0.1;
} }
@ -4086,7 +4086,7 @@ mode.versus={
player.chooseTarget('是否令一名敌方角色失去1点体力',function(card,player,target){ player.chooseTarget('是否令一名敌方角色失去1点体力',function(card,player,target){
return !target.isFriendOf(player); return !target.isFriendOf(player);
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -get.attitude(player,target);
} }
} }
"step 2" "step 2"
@ -4132,8 +4132,8 @@ mode.versus={
return target.isEnemyOf(player); return target.isEnemyOf(player);
}).ai=function(target){ }).ai=function(target){
if(player.hp<=1) return 0; if(player.hp<=1) return 0;
if(ai.get.attitude(player,target)>-3) return 0; if(get.attitude(player,target)>-3) return 0;
var eff=ai.get.damageEffect(target,player,player,'fire'); var eff=get.damageEffect(target,player,player,'fire');
if(eff>0){ if(eff>0){
return eff+target.countCards('e')/2; return eff+target.countCards('e')/2;
} }
@ -4767,7 +4767,6 @@ mode.versus={
} }
} }
}, },
ai:{
get:{ get:{
rawAttitude:function(from,to){ rawAttitude:function(from,to){
if(from.side==to.side){ if(from.side==to.side){
@ -4793,7 +4792,6 @@ mode.versus={
return -6; return -6;
} }
}, },
}
}, },
help:{ help:{
'对决模式': '对决模式':