feat(战斗系统): 实现怪物金币掉落计算和抽卡升级消耗

- 添加calculateMonsterGold函数计算不同怪物类型的金币掉落
- 修改SingletonModuleComp初始化金币为0并添加抽卡和升级消耗
- 在MissionCardComp中添加抽卡和升级的金币检查逻辑
- 清理FightSet中无用配置并添加金币相关常量
- 在MissionComp中实现金币奖励计算和局内数据初始化
This commit is contained in:
walkpan
2026-01-15 23:32:57 +08:00
parent d6ce56e543
commit 90e6bd755a
6 changed files with 3884 additions and 3702 deletions

View File

@@ -347,6 +347,29 @@ export function getLevelExp(level: number): number {
return Math.floor(baseExp * Math.pow(growthFactor, level - 1));
}
/**
* 计算怪物掉落金币
* @param uuid 怪物ID
* @param level 怪物等级
* @param type 怪物类型
*/
export function calculateMonsterGold(uuid: number, level: number, type: MonType): number {
const cost = MonsterCost[uuid] || 1;
// 危险值系数: cost越大越危险
let danger_ratio = 1 + cost * 0.1;
let type_ratio = 1;
if(type == MonType.BOSS) type_ratio = 10;
else if(type == MonType.ELITE) type_ratio = 3;
// 公式: 基础(5) * 类型 * 危险值 + 等级加成
const baseGold = 5;
let gold = Math.floor(baseGold * type_ratio * danger_ratio + level);
return gold;
}
// 怪物消耗点数配置
export const MonsterCost: Record<number, number> = {
5201: 1, // 兽人战士 (Warrior)