From 789e4183ec178b8f194942f921161951ad086da6 Mon Sep 17 00:00:00 2001 From: panw Date: Fri, 25 Apr 2025 16:56:27 +0800 Subject: [PATCH] dd --- assets/script/game/hero/HeroViewComp.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index efa3cb9c..f9fe4691 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -2,7 +2,6 @@ import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,insta import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { HeroSpine } from "./HeroSpine"; -import { HeroModelComp } from "./HeroModelComp"; import { BoxSet, GameSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; import { Skill } from "../skills/Skill"; @@ -11,7 +10,6 @@ import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; import { HeroSet } from "../common/config/heroSet"; import { BuffComp } from "./BuffComp"; -import { MonModelComp } from "./MonModelComp"; import { getMonsterDrops, MonsterType } from "../common/config/RewardSet"; import { HeroSkillsComp } from "../skill/heroSkillsComp"; const { ccclass, property } = _decorator; @@ -184,7 +182,7 @@ export class HeroViewComp extends CCComp { * 增加英雄的攻击(AP)。 * @param ap 要增加的攻击。 */ - add_ap(ap: number,is_num:boolean=false){ + add_ap(ap: number,is_num:boolean=true){ if(is_num){ this.ap += Math.floor(ap); }else{ @@ -193,7 +191,7 @@ export class HeroViewComp extends CCComp { this.BUFFCOMP.update_info_ap() } - de_ap(ap: number,is_num:boolean=false){ + de_ap(ap: number,is_num:boolean=true){ if(is_num){ this.ap -= Math.floor(ap); }else{ @@ -202,7 +200,7 @@ export class HeroViewComp extends CCComp { this.BUFFCOMP.update_info_ap() } - add_hp_max(hp: number=0,is_num:boolean=false){ + add_hp_max(hp: number=0,is_num:boolean=true){ if(is_num){ this.hp_max += Math.floor(hp) ; this.hp += Math.floor(hp) ; @@ -213,7 +211,7 @@ export class HeroViewComp extends CCComp { this.BUFFCOMP.update_info_hp() } - de_hp_max(hp: number=0,is_num:boolean=false){ + de_hp_max(hp: number=0,is_num:boolean=true){ if(is_num){ this.hp_max -= Math.floor(hp) ; }else{ @@ -222,7 +220,7 @@ export class HeroViewComp extends CCComp { this.BUFFCOMP.update_info_hp() } - add_hp(hp: number = 0,is_num:boolean=false) { + add_hp(hp: number = 0,is_num:boolean=true) { this.BUFFCOMP.heathed(); if(is_num){ this.hp+=Math.floor(hp); @@ -247,10 +245,20 @@ export class HeroViewComp extends CCComp { } } + do_change(){ + + } + do_update(){ + + } + do_dead(){ + + } dead(){ this.BUFFCOMP.dead() this.to_drop() } + //掉落物品 to_drop(){ // let Drops = getMonsterDrops(1, MonsterType.Normal, 1.2); @@ -261,6 +269,7 @@ export class HeroViewComp extends CCComp { to_console(value:any,value2:any=null,value3:any=null){ console.log("["+this.scale+this.hero_name+']'+value,value2,value3) } + reset() { this.is_dead = false; const collider = this.getComponent(Collider2D); @@ -271,6 +280,7 @@ export class HeroViewComp extends CCComp { this.node.destroy(); }, 0.1); } + playSkillEffect(skill_id:number) { let skill = SkillSet[skill_id] switch(skill.act){