ai优化,bugfix
This commit is contained in:
parent
270499d660
commit
2920ebf9c7
|
@ -1531,7 +1531,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
target:target,
|
target:target,
|
||||||
card:card
|
card:card
|
||||||
})) return;
|
})) return;
|
||||||
if(get.tag(card,'natureDamage')) return 'zerotarget';
|
if(get.tag(card,'natureDamage')) return 'zeroplayertarget';
|
||||||
if(card.name=='tiesuo'){
|
if(card.name=='tiesuo'){
|
||||||
return [0,0];
|
return [0,0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2216,7 +2216,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
effect:{
|
effect:{
|
||||||
target:function(card,player,target){
|
target:function(card,player,target){
|
||||||
if(target.hasSkillTag('unequip2')) return;
|
if(typeof card!=='object'||target.hasSkillTag('unequip2')) return;
|
||||||
if(player.hasSkillTag('unequip',false,{
|
if(player.hasSkillTag('unequip',false,{
|
||||||
name:card?card.name:null,
|
name:card?card.name:null,
|
||||||
target:target,
|
target:target,
|
||||||
|
@ -2226,7 +2226,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
target:target,
|
target:target,
|
||||||
card:card
|
card:card
|
||||||
})) return;
|
})) return;
|
||||||
if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget';
|
if(card.name=='sha'&&get.color(card)=='black') return 'zeroplayertarget';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -594,46 +594,43 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
effect:{
|
effect:{
|
||||||
player:function(card,player,target){
|
player:function(card,player,target){
|
||||||
if(typeof card!='object'||!target||get.name(card)!='sha'&&(get.type(card)!='trick'||(get.color(card)!='black'&&!get.tag(card,'damage')))) return;
|
if(typeof card!=='object'||!target||get.name(card)!=='sha'&&(get.type(card)!=='trick'||get.color(card)!=='black'&&!get.tag(card,'damage'))) return;
|
||||||
var info=get.info(card);
|
if(!target.hasSkill('heiguangkai_skill')||target.hasSkillTag('unequip2')||player.hasSkillTag('unequip',false,{
|
||||||
var targets=[];
|
name:card?card.name:null,
|
||||||
|
target:target,
|
||||||
|
card:card,
|
||||||
|
})||player.hasSkillTag('unequip_ai',false,{
|
||||||
|
name:card?card.name:null,
|
||||||
|
target:target,
|
||||||
|
card:card,
|
||||||
|
})) return;
|
||||||
|
let targets=[],evt=_status.event.getParent('useCard');
|
||||||
targets.addArray(ui.selected.targets);
|
targets.addArray(ui.selected.targets);
|
||||||
var evt=_status.event.getParent('useCard');
|
|
||||||
if(evt&&evt.card==card) targets.addArray(evt.targets);
|
if(evt&&evt.card==card) targets.addArray(evt.targets);
|
||||||
if(targets.length){
|
if(targets.length){
|
||||||
if(!targets.contains(target)){
|
if(targets.length>1||!targets.includes(target)) return 'zeroplayertarget';
|
||||||
if(target.hasSkill('heiguangkai_skill')&&!target.hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{
|
return;
|
||||||
name:card?card.name:null,
|
|
||||||
target:target,
|
|
||||||
card:card,
|
|
||||||
})&&!player.hasSkillTag('unequip_ai',false,{
|
|
||||||
name:card?card.name:null,
|
|
||||||
target:target,
|
|
||||||
card:card,
|
|
||||||
})) return 'zerotarget';
|
|
||||||
}
|
}
|
||||||
else{
|
let info=get.info(card);
|
||||||
if(targets.length>1) return;
|
if(!info||info.notarget||!info.filterTarget) return;
|
||||||
if(info.selectTarget!=-1&&targets[0].hasSkill('heiguangkai_skill')&&!targets[0].hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{
|
let range,select=get.copy(info.selectTarget),filter;
|
||||||
name:card?card.name:null,
|
if(select===undefined) range=[1,1];
|
||||||
target:targets[0],
|
else if(typeof select==='number') range=[select,select];
|
||||||
card:card,
|
else if(get.itemtype(select)==='select') range=select;
|
||||||
})&&!player.hasSkillTag('unequip_ai',false,{
|
else if(typeof select==='function') range=select(card,player);
|
||||||
name:card?card.name:null,
|
if(info.singleCard) range=[1,1];
|
||||||
target:targets[0],
|
game.checkMod(card,player,range,'selectTarget',player);
|
||||||
card:card,
|
if(range[1]<-1) range=[1, 1];
|
||||||
})) return 'zerotarget';
|
else if(range[0]<0){
|
||||||
|
if(info.filterTarget===true) filter=game.players.length;
|
||||||
|
else filter=game.countPlayer(current=>{
|
||||||
|
return info.filterTarget(card,player,current);
|
||||||
|
});
|
||||||
|
range=[filter,filter];
|
||||||
}
|
}
|
||||||
}
|
if(!range) return;
|
||||||
if(target.hasSkill('heiguangkai_skill')&&!target.hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{
|
if(range[0]>1&&range[1]>1) return 'zeroplayertarget';
|
||||||
name:card?card.name:null,
|
return [1,0,0.7,0];
|
||||||
target:target,
|
|
||||||
card:card,
|
|
||||||
})&&!player.hasSkillTag('unequip_ai',false,{
|
|
||||||
name:card?card.name:null,
|
|
||||||
target:target,
|
|
||||||
card:card,
|
|
||||||
})) return [1,0,0.7,0];
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -841,15 +841,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
nothunder:true,
|
nothunder:true,
|
||||||
effect:{
|
effect:{
|
||||||
target:function(card,player,target,current){
|
target:function(card,player,target,current){
|
||||||
|
if(target.hasSkillTag('unequip2')) return;
|
||||||
if(player.hasSkillTag('unequip',false,{
|
if(player.hasSkillTag('unequip',false,{
|
||||||
name:card?card.name:null,
|
name:card?card.name:null,
|
||||||
target:player,
|
target:player,
|
||||||
card:card
|
card:card
|
||||||
|
})||player.hasSkillTag('unequip_ai',false,{
|
||||||
|
name:card?card.name:null,
|
||||||
|
target:target,
|
||||||
|
card:card
|
||||||
})) return;
|
})) return;
|
||||||
if(get.tag(card,'natureDamage')) return 'zerotarget';
|
if(card.name=='tiesuo'||get.tag(card,'natureDamage')) return 'zeroplayertarget';
|
||||||
if(card.name=='tiesuo'){
|
|
||||||
return [0,0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12941,7 +12941,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
effect:{
|
effect:{
|
||||||
target:function(card,player,target){
|
target:function(card,player,target){
|
||||||
if(target.hasSkillTag('unequip2')) return;
|
if(typeof card!=='object'||target.hasSkillTag('unequip2')) return;
|
||||||
if(player.hasSkillTag('unequip',false,{
|
if(player.hasSkillTag('unequip',false,{
|
||||||
name:card?card.name:null,
|
name:card?card.name:null,
|
||||||
target:player,
|
target:player,
|
||||||
|
@ -12951,7 +12951,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
target:player,
|
target:player,
|
||||||
card:card
|
card:card
|
||||||
})) return;
|
})) return;
|
||||||
if(card.name=='sha'&&['spade','club','heart'].contains(get.suit(card))) return 'zerotarget';
|
if(card.name=='sha'&&['spade','club','heart'].contains(get.suit(card))) return 'zeroplayertarget';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue