优化【武魂】【断肠】【业仇】【天佐】【灵策】【放权】ai

This commit is contained in:
157 2023-12-25 21:54:13 +08:00
parent 56a77baea1
commit f45dfd3126
4 changed files with 83 additions and 14 deletions

View File

@ -1992,6 +1992,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
},
ai:{
notemp:true,
maixie_defend:true,
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')||!target.hasFriend()) return;
let die=[],extra=[null,0],temp;
game.filterPlayer(i=>{
if(!i.hasMark('twwuhun')) return false;
temp=get.attitude(target,i);
if(temp<0) die.push(i);
else{
temp=Math.sqrt(att)*i.countMark('twwuhun');
if(!extra[0]||temp<extra[1]) extra=[i,temp];
}
});
if(extra[0]&&!die.length) die.push(extra[0]);
if(target.hp+target.hujia>1&&(!die.length||get.attitude(player,target)<=0)) die.add(player);
if(die.length) return [1,0,1,die.reduce((num,i)=>{
return num-=2*get.sgnAttitude(player,i);
},0)];
}
}
}
},
shouli:{
audio:2,
@ -3214,7 +3238,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
effect:{
target:function(card,player,target){
if(card&&card.name=='qizhengxiangsheng') return 'zerotarget';
if(card&&card.name=='qizhengxiangsheng') return 'zeroplayertarget';
},
}
},
@ -3293,18 +3317,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!map[id]) map[id]={};
map[id].qizheng_name=result.control;
map[id].qizheng_aibuff=get.attitude(player,target)>0;
},
}
},
},
},
lingce:{
audio:2,
init:(player)=>{
game.addGlobalSkill('lingce_global');
},
trigger:{global:'useCard'},
forced:true,
filter:function(event,player){
return (event.card.name=='qizhengxiangsheng'||get.zhinangs().contains(event.card.name)||player.getStorage('dinghan').contains(event.card.name))&&event.card.isCard&&event.cards.length==1;
},
content:function(){player.draw()},
content:function(){
player.draw();
},
subSkill:{
global:{
ai:{
effect:{
player:(card,player,target)=>{
let num=0,nohave=true;
game.countPlayer(i=>{
if(i.hasSkill('lingce')){
nohave=false;
if(i.isIn()&&lib.skill.lingce.filter({card:card},i)) num+=get.sgnAttitude(player,i);
}
},true);
if(nohave) game.removeGlobalSkill('lingce_global');
else return [1,0.8*num];
}
}
}
}
}
},
dinghan:{
audio:2,
@ -4710,8 +4758,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
group:'new_wuhun_die',
ai:{
threaten:0.01,
notemp:true,
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')||!target.hasFriend()) return;
if(player.hasSkillTag('jueqing',null,target)) return 1.7;
let die=[null,1],temp;
game.filterPlayer(i=>{
temp=i.countMark('new_wuhun');
if(i===player&&target.hp+target.hujia>1) temp++;
if(temp>=die[1]){
if(!die[0]) die=[i,temp];
else{
let att=get.attitude(player,i);
if(att<die[1]) die=[i,temp];
}
}
});
if(die[0]) return [1,0,1,-6*get.sgnAttitude(player,die[0])/Math.max(1,target.hp)];
}
}
},
marktext:'魇',
intro:{

View File

@ -10115,7 +10115,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
content:function(){
"step 0"
var fang=player.countMark('olfangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+1;
var fang=player.countMark('olfangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+2;
player.chooseBool(get.prompt2('olfangquan')).set('ai',function(){
if(!_status.event.fang) return false;
return game.hasPlayer(function(target){
@ -14298,7 +14298,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
content:function(){
"step 0"
var fang=player.countMark('fangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+1;
var fang=player.countMark('fangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.maxHp+1;
player.chooseBool(get.prompt2('refangquan')).set('ai',function(){
if(!_status.event.fang) return false;
return game.hasPlayer(function(target){

View File

@ -3439,11 +3439,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2"
if(result.bool){
player.chooseTarget(true,'请选择进行额外回合的目标角色',lib.filter.notMe).ai=function(target){
if(target.hasJudge('lebu')) return -1;
if(get.attitude(player,target)>4){
if(target.hasJudge('lebu')||get.attitude(player,target)<=0) return -1;
if(target.isTurnedOver()) return 0.18;
return get.threaten(target)/Math.sqrt(target.hp+1)/Math.sqrt(target.countCards('h')+1);
}
return -1;
};
}
else event.finish();
@ -4154,7 +4152,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect:{
target:function(card,player,target,current){
if(!target.hasFriend()) return;
if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-2];
if(target.hp<=1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return 3;
return [1,0,0,-3*get.threaten(player)];
}
}
}
}

View File

@ -8238,8 +8238,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseTarget(get.prompt2('yechou'),function(card,player,target){
return player!=target&&target.getDamagedHp()>1
}).set('forceDie',true).set('ai',function(target){
var num=get.attitude(_status.event.player,target);
return -num;
let att=get.attitude(_status.event.player,target);
if(att>0) return 0;
att=Math.sqrt(0.01-att);
return att*(get.distance(_status.currentPhase,target,'absolute')||game.players.length);
});
"step 1"
if(result.bool){