bug修复,增加观微AI

This commit is contained in:
copcap 2023-07-20 03:54:40 +08:00
parent a11f8906d0
commit 9e2a3e8414
7 changed files with 101 additions and 24 deletions

View File

@ -2547,6 +2547,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 0;
}
}
if(name=='bingliang'&&source.countCards('j')>0&&source.countCards('h')>=source.hp-1){
return 0;
}
var card2;
if(name!=card.name){
card2={name:name};

View File

@ -4770,6 +4770,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player,name){
if(name=='damageEnd') return true;
var evt=event.getParent();
if(evt.player!=player) return false;
return evt.card&&evt.type=='card'&&evt.targets.length==1;
},
content:function(){

View File

@ -280,12 +280,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.cards.remove(card);
if(result.links[0]!='获得剩余的牌') event.finish();
}
else if(event.targets.length) event.goto(1);
else event.finish();
'step 3'
var cards=cards.filterInD('d');
if(cards.length>0) player.gain(cards,'gain2');
'step 4'
if(event.targets.length) event.goto(1);
},
ai:{
threaten:1.3,

View File

@ -8558,7 +8558,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(card){
return 6-get.value(card);
},
position:'h',
position:'hs',
onuse:function(result,player){
player.addTempSkill('juguan_effect');
},

View File

@ -409,7 +409,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
group:'dcguixiu_rec',
content:function(){
player.addMark('dcguixiu',1,false);
player.draw();
player.draw(2);
},
subSkill:{
rec:{
@ -17154,12 +17154,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true;
},
content:function(){
'step 0'
player.awakenSkill('syxiongyi');
if(!_status.characterlist){
lib.skill.pingjian.initList();
}
var hp=1-player.hp;
if((player.name1=='re_sunyi'||player.name2=='re_sunyi')&&_status.characterlist.contains('xushi')){
event.hp=1-player.hp;
if(_status.characterlist.contains('xushi')){
if(player.name1=='re_sunyi'||player.name2=='re_sunyi') event._result={control:'re_sunyi'};
else if(player.name2!=undefined){
player.chooseControl(player.name1,player.name2).set('prompt','请选择要更换的武将牌');
}
else event._result={control:player.name1};
hp+=2;
_status.characterlist.remove('xushi');
_status.characterlist.add('re_sunyi');
@ -17167,7 +17173,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
else{
player.addSkillLog('olhunzi');
event.goto(2);
}
'step 1'
event.hp+=2;
var name=result.control;
_status.characterlist.remove('xushi');
_status.characterlist.add(name);
player.reinit(name,'xushi',false);
'step 2'
var hp=event.hp;
if(hp>0) player.recover(hp);
},
ai:{
@ -30263,7 +30278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
syjiqiao:'激峭',
syjiqiao_info:'出牌阶段开始时你可将牌堆顶的X张牌置于你的武将牌上X为你的体力上限。当你于此出牌阶段内使用的牌结算结束后你可以获得其中的一张牌然后若剩余牌中红色牌和黑色牌的数量不相等你失去1点体力相等你回复1点体力。出牌阶段结束时你将这些牌置入弃牌堆。',
syxiongyi:'凶疑',
syxiongyi_info:'限定技。当你处于濒死状态时,若剩余武将牌堆中:有“徐氏”,则你将体力值回复至3点并将此武将牌替换为“徐氏”没有“徐氏”则你将体力值回复至1点并获得〖魂姿〗。',
syxiongyi_info:'限定技。当你处于濒死状态时,若剩余武将牌堆中:有“徐氏”,则你可以将体力值回复至3点并将此武将牌替换为“徐氏”没有“徐氏”则你可以将体力值回复至1点并获得〖魂姿〗。',
zhaoyan:'赵嫣',
jinhui:'锦绘',
jinhui_info:'出牌阶段限一次,你可以随机展示牌堆中的三张不具有“伤害”标签且使用目标范围为“自己”或“一名角色”的牌,然后选择一名其他角色。该角色选择并按如下“锦绘”规则使用其中一张,然后你可以按如下“锦绘”规则使用剩余的任意张牌:若此牌的使用目标为“自己”,则对自己使用该牌,否则对对方使用该牌(无距离限制且不计入次数限制)。',

View File

@ -447,6 +447,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.isPhaseUsing()) return false;
if(player==event.player) return false;
if(!event.player.isIn()) return false;
if(!event.card) return false;
return event.card.name=='sha'||get.type(event.card)=='trick'&&get.tag(event.card,'damage');
},
logTarget:'player',
@ -496,38 +497,53 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.index==0){
target.draw();
player.addTempSkill('twxianfeng_me',{player:'phaseBegin'});
player.addMark('twxianfeng_me',1,false);
}
else{
player.draw();
target.addTempSkill('twxianfeng_others');
target.markAuto('twxianfeng_others',[player]);
target.addSkill('twxianfeng_others');
if(!target.storage.twxianfeng_others) target.storage.twxianfeng_others={};
if(typeof target.storage.twxianfeng_others[player.playerid]!='number') target.storage.twxianfeng_others[player.playerid]=0;
target.storage.twxianfeng_others[player.playerid]++;
}
},
subSkill:{
me:{
charlotte:true,
mark:true,
intro:{content:'至其他角色的距离-1'},
intro:{content:'至其他角色的距离-#'},
mod:{
globalFrom:function(from,to,distance){
return distance-1;
return distance-from.countMark('twxianfeng_me');
}
}
},
others:{
trigger:{global:['phaseBegin','die']},
filter:function(event,player){
return player.getStorage('twxianfeng_others').contains(event.player);
return player.storage.twxianfeng_others&&player.storage.twxianfeng_others[event.player.playerid];
},
charlotte:true,
mark:true,
intro:{content:'至$的距离-1'},
forced:true,
intro:{
content:function(storage,player){
if(!storage) return '';
var str='';
var map=(_status.connectMode?lib.playerOL:game.playerMap);
for(var id of storage){
str+='至'+get.translation(map[id])+'的距离-'+storage[id]+'、';
}
return str.slice(0,-1);
}
},
content:function(){
player.unmarkAuto('twxianfeng_others',[trigger.player]);
delete player.storage.twxianfeng_others[trigger.player.playerid];
if(get.is.empty(player.storage.twxianfeng_others)) player.removeSkill('twxianfeng_others');
},
mod:{
globalFrom:function(from,to,distance){
if(from.getStorage('twxianfeng_others').contains(to)) return distance-1;
if(from.storage.twxianfeng_others&&typeof from.storage.twxianfeng_others[to.playerid]=='number') return distance-from.storage.twxianfeng_others[to.playerid];
}
}
},

View File

@ -836,21 +836,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
},
"xinfu_guanwei":{
xinfu_guanwei:{
audio:2,
usable:1,
trigger:{
global:"phaseUseEnd",
},
filter:function (event,player){
var history=event.player.getHistory('useCard',function(evt){
return evt.getParent('phaseUse')==event;
});
var history=event.player.getHistory('useCard');
var num=0;
var suit=false;
for(var i=0;i<history.length;i++){
var suit2=get.suit(history[i].card);
if(!suit2) continue;
if(!lib.suit.contains(suit2)) return false;
if(suit&&suit!=suit2) return false;
suit=suit2;
num++;
@ -858,17 +856,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return num>1;
},
direct:true,
global:'xinfu_guanwei_ai',
content:function (){
'step 0'
var target=trigger.player;
player.chooseToDiscard('he',get.prompt('xinfu_guanwei',trigger.player),'弃置一张牌,令其摸两张牌并进行一个额外的出牌阶段。').set('ai',function(card){
if(get.attitude(_status.event.player,_status.currentPhase)<1) return 0;
if(get.attitude(_status.event.player,_status.event.targetx)<1) return 0;
return 9-get.value(card);
}).set('logSkill','xinfu_guanwei');
}).set('logSkill',['xinfu_guanwei',target]).set('targetx',target);
'step 1'
if(result.bool){
player.line(trigger.player,'green');
trigger.player.draw(2);
}else{
}
else{
player.storage.counttrigger.xinfu_guanwei--;
event.finish();
}
'step 2'
@ -879,6 +881,47 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
expose:0.5,
},
subSkill:{
ai:{
ai:{
effect:{
player_use:function(card,player,target){
if(typeof card!='object'||!player.isPhaseUsing()) return;
var hasPanjun=game.hasPlayer(function(current){
return current.hasSkill('xinfu_guanwei')&&(!current.storage.counttrigger||!current.storage.counttrigger.xinfu_guanwei)&&
get.attitude(current,player)>=1&&current.hasCard(function(card){
return get.value(card)<7||(current!=game.me&&!current.isUnderControl()&&!current.isOnline())&&get.value(card)<9;
},'he');
});
if(!hasPanjun) return;
var suitx=get.suit(card);
var history=player.getHistory('useCard');
if(!history.length){
var val=0;
if(player.hasCard(function(cardx){
return get.suit(cardx)==suitx&&card!=cardx&&(!card.cards||!card.cards.contains(cardx))&&player.hasValueTarget(cardx);
},'hs')) val=[2,0.1];
if(val) return val;
return;
}
var num=0;
var suit=false;
for(var i=0;i<history.length;i++){
var suit2=get.suit(history[i].card);
if(!lib.suit.contains(suit2)) return;
if(suit&&suit!=suit2) return;
suit=suit2;
num++;
}
if(suitx==suit&&num==1) return [1,0.1];
if(suitx!=suit&&(num>1||num<=1&&player.hasCard(function(cardx){
return get.suit(cardx)==suit&&player.hasValueTarget(cardx);
},'hs'))) return 'zeroplayertarget';
},
},
},
}
},
},
xinfu_gongqing_gz_panjun:{audio:2},
"xinfu_gongqing":{
@ -1537,7 +1580,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"xinfu_zengdao2":"赠刀",
"xinfu_zengdao2_info":"",
"xinfu_guanwei":"观微",
"xinfu_guanwei_info":"每回合限一次。一名角色的出牌阶段结束时,若其于出牌阶段内使用过两张以上的牌且花色均相同,则你可以弃置一张牌,令其摸两张牌并进行一个额外的出牌阶段。",
"xinfu_guanwei_info":"每回合限一次。一名角色的出牌阶段结束时,若其本回合使用过两张以上的牌且这些牌均有花色且花色均相同,则你可以弃置一张牌,令其摸两张牌并进行一个额外的出牌阶段。",
"xinfu_gongqing":"公清",
"xinfu_gongqing_info":"锁定技。当你受到伤害时,若伤害来源的攻击范围:<3则你令此伤害的数值减为1。>3你令此伤害+1。",
"xinfu_andong":"安东",