✨ feat(gvg): 激战期内存以及玩家移动、挑战操作
This commit is contained in:
@@ -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