扫荡奖励添加哪一次掉落的

This commit is contained in:
luying
2020-10-19 17:52:34 +08:00
parent 0da6b7c169
commit 47a5843bdb
2 changed files with 4 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ export async function handleFixedReward(roleId: string, roleName: string, reward
return result; return result;
} }
export async function handleReward(roleId: string, roleName: string, rewards: Array<{type: number, gid: number, count: number}>) { export async function handleReward(roleId: string, roleName: string, rewards: Array<{type: number, gid: number, count: number, times: number}>) {
let returnGoods = new Array(); let returnGoods = new Array();
for(let goods of rewards) { for(let goods of rewards) {
@@ -21,7 +21,7 @@ export async function handleReward(roleId: string, roleName: string, rewards: Ar
if(goodInfo.goodType == GOOD_TYPE.EQUIP) { // 装备 if(goodInfo.goodType == GOOD_TYPE.EQUIP) { // 装备
let result = await rewardWeapons(roleId, roleName, goodInfo, {id: goods.gid, cnt: goods.count }); let result = await rewardWeapons(roleId, roleName, goodInfo, {id: goods.gid, cnt: goods.count });
for(let obj of result) { for(let obj of result) {
returnGoods.push({dropType: goods.type, ...obj}) returnGoods.push({dropType: goods.type, times: goods.times, ...obj})
} }
} }
} }

View File

@@ -16,7 +16,7 @@ export class WarReward {
condition: Map<number, boolean>; condition: Map<number, boolean>;
warInfo: any; warInfo: any;
isSuccess: boolean; isSuccess: boolean;
rewards: Array<{type: number, gid: number, count: number}>; rewards: Array<{type: number, gid: number, count: number, times: number}>;
constructor(roleId: string, roleName: string, battleId: number, isSuccess: boolean) { constructor(roleId: string, roleName: string, battleId: number, isSuccess: boolean) {
this.roleId = roleId; this.roleId = roleId;
@@ -97,6 +97,7 @@ export class WarReward {
this.handleConditionReward(num); this.handleConditionReward(num);
await this.handleRandomReward(num); await this.handleRandomReward(num);
console.log(this.rewards)
let returnGoods = await handleReward(this.roleId, this.roleName, this.rewards); let returnGoods = await handleReward(this.roleId, this.roleName, this.rewards);
return returnGoods; return returnGoods;
} }