@bf6mods/sdk 1.6.0 → 1.8.0

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/index.js CHANGED
@@ -1,75 +1,92 @@
1
+
1
2
  //#region src/config/mutators/index.ts
2
3
  /**
3
4
  * Determines the Man-Down behavior when a soldier is downed.
4
5
  */
5
- let ManDownExperienceType = /* @__PURE__ */ function(ManDownExperienceType$1) {
6
- ManDownExperienceType$1[ManDownExperienceType$1["Crawl"] = 0] = "Crawl";
7
- ManDownExperienceType$1[ManDownExperienceType$1["Downed"] = 1] = "Downed";
8
- ManDownExperienceType$1[ManDownExperienceType$1["InstantDeath"] = 2] = "InstantDeath";
9
- return ManDownExperienceType$1;
6
+ let ManDownExperienceType = /* @__PURE__ */ function(ManDownExperienceType) {
7
+ ManDownExperienceType[ManDownExperienceType["Crawl"] = 0] = "Crawl";
8
+ ManDownExperienceType[ManDownExperienceType["Downed"] = 1] = "Downed";
9
+ ManDownExperienceType[ManDownExperienceType["InstantDeath"] = 2] = "InstantDeath";
10
+ return ManDownExperienceType;
10
11
  }({});
11
12
  /**
12
13
  * Controls which type of AI to spawn. PvP AI will automatically spawn and can be replaced by human players. PvE AI is a fixed number that cannot be replaced, for Solo or Co-op experiences.
13
14
  */
14
- let AiSpawnType = /* @__PURE__ */ function(AiSpawnType$1) {
15
- AiSpawnType$1[AiSpawnType$1["NoBots"] = 0] = "NoBots";
16
- AiSpawnType$1[AiSpawnType$1["Backfill"] = 2] = "Backfill";
17
- AiSpawnType$1[AiSpawnType$1["Static"] = 1] = "Static";
18
- return AiSpawnType$1;
15
+ let AiSpawnType = /* @__PURE__ */ function(AiSpawnType) {
16
+ AiSpawnType[AiSpawnType["NoBots"] = 0] = "NoBots";
17
+ AiSpawnType[AiSpawnType["Backfill"] = 2] = "Backfill";
18
+ AiSpawnType[AiSpawnType["Static"] = 1] = "Static";
19
+ return AiSpawnType;
19
20
  }({});
20
21
  /**
21
22
  * Controls the rules for Squad Spawning, for squad members and squad leaders.
22
23
  */
23
- let SquadSpawnType = /* @__PURE__ */ function(SquadSpawnType$1) {
24
- SquadSpawnType$1[SquadSpawnType$1["All"] = 0] = "All";
25
- SquadSpawnType$1[SquadSpawnType$1["SquadmatesOnLeader_LeaderNone"] = 1] = "SquadmatesOnLeader_LeaderNone";
26
- SquadSpawnType$1[SquadSpawnType$1["SquadmatesOnLeader_LeaderAll"] = 2] = "SquadmatesOnLeader_LeaderAll";
27
- SquadSpawnType$1[SquadSpawnType$1["Disabled"] = 2] = "Disabled";
28
- SquadSpawnType$1[SquadSpawnType$1["Undocumented"] = 3] = "Undocumented";
29
- return SquadSpawnType$1;
24
+ let SquadSpawnType = /* @__PURE__ */ function(SquadSpawnType) {
25
+ SquadSpawnType[SquadSpawnType["All"] = 0] = "All";
26
+ SquadSpawnType[SquadSpawnType["SquadmatesOnLeader_LeaderNone"] = 1] = "SquadmatesOnLeader_LeaderNone";
27
+ SquadSpawnType[SquadSpawnType["SquadmatesOnLeader_LeaderAll"] = 2] = "SquadmatesOnLeader_LeaderAll";
28
+ SquadSpawnType[SquadSpawnType["Disabled"] = 3] = "Disabled";
29
+ return SquadSpawnType;
30
30
  }({});
31
31
  /**
32
32
  * Controls what type of scoreboard layout to use.
33
33
  */
34
- let ScoreboardType = /* @__PURE__ */ function(ScoreboardType$1) {
35
- ScoreboardType$1[ScoreboardType$1["NotSet"] = 0] = "NotSet";
36
- ScoreboardType$1[ScoreboardType$1["DefaultFAA"] = 1] = "DefaultFAA";
37
- ScoreboardType$1[ScoreboardType$1["Off"] = 2] = "Off";
38
- ScoreboardType$1[ScoreboardType$1["CustomTwoTeams"] = 3] = "CustomTwoTeams";
39
- ScoreboardType$1[ScoreboardType$1["CustomFFA"] = 4] = "CustomFFA";
40
- return ScoreboardType$1;
34
+ let ScoreboardType = /* @__PURE__ */ function(ScoreboardType) {
35
+ ScoreboardType[ScoreboardType["NotSet"] = 0] = "NotSet";
36
+ ScoreboardType[ScoreboardType["DefaultFAA"] = 1] = "DefaultFAA";
37
+ ScoreboardType[ScoreboardType["Off"] = 2] = "Off";
38
+ ScoreboardType[ScoreboardType["CustomTwoTeams"] = 3] = "CustomTwoTeams";
39
+ ScoreboardType[ScoreboardType["CustomFFA"] = 4] = "CustomFFA";
40
+ return ScoreboardType;
41
41
  }({});
42
42
  /**
43
43
  * Determines the behavior of the Ping command.
44
44
  */
45
- let PingBehavior = /* @__PURE__ */ function(PingBehavior$1) {
46
- PingBehavior$1[PingBehavior$1["PingTargets"] = 0] = "PingTargets";
47
- PingBehavior$1[PingBehavior$1["Disabled"] = 1] = "Disabled";
48
- return PingBehavior$1;
45
+ let PingBehavior = /* @__PURE__ */ function(PingBehavior) {
46
+ PingBehavior[PingBehavior["PingTargets"] = 0] = "PingTargets";
47
+ PingBehavior[PingBehavior["Disabled"] = 2] = "Disabled";
48
+ return PingBehavior;
49
49
  }({});
50
- let ModBuilderGameMode = /* @__PURE__ */ function(ModBuilderGameMode$1) {
51
- ModBuilderGameMode$1[ModBuilderGameMode$1["Custom"] = 2] = "Custom";
52
- return ModBuilderGameMode$1;
50
+ let ModBuilderGameMode = /* @__PURE__ */ function(ModBuilderGameMode) {
51
+ ModBuilderGameMode[ModBuilderGameMode["Custom"] = 2] = "Custom";
52
+ return ModBuilderGameMode;
53
53
  }({});
54
54
  /**
55
55
  * Sets the faction for each team.
56
56
  */
57
- let FactionID = /* @__PURE__ */ function(FactionID$1) {
58
- FactionID$1[FactionID$1["Pax"] = -1865993703] = "Pax";
59
- FactionID$1[FactionID$1["MapDefault"] = 0] = "MapDefault";
60
- FactionID$1[FactionID$1["NATO"] = 607944106] = "NATO";
61
- return FactionID$1;
57
+ let FactionID = /* @__PURE__ */ function(FactionID) {
58
+ FactionID[FactionID["Pax"] = -1865993703] = "Pax";
59
+ FactionID[FactionID["MapDefault"] = 0] = "MapDefault";
60
+ FactionID[FactionID["NATO"] = 607944106] = "NATO";
61
+ return FactionID;
62
+ }({});
63
+ /**
64
+ * Sets which train variant will appear in the Railway to Golmud map.
65
+ */
66
+ let GolmudTrainVariant = /* @__PURE__ */ function(GolmudTrainVariant) {
67
+ GolmudTrainVariant[GolmudTrainVariant["None"] = 0] = "None";
68
+ GolmudTrainVariant[GolmudTrainVariant["MovingTrain"] = 1] = "MovingTrain";
69
+ GolmudTrainVariant[GolmudTrainVariant["StaticTrainBreakthrough"] = 2] = "StaticTrainBreakthrough";
70
+ GolmudTrainVariant[GolmudTrainVariant["StaticTrainRush"] = 3] = "StaticTrainRush";
71
+ return GolmudTrainVariant;
72
+ }({});
73
+ /**
74
+ * Sets the Aircraft Carrier variation for the map Tsuru Reef.
75
+ */
76
+ let AircraftCarrierType = /* @__PURE__ */ function(AircraftCarrierType) {
77
+ AircraftCarrierType[AircraftCarrierType["None"] = 0] = "None";
78
+ AircraftCarrierType[AircraftCarrierType["Conquest"] = 1] = "Conquest";
79
+ AircraftCarrierType[AircraftCarrierType["CarrierStrike"] = 2] = "CarrierStrike";
80
+ return AircraftCarrierType;
62
81
  }({});
63
-
64
82
  //#endregion
65
83
  //#region src/config/index.ts
66
- let AttachmentType = /* @__PURE__ */ function(AttachmentType$1) {
67
- AttachmentType$1[AttachmentType$1["SpatialData"] = 1] = "SpatialData";
68
- AttachmentType$1[AttachmentType$1["TypeScript"] = 2] = "TypeScript";
69
- AttachmentType$1[AttachmentType$1["Strings"] = 4] = "Strings";
70
- return AttachmentType$1;
84
+ let AttachmentType = /* @__PURE__ */ function(AttachmentType) {
85
+ AttachmentType[AttachmentType["SpatialData"] = 1] = "SpatialData";
86
+ AttachmentType[AttachmentType["TypeScript"] = 2] = "TypeScript";
87
+ AttachmentType[AttachmentType["Strings"] = 4] = "Strings";
88
+ return AttachmentType;
71
89
  }({});
72
-
73
90
  //#endregion
74
91
  //#region src/modlib/index.ts
75
92
  function Concat(s1, s2) {
@@ -175,6 +192,11 @@ var ConditionState = class {
175
192
  return true;
176
193
  }
177
194
  };
195
+ var SimpleConditionState = class {
196
+ update(newState) {
197
+ return newState;
198
+ }
199
+ };
178
200
  var Conditions = class {
179
201
  constructor() {
180
202
  this.conditionStates = [];
@@ -189,7 +211,11 @@ let teamConditions = [];
189
211
  let capturePointConditions = [];
190
212
  let mcomConditions = [];
191
213
  let vehicleConditions = [];
214
+ let hqConditions = [];
215
+ let sectorConditions = [];
216
+ let vehicleSpawnerConditions = [];
192
217
  let globalConditions = new Conditions();
218
+ let simpleCondition = new SimpleConditionState();
193
219
  function getObjectCondition(id, objectConditions, n) {
194
220
  while (id >= objectConditions.length) objectConditions.push(new Conditions());
195
221
  return objectConditions[id].getConditionState(n);
@@ -213,9 +239,21 @@ function getMCOMCondition(obj, n) {
213
239
  function getVehicleCondition(obj, n) {
214
240
  return getObjectCondition(mod.GetObjId(obj), vehicleConditions, n);
215
241
  }
242
+ function getHQCondition(obj, n) {
243
+ return getObjectCondition(mod.GetObjId(obj), hqConditions, n);
244
+ }
245
+ function getSectorCondition(obj, n) {
246
+ return getObjectCondition(mod.GetObjId(obj), sectorConditions, n);
247
+ }
248
+ function getVehicleSpawnerCondition(obj, n) {
249
+ return getObjectCondition(mod.GetObjId(obj), vehicleSpawnerConditions, n);
250
+ }
216
251
  function getGlobalCondition(n) {
217
252
  return globalConditions.getConditionState(n);
218
253
  }
254
+ function getSimpleCondition() {
255
+ return simpleCondition;
256
+ }
219
257
  function getPlayersInTeam(teamObj) {
220
258
  const team = mod.GetObjId(teamObj);
221
259
  const allPlayers = mod.AllPlayers();
@@ -327,15 +365,15 @@ function ParseUI(...params) {
327
365
  return widget;
328
366
  }
329
367
  function DisplayCustomNotificationMessage(msg, custom, duration, target) {
330
- const CreateHeader = async (widgetId, msg$1, targetPlayer, slot) => {
331
- mod.AddUIText(widgetId, mod.CreateVector(50, 250 + slot * 45, 0), mod.CreateVector(250, 60, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg$1, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
368
+ const CreateHeader = async (widgetId, msg, targetPlayer, slot) => {
369
+ mod.AddUIText(widgetId, mod.CreateVector(50, 250 + slot * 45, 0), mod.CreateVector(250, 60, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
332
370
  if (duration > 0) {
333
371
  await mod.Wait(duration);
334
372
  mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
335
373
  }
336
374
  };
337
- const CreateSubText = async (widgetId, msg$1, targetPlayer, slot) => {
338
- mod.AddUIText(widgetId, mod.CreateVector(85, 270 + slot * 43, 0), mod.CreateVector(125, 40, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg$1, 20, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
375
+ const CreateSubText = async (widgetId, msg, targetPlayer, slot) => {
376
+ mod.AddUIText(widgetId, mod.CreateVector(85, 270 + slot * 43, 0), mod.CreateVector(125, 40, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg, 20, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
339
377
  if (duration > 0) {
340
378
  await mod.Wait(duration);
341
379
  mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
@@ -345,7 +383,8 @@ function DisplayCustomNotificationMessage(msg, custom, duration, target) {
345
383
  if (target) {
346
384
  if (mod.IsType(target, mod.Types.Player)) createNotificationFunction(custom + String(target), msg, target, custom);
347
385
  else if (mod.IsType(target, mod.Types.Team)) getPlayersInTeam(target).forEach((player) => {
348
- createNotificationFunction(custom + String(player), msg, player, custom);
386
+ const widgetId = custom + String(player);
387
+ createNotificationFunction(widgetId, msg, player, custom);
349
388
  });
350
389
  } else {
351
390
  const allPlayers = mod.AllPlayers();
@@ -357,9 +396,9 @@ function DisplayCustomNotificationMessage(msg, custom, duration, target) {
357
396
  }
358
397
  }
359
398
  function ShowEventGameModeMessage(event, target) {
360
- const MakeShiftDisplayGameModeMessage = async (message, target$1) => {
399
+ const MakeShiftDisplayGameModeMessage = async (message, target) => {
361
400
  const widgetId = "GameModeMessage";
362
- if (target$1) mod.AddUIText(widgetId, mod.CreateVector(0, 0, 0), mod.CreateVector(2500, 80, 0), mod.UIAnchor.TopCenter, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, message, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, target$1);
401
+ if (target) mod.AddUIText(widgetId, mod.CreateVector(0, 0, 0), mod.CreateVector(2500, 80, 0), mod.UIAnchor.TopCenter, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, message, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, target);
363
402
  else mod.AddUIText(widgetId, mod.CreateVector(0, 0, 0), mod.CreateVector(2500, 80, 0), mod.UIAnchor.TopCenter, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, message, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center);
364
403
  await mod.Wait(6);
365
404
  mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
@@ -415,7 +454,7 @@ function ClearCustomNotificationMessage(custom, target) {
415
454
  console.error("Could not clear custom message for specified target(s)");
416
455
  }
417
456
  }
418
-
419
457
  //#endregion
420
- export { AiSpawnType, And, AndFn, AttachmentType, ClearAllCustomNotificationMessages, ClearCustomNotificationMessage, Concat, ConditionState, ConvertArray, DisplayCustomNotificationMessage, Equals, FactionID, FilteredArray, IfThenElse, IndexOfFirstTrue, IsTrueForAll, IsTrueForAny, ManDownExperienceType, ModBuilderGameMode, ParseUI, PingBehavior, ScoreboardType, ShowEventGameModeMessage, ShowHighlightedGameModeMessage, ShowNotificationMessage, SortedArray, SquadSpawnType, WaitUntil, getCapturePointCondition, getGlobalCondition, getMCOMCondition, getPlayerCondition, getPlayerId, getPlayersInTeam, getTeamCondition, getTeamId, getVehicleCondition };
458
+ export { AiSpawnType, AircraftCarrierType, And, AndFn, AttachmentType, ClearAllCustomNotificationMessages, ClearCustomNotificationMessage, Concat, ConditionState, ConvertArray, DisplayCustomNotificationMessage, Equals, FactionID, FilteredArray, GolmudTrainVariant, IfThenElse, IndexOfFirstTrue, IsTrueForAll, IsTrueForAny, ManDownExperienceType, ModBuilderGameMode, ParseUI, PingBehavior, ScoreboardType, ShowEventGameModeMessage, ShowHighlightedGameModeMessage, ShowNotificationMessage, SimpleConditionState, SortedArray, SquadSpawnType, WaitUntil, getCapturePointCondition, getGlobalCondition, getHQCondition, getMCOMCondition, getPlayerCondition, getPlayerId, getPlayersInTeam, getSectorCondition, getSimpleCondition, getTeamCondition, getTeamId, getVehicleCondition, getVehicleSpawnerCondition };
459
+
421
460
  //# sourceMappingURL=index.js.map