From 264c4e7a7eaacb79a29fc056c1b57659f83ed290 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 25 Feb 2017 22:11:07 +0800 Subject: [PATCH] zf --- game/game.js | 16 +++- mode/connect.js | 2 +- mode/guozhan.js | 238 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 240 insertions(+), 16 deletions(-) diff --git a/game/game.js b/game/game.js index 0a0d7faad..a7c860696 100644 --- a/game/game.js +++ b/game/game.js @@ -5096,7 +5096,7 @@ get[i]=lib.init.eval(mode[lib.config.mode].get[i]); } lib.init.start=mode[lib.config.mode].start; - lib.init.startBefore=mode[lib.config.mode].startBefore; + lib.init.startBefore=lib.init.eval(mode[lib.config.mode].startBefore); if(game.onwash){ lib.onwash.push(game.onwash); delete game.onwash; @@ -5117,6 +5117,7 @@ if(i=='ui') continue; if(i=='get') continue; if(i=='config') continue; + if(i=='onreinit') continue; if(i=='start') continue; if(i=='startBefore') continue; if(lib[i]==undefined) lib[i]=(get.objtype(mode[lib.config.mode][i])=='array')?[]:{}; @@ -17264,6 +17265,14 @@ lib.skill[i]=lib.init.eval(mode.skill[i]); } } + if(mode.characterPack){ + for(var i in mode.characterPack){ + lib.characterPack[i]=mode.characterPack[i]; + } + } + if(mode.onreinit){ + (lib.init.eval(mode.onreinit))(); + } state=get.parsedResult(state); game.players=[]; game.dead=[]; @@ -20441,6 +20450,7 @@ if(game.online){ var dialog=ui.create.dialog(); dialog.content.innerHTML=result; + dialog.buttons=Array.from(dialog.querySelectorAll('.button')); var result2=arguments[1]; if(result2==true){ dialog.content.firstChild.innerHTML='战斗胜利'; @@ -31942,7 +31952,9 @@ } } else{ - game.saveConfig('reconnect_info'); + if(typeof game.roomId!='number'){ + game.saveConfig('reconnect_info'); + } } game.reload(); }, diff --git a/mode/connect.js b/mode/connect.js index c82ff57e2..65aad92bb 100644 --- a/mode/connect.js +++ b/mode/connect.js @@ -64,7 +64,7 @@ mode.connect={ ui.window.appendChild(text); ui.iptext=text; - var button=ui.create.div('.menubutton.highlight.large','连接',connect); + var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect); button.style.width='70px'; button.style.left='calc(50% - 35px)'; button.style.top='calc(50% + 60px)'; diff --git a/mode/guozhan.js b/mode/guozhan.js index 83a4a2197..e1f44ede4 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -14,6 +14,21 @@ mode.guozhan={ } } }, + onreinit:function(){ + var pack=lib.characterPack.mode_guozhan; + for(var i in pack){ + if(!lib.configOL.onlyguozhan){ + if(lib.character[i.slice(3)]) continue; + } + lib.character[i]=pack[i]; + if(!lib.character[i][4]){ + lib.character[i][4]=[]; + } + if(!lib.translate[i]){ + lib.translate[i]=lib.translate[i.slice(3)]; + } + } + }, start:function(){ "step 0" var playback=localStorage.getItem(lib.configprefix+'playback'); @@ -232,7 +247,7 @@ mode.guozhan={ gz_sunce:['male','wu',4,['jiang','yingyang','hunshang']], gz_chendong:['male','wu',4,['duanxie','fenming']], gz_sp_dongzhuo:['male','qun',4,['hengzheng','baoling']], - // gz_zhangren:['male','qun',4,['chuanxin','fengshi']], + gz_zhangren:['male','qun',4,['chuanxin','fengshi']], } }, characterIntro:{ @@ -242,6 +257,195 @@ mode.guozhan={ zoushi:'军阀张济之妻,张绣之婶。张绣降曹后,邹氏遂被曹操霸占。贾诩献计趁机诛杀曹操,险些得手。曹操在损失爱将典韦、侄子曹安民和长子曹昂后方才逃出生天。', }, skill:{ + _zhenfazhaohuan:{ + enable:'phaseUse', + usable:1, + getConfig:function(player){ + var n1,n2,p1,p2; + var config={ + inline:false, + siege:false + }; + var config2={}; + n1=player.getNext(); + p1=player.getPrevious(); + if(n1){ + if(n1.isUnseen()){ + config.inline=true; + } + n2=n1.getNext(); + if(n2&&n2.isUnseen()){ + config.siege=true; + } + } + if(p1){ + if(p1.isUnseen()){ + config.inline=true; + } + p2=p1.getNext(); + if(p2&&p2.isUnseen()){ + config.siege=true; + } + } + if(config.inline||config.siege){ + var skills=player.get('s'); + for(var i=0;i=2) return 1; + return 0; + }).set('choiceList',['弃置装备区内的所有牌并失去一点体力','移除副将牌']); + } + else{ + event._result={index:1}; + } + 'step 1' + if(result.index==1){ + trigger.player.removeCharacter(1); + } + else{ + trigger.player.discard(trigger.player.get('e')); + trigger.player.loseHp(); + } + } + }, gzguixiu:{ init2:function(player){ player.logSkill('guixiu'); @@ -1799,12 +2003,15 @@ mode.guozhan={ tongshimingzhi:'同时明置', mode_guozhan_character_config:'国战武将', + _zhenfazhaohuan:'阵法召唤', + _zhenfazhaohuan_info:'由拥有阵法技的角色发起,满足此阵法技条件的未确定势力角色均可按逆时针顺序一次明置其一张武将牌(响应阵法召唤),以发挥阵法技的效果', gzmingshi:'名士', gzmingshi_info:'锁定技,当你受到伤害时,若伤害来源有暗置的武将牌,此伤害-1', - chuanxin:'锋矢', - chuanxin_info:'阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,可令该角色弃置装备区里的一张牌', - fengshi:'穿心', - fengshi_info:'当你于出牌阶段内使用【杀】或【决斗】对目标角色造成伤害时,若其与你势力不同且有副将,你可以防止此伤害。若如此做,该角色选择一项:1.弃置装备区里的所有牌,若如此做,其失去1点体力;2.移除副将', + fengshi:'锋矢', + _fengshi:'锋矢', + fengshi_info:'阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,可令该角色弃置装备区里的一张牌', + chuanxin:'穿心', + chuanxin_info:'当你于出牌阶段内使用【杀】或【决斗】对目标角色造成伤害时,若其与你势力不同且有副将,你可以防止此伤害。若如此做,该角色选择一项:1.弃置装备区里的所有牌,若如此做,其失去1点体力;2.移除副将', baoling:'暴凌', baoling_info:'主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,然后加3点体力上限,回复3点体力,并获得“崩坏”', yingyang:'鹰扬', @@ -2336,15 +2543,20 @@ mode.guozhan={ return player.sieged()&&(player.getNext()==this||player.getPrevious()==this); } }, - sieged:function(){ + sieged:function(player){ if(this.identity=='unknown') return false; - var next=this.getNext(); - var previous=this.getPrevious(); - if(next&&previous&&next!=previous){ - if(next.identity=='unknown'||next.identity=='ye'||next.identity==this.identity) return false; - return next.identity==previous.identity; + if(player){ + return player.siege(this); + } + else{ + var next=this.getNext(); + var previous=this.getPrevious(); + if(next&&previous&&next!=previous){ + if(next.identity=='unknown'||next.identity=='ye'||next.identity==this.identity) return false; + return next.identity==previous.identity; + } + return false; } - return false; }, inline:function(){ if(this.identity=='unknown'||this.identity=='ye'||this.hasSkill('undist')) return false; @@ -2372,7 +2584,7 @@ mode.guozhan={ } if(!list.length) return false; for(var i=0;i