From 9fca1cb77ee7a563156c879284d9f7918fbb485a Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 18 Jan 2017 11:00:22 +0800 Subject: [PATCH] 1 --- card/guozhan.js | 1 + card/sp.js | 1 + card/swd.js | 2 + character/extra.js | 2 +- character/gujian.js | 252 +++++++++++++++++++++++++++++++++++++++++-- character/hearth.js | 107 +++++++++--------- character/ow.js | 13 ++- character/shenhua.js | 6 +- character/sp.js | 2 +- character/swd.js | 5 +- character/yijiang.js | 8 +- game/config.js | 5 + game/game.js | 82 +++++++++++--- game/update.js | 32 +++--- mode/chess.js | 4 +- mode/stone.js | 6 +- 16 files changed, 419 insertions(+), 109 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index e9b6c24da..1453aa837 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -290,6 +290,7 @@ card.guozhan={ fullskin:true, type:"equip", subtype:"equip2", + nomod:true, skills:['huxinjing'], ai:{ basic:{ diff --git a/card/sp.js b/card/sp.js index 3ff2161b1..6d208acb3 100644 --- a/card/sp.js +++ b/card/sp.js @@ -18,6 +18,7 @@ card.sp={ fullskin:true, type:'equip', subtype:'equip5', + nomod:true, skills:['muniu_skill','muniu_skill2','muniu_skill7'], ai:{ basic:{ diff --git a/card/swd.js b/card/swd.js index b6f54982a..c251b337e 100644 --- a/card/swd.js +++ b/card/swd.js @@ -492,6 +492,7 @@ card.swd={ fullskin:true, type:'equip', subtype:'equip5', + nomod:true, ai:{ equipValue:7 }, @@ -1697,6 +1698,7 @@ card.swd={ fullskin:true, type:'equip', subtype:'equip5', + nomod:true, skills:['yiluan'], ai:{ basic:{ diff --git a/character/extra.js b/character/extra.js index e92ea93af..5634d9ab7 100644 --- a/character/extra.js +++ b/character/extra.js @@ -854,7 +854,7 @@ character.extra={ }, filterTarget:function(card,player,target){ var length=ui.selected.cards.length; - return player!=target&&(length==0||length==4); + return (length==0||length==4); }, filterCard:function(card){ var suit=get.suit(card); diff --git a/character/gujian.js b/character/gujian.js index d7812468b..d93f574c6 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -7,12 +7,248 @@ character.gujian={ gjqt_yinqianshang:['male','qun',4,['zhongji','zuizhan']], gjqt_hongyu:['female','shu',4,['jianwu','meiying']], - gjqt_yuewuyi:['male','wei',4,['yanjia','xiuhua']], + gjqt_yuewuyi:['male','wei',4,['yanjia','xiuhua','liuying']], gjqt_wenrenyu:['female','shu',4,['jizhan','qianjun']], gjqt_xiayize:['male','qun',3,['xuanning','liuguang','yangming']], gjqt_aruan:['female','wu',3,['zhaolu','jiehuo','yuling']], }, skill:{ + xiuhua:{ + trigger:{global:'loseEnd'}, + filter:function(event,player){ + if(event.player==player) return false; + if(event.parent.name!='equip'&&event.parent.name!='discard') return false; + for(var i=0;i=2) return true; + } + } + }, + filterCard:function(card){ + var info=get.info(card); + return info.type=='equip'&&!info.nomod&&lib.inpile.contains(card.name); + }, + selectCard:2, + position:'he', + check:function(card){ + return ai.get.value(card); + }, + content:function(){ + var name=cards[0].name+'_'+cards[1].name; + var info1=get.info(cards[0]),info2=get.info(cards[1]); + if(!lib.card[name]){ + var info={ + enable:true, + type:'equip', + subtype:get.subtype(cards[0]), + vanish:true, + cardimage:info1.cardimage||cards[0].name, + filterTarget:function(card,player,target){ + return target==player; + }, + selectTarget:-1, + modTarget:true, + content:lib.element.content.equipCard, + legend:true, + onEquip:[], + onLose:[], + skills:[], + distance:{}, + ai:{ + order:8.9, + equipValue:10, + useful:2.5, + value:function(card,player){ + var value=0; + var info=get.info(card); + if(player.get('e',info.subtype[5])&&card!=player.get('e',info.subtype[5])){ + value=ai.get.value(player.get('e',info.subtype[5]),player); + } + var equipValue=info.ai.equipValue||info.ai.basic.equipValue; + if(typeof equipValue=='function') return equipValue(card,player)-value; + return equipValue-value; + }, + result:{ + target:function(player,target){ + var card=get.card(); + if(card==undefined){ + card={name:name}; + } + var value1=ai.get.value(card,target); + var value2=0; + if(target[get.subtype(card)]&&target[get.subtype(card)]!=card){ + value2=ai.get.value(target[get.subtype(card)],target); + } + return Math.max(0,value1-value2); + } + } + } + } + for(var i in info1.distance){ + info.distance[i]=info1.distance[i]; + } + for(var i in info2.distance){ + if(typeof info.distance[i]=='number'){ + info.distance[i]+=info2.distance[i]; + } + else{ + info.distance[i]=info2.distance[i]; + } + } + if(info1.skills){ + info.skills=info.skills.concat(info1.skills); + } + if(info2.skills){ + info.skills=info.skills.concat(info2.skills); + } + if(info1.onEquip){ + if(Array.isArray(info1.onEquip)){ + info.onEquip=info.onEquip.concat(info1.onEquip); + } + else{ + info.onEquip.push(info1.onEquip); + } + } + if(info2.onEquip){ + if(Array.isArray(info2.onEquip)){ + info.onEquip=info.onEquip.concat(info2.onEquip); + } + else{ + info.onEquip.push(info2.onEquip); + } + } + if(info1.onLose){ + if(Array.isArray(info1.onLose)){ + info.onLose=info.onLose.concat(info1.onLose); + } + else{ + info.onLose.push(info1.onLose); + } + } + if(info2.onLose){ + if(Array.isArray(info2.onLose)){ + info.onLose=info.onLose.concat(info2.onLose); + } + else{ + info.onLose.push(info2.onLose); + } + } + if(info.onEquip.length==0) delete info.onEquip; + if(info.onLose.length==0) delete info.onLose; + lib.card[name]=info; + lib.translate[name]=get.translation(cards[0].name,'skill')+get.translation(cards[1].name,'skill'); + var str=lib.translate[cards[0].name+'_info']; + if(str[str.length-1]=='.'||str[str.length-1]=='。'){ + str=str.slice(0,str.length-1); + } + lib.translate[name+'_info']=str+';'+lib.translate[cards[1].name+'_info']; + try{ + game.addVideo('newcard',null,{ + name:name, + translate:lib.translate[name], + info:lib.translate[name+'_info'], + card:cards[0].name, + legend:true, + }); + } + catch(e){ + console.log(e); + } + } + player.gain(game.createCard({name:name,suit:cards[0].suit,number:cards[0].number}),'gain2'); + }, + ai:{ + order:9.5, + result:{ + player:1 + } + } + }, meiying:{ global:'meiying2', globalSilent:true, @@ -538,7 +774,7 @@ character.gujian={ } } }, - xiuhua:{ + xiuhua_old:{ changeSeat:true, trigger:{player:'shaHit'}, filter:function(event,player){ @@ -605,7 +841,7 @@ character.gujian={ } } }, - yanjia:{ + yanjia_old:{ enable:'chooseToUse', filter:function(event,player){ return player.num('he',{type:'equip'})>0; @@ -1093,12 +1329,12 @@ character.gujian={ shahun2:'煞魂', shahun_info:'限定技,濒死阶段,你可以重置武将牌,弃置所有牌并摸三张牌,然后将体力回复至1;若如此做,你失去技能【反噬】,获得技能【绝境】,并于三回合后立即死亡', - xiuhua:'袖花', - xiuhua_info:'每当你使用杀击中目标,你可以将其拉至你的旁边', - liuying:'流影', - liuying_info:'你可以将一张装备牌当顺手牵羊使用', yanjia:'偃甲', - yanjia_info:'你可以将一张装备牌当无中生有使用', + yanjia_info:'出牌阶段,你可以将两张装备牌合成为一张强化装备', + xiuhua:'袖花', + xiuhua_info:'每当一件装备因被替换或弃置进入弃牌堆,你可以获得之', + liuying:'流影', + liuying_info:'每当你使用一张杀,你可以指定一名不是此杀目标的角色并进行一次判定,若结果是黑色,将其追加为杀的额外目标并可以再次判定', boyun:'拨云', boyun1:'拨云', boyun2:'拨云', diff --git a/character/hearth.js b/character/hearth.js index 9661d72b0..0b5b4522e 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -81,7 +81,7 @@ character.hearth={ // hs_wolazi:['male','wei',3,[]], // hs_tanghangu:['male','wei',3,[]], - hs_aya:['female','wu',3,['ayuling']], + hs_aya:['female','wu',3,['ayuling','qingzun']], // hs_barnes:['male','wei',3,[]], // hs_nuogefu:['male','wei',3,[]], hs_kazhakusi:['male','shu',3,['lianjin']], @@ -98,17 +98,52 @@ character.hearth={ hs_malfurion:['hs_malorne'], }, skill:{ - ayuling:{ - trigger:{player:'damageEnd'}, - frequent:true, - content:function(){ - var list=['feibiao','hufu','zhao','zhanfang','shandian']; - player.gain(game.createCard('hsqingyu_'+list.randomGet()),'draw'); + qingzun:{ + subSkill:{ + count:{ + trigger:{player:'useCard'}, + forced:true, + popup:false, + silent:true, + filter:function(event,player){ + return event.card.name.indexOf('hsqingyu_')==0; + }, + content:function(){ + player.storage.qingzun++; + player.updateMarks(); + } + }, + draw1:{ + trigger:{player:'phaseBegin'}, + filter:function(event,player){ + return player.storage.qingzun>=2; + }, + frequent:true, + content:function(){ + player.draw(); + } + }, + draw2:{ + trigger:{player:'phaseEnd'}, + filter:function(event,player){ + return player.storage.qingzun>=6; + }, + frequent:true, + content:function(){ + player.draw(); + } + }, + }, + mod:{ + maxHandcard:function(player,num){ + return num+player.storage.qingzun; + } }, init:function(player){ - player.storage.ayuling=0; + player.storage.qingzun=0; }, mark:true, + marktext:'玉', intro:{ content:function(storage,player){ if(!storage) return '未使用过青玉牌'; @@ -122,47 +157,15 @@ character.hearth={ return str; } }, - subSkill:{ - count:{ - trigger:{player:'useCard'}, - forced:true, - popup:false, - silent:true, - filter:function(event,player){ - return event.card.name.indexOf('hsqingyu_')==0; - }, - content:function(){ - player.storage.ayuling++; - player.updateMarks(); - } - }, - draw1:{ - trigger:{player:'phaseBegin'}, - filter:function(event,player){ - return player.storage.ayuling>=2; - }, - frequent:true, - content:function(){ - player.draw(); - } - }, - draw2:{ - trigger:{player:'phaseEnd'}, - filter:function(event,player){ - return player.storage.ayuling>=6; - }, - frequent:true, - content:function(){ - player.draw(); - } - }, + group:['qingzun_count','qingzun_draw1','qingzun_draw2'], + }, + ayuling:{ + trigger:{player:'damageEnd'}, + frequent:true, + content:function(){ + var list=['feibiao','hufu','zhao','zhanfang','shandian']; + player.gain(game.createCard('hsqingyu_'+list.randomGet()),'draw'); }, - mod:{ - maxHandcard:function(player,num){ - return num+player.storage.ayuling; - } - }, - group:['ayuling_count','ayuling_draw1','ayuling_draw2'], ai:{ maixie:true, effect:{ @@ -1248,7 +1251,7 @@ character.hearth={ } } if(event.target){ - player.chooseToDiscard([1,2],'献祭:是否弃置1〜2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){ + player.chooseToDiscard([1,2],'献祭:是否弃置1~2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){ if(ai.get.attitude(_status.event.player,_status.event.getParent().target)>1){ return 6-ai.get.value(card); } @@ -5256,7 +5259,9 @@ character.hearth={ hsqingyu_zhanfang:'青玉绽放', hsqingyu_zhanfang_info:'令一名角色增加一点体力上限并摸一张牌', ayuling:'玉灵', - ayuling_info:'每当你受到一次伤害,你可以获得一张随机青玉牌;每当你使用一张青玉牌,你的手牌上限+1;当你累计使用两张青玉牌后,你可以于回合开始阶段摸一张牌;当你累计使用六张青玉牌后,你可以于回合结束阶段摸一张牌', + ayuling_info:'每当你受到一次伤害,你可以获得一张随机青玉牌', + qingzun:'青樽', + qingzun_info:'本局对战中,每当你使用一张青玉牌,你的手牌上限+1;当你累计使用两张青玉牌后,你可以于回合开始阶段摸一张牌;当你累计使用六张青玉牌后,你可以于回合结束阶段摸一张牌', lianjin:'炼金', lianjin_info:'出牌阶段限两次,你可以将一张手牌永久转化为一张由三张随机牌组成的药水', shouji:'收集', @@ -5308,7 +5313,7 @@ character.hearth={ xianji:'献祭', xianji2:'献祭', xianji3:'献祭', - xianji_info:'其他角色可以在其回合结束阶段弃置1〜2张手牌并令你摸等量的牌,若如此做,直到其下一回合结束,每当你使用卡牌指定其为目标时,其摸一张牌', + xianji_info:'其他角色可以在其回合结束阶段弃置1~2张手牌并令你摸等量的牌,若如此做,直到其下一回合结束,每当你使用卡牌指定其为目标时,其摸一张牌', xueren:'血刃', xueren_info:'每当你使用杀造成伤害,你可以令受伤害角色与你各流失一点体力,然后你摸两张牌', maoxian:'冒险', diff --git a/character/ow.js b/character/ow.js index 69789705f..9f14fc79d 100644 --- a/character/ow.js +++ b/character/ow.js @@ -1602,6 +1602,17 @@ character.ow={ } }, feiren2:{ + trigger:{source:'damageBegin'}, + forced:true, + popup:false, + filter:function(event,player){ + return event.card&&event.card.name=='sha'&&get.suit(event.card)=='spade'; + }, + content:function(){ + trigger.num++; + } + }, + feiren3:{ trigger:{player:'useCardAfter'}, filter:function(event,player){ if(event.parent.name=='feiren2') return false; @@ -2668,7 +2679,7 @@ character.ow={ mujing_info:'每当你对攻击范围不含你的角色使用一张牌,你可以弃置目标一张牌;若你的手牌数不多于目标,你摸一张牌', feiren:'飞刃', feiren2:'飞刃', - feiren_info:'你的杀无视距离和防具;你的黑桃杀可以额外结算一次,梅花杀可以额外指定一个目标', + feiren_info:'你的杀无视距离和防具;你的黑桃杀造成的伤害+1,梅花杀可以额外指定一个目标', zhanlong:'斩龙', zhanlong_info:'限定技,回合开始阶段,若你体力值为1,你可以弃置所有牌(至少一张),然后将三张杀置入你的手牌,若如此做,你本回合使用杀无次数限制', xie:'谐', diff --git a/character/shenhua.js b/character/shenhua.js index 8dd8aaccc..75f0611d2 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -135,7 +135,7 @@ character.shenhua={ return num+player.storage.qimou; } }, - attackFrom:function(from,to,distance){ + globalFrom:function(from,to,distance){ if(typeof from.storage.qimou=='number'){ return distance-from.storage.qimou; } @@ -186,8 +186,8 @@ character.shenhua={ }, logTarget:'target', filter:function(event,player){ - if(event.target.num('h')0){ return 7-ai.get.value(card); } @@ -3787,10 +3787,10 @@ character.yijiang={ event.target=target; target.judge(function(card){ if(target.hp==target.maxHp){ - if(get.color(card)=='red') return 0; + if(get.color(card)=='red') return -1; } - if(get.color(card)=='red') return 1.5; - return 1; + if(get.color(card)=='red') return 1; + return 0; }); } else{ diff --git a/game/config.js b/game/config.js index a2dd11ec9..b9d9dbbeb 100644 --- a/game/config.js +++ b/game/config.js @@ -364,6 +364,11 @@ window.config={ // ['jiang','chongzhen'], // ['fenji','yuling'], ['jiushi','guixin'], + ['xiuhua','qiaoxie'], + ['xiuhua','xuanfeng'], + ['xiuhua','duanxing'], + ['xiuhua','xiaoji'], + ['xiuhua','xiaoji'], // ['jiushi','jushou'], // ['jiushi','kuiwei'], ] diff --git a/game/game.js b/game/game.js index 8f08c1fe6..c9946eab0 100644 --- a/game/game.js +++ b/game/game.js @@ -8337,11 +8337,21 @@ } "step 2" player.popup(cards[num].name); - var next=game.createEvent('lose_'+cards[num].name); - var info=get.info(cards[num]); - next.setContent(info.onLose); - next.player=player; - next.card=cards[num]; + var info=get.info(cards[num]); + if(Array.isArray(info.onLose)){ + for(var i=0;iversion1[i]){ + files=false;break; + } + else if(version1[i]>version2[i]){ + files=update.files.slice(0);break; + } + } + if(files===null){ + if(version1.length>=version2.length){ + files=update.files.slice(0); + } + } } var str; if(lib.config.debug){ diff --git a/game/update.js b/game/update.js index 6f69272b7..0cf774634 100644 --- a/game/update.js +++ b/game/update.js @@ -1,28 +1,26 @@ window.noname_update={ - version:'1.9.4', + version:'1.9.4.1', changeLog:[ - '武将修改', - '4v4改进', + 'bug修复', ], files:{ global:[ 'game/game.js', - 'game/asset.js', - 'card/extra.js', - 'card/yunchou.js', - 'card/swd.js', - 'character/extra.js', - 'character/hearth.js', - 'character/standard.js', - 'character/swd.js', - 'character/rank.js', - 'character/xianjian.js', - 'character/sp.js', - 'character/yijiang.js', + 'game/config.js', + 'character/shenhua.js', + 'character/gujian.js', 'character/ow.js', + 'character/swd.js', + 'character/yijiang.js', 'character/yxs.js', - 'mode/chess.js', + 'character/sp.js', + 'character/hearth.js', + 'character/gujian.js', + 'character/extra.js', + 'card/guozhan.js', + 'card/sp.js', + 'card/swd.js', ], - // '1.9.3.4':[], + '1.9.4':[], } } diff --git a/mode/chess.js b/mode/chess.js index 07f413f3a..961a8a536 100644 --- a/mode/chess.js +++ b/mode/chess.js @@ -5780,14 +5780,14 @@ mode.chess={ '若开启主将,双方各选择一名角色成为主将。主将体力上限加一,主将死亡后,若有副将,副将代替之成为主将,否则游戏结束
  • '+ '开启无尽模式后,任何一方有角色死亡都将选择一名新角色重新加入战场,直到点击左上角的结束游戏按钮手动结束游戏。结束游戏时,杀敌更多的一方获胜
  • '+ '行动顺序为指定时,双方无论存活角色角色多少都将轮流进行行动。在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
  • '+ - '开启战场机关后,每个回合结束时有一定机率出现一个机关,该机关不参与战斗,并有一个影响周围或全体角色的效果。机关在出现后的5〜10个回合内消失
  • '+ + '开启战场机关后,每个回合结束时有一定机率出现一个机关,该机关不参与战斗,并有一个影响周围或全体角色的效果。机关在出现后的5~10个回合内消失
  • '+ '开启击退效果后,当一名角色对距离两格以内的目标造成伤害后,受伤害角色将沿反方向移动一格
  • '+ '战场上可设置出现随机路障,角色无法移动到路障处。当一名角色的周围四格有至少三格为路障或在战场外时,其可以在回合内清除一个相邻路障'+ '
    君主模式
    • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
    • '+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
    • '+ '战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
    • '+ '挑战武将会与该武将以及与其强度相近的武将进行战斗,敌方人数与我方出场人数相同,但不少于3。胜利后可通过招募令招募该武将,普通/稀有/史诗/传说武将分别需要40/100/400/1600招募令
    • '+ - '竞技场:
      随机选择9名武将,每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。

      战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。

      战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场

      当取得12场胜利或所有武将全部阵亡后结束,并根据胜场数获得随机奖励
    • '+ + '竞技场:
      随机选择9名武将,每次派出1~3名武将参战。战斗中阵亡的武将不能再次上场。

      战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。

      战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场

      当取得12场胜利或所有武将全部阵亡后结束,并根据胜场数获得随机奖励
    • '+ '修改金钱:
      game.changeMoney
      修改招募令:
      game.changeDust
    ' }, } diff --git a/mode/stone.js b/mode/stone.js index 6ecb0bdc6..56b9a7bb0 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -9458,7 +9458,7 @@ mode.stone={ spell_xishengqiyue:'牺牲契约', spell_xishengqiyue_info:'令双方各一名随从立即死亡', spell_xiaoguibaopo:'小鬼爆破', - spell_xiaoguibaopo_info:'对一名随从造成1〜3点伤害,每造成一点伤害,便召唤一只小鬼', + spell_xiaoguibaopo_info:'对一名随从造成1~3点伤害,每造成一点伤害,便召唤一只小鬼', spell_anyinglieyan:'暗影裂焰', spell_anyinglieyan_info:'杀死一名友方随从,并对所有敌方随从造成等于其体力值的伤害', spell_liliangdaijia:'力量代价', @@ -9605,9 +9605,9 @@ mode.stone={ spell_xianzuzhishi_info:'从牌库中获得两张牌,本回合手牌上限-1(多次使用不叠加)', spell_lianhuanbaolie:'连环爆裂', - spell_lianhuanbaolie_info:'造成1〜2点雷电伤害', + spell_lianhuanbaolie_info:'造成1~2点雷电伤害', spell_shandianfengbao:'闪电风暴', - spell_shandianfengbao_info:'对所有敌方随从造成1〜2点伤害', + spell_shandianfengbao_info:'对所有敌方随从造成1~2点伤害', spell_yaoshu:'妖术', spell_yaoshu_info:'将一个随从变成一只青蛙', spell_yexinglanghun:'野性狼魂',