isaacscript-common 8.9.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/postPlayerCollectible.d.ts.map +1 -1
- package/dist/callbacks/postPlayerCollectible.lua +78 -9
- 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/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +8 -10
- 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/collectibleCacheFlag.d.ts +4 -1
- package/dist/functions/collectibleCacheFlag.d.ts.map +1 -1
- package/dist/functions/collectibleCacheFlag.lua +5 -2
- 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/familiars.d.ts.map +1 -1
- package/dist/functions/itemPool.lua +9 -11
- 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/players.d.ts +6 -0
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +7 -1
- 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 +63 -78
- 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/callbacks/postPlayerCollectible.ts +89 -10
- 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/playerInventory.ts +6 -10
- package/src/features/preventCollectibleRotation.ts +2 -2
- package/src/functions/cards.ts +102 -86
- package/src/functions/collectibleCacheFlag.ts +6 -2
- package/src/functions/collectibles.ts +1 -6
- package/src/functions/familiars.ts +1 -0
- package/src/functions/itemPool.ts +6 -7
- package/src/functions/pickupsSpecific.ts +16 -13
- package/src/functions/pills.ts +1 -6
- package/src/functions/players.ts +14 -1
- 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
|
@@ -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
|
|
@@ -62,11 +62,15 @@ export declare function getPlayerCloserThan(position: Vector, distance: float):
|
|
|
62
62
|
* collectible type(s) provided.
|
|
63
63
|
*
|
|
64
64
|
* This function is variadic, meaning that you can specify N collectible types.
|
|
65
|
+
*
|
|
66
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
65
67
|
*/
|
|
66
68
|
export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): int;
|
|
67
69
|
/**
|
|
68
70
|
* Iterates over every item in the game and returns a map containing the number of each item that
|
|
69
71
|
* the player has.
|
|
72
|
+
*
|
|
73
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
70
74
|
*/
|
|
71
75
|
export declare function getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
|
|
72
76
|
/** Helper function to get the player from a tear, laser, bomb, etc. */
|
|
@@ -111,6 +115,8 @@ export declare function getPlayersWithTrinket(...trinketTypes: TrinketType[]): E
|
|
|
111
115
|
/**
|
|
112
116
|
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
113
117
|
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
118
|
+
*
|
|
119
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
114
120
|
*/
|
|
115
121
|
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
|
|
116
122
|
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"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AI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -219,6 +219,8 @@ end
|
|
|
219
219
|
-- collectible type(s) provided.
|
|
220
220
|
--
|
|
221
221
|
-- This function is variadic, meaning that you can specify N collectible types.
|
|
222
|
+
--
|
|
223
|
+
-- Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
222
224
|
function ____exports.getPlayerCollectibleCount(self, player, ...)
|
|
223
225
|
local collectibleTypes = {...}
|
|
224
226
|
local numCollectibles = 0
|
|
@@ -229,6 +231,8 @@ function ____exports.getPlayerCollectibleCount(self, player, ...)
|
|
|
229
231
|
end
|
|
230
232
|
--- Iterates over every item in the game and returns a map containing the number of each item that
|
|
231
233
|
-- the player has.
|
|
234
|
+
--
|
|
235
|
+
-- Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
232
236
|
function ____exports.getPlayerCollectibleMap(self, player)
|
|
233
237
|
local collectibleArray = getCollectibleArray(nil)
|
|
234
238
|
local collectibleMap = __TS__New(Map)
|
|
@@ -334,11 +338,13 @@ function ____exports.getPlayersWithTrinket(self, ...)
|
|
|
334
338
|
end
|
|
335
339
|
--- Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
336
340
|
-- Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
341
|
+
--
|
|
342
|
+
-- Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
337
343
|
function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
338
344
|
local players = getPlayers(nil)
|
|
339
345
|
local numCollectiblesArray = __TS__ArrayMap(
|
|
340
346
|
players,
|
|
341
|
-
function(____, player) return player:GetCollectibleNum(collectibleType) end
|
|
347
|
+
function(____, player) return player:GetCollectibleNum(collectibleType, true) end
|
|
342
348
|
)
|
|
343
349
|
return sumArray(nil, numCollectiblesArray)
|
|
344
350
|
end
|
|
@@ -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,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,M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
|
|
|
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
|