refactor: 优化战斗流程与英雄死亡处理逻辑
1. 移除HeroAttrsComp中多余的空行 2. 修改英雄死亡处理:直接销毁实体而非移至墓地 3. 调整波次更迭逻辑:直接进入BattleStart而非PrepareStart 4. 简化fight_ready方法:移除死亡英雄复活入场逻辑 5. 调整抽卡面板与卡牌池逻辑:战斗阶段保留抽卡面板且仅刷英雄卡 6. 将enterPreparePhase改为public方法
This commit is contained in:
@@ -121,24 +121,14 @@ export class MissionHeroCompComp extends CCComp {
|
||||
}
|
||||
}
|
||||
|
||||
/** 战斗准备阶段:重置出战英雄计数,恢复满血重新登场 */
|
||||
/** 战斗准备阶段:重置出战英雄计数,恢复满血 */
|
||||
fight_ready(){
|
||||
const heroes = this.getAllHeroes();
|
||||
smc.vmdata.mission_data.hero_num = heroes.length;
|
||||
for (let i = 0; i < heroes.length; i++) {
|
||||
const hero = heroes[i];
|
||||
const model = hero.get(HeroAttrsComp);
|
||||
const view = hero.get(HeroViewComp);
|
||||
if (model && view) {
|
||||
if (model.is_dead) {
|
||||
view.alive();
|
||||
const landingPos = this.pickPositionForHero([hero.eid]);
|
||||
// 不再直接设置位置,而是播放下落入场动画
|
||||
// 计算出出生点(空中)
|
||||
const spawnPos: Vec3 = v3(landingPos.x, landingPos.y + MissionHeroCompComp.HERO_DROP_HEIGHT, 0);
|
||||
view.node.setPosition(spawnPos);
|
||||
hero.playDropAnim(spawnPos, landingPos.y);
|
||||
}
|
||||
if (model) {
|
||||
model.dirty_hp = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user