diff --git a/card/gwent.js b/card/gwent.js index fe958ee4e..93a0a0b7e 100644 --- a/card/gwent.js +++ b/card/gwent.js @@ -126,7 +126,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ player.line(target); target.removeEquipTrigger(); for(var i=0;i0); + } + else{ + event.finish(); + } + 'step 2' + if(result.bool){ + player.logSkill('nscangxi',event.current); + player.judge(function(card){ + return _status.event.att*(get.color(card)=='black'?1:0); + }).set('att',get.sgnAttitude(player,event.current)); + } + else{ + event.goto(1); + } + 'step 3' + if(result.color=='black'){ + var name=get.translation(event.current.name); + var att=0; + if(event.current.needsToDiscard()){ + att=1; + } + player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回进入弃牌堆的牌'],function(){ + return _status.event.att; + }).set('att',att); + } + else{ + event.goto(1); + } + 'step 4' + switch(result.index){ + case 0: event.current.draw('visible');break; + case 1: { + if(typeof event.current.storage.nscangxi!='number'){ + event.current.storage.nscangxi=0; + } + event.current.storage.nscangxi++; + event.current.syncStorage('nscangxi'); + event.current.markSkill('nscangxi'); + break; + } + case 2: { + player.chooseToDiscard(true,'he'); + break; + } + } + if(result.index!=2){ + event.goto(1); + } + 'step 5' + if(result.bool){ + var discarded=get.discarded(); + if(discarded.length){ + event.current.chooseCardButton('选择一张获得之',discarded,true).set('ai',function(button){ + return get.value(button.link); + }); + } + else{ + event.goto(1); + } + } + else{ + event.goto(1); + } + 'step 6' + if(result.bool&&result.links&&result.links.length){ + event.current.gain(result.links,'gain2'); + } + event.goto(1); + } + }, + nswulie:{ + trigger:{player:'phaseBegin'}, + skillAnimation:true, + animationColor:'metal', + unique:true, + check:function(){ + return false; + }, + filter:function(event,player){ + return ui.discardPile.childElementCount>0; + }, + content:function(){ + 'step 0' + player.awakenSkill('nswulie'); + player.loseMaxHp(); + 'step 1' + player.chooseCardButton(Array.from(ui.discardPile.childNodes),'将至多3张任意顺置于牌堆顶(先选择的在上)',true,[1,3]); + 'step 2' + if(result.bool){ + var cards=result.links.slice(0); + while(cards.length){ + ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild); + } + player.addTempSkill('nswulie_end'); + } + }, + subSkill:{ + end:{ + trigger:{player:'phaseEnd'}, + check:function(){ + return false; + }, + filter:function(event,player){ + return ui.discardPile.childElementCount>0; + }, + content:function(){ + 'step 0' + player.loseMaxHp(); + 'step 1' + player.chooseCardButton(Array.from(ui.discardPile.childNodes),'将至多3张任意顺置于牌堆顶(先选择的在上)',true,[1,3]); + 'step 2' + if(result.bool){ + var cards=result.links.slice(0); + while(cards.length){ + ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild); + } + } + } + } + } + }, + nshunyou:{ + enable:'phaseUse', + usable:1, + filterCard:{type:'basic'}, + filter:function(event,player){ + return player.countCards('h',{type:'basic'}); + }, + content:function(){ + 'step 0' + var equip=null, trick=null; + for(var i=0;i1){ + if(!target.getEquip(_status.event.subtype)) return att; + } + return 0; + }).set('subtype',get.subtype(event.equip)); + } + else{ + event.finish(); + } + 'step 2' + if(result.bool){ + player.line(result.targets,'green'); + player.$give(event.equip,result.targets[0]); + player.lose(event.equip,ui.special); + } + else{ + event.finish(); + } + 'step 3' + game.delay(0.5); + 'step 4' + result.targets[0].equip(event.equip); + 'step 5' + game.delay(); + }, + check:function(card){ + return 7-get.value(card); + }, + ai:{ + order:7, + result:{ + player:1 + } + } + }, nsgongjian:{ trigger:{player:'phaseDiscardEnd'}, forced:true, @@ -1604,7 +1870,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.$throw(links); game.log(player, '被移去了', links); for (var i = 0; i < links.length; i++) { - ui.discardPile.appendChild(links[i]); + links[i].discard(); } } 'step 2' @@ -2197,7 +2463,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.logSkill('zhucheng',_status.currentPhase); player.$throw(result.links[0]); player.storage.zhucheng.remove(result.links[0]); - ui.discardPile.appendChild(result.links[0]); + result.links[0].discard(); player.syncStorage('zhucheng'); if(player.storage.zhucheng.length==0){ player.unmarkSkill('zhucheng'); @@ -2338,7 +2604,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i0) player.draw(num); while(player.storage.yinbing.length){ - ui.discardPile.appendChild(player.storage.yinbing.shift()); + player.storage.yinbing.shift().discard(); } player.syncStorage('yinbing'); player.unmarkSkill('yinbing'); @@ -5392,7 +5392,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.$throw(result.links); for(var i=0;i1){ player.node.marks.lastChild.remove(); @@ -39317,7 +39343,7 @@ if(ui.discardPile.childNodes.length){ var list=[]; for(var i=0;i