isaacscript-common 74.0.0 → 75.0.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.
@@ -0,0 +1,17 @@
1
+ import { Feature } from "../../private/Feature";
2
+ export declare class UnlockAchievementsDetection extends Feature {
3
+ private readonly postGameStartedReordered;
4
+ /**
5
+ * Helper function to see if the current run can unlock achievements. For example, if playing on a
6
+ * set seed or in a victory lap, achievements are disabled.
7
+ *
8
+ * Under the hood, this is determined by spawning a Greed Donation Machine at the beginning of the
9
+ * run and then seeing if it exists before removing it. (The results are cached for the entire
10
+ * run.)
11
+ *
12
+ * In order to use this function, you must upgrade your mod with
13
+ * `ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION`.
14
+ */
15
+ canRunUnlockAchievements(): boolean;
16
+ }
17
+ //# sourceMappingURL=UnlockAchievementsDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnlockAchievementsDetection.d.ts","sourceRoot":"","sources":["../../../../src/classes/features/other/UnlockAchievementsDetection.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,2BAA4B,SAAQ,OAAO;IAiBtD,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAQvC;IAEF;;;;;;;;;;OAUG;IAEI,wBAAwB,IAAI,OAAO;CAG3C"}
@@ -0,0 +1,37 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
5
+ local ____exports = {}
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
8
+ local ____constants = require("core.constants")
9
+ local VectorZero = ____constants.VectorZero
10
+ local ____decorators = require("decorators")
11
+ local Exported = ____decorators.Exported
12
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
13
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
14
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
15
+ local spawnSlot = ____entitiesSpecific.spawnSlot
16
+ local ____Feature = require("classes.private.Feature")
17
+ local Feature = ____Feature.Feature
18
+ local v = {run = {canRunUnlockAchievements = true}}
19
+ ____exports.UnlockAchievementsDetection = __TS__Class()
20
+ local UnlockAchievementsDetection = ____exports.UnlockAchievementsDetection
21
+ UnlockAchievementsDetection.name = "UnlockAchievementsDetection"
22
+ __TS__ClassExtends(UnlockAchievementsDetection, Feature)
23
+ function UnlockAchievementsDetection.prototype.____constructor(self)
24
+ Feature.prototype.____constructor(self)
25
+ self.v = v
26
+ self.postGameStartedReordered = function()
27
+ local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
28
+ v.run.canRunUnlockAchievements = greedDonationMachine:Exists()
29
+ greedDonationMachine:Remove()
30
+ end
31
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}}
32
+ end
33
+ function UnlockAchievementsDetection.prototype.canRunUnlockAchievements(self)
34
+ return v.run.canRunUnlockAchievements
35
+ end
36
+ __TS__DecorateLegacy({Exported}, UnlockAchievementsDetection.prototype, "canRunUnlockAchievements", true)
37
+ return ____exports
@@ -55,6 +55,7 @@ export declare enum ISCFeature {
55
55
  SPAWN_COLLECTIBLE = 53,
56
56
  STAGE_HISTORY = 54,
57
57
  START_AMBUSH = 55,
58
- TAINTED_LAZARUS_PLAYERS = 56
58
+ TAINTED_LAZARUS_PLAYERS = 56,
59
+ UNLOCK_ACHIEVEMENTS_DETECTION = 57
59
60
  }
60
61
  //# sourceMappingURL=ISCFeature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISCFeature.d.ts","sourceRoot":"","sources":["../../src/enums/ISCFeature.ts"],"names":[],"mappings":"AAAA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AMBUSH] = "START_AMBUSH"
115
115
  ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 56
116
116
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
117
+ ____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION = 57
118
+ ____exports.ISCFeature[____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION] = "UNLOCK_ACHIEVEMENTS_DETECTION"
117
119
  return ____exports
@@ -56,6 +56,7 @@ import { SpawnRockAltRewards } from "./classes/features/other/SpawnRockAltReward
56
56
  import { StageHistory } from "./classes/features/other/StageHistory";
