Files
ZYZ/shared/consts/constModules/itemConst.ts
2020-12-18 17:13:49 +08:00

166 lines
6.5 KiB
TypeScript

export const IT_TYPE = {
BLUEPRT: 28,
JEWEL: 40
}
// 背包页签
export const GOOD_TYPE = {
ITEM: 1,
EQUIP: 2,
PIECE: 3,
BLUEPRT: 4,
JEWEL: 5,
PICTURE: 6
};
// 存到消耗品表内显示的类型
export const CONSUME_TYPE = {
CONSUME: 1, // 消耗品
SOUL: 2, // 将魂
BLUEPRT: 3, // 藏宝图
POINT: 4, // 远征币等
EXP: 5, // 经验书
FAVOUR: 6, // 好感度道具
SKIN: 7, // 时装
PIECE: 8, // 装备碎片
JEWEL: 9,//宝石
};
export enum EQUIP_TYPE {
START = 1,
WEAPON = 1, // 神兵(武器)
CLOTHES = 2, // 宝甲(上装)
SHOES = 3, // 行具(下装)
CAP = 4, // 冠冕(头部)
BOOK = 5, // 典籍(饰品)
ACCESSORY = 6, // 礼器(饰品)
END = 6
}
export const ITEM_TABLE = {
EQUIP: 'equip',
ITEM: 'item',
ROLE: 'role',
HERO: 'hero'
}
const itid_array = [
{ id: 1, name: '短兵(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 2, name: '枪矛(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 3, name: '重兵(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 4, name: '弓弩(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 5, name: '奇门(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 6, name: '羽扇(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 7, name: '法器(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 8, name: '杖(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 9, name: '头盔(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP },
{ id: 10, name: '头巾(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP },
{ id: 11, name: '重铠(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES },
{ id: 12, name: '皮甲(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES },
{ id: 13, name: '布衣(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES },
{ id: 14, name: '兵书(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK },
{ id: 15, name: '杂记(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK },
{ id: 16, name: '经典(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK },
{ id: 17, name: '马(行具)', table: 'equip', type: EQUIP_TYPE.SHOES },
{ id: 18, name: '鞋(行具)', table: 'equip', type: EQUIP_TYPE.SHOES },
{ id: 19, name: '车(行具)', table: 'equip', type: EQUIP_TYPE.SHOES },
{ id: 20, name: '佩饰(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY },
{ id: 21, name: '钟鼎(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY },
{ id: 22, name: '印章(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY },
{ id: 23, name: '消耗品', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 37, name: '消耗类物品(图纸类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 35, name: '消耗类物品(经验书)', table: 'item', type: CONSUME_TYPE.EXP },
{ id: 36, name: '消耗类物品(好感道具)', table: 'item', type: CONSUME_TYPE.FAVOUR },
{ id: 38, name: '消耗类物品(材料类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 24, name: '使用类物品(宝箱类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 25, name: '武将碎片', table: 'item', type: CONSUME_TYPE.SOUL },
{ id: 26, name: '剧情物品', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 27, name: '货币', table: 'role', isCurrency: true },
{ id: 28, name: '藏宝图', table: 'item', type: CONSUME_TYPE.BLUEPRT },
{ id: 29, name: '礼器', table: 'equip', type: EQUIP_TYPE.ACCESSORY },
{ id: 30, name: '宝甲', table: 'equip', type: EQUIP_TYPE.CLOTHES },
{ id: 31, name: '名驹', table: 'equip', type: EQUIP_TYPE.SHOES },
{ id: 32, name: '典籍', table: 'equip', type: EQUIP_TYPE.BOOK },
{ id: 33, name: '神兵', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 34, name: '代币', table: 'item', type: CONSUME_TYPE.POINT },
{ id: 39, name: '时装', table: 'hero', type: CONSUME_TYPE.SKIN },
{ id: 40, name: '装备碎片', table: 'item', type: CONSUME_TYPE.PIECE },
{ id: 41, name: '宝石', table: 'item', type: CONSUME_TYPE.JEWEL }
];
export const ITID = new Map<number, {id: number, name: string, table: string, type?: number, isCurrency?: boolean}>();
for(let obj of itid_array) {
ITID.set(obj.id, obj);
}
export const CURRENCY_TYPE = {
GOLD: "gold",
COIN: "coin",
ACTION_POINT: "ap",
TREASURE_POINT: "treasurePoint",
EXPEDITION_POINT: "expeditionPoint",
DUNGEON_POINT: "dungeonPoint",
FRIEND_POINT: "friendPoint"
}
const currencyArr = [
{ "gid": 31001, "name": "铜钱", "type": CURRENCY_TYPE.COIN },
{ "gid": 31002, "name": "元宝", "type": CURRENCY_TYPE.GOLD },
{ "gid": 31003, "name": "体力", "type": CURRENCY_TYPE.ACTION_POINT },
{ "gid": 40001, "name": "远征币", "type": CURRENCY_TYPE.EXPEDITION_POINT },
{ "gid": 40002, "name": "寻宝币", "type": CURRENCY_TYPE.TREASURE_POINT },
{ "gid": 40003, "name": "情谊点", "type": CURRENCY_TYPE.FRIEND_POINT },
{ "gid": 40004, "name": "秘境币", "type": CURRENCY_TYPE.DUNGEON_POINT },
];
export const CURRENCY = new Map<number, {gid: number, name: string, type: string}>();
export const CURRENCY_BY_TYPE = new Map<string, number>();
for(let obj of currencyArr) {
CURRENCY.set(obj.gid, obj);
CURRENCY_BY_TYPE.set(obj.type, obj.gid);
}
export enum QUALITY_TYPE {
BLUE = 1, // 蓝
PURPLE = 2, // 紫
ORANGE = 3, // 橙
RED = 4, // 红
GOLD = 5 // 金
}
export const GOOD_QUALITY = [QUALITY_TYPE.BLUE, QUALITY_TYPE.PURPLE, QUALITY_TYPE.ORANGE, QUALITY_TYPE.RED, QUALITY_TYPE.GOLD];
// 各品质随机属性条数 quality => number
export const RANDOM_SE_COUNT = new Map<number, number>([
[QUALITY_TYPE.BLUE, 0],
[QUALITY_TYPE.PURPLE, 1],
[QUALITY_TYPE.ORANGE, 2],
[QUALITY_TYPE.RED, 3],
[QUALITY_TYPE.GOLD, 4]
]);
export const FIX_ATTRIBUTES_RAN = 20; // 固定属性值+-20%随机
export function getCurNameById(gid) {
let currency = CURRENCY.get(gid);
if (!currency) {
return;
}
if (currency.type == CURRENCY_TYPE.COIN) {
return 'coin';
} else if (currency.type == CURRENCY_TYPE.GOLD) {
return 'gold';
} else if (currency.type == CURRENCY_TYPE.ACTION_POINT) {
return 'ap';
} else if (currency.type == CURRENCY_TYPE.FRIEND_POINT) {
return 'frdCnt';
} else if (currency.type == CURRENCY_TYPE.EXPEDITION_POINT) {
return 'expeditionPoint';
}
}