isaacscript-common 7.12.0 → 7.13.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.
@@ -1,3 +1,24 @@
1
- export declare function customPickupInit(): void;
2
- export declare function registerCustomPickup(): void;
1
+ import { PickupVariant } from "isaac-typescript-definitions";
2
+ export declare function customPickupInit(mod: Mod): void;
3
+ /**
4
+ * Helper function to register a custom pickup with the IsaacScript standard library. Use this
5
+ * feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
6
+ *
7
+ * When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
8
+ * will be immediately removed, and an effect showing the pickup's respective `Collect` animation
9
+ * will be spawned. (This emulates how a normal vanilla pickup would work.)
10
+ *
11
+ * Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
12
+ * of "5" and be associated with an anm2 file that has a "Collect" animation.
13
+ *
14
+ * @param pickupVariantCustom The variant for the corresponding custom pickup.
15
+ * @param subType The sub-type for the corresponding custom pickup.
16
+ * @param collectFunc The function to run when the player collects this pickup.
17
+ * @param collisionFunc Optional. The function to run when a player collides with the pickup.
18
+ * Default is a function that always returns true, meaning that the player will
19
+ * always immediately collect the pickup when they collide with it. Specify
20
+ * this function if your pickup should only be able to be collected under
21
+ * certain conditions.
22
+ */
23
+ export declare function registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (player: EntityPlayer) => void, collisionFunc?: (player: EntityPlayer) => boolean): void;
3
24
  //# sourceMappingURL=customPickup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customPickup.d.ts","sourceRoot":"","sources":["../../src/features/customPickup.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,IAAI,IAAI,CAAG;AAE3C,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
