重做 局内经验的利用,加攻 加血,特殊技能,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

@@ -51,8 +51,8 @@ export class Role extends ecs.Entity {
}
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
var rv = node.getComponent(RoleViewComp)!;
let role=smc.vm_data.role;
let role_talent= smc.vm_data.talent
let role=smc.vmdata.role;
let role_talent= smc.vmdata.talent
let talents=Talents;
rv.hero_uuid=uuid;
rv.speed =rv.ospeed = role.speed;

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);

View File

@@ -19,7 +19,7 @@ export class TalentComp extends CCComp {
let cost =this.node.getChildByName("cost")
let lv =this.node.getChildByName("lv")
let talent= Talents[this.t_uuid]
let role_talents = smc.vm_data.talent[talent.uuid]
let role_talents = smc.vmdata.talent[talent.uuid]
cost.getComponent(Label).string = (talent.cost*(1+role_talents.lv)).toString()
name.getComponent(Label).string = talent.name
info.getComponent(Label).string = talent.info