captainbattle 1.0.8 → 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.
Files changed (149) hide show
  1. package/dist/core/CallID.d.ts +21 -13
  2. package/dist/core/CallID.js +23 -13
  3. package/dist/core/ListenID.d.ts +551 -501
  4. package/dist/core/ListenID.js +552 -501
  5. package/dist/core/config/BadgeCfg.d.ts +18 -4
  6. package/dist/core/config/BadgeCfg.js +20 -6
  7. package/dist/core/config/BattlePassCfg.d.ts +1 -1
  8. package/dist/core/config/BuffCfg.d.ts +7 -1
  9. package/dist/core/config/BuffCfg.js +6 -0
  10. package/dist/core/config/Cfg.d.ts +36 -4
  11. package/dist/core/config/Cfg.js +46 -6
  12. package/dist/core/config/ChatLogCfg.d.ts +18 -0
  13. package/dist/core/config/ChatLogCfg.js +17 -0
  14. package/dist/core/config/Const.d.ts +2 -1
  15. package/dist/core/config/Const.js +1 -0
  16. package/dist/core/config/ConstConfigCfg.d.ts +2 -0
  17. package/dist/core/config/ConstConfigCfg.js +2 -0
  18. package/dist/core/config/DragonPathCfg.d.ts +1 -1
  19. package/dist/core/config/EmailCfg.d.ts +5 -3
  20. package/dist/core/config/EmailCfg.js +7 -5
  21. package/dist/core/config/EndlessConfigCfg.d.ts +1 -0
  22. package/dist/core/config/EndlessConfigCfg.js +1 -0
  23. package/dist/core/config/EnemyGridCfg.d.ts +1 -1
  24. package/dist/core/config/FormationCfg.d.ts +1 -1
  25. package/dist/core/config/FuncDescCfg.d.ts +4 -0
  26. package/dist/core/config/FuncDescCfg.js +4 -0
  27. package/dist/core/config/GemCfg.d.ts +1 -1
  28. package/dist/core/config/GuildBossWaveCfg.d.ts +1 -0
  29. package/dist/core/config/GuildIslandBuildCfg.d.ts +2 -1
  30. package/dist/core/config/GuildIslandTaskCfg.d.ts +13 -0
  31. package/dist/core/config/GuildIslandTaskCfg.js +8 -0
  32. package/dist/core/config/ItemsCfg.d.ts +1 -1
  33. package/dist/core/config/PetCfg.d.ts +1 -1
  34. package/dist/core/config/PetConfigCfg.d.ts +7 -0
  35. package/dist/core/config/PetConfigCfg.js +7 -0
  36. package/dist/core/config/PetSkillCfg.d.ts +1 -0
  37. package/dist/core/config/PetSlotLvCfg.d.ts +1 -0
  38. package/dist/core/config/PrivilegeCfg.d.ts +1 -0
  39. package/dist/core/config/PrivilegeCfg.js +1 -0
  40. package/dist/core/config/RankListCfg.d.ts +10 -0
  41. package/dist/core/config/RankListCfg.js +8 -0
  42. package/dist/core/config/RelicDungeonConfigCfg.d.ts +0 -1
  43. package/dist/core/config/RelicDungeonConfigCfg.js +0 -1
  44. package/dist/core/config/RelicDungeonGrowCfg.d.ts +5 -0
  45. package/dist/core/config/RobotConfigCfg.d.ts +7 -6
  46. package/dist/core/config/RuleDescCfg.d.ts +6 -2
  47. package/dist/core/config/RuleDescCfg.js +9 -5
  48. package/dist/core/config/SeaArenaConfigCfg.d.ts +2 -1
  49. package/dist/core/config/SeaArenaConfigCfg.js +1 -0
  50. package/dist/core/config/SprintActivityConfigCfg.d.ts +12 -0
  51. package/dist/core/config/SprintActivityConfigCfg.js +12 -0
  52. package/dist/core/config/SprintActivityRankRewardCfg.d.ts +3 -1
  53. package/dist/core/config/StageCfg.d.ts +2 -0
  54. package/dist/core/config/TreasureMatchConfigCfg.d.ts +19 -0
  55. package/dist/core/config/TreasureMatchConfigCfg.js +16 -0
  56. package/dist/core/config/TreasureMatchIconCfg.d.ts +12 -0
  57. package/dist/core/config/TreasureMatchIconCfg.js +8 -0
  58. package/dist/core/config/TreasureMatchRankRewardCfg.d.ts +10 -0
  59. package/dist/core/config/TreasureMatchRankRewardCfg.js +8 -0
  60. package/dist/core/config/VehicleUpgradeAttrCfg.d.ts +10 -0
  61. package/dist/core/config/VehicleUpgradeAttrCfg.js +8 -0
  62. package/dist/core/config/VehicleUpgradeConfigCfg.d.ts +16 -0
  63. package/dist/core/config/VehicleUpgradeConfigCfg.js +13 -0
  64. package/dist/core/config/VehicleUpgradeLevelCfg.d.ts +13 -0
  65. package/dist/core/config/VehicleUpgradeLevelCfg.js +8 -0
  66. package/dist/core/framework/Time.d.ts +1 -0
  67. package/dist/core/framework/Time.js +1 -0
  68. package/dist/core/module/arena/ArenaBattleModule.d.ts +3 -0
  69. package/dist/core/module/arena/ArenaBattleModule.js +14 -2
  70. package/dist/core/module/battle/Game.d.ts +13 -3
  71. package/dist/core/module/battle/Game.js +36 -6
  72. package/dist/core/module/battle/IGameModule.d.ts +1 -0
  73. package/dist/core/module/battle/IGameModule.js +7 -3
  74. package/dist/core/module/battle/battle.interface.d.ts +17 -1
  75. package/dist/core/module/battle/battle.interface.js +3 -0
  76. package/dist/core/module/battle/buff/buffitem/BossCloneBuff.d.ts +10 -0
  77. package/dist/core/module/battle/buff/buffitem/BossCloneBuff.js +89 -0
  78. package/dist/core/module/battle/buff/buffitem/BossPetrifyBuff.d.ts +9 -0
  79. package/dist/core/module/battle/buff/buffitem/BossPetrifyBuff.js +60 -0
  80. package/dist/core/module/battle/buff/buffitem/BossReinforcementBuff.d.ts +7 -0
  81. package/dist/core/module/battle/buff/buffitem/BossReinforcementBuff.js +26 -0
  82. package/dist/core/module/battle/buff/buffitem/ForceDizzinessBuff.d.ts +6 -0
  83. package/dist/core/module/battle/buff/buffitem/ForceDizzinessBuff.js +26 -0
  84. package/dist/core/module/battle/buff/buffitem/ImmuneForceDizziness.d.ts +3 -0
  85. package/dist/core/module/battle/buff/buffitem/ImmuneForceDizziness.js +18 -0
  86. package/dist/core/module/battle/buff/buffitem/PosionBuff.js +8 -2
  87. package/dist/core/module/battle/buff/buffitem/ReplaceSkillBuff.d.ts +1 -1
  88. package/dist/core/module/battle/buff/buffitem/ReplaceSkillBuff.js +4 -3
  89. package/dist/core/module/battle/buff/buffitem/SprintBuff.js +40 -17
  90. package/dist/core/module/battle/buff/buffitem/VenomBurstBuff.d.ts +8 -0
  91. package/dist/core/module/battle/buff/buffitem/VenomBurstBuff.js +40 -0
  92. package/dist/core/module/battle/buff/buffitem/index.d.ts +6 -0
  93. package/dist/core/module/battle/buff/buffitem/index.js +7 -1
  94. package/dist/core/module/battle/entity/FighterData.js +5 -1
  95. package/dist/core/module/battle/event/EntityEvent.d.ts +2 -0
  96. package/dist/core/module/battle/event/EntityEvent.js +2 -0
  97. package/dist/core/module/battle/factory/FighterFactory.js +17 -5
  98. package/dist/core/module/battle/fsm-state/Boss38210State.d.ts +11 -0
  99. package/dist/core/module/battle/fsm-state/Boss38210State.js +30 -0
  100. package/dist/core/module/battle/fsm-state/FighterStateProfiles.d.ts +2 -1
  101. package/dist/core/module/battle/fsm-state/FighterStateProfiles.js +4 -2
  102. package/dist/core/module/battle/fsm-state/TurnState.js +4 -4
  103. package/dist/core/module/battle/fsm-state/TurnTransitions.js +4 -4
  104. package/dist/core/module/battle/fsm-state/index.d.ts +1 -0
  105. package/dist/core/module/battle/fsm-state/index.js +2 -1
  106. package/dist/core/module/battle/manager/EntityManager.js +7 -3
  107. package/dist/core/module/battle/skill/emitter/SkillTargetHorRandomEmitter.d.ts +12 -0
  108. package/dist/core/module/battle/skill/emitter/SkillTargetHorRandomEmitter.js +62 -0
  109. package/dist/core/module/battle/skill/emitter/index.d.ts +1 -0
  110. package/dist/core/module/battle/skill/emitter/index.js +2 -1
  111. package/dist/core/module/battle/skill/impacts/Impact101.js +1 -0
  112. package/dist/core/module/battle/skill/impacts/Impact3.js +2 -1
  113. package/dist/core/module/battle/skill/impacts/Impact5.js +5 -1
  114. package/dist/core/module/battle/system/BornSystem.js +4 -0
  115. package/dist/core/module/battle/system/BuffSystem.js +9 -3
  116. package/dist/core/module/battle/system/SkillSystem.js +1 -1
  117. package/dist/core/module/battle/system/TurnPhaseSystem.js +1 -1
  118. package/dist/core/module/battle/target/RandomPosSelection.d.ts +4 -0
  119. package/dist/core/module/battle/target/RandomPosSelection.js +61 -0
  120. package/dist/core/module/battle/target/index.d.ts +1 -0
  121. package/dist/core/module/battle/target/index.js +2 -1
  122. package/dist/core/module/battle/turn/TurnBattleGame.d.ts +11 -3
  123. package/dist/core/module/battle/turn/TurnBattleGame.js +53 -12
  124. package/dist/core/module/battle/turn/TurnBattleModule.js +2 -2
  125. package/dist/core/module/battle/turn/TurnBattleTypes.d.ts +1 -6
  126. package/dist/core/module/battle/turn/TurnBattleTypes.js +1 -4
  127. package/dist/core/module/battle/util/BattleConfig.js +2 -2
  128. package/dist/core/module/battle/util/BattleUtils.d.ts +7 -1
  129. package/dist/core/module/battle/util/BattleUtils.js +67 -33
  130. package/dist/core/module/guild/island/battle/GuildIsLandBattleModule.d.ts +11 -0
  131. package/dist/core/module/guild/island/battle/GuildIsLandBattleModule.js +44 -0
  132. package/dist/core/module/guild/island/battle/index.d.ts +1 -0
  133. package/dist/core/module/guild/island/battle/index.js +13 -0
  134. package/dist/core/module/guild/view/boss/GuildBossBattleModule.js +1 -0
  135. package/dist/core/module/module.interface.d.ts +24 -0
  136. package/dist/core/module/module.interface.js +3 -0
  137. package/dist/core/module/property/Property.d.ts +2 -1
  138. package/dist/core/module/property/Property.js +8 -7
  139. package/dist/core/module/property/PropertyUtil.d.ts +17 -0
  140. package/dist/core/module/property/PropertyUtil.js +75 -1
  141. package/dist/core/module/relicDungeon/RelicBattleModule.d.ts +18 -0
  142. package/dist/core/module/relicDungeon/RelicBattleModule.js +148 -5
  143. package/dist/core/proto/CommonProto.d.ts +8740 -4068
  144. package/dist/core/proto/Proto.d.ts +129 -39
  145. package/dist/index.d.ts +47 -4
  146. package/dist/index.js +58 -4
  147. package/dist/register-all.d.ts +1 -0
  148. package/dist/register-all.js +1 -0
  149. package/package.json +1 -1
