diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts index b88ba0e3..c21ffa17 100644 --- a/assets/script/game/common/config/CardSet.ts +++ b/assets/script/game/common/config/CardSet.ts @@ -36,6 +36,7 @@ export const CardsUpSet: Record = { 4: 200, 5: 250, } + export const CardInitCoins = 4 /** 卡池默认初始等级 */ export const CARD_POOL_INIT_LEVEL = CardKind.LV1 diff --git a/assets/script/game/common/config/GameConst.ts b/assets/script/game/common/config/GameConst.ts deleted file mode 100644 index 24aff75d..00000000 --- a/assets/script/game/common/config/GameConst.ts +++ /dev/null @@ -1,36 +0,0 @@ - -/** - * 游戏通用常量定义 - * 用于替换硬编码数字,统一管理魔法数字 - */ -export const GameConst = { - /** 战斗系统常量 */ - Battle: { - /** AI检测频率(秒):降低频率以优化性能 */ - AI_CHECK_INTERVAL: 0.2, - - /** 技能施放延迟(秒):用于动画表现衔接 */ - SKILL_CAST_DELAY: 0.3, - - /** 默认索敌/攻击范围 */ - DEFAULT_SEARCH_RANGE: 300, - - /** 默认目标X坐标(右侧阵营) */ - DEFAULT_TARGET_X_RIGHT: 400, - - /** 默认目标X坐标(左侧阵营) */ - DEFAULT_TARGET_X_LEFT: -400, - - /** 默认目标Z坐标 */ - DEFAULT_TARGET_Z: 1, - - /** 索敌时的Y轴偏移修正 */ - SEARCH_Y_OFFSET: 30, - }, - - /** 技能相关常量 */ - Skill: { - /** 最小目标数量 */ - MIN_TARGET_COUNT: 1, - } -}; diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index aab648be..d784a22f 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -15,12 +15,51 @@ export enum BoxSet { //攻击距离 } - - export enum FacSet { HERO=0, MON=1, } +export enum FightSet { + CRIT_DAMAGE=50,//暴击伤害 + MORE_RC=10,//更多次数 广告获取的次数 + HEARTPOS=-320,//基地位置 + HERO_MAX_NUM=3,//英雄最大数量 + LVUP_GOLD=50,//升级需要的金币 + LVUP_GOLD_UP=50,//升级需要的金币 + CHOU_GOLD=100,//抽卡需要的金币 + BACK_RANG=30,//后退范围 + FiIGHT_TIME=60*10,//战斗时间 + BACK_CHANCE=40,//击退概率 + FROST_TIME=3,//冰冻时间 + SKILL_CAST_DELAY=0.15 +} + +export enum IndexSet { + /** 英雄基础层级 */ + HERO = 2000, + /** 一线怪物基础层级(y=120) - 层级较低,在后面 */ + MON1 = 1000, + /** 二线怪物基础层级(y=80) - 层级较高,在前面 */ + MON2 = 3000, + /** 每个怪物的层级增量,确保后生成的在前面 */ + MON_INCREMENT = 1, + SLILL=4000, + BOSS=2100, +} +export const TooltipTypes = { + life:1, + health:2, + skill:3, + crit:4, + uskill:5, + lvup:6, + apup:7, + hpup:8, + addmp:9, + shield:10, +} + + /** 数字格式化工具函数 */ export class NumberFormatter { @@ -69,43 +108,3 @@ export class NumberFormatter { } } } -export enum FightSet { - CRIT_DAMAGE=50,//暴击伤害 - MORE_RC=10,//更多次数 广告获取的次数 - HEARTPOS=-320,//基地位置 - HERO_MAX_NUM=3,//英雄最大数量 - LVUP_GOLD=50,//升级需要的金币 - LVUP_GOLD_UP=50,//升级需要的金币 - CHOU_GOLD=100,//抽卡需要的金币 - BACK_RANG=30,//后退范围 - FiIGHT_TIME=60*10,//战斗时间 - BACK_CHANCE=40,//击退概率 - FROST_TIME=3,//冰冻时间 - -} - - -export enum IndexSet { - /** 英雄基础层级 */ - HERO = 2000, - /** 一线怪物基础层级(y=120) - 层级较低,在后面 */ - MON1 = 1000, - /** 二线怪物基础层级(y=80) - 层级较高,在前面 */ - MON2 = 3000, - /** 每个怪物的层级增量,确保后生成的在前面 */ - MON_INCREMENT = 1, - SLILL=4000, - BOSS=2100, -} -export const TooltipTypes = { - life:1, - health:2, - skill:3, - crit:4, - uskill:5, - lvup:6, - apup:7, - hpup:8, - addmp:9, - shield:10, -} diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 5371f89b..002c3cef 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -5,9 +5,9 @@ import { HeroViewComp } from "./HeroViewComp"; import { DTType, SkillConfig, SkillKind, SkillSet, SkillUpList, TGroup } from "../common/config/SkillSet"; import { Skill } from "../skill/Skill"; import { smc } from "../common/SingletonModuleComp"; -import { GameConst } from "../common/config/GameConst"; import { HType } from "../common/config/heroSet"; import { Attrs } from "../common/config/HeroAttrs"; +import { FightSet } from "../common/config/GameSet"; /** * ==================== 自动施法系统 ==================== @@ -123,7 +123,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate // 优先使用技能配置的前摇时间,否则使用全局默认值 // 注意:这里仍然是基于时间的延迟,受帧率波动影响。 // 若需精确同步,建议在动画中添加帧事件并在 HeroViewComp 中监听。 - const delay = config.ready > 0 ? config.ready : GameConst.Battle.SKILL_CAST_DELAY; + const delay = config.ready > 0 ? config.ready : FightSet.SKILL_CAST_DELAY; heroView.scheduleOnce(() => { if (!smc.mission.play || smc.mission.pause || !smc.mission.in_fight) return;