创建公会

This commit is contained in:
luying
2021-01-18 21:05:25 +08:00
parent 97216647b2
commit 3c35852495
17 changed files with 281 additions and 37 deletions
@@ -1,9 +1,10 @@
import { Application, BackendSession } from 'pinus';
import { GOLD_COST_RATIO, DUNGEON_CONST, CURRENCY_TYPE, CURRENCY_BY_TYPE } from '../../../consts';
import { GOLD_COST_RATIO, DUNGEON_CONST } from '../../../consts';
import { STATUS } from '../../../consts/statusCode';
import { resResult, calculateNum, shouldRefresh } from '../../../pubUtils/util';
import { RoleModel } from '../../../db/Role';
import { handleCost } from '../../../services/rewardService';
import { getGoldObject } from '../../../pubUtils/itemUtils';
export default function(app: Application) {
return new DungeonBattleHandler(app);
@@ -62,7 +63,7 @@ export class DungeonBattleHandler {
if(buyCost > gold) {
return resResult(STATUS.DAILY_REFRESH_GOLD_LACK);
}
await handleCost(roleId, sid, [{id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.GOLD), count: buyCost}]);
await handleCost(roleId, sid, [getGoldObject(buyCost)]);
await RoleModel.buyCnt(roleId, needRefresh, count, curTime);
let nextCostGold = calculateNum(GOLD_COST_RATIO.DUNGRON_BUY_NUM, {num: dungeonBuyCnt + count + 1 }, 50);