更新AB商城最终版
This commit is contained in:
@@ -412,6 +412,19 @@ export class GameConfig {
|
||||
&& ["B", "2"].includes(String(assignment.group).toUpperCase());
|
||||
}
|
||||
|
||||
static isShopB(): boolean {
|
||||
const assignments = this.GM_INFO.abTestAssignments || {};
|
||||
const assignment = assignments.layer_3 || Object.keys(assignments)
|
||||
.map(key => assignments[key]).find(item => item && Number(item.layer) === 3);
|
||||
if (assignment) return assignment.enabled !== false
|
||||
&& ["B", "2"].includes(String(assignment.group).toUpperCase());
|
||||
return !!this.GM_INFO.abTests && this.GM_INFO.abTests.layer_three === 2;
|
||||
}
|
||||
|
||||
static getShopPrefabPath(): string {
|
||||
return this.isShopB() ? "prefab/shop2" : "prefab/shop";
|
||||
}
|
||||
|
||||
static getLevelConfigPath(level: number, mainline: boolean = true): string {
|
||||
const folder = mainline && this.isNewPlayerB() && level >= 1 && level <= 50 ? "Json2" : "Json";
|
||||
return `${folder}/level${level}`;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
export interface ShopProduct {
|
||||
id: string;
|
||||
price: number; // 分
|
||||
coin: number;
|
||||
firstPurchaseKey?: string;
|
||||
hammer?: number;
|
||||
freeze?: number;
|
||||
magic?: number;
|
||||
infiniteHealth?: number; // 秒;8 元礼包没有无限体力
|
||||
}
|
||||
|
||||
export const SHOP_A_GOLD: ShopProduct[] = [
|
||||
{ id: "gold_1", price: 600, coin: 1200, firstPurchaseKey: "gold_1" },
|
||||
{ id: "gold_2", price: 3600, coin: 8000, firstPurchaseKey: "gold_2" },
|
||||
{ id: "gold_3", price: 6800, coin: 16000, firstPurchaseKey: "gold_3" },
|
||||
{ id: "gold_4", price: 12800, coin: 32000, firstPurchaseKey: "gold_4" },
|
||||
{ id: "gold_5", price: 32800, coin: 100000, firstPurchaseKey: "gold_5" },
|
||||
{ id: "gold_6", price: 64800, coin: 240000, firstPurchaseKey: "gold_6" },
|
||||
];
|
||||
|
||||
export const SHOP_B_GOLD: ShopProduct[] = [
|
||||
{ id: "new_gold_1", price: 600, coin: 1200, firstPurchaseKey: "gold_1" },
|
||||
{ id: "new_gold_2", price: 3000, coin: 6800, firstPurchaseKey: "gold_2" },
|
||||
{ id: "new_gold_3", price: 6800, coin: 16000, firstPurchaseKey: "gold_3" },
|
||||
{ id: "new_gold_4", price: 12800, coin: 32000, firstPurchaseKey: "gold_4" },
|
||||
{ id: "new_gold_5", price: 32800, coin: 84000, firstPurchaseKey: "gold_5" },
|
||||
{ id: "new_gold_6", price: 64800, coin: 168000, firstPurchaseKey: "gold_6" },
|
||||
];
|
||||
|
||||
export const SHOP_B_BUNDLES: ShopProduct[] = [
|
||||
{ id: "new_unlimited_health_bundle_8", price: 800, coin: 1500, hammer: 2, freeze: 2, magic: 2, infiniteHealth: 0 },
|
||||
{ id: "new_unlimited_health_bundle_18", price: 1800, coin: 3000, hammer: 5, freeze: 5, magic: 5, infiniteHealth: 1800 },
|
||||
{ id: "new_unlimited_health_bundle_36", price: 3600, coin: 6000, hammer: 10, freeze: 10, magic: 10, infiniteHealth: 7200 },
|
||||
{ id: "new_unlimited_health_bundle_68", price: 6800, coin: 10000, hammer: 20, freeze: 20, magic: 20, infiniteHealth: 21600 },
|
||||
{ id: "new_unlimited_health_bundle_98", price: 9800, coin: 20000, hammer: 25, freeze: 25, magic: 25, infiniteHealth: 43200 },
|
||||
];
|
||||
|
||||
// 按订单商品 ID 查奖励,补单不能使用玩家当前的 AB 分组决定数值。
|
||||
export function getNewShopProduct(id: string): ShopProduct {
|
||||
return SHOP_B_GOLD.concat(SHOP_B_BUNDLES).find(product => product.id === id);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"ver": "1.1.0",
|
||||
"uuid": "3cf4c676-9dc9-48c9-852c-2bd77c5c2039",
|
||||
"importer": "typescript",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
Reference in New Issue
Block a user