From fbe7a8c422b61a281779ef9cfcc3604b5c248541 Mon Sep 17 00:00:00 2001 From: libccy Date: Thu, 19 Jan 2017 21:00:41 +0800 Subject: [PATCH] c --- card/standard.js | 6 +- card/swd.js | 23 ++- character/ow.js | 6 +- character/rank.js | 2 + character/sp.js | 7 +- character/xianjian.js | 376 ++++++++++++++++++++++++++++++++++-------- character/yijiang.js | 3 +- game/game.js | 96 +++++++---- 8 files changed, 400 insertions(+), 119 deletions(-) diff --git a/card/standard.js b/card/standard.js index 009bfc9e2..f8ae58f5c 100644 --- a/card/standard.js +++ b/card/standard.js @@ -633,7 +633,8 @@ card.standard={ }, basic:{ order:9, - useful:[5,1] + useful:[5,1], + value:5 }, result:{ target:function(player,target){ @@ -693,7 +694,8 @@ card.standard={ }, basic:{ order:9, - useful:1 + useful:1, + value:5 }, result:{ target:function(player,target){ diff --git a/card/swd.js b/card/swd.js index c251b337e..88df51ee0 100644 --- a/card/swd.js +++ b/card/swd.js @@ -1548,7 +1548,8 @@ card.swd={ }, basic:{ order:9, - useful:[5,1] + useful:[5,1], + value:5 }, result:{ target:function(player,target){ @@ -1609,7 +1610,8 @@ card.swd={ }, basic:{ order:9, - useful:1 + useful:1, + value:5 }, result:{ target:function(player,target){ @@ -1861,6 +1863,7 @@ card.swd={ content:function(){ 'step 0' player.addSkill('shuchui2'); + player.storage.shuchui2=0; event.num=0; 'step 1' var card=player.get('h','sha')[0]; @@ -1868,15 +1871,20 @@ card.swd={ player.useCard(card,target); } else{ + if(player.storage.shuchui2){ + player.draw(player.storage.shuchui2); + } player.removeSkill('shuchui2'); event.finish(); } 'step 2' - event.num++; - if(event.num<3&&target.isAlive()){ + if(event.num++<2&&target.isAlive()){ event.goto(1); } else{ + if(player.storage.shuchui2){ + player.draw(player.storage.shuchui2); + } player.removeSkill('shuchui2'); } }, @@ -1893,11 +1901,14 @@ card.swd={ trigger:{source:'damageEnd'}, forced:true, popup:false, + onremove:function(player){ + delete player.storage.shuchui2; + }, filter:function(event,player){ return event.card&&event.card.name=='sha'; }, content:function(){ - player.draw(); + player.storage.shuchui2++; } }, xuejibingbao:{ @@ -4281,7 +4292,7 @@ card.swd={ fengyinzhidan:'封印之蛋', fengyinzhidan_info:'随机使用三张非延时锦囊牌(随机指定目标)', shuchui:'鼠槌', - shuchui_info:'出牌阶段限一次,你可以指定一名攻击范围内的角色,依次将手牌中的所有杀对该角色使用,杀每造成一次伤害你摸一张牌(最多使用3张杀)', + shuchui_info:'出牌阶段限一次,你可以指定一名攻击范围内的角色,依次将手牌中的至多3张杀对该角色使用,杀每造成一次伤害你摸一张牌', zhiluxiaohu:'指路小狐', zhiluxiaohu_info:'出牌阶段对自己使用,视为对一名随机敌方角色使用一张杀,然后摸一张牌', xuejibingbao:'雪肌冰鲍', diff --git a/character/ow.js b/character/ow.js index 9f14fc79d..e62326d50 100644 --- a/character/ow.js +++ b/character/ow.js @@ -170,7 +170,7 @@ character.ow={ forced:true, popup:false, filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.storage.paotai>0; + return player.storage.paotai>0; }, content:function(){ player.storage.paotai--; @@ -1785,7 +1785,7 @@ character.ow={ luan2:{ mark:true, intro:{ - content:'受到的伤害+1,直到首次进入濒死状态' + content:'受到的伤害后流失一点体力,直到首次进入濒死状态' }, trigger:{player:'damageEnd'}, forced:true, @@ -2604,7 +2604,7 @@ character.ow={ zhongdun_info:'游戏开始时,你获得等同于游戏人数护甲;出牌阶段限一次,你可以弃置一张牌并将一点护甲分给一名没有护甲的其他角色', paotai:'炮台', paotai2:'炮台', - paotai_info:'出牌阶段,你可以弃置一张杀布置或升级一个炮台(最高3级);回合结束阶段,炮台有一定机率对一名随机敌人造成一点火焰伤害;每当你受到杀造成的伤害,炮台降低一级', + paotai_info:'出牌阶段,你可以弃置一张杀布置或升级一个炮台(最高3级);回合结束阶段,炮台有一定机率对一名随机敌人造成一点火焰伤害;每当你受到一次伤害,炮台降低一级', maoding:'铆钉', maoding2:'铆钉', maoding_info:'每当你造成或受到一次伤害,你可以获得一个零件;出牌限阶段限一次,你可以弃置两张零件牌令一名没有护甲的角色获得一点护甲', diff --git a/character/rank.js b/character/rank.js index dcf5fe493..57ef20ff0 100644 --- a/character/rank.js +++ b/character/rank.js @@ -18,6 +18,7 @@ window.characterRank={ 'pal_liumengli', ], ap:[ + 'pal_xiahoujinxuan', 'swd_huiyan', 'hs_medivh', 'ow_dva', @@ -134,6 +135,7 @@ window.characterRank={ 'pal_wangpengxu', 'yxs_luobinhan', 'hs_alleria', + 'pal_wenhui', ], am:[ 'swd_duanmeng', diff --git a/character/sp.js b/character/sp.js index 63c88e5a2..00225eb23 100644 --- a/character/sp.js +++ b/character/sp.js @@ -426,7 +426,6 @@ character.sp={ skillAnimation:true, unique:true, enable:'phaseUse', - mark:true, zhuSkill:true, filter:function(event,player){ if(!player.hasZhuSkill('shichou'))return false; @@ -435,7 +434,10 @@ character.sp={ }, selectCard:2, init:function(player){ - player.storage.shichou=false; + if(player.hasZhuSkill('shichou')){ + player.markSkill('shichou'); + player.storage.shichou=false; + } }, filterTarget:function(card,player,target){ return target.group=='shu'&&target!=player; @@ -2735,6 +2737,7 @@ character.sp={ trigger:{player:'phaseDiscardBegin'}, direct:true, filter:function(event,player){ + if(!player.storage.xingwu_color) return false; var length=player.storage.xingwu_color.length; if(length==0) return false; var hs=player.get('h'); diff --git a/character/xianjian.js b/character/xianjian.js index b3fbe4c39..5d0188d62 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -16,7 +16,7 @@ character.xianjian={ pal_changqing:['male','wei',4,['luanjian','tianfu']], pal_nangonghuang:['male','wei',3,['zhaoyao','sheling','zhangmu']], - // pal_wenhui:['female','shu',4,[]], + pal_wenhui:['female','shu',4,['huxi','longxiang']], pal_wangpengxu:['female','shu',3,['duxinshu','feixu']], pal_xingxuan:['male','wei',3,['feizhua','leiyu','lingxue']], // pal_leiyuange:['male','wei',3,[]], @@ -32,82 +32,313 @@ character.xianjian={ // pal_longyou:['male','wei',4,[]], // pal_xiaoman:['male','wei',4,[]], - // pal_xiahoujinxuan:['male','shu',3,['lingyan','danqing']], + pal_xiahoujinxuan:['male','shu',3,['xuanmo','lingyan','danqing']], // pal_muchanglan:['male','wei',4,[]], // pal_xia:['male','wei',4,[]], // pal_jiangcheng:['male','wei',4,[]], }, skill:{ - lingyan:{ - trigger:{player:'useCard'}, + longxiang:{ + trigger:{player:'shaBegin'}, filter:function(event,player){ - console.log(event.card.name); - return lib.skill.lingyan.filterx(event.card)&&event.target==player; + return event.target.num('h')>player.num('h'); + }, + check:function(event,player){ + return ai.get.attitude(player,event.target)<0; + }, + logTarget:'target', + content:function(){ + var hs=trigger.target.get('h'); + trigger.target.discard(hs.randomGets(hs.length-player.num('h'))); + } + }, + huxi:{ + enable:'chooseToUse', + viewAs:{name:'sha'}, + precontent:function(){ + 'step 0' + player.loseHp(); + 'step 1' + player.changeHujia(); + }, + filterCard:function(){return false}, + selectCard:-1, + prompt:'失去一点体力并获得一点护甲,视为使用一张杀', + ai:{ + order:function(){ + var player=_status.event.player; + if(player.hp<=2) return 0; + return 2; + }, + skillTagFilter:function(player,tag,arg){ + if(arg!='use') return false; + }, + respondSha:true, + } + }, + xuanmo:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + var type=get.type(card,'trick'); + return type=='basic'||type=='equip'||type=='trick'; + }, + check:function(card){ + return 8-ai.get.value(card); + }, + filter:function(event,player){ + return player.num('h')>0; + }, + discard:false, + prepare:'throw', + content:function(){ + game.log(player,'将',cards,'置于牌堆顶'); + ui.cardPile.insertBefore(cards[0],ui.cardPile.firstChild); + var list=get.inpile(get.type(cards[0],'trick'),'trick').randomGets(2); + for(var i=0;i0){ + return att+1/Math.sqrt(1+target.num('h')); + } + return 0; + }; + 'step 2' + if(result.bool){ + player.line(result.targets[0],'green'); + result.targets[0].draw(); + event.targets.push(result.targets[0]); + if(event.targets.length==game.players.length){ + event.finish(); + } + else{ + player.chooseTarget('令一名角色获得一点护甲',function(card,player,target){ + return !event.targets.contains(target); + }).ai=function(target){ + var att=ai.get.attitude(player,target); + if(att>0){ + return att+1/Math.sqrt(1+target.hp); + } + return 0; + }; + } + } + else{ + event.finish(); + } + 'step 3' + if(result.bool){ + player.line(result.targets[0],'green'); + result.targets[0].changeHujia(); + game.delay(); + event.targets.push(result.targets[0]); + if(event.targets.length==game.players.length){ + event.finish(); + } + else{ + player.chooseTarget('令一名角色装备一件随机装备',function(card,player,target){ + return !event.targets.contains(target); + }).ai=function(target){ + var att=ai.get.attitude(player,target); + if(att>0&&!target.get('e','5')){ + return att; + } + return 0; + }; + } + } + else{ + event.finish(); + } + 'step 4' + if(result.bool){ + player.line(result.targets[0],'green'); + game.delay(); + var list=[]; + for(var i=0;i0){ + return att+1/Math.sqrt(1+target.hp); + } + return 0; + }; + } + } + else{ + event.finish(); + } + 'step 5' + if(result.bool){ + player.line(result.targets[0],'green'); + game.delay(); + result.targets[0].addTempSkill('hslingjian_yinshen',{player:'phaseBegin'}); + } + } + }, + lingyan:{ + trigger:{player:'useCardToBegin'}, + filter:function(event,player){ + if(player.num('e')==5) return false; + return lib.skill.lingyan.filterx(event.card,player)&&event.target==player; }, direct:true, - filterx:function(card){ + filterx:function(card,player){ if(!lib.inpile.contains(card.name)) return false; var info=get.info(card); if(info.type!='equip') return false; if(info.nomod) return false; + if(!info.subtype) return false; + if(!player.get('e',info.subtype[5])) return false; return true; }, - group:'lingyan_lose', content:function(){ 'step 0' - var list=['equip1','equip2','equip3','equip4','equip5','cancelx']; - var list2=[]; - var subtype=get.subtype(trigger.card); - list.remove(subtype); - for(var i=0;i<4;i++){ - if(!player.get('e',subtype[5])){ - list2.push(list[i]); + var list=['equip1','equip2','equip3','equip4','equip5']; + for(var i=0;i0&&num2>=2; - }, - prompt:function(event,player){ - for(var i=0;i0&&num2>=2){ + return 7-ai.get.value(card); } - } - return get.prompt('leiyu',player.storage.leiyu); - }, - filter:function(event,player){ - if(player.storage.leiyu){ - for(var i=0;i1) this.node.background.classList.add('tight'); else this.node.background.classList.remove('tight'); } - if(lib.card[card[2]].noname&&!this.classList.contains('button')){ + if(info.noname&&!this.classList.contains('button')){ this.node.name.style.display='none'; } - if(lib.card[card[2]].color){ - this.style.color=lib.card[card[2]].color; + if(info.color){ + this.style.color=info.color; } - else if(lib.card[card[2]].fullimage){ + else if(info.fullimage){ this.style.color='white'; } - if(lib.card[card[2]].textShadow){ - this.style.textShadow=lib.card[card[2]].textShadow; + if(info.textShadow){ + this.style.textShadow=info.textShadow; } - else if(lib.card[card[2]].fullimage){ + else if(info.fullimage){ this.style.textShadow='black 0 0 2px'; } - if(lib.card[card[2]].opacity){ - this.node.info.style.opacity=lib.card[card[2]].opacity; - this.node.name.style.opacity=lib.card[card[2]].opacity; + if(info.opacity){ + this.node.info.style.opacity=info.opacity; + this.node.name.style.opacity=info.opacity; } - else if(lib.card[card[2]].fullimage){ + else if(info.fullimage){ this.node.info.style.opacity=1; this.node.name.style.opacity=1; } - if(lib.card[card[2]].modinfo){ - this.node.info.innerHTML=lib.card[card[2]].modinfo; + if(info.modinfo){ + this.node.info.innerHTML=info.modinfo; } else{ this.node.info.innerHTML=get.translation(card[0])+' '+card[1]; } - if(lib.card[card[2]].addinfo){ + if(info.addinfo){ this.node.addinfo=ui.create.div('.range',this); - this.node.addinfo.innerHTML=lib.card[card[2]].addinfo; + this.node.addinfo.innerHTML=info.addinfo; } if(card[0]=='heart'||card[0]=='diamond'){ this.node.info.classList.add('red'); @@ -13537,13 +13554,13 @@ this.classList.remove(this.nature); delete this.nature; } - if(lib.card[card[2]].subtype) this.classList.add(lib.card[card[2]].subtype); + if(info.subtype) this.classList.add(info.subtype); if(this.inits){ for(var i=0;i