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

@@ -10,6 +10,7 @@ import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { Attrs, GameScoreStats } from "./config/HeroAttrs";
import { count, time } from "console";
import { getLevelExp } from "../map/RogueConfig";
import { FightSet } from "./config/GameSet";
/**
* 用远程数据覆盖本地数据(统一方法)
* @param remoteData 远程数据(云端或本地调试)
@@ -134,7 +135,9 @@ export class SingletonModuleComp extends ecs.Comp {
skill: {uuid:0,count:0},
friend:{uuid:0,count:0},
},
gold: 200, // 金币数据MVVM绑定字段
gold: 0, // 金币数据MVVM绑定字段
chou_gold: FightSet.CHOU_GOLD,
lvup_gold: FightSet.LVUP_GOLD_UP,
};
@@ -294,9 +297,9 @@ export class SingletonModuleComp extends ecs.Comp {
}
return true
}
updateGold(gold:number){
updateGold(gold:number, is_sync: boolean = true){
this.vmdata.gold += gold;
if(this.isWxClient()){
if(this.isWxClient() && is_sync){
let res = this.updateCloudData()
if (res){
oops.message.dispatchEvent(GameEvent.GOLD_UPDATE)