From 590fadd89a77bcf5c6b84c6c7395bfc414c68739 Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 26 Nov 2017 13:21:55 +0800 Subject: [PATCH] v1.9.45.3 --- card/gwent.js | 71 +++++++++++++++++++------------ character/diy.js | 19 +++++---- character/gwent.js | 9 +++- character/refresh.js | 35 +++++++-------- character/shenhua.js | 14 +++++- character/sp.js | 77 ++++++++++++++++++++++++++++----- character/yijiang.js | 13 +++--- game/game.js | 89 ++++++++++++++++++++++++++++++++++++--- game/update.js | 16 ++++--- layout/default/layout.css | 14 +++--- 10 files changed, 260 insertions(+), 97 deletions(-) diff --git a/card/gwent.js b/card/gwent.js index 93a0a0b7e..9df0ffe59 100644 --- a/card/gwent.js +++ b/card/gwent.js @@ -1746,11 +1746,16 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'spell_bronze', enable:true, filterTarget:function(card,player,target){ - return target.isMinHp()&&target.countCards('h'); + return target.isMinHp(); }, selectTarget:-1, content:function(){ - target.randomDiscard('h'); + if(target.countCards('h')){ + target.randomDiscard('h'); + } + else{ + target.loseHp(); + } }, ai:{ basic:{ @@ -1759,7 +1764,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ useful:[4,1], }, result:{ - target:-1 + target:function(player,target){ + if(target.countCards('h')) return -1; + return -2; + } }, tag:{ multitarget:1, @@ -1832,36 +1840,43 @@ game.import('card',function(lib,game,ui,get,ai,_status){ mark:true, nopop:true, intro:{ - content:'不能成为其他角色的普通锦囊牌的目标(剩余#回合)' + content:'防止所有非属性伤害(剩余个#角色的回合)' }, - mod:{ - targetEnabled:function(card,player,target,now){ - if(player!=target){ - if(get.type(card)=='trick') return false; - } - } - }, init:function(player){ - // if(game.players.length>=6){ - // player.storage.gw_kunenfayin=3; - // } - // else{ - // player.storage.gw_kunenfayin=2; - // } - player.storage.gw_kunenfayin=3; + player.storage.gw_kunenfayin=Math.min(5,game.countPlayer()); + }, + trigger:{player:'damageBefore'}, + filter:function(event){ + return !event.nature; }, - trigger:{player:'phaseEnd'}, forced:true, - popup:false, content:function(){ - player.storage.gw_kunenfayin--; - if(player.storage.gw_kunenfayin>0){ - player.updateMarks(); - } - else{ - player.removeSkill('gw_kunenfayin'); + trigger.cancel(); + }, + ai:{ + nodamage:true, + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'damage')&&!get.tag(card,'natureDamage')) return [0,0]; + } + }, + }, + subSkill:{ + count:{ + trigger:{global:'phaseEnd'}, + silent:true, + content:function(){ + player.storage.gw_kunenfayin--; + if(player.storage.gw_kunenfayin>0){ + player.updateMarks(); + } + else{ + player.removeSkill('gw_kunenfayin'); + } + }, } }, + group:'gw_kunenfayin_count', onremove:true }, gw_baobaoshu:{ @@ -2226,13 +2241,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){ gw_ciguhanshuang_bg:'霜', gw_ciguhanshuang_info:'天气牌,出牌阶段对一名角色及其相邻角色使用,目标下个摸牌阶段摸牌数-1', gw_wenyi:'瘟疫', - gw_wenyi_info:'令所有体力值为全场最少的角色随机弃置一张手牌', + gw_wenyi_info:'令所有体力值为全场最少的角色随机弃置一张手牌;若没有手牌,改为失去一点体力', gw_yanziyaoshui:'燕子药水', gw_yanziyaoshui_info:'令一名角色摸一张牌,若其手牌数为全场最少或之一,改为摸两张', gw_shanbengshu:'山崩术', gw_shanbengshu_info:'出牌阶段对自己使用,随机弃置两件敌方角色场上的装备', gw_kunenfayin:'昆恩法印', - gw_kunenfayin_info:'出牌阶段对一名角色使用,目标不能成为其他角色的普通锦囊牌的目标,持续3回合', + gw_kunenfayin_info:'出牌阶段对一名角色使用,目标防止所有非属性伤害,持续X个角色的回合(X为存活角色数且最多为5)', }, cardType:{ spell:0.5, diff --git a/character/diy.js b/character/diy.js index 855b4373d..60f18f4f7 100644 --- a/character/diy.js +++ b/character/diy.js @@ -121,17 +121,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ subSkill:{ use:{ enable:'phaseUse', - usable:2, + usable:1, filterCard:true, check:function(card){ return 9-get.value(card); }, filter:function(event,player){ - if(!player.storage.nstuiyan2_done&&player.getStat().skill.nsbugua_use){ - return false; - } - return player.countCards('h'); + // if(!player.storage.nstuiyan2_done&&player.getStat().skill.nsbugua_use){ + // return false; + // } + return player.countCards('he'); }, + position:'he', content:function(){ 'step 0' player.throwDice(); @@ -206,7 +207,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return _status.currentPhase==player&&event.getParent('phaseUse',true)&&!player.hasSkill('nstuiyan_fail')&& typeof player.storage.nstuiyan=='number'&&event.card.number>player.storage.nstuiyan; }, - forced:true, + frequent:true, content:function(){ player.draw(); }, @@ -297,9 +298,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } player.storage.nstuiyan=trigger.card.number; player.storage.nstuiyan2+=trigger.card.number; - if(player.storage.nstuiyan2%8==0){ + if(player.storage.nstuiyan2%8==0&&!player.storage.nstuiyan2_done){ player.storage.nstuiyan2_done=true; - // player.addTempSkill('nstuiyan_bugua'); + player.addTempSkill('nstuiyan_bugua'); } player.markSkill('nstuiyan'); } @@ -3576,7 +3577,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ nsbugua_use_info:'弃置一张手牌,并将牌堆顶的六张牌反面朝上逐张按先后顺序排放,然后抛骰子,展示牌序号与骰子显示的点数一致的牌,然后你根据这张牌的花色、点数随机获得牌堆中相应的一张牌', nsbugua_info:'出牌阶段限一次,你可以弃置一张手牌,并将牌堆顶的六张牌反面朝上逐张按先后顺序排放,然后抛骰子,展示牌序号与骰子显示的点数一致的牌,然后你根据这张牌的花色、点数按以下规则随机获得牌堆中相应的一张牌:乾(红桃偶数):无中生有;坤(黑桃奇数):决斗;震(黑桃偶数):南蛮入侵;巽(红桃奇数):万箭齐发;坎(梅花偶数):过河拆桥、兑(梅花奇数):借刀杀人、艮(方片偶数):顺手牵羊、离(方片奇数):火攻。若牌堆中无此牌则摸一张牌,然后你观看未展示的另外五张牌并按任意顺序将其置于牌堆顶。', nstuiyan:'推演', - nstuiyan_info:'锁定技,出牌阶段,若你使用的牌点数比上一张使用的牌点数大,你摸一张牌,否则你本回合不能再以此法摸牌;当你使用的牌点数首次达到8的倍数时,你额外获得一次【卜卦】的机会', + nstuiyan_info:'出牌阶段,若你使用的牌点数比上一张使用的牌点数大,你可以摸一张牌,反之你本回合不能再以此法摸牌;当你使用的牌点数首次达到8的倍数时,你可以在结算后立即发动一次【卜卦】', nstianji:'天机', nstianji_info:'限定技,当一名其他角色进入濒死状态,你可自减一点体力上限,令其回复体力至1并增加一点体力上限', nszhaoxin:'昭心', diff --git a/character/gwent.js b/character/gwent.js index d8552e761..934771ade 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -1011,8 +1011,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else if(button.link[2]=='gw_wenyi'){ if(game.countPlayer(function(current){ - if(current.isMinHp()&¤t.countCards('he')){ - return -get.sgn(get.attitude(player,current)); + if(current.isMinHp()){ + if(!current.countCards('h')){ + return -2*get.sgn(get.attitude(player,current)); + } + else{ + return -get.sgn(get.attitude(player,current)); + } } })>0){ return 2; diff --git a/character/refresh.js b/character/refresh.js index 7e4f09827..71e9ea134 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -1245,6 +1245,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', usable:1, + delay:0, filter:function(event,player){ return game.hasPlayer(function(current){ return current.sex=='male'; @@ -1260,33 +1261,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 'red'; }); "step 1" - var num=20; - var card; - event.cards=[]; - while(num--){ - card=get.cards(0); - event.cards.push(card); - if(get.color(card)==result.control) break; - else if(get.type(card,'trick')==result.control) break; + event.card=get.cardPile(function(card){ + if(get.color(card)==result.control) return true; + if(get.type(card,'trick')==result.control) return true; + return false; + },'cardPile'); + if(!event.card){ + event.finish(); + return; } - event.card=card; - player.showCards(event.cards); + player.showCards([event.card]); + "step 2" player.chooseTarget(true,'选择一名男性角色送出'+get.translation(event.card),function(card,player,target){ return target.sex=='male'; }).set('ai',function(target){ var att=get.attitude(_status.event.player,target); if(_status.event.neg) return -att; return att; - }).set('neg',get.value(card,player,'raw')<0); - "step 2" - player.line(result.targets,'green'); - result.targets[0].$gain2(event.card); - for(var i=0;i=player.hp&&player!=event.player; + if(!player.hasSkill('fenxin_nei')){ + if(!player.countCards('h',{color:'black'})) return false; + } + return (event.player.hp>=player.hp||player.hasSkill('fenxin_fan'))&&player!=event.player; }, content:function(){ 'step 0' var goon=(get.attitude(player,trigger.player)<0); - var next=player.chooseToDiscard(get.prompt('jieyuan',trigger.player),{color:'black'}); + var next=player.chooseToDiscard(get.prompt('jieyuan',trigger.player)); + if(!player.hasSkill('fenxin_nei')){ + next.set('filterCard',function(card){ + return get.color(card)=='black'; + }); + next.set('prompt2','弃置一张黑色手牌令伤害+1'); + } + else{ + next.set('prompt2','弃置一张手牌令伤害+1'); + } next.set('ai',function(card){ if(_status.event.goon){ return 8-get.value(card); @@ -5564,14 +5575,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:true, trigger:{player:'damageBegin'}, filter:function(event,player){ - if(!player.countCards('h',{color:'red'})) return false; - return event.source&&event.source.hp>=player.hp&&player!=event.source; + if(!player.hasSkill('fenxin_nei')){ + if(!player.countCards('h',{color:'red'})) return false; + } + return event.source&&(event.source.hp>=player.hp||player.hasSkill('fenxin_zhong'))&&player!=event.source; }, direct:true, content:function(){ "step 0" - var next=player.chooseToDiscard('竭缘:是否弃置一张红色手牌令伤害-1?',{color:'red'}); - next.set('ai',function(card){ + var next=player.chooseToDiscard(get.prompt('jieyuan'),{color:'red'}); + if(!player.hasSkill('fenxin_nei')){ + next.set('filterCard',function(card){ + return get.color(card)=='red'; + }); + next.set('prompt2','弃置一张红色手牌令伤害-1'); + } + else{ + next.set('prompt2','弃置一张手牌令伤害-1'); + } + next.set('ai',function(card){ var player=_status.event.player; if(player.hp==1||_status.event.getTrigger().num>1){ return 9-get.value(card); @@ -5584,7 +5606,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ next.logSkill='jieyuan_less'; "step 1" if(result.bool){ - game.delay(); trigger.num--; } } @@ -5595,7 +5616,40 @@ game.import('character',function(lib,game,ui,get,ai,_status){ threaten:1.5 } }, - fenxin:{ + fenxin:{ + mode:['identity'], + trigger:{global:'dieAfter'}, + filter:function(event,player){ + return ['fan','zhong','nei'].contains(event.player.identity)&&!player.hasSkill('fenxin_'+event.player.identity); + }, + forced:true, + content:function(){ + player.addSkill('fenxin_'+trigger.player.identity); + player.markSkill('fenxin'); + }, + intro:{ + mark:function(dialog,content,player){ + if(player.hasSkill('fenxin_zhong')){ + dialog.addText('你发动“竭缘”减少伤害无体力值限制'); + } + if(player.hasSkill('fenxin_fan')){ + dialog.addText('你发动“竭缘”增加伤害无体力值限制'); + } + if(player.hasSkill('fenxin_nei')){ + dialog.addText('将“竭缘”中的黑色手牌和红色手牌改为一张牌'); + } + } + }, + subSkill:{ + fan:{}, + zhong:{}, + nei:{} + }, + ai:{ + combo:'jieyuan' + } + }, + fenxin_old:{ mode:['identity'], trigger:{source:'dieBegin'}, init:function(player){ @@ -9732,8 +9786,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jieyuan_more:'竭缘', jieyuan_less:'竭缘', jieyuan_info:'当你对一名其他角色造成伤害时,若其体力值大于或等于你的体力值,你可弃置一张黑色手牌令此伤害+1;当你受到一名其他角色造成的伤害时,若其体力值大于或等于你的体力值,你可弃置一张红色手牌令此伤害-1。', - fenxin:'焚心', - fenxin_info:'限定技,当你杀死一名非主公角色时,在其翻开身份牌之前,你可以与该角色交换身份牌。(你的身份为主公时不能发动此技能)', + fenxin:'焚心', + fenxin_info:'锁定技,一名其他角色死亡后,若其身份为:忠臣,你发动“竭缘”减少伤害无体力值限制;反贼,你发动“竭缘”增加伤害无体力值限制;内奸,将“竭缘”中的黑色手牌和红色手牌改为一张牌。', + fenxin_old_info:'限定技,当你杀死一名非主公角色时,在其翻开身份牌之前,你可以与该角色交换身份牌。(你的身份为主公时不能发动此技能)', shixin:'释衅', shixin_info:'锁定技,当你受到火属性伤害时,你防止此伤害', qingyi:'轻逸', diff --git a/character/yijiang.js b/character/yijiang.js index e0a0aac2b..b7a9f019f 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -1367,18 +1367,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' if(player.storage.fumian_choice=='draw'){ - player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸一张牌','你使用红色牌可以多选择两个目标',function(event,player){ + player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸一张牌','使用红色牌可以多选择两个目标(限一次)',function(event,player){ if(player.hp==1||player.countCards('h')<=1) return 0; return 1; }); } else if(player.storage.fumian_choice=='red'){ - player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸两张牌','你使用红色牌可以多选择一个目标',function(event,player){ + player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸两张牌','使用红色牌可以多选择一个目标(限一次)',function(event,player){ return 0; }); } else{ - player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸一张牌','你使用红色牌可以多选择一个目标',function(event,player){ + player.chooseControlList(get.prompt('fumian'),'摸牌阶段多摸一张牌','使用红色牌可以多选择一个目标(限一次)',function(event,player){ if(player.hp==1||player.countCards('h')=this.maxHp) this.hp=this.maxHp; @@ -24182,6 +24225,16 @@ } } }, + setAvatar:function(player,content){ + if(player&&content&&content.length==2){ + player.setAvatar(content[0],content[1]) + } + }, + setAvatarQueue:function(player,content){ + if(player&&content&&content.length==2){ + player.setAvatarQueue(content[0],content[1]) + } + }, addSubPlayer:function(player,content){ if(player&&content&&content[0]&&content[1]&& content[2]&&content[3]&&content[4]){ @@ -29135,15 +29188,37 @@ ul.appendChild(li); } var dialog=ui.create.dialog(caption,'hidden'); - dialog.content.appendChild(ul); + var lic=ui.create.div(dialog.content); + lic.style.display='block'; + ul.style.display='inline-block'; + ul.style.marginLeft='-40px'; + lic.appendChild(ul); if(players){ - dialog.addSmall([players,'character']); + for(var i=0;i