isaacscript-common 87.8.3 → 87.9.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/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/index.rollup.d.ts +8 -5
- package/dist/isaacscript-common.lua +9 -7
- package/package.json +1 -1
- package/src/classes/features/other/CustomPickups.ts +25 -12
- package/src/core/constants.ts +2 -0
- package/src/functions/playerCollectibles.ts +1 -3
|
@@ -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,+BAA+B,iBAAmC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,iBAAiB,4HAOpB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,QAA8B,CA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;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,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,eA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;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.
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 87.8.
|
|
3
|
+
isaacscript-common 87.8.3
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -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.
|
|
@@ -48170,9 +48172,9 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48170
48172
|
if player == nil then
|
|
48171
48173
|
return nil
|
|
48172
48174
|
end
|
|
48173
|
-
local shouldPickup = customPickupFunctions.collisionFunc(player)
|
|
48174
|
-
if
|
|
48175
|
-
return
|
|
48175
|
+
local shouldPickup = customPickupFunctions.collisionFunc(pickup, player)
|
|
48176
|
+
if shouldPickup ~= nil then
|
|
48177
|
+
return shouldPickup
|
|
48176
48178
|
end
|
|
48177
48179
|
pickup:Remove()
|
|
48178
48180
|
local pickupSprite = pickup:GetSprite()
|
|
@@ -48181,7 +48183,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48181
48183
|
local effectSprite = effect:GetSprite()
|
|
48182
48184
|
effectSprite:Load(fileName, true)
|
|
48183
48185
|
effectSprite:Play("Collect", true)
|
|
48184
|
-
customPickupFunctions.collectFunc(player)
|
|
48186
|
+
customPickupFunctions.collectFunc(pickup, player)
|
|
48185
48187
|
return nil
|
|
48186
48188
|
end
|
|
48187
48189
|
self.postEffectRenderPickupEffect = function(____, effect)
|
|
@@ -48197,7 +48199,7 @@ function CustomPickups.prototype.____constructor(self)
|
|
|
48197
48199
|
end
|
|
48198
48200
|
function CustomPickups.prototype.registerCustomPickup(self, pickupVariantCustom, subType, collectFunc, collisionFunc)
|
|
48199
48201
|
if collisionFunc == nil then
|
|
48200
|
-
collisionFunc = function() return
|
|
48202
|
+
collisionFunc = function() return nil end
|
|
48201
48203
|
end
|
|
48202
48204
|
local entityID = getEntityIDFromConstituents(nil, EntityType.PICKUP, pickupVariantCustom, subType)
|
|
48203
48205
|
local customPickupFunctions = {collectFunc = collectFunc, collisionFunc = collisionFunc}
|
package/package.json
CHANGED
|
@@ -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
|
/**
|