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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local CrawlSpaceVariant = ____isaac_2Dtypescript_2Ddefinitions.CrawlSpaceVariant
|
|
3
4
|
local DoorVariant = ____isaac_2Dtypescript_2Ddefinitions.DoorVariant
|
|
4
5
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
5
6
|
local PitVariant = ____isaac_2Dtypescript_2Ddefinitions.PitVariant
|
|
@@ -8,11 +9,16 @@ local PressurePlateVariant = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateV
|
|
|
8
9
|
local RockVariant = ____isaac_2Dtypescript_2Ddefinitions.RockVariant
|
|
9
10
|
local ____gridEntities = require("functions.gridEntities")
|
|
10
11
|
local getGridEntities = ____gridEntities.getGridEntities
|
|
12
|
+
local getMatchingGridEntities = ____gridEntities.getMatchingGridEntities
|
|
11
13
|
local removeGridEntities = ____gridEntities.removeGridEntities
|
|
12
14
|
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
13
15
|
local ____types = require("functions.types")
|
|
14
16
|
local asNumber = ____types.asNumber
|
|
15
|
-
--- Helper function to spawn a `GridEntityType.
|
|
17
|
+
--- Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant.
|
|
18
|
+
function ____exports.spawnCrawlSpaceWithVariant(self, crawlSpaceVariant, gridIndexOrPosition)
|
|
19
|
+
return spawnGridEntityWithVariant(nil, GridEntityType.CRAWL_SPACE, crawlSpaceVariant, gridIndexOrPosition)
|
|
20
|
+
end
|
|
21
|
+
--- Helper function to spawn a `GridEntityType.DOOR` (16).
|
|
16
22
|
function ____exports.spawnDoorWithVariant(self, doorVariant, gridIndexOrPosition)
|
|
17
23
|
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.DOOR, doorVariant, gridIndexOrPosition)
|
|
18
24
|
if gridEntity == nil then
|
|
@@ -96,6 +102,20 @@ function ____exports.spawnTNTWithVariant(self, variant, gridIndexOrPosition)
|
|
|
96
102
|
end
|
|
97
103
|
return tnt
|
|
98
104
|
end
|
|
105
|
+
--- Helper function to get all of the grid entities of type `GridEntityType.CRAWL_SPACE` (18) in the
|
|
106
|
+
-- room.
|
|
107
|
+
--
|
|
108
|
+
-- @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
|
|
109
|
+
-- variant. Default is -1, which matches every variant.
|
|
110
|
+
function ____exports.getCrawlSpaces(self, crawlSpaceVariant)
|
|
111
|
+
if crawlSpaceVariant == nil then
|
|
112
|
+
crawlSpaceVariant = -1
|
|
113
|
+
end
|
|
114
|
+
if asNumber(nil, crawlSpaceVariant) == -1 then
|
|
115
|
+
return getGridEntities(nil, GridEntityType.CRAWL_SPACE)
|
|
116
|
+
end
|
|
117
|
+
return getMatchingGridEntities(nil, GridEntityType.CRAWL_SPACE, crawlSpaceVariant)
|
|
118
|
+
end
|
|
99
119
|
--- Helper function to get all of the `GridEntityPit` in the room.
|
|
100
120
|
--
|
|
101
121
|
-- @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
|
|
@@ -218,6 +238,33 @@ function ____exports.getTNT(self, variant)
|
|
|
218
238
|
end
|
|
219
239
|
return tntArray
|
|
220
240
|
end
|
|
241
|
+
--- Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
242
|
+
-- room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
243
|
+
function ____exports.getTrapdoors(self, trapdoorVariant)
|
|
244
|
+
if trapdoorVariant == nil then
|
|
245
|
+
return getGridEntities(nil, GridEntityType.TRAPDOOR)
|
|
246
|
+
end
|
|
247
|
+
return getMatchingGridEntities(nil, GridEntityType.TRAPDOOR, trapdoorVariant)
|
|
248
|
+
end
|
|
249
|
+
--- Helper function to remove all of the `GridEntityType.CRAWL_SPACE` (18) in the room.
|
|
250
|
+
--
|
|
251
|
+
-- @param crawlSpaceVariant Optional. If specified, will only remove the crawl spaces that match
|
|
252
|
+
-- this variant. Default is -1, which matches every variant.
|
|
253
|
+
-- @param updateRoom Optional. Whether or not to update the room after the crawl spaces are removed.
|
|
254
|
+
-- Default is false. For more information, see the description of the
|
|
255
|
+
-- `removeGridEntities` helper function.
|
|
256
|
+
-- @param cap Optional. If specified, will only remove the given amount of crawl spaces.
|
|
257
|
+
-- @returns The crawl spaces that were removed.
|
|
258
|
+
function ____exports.removeAllCrawlSpaces(self, crawlSpaceVariant, updateRoom, cap)
|
|
259
|
+
if crawlSpaceVariant == nil then
|
|
260
|
+
crawlSpaceVariant = -1
|
|
261
|
+
end
|
|
262
|
+
if updateRoom == nil then
|
|
263
|
+
updateRoom = false
|
|
264
|
+
end
|
|
265
|
+
local crawlSpaces = ____exports.getCrawlSpaces(nil, crawlSpaceVariant)
|
|
266
|
+
return removeGridEntities(nil, crawlSpaces, updateRoom, cap)
|
|
267
|
+
end
|
|
221
268
|
--- Helper function to remove all of the `GridEntityPit` in the room.
|
|
222
269
|
--
|
|
223
270
|
-- @param pitVariant Optional. If specified, will only remove the pits that match this variant.
|
|
@@ -337,11 +384,34 @@ function ____exports.removeAllTNT(self, variant, updateRoom, cap)
|
|
|
337
384
|
local tnt = ____exports.getTNT(nil, variant)
|
|
338
385
|
return removeGridEntities(nil, tnt, updateRoom, cap)
|
|
339
386
|
end
|
|
340
|
-
--- Helper function to
|
|
387
|
+
--- Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
388
|
+
--
|
|
389
|
+
-- @param trapdoorVariant Optional. If specified, will only remove the trapdoors that match this
|
|
390
|
+
-- variant. Default is -1, which matches every variant.
|
|
391
|
+
-- @param updateRoom Optional. Whether or not to update the room after the trapdoors are removed.
|
|
392
|
+
-- Default is false. For more information, see the description of the
|
|
393
|
+
-- `removeGridEntities` helper function.
|
|
394
|
+
-- @param cap Optional. If specified, will only remove the given amount of trapdoors.
|
|
395
|
+
-- @returns The trapdoors that were removed.
|
|
396
|
+
function ____exports.removeAllTrapdoors(self, trapdoorVariant, updateRoom, cap)
|
|
397
|
+
if trapdoorVariant == nil then
|
|
398
|
+
trapdoorVariant = -1
|
|
399
|
+
end
|
|
400
|
+
if updateRoom == nil then
|
|
401
|
+
updateRoom = false
|
|
402
|
+
end
|
|
403
|
+
local trapdoors = ____exports.getTrapdoors(nil, trapdoorVariant)
|
|
404
|
+
return removeGridEntities(nil, trapdoors, updateRoom, cap)
|
|
405
|
+
end
|
|
406
|
+
--- Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18).
|
|
407
|
+
function ____exports.spawnCrawlSpace(self, gridIndexOrPosition)
|
|
408
|
+
return ____exports.spawnCrawlSpaceWithVariant(nil, CrawlSpaceVariant.NORMAL, gridIndexOrPosition)
|
|
409
|
+
end
|
|
410
|
+
--- Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant.
|
|
341
411
|
function ____exports.spawnDoor(self, gridIndexOrPosition)
|
|
342
412
|
return ____exports.spawnDoorWithVariant(nil, DoorVariant.UNSPECIFIED, gridIndexOrPosition)
|
|
343
413
|
end
|
|
344
|
-
--- Helper function to spawn a `GridEntityType.
|
|
414
|
+
--- Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant.
|
|
345
415
|
function ____exports.spawnPit(self, gridIndexOrPosition)
|
|
346
416
|
return ____exports.spawnPitWithVariant(nil, PitVariant.NORMAL, gridIndexOrPosition)
|
|
347
417
|
end
|
|
@@ -365,4 +435,12 @@ end
|
|
|
365
435
|
function ____exports.spawnTNT(self, gridIndexOrPosition)
|
|
366
436
|
return ____exports.spawnTNTWithVariant(nil, 0, gridIndexOrPosition)
|
|
367
437
|
end
|
|
438
|
+
--- Helper function to spawn a `GridEntityType.TRAPDOOR` (17).
|
|
439
|
+
function ____exports.spawnTrapdoor(self, gridIndexOrPosition)
|
|
440
|
+
return ____exports.spawnCrawlSpaceWithVariant(nil, CrawlSpaceVariant.NORMAL, gridIndexOrPosition)
|
|
441
|
+
end
|
|
442
|
+
--- Helper function to spawn a `GridEntityType.TRAPDOOR` (17) with a specific variant.
|
|
443
|
+
function ____exports.spawnTrapdoorWithVariant(self, trapdoorVariant, gridIndexOrPosition)
|
|
444
|
+
return spawnGridEntityWithVariant(nil, GridEntityType.TRAPDOOR, trapdoorVariant, gridIndexOrPosition)
|
|
445
|
+
end
|
|
368
446
|
return ____exports
|
|
@@ -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,GACl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AE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,gBAAgB,CAElB;AAED,iGAAiG;AACjG,wBAAgB,SAAS,CACvB,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,gBAAgB,CASlB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,gBAAgB,CAElB;AAED;;GAEG;AACH,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,oFAAoF;AACpF,wBAAgB,mBAAmB,IAAI,SAAS,EAAE,CAEjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,GACrB,yBAAyB,CAS3B;AAED
|
|
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,oFAAoF;AACpF,wBAAgB,mBAAmB,IAAI,SAAS,EAAE,CAEjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,GACrB,yBAAyB,CAS3B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAgBhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,GACrB,wBAAwB,CAS1B;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,IAAI,UAAU,EAAE,CAEpD;AAED,wBAAgB,WAAW,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,E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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,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAEtD;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,OAAO,CAEhE;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAElE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAOvC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAExC;AAED,wBAAgB,UAAU,CAAC,QAAQ,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
|