调整滕胤【陈见】并添加ai

This commit is contained in:
157 2024-01-29 09:48:40 +08:00
parent 714b2175bb
commit def08e2724
1 changed files with 57 additions and 44 deletions

View File

@ -8031,48 +8031,55 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{player:'phaseZhunbeiBegin'}, trigger:{player:'phaseZhunbeiBegin'},
prompt2:function(event,player){ prompt2:function(event,player){
return '展示牌堆顶的'+get.cnNumber(3+player.countMark('chenjian'))+'张牌。然后你可依次执行以下两项中的任意项:⒈弃置一张牌,然后令一名角色获得与你弃置牌花色相同的牌。⒉使用其中剩余的一张牌。若你执行了所有选项,则你获得一枚“陈见”,然后重铸所有手牌。'; return '展示牌堆顶的'+get.cnNumber(3+player.countMark('chenjian'))+'张牌,然后执行以下一至两项:⒈弃置一张牌,然后令一名角色获得与你弃置牌花色相同的牌。⒉使用其中剩余的一张牌。若你执行了所有选项,则你获得一枚“陈见”并重铸所有手牌';
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var cards=get.cards(3+player.countMark('chenjian')); var cards=get.cards(3+player.countMark('chenjian'));
event.cards=cards; event.cards=cards;
game.cardsGotoOrdering(cards); player.showCards(cards,get.translation(player)+'发动了【陈见】');
game.log(player,'展示了',event.cards);
event.videoId=lib.status.videoId++;
game.broadcastAll(function(player,id,cards){
var str=get.translation(player)+'发动了【陈见】';
var dialog=ui.create.dialog(str,cards);
dialog.videoId=id;
},player,event.videoId,event.cards);
game.addVideo('showCards',player,[get.translation(player)+'发动了【陈见】',get.cardsInfo(event.cards)]);
game.delay(2);
'step 1' 'step 1'
if(!player.countCards('he')){ var list=[];
game.broadcastAll('closeDialog',event.videoId); if(player.countCards('he',i=>{
game.addVideo('cardDialog',null,event.videoId); return lib.filter.cardDiscardable(i,player,'chenjian');
event.goto(4); })) list.push('选项一');
} if(event.cards.some(i=>{
else{ return player.hasUseTarget(i);
player.chooseToDiscard('he').set('prompt',false).set('ai',function(card){ })) list.push('选项二');
var cards=_status.event.getParent().cards,val=-get.value(card),suit=get.suit(card); if(list.length===1) event._result={control:list[0]};
for(var i of cards){ else if(list.length>1) player.chooseControl(list).set('choiceList',[
if(get.suit(i,false)==suit) val+=get.value(i,'raw'); '弃置一张牌,然后令一名角色获得与你弃置牌花色相同的牌',
} '使用'+get.translation(event.cards)+'中的一张牌'
return val; ]).set('prompt','陈见:请选择一项').set('ai',()=>{
}); let player=_status.event.player,cards=_status.event.getParent().cards;
var func=function(id){ if(cards.some(i=>{
var dialog=get.idDialog(id); return player.getUseValue(i)>0;
if(dialog) dialog.content.firstChild.innerHTML='是否弃置一张牌?'; })) return '选项二';
}; return '选项一';
if(player==game.me) func(event.videoId); });
else if(player.isOnline()) player.send(func,event.videoId); else event.finish();
}
'step 2' 'step 2'
game.broadcastAll('closeDialog',event.videoId); event.goon=0;
game.addVideo('cardDialog',null,event.videoId); event.choosed=result.control;
if(result.control==='cancel2') event.finish();
else if(result.control==='选项二') event.goto(6);
'step 3'
if(player.countCards('he',i=>{
return lib.filter.cardDiscardable(i,player,'chenjian');
})) player.chooseToDiscard('he',!event.goon).set('ai',function(card){
let evt=_status.event.getParent(),
val=event.goon&&evt.player.countMark('chenjian')<2?0:-get.value(card),
suit=get.suit(card);
for(let i of evt.cards){
if(get.suit(i,false)==suit) val+=get.value(i,'raw');
}
return val;
}).set('prompt','陈见:'+(event.goon?'是否':'请')+'弃置一张牌,然后令一名角色获得'+get.translation(event.cards)+'中花色与之相同的牌'+(event.goon?'':''));
else if(event.choosed==='选项一') event.goto(6);
else event.finish();
'step 4'
if(result.bool){ if(result.bool){
event.goon1=true; event.goon++;
var suit=get.suit(result.cards[0],player); var suit=get.suit(result.cards[0],player);
var cards2=event.cards.filter(function(i){ var cards2=event.cards.filter(function(i){
return get.suit(i,false)==suit; return get.suit(i,false)==suit;
@ -8087,31 +8094,37 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return att; return att;
}); });
} }
else event.goto(4); else if(event.choosed==='选项一') event.goto(6);
else event.goto(8);
} }
else event.goto(4); else event.finish();
'step 3' 'step 5'
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.line(target,'green'); player.line(target,'green');
target.gain(event.cards2,'gain2'); target.gain(event.cards2,'gain2');
event.cards.removeArray(event.cards2); event.cards.removeArray(event.cards2);
} }
'step 4' if(event.choosed==='选项二') event.goto(8);
'step 6'
var cards2=cards.filter(function(i){ var cards2=cards.filter(function(i){
return player.hasUseTarget(i); return player.hasUseTarget(i);
}); });
if(cards2.length) player.chooseButton(['是否使用其中一张牌?',cards2]).set('ai',function(button){ if(cards2.length) player.chooseButton(['陈见:'+(event.goon?'是否':'请')+'使用其中一张牌'+(event.goon?'':''),cards2],!event.goon).set('ai',function(button){
return player.getUseValue(button.link); return player.getUseValue(button.link);
}); });
else if(event.choosed==='选项二') event.goto(3);
else event.finish(); else event.finish();
'step 5' 'step 7'
if(result.bool){ if(result.bool){
player.chooseUseTarget(true,result.links[0],false); player.chooseUseTarget(true,result.links[0],false);
event.goon2=true; event.cards.removeArray(result.links);
event.goon+=2;
if(event.choosed==='选项二') event.goto(3);
} }
'step 6' else event.finish();
if(event.goon1&&event.goon2){ 'step 8'
if(event.goon>2){
if(player.countMark('chenjian')<2) player.addMark('chenjian',1,false); if(player.countMark('chenjian')<2) player.addMark('chenjian',1,false);
player.recast(player.getCards('h',lib.filter.cardRecastable)); player.recast(player.getCards('h',lib.filter.cardRecastable));
} }
@ -11327,7 +11340,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
shezang_info:'每轮限一次。当你或你回合内的其他角色进入濒死状态时,你可以从牌堆中获得每种花色的牌各一张。', shezang_info:'每轮限一次。当你或你回合内的其他角色进入濒死状态时,你可以从牌堆中获得每种花色的牌各一张。',
tengyin:'滕胤', tengyin:'滕胤',
chenjian:'陈见', chenjian:'陈见',
chenjian_info:'准备阶段你可展示牌堆顶的3+X张牌X为你“陈见”标记的数量且至多为2。然后你可依次执行以下两项中的任意项:⒈弃置一张牌,然后令一名角色获得与你弃置牌花色相同的牌。⒉使用其中剩余的一张牌。若你执行了所有选项,则你获得一枚“陈见”,然后重铸所有手牌。', chenjian_info:'准备阶段你可展示牌堆顶的3+X张牌X为你“陈见”标记的数量且至多为2,然后执行以下一至两项:⒈弃置一张牌,然后令一名角色获得与你弃置牌花色相同的牌。⒉使用其中剩余的一张牌。若你执行了所有选项,则你获得一枚“陈见”重铸所有手牌。',
xixiu:'皙秀', xixiu:'皙秀',
xixiu_info:'锁定技。①当你成为其他角色使用牌的目标时若你的装备区内有和此牌花色相同的牌则你摸一张牌。②若你装备区内的牌数为1则其他角色不能弃置你装备区内的牌。', xixiu_info:'锁定技。①当你成为其他角色使用牌的目标时若你的装备区内有和此牌花色相同的牌则你摸一张牌。②若你装备区内的牌数为1则其他角色不能弃置你装备区内的牌。',
zhangyao:'张媱', zhangyao:'张媱',