🐞 fix(gvg): 激战期推送相关修改
This commit is contained in:
@@ -49,7 +49,8 @@ export default class GVGCity extends BaseModel {
|
||||
|
||||
// 添加人数
|
||||
public static async increasePlayer(configId: number, groupKey: string, cityId: number, roleId: string, leagueCode: string, teamCnt: number) {
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, userCnt: { $lt: 200 } }, { $inc: { userCnt: 1 }, $push: { players: { roleId, leagueCode, teamCnt } }}, { new: true, upsert: true }).lean();
|
||||
await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId }, { $setOnInsert: { userCnt: 0, players: [] } }, { upsert: true }).lean()
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, userCnt: { $lt: 200 } }, { $inc: { userCnt: 1 }, $push: { players: { roleId, leagueCode, teamCnt } }}, { new: true }).lean();
|
||||
return city;
|
||||
}
|
||||
|
||||
@@ -98,7 +99,7 @@ export default class GVGCity extends BaseModel {
|
||||
public static async guardCity(configId: number, groupKey: string, cityId: number, league: LeagueRankInfo) {
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId: configId + 1, cityId, groupKey }, { $set: {
|
||||
hasGuard: true, guardLeague: league.code, guardLeagueName: league.name, guardLeagueIcon: league.icon
|
||||
} }, { upsert: true, new: true }).lean();
|
||||
}, $setOnInsert: { userCnt: 0, players: [] } }, { upsert: true, new: true }).lean();
|
||||
return city;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ export default class GVGTeam extends BaseModel {
|
||||
|
||||
// 结算防守方
|
||||
public static async battleEndDefense(teamCode: string, hpInc: number, rebirthAreaId: number, reviveCd: number) {
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { defenseTime: nowSeconds() + GVG.GVG_DEFAULT_DEFENSE_CD, lockTime: 0, lockTeamCode: '' }, $inc: { durability: hpInc } }, { new: true }).lean();
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { defenseTime: nowSeconds() + GVG.GVG_DEFAULT_DEFENSE_CD, lockTime: 0, lockTeamCode: '' }, $inc: { durability: -hpInc } }, { new: true }).lean();
|
||||
if(team.durability <= 0) {
|
||||
let originPointId = team.pointId;
|
||||
team = await GVGTeamModel.teamBreak(teamCode, team.isRobot, team.maxDurability, rebirthAreaId, team.areaId, reviveCd);
|
||||
@@ -294,11 +294,11 @@ export default class GVGTeam extends BaseModel {
|
||||
// 队伍进入修整器
|
||||
public static async teamBreak(teamCode: string, isRobot: boolean, maxDurability: number, areaId: number, fromAreaId: number, reviveCd: number) {
|
||||
if(!isRobot) {
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { restartTime: nowSeconds() - reviveCd, stopMoveTime: nowSeconds(), areaId, fromAreaId, durability: maxDurability, pointId: 0 } }, { new: true }).lean();
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { restartTime: nowSeconds() + reviveCd, stopMoveTime: nowSeconds(), areaId, fromAreaId, durability: maxDurability, pointId: 0 } }, { new: true }).lean();
|
||||
team.curTeamBreak = true;
|
||||
return team;
|
||||
} else {
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { fromAreaId, pointId: 0, durability: 0, isBroken: true } }, { new: true }).lean();
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { fromAreaId, durability: 0, isBroken: true } }, { new: true }).lean();
|
||||
team.curTeamBreak = true;
|
||||
return team;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ export const GUIDE = {
|
||||
};
|
||||
export const GVG = {
|
||||
GVG_LEAGUE_COMPOSE: 3, // 一个联军有最多多少军团组成
|
||||
GVG_CROSS_SERVICE_STARTTIME: 4, // 开服几周后开始跨服玩法
|
||||
GVG_CROSS_SERVICE_STARTTIME: 2, // 开服几周后开始跨服玩法
|
||||
GVG_ROLE_TOTAL_RATIO: 1.2, // 贤臣+猛将总人数上限系数
|
||||
GVG_ROLE_RATIO: 1, // 贤臣/猛将各职能选择人数上限系数
|
||||
GVG_PRODUCER_GET: '10&6|11&2', // 贤臣每天发多少令
|
||||
@@ -386,7 +386,7 @@ export const GVG = {
|
||||
GVG_ARMY_LEAGUE_TIME: 3, // GVG开启军团等级开启限制
|
||||
GVG_ROLE_TYPE: '1&贤臣|2&猛将', // GVG中职能选择
|
||||
GVG_TEAM_NUMBER: '1&1&100|2&50&100|3&80&100', // GVG编队,index&lv&durability
|
||||
GVG_CATAPULT: '&', // &
|
||||
GVG_GUARD_START_TIME: 300, // 城池占领者提前入城时间
|
||||
GVG_CITY_OCCUPIED_NUMBER: 2, // 一个联军最多可以占领的城池数量
|
||||
GVG_SP_FIELD_ADD: 0.2, // 农田特殊格子上种植对应的植物的加成
|
||||
GVG_FARM_LOCK_TIME: 300, // 农田锁定时间(秒)
|
||||
@@ -418,6 +418,7 @@ export const GVG = {
|
||||
GVG_ROBOT_WARJSON: 85002, // GVG城池守卫的出兵表
|
||||
GVG_REDPOINT_BATTLEFEAT: 0, // 千机阁战功红点大于多少可能出现红点
|
||||
GVG_REVIVE_GOLD: '1&100|2&150|3&200|4&250|5&300|6&500', // GVG激战期元宝购买复活的消耗,次数&元宝数
|
||||
GVG_VESTIGE_CHALLENGE_TIME: '5:00:00&22:00:00', // 征战中原遗迹可挑战时间
|
||||
};
|
||||
export const PLATFORM_CONFIG = {
|
||||
OPEN_ANIMATION: 1, // 0关,1开(开场动画视频)
|
||||
|
||||
@@ -292,5 +292,12 @@
|
||||
"sendName": "学宫驿使",
|
||||
"content": "亲爱的百家传人,逐鹿中原激战期已结束,您的联军锐不可当成功占领%d,占领奖励现已发送至邮箱,请查收",
|
||||
"time": 720
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"title": "联军邮件",
|
||||
"sendName": "&",
|
||||
"content": "%d",
|
||||
"time": 0
|
||||
}
|
||||
]
|
||||
@@ -14,7 +14,7 @@
|
||||
{
|
||||
"periodType": 3,
|
||||
"day": "6&",
|
||||
"startTime": "17:00:00",
|
||||
"endTime": "22:00:00"
|
||||
"startTime": "22:06:00",
|
||||
"endTime": "23:00:00"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user