commit
6bc30e698d
|
@ -289,35 +289,55 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
recastable:true,
|
||||
ai:{
|
||||
wuxie:function(target,card,player,viewer){
|
||||
if(_status.event.getRand()<0.5) return 0;
|
||||
if(player==game.me&&get.attitude(viewer,player)>0){
|
||||
return 0;
|
||||
}
|
||||
wuxie:(target,card,player,viewer, status)=>{
|
||||
if(status*get.attitude(viewer,player)>0&&!player.isMad() || target.hasSkillTag('nodamage') || target.hasSkillTag('nofire') || target.hasSkillTag('nothunder') || get.attitude(viewer,player)>0 || (1+target.countCards('hs'))*_status.event.getRand()>1.57) return 0;
|
||||
},
|
||||
basic:{
|
||||
useful:4,
|
||||
value:4,
|
||||
order:7
|
||||
order:(item,player)=>{
|
||||
if(player.hasCard(card=>{
|
||||
return get.tag(card,'damage')&&game.hasNature(card)&&player.hasValueTarget(card);
|
||||
},'hs')) return 7.3;
|
||||
return 4.1;
|
||||
},
|
||||
useful:1.2,
|
||||
value:4
|
||||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.isLinked()){
|
||||
target:(player,target)=>{
|
||||
if(target.hasSkillTag('link')) return 0;
|
||||
var f=target.hasSkillTag('nofire');
|
||||
var t=target.hasSkillTag('nothunder');
|
||||
if(f&&t) return 0;
|
||||
if(f||t) return 0.5;
|
||||
return 2;
|
||||
let curs = game.filterPlayer(current=>{
|
||||
if(current.hasSkillTag('nodamage')) return false;
|
||||
return !current.hasSkillTag('nofire') || !current.hasSkillTag('nothunder');
|
||||
});
|
||||
if(curs.length<2) return 0;
|
||||
let f = target.hasSkillTag('nofire'),
|
||||
t = target.hasSkillTag('nothunder'),
|
||||
res = 0.9;
|
||||
if(f&&t || target.hasSkillTag('nodamage')) return 0;
|
||||
if(f || t) res = 0.45;
|
||||
if(target.getEquip('tengjia')) res *= 2;
|
||||
if(!target.isLinked()) res = -res;
|
||||
if(ui.selected.targets.length) return res;
|
||||
let fs = 0,
|
||||
es = 0,
|
||||
att = get.attitude(player,target),
|
||||
linkf = false,
|
||||
alink = true;
|
||||
curs.forEach(i=>{
|
||||
let atti = get.attitude(player,i);
|
||||
if(atti>0){
|
||||
fs++;
|
||||
if(i.isLinked()) linkf = true;
|
||||
}
|
||||
if(get.attitude(player,target)>=0) return -0.9;
|
||||
if(ui.selected.targets.length) return -0.9;
|
||||
if(game.hasPlayer(function(current){
|
||||
return get.attitude(player,current)<=-1&¤t!=target&&!current.isLinked();
|
||||
})){
|
||||
return -0.9;
|
||||
else if(atti<0){
|
||||
es++;
|
||||
if(!i.isLinked()) alink = false;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
if(es<2&&!alink) {
|
||||
if(att<=0 || att>0 && linkf && fs<2) return 0;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},
|
||||
tag:{
|
||||
|
@ -433,10 +453,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return Math.max(0.1,equipValue-value);
|
||||
},
|
||||
equipValue:function(card,player){
|
||||
if(player._tengjiaEv_temp) return Math.max(1,6-player.hp);
|
||||
if(player.hasSkillTag('maixie')&&player.hp>1) return 0;
|
||||
if(player.hasSkillTag('noDirectDamage')) return 10;
|
||||
if(get.damageEffect(player,player,player,'fire')>=0) return 10;
|
||||
var num=4-game.countPlayer(function(current){
|
||||
player._tengjiaEv_temp=true;
|
||||
let eff=get.damageEffect(player,player,player,'fire');
|
||||
delete player._tengjiaEv_temp;
|
||||
if(eff>=0) return 10;
|
||||
let num=4-game.countPlayer(function(current){
|
||||
if(get.attitude(current,player)<0){
|
||||
if(current.hasSkillTag('fireAttack',null,null,true)) return 3;
|
||||
return 1;
|
||||
|
|
378
card/standard.js
378
card/standard.js
|
@ -372,7 +372,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
ai:{
|
||||
order:3,
|
||||
basic:{
|
||||
useful:[7,5.1,2],
|
||||
useful:(card,i)=>{
|
||||
let player = _status.event.player, basic = [7, 5.1, 2], num = basic[Math.min(2, i)];
|
||||
if(player.hp>2&&player.hasSkillTag('maixie')) num *= 0.57;
|
||||
if(player.getEquip('bagua') || player.getEquip('rewrite_bagua') || player.getEquip('renwang') || player.getEquip('rewrite_renwang')) num *= 0.8;
|
||||
return num;
|
||||
},
|
||||
value:[7,5.1,2],
|
||||
},
|
||||
result:{player:1},
|
||||
|
@ -422,7 +427,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(damaged) return Math.max(3,7.8-i);
|
||||
return Math.max(1,7.2-i);
|
||||
},
|
||||
value:(card,player,i)=>{
|
||||
value:(card,player)=>{
|
||||
let fs = game.filterPlayer(current=>{
|
||||
return get.attitude(_status.event.player,current)>0;
|
||||
}), damaged = 0, needs = 0;
|
||||
|
@ -431,9 +436,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(f.hp<=1) needs++;
|
||||
else if(f.hp==2) damaged++;
|
||||
});
|
||||
if(needs>2) return 11;
|
||||
if(needs>1) return 10;
|
||||
if(needs&&damaged || player.hasSkillTag('maixie')) return 9;
|
||||
if(needs&&damaged || player.hasSkillTag('maixie')) return Math.max(9,5*needs+3*damaged);
|
||||
if(needs || damaged>1) return 8;
|
||||
if(damaged) return 7.5;
|
||||
return Math.max(5,9.2-player.hp);
|
||||
|
@ -452,22 +455,19 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
let mode = get.mode(),
|
||||
taos = player.getCards('hs',i=>get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable'));
|
||||
if(target.hp>0){
|
||||
let min = 7.2-1.2*Math.min(3,player.hp),
|
||||
if(!player.isPhaseUsing()) return 0;
|
||||
let min = 7.2-4*player.hp/player.maxHp,
|
||||
nd = player.needsToDiscard(-player.countCards('h',i=>!taos.includes(i)&&get.value(i)<min)),
|
||||
keep = 0;
|
||||
if(!player.hasFriend() || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&target.hp<3&&(mode==='identity'||mode==='versus'||mode==='chess')) return 2;
|
||||
if(nd<3&&game.hasPlayer(current=>{
|
||||
keep = nd?0:2;
|
||||
if(nd>2 || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&(nd||target.hp<3)&&(mode==='identity'||mode==='versus'||mode==='chess') || !player.hasFriend()) return 2;
|
||||
if(game.hasPlayer(current=>{
|
||||
return player!==current&¤t.identity==='zhu'&¤t.hp<3&&(mode==='identity'||mode==='versus'||mode==='chess')&&get.attitude(player,current)>0;
|
||||
})){
|
||||
nd=0;
|
||||
keep=3;
|
||||
}
|
||||
else if(nd<2 || !player.isPhaseUsing()){
|
||||
if(nd<1) keep = 3;
|
||||
else if(target.hp>=2&&taos.length<=target.hp/2) keep = 1;
|
||||
}
|
||||
if(keep){
|
||||
if(!nd || game.countPlayer(current=>{
|
||||
})) keep = 3;
|
||||
else if(nd===2||player.hp<2) return 2;
|
||||
if(nd===2&&player.hp<=1) return 2;
|
||||
if(keep===3) return 0;
|
||||
if(taos.length<=player.hp/2) keep = 1;
|
||||
if(keep&&game.countPlayer(current=>{
|
||||
if(player!==current&¤t.hp<3&&player.hp>current.hp&&get.attitude(player,current)>2){
|
||||
keep += player.hp-current.hp;
|
||||
return true;
|
||||
|
@ -476,7 +476,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
})){
|
||||
if(keep>2) return 0;
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
if(target.isZhu2() || target===game.boss) return 2;
|
||||
|
@ -1298,10 +1297,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return target.hasCard(card=>lib.filter.canBeGained(card,target,player),get.is.single()?'he':'hej');
|
||||
},
|
||||
content:function(){
|
||||
var position=get.is.single()?'he':'hej';
|
||||
if(target.countGainableCards(player,position)){
|
||||
player.gainPlayerCard(position,target,true);
|
||||
}
|
||||
let pos=get.is.single()?'he':'hej';
|
||||
if(target.countGainableCards(player,pos)) player.gainPlayerCard(pos, target, true).set('target',target).set('ai',lib.card.shunshou.ai.button);
|
||||
},
|
||||
ai:{
|
||||
wuxie:function(target,card,player,viewer){
|
||||
|
@ -1311,54 +1308,143 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
basic:{
|
||||
order:7.5,
|
||||
useful:4,
|
||||
value:9
|
||||
useful:(card,i)=>8/(3+i),
|
||||
value:(card,player)=>{
|
||||
let max=0;
|
||||
game.countPlayer(cur=>{
|
||||
max=Math.max(max,lib.card.shunshou.ai.result.target(player,cur)*get.attitude(player,cur));
|
||||
});
|
||||
if(max<=0) return 2;
|
||||
return 0.53*max;
|
||||
}
|
||||
},
|
||||
button:(button)=>{
|
||||
let player = _status.event.player, target = _status.event.target;
|
||||
if(!lib.filter.canBeGained(button.link,player,target)) return 0;
|
||||
let att = get.attitude(player, target),
|
||||
val = get.value(button.link,player)/60,
|
||||
btv = get.buttonValue(button),
|
||||
pos = get.position(button.link),
|
||||
name = get.name(button.link);
|
||||
if(pos=='j'){
|
||||
if(name=='lebu'){
|
||||
let needs=target.needsToDiscard(2);
|
||||
btv*=1.08+0.2*needs;
|
||||
}
|
||||
else if(name=='shandian'||name=='fulei'||name=='plague') btv/=2;
|
||||
}
|
||||
if(get.attitude(player,get.owner(button.link))>0) btv=-btv;
|
||||
if(pos!='e'){
|
||||
if(pos=='h'&&!player.hasSkillTag('viewHandcard',null,target,true)) return btv+0.1;
|
||||
return btv+val;
|
||||
}
|
||||
let sub = get.subtype(button.link);
|
||||
if(sub=='equip1') return btv*Math.min(3.6,target.hp)/3;
|
||||
if(sub=='equip2'){
|
||||
if(name=='baiyin'&&pos=='e'&&target.isDamaged()){
|
||||
let by=3-0.6*Math.min(5,target.hp);
|
||||
return get.sgn(get.recoverEffect(target,player,player))*by;
|
||||
}
|
||||
return 1.57*btv+val;
|
||||
}
|
||||
if(att<=0&&(sub=='equip3'||sub=='equip4')&&(player.hasSkill('shouli')||player.hasSkill('psshouli'))) return 0;
|
||||
if(sub=='equip3'&&!game.hasPlayer((cur)=>!cur.inRange(target)&&get.attitude(cur,target)<0)) return 0.4*btv+val;
|
||||
if(sub=='equip4') return btv/2+val;
|
||||
return btv+val;
|
||||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
const hs=target.getGainableCards(player,'h');
|
||||
const es=target.getGainableCards(player,'e');
|
||||
const js=target.getGainableCards(player,'j');
|
||||
|
||||
if(get.attitude(player,target)<=0){
|
||||
if(hs.length>0) return -1.5;
|
||||
return (es.some(card=>{
|
||||
return get.value(card,target)>0&&card!=target.getEquip('jinhe');
|
||||
})||js.some(card=>{
|
||||
var cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
}))?-1.5:1.5;
|
||||
}
|
||||
return (es.some(card=>{
|
||||
return get.value(card,target)<=0;
|
||||
})||js.some(card=>{
|
||||
var cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
}))?1.5:-1.5;
|
||||
},
|
||||
player:function(player,target){
|
||||
const hs=target.getGainableCards(player,'h');
|
||||
const es=target.getGainableCards(player,'e');
|
||||
const js=target.getGainableCards(player,'j');
|
||||
|
||||
const att=get.attitude(player,target);
|
||||
if(att<0){
|
||||
if(!hs.length&&!es.some(card=>{
|
||||
return get.value(card,target)>0&&card!=target.getEquip('jinhe');
|
||||
})&&!js.some(card=>{
|
||||
var cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
})) return 0;
|
||||
let att=get.attitude(player,target),
|
||||
hs=target.hasCard((card)=>lib.filter.canBeGained(card,player,target),'h'),
|
||||
lose=hs,
|
||||
gain=att>0?0.52:1.28;
|
||||
if(Math.abs(att)<5.03){
|
||||
let temp=0.015*att*att;
|
||||
if(att<0) gain=0.9+temp;
|
||||
else gain=0.9-temp;
|
||||
}
|
||||
else if(att>1){
|
||||
return (es.some(card=>{
|
||||
return get.value(card,target)<=0;
|
||||
})||js.some(card=>{
|
||||
var cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
}))?1.5:0;
|
||||
target.countCards('e',function(card){
|
||||
if(card.name!='jinhe'&&lib.filter.canBeGained(card,player,target)&&att*get.value(card,target)<0){
|
||||
lose=true;
|
||||
let val=get.value(card,player);
|
||||
if(val>0) gain=Math.max(gain,val/7);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
target.countCards('j',function(card){
|
||||
let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card;
|
||||
if(lib.filter.canBeGained(card,player,target)&&att*get.effect(target,cardj,target,target)<0){
|
||||
lose=true;
|
||||
if(cardj.name=='lebu'){
|
||||
let needs=target.needsToDiscard(2);
|
||||
if(att>0) gain=Math.max(gain,1.6+needs/10);
|
||||
}
|
||||
else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') gain=Math.max(gain,1.5/Math.max(1,target.hp));
|
||||
else if(att>0) gain=Math.max(gain,1.7);
|
||||
}
|
||||
});
|
||||
if(!lose) return 0;
|
||||
return gain;
|
||||
},
|
||||
target:function(player,target){
|
||||
let att=get.attitude(player,target),
|
||||
hs=target.countCards('h',(card)=>lib.filter.canBeGained(card,player,target)),
|
||||
es=target.countCards('e',(card)=>lib.filter.canBeGained(card,player,target)),
|
||||
js=target.countCards('j',(card)=>lib.filter.canBeGained(card,player,target)),
|
||||
noh=!hs||target.hasSkillTag('noh'),
|
||||
noe=!es||target.hasSkillTag('noe'),
|
||||
check=[-1,att>0?-1.3:1.3,att>0?-2.5:2.5],
|
||||
idx=-1;
|
||||
if(hs){
|
||||
idx=0;
|
||||
if(noh) check[0]=0.7;
|
||||
}
|
||||
if(es){
|
||||
if(idx<0) idx=1;
|
||||
if(target.getEquip('baiyin')&&target.isDamaged()&&lib.filter.canBeGained(target.getEquip('baiyin'),player,target)){
|
||||
let rec=get.recoverEffect(target,player,target);
|
||||
if(es==1||att*rec>0){
|
||||
let val=3-0.6*Math.min(5,target.hp);
|
||||
if(rec>0) check[1]=val;
|
||||
else if(rec<0) check[1]=-val;
|
||||
}
|
||||
}
|
||||
target.countCards('e',function(card){
|
||||
let val=get.value(card,target);
|
||||
if(card.name=='jinhe'||att*val>=0||!lib.filter.canBeGained(card,player,target)) return false;
|
||||
if(att>0){
|
||||
check[1]=Math.max(1.3,check[1]);
|
||||
return true;
|
||||
}
|
||||
let sub=get.subtype(card);
|
||||
if(sub=='equip2'||sub=='equip5') val+=4;
|
||||
else if(sub=='equip1') val*=0.4*Math.min(3.6,target.hp);
|
||||
else val*=0.6;
|
||||
if(target.hp<3&&sub!='equip2'&&sub!='equip5') val*=0.4;
|
||||
check[1]=Math.min(-0.16*val,check[1]);
|
||||
});
|
||||
if(noe) check[1]+=0.9;
|
||||
}
|
||||
if(js){
|
||||
let func=function(num){
|
||||
if(att>0) check[2]=Math.max(check[2],num);
|
||||
else check[2]=Math.min(check[2],0.6-num);
|
||||
};
|
||||
if(idx<0) idx=2;
|
||||
target.countCards('j',function(card){
|
||||
let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card;
|
||||
if(!lib.filter.canBeGained(card,player,target)||att*get.effect(target,cardj,target,target)>=0) return false;
|
||||
if(cardj.name=='lebu') func(2.1+0.4*target.needsToDiscard(2));
|
||||
else if(cardj.name=='bingliang') func(2.4);
|
||||
else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') func(Math.abs(check[2])/(1+target.hp));
|
||||
else func(2.1);
|
||||
});
|
||||
}
|
||||
if(idx<0) return 0;
|
||||
for(let i=idx+1;i<3;i++){
|
||||
if(i==1&&!es||i==2&&!js) continue;
|
||||
if(att>0&&check[i]>check[idx]||att<=0&&check[i]<check[idx]) idx=i;
|
||||
}
|
||||
return check[idx];
|
||||
}
|
||||
},
|
||||
tag:{
|
||||
|
@ -1474,34 +1560,44 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
defaultYingbianEffect:'add',
|
||||
content:function(){
|
||||
'step 0'
|
||||
if(!get.is.single()&&target.countDiscardableCards(player,'hej')){
|
||||
player.discardPlayerCard('hej',target,true);
|
||||
event.finish();
|
||||
}
|
||||
else{
|
||||
var bool1=target.countDiscardableCards(player,'h');
|
||||
var bool2=target.countDiscardableCards(player,'e');
|
||||
if(bool1&&bool2){
|
||||
player.chooseControl('手牌区','装备区').set('ai',function(){
|
||||
if(get.is.single()){
|
||||
let bool1 = target.countDiscardableCards(player, 'h'),
|
||||
bool2 = target.countDiscardableCards(player, 'e');
|
||||
if(bool1&&bool2) player.chooseControl('手牌区','装备区').set('ai',function(){
|
||||
return Math.random() < 0.5 ? 1 : 0;
|
||||
}).set('prompt','弃置'+(get.translation(target))+'装备区的一张牌,或观看其手牌并弃置其中的一张牌。');
|
||||
}
|
||||
}).set('prompt', '弃置'+get.translation(target)+'装备区的一张牌,或观看其手牌并弃置其中的一张牌。');
|
||||
else event._result={control:bool1?'手牌区':'装备区'};
|
||||
}
|
||||
else event._result={control:'所有区域'};
|
||||
'step 1'
|
||||
var pos=result.control=='手牌区'?'h':'e';
|
||||
player.discardPlayerCard(target,pos,true,'visible');
|
||||
let pos, vis='visible';
|
||||
if(result.control=='手牌区') pos='h';
|
||||
else if(result.control=='装备区') pos='e';
|
||||
else{
|
||||
pos='hej';
|
||||
vis=undefined;
|
||||
}
|
||||
if(target.countDiscardableCards(player,pos)) player.discardPlayerCard(pos, target, true, vis).set('target',target).set('ai',lib.card.guohe.ai.button);
|
||||
},
|
||||
ai:{
|
||||
wuxie:(target,card,player,viewer,status)=>{
|
||||
if(status*get.attitude(viewer,player)>0&&!player.isMad() || target.hp>2&&!target.hasCard(i=>{
|
||||
return get.value(i,target)>3+Math.min(5,target.hp);
|
||||
let val=get.value(i,target),subtypes=get.subtypes(i);
|
||||
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;
|
||||
return val>3+Math.min(5,target.hp);
|
||||
},'e')&&target.countCards('h')*_status.event.getRand('guohe_wuxie')>1.57) return 0;
|
||||
},
|
||||
basic:{
|
||||
order:9,
|
||||
useful:5,
|
||||
value:5,
|
||||
useful:(card,i)=>10/(3+i),
|
||||
value:(card,player)=>{
|
||||
let max=0;
|
||||
game.countPlayer(cur=>{
|
||||
max=Math.max(max,lib.card.guohe.ai.result.target(player,cur)*get.attitude(player,cur));
|
||||
});
|
||||
if(max<=0) return 5;
|
||||
return 0.42*max;
|
||||
}
|
||||
},
|
||||
yingbian:function(card,player,targets,viewer){
|
||||
if(get.attitude(viewer,player)<=0) return 0;
|
||||
|
@ -1510,40 +1606,100 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
})) return 6;
|
||||
return 0;
|
||||
},
|
||||
button:(button)=>{
|
||||
let player = _status.event.player, target = _status.event.target;
|
||||
if(!lib.filter.canBeDiscarded(button.link,player,target)) return 0;
|
||||
let att = get.attitude(player, target),
|
||||
val = get.buttonValue(button),
|
||||
pos = get.position(button.link),
|
||||
name = get.name(button.link);
|
||||
if(pos==='j'){
|
||||
if(name==='lebu'){
|
||||
let needs=target.needsToDiscard(2);
|
||||
val *= 1.08+0.2*needs;
|
||||
}
|
||||
else if(name=='shandian'||name=='fulei'||name=='plague') val /= 2;
|
||||
}
|
||||
if(get.attitude(player,get.owner(button.link))>0) val = -val;
|
||||
if(pos!=='e') return val;
|
||||
let sub = get.subtypes(button.link);
|
||||
if(sub.includes('equip1')) return val*Math.min(3.6,target.hp)/3;
|
||||
if(sub.includes('equip2')){
|
||||
if(name==='baiyin'&&pos==='e'&&target.isDamaged()){
|
||||
let by=3-0.6*Math.min(5,target.hp);
|
||||
return get.sgn(get.recoverEffect(target,player,player))*by;
|
||||
}
|
||||
return 1.57*val;
|
||||
}
|
||||
if(att<=0&&(sub.includes('equip3')||sub.includes('equip4'))&&(player.hasSkill('shouli')||player.hasSkill('psshouli'))) return 0;
|
||||
if(sub.includes('equip6')) return val;
|
||||
if(sub.includes('equip4')) return val/2;
|
||||
if(sub.includes('equip3')&&!game.hasPlayer((cur)=>{
|
||||
return !cur.inRange(target)&&get.attitude(cur,target)<0;
|
||||
})) return 0.4*val;
|
||||
return val;
|
||||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
const att=get.attitude(player,target);
|
||||
const hs=target.getDiscardableCards(player,'h');
|
||||
const es=target.getDiscardableCards(player,'e');
|
||||
const js=target.getDiscardableCards(player,'j');
|
||||
if(!hs.length&&!es.length&&!js.length) return 0;
|
||||
let att=get.attitude(player, target),
|
||||
hs=target.countCards('h',(card)=>lib.filter.canBeDiscarded(card,player,target)),
|
||||
es=target.countCards('e',(card)=>lib.filter.canBeDiscarded(card,player,target)),
|
||||
js=target.countCards('j',(card)=>lib.filter.canBeDiscarded(card,player,target)),
|
||||
noh=!hs||target.hasSkillTag('noh'),
|
||||
noe=!es||target.hasSkillTag('noe'),
|
||||
check=[-1,att>0?-1.3:1.3,att>0?-2.5:2.5],
|
||||
idx=-1;
|
||||
if(hs){
|
||||
idx=0;
|
||||
if(noh) check[0]=0.7;
|
||||
}
|
||||
if(es){
|
||||
if(idx<0) idx=1;
|
||||
if(target.getEquip('baiyin')&&target.isDamaged()&&lib.filter.canBeDiscarded(target.getEquip('baiyin'),player,target)){
|
||||
let rec=get.recoverEffect(target,player,target);
|
||||
if(es==1||att*rec>0){
|
||||
let val=3-0.6*Math.min(5,target.hp);
|
||||
if(rec>0) check[1]=val;
|
||||
else if(rec<0) check[1]=-val;
|
||||
}
|
||||
}
|
||||
target.countCards('e',function(card){
|
||||
let val=get.value(card,target);
|
||||
if(card.name=='jinhe'||att*val>=0||!lib.filter.canBeDiscarded(card,player,target)) return false;
|
||||
if(att>0){
|
||||
if(js.some(card=>{
|
||||
const cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
})) return 3;
|
||||
if(target.isDamaged()&&es.some(card=>card.name=='baiyin')&&
|
||||
get.recoverEffect(target,player,player)>0){
|
||||
if(target.hp==1&&!target.hujia) return 1.6;
|
||||
check[1]=Math.max(1.3,check[1]);
|
||||
return true;
|
||||
}
|
||||
if(es.some(card=>{
|
||||
return get.value(card,target)<0;
|
||||
})) return 1;
|
||||
return -1.5;
|
||||
let sub=get.subtype(card);
|
||||
if(sub=='equip2'||sub=='equip5') val+=4;
|
||||
else if(sub=='equip1') val*=0.4*Math.min(3.6,target.hp);
|
||||
else val*=0.6;
|
||||
if(target.hp<3&&sub!='equip2'&&sub!='equip5') val*=0.4;
|
||||
check[1]=Math.min(-0.16*val,check[1]);
|
||||
});
|
||||
if(noe) check[1]+=0.9;
|
||||
}
|
||||
else{
|
||||
const noh=(hs.length==0||target.hasSkillTag('noh'));
|
||||
const noe=(es.length==0||target.hasSkillTag('noe'));
|
||||
const noe2=(noe||!es.some(card=>{
|
||||
return get.value(card,target)>0;
|
||||
}));
|
||||
const noj=(js.length==0||!js.some(card=>{
|
||||
const cardj=card.viewAs?{name:card.viewAs}:card;
|
||||
return get.effect(target,cardj,target,player)<0;
|
||||
}))
|
||||
if(noh&&noe2&&noj) return 1.5;
|
||||
return -1.5;
|
||||
if(js){
|
||||
let func=function(num){
|
||||
if(att>0) check[2]=Math.max(check[2],num);
|
||||
else check[2]=Math.min(check[2],0.6-num);
|
||||
};
|
||||
if(idx<0) idx=2;
|
||||
target.countCards('j',function(card){
|
||||
let cardj=card.viewAs?new lib.element.VCard({name:card.viewAs}):card;
|
||||
if(!lib.filter.canBeDiscarded(card,player,target)||att*get.effect(target,cardj,target,target)>=0) return false;
|
||||
if(cardj.name=='lebu') func(2.1+0.4*target.needsToDiscard(2));
|
||||
else if(cardj.name=='bingliang') func(2.4);
|
||||
else if(cardj.name=='shandian'||cardj.name=='fulei'||cardj.name=='plague') func(Math.abs(check[2])/(1+target.hp));
|
||||
else func(2.1);
|
||||
});
|
||||
}
|
||||
if(idx<0) return 0;
|
||||
for(let i=idx+1;i<3;i++){
|
||||
if(i==1&&!es||i==2&&!js) continue;
|
||||
if(att>0&&check[i]>check[idx]||att<=0&&check[i]<check[idx]) idx=i;
|
||||
}
|
||||
return check[idx];
|
||||
},
|
||||
},
|
||||
tag:{
|
||||
|
|
|
@ -19,18 +19,21 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
defaultYingbianEffect:'add',
|
||||
content:function(){
|
||||
var dist=get.distance(player,target);
|
||||
if(dist>1||card.yingbian_all) player.discardPlayerCard(target,'hej',true);
|
||||
if(dist<=1||card.yingbian_all) player.gainPlayerCard(target,'hej',true);
|
||||
if(dist>1||card.yingbian_all) player.discardPlayerCard(target,'hej',true).set('target',target).set('ai',lib.card.guohe.ai.button);
|
||||
if(dist<=1||card.yingbian_all) player.gainPlayerCard(target,'hej',true).set('target',target).set('ai',lib.card.shunshou.ai.button);
|
||||
},
|
||||
fullskin:true,
|
||||
postAi:function(targets){
|
||||
return targets.length==1&&targets[0].countCards('j');
|
||||
},
|
||||
ai:{
|
||||
wuxie:function(target,card,player,viewer){
|
||||
if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){
|
||||
return 0;
|
||||
}
|
||||
wuxie:function(target,card,player,viewer,status){
|
||||
if(status*get.attitude(viewer,player)>0&&!player.isMad()) return 0;
|
||||
if(!card.yingbian_all&&get.distance(player,target)>1&&!target.hasCard(i=>{
|
||||
let val=get.value(i,target),subtypes=get.subtypes(i);
|
||||
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;
|
||||
return val>3+Math.min(5,target.hp);
|
||||
},'e')&&target.countCards('h')*_status.event.getRand('guohe_wuxie')>1.57) return 0;
|
||||
},
|
||||
yingbian:function(card,player,targets,viewer){
|
||||
if(get.attitude(viewer,player)<=0) return 0;
|
||||
|
@ -60,8 +63,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
basic:{
|
||||
order:7.5,
|
||||
useful:4,
|
||||
value:9
|
||||
useful:(card,i)=>9.6/(2+i),
|
||||
value:(card,player)=>{
|
||||
let max=0;
|
||||
game.countPlayer(cur=>{
|
||||
let dist=get.distance(player,cur);
|
||||
if(dist>1||card.yingbian_all) max=Math.max(max,lib.card.shunshou.ai.result.target(player,cur)*get.attitude(player,cur));
|
||||
else max=Math.max(max,lib.card.guohe.ai.result.target(player,cur)*get.attitude(player,cur));
|
||||
});
|
||||
if(max<=0) return 7;
|
||||
if(card.yingbian_all) return 0.75*max;
|
||||
return 0.6*max;
|
||||
}
|
||||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
|
|
|
@ -11171,18 +11171,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ai:{
|
||||
order:1,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.skipList.contains('phaseDraw')||target.hasSkill('pingkou')) return 0;
|
||||
var hs=player.getCards('h').sort(function(a,b){
|
||||
return b.number-a.number;
|
||||
player:(player,target)=>{
|
||||
let hs=player.getCards('h').sort(function(a,b){
|
||||
return get.number(b)-get.number(a);
|
||||
});
|
||||
var ts=target.getCards('h').sort(function(a,b){
|
||||
return b.number-a.number;
|
||||
});
|
||||
if(!hs.length||!ts.length) return 0;
|
||||
if(hs[0].number>ts[0].number) return -1;
|
||||
return 0;
|
||||
if(!hs.length) return 0;
|
||||
let a=get.number(hs[0]),b=4;
|
||||
if(player.getDamagedHp()) b=2;
|
||||
return -b*(1-Math.pow((a-1)/13,target.countCards('h')));
|
||||
},
|
||||
target:(player,target)=>{
|
||||
if(target.skipList.includes('phaseDraw')||target.hasSkill('pingkou')||target.hasSkill('xinpingkou')) return 0;
|
||||
let hs=player.getCards('h').sort(function(a,b){
|
||||
return get.number(b)-get.number(a);
|
||||
});
|
||||
if(!hs.length) return 0;
|
||||
return -Math.pow((get.number(hs[0])-1)/13,target.countCards('h'))*2;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue