isaacscript-common 8.8.2 → 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/customStage/exports.d.ts +11 -1
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +10 -4
- package/dist/features/customStage/versusScreen.d.ts.map +1 -1
- package/dist/features/customStage/versusScreen.lua +3 -3
- 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/gridEntities.d.ts +1 -13
- package/dist/functions/gridEntities.d.ts.map +1 -1
- package/dist/functions/gridEntities.lua +45 -66
- package/dist/functions/gridEntitiesSpecific.d.ts +49 -4
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +81 -3
- 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 +111 -85
- 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/customStage/exports.ts +15 -7
- package/src/features/customStage/versusScreen.ts +3 -3
- 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/gridEntities.ts +0 -29
- package/src/functions/gridEntitiesSpecific.ts +119 -3
- 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,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;;;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OAAO,CAGT;AAED,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAa7E;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,eAAe,GAC/B,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;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 {
|
|
1
|
+
import { GridEntityType, GridEntityXMLType } from "isaac-typescript-definitions";
|
|
2
2
|
import { AnyGridEntity } from "../types/AnyGridEntity";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to convert the grid entity type found in a room XML file to the corresponding
|
|
@@ -20,13 +20,6 @@ export declare function getAllGridIndexes(): int[];
|
|
|
20
20
|
* not have collision yet in that callback.
|
|
21
21
|
*/
|
|
22
22
|
export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): Entity[];
|
|
23
|
-
/**
|
|
24
|
-
* Helper function to get all of the crawl spaces in the room.
|
|
25
|
-
*
|
|
26
|
-
* @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
|
|
27
|
-
* variant. Default is -1, which matches every variant.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant): GridEntity[];
|
|
30
23
|
/**
|
|
31
24
|
* Helper function to get every grid entity in the current room.
|
|
32
25
|
*
|
|
@@ -88,11 +81,6 @@ export declare function getTopLeftWall(): GridEntity | undefined;
|
|
|
88
81
|
* room shape is.)
|
|
89
82
|
*/
|
|
90
83
|
export declare function getTopLeftWallGridIndex(): int;
|
|
91
|
-
/**
|
|
92
|
-
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` in the room.
|
|
93
|
-
* Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
94
|
-
*/
|
|
95
|
-
export declare function getTrapdoors(trapdoorVariant?: TrapdoorVariant): GridEntity[];
|
|
96
84
|
/**
|
|
97
85
|
* Helper function to see if the provided gridEntity is in its respective broken state. See the
|
|
98
86
|
* `GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP` constant for more details.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgCvD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,GAAG,GACxB,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,CAqBnC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,EAAE,CAKzC;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,UAAU,GACrB,MAAM,EAAE,CA4BV;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,UAAU,EAAE,CAYd;AAgBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,UAAU,EAAE,CAYd;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAUtB;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAI9D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,GACX,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,GACX,UAAU,EAAE,CAKd;AAED,wBAAgB,0BAA0B,CACxC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;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAgCxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAkBtE"}
|
|
@@ -49,43 +49,6 @@ function ____exports.getAllGridIndexes(self)
|
|
|
49
49
|
local gridSize = room:GetGridSize()
|
|
50
50
|
return erange(nil, gridSize)
|
|
51
51
|
end
|
|
52
|
-
--- Helper function to get every grid entity in the current room.
|
|
53
|
-
--
|
|
54
|
-
-- Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
55
|
-
-- arguments to match specific grid entity types.
|
|
56
|
-
--
|
|
57
|
-
-- For example:
|
|
58
|
-
--
|
|
59
|
-
-- ```ts
|
|
60
|
-
-- for (const gridEntity of getGridEntities()) {
|
|
61
|
-
-- print(gridEntity.GetType())
|
|
62
|
-
-- }
|
|
63
|
-
-- ```
|
|
64
|
-
--
|
|
65
|
-
-- For example:
|
|
66
|
-
--
|
|
67
|
-
-- ```ts
|
|
68
|
-
-- const rocks = getGridEntities(
|
|
69
|
-
-- GridEntityType.ROCK,
|
|
70
|
-
-- GridEntityType.BLOCK,
|
|
71
|
-
-- GridEntityType.ROCK_TINTED,
|
|
72
|
-
-- );
|
|
73
|
-
-- ```
|
|
74
|
-
function ____exports.getGridEntities(self, ...)
|
|
75
|
-
local gridEntityTypes = {...}
|
|
76
|
-
local gridEntities = getAllGridEntities(nil)
|
|
77
|
-
if #gridEntityTypes == 0 then
|
|
78
|
-
return gridEntities
|
|
79
|
-
end
|
|
80
|
-
local gridEntityTypesSet = __TS__New(Set, gridEntityTypes)
|
|
81
|
-
return __TS__ArrayFilter(
|
|
82
|
-
gridEntities,
|
|
83
|
-
function(____, gridEntity)
|
|
84
|
-
local gridEntityType = gridEntity:GetType()
|
|
85
|
-
return gridEntityTypesSet:has(gridEntityType)
|
|
86
|
-
end
|
|
87
|
-
)
|
|
88
|
-
end
|
|
89
52
|
function getAllGridEntities(self)
|
|
90
53
|
local room = game:GetRoom()
|
|
91
54
|
local gridEntities = {}
|
|
@@ -97,17 +60,6 @@ function getAllGridEntities(self)
|
|
|
97
60
|
end
|
|
98
61
|
return gridEntities
|
|
99
62
|
end
|
|
100
|
-
--- Helper function to get all of the grid entities in the room that specifically match the type and
|
|
101
|
-
-- variant provided.
|
|
102
|
-
--
|
|
103
|
-
-- If you want to match every variant, use the `getGridEntities` function instead.
|
|
104
|
-
function ____exports.getMatchingGridEntities(self, gridEntityType, variant)
|
|
105
|
-
local gridEntities = ____exports.getGridEntities(nil, gridEntityType)
|
|
106
|
-
return __TS__ArrayFilter(
|
|
107
|
-
gridEntities,
|
|
108
|
-
function(____, gridEntity) return gridEntity:GetVariant() == variant end
|
|
109
|
-
)
|
|
110
|
-
end
|
|
111
63
|
--- Helper function to get the grid index of the top left wall. (This will depend on what the current
|
|
112
64
|
-- room shape is.)
|
|
113
65
|
function ____exports.getTopLeftWallGridIndex(self)
|
|
@@ -243,18 +195,42 @@ function ____exports.getCollidingEntitiesWithGridEntity(self, gridEntity)
|
|
|
243
195
|
) end
|
|
244
196
|
)
|
|
245
197
|
end
|
|
246
|
-
--- Helper function to get
|
|
198
|
+
--- Helper function to get every grid entity in the current room.
|
|
247
199
|
--
|
|
248
|
-
--
|
|
249
|
-
--
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
200
|
+
-- Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
201
|
+
-- arguments to match specific grid entity types.
|
|
202
|
+
--
|
|
203
|
+
-- For example:
|
|
204
|
+
--
|
|
205
|
+
-- ```ts
|
|
206
|
+
-- for (const gridEntity of getGridEntities()) {
|
|
207
|
+
-- print(gridEntity.GetType())
|
|
208
|
+
-- }
|
|
209
|
+
-- ```
|
|
210
|
+
--
|
|
211
|
+
-- For example:
|
|
212
|
+
--
|
|
213
|
+
-- ```ts
|
|
214
|
+
-- const rocks = getGridEntities(
|
|
215
|
+
-- GridEntityType.ROCK,
|
|
216
|
+
-- GridEntityType.BLOCK,
|
|
217
|
+
-- GridEntityType.ROCK_TINTED,
|
|
218
|
+
-- );
|
|
219
|
+
-- ```
|
|
220
|
+
function ____exports.getGridEntities(self, ...)
|
|
221
|
+
local gridEntityTypes = {...}
|
|
222
|
+
local gridEntities = getAllGridEntities(nil)
|
|
223
|
+
if #gridEntityTypes == 0 then
|
|
224
|
+
return gridEntities
|
|
256
225
|
end
|
|
257
|
-
|
|
226
|
+
local gridEntityTypesSet = __TS__New(Set, gridEntityTypes)
|
|
227
|
+
return __TS__ArrayFilter(
|
|
228
|
+
gridEntities,
|
|
229
|
+
function(____, gridEntity)
|
|
230
|
+
local gridEntityType = gridEntity:GetType()
|
|
231
|
+
return gridEntityTypesSet:has(gridEntityType)
|
|
232
|
+
end
|
|
233
|
+
)
|
|
258
234
|
end
|
|
259
235
|
--- Helper function to get every grid entity in the current room except for certain specific types.
|
|
260
236
|
--
|
|
@@ -300,6 +276,17 @@ end
|
|
|
300
276
|
function ____exports.getGridEntityIDFromConstituents(self, gridEntityType, variant)
|
|
301
277
|
return (tostring(gridEntityType) .. ".") .. tostring(variant)
|
|
302
278
|
end
|
|
279
|
+
--- Helper function to get all of the grid entities in the room that specifically match the type and
|
|
280
|
+
-- variant provided.
|
|
281
|
+
--
|
|
282
|
+
-- If you want to match every variant, use the `getGridEntities` function instead.
|
|
283
|
+
function ____exports.getMatchingGridEntities(self, gridEntityType, variant)
|
|
284
|
+
local gridEntities = ____exports.getGridEntities(nil, gridEntityType)
|
|
285
|
+
return __TS__ArrayFilter(
|
|
286
|
+
gridEntities,
|
|
287
|
+
function(____, gridEntity) return gridEntity:GetVariant() == variant end
|
|
288
|
+
)
|
|
289
|
+
end
|
|
303
290
|
function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
304
291
|
local room = game:GetRoom()
|
|
305
292
|
local gridWidth = room:GetGridWidth()
|
|
@@ -328,14 +315,6 @@ function ____exports.getTopLeftWall(self)
|
|
|
328
315
|
local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
|
|
329
316
|
return room:GetGridEntity(topLeftWallGridIndex)
|
|
330
317
|
end
|
|
331
|
-
--- Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` in the room.
|
|
332
|
-
-- Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
333
|
-
function ____exports.getTrapdoors(self, trapdoorVariant)
|
|
334
|
-
if trapdoorVariant == nil then
|
|
335
|
-
return ____exports.getGridEntities(nil, GridEntityType.TRAPDOOR)
|
|
336
|
-
end
|
|
337
|
-
return ____exports.getMatchingGridEntities(nil, GridEntityType.TRAPDOOR, trapdoorVariant)
|
|
338
|
-
end
|
|
339
318
|
--- Helper function to see if the provided gridEntity is in its respective broken state. See the
|
|
340
319
|
-- `GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP` constant for more details.
|
|
341
320
|
--
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { DoorVariant, PitVariant, PoopGridEntityVariant, PressurePlateVariant, RockVariant } from "isaac-typescript-definitions";
|
|
1
|
+
import { CrawlSpaceVariant, DoorVariant, PitVariant, PoopGridEntityVariant, PressurePlateVariant, RockVariant, TrapdoorVariant } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get all of the grid entities of type `GridEntityType.CRAWL_SPACE` (18) in the
|
|
4
|
+
* room.
|
|
5
|
+
*
|
|
6
|
+
* @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
|
|
7
|
+
* variant. Default is -1, which matches every variant.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant): GridEntity[];
|
|
2
10
|
/**
|
|
3
11
|
* Helper function to get all of the `GridEntityPit` in the room.
|
|
4
12
|
*
|
|
@@ -33,6 +41,23 @@ export declare function getRocks(variant?: number): GridEntityRock[];
|
|
|
33
41
|
export declare function getSpikes(variant?: number): GridEntitySpikes[];
|
|
34
42
|
/** Helper function to get all of the `GridEntityTNT` in the room. */
|
|
35
43
|
export declare function getTNT(variant?: number): GridEntityTNT[];
|
|
44
|
+
/**
|
|
45
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
46
|
+
* room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getTrapdoors(trapdoorVariant?: TrapdoorVariant): GridEntity[];
|
|
49
|
+
/**
|
|
50
|
+
* Helper function to remove all of the `GridEntityType.CRAWL_SPACE` (18) in the room.
|
|
51
|
+
*
|
|
52
|
+
* @param crawlSpaceVariant Optional. If specified, will only remove the crawl spaces that match
|
|
53
|
+
* this variant. Default is -1, which matches every variant.
|
|
54
|
+
* @param updateRoom Optional. Whether or not to update the room after the crawl spaces are removed.
|
|
55
|
+
* Default is false. For more information, see the description of the
|
|
56
|
+
* `removeGridEntities` helper function.
|
|
57
|
+
* @param cap Optional. If specified, will only remove the given amount of crawl spaces.
|
|
58
|
+
* @returns The crawl spaces that were removed.
|
|
59
|
+
*/
|
|
60
|
+
export declare function removeAllCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant, updateRoom?: boolean, cap?: int): GridEntity[];
|
|
36
61
|
/**
|
|
37
62
|
* Helper function to remove all of the `GridEntityPit` in the room.
|
|
38
63
|
*
|
|
@@ -110,11 +135,27 @@ export declare function removeAllSpikes(variant?: number, updateRoom?: boolean,
|
|
|
110
135
|
* @returns The TNTs that were removed.
|
|
111
136
|
*/
|
|
112
137
|
export declare function removeAllTNT(variant?: number, updateRoom?: boolean, cap?: int): GridEntityTNT[];
|
|
113
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
140
|
+
*
|
|
141
|
+
* @param trapdoorVariant Optional. If specified, will only remove the trapdoors that match this
|
|
142
|
+
* variant. Default is -1, which matches every variant.
|
|
143
|
+
* @param updateRoom Optional. Whether or not to update the room after the trapdoors are removed.
|
|
144
|
+
* Default is false. For more information, see the description of the
|
|
145
|
+
* `removeGridEntities` helper function.
|
|
146
|
+
* @param cap Optional. If specified, will only remove the given amount of trapdoors.
|
|
147
|
+
* @returns The trapdoors that were removed.
|
|
148
|
+
*/
|
|
149
|
+
export declare function removeAllTrapdoors(trapdoorVariant?: TrapdoorVariant, updateRoom?: boolean, cap?: int): GridEntity[];
|
|
150
|
+
/** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18). */
|
|
151
|
+
export declare function spawnCrawlSpace(gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
152
|
+
/** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant. */
|
|
153
|
+
export declare function spawnCrawlSpaceWithVariant(crawlSpaceVariant: CrawlSpaceVariant, gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
154
|
+
/** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */
|
|
114
155
|
export declare function spawnDoor(gridIndexOrPosition: int | Vector): GridEntityDoor | undefined;
|
|
115
|
-
/** Helper function to spawn a `GridEntityType.DOOR` (16)
|
|
156
|
+
/** Helper function to spawn a `GridEntityType.DOOR` (16). */
|
|
116
157
|
export declare function spawnDoorWithVariant(doorVariant: DoorVariant, gridIndexOrPosition: int | Vector): GridEntityDoor | undefined;
|
|
117
|
-
/** Helper function to spawn a `GridEntityType.
|
|
158
|
+
/** Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant. */
|
|
118
159
|
export declare function spawnPit(gridIndexOrPosition: int | Vector): GridEntityPit | undefined;
|
|
119
160
|
/** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */
|
|
120
161
|
export declare function spawnPitWithVariant(pitVariant: PitVariant, gridIndexOrPosition: int | Vector): GridEntityPit | undefined;
|
|
@@ -138,4 +179,8 @@ export declare function spawnSpikesWithVariant(variant: int, gridIndexOrPosition
|
|
|
138
179
|
export declare function spawnTNT(gridIndexOrPosition: int | Vector): GridEntityTNT | undefined;
|
|
139
180
|
/** Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant. */
|
|
140
181
|
export declare function spawnTNTWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntityTNT | undefined;
|
|
182
|
+
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17). */
|
|
183
|
+
export declare function spawnTrapdoor(gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
184
|
+
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17) with a specific variant. */
|
|
185
|
+
export declare function spawnTrapdoorWithVariant(trapdoorVariant: TrapdoorVariant, gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
141
186
|
//# sourceMappingURL=gridEntitiesSpecific.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,
|
|
1
|
+
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEX,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAStC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,GAAE,iBAAsB,GACxC,UAAU,EAAE,CAMd;AAKD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,UAAU,GAAE,UAAe,GAAG,aAAa,EAAE,CAepE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,WAAW,GAAE,qBAA0B,GAC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