Merge pull request #377 from PZ157/PR-Branch

bug修复,ai优化
This commit is contained in:
Spmario233 2023-09-24 20:59:35 +08:00 committed by GitHub
commit e517d67fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 11 deletions

View File

@ -3045,14 +3045,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect:{
target:function(card,player,target,current){
if(get.tag(card,'damage')){
if(player.hp==target.hp) return;
if(player.hp==target.hp||lib.linked.contains(get.nature(card))) return;
var cards=[card];
if(card.cards&&card.cards.length) cards.addArray(card.cards);
if(ui.selected.cards.length) cards.addArray(ui.selected.cards);
if(player.countCards('h',function(card){
return !cards.contains(card);
})==target.countCards('h')) return;
return 'zerotarget';
return 'zeroplayertarget';
}
},
},
@ -4707,6 +4707,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(num==0) player.awakenSkill('recuorui');
player.gainPlayerCard(target,true,'h');
},
ai:{
order:10,
result:{
player:1,
target:function(player,target){
if(target.hasSkillTag('noh')) return 0;
return -1;
}
}
}
},
reliewei:{
audio:'liewei',
@ -8948,10 +8958,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
ai:{
order:1,
result:{
target:0,
order:function(){
var player=_status.event.player,num=0;
for(var i=1;i<6;i++){
num+=player.countEquipableSlot(i);
}
if(num<=2) return 6;
if(player.hp<=2||!game.hasPlayer((current)=>{
if(player==current||get.attitude(player,current)<0||current.hp<=1) return false;
return current.hp>2||current.countCards('hs')>2;
})) return 1;
return 0;
},
result:{
target:function(player,target){
var num=0;
for(var i=1;i<6;i++){
num+=target.countEquipableSlot(i);
}
return num;
}
}
},
mark:true,
intro:{

View File

@ -2558,7 +2558,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=list[0],count=list[1]||1;
event.target=target; event.count=count;
'step 1'
if(player.countMark('twqiangling')>=2){
if(player.countMark('twlinglu_order')>=2){
game.log(player,'成功完成了',target,'发布的','#g【令戮】','强令');
player.popup('强令成功','wood');
player.draw(2);
@ -2569,7 +2569,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.popup('强令失败','fire');
}
'step 2'
if(player.countMark('twqiangling')>=2){
if(player.countMark('twlinglu_order')>=2){
game.delayx();
}
else{

View File

@ -523,6 +523,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
},
ai:{
effect:{
target:function(card,player,target,current){
if(get.type(card)=='equip'&&!get.cardtag(card,'gifts')&&game.hasPlayer(function(current){
return target.canUse('sha',current);
})) return [1,1.5];
}
},
noe:true,
reverseEquip:true,
skillTagFilter:function(player,tag,arg){
if(tag=='noe') return player.countCards('e')==player.hp+1;
return game.hasPlayer(function(current){
return player.canUse('sha',current);
});
}
}
},
xinfu_jijun:{
ai:{
@ -810,6 +827,31 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.addToExpansion(cards,player,'give').gaintag.add('xinfu_zengdao2');
target.addSkill('xinfu_zengdao2');
},
ai:{
order:function(){
var player=_status.event.player,num=0;
if(player.hasCard((card)=>get.value(card,player)<0,'e')) return 9;
for(var i=1;i<6;i++){
num+=player.countEquipableSlot(i);
}
if(num<=2) return 9;
var targets=player.getStorage('xinfu_weilu_recover'),num=0;
if(player.hp<=2||!game.hasPlayer((current)=>{
if(player==current||get.attitude(player,current)<0||current.hp<=1) return false;
for(var arr of targets){
if(current==arr[0]) break;
}
return current.hp>2||current.countCards('hs')>2;
})) return 1;
return 0;
},
result:{
target:function(player,target){
if(target.hasValueTarget({name:'sha',isCard:true})) return ui.selected.cards.length;
return 0;
}
}
}
},
xinfu_zengdao2:{
trigger:{source:'damageBegin1'},

View File

@ -11532,6 +11532,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
miji:{
audio:2,
mod:{
aiOrder:function(player,card,num){
if(num>0&&_status.event&&_status.event.type==='phase'&&get.tag(card,'recover')){
if(player.needsToDiscard()) return num/3;
return 0;
}
}
},
trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){
return player.hp<player.maxHp;
@ -11570,13 +11578,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
ai:{
threaten:function(player,target){
if(target.hp==1) return 3;
if(target.hp==2) return 1.5;
return 0.5;
return 0.6+0.7*target.getDamagedHp();
},
effect:{
target:function(card,player,target){
if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0];
if(target.hp<=2&&get.tag(card,'damage')){
var num=1;
if(get.itemtype(player)=='player'&&player.hasSkillTag('damageBonus',false,{
target:target,
card:card
})&&!target.hasSkillTag('filterDamage',null,{
player:player,
card:card
})) num=2;
if(target.hp>num) return [1,1];
}
}
}
}