isaacscript-common 87.8.3 → 87.9.3
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/classes/features/other/CustomPickups.d.ts +6 -5
- package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
- package/dist/classes/features/other/CustomPickups.js +10 -9
- package/dist/classes/features/other/CustomPickups.lua +5 -5
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +2 -0
- package/dist/core/constants.lua +2 -0
- package/dist/functions/playerCollectibles.d.ts.map +1 -1
- package/dist/functions/playerCollectibles.js +1 -3
- package/dist/functions/playerCollectibles.lua +1 -1
- package/dist/functions/rooms.d.ts +10 -2
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.js +12 -1
- package/dist/functions/rooms.lua +11 -1
- package/dist/index.rollup.d.ts +16 -5
- package/dist/isaacscript-common.lua +23 -10
- package/dist/lualib_bundle.lua +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +6 -6
- package/src/classes/features/other/CustomPickups.ts +25 -12
- package/src/core/constants.ts +2 -0
- package/src/functions/playerCollectibles.ts +1 -3
- package/src/functions/rooms.ts +13 -2
|
@@ -26,12 +26,13 @@ export declare class CustomPickups extends Feature {
|
|
|
26
26
|
* @param subType The sub-type for the corresponding custom pickup.
|
|
27
27
|
* @param collectFunc The function to run when the player collects this pickup.
|
|
28
28
|
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
29
|
-
* Default is a function that always returns
|
|
30
|
-
* will always immediately collect the pickup when they collide with
|
|
31
|
-
* Specify this function if your pickup should only be able to be
|
|
32
|
-
* under certain conditions.
|
|
29
|
+
* Default is a function that always returns undefined, meaning that the
|
|
30
|
+
* player will always immediately collect the pickup when they collide with
|
|
31
|
+
* it. Specify this function if your pickup should only be able to be
|
|
32
|
+
* collected under certain conditions. Return value acts similar to
|
|
33
|
+
* `ModCallback.PRE_PICKUP_COLLISION`.
|
|
33
34
|
* @public
|
|
34
35
|
*/
|
|
35
|
-
registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, player: EntityPlayer) => void, collisionFunc?: (this: void, player: EntityPlayer) => boolean): void;
|
|
36
|
+
registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, pickup: EntityPickup, player: EntityPlayer) => void, collisionFunc?: (this: void, pickup: EntityPickup, player: EntityPlayer) => boolean | undefined): void;
|
|
36
37
|
}
|
|
37
38
|
//# sourceMappingURL=CustomPickups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPickups.d.ts","sourceRoot":"","sources":["../../../../src/classes/features/other/CustomPickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAalE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomPickups.d.ts","sourceRoot":"","sources":["../../../../src/classes/features/other/CustomPickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAalE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAsBhD,qBAAa,aAAc,SAAQ,OAAO;IACxC,4BAA4B;IAC5B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAGrC;IAoBJ,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAqCjC;IAIF,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAU3C;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IAEI,oBAAoB,CACzB,mBAAmB,EAAE,aAAa,EAClC,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,CACX,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,KACjB,IAAI,EACT,aAAa,GAAE,CACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,KACjB,OAAO,GAAG,SAA2B,GACzC,IAAI;CAYR"}
|
|
@@ -51,9 +51,9 @@ class CustomPickups extends Feature_1.Feature {
|
|
|
51
51
|
if (player === undefined) {
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
54
|
-
const shouldPickup = customPickupFunctions.collisionFunc(player);
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
54
|
+
const shouldPickup = customPickupFunctions.collisionFunc(pickup, player);
|
|
55
|
+
if (shouldPickup !== undefined) {
|
|
56
|
+
return shouldPickup;
|
|
57
57
|
}
|
|
58
58
|
pickup.Remove();
|
|
59
59
|
const pickupSprite = pickup.GetSprite();
|
|
@@ -62,7 +62,7 @@ class CustomPickups extends Feature_1.Feature {
|
|
|
62
62
|
const effectSprite = effect.GetSprite();
|
|
63
63
|
effectSprite.Load(fileName, true);
|
|
64
64
|
effectSprite.Play("Collect", true);
|
|
65
|
-
customPickupFunctions.collectFunc(player);
|
|
65
|
+
customPickupFunctions.collectFunc(pickup, player);
|
|
66
66
|
return undefined;
|
|
67
67
|
};
|
|
68
68
|
// ModCallback.POST_EFFECT_RENDER (56)
|
|
@@ -98,13 +98,14 @@ class CustomPickups extends Feature_1.Feature {
|
|
|
98
98
|
* @param subType The sub-type for the corresponding custom pickup.
|
|
99
99
|
* @param collectFunc The function to run when the player collects this pickup.
|
|
100
100
|
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
101
|
-
* Default is a function that always returns
|
|
102
|
-
* will always immediately collect the pickup when they collide with
|
|
103
|
-
* Specify this function if your pickup should only be able to be
|
|
104
|
-
* under certain conditions.
|
|
101
|
+
* Default is a function that always returns undefined, meaning that the
|
|
102
|
+
* player will always immediately collect the pickup when they collide with
|
|
103
|
+
* it. Specify this function if your pickup should only be able to be
|
|
104
|
+
* collected under certain conditions. Return value acts similar to
|
|
105
|
+
* `ModCallback.PRE_PICKUP_COLLISION`.
|
|
105
106
|
* @public
|
|
106
107
|
*/
|
|
107
|
-
registerCustomPickup(pickupVariantCustom, subType, collectFunc, collisionFunc = () =>
|
|
108
|
+
registerCustomPickup(pickupVariantCustom, subType, collectFunc, collisionFunc = () => undefined) {
|
|
108
109
|
const entityID = (0, entities_1.getEntityIDFromConstituents)(isaac_typescript_definitions_1.EntityType.PICKUP, pickupVariantCustom, subType);
|
|
109
110
|
const customPickupFunctions = {
|
|
110
111
|
collectFunc,
|
|
@@ -45,9 +45,9 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
45
45
|
if player == nil then
|
|
46
46
|
return nil
|
|
47
47
|
end
|
|
48
|
-
local shouldPickup = customPickupFunctions.collisionFunc(player)
|
|
49
|
-
if
|
|
50
|
-
return
|
|
48
|
+
local shouldPickup = customPickupFunctions.collisionFunc(pickup, player)
|
|
49
|
+
if shouldPickup ~= nil then
|
|
50
|
+
return shouldPickup
|
|
51
51
|
end
|
|
52
52
|
pickup:Remove()
|
|
53
53
|
local pickupSprite = pickup:GetSprite()
|
|
@@ -56,7 +56,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
56
56
|
local effectSprite = effect:GetSprite()
|
|
57
57
|
effectSprite:Load(fileName, true)
|
|
58
58
|
effectSprite:Play("Collect", true)
|
|
59
|
-
customPickupFunctions.collectFunc(player)
|
|
59
|
+
customPickupFunctions.collectFunc(pickup, player)
|
|
60
60
|
return nil
|
|
61
61
|
end
|
|
62
62
|
self.postEffectRenderPickupEffect = function(____, effect)
|
|
@@ -72,7 +72,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
72
72
|
end
|
|
73
73
|
function CustomPickups.prototype.registerCustomPickup(self, pickupVariantCustom, subType, collectFunc, collisionFunc)
|
|
74
74
|
if collisionFunc == nil then
|
|
75
|
-
collisionFunc = function() return
|
|
75
|
+
collisionFunc = function() return nil end
|
|
76
76
|
end
|
|
77
77
|
local entityID = getEntityIDFromConstituents(nil, EntityType.PICKUP, pickupVariantCustom, subType)
|
|
78
78
|
local customPickupFunctions = {collectFunc = collectFunc, collisionFunc = collisionFunc}
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -143,6 +143,8 @@ export declare const NUM_DIMENSIONS: number;
|
|
|
143
143
|
/**
|
|
144
144
|
* An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
145
145
|
* from the `NUM_DIMENSIONS` constant.)
|
|
146
|
+
*
|
|
147
|
+
* We cannot use the values of the `Dimension` enum because it includes -1.
|
|
146
148
|
*/
|
|
147
149
|
export declare const DIMENSIONS: readonly Dimension[];
|
|
148
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EAET,YAAY,EACZ,aAAa,EACb,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAatC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,eAAO,MAAM,qBAAqB,yUAaxB,CAAC;AAEX,eAAO,MAAM,yBAAyB,4BAErC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;;;GAMG;AAEH,eAAO,MAAM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AC7D,eAAO,MAAM,WAAW,EAAE,OAAW,CAAC;AAEtC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAAmB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAS,CAAC;AAEvE,4CAA4C;AAC5C,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,KAAkB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,kBAA0B,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kBAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,iBAA4B,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAgC,CAAC"}
|
package/dist/core/constants.js
CHANGED
|
@@ -216,6 +216,8 @@ exports.NUM_DIMENSIONS = (0, enums_1.getEnumLength)(isaac_typescript_definitions
|
|
|
216
216
|
/**
|
|
217
217
|
* An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
218
218
|
* from the `NUM_DIMENSIONS` constant.)
|
|
219
|
+
*
|
|
220
|
+
* We cannot use the values of the `Dimension` enum because it includes -1.
|
|
219
221
|
*/
|
|
220
222
|
exports.DIMENSIONS = (0, utils_1.eRange)(exports.NUM_DIMENSIONS);
|
|
221
223
|
/**
|
package/dist/core/constants.lua
CHANGED
|
@@ -196,6 +196,8 @@ ____exports.MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000
|
|
|
196
196
|
____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
|
|
197
197
|
--- An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
198
198
|
-- from the `NUM_DIMENSIONS` constant.)
|
|
199
|
+
--
|
|
200
|
+
-- We cannot use the values of the `Dimension` enum because it includes -1.
|
|
199
201
|
____exports.DIMENSIONS = eRange(nil, ____exports.NUM_DIMENSIONS)
|
|
200
202
|
--- The pill pool for each run is comprised of one effect for each unique pill color (minus gold and
|
|
201
203
|
-- horse pills.)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCollectibles.d.ts","sourceRoot":"","sources":["../../src/functions/playerCollectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAStC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAC9C,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,SAAS,UAAU,EAAE,CAKvB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"playerCollectibles.d.ts","sourceRoot":"","sources":["../../src/functions/playerCollectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAStC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,SAAS,eAAe,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oB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAC9C,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAC9C,IAAI,CAQN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA2DN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -73,9 +73,7 @@ function getActiveItemSlots(player, collectibleType) {
|
|
|
73
73
|
*/
|
|
74
74
|
function getAdjustedPrice(basePrice) {
|
|
75
75
|
const numSteamSales = getTotalPlayerCollectibles(isaac_typescript_definitions_1.CollectibleType.STEAM_SALE);
|
|
76
|
-
return numSteamSales
|
|
77
|
-
? Math.floor(basePrice / (numSteamSales + 1))
|
|
78
|
-
: basePrice;
|
|
76
|
+
return Math.ceil(basePrice / (numSteamSales + 1));
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
81
79
|
* Helper function to return the total amount of collectibles that a player has that match the
|
|
@@ -83,7 +83,7 @@ end
|
|
|
83
83
|
-- the prices for items in the shop would be the same as if Isaac had two Steam Sales.)
|
|
84
84
|
function ____exports.getAdjustedPrice(self, basePrice)
|
|
85
85
|
local numSteamSales = ____exports.getTotalPlayerCollectibles(nil, CollectibleType.STEAM_SALE)
|
|
86
|
-
return
|
|
86
|
+
return math.ceil(basePrice / (numSteamSales + 1))
|
|
87
87
|
end
|
|
88
88
|
--- Helper function to return the total amount of collectibles that a player has that match the
|
|
89
89
|
-- collectible type(s) provided.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BackdropType, BossID,
|
|
2
|
-
import { Dimension, RoomType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { BackdropType, BossID, MinibossID, RoomShape } from "isaac-typescript-definitions";
|
|
2
|
+
import { Dimension, ItemPoolType, RoomType } from "isaac-typescript-definitions";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function for quickly switching to a new room without playing a particular animation. Use
|
|
5
5
|
* this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
|
|
@@ -51,6 +51,14 @@ export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVarian
|
|
|
51
51
|
/**
|
|
52
52
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
53
53
|
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
54
|
+
*
|
|
55
|
+
* This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
56
|
+
*
|
|
57
|
+
* Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
58
|
+
* function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
59
|
+
* is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
60
|
+
* to distinguish between real Treasure Rooms and default rooms, then use the
|
|
61
|
+
* `ItemPool.GetPoolForRoom` method directly.
|
|
54
62
|
*/
|
|
55
63
|
export declare function getRoomItemPoolType(): ItemPoolType;
|
|
56
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,
|
|
1
|
+
{"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js
CHANGED
|
@@ -166,13 +166,24 @@ function getRoomDataForTypeVariant(roomType, roomVariant, cancelRoomTransition =
|
|
|
166
166
|
/**
|
|
167
167
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
168
168
|
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
169
|
+
*
|
|
170
|
+
* This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
171
|
+
*
|
|
172
|
+
* Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
173
|
+
* function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
174
|
+
* is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
175
|
+
* to distinguish between real Treasure Rooms and default rooms, then use the
|
|
176
|
+
* `ItemPool.GetPoolForRoom` method directly.
|
|
169
177
|
*/
|
|
170
178
|
function getRoomItemPoolType() {
|
|
171
179
|
const itemPool = cachedClasses_1.game.GetItemPool();
|
|
172
180
|
const room = cachedClasses_1.game.GetRoom();
|
|
173
181
|
const roomType = room.GetType();
|
|
174
182
|
const roomSeed = room.GetSpawnSeed();
|
|
175
|
-
|
|
183
|
+
const itemPoolTypeOrNegativeOne = itemPool.GetPoolForRoom(roomType, roomSeed);
|
|
184
|
+
return itemPoolTypeOrNegativeOne === -1
|
|
185
|
+
? isaac_typescript_definitions_1.ItemPoolType.TREASURE
|
|
186
|
+
: itemPoolTypeOrNegativeOne;
|
|
176
187
|
}
|
|
177
188
|
/**
|
|
178
189
|
* Helper function to get the proper name of a room type.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -20,6 +20,7 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
|
|
|
20
20
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
21
21
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
22
22
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
23
|
+
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
23
24
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
24
25
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
25
26
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
@@ -334,12 +335,21 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
|
|
|
334
335
|
end
|
|
335
336
|
--- Helper function to get the item pool type for the current room. For example, this returns
|
|
336
337
|
-- `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
338
|
+
--
|
|
339
|
+
-- This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
340
|
+
--
|
|
341
|
+
-- Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
342
|
+
-- function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
343
|
+
-- is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
344
|
+
-- to distinguish between real Treasure Rooms and default rooms, then use the
|
|
345
|
+
-- `ItemPool.GetPoolForRoom` method directly.
|
|
337
346
|
function ____exports.getRoomItemPoolType(self)
|
|
338
347
|
local itemPool = game:GetItemPool()
|
|
339
348
|
local room = game:GetRoom()
|
|
340
349
|
local roomType = room:GetType()
|
|
341
350
|
local roomSeed = room:GetSpawnSeed()
|
|
342
|
-
|
|
351
|
+
local itemPoolTypeOrNegativeOne = itemPool:GetPoolForRoom(roomType, roomSeed)
|
|
352
|
+
return itemPoolTypeOrNegativeOne == -1 and ItemPoolType.TREASURE or itemPoolTypeOrNegativeOne
|
|
343
353
|
end
|
|
344
354
|
--- Helper function to get the proper name of a room type.
|
|
345
355
|
--
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -2175,13 +2175,14 @@ declare class CustomPickups extends Feature {
|
|
|
2175
2175
|
* @param subType The sub-type for the corresponding custom pickup.
|
|
2176
2176
|
* @param collectFunc The function to run when the player collects this pickup.
|
|
2177
2177
|
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
2178
|
-
* Default is a function that always returns
|
|
2179
|
-
* will always immediately collect the pickup when they collide with
|
|
2180
|
-
* Specify this function if your pickup should only be able to be
|
|
2181
|
-
* under certain conditions.
|
|
2178
|
+
* Default is a function that always returns undefined, meaning that the
|
|
2179
|
+
* player will always immediately collect the pickup when they collide with
|
|
2180
|
+
* it. Specify this function if your pickup should only be able to be
|
|
2181
|
+
* collected under certain conditions. Return value acts similar to
|
|
2182
|
+
* `ModCallback.PRE_PICKUP_COLLISION`.
|
|
2182
2183
|
* @public
|
|
2183
2184
|
*/
|
|
2184
|
-
registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, player: EntityPlayer) => void, collisionFunc?: (this: void, player: EntityPlayer) => boolean): void;
|
|
2185
|
+
registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, pickup: EntityPickup, player: EntityPlayer) => void, collisionFunc?: (this: void, pickup: EntityPickup, player: EntityPlayer) => boolean | undefined): void;
|
|
2185
2186
|
}
|
|
2186
2187
|
|
|
2187
2188
|
declare class CustomRevive extends Feature {
|
|
@@ -3745,6 +3746,8 @@ export declare const DICE_FLOOR_TRIGGER_SQUARE_SIZE = 75;
|
|
|
3745
3746
|
/**
|
|
3746
3747
|
* An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
3747
3748
|
* from the `NUM_DIMENSIONS` constant.)
|
|
3749
|
+
*
|
|
3750
|
+
* We cannot use the values of the `Dimension` enum because it includes -1.
|
|
3748
3751
|
*/
|
|
3749
3752
|
export declare const DIMENSIONS: readonly Dimension[];
|
|
3750
3753
|
|
|
@@ -7508,6 +7511,14 @@ export declare function getRoomGridIndexesForType(...roomTypes: readonly RoomTyp
|
|
|
7508
7511
|
/**
|
|
7509
7512
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
7510
7513
|
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
7514
|
+
*
|
|
7515
|
+
* This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
7516
|
+
*
|
|
7517
|
+
* Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
7518
|
+
* function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
7519
|
+
* is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
7520
|
+
* to distinguish between real Treasure Rooms and default rooms, then use the
|
|
7521
|
+
* `ItemPool.GetPoolForRoom` method directly.
|
|
7511
7522
|
*/
|
|
7512
7523
|
export declare function getRoomItemPoolType(): ItemPoolType;
|
|
7513
7524
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 87.
|
|
3
|
+
isaacscript-common 87.9.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -2295,7 +2295,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2295
2295
|
end
|
|
2296
2296
|
local result = string.gsub(
|
|
2297
2297
|
trace,
|
|
2298
|
-
"(
|
|
2298
|
+
"([^%s<]+)%.lua:(%d+)",
|
|
2299
2299
|
function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
|
|
2300
2300
|
)
|
|
2301
2301
|
local function stringReplacer(____, file, line)
|
|
@@ -21405,6 +21405,8 @@ ____exports.MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000
|
|
|
21405
21405
|
____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
|
|
21406
21406
|
--- An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
21407
21407
|
-- from the `NUM_DIMENSIONS` constant.)
|
|
21408
|
+
--
|
|
21409
|
+
-- We cannot use the values of the `Dimension` enum because it includes -1.
|
|
21408
21410
|
____exports.DIMENSIONS = eRange(nil, ____exports.NUM_DIMENSIONS)
|
|
21409
21411
|
--- The pill pool for each run is comprised of one effect for each unique pill color (minus gold and
|
|
21410
21412
|
-- horse pills.)
|
|
@@ -29102,7 +29104,7 @@ end
|
|
|
29102
29104
|
-- the prices for items in the shop would be the same as if Isaac had two Steam Sales.)
|
|
29103
29105
|
function ____exports.getAdjustedPrice(self, basePrice)
|
|
29104
29106
|
local numSteamSales = ____exports.getTotalPlayerCollectibles(nil, CollectibleType.STEAM_SALE)
|
|
29105
|
-
return
|
|
29107
|
+
return math.ceil(basePrice / (numSteamSales + 1))
|
|
29106
29108
|
end
|
|
29107
29109
|
--- Helper function to return the total amount of collectibles that a player has that match the
|
|
29108
29110
|
-- collectible type(s) provided.
|
|
@@ -33362,6 +33364,7 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
|
|
|
33362
33364
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
33363
33365
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
33364
33366
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
33367
|
+
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
33365
33368
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
33366
33369
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
33367
33370
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
@@ -33676,12 +33679,21 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
|
|
|
33676
33679
|
end
|
|
33677
33680
|
--- Helper function to get the item pool type for the current room. For example, this returns
|
|
33678
33681
|
-- `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
33682
|
+
--
|
|
33683
|
+
-- This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
33684
|
+
--
|
|
33685
|
+
-- Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
33686
|
+
-- function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
33687
|
+
-- is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
33688
|
+
-- to distinguish between real Treasure Rooms and default rooms, then use the
|
|
33689
|
+
-- `ItemPool.GetPoolForRoom` method directly.
|
|
33679
33690
|
function ____exports.getRoomItemPoolType(self)
|
|
33680
33691
|
local itemPool = game:GetItemPool()
|
|
33681
33692
|
local room = game:GetRoom()
|
|
33682
33693
|
local roomType = room:GetType()
|
|
33683
33694
|
local roomSeed = room:GetSpawnSeed()
|
|
33684
|
-
|
|
33695
|
+
local itemPoolTypeOrNegativeOne = itemPool:GetPoolForRoom(roomType, roomSeed)
|
|
33696
|
+
return itemPoolTypeOrNegativeOne == -1 and ItemPoolType.TREASURE or itemPoolTypeOrNegativeOne
|
|
33685
33697
|
end
|
|
33686
33698
|
--- Helper function to get the proper name of a room type.
|
|
33687
33699
|
--
|
|
@@ -48170,9 +48182,9 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48170
48182
|
if player == nil then
|
|
48171
48183
|
return nil
|
|
48172
48184
|
end
|
|
48173
|
-
local shouldPickup = customPickupFunctions.collisionFunc(player)
|
|
48174
|
-
if
|
|
48175
|
-
return
|
|
48185
|
+
local shouldPickup = customPickupFunctions.collisionFunc(pickup, player)
|
|
48186
|
+
if shouldPickup ~= nil then
|
|
48187
|
+
return shouldPickup
|
|
48176
48188
|
end
|
|
48177
48189
|
pickup:Remove()
|
|
48178
48190
|
local pickupSprite = pickup:GetSprite()
|
|
@@ -48181,7 +48193,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48181
48193
|
local effectSprite = effect:GetSprite()
|
|
48182
48194
|
effectSprite:Load(fileName, true)
|
|
48183
48195
|
effectSprite:Play("Collect", true)
|
|
48184
|
-
customPickupFunctions.collectFunc(player)
|
|
48196
|
+
customPickupFunctions.collectFunc(pickup, player)
|
|
48185
48197
|
return nil
|
|
48186
48198
|
end
|
|
48187
48199
|
self.postEffectRenderPickupEffect = function(____, effect)
|
|
@@ -48197,7 +48209,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48197
48209
|
end
|
|
48198
48210
|
function CustomPickups.prototype.registerCustomPickup(self, pickupVariantCustom, subType, collectFunc, collisionFunc)
|
|
48199
48211
|
if collisionFunc == nil then
|
|
48200
|
-
collisionFunc = function() return
|
|
48212
|
+
collisionFunc = function() return nil end
|
|
48201
48213
|
end
|
|
48202
48214
|
local entityID = getEntityIDFromConstituents(nil, EntityType.PICKUP, pickupVariantCustom, subType)
|
|
48203
48215
|
local customPickupFunctions = {collectFunc = collectFunc, collisionFunc = collisionFunc}
|
|
@@ -70870,4 +70882,5 @@ end
|
|
|
70870
70882
|
return ____exports
|
|
70871
70883
|
end,
|
|
70872
70884
|
}
|
|
70873
|
-
|
|
70885
|
+
local ____entry = require("indexLua", ...)
|
|
70886
|
+
return ____entry
|
package/dist/lualib_bundle.lua
CHANGED
|
@@ -2241,7 +2241,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2241
2241
|
end
|
|
2242
2242
|
local result = string.gsub(
|
|
2243
2243
|
trace,
|
|
2244
|
-
"(
|
|
2244
|
+
"([^%s<]+)%.lua:(%d+)",
|
|
2245
2245
|
function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
|
|
2246
2246
|
)
|
|
2247
2247
|
local function stringReplacer(____, file, line)
|
package/dist/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "87.
|
|
3
|
+
"version": "87.9.3",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"isaac-typescript-definitions": "43.0.
|
|
37
|
+
"isaac-typescript-definitions": "43.0.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@microsoft/api-extractor": "7.
|
|
41
|
-
"complete-node": "16.
|
|
40
|
+
"@microsoft/api-extractor": "7.57.7",
|
|
41
|
+
"complete-node": "16.3.0",
|
|
42
42
|
"eslint-plugin-sort-exports": "0.9.1",
|
|
43
|
-
"typescript-eslint": "8.
|
|
44
|
-
"typescript-to-lua": "1.
|
|
43
|
+
"typescript-eslint": "8.57.0",
|
|
44
|
+
"typescript-to-lua": "1.34.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -14,8 +14,12 @@ import { spawnEffect } from "../../../functions/entitiesSpecific";
|
|
|
14
14
|
import { Feature } from "../../private/Feature";
|
|
15
15
|
|
|
16
16
|
interface CustomPickupFunctions {
|
|
17
|
-
collectFunc: (this: void, player: EntityPlayer) => void;
|
|
18
|
-
collisionFunc: (
|
|
17
|
+
collectFunc: (this: void, pickup: EntityPickup, player: EntityPlayer) => void;
|
|
18
|
+
collisionFunc: (
|
|
19
|
+
this: void,
|
|
20
|
+
pickup: EntityPickup,
|
|
21
|
+
player: EntityPlayer,
|
|
22
|
+
) => boolean | undefined;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
/**
|
|
@@ -69,9 +73,9 @@ export class CustomPickups extends Feature {
|
|
|
69
73
|
return undefined;
|
|
70
74
|
}
|
|
71
75
|
|
|
72
|
-
const shouldPickup = customPickupFunctions.collisionFunc(player);
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
76
|
+
const shouldPickup = customPickupFunctions.collisionFunc(pickup, player);
|
|
77
|
+
if (shouldPickup !== undefined) {
|
|
78
|
+
return shouldPickup;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
pickup.Remove();
|
|
@@ -88,7 +92,7 @@ export class CustomPickups extends Feature {
|
|
|
88
92
|
effectSprite.Load(fileName, true);
|
|
89
93
|
effectSprite.Play("Collect", true);
|
|
90
94
|
|
|
91
|
-
customPickupFunctions.collectFunc(player);
|
|
95
|
+
customPickupFunctions.collectFunc(pickup, player);
|
|
92
96
|
|
|
93
97
|
return undefined;
|
|
94
98
|
};
|
|
@@ -128,18 +132,27 @@ export class CustomPickups extends Feature {
|
|
|
128
132
|
* @param subType The sub-type for the corresponding custom pickup.
|
|
129
133
|
* @param collectFunc The function to run when the player collects this pickup.
|
|
130
134
|
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
131
|
-
* Default is a function that always returns
|
|
132
|
-
* will always immediately collect the pickup when they collide with
|
|
133
|
-
* Specify this function if your pickup should only be able to be
|
|
134
|
-
* under certain conditions.
|
|
135
|
+
* Default is a function that always returns undefined, meaning that the
|
|
136
|
+
* player will always immediately collect the pickup when they collide with
|
|
137
|
+
* it. Specify this function if your pickup should only be able to be
|
|
138
|
+
* collected under certain conditions. Return value acts similar to
|
|
139
|
+
* `ModCallback.PRE_PICKUP_COLLISION`.
|
|
135
140
|
* @public
|
|
136
141
|
*/
|
|
137
142
|
@Exported
|
|
138
143
|
public registerCustomPickup(
|
|
139
144
|
pickupVariantCustom: PickupVariant,
|
|
140
145
|
subType: int,
|
|
141
|
-
collectFunc: (
|
|
142
|
-
|
|
146
|
+
collectFunc: (
|
|
147
|
+
this: void,
|
|
148
|
+
pickup: EntityPickup,
|
|
149
|
+
player: EntityPlayer,
|
|
150
|
+
) => void,
|
|
151
|
+
collisionFunc: (
|
|
152
|
+
this: void,
|
|
153
|
+
pickup: EntityPickup,
|
|
154
|
+
player: EntityPlayer,
|
|
155
|
+
) => boolean | undefined = () => undefined,
|
|
143
156
|
): void {
|
|
144
157
|
const entityID = getEntityIDFromConstituents(
|
|
145
158
|
EntityType.PICKUP,
|
package/src/core/constants.ts
CHANGED
|
@@ -276,6 +276,8 @@ export const NUM_DIMENSIONS = getEnumLength(Dimension) - 1;
|
|
|
276
276
|
/**
|
|
277
277
|
* An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
|
|
278
278
|
* from the `NUM_DIMENSIONS` constant.)
|
|
279
|
+
*
|
|
280
|
+
* We cannot use the values of the `Dimension` enum because it includes -1.
|
|
279
281
|
*/
|
|
280
282
|
export const DIMENSIONS: readonly Dimension[] = eRange(
|
|
281
283
|
NUM_DIMENSIONS,
|
|
@@ -78,9 +78,7 @@ export function getActiveItemSlots(
|
|
|
78
78
|
*/
|
|
79
79
|
export function getAdjustedPrice(basePrice: int): int {
|
|
80
80
|
const numSteamSales = getTotalPlayerCollectibles(CollectibleType.STEAM_SALE);
|
|
81
|
-
return numSteamSales
|
|
82
|
-
? Math.floor(basePrice / (numSteamSales + 1))
|
|
83
|
-
: basePrice;
|
|
81
|
+
return Math.ceil(basePrice / (numSteamSales + 1));
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/**
|
package/src/functions/rooms.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BackdropType,
|
|
3
3
|
BossID,
|
|
4
|
-
ItemPoolType,
|
|
5
4
|
MinibossID,
|
|
6
5
|
RoomShape,
|
|
7
6
|
} from "isaac-typescript-definitions";
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
DungeonSubType,
|
|
15
14
|
GridRoom,
|
|
16
15
|
HomeRoomSubType,
|
|
16
|
+
ItemPoolType,
|
|
17
17
|
RoomDescriptorFlag,
|
|
18
18
|
RoomType,
|
|
19
19
|
SoundEffect,
|
|
@@ -166,14 +166,25 @@ export function getRoomDataForTypeVariant(
|
|
|
166
166
|
/**
|
|
167
167
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
168
168
|
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
169
|
+
*
|
|
170
|
+
* This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
|
|
171
|
+
*
|
|
172
|
+
* Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
|
|
173
|
+
* function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
|
|
174
|
+
* is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
|
|
175
|
+
* to distinguish between real Treasure Rooms and default rooms, then use the
|
|
176
|
+
* `ItemPool.GetPoolForRoom` method directly.
|
|
169
177
|
*/
|
|
170
178
|
export function getRoomItemPoolType(): ItemPoolType {
|
|
171
179
|
const itemPool = game.GetItemPool();
|
|
172
180
|
const room = game.GetRoom();
|
|
173
181
|
const roomType = room.GetType();
|
|
174
182
|
const roomSeed = room.GetSpawnSeed();
|
|
183
|
+
const itemPoolTypeOrNegativeOne = itemPool.GetPoolForRoom(roomType, roomSeed);
|
|
175
184
|
|
|
176
|
-
return
|
|
185
|
+
return itemPoolTypeOrNegativeOne === -1
|
|
186
|
+
? ItemPoolType.TREASURE
|
|
187
|
+
: itemPoolTypeOrNegativeOne;
|
|
177
188
|
}
|
|
178
189
|
|
|
179
190
|
/**
|