From e7d22b9cd19937e8d52e1f60d9049b3f5b677847 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Sat, 28 Oct 2023 00:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E6=AF=81=E6=9C=BA=E5=88=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20[Experimental]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/jsrg.js | 24 ++---------- character/xianding.js | 32 ++-------------- game/game.js | 85 ++++++++++++++++++++++++++----------------- 3 files changed, 59 insertions(+), 82 deletions(-) diff --git a/character/jsrg.js b/character/jsrg.js index 2a0ae0dd1..cc0108c7d 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -71,12 +71,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'basic', enable:false, - global:'ying_destory', + destroy:'discardPile', getYing:function(count){ var cards=[]; if(typeof count!='number') count=1; while(count--){ - cards.push(game.createCard('ying','spade',1)); + let card=game.createCard('ying','spade',1); + card.destroyed='discardPile'; + cards.push(card); } return cards; }, @@ -95,24 +97,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, skill:{ //江山如故·转 - //白牌 - ying_destory:{ - trigger:{ - player:'loseAfter', - global:['loseAsyncAfter','cardsDiscardAfter','equipAfter'], - }, - cardSkill:true, - forced:true, - popup:false, - filter:function(event,player){ - return event.getd().some(i=>get.name(i,false)=='ying'&&get.position(i,true)=='d'); - }, - content:function(){ - var cards=trigger.getd().filter(i=>get.name(i,false)=='ying'&&get.position(i,true)=='d'); - game.cardsGotoSpecial(cards); - game.log(cards,'被移出了游戏'); - }, - }, //404郭嘉 jsrgqingzi:{ audio:2, diff --git a/character/xianding.js b/character/xianding.js index 8674f7654..db24820b5 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -11609,7 +11609,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 7-get.value(card); }, content:function(){ - player.addSkill('pyzhuren_destroy'); + //player.addSkill('pyzhuren_destroy'); if(!_status.pyzhuren) _status.pyzhuren={}; var rand=0.85; var num=get.number(cards[0]); @@ -11627,7 +11627,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ _status.pyzhuren[name]=true; - player.gain(game.createCard(name,cards[0].name=='shandian'?'spade':cards[0].suit,1),'gain2') + var card=game.createCard(name,cards[0].name=='shandian'?'spade':cards[0].suit,1); + card.destroyed='discardPile'; + player.gain(card,'gain2') } }, ai:{ @@ -11637,32 +11639,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, }, - pyzhuren_destroy:{ - trigger:{global:['loseEnd','cardsDiscardEnd']}, - forced:true, - charlotte:true, - filter:function(event,player){ - var cs=event.cards; - for(var i=0;i6){ var cards=_status.renku.splice(0,_status.renku.length-6); @@ -20336,14 +20334,9 @@ else if(get.position(cards[0])=='c') event.updatePile=true; } "step 1" - if(cards[0].destroyed){ - if(player.hasSkill(cards[0].destroyed)){ - delete cards[0].destroyed; - } - else{ - event.finish(); - return; - } + if(cards[0].willBeDestroyed('judge',player,event)){ + event.finish(); + return; } else if(event.relatedLose){ var owner=event.relatedLose.player; @@ -29910,6 +29903,26 @@ buildIntro(noclick){ if(!noclick) lib.setIntro(this); } + //判断一张牌进入某个区域后是否会被销毁 + willBeDestroyed(targetPosition,player,event){ + const destroyed=this.destroyed; + if(typeof destroyed=='function'){ + return destroyed(card,targetPosition,player,event); + } + else if(lib.skill[destroyed]){ + if(player){ + if(player.hasSkill(destroyed)){ + delete this.destroyed; + return false; + } + } + return true; + } + else if(typeof destroyed=='string'){ + return (destroyed==targetPosition); + } + return destroyed; + } hasNature(nature,player){ return game.hasNature(this,nature,player); } @@ -30511,7 +30524,7 @@ if(this._uncheck.length==0) this.classList.remove('uncheck'); } discard(bool){ - if(!this.destroyed){ + if(!this.willBeDestroyed('discardPile',null,event)){ ui.discardPile.appendChild(this); } this.fix(); @@ -36286,6 +36299,10 @@ const cards=event.cards; const pile=ui.cardPile; for(let i=0;i