57
57
  import { StartAmbush } from "./classes/features/other/StartAmbush";
58
58
  import { TaintedLazarusPlayers } from "./classes/features/other/TaintedLazarusPlayers";
59
+ import { UnlockAchievementsDetection } from "./classes/features/other/UnlockAchievementsDetection";
59
60
  import { ISCFeature } from "./enums/ISCFeature";
60
61
  import type { ModUpgradedInterface } from "./interfaces/private/ModUpgradedInterface";
61
62
  export interface ISCFeatureToClass {
@@ -116,6 +117,7 @@ export interface ISCFeatureToClass {
116
117
  [ISCFeature.STAGE_HISTORY]: StageHistory;
117
118
  [ISCFeature.START_AMBUSH]: StartAmbush;
118
119
  [ISCFeature.TAINTED_LAZARUS_PLAYERS]: TaintedLazarusPlayers;
120
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]: UnlockAchievementsDetection;
119
121
  }
120
122
  export declare function getFeatures(mod: ModUpgradedInterface, callbacks: ModCallbackCustomToClass): {
121
123
  readonly 0: CustomRevive;
@@ -175,5 +177,6 @@ export declare function getFeatures(mod: ModUpgradedInterface, callbacks: ModCal
175
177
  readonly 54: StageHistory;
176
178
  readonly 55: StartAmbush;
177
179
  readonly 56: TaintedLazarusPlayers;
180
+ readonly 57: UnlockAchievementsDetection;
178
181
  };
179
182
  //# sourceMappingURL=features.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"features.d.ts","s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,cAAc,CAAC,EAAE,aAAa,CAAC;IAC3C,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACrC,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;IAC1D,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE,0BAA0B,CAAC;IACtE,CAAC,UAAU,CAAC,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACnE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAC9C,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IACvC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC3C,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,WAAW,CAAC;IACxC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC;IACtC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,eAAe,CAAC;IAChD,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,mBAAmB,CAAC;IACzD,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACjD,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACzC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IACvC,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,qBAAqB,CAAC;IAC5D,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE,2BAA2B,CAAC;CACzE;AAKD,wBAAgB,WAAW,CACzB,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLpC"}
package/dist/features.lua CHANGED
@@ -115,6 +115,8 @@ local ____StartAmbush = require("classes.features.other.StartAmbush")
115
115
  local StartAmbush = ____StartAmbush.StartAmbush
116
116
  local ____TaintedLazarusPlayers = require("classes.features.other.TaintedLazarusPlayers")
117
117
  local TaintedLazarusPlayers = ____TaintedLazarusPlayers.TaintedLazarusPlayers
118
+ local ____UnlockAchievementsDetection = require("classes.features.other.UnlockAchievementsDetection")
119
+ local UnlockAchievementsDetection = ____UnlockAchievementsDetection.UnlockAchievementsDetection
118
120
  local ____ISCFeature = require("enums.ISCFeature")
119
121
  local ISCFeature = ____ISCFeature.ISCFeature
120
122
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
@@ -243,7 +245,8 @@ function ____exports.getFeatures(self, mod, callbacks)
243
245
  [ISCFeature.SPAWN_COLLECTIBLE] = spawnCollectible,
244
246
  [ISCFeature.STAGE_HISTORY] = stageHistory,
245
247
  [ISCFeature.START_AMBUSH] = __TS__New(StartAmbush, runInNFrames),
246
- [ISCFeature.TAINTED_LAZARUS_PLAYERS] = __TS__New(TaintedLazarusPlayers)
248
+ [ISCFeature.TAINTED_LAZARUS_PLAYERS] = __TS__New(TaintedLazarusPlayers),
249
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION] = __TS__New(UnlockAchievementsDetection)
247
250
  }
248
251
  return features
249
252
  end
