重做 局内经验的利用,加攻 加血,特殊技能,todo:先完成物品设定

This commit is contained in:
walkpan
2024-11-25 00:02:07 +08:00
parent 5a268cc8f2
commit 2d4d564c1f
31 changed files with 5212 additions and 6212 deletions

View File

@@ -112,7 +112,7 @@ export class RoleViewComp extends CCComp {
// this.orginalFlashMaterial = this.sprite.getRenderMaterial(0);
// 注册单个碰撞体的回调函数
let collider = this.getComponent(Collider2D);
smc.vm_data.role.atk_time=smc.vm_data.role.atk_cd;
smc.vmdata.role.atk_time=smc.vmdata.role.atk_cd;
collider.group = this.box_group;
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
@@ -177,7 +177,7 @@ export class RoleViewComp extends CCComp {
update(dt: number){
if(!smc.vm_data.mission.play||smc.vm_data.pause){
if(!smc.vmdata.mission.play||smc.vmdata.pause){
return
}
if (this.timer.update(dt)) {
@@ -187,7 +187,7 @@ export class RoleViewComp extends CCComp {
this.check_buff_atks(dt)
this.in_shield(dt);
this.in_stop(dt);
smc.vm_data.role.atk_time -= dt;
smc.vmdata.role.atk_time -= dt;
this.in_atk();
this.skill_cds(dt);
this.move(dt);
@@ -323,16 +323,16 @@ export class RoleViewComp extends CCComp {
}
}
in_atk() {
if(smc.vm_data.role.atk_time <= 0 ){
if(smc.vmdata.role.atk_time <= 0 ){
if(this.is_atking){
smc.vm_data.role.atk_time = smc.vm_data.role.atk_cd;
console.log("atk_cd:"+smc.vm_data.role.atk_cd);
smc.vmdata.role.atk_time = smc.vmdata.role.atk_cd;
console.log("atk_cd:"+smc.vmdata.role.atk_cd);
this.as.atk();
this.scheduleOnce(()=>{
this.shoot(this.skill,0,30);
},0.4)
}
// smc.vm_data.role.atk_time = 0;
// smc.vmdata.role.atk_time = 0;
// this.as.atk();
// this.scheduleOnce(()=>{
// this.shoot(this.skill,-30,45);
@@ -373,7 +373,7 @@ export class RoleViewComp extends CCComp {
this.dead();
this.is_dead = true;
this.ent.remove(MoveToComp)
smc.vm_data.game_over = true;
smc.vmdata.game_over = true;
setTimeout(() => {
this.ent.destroy();
}, 15);