✨ feat(共鸣系统): 新增
This commit is contained in:
@@ -15,7 +15,7 @@ import { dicWar, dicWarPvp, dicDailyWarByType, loadWar, dicHeroIdByWar, dicComBa
|
||||
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
|
||||
import { AUCTION_TIME, BOSS_HP_RATIO_TYPE } from "../consts";
|
||||
import { dicFashions, dicFashionsByHeroId, loadFashions } from "./dictionary/DicFashions";
|
||||
import { friendShips, friendShipsByLv, friendShipsMax, loadFriendShip } from "./dictionary/DicFriendShip";
|
||||
import { friendShipByIndex, friendShips, friendShipsByLv, friendShipsMax, loadFriendShip } from "./dictionary/DicFriendShip";
|
||||
import { dicHeroQualityUp, loadHeroQualityUp } from "./dictionary/DicHeroQualityUp";
|
||||
import { dicHeroStar, loadHeroStar } from "./dictionary/DicHeroStar";
|
||||
import { dicHeroWake, loadHeroWake } from "./dictionary/DicHeroWake";
|
||||
@@ -174,6 +174,7 @@ import { dicRougeCharaCardPlan, loadRougeCharaCardPlan } from "./dictionary/DicR
|
||||
import { dicRougeHolyCardPlan, loadRougeHolyCardPlan } from "./dictionary/DicRougeHolyCardPlan";
|
||||
import { dicBossHpRatio, loadBossHpRatio } from "./dictionary/DicBossHpRatio";
|
||||
import { dicSpiritCompose, loadSpiritCompose } from "./dictionary/DicSpiritCompose";
|
||||
import { dicResonance, loadResonance } from "./dictionary/DicResonance";
|
||||
|
||||
export const gameData = {
|
||||
daily: dicDaily,
|
||||
@@ -207,6 +208,7 @@ export const gameData = {
|
||||
friendShips: friendShips,
|
||||
friendShipsByLv: friendShipsByLv,
|
||||
friendShipsMax: friendShipsMax,
|
||||
friendShipByIndex: friendShipByIndex,
|
||||
randomEffectPool: dicRandomEffectPool,
|
||||
randomEffectPoolByGroupAndLv: dicRandomEffectPoolByGroupAndLv,
|
||||
title: dicTitle,
|
||||
@@ -436,6 +438,8 @@ export const gameData = {
|
||||
bossHpRatio: dicBossHpRatio,
|
||||
spiritCompose: dicSpiritCompose,
|
||||
spiritByQuality: dicSpiritByQuality,
|
||||
|
||||
resonance: dicResonance,
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -1384,9 +1388,9 @@ export function getRougeEffectTypeKind(effectTypes: number[]) {
|
||||
}
|
||||
|
||||
export function getBossHpRatio(type: BOSS_HP_RATIO_TYPE, day: number) {
|
||||
let arr = gameData.bossHpRatio.get(type)||[];
|
||||
let arr = gameData.bossHpRatio.get(type) || [];
|
||||
let bossHpRatio = 1;
|
||||
for(let { serverOpen, ratio } of arr) {
|
||||
for (let { serverOpen, ratio } of arr) {
|
||||
bossHpRatio = ratio;
|
||||
if (serverOpen != -1 && serverOpen >= day) break;
|
||||
}
|
||||
@@ -1807,9 +1811,10 @@ function loadDatas(type?: string) {
|
||||
if (type == undefined || type == 'loadRougeTechLevel') loadRougeTechLevel();
|
||||
if (type == undefined || type == 'loadBossHpRatio') loadBossHpRatio();
|
||||
if (type == undefined || type == 'loadSpiritCompose') loadSpiritCompose();
|
||||
if (type == undefined || type == 'loadResonance') loadResonance();
|
||||
|
||||
console.log('loadDatas type: ', type || 'all');
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 后台调用重载资源
|
||||
|
||||
@@ -478,3 +478,10 @@ export const ROUGELIKE = {
|
||||
SELECT_HOLLYCARD_WEIGHT: 30, // 选择的圣物卡后该特性卡权重减少比例(%)
|
||||
RANDOM_HOLLYCARD_WEIGHT: 10, // 随机出的圣物卡后该特性卡权重减少比例(%)
|
||||
};
|
||||
|
||||
export const RESONANCE = {
|
||||
START_MAIN_WARId: 301, //共鸣系统开启
|
||||
HOSTER: 6, //鸣主
|
||||
JEWEL: 1,// 共灵阵是否包括共灵天晶镶嵌(1:包括 0:不包括)
|
||||
STONE: 1, // 共灵阵是否包括共灵地玉镶嵌(1:包括 0:不包括)
|
||||
}
|
||||
@@ -16,16 +16,21 @@ export interface DicFriendShip {
|
||||
// 羁绊武将ID
|
||||
readonly hids: Array<number>;
|
||||
// 属性加成
|
||||
readonly attributes: Array<{id: number, number: number}>
|
||||
readonly attributes: Array<{ id: number, number: number }>
|
||||
// 升到这一级所需的羁绊值
|
||||
readonly shipExp: number;
|
||||
|
||||
readonly index: number;
|
||||
}
|
||||
|
||||
export const friendShips = new Map<string, { level: number, shipExp: number }[]>();
|
||||
export const friendShipsByLv = new Map<string, DicFriendShip>();
|
||||
export const friendShipsMax = new Map<string, number>();
|
||||
export const friendShipByIndex = new Map<string, number>();
|
||||
export function loadFriendShip() {
|
||||
friendShips.clear();
|
||||
friendShipByIndex.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_FRIEND_SHIP);
|
||||
|
||||
arr.forEach(o => {
|
||||
@@ -33,32 +38,35 @@ export function loadFriendShip() {
|
||||
o.hids = parseNumberList(o.memberId);
|
||||
let key1 = `${o.actorId}_${o.shipId}`;
|
||||
let shipSumValue = 0;
|
||||
if(!friendShips.has(key1)) {
|
||||
if (!friendShips.has(key1)) {
|
||||
friendShips.set(key1, []);
|
||||
shipSumValue = 0;
|
||||
}
|
||||
shipSumValue += o.shipExp;
|
||||
friendShips.get(key1).push({ level: o.level, shipExp: shipSumValue });
|
||||
|
||||
if(!friendShipsMax.has(key1) || friendShipsMax.get(key1) < o.level) {
|
||||
if (!friendShipsMax.has(key1) || friendShipsMax.get(key1) < o.level) {
|
||||
friendShipsMax.set(key1, o.level);
|
||||
}
|
||||
|
||||
let key2 = `${o.actorId}_${o.shipId}_${o.level}`;
|
||||
friendShipsByLv.set(key2, o);
|
||||
|
||||
let newKey = `${o.actorId}_${o.index}`;
|
||||
if (!friendShipByIndex.has(newKey)) friendShipByIndex.set(newKey, o.shipId);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
|
||||
function parseAttribute(str: string) {
|
||||
let result = new Array<{id: number, number: number}>();
|
||||
if(!str) return result;
|
||||
let result = new Array<{ id: number, number: number }>();
|
||||
if (!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for(let [id, number] of decodeArr) {
|
||||
if(isNaN(parseInt(id)) || isNaN(parseInt(number))) {
|
||||
for (let [id, number] of decodeArr) {
|
||||
if (isNaN(parseInt(id)) || isNaN(parseInt(number))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({id: parseInt(id), number: parseInt(number)});
|
||||
}
|
||||
result.push({ id: parseInt(id), number: parseInt(number) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
26
shared/pubUtils/dictionary/DicResonance.ts
Normal file
26
shared/pubUtils/dictionary/DicResonance.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
import { parseGoodStr, readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
|
||||
export interface DicResonance {
|
||||
readonly id: number;
|
||||
readonly name: string;
|
||||
readonly openLimit: number;
|
||||
readonly openConsume: RewardInter[];
|
||||
}
|
||||
export const dicResonance = new Map<number, DicResonance>();
|
||||
|
||||
export function loadResonance() {
|
||||
dicResonance.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_RESONANCE);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
o.openConsume = parseGoodStr(o.openConsume);
|
||||
dicResonance.set(o.id, o);
|
||||
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// 一些通用的interface定义
|
||||
|
||||
import { ResonanceConnection, ResonanceEplace, ResonanceTalent } from "../db/Resonance";
|
||||
import { RougelikeCardPara } from "../db/RougelikeCard";
|
||||
import { RougelikeCharaPara } from "../db/RougelikeChara";
|
||||
import { RougelikeCollectionType } from "../db/RougelikeCollection";
|
||||
@@ -206,4 +207,19 @@ export interface CommonReward {
|
||||
export interface SlotCard {
|
||||
index: number; //卡槽标记
|
||||
cardCode: string; //安装的特性卡唯一code
|
||||
}
|
||||
|
||||
export interface ReturnResonanceParam {
|
||||
positon: number; // 上阵位置,从1开始(6为鸣主配系统参数表),已解锁未上阵仅有positon
|
||||
hid?: number; // 武将id
|
||||
seqId?: number; // 武将表自增 id
|
||||
lv?: number; //武将等级
|
||||
exp?: number;
|
||||
jobStage?: number; // 职阶
|
||||
talent?: ResonanceTalent[]; // 天赋
|
||||
usedTalentPoint?: number;
|
||||
totalTalentPoint?: number;
|
||||
connections?: ResonanceConnection[]; // 羁绊
|
||||
ePlace?: ResonanceEplace[];
|
||||
ce?: number; //战力
|
||||
}
|
||||
Reference in New Issue
Block a user