isaacscript-common 1.0.493 → 1.0.497

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,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostBombInitLateCallbackType = (bomb: EntityBomb) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostBombInitLateCallbackType, bombVariant?: BombVariant): void;
4
+ export declare function register(callback: PostBombInitLateCallbackType, bombVariant?: BombVariant | int): void;
5
5
  export declare function fire(bomb: EntityBomb): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostFamiliarInitLateCallbackType = (familiar: EntityFamiliar) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostFamiliarInitLateCallbackType, familiarVariant?: FamiliarVariant): void;
4
+ export declare function register(callback: PostFamiliarInitLateCallbackType, familiarVariant?: FamiliarVariant | int): void;
5
5
  export declare function fire(familiar: EntityFamiliar): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostKnifeInitLateCallbackType = (knife: EntityKnife) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostKnifeInitLateCallbackType, knifeVariant?: KnifeVariant): void;
4
+ export declare function register(callback: PostKnifeInitLateCallbackType, knifeVariant?: KnifeVariant | int): void;
5
5
  export declare function fire(knife: EntityKnife): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostLaserInitLateCallbackType = (laser: EntityLaser) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostLaserInitLateCallbackType, laserVariant?: LaserVariant): void;
4
+ export declare function register(callback: PostLaserInitLateCallbackType, laserVariant?: LaserVariant | int): void;
5
5
  export declare function fire(laser: EntityLaser): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostPickupCollectCallbackType = (pickup: EntityPickup, player: EntityPlayer) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostPickupCollectCallbackType, pickupVariant?: PickupVariant): void;
4
+ export declare function register(callback: PostPickupCollectCallbackType, pickupVariant?: PickupVariant | int): void;
5
5
  export declare function fire(pickup: EntityPickup, player: EntityPlayer): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostPickupInitLateCallbackType = (pickup: EntityPickup) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostPickupInitLateCallbackType, pickupVariant?: PickupVariant): void;
4
+ export declare function register(callback: PostPickupInitLateCallbackType, pickupVariant?: PickupVariant | int): void;
5
5
  export declare function fire(pickup: EntityPickup): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostProjectileInitLateCallbackType = (projectile: EntityProjectile) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostProjectileInitLateCallbackType, projectileVariant?: ProjectileVariant): void;
4
+ export declare function register(callback: PostProjectileInitLateCallbackType, projectileVariant?: ProjectileVariant | int): void;
5
5
  export declare function fire(projectile: EntityProjectile): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare type PostPurchaseCallbackType = (player: EntityPlayer, pickupVariant: PickupVariant, pickupSubType: int, pickupPrice: int) => void;
2
+ export declare type PostPurchaseCallbackType = (player: EntityPlayer, pickupVariant: PickupVariant | int, pickupSubType: int, pickupPrice: int) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostPurchaseCallbackType, pickupVariant?: PickupVariant, pickupSubType?: int): void;
5
- export declare function fire(player: EntityPlayer, pickupVariant: PickupVariant, pickupSubType: int, pickupPrice: int): void;
4
+ export declare function register(callback: PostPurchaseCallbackType, pickupVariant?: PickupVariant | int, pickupSubType?: int): void;
5
+ export declare function fire(player: EntityPlayer, pickupVariant: PickupVariant | int, pickupSubType: int, pickupPrice: int): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare type PostTearInitLateCallbackType = (tear: EntityTear) => void;
3
3
  export declare function hasSubscriptions(): boolean;
4
- export declare function register(callback: PostTearInitLateCallbackType, tearVariant?: TearVariant): void;
4
+ export declare function register(callback: PostTearInitLateCallbackType, tearVariant?: TearVariant | int): void;
5
5
  export declare function fire(tear: EntityTear): void;
@@ -9,14 +9,28 @@ export declare const BOMB_EXPLODE_FRAME = 45;
9
9
  export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
10
10
  /**
11
11
  * The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
12
- * Baby). This set includes The Lost and Tainted Lost.
12
+ * Baby). This includes The Lost and Tainted Lost. This does not include Keeper or Tainted Keeper.
13
13
  */
14
14
  export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
15
15
  /**
16
16
  * The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
17
- * set includes The Lost and Tainted Lost.
17
+ * includes The Lost and Tainted Lost.
18
18
  */
19
19
  export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
