扫荡奖励添加哪一次掉落的
This commit is contained in:
@@ -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})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user