1
+ {"version":3,"file":"customPickup.d.ts","sourceRoot":"","sources":["../../src/features/customPickup.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,8BAA8B,CAAC;AA6BtC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAO/C;AAuDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,mBAAmB,EAAE,aAAa,EAClC,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,EAC3C,aAAa,GAAE,CAAC,MAAM,EAAE,YAAY,KAAK,OAAoB,GAC5D,IAAI,CAaN"}
@@ -1,10 +1,85 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
1
4
  local ____exports = {}
5
+ local prePickupCollision, postEffectRenderPickupEffect, PICKUP_EFFECT_VARIANT, PICKUP_EFFECT_SUB_TYPE, customPickupFunctionsMap
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
8
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
9
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
2
10
  local ____featuresInitialized = require("featuresInitialized")
3
11
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
12
+ local ____entities = require("functions.entities")
13
+ local getEntityID = ____entities.getEntityID
14
+ local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
15
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
16
+ local spawnEffect = ____entitiesSpecific.spawnEffect
17
+ function prePickupCollision(self, pickup, collider)
18
+ local entityID = getEntityID(nil, pickup)
19
+ local customPickupFunctions = customPickupFunctionsMap:get(entityID)
20
+ if customPickupFunctions == nil then
21
+ return nil
22
+ end
23
+ local player = collider:ToPlayer()
24
+ if player == nil then
25
+ return nil
26
+ end
27
+ local shouldPickup = customPickupFunctions:collisionFunc(player)
28
+ if not shouldPickup then
29
+ return nil
30
+ end
31
+ pickup:Remove()
32
+ local pickupSprite = pickup:GetSprite()
33
+ local fileName = pickupSprite:GetFilename()
34
+ local effect = spawnEffect(nil, PICKUP_EFFECT_VARIANT, PICKUP_EFFECT_SUB_TYPE, pickup.Position)
35
+ local effectSprite = effect:GetSprite()
36
+ effectSprite:Load(fileName, true)
37
+ effectSprite:Play("Collect", true)
38
+ customPickupFunctions:collectFunc(player)
39
+ return nil
40
+ end
41
+ function postEffectRenderPickupEffect(self, effect)
42
+ if effect.SubType ~= PICKUP_EFFECT_SUB_TYPE then
43
+ return
44
+ end
45
+ local sprite = effect:GetSprite()
46
+ if sprite:IsFinished("Collect") then
47
+ effect:Remove()
48
+ end
49
+ end
4
50
  local FEATURE_NAME = "customPickup"
5
- function ____exports.customPickupInit(self)
51
+ PICKUP_EFFECT_VARIANT = EffectVariant.LADDER
52
+ PICKUP_EFFECT_SUB_TYPE = 103
53
+ customPickupFunctionsMap = __TS__New(Map)
54
+ function ____exports.customPickupInit(self, mod)
55
+ mod:AddCallback(ModCallback.PRE_PICKUP_COLLISION, prePickupCollision)
56
+ mod:AddCallback(ModCallback.POST_EFFECT_RENDER, postEffectRenderPickupEffect, PICKUP_EFFECT_VARIANT)
6
57
  end
7
- function ____exports.registerCustomPickup(self)
58
+ --- Helper function to register a custom pickup with the IsaacScript standard library. Use this
59
+ -- feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
60
+ --
61
+ -- When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
62
+ -- will be immediately removed, and an effect showing the pickup's respective `Collect` animation
63
+ -- will be spawned. (This emulates how a normal vanilla pickup would work.)
64
+ --
65
+ -- Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
66
+ -- of "5" and be associated with an anm2 file that has a "Collect" animation.
67
+ --
68
+ -- @param pickupVariantCustom The variant for the corresponding custom pickup.
69
+ -- @param subType The sub-type for the corresponding custom pickup.
70
+ -- @param collectFunc The function to run when the player collects this pickup.
71
+ -- @param collisionFunc Optional. The function to run when a player collides with the pickup.
72
+ -- Default is a function that always returns true, meaning that the player will
73
+ -- always immediately collect the pickup when they collide with it. Specify
74
+ -- this function if your pickup should only be able to be collected under
75
+ -- certain conditions.
76
+ function ____exports.registerCustomPickup(self, pickupVariantCustom, subType, collectFunc, collisionFunc)
77
+ if collisionFunc == nil then
78
+ collisionFunc = function() return true end
79
+ end
8
80
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
81
+ local entityID = getEntityIDFromConstituents(nil, EntityType.PICKUP, pickupVariantCustom, subType)
82
+ local customPickupFunctions = {collectFunc = collectFunc, collisionFunc = collisionFunc}
83
+ customPickupFunctionsMap:set(entityID, customPickupFunctions)
9
84
  end
10
85
  return ____exports
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local Set = ____lualib.Set
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
- local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT, BACKDROP_EFFECT_SUBTYPE
5
+ local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT, BACKDROP_EFFECT_SUB_TYPE
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
8
8
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
@@ -42,7 +42,7 @@ function spawnWallEntity(self, customStage, rng, isExtraWall)
42
42
  local wallEffect = spawnEffectWithSeed(
43
43
  nil,
44
44
  BACKDROP_EFFECT_VARIANT,
45
- BACKDROP_EFFECT_SUBTYPE,
45
+ BACKDROP_EFFECT_SUB_TYPE,
46
46
  VectorZero,
47
47
  seed
48
48
  )
@@ -181,7 +181,7 @@ WALL_OFFSET = Vector(-80, -80)
181
181
  L_FLOOR_ANM2_LAYERS = {16, 17}
182
182
  N_FLOOR_ANM2_LAYERS = {18, 19}
183
183
  BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER
184
- BACKDROP_EFFECT_SUBTYPE = 101
184
+ BACKDROP_EFFECT_SUB_TYPE = 101
185
185
  local BACKDROP_ROOM_TYPE_SET = __TS__New(Set, {RoomType.DEFAULT, RoomType.BOSS, RoomType.MINI_BOSS})
186
186
  function ____exports.setCustomStageBackdrop(self, customStage)
187
187
  local room = game:GetRoom()
@@ -21,7 +21,7 @@ local v = ____v.default
21
21
  -- We arbitrarily choose a ladder for this purpose because it will not automatically despawn after
22
22
  -- time passes, like most other effects.
23
23
  local SHADOW_EFFECT_VARIANT = EffectVariant.LADDER
24
- local SHADOW_EFFECT_SUBTYPE = 102
24
+ local SHADOW_EFFECT_SUB_TYPE = 102
25
25
  --- The animation comes from StageAPI.
26
26
  local ROOM_SHAPE_TO_SHADOW_ANIMATION = {
27
27
  [RoomShape.SHAPE_1x1] = "1x1",
@@ -54,7 +54,7 @@ function ____exports.setShadows(self, customStage)
54
54
  local shadowEffect = spawnEffectWithSeed(
55
55
  nil,
56
56
  SHADOW_EFFECT_VARIANT,
57
- SHADOW_EFFECT_SUBTYPE,
57
+ SHADOW_EFFECT_SUB_TYPE,
58
58
  centerPos,
59
59
  seed
60
60
  )
@@ -3,7 +3,7 @@ local Set = ____lualib.Set
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
5
5
  local ____exports = {}
6
- local NON_ALIVE_NPCS_TYPE_VARIANT, NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE
6
+ local NON_ALIVE_NPCS_TYPE_VARIANT, NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE
7
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
8
  local BegottenVariant = ____isaac_2Dtypescript_2Ddefinitions.BegottenVariant
9
9
  local BigHornVariant = ____isaac_2Dtypescript_2Ddefinitions.BigHornVariant
@@ -34,7 +34,7 @@ function ____exports.isAliveExceptionNPC(self, npc)
34
34
  return true
35
35
  end
36
36
  local entityTypeVariantSubType = (((tostring(npc.Type) .. ".") .. tostring(npc.Variant)) .. ".") .. tostring(npc.SubType)
37
- if NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE:has(entityTypeVariantSubType) then
37
+ if NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE:has(entityTypeVariantSubType) then
38
38
  return true
39
39
  end
40
40
  if ____exports.isDyingEggyWithNoSpidersLeft(nil, npc) then
@@ -86,7 +86,7 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
86
86
  (tostring(EntityType.DARK_ESAU) .. ".") .. tostring(DarkEsauVariant.PIT)
87
87
  }
88
88
  )
