isaacscript-common 8.9.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/constantsFirstLast.d.ts +4 -4
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +4 -4
- package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
- package/dist/features/firstLast.d.ts +9 -9
- package/dist/features/firstLast.d.ts.map +1 -1
- package/dist/features/firstLast.lua +26 -26
- package/dist/features/preventCollectibleRotation.lua +2 -2
- package/dist/functions/cards.d.ts +27 -36
- package/dist/functions/cards.d.ts.map +1 -1
- package/dist/functions/cards.lua +70 -79
- package/dist/functions/collectibles.d.ts +1 -6
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +1 -6
- package/dist/functions/pickupsSpecific.d.ts +9 -9
- package/dist/functions/pickupsSpecific.d.ts.map +1 -1
- package/dist/functions/pickupsSpecific.lua +16 -16
- package/dist/functions/pills.d.ts +1 -6
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +1 -6
- package/dist/functions/pocketItems.lua +4 -4
- package/dist/functions/rockAlt.lua +2 -2
- package/dist/functions/trinkets.d.ts +1 -6
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.lua +1 -6
- package/dist/functions/types.d.ts +3 -3
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.lua +2 -2
- package/dist/index.d.ts +53 -77
- package/dist/maps/cardMap.d.ts +2 -2
- package/dist/maps/cardMap.d.ts.map +1 -1
- package/dist/maps/cardMap.lua +203 -203
- package/dist/objects/cardDescriptions.d.ts +2 -2
- package/dist/objects/cardDescriptions.d.ts.map +1 -1
- package/dist/objects/cardDescriptions.lua +99 -99
- package/dist/objects/cardNames.d.ts +2 -2
- package/dist/objects/cardNames.d.ts.map +1 -1
- package/dist/objects/cardNames.lua +99 -99
- package/dist/objects/cardTypeToItemConfigCardType.d.ts +6 -0
- package/dist/objects/cardTypeToItemConfigCardType.d.ts.map +1 -0
- package/dist/objects/cardTypeToItemConfigCardType.lua +106 -0
- package/package.json +2 -2
- package/src/core/constantsFirstLast.ts +4 -4
- package/src/features/extraConsoleCommands/listCommands.ts +16 -16
- package/src/features/firstLast.ts +26 -26
- package/src/features/preventCollectibleRotation.ts +2 -2
- package/src/functions/cards.ts +102 -88
- package/src/functions/collectibles.ts +1 -6
- package/src/functions/pickupsSpecific.ts +16 -13
- package/src/functions/pills.ts +1 -6
- package/src/functions/pocketItems.ts +4 -4
- package/src/functions/rockAlt.ts +2 -2
- package/src/functions/trinkets.ts +1 -6
- package/src/functions/types.ts +3 -3
- package/src/maps/cardMap.ts +204 -204
- package/src/objects/cardDescriptions.ts +100 -100
- package/src/objects/cardNames.ts +100 -100
- package/src/objects/cardTypeToItemConfigCardType.ts +106 -0
- package/dist/objects/cardTypes.d.ts +0 -6
- package/dist/objects/cardTypes.d.ts.map +0 -1
- package/dist/objects/cardTypes.lua +0 -106
- package/src/objects/cardTypes.ts +0 -104
package/dist/functions/cards.lua
CHANGED
|
@@ -4,24 +4,24 @@ local __TS__New = ____lualib.__TS__New
|
|
|
4
4
|
local Set = ____lualib.Set
|
|
5
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local lazyInitCardMapsSets,
|
|
7
|
+
local lazyInitCardMapsSets, ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP, CARD_SET
|
|
8
8
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
|
-
local
|
|
9
|
+
local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
|
|
10
10
|
local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardType
|
|
11
11
|
local ____cachedClasses = require("core.cachedClasses")
|
|
12
12
|
local itemConfig = ____cachedClasses.itemConfig
|
|
13
13
|
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
14
|
-
local
|
|
15
|
-
local
|
|
14
|
+
local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
|
|
15
|
+
local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
|
|
16
16
|
local ____cardDescriptions = require("objects.cardDescriptions")
|
|
17
17
|
local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
|
|
18
18
|
local DEFAULT_CARD_DESCRIPTION = ____cardDescriptions.DEFAULT_CARD_DESCRIPTION
|
|
19
19
|
local ____cardNames = require("objects.cardNames")
|
|
20
20
|
local CARD_NAMES = ____cardNames.CARD_NAMES
|
|
21
21
|
local DEFAULT_CARD_NAME = ____cardNames.DEFAULT_CARD_NAME
|
|
22
|
-
local
|
|
23
|
-
local
|
|
24
|
-
local DEFAULT_CARD_TYPE =
|
|
22
|
+
local ____cardTypeToItemConfigCardType = require("objects.cardTypeToItemConfigCardType")
|
|
23
|
+
local CARD_TYPE_TO_ITEM_CONFIG_CARD_TYPE = ____cardTypeToItemConfigCardType.CARD_TYPE_TO_ITEM_CONFIG_CARD_TYPE
|
|
24
|
+
local DEFAULT_CARD_TYPE = ____cardTypeToItemConfigCardType.DEFAULT_CARD_TYPE
|
|
25
25
|
local ____enums = require("functions.enums")
|
|
26
26
|
local getEnumValues = ____enums.getEnumValues
|
|
27
27
|
local ____rng = require("functions.rng")
|
|
@@ -33,20 +33,20 @@ local ____utils = require("functions.utils")
|
|
|
33
33
|
local irange = ____utils.irange
|
|
34
34
|
function lazyInitCardMapsSets(self)
|
|
35
35
|
for ____, cardType in ipairs(getEnumValues(nil, ItemConfigCardType)) do
|
|
36
|
-
|
|
36
|
+
ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP:set(
|
|
37
37
|
cardType,
|
|
38
38
|
__TS__New(Set)
|
|
39
39
|
)
|
|
40
40
|
end
|
|
41
|
-
for ____, card in ipairs(____exports.
|
|
42
|
-
local
|
|
43
|
-
local cardTypeSet =
|
|
41
|
+
for ____, card in ipairs(____exports.getVanillaCardTypes(nil)) do
|
|
42
|
+
local itemConfigCardType = ____exports.getItemConfigCardType(nil, card)
|
|
43
|
+
local cardTypeSet = ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP:get(itemConfigCardType)
|
|
44
44
|
if cardTypeSet == nil then
|
|
45
|
-
error("Failed to get the card set for card type: " .. tostring(
|
|
45
|
+
error("Failed to get the card set for item config card type: " .. tostring(itemConfigCardType))
|
|
46
46
|
end
|
|
47
47
|
cardTypeSet:add(card)
|
|
48
48
|
end
|
|
49
|
-
local cards = ____exports.
|
|
49
|
+
local cards = ____exports.getCardTypesOfType(
|
|
50
50
|
nil,
|
|
51
51
|
ItemConfigCardType.TAROT,
|
|
52
52
|
ItemConfigCardType.SUIT,
|
|
@@ -55,55 +55,50 @@ function lazyInitCardMapsSets(self)
|
|
|
55
55
|
)
|
|
56
56
|
addSetsToSet(nil, CARD_SET, cards)
|
|
57
57
|
end
|
|
58
|
-
function
|
|
59
|
-
local cardType = CARD_TYPES[card]
|
|
60
|
-
return cardType == nil and DEFAULT_CARD_TYPE or cardType
|
|
61
|
-
end
|
|
62
|
-
--- Helper function to get a set of cards matching the type. Also see the `CardType` enum.
|
|
58
|
+
--- Helper function to get a set of card types matching the `ItemConfigCardType`.
|
|
63
59
|
--
|
|
64
60
|
-- This function is variadic, meaning that you can you can specify N card types to get a set
|
|
65
61
|
-- containing cards that match any of the specified types.
|
|
66
|
-
function ____exports.
|
|
67
|
-
local
|
|
68
|
-
if
|
|
62
|
+
function ____exports.getCardTypesOfType(self, ...)
|
|
63
|
+
local itemConfigCardTypes = {...}
|
|
64
|
+
if ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP.size == 0 then
|
|
69
65
|
lazyInitCardMapsSets(nil)
|
|
70
66
|
end
|
|
71
|
-
local
|
|
72
|
-
for ____,
|
|
73
|
-
local
|
|
74
|
-
if
|
|
75
|
-
error("Failed to get the
|
|
67
|
+
local matchingCardTypes = __TS__New(Set)
|
|
68
|
+
for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
|
|
69
|
+
local cardTypeSet = ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP:get(itemConfigCardType)
|
|
70
|
+
if cardTypeSet == nil then
|
|
71
|
+
error("Failed to get the card type set for item config type: " .. tostring(itemConfigCardType))
|
|
76
72
|
end
|
|
77
|
-
for ____,
|
|
78
|
-
|
|
73
|
+
for ____, cardType in __TS__Iterator(cardTypeSet:values()) do
|
|
74
|
+
matchingCardTypes:add(cardType)
|
|
79
75
|
end
|
|
80
76
|
end
|
|
81
|
-
return
|
|
77
|
+
return matchingCardTypes
|
|
78
|
+
end
|
|
79
|
+
function ____exports.getItemConfigCardType(self, cardType)
|
|
80
|
+
local itemConfigCardType = CARD_TYPE_TO_ITEM_CONFIG_CARD_TYPE[cardType]
|
|
81
|
+
return itemConfigCardType == nil and DEFAULT_CARD_TYPE or itemConfigCardType
|
|
82
82
|
end
|
|
83
83
|
--- Helper function to get an array with every valid vanilla card sub-type.
|
|
84
|
-
function ____exports.
|
|
85
|
-
return irange(nil,
|
|
84
|
+
function ____exports.getVanillaCardTypes(self)
|
|
85
|
+
return irange(nil, FIRST_CARD_TYPE, LAST_VANILLA_CARD_TYPE)
|
|
86
86
|
end
|
|
87
87
|
--- Returns true for any vanilla card or rune.
|
|
88
|
-
function ____exports.
|
|
89
|
-
return
|
|
88
|
+
function ____exports.isVanillaCardType(self, cardType)
|
|
89
|
+
return cardType <= LAST_VANILLA_CARD_TYPE
|
|
90
90
|
end
|
|
91
|
-
|
|
91
|
+
ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP = __TS__New(Map)
|
|
92
92
|
CARD_SET = __TS__New(Set)
|
|
93
93
|
--- Helper function to get a card description from a Card enum value.
|
|
94
94
|
--
|
|
95
|
-
-- For example
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-- const card = Card.FOOL;
|
|
99
|
-
-- const cardDescription = getCardDescription(card); // cardDescription is "Where journey begins"
|
|
100
|
-
-- ```
|
|
101
|
-
function ____exports.getCardDescription(self, card)
|
|
102
|
-
local cardDescription = CARD_DESCRIPTIONS[card]
|
|
95
|
+
-- For example, `getCardDescription(card)` returns "Where journey begins".
|
|
96
|
+
function ____exports.getCardDescription(self, cardType)
|
|
97
|
+
local cardDescription = CARD_DESCRIPTIONS[cardType]
|
|
103
98
|
if cardDescription ~= nil then
|
|
104
99
|
return cardDescription
|
|
105
100
|
end
|
|
106
|
-
local itemConfigCard = itemConfig:GetCard(
|
|
101
|
+
local itemConfigCard = itemConfig:GetCard(cardType)
|
|
107
102
|
if itemConfigCard ~= nil then
|
|
108
103
|
return itemConfigCard.Description
|
|
109
104
|
end
|
|
@@ -111,18 +106,13 @@ function ____exports.getCardDescription(self, card)
|
|
|
111
106
|
end
|
|
112
107
|
--- Helper function to get a card name from a Card.
|
|
113
108
|
--
|
|
114
|
-
-- For example
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-- const card = Card.FOOL;
|
|
118
|
-
-- const cardName = getCardName(card); // cardName is "0 - The Fool"
|
|
119
|
-
-- ```
|
|
120
|
-
function ____exports.getCardName(self, card)
|
|
121
|
-
local cardName = CARD_NAMES[card]
|
|
109
|
+
-- For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
|
|
110
|
+
function ____exports.getCardName(self, cardType)
|
|
111
|
+
local cardName = CARD_NAMES[cardType]
|
|
122
112
|
if cardName ~= nil then
|
|
123
113
|
return cardName
|
|
124
114
|
end
|
|
125
|
-
local itemConfigCard = itemConfig:GetCard(
|
|
115
|
+
local itemConfigCard = itemConfig:GetCard(cardType)
|
|
126
116
|
if itemConfigCard ~= nil then
|
|
127
117
|
return itemConfigCard.Name
|
|
128
118
|
end
|
|
@@ -149,19 +139,20 @@ function ____exports.getRandomCard(self, seedOrRNG, exceptions)
|
|
|
149
139
|
return getRandomSetElement(nil, CARD_SET, seedOrRNG, exceptions)
|
|
150
140
|
end
|
|
151
141
|
---
|
|
152
|
-
-- @param
|
|
142
|
+
-- @param itemConfigCardType The item config card type that represents the pool of cards to select
|
|
143
|
+
-- from.
|
|
153
144
|
-- @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
154
145
|
-- `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
155
146
|
-- @param exceptions Optional. An array of cards to not select.
|
|
156
|
-
function ____exports.
|
|
147
|
+
function ____exports.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
|
|
157
148
|
if seedOrRNG == nil then
|
|
158
149
|
seedOrRNG = getRandomSeed(nil)
|
|
159
150
|
end
|
|
160
151
|
if exceptions == nil then
|
|
161
152
|
exceptions = {}
|
|
162
153
|
end
|
|
163
|
-
local
|
|
164
|
-
return getRandomSetElement(nil,
|
|
154
|
+
local cardTypeSet = ____exports.getCardTypesOfType(nil, itemConfigCardType)
|
|
155
|
+
return getRandomSetElement(nil, cardTypeSet, seedOrRNG, exceptions)
|
|
165
156
|
end
|
|
166
157
|
--- Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul of
|
|
167
158
|
-- Isaac, etc.). This will never return a Rune Shard.
|
|
@@ -176,8 +167,8 @@ function ____exports.getRandomRune(self, seedOrRNG, exceptions)
|
|
|
176
167
|
if exceptions == nil then
|
|
177
168
|
exceptions = {}
|
|
178
169
|
end
|
|
179
|
-
local runesSet = ____exports.
|
|
180
|
-
runesSet:delete(
|
|
170
|
+
local runesSet = ____exports.getCardTypesOfType(nil, ItemConfigCardType.RUNE)
|
|
171
|
+
runesSet:delete(CardType.RUNE_SHARD)
|
|
181
172
|
return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
|
|
182
173
|
end
|
|
183
174
|
--- Returns true for cards that have the following card type:
|
|
@@ -185,39 +176,39 @@ end
|
|
|
185
176
|
-- - CardType.SUIT
|
|
186
177
|
-- - CardType.SPECIAL
|
|
187
178
|
-- - CardType.TAROT_REVERSE
|
|
188
|
-
function ____exports.isCard(self,
|
|
189
|
-
return CARD_SET:has(
|
|
179
|
+
function ____exports.isCard(self, cardType)
|
|
180
|
+
return CARD_SET:has(cardType)
|
|
190
181
|
end
|
|
191
|
-
--- Returns whether or not the given card matches the specified card type.
|
|
192
|
-
function ____exports.isCardType(self,
|
|
193
|
-
return
|
|
182
|
+
--- Returns whether or not the given card type matches the specified item config card type.
|
|
183
|
+
function ____exports.isCardType(self, cardType, itemConfigCardType)
|
|
184
|
+
return itemConfigCardType == ____exports.getItemConfigCardType(nil, cardType)
|
|
194
185
|
end
|
|
195
186
|
--- Returns true for any card or rune added by a mod.
|
|
196
|
-
function ____exports.
|
|
197
|
-
return not ____exports.
|
|
187
|
+
function ____exports.isModdedCardType(self, cardType)
|
|
188
|
+
return not ____exports.isVanillaCardType(nil, cardType)
|
|
198
189
|
end
|
|
199
|
-
--- Returns true for cards that have `
|
|
200
|
-
function ____exports.isPocketItemObject(self,
|
|
201
|
-
return ____exports.isCardType(nil,
|
|
190
|
+
--- Returns true for cards that have `ItemConfigCardType.SPECIAL_OBJECT`.
|
|
191
|
+
function ____exports.isPocketItemObject(self, cardType)
|
|
192
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.SPECIAL_OBJECT)
|
|
202
193
|
end
|
|
203
|
-
--- Returns true for cards that have `
|
|
204
|
-
function ____exports.isReverseTarotCard(self,
|
|
205
|
-
return ____exports.isCardType(nil,
|
|
194
|
+
--- Returns true for cards that have `ItemConfigCardType.TAROT_REVERSE`.
|
|
195
|
+
function ____exports.isReverseTarotCard(self, cardType)
|
|
196
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.TAROT_REVERSE)
|
|
206
197
|
end
|
|
207
198
|
--- Returns true for cards that have `CardType.RUNE`.
|
|
208
|
-
function ____exports.isRune(self,
|
|
209
|
-
return ____exports.isCardType(nil,
|
|
199
|
+
function ____exports.isRune(self, cardType)
|
|
200
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.RUNE)
|
|
210
201
|
end
|
|
211
202
|
--- Returns true for cards that have `CardType.SPECIAL`.
|
|
212
|
-
function ____exports.isSpecialCard(self,
|
|
213
|
-
return ____exports.isCardType(nil,
|
|
203
|
+
function ____exports.isSpecialCard(self, cardType)
|
|
204
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.SPECIAL)
|
|
214
205
|
end
|
|
215
206
|
--- Returns true for cards that have `CardType.SUIT`.
|
|
216
|
-
function ____exports.isSuitCard(self,
|
|
217
|
-
return ____exports.isCardType(nil,
|
|
207
|
+
function ____exports.isSuitCard(self, cardType)
|
|
208
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.SUIT)
|
|
218
209
|
end
|
|
219
210
|
--- Returns true for cards that have `CardType.TAROT`.
|
|
220
|
-
function ____exports.isTarotCard(self,
|
|
221
|
-
return ____exports.isCardType(nil,
|
|
211
|
+
function ____exports.isTarotCard(self, cardType)
|
|
212
|
+
return ____exports.isCardType(nil, cardType, ItemConfigCardType.TAROT)
|
|
222
213
|
end
|
|
223
214
|
return ____exports
|
|
@@ -97,12 +97,7 @@ export declare function getCollectibleMaxCharges(collectibleType: CollectibleTyp
|
|
|
97
97
|
* Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
|
|
98
98
|
* type is not valid.
|
|
99
99
|
*
|
|
100
|
-
* For example
|
|
101
|
-
*
|
|
102
|
-
* ```ts
|
|
103
|
-
* const collectibleType = CollectibleType.SAD_ONION;
|
|
104
|
-
* const collectibleName = getCollectibleName(collectibleType); // collectibleName is "Sad Onion"
|
|
105
|
-
* ```
|
|
100
|
+
* For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
|
|
106
101
|
*/
|
|
107
102
|
export declare function getCollectibleName(collectibleType: CollectibleType): string;
|
|
108
103
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA0B7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,YAAY,GACxB,gBAAgB,CAsBlB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAOL;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAOV;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAOL;AAED
|
|
1
|
+
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ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ED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
|
|
@@ -283,12 +283,7 @@ end
|
|
|
283
283
|
--- Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
|
|
284
284
|
-- type is not valid.
|
|
285
285
|
--
|
|
286
|
-
-- For example
|
|
287
|
-
--
|
|
288
|
-
-- ```ts
|
|
289
|
-
-- const collectibleType = CollectibleType.SAD_ONION;
|
|
290
|
-
-- const collectibleName = getCollectibleName(collectibleType); // collectibleName is "Sad Onion"
|
|
291
|
-
-- ```
|
|
286
|
+
-- For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
|
|
292
287
|
function ____exports.getCollectibleName(self, collectibleType)
|
|
293
288
|
local collectibleName = COLLECTIBLE_NAME_MAP:get(collectibleType)
|
|
294
289
|
if collectibleName ~= nil then
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatterySubType, BombSubType,
|
|
1
|
+
import { BatterySubType, BombSubType, CardType, CoinSubType, CollectibleType, HeartSubType, KeySubType, PillColor, SackSubType, TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get all of the battery entities in the room.
|
|
4
4
|
*
|
|
@@ -17,10 +17,10 @@ export declare function getBombPickups(bombSubType?: BombSubType): EntityPickupB
|
|
|
17
17
|
/**
|
|
18
18
|
* Helper function to get all of the card entities in the room.
|
|
19
19
|
*
|
|
20
|
-
* @param
|
|
21
|
-
*
|
|
20
|
+
* @param cardType Optional. If specified, will only get the cards that match the sub-type. Default
|
|
21
|
+
* is -1, which matches every sub-type.
|
|
22
22
|
*/
|
|
23
|
-
export declare function getCards(
|
|
23
|
+
export declare function getCards(cardType?: CardType): EntityPickupCard[];
|
|
24
24
|
/**
|
|
25
25
|
* Helper function to get all of the coin pickup entities in the room.
|
|
26
26
|
*
|
|
@@ -92,12 +92,12 @@ export declare function removeAllBombPickups(bombSubType?: BombSubType, cap?: in
|
|
|
92
92
|
/**
|
|
93
93
|
* Helper function to remove all of the cards in the room.
|
|
94
94
|
*
|
|
95
|
-
* @param
|
|
96
|
-
*
|
|
95
|
+
* @param cardType Optional. If specified, will only remove cards that match this sub-type. Default
|
|
96
|
+
* is -1, which matches every sub-type.
|
|
97
97
|
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
98
98
|
* @returns The cards that were removed.
|
|
99
99
|
*/
|
|
100
|
-
export declare function removeAllCards(
|
|
100
|
+
export declare function removeAllCards(cardType?: CardType, cap?: int): EntityPickupCard[];
|
|
101
101
|
/**
|
|
102
102
|
* Helper function to remove all of the coins in the room.
|
|
103
103
|
*
|
|
@@ -180,12 +180,12 @@ export declare function spawnBombPickupWithSeed(bombSubType: BombSubType, positi
|
|
|
180
180
|
/**
|
|
181
181
|
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
|
|
182
182
|
*/
|
|
183
|
-
export declare function spawnCard(
|
|
183
|
+
export declare function spawnCard(cardType: CardType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupCard;
|
|
184
184
|
/**
|
|
185
185
|
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300)
|
|
186
186
|
* and a specific seed.
|
|
187
187
|
*/
|
|
188
|
-
export declare function spawnCardWithSeed(
|
|
188
|
+
export declare function spawnCardWithSeed(cardType: CardType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCard;
|
|
189
189
|
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
|
|
190
190
|
export declare function spawnCoin(coinSubType: CoinSubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupCoin;
|
|
191
191
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickupsSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/pickupsSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"pickupsSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/pickupsSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,EACf,YAAY,EACZ,UAAU,EAEV,SAAS,EACT,WAAW,EACX,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAItC;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,cAAc,GAAE,cAAmB,GAClC,mBAAmB,EAAE,CAKvB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,WAAW,GAAE,WAAgB,GAC5B,gBAAgB,EAAE,CAEpB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,GAAE,QAAa,GAAG,gBAAgB,EAAE,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,WAAW,GAAE,WAAgB,GAAG,gBAAgB,EAAE,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,eAAe,GAAE,eAAoB,GACpC,uBAAuB,EAAE,CAK3B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,YAAY,GAAE,YAAiB,GAC9B,iBAAiB,EAAE,CAErB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,UAAU,GAAE,UAAe,GAAG,eAAe,EAAE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ACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,mBAAmB,CASrB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,mBAAmB,CAErB"}
|
|
@@ -30,13 +30,13 @@ function ____exports.getBombPickups(self, bombSubType)
|
|
|
30
30
|
end
|
|
31
31
|
--- Helper function to get all of the card entities in the room.
|
|
32
32
|
--
|
|
33
|
-
-- @param
|
|
34
|
-
-- -1, which matches every sub-type.
|
|
35
|
-
function ____exports.getCards(self,
|
|
36
|
-
if
|
|
37
|
-
|
|
33
|
+
-- @param cardType Optional. If specified, will only get the cards that match the sub-type. Default
|
|
34
|
+
-- is -1, which matches every sub-type.
|
|
35
|
+
function ____exports.getCards(self, cardType)
|
|
36
|
+
if cardType == nil then
|
|
37
|
+
cardType = -1
|
|
38
38
|
end
|
|
39
|
-
return getPickups(nil, PickupVariant.TAROT_CARD,
|
|
39
|
+
return getPickups(nil, PickupVariant.TAROT_CARD, cardType)
|
|
40
40
|
end
|
|
41
41
|
--- Helper function to get all of the coin pickup entities in the room.
|
|
42
42
|
--
|
|
@@ -135,15 +135,15 @@ function ____exports.removeAllBombPickups(self, bombSubType, cap)
|
|
|
135
135
|
end
|
|
136
136
|
--- Helper function to remove all of the cards in the room.
|
|
137
137
|
--
|
|
138
|
-
-- @param
|
|
139
|
-
-- -1, which matches every sub-type.
|
|
138
|
+
-- @param cardType Optional. If specified, will only remove cards that match this sub-type. Default
|
|
139
|
+
-- is -1, which matches every sub-type.
|
|
140
140
|
-- @param cap Optional. If specified, will only remove the given amount of cards.
|
|
141
141
|
-- @returns The cards that were removed.
|
|
142
|
-
function ____exports.removeAllCards(self,
|
|
143
|
-
if
|
|
144
|
-
|
|
142
|
+
function ____exports.removeAllCards(self, cardType, cap)
|
|
143
|
+
if cardType == nil then
|
|
144
|
+
cardType = -1
|
|
145
145
|
end
|
|
146
|
-
return removeAllPickups(nil, PickupVariant.TAROT_CARD,
|
|
146
|
+
return removeAllPickups(nil, PickupVariant.TAROT_CARD, cardType, cap)
|
|
147
147
|
end
|
|
148
148
|
--- Helper function to remove all of the coins in the room.
|
|
149
149
|
--
|
|
@@ -287,7 +287,7 @@ function ____exports.spawnBombPickupWithSeed(self, bombSubType, position, seedOr
|
|
|
287
287
|
)
|
|
288
288
|
end
|
|
289
289
|
--- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
|
|
290
|
-
function ____exports.spawnCard(self,
|
|
290
|
+
function ____exports.spawnCard(self, cardType, position, velocity, spawner, seedOrRNG)
|
|
291
291
|
if velocity == nil then
|
|
292
292
|
velocity = VectorZero
|
|
293
293
|
end
|
|
@@ -300,7 +300,7 @@ function ____exports.spawnCard(self, card, position, velocity, spawner, seedOrRN
|
|
|
300
300
|
return spawnPickup(
|
|
301
301
|
nil,
|
|
302
302
|
PickupVariant.TAROT_CARD,
|
|
303
|
-
|
|
303
|
+
cardType,
|
|
304
304
|
position,
|
|
305
305
|
velocity,
|
|
306
306
|
spawner,
|
|
@@ -309,7 +309,7 @@ function ____exports.spawnCard(self, card, position, velocity, spawner, seedOrRN
|
|
|
309
309
|
end
|
|
310
310
|
--- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300)
|
|
311
311
|
-- and a specific seed.
|
|
312
|
-
function ____exports.spawnCardWithSeed(self,
|
|
312
|
+
function ____exports.spawnCardWithSeed(self, cardType, position, seedOrRNG, velocity, spawner)
|
|
313
313
|
if velocity == nil then
|
|
314
314
|
velocity = VectorZero
|
|
315
315
|
end
|
|
@@ -318,7 +318,7 @@ function ____exports.spawnCardWithSeed(self, card, position, seedOrRNG, velocity
|
|
|
318
318
|
end
|
|
319
319
|
return ____exports.spawnCard(
|
|
320
320
|
nil,
|
|
321
|
-
|
|
321
|
+
cardType,
|
|
322
322
|
position,
|
|
323
323
|
velocity,
|
|
324
324
|
spawner,
|
|
@@ -46,12 +46,7 @@ export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPi
|
|
|
46
46
|
/**
|
|
47
47
|
* Helper function to get a pill effect name from a PillEffect enum value.
|
|
48
48
|
*
|
|
49
|
-
* For example
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* const pillEffect = PillEffect.BAD_GAS;
|
|
53
|
-
* const pillEffectName = getPillEffectName(pillEffect); // trinketName is "Bad Gas"
|
|
54
|
-
* ```
|
|
49
|
+
* For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
|
|
55
50
|
*/
|
|
56
51
|
export declare function getPillEffectName(pillEffect: PillEffect): string;
|
|
57
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,SAAS,EACT,UAAU,EACX,MAAM,8BAA8B,CAAC;AAqCtC;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAI9C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAEjE;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,IAAI,SAAS,EAAE,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAM3E;AAED,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AW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAElE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEnE"}
|
package/dist/functions/pills.lua
CHANGED
|
@@ -100,12 +100,7 @@ function ____exports.getPillEffectClass(self, pillEffect)
|
|
|
100
100
|
end
|
|
101
101
|
--- Helper function to get a pill effect name from a PillEffect enum value.
|
|
102
102
|
--
|
|
103
|
-
-- For example
|
|
104
|
-
--
|
|
105
|
-
-- ```ts
|
|
106
|
-
-- const pillEffect = PillEffect.BAD_GAS;
|
|
107
|
-
-- const pillEffectName = getPillEffectName(pillEffect); // trinketName is "Bad Gas"
|
|
108
|
-
-- ```
|
|
103
|
+
-- For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
|
|
109
104
|
function ____exports.getPillEffectName(self, pillEffect)
|
|
110
105
|
local pillEffectName = PILL_EFFECT_NAMES[pillEffect]
|
|
111
106
|
if pillEffectName ~= nil then
|
|
@@ -4,7 +4,7 @@ local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
|
4
4
|
local ____exports = {}
|
|
5
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
6
|
local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
7
|
-
local
|
|
7
|
+
local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
|
|
8
8
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
9
|
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
10
10
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
@@ -36,10 +36,10 @@ function ____exports.getPocketItems(self, player)
|
|
|
36
36
|
local pocketItemIdentified = false
|
|
37
37
|
local pocketItem2Identified = false
|
|
38
38
|
for ____, slot in ipairs(pocketItemSlots) do
|
|
39
|
-
local
|
|
39
|
+
local cardType = player:GetCard(slot)
|
|
40
40
|
local pillColor = player:GetPill(slot)
|
|
41
|
-
if
|
|
42
|
-
pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.CARD, subType =
|
|
41
|
+
if cardType ~= CardType.NULL then
|
|
42
|
+
pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.CARD, subType = cardType}
|
|
43
43
|
elseif pillColor ~= PillColor.NULL then
|
|
44
44
|
pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.PILL, subType = pillColor}
|
|
45
45
|
elseif hasPocketItem and not hasPocketItem2 and not pocketItemIdentified then
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, FIND_FREE_INITIAL_STEP, FART_RADIUS, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
|
-
local
|
|
4
|
+
local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
|
|
5
5
|
local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
|
|
6
6
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
7
7
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
@@ -167,7 +167,7 @@ function spawnRockAltRewardSkull(self, position, rng)
|
|
|
167
167
|
end
|
|
168
168
|
totalChance = totalChance + ROCK_ALT_CHANCES.BASIC_DROP
|
|
169
169
|
if chance < totalChance then
|
|
170
|
-
spawnCardWithSeed(nil,
|
|
170
|
+
spawnCardWithSeed(nil, CardType.NULL, position, rng)
|
|
171
171
|
return true
|
|
172
172
|
end
|
|
173
173
|
totalChance = totalChance + ROCK_ALT_CHANCES.TRINKET
|
|
@@ -39,12 +39,7 @@ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
|
|
|
39
39
|
* Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
|
|
40
40
|
* not valid.
|
|
41
41
|
*
|
|
42
|
-
* For example
|
|
43
|
-
*
|
|
44
|
-
* ```ts
|
|
45
|
-
* const trinketType = TrinketType.SWALLOWED_PENNY;
|
|
46
|
-
* const trinketName = getTrinketName(trinketType); // trinketName is "Swallowed Penny"
|
|
47
|
-
* ```
|
|
42
|
+
* For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
|
|
48
43
|
*/
|
|
49
44
|
export declare function getTrinketName(trinketType: TrinketType): string;
|
|
50
45
|
/** Helper function to get an array that represents every vanilla trinket type. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED
|
|
1
|
+
{"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CASjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN"}
|
|
@@ -102,12 +102,7 @@ end
|
|
|
102
102
|
--- Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
|
|
103
103
|
-- not valid.
|
|
104
104
|
--
|
|
105
|
-
-- For example
|
|
106
|
-
--
|
|
107
|
-
-- ```ts
|
|
108
|
-
-- const trinketType = TrinketType.SWALLOWED_PENNY;
|
|
109
|
-
-- const trinketName = getTrinketName(trinketType); // trinketName is "Swallowed Penny"
|
|
110
|
-
-- ```
|
|
105
|
+
-- For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
|
|
111
106
|
function ____exports.getTrinketName(self, trinketType)
|
|
112
107
|
local trinketName = TRINKET_NAME_MAP:get(trinketType)
|
|
113
108
|
if trinketName ~= nil then
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
2
|
/// <reference types="lua-types/5.3" />
|
|
3
|
-
import {
|
|
3
|
+
import { CardType, CollectibleType, LevelStage, NpcState, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
4
4
|
/**
|
|
5
|
-
* Helper function to safely cast a `number` to a `
|
|
5
|
+
* Helper function to safely cast a `number` to a `CardType`. (This is better than using the `as`
|
|
6
6
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
7
7
|
*
|
|
8
8
|
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
9
9
|
*/
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function asCardType(num: number): CardType;
|
|
11
11
|
/**
|
|
12
12
|
* Helper function to safely cast a `number` to a `CollectibleType`. (This is better than using the
|
|
13
13
|
* `as` TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,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AAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAErE"}
|
package/dist/functions/types.lua
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
--- Helper function to safely cast a `number` to a `
|
|
2
|
+
--- Helper function to safely cast a `number` to a `CardType`. (This is better than using the `as`
|
|
3
3
|
-- TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
4
4
|
--
|
|
5
5
|
-- This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
6
|
-
function ____exports.
|
|
6
|
+
function ____exports.asCardType(self, num)
|
|
7
7
|
return num
|
|
8
8
|
end
|
|
9
9
|
--- Helper function to safely cast a `number` to a `CollectibleType`. (This is better than using the
|