20
+ /**
21
+ * A collection of common colors that can be reused. Note that if you want to further modify these
22
+ * colors, you should copy them first with the `copyColor` function.
23
+ */
24
+ export declare const COLORS: {
25
+ BLACK: Color;
26
+ RED: Color;
27
+ GREEN: Color;
28
+ BLUE: Color;
29
+ YELLOW: Color;
30
+ PINK: Color;
31
+ CYAN: Color;
32
+ WHITE: Color;
33
+ };
20
34
  export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
21
35
  /** This is also the distance that a player spawns from the door that they enter a room from. */
22
36
  export declare const DISTANCE_OF_GRID_TILE = 40;
@@ -27,6 +41,8 @@ export declare const DOOR_HITBOX_DISTANCE = 11;
27
41
  * value.
28
42
  */
29
43
  export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
44
+ /** As of Repentance, the final stage is floor 13 (which is the Home floor). */
45
+ export declare const FINAL_STAGE: number;
30
46
  /**
31
47
  * The random items that appear when the player has TMTRAINER are generated on the fly as they are
32
48
  * encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
@@ -26,11 +26,28 @@ ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
26
26
  PlayerType.PLAYER_THEFORGOTTEN_B,
27
27
  PlayerType.PLAYER_BETHANY_B
28
28
  })
29
- ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B})
29
+ ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {
30
+ PlayerType.PLAYER_THELOST,
31
+ PlayerType.PLAYER_KEEPER,
32
+ PlayerType.PLAYER_BETHANY,
33
+ PlayerType.PLAYER_THELOST_B,
34
+ PlayerType.PLAYER_KEEPER_B
35
+ })
36
+ ____exports.COLORS = {
37
+ BLACK = Color(1, 1, 1),
38
+ RED = Color(1, 0, 0),
39
+ GREEN = Color(0, 1, 0),
40
+ BLUE = Color(0, 0, 1),
41
+ YELLOW = Color(1, 1, 0),
42
+ PINK = Color(1, 0, 1),
43
+ CYAN = Color(0, 1, 1),
44
+ WHITE = Color(1, 1, 1)
45
+ }
30
46
  ____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
31
47
  ____exports.DISTANCE_OF_GRID_TILE = 40
32
48
  ____exports.DOOR_HITBOX_DISTANCE = 11
33
49
  ____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
50
+ ____exports.FINAL_STAGE = LevelStage.NUM_STAGES - 1
34
51
  ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
35
52
  ____exports.GENESIS_ROOM_VARIANT = 1000
36
53
  ____exports.GENESIS_ROOM_SUBTYPE = 99
@@ -166,7 +166,7 @@ export declare function removeEntities(entities: Entity[], cap?: int): void;
166
166
  * @param subType Optional. If specified, will only remove bombs that match this sub-type.
167
167
  * @param cap Optional. If specified, will only remove the given amount of bombs.
168
168
  */
169
- export declare function removeAllBombs(variant?: BombVariant, subType?: int, cap?: int): void;
169
+ export declare function removeAllBombs(variant?: BombVariant | int, subType?: int, cap?: int): void;
170
170
  /**
171
171
  * Helper function to remove all of the effects in the room.
172
172
  *
@@ -182,7 +182,7 @@ export declare function removeAllEffects(variant?: EffectVariant, subType?: int,
182
182
  * @param subType Optional. If specified, will only remove familiars that match this sub-type.
183
183
  * @param cap Optional. If specified, will only remove the given amount of familiars.
184
184
  */
185
- export declare function removeAllFamiliars(variant?: FamiliarVariant, subType?: int, cap?: int): void;
185
+ export declare function removeAllFamiliars(variant?: FamiliarVariant | int, subType?: int, cap?: int): void;
186
186
  /**
187
187
  * Helper function to remove all of the knives in the room.
188
188
  *
@@ -190,7 +190,7 @@ export declare function removeAllFamiliars(variant?: FamiliarVariant, subType?:
190
190
  * @param subType Optional. If specified, will only remove knives that match this sub-type.
191
191
  * @param cap Optional. If specified, will only remove the given amount of knives.
192
192
  */
193
- export declare function removeAllKnives(variant?: KnifeVariant, subType?: int, cap?: int): void;
193
+ export declare function removeAllKnives(variant?: KnifeVariant | int, subType?: int, cap?: int): void;
194
194
  /**
195
195
  * Helper function to remove all of the lasers in the room.
196
196
  *
@@ -198,7 +198,7 @@ export declare function removeAllKnives(variant?: KnifeVariant, subType?: int, c
198
198
  * @param subType Optional. If specified, will only remove lasers that match this sub-type.
199
199
  * @param cap Optional. If specified, will only remove the given amount of lasers.
200
200
  */
