创建初始装备
This commit is contained in:
@@ -14,10 +14,16 @@ export class EquipHandler {
|
||||
|
||||
// TODO 合成装备
|
||||
public async composeEquip(msg: { gid: number, originalEquip: number[]}, session: BackendSession) {
|
||||
let roleId: string = session.get('roleId');
|
||||
let roleName: string = session.get('roleName');
|
||||
let sid: string = session.get('sid');
|
||||
// 消耗材料
|
||||
// 获得装备
|
||||
let {gid, } = msg;
|
||||
|
||||
// 1. 获得部位
|
||||
let items = [{id: gid, count: 1}];
|
||||
let goods = await addItems(roleId, roleName, sid, items);
|
||||
return resResult(STATUS.SUCCESS, { goods });
|
||||
}
|
||||
|
||||
// TODO 装备栏强化
|
||||
|
||||
@@ -16,17 +16,17 @@ export class RoleHandler {
|
||||
}
|
||||
|
||||
async initEquips(roleId: string, roleName: string) {
|
||||
const seqId = await CounterModel.getNewCounter(COUNTER.EID);
|
||||
const equipInfo = {
|
||||
roleId,
|
||||
roleName,
|
||||
id: 1,
|
||||
name: '倚天剑',
|
||||
seqId,
|
||||
type: 1
|
||||
}
|
||||
const equip = await EquipModel.createEquip(equipInfo);
|
||||
await HeroModel.addEquip(roleId, 12, equip._id);
|
||||
// const seqId = await CounterModel.getNewCounter(COUNTER.EID);
|
||||
// const equipInfo = {
|
||||
// roleId,
|
||||
// roleName,
|
||||
// id: 1,
|
||||
// name: '倚天剑',
|
||||
// seqId,
|
||||
// type: 1
|
||||
// }
|
||||
// const equip = await EquipModel.createEquip(equipInfo);
|
||||
// await HeroModel.addEquip(roleId, 12, equip._id);
|
||||
}
|
||||
|
||||
async initHeros(roleId: string, roleName: string) {
|
||||
|
||||
Reference in New Issue
Block a user