isaacscript-common 15.1.0 → 15.1.1

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.d.ts CHANGED
@@ -641,6 +641,16 @@ export declare function addSetsToSet<T>(mainSet: Set<T>, ...setsToAdd: Array<Set
641
641
  * adds it to the player.
642
642
  * - This function should only be used inside the `EVALUATE_CACHE` callback.
643
643
  * - In this context, the "tears stat" represents what is shown on the in-game stat UI.
644
+ *
645
+ * For example:
646
+ *
647
+ * ```ts
648
+ * function evaluateCacheTears(player: EntityPlayer) {
649
+ * const numFoo = player.GetNumCollectible(CollectibleTypeCustom.FOO);
650
+ * const tearsStat = numFoo * FOO_TEARS_STAT;
651
+ * addTearsStat(player, tearsStat);
652
+ * }
653
+ * ```
644
654
  */
645
655
  export declare function addTearsStat(player: EntityPlayer, tearsStat: float): void;
646
656
 
@@ -6701,7 +6711,7 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
6701
6711
  /**
6702
6712
  * Helper function for non-TypeScript users to check if an element is in an array.
6703
6713
  *
6704
- * Since this takes O(N) time, using this function is usually a mistake, since you can use a `Map`
6714
+ * Since this takes O(N) time, using this function is usually a mistake, since you can use a `Set`
6705
6715
  * data structure to get O(1) lookups.
6706
6716
  *
6707
6717
  * Internally, this just calls `array.includes`.
@@ -10647,10 +10657,20 @@ declare class ModdedElementSets extends Feature {
10647
10657
  * mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
10648
10658
  * that automatically subscribe to callbacks.
10649
10659
  *
10660
+ * If your feature has variables that are managed by the save data manager, put them as a `v` class
10661
+ * member and they will automatically be registered with the save data manager when the class is
10662
+ * instantiated.
10663
+ *
10650
10664
  * For example:
10651
10665
  *
10652
10666
  * ```ts
10653
10667
  * export class MyFeature extends ModFeature {
10668
+ * v = {
10669
+ * run: {
10670
+ * foo: 123,
10671
+ * }
10672
+ * }
10673
+ *
10654
10674
  * @Callback(ModCallback.POST_GAME_STARTED)
10655
10675
  * postGameStarted(isContinued: boolean): void {
10656
10676
  * Isaac.DebugString(`Callback fired: POST_GAME_STARTED`);
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 15.1.0
3
+ isaacscript-common 15.1.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -48279,7 +48279,6 @@ return ____exports
48279
48279
  ["src.classes.ModFeature"] = function(...)
48280
48280
  local ____lualib = require("lualib_bundle")
48281
48281
  local __TS__Class = ____lualib.__TS__Class
48282
- local __TS__Spread = ____lualib.__TS__Spread
48283
48282
  local ____exports = {}
48284
48283
  local checkAddDecoratedCallbacks, checkAddDecoratedCallbacksCustom, checkRegisterSaveDataManager
48285
48284
  local ____tstlClass = require("src.functions.tstlClass")
@@ -48287,22 +48286,56 @@ local getTSTLClassConstructor = ____tstlClass.getTSTLClassConstructor
48287
48286
  local getTSTLClassName = ____tstlClass.getTSTLClassName
48288
48287
  local ____types = require("src.functions.types")
48289
48288
  local isTable = ____types.isTable
48290
- function checkAddDecoratedCallbacks(self, mod, modFeatureConstructor)
48289
+ function checkAddDecoratedCallbacks(self, mod, modFeatureConstructor, modFeature)
48291
48290
  local addCallbackArgs = modFeatureConstructor[____exports.ADD_CALLBACK_ARGS_KEY]
48292
48291
  if addCallbackArgs == nil then
48293
48292
  return
48294
48293
  end
48294
+ local tstlClassName = getTSTLClassName(nil, modFeatureConstructor) or "Unknown"
48295
48295
  for ____, args in ipairs(addCallbackArgs) do
48296
- mod:AddCallback(__TS__Spread(args))
48296
+ local parameters = args
48297
+ local modCallback = table.remove(parameters, 1)
48298
+ if modCallback == nil then
48299
+ error("Failed to get the ModCallback from the parameters for class: " .. tstlClassName)
48300
+ end
48301
+ local callback = table.remove(parameters, 1)
48302
+ if callback == nil then
48303
+ error("Failed to get the callback from the parameters for class: " .. tstlClassName)
48304
+ end
48305
+ local function newCallback(____, ...)
48306
+ callback(modFeature, ...)
48307
+ end
48308
+ mod:AddCallback(
48309
+ modCallback,
48310
+ newCallback,
48311
+ table.unpack(parameters)
48312
+ )
48297
48313
  end
48298
48314
  end
48299
- function checkAddDecoratedCallbacksCustom(self, mod, modFeatureConstructor)
48315
+ function checkAddDecoratedCallbacksCustom(self, mod, modFeatureConstructor, modFeature)
48300
48316
  local addCallbackCustomArgs = modFeatureConstructor[____exports.ADD_CALLBACK_CUSTOM_ARGS_KEY]
48301
48317
  if addCallbackCustomArgs == nil then
48302
48318
  return
48303
48319
  end
48320
+ local tstlClassName = getTSTLClassName(nil, modFeatureConstructor) or "Unknown"
48304
48321
  for ____, args in ipairs(addCallbackCustomArgs) do
48305
- mod:AddCallbackCustom(__TS__Spread(args))
48322
+ local parameters = args
48323
+ local modCallbackCustom = table.remove(parameters, 1)
48324
+ if modCallbackCustom == nil then
48325
+ error("Failed to get the ModCallbackCustom from the parameters for class: " .. tstlClassName)
48326
+ end
48327
+ local callback = table.remove(parameters, 1)
48328
+ if callback == nil then
48329
+ error("Failed to get the callback from the parameters for class: " .. tstlClassName)
48330
+ end
48331
+ local function newCallback(____, ...)
48332
+ callback(modFeature, ...)
48333
+ end
48334
+ mod:AddCallbackCustom(
48335
+ modCallbackCustom,
48336
+ newCallback,
48337
+ table.unpack(parameters)
48338
+ )
48306
48339
  end
48307
48340
  end
48308
48341
  function checkRegisterSaveDataManager(self, mod, modFeature)
@@ -48333,8 +48366,8 @@ function ModFeature.prototype.____constructor(self, mod)
48333
48366
  error("Failed to get the TSTL class constructor for a mod feature.")
48334
48367
  end
48335
48368
  local modFeatureConstructor = constructor
48336
- checkAddDecoratedCallbacks(nil, mod, modFeatureConstructor)
48337
- checkAddDecoratedCallbacksCustom(nil, mod, modFeatureConstructor)
48369
+ checkAddDecoratedCallbacks(nil, mod, modFeatureConstructor, self)
48370
+ checkAddDecoratedCallbacksCustom(nil, mod, modFeatureConstructor, self)
48338
48371
  checkRegisterSaveDataManager(nil, mod, self)
48339
48372
  end
48340
48373
  return ____exports
@@ -48712,6 +48745,8 @@ local ____exports = {}
48712
48745
  local ____ModFeature = require("src.classes.ModFeature")
48713
48746
  local ADD_CALLBACK_ARGS_KEY = ____ModFeature.ADD_CALLBACK_ARGS_KEY
48714
48747
  local ADD_CALLBACK_CUSTOM_ARGS_KEY = ____ModFeature.ADD_CALLBACK_CUSTOM_ARGS_KEY
48748
+ local ____tstlClass = require("src.functions.tstlClass")
48749
+ local getTSTLClassName = ____tstlClass.getTSTLClassName
48715
48750
  function ____exports.Callback(self, modCallback, ...)
48716
48751
  local optionalArgs = {...}
48717
48752
  return function(____, target, propertyKey, _descriptor)
@@ -48723,6 +48758,10 @@ function ____exports.Callback(self, modCallback, ...)
48723
48758
  __TS__Spread(optionalArgs)
48724
48759
  }
48725
48760
  local constructor = target.constructor
48761
+ if constructor == nil then
48762
+ local tstlClassName = getTSTLClassName(nil, target) or "Unknown"
48763
+ error(("Failed to get the constructor for class \"" .. tstlClassName) .. "\". Did you decorate a static method? You can only decorate non-static class methods, because the \"Mod\" object is not present before the class is instantiated.")
48764
+ end
48726
48765
  if not (constructor[ADD_CALLBACK_ARGS_KEY] ~= nil) then
48727
48766
  constructor[ADD_CALLBACK_ARGS_KEY] = {}
48728
48767
  end
@@ -48741,6 +48780,10 @@ function ____exports.CallbackCustom(self, modCallbackCustom, ...)
48741
48780
  __TS__Spread(optionalArgs)
48742
48781
  }
48743
48782
  local constructor = target.constructor
48783
+ if constructor == nil then
48784
+ local tstlClassName = getTSTLClassName(nil, target) or "Unknown"
48785
+ error(("Failed to get the constructor for class \"" .. tstlClassName) .. "\". Did you decorate a static method? You can only decorate non-static class methods, because the \"Mod\" object is not present before the class is instantiated.")
48786
+ end
48744
48787
  if not (constructor[ADD_CALLBACK_CUSTOM_ARGS_KEY] ~= nil) then
48745
48788
  constructor[ADD_CALLBACK_CUSTOM_ARGS_KEY] = {}
48746
48789
  end
@@ -6,10 +6,20 @@ export declare const ADD_CALLBACK_CUSTOM_ARGS_KEY = "__addCallbackCustomArgs";
6
6
  * mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
7
7
  * that automatically subscribe to callbacks.
8
8
  *
9
+ * If your feature has variables that are managed by the save data manager, put them as a `v` class
10
+ * member and they will automatically be registered with the save data manager when the class is
11
+ * instantiated.
12
+ *
9
13
  * For example:
10
14
  *
11
15
  * ```ts
12
16
  * export class MyFeature extends ModFeature {
17
+ * v = {
18
+ * run: {
19
+ * foo: 123,
20
+ * }
21
+ * }
22
+ *
13
23
  * @Callback(ModCallback.POST_GAME_STARTED)
14
24
  * postGameStarted(isContinued: boolean): void {
15
25
  * Isaac.DebugString(`Callback fired: POST_GAME_STARTED`);
@@ -1 +1 @@
1
- {"version":3,"file":"ModFeature.d.ts","sourceRoot":"","sources":["../../../src/classes/ModFeature.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAOtE;;;;;;;;;;;;;;;GAeG;AAEH,qBAAa,UAAU;gBACT,GAAG,EAAE,eAAe;CAWjC"}
1
+ {"version":3,"file":"ModFeature.d.ts","sourceRoot":"","sources":["../../../src/classes/ModFeature.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAOtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,qBAAa,UAAU;gBACT,GAAG,EAAE,eAAe;CAWjC"}
@@ -1,6 +1,5 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__Class = ____lualib.__TS__Class
3
- local __TS__Spread = ____lualib.__TS__Spread
4
3
  local ____exports = {}
5
4
  local checkAddDecoratedCallbacks, checkAddDecoratedCallbacksCustom, checkRegisterSaveDataManager
6
5
  local ____tstlClass = require("src.functions.tstlClass")
@@ -8,22 +7,60 @@ local getTSTLClassConstructor = ____tstlClass.getTSTLClassConstructor
8
7
  local getTSTLClassName = ____tstlClass.getTSTLClassName
9
8
  local ____types = require("src.functions.types")
10
9
  local isTable = ____types.isTable
11
- function checkAddDecoratedCallbacks(self, mod, modFeatureConstructor)
10
+ function checkAddDecoratedCallbacks(self, mod, modFeatureConstructor, modFeature)
12
11
  local addCallbackArgs = modFeatureConstructor[____exports.ADD_CALLBACK_ARGS_KEY]
13
12
  if addCallbackArgs == nil then
14
13
  return
15
14
  end
15
+ local tstlClassName = getTSTLClassName(nil, modFeatureConstructor) or "Unknown"
16
16
  for ____, args in ipairs(addCallbackArgs) do
17
- mod:AddCallback(__TS__Spread(args))
17
+ local parameters = args
18
+ local modCallback = table.remove(parameters, 1)
19
+ if modCallback == nil then
20
+ error("Failed to get the ModCallback from the parameters for class: " .. tstlClassName)
21
+ end
22
+ local callback = table.remove(parameters, 1)
23
+ if callback == nil then
24
+ error("Failed to get the callback from the parameters for class: " .. tstlClassName)
25
+ end
26
+ --- We need to wrap the callback in a new function so that we can explicitly pass the class as
27
+ -- the first argument. (Otherwise, the method will not be able to properly access `this`.
28
+ local function newCallback(____, ...)
29
+ callback(modFeature, ...)
30
+ end
31
+ mod:AddCallback(
32
+ modCallback,
33
+ newCallback,
34
+ table.unpack(parameters)
35
+ )
18
36
  end
19
37
  end
20
- function checkAddDecoratedCallbacksCustom(self, mod, modFeatureConstructor)
38
+ function checkAddDecoratedCallbacksCustom(self, mod, modFeatureConstructor, modFeature)
21
39
  local addCallbackCustomArgs = modFeatureConstructor[____exports.ADD_CALLBACK_CUSTOM_ARGS_KEY]
22
40
  if addCallbackCustomArgs == nil then
23
41
  return
24
42
  end
43
+ local tstlClassName = getTSTLClassName(nil, modFeatureConstructor) or "Unknown"
25
44
  for ____, args in ipairs(addCallbackCustomArgs) do
26
- mod:AddCallbackCustom(__TS__Spread(args))
45
+ local parameters = args
46
+ local modCallbackCustom = table.remove(parameters, 1)
47
+ if modCallbackCustom == nil then
48
+ error("Failed to get the ModCallbackCustom from the parameters for class: " .. tstlClassName)
49
+ end
50
+ local callback = table.remove(parameters, 1)
51
+ if callback == nil then
52
+ error("Failed to get the callback from the parameters for class: " .. tstlClassName)
53
+ end
54
+ --- We need to wrap the callback in a new function so that we can explicitly pass the class as
55
+ -- the first argument. (Otherwise, the method will not be able to properly access `this`.
56
+ local function newCallback(____, ...)
57
+ callback(modFeature, ...)
58
+ end
59
+ mod:AddCallbackCustom(
60
+ modCallbackCustom,
61
+ newCallback,
62
+ table.unpack(parameters)
63
+ )
27
64
  end
28
65
  end
29
66
  function checkRegisterSaveDataManager(self, mod, modFeature)
@@ -49,10 +86,19 @@ ____exports.ADD_CALLBACK_CUSTOM_ARGS_KEY = "__addCallbackCustomArgs"
49
86
  -- mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
50
87
  -- that automatically subscribe to callbacks.
51
88
  --
89
+ -- If your feature has variables that are managed by the save data manager, put them as a `v` class
90
+ -- member and they will automatically be registered with the save data manager when the class is
91
+ -- instantiated.
92
+ --
52
93
  -- For example:
53
94
  --
54
95
  -- ```ts
55
96
  -- export class MyFeature extends ModFeature {
97
+ -- v = {
98
+ -- run: {
99
+ -- foo: 123,
100
+ -- }
101
+ -- }
56
102
  --
57
103
  -- @Callback (ModCallback.POST_GAME_STARTED)
58
104
  -- postGameStarted(isContinued: boolean): void {
@@ -69,8 +115,8 @@ function ModFeature.prototype.____constructor(self, mod)
69
115
  error("Failed to get the TSTL class constructor for a mod feature.")
70
116
  end
71
117
  local modFeatureConstructor = constructor
72
- checkAddDecoratedCallbacks(nil, mod, modFeatureConstructor)
73
- checkAddDecoratedCallbacksCustom(nil, mod, modFeatureConstructor)
118
+ checkAddDecoratedCallbacks(nil, mod, modFeatureConstructor, self)
119
+ checkAddDecoratedCallbacksCustom(nil, mod, modFeatureConstructor, self)
74
120
  checkRegisterSaveDataManager(nil, mod, self)
75
121
  end
76
122
  return ____exports
@@ -36,7 +36,7 @@ export declare function forEach<T>(array: T[], func: (value: T, index: number, a
36
36
  /**
37
37
  * Helper function for non-TypeScript users to check if an element is in an array.
38
38
  *
39
- * Since this takes O(N) time, using this function is usually a mistake, since you can use a `Map`
39
+ * Since this takes O(N) time, using this function is usually a mistake, since you can use a `Set`
40
40
  * data structure to get O(1) lookups.
41
41
  *
42
42
  * Internally, this just calls `array.includes`.
@@ -36,7 +36,7 @@ function ____exports.forEach(self, array, func)
36
36
  end
37
37
  --- Helper function for non-TypeScript users to check if an element is in an array.
38
38
  --
39
- -- Since this takes O(N) time, using this function is usually a mistake, since you can use a `Map`
39
+ -- Since this takes O(N) time, using this function is usually a mistake, since you can use a `Set`
40
40
  -- data structure to get O(1) lookups.
41
41
  --
42
42
  -- Internally, this just calls `array.includes`.
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/functions/decorators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAGL,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAC5C,WAAW,EAAE,CAAC,EACd,GAAG,YAAY,EAAE,WAAW,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,kGAIvC,MAAM,+CAElB,IAAI,CAwBR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,iBAAiB,EACxD,iBAAiB,EAAE,CAAC,EACpB,GAAG,YAAY,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,wGAO7C,MAAM,+CAElB,IAAI,CA0BR"}
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/functions/decorators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAGL,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAC5C,WAAW,EAAE,CAAC,EACd,GAAG,YAAY,EAAE,WAAW,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,kGAIvC,MAAM,+CAElB,IAAI,CA+BR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,iBAAiB,EACxD,iBAAiB,EAAE,CAAC,EACpB,GAAG,YAAY,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,wGAO7C,MAAM,+CAElB,IAAI,CAiCR"}
@@ -4,6 +4,8 @@ local ____exports = {}
4
4
  local ____ModFeature = require("src.classes.ModFeature")
5
5
  local ADD_CALLBACK_ARGS_KEY = ____ModFeature.ADD_CALLBACK_ARGS_KEY
6
6
  local ADD_CALLBACK_CUSTOM_ARGS_KEY = ____ModFeature.ADD_CALLBACK_CUSTOM_ARGS_KEY
7
+ local ____tstlClass = require("src.functions.tstlClass")
8
+ local getTSTLClassName = ____tstlClass.getTSTLClassName
7
9
  --- A decorator function that signifies that the decorated class method should be automatically
8
10
  -- registered with `Mod.AddCallback`.
9
11
  --
@@ -19,6 +21,10 @@ function ____exports.Callback(self, modCallback, ...)
19
21
  __TS__Spread(optionalArgs)
20
22
  }
21
23
  local constructor = target.constructor
24
+ if constructor == nil then
25
+ local tstlClassName = getTSTLClassName(nil, target) or "Unknown"
26
+ error(("Failed to get the constructor for class \"" .. tstlClassName) .. "\". Did you decorate a static method? You can only decorate non-static class methods, because the \"Mod\" object is not present before the class is instantiated.")
27
+ end
22
28
  if not (constructor[ADD_CALLBACK_ARGS_KEY] ~= nil) then
23
29
  constructor[ADD_CALLBACK_ARGS_KEY] = {}
24
30
  end
@@ -41,6 +47,10 @@ function ____exports.CallbackCustom(self, modCallbackCustom, ...)
41
47
  __TS__Spread(optionalArgs)
42
48
  }
43
49
  local constructor = target.constructor
50
+ if constructor == nil then
51
+ local tstlClassName = getTSTLClassName(nil, target) or "Unknown"
52
+ error(("Failed to get the constructor for class \"" .. tstlClassName) .. "\". Did you decorate a static method? You can only decorate non-static class methods, because the \"Mod\" object is not present before the class is instantiated.")
53
+ end
44
54
  if not (constructor[ADD_CALLBACK_CUSTOM_ARGS_KEY] ~= nil) then
45
55
  constructor[ADD_CALLBACK_CUSTOM_ARGS_KEY] = {}
46
56
  end
@@ -6,6 +6,16 @@
6
6
  * adds it to the player.
7
7
  * - This function should only be used inside the `EVALUATE_CACHE` callback.
8
8
  * - In this context, the "tears stat" represents what is shown on the in-game stat UI.
9
+ *
10
+ * For example:
11
+ *
12
+ * ```ts
13
+ * function evaluateCacheTears(player: EntityPlayer) {
14
+ * const numFoo = player.GetNumCollectible(CollectibleTypeCustom.FOO);
15
+ * const tearsStat = numFoo * FOO_TEARS_STAT;
16
+ * addTearsStat(player, tearsStat);
17
+ * }
18
+ * ```
9
19
  */
10
20
  export declare function addTearsStat(player: EntityPlayer, tearsStat: float): void;
11
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tears.d.ts","sourceRoot":"","sources":["../../../src/functions/tears.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB1D"}
1
+ {"version":3,"file":"tears.d.ts","sourceRoot":"","sources":["../../../src/functions/tears.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB1D"}
@@ -18,6 +18,16 @@ end
18
18
  -- adds it to the player.
19
19
  -- - This function should only be used inside the `EVALUATE_CACHE` callback.
20
20
  -- - In this context, the "tears stat" represents what is shown on the in-game stat UI.
21
+ --
22
+ -- For example:
23
+ --
24
+ -- ```ts
25
+ -- function evaluateCacheTears(player: EntityPlayer) {
26
+ -- const numFoo = player.GetNumCollectible(CollectibleTypeCustom.FOO);
27
+ -- const tearsStat = numFoo * FOO_TEARS_STAT;
28
+ -- addTearsStat(player, tearsStat);
29
+ -- }
30
+ -- ```
21
31
  function ____exports.addTearsStat(self, player, tearsStat)
22
32
  local existingTearsStat = ____exports.getTearsStat(nil, player.MaxFireDelay)
23
33
  local newTearsStat = existingTearsStat + tearsStat
@@ -0,0 +1,169 @@
1
+ export * from "./classes/DefaultMap";
2
+ export * from "./classes/ModFeature";
3
+ export * from "./classes/ModUpgradedBase";
4
+ export * from "./core/cachedClasses";
5
+ export * from "./core/constants";
6
+ export * from "./core/constantsFirstLast";
7
+ export * from "./core/upgradeMod";
8
+ export * from "./enums/AmbushType";
9
+ export * from "./enums/CornerType";
10
+ export * from "./enums/HealthType";
11
+ export * from "./enums/ISCFeature";
12
+ export * from "./enums/LadderSubTypeCustom";
13
+ export * from "./enums/ModCallbackCustom";
14
+ export * from "./enums/PocketItemType";
15
+ export * from "./enums/RockAltType";
16
+ export * from "./enums/SaveDataKey";
17
+ export * from "./enums/SerializationBrand";
18
+ export * from "./enums/SerializationType";
19
+ export * from "./enums/SlotDestructionType";
20
+ export * from "./enums/StatType";
21
+ export * from "./functions/ambush";
22
+ export * from "./functions/array";
23
+ export * from "./functions/arrayLua";
24
+ export * from "./functions/benchmark";
25
+ export * from "./functions/bitSet128";
26
+ export * from "./functions/bitwise";
27
+ export * from "./functions/bombs";
28
+ export * from "./functions/bosses";
29
+ export * from "./functions/cards";
30
+ export * from "./functions/challenges";
31
+ export * from "./functions/characters";
32
+ export * from "./functions/charge";
33
+ export * from "./functions/chargeBar";
34
+ export * from "./functions/collectibles";
35
+ export * from "./functions/collectibleTag";
36
+ export * from "./functions/color";
37
+ export * from "./functions/curses";
38
+ export * from "./functions/debugFunctions";
39
+ export * from "./functions/decorators";
40
+ export * from "./functions/deepCopy";
41
+ export * from "./functions/deepCopyTests";
42
+ export * from "./functions/dimensions";
43
+ export * from "./functions/direction";
44
+ export * from "./functions/doors";
45
+ export * from "./functions/easing";
46
+ export * from "./functions/effects";
47
+ export * from "./functions/emptyRoom";
48
+ export * from "./functions/entities";
49
+ export * from "./functions/entitiesSpecific";
50
+ export * from "./functions/entityTypes";
51
+ export * from "./functions/enums";
52
+ export * from "./functions/familiars";
53
+ export * from "./functions/flag";
54
+ export * from "./functions/globals";
55
+ export * from "./functions/gridEntities";
56
+ export * from "./functions/gridEntitiesSpecific";
57
+ export * from "./functions/gridIndex";
58
+ export * from "./functions/hex";
59
+ export * from "./functions/initArray";
60
+ export * from "./functions/input";
61
+ export * from "./functions/isaacAPIClass";
62
+ export * from "./functions/jsonHelpers";
63
+ export * from "./functions/jsonRoom";
64
+ export * from "./functions/kColor";
65
+ export * from "./functions/language";
66
+ export * from "./functions/level";
67
+ export * from "./functions/levelGrid";
68
+ export * from "./functions/log";
69
+ export * from "./functions/logEntities";
70
+ export * from "./functions/logMisc";
71
+ export * from "./functions/map";
72
+ export * from "./functions/math";
73
+ export * from "./functions/merge";
74
+ export * from "./functions/mergeTests";
75
+ export * from "./functions/minimap";
76
+ export * from "./functions/nextStage";
77
+ export * from "./functions/npcs";
78
+ export * from "./functions/pickups";
79
+ export * from "./functions/pickupsSpecific";
80
+ export * from "./functions/pickupVariants";
81
+ export * from "./functions/pills";
82
+ export * from "./functions/playerCenter";
83
+ export * from "./functions/playerDataStructures";
84
+ export * from "./functions/playerHealth";
85
+ export * from "./functions/playerIndex";
86
+ export * from "./functions/players";
87
+ export * from "./functions/playerStats";
88
+ export * from "./functions/pocketItems";
89
+ export * from "./functions/positionVelocity";
90
+ export * from "./functions/pressurePlate";
91
+ export * from "./functions/projectiles";
92
+ export * from "./functions/random";
93
+ export * from "./functions/revive";
94
+ export * from "./functions/rng";
95
+ export * from "./functions/rockAlt";
96
+ export * from "./functions/roomData";
97
+ export * from "./functions/roomGrid";
98
+ export * from "./functions/rooms";
99
+ export * from "./functions/roomShape";
100
+ export * from "./functions/roomShapeWalls";
101
+ export * from "./functions/roomTransition";
102
+ export * from "./functions/run";
103
+ export * from "./functions/seeds";
104
+ export * from "./functions/serialization";
105
+ export * from "./functions/set";
106
+ export * from "./functions/sound";
107
+ export * from "./functions/spawnCollectible";
108
+ export * from "./functions/sprites";
109
+ export * from "./functions/stage";
110
+ export * from "./functions/string";
111
+ export * from "./functions/table";
112
+ export * from "./functions/tears";
113
+ export * from "./functions/transformations";
114
+ export * from "./functions/trinketGive";
115
+ export * from "./functions/trinkets";
116
+ export * from "./functions/tstlClass";
117
+ export * from "./functions/types";
118
+ export * from "./functions/ui";
119
+ export * from "./functions/utils";
120
+ export * from "./functions/vector";
121
+ export * from "./functions/weighted";
122
+ export * from "./interfaces/ChargeBarSprites";
123
+ export * from "./interfaces/Corner";
124
+ export * from "./interfaces/CustomStageTSConfig";
125
+ export * from "./interfaces/GridEntityCustomData";
126
+ export * from "./interfaces/JSONRoomsFile";
127
+ export * from "./interfaces/PlayerHealth";
128
+ export * from "./interfaces/PocketItemDescription";
129
+ export * from "./interfaces/RoomDescription";
130
+ export * from "./interfaces/SaveData";
131
+ export * from "./interfaces/StatTypeType";
132
+ export * from "./interfaces/TrinketSituation";
133
+ export * from "./maps/cardNameToTypeMap";
134
+ export * from "./maps/characterNameToTypeMap";
135
+ export * from "./maps/pillNameToEffectMap";
136
+ export * from "./maps/roomNameToTypeMap";
137
+ export * from "./maps/transformationNameToPlayerFormMap";
138
+ export * from "./objects/colors";
139
+ export * from "./objects/kColors";
140
+ export * from "./types/AllButFirst";
141
+ export * from "./types/AllButLast";
142
+ export * from "./types/AnyClass";
143
+ export * from "./types/AnyEntity";
144
+ export * from "./types/AnyFunction";
145
+ export * from "./types/AnyGridEntity";
146
+ export * from "./types/CollectibleIndex";
147
+ export * from "./types/ConversionHeartSubType";
148
+ export * from "./types/FunctionTuple";
149
+ export * from "./types/HasAllEnumKeys";
150
+ export * from "./types/HasFunction";
151
+ export * from "./types/Immutable";
152
+ export * from "./types/LowercaseKeys";
153
+ export * from "./types/ModUpgraded";
154
+ export * from "./types/PickingUpItem";
155
+ export * from "./types/PickupIndex";
156
+ export * from "./types/PlayerIndex";
157
+ export * from "./types/PossibleStatType";
158
+ export * from "./types/PublicInterface";
159
+ export * from "./types/StartsWithLowercase";
160
+ export * from "./types/StartsWithUppercase";
161
+ export * from "./types/TSTLClass";
162
+ export * from "./types/TupleToIntersection";
163
+ export * from "./types/TupleToUnion";
164
+ export * from "./types/UnionToIntersection";
165
+ export * from "./types/UppercaseKeys";
166
+ export * from "./types/WeightedArray";
167
+ export * from "./types/Writable";
168
+ export * from "isaac-typescript-definitions";
169
+ //# sourceMappingURL=indexLua.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexLua.d.ts","sourceRoot":"","sources":["../../../../../packages/isaacscript-common/src/indexLua.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cA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