后台添加装备时可以选择武将穿上
This commit is contained in:
@@ -34,6 +34,7 @@ export interface EquipInter {
|
||||
hole: number;
|
||||
randomEffect: Array<number>;
|
||||
itid: number;
|
||||
hid?: number;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function addBags(roleId: string, roleName: string, data: BagInter)
|
||||
}
|
||||
|
||||
export async function addEquips(roleId: string, roleName: string, weapon: EquipInter) {
|
||||
let { id, name, quality, suitId, hole, randomEffect, itid } = weapon;
|
||||
let { id, name, quality, suitId, hole, randomEffect, itid, hid } = weapon;
|
||||
let {type} = ITID.get(itid);
|
||||
|
||||
let randomNum = RANDOM_SE_COUNT.get(quality);
|
||||
@@ -40,9 +40,9 @@ export async function addEquips(roleId: string, roleName: string, weapon: EquipI
|
||||
let randSe = new Array<RandSe>();
|
||||
for(let i = 0; i < randomNum; i++) {
|
||||
pool = pool.filter(cur => !chosen.includes(cur.id));
|
||||
console.log(JSON.stringify(pool))
|
||||
let random = getRandomByLen(pool);
|
||||
if(!random) break;
|
||||
chosen.push(random.id);
|
||||
let rand = 0;
|
||||
if(random.id > 0) rand = Math.floor(Math.random() * (random.Max - random.Min) + random.Min);
|
||||
randSe.push({
|
||||
@@ -58,6 +58,6 @@ export async function addEquips(roleId: string, roleName: string, weapon: EquipI
|
||||
holes.push({id: i+1, isOpen: false, jewel: 0})
|
||||
}
|
||||
|
||||
const equip = await EquipModel.createEquip({roleId, roleName, id, name, quality, suitId, randRange, ePlaceId: type, randSe, holes});
|
||||
const equip = await EquipModel.createEquip({roleId, roleName, id, name, quality, suitId, randRange, ePlaceId: type, randSe, holes, hid});
|
||||
return equip
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user