@@ -8,17 +8,6 @@ export declare function anyEasterEggEnabled(exceptions?: SeedEffect[]): boolean;
8
8
  * @param exceptions Optional. An array of seed effects to ignore.
9
9
  */
10
10
  export declare function anySeedEffectEnabled(exceptions?: SeedEffect[]): boolean;
11
- /**
12
- * Helper function to see if the current run can unlock achievements. For example, if playing on a
13
- * set seed or in a victory lap, achievements are disabled.
14
- *
15
- * This function can cause problems if called multiple times per frame, since it involves spawning
16
- * an entity. It is recommended that you cache the result at the beginning of every run.
17
- *
18
- * Under the hood, this is determined by spawning a Greed Donation Machine and then seeing if it
19
- * exists before removing it.
20
- */
21
- export declare function canRunUnlockAchievements(): boolean;
22
11
  /**
23
12
  * Helper function to get the seed effects (i.e. Easter Eggs) that are enabled for the current run.
24
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAUtC,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAavE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,0BAA0B,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAa,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAQrE,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAavE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,0BAA0B,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -7,19 +7,14 @@ local ____exports = {}
7
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
8
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
9
9
  local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
10
- local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
11
10
  local ____cachedEnumValues = require("arrays.cachedEnumValues")
12
11
  local SEED_EFFECTS = ____cachedEnumValues.SEED_EFFECTS
13
12
  local ____cachedClasses = require("core.cachedClasses")
14
13
  local game = ____cachedClasses.game
15
- local ____constants = require("core.constants")
16
- local VectorZero = ____constants.VectorZero
17
14
  local ____constantsFirstLast = require("core.constantsFirstLast")
18
15
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
19
16
  local ____characters = require("functions.characters")
20
17
  local getCharacterName = ____characters.getCharacterName
21
- local ____entitiesSpecific = require("functions.entitiesSpecific")
22
- local spawnSlot = ____entitiesSpecific.spawnSlot
23
18
  local ____log = require("functions.log")
24
19
  local log = ____log.log
25
20
  local ____types = require("functions.types")
@@ -43,20 +38,6 @@ end
43
38
  function ____exports.anyEasterEggEnabled(self, exceptions)
44
39
  return ____exports.anySeedEffectEnabled(nil, exceptions)
45
40
  end
46
- --- Helper function to see if the current run can unlock achievements. For example, if playing on a
47
- -- set seed or in a victory lap, achievements are disabled.
48
- --
49
- -- This function can cause problems if called multiple times per frame, since it involves spawning
50
- -- an entity. It is recommended that you cache the result at the beginning of every run.
51
- --
52
- -- Under the hood, this is determined by spawning a Greed Donation Machine and then seeing if it
53
- -- exists before removing it.
54
- function ____exports.canRunUnlockAchievements(self)
55
- local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
56
- local canUnlockAchievements = greedDonationMachine:Exists()
57
- greedDonationMachine:Remove()
58
- return canUnlockAchievements
59
- end
60
41
  --- Helper function to get the seed effects (i.e. Easter Eggs) that are enabled for the current run.
61
42
  function ____exports.getSeedEffects(self)
62
43
  local seeds = game:GetSeeds()
@@ -1373,18 +1373,6 @@ export declare function canPickEternalHearts(player: EntityPlayer): boolean;
1373
1373
  */
1374
1374
  export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
1375
1375
 
1376
- /**
1377
- * Helper function to see if the current run can unlock achievements. For example, if playing on a
1378
- * set seed or in a victory lap, achievements are disabled.
1379
- *
1380
- * This function can cause problems if called multiple times per frame, since it involves spawning
1381
- * an entity. It is recommended that you cache the result at the beginning of every run.
1382
- *
1383
- * Under the hood, this is determined by spawning a Greed Donation Machine and then seeing if it
1384
- * exists before removing it.
1385
- */
1386
- export declare function canRunUnlockAchievements(): boolean;
1387
-
1388
1376
  export declare function capitalizeFirstLetter(string: string): string;
