From 66445f6351d61051f0a556f2de0934ba2b68acf4 Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 19 Jul 2017 12:06:06 +0800 Subject: [PATCH] 4 --- game/config.js | 2 +- game/game.js | 36 ++++++++++++++++++++----------- layout/long2/layout.css | 1 + mode/identity.js | 48 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 13 deletions(-) diff --git a/game/config.js b/game/config.js index ac85c0a34..f7c6d70bf 100644 --- a/game/config.js +++ b/game/config.js @@ -64,7 +64,7 @@ window.config={ background_audio:true, background_speak:true, glow_phase:'yellow', - die_flip:true, + die_move:'flip', skin:{}, gameRecord:{}, diff --git a/game/game.js b/game/game.js index b47776e60..886472d98 100644 --- a/game/game.js +++ b/game/game.js @@ -2183,12 +2183,6 @@ init:true, unfrequent:true, }, - die_flip:{ - name:'阵亡效果', - intro:'阵亡后武将位置会随机移动', - init:true, - unfrequent:true, - }, animation:{ name:'游戏特效', intro:'开启后出现属性伤害、回复体力等情况时会显示动画', @@ -2201,6 +2195,17 @@ init:true, unfrequent:true, }, + die_move:{ + name:'阵亡效果', + intro:'阵亡后武将的显示效果', + init:'flip', + unfrequent:true, + item:{ + off:'关闭', + move:'移动', + flip:'翻面', + } + }, target_shake:{ name:'目标效果', intro:'一名玩家成为卡牌或技能的目标时的显示效果', @@ -18285,14 +18290,14 @@ game.broadcast(function(player){ player.$die(); },this); - if(lib.config.die_flip){ - this.$dieflip(); + if(lib.config.die_move!='off'){ + this.$dieflip(lib.config.die_move); } if(lib.element.player.$dieAfter){ lib.element.player.$dieAfter.call(this); } }, - $dieflip:function(){ + $dieflip:function(type){ var top0=ui.window.offsetHeight/2; var left0=ui.window.offsetWidth/2; var ratio=(left0-this.offsetLeft)/(top0-this.offsetTop); @@ -18305,8 +18310,15 @@ top=Math.random()*5+10; } var transform='translate('+left+'px,'+top+'px) '+ - 'rotate('+(Math.random()*20-10)+'deg) '+ - ((Math.random()-0.5<0)?'rotateX(180deg)':'rotateY(180deg)'); + 'rotate('+(Math.random()*20-10)+'deg) '; + if(type=='flip'){ + if(game.layout=='long'||game.layout=='long2'){ + transform+='rotateY(180deg)'; + } + else{ + transform+=((Math.random()-0.5<0)?'rotateX(180deg)':'rotateY(180deg)'); + } + } if(get.is.mobileMe(this)){ this.node.avatar.style.transform=transform; this.node.avatar2.style.transform=transform; @@ -20860,7 +20872,7 @@ player.setNickname(); if(info.dead){ player.classList.add('dead'); - if(lib.config.die_flip){ + if(lib.config.die_move){ player.$dieflip(); } if(lib.element.player.$dieAfter){ diff --git a/layout/long2/layout.css b/layout/long2/layout.css index 9ccd832bd..fcb3d89d8 100644 --- a/layout/long2/layout.css +++ b/layout/long2/layout.css @@ -239,6 +239,7 @@ } #arena>.player:not(.minskin)>.damage.dieidentity{ font-size: 60px; + transform: scale(1); } #arena[data-player_height='default']>.player:not(.minskin){ height: 200px !important; diff --git a/mode/identity.js b/mode/identity.js index b1eae9e55..2b027d659 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -880,6 +880,40 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.players[i].identityShown=false; } } + + if(get.config('special_identity')&&!event.zhongmode&&game.players.length==8){ + for(var i=0;i=1){ + fans.randomRemove().special_identity='identity_zeishou'; + event.special_identity.push('identity_zeishou'); + } + if(zhongs.length>1){ + zhongs.randomRemove().special_identity='identity_dajiang'; + zhongs.randomRemove().special_identity='identity_junshi'; + event.special_identity.push('identity_dajiang'); + event.special_identity.push('identity_junshi'); + } + else if(zhongs.length==1){ + if(Math.random()<0.5){ + zhongs.randomRemove().special_identity='identity_dajiang'; + event.special_identity.push('identity_dajiang'); + } + else{ + zhongs.randomRemove().special_identity='identity_junshi'; + event.special_identity.push('identity_junshi'); + } + } + } + if(!game.zhu) game.zhu=game.me; else{ game.zhu.setIdentity(); @@ -969,6 +1003,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } } + if(game.me.special_identity){ + dialog.setCaption('选择角色('+get.translation(game.me.special_identity)+')'); + game.me.node.identity.firstChild.innerHTML=get.translation(game.me.special_identity+'_bg'); + } + else{ + dialog.setCaption('选择角色'); + game.me.setIdentity(); + } if(!event.chosen.length){ game.me.chooseButton(dialog,true).set('onfree',true).selectButton=function(){ if(_status.brawl&&_status.brawl.doubleCharacter) return 2; @@ -1131,6 +1173,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ setTimeout(function(){ ui.arena.classList.remove('choose-character'); },500); + + if(event.special_identity){ + for(var i=0;i