201
- export declare function removeAllLasers(variant?: LaserVariant, subType?: int, cap?: int): void;
201
+ export declare function removeAllLasers(variant?: LaserVariant | int, subType?: int, cap?: int): void;
202
202
  /**
203
203
  * Helper function to remove all of the matching entities in the room.
204
204
  *
@@ -217,7 +217,7 @@ export declare function removeAllMatchingEntities(entityType: int, entityVariant
217
217
  * @param subType Optional. If specified, will only remove pickups that match this sub-type.
218
218
  * @param cap Optional. If specified, will only remove the given amount of pickups.
219
219
  */
220
- export declare function removeAllPickups(variant?: PickupVariant, subType?: int, cap?: int): void;
220
+ export declare function removeAllPickups(variant?: PickupVariant | int, subType?: int, cap?: int): void;
221
221
  /**
222
222
  * Helper function to remove all of the projectiles in the room.
223
223
  *
@@ -225,7 +225,7 @@ export declare function removeAllPickups(variant?: PickupVariant, subType?: int,
225
225
  * @param subType Optional. If specified, will only remove projectiles that match this sub-type.
226
226
  * @param cap Optional. If specified, will only remove the given amount of projectiles.
227
227
  */
228
- export declare function removeAllProjectiles(variant?: ProjectileVariant, subType?: int, cap?: int): void;
228
+ export declare function removeAllProjectiles(variant?: ProjectileVariant | int, subType?: int, cap?: int): void;
229
229
  /**
230
230
  * Helper function to remove all of the tears in the room.
231
231
  *
@@ -233,7 +233,7 @@ export declare function removeAllProjectiles(variant?: ProjectileVariant, subTyp
233
233
  * @param subType Optional. If specified, will only remove tears that match this sub-type.
234
234
  * @param cap Optional. If specified, will only remove the given amount of tears.
235
235
  */
236
- export declare function removeAllTears(variant?: TearVariant, subType?: int, cap?: int): void;
236
+ export declare function removeAllTears(variant?: TearVariant | int, subType?: int, cap?: int): void;
237
237
  /**
238
238
  * Helper function to set the position of every entity in the room based on a map of positions. If
239
239
  * an entity is found that does not have matching element in the provided map, then that entity will
@@ -22,8 +22,9 @@ export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boo
22
22
  export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
23
23
  /**
24
24
  * Helper function to see if the provided character can have red heart containers. Returns true for
25
- * characters like Isaac, Magdalene, or Cain. Returns false for characters like Blue Baby. Returns
26
- * false for The Lost and Tainted Lost.
25
+ * characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
26
+ * though coin containers are not technically the same as red heart containers. Returns false for
27
+ * characters like Blue Baby. Returns false for The Lost and Tainted Lost.
27
28
  */
28
29
  export declare function characterCanHaveRedHearts(character: PlayerType): boolean;
29
30
  /**
@@ -24,9 +24,9 @@ export declare function getRoomData(): RoomConfig | undefined;
24
24
  export declare function getRoomDataType(): int;
25
25
  /**
26
26
  * Helper function to get the room index of the current room. Use this instead of calling
27
- * `Game().GetLevel().GetCurrentRoomIndex()` directly to avoid bugs with big rooms.
28
- * (Big rooms will return the specific 1x1 quadrant that the player entered the room at,
29
- * which can break data structures that use the room index as an index.)
27
+ * `Level.GetCurrentRoomIndex()` directly to avoid bugs with big rooms. (Big rooms will return the
28
+ * specific 1x1 quadrant that the player entered the room at, which can break data structures that
29
+ * use the room index as an index.)
30
30
  */
31
31
  export declare function getRoomIndex(): int;
