49 lines
2.6 KiB
TypeScript
49 lines
2.6 KiB
TypeScript
import { Items } from "./Items";
|
|
|
|
export enum GType{
|
|
ITEM=1, //物品
|
|
GOLD=2, //金币
|
|
DIAMOND=3, //钻石
|
|
EXP=4, //经验
|
|
MEAT=5, //能量
|
|
}
|
|
export enum CType{
|
|
GOLD=1, //金币
|
|
DIAMOND=2, //钻石
|
|
FREE=3, //免费
|
|
AD=4, //广告
|
|
}
|
|
export const getRandomGoods=()=>{
|
|
let goods=[1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023]
|
|
// 随机打乱数组
|
|
for (let i = goods.length - 1; i > 0; i--) {
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
[goods[i], goods[j]] = [goods[j], goods[i]];
|
|
}
|
|
return goods.slice(0, 8);
|
|
}
|
|
export const Goods={
|
|
1001:{i_uuid:Items[9001].uuid,num:10000,cast:0,type:GType.GOLD,c_type:CType.FREE},
|
|
1002:{i_uuid:Items[9002].uuid,num:100000,cast:0,type:GType.GOLD,c_type:CType.AD,},
|
|
1003:{i_uuid:Items[9003].uuid,num:500000,cast:100,type:GType.GOLD,c_type:CType.DIAMOND},
|
|
1004:{i_uuid:Items[9004].uuid,num:100,cast:0,type:GType.DIAMOND,c_type:CType.FREE},
|
|
1005:{i_uuid:Items[9005].uuid,num:200,cast:0,type:GType.DIAMOND,c_type:CType.FREE},
|
|
1006:{i_uuid:Items[9006].uuid,num:300,cast:0,type:GType.DIAMOND,c_type:CType.AD},
|
|
1007:{i_uuid:Items[9007].uuid,num:500,cast:0,type:GType.DIAMOND,c_type:CType.AD},
|
|
1008:{i_uuid:Items[1001].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1009:{i_uuid:Items[1002].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1010:{i_uuid:Items[1003].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1011:{i_uuid:Items[1004].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1012:{i_uuid:Items[1005].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1013:{i_uuid:Items[1006].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1014:{i_uuid:Items[1007].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1015:{i_uuid:Items[1008].uuid,num:1,cast:1,type:GType.ITEM,c_type:CType.DIAMOND},
|
|
1016:{i_uuid:Items[1001].uuid,num:1,cast:10000,type:GType.ITEM,c_type:CType.GOLD},
|
|
1017:{i_uuid:Items[1002].uuid,num:1,cast:100000,type:GType.ITEM,c_type:CType.GOLD},
|
|
1018:{i_uuid:Items[1003].uuid,num:1,cast:500000,type:GType.ITEM,c_type:CType.GOLD},
|
|
1019:{i_uuid:Items[1004].uuid,num:1,cast:100,type:GType.ITEM,c_type:CType.GOLD},
|
|
1020:{i_uuid:Items[1005].uuid,num:1,cast:200,type:GType.ITEM,c_type:CType.GOLD},
|
|
1021:{i_uuid:Items[1006].uuid,num:1,cast:300,type:GType.ITEM,c_type:CType.GOLD},
|
|
1022:{i_uuid:Items[1007].uuid,num:1,cast:500,type:GType.ITEM,c_type:CType.GOLD},
|
|
1023:{i_uuid:Items[1008].uuid,num:1,cast:1000,type:GType.ITEM,c_type:CType.GOLD},
|
|
} |