将魂商店:修改产出

This commit is contained in:
luying
2021-10-15 11:02:07 +08:00
parent 7425691a03
commit cb78e2256f
2 changed files with 8 additions and 11 deletions
@@ -1,6 +1,6 @@
import { Application, BackendSession } from "pinus";
import { gameData } from "../../../pubUtils/data";
import { resResult } from "../../../pubUtils/util";
import { parseGoodStr, resResult } from "../../../pubUtils/util";
import { STATUS, GUILD_STRUCTURE, ITID, CONSUME_TYPE, HERO_QUALITY_TYPE, HERO_GROW_MAX } from "../../../consts";
import { DicShopListModel } from "../../../db/DicShopList";
import { UserShopModel } from "../../../db/UserShop";
@@ -10,6 +10,7 @@ import { SHOP } from "../../../pubUtils/dicParam";
import { getHonourObject } from "../../../pubUtils/itemUtils";
import { HeroModel } from "../../../db/Hero";
import { getShopListById } from "../../../services/shopService";
import { RewardInter } from "../../../pubUtils/interface";
export default function(app: Application) {
return new ShopHandler(app);
@@ -122,18 +123,17 @@ export class ShopHandler {
let costResult = await handleCost(roleId, sid, cost);
if(!costResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
let honour = 0;
let reward: RewardInter[] = [];
switch (dicGoods.quality) {
case HERO_QUALITY_TYPE.BLUE:
honour = SHOP.HERO_SOUL_BULE * count; break;
reward = parseGoodStr(SHOP.HERO_SOUL_BULE); break;
case HERO_QUALITY_TYPE.PURPLE:
honour = SHOP.HERO_SOUL_PURPLE * count; break;
reward = parseGoodStr(SHOP.HERO_SOUL_PURPLE); break;
case HERO_QUALITY_TYPE.GOLD:
honour = SHOP.HERO_SOUL_GOLDEN * count; break;
reward = parseGoodStr(SHOP.HERO_SOUL_GOLDEN); break;
}
// 增加功勋
let reward = getHonourObject(honour);
let goods = await addItems(roleId, roleName, sid, [reward]);
// 增加货币
let goods = await addItems(roleId, roleName, sid, reward.map(cur => { return {id: cur.id, count: cur.count * count} }));
return resResult(STATUS.SUCCESS, {
goodsId, count,