diff --git a/CHANGELOG.MD b/CHANGELOG.MD index ed18f9907..63d7a0ad4 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,2 +1,5 @@ -1.2.12 +1.3.0 AI +裸衣bug +部分游戏特效 +(可在“设置->外观->动画特效”中关闭) diff --git a/card/hearth.js b/card/hearth.js index 8f4cfd79c..a14123c10 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -452,7 +452,7 @@ card.hearth={ 'step 1' if(target.hpplayer.maxHp-player.hp) num=player.maxHp-player.hp; if(num>0){ - player.changeHp(num); + player.changeHp(num,false); + if(lib.config.animation){ + player.$damagepop(num,'wood'); + player.$recover(); + } + else{ + player.popup(num); + } game.log(get.translation(player)+'回复了'+get.cnNumber(num)+'点体力') } }, @@ -4256,6 +4266,38 @@ game.animate.flame(this.offsetLeft+this.offsetWidth/2, this.offsetTop+this.offsetHeight-30,700,'thunder'); }, + $recover:function(){ + game.animate.flame(this.offsetLeft+this.offsetWidth/2, + this.offsetTop+this.offsetHeight-30,700,'recover'); + }, + $damagepop:function(num,nature){ + if(typeof num=='number'){ + var node=ui.create.div('.damage'); + if(num>0){ + num='+'+num; + } + node.innerHTML=num; + this.damagepopups.push(node); + node.dataset.nature=nature||'soil'; + if(this.damagepopups.length==1){ + this.$damagepop(); + } + } + else if(this.damagepopups.length){ + var node=this.damagepopups[0]; + this.appendChild(node); + ui.refresh(node); + node.classList.add('damageadded'); + setTimeout(function(){ + node.delete(); + },500); + var that=this; + setTimeout(function(){ + that.damagepopups.shift(); + that.$damagepop(); + },500); + } + }, $damage:function(source){ if(source&&source!=this){ var left,top; @@ -5326,7 +5368,7 @@ flame:function(x,y,duration,type){ var particles=[]; var particle_count=50; - if(type=='thunder'){ + if(type=='thunder'||type=='recover'){ particle_count=30; } for(var i = 0; i < particle_count; i++) { @@ -5361,6 +5403,24 @@ this.b = 0; break; } + case 'recover':{ + this.g = 255; + this.r = Math.round(Math.random()*200+55); + this.b = Math.round(Math.random()*155+55); + this.location.x+=Math.round(Math.random()*60)-30; + this.location.y+=Math.round(Math.random()*40)-20; + if(this.location.xx){ + this.speed.x=Math.abs(this.speed.x); + } + this.speed.x/=2; + this.speed.y/=2; + this.life*=2; + this.death*=2; + break; + } default:{ this.r = 255; this.g = Math.round(Math.random()*155); @@ -5380,6 +5440,10 @@ surface.beginPath(); var middle=0.5; var radius=p.radius; + if(type=='recover'){ + middle=0.7; + radius/=3; + } p.opacity = Math.round(p.death/p.life*100)/100 var gradient = surface.createRadialGradient(p.location.x, p.location.y, 0, p.location.x, p.location.y, p.radius); @@ -5390,7 +5454,12 @@ surface.arc(p.location.x, p.location.y, radius, Math.PI*2, false); surface.fill(); p.death--; - p.radius++; + if(type=='recover'){ + p.radius+=0.5; + } + else { + p.radius++; + } p.location.x += (p.speed.x); p.location.y += (p.speed.y); @@ -5408,10 +5477,6 @@ } }); } - }, - animatex:function(){ - - }, linexy:function(path){ var from=[path[0],path[1]]; @@ -8256,6 +8321,7 @@ node.forbiddenSkills=[]; node.modeSkills=[]; node.popups=[]; + node.damagepopups=[]; node.stat=[{card:{},skill:{}}]; node.tempSkills={}; node.storage={}; diff --git a/layout/default/layout.css b/layout/default/layout.css index 231ff14ab..45cc19c92 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -211,6 +211,25 @@ margin-bottom: 5px; .player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);} .player>.name{left: 18px;top:36px;} .player>.intro{top:87px;left: 18px;} +.player>.damage{ + font-family: 'huangcao'; + font-size:72px; + width: 100%; + text-align: center; + top:calc(50% - 36px); + opacity: 0; + -webkit-transform:scale(0.7); +} +.player>.damage.damageadded{ + opacity: 1; + -webkit-transform:scale(1); +} +.player.linked>.damage{ + -webkit-transform:scale(0.7) rotate(90deg); +} +.player.linked>.damage.damageadded{ + -webkit-transform:scale(1) rotate(90deg); +} .avatar{width: 96px;height: 96px;left: 12px;top: 12px;overflow: hidden;} .avatar2{width: 42px;height: 42px;top: 70px;left: 70px;overflow: hidden;} .equips{width: 96px;height: 96px;right: 14px;top:12px;}