将魂商店:修改产出

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 { Application, BackendSession } from "pinus";
import { gameData } from "../../../pubUtils/data"; 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 { STATUS, GUILD_STRUCTURE, ITID, CONSUME_TYPE, HERO_QUALITY_TYPE, HERO_GROW_MAX } from "../../../consts";
import { DicShopListModel } from "../../../db/DicShopList"; import { DicShopListModel } from "../../../db/DicShopList";
import { UserShopModel } from "../../../db/UserShop"; import { UserShopModel } from "../../../db/UserShop";
@@ -10,6 +10,7 @@ import { SHOP } from "../../../pubUtils/dicParam";
import { getHonourObject } from "../../../pubUtils/itemUtils"; import { getHonourObject } from "../../../pubUtils/itemUtils";
import { HeroModel } from "../../../db/Hero"; import { HeroModel } from "../../../db/Hero";
import { getShopListById } from "../../../services/shopService"; import { getShopListById } from "../../../services/shopService";
import { RewardInter } from "../../../pubUtils/interface";
export default function(app: Application) { export default function(app: Application) {
return new ShopHandler(app); return new ShopHandler(app);
@@ -122,18 +123,17 @@ export class ShopHandler {
let costResult = await handleCost(roleId, sid, cost); let costResult = await handleCost(roleId, sid, cost);
if(!costResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH); if(!costResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
let honour = 0; let reward: RewardInter[] = [];
switch (dicGoods.quality) { switch (dicGoods.quality) {
case HERO_QUALITY_TYPE.BLUE: case HERO_QUALITY_TYPE.BLUE:
honour = SHOP.HERO_SOUL_BULE * count; break; reward = parseGoodStr(SHOP.HERO_SOUL_BULE); break;
case HERO_QUALITY_TYPE.PURPLE: case HERO_QUALITY_TYPE.PURPLE:
honour = SHOP.HERO_SOUL_PURPLE * count; break; reward = parseGoodStr(SHOP.HERO_SOUL_PURPLE); break;
case HERO_QUALITY_TYPE.GOLD: 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.map(cur => { return {id: cur.id, count: cur.count * count} }));
let goods = await addItems(roleId, roleName, sid, [reward]);
return resResult(STATUS.SUCCESS, { return resResult(STATUS.SUCCESS, {
goodsId, count, goodsId, count,
@@ -12,7 +12,6 @@ import { participants } from './guildActivityService';
import { Member } from '../domain/battleField/guildActivity'; import { Member } from '../domain/battleField/guildActivity';
import * as dicParam from '../pubUtils/dicParam'; import * as dicParam from '../pubUtils/dicParam';
import { RewardInter } from '../pubUtils/interface'; import { RewardInter } from '../pubUtils/interface';
import { errlogger } from '../util/logger';
import { pushCurrentTime } from './chatService'; import { pushCurrentTime } from './chatService';
// ! 获取底价,假数据 // ! 获取底价,假数据
@@ -161,8 +160,6 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
maxPrice, curPrice: basePrice, maxPrice, curPrice: basePrice,
} }
}); });
errlogger.error(`******genAuction begin ${begin} end ${end}`);
errlogger.error(`******genAuction ${JSON.stringify(lotsData)}`);
const lots = await LotModel.createRecs(lotsData); const lots = await LotModel.createRecs(lotsData);
const dividendCode = genCode(DIVIDEND_CODE_LEN); const dividendCode = genCode(DIVIDEND_CODE_LEN);
const dividendData: DividendParam = { const dividendData: DividendParam = {