技能继续重构
This commit is contained in:
@@ -153,7 +153,7 @@ export class BuffComp extends Component {
|
||||
node.setPosition(pos);
|
||||
}
|
||||
in_atked(anm:string="atked",scale:number=1) {
|
||||
var path = "game/skills/"+anm;
|
||||
var path = "game/skill/boom/"+anm;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setScale(node.scale.x*scale,node.scale.y)
|
||||
|
||||
@@ -84,7 +84,6 @@ export class HeroViewComp extends CCComp {
|
||||
atk_count: number = 0;
|
||||
atked_count: number = 0;
|
||||
|
||||
speek_time:number = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ export class Monster extends ecs.Entity {
|
||||
// console.log("mon load",uuid)
|
||||
// this.addComponents<ecs.Comp>( MonModelComp, BattleMoveComp);
|
||||
var scene = smc.map.MapView.scene;
|
||||
this.brith_light(pos,scene)
|
||||
var path = "game/heros/"+HeroInfo[uuid].path;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
@@ -55,13 +54,7 @@ export class Monster extends ecs.Entity {
|
||||
smc.vmdata.mission_data.mon_num++
|
||||
// console.log("[Mon] mission_data.mon_num:",smc.vmdata.mission_data.mon_num)
|
||||
}
|
||||
brith_light(pos:Vec3,scene:any){
|
||||
var path = "game/skills/map_birth";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = scene.entityLayer!.node!
|
||||
node.setPosition(pos)
|
||||
}
|
||||
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false, strengthMultiplier: number = 1.0) {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
|
||||
|
||||
@@ -23,10 +23,8 @@ export class SkillConComp extends CCComp {
|
||||
}
|
||||
onLoad(){
|
||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||
// //console.log(this.HeroView.uid+"=>"+this.HeroView.hero_name+"=> SkillConComp onLoad")
|
||||
}
|
||||
start() {
|
||||
// //console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp start")
|
||||
this.HeroEntity=this.HeroView.ent
|
||||
}
|
||||
|
||||
@@ -34,10 +32,8 @@ export class SkillConComp extends CCComp {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
if(!this.HeroView.isStun() && !this.HeroView.isFrost()) {
|
||||
let skills=this.HeroView.skills
|
||||
console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"技能列表:",skills)
|
||||
for(let i=0;i<skills.length;i++){
|
||||
skills[i].cd += dt;
|
||||
console.log(this.HeroView.uuid+"=>"+skills[i].cost,this.HeroView.mp)
|
||||
if(skills[i].cd > skills[i].cd_max&&this.HeroView.mp >= skills[i].cost){
|
||||
|
||||
if(SkillSet[skills[i].uuid].SType==SType.damage&&this.HeroView.is_atking){
|
||||
@@ -55,7 +51,6 @@ export class SkillConComp extends CCComp {
|
||||
|
||||
/** 施放技能 */
|
||||
castSkill(config: typeof SkillSet[keyof typeof SkillSet]) {
|
||||
// //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
||||
let wfuny=this.check_wfuny()
|
||||
let dmg=0
|
||||
this.doSkill(config,wfuny,dmg);
|
||||
|
||||
Reference in New Issue
Block a user