This commit is contained in:
2025-08-19 08:42:19 +08:00
parent f5a13de4b5
commit 6365464a1b
14 changed files with 4811 additions and 5540 deletions

View File

@@ -80,14 +80,6 @@ export class SingletonModuleComp extends ecs.Comp {
diamond:0, //商店购买 及 双倍奖励资源
meat:0,
exp:0, //升级经验
ghstone:0, //英雄石 绿色 普通英雄升星
bhstone:0, //英雄石 蓝色 稀有英雄升星
phlestone:0, //英雄石 紫色 史诗英雄升星
rhstone:0, //英雄石 红色 传说英雄升星
herocard:0, //英雄卡,抽卡凭证
ckey:0, //铜钥匙 解锁稀有英雄 也可以直接兑换金币
skey:0, //银钥匙 解锁史诗英雄 也可以直接兑换金币
gkey:0, //金钥匙 解锁传说英雄 也可以直接兑换金币
}
};
vmAdd() {
@@ -123,7 +115,7 @@ export class SingletonModuleComp extends ecs.Comp {
setFightHero(position:number,heroId:number,autoSave:boolean=true){
this.fight_heros[position] = heroId;
if(autoSave){
if(this.isWxClient()){
this.updateFightHeros()
}
}
@@ -142,11 +134,18 @@ export class SingletonModuleComp extends ecs.Comp {
return heros_uuid
}
levelUpHero(heroId:number,exp:number,gold:number){
let result=this.gameDataSyncManager.levelUpHero(heroId,exp,gold);
if(result){
this.heros[heroId].lv++;
if(this.isWxClient()){
let result=this.gameDataSyncManager.levelUpHero(heroId,exp,gold);
if(result){
this.heros[heroId].lv++;
return true
}
return false
}
else{
this.heros[heroId].lv++;
return true
}
return result;
}

View File

@@ -13,12 +13,12 @@ export class Test{
user_id: "local_debug",
openid: "local_debug",
regist_time: Date.now(),
data: JSON.parse(oops.storage.get("data")),
fight_heros: JSON.parse(oops.storage.get("fight_heros")),
heros: JSON.parse(oops.storage.get("heros")),
items: JSON.parse(oops.storage.get("items")),
tals: JSON.parse(oops.storage.get("tals")),
equips: JSON.parse(oops.storage.get("equips"))
data: JSON.parse(oops.storage.get("data")||null),
fight_heros: JSON.parse(oops.storage.get("fight_heros")||null),
heros: JSON.parse(oops.storage.get("heros")||null),
items: JSON.parse(oops.storage.get("items")||null),
tals: JSON.parse(oops.storage.get("tals")||null),
equips: JSON.parse(oops.storage.get("equips")||null)
}
return local_data
}

View File

@@ -443,3 +443,4 @@ export class GameDataManager {