fix: 将英雄最大数量从5调整为3并统一相关逻辑
将游戏配置中的英雄最大数量(HERO_MAX_NUM)从5改为3,以调整游戏平衡性。 更新了SingletonModuleComp和MissionCardComp中相关的英雄数量上限逻辑,确保所有相关代码都使用统一的配置值而非硬编码的数字。 同时添加了两个CSV配置文件(heros.csv和skills.csv)的元数据文件。
This commit is contained in:
@@ -202,8 +202,8 @@ export class MissionCardComp extends CCComp {
|
||||
if (missionData) {
|
||||
missionData.coin = Math.max(0, Math.floor(missionData.coin ?? 0));
|
||||
missionData.hero_num = 0;
|
||||
missionData.hero_max_num = 5;
|
||||
missionData.hero_extend_max_num = 6;
|
||||
missionData.hero_max_num = FightSet.HERO_MAX_NUM;
|
||||
missionData.hero_extend_max_num = FightSet.HERO_MAX_NUM + 1;
|
||||
}
|
||||
this.clearHeroInfoPanels();
|
||||
this.layoutCardSlots();
|
||||
@@ -976,8 +976,8 @@ export class MissionCardComp extends CCComp {
|
||||
public setHeroMaxCount(max: number) {
|
||||
const missionData = this.getMissionData();
|
||||
if (!missionData) return;
|
||||
const min = 5;
|
||||
const limit = Math.max(min, missionData.hero_extend_max_num ?? 6);
|
||||
const min = FightSet.HERO_MAX_NUM;
|
||||
const limit = Math.max(min, missionData.hero_extend_max_num ?? (FightSet.HERO_MAX_NUM + 1));
|
||||
const next = Math.max(min, Math.min(limit, Math.floor(max || min)));
|
||||
if (next === missionData.hero_max_num) return;
|
||||
missionData.hero_max_num = next;
|
||||
@@ -1134,7 +1134,7 @@ export class MissionCardComp extends CCComp {
|
||||
|
||||
private getMissionHeroMaxNum(): number {
|
||||
const missionData = this.getMissionData();
|
||||
return Math.max(5, Math.floor(missionData?.hero_max_num ?? 5));
|
||||
return Math.max(FightSet.HERO_MAX_NUM, Math.floor(missionData?.hero_max_num ?? FightSet.HERO_MAX_NUM));
|
||||
}
|
||||
|
||||
private syncMissionHeroData(count?: number) {
|
||||
|
||||
Reference in New Issue
Block a user