isaacscript-common 1.2.138 → 1.2.141
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/postSlotRender.d.ts +1 -0
- package/dist/callbacks/postSlotRender.lua +73 -0
- package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +2 -0
- package/dist/callbacks/subscriptions/postSlotAnimationChanged.lua +25 -0
- package/dist/constants.d.ts +2 -0
- package/dist/features/deployJSONRoom.lua +11 -22
- package/dist/features/disableInputs.lua +6 -20
- package/dist/features/disableSound.lua +4 -12
- package/dist/features/extraConsoleCommands/commands.d.ts +88 -4
- package/dist/features/extraConsoleCommands/commands.lua +357 -71
- package/dist/features/extraConsoleCommands/init.lua +52 -9
- package/dist/features/extraConsoleCommands/v.d.ts +5 -1
- package/dist/features/extraConsoleCommands/v.lua +7 -1
- package/dist/features/forgottenSwitch.lua +3 -8
- package/dist/features/getCollectibleItemPoolType.lua +4 -9
- package/dist/features/isPonyActive.lua +3 -8
- package/dist/features/preventCollectibleRotate.lua +3 -8
- package/dist/features/runInNFrames.lua +6 -20
- package/dist/features/saveDataManager/constants.d.ts +3 -0
- package/dist/features/saveDataManager/constants.lua +5 -0
- package/dist/features/saveDataManager/exports.lua +9 -18
- package/dist/features/saveDataManager/load.lua +4 -3
- package/dist/features/saveDataManager/main.lua +4 -10
- package/dist/features/saveDataManager/merge.lua +2 -2
- package/dist/features/saveDataManager/save.lua +3 -1
- package/dist/features/sirenHelpers.lua +4 -8
- package/dist/featuresInitialized.d.ts +1 -1
- package/dist/featuresInitialized.lua +5 -0
- package/dist/functions/cards.lua +12 -18
- package/dist/functions/challenges.lua +3 -2
- package/dist/functions/collectibles.lua +8 -14
- package/dist/functions/deepCopy.lua +2 -2
- package/dist/functions/log.lua +3 -0
- package/dist/functions/map.d.ts +4 -1
- package/dist/functions/map.lua +5 -1
- package/dist/functions/pills.lua +10 -15
- package/dist/functions/player.d.ts +2 -0
- package/dist/functions/player.lua +37 -81
- package/dist/functions/rooms.lua +4 -5
- package/dist/functions/transformations.lua +3 -3
- package/dist/functions/trinkets.lua +8 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.lua +16 -0
- package/dist/maps/cardDescriptionMap.d.ts +4 -1
- package/dist/maps/cardDescriptionMap.lua +103 -102
- package/dist/maps/cardNameMap.d.ts +4 -1
- package/dist/maps/cardNameMap.lua +103 -102
- package/dist/maps/cardTypeMap.d.ts +3 -1
- package/dist/maps/cardTypeMap.lua +102 -102
- package/dist/maps/challengeNameMap.d.ts +4 -1
- package/dist/maps/challengeNameMap.lua +50 -50
- package/dist/maps/characterNameMap.d.ts +5 -0
- package/dist/maps/characterNameMap.lua +49 -0
- package/dist/maps/collectibleDescriptionMap.d.ts +1 -0
- package/dist/maps/collectibleDescriptionMap.lua +1 -0
- package/dist/maps/collectibleNameMap.d.ts +1 -0
- package/dist/maps/collectibleNameMap.lua +1 -0
- package/dist/maps/pillEffectClassMap.d.ts +4 -1
- package/dist/maps/pillEffectClassMap.lua +56 -55
- package/dist/maps/pillEffectNameMap.d.ts +4 -1
- package/dist/maps/pillEffectNameMap.lua +55 -55
- package/dist/maps/pillEffectTypeMap.d.ts +4 -1
- package/dist/maps/pillEffectTypeMap.lua +55 -55
- package/dist/maps/roomTypeMap.d.ts +3 -0
- package/dist/maps/roomTypeMap.lua +43 -0
- package/dist/maps/roomTypeNameMap.d.ts +5 -0
- package/dist/maps/roomTypeNameMap.lua +37 -0
- package/dist/maps/transformationNameMap.d.ts +4 -1
- package/dist/maps/transformationNameMap.lua +19 -20
- package/dist/maps/trinketDescriptionMap.d.ts +1 -0
- package/dist/maps/trinketDescriptionMap.lua +1 -0
- package/dist/maps/trinketNameMap.d.ts +1 -0
- package/dist/maps/trinketNameMap.lua +1 -0
- package/dist/types/CallbackParametersCustom.d.ts +5 -0
- package/dist/types/CardType.d.ts +10 -8
- package/dist/types/CardType.lua +9 -7
- package/dist/types/ModCallbacksCustom.d.ts +10 -9
- package/dist/types/ModCallbacksCustom.lua +11 -9
- package/dist/types/ModUpgraded.lua +8 -0
- package/dist/types/PillEffectClass.d.ts +11 -5
- package/dist/types/PillEffectClass.lua +8 -5
- package/dist/types/PillEffectType.d.ts +10 -4
- package/dist/types/PillEffectType.lua +7 -4
- package/dist/upgradeMod.lua +3 -3
- package/package.json +1 -1
package/dist/functions/cards.lua
CHANGED
|
@@ -10,8 +10,10 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
10
10
|
local itemConfig = ____cachedClasses.itemConfig
|
|
11
11
|
local ____cardDescriptionMap = require("maps.cardDescriptionMap")
|
|
12
12
|
local CARD_DESCRIPTION_MAP = ____cardDescriptionMap.CARD_DESCRIPTION_MAP
|
|
13
|
+
local DEFAULT_CARD_DESCRIPTION = ____cardDescriptionMap.DEFAULT_CARD_DESCRIPTION
|
|
13
14
|
local ____cardNameMap = require("maps.cardNameMap")
|
|
14
15
|
local CARD_NAME_MAP = ____cardNameMap.CARD_NAME_MAP
|
|
16
|
+
local DEFAULT_CARD_NAME = ____cardNameMap.DEFAULT_CARD_NAME
|
|
15
17
|
local ____cardTypeMap = require("maps.cardTypeMap")
|
|
16
18
|
local CARD_TYPE_MAP = ____cardTypeMap.CARD_TYPE_MAP
|
|
17
19
|
local DEFAULT_CARD_TYPE = ____cardTypeMap.DEFAULT_CARD_TYPE
|
|
@@ -67,7 +69,7 @@ function ____exports.getCardsOfType(self, ...)
|
|
|
67
69
|
return matchingCards
|
|
68
70
|
end
|
|
69
71
|
function ____exports.getCardType(self, card)
|
|
70
|
-
local cardType = CARD_TYPE_MAP
|
|
72
|
+
local cardType = CARD_TYPE_MAP[card]
|
|
71
73
|
return cardType == nil and DEFAULT_CARD_TYPE or cardType
|
|
72
74
|
end
|
|
73
75
|
function ____exports.getMaxCards(self)
|
|
@@ -76,34 +78,26 @@ end
|
|
|
76
78
|
CARD_TYPE_TO_CARDS_MAP = __TS__New(Map)
|
|
77
79
|
CARD_SET = __TS__New(Set)
|
|
78
80
|
function ____exports.getCardDescription(self, card)
|
|
79
|
-
local
|
|
80
|
-
if type(card) ~= "number" then
|
|
81
|
-
return defaultDescription
|
|
82
|
-
end
|
|
83
|
-
local cardDescription = CARD_DESCRIPTION_MAP:get(card)
|
|
81
|
+
local cardDescription = CARD_DESCRIPTION_MAP[card]
|
|
84
82
|
if cardDescription ~= nil then
|
|
85
83
|
return cardDescription
|
|
86
84
|
end
|
|
87
85
|
local itemConfigCard = itemConfig:GetCard(card)
|
|
88
|
-
if itemConfigCard
|
|
89
|
-
return
|
|
86
|
+
if itemConfigCard ~= nil then
|
|
87
|
+
return itemConfigCard.Description
|
|
90
88
|
end
|
|
91
|
-
return
|
|
89
|
+
return DEFAULT_CARD_DESCRIPTION
|
|
92
90
|
end
|
|
93
91
|
function ____exports.getCardName(self, card)
|
|
94
|
-
local
|
|
95
|
-
if
|
|
96
|
-
return defaultName
|
|
97
|
-
end
|
|
98
|
-
local cardName = CARD_NAME_MAP:get(card)
|
|
99
|
-
if cardName ~= nil then
|
|
92
|
+
local cardName = CARD_NAME_MAP[card]
|
|
93
|
+
if cardName ~= nil and cardName ~= DEFAULT_CARD_NAME then
|
|
100
94
|
return cardName
|
|
101
95
|
end
|
|
102
96
|
local itemConfigCard = itemConfig:GetCard(card)
|
|
103
|
-
if itemConfigCard
|
|
104
|
-
return
|
|
97
|
+
if itemConfigCard ~= nil then
|
|
98
|
+
return itemConfigCard.Name
|
|
105
99
|
end
|
|
106
|
-
return
|
|
100
|
+
return DEFAULT_CARD_NAME
|
|
107
101
|
end
|
|
108
102
|
function ____exports.getRandomCard(self, seed, exceptions)
|
|
109
103
|
if seed == nil then
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
local ____exports = {}
|
|
3
3
|
local ____challengeNameMap = require("maps.challengeNameMap")
|
|
4
4
|
local CHALLENGE_NAME_MAP = ____challengeNameMap.CHALLENGE_NAME_MAP
|
|
5
|
+
local DEFAULT_CHALLENGE_NAME = ____challengeNameMap.DEFAULT_CHALLENGE_NAME
|
|
5
6
|
function ____exports.getChallengeName(self, challenge)
|
|
6
|
-
local challengeName = CHALLENGE_NAME_MAP
|
|
7
|
-
return challengeName == nil and
|
|
7
|
+
local challengeName = CHALLENGE_NAME_MAP[challenge]
|
|
8
|
+
return challengeName == nil and DEFAULT_CHALLENGE_NAME or challengeName
|
|
8
9
|
end
|
|
9
10
|
return ____exports
|
|
@@ -8,8 +8,10 @@ local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
|
|
|
8
8
|
local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = ____constants.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES
|
|
9
9
|
local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
|
|
10
10
|
local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
|
|
11
|
+
local DEFAULT_COLLECTIBLE_DESCRIPTION = ____collectibleDescriptionMap.DEFAULT_COLLECTIBLE_DESCRIPTION
|
|
11
12
|
local ____collectibleNameMap = require("maps.collectibleNameMap")
|
|
12
13
|
local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
14
|
+
local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
|
|
13
15
|
local ____flag = require("functions.flag")
|
|
14
16
|
local hasFlag = ____flag.hasFlag
|
|
15
17
|
local ____pickups = require("functions.pickups")
|
|
@@ -50,19 +52,15 @@ function ____exports.collectibleHasCacheFlag(self, collectibleType, cacheFlag)
|
|
|
50
52
|
return hasFlag(nil, itemConfigItem.CacheFlags, cacheFlag)
|
|
51
53
|
end
|
|
52
54
|
function ____exports.getCollectibleDescription(self, collectibleType)
|
|
53
|
-
local defaultDescription = "Unknown"
|
|
54
|
-
if type(collectibleType) ~= "number" then
|
|
55
|
-
return defaultDescription
|
|
56
|
-
end
|
|
57
55
|
local collectibleDescription = COLLECTIBLE_DESCRIPTION_MAP:get(collectibleType)
|
|
58
56
|
if collectibleDescription ~= nil then
|
|
59
57
|
return collectibleDescription
|
|
60
58
|
end
|
|
61
59
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
62
|
-
if itemConfigItem
|
|
63
|
-
return
|
|
60
|
+
if itemConfigItem ~= nil then
|
|
61
|
+
return itemConfigItem.Description
|
|
64
62
|
end
|
|
65
|
-
return
|
|
63
|
+
return DEFAULT_COLLECTIBLE_DESCRIPTION
|
|
66
64
|
end
|
|
67
65
|
function ____exports.getCollectibleDevilHeartPrice(self, collectibleType, player)
|
|
68
66
|
local maxHearts = player:GetMaxHearts()
|
|
@@ -116,19 +114,15 @@ function ____exports.getCollectibleMaxCharges(self, collectibleType)
|
|
|
116
114
|
return itemConfigItem.MaxCharges
|
|
117
115
|
end
|
|
118
116
|
function ____exports.getCollectibleName(self, collectibleType)
|
|
119
|
-
local defaultName = "Unknown"
|
|
120
|
-
if type(collectibleType) ~= "number" then
|
|
121
|
-
return defaultName
|
|
122
|
-
end
|
|
123
117
|
local collectibleName = COLLECTIBLE_NAME_MAP:get(collectibleType)
|
|
124
118
|
if collectibleName ~= nil then
|
|
125
119
|
return collectibleName
|
|
126
120
|
end
|
|
127
121
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
128
|
-
if itemConfigItem
|
|
129
|
-
return
|
|
122
|
+
if itemConfigItem ~= nil then
|
|
123
|
+
return itemConfigItem.Name
|
|
130
124
|
end
|
|
131
|
-
return
|
|
125
|
+
return DEFAULT_COLLECTIBLE_NAME
|
|
132
126
|
end
|
|
133
127
|
function ____exports.getCollectiblePedestalType(self, collectible)
|
|
134
128
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
@@ -7,8 +7,8 @@ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
|
7
7
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
8
8
|
local ____exports = {}
|
|
9
9
|
local isTSTLClass, copyClass, getNewClassFromMetatable, deepCopyValue, copyVector, checkMetatable, validateValue, TSTL_CLASS_KEYS
|
|
10
|
-
local
|
|
11
|
-
local SAVE_DATA_MANAGER_DEBUG =
|
|
10
|
+
local ____constants = require("features.saveDataManager.constants")
|
|
11
|
+
local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
|
|
12
12
|
local ____DefaultMap = require("types.DefaultMap")
|
|
13
13
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
14
14
|
local ____SerializationBrand = require("types.private.SerializationBrand")
|
package/dist/functions/log.lua
CHANGED
|
@@ -207,6 +207,7 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
|
207
207
|
debugString = debugString .. (" (DropSeed: " .. tostring(entity.DropSeed)) .. ")"
|
|
208
208
|
debugString = debugString .. (((" (Position: " .. tostring(entity.Position.X)) .. ", ") .. tostring(entity.Position.Y)) .. ")"
|
|
209
209
|
debugString = debugString .. (((" (Velocity: " .. tostring(entity.Velocity.X)) .. ", ") .. tostring(entity.Velocity.Y)) .. ")"
|
|
210
|
+
debugString = debugString .. (((" (HP: " .. tostring(entity.HitPoints)) .. " / ") .. tostring(entity.MaxHitPoints)) .. ")"
|
|
210
211
|
____exports.log(debugString)
|
|
211
212
|
numMatchedEntities = numMatchedEntities + 1
|
|
212
213
|
end
|
|
@@ -315,7 +316,9 @@ function ____exports.logRoom()
|
|
|
315
316
|
if roomData == nil then
|
|
316
317
|
____exports.log("Current room data is undefined.")
|
|
317
318
|
else
|
|
319
|
+
____exports.log("Current room stage ID: " .. tostring(roomData.StageID))
|
|
318
320
|
____exports.log((((("Current room type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
|
|
321
|
+
____exports.log("Current room name: " .. roomData.Name)
|
|
319
322
|
end
|
|
320
323
|
____exports.log("Current room grid index: " .. tostring(roomGridIndex))
|
|
321
324
|
____exports.log("Current room list index: " .. tostring(roomListIndex))
|
package/dist/functions/map.d.ts
CHANGED
|
@@ -20,9 +20,12 @@ export declare function defaultMapGetNextSeed<K, A extends unknown[]>(map: Defau
|
|
|
20
20
|
* ]);
|
|
21
21
|
* const searchText = "f";
|
|
22
22
|
* const match = getMapPartialMatch(map, searchText); // match is now equal to 123
|
|
23
|
+
*
|
|
24
|
+
* @returns If a match was found, returns a tuple of the map key and value. If a match was not
|
|
25
|
+
* found, returns undefined.
|
|
23
26
|
* ```
|
|
24
27
|
*/
|
|
25
|
-
export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyMap<string, T>): T | undefined;
|
|
28
|
+
export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyMap<string, T>): [string, T] | undefined;
|
|
26
29
|
/**
|
|
27
30
|
* Helper function to make using maps with `Seed` values easier. Use this instead of manually
|
|
28
31
|
* getting the current value, incrementing it, and then setting it.
|
package/dist/functions/map.lua
CHANGED
|
@@ -46,7 +46,11 @@ function ____exports.getMapPartialMatch(self, searchText, map)
|
|
|
46
46
|
if matchingKey == nil then
|
|
47
47
|
return nil
|
|
48
48
|
end
|
|
49
|
-
|
|
49
|
+
local value = map:get(matchingKey)
|
|
50
|
+
if value == nil then
|
|
51
|
+
return nil
|
|
52
|
+
end
|
|
53
|
+
return {matchingKey, value}
|
|
50
54
|
end
|
|
51
55
|
function ____exports.mapGetNextSeed(self, map, key)
|
|
52
56
|
local seed = map:get(key)
|
package/dist/functions/pills.lua
CHANGED
|
@@ -3,39 +3,34 @@ local ____exports = {}
|
|
|
3
3
|
local ____cachedClasses = require("cachedClasses")
|
|
4
4
|
local itemConfig = ____cachedClasses.itemConfig
|
|
5
5
|
local ____pillEffectClassMap = require("maps.pillEffectClassMap")
|
|
6
|
+
local DEFAULT_PILL_EFFECT_CLASS = ____pillEffectClassMap.DEFAULT_PILL_EFFECT_CLASS
|
|
6
7
|
local PILL_EFFECT_CLASS_MAP = ____pillEffectClassMap.PILL_EFFECT_CLASS_MAP
|
|
7
8
|
local ____pillEffectNameMap = require("maps.pillEffectNameMap")
|
|
9
|
+
local DEFAULT_PILL_EFFECT_NAME = ____pillEffectNameMap.DEFAULT_PILL_EFFECT_NAME
|
|
8
10
|
local PILL_EFFECT_NAME_MAP = ____pillEffectNameMap.PILL_EFFECT_NAME_MAP
|
|
9
11
|
local ____pillEffectTypeMap = require("maps.pillEffectTypeMap")
|
|
12
|
+
local DEFAULT_PILL_EFFECT_TYPE = ____pillEffectTypeMap.DEFAULT_PILL_EFFECT_TYPE
|
|
10
13
|
local PILL_EFFECT_TYPE_MAP = ____pillEffectTypeMap.PILL_EFFECT_TYPE_MAP
|
|
11
|
-
local ____PillEffectClass = require("types.PillEffectClass")
|
|
12
|
-
local DEFAULT_PILL_EFFECT_CLASS = ____PillEffectClass.DEFAULT_PILL_EFFECT_CLASS
|
|
13
|
-
local ____PillEffectType = require("types.PillEffectType")
|
|
14
|
-
local DEFAULT_PILL_EFFECT_TYPE = ____PillEffectType.DEFAULT_PILL_EFFECT_TYPE
|
|
15
14
|
function ____exports.getMaxPillEffects(self)
|
|
16
15
|
return itemConfig:GetPillEffects().Size - 1
|
|
17
16
|
end
|
|
18
17
|
function ____exports.getPillEffectClass(self, pillEffect)
|
|
19
|
-
local pillEffectClass = PILL_EFFECT_CLASS_MAP
|
|
18
|
+
local pillEffectClass = PILL_EFFECT_CLASS_MAP[pillEffect]
|
|
20
19
|
return pillEffectClass == nil and DEFAULT_PILL_EFFECT_CLASS or pillEffectClass
|
|
21
20
|
end
|
|
22
21
|
function ____exports.getPillEffectName(self, pillEffect)
|
|
23
|
-
local
|
|
24
|
-
if
|
|
25
|
-
return defaultName
|
|
26
|
-
end
|
|
27
|
-
local pillEffectName = PILL_EFFECT_NAME_MAP:get(pillEffect)
|
|
28
|
-
if pillEffectName ~= nil then
|
|
22
|
+
local pillEffectName = PILL_EFFECT_NAME_MAP[pillEffect]
|
|
23
|
+
if pillEffectName ~= nil and pillEffectName ~= DEFAULT_PILL_EFFECT_NAME then
|
|
29
24
|
return pillEffectName
|
|
30
25
|
end
|
|
31
26
|
local itemConfigPillEffect = itemConfig:GetPillEffect(pillEffect)
|
|
32
|
-
if itemConfigPillEffect
|
|
33
|
-
return
|
|
27
|
+
if itemConfigPillEffect ~= nil then
|
|
28
|
+
return itemConfigPillEffect.Name
|
|
34
29
|
end
|
|
35
|
-
return
|
|
30
|
+
return DEFAULT_PILL_EFFECT_NAME
|
|
36
31
|
end
|
|
37
32
|
function ____exports.getPillEffectType(self, pillEffect)
|
|
38
|
-
local pillEffectClass = PILL_EFFECT_TYPE_MAP
|
|
33
|
+
local pillEffectClass = PILL_EFFECT_TYPE_MAP[pillEffect]
|
|
39
34
|
return pillEffectClass == nil and DEFAULT_PILL_EFFECT_TYPE or pillEffectClass
|
|
40
35
|
end
|
|
41
36
|
return ____exports
|
|
@@ -72,6 +72,8 @@ export declare function getBlackHearts(player: EntityPlayer): int;
|
|
|
72
72
|
* Mother's Kiss; use the `getPlayerMaxHeartContainers` helper function for that.
|
|
73
73
|
*/
|
|
74
74
|
export declare function getCharacterMaxHeartContainers(character: PlayerType | int): int;
|
|
75
|
+
/** Helper function to get the name of a character. Returns "unknown" for modded characters. */
|
|
76
|
+
export declare function getCharacterName(character: PlayerType | int): string;
|
|
75
77
|
/** Helper function to get an array containing the characters of all of the current players. */
|
|
76
78
|
export declare function getCharacters(): PlayerType[];
|
|
77
79
|
export declare function getClosestPlayer(position: Vector): EntityPlayer;
|
|
@@ -11,7 +11,7 @@ local __TS__Iterator = ____lualib.__TS__Iterator
|
|
|
11
11
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
12
12
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
13
13
|
local ____exports = {}
|
|
14
|
-
local getPlayerIndexCollectibleType,
|
|
14
|
+
local getPlayerIndexCollectibleType, isTaintedModded, DEFAULT_COLLECTIBLE_TYPE, EXCLUDED_CHARACTERS
|
|
15
15
|
local ____cachedClasses = require("cachedClasses")
|
|
16
16
|
local game = ____cachedClasses.game
|
|
17
17
|
local itemConfig = ____cachedClasses.itemConfig
|
|
@@ -22,6 +22,9 @@ local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEART
|
|
|
22
22
|
local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
|
|
23
23
|
local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
|
|
24
24
|
local MAX_VANILLA_CHARACTER = ____constants.MAX_VANILLA_CHARACTER
|
|
25
|
+
local ____characterNameMap = require("maps.characterNameMap")
|
|
26
|
+
local CHARACTER_NAME_MAP = ____characterNameMap.CHARACTER_NAME_MAP
|
|
27
|
+
local DEFAULT_CHARACTER_NAME = ____characterNameMap.DEFAULT_CHARACTER_NAME
|
|
25
28
|
local ____HealthType = require("types.HealthType")
|
|
26
29
|
local HealthType = ____HealthType.HealthType
|
|
27
30
|
local ____array = require("functions.array")
|
|
@@ -35,9 +38,6 @@ local ____collectibles = require("functions.collectibles")
|
|
|
35
38
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
36
39
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
37
40
|
local getCollectibleSet = ____collectibleSet.getCollectibleSet
|
|
38
|
-
local ____string = require("functions.string")
|
|
39
|
-
local stringContains = ____string.stringContains
|
|
40
|
-
local trimPrefix = ____string.trimPrefix
|
|
41
41
|
local ____utils = require("functions.utils")
|
|
42
42
|
local ensureAllCases = ____utils.ensureAllCases
|
|
43
43
|
local ____repeat = ____utils["repeat"]
|
|
@@ -100,15 +100,15 @@ end
|
|
|
100
100
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
101
101
|
local character = player:GetPlayerType()
|
|
102
102
|
repeat
|
|
103
|
-
local
|
|
104
|
-
local
|
|
105
|
-
if
|
|
103
|
+
local ____switch71 = character
|
|
104
|
+
local ____cond71 = ____switch71 == PlayerType.PLAYER_THESOUL
|
|
105
|
+
if ____cond71 then
|
|
106
106
|
do
|
|
107
107
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
|
-
|
|
111
|
-
if
|
|
110
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_LAZARUS2_B
|
|
111
|
+
if ____cond71 then
|
|
112
112
|
do
|
|
113
113
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
114
114
|
end
|
|
@@ -136,53 +136,6 @@ function ____exports.getPlayerMaxHeartContainers(self, player)
|
|
|
136
136
|
end
|
|
137
137
|
return characterMaxHeartContainers
|
|
138
138
|
end
|
|
139
|
-
function getAdjustedPlayerName(self, player)
|
|
140
|
-
local character = player:GetPlayerType()
|
|
141
|
-
repeat
|
|
142
|
-
local ____switch82 = character
|
|
143
|
-
local ____cond82 = ____switch82 == PlayerType.PLAYER_BLUEBABY or ____switch82 == PlayerType.PLAYER_BLUEBABY_B
|
|
144
|
-
if ____cond82 then
|
|
145
|
-
do
|
|
146
|
-
return "Blue Baby"
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_LAZARUS2
|
|
150
|
-
if ____cond82 then
|
|
151
|
-
do
|
|
152
|
-
return "Lazarus II"
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_BLACKJUDAS
|
|
156
|
-
if ____cond82 then
|
|
157
|
-
do
|
|
158
|
-
return "Dark Judas"
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_JACOB
|
|
162
|
-
if ____cond82 then
|
|
163
|
-
do
|
|
164
|
-
return "Jacob & Esau"
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_LAZARUS2_B
|
|
168
|
-
if ____cond82 then
|
|
169
|
-
do
|
|
170
|
-
return "Dead Tainted Lazarus"
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_JACOB2_B
|
|
174
|
-
if ____cond82 then
|
|
175
|
-
do
|
|
176
|
-
return "Dead Tainted Jacob"
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
do
|
|
180
|
-
do
|
|
181
|
-
return player:GetName()
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
until true
|
|
185
|
-
end
|
|
186
139
|
function ____exports.getPlayers(self, performCharacterExclusions)
|
|
187
140
|
if performCharacterExclusions == nil then
|
|
188
141
|
performCharacterExclusions = false
|
|
@@ -223,16 +176,6 @@ function ____exports.isKeeper(self, player)
|
|
|
223
176
|
local character = player:GetPlayerType()
|
|
224
177
|
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
225
178
|
end
|
|
226
|
-
function ____exports.isTainted(self, player)
|
|
227
|
-
local character = player:GetPlayerType()
|
|
228
|
-
local ____isVanillaCharacter_result_1
|
|
229
|
-
if ____exports.isVanillaCharacter(nil, player) then
|
|
230
|
-
____isVanillaCharacter_result_1 = character >= PlayerType.PLAYER_ISAAC_B
|
|
231
|
-
else
|
|
232
|
-
____isVanillaCharacter_result_1 = isTaintedModded(nil, player)
|
|
233
|
-
end
|
|
234
|
-
return ____isVanillaCharacter_result_1
|
|
235
|
-
end
|
|
236
179
|
function isTaintedModded(self, player)
|
|
237
180
|
local character = player:GetPlayerType()
|
|
238
181
|
local name = player:GetName()
|
|
@@ -318,6 +261,13 @@ function ____exports.getBlackHearts(self, player)
|
|
|
318
261
|
local blackHeartBits = countSetBits(nil, blackHeartsBitmask)
|
|
319
262
|
return blackHeartBits * 2
|
|
320
263
|
end
|
|
264
|
+
function ____exports.getCharacterName(self, character)
|
|
265
|
+
if character >= PlayerType.NUM_PLAYER_TYPES then
|
|
266
|
+
return "unknown"
|
|
267
|
+
end
|
|
268
|
+
local characterName = CHARACTER_NAME_MAP[character]
|
|
269
|
+
return characterName == nil and DEFAULT_CHARACTER_NAME or characterName
|
|
270
|
+
end
|
|
321
271
|
function ____exports.getClosestPlayer(self, position)
|
|
322
272
|
local closestPlayer = nil
|
|
323
273
|
local closestDistance = math.huge
|
|
@@ -476,12 +426,8 @@ function ____exports.getPlayerIndexVanilla(self, playerToFind)
|
|
|
476
426
|
return nil
|
|
477
427
|
end
|
|
478
428
|
function ____exports.getPlayerName(self, player)
|
|
479
|
-
local
|
|
480
|
-
|
|
481
|
-
return adjustedName
|
|
482
|
-
end
|
|
483
|
-
local baseName = trimPrefix(nil, adjustedName, "The ")
|
|
484
|
-
return stringContains(nil, baseName, "Tainted") and baseName or "Tainted " .. baseName
|
|
429
|
+
local character = player:GetPlayerType()
|
|
430
|
+
return character >= PlayerType.NUM_PLAYER_TYPES and player:GetName() or ____exports.getCharacterName(nil, character)
|
|
485
431
|
end
|
|
486
432
|
function ____exports.getPlayerNumHitsRemaining(self, player)
|
|
487
433
|
local hearts = player:GetHearts()
|
|
@@ -578,6 +524,16 @@ function ____exports.canTakeFreeDevilDeals(self, player)
|
|
|
578
524
|
local character = player:GetPlayerType()
|
|
579
525
|
return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
|
|
580
526
|
end
|
|
527
|
+
function ____exports.isTainted(self, player)
|
|
528
|
+
local character = player:GetPlayerType()
|
|
529
|
+
local ____isVanillaCharacter_result_1
|
|
530
|
+
if ____exports.isVanillaCharacter(nil, player) then
|
|
531
|
+
____isVanillaCharacter_result_1 = character >= PlayerType.PLAYER_ISAAC_B
|
|
532
|
+
else
|
|
533
|
+
____isVanillaCharacter_result_1 = isTaintedModded(nil, player)
|
|
534
|
+
end
|
|
535
|
+
return ____isVanillaCharacter_result_1
|
|
536
|
+
end
|
|
581
537
|
function ____exports.isTaintedLazarus(self, player)
|
|
582
538
|
local character = player:GetPlayerType()
|
|
583
539
|
return character == PlayerType.PLAYER_LAZARUS_B or character == PlayerType.PLAYER_LAZARUS2_B
|
|
@@ -620,9 +576,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
620
576
|
itemPool:RemoveCollectible(collectibleType)
|
|
621
577
|
end
|
|
622
578
|
repeat
|
|
623
|
-
local
|
|
624
|
-
local
|
|
625
|
-
if
|
|
579
|
+
local ____switch125 = activeSlot
|
|
580
|
+
local ____cond125 = ____switch125 == ActiveSlot.SLOT_PRIMARY
|
|
581
|
+
if ____cond125 then
|
|
626
582
|
do
|
|
627
583
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
628
584
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -631,8 +587,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
631
587
|
break
|
|
632
588
|
end
|
|
633
589
|
end
|
|
634
|
-
|
|
635
|
-
if
|
|
590
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_SECONDARY
|
|
591
|
+
if ____cond125 then
|
|
636
592
|
do
|
|
637
593
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
638
594
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -647,16 +603,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
647
603
|
break
|
|
648
604
|
end
|
|
649
605
|
end
|
|
650
|
-
|
|
651
|
-
if
|
|
606
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_POCKET
|
|
607
|
+
if ____cond125 then
|
|
652
608
|
do
|
|
653
609
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
654
610
|
player:SetActiveCharge(charge, activeSlot)
|
|
655
611
|
break
|
|
656
612
|
end
|
|
657
613
|
end
|
|
658
|
-
|
|
659
|
-
if
|
|
614
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_POCKET2
|
|
615
|
+
if ____cond125 then
|
|
660
616
|
do
|
|
661
617
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
662
618
|
break
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -221,10 +221,8 @@ function ____exports.inLRoom(self)
|
|
|
221
221
|
return roomShape == RoomShape.ROOMSHAPE_LTL or roomShape == RoomShape.ROOMSHAPE_LTR or roomShape == RoomShape.ROOMSHAPE_LBL or roomShape == RoomShape.ROOMSHAPE_LBR
|
|
222
222
|
end
|
|
223
223
|
function ____exports.inGenesisRoom(self)
|
|
224
|
-
local
|
|
225
|
-
|
|
226
|
-
local roomSubType = ____exports.getRoomSubType(nil)
|
|
227
|
-
return roomType == RoomType.ROOM_ISAACS and roomSubType == 99
|
|
224
|
+
local roomGridIndex = ____exports.getRoomGridIndex(nil)
|
|
225
|
+
return roomGridIndex == GridRooms.ROOM_GENESIS_IDX
|
|
228
226
|
end
|
|
229
227
|
function ____exports.inMegaSatanRoom(self)
|
|
230
228
|
local roomGridIndex = ____exports.getRoomGridIndex(nil)
|
|
@@ -238,7 +236,8 @@ function ____exports.inMinibossRoomOf(self, minibossID)
|
|
|
238
236
|
return roomType == RoomType.ROOM_MINIBOSS and roomStageID == 0 and roomSubType == minibossID
|
|
239
237
|
end
|
|
240
238
|
function ____exports.inSecretShop(self)
|
|
241
|
-
|
|
239
|
+
local roomGridIndex = ____exports.getRoomGridIndex(nil)
|
|
240
|
+
return roomGridIndex == GridRooms.ROOM_SECRET_SHOP_IDX
|
|
242
241
|
end
|
|
243
242
|
function ____exports.inStartingRoom(self)
|
|
244
243
|
local level = game:GetLevel()
|
|
@@ -6,6 +6,7 @@ local Set = ____lualib.Set
|
|
|
6
6
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
7
7
|
local ____exports = {}
|
|
8
8
|
local ____transformationNameMap = require("maps.transformationNameMap")
|
|
9
|
+
local DEFAULT_TRANSFORMATION_NAME = ____transformationNameMap.DEFAULT_TRANSFORMATION_NAME
|
|
9
10
|
local TRANSFORMATION_NAME_MAP = ____transformationNameMap.TRANSFORMATION_NAME_MAP
|
|
10
11
|
local ____DefaultMap = require("types.DefaultMap")
|
|
11
12
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
@@ -90,9 +91,8 @@ function ____exports.getPlayerNumTransformationCollectibles(self, player, player
|
|
|
90
91
|
return numCollectibles
|
|
91
92
|
end
|
|
92
93
|
function ____exports.getTransformationName(self, playerForm)
|
|
93
|
-
local
|
|
94
|
-
|
|
95
|
-
return transformationName == nil and defaultName or transformationName
|
|
94
|
+
local transformationName = TRANSFORMATION_NAME_MAP[playerForm]
|
|
95
|
+
return transformationName == nil and DEFAULT_TRANSFORMATION_NAME or transformationName
|
|
96
96
|
end
|
|
97
97
|
function ____exports.getTransformationsForCollectibleType(self, collectibleType)
|
|
98
98
|
if COLLECTIBLE_TYPE_TO_TRANSFORMATION_MAP.size == 0 then
|
|
@@ -5,8 +5,10 @@ local itemConfig = ____cachedClasses.itemConfig
|
|
|
5
5
|
local ____constants = require("constants")
|
|
6
6
|
local TRINKET_GOLDEN_FLAG = ____constants.TRINKET_GOLDEN_FLAG
|
|
7
7
|
local ____trinketDescriptionMap = require("maps.trinketDescriptionMap")
|
|
8
|
+
local DEFAULT_TRINKET_DESCRIPTION = ____trinketDescriptionMap.DEFAULT_TRINKET_DESCRIPTION
|
|
8
9
|
local TRINKET_DESCRIPTION_MAP = ____trinketDescriptionMap.TRINKET_DESCRIPTION_MAP
|
|
9
10
|
local ____trinketNameMap = require("maps.trinketNameMap")
|
|
11
|
+
local DEFAULT_TRINKET_NAME = ____trinketNameMap.DEFAULT_TRINKET_NAME
|
|
10
12
|
local TRINKET_NAME_MAP = ____trinketNameMap.TRINKET_NAME_MAP
|
|
11
13
|
local ____flag = require("functions.flag")
|
|
12
14
|
local hasFlag = ____flag.hasFlag
|
|
@@ -44,34 +46,26 @@ function ____exports.getTrinkets(self, matchingSubType)
|
|
|
44
46
|
return getPickups(nil, PickupVariant.PICKUP_TRINKET, matchingSubType)
|
|
45
47
|
end
|
|
46
48
|
function ____exports.getTrinketDescription(self, trinketType)
|
|
47
|
-
local defaultDescription = "Unknown"
|
|
48
|
-
if type(trinketType) ~= "number" then
|
|
49
|
-
return defaultDescription
|
|
50
|
-
end
|
|
51
49
|
local trinketDescription = TRINKET_DESCRIPTION_MAP:get(trinketType)
|
|
52
50
|
if trinketDescription ~= nil then
|
|
53
51
|
return trinketDescription
|
|
54
52
|
end
|
|
55
53
|
local itemConfigItem = itemConfig:GetCollectible(trinketType)
|
|
56
|
-
if itemConfigItem
|
|
57
|
-
return
|
|
54
|
+
if itemConfigItem ~= nil then
|
|
55
|
+
return itemConfigItem.Description
|
|
58
56
|
end
|
|
59
|
-
return
|
|
57
|
+
return DEFAULT_TRINKET_DESCRIPTION
|
|
60
58
|
end
|
|
61
59
|
function ____exports.getTrinketName(self, trinketType)
|
|
62
|
-
local defaultName = "Unknown"
|
|
63
|
-
if type(trinketType) ~= "number" then
|
|
64
|
-
return defaultName
|
|
65
|
-
end
|
|
66
60
|
local trinketName = TRINKET_NAME_MAP:get(trinketType)
|
|
67
61
|
if trinketName ~= nil then
|
|
68
62
|
return trinketName
|
|
69
63
|
end
|
|
70
64
|
local itemConfigItem = itemConfig:GetCollectible(trinketType)
|
|
71
|
-
if itemConfigItem
|
|
72
|
-
return
|
|
65
|
+
if itemConfigItem ~= nil then
|
|
66
|
+
return itemConfigItem.Name
|
|
73
67
|
end
|
|
74
|
-
return
|
|
68
|
+
return DEFAULT_TRINKET_NAME
|
|
75
69
|
end
|
|
76
70
|
function ____exports.hasOpenTrinketSlot(self, player)
|
|
77
71
|
local character = player:GetPlayerType()
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export * from "./maps/pillEffectMap";
|
|
|
83
83
|
export * from "./maps/pillEffectNameMap";
|
|
84
84
|
export * from "./maps/pillEffectTypeMap";
|
|
85
85
|
export * from "./maps/roomShapeToTopLeftWallGridIndexMap";
|
|
86
|
+
export * from "./maps/roomTypeMap";
|
|
87
|
+
export * from "./maps/roomTypeNameMap";
|
|
86
88
|
export * from "./maps/transformationNameMap";
|
|
87
89
|
export * from "./maps/trinketDescriptionMap";
|
|
88
90
|
export * from "./maps/trinketNameMap";
|
package/dist/index.lua
CHANGED
|
@@ -671,6 +671,22 @@ do
|
|
|
671
671
|
end
|
|
672
672
|
end
|
|
673
673
|
end
|
|
674
|
+
do
|
|
675
|
+
local ____export = require("maps.roomTypeMap")
|
|
676
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
677
|
+
if ____exportKey ~= "default" then
|
|
678
|
+
____exports[____exportKey] = ____exportValue
|
|
679
|
+
end
|
|
680
|
+
end
|
|
681
|
+
end
|
|
682
|
+
do
|
|
683
|
+
local ____export = require("maps.roomTypeNameMap")
|
|
684
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
685
|
+
if ____exportKey ~= "default" then
|
|
686
|
+
____exports[____exportKey] = ____exportValue
|
|
687
|
+
end
|
|
688
|
+
end
|
|
689
|
+
end
|
|
674
690
|
do
|
|
675
691
|
local ____export = require("maps.transformationNameMap")
|
|
676
692
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const DEFAULT_CARD_DESCRIPTION = "Unknown";
|
|
3
|
+
export declare const CARD_DESCRIPTION_MAP: {
|
|
4
|
+
readonly [key in Card]: string;
|
|
5
|
+
};
|