isaacscript-common 7.1.0 → 7.2.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/callbacks/itemPickup.d.ts.map +1 -1
- package/dist/callbacks/itemPickup.lua +3 -1
- package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +14 -11
- package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
- package/dist/callbacks/postDiceRoomActivated.lua +5 -4
- package/dist/callbacks/postItemDischarged.lua +2 -1
- package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
- package/dist/callbacks/postPlayerChangeStat.lua +44 -15
- package/dist/callbacks/postSlotDestroyed.lua +3 -3
- package/dist/classes/DefaultMap.d.ts +5 -5
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.lua +3 -1
- package/dist/core/constantsFirstLast.d.ts +2 -0
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +36 -9
- package/dist/enums/AmbushType.d.ts +1 -0
- package/dist/enums/AmbushType.d.ts.map +1 -1
- package/dist/enums/AmbushType.lua +1 -0
- package/dist/enums/CornerType.d.ts +1 -0
- package/dist/enums/CornerType.d.ts.map +1 -1
- package/dist/enums/CornerType.lua +1 -0
- package/dist/enums/PocketItemType.d.ts +1 -0
- package/dist/enums/PocketItemType.d.ts.map +1 -1
- package/dist/enums/PocketItemType.lua +1 -0
- package/dist/enums/RockAltType.d.ts +1 -0
- package/dist/enums/RockAltType.d.ts.map +1 -1
- package/dist/enums/RockAltType.lua +1 -0
- package/dist/enums/SaveDataKey.d.ts +11 -0
- package/dist/enums/SaveDataKey.d.ts.map +1 -0
- package/dist/enums/{private/SaveDataKey.lua → SaveDataKey.lua} +2 -0
- package/dist/enums/SerializationType.d.ts +1 -0
- package/dist/enums/SerializationType.d.ts.map +1 -1
- package/dist/enums/SerializationType.lua +1 -0
- package/dist/enums/SlotDestructionType.d.ts +1 -0
- package/dist/enums/SlotDestructionType.d.ts.map +1 -1
- package/dist/enums/SlotDestructionType.lua +1 -0
- package/dist/enums/StatType.d.ts +1 -3
- package/dist/enums/StatType.d.ts.map +1 -1
- package/dist/enums/StatType.lua +0 -2
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.lua +8 -0
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +3 -1
- package/dist/features/customStage/backdrop.d.ts +1 -1
- package/dist/features/customStage/backdrop.d.ts.map +1 -1
- package/dist/features/customStage/backdrop.lua +5 -3
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
- package/dist/features/customStage/customStageGridEntities.lua +3 -1
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +3 -1
- package/dist/features/customStage/init.lua +2 -2
- package/dist/features/customStage/shadows.d.ts.map +1 -1
- package/dist/features/customStage/shadows.lua +2 -1
- package/dist/features/deployJSONRoom.lua +13 -10
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +8 -2
- package/dist/features/saveDataManager/exports.d.ts +2 -1
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.d.ts +1 -1
- package/dist/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/functions/bitSet128.d.ts.map +1 -1
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +3 -1
- package/dist/functions/cacheFlag.d.ts +23 -1
- package/dist/functions/cacheFlag.d.ts.map +1 -1
- package/dist/functions/cacheFlag.lua +78 -0
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +2 -1
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +3 -1
- package/dist/functions/entities.lua +2 -1
- package/dist/functions/flying.lua +2 -2
- package/dist/functions/gridEntities.lua +2 -1
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +5 -3
- package/dist/functions/index.d.ts +0 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +0 -8
- package/dist/functions/input.d.ts +5 -2
- package/dist/functions/input.d.ts.map +1 -1
- package/dist/functions/input.lua +11 -3
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/levelGrid.d.ts.map +1 -1
- package/dist/functions/levelGrid.lua +3 -1
- package/dist/functions/nextStage.d.ts.map +1 -1
- package/dist/functions/nextStage.lua +7 -5
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.lua +4 -2
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +9 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +2 -1
- package/dist/functions/playerStats.d.ts.map +1 -1
- package/dist/functions/playerStats.lua +1 -2
- package/dist/functions/players.d.ts +1 -1
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +13 -15
- package/dist/functions/pocketItems.d.ts.map +1 -1
- package/dist/functions/pocketItems.lua +3 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.lua +3 -0
- package/dist/functions/rockAlt.d.ts.map +1 -1
- package/dist/functions/rockAlt.lua +11 -20
- package/dist/functions/rooms.d.ts +4 -4
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +18 -16
- package/dist/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +8 -2
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.lua +4 -2
- package/dist/functions/types.d.ts +64 -0
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.lua +63 -0
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/interfaces/ChargeBarSprites.d.ts +1 -1
- package/dist/interfaces/Corner.d.ts +5 -0
- package/dist/interfaces/Corner.d.ts.map +1 -1
- package/dist/interfaces/CustomStageLua.d.ts +57 -0
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/dist/interfaces/GridEntityCustomData.d.ts +6 -0
- package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
- package/dist/interfaces/JSONRoomsFile.d.ts +7 -3
- package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
- package/dist/interfaces/PlayerHealth.d.ts +1 -1
- package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +1 -1
- package/dist/interfaces/RoomDescription.d.ts.map +1 -1
- package/dist/interfaces/StatTypeType.d.ts +4 -1
- package/dist/interfaces/StatTypeType.d.ts.map +1 -1
- package/dist/interfaces/TrinketSituation.d.ts +1 -1
- package/dist/interfaces/TrinketSituation.d.ts.map +1 -1
- package/dist/maps/keyboardToString.d.ts +4 -0
- package/dist/maps/keyboardToString.d.ts.map +1 -0
- package/dist/maps/keyboardToString.lua +73 -0
- package/dist/types/AnyEntity.d.ts +5 -0
- package/dist/types/AnyEntity.d.ts.map +1 -1
- package/dist/types/AnyGridEntity.d.ts +5 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/types/CollectibleIndex.d.ts +4 -3
- package/dist/types/CollectibleIndex.d.ts.map +1 -1
- package/dist/types/Immutable.d.ts +3 -1
- package/dist/types/Immutable.d.ts.map +1 -1
- package/dist/types/PickupIndex.d.ts +4 -2
- package/dist/types/PickupIndex.d.ts.map +1 -1
- package/dist/types/PlayerIndex.d.ts +3 -2
- package/dist/types/PlayerIndex.d.ts.map +1 -1
- package/dist/types/SerializedIsaacAPIClass.d.ts +6 -0
- package/dist/types/SerializedIsaacAPIClass.d.ts.map +1 -1
- package/dist/types/TSTLClass.d.ts +5 -0
- package/dist/types/TSTLClass.d.ts.map +1 -1
- package/dist/types/TrapdoorDestination.d.ts +3 -0
- package/dist/types/TrapdoorDestination.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/itemPickup.ts +5 -2
- package/src/callbacks/postCustomDoorEnter.ts +18 -11
- package/src/callbacks/postDiceRoomActivated.ts +7 -12
- package/src/callbacks/postItemDischarged.ts +3 -1
- package/src/callbacks/postPlayerChangeStat.ts +45 -3
- package/src/callbacks/postSlotDestroyed.ts +3 -2
- package/src/callbacks/reorderedCallbacks.ts +2 -2
- package/src/classes/DefaultMap.ts +8 -8
- package/src/core/constants.ts +3 -3
- package/src/core/constantsFirstLast.ts +29 -14
- package/src/enums/AmbushType.ts +1 -0
- package/src/enums/CornerType.ts +1 -0
- package/src/enums/PocketItemType.ts +1 -0
- package/src/enums/RockAltType.ts +1 -0
- package/src/enums/SaveDataKey.ts +10 -0
- package/src/enums/SerializationType.ts +1 -0
- package/src/enums/SlotDestructionType.ts +1 -0
- package/src/enums/StatType.ts +7 -7
- package/src/enums/index.ts +1 -0
- package/src/enums/indexTypeDoc.ts +1 -0
- package/src/features/customGridEntity.ts +2 -1
- package/src/features/customStage/backdrop.ts +5 -3
- package/src/features/customStage/customStageGridEntities.ts +2 -1
- package/src/features/customStage/exports.ts +5 -4
- package/src/features/customStage/init.ts +2 -2
- package/src/features/customStage/shadows.ts +2 -1
- package/src/features/deployJSONRoom.ts +14 -19
- package/src/features/extraConsoleCommands/listCommands.ts +3 -2
- package/src/features/fastReset.ts +1 -1
- package/src/features/indexTypeDoc.ts +2 -1
- package/src/features/saveDataManager/exports.ts +4 -4
- package/src/features/saveDataManager/main.ts +1 -1
- package/src/features/saveDataManager/save.ts +1 -1
- package/src/functions/bitSet128.ts +1 -5
- package/src/functions/bosses.ts +2 -1
- package/src/functions/cacheFlag.ts +90 -1
- package/src/functions/cards.ts +3 -3
- package/src/functions/collectibles.ts +2 -8
- package/src/functions/color.ts +1 -1
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/dimensions.ts +1 -1
- package/src/functions/doors.ts +2 -2
- package/src/functions/entities.ts +2 -2
- package/src/functions/flying.ts +1 -1
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridEntitiesSpecific.ts +4 -3
- package/src/functions/index.ts +0 -1
- package/src/functions/indexTypeDoc.ts +0 -1
- package/src/functions/input.ts +17 -4
- package/src/functions/jsonHelpers.ts +1 -1
- package/src/functions/kColor.ts +1 -5
- package/src/functions/levelGrid.ts +3 -2
- package/src/functions/nextStage.ts +6 -5
- package/src/functions/npcs.ts +3 -2
- package/src/functions/pills.ts +11 -9
- package/src/functions/playerIndex.ts +3 -1
- package/src/functions/playerStats.ts +0 -1
- package/src/functions/players.ts +5 -6
- package/src/functions/pocketItems.ts +4 -4
- package/src/functions/rng.ts +8 -5
- package/src/functions/rockAlt.ts +28 -13
- package/src/functions/rooms.ts +27 -26
- package/src/functions/spawnCollectible.ts +1 -2
- package/src/functions/stage.ts +3 -2
- package/src/functions/trinkets.ts +6 -5
- package/src/functions/types.ts +100 -0
- package/src/functions/vector.ts +1 -5
- package/src/interfaces/ChargeBarSprites.ts +1 -1
- package/src/interfaces/Corner.ts +5 -0
- package/src/interfaces/CustomStageLua.ts +66 -0
- package/src/interfaces/GridEntityCustomData.ts +6 -0
- package/src/interfaces/JSONRoomsFile.ts +7 -3
- package/src/interfaces/PlayerHealth.ts +1 -1
- package/src/interfaces/PocketItemDescription.ts +1 -1
- package/src/interfaces/RoomDescription.ts +1 -1
- package/src/interfaces/StatTypeType.ts +4 -1
- package/src/interfaces/TrinketSituation.ts +1 -1
- package/src/maps/keyboardToString.ts +77 -0
- package/src/types/AnyEntity.ts +5 -0
- package/src/types/AnyGridEntity.ts +5 -0
- package/src/types/CollectibleIndex.ts +4 -3
- package/src/types/Immutable.ts +3 -1
- package/src/types/PickupIndex.ts +4 -2
- package/src/types/PlayerIndex.ts +3 -2
- package/src/types/SerializedIsaacAPIClass.ts +6 -0
- package/src/types/TSTLClass.ts +5 -0
- package/src/types/TrapdoorDestination.ts +3 -0
- package/dist/enums/private/SaveDataKey.d.ts +0 -7
- package/dist/enums/private/SaveDataKey.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.d.ts +0 -24
- package/dist/functions/collectibleCacheFlag.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.lua +0 -80
- package/src/enums/private/SaveDataKey.ts +0 -6
- package/src/functions/collectibleCacheFlag.ts +0 -90
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** This is used by the `temporarilyRemoveTrinkets` and related helper functions. */
|
|
4
4
|
export interface TrinketSituation {
|
|
5
5
|
trinketTypeRemoved: TrinketType;
|
|
6
6
|
trinketType1: TrinketType;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Keyboard } from "isaac-typescript-definitions";
|
|
2
|
+
|
|
3
|
+
/** Maps each keyboard enum member to its corresponding lowercase and uppercase characters. */
|
|
4
|
+
export const KEYBOARD_TO_STRING: ReadonlyMap<
|
|
5
|
+
Keyboard,
|
|
6
|
+
readonly [lowercaseCharacter: string, uppercaseCharacter: string]
|
|
7
|
+
> = new Map([
|
|
8
|
+
[Keyboard.SPACE, [" ", " "]], // 32
|
|
9
|
+
[Keyboard.APOSTROPHE, ["'", '"']], // 39
|
|
10
|
+
[Keyboard.COMMA, [",", "<"]], // 44
|
|
11
|
+
[Keyboard.MINUS, ["-", "_"]], // 45
|
|
12
|
+
[Keyboard.PERIOD, [".", ">"]], // 46
|
|
13
|
+
[Keyboard.SLASH, ["/", "?"]], // 47
|
|
14
|
+
|
|
15
|
+
[Keyboard.ZERO, ["0", ")"]], // 48
|
|
16
|
+
[Keyboard.ONE, ["1", "!"]], // 49
|
|
17
|
+
[Keyboard.TWO, ["2", "@"]], // 50
|
|
18
|
+
[Keyboard.THREE, ["3", "#"]], // 51
|
|
19
|
+
[Keyboard.FOUR, ["4", "$"]], // 52
|
|
20
|
+
[Keyboard.FIVE, ["5", "%"]], // 53
|
|
21
|
+
[Keyboard.SIX, ["6", "^"]], // 54
|
|
22
|
+
[Keyboard.SEVEN, ["7", "&"]], // 55
|
|
23
|
+
[Keyboard.EIGHT, ["8", "*"]], // 56
|
|
24
|
+
[Keyboard.NINE, ["9", "("]], // 57
|
|
25
|
+
|
|
26
|
+
[Keyboard.SEMICOLON, [";", ":"]], // 59
|
|
27
|
+
[Keyboard.EQUAL, ["=", "+"]], // 61
|
|
28
|
+
|
|
29
|
+
[Keyboard.A, ["a", "A"]], // 65
|
|
30
|
+
[Keyboard.B, ["b", "B"]], // 66
|
|
31
|
+
[Keyboard.C, ["c", "C"]], // 67
|
|
32
|
+
[Keyboard.D, ["d", "D"]], // 68
|
|
33
|
+
[Keyboard.E, ["e", "E"]], // 69
|
|
34
|
+
[Keyboard.F, ["f", "F"]], // 70
|
|
35
|
+
[Keyboard.G, ["g", "G"]], // 71
|
|
36
|
+
[Keyboard.H, ["h", "H"]], // 72
|
|
37
|
+
[Keyboard.I, ["i", "I"]], // 73
|
|
38
|
+
[Keyboard.J, ["j", "J"]], // 74
|
|
39
|
+
[Keyboard.K, ["k", "K"]], // 75
|
|
40
|
+
[Keyboard.L, ["l", "L"]], // 76
|
|
41
|
+
[Keyboard.M, ["m", "M"]], // 77
|
|
42
|
+
[Keyboard.N, ["n", "N"]], // 78
|
|
43
|
+
[Keyboard.O, ["o", "O"]], // 79
|
|
44
|
+
[Keyboard.P, ["p", "P"]], // 80
|
|
45
|
+
[Keyboard.Q, ["q", "Q"]], // 81
|
|
46
|
+
[Keyboard.R, ["r", "R"]], // 82
|
|
47
|
+
[Keyboard.S, ["s", "S"]], // 83
|
|
48
|
+
[Keyboard.T, ["t", "T"]], // 84
|
|
49
|
+
[Keyboard.U, ["u", "U"]], // 85
|
|
50
|
+
[Keyboard.V, ["v", "V"]], // 86
|
|
51
|
+
[Keyboard.W, ["w", "W"]], // 87
|
|
52
|
+
[Keyboard.X, ["x", "X"]], // 88
|
|
53
|
+
[Keyboard.Y, ["y", "Y"]], // 89
|
|
54
|
+
[Keyboard.Z, ["z", "Z"]], // 90
|
|
55
|
+
|
|
56
|
+
[Keyboard.KP_0, ["0", "0"]], // 320
|
|
57
|
+
[Keyboard.KP_1, ["1", "1"]], // 321
|
|
58
|
+
[Keyboard.KP_2, ["2", "2"]], // 322
|
|
59
|
+
[Keyboard.KP_3, ["3", "3"]], // 323
|
|
60
|
+
[Keyboard.KP_4, ["4", "4"]], // 324
|
|
61
|
+
[Keyboard.KP_5, ["5", "5"]], // 325
|
|
62
|
+
[Keyboard.KP_6, ["6", "6"]], // 326
|
|
63
|
+
[Keyboard.KP_7, ["7", "7"]], // 327
|
|
64
|
+
[Keyboard.KP_8, ["8", "8"]], // 328
|
|
65
|
+
[Keyboard.KP_9, ["9", "9"]], // 329
|
|
66
|
+
|
|
67
|
+
[Keyboard.KP_DECIMAL, [".", "."]], // 330
|
|
68
|
+
[Keyboard.KP_DIVIDE, ["/", "/"]], // 331
|
|
69
|
+
[Keyboard.KP_MULTIPLY, ["*", "*"]], // 332
|
|
70
|
+
[Keyboard.KP_SUBTRACT, ["-", "-"]], // 333
|
|
71
|
+
[Keyboard.KP_ADD, ["+", "+"]], // 334
|
|
72
|
+
|
|
73
|
+
[Keyboard.LEFT_BRACKET, ["[", "{"]], // 91
|
|
74
|
+
[Keyboard.BACKSLASH, ["\\", "|"]], // 92
|
|
75
|
+
[Keyboard.RIGHT_BRACKET, ["]", "}"]], // 93
|
|
76
|
+
[Keyboard.GRAVE_ACCENT, ["`", "~"]], // 96
|
|
77
|
+
]);
|
package/src/types/AnyEntity.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `CollectibleIndex` is a specific type of string
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* `CollectibleIndex` is a specific type of string that represents a unique identifier for a
|
|
3
|
+
* collectible. Mods can signify that data structures handle collectibles by using this type.
|
|
4
|
+
*
|
|
5
|
+
* For more information, see the documentation for the `getCollectibleIndex` function.
|
|
5
6
|
*
|
|
6
7
|
* For example:
|
|
7
8
|
*
|
package/src/types/Immutable.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Immutable is a type that will make the given array/map/set/object recursively read-only.
|
|
2
|
+
* Immutable is a utility type that will make the given array/map/set/object recursively read-only.
|
|
3
|
+
*
|
|
4
|
+
* You can use this type to easily build safe data structures.
|
|
3
5
|
*
|
|
4
6
|
* From: https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
|
|
5
7
|
*/
|
package/src/types/PickupIndex.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `PickupIndex` is a specific type of
|
|
3
|
-
*
|
|
2
|
+
* `PickupIndex` is a specific type of number that represents a unique identifier for a pickup. Mods
|
|
3
|
+
* can signify that data structures handle collectibles by using this type.
|
|
4
|
+
*
|
|
5
|
+
* For more information, see the documentation for the `getPickupIndex` function.
|
|
4
6
|
*
|
|
5
7
|
* For example:
|
|
6
8
|
*
|
package/src/types/PlayerIndex.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `PlayerIndex` is a specific type of number that represents a unique identifier for a player. Mods
|
|
3
|
-
* can signify that data structures handle `EntityPlayer` by using this type.
|
|
4
|
-
*
|
|
3
|
+
* can signify that data structures handle `EntityPlayer` by using this type.
|
|
4
|
+
*
|
|
5
|
+
* For more information, see the documentation for the `getPlayerIndex` function.
|
|
5
6
|
*
|
|
6
7
|
* For example:
|
|
7
8
|
*
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a type representing an Isaac API class like `Color` or `RNG` that has been written to the
|
|
3
|
+
* "save#.dat" file. It is used by the save data manager when reading and writing to that file.
|
|
4
|
+
*
|
|
5
|
+
* For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
|
|
6
|
+
*/
|
|
1
7
|
export type SerializedIsaacAPIClass = LuaMap<string, unknown> & {
|
|
2
8
|
readonly __serializedIsaacAPIClassBrand: symbol;
|
|
3
9
|
};
|
package/src/types/TSTLClass.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a type representing a user-created class from TypeScript code.
|
|
3
|
+
*
|
|
4
|
+
* This type is used by the save data manager to when copying, serializing, and deserializing.
|
|
5
|
+
*/
|
|
1
6
|
export type TSTLClass = LuaMap<AnyNotNil, unknown> & {
|
|
2
7
|
readonly __tstlClassBrand: symbol;
|
|
3
8
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* This is the type that you need to specify when using the `spawnCustomTrapdoor` helper function.
|
|
5
|
+
*/
|
|
3
6
|
export type TrapdoorDestination =
|
|
4
7
|
| [stage: LevelStage, stageType: StageType]
|
|
5
8
|
| [customStageName: string, floorNum: int];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SaveDataKey.d.ts","sourceRoot":"","sources":["../../../src/enums/private/SaveDataKey.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,UAAU,eAAe;IACzB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;CACd"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CacheFlag, CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
-
export declare function collectibleHasCacheFlag(collectibleType: CollectibleType, cacheFlag: CacheFlag): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Returns a set containing every collectible type with the given cache flag, including modded
|
|
5
|
-
* collectibles.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<CollectibleType>;
|
|
8
|
-
/**
|
|
9
|
-
* Returns an array containing every collectible type that the player has that matches the provided
|
|
10
|
-
* CacheFlag.
|
|
11
|
-
*
|
|
12
|
-
* For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
13
|
-
* two Dead Doves, then this function would return:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* [
|
|
17
|
-
* CollectibleType.LORD_OF_THE_PIT,
|
|
18
|
-
* CollectibleType.DEAD_DOVE,
|
|
19
|
-
* CollectibleType.DEAD_DOVE,
|
|
20
|
-
* ]
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function getPlayerCollectiblesForCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): CollectibleType[];
|
|
24
|
-
//# sourceMappingURL=collectibleCacheFlag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectibleCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA2B1E,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,eAAe,CAAC,CAYtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE,CAYnB"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
|
-
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local Set = ____lualib.Set
|
|
5
|
-
local ____exports = {}
|
|
6
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
-
local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
|
|
8
|
-
local ____cachedClasses = require("core.cachedClasses")
|
|
9
|
-
local itemConfig = ____cachedClasses.itemConfig
|
|
10
|
-
local ____collectibleSet = require("functions.collectibleSet")
|
|
11
|
-
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
12
|
-
local ____enums = require("functions.enums")
|
|
13
|
-
local getEnumValues = ____enums.getEnumValues
|
|
14
|
-
local ____flag = require("functions.flag")
|
|
15
|
-
local hasFlag = ____flag.hasFlag
|
|
16
|
-
local ____set = require("functions.set")
|
|
17
|
-
local copySet = ____set.copySet
|
|
18
|
-
local getSortedSetValues = ____set.getSortedSetValues
|
|
19
|
-
local ____utils = require("functions.utils")
|
|
20
|
-
local ____repeat = ____utils["repeat"]
|
|
21
|
-
function ____exports.collectibleHasCacheFlag(self, collectibleType, cacheFlag)
|
|
22
|
-
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
23
|
-
if itemConfigItem == nil then
|
|
24
|
-
return false
|
|
25
|
-
end
|
|
26
|
-
return hasFlag(nil, itemConfigItem.CacheFlags, cacheFlag)
|
|
27
|
-
end
|
|
28
|
-
local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
|
|
29
|
-
local function initCacheFlagMap(self)
|
|
30
|
-
for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
|
|
31
|
-
local collectiblesSet = __TS__New(Set)
|
|
32
|
-
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
33
|
-
if ____exports.collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
|
|
34
|
-
collectiblesSet:add(collectibleType)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
CACHE_FLAG_TO_COLLECTIBLES_MAP:set(cacheFlag, collectiblesSet)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
--- Returns a set containing every collectible type with the given cache flag, including modded
|
|
41
|
-
-- collectibles.
|
|
42
|
-
function ____exports.getCollectiblesForCacheFlag(self, cacheFlag)
|
|
43
|
-
if CACHE_FLAG_TO_COLLECTIBLES_MAP.size == 0 then
|
|
44
|
-
initCacheFlagMap(nil)
|
|
45
|
-
end
|
|
46
|
-
local collectiblesSet = CACHE_FLAG_TO_COLLECTIBLES_MAP:get(cacheFlag)
|
|
47
|
-
if collectiblesSet == nil then
|
|
48
|
-
return __TS__New(Set)
|
|
49
|
-
end
|
|
50
|
-
return copySet(nil, collectiblesSet)
|
|
51
|
-
end
|
|
52
|
-
--- Returns an array containing every collectible type that the player has that matches the provided
|
|
53
|
-
-- CacheFlag.
|
|
54
|
-
--
|
|
55
|
-
-- For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
56
|
-
-- two Dead Doves, then this function would return:
|
|
57
|
-
--
|
|
58
|
-
-- ```ts
|
|
59
|
-
-- [
|
|
60
|
-
-- CollectibleType.LORD_OF_THE_PIT,
|
|
61
|
-
-- CollectibleType.DEAD_DOVE,
|
|
62
|
-
-- CollectibleType.DEAD_DOVE,
|
|
63
|
-
-- ]
|
|
64
|
-
-- ```
|
|
65
|
-
function ____exports.getPlayerCollectiblesForCacheFlag(self, player, cacheFlag)
|
|
66
|
-
local collectiblesForCacheFlag = ____exports.getCollectiblesForCacheFlag(nil, cacheFlag)
|
|
67
|
-
local playerCollectibles = {}
|
|
68
|
-
for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesForCacheFlag)) do
|
|
69
|
-
local numCollectibles = player:GetCollectibleNum(collectibleType)
|
|
70
|
-
____repeat(
|
|
71
|
-
nil,
|
|
72
|
-
numCollectibles,
|
|
73
|
-
function()
|
|
74
|
-
playerCollectibles[#playerCollectibles + 1] = collectibleType
|
|
75
|
-
end
|
|
76
|
-
)
|
|
77
|
-
end
|
|
78
|
-
return playerCollectibles
|
|
79
|
-
end
|
|
80
|
-
return ____exports
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { CacheFlag, CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
-
import { itemConfig } from "../core/cachedClasses";
|
|
3
|
-
import { getCollectibleArray } from "./collectibleSet";
|
|
4
|
-
import { getEnumValues } from "./enums";
|
|
5
|
-
import { hasFlag } from "./flag";
|
|
6
|
-
import { copySet, getSortedSetValues } from "./set";
|
|
7
|
-
import { repeat } from "./utils";
|
|
8
|
-
|
|
9
|
-
const CACHE_FLAG_TO_COLLECTIBLES_MAP = new Map<
|
|
10
|
-
CacheFlag,
|
|
11
|
-
Set<CollectibleType>
|
|
12
|
-
>();
|
|
13
|
-
|
|
14
|
-
function initCacheFlagMap() {
|
|
15
|
-
for (const cacheFlag of getEnumValues(CacheFlag)) {
|
|
16
|
-
const collectiblesSet = new Set<CollectibleType>();
|
|
17
|
-
|
|
18
|
-
for (const collectibleType of getCollectibleArray()) {
|
|
19
|
-
if (collectibleHasCacheFlag(collectibleType, cacheFlag)) {
|
|
20
|
-
collectiblesSet.add(collectibleType);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
CACHE_FLAG_TO_COLLECTIBLES_MAP.set(cacheFlag, collectiblesSet);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function collectibleHasCacheFlag(
|
|
29
|
-
collectibleType: CollectibleType,
|
|
30
|
-
cacheFlag: CacheFlag,
|
|
31
|
-
): boolean {
|
|
32
|
-
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
33
|
-
if (itemConfigItem === undefined) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return hasFlag(itemConfigItem.CacheFlags, cacheFlag);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns a set containing every collectible type with the given cache flag, including modded
|
|
42
|
-
* collectibles.
|
|
43
|
-
*/
|
|
44
|
-
export function getCollectiblesForCacheFlag(
|
|
45
|
-
cacheFlag: CacheFlag,
|
|
46
|
-
): Set<CollectibleType> {
|
|
47
|
-
// Lazy initialize the map.
|
|
48
|
-
if (CACHE_FLAG_TO_COLLECTIBLES_MAP.size === 0) {
|
|
49
|
-
initCacheFlagMap();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const collectiblesSet = CACHE_FLAG_TO_COLLECTIBLES_MAP.get(cacheFlag);
|
|
53
|
-
if (collectiblesSet === undefined) {
|
|
54
|
-
return new Set();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return copySet(collectiblesSet);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Returns an array containing every collectible type that the player has that matches the provided
|
|
62
|
-
* CacheFlag.
|
|
63
|
-
*
|
|
64
|
-
* For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
65
|
-
* two Dead Doves, then this function would return:
|
|
66
|
-
*
|
|
67
|
-
* ```ts
|
|
68
|
-
* [
|
|
69
|
-
* CollectibleType.LORD_OF_THE_PIT,
|
|
70
|
-
* CollectibleType.DEAD_DOVE,
|
|
71
|
-
* CollectibleType.DEAD_DOVE,
|
|
72
|
-
* ]
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export function getPlayerCollectiblesForCacheFlag(
|
|
76
|
-
player: EntityPlayer,
|
|
77
|
-
cacheFlag: CacheFlag,
|
|
78
|
-
): CollectibleType[] {
|
|
79
|
-
const collectiblesForCacheFlag = getCollectiblesForCacheFlag(cacheFlag);
|
|
80
|
-
|
|
81
|
-
const playerCollectibles: CollectibleType[] = [];
|
|
82
|
-
for (const collectibleType of getSortedSetValues(collectiblesForCacheFlag)) {
|
|
83
|
-
const numCollectibles = player.GetCollectibleNum(collectibleType);
|
|
84
|
-
repeat(numCollectibles, () => {
|
|
85
|
-
playerCollectibles.push(collectibleType);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return playerCollectibles;
|
|
90
|
-
}
|