diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 5f54c5eb5..95a029651 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,2 +1,4 @@ -1.5.2 -明忠模式 +1.5.3 +战棋路障、特殊战场角色 +战棋自动显示距离 +修正部分区域点击困难的问题 diff --git a/card/standard.js b/card/standard.js index f407f3989..85f559c73 100755 --- a/card/standard.js +++ b/card/standard.js @@ -435,6 +435,7 @@ card.standard={ ui.clear(); var cards=get.cards(game.players.length); var dialog=ui.create.dialog('五谷丰登',cards,true); + _status.dieClose.push(dialog); dialog.videoId=lib.status.videoId++; game.addVideo('cardDialog',null,['五谷丰登',get.cardsInfo(cards),dialog.videoId]); event.parent.preResult=dialog.videoId; @@ -479,6 +480,7 @@ card.standard={ for(var i=0;i1){ + if(i==0) return 5; + return 1; + } + if(i==0) return 7.3; + return 3; + }, + value:function(card,player){ + if(player.hp>1){ + if(i==0) return 5; + return 1; + } + if(i==0) return 7.3; + return 3; + }, }, order:function(){ return lib.card.sha.ai.order+0.2; diff --git a/character/extra.js b/character/extra.js index 278cdf675..bc8f13917 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1107,7 +1107,8 @@ character.extra={ shelie_info:'摸牌阶段,你可以放弃摸牌,改为从牌堆顶亮出五张牌,你获得不同花色的牌各一张,将其余的牌置入弃牌堆。', gongxin_info:'出牌阶段,你可以观看一名其他角色的手牌,并可以展示其中一张红桃牌,然后将其弃置或置于牌堆顶,每阶段限一次。', guixin_info:'每当你受到1次伤害后,若至少一名其他角色的区域里有牌,你可以选择所有其他角色,获得这些角色区域里的一张牌,然后将你的武将牌翻面。', - qinyin_info:'每当你于弃牌阶段内因你的弃置而失去第X张手牌时(X至少为2),你可以选择一项:1.令所有角色各回复1点体力;2.令所有角色各失去1点体力。每阶段限一次。', + qinyin_info:'弃牌阶段结束时,若你于此阶段内弃置过你的至少两张手牌,则你可以选择一项:1. 所有角色各回复1点体力;2. 所有角色各失去1点体力。', + // qinyin_info:'每当你于弃牌阶段内因你的弃置而失去第X张手牌时(X至少为2),你可以选择一项:1.令所有角色各回复1点体力;2.令所有角色各失去1点体力。每阶段限一次。', yeyan_info:'限定技,出牌阶段,你可以对一至三名角色造成至多共3点火焰伤害(你可以任意分配每名目标角色受到的伤害点数),若你将对一名角色分配2点或更多的火焰伤害,你须先弃置四张不同花色的手牌再失去3点体力。', qixing:'七星', qixing_bg:'星', diff --git a/character/mountain.js b/character/mountain.js index 1371c9df1..24c7c4c80 100755 --- a/character/mountain.js +++ b/character/mountain.js @@ -918,6 +918,7 @@ character.mountain={ priority:10, content:function(){ for(var i in lib.character){ + if(i.indexOf('stone_')==0) continue; var add=false; for(var j=0;jrecover&&lose>0) return 0; if(lose0) return 1; @@ -7944,8 +7946,6 @@ character.swd={ fushen2:'附身', tiandao:'天道', tiandao_info:'任意一名角色的判定生效前,你可以打出一张牌替换之', - swdqinyin:'琴音', - swdqinyin_info:'回合结束阶段,若你于本回合内未造成过伤害,你可以令所有角色失去或回复一点体力', wangchen:'忘尘', wangchen_info:'若你于弃牌阶段弃置了基本牌,可令一名角色翻面', guiyin:'归隐', diff --git a/character/xianjian.js b/character/xianjian.js index cb7565e55..66b883ad5 100755 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -68,7 +68,7 @@ character.xianjian={ } }, ningbin:{ - trigger:{player:'damageEnd',source:'damageEnd'}, + trigger:{player:'damageEnd'}, forced:true, filter:function(event){ return event.nature=='thunder'; @@ -1360,7 +1360,7 @@ character.xianjian={ xuanyan2:'玄炎', xuanyan_info:'锁定技,你的火属性伤害+1;你造成火属性伤害后流失1点体力', ningbin:'凝冰', - ningbin_info:'锁定技,每当你造成或受到1次雷属性伤害,你回复1点体力', + ningbin_info:'锁定技,每当你受到1次雷属性伤害,你回复1点体力', fenxin:'焚心', fenxin2:'焚心', fenxin_info:'锁定技,每当你的体力值发生改变,你摸等量的牌;每当你杀死一名角色,你增加一点体力上限并回复一点体力', diff --git a/character/zhuogui.js b/character/zhuogui.js index 525174d4c..eb473f7a8 100755 --- a/character/zhuogui.js +++ b/character/zhuogui.js @@ -1,7 +1,7 @@ character.zhuogui={ character:{ nianshou:['male','shu',4,['nianrui','qixiang']], - mamian:['male','qun',4,['lianyu','guiji']], + // mamian:['male','qun',4,['lianyu','guiji']], niutou:['male','shu',4,['manjia','xiaoshou'],['fullskin']], baiwuchang:['male','qun',3,['qiangzheng','moukui']], heiwuchang:['male','qun',3,['suoling','xixing']], diff --git a/game/game.js b/game/game.js index 010a20aef..631f6af8f 100755 --- a/game/game.js +++ b/game/game.js @@ -13,6 +13,7 @@ ai:{}, lastdragchange:[], skillaudio:[], + dieClose:[] }; var lib={ configprefix:'noname_0.9_', @@ -1312,25 +1313,48 @@ } }, }, + chess_treasure:{ + name:'特殊战场角色', + init:'0.2', + frequent:true, + item:{ + '0':'关闭', + '0.1':'较少出现', + '0.2':'偶尔出现', + '0.333':'时常出现', + '0.5':'频繁出现', + } + }, + chess_obstacle:{ + name:'随机路障', + init:'0.333', + item:{ + '0':'关闭', + '0.2':'少量', + '0.333':'中量', + '0.5':'大量', + }, + frequent:true, + }, + show_distance:{ + name:'显示距离', + init:true, + // frequent:true, + }, chess_ordered:{ name:'交替行动', init:true, - frequent:true, + // frequent:true, }, chess_character:{ name:'战棋武将', init:true, - frequent:true, + // frequent:true, }, - chessscroll_speed:{ - name:'边缘滚动速度', - init:'20', - item:{ - '0':'不滚动', - '10':'10格/秒', - '20':'20格/秒', - '30':'30格/秒', - } + chess_card:{ + name:'战棋卡牌', + init:true, + // frequent:true, }, free_choose:{ name:'自由选将', @@ -1367,6 +1391,16 @@ init:false, restart:true, }, + chessscroll_speed:{ + name:'边缘滚动速度', + init:'20', + item:{ + '0':'不滚动', + '10':'10格/秒', + '20':'20格/秒', + '30':'30格/秒', + } + }, } }, stone:{ @@ -1463,12 +1497,15 @@ '身份模式':'
明忠
  • 本模式需要8名玩家进行游戏,使用的身份牌为:1主公、2忠臣、4反贼和1内奸。游戏开始时,每名玩家随机获得一个身份,由系统随机选择一名忠臣身份的玩家亮出身份(将忠臣牌正面朝上放在面前),其他身份(包括主公)的玩家不亮出身份。
  • '+ '首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出
  • '+ '亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。', - '战棋模式':'
    对阵
    • n人对战n人的模式,由单人控制,开始游戏后随机分配位置与出牌顺序
    • '+ + '战棋模式': + '
      对阵模式
      • n人对战n人的模式,由单人控制,开始游戏后随机分配位置与出牌顺序
      • '+ '每人在出牌阶段有一次移动的机会,若一名角色在移动之前使用过指定其他角色为目标的牌,该回合可移动的最大距离为2,否则最大距离为1
      • '+ '任何卡牌或技能无法指定位置相隔8个格以上的角色为目标
      • '+ '杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚
      • '+ - '开启交替行动后,在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
      '+ - '
      统率
      • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
      • '+ + '开启交替行动时,双方无论存活角色角色多少都将轮流进行行动。在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
      • '+ + '开启特殊战场角色后,每个回合结束时有一定机率出现一个特殊角色,该角色不参与战斗,并有一个影响周围或全体角色的效果。该角色在出现后的5〜10个回合内消失
      • '+ + '战场上可设置出现随机路障,角色无法移动到路障处。当一名角色的周围四格有至少三格为路障或在战场外,其可以在回合内清除一个相邻路障
      '+ + '
      统率模式
      • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
      • '+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
      • '+ '战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
      • '+ '挑战武将会与该武将以及与其强度相近的武将进行战斗,敌方人数与我方出场人数相同,但不少于3。胜利后可通过招募令招募该武将
      • '+ @@ -2854,7 +2891,7 @@ event.finish(); } "step 6" - ui.clear(); + if(event.card.name!='wuxie') ui.clear(); }, useSkill:function(){ "step 0" @@ -4132,6 +4169,18 @@ return cards; } }, + playerfocus:function(time){ + time=time||1000; + this.classList.add('playerfocus'); + ui.arena.classList.add('playerfocus'); + var that=this; + setTimeout(function(){ + that.classList.remove('playerfocus'); + ui.arena.classList.remove('playerfocus'); + },1000); + game.addVideo('playerfocus',this,time); + return this; + }, changeHujia:function(num){ if(typeof num!='number'){ num=1; @@ -5777,6 +5826,7 @@ $throwordered:function(node,nosource){ if(nosource){ node.style.transform='scale(0)'; + node.classList.add('center'); } else{ node.dataset.position=this.dataset.position; @@ -6093,6 +6143,30 @@ game.animate.flame(left+this.offsetWidth/2, top+this.offsetHeight-30,700,'thunder'); }, + $rare2:function(){ + game.addVideo('flame',this,'rare2'); + var rect=this.getBoundingClientRect(); + var left=rect.left; + var top=rect.top+15; + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-30,700,'rare'); + }, + $epic2:function(){ + game.addVideo('flame',this,'epic2'); + var rect=this.getBoundingClientRect(); + var left=rect.left; + var top=rect.top+15; + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-30,700,'epic'); + }, + $legend2:function(){ + game.addVideo('flame',this,'legend2'); + var rect=this.getBoundingClientRect(); + var left=rect.left; + var top=rect.top+15; + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-30,700,'legend'); + }, $rare:function(){ game.addVideo('flame',this,'rare'); var left,top; @@ -7442,7 +7516,9 @@ if(content.type=='delay'){ game.delay(content.content); } - else if(typeof content.player=='string'&&game.playerMap[content.player]){ + else if(typeof content.player=='string'&&game.playerMap[content.player]&& + game.playerMap[content.player].classList&& + !game.playerMap[content.player].classList.contains('obstacle')){ game.videoContent[content.type](game.playerMap[content.player],content.content); } else{ @@ -7584,14 +7660,9 @@ console.log(player); } }, - playerfocus:function(player){ - if(player){ - player.classList.add('playerfocus'); - ui.arena.classList.add('playerfocus'); - setTimeout(function(){ - player.classList.remove('playerfocus'); - ui.arena.classList.remove('playerfocus'); - },1000); + playerfocus:function(player,time){ + if(player&&player.playerfocus){ + player.playerfocus(time); } else{ console.log(player); @@ -7626,6 +7697,17 @@ console.log(player) } }, + addObstacle:function(pos){ + if(pos){ + game.addObstacle(pos[0],pos[1]); + } + else{ + console.log(pos) + } + }, + removeObstacle:function(pos){ + game.removeObstacle(pos); + }, moveTox:function(player,pos){ if(player&&player.dataset){ delete lib.posmap[player.dataset.position]; @@ -7651,6 +7733,25 @@ console.log('chessFocus'); } }, + removeTreasure:function(pos){ + if(game.playerMap[pos]){ + game.playerMap[pos].delete(); + delete game.playerMap[pos]; + } + else{ + console.log(pos); + } + }, + initobs:function(obs){ + if(obs){ + for(var i=0;i7){ + game.players[i].node.action.classList.add('thunder'); + } + else{ + game.players[i].node.action.classList.remove('thunder'); + } + } + } + } if(ok&&auto&&lib.config.auto_confirm&&(!_status.mousedragging||!_status.mouseleft)&&!_status.mousedown){ if(ui.confirm){ if(!skillinfo||!skillinfo.preservecancel){ @@ -12001,6 +12124,7 @@ for(var i=0;i'; - node.node.group.style.backgroundColor=get.translation(infoitem[1]+'Color'); + if(infoitem[1]){ + node.node.group.innerHTML='
        '+get.translation(infoitem[1])+'
        '; + node.node.group.style.backgroundColor=get.translation(infoitem[1]+'Color'); + } + else{ + node.node.group.style.display='none'; + } } else{ if(item.name.indexOf('unknown')==0){ @@ -15586,7 +15736,7 @@ var i,translation,intro,str; if(node.classList.contains('player')){ var capt=get.translation(node.name); - if(lib.character[node.name]){ + if(lib.character[node.name]&&lib.character[node.name][1]){ capt+='  '+lib.translate[lib.character[node.name][1]]; } uiintro.add(capt); @@ -16802,7 +16952,7 @@ } } lib.skilllist=[]; - lib.characterPack={}; + if(!lib.characterPack) lib.characterPack={}; for(i in character){ if(character[i].character){ lib.characterPack[i]=character[i].character @@ -16857,7 +17007,7 @@ } } } - lib.cardPack={}; + if(!lib.cardPack) lib.cardPack={}; for(i in card){ lib.cardPack[i]=[]; if(card[i].card){ diff --git a/image/card/chess_chuzhang.png b/image/card/chess_chuzhang.png new file mode 100644 index 000000000..21c0cab3f Binary files /dev/null and b/image/card/chess_chuzhang.png differ diff --git a/image/card/chess_shezhang.png b/image/card/chess_shezhang.png new file mode 100644 index 000000000..a386c1d90 Binary files /dev/null and b/image/card/chess_shezhang.png differ diff --git a/image/card/huimiezhichui.png b/image/card/huimiezhichui.png new file mode 100644 index 000000000..a2888efb4 Binary files /dev/null and b/image/card/huimiezhichui.png differ diff --git a/image/character/default/mamian.jpg b/image/character/default/mamian.jpg old mode 100755 new mode 100644 index 2b8315258..8706bdfc6 Binary files a/image/character/default/mamian.jpg and b/image/character/default/mamian.jpg differ diff --git a/image/character/default/mamian.png b/image/character/default/mamian.png new file mode 100644 index 000000000..ed2bae34e Binary files /dev/null and b/image/character/default/mamian.png differ diff --git a/image/character/default/treasure_dubiaoxianjing.jpg b/image/character/default/treasure_dubiaoxianjing.jpg new file mode 100644 index 000000000..738754d85 Binary files /dev/null and b/image/character/default/treasure_dubiaoxianjing.jpg differ diff --git a/image/character/default/treasure_jiqishi.jpg b/image/character/default/treasure_jiqishi.jpg new file mode 100644 index 000000000..d06b19976 Binary files /dev/null and b/image/character/default/treasure_jiqishi.jpg differ diff --git a/image/character/default/treasure_shenmidiaoxiang.jpg b/image/character/default/treasure_shenmidiaoxiang.jpg new file mode 100644 index 000000000..56aff1e1e Binary files /dev/null and b/image/character/default/treasure_shenmidiaoxiang.jpg differ diff --git a/image/character/default/treasure_shenpanxianjing.jpg b/image/character/default/treasure_shenpanxianjing.jpg new file mode 100644 index 000000000..527e7f846 Binary files /dev/null and b/image/character/default/treasure_shenpanxianjing.jpg differ diff --git a/image/character/default/treasure_shiyuansu.jpg b/image/character/default/treasure_shiyuansu.jpg new file mode 100644 index 000000000..af295bf3f Binary files /dev/null and b/image/character/default/treasure_shiyuansu.jpg differ diff --git a/image/character/default/treasure_wuyashenxiang.jpg b/image/character/default/treasure_wuyashenxiang.jpg new file mode 100644 index 000000000..b0024b44a Binary files /dev/null and b/image/character/default/treasure_wuyashenxiang.jpg differ diff --git a/layout/default/layout.css b/layout/default/layout.css index e04703f22..8016055ca 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -28,9 +28,13 @@ table{table-layout: fixed;} pointer-events: none; position: absolute; } -#arena.playerfocus>div:not(.playerfocus){ +#arena.playerfocus>div:not(.playerfocus):not(#chess-container):not(.removing){ opacity: 0.3 !important; } +#arena.playerfocus #chess>div:not(.playerfocus):not(.removing){ + opacity: 0.3 !important; +} + #me,#mebg{width: 100%;height: 140px;top:calc(100% - 140px);left:0;} #mebg{z-index:-1} #handcards1,#handcards2{width: calc(50% - 140px);height: 127px;padding: 10px;} @@ -39,8 +43,8 @@ table{table-layout: fixed;} #handcards2{left: calc(50% + 120px);top:calc(100% - 140px);} #arena.single-handcard #handcards1{width: 100%;} #arena.single-handcard #handcards2{display: none;} -#system{padding: 6px;width: calc(100% - 12px);white-space: nowrap;z-index: 3;} -#system>div{height: 100%;position: relative;margin: 0;padding: 0;} +#system{padding: 6px;width: calc(100% - 12px);white-space: nowrap;z-index: 3;pointer-events: none} +#system>div{height: 100%;position: relative;margin: 0;padding: 0;pointer-events: auto} #system>div:last-child{text-align: right;float:right} #system>div>div{position: relative;padding-top: 6px;padding-bottom: 6px;padding-left: 8px;padding-right: 8px;text-align: center;margin:4px} #paused,#click{left: 0;top:0;width: 100%;height: 100%;z-index: 5;} @@ -242,7 +246,8 @@ margin-bottom: 5px; .button.character>.intro{top:71px;left:0;} .button.character>.identity{top:-6px;left:72px;} /*--------确认--------*/ -#control{text-align: center;z-index: 2;top: calc(200% / 3);left: calc(5% + 240px);width: calc(90% - 480px);} +#control{text-align: center;z-index: 2;top: calc(200% / 3);left: calc(5% + 240px);width: calc(90% - 480px);pointer-events: none} +#control>*{pointer-events: auto} .control{padding-top: 2px;padding-bottom: 2px;padding-left: 4px;padding-right: 4px;margin-left: 4px;margin-right: 4px;} .control{font-size: 18px;white-space: nowrap;position: relative;overflow: hidden;opacity:0} .control:not(.nozoom){width:0} @@ -260,7 +265,7 @@ margin-bottom: 5px; .player>.avatar:not(.glow2)>.action{opacity: 0} .player.controlfakeme{width:100px;height:120px;top:calc(100% - 140px)} .player.controlfakeme>.avatar{width: 100%;height: 100%;box-shadow: none;left: 0;top: 0} -.player{z-index: 4;width: 240px;height: 120px;} +.player{z-index: 2;width: 240px;height: 120px;} .player.minskin{width:120px;} .player.replaceme{ animation:replaceme 0.5s; @@ -508,6 +513,10 @@ margin-bottom: 5px; animation: game_start 0.5s; -webkit-animation: game_start 0.5s; } +.start2{ + animation: card_start 0.5s; + -webkit-animation: card_start 0.5s; +} .dialog{ animation: dialog_start 0.5s; -webkit-animation: dialog_start 0.5s; @@ -533,7 +542,7 @@ margin-bottom: 5px; animation: card_start 0.5s; -webkit-animation: card_start 0.5s; } -.card.judgestart{ +.judgestart{ animation: card_judgestart 1s; -webkit-animation: card_judgestart 1s; } diff --git a/layout/mobile/equip.css b/layout/mobile/equip.css index 340a11c81..e54cb27c6 100644 --- a/layout/mobile/equip.css +++ b/layout/mobile/equip.css @@ -125,7 +125,7 @@ } .player:not([data-position='0']).minskin.linked .equips, #arena.chess .player.minskin.linked .equips{ - transform:rotate(90deg) translate(-90px,-6px) scale(0.73); + transform:rotate(90deg) translate(-92px,-6px) scale(0.73); } .player:not([data-position='0']).linked div:not(.equips) .card, .player:not([data-position='0']).linked .identity, diff --git a/layout/mode/chess.css b/layout/mode/chess.css index 215b1c4ce..654a7e0ce 100755 --- a/layout/mode/chess.css +++ b/layout/mode/chess.css @@ -116,11 +116,20 @@ -webkit-animation-fill-mode: forwards; } -.player.playergrid{ +.player.playergrid,.player.obstacle{ background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:8px; } +.player.obstacle{ + background: repeating-linear-gradient( + 135deg, + rgba(0,0,0,0.2), + rgba(0,0,0,0.2) 10px, + rgba(0,0,0,0.1) 10px, + rgba(0,0,0,0.1) 20px + ); +} .playergrid.temp{ opacity:0.3; } @@ -147,3 +156,27 @@ #arena.leadercontrol>#control{ transition: all 0.5s !important; } +.player.treasure{ + box-shadow: none; +} +.player.treasure .count, +.player.treasure .identity{ + display: none; +} +.player.treasure .avatar{ + width: 120px; + height: 120px; + left: 0; + top: 0; +} +.player .action{ + text-shadow: black 0 0 1px !important; + font-size: 16px !important; + left:0; +} +.player .action.thunder{ + color: rgb(117,186,255); +} +#arena.selecting .player .action:not(.hidden){ + opacity: 1 !important; +} diff --git a/layout/newlayout/equip.css b/layout/newlayout/equip.css index d3f7d8dd0..20b2bc48d 100644 --- a/layout/newlayout/equip.css +++ b/layout/newlayout/equip.css @@ -104,7 +104,7 @@ transform-origin:bottom left; } .player.minskin.linked .equips{ - transform:rotate(90deg) translate(-90px,-6px) scale(0.73); + transform:rotate(90deg) translate(-92px,-6px) scale(0.73); } .player.linked div:not(.equips) .card, .player.linked .identity{ diff --git a/mode/boss.js b/mode/boss.js index faed6fb4e..820ca3480 100755 --- a/mode/boss.js +++ b/mode/boss.js @@ -307,6 +307,7 @@ mode.boss={ game.addVideo('init',null,info); "step 3" + event.trigger('gameStart'); game.gameDraw(game.boss); game.bossPhaseLoop(); setTimeout(function(){ diff --git a/mode/chess.js b/mode/chess.js index a2845dc80..bcac208cb 100755 --- a/mode/chess.js +++ b/mode/chess.js @@ -38,11 +38,16 @@ mode.chess={ while(shadows.length){ shadows[0].remove(); } + var grids=[]; for(var i=1-num;i0&&this.movable(1,0)) return true; + if(dy<0&&this.movable(0,-1)) return true; + if(dy>0&&this.movable(0,1)) return true; + return false; + }, + moveTowards:function(target){ + var fxy=this.getXY(); + var txy=target.getXY(); + var dx=txy[0]-fxy[0]; + var dy=txy[1]-fxy[1]; + if(Math.abs(dx)>Math.abs(dy)){ + if(dx<0){ + if(this.movable(-1,0)){ + this.moveLeft(); + return true; + } + } + else if(dx>0){ + if(this.movable(1,0)){ + this.moveRight(); + return true; + } + } + if(dy<0){ + if(this.movable(0,-1)){ + this.moveUp(); + return true; + } + } + else if(dy>0){ + if(this.movable(0,1)){ + this.moveDown(); + return true; + } + } + } + else{ + if(dy<0){ + if(this.movable(0,-1)){ + this.moveUp(); + return true; + } + } + else if(dy>0){ + if(this.movable(0,1)){ + this.moveDown(); + return true; + } + } + if(dx<0){ + if(this.movable(-1,0)){ + this.moveLeft(); + return true; + } + } + else if(dx>0){ + if(this.movable(1,0)){ + this.moveRight(); + return true; + } + } + } + return false; + }, chessFocus:function(){ game.addVideo('chessFocus',this); if(ui.chess._chessdrag) return; @@ -138,6 +214,11 @@ mode.chess={ return x+y*ui.chesswidth; }, getNeighbour:function(x,y){ + var xy=this.getXY(); + if(xy[0]+x<0) return null; + if(xy[1]+y<0) return null; + if(xy[0]+x>=ui.chesswidth) return null; + if(xy[1]+y>=ui.chessheight) return null; return lib.posmap[this.getDataPos(x,y)]||null; }, movable:function(x,y){ @@ -423,51 +504,8 @@ mode.chess={ }); while(targets.length){ var target=targets.shift(); - var txy=target.getXY(); - var pxy=player.getXY(); - if(Math.random()<0.5){ - if(txy[0]>pxy[0]&&randomMove.contains('moveRight')){ - if(player.moveRight()){ - event.moved=true;break; - } - } - else if(txy[0]pxy[1]&&randomMove.contains('moveDown')){ - if(player.moveDown()){ - event.moved=true;break; - } - } - else if(txy[1]pxy[1]&&randomMove.contains('moveDown')){ - if(player.moveDown()){ - event.moved=true;break; - } - } - else if(txy[1]pxy[0]&&randomMove.contains('moveRight')){ - if(player.moveRight()){ - event.moved=true;break; - } - } - else if(txy[0]=ui.chesswidth){ + x=ui.chesswidth-1; + } + if(y>=ui.chessheight){ + y=ui.chessheight-1; + } + + pos=y*ui.chesswidth+x; + } + if(!lib.posmap[pos]){ + var grid=ui.create.div('.player.minskin.obstacle',ui.chess).animate('start'); + grid.dataset.position=pos; + grid.listen(ui.click.obstacle); + lib.posmap[pos]=grid; + game.obstacles.push(grid); + } + }, + removeObstacle:function(pos){ + var node=lib.posmap[pos]; + if(node&&game.obstacles.contains(node)){ + game.addVideo('removeObstacle',null,pos); + game.obstacles.remove(node); + delete lib.posmap[pos]; + node.delete(); + } + }, addOverDialog:function(dialog,result){ dialog.classList.add('center'); if(get.config('chess_mode')!='leader') return; @@ -630,7 +731,7 @@ mode.chess={ } }, controlOver:function(){ - ui.create.control(get.config('chess_mode')=='leader'?'返回':'重新开始',game.reload); + ui.create.control('返回',game.reload); if(get.config('chess_mode')!='leader') return; if(_status.enterArena){ game.data.arena.acted.length=0; @@ -777,6 +878,30 @@ mode.chess={ break; } } + if(Math.random()0){ + lib.card.list=lib.card.list.concat(lib.chess_obstaclelist); + delete lib.chess_obstaclelist + } + ui.create.arena(); + ui.create.cards(); + game.finishCards(); ui.chessContainer=ui.create.div('#chess-container',ui.arena); ui.chessContainer.ontouchmove = ui.click.touchScroll; ui.chessContainer.style.WebkitOverflowScrolling='touch'; @@ -1056,6 +1192,18 @@ mode.chess={ for(var i=0;i0){ + var ng=Math.floor(gridnum*nco); + for(var i=0;i7?'thunder':''; - game.players[i].popup('距离:'+dist2+'/'+dist,nature); - } - } - },true); + // ui.create.system('显示距离',function(){ + // if(!game.me.isAlive()) return; + // for(var i=0;i7?'thunder':''; + // game.players[i].popup('距离:'+dist2+'/'+dist,nature); + // } + // } + // },true); ui.create.me(); ui.create.fakeme(); @@ -1179,6 +1327,9 @@ mode.chess={ } _status.videoInited=true, game.addVideo('init',null,info); + if(event.obs){ + game.addVideo('initobs',null,event.obs); + } event.trigger('gameStart'); game.gameDraw(p); @@ -2689,6 +2840,7 @@ mode.chess={ var bosslist=[]; event.list=list; for(i in lib.character){ + if(i.indexOf('treasure_')==0) continue; if(lib.character[i][4].contains('minskin')) continue; if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue; @@ -2922,6 +3074,286 @@ mode.chess={ } }, skill:{ + dubiaoxianjing:{ + global:'dubiaoxianjing2' + }, + dubiaoxianjing2:{ + trigger:{player:'phaseAfter'}, + forced:true, + popup:false, + filter:function(event,player){ + if(player.hp<=1) return false; + for(var i=0;i1) return false; + for(var i=0;inh) return false; + } + return true; + } + } + return false; + }, + content:function(){ + 'step 0' + var source=null; + for(var i=0;i3; + } + } + return false; + }, + content:function(){ + 'step 0' + var source=null; + for(var i=0;i=ui.chesswidth) num++; + if(game.obstacles.contains(player.getNeighbour(0,-1))||xy[1]==0) num++; + if(game.obstacles.contains(player.getNeighbour(0,1))||xy[1]+1>=ui.chessheight) num++; + return num>=3; + }, + content:function(){ + 'step 0' + event.obstacles=[]; + var neighbour; + neighbour=player.getNeighbour(-1,0); + if(neighbour&&game.obstacles.contains(neighbour)){ + event.obstacles.push(neighbour); + } + neighbour=player.getNeighbour(1,0); + if(neighbour&&game.obstacles.contains(neighbour)){ + event.obstacles.push(neighbour); + } + neighbour=player.getNeighbour(0,-1); + if(neighbour&&game.obstacles.contains(neighbour)){ + event.obstacles.push(neighbour); + } + neighbour=player.getNeighbour(0,1); + if(neighbour&&game.obstacles.contains(neighbour)){ + event.obstacles.push(neighbour); + } + if(!event.obstacles.length){ + event.finish(); + return; + } + else if(event.obstacles.length==1){ + event.obstacle=event.obstacles[0]; + } + else if(event.isMine()){ + for(var i=0;i'+lib.translate._chess_chuzhang_info+''); + } + 'step 1' + _status.imchoosing=false; + if(!event.obstacle){ + event.obstacle=event.obstacles.randomGet(); + } + game.removeObstacle(event.obstacle.dataset.position); + for(var i=0;i.equips>.equip5 { - border-radius: 8px; + border-radius: 4px; } diff --git a/theme/simple/style.css b/theme/simple/style.css index fee664ec0..a44874c14 100755 --- a/theme/simple/style.css +++ b/theme/simple/style.css @@ -35,6 +35,10 @@ body{ .player.unseen .equips:not(*:empty){ border-radius:4px; } +#arena:not(.chess) .player[data-position='0']>.equips>.equip5 { + border-radius: 4px; +} + .card{ color:white; } @@ -47,6 +51,15 @@ body{ #me>div>.card,#arena>.card:not(*:empty){ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px; } +/*.player{ + background:repeating-linear-gradient( + 135deg, + rgba(0,0,0,0.4), + rgba(0,0,0,0.4) 2px, + rgba(0,0,0,0.2) 2px, + rgba(0,0,0,0.2) 4px + ); +}*/ .menupaused{ opacity: 0.3;