1389
1377
 
1390
1378
  /** Maps card names to the values of the `CardType` enum. */
@@ -9013,7 +9001,8 @@ export declare enum ISCFeature {
9013
9001
  SPAWN_COLLECTIBLE = 53,
9014
9002
  STAGE_HISTORY = 54,
9015
9003
  START_AMBUSH = 55,
9016
- TAINTED_LAZARUS_PLAYERS = 56
9004
+ TAINTED_LAZARUS_PLAYERS = 56,
9005
+ UNLOCK_ACHIEVEMENTS_DETECTION = 57
9017
9006
  }
9018
9007
 
9019
9008
  /**
@@ -9080,6 +9069,7 @@ declare interface ISCFeatureToClass {
9080
9069
  [ISCFeature.STAGE_HISTORY]: StageHistory;
9081
9070
  [ISCFeature.START_AMBUSH]: StartAmbush;
9082
9071
  [ISCFeature.TAINTED_LAZARUS_PLAYERS]: TaintedLazarusPlayers;
9072
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]: UnlockAchievementsDetection;
9083
9073
  }
9084
9074
 
9085
9075
  declare type ISCFeatureTuple<T extends readonly ISCFeature[]> = ISCFeature extends T["length"] ? 'The list of features must be a tuple. Use the "as const" assertion when declaring the array.' : T;
@@ -18598,6 +18588,22 @@ export declare const UI_HEART_WIDTH = 12;
18598
18588
  /** Helper type to convert a union to an intersection. */
18599
18589
  export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
18600
18590
 
