✨ feat(gvg): 投石车攻击对手范围调整
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user