This commit is contained in:
2024-09-23 08:14:39 +08:00
parent 96c96da552
commit 618a6e3f7b
65 changed files with 38950 additions and 8530 deletions

View File

@@ -155,6 +155,9 @@ export class MonViewComp extends CCComp {
update(dt: number){
if(smc.vm_data.game_over||smc.vm_data.game_pause){
return
}
if (this.timer.update(dt)) {
this.power_change(this.power_speed)
}
@@ -306,14 +309,14 @@ export class MonViewComp extends CCComp {
if(this.hp <= 0){
this.dead();
this.is_dead = true;
smc.vm_data.mission.reward_num += 1;
setTimeout(() => {
this.ent.destroy();
}, 15);
}
}
add_hp(hp: number=0){
console.log("hero 加血动画");
this.heathed()
this.hp+=hp;
if(this.hp > this.hp_max){
this.hp = this.hp_max;
@@ -322,6 +325,10 @@ export class MonViewComp extends CCComp {
let hp_progress= this.hp/this.hp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
}
heathed(){
this.node.getChildByName("heathed").active=true
}
add_atk(atk: number,time:number=0){
if(time > 0){
let buff={atk:atk,time:time}
@@ -330,6 +337,7 @@ export class MonViewComp extends CCComp {
this.atk += atk;
}
}
check_buff_atks(dt: number){
for(let i=0;i<this.buff_atks.length;i++){
let buff=this.buff_atks[i];