isaacscript-common 1.2.131 → 1.2.132
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/cachedClasses.d.ts +4 -4
- package/dist/constants.d.ts +2 -2
- package/dist/features/deployJSONRoom.d.ts +2 -2
- package/dist/functions/debug.d.ts +1 -1
- package/dist/functions/doors.d.ts +6 -6
- package/dist/functions/entity.d.ts +3 -3
- package/dist/functions/gridEntity.d.ts +5 -5
- package/dist/functions/log.d.ts +1 -1
- package/dist/functions/log.lua +2 -2
- package/dist/functions/npc.d.ts +2 -2
- package/dist/functions/player.d.ts +15 -12
- package/dist/functions/player.lua +16 -9
- package/dist/functions/playerHealth.d.ts +2 -2
- package/dist/functions/pocketItems.d.ts +1 -1
- package/dist/functions/positionVelocity.d.ts +13 -15
- package/dist/functions/random.d.ts +4 -4
- package/dist/functions/revive.d.ts +2 -2
- package/dist/functions/rooms.d.ts +12 -12
- package/dist/functions/spawnCollectible.d.ts +4 -3
- package/dist/functions/sprite.d.ts +4 -4
- package/dist/functions/ui.d.ts +1 -1
- package/dist/functions/utils.d.ts +4 -4
- package/dist/upgradeMod.d.ts +1 -1
- package/package.json +3 -3
package/dist/cachedClasses.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
|
-
* A cached version of the `Game()` constructor.
|
|
3
|
+
* A cached version of the class returned from the `Game()` constructor.
|
|
4
4
|
*
|
|
5
5
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
6
6
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const game: Game;
|
|
11
11
|
/**
|
|
12
|
-
* A cached version of the `Isaac.GetItemConfig()
|
|
12
|
+
* A cached version of the class returned from the `Isaac.GetItemConfig()` constructor.
|
|
13
13
|
*
|
|
14
14
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ export declare const game: Game;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const itemConfig: ItemConfig;
|
|
20
20
|
/**
|
|
21
|
-
* A cached version of the `MusicManager()` constructor.
|
|
21
|
+
* A cached version of the class returned from the `MusicManager()` constructor.
|
|
22
22
|
*
|
|
23
23
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
24
24
|
*
|
|
@@ -27,7 +27,7 @@ export declare const itemConfig: ItemConfig;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare const musicManager: MusicManager;
|
|
29
29
|
/**
|
|
30
|
-
* A cached version of the `SFXManager()` constructor.
|
|
30
|
+
* A cached version of the class returned from the `SFXManager()` constructor.
|
|
31
31
|
*
|
|
32
32
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
33
33
|
*
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
3
|
* The distance of the laser when Azazel does not have any range up items yet.
|
|
4
|
-
* For more info, see the documentation for the `getAzazelBrimstoneDistance
|
|
4
|
+
* For more info, see the documentation for the `getAzazelBrimstoneDistance` function.
|
|
5
5
|
*/
|
|
6
6
|
export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
7
7
|
/**
|
|
@@ -51,7 +51,7 @@ export declare const DOOR_HITBOX_DISTANCE = 11;
|
|
|
51
51
|
export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
|
|
52
52
|
/**
|
|
53
53
|
* A non-existent or completely transparent PNG file for use in clearing sprites. For more
|
|
54
|
-
* information, see the documentation for the `clearSprite
|
|
54
|
+
* information, see the documentation for the `clearSprite` helper function.
|
|
55
55
|
*/
|
|
56
56
|
export declare const EMPTY_PNG_PATH = "gfx/none.png";
|
|
57
57
|
export declare const FAMILIARS_THAT_SHOOT_PLAYER_TEARS: ReadonlySet<FamiliarVariant>;
|
|
@@ -18,7 +18,7 @@ import { JSONRoom } from "../types/JSONRoom";
|
|
|
18
18
|
* Default is `Random()`.
|
|
19
19
|
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
|
|
20
20
|
* what the function is doing. Default is false.
|
|
21
|
-
* @returns Before using the seed for spawning each entity, it is iterated with `nextSeed
|
|
21
|
+
* @returns Before using the seed for spawning each entity, it is iterated with `nextSeed`. The
|
|
22
22
|
* function returns the final iterated seed after spawning everything, which can be used in
|
|
23
23
|
* subsequent room deployments.
|
|
24
24
|
*/
|
|
@@ -46,7 +46,7 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom, seed?: Seed, verbose?
|
|
|
46
46
|
* that, it is also used for spawning every entity in the room. Default is `Random()`.
|
|
47
47
|
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
|
|
48
48
|
* what the function is doing. Default is false.
|
|
49
|
-
* @returns Before using the seed for spawning each entity, it is iterated with `nextSeed
|
|
49
|
+
* @returns Before using the seed for spawning each entity, it is iterated with `nextSeed`. The
|
|
50
50
|
* function returns the final iterated seed after spawning everything, which can be used in
|
|
51
51
|
* subsequent room deployments.
|
|
52
52
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export declare function getTraceback(): string;
|
|
8
8
|
/**
|
|
9
9
|
* Helper function to print a stack trace to the "log.txt" file, similar to JavaScript's
|
|
10
|
-
* `console.trace
|
|
10
|
+
* `console.trace` function.
|
|
11
11
|
*
|
|
12
12
|
* This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
|
|
13
13
|
* enabled.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare function closeAllDoors(): void;
|
|
3
3
|
/**
|
|
4
|
-
* Use this instead of the `
|
|
5
|
-
* an animation.
|
|
4
|
+
* Use this instead of the `GridEntityDoor.Close` method if you want the door to immediately close
|
|
5
|
+
* without an animation.
|
|
6
6
|
*/
|
|
7
7
|
export declare function closeDoorFast(door: GridEntityDoor): void;
|
|
8
8
|
/**
|
|
@@ -63,9 +63,9 @@ export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
|
|
|
63
63
|
export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Helper function to reset an unlocked door back to a locked state. Doing this is non-trivial
|
|
66
|
-
* because in addition to calling the `SetLocked
|
|
66
|
+
* because in addition to calling the `GridEntityDoor.SetLocked` method, you must also:
|
|
67
67
|
*
|
|
68
|
-
* -
|
|
68
|
+
* - Set the `VisitedCount` of the room's `RoomDescription` to 0.
|
|
69
69
|
* - Set the variant to `DoorVariant.DOOR_LOCKED`.
|
|
70
70
|
* - Close the door.
|
|
71
71
|
*/
|
|
@@ -76,8 +76,8 @@ export declare function lockDoor(door: GridEntityDoor): void;
|
|
|
76
76
|
*/
|
|
77
77
|
export declare function openAllDoors(): void;
|
|
78
78
|
/**
|
|
79
|
-
* Use this instead of the `
|
|
80
|
-
* an animation.
|
|
79
|
+
* Use this instead of the `GridEntityDoor.Open` method if you want the door to immediately open
|
|
80
|
+
* without an animation.
|
|
81
81
|
*/
|
|
82
82
|
export declare function openDoorFast(door: GridEntityDoor): void;
|
|
83
83
|
/**
|
|
@@ -33,9 +33,9 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
|
|
|
33
33
|
* Helper function to get all of the entities in the room or all of the entities that match a
|
|
34
34
|
* specific entity type / variant / sub-type.
|
|
35
35
|
*
|
|
36
|
-
* Due to bugs with `Isaac.FindInRadius
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* Due to bugs with `Isaac.FindInRadius`, this function uses `Isaac.GetRoomEntities`, which is more
|
|
37
|
+
* expensive but also more robust. (If a matching entity type is provided, then `Isaac.FindByType`
|
|
38
|
+
* will be used instead.)
|
|
39
39
|
*
|
|
40
40
|
* Example:
|
|
41
41
|
* ```
|
|
@@ -102,15 +102,15 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
|
|
|
102
102
|
* @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
|
|
103
103
|
* Default is true. This is generally a good idea because if the room is not updated, you will be
|
|
104
104
|
* unable to spawn another grid entity on the same tile until a frame has passed. However, doing
|
|
105
|
-
* this is expensive, since it involves a call to `Isaac.GetRoomEntities
|
|
106
|
-
*
|
|
105
|
+
* this is expensive, since it involves a call to `Isaac.GetRoomEntities`, so set it to false if you
|
|
106
|
+
* need to invoke this function multiple times.
|
|
107
107
|
*/
|
|
108
108
|
export declare function removeGridEntity(gridEntity: GridEntity, updateRoom?: boolean): void;
|
|
109
109
|
/**
|
|
110
110
|
* Helper function to make a grid entity invisible. This is accomplished by setting its sprite to
|
|
111
111
|
* an empty/missing PNG file.
|
|
112
112
|
*
|
|
113
|
-
* For more information, see the documentation for the `clearSprite
|
|
113
|
+
* For more information, see the documentation for the `clearSprite` helper function.
|
|
114
114
|
*/
|
|
115
115
|
export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
|
|
116
116
|
/**
|
|
@@ -124,7 +124,7 @@ export declare function spawnGiantPoop(topLeftGridIndex: int): void;
|
|
|
124
124
|
* This function assumes you want to give the grid entity a variant of 0. If you want to specify a
|
|
125
125
|
* variant, use the `spawnGridEntityWithVariant` helper function instead.
|
|
126
126
|
*
|
|
127
|
-
* Use this instead of the `Isaac.GridSpawn
|
|
127
|
+
* Use this instead of the `Isaac.GridSpawn` method since it:
|
|
128
128
|
* - handles giving pits collision
|
|
129
129
|
* - removes existing grid entities on the same tile, if any
|
|
130
130
|
* - allows you to specify the grid index instead of the position
|
|
@@ -133,7 +133,7 @@ export declare function spawnGridEntity(gridEntityType: GridEntityType, gridInde
|
|
|
133
133
|
/**
|
|
134
134
|
* Helper function to spawn a grid entity with a specific variant.
|
|
135
135
|
*
|
|
136
|
-
* Use this instead of the `Isaac.GridSpawn
|
|
136
|
+
* Use this instead of the `Isaac.GridSpawn` method since it:
|
|
137
137
|
* - handles giving pits collision
|
|
138
138
|
* - removes existing grid entities on the same tile, if any
|
|
139
139
|
* - allows you to specify the grid index instead of the position
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare function logAllSeedEffects(this: void): void;
|
|
|
32
32
|
/** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
|
|
33
33
|
export declare function logAllTearFlags(this: void, flags: int): void;
|
|
34
34
|
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
35
|
-
export declare function logAllUseFlags(this: void,
|
|
35
|
+
export declare function logAllUseFlags(this: void, _flags: int): void;
|
|
36
36
|
export declare function logArray<T>(this: void, array: T[]): void;
|
|
37
37
|
export declare function logColor(this: void, color: Color): void;
|
|
38
38
|
export declare function logEntity(this: void, entity: Entity): void;
|
package/dist/functions/log.lua
CHANGED
|
@@ -107,8 +107,8 @@ end
|
|
|
107
107
|
function ____exports.logAllTearFlags(flags)
|
|
108
108
|
____exports.logAllFlags(flags, TearFlags, "tear")
|
|
109
109
|
end
|
|
110
|
-
function ____exports.logAllUseFlags(
|
|
111
|
-
____exports.
|
|
110
|
+
function ____exports.logAllUseFlags(_flags)
|
|
111
|
+
____exports.log("The \"logAllUseFlags\" helper function is temporarily disabled while the UseFlag enum remains unpatched in vanilla.")
|
|
112
112
|
end
|
|
113
113
|
function ____exports.logArray(array)
|
|
114
114
|
local arrayString = arrayToString(nil, array)
|
package/dist/functions/npc.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to make an NPC fire a projectile. Returns the fired projectile. Use this function
|
|
4
|
-
* instead of `EntityNPC.FireProjectiles
|
|
4
|
+
* instead of the `EntityNPC.FireProjectiles` method, since that returns void.
|
|
5
5
|
*
|
|
6
6
|
* @param npc The NPC to fire the projectile from.
|
|
7
7
|
* @param position The staring position of the projectile.
|
|
@@ -29,7 +29,7 @@ export declare function getAliveBosses(matchingEntityType?: EntityType | int, ma
|
|
|
29
29
|
export declare function getAliveNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
30
30
|
/** Helper function to get all of the bosses in the room. */
|
|
31
31
|
export declare function getBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
32
|
-
/** The same thing as the `getEntities
|
|
32
|
+
/** The same thing as the `getEntities` function, but returns only NPCs. */
|
|
33
33
|
export declare function getNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
34
34
|
/**
|
|
35
35
|
* Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
@@ -38,7 +38,7 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
|
|
|
38
38
|
* `Isaac.GetPlayer`.
|
|
39
39
|
*
|
|
40
40
|
* This function is almost never what you want to use. For most intents and purposes, use the
|
|
41
|
-
* `getPlayers
|
|
41
|
+
* `getPlayers` helper function instead to get a filtered list of players.
|
|
42
42
|
*/
|
|
43
43
|
export declare function getAllPlayers(): EntityPlayer[];
|
|
44
44
|
/**
|
|
@@ -58,8 +58,8 @@ export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPla
|
|
|
58
58
|
export declare function getBlackHearts(player: EntityPlayer): int;
|
|
59
59
|
/**
|
|
60
60
|
* Returns the maximum heart containers that the provided character can have. Normally, this is 12,
|
|
61
|
-
* but with Keeper it is 3, with Tainted Keeper it is 2.
|
|
62
|
-
* Kiss; use the `getPlayerMaxHeartContainers
|
|
61
|
+
* but with Keeper it is 3, and with Tainted Keeper it is 2. This does not account for Birthright or
|
|
62
|
+
* Mother's Kiss; use the `getPlayerMaxHeartContainers` helper function for that.
|
|
63
63
|
*/
|
|
64
64
|
export declare function getCharacterMaxHeartContainers(character: PlayerType | int): int;
|
|
65
65
|
/** Helper function to get an array containing the characters of all of the current players. */
|
|
@@ -77,7 +77,7 @@ export declare function getDeathAnimationName(player: EntityPlayer): string;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
|
|
79
79
|
/**
|
|
80
|
-
* Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer
|
|
80
|
+
* Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
|
|
81
81
|
* method.
|
|
82
82
|
*/
|
|
83
83
|
export declare function getFinalPlayer(): EntityPlayer;
|
|
@@ -137,8 +137,8 @@ export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlay
|
|
|
137
137
|
* - We cannot use `EntityPlayer.InitSeed` because it is not consistent with additional players
|
|
138
138
|
* beyond the first.
|
|
139
139
|
*
|
|
140
|
-
* Instead, we use `EntityPlayer.GetCollectibleRNG
|
|
141
|
-
* works even if the player does not have any Sad Onions.
|
|
140
|
+
* Instead, we use the `EntityPlayer.GetCollectibleRNG` method with an arbitrary value of Sad Onion
|
|
141
|
+
* (1). This works even if the player does not have any Sad Onions.
|
|
142
142
|
*
|
|
143
143
|
* Since the RNG value is the same for both Tainted Lazarus and Dead Tainted Lazarus, we revert to
|
|
144
144
|
* using the RNG of The Inner Eye (2) for Dead Tainted Lazarus.
|
|
@@ -151,13 +151,14 @@ export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlay
|
|
|
151
151
|
export declare function getPlayerIndex(player: EntityPlayer, differentiateForgottenAndSoul?: boolean): PlayerIndex;
|
|
152
152
|
/**
|
|
153
153
|
* Helper function to return the index of this player with respect to the output of the
|
|
154
|
-
* `Isaac.GetPlayer
|
|
154
|
+
* `Isaac.GetPlayer` method.
|
|
155
155
|
*/
|
|
156
156
|
export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int | undefined;
|
|
157
157
|
/**
|
|
158
158
|
* Returns the maximum heart containers that the provided player can have. Normally, this is 12, but
|
|
159
159
|
* it can change depending on the character (e.g. Keeper) and other things (e.g. Mother's Kiss).
|
|
160
|
-
*
|
|
160
|
+
* This function does not account for Broken Hearts; use the `getPlayerAvailableHeartSlots` helper
|
|
161
|
+
* function for that.
|
|
161
162
|
*/
|
|
162
163
|
export declare function getPlayerMaxHeartContainers(player: EntityPlayer): int;
|
|
163
164
|
/**
|
|
@@ -193,6 +194,7 @@ export declare function getPlayers(performCharacterExclusions?: boolean): Entity
|
|
|
193
194
|
* for. Returns true if any of the characters supplied are present.
|
|
194
195
|
*/
|
|
195
196
|
export declare function getPlayersOfType(...characters: Array<PlayerType | int>): EntityPlayer[];
|
|
197
|
+
export declare function getPlayersWithCollectible(collectibleType: CollectibleType | int): EntityPlayer[];
|
|
196
198
|
/**
|
|
197
199
|
* Returns the number of soul hearts that the player has, excluding any black hearts. For example,
|
|
198
200
|
* if the player has one full black heart, one full soul heart, and one half black heart, this
|
|
@@ -287,8 +289,8 @@ export declare function removeCollectibleCostume(player: EntityPlayer, collectib
|
|
|
287
289
|
/**
|
|
288
290
|
* Helper function to remove the Dead Eye multiplier from a player.
|
|
289
291
|
*
|
|
290
|
-
* Note that each time the `EntityPlayer.ClearDeadEyeCharge
|
|
291
|
-
*
|
|
292
|
+
* Note that each time the `EntityPlayer.ClearDeadEyeCharge` method is called, it only has a chance
|
|
293
|
+
* of working, so this function calls it 100 times to be safe.
|
|
292
294
|
*/
|
|
293
295
|
export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
294
296
|
/**
|
|
@@ -298,8 +300,9 @@ export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
|
298
300
|
export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
299
301
|
/**
|
|
300
302
|
* Helper function to set an active collectible to a particular slot. This has different behavior
|
|
301
|
-
* than calling `player.AddCollectible
|
|
302
|
-
* not shift existing items into the Schoolbag and it handles
|
|
303
|
+
* than calling the `player.AddCollectible` method with the `activeSlot` argument, because this
|
|
304
|
+
* function will not shift existing items into the Schoolbag and it handles
|
|
305
|
+
* `ActiveSlot.SLOT_POCKET2`.
|
|
303
306
|
*
|
|
304
307
|
* Note that if an item is set to `ActiveSlot.SLOT_POCKET2`, it will disappear after being used and
|
|
305
308
|
* will be automatically removed upon entering a new room.
|
|
@@ -498,6 +498,13 @@ function ____exports.getPlayersOfType(self, ...)
|
|
|
498
498
|
end
|
|
499
499
|
)
|
|
500
500
|
end
|
|
501
|
+
function ____exports.getPlayersWithCollectible(self, collectibleType)
|
|
502
|
+
local players = ____exports.getPlayers(nil)
|
|
503
|
+
return __TS__ArrayFilter(
|
|
504
|
+
players,
|
|
505
|
+
function(____, player) return player:HasCollectible(collectibleType) end
|
|
506
|
+
)
|
|
507
|
+
end
|
|
501
508
|
function ____exports.getSoulHearts(self, player)
|
|
502
509
|
local soulHearts = player:GetSoulHearts()
|
|
503
510
|
local blackHearts = ____exports.getBlackHearts(nil, player)
|
|
@@ -604,9 +611,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
604
611
|
itemPool:RemoveCollectible(collectibleType)
|
|
605
612
|
end
|
|
606
613
|
repeat
|
|
607
|
-
local
|
|
608
|
-
local
|
|
609
|
-
if
|
|
614
|
+
local ____switch131 = activeSlot
|
|
615
|
+
local ____cond131 = ____switch131 == ActiveSlot.SLOT_PRIMARY
|
|
616
|
+
if ____cond131 then
|
|
610
617
|
do
|
|
611
618
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
612
619
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -615,8 +622,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
615
622
|
break
|
|
616
623
|
end
|
|
617
624
|
end
|
|
618
|
-
|
|
619
|
-
if
|
|
625
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SLOT_SECONDARY
|
|
626
|
+
if ____cond131 then
|
|
620
627
|
do
|
|
621
628
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
622
629
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -631,16 +638,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
631
638
|
break
|
|
632
639
|
end
|
|
633
640
|
end
|
|
634
|
-
|
|
635
|
-
if
|
|
641
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SLOT_POCKET
|
|
642
|
+
if ____cond131 then
|
|
636
643
|
do
|
|
637
644
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
638
645
|
player:SetActiveCharge(charge, activeSlot)
|
|
639
646
|
break
|
|
640
647
|
end
|
|
641
648
|
end
|
|
642
|
-
|
|
643
|
-
if
|
|
649
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SLOT_POCKET2
|
|
650
|
+
if ____cond131 then
|
|
644
651
|
do
|
|
645
652
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
646
653
|
break
|
|
@@ -5,7 +5,7 @@ import { PlayerHealth } from "../types/PlayerHealth";
|
|
|
5
5
|
* `setPlayerHealth` function to restore the player's health back to a certain configuration at a
|
|
6
6
|
* later time.
|
|
7
7
|
*
|
|
8
|
-
* This is based on the `REVEL.StoreHealth
|
|
8
|
+
* This is based on the `REVEL.StoreHealth` function in the Revelations mod.
|
|
9
9
|
*/
|
|
10
10
|
export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
|
|
|
13
13
|
* with the `getPlayerHealth` function to restore the player's health back to a certain
|
|
14
14
|
* configuration at a later time.
|
|
15
15
|
*
|
|
16
|
-
* Based on the `REVEL.LoadHealth
|
|
16
|
+
* Based on the `REVEL.LoadHealth` function in the Revelations mod.
|
|
17
17
|
*/
|
|
18
18
|
export declare function setPlayerHealth(player: EntityPlayer, playerHealth: PlayerHealth): void;
|
|
19
19
|
export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { PocketItemDescription } from "../types/PocketItemDescription";
|
|
3
3
|
export declare function getFirstCardOrPill(player: EntityPlayer): PocketItemDescription | undefined;
|
|
4
4
|
/**
|
|
5
|
-
* Use this helper function as a workaround for `EntityPlayer.GetPocketItem
|
|
5
|
+
* Use this helper function as a workaround for the `EntityPlayer.GetPocketItem` method not working
|
|
6
6
|
* correctly.
|
|
7
7
|
*
|
|
8
8
|
* Note that due to API limitations, there is no way to determine the location of a Dice Bag trinket
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get a room position that is not overlapping with a grid entity, a heaven door,
|
|
4
|
-
* or a player. The `Room.FindFreePickupSpawnPosition
|
|
4
|
+
* or a player. The `Room.FindFreePickupSpawnPosition` method will return locations that overlap
|
|
5
5
|
* with heaven doors and partially overlap with players, if the thing being spawned is bigger than a
|
|
6
6
|
* tile (like a Blood Donation Machine). Use this function instead if you want to account for those
|
|
7
7
|
* specific situations.
|
|
@@ -14,20 +14,19 @@ export declare function findFreePosition(startingPosition: Vector, avoidActiveEn
|
|
|
14
14
|
/**
|
|
15
15
|
* Helper function to get a map containing the positions of every entity in the current room.
|
|
16
16
|
*
|
|
17
|
-
* This is useful for rewinding entity positions at a later time. Also see `setEntityPositions
|
|
17
|
+
* This is useful for rewinding entity positions at a later time. Also see `setEntityPositions`.
|
|
18
18
|
*
|
|
19
|
-
* @param entities Optional. If provided, will only get the positions of the provided entities.
|
|
20
|
-
*
|
|
19
|
+
* @param entities Optional. If provided, will only get the positions of the provided entities. Use
|
|
20
|
+
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
|
|
21
21
|
*/
|
|
22
22
|
export declare function getEntityPositions(entities?: Entity[]): Map<PtrHash, Vector>;
|
|
23
23
|
/**
|
|
24
24
|
* Helper function to get a map containing the velocities of every entity in the current room.
|
|
25
25
|
*
|
|
26
|
-
* This is useful for rewinding entity velocities at a later time. Also see `setEntityVelocities
|
|
26
|
+
* This is useful for rewinding entity velocities at a later time. Also see `setEntityVelocities`.
|
|
27
27
|
*
|
|
28
|
-
* @param entities Optional. If provided, will only get the velocities of the provided entities.
|
|
29
|
-
*
|
|
30
|
-
* times.
|
|
28
|
+
* @param entities Optional. If provided, will only get the velocities of the provided entities. Use
|
|
29
|
+
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
|
|
31
30
|
*/
|
|
32
31
|
export declare function getEntityVelocities(entities?: Entity[]): Map<PtrHash, Vector>;
|
|
33
32
|
/**
|
|
@@ -36,11 +35,11 @@ export declare function getEntityVelocities(entities?: Entity[]): Map<PtrHash, V
|
|
|
36
35
|
* be skipped.
|
|
37
36
|
*
|
|
38
37
|
* This function is useful for rewinding entity positions at a later time. Also see
|
|
39
|
-
* `getEntityPositions
|
|
38
|
+
* `getEntityPositions`.
|
|
40
39
|
*
|
|
41
40
|
* @param entityPositions The map providing the positions for every entity.
|
|
42
|
-
* @param entities Optional. If provided, will only set the positions of the provided entities.
|
|
43
|
-
*
|
|
41
|
+
* @param entities Optional. If provided, will only set the positions of the provided entities. Use
|
|
42
|
+
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
|
|
44
43
|
*/
|
|
45
44
|
export declare function setEntityPositions(entityPositions: Map<PtrHash, Vector>, entities?: Entity[]): void;
|
|
46
45
|
/**
|
|
@@ -49,11 +48,10 @@ export declare function setEntityPositions(entityPositions: Map<PtrHash, Vector>
|
|
|
49
48
|
* be skipped.
|
|
50
49
|
*
|
|
51
50
|
* This function is useful for rewinding entity velocities at a later time. Also see
|
|
52
|
-
* `getEntityVelocities
|
|
51
|
+
* `getEntityVelocities`.
|
|
53
52
|
*
|
|
54
53
|
* @param entityVelocities The map providing the velocities for every entity.
|
|
55
|
-
* @param entities Optional. If provided, will only set the velocities of the provided entities.
|
|
56
|
-
*
|
|
57
|
-
* times.
|
|
54
|
+
* @param entities Optional. If provided, will only set the velocities of the provided entities. Use
|
|
55
|
+
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
|
|
58
56
|
*/
|
|
59
57
|
export declare function setEntityVelocities(entityVelocities: Map<PtrHash, Vector>, entities?: Entity[]): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
3
|
* This returns a random float between 0 and 1. It is inclusive on the low end, but exclusive on
|
|
4
|
-
* the high end. (This is because `RNG.RandomFloat
|
|
5
|
-
* return a value of exactly 1.)
|
|
4
|
+
* the high end. (This is because the `RNG.RandomFloat` method can return a value of 0.999, but it
|
|
5
|
+
* will never return a value of exactly 1.)
|
|
6
6
|
*/
|
|
7
7
|
export declare function getRandom(seed?: Seed): float;
|
|
8
8
|
/**
|
|
9
9
|
* This returns a random float between min and max. It is inclusive on the low end, but exclusive on
|
|
10
|
-
* the high end. (This is because `RNG.RandomFloat
|
|
11
|
-
* return a value of exactly 1.)
|
|
10
|
+
* the high end. (This is because the `RNG.RandomFloat` method can return a value of 0.999, but it
|
|
11
|
+
* will never return a value of exactly 1.)
|
|
12
12
|
*
|
|
13
13
|
* Example:
|
|
14
14
|
* ```
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function isDamageToPlayerFatal(player: EntityPlayer, damageAmount: int, damageSource: EntityRef, lastDamageGameFrame: int | undefined): boolean;
|
|
7
7
|
/**
|
|
8
|
-
* The `EntityPlayer.WillPlayerRevive
|
|
9
|
-
*
|
|
8
|
+
* The `EntityPlayer.WillPlayerRevive` method does not properly account for Mysterious Paper, so use
|
|
9
|
+
* this helper function instead for more robust revival detection.
|
|
10
10
|
*/
|
|
11
11
|
export declare function willPlayerRevive(player: EntityPlayer): boolean;
|
|
12
12
|
/**
|
|
@@ -16,7 +16,7 @@ export declare function getAllRoomGridIndexes(): int[];
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCurrentDimension(): Dimension;
|
|
18
18
|
/**
|
|
19
|
-
* Alias for the `Level.GetCurrentRoomDesc
|
|
19
|
+
* Alias for the `Level.GetCurrentRoomDesc` method. Use this to make it more clear what type of
|
|
20
20
|
* `RoomDescriptor` object that you are retrieving.
|
|
21
21
|
*/
|
|
22
22
|
export declare function getCurrentRoomDescriptorReadOnly(): RoomDescriptorReadOnly;
|
|
@@ -73,8 +73,8 @@ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int
|
|
|
73
73
|
export declare function getRoomItemPoolType(): ItemPoolType;
|
|
74
74
|
/**
|
|
75
75
|
* Helper function to get the list grid index of the provided room, which is equal to the index in
|
|
76
|
-
* the `
|
|
77
|
-
*
|
|
76
|
+
* the `RoomList.Get` method. In other words, this is equal to the order that the room was created
|
|
77
|
+
* by the floor generation algorithm.
|
|
78
78
|
*
|
|
79
79
|
* Use this as an index for data structures that store data per room, since it is unique across
|
|
80
80
|
* different dimensions.
|
|
@@ -126,8 +126,8 @@ export declare function getRoomVariant(roomGridIndex?: int): int;
|
|
|
126
126
|
*/
|
|
127
127
|
export declare function getRoomVisitedCount(roomGridIndex?: int): int;
|
|
128
128
|
/**
|
|
129
|
-
* Helper function to get the room descriptor for every room on the level. Uses the
|
|
130
|
-
*
|
|
129
|
+
* Helper function to get the room descriptor for every room on the level. Uses the `Level.GetRooms`
|
|
130
|
+
* method to accomplish this.
|
|
131
131
|
*
|
|
132
132
|
* @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
|
|
133
133
|
* extra-dimensional rooms are automatically be generated and can be seen when you iterate over the
|
|
@@ -217,10 +217,10 @@ export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
|
|
|
217
217
|
*/
|
|
218
218
|
export declare function isRoomInsideMap(roomGridIndex?: int): boolean;
|
|
219
219
|
/**
|
|
220
|
-
* If `Room.Update
|
|
221
|
-
* (such as the player). Since those entity velocities are already at zero, setting them to
|
|
222
|
-
* will have no effect. Thus, a generic solution is to record all of the entity
|
|
223
|
-
* before updating the room, and then restore those positions/velocities.
|
|
220
|
+
* If the `Room.Update` method is called in a PostNewRoom callback, then some entities will slide
|
|
221
|
+
* around (such as the player). Since those entity velocities are already at zero, setting them to
|
|
222
|
+
* zero will have no effect. Thus, a generic solution is to record all of the entity
|
|
223
|
+
* positions/velocities before updating the room, and then restore those positions/velocities.
|
|
224
224
|
*/
|
|
225
225
|
export declare function roomUpdateSafe(): void;
|
|
226
226
|
/**
|
|
@@ -237,9 +237,9 @@ export declare function setRoomUncleared(): void;
|
|
|
237
237
|
/**
|
|
238
238
|
* Helper function to change the current room. It can be used for both teleportation and "normal"
|
|
239
239
|
* room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
|
|
240
|
-
* arguments. Use this function instead of invoking `Game.StartRoomTransition
|
|
241
|
-
* you do not forget to set `Level.LeaveDoor` property and to prevent crashing on invalid
|
|
242
|
-
* indexes.
|
|
240
|
+
* arguments. Use this function instead of invoking the `Game.StartRoomTransition` method directly
|
|
241
|
+
* so that you do not forget to set `Level.LeaveDoor` property and to prevent crashing on invalid
|
|
242
|
+
* room grid indexes.
|
|
243
243
|
*
|
|
244
244
|
* @param roomGridIndex The room grid index of the destination room.
|
|
245
245
|
* @param direction Optional. Default is `Direction.NO_DIRECTION`.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
|
-
* Helper function to spawn a collectible. Use this instead of `Game.Spawn
|
|
4
|
-
* cases of Tainted Keeper collectibles costing coins and preventing quest items from
|
|
5
|
-
* by Tainted Isaac's rotation mechanic.
|
|
3
|
+
* Helper function to spawn a collectible. Use this instead of the `Game.Spawn` method because it
|
|
4
|
+
* handles the cases of Tainted Keeper collectibles costing coins and preventing quest items from
|
|
5
|
+
* being rotated by Tainted Isaac's rotation mechanic. (Rotation prevention will only occur in
|
|
6
|
+
* upgraded mods.)
|
|
6
7
|
*
|
|
7
8
|
* @param collectibleType The collectible type to spawn.
|
|
8
9
|
* @param position The position to spawn the collectible at.
|
|
@@ -18,9 +18,9 @@ export declare function clearSprite(sprite: Sprite, ...layerIDs: int[]): void;
|
|
|
18
18
|
* specific animation to check.
|
|
19
19
|
*
|
|
20
20
|
* Note that this function is bugged with the Stop Watch or the Broken Watch, since using the
|
|
21
|
-
* `SetFrame
|
|
22
|
-
* the animation. (The `PlaybackSpeed` property of the sprite is not used.) Thus, it is only safe
|
|
23
|
-
* use this function on animations that are not slowed down by Stop Watch or Broken Watch, such
|
|
24
|
-
* player animations.
|
|
21
|
+
* `Sprite.SetFrame` method will reset the internal accumulator used to slow down the playback speed
|
|
22
|
+
* of the animation. (The `PlaybackSpeed` property of the sprite is not used.) Thus, it is only safe
|
|
23
|
+
* to use this function on animations that are not slowed down by Stop Watch or Broken Watch, such
|
|
24
|
+
* as player animations.
|
|
25
25
|
*/
|
|
26
26
|
export declare function getFinalFrameOfAnimation(sprite: Sprite, animation?: string): int;
|
package/dist/functions/ui.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get the width of the first player's hearts on the UI. This is useful for
|
|
4
4
|
* drawing UI elements to the right of where the player's hearts are. Make sure to use this in
|
|
5
|
-
* combination with the `getHUDOffsetVector
|
|
5
|
+
* combination with the the `getHUDOffsetVector` helper function.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getHeartsUIWidth(): int;
|
|
8
8
|
/**
|
|
@@ -50,7 +50,7 @@ export declare const ensureAllCases: (obj: never) => never;
|
|
|
50
50
|
* https://isaacscript.github.io/docs/gotchas#iterating-over-enums
|
|
51
51
|
*
|
|
52
52
|
* You can also use this function for vanilla enums, which can make code easier to read than using
|
|
53
|
-
* `pairs` or `Object.values
|
|
53
|
+
* `pairs` or `Object.values`.
|
|
54
54
|
*/
|
|
55
55
|
export declare function getEnumValues<T>(transpiledEnum: T): Array<T[keyof T]>;
|
|
56
56
|
/**
|
|
@@ -78,9 +78,9 @@ export declare function isLuaDebugEnabled(): boolean;
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function onSetSeed(): boolean;
|
|
80
80
|
/**
|
|
81
|
-
* Helper function to print something to the in-game console. Use this instead of invoking
|
|
82
|
-
* `Isaac.ConsoleOutput
|
|
83
|
-
* message (which `Isaac.ConsoleOutput
|
|
81
|
+
* Helper function to print something to the in-game console. Use this instead of invoking the
|
|
82
|
+
* `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
|
|
83
|
+
* of the message (which `Isaac.ConsoleOutput` does not do by default).
|
|
84
84
|
*/
|
|
85
85
|
export declare function printConsole(msg: string): void;
|
|
86
86
|
/**
|
package/dist/upgradeMod.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { ModUpgraded } from "./types/ModUpgraded";
|
|
|
18
18
|
* For a list of all custom callbacks, check out the
|
|
19
19
|
* [Function Signatures](https://isaacscript.github.io/docs/function-signatures#custom-callbacks).
|
|
20
20
|
*
|
|
21
|
-
* @param modVanilla The mod object returned by the `RegisterMod
|
|
21
|
+
* @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
22
22
|
* @param verbose Enables verbose logging for the purposes of crash troubleshooting.
|
|
23
23
|
* Defaults to false.
|
|
24
24
|
* @returns The upgraded mod object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.132",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@zamiell/typescript-to-lua": "^1.4.2",
|
|
29
|
-
"isaac-typescript-definitions": "^1.0.
|
|
30
|
-
"isaacscript-lint": "^1.0.
|
|
29
|
+
"isaac-typescript-definitions": "^1.0.364",
|
|
30
|
+
"isaacscript-lint": "^1.0.86",
|
|
31
31
|
"isaacscript-tsconfig": "^1.1.8",
|
|
32
32
|
"typedoc": "^0.22.13",
|
|
33
33
|
"typescript": "4.5.5"
|