boss需要改用spine 动画 先放一放

This commit is contained in:
2024-09-19 16:22:39 +08:00
parent 29a6f6a8b6
commit 3c9fab6889
43 changed files with 2179 additions and 2679 deletions

View File

@@ -11,7 +11,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { HeroSpine } from "./HeroSpine";
import { Hero } from "./Hero";
import { HeroModelComp } from "./HeroModelComp";
import { BoxSet } from "../common/config/BoxSet";
import { BoxSet, GameSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { Skill } from "../skills/Skill";
@@ -192,7 +192,26 @@ export class HeroViewComp extends CCComp {
// this.move_to()
// }
}
check_enemy_alive(){
let dir = 320
for (let i = 0; i < GameSet.ATK_LINES; i++) {
let mon:any = smc.enemy_pos[i];
let x=Math.abs(mon.x-this.node.position.x)
let y = Math.abs(mon.y-this.node.position.y)
let squaredDistance =x*x+y*y
let distance = Math.sqrt(squaredDistance);
if(distance < dir){
dir = distance
this.enemy = mon
}
}
if(dir < this.atk_dis){
this.is_atking=true
}else{
this.is_atking=false
}
}
move(dt: number){
if(this.stop_cd > 0){
return
@@ -356,24 +375,7 @@ export class HeroViewComp extends CCComp {
}
}
check_enemy_alive(){
let dir = 320
for (let i = 0; i <= 2; i++) {
let mon:any = smc.enemy_pos[i];
let squaredDistance =mon.x*mon.x+mon.y*mon.y
let distance = Math.sqrt(squaredDistance);
if(distance < dir){
dir = distance
this.enemy = mon
}
}
if(dir < this.atk_dis){
this.is_atking=true
}else{
this.is_atking=false
}
}
in_atk(dt: number) {
if(this.atk_time >= this.atk_cd){
if(this.is_atking){
@@ -437,10 +439,6 @@ export class HeroViewComp extends CCComp {
}else{
this.atk += atk;
}
this.sprite.setSharedMaterial(this.atkMaterial, 0);
this.scheduleOnce(() => {
this.sprite.setSharedMaterial(this.orginalFlashMaterial, 0);
}, 0.3);
// console.log(this.buff_atks)
}
@@ -455,15 +453,17 @@ export class HeroViewComp extends CCComp {
}
if(this.buff_atks.length <= 0){
this.buff_atk = 0
this.buff_icon_change("atk",false)
// this.buff_icon_change("atk",false)
this.sprite.setSharedMaterial(this.orginalFlashMaterial, 0);
}else{
this.buff_icon_change("atk",true)
// this.buff_icon_change("atk",true)
this.sprite.setSharedMaterial(this.atkMaterial, 0);
}
}
buff_icon_change(icon:string,value:boolean){
this.node.getChildByName("top").getChildByName("buff").getChildByName(icon).active=value
// this.node.getChildByName("top").getChildByName("buff").getChildByName(icon).active=value
}