feat: 新手礼包

This commit is contained in:
guanchao
2026-09-09 19:27:42 +08:00
parent 4e0378577d
commit 1b8cd1f557
38 changed files with 3408 additions and 2230 deletions
+18 -15
View File
@@ -5,6 +5,7 @@ import Freeze from "../../prop/Freeze";
import SceneManager from "../../SceneManager";
import { MiniGameSdk } from "../../Sdk/MiniGameSdk";
import Utils from "../Pay/Utils";
import { starterPackReward } from "../Config/StarterPack";
//@ts-ignore
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
var GameTool = {
@@ -924,7 +925,10 @@ var GameTool = {
},
//商城购买
shopBuy(productId, compensate) {
shopBuy(productId, compensate, orderContext: any = null) {
const starterOrderKey = productId === "starter_pack" && orderContext?.outTradeNo
? "StarterPackGranted_" + cc.fx.GameConfig.GM_INFO.uid + "_" + orderContext.outTradeNo : "";
if (starterOrderKey && cc.fx.StorageMessage.getStorage(starterOrderKey)) return;
let coin = 0;
let price = 0;
let getCoin = 0;
@@ -1174,24 +1178,23 @@ var GameTool = {
}
this.getShopProp(propData3, compensate);
break;
case "starter_pack":
cc.fx.GameTool.changeCoin(3000);
coin = 3000;
case "starter_pack": {
const reward = starterPackReward();
coin = reward.coin;
price = 300;
let propData4 = {
"freeze": 5,
"hammer": 5,
"magic_wand": 5,
"price": price
}
this.getShopProp(propData4, compensate);
cc.fx.GameTool.changeCoin(coin);
this.getShopProp({ freeze: reward.freeze, hammer: reward.hammer,
magic_wand: reward.magic_wand, price }, compensate);
rewardData = [
{ type: "coin", count: coin },
{ type: "freeze", count: 5 },
{ type: "hammer", count: 5 },
{ type: "magic", count: 5 }
]
{ type: "freeze", count: reward.freeze },
{ type: "hammer", count: reward.hammer },
{ type: "magic", count: reward.magic_wand },
];
cc.fx.GameConfig.GM_INFO.starterPackPurchased = true;
if (starterOrderKey) cc.fx.StorageMessage.setStorage(starterOrderKey, true);
break;
}
}