将必杀技 迁移到 skillconcom ,去除技能释放卡牌
This commit is contained in:
@@ -196,12 +196,12 @@ export class FightConComp extends Component {
|
||||
}
|
||||
|
||||
|
||||
/** 随机选择目标 */
|
||||
private pickRandomTarget(count: number=1): ecs.Entity[] {
|
||||
let entities = ecs.query(ecs.allOf(MonModelComp))
|
||||
const shuffled = [...entities].sort(() => 0.5 - Math.random());
|
||||
return shuffled.slice(0, count);
|
||||
}
|
||||
// /** 随机选择目标 */
|
||||
// private pickRandomTarget(count: number=1): ecs.Entity[] {
|
||||
// let entities = ecs.query(ecs.allOf(MonModelComp))
|
||||
// const shuffled = [...entities].sort(() => 0.5 - Math.random());
|
||||
// return shuffled.slice(0, count);
|
||||
// }
|
||||
|
||||
private clearAlls() {
|
||||
this.hero_buff=getBuffNum()
|
||||
@@ -227,37 +227,37 @@ export class FightConComp extends Component {
|
||||
this.skill_id_counter = 0; // 重置技能ID计数器
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
// 并行执行多个技能
|
||||
if (this.aoe_queues.length > 0) {
|
||||
console.log("[FightConComp]:aoe_queues:",this.aoe_queues)
|
||||
// update(deltaTime: number) {
|
||||
// // 并行执行多个技能
|
||||
// if (this.aoe_queues.length > 0) {
|
||||
// console.log("[FightConComp]:aoe_queues:",this.aoe_queues)
|
||||
|
||||
// 遍历所有技能,更新它们的计时器
|
||||
for (let i = this.aoe_queues.length - 1; i >= 0; i--) {
|
||||
let skill = this.aoe_queues[i];
|
||||
let timer = this.aoe_timers.get(skill.id) || 0;
|
||||
// // 遍历所有技能,更新它们的计时器
|
||||
// for (let i = this.aoe_queues.length - 1; i >= 0; i--) {
|
||||
// let skill = this.aoe_queues[i];
|
||||
// let timer = this.aoe_timers.get(skill.id) || 0;
|
||||
|
||||
timer += deltaTime;
|
||||
this.aoe_timers.set(skill.id, timer);
|
||||
// timer += deltaTime;
|
||||
// this.aoe_timers.set(skill.id, timer);
|
||||
|
||||
// 检查是否到达执行间隔
|
||||
if (timer >= this.AOE_INTERVAL) {
|
||||
// 重置计时器
|
||||
this.aoe_timers.set(skill.id, 0);
|
||||
// // 检查是否到达执行间隔
|
||||
// if (timer >= this.AOE_INTERVAL) {
|
||||
// // 重置计时器
|
||||
// this.aoe_timers.set(skill.id, 0);
|
||||
|
||||
// 执行技能
|
||||
this.aoe_skill_execute(skill);
|
||||
skill.count--;
|
||||
// // 执行技能
|
||||
// this.aoe_skill_execute(skill);
|
||||
// skill.count--;
|
||||
|
||||
// 如果技能执行完毕,从队列中移除
|
||||
if (skill.count <= 0) {
|
||||
this.aoe_queues.splice(i, 1);
|
||||
this.aoe_timers.delete(skill.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 如果技能执行完毕,从队列中移除
|
||||
// if (skill.count <= 0) {
|
||||
// this.aoe_queues.splice(i, 1);
|
||||
// this.aoe_timers.delete(skill.id);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user