From 5b85397f4bcb326ebcd63e13916e870de2d26c84 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 29 Jul 2019 12:08:42 +0800 Subject: [PATCH] v1.9.90.4 --- card/guozhan.js | 38 ++++++++++-- character/refresh.js | 14 +++-- character/shenhua.js | 51 ++++++++++------ character/sp.js | 20 +++---- character/standard.js | 14 +++-- character/xinghuoliaoyuan.js | 57 +++++++----------- character/yijiang.js | 30 ++++++---- game/game.js | 17 ++++-- game/update.js | 10 ++-- mode/guozhan.js | 113 ++++------------------------------- 10 files changed, 162 insertions(+), 202 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index 78215cae6..ee097492e 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -290,18 +290,48 @@ game.import('card',function(lib,game,ui,get,ai,_status){ },targets); } }, + contentBefore:function(){ + var evt=event.getParent(); + if(evt&&evt.targets&&evt.targets.contains(player)){ + evt.fixedSeat=true; + evt.targets.remove(player); + evt.targets.push(player); + } + }, content:function(){ 'step 0' if(target==player){ - var num=targets.length-1; - target.chooseDrawRecover(num,num,true); - event.finish(); + var num=targets.length-1; + event.num=num; + var damaged=target.maxHp-target.hp; + if(damaged==0){ + target.draw(num); + event.finish(); + } + else{ + var list=[]; + for(var i=0;i<=Math.min(num,damaged);i++){ + list.push('摸'+i+'回'+(num-i)); + } + target.chooseControl(list).set('prompt','请分配自己的摸牌数和回复量').ai=function(){ + if(player.hasSkill('diaohulishan')) return 0; + if(_status._aozhan) return list.length-1; + return list.randomGet(); + }; + } } else{ target.draw(); } 'step 1' - target.link(false); + if(target!=player) target.link(false); + else if(typeof result.control=='string'){ + var index=result.control.indexOf('回'); + var draw=parseInt(result.control.slice(1,index)); + var recover=parseInt(result.control.slice(index+1)); + if(draw) target.draw(draw); + if(recover) target.recover(recover); + } }, ai:{ order:3, diff --git a/character/refresh.js b/character/refresh.js index 39482eb37..a545aded7 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -1205,7 +1205,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player.storage.reluoshen&&player.storage.reluoshen.contains(card)){ return true; } - } + }, + cardDiscardable:function(card,player,name){ + if(name=='phaseDiscard'&&player.storage.reluoshen&&player.storage.reluoshen.contains(card)){ + return true; + } + }, }, group:'reluoshen_clear', subSkill:{ @@ -2845,7 +2850,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 0" player.chooseTarget(get.prompt('fenwei'), [1,trigger.targets.length],function(card,player,target){ - return _status.event.getTrigger().targets.contains(target); + var evt=_status.event.getTrigger(); + return evt.targets.contains(target)&&!evt.excluded.contains(target); }).set('ai',function(target){ var trigger=_status.event.getTrigger(); if(game.phaseNumber>game.players.length*2&&trigger.targets.length>=game.players.length-1){ @@ -2858,9 +2864,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('fenwei'); player.logSkill('fenwei',result.targets); player.storage.fenwei=true; - for(var i=0;i1) return false; - }, - }, trigger:{ player:'useCardAfter' }, @@ -1363,6 +1358,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.storage.nzry_zhizheng++; }, subSkill:{ + others:{ + sub:true, + mod:{ + targetEnabled:function(card,player,target){ + if(player.hasSkill('nzry_zhizheng')&&player.isPhaseUsing()&&get.distance(target,player,'attack')>1) return false; + }, + }, + }, "1":{ trigger:{ player:['phaseUseBefore','phaseUseAfter'] @@ -1370,6 +1373,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, popup:false, content:function(){ + if(event.triggername=='phaseUseBefore') game.countPlayer(function(current){ + if(current!=player){ + current.addTempSkill('nzry_zhizheng_others','phaseUseAfter'); + } + }); player.storage.nzry_zhizheng=0; }, }, @@ -2845,28 +2853,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.judge(function(card){ if(get.suit(card)=='heart') return -1; return 1; - },ui.special).nogain=function(card){ - return get.suit(card)!='heart'; - }; + },ui.special); "step 1" - if(result.bool){ - result.card.goto(ui.special); + var bool1=result.bool; + var bool2=!get.owner(result.card); + if(bool1&&bool2){ + event.card=result.card; + event.node=result.node; + } + else{ + if(bool2) result.card.discard(); + event.finish(); + } + "step 2" + event.card.goto(ui.special); event.trigger("addCardToStorage"); - player.storage.tuntian.push(result.card); - result.node.moveDelete(player); + player.storage.tuntian.push(event.card); + event.node.moveDelete(player); game.broadcast(function(cardid,player){ var node=lib.cardOL[cardid]; if(node){ node.moveDelete(player); } - },result.node.cardid,player); - game.addVideo('gain2',player,get.cardsInfo([result.node])); + },event.node.cardid,player); + game.addVideo('gain2',player,get.cardsInfo([event.node])); player.markSkill('tuntian'); game.addVideo('storage',player,['tuntian',get.cardsInfo(player.storage.tuntian),'cards']); - } }, init:function(player){ - player.storage.tuntian=[]; + if(!player.storage.tuntian) player.storage.tuntian=[]; }, intro:{ content:'cards' diff --git a/character/sp.js b/character/sp.js index be6c42b70..6bdfe07bb 100755 --- a/character/sp.js +++ b/character/sp.js @@ -3247,7 +3247,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=player.storage.xianfu2; player.line(target,'green'); target.logSkill('xianfu'); - target[trigger.name](trigger.num,trigger.source||'nosource'); + target[trigger.name](trigger.num,'nosource'); game.delay(); }, group:'xianfu3', @@ -3867,12 +3867,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return !event.player.isMad()&&!_status.connectMode; }, content:function(){ - game.countPlayer(function(current){ - current.forceCountChoose={default:5}; - }); + player.forceCountChoose={chooseToUse:5,default:5}; player.addSkill('kuangcai_use'); player.addSkill('kuangcai_cancel'); - ui.auto.hide(); + //ui.auto.hide(); }, subSkill:{ use:{ @@ -3885,7 +3883,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return true; }, cardEnabled:function(card,player){ - if(player.forceCountChoose&&player.forceCountChoose.default<=0) return false; + if(player.forceCountChoose&&player.forceCountChoose.chooseToUse<=0) return false; }, }, trigger:{player:'useCard'}, @@ -3900,7 +3898,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ player.draw(); - player.forceCountChoose.default--; + player.forceCountChoose.chooseToUse--; } }, cancel:{ @@ -3908,10 +3906,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ priority:50, silent:true, content:function(){ - game.countPlayer(function(current){ - delete current.forceCountChoose; - }); - ui.auto.show(); + delete player.forceCountChoose; + //ui.auto.show(); player.removeSkill('kuangcai_use'); player.removeSkill('kuangcai_cancel'); } @@ -11789,7 +11785,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.removeAdditionalSkill('baobian'); var list=[]; if(player.hp<=3){ - if(trigger.num!=undefined&&trigger.num<0) player.logSkil('baobian'); + if(trigger.num!=undefined&&trigger.num<0) player.logSkill('baobian'); list.push('tiaoxin'); } if(player.hp<=2){ diff --git a/character/standard.js b/character/standard.js index b5cd1b5bd..a97e20d68 100755 --- a/character/standard.js +++ b/character/standard.js @@ -1449,7 +1449,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'useCard'}, frequent:true, filter:function(event){ - return (get.type(event.card)=='trick'&&event.cards[0]&&event.cards[0]==event.card); + return (get.type(event.card)=='trick'&&(!event.cards.length||event.cards[0]&&event.cards[0]==event.card)); }, content:function(){ player.draw(); @@ -1843,7 +1843,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterTarget:function(card,player,target){ var trigger=_status.event.getTrigger(); if(get.distance(player,target,'attack')<=1&& - target!=trigger.player&&target!=player){ + target!=trigger.player&&!trigger.targets.contains(target)){ if(player.canUse(trigger.card,target)) return true; } return false; @@ -1866,15 +1866,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } return -1; }, - prompt:get.prompt('liuli') + prompt:get.prompt2('liuli') }); "step 1" if(result.bool){ player.discard(result.cards); player.logSkill(event.name,result.targets); trigger.target=result.targets[0]; - trigger.targets.remove(player); - trigger.targets.push(result.targets[0]); + for(var i=0;i1) return true; + if(player.storage.guanwei&&player.storage.guanwei.suit.length==1&&player.storage.guanwei.num>1) return true; return false; }, direct:true, content:function (){ 'step 0' - player.chooseToDiscard('he',get.prompt('xinfu_guanwei')).set('ai',function(card){ + player.chooseToDiscard('he',get.prompt2('xinfu_guanwei')).set('ai',function(card){ if(get.attitude(_status.event.player,_status.currentPhase)<1) return 0; return 9-get.value(card); }).set('logSkill','xinfu_guanwei'); @@ -3441,13 +3426,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:"useCard", }, filter:function (event,player){ - return _status.currentPhase==event.player; + return event.player.isPhaseUsing(); }, silent:true, content:function (){ - if(!player.storage.guanwei.contains(get.suit(trigger.card))){ - player.storage.guanwei.push(get.suit(trigger.card)); + if(!player.storage.guanwei.suit.contains(get.suit(trigger.card))){ + player.storage.guanwei.suit.push(get.suit(trigger.card)); } + player.storage.guanwei.num++; }, sub:true, forced:true, @@ -3459,7 +3445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, silent:true, content:function (){ - player.storage.guanwei=[]; + player.storage.guanwei={num:0,suit:[]}; }, sub:true, forced:true, @@ -5081,6 +5067,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, discard:false, lose:false, + delay:0, content:function (){ 'step 0' player.lose(cards,ui.special,'toStorage') @@ -5147,7 +5134,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } 'step 4' if(result.bool){ - trigger.player.damage(); + trigger.player.damage('nocard'); } }, }, @@ -5661,7 +5648,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "xinfu_jianjie":"荐杰", "xinfu_jianjie_info":"你的第一个准备阶段,你令两名其他角色分别获得龙印与凤印;出牌阶段限一次(你的第一个回合除外),或当拥有龙印、凤印的角色死亡时,你可以转移龙印、凤印。", "xinfu_jianjie1":"荐杰", - "xinfu_jianjie1_info":"出牌阶段,你可以弃一张牌,视为一名男性角色对另一名男性角色使用一张[决斗],每阶段限一次", + "xinfu_jianjie1_info":"", "smh_huoji":"火计", "smh_huoji_info":"", "smh_lianhuan":"连环", @@ -5675,7 +5662,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "xinfu_yinshi":"隐士", "xinfu_yinshi_info":"锁定技,若你没有龙印、凤印且没装备防具,防止你受到的属性伤害和锦囊牌造成的伤害。", "xinfu_chenghao":"称好", - "xinfu_chenghao_info":"当一名角色受到属性伤害后,若其处于“连环状态”且是伤害传导的起点,你可以观看牌堆顶的X+1张牌并分配给任意角色(X为横置的角色数量)。", + "xinfu_chenghao_info":"当一名角色受到属性伤害后,若其存活且处于“连环状态”且是伤害传导的起点,你可以观看牌堆顶的X张牌并分配给任意角色(X为横置的角色数量且包含该角色)。", "jianjie_faq":"关于龙凤印", "jianjie_faq_info":"龙印效果:获得“火计”。凤印效果:获得“连环”。(均一回合限使用三次) 龙凤印齐全:获得“业炎”,“业炎”发动后移除龙凤印。", "xinfu_wuniang":"武娘", diff --git a/character/yijiang.js b/character/yijiang.js index 1b65e16a2..8a98219f1 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -3348,6 +3348,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ fulin:{ trigger:{player:'phaseDiscardBegin'}, audio:2, + forced:true, content:function(){ player.addTempSkill('fulin2','phaseDiscardAfter'); }, @@ -3385,7 +3386,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player.storage.fulin&&player.storage.fulin.contains(card)){ return true; } - } + }, + cardDiscardable:function(card,player,name){ + if(name=='phaseDiscard'&&player.storage.fulin&&player.storage.fulin.contains(card)){ + return false; + } + }, }, }, duliang:{ @@ -5401,7 +5407,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'})) return false; - if(player.hasSkill('huomo2')) return false; + if(!lib.filter.cardRespondable({name:'sha'},player,event)) return false; + if(player.storage.huomo&&player.storage.huomo.shan) return false; if(event.parent.name!='sha') return false; var hs=player.getCards('he',{color:'black'}); for(var i=0;i0; + var range='ej'; + if(_status.event.nojudge) range='e'; + return target.countCards(range)>0; } }); + next.set('nojudge',event.nojudge||false); next.set('ai',function(target){ var player=_status.event.player; var att=get.attitude(player,target); if(ui.selected.targets.length==0){ if(att>0){ - if(target.countCards('j')) return 10; + if(!_status.event.nojudge&&target.countCards('j')) return 10; } else if(att<0){ if(game.hasPlayer(function(current){ @@ -12551,6 +12555,7 @@ } event.targets[0].$give(link,event.targets[1]) game.delay(); + event.result={bool:true}; } }, useCard:function(){ @@ -33755,7 +33760,7 @@ node.mode=mode; var list=[]; for(var i=0;i=4; - }); - var vacancies={ - equip1:0, - equip2:0, - equip3:0, - equip4:0, - equip5:0 - }; - for(var i=0;i'+get.translation(targets[i])+''); - info.push(es); - } - } - var next=player.chooseButton(true,[1,3]); - next.set('createDialog',info); - next.set('filterButton',function(button){ - return game.hasPlayer(function(current){ - return current.isEmpty(get.subtype(button.link)); - }); - }); - next.set('ai',function(button){ - var player=_status.event.player; - var owner=get.owner(button.link); - var att=get.attitude(player,owner); - if(att>0) return 0; - var subtype=get.subtype(button.link); - var vacancies=_status.event.vacancies; - var num=vacancies[subtype]; - for(var i=0;i0){ - var val=get.equipValue(button.link); - if(att>=-1){ - val-=2; - } - return val; - } - return 0; - }); - next.set('vacancies',vacancies); + event.count=3; 'step 1' - event.cards=result.links.slice(0); - event.num=0; + player.moveCard().nojudge=true; + event.count--; 'step 2' - if(event.num