fix: 修复合成规则默认值和进度条组件类型错误
- 将 MissionCardComp 中的合成规则默认值改为从 FightSet 配置读取,避免硬编码 - 修复 VictoryComp 中进度条组件类型错误,将 Sprite 改为 ProgressBar 并更新属性设置
This commit is contained in:
@@ -45,7 +45,7 @@ import { HInfoComp } from "./HInfoComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroInfo, HType } from "../common/config/heroSet";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { FacSet } from "../common/config/GameSet";
|
||||
import { FacSet, FightSet } from "../common/config/GameSet";
|
||||
import { MoveComp } from "../hero/MoveComp";
|
||||
import { MissionHeroCompComp } from "./MissionHeroComp";
|
||||
|
||||
@@ -454,13 +454,13 @@ export class MissionCardComp extends CCComp {
|
||||
* @returns { needCount: 合成所需数量, maxLv: 最大合成等级 }
|
||||
*/
|
||||
private getMergeRule(): { needCount: number, maxLv: number } {
|
||||
let needCount = 3;
|
||||
let maxLv = 2; // 兜底值改为2,与 MissionHeroComp 保持一致
|
||||
let needCount = FightSet.MERGE_NEED === 2 ? 2 : 3;
|
||||
let maxLv = Math.max(1, Math.floor(FightSet.MERGE_MAX ?? 3));
|
||||
ecs.query(ecs.allOf(MissionHeroCompComp)).forEach((entity: ecs.Entity) => {
|
||||
const comp = entity.get(MissionHeroCompComp);
|
||||
if (!comp) return;
|
||||
needCount = comp.merge_need_count === 2 ? 2 : 3;
|
||||
maxLv = Math.max(1, Math.floor(comp.merge_max_lv ?? 2));
|
||||
maxLv = Math.max(1, Math.floor(comp.merge_max_lv ?? 3));
|
||||
});
|
||||
return { needCount, maxLv };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user