修改十周年滕芳兰【落宠】操作逻辑

This commit is contained in:
Spmario233 2024-02-05 21:38:34 +08:00
parent 08c5bca047
commit b84c122cd3
1 changed files with 69 additions and 50 deletions

View File

@ -5095,58 +5095,77 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return game.hasPlayer(current=>current.countDiscardableCards(player,'hej')>0); return game.hasPlayer(current=>current.countDiscardableCards(player,'hej')>0);
}, },
direct:true, direct:true,
content:function(){ async content(event,trigger,player){
'step 0' if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
var num=4-player.countMark('dcluochong'); const lose_list = [];
var dialog=[]; let num = 4 - player.countMark('dcluochong');
dialog.push('###'+get.prompt('dcluochong')+'###<div class="text center">弃置任意名角色区域内共计至多'+get.cnNumber(num)+'张牌</div>'); while (num>0) {
game.filterPlayer().sortBySeat().forEach(target=>{ const result = await player.chooseTarget(
if(target.countDiscardableCards(player,'hej')<=0) return false; get.prompt('dcluochong'),
var name=(target==player?'你':get.translation(target)); `弃置任意名角色区域内的累计至多${num}张牌`,
if(target.countCards('h')){ (card,player,target)=>{
dialog.add('<div class="text center">'+name+'的手牌区</div>'); return target.hasCard(card => {
if(player.hasSkillTag('viewHandcard',null,target,true)||player==target) dialog.push(target.getCards('h')); const discarded = _status.event.lose_list.find(item => item[0] == target);
else dialog.push([target.getCards('h'),'blank']); if (discarded && discarded[1].includes(card)) return false;
} return lib.filter.canBeDiscarded(card,player,target,'dcluochong');
if(target.countCards('e')) dialog.addArray(['<div class="text center">'+name+'的装备区</div>',target.getCards('e')]); }, 'hej')
if(target.countCards('j')) dialog.addArray(['<div class="text center">'+name+'的判定区</div>',target.getCards('j')]); }
}); ).set('ai',target=>{
player.chooseButton([1,num]).set('createDialog',dialog).set('filterButton',button=>{ const player = _status.event.player, discarded = _status.event.lose_list.find(item => item[0] == target);
return lib.filter.canBeDiscarded(button.link,_status.event.player,get.owner(button.link)); if(discarded){
}).set('ai',button=>{ if (target == player) return 0;
var player=_status.event.player, const num = discarded[1].length;
target=get.owner(button.link), if (num > 1 && player.hp + player.hujia > 2) return 0;
num=ui.selected.buttons.filter(i=>get.owner(i.link)==target).length; }
if(num>1&&player.hp+player.hujia>2) return 0; if (target == player){
if(target==player){ if(ui.cardPile.childNodes.length > 80 && player.hasCard(card => get.value(card) < 8)) return 20;
if(num) return -get.value(button.link,target); return 0;
if(ui.cardPile.childNodes.length>80) return 6-get.value(button.link,player); }
return 0; return get.effect(target, {name:'guohe_copy2'}, player, player);
} }).set('lose_list',lose_list).forResult();
var val=get.buttonValue(button); if (result.bool) {
if(num===2) val/=4; const target = result.targets[0];
if(get.attitude(player,target)>0) return -val; const cards = await player.choosePlayerCard(target, true, 'hej', [1,num], `选择弃置${get.translation(target)}区域内的牌`, (button) => {
return val; const card = button.link, target = _status.event.target;
//return -(get.position(card)!='h'?get.value(card,target):(4.5+Math.random()-0.2*(num>2?1:0)))*get.attitude(player,target); const discarded = _status.event.lose_list.find(item => item[0] == target);
}); if (discarded && discarded[1].includes(card)) return false;
'step 1' return lib.filter.canBeDiscarded(card,player,target,'dcluochong');
if(result.bool){ }).set('lose_list',lose_list).set('ai', button => {
var links=result.links; if (ui.selected.buttons.length>0) return false;
var lose_list=[]; var val = get.buttonValue(button);
var log=false; if (get.attitude(_status.event.player, _status.event.target) > 0) return -val;
for(var target of game.players){ return val;
var cards=links.filter(card=>get.owner(card)==target); }).forResultCards();
if(cards.length){ num -= cards.length;
if(cards.length>2){ const index = lose_list.find(item => item[0] == target);
player.addMark('dcluochong',1,false); if (!index) {
log=true; lose_list.push([target, cards]);
} }
lose_list.push([target,cards]); else {
index[1].addArray(cards);
} }
} }
player.logSkill('dcluochong',lose_list.map(i=>i[0])); else {
if(log) game.log(player,'可弃置牌数','#g-1'); break;
if(lose_list[0].length==1) lose_list[0][0].discard(lose_list[0][1]); }
}
if (_status.connectMode) {
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
}
if (lose_list.length>0) {
lib.tempSortSeat = trigger.player;
lose_list.sort((a,b)=>{
return lib.sort.seat(a[0],b[0]);
});
delete lib.tempSortSeat;
player.logSkill('dcluochong',lose_list.map(i => i[0]));
if (lose_list.some(i => i[1].length > 2)) {
game.log(player,'可弃置牌数','#g-1');
player.addMark('dcluochong',1,false);
}
if (lose_list[0].length==1) {
lose_list[0][0].discard(lose_list[0][1]);
}
else{ else{
game.loseAsync({ game.loseAsync({
lose_list:lose_list, lose_list:lose_list,