captainbattle 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/CallID.d.ts +21 -13
- package/dist/core/CallID.js +23 -13
- package/dist/core/ListenID.d.ts +551 -501
- package/dist/core/ListenID.js +552 -501
- package/dist/core/config/BadgeCfg.d.ts +18 -4
- package/dist/core/config/BadgeCfg.js +20 -6
- package/dist/core/config/BattlePassCfg.d.ts +1 -1
- package/dist/core/config/BuffCfg.d.ts +7 -1
- package/dist/core/config/BuffCfg.js +6 -0
- package/dist/core/config/Cfg.d.ts +36 -4
- package/dist/core/config/Cfg.js +46 -6
- package/dist/core/config/ChatLogCfg.d.ts +18 -0
- package/dist/core/config/ChatLogCfg.js +17 -0
- package/dist/core/config/Const.d.ts +2 -1
- package/dist/core/config/Const.js +1 -0
- package/dist/core/config/ConstConfigCfg.d.ts +2 -0
- package/dist/core/config/ConstConfigCfg.js +2 -0
- package/dist/core/config/DragonPathCfg.d.ts +1 -1
- package/dist/core/config/EmailCfg.d.ts +5 -3
- package/dist/core/config/EmailCfg.js +7 -5
- package/dist/core/config/EndlessConfigCfg.d.ts +1 -0
- package/dist/core/config/EndlessConfigCfg.js +1 -0
- package/dist/core/config/EnemyGridCfg.d.ts +1 -1
- package/dist/core/config/FormationCfg.d.ts +1 -1
- package/dist/core/config/FuncDescCfg.d.ts +4 -0
- package/dist/core/config/FuncDescCfg.js +4 -0
- package/dist/core/config/GemCfg.d.ts +1 -1
- package/dist/core/config/GuildBossWaveCfg.d.ts +1 -0
- package/dist/core/config/GuildIslandBuildCfg.d.ts +2 -1
- package/dist/core/config/GuildIslandTaskCfg.d.ts +13 -0
- package/dist/core/config/GuildIslandTaskCfg.js +8 -0
- package/dist/core/config/ItemsCfg.d.ts +1 -1
- package/dist/core/config/PetCfg.d.ts +1 -1
- package/dist/core/config/PetConfigCfg.d.ts +7 -0
- package/dist/core/config/PetConfigCfg.js +7 -0
- package/dist/core/config/PetSkillCfg.d.ts +1 -0
- package/dist/core/config/PetSlotLvCfg.d.ts +1 -0
- package/dist/core/config/PrivilegeCfg.d.ts +1 -0
- package/dist/core/config/PrivilegeCfg.js +1 -0
- package/dist/core/config/RankListCfg.d.ts +10 -0
- package/dist/core/config/RankListCfg.js +8 -0
- package/dist/core/config/RelicDungeonConfigCfg.d.ts +0 -1
- package/dist/core/config/RelicDungeonConfigCfg.js +0 -1
- package/dist/core/config/RelicDungeonGrowCfg.d.ts +5 -0
- package/dist/core/config/RobotConfigCfg.d.ts +7 -6
- package/dist/core/config/RuleDescCfg.d.ts +6 -2
- package/dist/core/config/RuleDescCfg.js +9 -5
- package/dist/core/config/SeaArenaConfigCfg.d.ts +2 -1
- package/dist/core/config/SeaArenaConfigCfg.js +1 -0
- package/dist/core/config/SprintActivityConfigCfg.d.ts +12 -0
- package/dist/core/config/SprintActivityConfigCfg.js +12 -0
- package/dist/core/config/SprintActivityRankRewardCfg.d.ts +3 -1
- package/dist/core/config/StageCfg.d.ts +2 -0
- package/dist/core/config/TreasureMatchConfigCfg.d.ts +19 -0
- package/dist/core/config/TreasureMatchConfigCfg.js +16 -0
- package/dist/core/config/TreasureMatchIconCfg.d.ts +12 -0
- package/dist/core/config/TreasureMatchIconCfg.js +8 -0
- package/dist/core/config/TreasureMatchRankRewardCfg.d.ts +10 -0
- package/dist/core/config/TreasureMatchRankRewardCfg.js +8 -0
- package/dist/core/config/VehicleUpgradeAttrCfg.d.ts +10 -0
- package/dist/core/config/VehicleUpgradeAttrCfg.js +8 -0
- package/dist/core/config/VehicleUpgradeConfigCfg.d.ts +16 -0
- package/dist/core/config/VehicleUpgradeConfigCfg.js +13 -0
- package/dist/core/config/VehicleUpgradeLevelCfg.d.ts +13 -0
- package/dist/core/config/VehicleUpgradeLevelCfg.js +8 -0
- package/dist/core/framework/Time.d.ts +1 -0
- package/dist/core/framework/Time.js +1 -0
- package/dist/core/module/arena/ArenaBattleModule.d.ts +3 -0
- package/dist/core/module/arena/ArenaBattleModule.js +14 -2
- package/dist/core/module/battle/Game.d.ts +13 -3
- package/dist/core/module/battle/Game.js +36 -6
- package/dist/core/module/battle/IGameModule.d.ts +1 -0
- package/dist/core/module/battle/IGameModule.js +7 -3
- package/dist/core/module/battle/battle.interface.d.ts +17 -1
- package/dist/core/module/battle/battle.interface.js +3 -0
- package/dist/core/module/battle/buff/buffitem/BossCloneBuff.d.ts +10 -0
- package/dist/core/module/battle/buff/buffitem/BossCloneBuff.js +89 -0
- package/dist/core/module/battle/buff/buffitem/BossPetrifyBuff.d.ts +9 -0
- package/dist/core/module/battle/buff/buffitem/BossPetrifyBuff.js +60 -0
- package/dist/core/module/battle/buff/buffitem/BossReinforcementBuff.d.ts +7 -0
- package/dist/core/module/battle/buff/buffitem/BossReinforcementBuff.js +26 -0
- package/dist/core/module/battle/buff/buffitem/ForceDizzinessBuff.d.ts +6 -0
- package/dist/core/module/battle/buff/buffitem/ForceDizzinessBuff.js +26 -0
- package/dist/core/module/battle/buff/buffitem/ImmuneForceDizziness.d.ts +3 -0
- package/dist/core/module/battle/buff/buffitem/ImmuneForceDizziness.js +18 -0
- package/dist/core/module/battle/buff/buffitem/PosionBuff.js +8 -2
- package/dist/core/module/battle/buff/buffitem/ReplaceSkillBuff.d.ts +1 -1
- package/dist/core/module/battle/buff/buffitem/ReplaceSkillBuff.js +4 -3
- package/dist/core/module/battle/buff/buffitem/SprintBuff.js +40 -17
- package/dist/core/module/battle/buff/buffitem/VenomBurstBuff.d.ts +8 -0
- package/dist/core/module/battle/buff/buffitem/VenomBurstBuff.js +40 -0
- package/dist/core/module/battle/buff/buffitem/index.d.ts +6 -0
- package/dist/core/module/battle/buff/buffitem/index.js +7 -1
- package/dist/core/module/battle/entity/FighterData.js +5 -1
- package/dist/core/module/battle/event/EntityEvent.d.ts +2 -0
- package/dist/core/module/battle/event/EntityEvent.js +2 -0
- package/dist/core/module/battle/factory/FighterFactory.js +17 -5
- package/dist/core/module/battle/fsm-state/Boss38210State.d.ts +11 -0
- package/dist/core/module/battle/fsm-state/Boss38210State.js +30 -0
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.d.ts +2 -1
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.js +4 -2
- package/dist/core/module/battle/fsm-state/TurnState.js +4 -4
- package/dist/core/module/battle/fsm-state/TurnTransitions.js +4 -4
- package/dist/core/module/battle/fsm-state/index.d.ts +1 -0
- package/dist/core/module/battle/fsm-state/index.js +2 -1
- package/dist/core/module/battle/manager/EntityManager.js +7 -3
- package/dist/core/module/battle/skill/emitter/SkillTargetHorRandomEmitter.d.ts +12 -0
- package/dist/core/module/battle/skill/emitter/SkillTargetHorRandomEmitter.js +62 -0
- package/dist/core/module/battle/skill/emitter/index.d.ts +1 -0
- package/dist/core/module/battle/skill/emitter/index.js +2 -1
- package/dist/core/module/battle/skill/impacts/Impact101.js +1 -0
- package/dist/core/module/battle/skill/impacts/Impact3.js +2 -1
- package/dist/core/module/battle/skill/impacts/Impact5.js +5 -1
- package/dist/core/module/battle/system/BornSystem.js +4 -0
- package/dist/core/module/battle/system/BuffSystem.js +9 -3
- package/dist/core/module/battle/system/SkillSystem.js +1 -1
- package/dist/core/module/battle/system/TurnPhaseSystem.js +1 -1
- package/dist/core/module/battle/target/RandomPosSelection.d.ts +4 -0
- package/dist/core/module/battle/target/RandomPosSelection.js +61 -0
- package/dist/core/module/battle/target/index.d.ts +1 -0
- package/dist/core/module/battle/target/index.js +2 -1
- package/dist/core/module/battle/turn/TurnBattleGame.d.ts +11 -3
- package/dist/core/module/battle/turn/TurnBattleGame.js +53 -12
- package/dist/core/module/battle/turn/TurnBattleModule.js +2 -2
- package/dist/core/module/battle/turn/TurnBattleTypes.d.ts +1 -6
- package/dist/core/module/battle/turn/TurnBattleTypes.js +1 -4
- package/dist/core/module/battle/util/BattleConfig.js +2 -2
- package/dist/core/module/battle/util/BattleUtils.d.ts +7 -1
- package/dist/core/module/battle/util/BattleUtils.js +67 -33
- package/dist/core/module/guild/island/battle/GuildIsLandBattleModule.d.ts +11 -0
- package/dist/core/module/guild/island/battle/GuildIsLandBattleModule.js +44 -0
- package/dist/core/module/guild/island/battle/index.d.ts +1 -0
- package/dist/core/module/guild/island/battle/index.js +13 -0
- package/dist/core/module/guild/view/boss/GuildBossBattleModule.js +1 -0
- package/dist/core/module/module.interface.d.ts +24 -0
- package/dist/core/module/module.interface.js +3 -0
- package/dist/core/module/property/Property.d.ts +2 -1
- package/dist/core/module/property/Property.js +8 -7
- package/dist/core/module/property/PropertyUtil.d.ts +17 -0
- package/dist/core/module/property/PropertyUtil.js +75 -1
- package/dist/core/module/relicDungeon/RelicBattleModule.d.ts +18 -0
- package/dist/core/module/relicDungeon/RelicBattleModule.js +148 -5
- package/dist/core/proto/CommonProto.d.ts +8740 -4068
- package/dist/core/proto/Proto.d.ts +129 -39
- package/dist/index.d.ts +47 -4
- package/dist/index.js +69 -12
- package/dist/register-all.d.ts +1 -0
- package/dist/register-all.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./GuildIsLandBattleModule";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// 本文件由 scripts/gen-registry.mjs 自动生成,请勿手动编辑。
|
|
3
|
+
// 改了目录里的文件后跑 `npm run gen` 重新生成(prestart / prebuild 会自动跑)。
|
|
4
|
+
//
|
|
5
|
+
// 作用:@cacheFunction -> bufferCache
|
|
6
|
+
//
|
|
7
|
+
// 这些类靠装饰器往注册表里登记自己,而装饰器只在模块被求值时执行。
|
|
8
|
+
// Cocos 的资源系统会把 assets 下所有脚本加载一遍,所以引擎里天然成立;
|
|
9
|
+
// Node 只执行从入口 import 可达的模块,不引这一下,注册表就是空的。
|
|
10
|
+
//
|
|
11
|
+
// 共 1 个模块。下面的 import 只为副作用,不需要用到导出。
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
require("./GuildIsLandBattleModule");
|
|
@@ -190,6 +190,7 @@ let GuildBossBattleModule = class GuildBossBattleModule extends IGameModule_1.Ga
|
|
|
190
190
|
killHpCount: this.calcBossHpDedStep(),
|
|
191
191
|
addBossBoxCount: this._bossStep,
|
|
192
192
|
curFrame: this.game.gameContext.curFrame,
|
|
193
|
+
battleFrames: BattleInputCodec_1.default.encodeFrames(this.game.getBattleFrames()),
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
196
|
/** 根据已完成阶段、最后阶段循环轮数和当前血量计算累计扣除血条数 */
|
|
@@ -96,6 +96,7 @@ export interface IStageResultData extends StageProto.IC_STAGE_BATTLE_END {
|
|
|
96
96
|
newPass: boolean;
|
|
97
97
|
lastPassStage: number;
|
|
98
98
|
stageType: number;
|
|
99
|
+
fightTimes?: number;
|
|
99
100
|
}
|
|
100
101
|
export interface IRelicResultData extends RelicDungeonProto.IC_RELIC_DUNGEON_END {
|
|
101
102
|
stageId?: number;
|
|
@@ -107,6 +108,8 @@ export interface IRelicResultData extends RelicDungeonProto.IC_RELIC_DUNGEON_END
|
|
|
107
108
|
allWave: number;
|
|
108
109
|
items: ItemProto.IItem[];
|
|
109
110
|
newPass: boolean;
|
|
111
|
+
damage?: number;
|
|
112
|
+
score?: number;
|
|
110
113
|
}
|
|
111
114
|
export interface IGuildBossResultData extends GuildProto.C_GUILD_BOSS_ATTACK_END {
|
|
112
115
|
myFightData: {
|
|
@@ -121,6 +124,22 @@ export interface IGuildBossResultData extends GuildProto.C_GUILD_BOSS_ATTACK_END
|
|
|
121
124
|
damage?: number;
|
|
122
125
|
curFrame?: number;
|
|
123
126
|
}
|
|
127
|
+
/** 组队Boss结算数据(无proto,字段对照IGuildBossResultData,待teamBoss协议出表后对齐) */
|
|
128
|
+
export interface ITeamBossResultData {
|
|
129
|
+
stageId: number;
|
|
130
|
+
myFightData: {
|
|
131
|
+
[key: number]: IFightData;
|
|
132
|
+
};
|
|
133
|
+
gameTime: number;
|
|
134
|
+
bossStep: number;
|
|
135
|
+
items: ItemProto.IItem[];
|
|
136
|
+
battleFrames: BattleProto.IBattleFrameData[];
|
|
137
|
+
codexInfo: CodexProto.IBattleCodexInfo;
|
|
138
|
+
damage: number;
|
|
139
|
+
killHpCount: number;
|
|
140
|
+
addBossBoxCount: number;
|
|
141
|
+
curFrame: number;
|
|
142
|
+
}
|
|
124
143
|
export interface IBattleSnapShotInfo {
|
|
125
144
|
mode: string;
|
|
126
145
|
snapShotInfo: object;
|
|
@@ -133,3 +152,8 @@ export interface IDailyTrialResultData extends StageProto.IC_STAGE_BATTLE_END {
|
|
|
133
152
|
gameTime: number;
|
|
134
153
|
items: ItemProto.IItem[];
|
|
135
154
|
}
|
|
155
|
+
export interface IGuildIsLandResultData {
|
|
156
|
+
buildingId: number;
|
|
157
|
+
rewards: ItemProto.IItem[];
|
|
158
|
+
battleData: GuildIslandProto.IGuildIslandBattleData;
|
|
159
|
+
}
|
|
@@ -6,6 +6,9 @@ exports.PopUpParam = {
|
|
|
6
6
|
FirstRecharge: { route: "ui/shop/FirstRechargeView", priority: 2, interface: 2, noCfgFlag: true }, //首充礼包
|
|
7
7
|
TurretUnlock: { route: "ui/turret/TurretUnlockView", priority: 3, interface: 2, noCfgFlag: true }, //炮塔解锁
|
|
8
8
|
ChainGift: { route: "ui/activity/chainGift/ChainGiftView", priority: 2, interface: 2, noCfgFlag: true }, //连锁礼包
|
|
9
|
+
GuildIsLandStart: { route: "ui/guild/island/GuildIslandStartView", priority: 3, interface: 2, noCfgFlag: true }, //开始赛程
|
|
10
|
+
GuildIsLandEnd: { route: "ui/guild/island/GuildIslandEndView", priority: 3, interface: 2, noCfgFlag: true }, //结束赛程
|
|
11
|
+
GuildIsLandMerge: { route: "ui/guild/island/GuildIslandMergeView", priority: 3, interface: 2, noCfgFlag: true }, //战区合并
|
|
9
12
|
};
|
|
10
13
|
/**
|
|
11
14
|
* 广告场景
|
|
@@ -18,6 +18,7 @@ var SystemProperty;
|
|
|
18
18
|
SystemProperty[SystemProperty["Decoration"] = 1 << offset++] = "Decoration";
|
|
19
19
|
SystemProperty[SystemProperty["VehicleWash"] = 1 << offset++] = "VehicleWash";
|
|
20
20
|
SystemProperty[SystemProperty["Pet"] = 1 << offset++] = "Pet";
|
|
21
|
+
SystemProperty[SystemProperty["TurretMod"] = 1 << offset++] = "TurretMod";
|
|
21
22
|
})(SystemProperty || (exports.SystemProperty = SystemProperty = {}));
|
|
22
23
|
exports.PROPERTY_SCALE = 10000; //属性万分比
|
|
23
24
|
exports.ATTACK_SHAKE_TIME_SCALE = 9999; //攻击前摇时间万分比
|
|
@@ -235,7 +236,7 @@ class PropertyHelper {
|
|
|
235
236
|
/** 展示属性预览值 */
|
|
236
237
|
static showPreview(attr) {
|
|
237
238
|
let cfg = Cfg_1.Cfg.ProDefine.get(attr[0]);
|
|
238
|
-
let val = cfg.ratioType == 1 ? `${attr[1] / 100}
|
|
239
|
+
let val = cfg.ratioType == 1 ? `${attr[1] / 100}%` : `${attr[1]}`;
|
|
239
240
|
return { name: cfg.proName.translate(), val, icon: cfg.attrIcon };
|
|
240
241
|
}
|
|
241
242
|
/** 回合出手速度 */
|
|
@@ -244,27 +245,27 @@ class PropertyHelper {
|
|
|
244
245
|
}
|
|
245
246
|
/** 回合制连击概率 */
|
|
246
247
|
static turnComboRatio(out) {
|
|
247
|
-
return out[50100] + out[50102];
|
|
248
|
+
return out[50100] + out[50102] + out[51800];
|
|
248
249
|
}
|
|
249
250
|
/** 回合制反击概率 */
|
|
250
251
|
static turnCounterRatio(out) {
|
|
251
|
-
return out[50200] + out[50201];
|
|
252
|
+
return out[50200] + out[50201] + out[51800];
|
|
252
253
|
}
|
|
253
254
|
/** 回合制 击晕概率 */
|
|
254
255
|
static turnStunRatio(out) {
|
|
255
|
-
return out[50200] + out[50201];
|
|
256
|
+
return out[50200] + out[50201] + out[51800];
|
|
256
257
|
}
|
|
257
258
|
/** 回合制 闪避概率 */
|
|
258
259
|
static turnMissRatio(out) {
|
|
259
|
-
return out[50400] + out[50401];
|
|
260
|
+
return out[50400] + out[50401] + out[51800];
|
|
260
261
|
}
|
|
261
262
|
/** 回合制 破甲概率 */
|
|
262
263
|
static turnCritRatio(out) {
|
|
263
|
-
return out[50500] + out[50501];
|
|
264
|
+
return out[50500] + out[50501] + out[51800];
|
|
264
265
|
}
|
|
265
266
|
/** 回合制护盾恢复 */
|
|
266
267
|
static turnShieldHeal(out) {
|
|
267
|
-
return out[50600] + out[50601];
|
|
268
|
+
return out[50600] + out[50601] + out[51800];
|
|
268
269
|
}
|
|
269
270
|
/** 展示属性对比预览值 */
|
|
270
271
|
static showContrastPreview(oldVal, newVal) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RoleCfg } from "../../config/RoleCfg";
|
|
2
2
|
import { IProperty, SystemProperty } from "./Property";
|
|
3
3
|
export interface LocalFight {
|
|
4
|
+
turretMods: TurretModProto.ITurretMod[];
|
|
4
5
|
roleId?: number;
|
|
5
6
|
level?: number;
|
|
6
7
|
equipPartMap?: {
|
|
@@ -73,4 +74,20 @@ export default class PropertyUtil {
|
|
|
73
74
|
}, petSlots: {
|
|
74
75
|
[key: number]: PetProto.ISlot;
|
|
75
76
|
}, out: IProperty): void;
|
|
77
|
+
private static attrQualitys;
|
|
78
|
+
/** 炮塔改造件系统属性投放 */
|
|
79
|
+
private static getAllTurretModProperty;
|
|
80
|
+
/**获取实际属性值
|
|
81
|
+
* return [属性id 属性值 品阶 等级]
|
|
82
|
+
*/
|
|
83
|
+
static getTurretModAttrs(attrId: number, lv: number): number[];
|
|
84
|
+
/** 获取主属性值 */
|
|
85
|
+
static getTurretModMainAttr(configId: number, fusionLevel: number): number[];
|
|
86
|
+
/**
|
|
87
|
+
* 数组分块
|
|
88
|
+
* @param arr 数组
|
|
89
|
+
* @param size 每个子数组的大小
|
|
90
|
+
* @returns 分块后的数组
|
|
91
|
+
*/
|
|
92
|
+
static chunkArray<T>(arr: T[], size: number): T[][];
|
|
76
93
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Cfg_1 = require("../../config/Cfg");
|
|
4
|
+
const TurretModConfigCfg_1 = require("../../config/TurretModConfigCfg");
|
|
4
5
|
const Property_1 = require("./Property");
|
|
5
6
|
const mainRoleId = 200000;
|
|
6
7
|
const DefaultWeapon = 810000;
|
|
7
8
|
class PropertyUtil {
|
|
8
|
-
static roleSystem = [Property_1.SystemProperty.Base, Property_1.SystemProperty.Equip, Property_1.SystemProperty.Talent, Property_1.SystemProperty.Talent_Tree, Property_1.SystemProperty.Turret, Property_1.SystemProperty.Relic, Property_1.SystemProperty.Gem, Property_1.SystemProperty.Skin, Property_1.SystemProperty.Decoration, Property_1.SystemProperty.VehicleWash, Property_1.SystemProperty.Pet];
|
|
9
|
+
static roleSystem = [Property_1.SystemProperty.Base, Property_1.SystemProperty.Equip, Property_1.SystemProperty.Talent, Property_1.SystemProperty.Talent_Tree, Property_1.SystemProperty.Turret, Property_1.SystemProperty.Relic, Property_1.SystemProperty.Gem, Property_1.SystemProperty.Skin, Property_1.SystemProperty.Decoration, Property_1.SystemProperty.VehicleWash, Property_1.SystemProperty.Pet, Property_1.SystemProperty.TurretMod];
|
|
9
10
|
static towerSystem = [Property_1.SystemProperty.Base, Property_1.SystemProperty.Level];
|
|
10
11
|
static reset() {
|
|
11
12
|
}
|
|
@@ -16,9 +17,20 @@ class PropertyUtil {
|
|
|
16
17
|
talents: [],
|
|
17
18
|
talent_tree: {},
|
|
18
19
|
gems: [],
|
|
20
|
+
turretMods: [],
|
|
19
21
|
};
|
|
20
22
|
static getFightPropertyByBattlePlayer(roleId, playerData, out, needNormal = true, isPvp = false) {
|
|
21
23
|
out = out || Property_1.PropertyHelper.createProperty();
|
|
24
|
+
if (playerData.isRobot) {
|
|
25
|
+
let robotConfig = Cfg_1.Cfg.RobotConfig.get(playerData.robotId);
|
|
26
|
+
if (robotConfig) {
|
|
27
|
+
Property_1.PropertyHelper.addPropertyByArray(out, robotConfig.attrGroupId);
|
|
28
|
+
}
|
|
29
|
+
if (needNormal) {
|
|
30
|
+
Property_1.PropertyHelper.normalize(out, isPvp);
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
22
34
|
let roleCfg = Cfg_1.Cfg.Role.get(roleId);
|
|
23
35
|
let tempFight = this.tempFight;
|
|
24
36
|
tempFight.roleId = roleId;
|
|
@@ -116,6 +128,9 @@ class PropertyUtil {
|
|
|
116
128
|
case Property_1.SystemProperty.Pet:
|
|
117
129
|
this.getAllPetProperty(fight.pets, fight.petSlots, out);
|
|
118
130
|
break;
|
|
131
|
+
case Property_1.SystemProperty.TurretMod:
|
|
132
|
+
this.getAllTurretModProperty(fight.turretMods, out);
|
|
133
|
+
break;
|
|
119
134
|
}
|
|
120
135
|
}
|
|
121
136
|
static getEquipProperty(equipId, part) {
|
|
@@ -340,5 +355,64 @@ class PropertyUtil {
|
|
|
340
355
|
}
|
|
341
356
|
}
|
|
342
357
|
}
|
|
358
|
+
static attrQualitys;
|
|
359
|
+
/** 炮塔改造件系统属性投放 */
|
|
360
|
+
static getAllTurretModProperty(turretMods, out) {
|
|
361
|
+
if (!turretMods)
|
|
362
|
+
return;
|
|
363
|
+
turretMods.forEach(item => {
|
|
364
|
+
if (!item?.id)
|
|
365
|
+
return;
|
|
366
|
+
let modCfg = Cfg_1.Cfg.TurretMod.get(item.configId);
|
|
367
|
+
let fusionLevel = 0;
|
|
368
|
+
/**随机属性 */
|
|
369
|
+
item.attrInfos.forEach(item => {
|
|
370
|
+
let res = this.getTurretModAttrs(item.id, item.curLevel);
|
|
371
|
+
Property_1.PropertyHelper.addPropertyByKeyValue(out, res[0], res[1]);
|
|
372
|
+
fusionLevel += (item.curLevel - 1);
|
|
373
|
+
});
|
|
374
|
+
/**融合属性 */
|
|
375
|
+
let fusionCfg = Cfg_1.Cfg.TurretFusionLevel.findBy(i => i.fusionGroupId == modCfg.fusionGroupId && (i.fusionLevel - fusionLevel) >= 0);
|
|
376
|
+
Property_1.PropertyHelper.addPropertyByArray(out, fusionCfg.attrs);
|
|
377
|
+
/**主属性 */
|
|
378
|
+
Property_1.PropertyHelper.addPropertyByArray(out, [this.getTurretModMainAttr(item.configId, fusionLevel)]);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**获取实际属性值
|
|
382
|
+
* return [属性id 属性值 品阶 等级]
|
|
383
|
+
*/
|
|
384
|
+
static getTurretModAttrs(attrId, lv) {
|
|
385
|
+
PropertyUtil.attrQualitys ||= this.chunkArray(Cfg_1.Cfg.TurretModConfig.get(TurretModConfigCfg_1.TurretModConfigDefine.affix_quality_range).value2, 3);
|
|
386
|
+
let cfg = Cfg_1.Cfg.TurretModAffixLv.find({ attrId });
|
|
387
|
+
let quality = PropertyUtil.attrQualitys.find(i => lv >= i[1] && lv <= i[2])[0];
|
|
388
|
+
let val = cfg.baseAttr.find(i => i[0] == quality)[1] + (lv - 1) * cfg.growthValue;
|
|
389
|
+
return [attrId, val, quality, lv];
|
|
390
|
+
}
|
|
391
|
+
/** 获取主属性值 */
|
|
392
|
+
static getTurretModMainAttr(configId, fusionLevel) {
|
|
393
|
+
let modCfg = Cfg_1.Cfg.TurretMod.get(configId);
|
|
394
|
+
let itemsCfg = Cfg_1.Cfg.Items.get(modCfg.itemId);
|
|
395
|
+
let mainAttrVal = modCfg.baseMainAttr.find(i => i[0] == itemsCfg.quality)[1] + modCfg.mainAttrGrowth * fusionLevel;
|
|
396
|
+
return [modCfg.mainAttrId, mainAttrVal];
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* 数组分块
|
|
400
|
+
* @param arr 数组
|
|
401
|
+
* @param size 每个子数组的大小
|
|
402
|
+
* @returns 分块后的数组
|
|
403
|
+
*/
|
|
404
|
+
static chunkArray(arr, size) {
|
|
405
|
+
return arr.reduce((result, item, index) => {
|
|
406
|
+
// 计算当前元素应该属于哪个子数组的索引
|
|
407
|
+
const chunkIndex = Math.floor(index / size);
|
|
408
|
+
// 如果该子数组还不存在,则初始化一个空数组
|
|
409
|
+
if (!result[chunkIndex]) {
|
|
410
|
+
result[chunkIndex] = [];
|
|
411
|
+
}
|
|
412
|
+
// 将当前元素推入对应的子数组
|
|
413
|
+
result[chunkIndex].push(item);
|
|
414
|
+
return result;
|
|
415
|
+
}, []);
|
|
416
|
+
}
|
|
343
417
|
}
|
|
344
418
|
exports.default = PropertyUtil;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
+
import { IFighterInfo } from "../battle/battle.interface";
|
|
1
2
|
import type FighterData from "../battle/entity/FighterData";
|
|
2
3
|
import { GameModule } from "../battle/IGameModule";
|
|
3
4
|
export default class RelicBattleModule extends GameModule {
|
|
5
|
+
private _countDown;
|
|
6
|
+
get CountTime(): number;
|
|
4
7
|
private _damage;
|
|
5
8
|
get damage(): number;
|
|
9
|
+
private _boss;
|
|
10
|
+
private _popupSkillSelectInfo;
|
|
11
|
+
private _scoreSegments;
|
|
12
|
+
private getScoreSegments;
|
|
13
|
+
private _relicDungeonGrow;
|
|
14
|
+
/** 上一档已生效的属性加成,用于切换档位时撤销(覆盖而非叠加) */
|
|
15
|
+
private _bossGrowAtr;
|
|
16
|
+
changeListener(enable: boolean): void;
|
|
6
17
|
init(): void;
|
|
7
18
|
getMode(): number;
|
|
8
19
|
gameStart(): void;
|
|
9
20
|
gameWin(): void;
|
|
10
21
|
gameFail(isCross?: boolean): void;
|
|
11
22
|
gameFinish(isWin: boolean, isCross?: boolean): void;
|
|
23
|
+
setFighterPosition(fighter: FighterData, data: IFighterInfo): void;
|
|
24
|
+
bossCome(fighter: FighterData): void;
|
|
25
|
+
private bossInNextLevel;
|
|
12
26
|
onUpdateWaveInfo(curWave: number, allWave: number): void;
|
|
13
27
|
reportStageInfo(): void;
|
|
28
|
+
onUpdate(dt: number): void;
|
|
29
|
+
popupSkillSelectInfo(): void;
|
|
14
30
|
onHurt(attackId: number, hurt: number, defender: FighterData): void;
|
|
31
|
+
checkEnemyGrowCurve(fighter: FighterData): void;
|
|
32
|
+
checkBossGrowCurve(): void;
|
|
15
33
|
getScore(damage: number): number;
|
|
16
34
|
}
|
|
@@ -10,23 +10,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const Cfg_1 = require("../../config/Cfg");
|
|
13
|
-
const ConstConfigCfg_1 = require("../../config/ConstConfigCfg");
|
|
14
13
|
const RelicDungeonConfigCfg_1 = require("../../config/RelicDungeonConfigCfg");
|
|
15
14
|
const Notifier_1 = require("../../framework/notify/Notifier");
|
|
16
15
|
const ListenID_1 = require("../../ListenID");
|
|
17
16
|
const battle_interface_1 = require("../battle/battle.interface");
|
|
18
17
|
const Collider_1 = require("../battle/collider/Collider");
|
|
19
18
|
const ColliderPool_1 = require("../battle/collider/ColliderPool");
|
|
19
|
+
const EntityEvent_1 = require("../battle/event/EntityEvent");
|
|
20
|
+
const GameEvent_1 = require("../battle/event/GameEvent");
|
|
20
21
|
const IGameModule_1 = require("../battle/IGameModule");
|
|
21
22
|
const BattleInputCodec_1 = __importDefault(require("../battle/util/BattleInputCodec"));
|
|
22
23
|
const BattleUtils_1 = require("../battle/util/BattleUtils");
|
|
24
|
+
const Property_1 = require("../property/Property");
|
|
23
25
|
let RelicBattleModule = class RelicBattleModule extends IGameModule_1.GameModule {
|
|
26
|
+
_countDown = 0;
|
|
27
|
+
get CountTime() { return this._countDown; }
|
|
24
28
|
_damage = 0;
|
|
25
29
|
get damage() { return this._damage; }
|
|
30
|
+
_boss;
|
|
31
|
+
_popupSkillSelectInfo;
|
|
32
|
+
_scoreSegments = null;
|
|
33
|
+
getScoreSegments() {
|
|
34
|
+
if (!this._scoreSegments)
|
|
35
|
+
this._scoreSegments = Cfg_1.Cfg.RelicDungeonScore.getArray().sort((a, b) => a.dmgMin - b.dmgMin);
|
|
36
|
+
return this._scoreSegments;
|
|
37
|
+
}
|
|
38
|
+
//npc属性成长
|
|
39
|
+
_relicDungeonGrow = null;
|
|
40
|
+
/** 上一档已生效的属性加成,用于切换档位时撤销(覆盖而非叠加) */
|
|
41
|
+
_bossGrowAtr = null;
|
|
42
|
+
changeListener(enable) {
|
|
43
|
+
super.changeListener(enable);
|
|
44
|
+
(0, Notifier_1.bindListenEvents)(this, enable);
|
|
45
|
+
}
|
|
26
46
|
init() {
|
|
27
|
-
this.moduleState.reliveTime = Cfg_1.Cfg.ConstConfig.get(ConstConfigCfg_1.ConstConfigDefine.stage_relive_count)?.value;
|
|
28
47
|
this.myPosIndexs = [[0, -200], [-93, -125 - 24], [93, -125 - 24], [-93, -275 - 24], [93, -275 - 24]];
|
|
29
48
|
this.game.rolePosType = 1;
|
|
49
|
+
this._countDown = Cfg_1.Cfg.RelicDungeonConfig.get(RelicDungeonConfigCfg_1.RelicDungeonConfigDefine.boss_fight_time).value;
|
|
50
|
+
this.finishTime = this._countDown;
|
|
51
|
+
this._popupSkillSelectInfo = [];
|
|
52
|
+
this._popupSkillSelectInfo.push(...Cfg_1.Cfg.RelicDungeonConfig.get(RelicDungeonConfigCfg_1.RelicDungeonConfigDefine.lv_tiem).value2);
|
|
53
|
+
this._relicDungeonGrow = new Map;
|
|
54
|
+
Cfg_1.Cfg.RelicDungeonGrow.forEach(item => {
|
|
55
|
+
let cfgs = this._relicDungeonGrow.get(item.objectType);
|
|
56
|
+
if (!cfgs) {
|
|
57
|
+
cfgs = [];
|
|
58
|
+
this._relicDungeonGrow.set(item.objectType, cfgs);
|
|
59
|
+
}
|
|
60
|
+
cfgs.push(item);
|
|
61
|
+
});
|
|
30
62
|
}
|
|
31
63
|
getMode() {
|
|
32
64
|
return 1;
|
|
@@ -46,6 +78,7 @@ let RelicBattleModule = class RelicBattleModule extends IGameModule_1.GameModule
|
|
|
46
78
|
shape.offset.y = centerPoint[1];
|
|
47
79
|
mainRole.shape = shape;
|
|
48
80
|
shape.group = Collider_1.ColliderMask.My;
|
|
81
|
+
shape.isActive = true;
|
|
49
82
|
mainRole.isDirty |= 1 /* LocalDirtyFlag.POSITION */;
|
|
50
83
|
this._damage = 0;
|
|
51
84
|
// const levelCfg = Cfg.RelicDungeonLevel.get(this.stageId);
|
|
@@ -79,11 +112,44 @@ let RelicBattleModule = class RelicBattleModule extends IGameModule_1.GameModule
|
|
|
79
112
|
curWave: this.curWave,
|
|
80
113
|
allWave: this.allWave,
|
|
81
114
|
items: [],
|
|
82
|
-
battleFrames:
|
|
115
|
+
battleFrames: BattleInputCodec_1.default.encodeFrames(this.game.getBattleFrames()) || [],
|
|
83
116
|
codexInfo: this.codeInfo,
|
|
84
117
|
newPass: false,
|
|
118
|
+
endFrame: this.game.gameContext.curFrame,
|
|
119
|
+
damage: this._damage,
|
|
120
|
+
score: this.getScore(this._damage),
|
|
85
121
|
});
|
|
86
122
|
}
|
|
123
|
+
setFighterPosition(fighter, data) {
|
|
124
|
+
super.setFighterPosition(fighter, data);
|
|
125
|
+
if (fighter.campType === battle_interface_1.CampType.ENEMY && fighter.isBoss !== 1) {
|
|
126
|
+
this.checkEnemyGrowCurve(fighter);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
bossCome(fighter) {
|
|
130
|
+
this._boss = fighter;
|
|
131
|
+
this.game.on(fighter.ID, EntityEvent_1.EntityEvent.BeforeDead, this.bossInNextLevel, this);
|
|
132
|
+
}
|
|
133
|
+
bossInNextLevel(fighter, hitData, overflowHp) {
|
|
134
|
+
if (hitData) {
|
|
135
|
+
hitData.hurt -= this._boss.curHp;
|
|
136
|
+
}
|
|
137
|
+
this._boss.curHp = Property_1.PropertyHelper.hp(this._boss.property);
|
|
138
|
+
const hp = overflowHp || 0;
|
|
139
|
+
if (this._boss.curHp <= hp) {
|
|
140
|
+
this.bossInNextLevel(fighter, hitData, hp - this._boss.curHp);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this._boss.curHp -= (hp || 0);
|
|
144
|
+
if (hitData) {
|
|
145
|
+
hitData.hurt -= hp;
|
|
146
|
+
}
|
|
147
|
+
const skillId = 20217;
|
|
148
|
+
if (Cfg_1.Cfg.Skill.get(skillId)) {
|
|
149
|
+
this._boss.game.emit(GameEvent_1.GameEvent.LearnSkill, this._boss, skillId, false);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
87
153
|
onUpdateWaveInfo(curWave, allWave) {
|
|
88
154
|
super.onUpdateWaveInfo(curWave, allWave);
|
|
89
155
|
this.reportStageInfo();
|
|
@@ -99,11 +165,32 @@ let RelicBattleModule = class RelicBattleModule extends IGameModule_1.GameModule
|
|
|
99
165
|
isPassStage: false,
|
|
100
166
|
myFightData: this.game.getMyFightDataMap(),
|
|
101
167
|
gameTime: Math.ceil(this.game.getBattleTime()),
|
|
168
|
+
damage: this._damage,
|
|
169
|
+
score: this.getScore(this._damage),
|
|
102
170
|
curWave: this.curWave,
|
|
103
171
|
allWave: this.allWave,
|
|
104
172
|
codexInfo: this.codeInfo,
|
|
173
|
+
endFrame: this.game.gameContext.curFrame,
|
|
105
174
|
});
|
|
106
175
|
}
|
|
176
|
+
onUpdate(dt) {
|
|
177
|
+
super.onUpdate(dt);
|
|
178
|
+
if (this._countDown - this.game.gameContext.now <= 0) {
|
|
179
|
+
this.game.setGameFail();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
this.popupSkillSelectInfo();
|
|
183
|
+
}
|
|
184
|
+
popupSkillSelectInfo() {
|
|
185
|
+
if (this.game.onlyLogic || this._popupSkillSelectInfo.length === 0) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
let time = this._popupSkillSelectInfo[0];
|
|
189
|
+
if (!time || this.game.gameContext.now >= time) {
|
|
190
|
+
this.pushLevelUpSelectSkill(1);
|
|
191
|
+
this._popupSkillSelectInfo.shift();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
107
194
|
onHurt(attackId, hurt, defender) {
|
|
108
195
|
super.onHurt(attackId, hurt, defender);
|
|
109
196
|
if (defender.campType !== battle_interface_1.CampType.ENEMY)
|
|
@@ -111,13 +198,69 @@ let RelicBattleModule = class RelicBattleModule extends IGameModule_1.GameModule
|
|
|
111
198
|
this._damage += hurt;
|
|
112
199
|
const score = this.getScore(this._damage);
|
|
113
200
|
Notifier_1.Notifier.send(ListenID_1.ListenID.RelicDungeon_UpdateTotalDmg, this._damage, score);
|
|
201
|
+
this.checkBossGrowCurve();
|
|
202
|
+
}
|
|
203
|
+
//敌人成长曲线
|
|
204
|
+
checkEnemyGrowCurve(fighter) {
|
|
205
|
+
const cfgs = this._relicDungeonGrow.get(1);
|
|
206
|
+
if (cfgs && cfgs.length) {
|
|
207
|
+
let curAtr = null;
|
|
208
|
+
for (let i = 0; i < cfgs.length; i++) {
|
|
209
|
+
if (cfgs[i].triggerValue <= this._damage)
|
|
210
|
+
curAtr = cfgs[i].atr || null;
|
|
211
|
+
else
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
if (curAtr)
|
|
215
|
+
Property_1.PropertyHelper.addPropertyByArray(fighter.property, curAtr);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//BOSS成长曲线
|
|
219
|
+
checkBossGrowCurve() {
|
|
220
|
+
if (this._boss) {
|
|
221
|
+
const bossAtrCfgs = this._relicDungeonGrow.get(2);
|
|
222
|
+
if (!bossAtrCfgs || !bossAtrCfgs.length)
|
|
223
|
+
return;
|
|
224
|
+
let curAtr = null;
|
|
225
|
+
while (bossAtrCfgs.length && bossAtrCfgs[0].triggerValue <= this._damage) {
|
|
226
|
+
curAtr = bossAtrCfgs[0].atr;
|
|
227
|
+
bossAtrCfgs.shift();
|
|
228
|
+
}
|
|
229
|
+
if (curAtr === null || curAtr === this._bossGrowAtr)
|
|
230
|
+
return;
|
|
231
|
+
const prop = this._boss.property;
|
|
232
|
+
if (this._bossGrowAtr) {
|
|
233
|
+
for (let i = 0; i < this._bossGrowAtr.length; i++) {
|
|
234
|
+
Property_1.PropertyHelper.addPropertyByKeyValue(prop, this._bossGrowAtr[i][0], -this._bossGrowAtr[i][1]);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
this._bossGrowAtr = curAtr;
|
|
238
|
+
if (curAtr)
|
|
239
|
+
Property_1.PropertyHelper.addPropertyByArray(prop, curAtr);
|
|
240
|
+
}
|
|
114
241
|
}
|
|
115
242
|
//伤害转积分
|
|
116
243
|
getScore(damage) {
|
|
117
|
-
const
|
|
118
|
-
|
|
244
|
+
const segments = this.getScoreSegments();
|
|
245
|
+
if (!segments.length)
|
|
246
|
+
return 0;
|
|
247
|
+
const last = segments[segments.length - 1];
|
|
248
|
+
const wan = Math.min(Math.max(damage, 0) / 10000, last.dmgMax);
|
|
249
|
+
if (wan <= 0)
|
|
250
|
+
return 0;
|
|
251
|
+
let score = 0;
|
|
252
|
+
for (let i = 0; i < segments.length; i++) {
|
|
253
|
+
const cfg = segments[i];
|
|
254
|
+
if (wan <= cfg.dmgMin)
|
|
255
|
+
break;
|
|
256
|
+
score += (Math.min(wan, cfg.dmgMax) - cfg.dmgMin) * cfg.coef;
|
|
257
|
+
}
|
|
258
|
+
return Math.floor(score);
|
|
119
259
|
}
|
|
120
260
|
};
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, Notifier_1.ListenEventListener)(ListenID_1.ListenID.Battle_BossCome)
|
|
263
|
+
], RelicBattleModule.prototype, "bossCome", null);
|
|
121
264
|
RelicBattleModule = __decorate([
|
|
122
265
|
(0, BattleUtils_1.cacheFunction)("RelicBattleModule")
|
|
123
266
|
], RelicBattleModule);
|