From a91a9efd182a0fbb05c8788754309cffd8ab12d9 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 5 Dec 2016 10:45:27 +0800 Subject: [PATCH] s --- character/hearth.js | 149 +++++++++++++++++++++++++++++++++++++------ character/yijiang.js | 5 +- game/game.js | 95 +++++++++++++++++---------- game/update.js | 6 +- mode/boss.js | 15 +++-- 5 files changed, 209 insertions(+), 61 deletions(-) diff --git a/character/hearth.js b/character/hearth.js index b92afec89..4f77ac582 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -75,17 +75,17 @@ character.hearth={ // hs_nzoth:['male','shu',4,['nuyan']], hs_walian:['male','shu',4,['wzhanyi']], // hs_pengpeng:['male','qun',4,['zhadan']], - + // hs_yashaji:['male','wei',3,[]], // hs_wolazi:['male','wei',3,[]], + // hs_tanghangu:['male','wei',3,[]], // hs_aya:['male','wei',3,[]], // hs_barnes:['male','wei',3,[]], // hs_nuogefu:['male','wei',3,[]], - // hs_kazhakusi:['male','wei',3,[]], + hs_kazhakusi:['male','shu',3,['lianjin']], // hs_lazi:['male','wei',3,[]], - // hs_shaku:['male','wei',3,[]], - // hs_laxiao:['male','wei',3,[]], - // hs_yashaji:['male','wei',3,[]], + hs_shaku:['male','wei',3,['shouji']], + hs_laxiao:['male','qun',3,['guimou','yingxi']], // hs_xiangyaqishi:['male','wei',3,[]], }, perfectPair:{ @@ -95,6 +95,120 @@ character.hearth={ hs_malfurion:['hs_malorne'], }, skill:{ + lianjin:{ + enable:'phaseUse', + usable:2, + filterCard:true, + check:function(card){ + return 7-ai.get.value(card); + }, + content:function(){ + 'step 0' + var list=get.inpile('trick'); + list=list.randomGets(3); + for(var i=0;i0; + }, + content:function(){ + player.gain(game.createCard(trigger.target.get('h').randomGet()),'draw'); + } + }, + miss:{ + trigger:{player:'shaMiss'}, + frequent:true, + filter:function(event){ + return event.target.num('e')>0; + }, + content:function(){ + player.gain(game.createCard(trigger.target.get('e').randomGet()),'draw'); + } + } + } + }, + yingxi:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return !player.getStat('damage')&&player.num('he',{color:'black'})>0; + }, + content:function(){ + 'step 0' + player.chooseCardTarget({ + prompt:get.prompt('yingxi'), + filterCard:{color:'black'}, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target); + }, + position:'he', + ai1:function(card){ + return 8-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.effect(target,{name:'sha'},player,player); + } + }); + 'step 1' + if(result.bool){ + player.logSkill('yingxi',event.target); + player.useCard({name:'sha'},result.cards,result.targets); + } + }, + }, + guimou:{ + trigger:{player:'damageEnd'}, + check:function(event,player){ + return ai.get.attitude(player,event.source)<=0; + }, + filter:function(event,player){ + return event.source&&event.source.isAlive()&&event.source.num('h')>0; + }, + content:function(){ + var card=trigger.source.get('h').randomGet(); + if(card){ + player.gain(card); + if(get.color(card)=='black'){ + trigger.source.$give(card,player); + event.redo(); + } + else{ + trigger.source.$give(1,player); + } + game.delay(0.5); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(player.hasSkill('jueqing')) return [1,-2]; + if(!target.hasFriend()) return false; + if(get.tag(card,'damage')) return [1,0,0,-1]; + } + } + } + }, peiyu:{ enable:'phaseUse', filterCard:true, @@ -2201,20 +2315,7 @@ character.hearth={ trigger:{player:'phaseUseBegin'}, forced:true, content:function(){ - 'step 0' - var list=[]; - for(var i in lib.card){ - if(!lib.translate[i+'_info']) continue; - if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; - if(lib.card[i].type=='trick') list.push(['锦囊','',i]); - } - list=list.randomGets(3); - var dialog=ui.create.dialog('选择一张锦囊牌加入你的手牌',[list,'vcard'],'hidden'); - player.chooseButton(dialog,true); - 'step 1' - if(result.buttons){ - player.gain(game.createCard(result.buttons[0].link[2]),'gain2'); - } + player.gain(game.createCard(get.inpile('trick').randomGet()),'draw'); } }, lingzhou:{ @@ -4688,6 +4789,14 @@ character.hearth={ hs_laxiao:'拉希奥', hs_yashaji:'亚煞极', + lianjin:'炼金', + lianjin_info:'出牌阶段限两次,你可以弃置一张手牌,并从3张随机锦囊牌中选择一张加入手牌', + shouji:'收集', + shouji_info:'每当你使用一张杀,你可以获得一张目标随机手牌的复制;每当你的杀被闪避,你可以获得一张目标随机装备牌的复制', + guimou:'鬼谋', + guimou_info:'每当你受到一次伤害,你可以获得伤害来源的一张手牌,若此牌是黑色,你展示此牌并重复此过程', + yingxi:'影袭', + yingxi_info:'回合结束阶段,若你本回合未造成伤害,你可以将一张黑色牌当作杀对任意一名角色使用', peiyu:'培育', peiyu_info:'出牌阶段,你可以弃置一张牌令一名没有图腾的角色获得一个随机图腾,或令一名有图腾的角色替换一个图腾;你死亡时,其他角色失去以此法获得的图腾', wzhanyi:'战意', @@ -4834,7 +4943,7 @@ character.hearth={ liehun_info:'锁定技,回合结束阶段,你获得手牌中所有非基本牌的复制', malymowang:'魔网', malymowang2:'魔网', - malymowang_info:'锁定技,你的锦囊牌造成的伤害+1;出牌阶段开始时,你观看随机3张锦囊牌,并将其中一张加入你的手牌', + malymowang_info:'锁定技,你的锦囊牌造成的伤害+1;出牌阶段开始时,你随机获得一张锦囊牌', lingzhou:'灵咒', lingzhou_info:'每当你使用一张锦囊牌,可令一名角色摸一张牌或回复一点体力', mieshi:'灭世', diff --git a/character/yijiang.js b/character/yijiang.js index d584ca3b1..cf51f28ba 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -117,6 +117,9 @@ character.yijiang={ } return false; }, + ai:{ + threaten:1.5 + }, content:function(){ 'step 0' var goon=true; @@ -165,7 +168,7 @@ character.yijiang={ audio:false, content:function(){ if(!player.storage.xinsidi3&&player.storage.xinsidi4.isAlive()){ - player.useCard({name:'sha'},player.storage.xinsidi4); + player.storage.xinsidi4.useCard({name:'sha'},player); } delete player.storage.xinsidi2; delete player.storage.xinsidi3; diff --git a/game/game.js b/game/game.js index f85ded2c6..db3ee982d 100644 --- a/game/game.js +++ b/game/game.js @@ -1995,31 +1995,31 @@ } }, }, - hsmod:{ - enable:{ - name:'开启', - init:false, - restart:true, - onclick:function(bool){ - if(bool){ - lib.config.plays.add('hsmod'); - } - else{ - lib.config.plays.remove('hsmod'); - } - game.saveConfig('plays',lib.config.plays); - } - }, - hide:{ - name:'隐藏此扩展', - clear:true, - onclick:function(){ - this.innerHTML='此扩展将在重启后隐藏'; - lib.config.hiddenPlayPack.add('hsmod'); - game.saveConfig('hiddenPlayPack',lib.config.hiddenPlayPack); - } - }, - }, + // hsmod:{ + // enable:{ + // name:'开启', + // init:false, + // restart:true, + // onclick:function(bool){ + // if(bool){ + // lib.config.plays.add('hsmod'); + // } + // else{ + // lib.config.plays.remove('hsmod'); + // } + // game.saveConfig('plays',lib.config.plays); + // } + // }, + // hide:{ + // name:'隐藏此扩展', + // clear:true, + // onclick:function(){ + // this.innerHTML='此扩展将在重启后隐藏'; + // lib.config.hiddenPlayPack.add('hsmod'); + // game.saveConfig('hiddenPlayPack',lib.config.hiddenPlayPack); + // } + // }, + // }, }, mode:{ identity:{ @@ -6877,16 +6877,27 @@ return; } if(event.isMine()){ - event.controlbar=ui.create.control(event.controls); - if(event.dialog){ - if(Array.isArray(event.dialog)){ - event.dialog=ui.create.dialog.apply(this,event.dialog); + if(event.dialogcontrol){ + event.dialog=ui.create.dialog(event.prompt||'选择一项','hidden'); + for(var i=0;i'+event.controls[i]+''); + item.firstChild.listen(ui.click.dialogcontrol); + item.firstChild.link=event.controls[i]; } - event.dialog.open(); - } - else if(event.prompt){ - event.dialog=ui.create.dialog(event.prompt); - } + event.dialog.open(); + } + else{ + event.controlbar=ui.create.control(event.controls); + if(event.dialog){ + if(Array.isArray(event.dialog)){ + event.dialog=ui.create.dialog.apply(this,event.dialog); + } + event.dialog.open(); + } + else if(event.prompt){ + event.dialog=ui.create.dialog(event.prompt); + } + } game.pause(); game.countChoose(); event.choosing=true; @@ -6907,6 +6918,7 @@ } else event.result.control=event.controls[event.choice]; } + event.result.index=event.controls.indexOf(event.result.control); event.choosing=false; _status.imchoosing=false; if(event.dialog&&event.dialog.close) event.dialog.close(); @@ -9948,7 +9960,10 @@ var next=game.createEvent('chooseControl'); next.controls=[]; for(var i=0;i