18591
+ declare class UnlockAchievementsDetection extends Feature {
18592
+ private readonly postGameStartedReordered;
18593
+ /**
18594
+ * Helper function to see if the current run can unlock achievements. For example, if playing on a
18595
+ * set seed or in a victory lap, achievements are disabled.
18596
+ *
18597
+ * Under the hood, this is determined by spawning a Greed Donation Machine at the beginning of the
18598
+ * run and then seeing if it exists before removing it. (The results are cached for the entire
18599
+ * run.)
18600
+ *
18601
+ * In order to use this function, you must upgrade your mod with
18602
+ * `ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION`.
18603
+ */
18604
+ canRunUnlockAchievements(): boolean;
18605
+ }
18606
+
18601
18607
  /**
18602
18608
  * Use this function to enable the custom callbacks and other optional features provided by
18603
18609
  * `isaacscript-common`.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 73.1.1
3
+ isaacscript-common 74.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -18880,6 +18880,8 @@ ____exports.ISCFeature.START_AMBUSH = 55
18880
18880
  ____exports.ISCFeature[____exports.ISCFeature.START_AMBUSH] = "START_AMBUSH"
18881
18881
  ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 56
18882
18882
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
18883
+ ____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION = 57
18884
+ ____exports.ISCFeature[____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION] = "UNLOCK_ACHIEVEMENTS_DETECTION"
18883
18885
  return ____exports
18884
18886
  end,
18885
18887
  ["functions.bitSet128"] = function(...)
@@ -39358,19 +39360,14 @@ local ____exports = {}
39358
39360
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
39359
39361
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
39360
39362
  local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
39361
- local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
39362
39363
  local ____cachedEnumValues = require("arrays.cachedEnumValues")
39363
39364
  local SEED_EFFECTS = ____cachedEnumValues.SEED_EFFECTS
39364
39365
  local ____cachedClasses = require("core.cachedClasses")
39365
39366
  local game = ____cachedClasses.game
39366
- local ____constants = require("core.constants")
39367
- local VectorZero = ____constants.VectorZero
39368
39367
  local ____constantsFirstLast = require("core.constantsFirstLast")
39369
39368
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
39370
39369
  local ____characters = require("functions.characters")
39371
39370
  local getCharacterName = ____characters.getCharacterName
39372
- local ____entitiesSpecific = require("functions.entitiesSpecific")
39373
- local spawnSlot = ____entitiesSpecific.spawnSlot
39374
39371
  local ____log = require("functions.log")
39375
39372
  local log = ____log.log
39376
39373
  local ____types = require("functions.types")
@@ -39394,20 +39391,6 @@ end
39394
39391
  function ____exports.anyEasterEggEnabled(self, exceptions)
39395
39392
  return ____exports.anySeedEffectEnabled(nil, exceptions)
39396
39393
  end
39397
- --- Helper function to see if the current run can unlock achievements. For example, if playing on a
39398
- -- set seed or in a victory lap, achievements are disabled.
39399
- --
39400
- -- This function can cause problems if called multiple times per frame, since it involves spawning
39401
- -- an entity. It is recommended that you cache the result at the beginning of every run.
39402
- --
39403
- -- Under the hood, this is determined by spawning a Greed Donation Machine and then seeing if it
39404
- -- exists before removing it.
39405
- function ____exports.canRunUnlockAchievements(self)
39406
- local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
39407
- local canUnlockAchievements = greedDonationMachine:Exists()
39408
- greedDonationMachine:Remove()
39409
- return canUnlockAchievements
39410
- end
39411
39394
  --- Helper function to get the seed effects (i.e. Easter Eggs) that are enabled for the current run.
39412
39395
  function ____exports.getSeedEffects(self)
39413
39396
  local seeds = game:GetSeeds()
@@ -62136,6 +62119,45 @@ function TaintedLazarusPlayers.prototype.getTaintedLazarusSubPlayer(self, player
62136
62119
  return v.run.subPlayerMap:get(ptrHash)
62137
62120
  end
62138
62121
  __TS__DecorateLegacy({Exported}, TaintedLazarusPlayers.prototype, "getTaintedLazarusSubPlayer", true)
62122
+ return ____exports
62123
+ end,
62124
+ ["classes.features.other.UnlockAchievementsDetection"] = function(...)
62125
+ local ____lualib = require("lualib_bundle")
62126
+ local __TS__Class = ____lualib.__TS__Class
62127
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
62128
+ local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
62129
+ local ____exports = {}
62130
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
62131
+ local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
62132
+ local ____constants = require("core.constants")
62133
+ local VectorZero = ____constants.VectorZero
62134
+ local ____decorators = require("decorators")
62135
+ local Exported = ____decorators.Exported
62136
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
62137
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
62138
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
62139
+ local spawnSlot = ____entitiesSpecific.spawnSlot
62140
+ local ____Feature = require("classes.private.Feature")
62141
+ local Feature = ____Feature.Feature
62142
+ local v = {run = {canRunUnlockAchievements = true}}
62143
+ ____exports.UnlockAchievementsDetection = __TS__Class()
62144
+ local UnlockAchievementsDetection = ____exports.UnlockAchievementsDetection
62145
+ UnlockAchievementsDetection.name = "UnlockAchievementsDetection"
62146
+ __TS__ClassExtends(UnlockAchievementsDetection, Feature)
62147
+ function UnlockAchievementsDetection.prototype.____constructor(self)
62148
+ Feature.prototype.____constructor(self)
62149
+ self.v = v
62150
+ self.postGameStartedReordered = function()
62151
+ local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
62152
+ v.run.canRunUnlockAchievements = greedDonationMachine:Exists()
62153
+ greedDonationMachine:Remove()
62154
+ end
62155
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}}
62156
+ end
62157
+ function UnlockAchievementsDetection.prototype.canRunUnlockAchievements(self)
62158
+ return v.run.canRunUnlockAchievements
62159
+ end
62160
+ __TS__DecorateLegacy({Exported}, UnlockAchievementsDetection.prototype, "canRunUnlockAchievements", true)
62139
62161
  return ____exports
62140
62162
  end,
62141
62163
  ["features"] = function(...)
@@ -62256,6 +62278,8 @@ local ____StartAmbush = require("classes.features.other.StartAmbush")
62256
62278
  local StartAmbush = ____StartAmbush.StartAmbush
62257
62279
  local ____TaintedLazarusPlayers = require("classes.features.other.TaintedLazarusPlayers")
62258
62280
  local TaintedLazarusPlayers = ____TaintedLazarusPlayers.TaintedLazarusPlayers
62281
+ local ____UnlockAchievementsDetection = require("classes.features.other.UnlockAchievementsDetection")
62282
+ local UnlockAchievementsDetection = ____UnlockAchievementsDetection.UnlockAchievementsDetection
62259
62283
  local ____ISCFeature = require("enums.ISCFeature")
62260
62284
  local ISCFeature = ____ISCFeature.ISCFeature
62261
62285
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
@@ -62384,7 +62408,8 @@ function ____exports.getFeatures(self, mod, callbacks)
62384
62408
  [ISCFeature.SPAWN_COLLECTIBLE] = spawnCollectible,
62385
62409
  [ISCFeature.STAGE_HISTORY] = stageHistory,
62386
62410
  [ISCFeature.START_AMBUSH] = __TS__New(StartAmbush, runInNFrames),
62387
- [ISCFeature.TAINTED_LAZARUS_PLAYERS] = __TS__New(TaintedLazarusPlayers)
62411
+ [ISCFeature.TAINTED_LAZARUS_PLAYERS] = __TS__New(TaintedLazarusPlayers),
62412
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION] = __TS__New(UnlockAchievementsDetection)
62388
62413
  }
62389
62414
  return features
62390
62415
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "74.0.0",
3
+ "version": "75.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -0,0 +1,56 @@
1
+ import { SlotVariant } from "isaac-typescript-definitions";
2
+ import { VectorZero } from "../../../core/constants";
3
+ import { Exported } from "../../../decorators";
4
+ import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
5
+ import { spawnSlot } from "../../../functions/entitiesSpecific";
6
+ import { Feature } from "../../private/Feature";
7
+
8
+ const v = {
9
+ run: {
10
+ canRunUnlockAchievements: true,
11
+ },
12
+ };
13
+
14
+ export class UnlockAchievementsDetection extends Feature {
15
+ /** @internal */
16
+ public override v = v;
17
+
18
+ /** @internal */
19
+ constructor() {
20
+ super();
21
+
22
+ this.customCallbacksUsed = [
23
+ [
24
+ ModCallbackCustom.POST_GAME_STARTED_REORDERED,
25
+ this.postGameStartedReordered,
26
+ ],
27
+ ];
28
+ }
29
+
30
+ // ModCallbackCustom.POST_GAME_STARTED_REORDERED
31
+ private readonly postGameStartedReordered = () => {
32
+ const greedDonationMachine = spawnSlot(
33
+ SlotVariant.GREED_DONATION_MACHINE,
34
+ 0,
35
+ VectorZero,
36
+ );
37
+ v.run.canRunUnlockAchievements = greedDonationMachine.Exists();
38
+ greedDonationMachine.Remove();
39
+ };
40
+
41
+ /**
42
+ * Helper function to see if the current run can unlock achievements. For example, if playing on a
43
+ * set seed or in a victory lap, achievements are disabled.
44
+ *
45
+ * Under the hood, this is determined by spawning a Greed Donation Machine at the beginning of the
46
+ * run and then seeing if it exists before removing it. (The results are cached for the entire
47
+ * run.)
48
+ *
49
+ * In order to use this function, you must upgrade your mod with
50
+ * `ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION`.
51
+ */
52
+ @Exported
53
+ public canRunUnlockAchievements(): boolean {
54
+ return v.run.canRunUnlockAchievements;
55
+ }
56
+ }
@@ -59,4 +59,5 @@ export enum ISCFeature {
59
59
  STAGE_HISTORY,
60
60
  START_AMBUSH,
61
61
  TAINTED_LAZARUS_PLAYERS,
62
+ UNLOCK_ACHIEVEMENTS_DETECTION,
62
63
  }