32
32
  /**
@@ -23,10 +23,6 @@ local hasFlag = ____flag.hasFlag
23
23
  function ____exports.getRoomIndex(self)
24
24
  local game = Game()
25
25
  local level = game:GetLevel()
26
- local roomIndex = level:GetCurrentRoomIndex()
27
- if roomIndex < 0 then
28
- return roomIndex
29
- end
30
26
  local roomDesc = level:GetCurrentRoomDesc()
31
27
  return roomDesc.SafeGridIndex
32
28
  end
@@ -223,14 +219,14 @@ function ____exports.setRoomCleared(self)
223
219
  for ____, door in ipairs(getDoors(nil)) do
224
220
  do
225
221
  if isHiddenSecretRoomDoor(nil, door) then
226
- goto __continue39
222
+ goto __continue38
227
223
  end
228
224
  door.State = DoorState.STATE_OPEN
229
225
  local sprite = door:GetSprite()
230
226
  sprite:Play("Opened", true)
231
227
  door.ExtraVisible = false
232
228
  end
233
- ::__continue39::
229
+ ::__continue38::
234
230
  end
235
231
  sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
236
232
  game:ShakeScreen(0)
@@ -67,31 +67,31 @@ export interface CallbackParametersCustom {
67
67
  ];
68
68
  [ModCallbacksCustom.MC_POST_TEAR_INIT_LATE]: [
69
69
  callback: PostTearInitLateCallbackType,
70
- tearVariant?: TearVariant
70
+ tearVariant?: TearVariant | int
71
71
  ];
72
72
  [ModCallbacksCustom.MC_POST_FAMILIAR_INIT_LATE]: [
73
73
  callback: PostFamiliarInitLateCallbackType,
74
- familiarVariant?: FamiliarVariant
74
+ familiarVariant?: FamiliarVariant | int
75
75
  ];
76
76
  [ModCallbacksCustom.MC_POST_BOMB_INIT_LATE]: [
77
77
  callback: PostBombInitLateCallbackType,
78
- bombVariant?: BombVariant
78
+ bombVariant?: BombVariant | int
79
79
  ];
80
80
  [ModCallbacksCustom.MC_POST_PICKUP_INIT_LATE]: [
81
81
  callback: PostPickupInitLateCallbackType,
82
- pickupVariant?: PickupVariant
82
+ pickupVariant?: PickupVariant | int
83
83
  ];
84
84
  [ModCallbacksCustom.MC_POST_LASER_INIT_LATE]: [
85
85
  callback: PostLaserInitLateCallbackType,
86
- laserVariant?: LaserVariant
86
+ laserVariant?: LaserVariant | int
87
87
  ];
88
88
  [ModCallbacksCustom.MC_POST_KNIFE_INIT_LATE]: [
89
89
  callback: PostKnifeInitLateCallbackType,
90
- knifeVariant?: KnifeVariant
90
+ knifeVariant?: KnifeVariant | int
91
91
  ];
92
92
  [ModCallbacksCustom.MC_POST_PROJECTILE_INIT_LATE]: [
93
93
  callback: PostProjectileInitLateCallbackType,
94
- projectileVariant?: ProjectileVariant
94
+ projectileVariant?: ProjectileVariant | int
95
95
  ];
96
96
  [ModCallbacksCustom.MC_POST_NPC_INIT_LATE]: [
97
97
  callback: PostNPCInitLateCallbackType,
@@ -103,7 +103,7 @@ export interface CallbackParametersCustom {
103
103
  ];
104
104
  [ModCallbacksCustom.MC_POST_PICKUP_COLLECT]: [
105
105
  callback: PostPickupCollectCallbackType,
106
- pickupVariant?: PickupVariant
106
+ pickupVariant?: PickupVariant | int
107
107
  ];
108
108
  [ModCallbacksCustom.MC_PRE_ITEM_PICKUP]: [
109
109
  callback: PreItemPickupCallbackType,
@@ -146,7 +146,7 @@ export interface CallbackParametersCustom {
146
146
  ];
147
147
  [ModCallbacksCustom.MC_POST_PURCHASE]: [
148
148
  callback: PostPurchaseCallbackType,
149
- pickupVariant?: PickupVariant,
149
+ pickupVariant?: PickupVariant | int,
150
150
  pickupSubType?: int
151
151
  ];
152
152
  [ModCallbacksCustom.MC_POST_SACRIFICE]: [callback: PostSacrificeCallbackType];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.493",
3
+ "version": "1.0.497",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,7 +25,7 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "isaac-typescript-definitions": "^1.0.285",
28
+ "isaac-typescript-definitions": "^1.0.286",
29
29
  "isaacscript-lint": "^1.0.68",
30
30
  "typedoc": "^0.22.10",
31
31
  "typescript": "4.5.2",