Merge pull request #657 from PZ157/PR-Branch

部分技能ai优化
This commit is contained in:
Spmario233 2023-11-19 23:32:20 +08:00 committed by GitHub
commit 12926b0c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -8149,8 +8149,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return ui.create.dialog('义烈',[list,'vcard'],'hidden')
},
check:function(button){
let player=_status.event.player,hs=player.getCards('h',card=>{
return get.name(card)!==button.link[2]&&(!button.link[3]||get.hasNature(card,button.link[3]));
}),bool=false,map={};
for(let i of hs){
let color=get.color(i);
if(!map[color]) map[color]=true;
else{
bool=true;
break;
}
}
if(!bool) return 0;
if(button.link[2]=='shan') return 3;
var player=_status.event.player;
if(button.link[2]=='jiu'){
if(player.getUseValue({name:'jiu'})<=0) return 0;
if(player.countCards('h','sha')) return player.getUseValue({name:'jiu'});
@ -8171,7 +8182,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
position:'hs',
complexCard:true,
check:(card)=>8-get.value(card),
check:(card)=>{
if(get.name(card)===lib.skill.yilie_backup.viewAs.name&&(!lib.skill.yilie_backup.viewAs.nature||game.hasNature(card,lib.skill.yilie_backup.viewAs.nature))) return -1;
return 8-get.value(card);
},
popname:true,
viewAs:{
name:links[0][2],

View File

@ -10490,9 +10490,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
if(red>2&&black>2) return 4-get.value(card);
if(red==0||black==0) return 8-get.value(card);
var color=get.color(red);
var color=get.color(card);
if(black<=red) return ((color=='black'&&get.position(card)=='h')?8:4)-get.value(card);
return ((color=='red'&&get.position(card)=='h'?8:4))-get.value(card);
return (color=='red'&&get.position(card)=='h'?8:4)-get.value(card);
},
content:function(){
player.draw();