From c3608b7ef90248bd336a97548e4320e622b4a291 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Thu, 5 Oct 2023 12:53:01 +0800 Subject: [PATCH] bug fixs --- card/standard.js | 44 ++++++++++++++++++++------------------------ character/shiji.js | 2 +- game/game.js | 29 +++++++++++++++++------------ game/pinyinjs.js | 2 +- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/card/standard.js b/card/standard.js index 23ccb98de..a28b28680 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1148,38 +1148,34 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } } "step 3" - if(event.target.isDead()||event.player.isDead()){ - event.finish(); - } - else{ - if(result.bool){ - event.shaRequired--; - if(event.turn==target){ - if(result.cards) event.targetCards.addArray(result.cards); - if(event.shaRequired>0) event.goto(2); - else{ - event.turn=player; - event.goto(1); - } - } + if(result.bool){ + event.shaRequired--; + if(event.turn==target){ + if(result.cards) event.targetCards.addArray(result.cards); + if(event.shaRequired>0) event.goto(2); else{ - if(result.cards) event.playerCards.addArray(result.cards); - if(event.shaRequired>0) event.goto(2); - else{ - event.turn=target; - event.goto(1); - } + event.turn=player; + event.goto(1); } } else{ - if(event.turn==target){ - target.damage(); - } + if(result.cards) event.playerCards.addArray(result.cards); + if(event.shaRequired>0) event.goto(2); else{ - player.damage(target); + event.turn=target; + event.goto(1); } } } + else{ + if(event.turn==target){ + target.damage(); + } + else{ + player.damage(target); + } + } + event._result={}; }, ai:{ wuxie:function(target,card,player,viewer){ diff --git a/character/shiji.js b/character/shiji.js index a11a0cfab..2b1140389 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -2278,7 +2278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' //特殊处理 if(player.isDead()){ - player.useResult(event.result,event.getParent()) + player.useResult(event.result,event.getParent()).forceDie=true; } }, ai:{ diff --git a/game/game.js b/game/game.js index 0fffbd63c..daae23dd8 100644 --- a/game/game.js +++ b/game/game.js @@ -25152,24 +25152,25 @@ }, addJudgeNext:function(card,unlimited){ if(!card.expired){ - if(!unlimited&&get.position(card,true)!=='o'&&get.position(card,true)!=='j'){ - game.log('将',card,'移入',this.next,'的判定区失败'); + let target=this.next; + const name=card.viewAs||card.name; + const cards=(get.itemtype(card)=='card')?[card]:card.cards; + if(get.itemtype(cards)!='cards') return; + let bool=false; + if(!unlimited&&cards.some(card=>{ + const position=get.position(card,true); + return position!='j'&&position!='o'; + })){ + game.log(card,'已被移出处理区,无法置入判定区'); return; } - var target=this.next; - var name=card.viewAs||card.name; - var bool=false; - for(var iwhile=0;iwhile<20;iwhile++){ + for(let iwhile=0;iwhile<20;iwhile++){ if(target.canAddJudge(card)){ bool=true;break; } target=target.next; } - if(!bool){ - game.log(card,'进入了弃牌堆'); - game.cardsDiscard(card); - } - else{ + if(bool){ if(card.cards&&card.cards.length){ target.addJudge(name,card.cards[0]); } @@ -56223,7 +56224,7 @@ if(!extraInformations) return false; for(const extraInformation of extraInformations){ if(!extraInformation.startsWith('doublegroup:')) continue; - return Boolean(array)&&extraInformation.split(':').slice(1); + return array?extraInformation.split(':').slice(1):true; } return false; }, @@ -59018,6 +59019,10 @@ if(cardinfo&&cardinfo.cardPrompt) uiintro.add('
'+es[i].outerHTML+'
'+cardinfo.cardPrompt(es[i])+'
'); else uiintro.add('
'+es[i].outerHTML+'
'+lib.translate[es[i].name+'_info']+'
'); uiintro.content.lastChild.querySelector('.skill>.card').style.transform=''; + + if(lib.translate[es[i].name+'_append']){ + uiintro.add('
'+lib.translate[es[i].name+'_append']+'
'); + } } var js=node.getCards('j'); for(var i=0;i