✨ feat(gvg): 激战期内存以及玩家移动、挑战操作
This commit is contained in:
@@ -358,6 +358,16 @@ export const STATUS = {
|
||||
GVG_RECEIVE_NO_RANK_REWARD: { code: 21368, simStr: '没有可领取的奖励' },
|
||||
GVG_VESTIGE_TIME_OUT: { code: 21369, simStr: '今天遗迹已结算,不可再挑战' },
|
||||
|
||||
// GVG激战期
|
||||
GVG_BATTLE_TEAM_NOT_FOUND: { code: 21400, simStr: '未找到该编队' },
|
||||
GVG_BATTLE_TEAM_IS_SELLTED: { code: 21401, simStr: '编队正在驻守据点,不可移动' },
|
||||
GVG_BATTLE_AREA_NOT_RELATE: { code: 21402, simStr: '该据点与原据点不相连' },
|
||||
GVG_BATTLE_IS_MOVING: { code: 21403, simStr: '编队正在移动中' },
|
||||
GVG_BATTLE_IS_NOT_IN_CITY: { code: 21404, simStr: '编队不在这个城池中' },
|
||||
GVG_TEAM_ATTACKING: { code: 21405, simStr: '您的编队正在攻击冷却中' },
|
||||
GVG_TEAM_DEFENSEING: { code: 21406, simStr: '选择的编队正在防守冷却中' },
|
||||
GVG_BATTLEREC_NOT_FOUND: { code: 21407, simStr: '未找到该记录' },
|
||||
|
||||
// 通用 30000 - 30099
|
||||
DIC_DATA_NOT_FOUND: { code: 30000, simStr: '数据表未找到' },
|
||||
ROLE_MATERIAL_NOT_ENOUGH: { code: 30001, simStr: '材料数量不足' },
|
||||
|
||||
79
shared/db/GVGBattleRec.ts
Normal file
79
shared/db/GVGBattleRec.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
// GVGBattleRec 数据库表,挑战记录信息
|
||||
import BaseModel from "./BaseModel";
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { genCode } from "../pubUtils/util";
|
||||
import { LineupHero } from './../domain/roleField/hero';
|
||||
import { GVGTeamType } from "./GVGTeam";
|
||||
|
||||
class TeamInfo {
|
||||
@prop({ required: true })
|
||||
roleId: string; // 玩家id
|
||||
|
||||
@prop({ required: true })
|
||||
teamCode: string; // 玩家队伍唯一标识
|
||||
|
||||
@prop({ required: true })
|
||||
teamId: number; // 队伍id,1-3,玩家的第几个队伍
|
||||
|
||||
@prop({ required: true })
|
||||
leagueCode: string; // 联军
|
||||
|
||||
@prop({ required: true })
|
||||
guildCode: string; // 军团
|
||||
|
||||
@prop({ required: false })
|
||||
areaId: number;
|
||||
|
||||
@prop({ required: false })
|
||||
cityId: number;
|
||||
|
||||
@prop({ required: false })
|
||||
pointId: number;
|
||||
|
||||
@prop({ required: true })
|
||||
head: number; // 头像
|
||||
|
||||
@prop({ required: true })
|
||||
spine: number; // 形象
|
||||
|
||||
@prop({ required: true })
|
||||
frame: number; // 相框
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
durability: number; // 耐久
|
||||
|
||||
@prop({ required: true, type: () => LineupHero, _id: false })
|
||||
lineup: LineupHero[]
|
||||
}
|
||||
|
||||
@index({ battleCode: 1 })
|
||||
export default class GVGBattleRec extends BaseModel {
|
||||
@prop({ required: true })
|
||||
battleCode: string; // 战斗记录
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
attackTeam: TeamInfo; // 挑战队伍
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
defenseTeam: TeamInfo; // 防守队伍
|
||||
|
||||
@prop({ required: true })
|
||||
isSuccess: boolean;
|
||||
|
||||
public static async createRec(attackTeam: GVGTeamType, defenseTeam: GVGTeamType) {
|
||||
const battleCode = genCode(8);
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { attackTeam, defenseTeam, isSuccess: false } }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async findByBattleCode(battleCode: string) {
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOne({ battleCode }).lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export const GVGBattleRecModel = getModelForClass(GVGBattleRec);
|
||||
|
||||
export interface GVGBattleRecType extends Pick<DocumentType<GVGBattleRec>, keyof GVGBattleRec> {};
|
||||
|
||||
export type GVGBattleRecUpdate = Partial<GVGBattleRecType>; // 将所有字段变成可选项
|
||||
@@ -1,17 +1,31 @@
|
||||
import BaseModel from "./BaseModel";
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
|
||||
@index({ configId: 1, cityId: 1 })
|
||||
class Player {
|
||||
@prop({ required: true })
|
||||
leagueCode: string;
|
||||
@prop({ required: true })
|
||||
roleId: string;
|
||||
}
|
||||
|
||||
|
||||
@index({ configId: 1, cityId: 1, groupId: 1, serverType: 1 })
|
||||
// GVGCity 类,继承自 BaseModel
|
||||
export default class GVGCity extends BaseModel {
|
||||
@prop({ required: true, default: 1 })
|
||||
configId: number; // config唯一id
|
||||
|
||||
@prop({ required: true, default: 1 })
|
||||
groupId: number; // 战区
|
||||
|
||||
@prop({ required: true, default: 1 })
|
||||
serverType: number; // 1-单服 2-跨服
|
||||
|
||||
@prop({ required: true })
|
||||
cityId: number; // 城池id
|
||||
|
||||
@prop({ required: true, default: [] })
|
||||
leagueCodes: string[]; // 联军
|
||||
@prop({ required: true, default: [], type: Player, _id: false })
|
||||
players: Player[]; // 联军
|
||||
|
||||
@prop({ required: false })
|
||||
guardLeague: string; // 占领的联军
|
||||
@@ -19,29 +33,35 @@ export default class GVGCity extends BaseModel {
|
||||
@prop({ required: false })
|
||||
guardLeagueName: string; // 占领的联军
|
||||
|
||||
@prop({ required: false })
|
||||
guardLeagueIcon: number; // 占领的联军
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
userCnt: number; // 城池人数
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
teamCnt: number; // 城池队伍数
|
||||
|
||||
// 创建城市
|
||||
public static async createCity(configId: number, cityId: number) {
|
||||
public static async createCity(configId: number, groupId: number, serverType: number, cityId: number) {
|
||||
let doc = new GVGCityModel();
|
||||
let update = Object.assign(doc.toJSON(), { configId, cityId});
|
||||
const city: GVGCityType | null = await GVGCityModel.findOneAndUpdate({ configId, cityId }, { $setOnInsert: update }, { upsert: true, new: true }).lean();
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, cityId, groupId, serverType }, { $setOnInsert: update }, { upsert: true, new: true }).lean();
|
||||
return city;
|
||||
}
|
||||
|
||||
// 通过 cityId 获取城市
|
||||
public static async getCityByCityId(configId: number, cityId: number) {
|
||||
const city: GVGCityType | null = await GVGCityModel.findOne({ configId, cityId }).lean();
|
||||
public static async findByCityId(configId: number, groupId: number, serverType: number, cityId: number) {
|
||||
const city: GVGCityType = await GVGCityModel.findOne({ configId, groupId, serverType, cityId }).lean();
|
||||
return city;
|
||||
}
|
||||
|
||||
// 更新城市字段
|
||||
public static async updateCityUser(configId: number, cityId: number, userInc: number, teamInc: number) {
|
||||
const city: GVGCityType | null = await GVGCityModel.findOneAndUpdate({ configId, cityId}, { $inc: {userCnt: userInc, teamCnt: teamInc} }, { new: true }).lean();
|
||||
// 添加人数
|
||||
public static async increasePlayer(configId: number, groupId: number, serverType: number, cityId: number, roleId: string, leagueCode: string) {
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupId, serverType, cityId, userCnt: { $lt: 200 } }, { $inc: { userCnt: 1 }, $push: { players: { roleId, leagueCode } }}, { new: true, upsert: true }).lean();
|
||||
return city;
|
||||
}
|
||||
|
||||
// 减少人数
|
||||
public static async decreasePlayer(configId: number, groupId: number, serverType: number, cityId: number, roleId: string) {
|
||||
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupId, serverType, cityId, 'players.roleId': roleId }, { $inc: { userCnt: -1 }, $pull: { players: { roleId } }}, { new: true, upsert: true }).lean();
|
||||
return city;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ export default class GVGLeagueFarm extends BaseModel {
|
||||
public static async lockFields(configId: number, leagueCode: string, farmId: number, type: number, roleId: string, roleName: string, lands: { fieldId: number, addType: number }[]) {
|
||||
// 先创建
|
||||
await GVGLeagueFarmModel.bulkWrite(lands.map(({ fieldId }) => {
|
||||
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId }, update: { $setOnInsert: { unlockTime: 0, harvestTime: 0, seedType: 0, addType: 0, addTypes: [], type } }, upsert: true} }
|
||||
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId }, update: { $setOnInsert: { unlockTime: 0, harvestTime: 0, seedType: 0, addType: 0, addTypes: [], type, index: 0 } }, upsert: true} }
|
||||
}));
|
||||
const result = await GVGLeagueFarmModel.bulkWrite(lands.map(({ fieldId, addType }) => {
|
||||
if(addType > 0) {
|
||||
|
||||
@@ -3,10 +3,14 @@ import BaseModel from "./BaseModel";
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { genCode } from "../pubUtils/util";
|
||||
import { LineupHero } from './../domain/roleField/hero';
|
||||
import { nowSeconds } from "../pubUtils/timeUtil";
|
||||
import { GVG } from "../pubUtils/dicParam";
|
||||
import { DicGVGAreaPoint } from "../pubUtils/dictionary/DicGVGAreaPoint";
|
||||
|
||||
@index({ roleId: 1, teamId: 1 })
|
||||
@index({ teamCode: 1 })
|
||||
export default class GVGTeam extends BaseModel {
|
||||
|
||||
@prop({ required: true })
|
||||
roleId: string; // 玩家id
|
||||
|
||||
@@ -19,6 +23,9 @@ export default class GVGTeam extends BaseModel {
|
||||
@prop({ required: true })
|
||||
leagueCode: string; // 联军
|
||||
|
||||
@prop({ required: true })
|
||||
guildCode: string; // 军团
|
||||
|
||||
@prop({ required: false })
|
||||
areaId: number;
|
||||
|
||||
@@ -47,13 +54,31 @@ export default class GVGTeam extends BaseModel {
|
||||
attackTime: number; // 进攻冷却时间
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
moveTime: number; // 移动冷却时间
|
||||
startMoveTime: number;
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
stopMoveTime: number; // 移动冷却时间
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
defenseTime: number; // 防守保护时间
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
point: number; // 积分
|
||||
|
||||
@prop({ required: true, type: () => LineupHero, _id: false })
|
||||
lineup: LineupHero[];
|
||||
|
||||
@prop({ required: true })
|
||||
lineup: [LineupHero]
|
||||
lineupCe: number;
|
||||
|
||||
@prop({ required: true })
|
||||
groupId: number; // 战区
|
||||
|
||||
@prop({ required: true })
|
||||
serverType: number; // 单服还是跨服
|
||||
|
||||
@prop({ required: true, default: false })
|
||||
isRobot: boolean; // 是否是机器人
|
||||
|
||||
// 创建队伍
|
||||
public static async createTeam(roleId: string, leagueCode: string, teamId: number, head: number, spine: number, frame: number, lineup: [LineupHero]) {
|
||||
@@ -87,10 +112,72 @@ export default class GVGTeam extends BaseModel {
|
||||
}
|
||||
|
||||
// 玩家切换城池更新队伍信息
|
||||
public static async resetTeamsLoc(roleId: string, cityId: number, areaId: number) {
|
||||
const res = await GVGTeamModel.updateMany({ roleId }, { cityId, areaId, pointId: 0 }).lean();
|
||||
public static async enterCity(roleId: string, cityId: number, areaId: number, groupId: number, serverType: number) {
|
||||
const res = await GVGTeamModel.updateMany({ roleId }, { cityId, areaId, pointId: 0, groupId, serverType }).lean();
|
||||
return !!res['ok'];
|
||||
}
|
||||
|
||||
// 获取我的编队
|
||||
public static async findByRole(roleId: string, select = '') {
|
||||
const teams: GVGTeamType[] = await GVGTeamModel.find({ roleId }).select(select).lean();
|
||||
return teams;
|
||||
}
|
||||
|
||||
// 获取我的编队
|
||||
public static async findByTeamCode(roleId: string, teamCode: string, select = '') {
|
||||
const res: GVGTeamType = await GVGTeamModel.findOne({ roleId, teamCode }).select(select).lean();
|
||||
return res;
|
||||
}
|
||||
|
||||
// 移动
|
||||
public static async startMove(teamCode: string, areaId: number) {
|
||||
const res: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { areaId, stopMoveTime: nowSeconds() + GVG.GVG_DEFAULT_MOVE_CD } }).lean();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static async stopMove(teamCode: string, areaId: number) {
|
||||
const res: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { areaId, stopMoveTime: nowSeconds() } }).lean();
|
||||
return res;
|
||||
}
|
||||
|
||||
// 查询挑战和防守的编队
|
||||
public static async findBattleTeams(teamCode: string, oppoTeamCode: string) {
|
||||
const teams: GVGTeamType[] = await GVGTeamModel.find({ teamCode: { $in: [ teamCode, oppoTeamCode ] } }).lean();
|
||||
let attackTeam: GVGTeamType = null, defenseTeam: GVGTeamType = null;
|
||||
for(let team of teams) {
|
||||
if(team.teamCode == teamCode) attackTeam = team;
|
||||
if(team.teamCode == oppoTeamCode) defenseTeam = team;
|
||||
}
|
||||
return { attackTeam, defenseTeam }
|
||||
}
|
||||
|
||||
public static async checkRobot(groupId: number, serverType: number, cityId: number) {
|
||||
return await GVGTeamModel.exists({ groupId, serverType, cityId, isRobot: true });
|
||||
}
|
||||
|
||||
public static async initRobots(groupId: number, serverType: number, cityId: number, dicPoints: DicGVGAreaPoint[]) {
|
||||
await GVGTeamModel.bulkWrite(dicPoints.map(dic => {
|
||||
return {
|
||||
updateOne: {
|
||||
filter: { groupId, serverType, cityId, pointId: dic.pointId },
|
||||
update: { $setOnInsert: { teamCode: `robot${dic.pointId}`, ...dic, isRobot: true } }, upsert: true
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// 攻击方攻击cd
|
||||
public static async lockAttack(teamCode: string, groupId: number, serverType: number) {
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { attackTime: nowSeconds() + GVG.GVG_DEFAULT_ATTACK_CD, groupId, serverType } }, { new: true }).lean();
|
||||
return team;
|
||||
}
|
||||
|
||||
// 防守方防守cd
|
||||
public static async lockDefense(teamCode: string, groupId: number, serverType: number) {
|
||||
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { attackTime: nowSeconds() + GVG.GVG_DEFAULT_DEFENSE_CD, groupId, serverType } }, { new: true }).lean();
|
||||
return team;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const GVGTeamModel = getModelForClass(GVGTeam);
|
||||
@@ -98,3 +185,5 @@ export const GVGTeamModel = getModelForClass(GVGTeam);
|
||||
export interface GVGTeamType extends Pick<DocumentType<GVGTeam>, keyof GVGTeam> {
|
||||
id: number;
|
||||
};
|
||||
|
||||
export type GVGTeamUpdate = Partial<GVGTeamType>; // 将所有字段变成可选项
|
||||
@@ -129,6 +129,7 @@ export default class GVGUserData extends BaseModel {
|
||||
const result: GVGUserDataType = await GVGUserDataModel.findOneAndUpdate({ configId, leagueCode, roleId }, { $set: { cityId }}, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const GVGUserDataModel = getModelForClass(GVGUserData);
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import { GVGTeamType } from "../../db/GVGTeam";
|
||||
import { GVGTeamType, GVGTeamUpdate } from "../../db/GVGTeam";
|
||||
|
||||
// 积分点分类统计,1-3级积分点代表从小到大
|
||||
export interface LeagueCityPoint {
|
||||
export class LeagueCityPoint {
|
||||
// 玩家id
|
||||
roleId: string;
|
||||
// 军团id
|
||||
guildCode: string;
|
||||
// 联军id
|
||||
leagueCode: string;
|
||||
|
||||
// 计分点数
|
||||
pointCnt1: number;
|
||||
pointCnt2: number;
|
||||
@@ -13,11 +20,43 @@ export interface LeagueCityPoint {
|
||||
}
|
||||
|
||||
// 队伍状态
|
||||
export interface GVGTeamMem extends GVGTeamType {
|
||||
// 开始移动时间戳
|
||||
export class GVGTeamMem implements GVGTeamUpdate {
|
||||
roleId: string; // 玩家id
|
||||
id: number;
|
||||
teamCode: string;
|
||||
teamId: number;
|
||||
leagueCode: string;
|
||||
guildCode: string;
|
||||
areaId: number;
|
||||
cityId: number;
|
||||
pointId: number;
|
||||
head: number;
|
||||
spine: number;
|
||||
frame: number;
|
||||
durability: number;
|
||||
restartTime: number;
|
||||
attackTime: number;
|
||||
defenseTime: number;
|
||||
startMoveTime: number;
|
||||
// 停止移动时间戳
|
||||
stopMoveTime: number;
|
||||
// 是否正在移动
|
||||
isMoving: boolean;
|
||||
point: number;
|
||||
|
||||
constructor(team: GVGTeamType) {
|
||||
for(let key in team) {
|
||||
this[key] = team[key];
|
||||
}
|
||||
}
|
||||
|
||||
public setCity(cityId: number, areaId = 0) {
|
||||
this.cityId = cityId;
|
||||
this.areaId = areaId;
|
||||
this.pointId = 0;
|
||||
}
|
||||
|
||||
public moveToArea(areaId: number, startMoveTime: number, stopMoveTime: number) {
|
||||
this.areaId = areaId;
|
||||
this.startMoveTime = startMoveTime;
|
||||
this.stopMoveTime = stopMoveTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ export class LeagueFarmMember {
|
||||
setByFields(fields: GVGLeagueFarmType[]) {
|
||||
this.count = fields.length;
|
||||
this.harvestTime = Math.min(...fields.map(cur => cur.harvestTime))||0;
|
||||
this.canHelp = !!fields.find(cur => cur.harvestTime < nowSeconds());
|
||||
this.canHelp = !!fields.find(cur => cur.harvestTime > 0 && cur.harvestTime < nowSeconds());
|
||||
this.output = fields.reduce((pre, cur) => (pre + cur.output||0), 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
import { prop } from 'typegoose';
|
||||
import { ArtifactModelType } from '../../db/Artifact';
|
||||
import { Connect, EPlace, HeroSkin, HeroType, HeroUpdate, Talent } from '../../db/Hero';
|
||||
import { JewelSe, JewelType, RandSe } from '../../db/Jewel';
|
||||
@@ -155,8 +156,11 @@ export class ArtifactParam {
|
||||
}
|
||||
|
||||
// 阵容
|
||||
export interface LineupHero {
|
||||
export class LineupHero {
|
||||
@prop({ required: true })
|
||||
actorId: number; // 武将
|
||||
@prop({ required: true })
|
||||
dataId: number; // 出兵表上的位置
|
||||
@prop({ required: true })
|
||||
order: number; // 行动
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import { dicCityActivityReward, loadCityActivityReward } from "./dictionary/DicC
|
||||
import { dicRaceActivity, dicRaceTypes, loadRaceActivity } from './dictionary/DicRaceActivity';
|
||||
import { GUILDACTIVITY, RECRUIT } from "./dicParam";
|
||||
import * as param from "./dicParam";
|
||||
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandEelm, readTsFile, getRandSingleEelm } from "./util";
|
||||
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandEelm, readTsFile, getRandSingleEelm, parseNumberList } from "./util";
|
||||
import { RACE_EVENT_TYPE } from "../consts";
|
||||
import { dicShopByType, dicShopItem, loadShop } from "./dictionary/DicShop";
|
||||
import { dicShopType, loadShopType } from "./dictionary/DicShopType";
|
||||
@@ -334,6 +334,7 @@ export const gameData = {
|
||||
gvgVestigeName: dicGVGVestigeName,
|
||||
gvgAreaPoint: dicGVGAreaPoint,
|
||||
gvgBattleRankReward: dicGVGBattleRankReward,
|
||||
gvgBattleDurabilityMinus: { win: 0, fail: 0 },
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -1213,6 +1214,12 @@ export function getGVGBattleRankReward(type: number, rank: number) {
|
||||
return lastRank
|
||||
}
|
||||
|
||||
function parseGVGDurabilityMinus() {
|
||||
const range = parseNumberList(param.GVG.GVG_DEFAULT_DURABILITY_MINUS);
|
||||
gameData.gvgBattleDurabilityMinus.win = range[0];
|
||||
gameData.gvgBattleDurabilityMinus.fail = range[0];
|
||||
}
|
||||
|
||||
// 初始加载
|
||||
function initDatas() {
|
||||
parseDicParam();
|
||||
@@ -1236,6 +1243,7 @@ function parseDicParam() {
|
||||
parseGVGActive();
|
||||
parseGVGFieldAdd();
|
||||
parseGVGVestigeCnt();
|
||||
parseGVGDurabilityMinus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -376,7 +376,7 @@ export const GVG = {
|
||||
GVG_LEAGUE_COMPOSE: 3, // 一个联军有最多多少军团组成
|
||||
GVG_CROSS_SERVICE_STARTTIME: 4, // 开服几周后开始跨服玩法
|
||||
GVG_ROLE_TOTAL_RATIO: 1.2, // 贤臣+猛将总人数上限系数
|
||||
GVG_ROLE_RATIO: 1, // 贤臣/猛将各职能选择人数上限系数
|
||||
GVG_ROLE_RATIO: 1.2, // 贤臣/猛将各职能选择人数上限系数
|
||||
GVG_PRODUCER_GET: '10&4|11&2', // 贤臣每天发多少令
|
||||
GVG_FIGHTER_GET: '10&2|11&4', // 猛将每天发多少令
|
||||
GVG_LEAGUE_TECH_LIST: 3, // 科技树解锁队列数量
|
||||
@@ -401,4 +401,9 @@ export const GVG = {
|
||||
GVG_VESTIGE_BATTLE_COUNTDOWN: 300, // 遗迹战斗界面倒计时(s)
|
||||
GVG_VESTIGE_BGMAP_GKID: 80001, // GVG备战期遗迹防守阵容地图所用的关卡id
|
||||
GVG_CITY_BGMAP_GKID: 85001, // GVG激战期防守阵容地图所用的关卡id
|
||||
GVG_DEFAULT_REVIVE_CD: 30, // GVG激战期默认的复活CD
|
||||
GVG_DEFAULT_MOVE_CD: 5, // GVG激战期默认的移动CD
|
||||
GVG_DEFAULT_ATTACK_CD: 5, // GVG激战期默认的攻击CD
|
||||
GVG_DEFAULT_DEFENSE_CD: 2, // GVG激战期默认的防御CD
|
||||
GVG_DEFAULT_DURABILITY_MINUS: '5&100', // GVG激战期默认的队伍耐扣除规则,胜&败:num&num
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface DicGVGArea {
|
||||
}
|
||||
|
||||
export const dicGVGArea = new Map<number, DicGVGArea>();
|
||||
export const dicGVGCity = new Map<number, { cityType: number, areaIds: number[] }>();
|
||||
export const dicGVGCity = new Map<number, { cityType: number, areaIds: number[], defenseBirth: number, attackBirth: number }>();
|
||||
export function loadGVGArea() {
|
||||
dicGVGArea.clear();
|
||||
dicGVGCity.clear();
|
||||
@@ -31,9 +31,11 @@ export function loadGVGArea() {
|
||||
arr.forEach(o => {
|
||||
o.relateArea = parseNumberList(o.relateArea);
|
||||
if(!dicGVGCity.has(o.cityId)) {
|
||||
dicGVGCity.set(o.cityId, { cityType: o.cityType, areaIds: [] });
|
||||
dicGVGCity.set(o.cityId, { cityType: o.cityType, areaIds: [], defenseBirth: 0, attackBirth: 0 });
|
||||
}
|
||||
dicGVGCity.get(o.cityId)?.areaIds.push(o.areaId);
|
||||
if(o.areaType == 1) dicGVGCity.get(o.cityId).defenseBirth = o.areaId;
|
||||
if(o.areaType == 2) dicGVGCity.get(o.cityId).attackBirth = o.areaId;
|
||||
dicGVGArea.set(o.areaId, o);
|
||||
});
|
||||
arr = undefined;
|
||||
|
||||
@@ -11,6 +11,16 @@ export interface DicGVGAreaPoint {
|
||||
readonly score: number;
|
||||
// 位置
|
||||
readonly pointPosition: string;
|
||||
// 守卫名
|
||||
readonly name: number;
|
||||
// 守卫头像
|
||||
readonly head: number;
|
||||
// 守卫形象
|
||||
readonly spine: number;
|
||||
// 守卫战力
|
||||
readonly ce: number;
|
||||
// 守卫耐久
|
||||
readonly durability: number;
|
||||
}
|
||||
|
||||
export const dicGVGAreaPoint = new Map<number, DicGVGAreaPoint>();
|
||||
|
||||
Reference in New Issue
Block a user