@@ -18,6 +18,7 @@ var RunPriorityType;
18
18
  RunPriorityType[RunPriorityType["HEIGHT"] = 2] = "HEIGHT";
19
19
  })(RunPriorityType || (exports.RunPriorityType = RunPriorityType = {}));
20
20
  class _Time {
21
+ minuteMs = 60 * 1000;
21
22
  _time = 0;
22
23
  //游戏累计总时间
23
24
  get time() {
@@ -1,7 +1,10 @@
1
1
  import TurnBattleModule from "../battle/turn/TurnBattleModule";
2
2
  export default class ArenaBattleModule extends TurnBattleModule {
3
+ resultInfo: ArenaProto.IS_START_FIGHT;
3
4
  getMode(): number;
4
5
  onUpdate(dt: number): void;
5
6
  gameWin(): void;
6
7
  gameFail(): void;
8
+ setCross(): void;
9
+ gameFinish(): void;
7
10
  }
@@ -9,9 +9,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ const Notifier_1 = require("../../framework/notify/Notifier");
13
+ const ListenID_1 = require("../../ListenID");
12
14
  const TurnBattleModule_1 = __importDefault(require("../battle/turn/TurnBattleModule"));
13
15
  const BattleUtils_1 = require("../battle/util/BattleUtils");
14
16
  let ArenaBattleModule = class ArenaBattleModule extends TurnBattleModule_1.default {
17
+ resultInfo;
15
18
  getMode() {
16
19
  return 5;
17
20
  }
@@ -19,11 +22,20 @@ let ArenaBattleModule = class ArenaBattleModule extends TurnBattleModule_1.defau
19
22
  }
20
23
  gameWin() {
21
24
  super.gameWin();
22
- console.log('胜利');
25
+ this.gameFinish();
23
26
  }
24
27
  gameFail() {
25
28
  super.gameFail();
26
- console.log('失败');
29
+ this.gameFinish();
30
+ }
31
+ setCross() {
32
+ this.game.gameState = 3 /* GameState.OVER */;
33
+ this.gameFinish();
34
+ }
35
+ gameFinish() {
36
+ if (this.resultInfo) {
37
+ Notifier_1.Notifier.send(ListenID_1.ListenID.Arena_OpenResultView, this.resultInfo, this.game);
38
+ }
27
39
  }
28
40
  };
29
41
  ArenaBattleModule = __decorate([
@@ -1,6 +1,6 @@
1
1
  import type { Node } from "cc";
2
2
  import { WavesInfoCfg } from "../../config/WavesInfoCfg";
3
- import { DEBUG_EVENT, EGameModule, EntityType, GameAddPartner, GameInput, GameState, IBattleFrameData, IFightData, IFighterInfo, IImpact } from "./battle.interface";
3
+ import { DEBUG_EVENT, EGameModule, EntityType, GameAddPartner, GameInput, GameState, IBattleFrameData, IFightData, IFighterInfo, IImpact, IPVPFightData } from "./battle.interface";
4
4
  import BaseEntityData from "./entity/BaseEntityData";
5
5
  import FighterData, { IFighterValueSnapshot } from "./entity/FighterData";
6
6
  import ProjectileData, { IProjectileValueSnapshot } from "./entity/ProjectileData";
@@ -110,6 +110,11 @@ export interface IGameContext {
110
110
  myFightData: {
111
111
  [key: number]: IFightData;
112
112
  };
113
+ playerFightData: {
114
+ [playerId: number]: {
115
+ [key: number]: IPVPFightData;
116
+ };
117
+ };
113
118
  buffMaxLayer: {
114
119
  [key: number]: number;
115
120
  };
@@ -215,6 +220,8 @@ export interface GameOptions {
215
220
  stageId?: number;
216
221
  wavesPro?: number[][];
217
222
  broadphase?: 'quadtree' | 'sap';
223
+ mapTraitId?: number;
224
+ weatherTraitId?: number;
218
225
  talentSkillIds?: number[];
219
226
  inputs?: IBattleFrameData[];
220
227
  debugEvent?: DEBUG_EVENT;
@@ -262,7 +269,6 @@ export default class Game {
262
269
  canPopWaitSKill: boolean;
263
270
  freeChangeSkillTimes: number;
264
271
  freeChangeSkillBoxTimes: number;
265
- firstSelectTimes: number;
266
272
  proMaxMap: Map<number, number>;
267
273
  proMinMap: Map<number, number>;
268
274
  get isPVP(): boolean;
@@ -276,6 +282,7 @@ export default class Game {
276
282
  protected collisionSystem: CollisionSystem;
277
283
  protected debugSystem: DebugSystem;
278
284
  private _events;
285
+ gameOptions: GameOptions;
279
286
  constructor(options?: GameOptions);
280
287
  protected initSystem(options?: GameOptions): void;
281
288
  protected initGameModule(options?: GameOptions): void;
@@ -374,7 +381,10 @@ export default class Game {
374
381
  call(eventId: GameEventId, ...argArray: any[]): any;
375
382
  call(entity: BaseEntityData, eventId: number, ...argArray: any[]): any;
376
383
  hasBronRole(playerId: number, role: number): boolean;
377
- logFightData(attacker: FighterData, fightType: number, hurt: number, skillId: number): void;
384
+ logHurtData(attacker: FighterData, fightType: number, hurt: number, skillId: number): void;
385
+ logTakeDamage(defender: FighterData, hurt: number): void;
386
+ logHealData(caster: FighterData, heal: number): void;
387
+ logShieldData(caster: FighterData, shield: number): void;
378
388
  getRoleLevelByRoleId(roleId: number): {
379
389
  level: number;
380
390
  maxQuality: number;
@@ -82,7 +82,6 @@ class Game {
82
82
  canPopWaitSKill = false;
83
83
  freeChangeSkillTimes = 0; //免费刷新技能次数
84
84
  freeChangeSkillBoxTimes = 1; //免费刷新精英转盘技能次数
85
- firstSelectTimes = 0; //首次选择词条次数
86
85
  proMaxMap = new Map();
87
86
  proMinMap = new Map();
88
87
  get isPVP() {
@@ -99,8 +98,10 @@ class Game {
99
98
  debugSystem = null;
100
99
  _events = null;
101
100
  //#endregion
101
+ gameOptions = null;
102
102
  constructor(options) {
103
103
  this._resultCall = options.resultCall;
104
+ this.gameOptions = options;
104
105
  this.logicStep = options.logicStep ? Math.trunc(1000 / options.logicStep) / 1000 : Game.stableTime;
105
106
  this._events = new EventListener_1.EventListener();
106
107
  this._gameWidth = options.gameWidth || this._gameWidth;
@@ -109,7 +110,6 @@ class Game {
109
110
  this._halfHeight = this._gameHeight * 0.5;
110
111
  this.freeChangeSkillTimes = options.freeChangeSkillTimes || 0;
111
112
  this.freeChangeSkillBoxTimes = options.freeChangeSkillBoxTimes ?? 1;
112
- this.firstSelectTimes = options.firstSelectTimes || 0;
113
113
  this.selfPlayerId = options.selfPlayerId || 0;
114
114
  Cfg_1.Cfg.ProDefine.forEach(value => {
115
115
  this.proMaxMap.set(value.id, value.maxValue != null ? value.maxValue : Number.MAX_SAFE_INTEGER);
@@ -151,6 +151,7 @@ class Game {
151
151
  //实体数据
152
152
  fighters: [],
153
153
  myFightData: {},
154
+ playerFightData: {},
154
155
  projectiles: [],
155
156
  activeSkills: {},
156
157
  curBornRole: {},
@@ -699,9 +700,9 @@ class Game {
699
700
  }
700
701
  return false;
701
702
  }
702
- logFightData(attacker, fightType, hurt, skillId) {
703
+ logHurtData(attacker, fightType, hurt, skillId) {
703
704
  if (this.gameModule.moduleState.logDetial) {
704
- let id = attacker.callEntityId || attacker.ID;
705
+ let id = attacker.callTopEntityId || attacker.ID;
705
706
  let fightData = this.gameContext.myFightData[id];
706
707
  this.debugSystem.pushEvent(battle_interface_1.DEBUG_EVENT.Hurt, hurt, skillId || 0);
707
708
  if (fightData) {
@@ -716,6 +717,33 @@ class Game {
716
717
  }
717
718
  }
718
719
  }
720
+ logTakeDamage(defender, hurt) {
721
+ if (this.gameModule.moduleState.logDetial) {
722
+ let id = defender.ID;
723
+ let fightData = this.gameContext.myFightData[id];
724
+ if (fightData) {
725
+ fightData.takeDamage += hurt;
726
+ }
727
+ }
728
+ }
729
+ logHealData(caster, heal) {
730
+ if (this.gameModule.moduleState.logDetial) {
731
+ let id = caster.callTopEntityId || caster.ID;
732
+ let fightData = this.gameContext.myFightData[id];
733
+ if (fightData) {
734
+ fightData.heal += heal;
735
+ }
736
+ }
737
+ }
738
+ logShieldData(caster, shield) {
739
+ if (this.gameModule.moduleState.logDetial) {
740
+ let id = caster.callTopEntityId || caster.ID;
741
+ let fightData = this.gameContext.myFightData[id];
742
+ if (fightData) {
743
+ fightData.shield += shield;
744
+ }
745
+ }
746
+ }
719
747
  getRoleLevelByRoleId(roleId) {
720
748
  let curskills = this.gameContext.activeSkills[this.selfPlayerId];
721
749
  let level = 0;
@@ -954,8 +982,10 @@ class Game {
954
982
  let a7 = Math.max(10000, atkpro[10400] * (1 - defpro[10410] / Property_1.PROPERTY_SCALE));
955
983
  a8 = a6 * (a7 / Property_1.PROPERTY_SCALE);
956
984
  }
957
- //最终伤害 = max(1 , (主伤害 + 附加点伤) × (1 + 最终伤害%) × (1 - min(90% , target最终减伤%) ) - 固定减伤)
958
- let finalDamage = Math.max(1, Math.ceil((a8 + a3) * (1 + atkpro[10130] / Property_1.PROPERTY_SCALE) * (1 - Math.min(0.9, defpro[10140] / Property_1.PROPERTY_SCALE)) - defpro[10070] * 0.5));
985
+ // 侵蚀伤害加成
986
+ const erosionDamageAdd = this.gameModule.getErosionDamageAdd();
987
+ //最终伤害 = max(1 , (主伤害 + 附加点伤) × (1 + 最终伤害%) × (侵蚀伤害加成) x(1 - min(90% , target最终减伤%) ) - 固定减伤)
988
+ let finalDamage = Math.max(1, Math.ceil((a8 + a3) * (1 + atkpro[10130] / Property_1.PROPERTY_SCALE) * erosionDamageAdd * (1 - Math.min(0.9, defpro[10140] / Property_1.PROPERTY_SCALE)) - defpro[10070] * 0.5));
959
989
  if (defender.campType === battle_interface_1.CampType.ENEMY && defpro[24480]) {
960
990
  const maxDamage = Math.ceil(defpro[24480] * Property_1.PropertyHelper.hp(defpro) / Property_1.PROPERTY_SCALE);
961
991
  if (maxDamage < finalDamage)
@@ -42,6 +42,7 @@ export declare abstract class GameModule {
42
42
  constructor(type: EGameModule, game: Game);
43
43
  abstract init(): any;
44
44
  abstract getMode(): number;
45
+ getErosionDamageAdd(): number;
45
46
  setFighterPosition(fighter: FighterData, data: IFighterInfo): void;
46
47
  getClosestDistanceSqrt(fighter: FighterData, target: FighterData): number;
47
48
  getClosestTarget(fighter: FighterData, isDiffCamp?: boolean, num?: number): any;
@@ -47,6 +47,10 @@ class GameModule {
47
47
  this.codeInfo = new CodexProto.BattleCodexInfo();
48
48
  }
49
49
  }
50
+ //获取侵蚀伤害加成
51
+ getErosionDamageAdd() {
52
+ return 1;
53
+ }
50
54
  setFighterPosition(fighter, data) {
51
55
  if (fighter.campType === battle_interface_1.CampType.MY && fighter.subType === battle_interface_1.SubEntityType.ROLE || fighter.subType === battle_interface_1.SubEntityType.TOWER || fighter.subType === battle_interface_1.SubEntityType.PET) {
52
56
  let list = fighter.subType === battle_interface_1.SubEntityType.PET ? fighter.game.gameContext.curBornPet[data.playerId] : fighter.game.gameContext.curBornRole[data.playerId];
@@ -670,12 +674,12 @@ class GameModule {
670
674
  }
671
675
  onUpdate(dt) {
672
676
  if (this.game.gameContext.curFrame === 10) {
673
- if (this.game.firstSelectTimes) {
677
+ if (this.game.gameOptions.firstSelectTimes) {
674
678
  const dropId = 100 * 10 + 1;
675
- for (let i = 0; i < this.game.firstSelectTimes; i++) {
679
+ for (let i = 0; i < this.game.gameOptions.firstSelectTimes; i++) {
676
680
  this.game.gameContext.waitSkills.push(dropId);
677
681
  }
678
- this.game.firstSelectTimes = 0;
682
+ this.game.gameOptions.firstSelectTimes = 0;
679
683
  }
680
684
  }
681
685
  // 每个宝箱独立计时,到时间后进入弹窗队列(保留掉落先后顺序)
@@ -27,6 +27,7 @@ export declare enum ETargetType {
27
27
  PRIORITY_TYPE = 7,//根据类型优先目标
28
28
  RANDOM_RANGE = 8,//随机范围目标
29
29
  CLOSE_DOWN = 9,//下方最近目标
30
+ RANDOM_POS = 10,//随机位置目标
30
31
  SELF = 100,//自身
31
32
  SELF_RANDOM = 101,//自身随机单位
32
33
  SELF_ROLE = 102,//玩家主角
@@ -51,7 +52,9 @@ export declare enum EGameModule {
51
52
  CheatDPS = "CheatDPSBattleModule",//秘籍战斗 2
52
53
  GuildBoss = "GuildBossBattleModule",//船队boss 3
53
54
  DailyTrial = "DailyTrialBattleModule",//每日试炼 4
54
- Arena = "ArenaBattleModule"
55
+ Arena = "ArenaBattleModule",//竞技场 5
56
+ TeamBoss = "TeamBossBattleModule",//组队boss 6
57
+ GuildIsland = "GuildIsLandBattleModule"
55
58
  }
56
59
  export declare const enum GameState {
57
60
  NONE = 0,
@@ -124,6 +127,18 @@ export interface IFightData {
124
127
  skillList?: {
125
128
  [key: number]: number;
126
129
  };
130
+ takeDamage?: number;
131
+ heal?: number;
132
+ shield?: number;
133
+ }
134
+ export interface IPVPFightData {
135
+ oid: number;
136
+ ID: number;
137
+ fightId: number;
138
+ hurt: number;
139
+ takeDamage: number;
140
+ heal: number;
141
+ shield: number;
127
142
  }
128
143
  export interface DrawTagEx extends DrawTagCfg {
129
144
  level: number;
@@ -150,6 +165,7 @@ export interface IFighterInfo {
150
165
  fashionId?: number;
151
166
  weaponFashionId?: number;
152
167
  vehicleId?: number;
168
+ vehicleFashionId?: number;
153
169
  hpNum?: number;
154
170
  dropExp?: number;
155
171
  wave?: number;
@@ -30,6 +30,7 @@ var ETargetType;
30
30
  ETargetType[ETargetType["PRIORITY_TYPE"] = 7] = "PRIORITY_TYPE";
31
31
  ETargetType[ETargetType["RANDOM_RANGE"] = 8] = "RANDOM_RANGE";
32
32
  ETargetType[ETargetType["CLOSE_DOWN"] = 9] = "CLOSE_DOWN";
33
+ ETargetType[ETargetType["RANDOM_POS"] = 10] = "RANDOM_POS";
33
34
  ETargetType[ETargetType["SELF"] = 100] = "SELF";
34
35
  ETargetType[ETargetType["SELF_RANDOM"] = 101] = "SELF_RANDOM";
35
36
  ETargetType[ETargetType["SELF_ROLE"] = 102] = "SELF_ROLE";
@@ -59,6 +60,8 @@ var EGameModule;
59
60
  EGameModule["GuildBoss"] = "GuildBossBattleModule";
60
61
  EGameModule["DailyTrial"] = "DailyTrialBattleModule";
61
62
  EGameModule["Arena"] = "ArenaBattleModule";
63
+ EGameModule["TeamBoss"] = "TeamBossBattleModule";
64
+ EGameModule["GuildIsland"] = "GuildIsLandBattleModule";
62
65
  })(EGameModule || (exports.EGameModule = EGameModule = {}));
63
66
  var GameInputTypeEnum;
64
67
  (function (GameInputTypeEnum) {
@@ -0,0 +1,10 @@
1
+ import FighterData from "../../entity/FighterData";
2
+ import { Buff } from "../BuffMgr";
3
+ import { BaseBuff } from "./BaseBuff";
4
+ export declare class BossCloneBuff extends BaseBuff {
5
+ static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
6
+ private static onCallFighter;
7
+ private static onCallFighterDead;
8
+ static onExecute(entity: FighterData, buff: Buff.BuffItem, dt: number): boolean;
9
+ static onExit(entity: FighterData, buff: Buff.BuffItem): void;
10
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BossCloneBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const EntityEvent_1 = require("../../event/EntityEvent");
12
+ const GameEvent_1 = require("../../event/GameEvent");
13
+ const BuffMgr_1 = require("../BuffMgr");
14
+ const BaseBuff_1 = require("./BaseBuff");
15
+ let BossCloneBuff = class BossCloneBuff extends BaseBuff_1.BaseBuff {
16
+ static onEnter(entity, buff) {
17
+ buff.curBuffTime = 0;
18
+ buff.context.originnum = 0; //分身数量
19
+ buff.context.deltaTime = 0; //分身时间间隔
20
+ entity.game.on(EntityEvent_1.EntityEvent.CallFighter, this.onCallFighter, this);
21
+ entity.game.on(EntityEvent_1.EntityEvent.CallFighterDead, this.onCallFighterDead, this);
22
+ }
23
+ static onCallFighter(entity, fighter) {
24
+ const buffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.BossClone);
25
+ if (buffs.length > 0) {
26
+ buffs[0].context.originnum++;
27
+ if (!buffs[0].context.projectileArray) {
28
+ buffs[0].context.projectileArray = [];
29
+ }
30
+ buffs[0].context.projectileArray.push(fighter.ID, fighter.x, fighter.y);
31
+ buffs[0].context.deltaTime = 2 * entity.game.logicStep;
32
+ }
33
+ }
34
+ static onCallFighterDead(entity, fighter) {
35
+ const buffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.BossClone);
36
+ if (buffs.length > 0) {
37
+ if (!fighter.isKillSelf) {
38
+ buffs[0].context.originnum--;
39
+ }
40
+ if (buffs[0].context.originnum <= 0) {
41
+ const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buffs[0]), buffs[0]);
42
+ if (impact.p5) {
43
+ entity.game.emit(GameEvent_1.GameEvent.UseSkill, entity, impact.p5);
44
+ }
45
+ }
46
+ }
47
+ }
48
+ static onExecute(entity, buff, dt) {
49
+ buff.curBuffTime += dt;
50
+ if (buff.context.projectileArray && buff.context.projectileArray.length > 0 && buff.context.deltaTime > 0) {
51
+ buff.context.deltaTime -= dt;
52
+ if (buff.context.deltaTime <= 0) {
53
+ let num = buff.context.projectileArray.length / 3 + 1;
54
+ let index = entity.game.randomRange(0, num - 1);
55
+ if (index > 0) {
56
+ index--;
57
+ let id = buff.context.projectileArray[index * 3];
58
+ let x = buff.context.projectileArray[index * 3 + 1];
59
+ let y = buff.context.projectileArray[index * 3 + 2];
60
+ let fighter = entity.game.getEntityLogic(id);
61
+ if (fighter) {
62
+ fighter.setPosition(entity.x, entity.y);
63
+ entity.setPosition(x, y);
64
+ }
65
+ }
66
+ }
67
+ }
68
+ if (buff.buffTime >= 0 && buff.curBuffTime > buff.buffTime) {
69
+ const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
70
+ if (impact.p6) {
71
+ if (buff.context.originnum > 0) {
72
+ for (let i = 0; i < buff.context.originnum; i++) {
73
+ entity.game.emit(GameEvent_1.GameEvent.UseSkill, entity, impact.p6);
74
+ }
75
+ }
76
+ }
77
+ return false;
78
+ }
79
+ return true;
80
+ }
81
+ static onExit(entity, buff) {
82
+ entity.game.on(EntityEvent_1.EntityEvent.CallFighter, this.onCallFighter, this);
83
+ entity.game.on(EntityEvent_1.EntityEvent.CallFighterDead, this.onCallFighterDead, this);
84
+ }
85
+ };
86
+ exports.BossCloneBuff = BossCloneBuff;
87
+ exports.BossCloneBuff = BossCloneBuff = __decorate([
88
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.BossClone)
89
+ ], BossCloneBuff);
@@ -0,0 +1,9 @@
1
+ import FighterData from "../../entity/FighterData";
2
+ import { Buff } from "../BuffMgr";
3
+ import { BaseBuff } from "./BaseBuff";
4
+ export declare class BossPetrifyBuff extends BaseBuff {
5
+ static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
6
+ private static onShieldReduce;
7
+ static onExecute(entity: FighterData, buff: Buff.BuffItem, dt: number): boolean;
8
+ static onExit(entity: FighterData, buff: Buff.BuffItem): void;
9
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BossPetrifyBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const Property_1 = require("../../../property/Property");
12
+ const EntityEvent_1 = require("../../event/EntityEvent");
13
+ const GameEvent_1 = require("../../event/GameEvent");
14
+ const BuffMgr_1 = require("../BuffMgr");
15
+ const BaseBuff_1 = require("./BaseBuff");
16
+ let BossPetrifyBuff = class BossPetrifyBuff extends BaseBuff_1.BaseBuff {
17
+ static onEnter(entity, buff) {
18
+ buff.curBuffTime = 0;
19
+ const shield = Math.ceil(Property_1.PropertyHelper.hp(entity.property) * buff.buffValue / Property_1.PROPERTY_SCALE);
20
+ entity.property[10090] += shield;
21
+ buff.context.originnum = shield;
22
+ entity.game.on(EntityEvent_1.EntityEvent.ShieldReduce, this.onShieldReduce, this);
23
+ }
24
+ static onShieldReduce(entity, shield) {
25
+ const buffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.BossPetrify);
26
+ if (buffs.length > 0 && buffs[0].context.originnum) {
27
+ buffs[0].context.originnum -= shield;
28
+ if (buffs[0].context.originnum < 0)
29
+ buffs[0].context.originnum = 0;
30
+ if (buffs[0].context.originnum <= 0) {
31
+ const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buffs[0]), buffs[0]);
32
+ if (impact.p5) {
33
+ entity.game.emit(GameEvent_1.GameEvent.UseSkill, entity, impact.p5);
34
+ }
35
+ }
36
+ }
37
+ }
38
+ static onExecute(entity, buff, dt) {
39
+ buff.curBuffTime += dt;
40
+ if (buff.buffTime >= 0 && buff.curBuffTime > buff.buffTime) {
41
+ const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
42
+ if (impact.p6) {
43
+ entity.game.emit(GameEvent_1.GameEvent.UseSkill, entity, impact.p6);
44
+ }
45
+ return false;
46
+ }
47
+ return true;
48
+ }
49
+ static onExit(entity, buff) {
50
+ if (buff.context.originnum > 0) {
51
+ entity.property[10090] -= buff.context.originnum;
52
+ buff.context.originnum = 0;
53
+ }
54
+ entity.game.off(EntityEvent_1.EntityEvent.ShieldReduce, this.onShieldReduce, this);
55
+ }
56
+ };
57
+ exports.BossPetrifyBuff = BossPetrifyBuff;
58
+ exports.BossPetrifyBuff = BossPetrifyBuff = __decorate([
59
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.BossPetrify)
60
+ ], BossPetrifyBuff);
@@ -0,0 +1,7 @@
1
+ import FighterData from "../../entity/FighterData";
2
+ import { Buff } from "../BuffMgr";
3
+ import { BaseBuff } from "./BaseBuff";
4
+ export declare class BossReinforcementBuff extends BaseBuff {
5
+ static onExit(entity: FighterData, buff: Buff.BuffItem): void;
6
+ static layerChange(entity: FighterData, buff: Buff.BuffItem, layer: number): void;
7
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BossReinforcementBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const BuffMgr_1 = require("../BuffMgr");
12
+ const BaseBuff_1 = require("./BaseBuff");
13
+ let BossReinforcementBuff = class BossReinforcementBuff extends BaseBuff_1.BaseBuff {
14
+ static onExit(entity, buff) {
15
+ entity.property[10460] -= buff.buffLayer * buff.buffValue;
16
+ }
17
+ static layerChange(entity, buff, layer) {
18
+ const addLayer = layer - buff.buffLayer;
19
+ buff.buffLayer = layer;
20
+ entity.property[10460] += addLayer * buff.buffValue;
21
+ }
22
+ };
23
+ exports.BossReinforcementBuff = BossReinforcementBuff;
24
+ exports.BossReinforcementBuff = BossReinforcementBuff = __decorate([
25
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.BossReinforcement)
26
+ ], BossReinforcementBuff);
@@ -0,0 +1,6 @@
1
+ import FighterData from "../../entity/FighterData";
2
+ import { Buff } from "../BuffMgr";
3
+ import { BaseBuff } from "./BaseBuff";
4
+ export declare class ForceDizzinessBuff extends BaseBuff {
5
+ static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
6
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ForceDizzinessBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const GameEvent_1 = require("../../event/GameEvent");
12
+ const FighterStateType_1 = require("../../fsm-state/FighterStateType");
13
+ const BuffMgr_1 = require("../BuffMgr");
14
+ const BaseBuff_1 = require("./BaseBuff");
15
+ let ForceDizzinessBuff = class ForceDizzinessBuff extends BaseBuff_1.BaseBuff {
16
+ static onEnter(entity, buff) {
17
+ buff.curBuffTime = 0;
18
+ if (entity.isDead)
19
+ return;
20
+ entity.game.emit(GameEvent_1.GameEvent.FsmChangeState, entity, FighterStateType_1.StateType.HIT);
21
+ }
22
+ };
23
+ exports.ForceDizzinessBuff = ForceDizzinessBuff;
24
+ exports.ForceDizzinessBuff = ForceDizzinessBuff = __decorate([
25
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.ForceDizziness)
26
+ ], ForceDizzinessBuff);
@@ -0,0 +1,3 @@
1
+ import { BaseBuff } from "./BaseBuff";
2
+ export declare class ImmuneForceDizzinessBuff extends BaseBuff {
3
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ImmuneForceDizzinessBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const BuffMgr_1 = require("../BuffMgr");
12
+ const BaseBuff_1 = require("./BaseBuff");
13
+ let ImmuneForceDizzinessBuff = class ImmuneForceDizzinessBuff extends BaseBuff_1.BaseBuff {
14
+ };
15
+ exports.ImmuneForceDizzinessBuff = ImmuneForceDizzinessBuff;
16
+ exports.ImmuneForceDizzinessBuff = ImmuneForceDizzinessBuff = __decorate([
17
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.ImmuneForceDizziness)
18
+ ], ImmuneForceDizzinessBuff);
@@ -57,7 +57,9 @@ let PosionBuff = class PosionBuff extends BaseBuff_1.BaseBuff {
57
57
  else {
58
58
  let casterer = entity.game.getEntityLogic(buff.caster);
59
59
  if (!noreduce && casterer) {
60
- casterer.game.emit(casterer, EntityEvent_1.EntityEvent.BuffLayerNum, { id: buff.buffTypeId, layer: buff.buffLayer, beHiter: entity, buff });
60
+ const args = { id: buff.buffTypeId, layer: buff.buffLayer, beHiter: entity, buff };
61
+ casterer.game.emit(casterer, EntityEvent_1.EntityEvent.BuffLayerNum, args);
62
+ casterer.game.emit1(casterer, EntityEvent_1.EntityEvent.BuffLayerNumRatio, args);
61
63
  }
62
64
  }
63
65
  }
@@ -72,7 +74,11 @@ let PosionBuff = class PosionBuff extends BaseBuff_1.BaseBuff {
72
74
  static layerChange(entity, buff, layer) {
73
75
  // let extraLayer = buff.buffValue || 0;
74
76
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
75
- const debuffRatio = impact.p7 / 10000;
77
+ let debuffRatio = impact.p7 / 10000;
78
+ const maxratio = impact.p10;
79
+ if (typeof maxratio === "number") {
80
+ debuffRatio = entity.game.randomRange(impact.p7, maxratio) / 10000;
81
+ }
76
82
  const reallayer = (buff.buffValue || 1);
77
83
  const caster = (0, BuffMgr_1.getBuffCaster)(entity, buff);
78
84
  const extraAddBuffs = caster.getBuffsByType(BuffCfg_1.BuffDefine.PosionExtraAdd);
@@ -3,6 +3,6 @@ import { Buff } from "../BuffMgr";
3
3
  import { BaseBuff } from "./BaseBuff";
4
4
  export declare class ReplaceSkilllBuff extends BaseBuff {
5
5
  static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
6
- static findSkillData(entity: FighterData, skillId: number, belong: any): import("../../skill/SkillData").SkillData;
6
+ static findSkillData(entity: FighterData, skillId: number, belong: any, isHasSkillCanReplace: any): import("../../skill/SkillData").SkillData;
7
7
  static copy(target: any): any;
8
8
  }
@@ -21,7 +21,8 @@ let ReplaceSkilllBuff = class ReplaceSkilllBuff extends BaseBuff_1.BaseBuff {
21
21
  let value = impact.p6;
22
22
  let addType = impact.p7 || 0;
23
23
  let arrayIndex = impact.p8 || 0;
24
- let skillData = this.findSkillData(entity, skillId, impact.belong);
24
+ let isHasSkillCanReplace = impact.p9 || 0;
25
+ let skillData = this.findSkillData(entity, skillId, impact.belong, isHasSkillCanReplace);
25
26
  let iscd = false;
26
27
  if (skillData) {
27
28
  let t = this.copy(skillData.cfg);
@@ -61,14 +62,14 @@ let ReplaceSkilllBuff = class ReplaceSkilllBuff extends BaseBuff_1.BaseBuff {
61
62
  skillData.cfg = t;
62
63
  }
63
64
  }
64
- static findSkillData(entity, skillId, belong) {
65
+ static findSkillData(entity, skillId, belong, isHasSkillCanReplace) {
65
66
  let curSkillId = skillId;
66
67
  if (belong && belong !== entity.cfg.id) {
67
68
  console.warn("ReplaceSkillBuff findSkillData belong error", belong, entity.cfg.id);
68
69
  return null;
69
70
  }
70
71
  let skillData = entity.skillDatas[curSkillId];
71
- if (!skillData) {
72
+ if (!skillData && !isHasSkillCanReplace) {
72
73
  entity.game.emit(GameEvent_1.GameEvent.LearnSkill, entity, skillId, true);
73
74
  skillData = entity.skillDatas[curSkillId];
74
75
  }