fix: 将英雄最大数量从5调整为3并统一相关逻辑
将游戏配置中的英雄最大数量(HERO_MAX_NUM)从5改为3,以调整游戏平衡性。 更新了SingletonModuleComp和MissionCardComp中相关的英雄数量上限逻辑,确保所有相关代码都使用统一的配置值而非硬编码的数字。 同时添加了两个CSV配置文件(heros.csv和skills.csv)的元数据文件。
This commit is contained in:
@@ -10,6 +10,7 @@ import { GameScoreStats } from "./config/HeroAttrs";
|
||||
import { mLogger } from "./Logger";
|
||||
import { TalentType } from "./config/TalentSet";
|
||||
import { gameDataSync } from "./GameDataSync";
|
||||
import { FightSet } from "./config/GameSet";
|
||||
|
||||
/**
|
||||
* 用远程数据覆盖本地数据(统一方法)
|
||||
@@ -79,8 +80,8 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
mission_data:{
|
||||
mon_num:0,//怪物数量
|
||||
hero_num:0,//英雄数量
|
||||
hero_max_num:5,//英雄可召唤上限
|
||||
hero_extend_max_num:6,//英雄可拓展上限
|
||||
hero_max_num:FightSet.HERO_MAX_NUM,//英雄可召唤上限
|
||||
hero_extend_max_num:FightSet.HERO_MAX_NUM + 1,//英雄可拓展上限
|
||||
wave_time_num:0,//波次时间
|
||||
in_fight:false,
|
||||
fight_time:0,//战斗时间
|
||||
|
||||
@@ -23,7 +23,7 @@ export enum FightSet {
|
||||
CRIT_DAMAGE=50,//暴击伤害
|
||||
MORE_RC=10,//更多次数 广告获取的次数
|
||||
HEARTPOS=-320,//基地位置
|
||||
HERO_MAX_NUM=5,//英雄最大数量
|
||||
HERO_MAX_NUM=3,//英雄最大数量
|
||||
MERGE_MAX=3, //英雄最大等级
|
||||
MERGE_NEED=2, //英雄升级需要的英雄数
|
||||
// BACK_RANG=30,//后退范围
|
||||
|
||||
11
assets/script/game/common/config/heros.csv.meta
Normal file
11
assets/script/game/common/config/heros.csv.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"importer": "text",
|
||||
"imported": true,
|
||||
"uuid": "54a8544b-ba40-49cd-86f8-61616975fd61",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
11
assets/script/game/common/config/skills.csv.meta
Normal file
11
assets/script/game/common/config/skills.csv.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"importer": "text",
|
||||
"imported": true,
|
||||
"uuid": "f1181369-d7bf-401c-8ec5-c5cbc520ff20",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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