道具:体力回复道具上限
This commit is contained in:
@@ -13,6 +13,7 @@ import { ActionPointModel } from "../../../db/ActionPoint";
|
||||
import { GiftCodeDetailModel } from "../../../db/GiftCodeDetail";
|
||||
import { GiftCodeType, GiftCodeModel } from "../../../db/GiftCode";
|
||||
import { nowSeconds } from "../../../pubUtils/timeUtil";
|
||||
import { AP } from "../../../pubUtils/dicParam";
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -79,9 +80,13 @@ export class ItemHandler {
|
||||
}
|
||||
|
||||
let role = await RoleModel.findByRoleId(roleId, 'lv');
|
||||
let { isOver } = await getAp(roleId, ip, role.lv);
|
||||
let { ap, isOver } = await getAp(roleId, ip, role.lv);
|
||||
if (isOver) return resResult(STATUS.AP_IS_FULL);
|
||||
|
||||
if(ap + dicGoods.value * count > AP.AP_SAVE_MAX) {
|
||||
return resResult(STATUS.AP_IS_FULL);
|
||||
}
|
||||
|
||||
let consumeResult = await handleCost(roleId, sid, [{ id: id, count: count }], ITEM_CHANGE_REASON.USE_MEAT);
|
||||
if (!consumeResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user