优化手杀王粲【善檄】、手杀王双【善械】ai

This commit is contained in:
157 2023-09-30 21:09:42 +08:00 committed by GitHub
parent 44607e8abc
commit e740d18896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 70 additions and 1 deletions

View File

@ -1399,7 +1399,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:9,
result:{player:1},
},
group:'shanxie_exclude',
group:['shanxie_exclude','shanxie_shan'],
subSkill:{
exclude:{
trigger:{global:'useCard'},
@ -1414,6 +1414,48 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
trigger.all_excluded=true;
},
sub:true
},
shan:{
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return event.target.isAlive()&&event.card.name=='sha';
},
silent:true,
content:function(){
trigger.target.addTempSkill('shanxie_banned');
trigger.target.storage.shanxie_banned={
card:trigger.card,
num:player.getAttackRange()*2
};
},
sub:true
},
banned:{
init:function(player){
player.storage.shanxie_banned={};
},
onremove:function(player){
delete player.storage.shanxie_banned;
},
trigger:{global:'useCardEnd'},
filter:function(event,player){
return event.card==player.storage.shanxie_banned.card;
},
silent:true,
content:function(){
player.removeSkill('shanxie_banned');
},
ai:{
effect:{
player:function(card,player,target){
if(get.name(card)=='shan'){
let num=get.number(card);
if(!num||num<=player.storage.shanxie_banned.num) return 'zeroplayertarget';
}
}
}
}
},
},
},
@ -5808,6 +5850,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
spshanxi:{
audio:2,
init:function(player){
game.addGlobalSkill('spshanxi_bj');
},
onremove:function(player){
game.removeGlobalSkill('spshanxi_bj');
},
trigger:{player:'phaseUseBegin'},
direct:true,
filter:function(event,player){
@ -5867,6 +5915,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else trigger.player.give(result.cards,player);
},
},
spshanxi_bj:{
charlotte:true,
trigger:{player:'dieAfter'},
filter:function(event,player){
return !game.hasPlayer(current=>current.hasSkill('spshanxi_suoming'));
},
content:function(){
game.removeGlobalSkill('spshanxi_bj');
},
ai:{
effect:{
target:function(card,player,target){
let suoming=game.findPlayer(current=>current.hasSkill('spshanxi_suoming'));
if(suoming&&_status.event&&target===_status.event.dying&&target.hasMark('spshanxi')){
if(target.countCards('he')<2) return 'zerotarget';
return [1,get.attitude(target,suoming)>0?0:-1.2];
}
}
}
}
},
shameng:{
audio:2,
enable:'phaseUse',