package/src/features.ts CHANGED
@@ -56,6 +56,7 @@ import { SpawnRockAltRewards } from "./classes/features/other/SpawnRockAltReward
56
56
  import { StageHistory } from "./classes/features/other/StageHistory";
57
57
  import { StartAmbush } from "./classes/features/other/StartAmbush";
58
58
  import { TaintedLazarusPlayers } from "./classes/features/other/TaintedLazarusPlayers";
59
+ import { UnlockAchievementsDetection } from "./classes/features/other/UnlockAchievementsDetection";
59
60
  import type { Feature } from "./classes/private/Feature";
60
61
  import { ISCFeature } from "./enums/ISCFeature";
61
62
  import { ModCallbackCustom } from "./enums/ModCallbackCustom";
@@ -123,6 +124,7 @@ export interface ISCFeatureToClass {
123
124
  [ISCFeature.STAGE_HISTORY]: StageHistory;
124
125
  [ISCFeature.START_AMBUSH]: StartAmbush;
125
126
  [ISCFeature.TAINTED_LAZARUS_PLAYERS]: TaintedLazarusPlayers;
127
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]: UnlockAchievementsDetection;
126
128
  }
127
129
 
128
130
  validateInterfaceMatchesEnum<ISCFeatureToClass, ISCFeature>();
