道具:体力回复道具上限
This commit is contained in:
@@ -13,6 +13,7 @@ import { ActionPointModel } from "../../../db/ActionPoint";
|
|||||||
import { GiftCodeDetailModel } from "../../../db/GiftCodeDetail";
|
import { GiftCodeDetailModel } from "../../../db/GiftCodeDetail";
|
||||||
import { GiftCodeType, GiftCodeModel } from "../../../db/GiftCode";
|
import { GiftCodeType, GiftCodeModel } from "../../../db/GiftCode";
|
||||||
import { nowSeconds } from "../../../pubUtils/timeUtil";
|
import { nowSeconds } from "../../../pubUtils/timeUtil";
|
||||||
|
import { AP } from "../../../pubUtils/dicParam";
|
||||||
|
|
||||||
export default function (app: Application) {
|
export default function (app: Application) {
|
||||||
new HandlerService(app, {});
|
new HandlerService(app, {});
|
||||||
@@ -79,9 +80,13 @@ export class ItemHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let role = await RoleModel.findByRoleId(roleId, 'lv');
|
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 (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);
|
let consumeResult = await handleCost(roleId, sid, [{ id: id, count: count }], ITEM_CHANGE_REASON.USE_MEAT);
|
||||||
if (!consumeResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
if (!consumeResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||||
|
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ export async function recentPrivateChatInfos(roleId: string, roleName: string) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.splice(CHAT_SYSTEM.RECENT_PRIVATE_CHATS_CNT);
|
.splice(CHAT_SYSTEM.RECENT_PRIVATE_CHATS_CNT);
|
||||||
if (!recentPrivateChats || !recentPrivateChats.length) return null;
|
if (!recentPrivateChats || !recentPrivateChats.length) return [];
|
||||||
|
|
||||||
const roleInfos = await RoleModel.findByRoleIds(recentPrivateChats.map(chat => { return chat.targetRoleId }));
|
const roleInfos = await RoleModel.findByRoleIds(recentPrivateChats.map(chat => { return chat.targetRoleId }));
|
||||||
const chatInfos = recentPrivateChats.map( chat => {
|
const chatInfos = recentPrivateChats.map( chat => {
|
||||||
|
|||||||
Reference in New Issue
Block a user