回血动画

This commit is contained in:
libccy 2015-09-26 21:11:55 +08:00
parent 0a7084ef0c
commit ec74b01d8d
7 changed files with 103 additions and 13 deletions

View File

@ -1,2 +1,5 @@
1.2.12 1.3.0
AI AI
裸衣bug
部分游戏特效
(可在“设置->外观->动画特效”中关闭)

View File

@ -452,7 +452,7 @@ card.hearth={
'step 1' 'step 1'
if(target.hp<target.maxHp){ if(target.hp<target.maxHp){
target.judge(function(card){ target.judge(function(card){
return get.color(card)=='red'?1:-1; return get.color(card)=='red'?1:0;
}); });
} }
else{ else{

View File

@ -201,7 +201,8 @@ character.refresh={
reluoyi2:{ reluoyi2:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
filter:function(event){ filter:function(event){
return (event.card&&(event.card.name=='sha'||event.card.name=='juedou')); return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&
event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2';
}, },
forced:true, forced:true,
content:function(){ content:function(){

View File

@ -283,7 +283,8 @@ character.standard={
luoyi2:{ luoyi2:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
filter:function(event){ filter:function(event){
return (event.card&&(event.card.name=='sha'||event.card.name=='juedou')); return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&
event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2';
}, },
forced:true, forced:true,
content:function(){ content:function(){

View File

@ -166,7 +166,7 @@ window.config={
threed_card_config:'立体手牌', threed_card_config:'立体手牌',
blur_ui_config:'模糊效果', blur_ui_config:'模糊效果',
vertical_scroll_config:'纵向滚动手牌', vertical_scroll_config:'纵向滚动手牌',
animation_config:'动画', animation_config:'动画效',
right_sidebar_config:'侧栏靠右', right_sidebar_config:'侧栏靠右',
title_config:'标题栏显示信息', title_config:'标题栏显示信息',
intro_config:'信息符号', intro_config:'信息符号',

View File

@ -1705,9 +1705,12 @@
else if(event.nature=='thunder'){ else if(event.nature=='thunder'){
player.$thunder(); player.$thunder();
} }
player.$damagepop(-num,event.nature);
} }
} else{
player.popup(-num,event.nature); player.popup(-num,event.nature);
}
}
// if(source){ // if(source){
// if(player._damagetimeout!=source){ // if(player._damagetimeout!=source){
// player.$damage(source); // player.$damage(source);
@ -1746,7 +1749,14 @@
} }
if(num>player.maxHp-player.hp) num=player.maxHp-player.hp; if(num>player.maxHp-player.hp) num=player.maxHp-player.hp;
if(num>0){ 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)+'点体力') game.log(get.translation(player)+'回复了'+get.cnNumber(num)+'点体力')
} }
}, },
@ -4256,6 +4266,38 @@
game.animate.flame(this.offsetLeft+this.offsetWidth/2, game.animate.flame(this.offsetLeft+this.offsetWidth/2,
this.offsetTop+this.offsetHeight-30,700,'thunder'); 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){ $damage:function(source){
if(source&&source!=this){ if(source&&source!=this){
var left,top; var left,top;
@ -5326,7 +5368,7 @@
flame:function(x,y,duration,type){ flame:function(x,y,duration,type){
var particles=[]; var particles=[];
var particle_count=50; var particle_count=50;
if(type=='thunder'){ if(type=='thunder'||type=='recover'){
particle_count=30; particle_count=30;
} }
for(var i = 0; i < particle_count; i++) { for(var i = 0; i < particle_count; i++) {
@ -5361,6 +5403,24 @@
this.b = 0; this.b = 0;
break; 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.x<x){
this.speed.x=-Math.abs(this.speed.x);
}
else if(this.location.x>x){
this.speed.x=Math.abs(this.speed.x);
}
this.speed.x/=2;
this.speed.y/=2;
this.life*=2;
this.death*=2;
break;
}
default:{ default:{
this.r = 255; this.r = 255;
this.g = Math.round(Math.random()*155); this.g = Math.round(Math.random()*155);
@ -5380,6 +5440,10 @@
surface.beginPath(); surface.beginPath();
var middle=0.5; var middle=0.5;
var radius=p.radius; var radius=p.radius;
if(type=='recover'){
middle=0.7;
radius/=3;
}
p.opacity = Math.round(p.death/p.life*100)/100 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); 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.arc(p.location.x, p.location.y, radius, Math.PI*2, false);
surface.fill(); surface.fill();
p.death--; p.death--;
if(type=='recover'){
p.radius+=0.5;
}
else {
p.radius++; p.radius++;
}
p.location.x += (p.speed.x); p.location.x += (p.speed.x);
p.location.y += (p.speed.y); p.location.y += (p.speed.y);
@ -5408,10 +5477,6 @@
} }
}); });
} }
},
animatex:function(){
}, },
linexy:function(path){ linexy:function(path){
var from=[path[0],path[1]]; var from=[path[0],path[1]];
@ -8256,6 +8321,7 @@
node.forbiddenSkills=[]; node.forbiddenSkills=[];
node.modeSkills=[]; node.modeSkills=[];
node.popups=[]; node.popups=[];
node.damagepopups=[];
node.stat=[{card:{},skill:{}}]; node.stat=[{card:{},skill:{}}];
node.tempSkills={}; node.tempSkills={};
node.storage={}; node.storage={};

View File

@ -211,6 +211,25 @@ margin-bottom: 5px;
.player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);} .player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);}
.player>.name{left: 18px;top:36px;} .player>.name{left: 18px;top:36px;}
.player>.intro{top:87px;left: 18px;} .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;} .avatar{width: 96px;height: 96px;left: 12px;top: 12px;overflow: hidden;}
.avatar2{width: 42px;height: 42px;top: 70px;left: 70px;overflow: hidden;} .avatar2{width: 42px;height: 42px;top: 70px;left: 70px;overflow: hidden;}
.equips{width: 96px;height: 96px;right: 14px;top:12px;} .equips{width: 96px;height: 96px;right: 14px;top:12px;}