feat(gvg): 投石车攻击对手范围调整

This commit is contained in:
luying
2023-02-28 10:51:18 +08:00
parent 78777a1437
commit 9d369ee0a9
6 changed files with 77 additions and 60 deletions

View File

@@ -155,9 +155,23 @@ export enum GVG_AREA_TYPE {
}
export const GVG_CATAPULT = 'catapult';
export const GVG_ROBOT = 'robot';
export enum GVG_BATTLE_RANK_TYPE {
PLAYER = 1,
GUILD = 2, // 废弃
LEAGUE = 3
}
// 据点上的守卫类型
export enum GVG_POINT_TYPE {
NO = 0,
ROBOT = 1, // 守卫者
CATAPULT = 2, // 投石车
}
export enum GVG_ATTACK_TYPE {
CATAPULT = 1, // 投石车
KNIFE = 2, // 道具
PLAYER = 3, // 玩家
}

View File

@@ -7,7 +7,7 @@ import { EXTERIOR, GVG } from "../pubUtils/dicParam";
import { DicGVGAreaPoint } from "../pubUtils/dictionary/DicGVGAreaPoint";
import { InitTeamParam, SaveTeamUpdateParam } from "../domain/gvgField/gvgDb";
import { GVGHeroInfo } from "../domain/dbGeneral";
import { GVG_CATAPULT } from "../consts";
import { GVG_CATAPULT, GVG_ROBOT } from "../consts";
@index({ roleId: 1, index: 1 })
@index({ teamCode: 1 })
@@ -215,7 +215,7 @@ export default class GVGTeam extends BaseModel {
let teams: GVGTeamType[] = [];
for(let { pointId, areaId, name, head, spine, ce, durability } of dicPoints) {
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ groupKey, cityId, areaId, pointId }, {
$setOnInsert: {teamCode: genCode(8), maxDurability: durability, roleName: name, head, spine, frame: EXTERIOR.EXTERIOR_FACECASE, lineupCe: ce, isRobot: true, lv, isBroken: false, startMoveTime: 0, stopMoveTime: 0, guildCode: '', leagueCode: '', leagueName: '', fromAreaId: areaId,
$setOnInsert: {teamCode: genCode(8), maxDurability: durability, roleName: name, head, spine, frame: EXTERIOR.EXTERIOR_FACECASE, lineupCe: ce, isRobot: true, lv, isBroken: false, startMoveTime: 0, stopMoveTime: 0, guildCode: '', leagueCode: '', leagueName: '', fromAreaId: areaId, roleId: GVG_ROBOT,
}, $set: { configId, durability }
}, { new: true, upsert: true }).lean();
teams.push(team);
@@ -235,7 +235,7 @@ export default class GVGTeam extends BaseModel {
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ groupKey, cityId, areaId, pointId }, {
$setOnInsert: {
teamCode: genCode(8), maxDurability: durability, roleName: name, head, spine, frame: EXTERIOR.EXTERIOR_FACECASE, lineupCe: ce, lv, leagueCode, leagueName, captapultAtk: atk,
isRobot: true, isCatapult: true, isBroken: false, startMoveTime: 0, stopMoveTime: 0, guildCode: '', fromAreaId: areaId,
isRobot: true, isCatapult: true, isBroken: false, startMoveTime: 0, stopMoveTime: 0, guildCode: '', fromAreaId: areaId, roleId: GVG_CATAPULT,
}, $set: { configId, durability }
}, { new: true, upsert: true }).lean();
teams.push(team);

View File

@@ -1,5 +1,5 @@
// GVG城池
import { FILENAME } from '../../consts'
import { FILENAME, GVG_AREA_TYPE } from '../../consts'
import { parseNumberList, readFileAndParse } from '../util'
export interface DicGVGArea {
@@ -26,7 +26,7 @@ export interface DicGVGArea {
}
export const dicGVGArea = new Map<number, DicGVGArea>();
export const dicGVGCity = new Map<number, { cityType: number, mapType: number, areaIds: number[], defenseBirth: number, attackBirth: number, cityName: string }>();
export const dicGVGCity = new Map<number, { cityType: number, mapType: number, battleAreaIds: number[], catapultAreaIds: number[], areaIds: number[], defenseBirth: number, attackBirth: number, cityName: string }>();
export function loadGVGArea() {
dicGVGArea.clear();
dicGVGCity.clear();
@@ -35,11 +35,14 @@ export function loadGVGArea() {
arr.forEach(o => {
o.relateArea = parseNumberList(o.relateArea);
if(!dicGVGCity.has(o.cityId)) {
dicGVGCity.set(o.cityId, { cityType: o.cityType, mapType: o.mapType, areaIds: [], defenseBirth: 0, attackBirth: 0, cityName: o.cityName });
dicGVGCity.set(o.cityId, { cityType: o.cityType, mapType: o.mapType, battleAreaIds: [], catapultAreaIds: [], areaIds: [], defenseBirth: 0, attackBirth: 0, cityName: o.cityName });
}
if(o.areaType == GVG_AREA_TYPE.BIG || o.areaType == GVG_AREA_TYPE.MIDDLE || o.areaType == GVG_AREA_TYPE.SMALL)
dicGVGCity.get(o.cityId)?.battleAreaIds.push(o.areaId);
if(o.areaType == GVG_AREA_TYPE.CATAPULT) dicGVGCity.get(o.cityId)?.catapultAreaIds.push(o.areaId);
if(o.areaType == GVG_AREA_TYPE.DEFENSER) dicGVGCity.get(o.cityId).defenseBirth = o.areaId;
if(o.areaType == GVG_AREA_TYPE.ATTACKER) dicGVGCity.get(o.cityId).attackBirth = o.areaId;
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;