@@ -308,6 +310,8 @@ export function getFeatures(
308
310
  [ISCFeature.STAGE_HISTORY]: stageHistory,
309
311
  [ISCFeature.START_AMBUSH]: new StartAmbush(runInNFrames),
310
312
  [ISCFeature.TAINTED_LAZARUS_PLAYERS]: new TaintedLazarusPlayers(),
313
+ [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]:
314
+ new UnlockAchievementsDetection(),
311
315
  } as const satisfies Record<ISCFeature, Feature>;
312
316
 
313
317
  return features;
@@ -1,15 +1,9 @@
1
1
  import type { PlayerType } from "isaac-typescript-definitions";
2
- import {
3
- Challenge,
4
- SeedEffect,
5
- SlotVariant,
6
- } from "isaac-typescript-definitions";
2
+ import { Challenge, SeedEffect } from "isaac-typescript-definitions";
7
3
  import { SEED_EFFECTS } from "../arrays/cachedEnumValues";
8
4
  import { game } from "../core/cachedClasses";
9
- import { VectorZero } from "../core/constants";
10
5
  import { FIRST_CHARACTER } from "../core/constantsFirstLast";
11
6
  import { getCharacterName } from "./characters";
12
- import { spawnSlot } from "./entitiesSpecific";
13
7
  import { log } from "./log";
14
8
  import { isString } from "./types";
15
9
 
@@ -38,28 +32,6 @@ export function anySeedEffectEnabled(exceptions?: SeedEffect[]): boolean {
38
32
  );
39
33
  }
40
34
 
41
- /**
42
- * Helper function to see if the current run can unlock achievements. For example, if playing on a
43
- * set seed or in a victory lap, achievements are disabled.
44
- *
45
- * This function can cause problems if called multiple times per frame, since it involves spawning
46
- * an entity. It is recommended that you cache the result at the beginning of every run.
47
- *
48
- * Under the hood, this is determined by spawning a Greed Donation Machine and then seeing if it
49
- * exists before removing it.
50
- */
51
- export function canRunUnlockAchievements(): boolean {
52
- const greedDonationMachine = spawnSlot(
53
- SlotVariant.GREED_DONATION_MACHINE,
54
- 0,
55
- VectorZero,
56
- );
57
- const canUnlockAchievements = greedDonationMachine.Exists();
58
- greedDonationMachine.Remove();
59
-
60
- return canUnlockAchievements;
61
- }
62
-
63
35
  /**
64
36
  * Helper function to get the seed effects (i.e. Easter Eggs) that are enabled for the current run.
65
37
  */