伤害系统 + 战斗管理系统
This commit is contained in:
9
assets/script/game/damage/DamageComp.ts.meta
Normal file
9
assets/script/game/damage/DamageComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5dc13d0b-967b-4378-89d0-35322998b506",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
21
assets/script/game/damage/DamageShowSystem.ts
Normal file
21
assets/script/game/damage/DamageShowSystem.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { DamageResult } from "./DamageComp";
|
||||
|
||||
@ecs.register('DamageShowSystem')
|
||||
export class DamageShowSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(DamageResult, HeroViewComp);
|
||||
}
|
||||
|
||||
update(e: ecs.Entity) {
|
||||
const res = e.get(DamageResult);
|
||||
const view = e.get(HeroViewComp);
|
||||
|
||||
// 显示伤害数字
|
||||
view.showDamage(res.finalDamage, res.isCrit);
|
||||
|
||||
// 移除已处理的伤害结果组件
|
||||
e.remove(DamageResult);
|
||||
}
|
||||
}
|
||||
9
assets/script/game/damage/DamageShowSystem.ts.meta
Normal file
9
assets/script/game/damage/DamageShowSystem.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "a9a6c37c-d5c7-4811-bc7a-471c8ed7b022",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
9
assets/script/game/damage/DamageSystem.ts.meta
Normal file
9
assets/script/game/damage/DamageSystem.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5e0fcfaa-f9b3-43b6-8584-5a55940c89e0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user