89
- NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE = __TS__New(
89
+ NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE = __TS__New(
90
90
  Set,
91
91
  {
92
92
  (((tostring(EntityType.CHARGER) .. ".") .. tostring(ChargerVariant.CHARGER)) .. ".") .. tostring(ChargerSubType.MY_SHADOW),
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
3
3
  local ____exports = {}
4
4
  local ____coinSubTypeToValue = require("objects.coinSubTypeToValue")
5
- local COIN_SUBTYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUBTYPE_TO_VALUE
5
+ local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
6
6
  local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
7
7
  local ____chestPickupVariantsSet = require("sets.chestPickupVariantsSet")
8
8
  local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
@@ -17,7 +17,7 @@ local isHeart = ____pickupVariants.isHeart
17
17
  --- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
18
18
  -- sub-types.
19
19
  function ____exports.getCoinValue(self, coinSubType)
20
- local value = COIN_SUBTYPE_TO_VALUE[coinSubType]
20
+ local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
21
21
  return value == nil and DEFAULT_COIN_VALUE or value
22
22
  end
23
23
  --- Helper function to get all of the red heart pickup entities in the room.
@@ -65,7 +65,7 @@ function initFeaturesMajor(self, mod)
65
65
  customGridEntityInit(nil, mod)
66
66
  end
67
67
  function initFeaturesMinor(self, mod)
68
- customPickupInit(nil)
68
+ customPickupInit(nil, mod)
69
69
  customTrapdoorInit(nil, mod)
70
70
  disableAllSoundInit(nil, mod)
71
71
  disableInputsInit(nil, mod)
@@ -1,6 +1,6 @@
1
1
  import { CoinSubType } from "isaac-typescript-definitions";
2
2
  export declare const DEFAULT_COIN_VALUE = 1;
3
- export declare const COIN_SUBTYPE_TO_VALUE: {
3
+ export declare const COIN_SUB_TYPE_TO_VALUE: {
4
4
  readonly [key in CoinSubType]: int;
5
5
  };
6
6
  //# sourceMappingURL=coinSubTypeToValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coinSubTypeToValue.d.ts","sourceRoot":"","sources":["../../src/objects/coinSubTypeToValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,eAAO,MAAM,qBAAqB,EAAE;IAAE,QAAQ,EAAE,GAAG,IAAI,WAAW,GAAG,GAAG;CAS9D,CAAC"}
1
+ {"version":3,"file":"coinSubTypeToValue.d.ts","sourceRoot":"","sources":["../../src/objects/coinSubTypeToValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,eAAO,MAAM,sBAAsB,EAAE;IAAE,QAAQ,EAAE,GAAG,IAAI,WAAW,GAAG,GAAG;CAS/D,CAAC"}
@@ -2,7 +2,7 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
4
4
  ____exports.DEFAULT_COIN_VALUE = 1
5
- ____exports.COIN_SUBTYPE_TO_VALUE = {
5
+ ____exports.COIN_SUB_TYPE_TO_VALUE = {
6
6
  [CoinSubType.NULL] = 0,
7
7
  [CoinSubType.PENNY] = 1,
8
8
  [CoinSubType.NICKEL] = 5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "7.12.0",
3
+ "version": "7.13.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,9 +1,135 @@
1
+ import {
2
+ EffectVariant,
3
+ EntityType,
4
+ ModCallback,
5
+ PickupVariant,
6
+ } from "isaac-typescript-definitions";
1
7
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
8
+ import {
9
+ getEntityID,
10
+ getEntityIDFromConstituents,
11
+ } from "../functions/entities";
12
+ import { spawnEffect } from "../functions/entitiesSpecific";
2
13
 
3
14
  const FEATURE_NAME = "customPickup";
4
15
 
5
- export function customPickupInit(): void {}
16
+ interface CustomPickupFunctions {
17
+ collectFunc: (player: EntityPlayer) => void;
18
+ collisionFunc: (player: EntityPlayer) => boolean;
19
+ }
20
+
21
+ /**
22
+ * Normally, we would make a custom entity to represent a fading-away pickup, but we don't want to
23
+ * interfere with the "entities2.xml" file in end-user mods. Thus, we must select a vanilla effect
24
+ * to masquerade as a backdrop effect.
25
+ *
26
+ * We arbitrarily choose a ladder for this purpose because it will not automatically despawn after
27
+ * time passes, like most other effects.
28
+ */
29
+ const PICKUP_EFFECT_VARIANT = EffectVariant.LADDER;
30
+ const PICKUP_EFFECT_SUB_TYPE = 103;
31
+
32
+ /** Indexed by entity ID. */
33
+ const customPickupFunctionsMap = new Map<string, CustomPickupFunctions>();
34
+
35
+ export function customPickupInit(mod: Mod): void {
36
+ mod.AddCallback(ModCallback.PRE_PICKUP_COLLISION, prePickupCollision); // 38
37
+ mod.AddCallback(
38
+ ModCallback.POST_EFFECT_RENDER,
39
+ postEffectRenderPickupEffect,
40
+ PICKUP_EFFECT_VARIANT,
41
+ ); // 56
42
+ }
43
+
44
+ // ModCallback.PRE_PICKUP_COLLISION (38)
45
+ function prePickupCollision(
46
+ pickup: EntityPickup,
47
+ collider: Entity,
48
+ ): boolean | undefined {
49
+ const entityID = getEntityID(pickup);
50
+ const customPickupFunctions = customPickupFunctionsMap.get(entityID);
51
+ if (customPickupFunctions === undefined) {
52
+ return undefined;
53
+ }
54
+
55
+ const player = collider.ToPlayer();
56
+ if (player === undefined) {
57
+ return undefined;
58
+ }
59
+
60
+ const shouldPickup = customPickupFunctions.collisionFunc(player);
61
+ if (!shouldPickup) {
62
+ return undefined;
63
+ }
64
+
65
+ pickup.Remove();
6
66
 
7
- export function registerCustomPickup(): void {
67
+ const pickupSprite = pickup.GetSprite();
68
+ const fileName = pickupSprite.GetFilename();
69
+
70
+ const effect = spawnEffect(
71
+ PICKUP_EFFECT_VARIANT,
72
+ PICKUP_EFFECT_SUB_TYPE,
73
+ pickup.Position,
74
+ );
75
+ const effectSprite = effect.GetSprite();
76
+ effectSprite.Load(fileName, true);
77
+ effectSprite.Play("Collect", true);
78
+
79
+ customPickupFunctions.collectFunc(player);
80
+
81
+ return undefined;
82
+ }
83
+
84
+ // ModCallback.POST_EFFECT_RENDER (56)
85
+ // PICKUP_EFFECT_VARIANT
86
+ function postEffectRenderPickupEffect(effect: EntityEffect) {
87
+ if (effect.SubType !== PICKUP_EFFECT_SUB_TYPE) {
88
+ return;
89
+ }
90
+
91
+ const sprite = effect.GetSprite();
92
+ if (sprite.IsFinished("Collect")) {
93
+ effect.Remove();
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Helper function to register a custom pickup with the IsaacScript standard library. Use this
99
+ * feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
100
+ *
101
+ * When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
102
+ * will be immediately removed, and an effect showing the pickup's respective `Collect` animation
103
+ * will be spawned. (This emulates how a normal vanilla pickup would work.)
104
+ *
105
+ * Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
106
+ * of "5" and be associated with an anm2 file that has a "Collect" animation.
107
+ *
108
+ * @param pickupVariantCustom The variant for the corresponding custom pickup.
109
+ * @param subType The sub-type for the corresponding custom pickup.
110
+ * @param collectFunc The function to run when the player collects this pickup.
111
+ * @param collisionFunc Optional. The function to run when a player collides with the pickup.
112
+ * Default is a function that always returns true, meaning that the player will
113
+ * always immediately collect the pickup when they collide with it. Specify
114
+ * this function if your pickup should only be able to be collected under
115
+ * certain conditions.
116
+ */
117
+ export function registerCustomPickup(
118
+ pickupVariantCustom: PickupVariant,
119
+ subType: int,
120
+ collectFunc: (player: EntityPlayer) => void,
121
+ collisionFunc: (player: EntityPlayer) => boolean = () => true,
122
+ ): void {
8
123
  errorIfFeaturesNotInitialized(FEATURE_NAME);
124
+
125
+ const entityID = getEntityIDFromConstituents(
126
+ EntityType.PICKUP,
127
+ pickupVariantCustom,
128
+ subType,
129
+ );
130
+ const customPickupFunctions: CustomPickupFunctions = {
131
+ collectFunc,
132
+ collisionFunc,
133
+ };
134
+ customPickupFunctionsMap.set(entityID, customPickupFunctions);
9
135
  }
@@ -83,7 +83,7 @@ const N_FLOOR_ANM2_LAYERS: readonly int[] = [18, 19];
83
83
  * time passes, like most other effects.
84
84
  */
85
85
  const BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER;
86
- const BACKDROP_EFFECT_SUBTYPE = 101;
86
+ const BACKDROP_EFFECT_SUB_TYPE = 101;
87
87
 
88
88
  const BACKDROP_ROOM_TYPE_SET: ReadonlySet<RoomType> = new Set([
89
89
  RoomType.DEFAULT,
@@ -135,7 +135,7 @@ function spawnWallEntity(
135
135
  const seed = 1 as Seed;
136
136
  const wallEffect = spawnEffectWithSeed(
137
137
  BACKDROP_EFFECT_VARIANT,
138
- BACKDROP_EFFECT_SUBTYPE,
138
+ BACKDROP_EFFECT_SUB_TYPE,
139
139
  VectorZero,
140
140
  seed,
141
141
  );
@@ -18,7 +18,7 @@ type ShadowAnimation = "1x1" | "1x2" | "2x1" | "2x2";
18
18
  * time passes, like most other effects.
19
19
  */
20
20
  const SHADOW_EFFECT_VARIANT = EffectVariant.LADDER;
21
- const SHADOW_EFFECT_SUBTYPE = 102;
21
+ const SHADOW_EFFECT_SUB_TYPE = 102;
22
22
 
23
23
  /** The animation comes from StageAPI. */
24
24
  const ROOM_SHAPE_TO_SHADOW_ANIMATION: {
@@ -60,7 +60,7 @@ export function setShadows(customStage: CustomStage): void {
60
60
  const seed = 1 as Seed;
61
61
  const shadowEffect = spawnEffectWithSeed(
62
62
  SHADOW_EFFECT_VARIANT,
63
- SHADOW_EFFECT_SUBTYPE,
63
+ SHADOW_EFFECT_SUB_TYPE,
64
64
  centerPos,
65
65
  seed,
66
66
  );
@@ -41,7 +41,7 @@ const NON_ALIVE_NPCS_TYPE_VARIANT: ReadonlySet<string> = new Set([
41
41
  * Used to filter out certain NPCs when determining of an NPC is "alive" and/or should keep the
42
42
  * doors open.
43
43
  */
44
- const NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE: ReadonlySet<string> = new Set([
44
+ const NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE: ReadonlySet<string> = new Set([
45
45
  `${EntityType.CHARGER}.${ChargerVariant.CHARGER}.${ChargerSubType.MY_SHADOW}`, // 23.0.1
46
46
  `${EntityType.MOTHER}.${MotherVariant.MOTHER_1}.${MotherSubType.PHASE_2}`, // 912
47
47
  ]);
@@ -81,7 +81,7 @@ export function isAliveExceptionNPC(npc: EntityNPC): boolean {
81
81
  }
82
82
 
83
83
  const entityTypeVariantSubType = `${npc.Type}.${npc.Variant}.${npc.SubType}`;
84
- if (NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE.has(entityTypeVariantSubType)) {
84
+ if (NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE.has(entityTypeVariantSubType)) {
85
85
  return true;
86
86
  }
87
87
 
@@ -1,6 +1,6 @@
1
1
  import { CoinSubType } from "isaac-typescript-definitions";
2
2
  import {
3
- COIN_SUBTYPE_TO_VALUE,
3
+ COIN_SUB_TYPE_TO_VALUE,
4
4
  DEFAULT_COIN_VALUE,
5
5
  } from "../objects/coinSubTypeToValue";
6
6
  import { CHEST_PICKUP_VARIANTS } from "../sets/chestPickupVariantsSet";
@@ -14,7 +14,7 @@ import { isHeart } from "./pickupVariants";
14
14
  * sub-types.
15
15
  */
16
16
  export function getCoinValue(coinSubType: CoinSubType): int {
17
- const value = COIN_SUBTYPE_TO_VALUE[coinSubType];
17
+ const value = COIN_SUB_TYPE_TO_VALUE[coinSubType];
18
18
  // Handle modded coin sub-types.
19
19
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
20
20
  return value === undefined ? DEFAULT_COIN_VALUE : value;
@@ -43,7 +43,7 @@ function initFeaturesMajor(mod: ModUpgraded) {
43
43
  }
44
44
 
45
45
  function initFeaturesMinor(mod: ModUpgraded) {
46
- customPickupInit();
46
+ customPickupInit(mod);
47
47
  customTrapdoorInit(mod);
48
48
  disableAllSoundInit(mod);
49
49
  disableInputsInit(mod);
@@ -2,7 +2,7 @@ import { CoinSubType } from "isaac-typescript-definitions";
2
2
 
3
3
  export const DEFAULT_COIN_VALUE = 1;
4
4
 
5
- export const COIN_SUBTYPE_TO_VALUE: { readonly [key in CoinSubType]: int } = {
5
+ export const COIN_SUB_TYPE_TO_VALUE: { readonly [key in CoinSubType]: int } = {
6
6
  [CoinSubType.NULL]: 0, // 0
7
7
  [CoinSubType.PENNY]: 1, // 1
8
8
  [CoinSubType.NICKEL]: 5, // 2