Merge branch 'PR-Branch' of github.com:nonameShijian/libccy-noname-fork into PR-Branch
This commit is contained in:
commit
d8c9b30957
|
@ -204,6 +204,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
game.addVideo('cardDialog',null,[get.translation(target)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]);
|
||||
event.card2=result.cards[0];
|
||||
game.log(target,'展示了',event.card2);
|
||||
game.addCardKnower(result.cards, 'everyone');
|
||||
event._result={};
|
||||
player.chooseToDiscard({suit:get.suit(event.card2)},function(card){
|
||||
var evt=_status.event.getParent();
|
||||
|
|
|
@ -226,18 +226,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
'令'+str+'弃置两张类型不同的手牌',
|
||||
'弃置'+str+'的一张手牌',
|
||||
]).set('ai',()=>{
|
||||
let target=_status.event.getParent().target,hs=target.getCards('h'),type=[];
|
||||
if(hs.length<2) return 0;
|
||||
let target=_status.event.getParent().target,hs=target.getCards('h'),type=[],att=get.attitude(_status.event.player,target);
|
||||
if(hs.length<2) return att>0?1:0;
|
||||
hs.forEach(i=>{
|
||||
type.add(get.type2(i,target));
|
||||
});
|
||||
if(target.identity!=='qun'){
|
||||
if(type.length>1) return 0;
|
||||
return 1;
|
||||
if(Boolean(att>0)===Boolean(type.length>1)) return 1;
|
||||
return 0;
|
||||
}
|
||||
if(type.length<2||target.hp<3) return 1;
|
||||
if(hs.length===2) return 0;
|
||||
return 1;
|
||||
if(type.length<2||target.hp<3) return att>0?1:0;
|
||||
if(hs.length===2) return att>0?0:1;
|
||||
return att>0?1:0;
|
||||
});
|
||||
'step 2'
|
||||
if(result.index==0){
|
||||
|
|
|
@ -1401,10 +1401,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
result:{
|
||||
target:function(player,current){
|
||||
if(current.hasSkill('gw_qinpendayu')) return 0;
|
||||
if(current.needsToDiscard()) return -1;
|
||||
if(current.needsToDiscard(1)) return -0.7;
|
||||
if(current.needsToDiscard(2)) return -0.4;
|
||||
return -0.1;
|
||||
return Math.max(-1,-0.1-0.3*current.needsToDiscard(2));
|
||||
}
|
||||
},
|
||||
order:1.2,
|
||||
|
|
|
@ -231,7 +231,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(get.cardtag(card,'yingbian_hit')){
|
||||
hit=true;
|
||||
if(targets.some(target=>{
|
||||
return target.mayHaveShan(viewer)&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0;
|
||||
return target.mayHaveShan(viewer,'use')&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0;
|
||||
})) base+=5;
|
||||
}
|
||||
if(get.cardtag(card,'yingbian_add')){
|
||||
|
@ -241,7 +241,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
if(get.cardtag(card,'yingbian_damage')){
|
||||
if(targets.some(target=>{
|
||||
return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer)||player.hasSkillTag('directHit_ai',true,{
|
||||
return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use')||player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:card,
|
||||
},true))&&!target.hasSkillTag('filterDamage',null,{
|
||||
|
@ -294,7 +294,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
return -1.5;
|
||||
}();
|
||||
if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
|
||||
if(!isLink&&target.mayHaveShan(player,'use')&&!player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:card,
|
||||
},true)) return eff/1.2;
|
||||
|
@ -456,7 +456,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(target.hp>0){
|
||||
if(!player.isPhaseUsing()) return 0;
|
||||
let min = 7.2-4*player.hp/player.maxHp,
|
||||
nd = player.needsToDiscard(i=>taos.includes(i)||get.value(i)>=min),
|
||||
nd = player.needsToDiscard(0,(i,player)=>{
|
||||
return !player.canIgnoreHandcard(i)&&(taos.includes(i)||get.value(i)>=min);
|
||||
}),
|
||||
keep = nd?0:2;
|
||||
if(nd>2 || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&(nd||target.hp<3)&&(mode==='identity'||mode==='versus'||mode==='chess') || !player.hasFriend()) return 2;
|
||||
if(game.hasPlayer(current=>{
|
||||
|
|
|
@ -256,9 +256,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var player=_status.event.player;
|
||||
var card={name:button.link[2],nature:button.link[3],isCard:true};
|
||||
if(card.name=='tao'){
|
||||
if(player.hp==1||(player.hp==2&&!player.hasShan())||player.needsToDiscard()){
|
||||
return 5;
|
||||
}
|
||||
if(player.hp==1||(player.hp==2&&!player.hasShan())||player.needsToDiscard()) return 5;
|
||||
return 1;
|
||||
}
|
||||
if(card.name=='sha'){
|
||||
|
|
|
@ -5078,12 +5078,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.7;
|
||||
}
|
||||
else{
|
||||
num=0.5;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.7;
|
||||
else num=0.5;
|
||||
}
|
||||
if(target.hp>=4) return [1,num*2.5];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
|
|
@ -1012,7 +1012,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
var hasRuanshizi=game.hasPlayer(function(target){
|
||||
return target!=player&&player.canUse('sha',target,null,true)&&!target.mayHaveShan()&&get.attitude(player,target)<0&&get.effect(target,{name:'sha'},player,player)>0;
|
||||
return target!=player&&player.canUse('sha',target,null,true)&&!target.mayHaveShan(player,'use')&&get.attitude(player,target)<0&&get.effect(target,{name:'sha'},player,player)>0;
|
||||
})
|
||||
for(var card of hs){
|
||||
var name=get.name(card);
|
||||
|
@ -2216,7 +2216,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(target.hasSkillTag('nodamage')||target.hasSkillTag('nothunder')) return 'zeroplayertarget';
|
||||
if(target.hasSkillTag('filterDamage',null,{
|
||||
player:player,
|
||||
card:lib.element.VCard({
|
||||
card:new lib.element.VCard({
|
||||
name:card.name,
|
||||
nature:'thunder'
|
||||
},[card])
|
||||
|
|
|
@ -804,7 +804,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return trigger.targets.includes(target);
|
||||
},
|
||||
ai1:function(card){
|
||||
if(!player.needsToDiscard(ui.selected.cards.length)) return 0;
|
||||
if(!player.needsToDiscard(0,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 0;
|
||||
if(ui.selected.cards.length>=num2) return 0;
|
||||
return Math.max(5,get.value(trigger.card))-get.value(card)-1;
|
||||
},
|
||||
|
|
|
@ -4582,7 +4582,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var d1=true;
|
||||
if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false
|
||||
for(var target of trigger.targets){
|
||||
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
|
|
@ -2368,7 +2368,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
result:{
|
||||
target:function(player,target){
|
||||
var eff=get.effect(target,{name:'sha',nature:'fire'},player,target)/30;
|
||||
if(!target.mayHaveShan()) eff*=2;
|
||||
if(!target.mayHaveShan(player,'use')) eff*=2;
|
||||
var del=target.countCards('h')-player.countCards('h')+1.5;
|
||||
eff*=Math.sqrt(del);
|
||||
return eff;
|
||||
|
@ -5060,12 +5060,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!moveCard||!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.5;
|
||||
}
|
||||
else{
|
||||
num=0.3;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.5;
|
||||
else num=0.3;
|
||||
}
|
||||
if(target.hp>=4) return [1,num*2];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
@ -5224,7 +5220,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(_status.event.all) return 1;
|
||||
if(ui.selected.buttons.length) return 0;
|
||||
return Math.random();
|
||||
}).set('all',!target.mayHaveShan()&&Math.random()<0.75).set('forceAuto',true);
|
||||
}).set('all',!target.mayHaveShan(player,'use')&&Math.random()<0.75).set('forceAuto',true);
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
var cards=result.cards;
|
||||
|
|
|
@ -4306,7 +4306,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
selectCard:(player.getStat('skill').buxu||0)+1,
|
||||
ai1:function(card){
|
||||
var player=_status.event.player;
|
||||
if(player.needsToDiscard()>ui.selected.cards.length) return 10/Math.max(0.1,get.value(card));
|
||||
if(player.needsToDiscard(0,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 10/Math.max(0.1,get.value(card));
|
||||
return 5-(player.getStat('skill').buxu||0)-get.value(card);
|
||||
},
|
||||
ai2:()=>1,
|
||||
|
@ -8443,7 +8445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
]).set('ai',function(){
|
||||
var target=_status.event.getTrigger().target;
|
||||
var player=_status.event.player;
|
||||
var num=target.mayHaveShan()?0:1;
|
||||
var num=target.mayHaveShan(player,'use')?0:1;
|
||||
if(get.attitude(player,target)>0) num=1-num;
|
||||
return num;
|
||||
});
|
||||
|
@ -11316,12 +11318,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.7;
|
||||
}
|
||||
else{
|
||||
num=0.5;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.7;
|
||||
else num=0.5;
|
||||
}
|
||||
if(target.hp>=4) return [1,num*2];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
|
|
@ -170,7 +170,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
d1=true;
|
||||
if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false;
|
||||
for(var target of trigger.targets){
|
||||
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
@ -299,7 +299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var effect=0;
|
||||
for(var target of trigger.targets){
|
||||
var eff=get.effect(target,trigger.card,trigger.player,player);
|
||||
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
@ -765,7 +765,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(target.hasSkillTag('nodamage')||target.hasSkillTag('nothunder')) return 'zeroplayertarget';
|
||||
if(target.hasSkillTag('filterDamage',null,{
|
||||
player:player,
|
||||
card:lib.element.VCard({
|
||||
card:new lib.element.VCard({
|
||||
name:card.name,
|
||||
nature:'thunder'
|
||||
},[card])
|
||||
|
@ -4906,7 +4906,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
//护驾
|
||||
else if(!player.hasShan()&&game.hasPlayer(function(current){
|
||||
return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
|
||||
return current!=player&¤t.group=='wei'&¤t.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
|
||||
})) return 1;
|
||||
return -1;
|
||||
});
|
||||
|
@ -4940,7 +4940,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
//护驾
|
||||
else if(!player.hasShan()&&game.hasPlayer(function(current){
|
||||
return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
|
||||
return current!=player&¤t.group=='wei'&¤t.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
|
||||
})) return 'hujia';
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6510,7 +6510,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
true
|
||||
)) return 6.5 - get.value(card, player);
|
||||
if (Math.random() * target.countCards('hs') < 1 || player.needsToDiscard(-ui.selected.cards.length)) return 6 - get.value(card, player);
|
||||
if (Math.random() * target.countCards('hs') < 1 || player.needsToDiscard(0,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 6 - get.value(card, player);
|
||||
return 0;
|
||||
}
|
||||
return 6.3 - get.value(card);
|
||||
|
@ -11122,7 +11124,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
useShan:true,
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
let name='sha';
|
||||
let name;
|
||||
if(typeof card=='object'){
|
||||
if(card.viewAs) name=card.viewAs;
|
||||
else name=get.name(card);
|
||||
|
@ -11766,12 +11768,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.7;
|
||||
}
|
||||
else{
|
||||
num=0.5;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.7;
|
||||
else num=0.5;
|
||||
}
|
||||
if(player.hp>=4) return [1,num*2];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
@ -12108,7 +12106,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return player!=target;
|
||||
},
|
||||
ai1:function(card){
|
||||
if(get.attitude(_status.event.player,_status.currentPhase)<0&&_status.currentPhase.needsToDiscard()&&card.name!='du') return -1;
|
||||
if(card.name!='du'&&get.attitude(_status.event.player,_status.currentPhase)<0&&_status.currentPhase.needsToDiscard()) return -1;
|
||||
for(var i=0;i<ui.selected.cards.length;i++){
|
||||
if(get.type(ui.selected.cards[i])==get.type(card)||(ui.selected.cards[i].name=='du'&&card.name!='du')) return -1;
|
||||
}
|
||||
|
@ -13665,12 +13663,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.7;
|
||||
}
|
||||
else{
|
||||
num=0.5;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.7;
|
||||
else num=0.5;
|
||||
}
|
||||
if(player.hp>=4) return [1,num*2];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
|
|
@ -5162,10 +5162,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
return -1.5;
|
||||
}();
|
||||
if(!isLink && target.mayHaveShan() && !player.hasSkillTag('directHit_ai', true, {
|
||||
if(!isLink && target.mayHaveShan(player,'use') && !player.hasSkillTag('directHit_ai', true, {
|
||||
target: target,
|
||||
card: card
|
||||
}, true)) return eff / 1.2;
|
||||
}, true)) return eff * 0.6;
|
||||
return eff;
|
||||
}
|
||||
},
|
||||
|
@ -6954,7 +6954,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
else{
|
||||
var target=trigger.target;
|
||||
if(trigger.targets.length>1||target.mayHaveShan()) return 0;
|
||||
if(trigger.targets.length>1||target.mayHaveShan(player,'use')) return 0;
|
||||
}
|
||||
var num=trigger.getParent().baseDamage;
|
||||
var map=trigger.getParent().customArgs,id=target.playerid;
|
||||
|
@ -14460,12 +14460,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(num>=delta) return 'zeroplayertarget';
|
||||
}
|
||||
else if(get.tag(card,'respondShan')>0){
|
||||
if(current<0&&used==target.getAttackRange()-1&&target.mayHaveShan()){
|
||||
if(current<0&&used==target.getAttackRange()-1&&target.mayHaveShan(player)){
|
||||
return 0.6;
|
||||
}
|
||||
}
|
||||
else if(get.tag(card,'respondSha')>0){
|
||||
if(current<0&&used==target.getAttackRange()-1&&target.mayHaveSha()){
|
||||
if(current<0&&used==target.getAttackRange()-1&&target.mayHaveSha(player)){
|
||||
return 0.6;
|
||||
}
|
||||
}
|
||||
|
@ -15204,17 +15204,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return target!=player;
|
||||
}).set('ai',function(target){
|
||||
if(target.hasJudge('lebu')) return 0;
|
||||
var att=get.attitude(_status.event.player,target);
|
||||
let att=get.attitude(_status.event.player,target),name=_status.event.cards[0].name;
|
||||
if(att<3) return 0;
|
||||
if(target.hasSkillTag('nogain')) att/=10;
|
||||
if(target.hasSha()&&_status.event.sha){
|
||||
att/=5;
|
||||
}
|
||||
if(event.wuxie&&target.needsToDiscard(1)){
|
||||
att/=5;
|
||||
}
|
||||
if(name==='sha'&&target.hasSha()) att/=5;
|
||||
if(name==='wuxie'&&target.needsToDiscard(_status.event.cards)) att/=5;
|
||||
return att/(1+get.distance(player,target,'absolute'));
|
||||
}).set('sha',trigger.cards[0].name=='sha').set('wuxie',trigger.cards[0].name=='wuxie');
|
||||
}).set('cards',trigger.cards);
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
player.logSkill('yingyuan',result.targets[0]);
|
||||
|
@ -15288,19 +15284,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(_status.event.du) return -get.value(card,player,'raw');
|
||||
else if(_status.event.shuimeng){
|
||||
if(cardname=='wuzhong'){
|
||||
if(player.needsToDiscard(2-ui.selected.cards.length)){
|
||||
return 10-get.value(card,player,'raw');
|
||||
}
|
||||
if(player.needsToDiscard(2,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 10-get.value(card,player,'raw');
|
||||
}
|
||||
else if(cardname=='guohe'){
|
||||
if(player.needsToDiscard(-1-ui.selected.cards.length)){
|
||||
return 10-get.value(card,player,'raw');
|
||||
}
|
||||
if(player.needsToDiscard(-1,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 10-get.value(card,player,'raw');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else if(cardname=='lebu'){
|
||||
if(player.needsToDiscard(1-ui.selected.cards.length)){
|
||||
if(player.needsToDiscard(1,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})){
|
||||
return 8-get.value(card,player,'raw');
|
||||
}
|
||||
else{
|
||||
|
@ -17480,9 +17478,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return 20-num;
|
||||
}
|
||||
else{
|
||||
if(_status.event.player.needsToDiscard()){
|
||||
return 7-num;
|
||||
}
|
||||
if(_status.event.player.needsToDiscard()) return 7-num;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
|
|
|
@ -5015,7 +5015,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})) return 3;
|
||||
return Math.sqrt(target.countCards('he'));
|
||||
}
|
||||
if(target.mayHaveShan()&&player.countCards('hs',function(card){
|
||||
if(target.mayHaveShan(player,'use')&&player.countCards('hs',function(card){
|
||||
return !ui.selected.cards.includes(card)&&get.name(card)=='sha'&&player.canUse(card,target)&&get.effect(target,card,player,player)!=0;
|
||||
})) return -Math.sqrt(Math.abs(get.attitude(player,target)))/2;
|
||||
return 0.1;
|
||||
|
@ -5347,7 +5347,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.addSkill('mouni2');
|
||||
player.chooseTarget(get.prompt2('mouni'),lib.filter.notMe).set('ai',function(target){
|
||||
var player=_status.event.player,cards=player.getCards('h','sha');
|
||||
if(get.attitude(player,target)>=0||!player.canUse(cards[0],target,false)||(!player.hasJudge('lebu')&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
|
||||
if(get.attitude(player,target)>=0||!player.canUse(cards[0],target,false)||(!player.hasJudge('lebu')&&target.mayHaveShan(player,'use')&&!player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:cards[0],
|
||||
},true))) return 0;
|
||||
|
|
|
@ -384,7 +384,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}).set('goon',function(){
|
||||
var d1=true;
|
||||
if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')) d1=false;
|
||||
if(!target.mayHaveShan()||player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
@ -2985,7 +2985,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
expose:0.2,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.countCards('h')<=target.hp&&!target.mayHaveShan()&&get.effect(target,{name:'sha',isCard:true},player,player)>0) return -1;
|
||||
if(target.countCards('h')<=target.hp&&!target.mayHaveShan(player,'use')&&get.effect(target,{name:'sha',isCard:true},player,player)>0) return -1;
|
||||
else if(target.countCards('h')>target.hp&&target.hp>2&&target.hasShan()) return 1;
|
||||
return 0;
|
||||
},
|
||||
|
@ -6572,7 +6572,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var player=_status.event.player;
|
||||
if(player.hp+player.countCards('hs',{name:['tao','jiu']})<=1) return -1;
|
||||
var num=1;
|
||||
if((!target.mayHaveShan()||player.hasSkillTag('directHit_ai',true,{
|
||||
if((!target.mayHaveShan(player,'use')||player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:{name:'sha'},
|
||||
},true))&&!target.hasSkillTag('filterDamage',null,{
|
||||
|
@ -11090,7 +11090,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var d1=true;
|
||||
if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false;
|
||||
for(var target of trigger.targets){
|
||||
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
@ -13290,7 +13290,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var d1=true;
|
||||
if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false
|
||||
for(var target of trigger.targets){
|
||||
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
|
||||
target:target,
|
||||
card:trigger.card,
|
||||
},true)){
|
||||
|
|
|
@ -277,7 +277,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filter:function(event,player){
|
||||
if(!player.getHp()) return false;
|
||||
if(event.name=='loseAsync'&&event.type!='gain') return false;
|
||||
var cards1=event.getl(player).cards2,cards2=cards=event.getg(player);
|
||||
var cards1=event.getl(player).cards2,cards2=event.getg(player);
|
||||
return (!player.hasSkill('dcsbmengmou_true')&&game.hasPlayer(function(current){
|
||||
if(current==player) return false;
|
||||
var cardsx=event.getg(current);
|
||||
|
@ -3334,10 +3334,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(num>0&&!player._dczhizhe_mod&&get.itemtype(card)==='card'&&card.hasGaintag('dczhizhe')){
|
||||
if(player.canIgnoreHandcard(card)) return Infinity;
|
||||
player._dczhizhe_mod=true;
|
||||
if(player.hp<3&&player.needsToDiscard(player.countCards('h',(cardx)=>{
|
||||
if(player.canIgnoreHandcard(cardx)||get.useful(cardx)>6) return true;
|
||||
return false;
|
||||
}))) return num*1.5;
|
||||
if(player.hp<3&&player.needsToDiscard(0,(i,player)=>{
|
||||
return !player.canIgnoreHandcard(i)&&get.useful(i)>6;
|
||||
})) return num*1.5;
|
||||
return num*10;
|
||||
}
|
||||
}
|
||||
|
@ -3525,12 +3524,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.5;
|
||||
}
|
||||
else{
|
||||
num=0.3;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.5;
|
||||
else num=0.3;
|
||||
}
|
||||
if(target.hp>=4) return [1,num*2];
|
||||
if(target.hp==3) return [1,num*1.5];
|
||||
|
@ -3844,12 +3839,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!target.hasFriend()) return;
|
||||
var num=1;
|
||||
if(get.attitude(player,target)>0){
|
||||
if(player.needsToDiscard()){
|
||||
num=0.7;
|
||||
}
|
||||
else{
|
||||
num=0.5;
|
||||
}
|
||||
if(player.needsToDiscard()) num=0.7;
|
||||
else num=0.5;
|
||||
}
|
||||
if(target.hp==2&&target.hasFriend()) return [1,num*1.5];
|
||||
if(target.hp>=2) return [1,num];
|
||||
|
@ -8268,7 +8259,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(current==player||current.countCards('he')==0) return false;
|
||||
return get.effect(current,{name:'guohe_copy2'},player,player)+get.effect(current,{name:'sha'},player,player)>0;
|
||||
})){
|
||||
if(get.position(card)=='h'&&player.needsToDiscard()>ui.selected.cards.length) return 7+1/Math.max(1,get.value(card));
|
||||
if(get.position(card)=='h'&&player.needsToDiscard(0,(i,player)=>{
|
||||
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return 7+1/Math.max(1,get.value(card));
|
||||
return 7-get.value(card);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -653,9 +653,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.chooseTarget('将'+get.translation(result.links)+'交给一名角色',true).ai=function(target){
|
||||
var att=get.attitude(player,target)/Math.sqrt(target.countCards('h')+1);
|
||||
if(result.links.length>1){
|
||||
if(target==player&&target.needsToDiscard(result.links.length)>1){
|
||||
return att/5;
|
||||
}
|
||||
if(target==player&&target.needsToDiscard(result.links)>1) return att/5;
|
||||
return att;
|
||||
}
|
||||
else{
|
||||
|
@ -1241,7 +1239,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
return false;
|
||||
}).ai=function(target){
|
||||
var num=0,eff=0,damaged=false;
|
||||
var use=[],eff=0,damaged=false;
|
||||
for(var i=0;i<hs.length;i++){
|
||||
if(get.info(hs[i]).multitarget) continue;
|
||||
var hef;
|
||||
|
@ -1252,7 +1250,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
hef=get.effect(target,hs[i],player,player);
|
||||
}
|
||||
if(lib.filter.targetEnabled2(hs[i],player,target)&&hef>0){
|
||||
num++;
|
||||
use.push(hs[i]);
|
||||
if(get.attitude(player,target)>0){
|
||||
hef/=1.5;
|
||||
if(get.tag(hs[i],'damage')){
|
||||
|
@ -1262,9 +1260,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
eff+=hef;
|
||||
}
|
||||
}
|
||||
if(!player.needsToDiscard(-num)){
|
||||
return eff;
|
||||
}
|
||||
if(!player.needsToDiscard(0,(i,player)=>{
|
||||
return !use.includes(i)&&!player.canIgnoreHandcard(i);
|
||||
})) return eff;
|
||||
return 0;
|
||||
};
|
||||
'step 1'
|
||||
|
|
|
@ -1371,19 +1371,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(target==player) return false;
|
||||
return target.countCards('h')>player.countCards('h')||Math.max(0,target.hp)>Math.max(0,player.hp);
|
||||
}).set('ai',function(target){
|
||||
var att=get.attitude(_status.event.player,target);
|
||||
let att=get.attitude(_status.event.player,target),name=_status.event.cards[0].name;
|
||||
if(att<3) return 0;
|
||||
if(target.hasJudge('lebu')){
|
||||
att/=5;
|
||||
}
|
||||
if(target.hasSha()&&_status.event.sha){
|
||||
att/=5;
|
||||
}
|
||||
if(_status.event.wuxie&&target.needsToDiscard(1)){
|
||||
att/=5;
|
||||
}
|
||||
if(target.hasJudge('lebu')) att/=5;
|
||||
if(name==='sha'&&target.hasSha()) att/=5;
|
||||
if(name==='wuxie'&&target.needsToDiscard(_status.event.cards)) att/=5;
|
||||
return att/(1+get.distance(player,target,'absolute'));
|
||||
}).set('sha',trigger.cards[0].name=='sha').set('wuxie',trigger.cards[0].name=='wuxie');
|
||||
}).set('cards',trigger.cards);
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
var list=[];
|
||||
|
|
|
@ -2101,7 +2101,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(num>2) return true;
|
||||
var card=trigger.card;
|
||||
if(get.tag(card,'damage')&&player.hp<=trigger.getParent().baseDamage&&(!get.tag(card,'respondShan')||!player.hasShan())&&(!get.tag(card,'respondSha')||!player.hasSha())) return true;
|
||||
var source=_status.currentPhase,todis=(source.countCards('h')-Math.max(0,source.needsToDiscard()));
|
||||
var source=_status.currentPhase,todis=source.countCards('h')-source.needsToDiscard();
|
||||
if(todis<=Math.max(Math.min(2+(source.hp<=1?1:0),player.countCards('he',function(card){
|
||||
return get.value(card,player)<Math.max(5.5,8-todis)
|
||||
})),player.countCards('he',function(card){
|
||||
|
@ -2235,7 +2235,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
case 2:{
|
||||
var num=1.3;
|
||||
if(event.card.name=='sha'&&event.targets.filter(function(current){
|
||||
if(current.mayHaveShan()&&get.attitude(player,current)<=0){
|
||||
if(current.mayHaveShan(player,'use')&&get.attitude(player,current)<=0){
|
||||
if(current.hasSkillTag('useShan')) num=1.9;
|
||||
return true;
|
||||
}
|
||||
|
@ -6980,8 +6980,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
effect:{
|
||||
player:function(card,player,target){
|
||||
if(_status.currentPhase!=player) return;
|
||||
if(card.name=='sha'&&!player.needsToDiscard()&&
|
||||
!player.getExpansions('chunlao').length&&target.hp>1){
|
||||
if(card.name=='sha'&&!player.needsToDiscard()&&!player.getExpansions('chunlao').length&&target.hp>1){
|
||||
return 'zeroplayertarget';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3528,7 +3528,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
]).set('prompt',get.prompt('gzliegong',trigger.target)).setHiddenSkill('gzliegong').set('ai',function(){
|
||||
var player=_status.event.player,target=_status.event.getTrigger().target;
|
||||
if(get.attitude(player,target)>0) return 2;
|
||||
return target.mayHaveShan()?1:0;
|
||||
return target.mayHaveShan(player,'use')?1:0;
|
||||
});
|
||||
'step 1'
|
||||
if(result.control!='cancel2'){
|
||||
|
@ -10654,7 +10654,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
goon=false;
|
||||
}
|
||||
else if(trigger.card.name=='sha'){
|
||||
if(trigger.target.mayHaveShan()||trigger.target.hp>=3){
|
||||
if(trigger.target.mayHaveShan(player,'use')||trigger.target.hp>=3){
|
||||
goon=false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7713,20 +7713,25 @@ export class Player extends HTMLDivElement {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
needsToDiscard(filter, add) {
|
||||
needsToDiscard(add, filter, pure) {
|
||||
/**
|
||||
* filter: typeof 'number' -> 额外摸等量牌(逻辑上)
|
||||
* typeof 'function' -> 只考虑符合函数筛选的牌
|
||||
* add: 额外获得这张/些牌(逻辑上)
|
||||
* add: (逻辑上)同时考虑“获得”的这张/些牌
|
||||
* filter(function): 代替默认策略进行筛选
|
||||
* pure: 返回值可以为负数
|
||||
*/
|
||||
let cards = this.getCards('h', card => !this.canIgnoreHandcard(card)), num = 0;
|
||||
if (get.itemtype(add) === 'cards') cards.addArray(add);
|
||||
let cards = this.getCards('h'), num = 0;
|
||||
if (typeof add === 'number') num = add;
|
||||
else if (get.itemtype(add) === 'cards') for (let i of add) {
|
||||
cards.push(add);
|
||||
}
|
||||
else if (get.itemtype(add) === 'card') cards.push(add);
|
||||
if (typeof filter === 'number') num = filter;
|
||||
else if (typeof filter === 'function') cards = cards.filter(card => {
|
||||
return filter(card);
|
||||
if (typeof filter !== 'function') filter = (card, player) => !player.canIgnoreHandcard(card);
|
||||
cards = cards.filter(card => {
|
||||
return filter(card, this, cards);
|
||||
});
|
||||
return Math.max(0, num + cards.length - this.getHandcardLimit());
|
||||
num += cards.length - this.getHandcardLimit();
|
||||
if (pure) return num;
|
||||
return Math.max(0, num);
|
||||
}
|
||||
distanceTo(target, method) {
|
||||
return get.distance(this, target, method);
|
||||
|
@ -7899,12 +7904,12 @@ export class Player extends HTMLDivElement {
|
|||
else return true;
|
||||
}
|
||||
if (get.itemtype(viewer) !== 'player') viewer = _status.event.player;
|
||||
let cards, selected = get.copy(ui.selected.cards);
|
||||
let cards, selected = [];
|
||||
if (get.itemtype(ignore) === 'cards') selected.addArray(ignore);
|
||||
else if (get.itemtype(ignore) === 'card') selected.add(ignore);
|
||||
if (this === viewer || get.itemtype(viewer) == 'player') cards = this.getKnownCards(viewer);
|
||||
else cards = this.getShownCards();
|
||||
count += cards.filter(card => {
|
||||
cards = cards.filter(card => {
|
||||
if (selected.includes(card)) return false;
|
||||
let name = get.name(card, this);
|
||||
if (name == 'sha' || name == 'hufu' || name == 'yuchanqian') {
|
||||
|
@ -7913,9 +7918,10 @@ export class Player extends HTMLDivElement {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}).length;
|
||||
});
|
||||
count += cards.length;
|
||||
if (count && rvt !== 'count') return true;
|
||||
let hs = this.getCards('hs').filter(i => !cards.includes(i) && !selected.includes(i)).length;
|
||||
let hs = this.getCards('hs').filter(i => !cards.includes(i)).length;
|
||||
if (!hs) {
|
||||
if (rvt === 'count') return count;
|
||||
return false;
|
||||
|
@ -7941,12 +7947,12 @@ export class Player extends HTMLDivElement {
|
|||
else return true;
|
||||
}
|
||||
if (get.itemtype(viewer) !== 'player') viewer = _status.event.player;
|
||||
let cards, selected = get.copy(ui.selected.cards);
|
||||
let cards, selected = [];
|
||||
if (get.itemtype(ignore) === 'cards') selected.addArray(ignore);
|
||||
else if (get.itemtype(ignore) === 'card') selected.add(ignore);
|
||||
if (this === viewer || get.itemtype(viewer) == 'player') cards = this.getKnownCards(viewer);
|
||||
else cards = this.getShownCards();
|
||||
count += cards.filter(card => {
|
||||
cards = cards.filter(card => {
|
||||
if (selected.includes(card)) return false;
|
||||
let name = get.name(card, this);
|
||||
if (name === 'shan' || name === 'hufu') {
|
||||
|
@ -7955,9 +7961,10 @@ export class Player extends HTMLDivElement {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}).length;
|
||||
});
|
||||
count += cards.length;
|
||||
if (count && rvt !== 'count') return true;
|
||||
let hs = this.getCards('hs').filter(i => !cards.includes(i) && !selected.includes(i)).length;
|
||||
let hs = this.getCards('hs').filter(i => !cards.includes(i)).length;
|
||||
if (!hs) {
|
||||
if (rvt === 'count') return count;
|
||||
return false;
|
||||
|
|
|
@ -10311,7 +10311,7 @@ export class Library extends Uninstantable {
|
|||
if (game.hasPlayer(current => {
|
||||
if (!player.canUse(card, current)) return false;
|
||||
const storage = player.storage, zhibi = storage.zhibi;
|
||||
return (zhibi && !zhibi.includes(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan() && player.hasSkill('jiu');
|
||||
return (zhibi && !zhibi.includes(current) || get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1)) && current.mayHaveShan(player, 'use') && player.hasSkill('jiu');
|
||||
})) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -10382,7 +10382,7 @@ export class Library extends Uninstantable {
|
|||
if (game.hasPlayer(current => {
|
||||
if (!player.canUse(card, current)) return false;
|
||||
const storage = player.storage, zhibi = storage.zhibi;
|
||||
return (zhibi && !zhibi.includes(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan();
|
||||
return (zhibi && !zhibi.includes(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan(player, 'use');
|
||||
})) return get.order(card, player) + 0.5;
|
||||
}
|
||||
else if (cardName == 'tao' && player.hp <= 2 && player.getDamagedHp() >= 2) return get.order(card, player) + 0.5;
|
||||
|
|
Loading…
Reference in New Issue