hero需要重做,去除role 加载,需要关注后续错误

This commit is contained in:
2024-11-12 16:47:41 +08:00
parent be7ea10196
commit 220f595ff6
82 changed files with 1819 additions and 15395 deletions

View File

@@ -23,6 +23,7 @@ import { MoveToComp } from "../common/ecs/position/MoveTo";
import { BoxRangComp } from "./BoxRangComp";
import { MonViewComp } from "../mon/MonViewComp";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { TimerManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/TimerManager";
const { ccclass, property } = _decorator;
/** 角色显示组件 */
@@ -96,8 +97,8 @@ export class HeroViewComp extends CCComp {
dir_y:number = 0;
speek_time:number = 0;
role_heros_index:number = -1;
anm_timer:Timer = new Timer(2);
anm_name="idle"
onLoad() {
this.as = this.getComponent(HeroSpine);
@@ -193,22 +194,45 @@ export class HeroViewComp extends CCComp {
if (this.timer.update(dt)) {
this.power_change(this.power_speed)
}
this.in_destroy();
this.check_buff_atks(dt)
this.in_shield(dt);
this.in_stop(dt);
this.atk_time += dt;
this.check_enemy_alive()
this.in_atk(dt);
this.hp_show()
if(this.anm_timer.update(dt)) {
this.change_anm()
}
// this.in_destroy();
// this.check_buff_atks(dt)
// this.in_shield(dt);
// this.in_stop(dt);
// this.atk_time += dt;
// this.check_enemy_alive()
// this.in_atk(dt);
// this.hp_show()
// this.move(dt);
// this.in_speek(dt);
this.move(dt);
// this.move_to()
// if(this.m_timer.update(dt)){
// this.move_to()
// }
}
change_anm(){
if (this.anm_name == "max"){
this.as.max()
this.anm_name = "idle"
}
if (this.anm_name == "atk") {
this.as.atk()
this.anm_name = "max"
}
if (this.anm_name == "move") {
this.as.move()
this.anm_name = "atk"
}
if (this.anm_name == "idle") {
this.as.idle()
this.anm_name = "move"
}
}
check_enemy_alive(){
let dir = 320
this.enemy = v3(720,this.node.position.y)

View File

@@ -82,7 +82,7 @@ export class MapMonsterComp extends CCComp {
}
if(this.setp_timer.update(dt)){
if(this.total<=0) return
this.monster_refresh()
// this.monster_refresh()
}
if(this.call_hero_timer.update(dt)){
if(this.hero_total <= 0) return
@@ -110,7 +110,7 @@ export class MapMonsterComp extends CCComp {
}
mission_start(){
this.total=smc.vm_data.mission.m_less=smc.vm_data.mission.m_alive=smc.vm_data.mission.total;
this.hero_total=smc.vm_data.role.hero_num
this.hero_total=1
let num =RandomManager.instance.getRandomByObjectList(MissionNum,1)
this.cur_mission = num[0]
this.mission_list = MonsetList[this.cur_mission]
@@ -122,7 +122,7 @@ export class MapMonsterComp extends CCComp {
this.hero_x=0
this.hero_index=0
smc.vm_data.mission.coin = 0
this.load_role()
// this.load_role()
}
on_mon_dead(){
let coin =(GameSet.MON_COIN_ADD*smc.vm_data.mission.coin_reward_add*(1+Talents[1006].bonus*smc.vm_data.talent[1006].lv)).toFixed(0)