装备:清理寻宝相关
This commit is contained in:
@@ -465,7 +465,7 @@ export class ComBattleHandler {
|
||||
updateRobotHurtByTime(teamStatus, st, COM_BTL_CONST.ROBOT_BASE_TIME_INTERVAL + idx, channel, this.robotHurtTimer, this.teamMap);
|
||||
}
|
||||
});
|
||||
await checkTaskInComBattleStart(teamStatus.roleStatus, teamStatus.capId, teamStatus.lv);
|
||||
await checkTaskInComBattleStart(teamStatus.roleStatus, teamStatus.capId);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import { gameData } from '../pubUtils/data';
|
||||
import { getSeconds, getZeroPointD } from '../pubUtils/timeUtil';
|
||||
import { RoleStatus } from '../db/ComBattleTeam';
|
||||
import { getActivities } from './activity/activityService';
|
||||
import { JewelType } from '../db/Jewel';
|
||||
|
||||
export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, taskType: number, roles: RoleType[]) {
|
||||
for (let role of roles) {
|
||||
@@ -165,7 +164,7 @@ export async function checkTaskInBattleSweep(serverId: number, roleId: string, s
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkTaskInComBattleStart(roleStatus: RoleStatus[], capId: string, quality: number) {
|
||||
export async function checkTaskInComBattleStart(roleStatus: RoleStatus[], capId: string) {
|
||||
// console.log('********', JSON.stringify(roleStatus), capId, quality)
|
||||
for (let { roleId, isRobot } of roleStatus) {
|
||||
if (!isRobot) {
|
||||
@@ -180,7 +179,6 @@ export async function checkTaskInComBattleStart(roleStatus: RoleStatus[], capId:
|
||||
await checkActivityTask(serverId, null, roleId, TASK_TYPE.COM_BATTLE_ASSIST_TEAM, 1);
|
||||
}
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE, 1, true, {});
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE_QUALITY, 1, true, { quality });
|
||||
//活动任务
|
||||
await checkActivityTask(serverId, null, roleId, TASK_TYPE.COM_BATTLE, 1);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { BattleDropModel } from '../db/BattleDrop';
|
||||
import { getRandEelmWithWeight, getRandSingleEelm, getReasonByWarType } from '../pubUtils/util';
|
||||
import { BATTLE_REWARD_TYPE, BLUEPRT_CONST } from '../consts';
|
||||
import { addItems, combineItemAndJewels } from './rewardService';
|
||||
import { BattleBlueprtDropModel } from '../db/BattleBlueprtDrop'
|
||||
import { RoleModel } from '../db/Role';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { DicWar } from '../pubUtils/dictionary/DicWar';
|
||||
|
||||
@@ -639,10 +639,10 @@ export enum TASK_TYPE {
|
||||
BATTLE_EXPEDITION = 49, // 远征
|
||||
BATTLE_EXPEDITION_BOX = 50, // 领取远征宝箱
|
||||
COM_BATTLE_CREATE_TEAM = 51, // 寻宝招募队友
|
||||
COM_BATTLE_BLUEPRT = 52, // 合成藏宝图
|
||||
// COM_BATTLE_BLUEPRT = 52, // 合成藏宝图
|
||||
COM_BATTLE_ASSIST_TEAM = 53, // 队友协助寻宝
|
||||
COM_BATTLE = 54, // 寻宝
|
||||
COM_BATTLE_QUALITY = 55, // 按品质寻宝
|
||||
// COM_BATTLE_QUALITY = 55, // 按品质寻宝
|
||||
COM_BATTLE_DROP = 56, // 寻宝掉落碎片
|
||||
PVP = 57, // PVP挑战
|
||||
PVP_WIN = 58, // PVP胜利
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
|
||||
/**
|
||||
* 藏宝图掉落记录
|
||||
*/
|
||||
@index({ roleId: 1, battleId: 1 })
|
||||
|
||||
export default class BattleBlueprtDrop extends BaseModel {
|
||||
@prop({ required: true })
|
||||
roleId: string; // 角色 id
|
||||
@prop({ required: true })
|
||||
refTime: Date; // 刷新日期
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
getNum: number; // 获取次数,当curCostAp超过ap重置
|
||||
@prop({ required: true })
|
||||
curCostAp: number; // 这一轮消耗的ap,单独设置出了以防以后修改PER_AP
|
||||
@prop({ required: true, default: 0 })
|
||||
getSum: number; // 获取道具的全部次数
|
||||
@prop({ required: true })
|
||||
costAp: number; // 当天消耗的ap
|
||||
|
||||
public static async findByTime(roleId: string, refTime: Date, lean = true) {
|
||||
const result: BattleBlueprtDropType = await BattleBlueprtDropModel.findOneAndUpdate({ roleId, refTime }, {}, {new: true, upsert: true}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async updateByTime(roleId: string, refTime: Date, params: {getNum: number, curCostAp: number, getSum: number, costAp: number}, lean = true) {
|
||||
const result: BattleBlueprtDropType = await BattleBlueprtDropModel.findOneAndUpdate({roleId, refTime}, {$set: params}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async deleteAccount(roleId: string) {
|
||||
let result = await BattleBlueprtDropModel.deleteMany({roleId});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export const BattleBlueprtDropModel = getModelForClass(BattleBlueprtDrop);
|
||||
|
||||
export interface BattleBlueprtDropType extends Pick<DocumentType<BattleBlueprtDrop>, keyof BattleBlueprtDrop>{}
|
||||
@@ -70,7 +70,6 @@ import { ActivityTreasureHuntShopModel } from '../db/ActivityTreasureHuntShop';
|
||||
import { ActivityTreasureHuntTaskModel } from '../db/ActivityTreasureHuntTask';
|
||||
import { ActivityTreasureHuntTreasureShopModel } from '../db/ActivityTreasureHuntTreasureShop';
|
||||
import { ActivityVipRechargeMoneyModel } from '../db/ActivityVipRechargeMoney';
|
||||
import { BattleBlueprtDropModel } from '../db/BattleBlueprtDrop';
|
||||
import { ChatInfoModel } from '../db/ChatInfo';
|
||||
import { DungeonFirstModel } from '../db/DungeonFirst';
|
||||
import { EquipPrintDropModel } from '../db/EquipPrintDrop';
|
||||
@@ -410,7 +409,6 @@ export async function deletRole(roleId: string) {
|
||||
await ActivityTreasureHuntTaskModel.deleteMany({ roleId });
|
||||
await ActivityTreasureHuntTreasureShopModel.deleteMany({ roleId });
|
||||
await ActivityVipRechargeMoneyModel.deleteMany({ roleId });
|
||||
await BattleBlueprtDropModel.deleteMany({ roleId });
|
||||
await BattleDropModel.deleteMany({ roleId });
|
||||
await BattleRecordModel.deleteMany({ roleId });
|
||||
await BattleSweepRecordModel.deleteMany({ roleId });
|
||||
|
||||
@@ -494,10 +494,6 @@ export async function checkTaskRec(roleId: string, type: number, group: string,
|
||||
case TASK_TYPE.BATTLE_EXPEDITION_BOX:
|
||||
isMatch = taskParam[1] == 0 || param.point == taskParam[1];
|
||||
break;
|
||||
case TASK_TYPE.COM_BATTLE_BLUEPRT:
|
||||
case TASK_TYPE.COM_BATTLE_QUALITY:
|
||||
isMatch = taskParam[0] == 0 || param.quality == taskParam[0];
|
||||
break;
|
||||
case TASK_TYPE.COM_BATTLE_DROP:
|
||||
isMatch = checkIdList(taskParam, 1, param.gid);
|
||||
break;
|
||||
@@ -1321,11 +1317,6 @@ export function isComplete(_roleId: string, taskType: TASK_TYPE, taskParam: stri
|
||||
case TASK_TYPE.HERO_STAR_UP:
|
||||
addCount = count;
|
||||
break;
|
||||
case TASK_TYPE.COM_BATTLE_BLUEPRT:
|
||||
if(paramObj.quality == param[0]) {
|
||||
addCount = count;
|
||||
}
|
||||
break;
|
||||
case TASK_TYPE.FRIEND_NUM:
|
||||
addCount = count;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user