feat(gvg): 占领城池对内政产量的加成

This commit is contained in:
luying
2023-02-17 10:58:06 +08:00
parent 7895c08f16
commit 72a25640aa
6 changed files with 139 additions and 0 deletions
+2
View File
@@ -572,6 +572,8 @@ export const FILENAME = {
DIC_GVG_LEAGUE_LV: 'dic_zyz_GVGLeagueLv',
DIC_GVG_RESOURCE_BASE: 'dic_zyz_GVGResourceBase',
DIC_GVG_CONTRIBUTE_BOX: 'dic_zyz_GVGContributeBox',
DIC_GVG_AREA: 'dic_zyz_GVGArea',
DIC_GVG_CITY_ADD: 'dic_zyz_GVGCityAdd',
}
export const WAR_RELATE_TABLES = [
+7
View File
@@ -124,6 +124,8 @@ import { dicGVGItem, loadGVGItem } from "./dictionary/DicGVGItems";
import { dicGVGLeagueLv, loadGVGLeagueLv } from "./dictionary/DicGVGLeagueLv";
import { dicGVGResourceBase, dicGVGResourceBaseByType, dicGVGResourceBaseByLv, loadGVGResourceBase, DicGVGResourceBase } from './dictionary/DicGVGResourceBase';
import { dicGVGContributeBox, loadGVGContributeBox } from './dictionary/DicGVGContributeBox';
import { dicGVGArea, dicGVGCity, loadGVGArea } from './dictionary/DicGVGArea';
import { dicGVGCityAdd, loadGVGCityAdd } from './dictionary/DicGVGCityAdd';
export const gameData = {
daily: dicDaily,
@@ -312,6 +314,9 @@ export const gameData = {
gvgFieldAddType: new Map<number, number>(),
gvgSpFieldRatio: { min: 0, max: 0},
gvgContributeBox: dicGVGContributeBox,
gvgArea: dicGVGArea,
gvgCity: dicGVGCity,
gvgCityAdd: dicGVGCityAdd,
};
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
@@ -1346,6 +1351,8 @@ function loadDatas() {
loadGVGLeagueLv();
loadGVGResourceBase();
loadGVGContributeBox();
loadGVGArea();
loadGVGCityAdd();
}
// 重载dicParam
+40
View File
@@ -0,0 +1,40 @@
// GVG城池
import { FILENAME } from '../../consts'
import { parseNumberList, readFileAndParse } from '../util'
export interface DicGVGArea {
// 区域id
areaId: number;
// 大地图id
mapId: string
// 大地图类型 1-单服 2-跨服
mapType: number;
// 城池id
cityId: number;
// 城池类型
cityType: number;
// 区域类型 1-守方备战区 2-攻方备战区 3-大据点区 4-中据点区 5-小据点区 6-投石车区
areaType: number;
// 区域管理
relateArea: number[];
// 0表不能被投石车选中作为攻击区域,1表能
catapultAttack: number;
}
export const dicGVGArea = new Map<number, DicGVGArea>();
export const dicGVGCity = new Map<number, { cityType: number, areaIds: number[] }>();
export function loadGVGArea() {
dicGVGArea.clear();
dicGVGCity.clear();
let arr = readFileAndParse(FILENAME.DIC_GVG_AREA);
arr.forEach(o => {
o.relateArea = parseNumberList(o.relateArea);
if(!dicGVGCity.has(o.cityId)) {
dicGVGCity.set(o.cityId, { cityType: o.cityType, areaIds: [] });
}
dicGVGCity.get(o.cityId)?.areaIds.push(o.areaId);
dicGVGArea.set(o.areaId, o);
});
arr = undefined;
}
@@ -0,0 +1,25 @@
// GVG城池
import { FILENAME } from '../../consts'
import { readFileAndParse } from '../util'
export interface DicGVGCityAdd {
// 城池类型 1-大城 2-中城 3-小城
cityType: number;
// dic_zyz_GVGResourceBase的type
resourceType: number;
// 联盟币的加成
coinAdd: number;
// 产量加成
outputAdd: number;
}
export const dicGVGCityAdd = new Map<string, DicGVGCityAdd>();
export function loadGVGCityAdd() {
dicGVGCityAdd.clear();
let arr = readFileAndParse(FILENAME.DIC_GVG_CITY_ADD);
arr.forEach(o => {
dicGVGCityAdd.set(`${o.cityType}_${o.resourceType}`, o);
});
arr = undefined;
}
@@ -0,0 +1,57 @@
[
{
"areaId": 1,
"mapId": 1,
"mapType": 1,
"cityId": 1,
"cityType": 3,
"areaType": 2,
"relateArea": "2&",
"catapultAttack": 0,
"备注": "本服小城攻方备战区"
},
{
"areaId": 2,
"mapId": 1,
"mapType": 1,
"cityId": 1,
"cityType": 3,
"areaType": 5,
"relateArea": "1&3&4",
"catapultAttack": 1,
"备注": "本服小城小据点区"
},
{
"areaId": 3,
"mapId": 1,
"mapType": 1,
"cityId": 1,
"cityType": 3,
"areaType": 4,
"relateArea": "2&4&5",
"catapultAttack": 1,
"备注": "本服小城中据点区"
},
{
"areaId": 4,
"mapId": 1,
"mapType": 1,
"cityId": 1,
"cityType": 3,
"areaType": 6,
"relateArea": "2&3",
"catapultAttack": 0,
"备注": "本服小城投石车区"
},
{
"areaId": 5,
"mapId": 1,
"mapType": 1,
"cityId": 1,
"cityType": 3,
"areaType": 1,
"relateArea": "3&",
"catapultAttack": 0,
"备注": "本服小城守方备战区"
}
]
@@ -0,0 +1,8 @@
[
{
"cityType": 1,
"resourceType": 1,
"coinAdd": 0.1,
"outputAdd": 0.1
}
]