isaacscript-common 7.12.0 → 7.15.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/features/customPickup.d.ts +23 -2
- package/dist/features/customPickup.d.ts.map +1 -1
- package/dist/features/customPickup.lua +77 -2
- package/dist/features/customStage/backdrop.lua +3 -3
- package/dist/features/customStage/shadows.lua +2 -2
- package/dist/features/deployJSONRoom.lua +2 -2
- package/dist/functions/collectibleSet.d.ts.map +1 -1
- package/dist/functions/collectibleSet.lua +2 -2
- package/dist/functions/gridEntities.d.ts +2 -2
- package/dist/functions/gridEntities.d.ts.map +1 -1
- package/dist/functions/gridEntities.lua +2 -2
- package/dist/functions/npcs.lua +3 -3
- package/dist/functions/pickups.lua +2 -2
- package/dist/functions/trinketSet.d.ts +44 -0
- package/dist/functions/trinketSet.d.ts.map +1 -0
- package/dist/functions/trinketSet.lua +101 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +8 -0
- package/dist/initFeatures.lua +1 -1
- package/dist/objects/coinSubTypeToValue.d.ts +1 -1
- package/dist/objects/coinSubTypeToValue.d.ts.map +1 -1
- package/dist/objects/coinSubTypeToValue.lua +1 -1
- package/package.json +1 -1
- package/src/features/customPickup.ts +128 -2
- package/src/features/customStage/backdrop.ts +2 -2
- package/src/features/customStage/shadows.ts +2 -2
- package/src/features/deployJSONRoom.ts +2 -2
- package/src/functions/collectibleSet.ts +4 -3
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/npcs.ts +2 -2
- package/src/functions/pickups.ts +2 -2
- package/src/functions/trinketSet.ts +133 -0
- package/src/index.ts +1 -0
- package/src/initFeatures.ts +1 -1
- package/src/objects/coinSubTypeToValue.ts +1 -1
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import { PickupVariant } from "isaac-typescript-definitions";
|
|
2
|
+
export declare function customPickupInit(mod: Mod): void;
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to register a custom pickup with the IsaacScript standard library. Use this
|
|
5
|
+
* feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
|
|
6
|
+
*
|
|
7
|
+
* When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
|
|
8
|
+
* will be immediately removed, and an effect showing the pickup's respective `Collect` animation
|
|
9
|
+
* will be spawned. (This emulates how a normal vanilla pickup would work.)
|
|
10
|
+
*
|
|
11
|
+
* Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
|
|
12
|
+
* of "5" and be associated with an anm2 file that has a "Collect" animation.
|
|
13
|
+
*
|
|
14
|
+
* @param pickupVariantCustom The variant for the corresponding custom pickup.
|
|
15
|
+
* @param subType The sub-type for the corresponding custom pickup.
|
|
16
|
+
* @param collectFunc The function to run when the player collects this pickup.
|
|
17
|
+
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
18
|
+
* Default is a function that always returns true, meaning that the player will
|
|
19
|
+
* always immediately collect the pickup when they collide with it. Specify
|
|
20
|
+
* this function if your pickup should only be able to be collected under
|
|
21
|
+
* certain conditions.
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (player: EntityPlayer) => void, collisionFunc?: (player: EntityPlayer) => boolean): void;
|
|
3
24
|
//# sourceMappingURL=customPickup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPickup.d.ts","sourceRoot":"","sources":["../../src/features/customPickup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customPickup.d.ts","sourceRoot":"","sources":["../../src/features/customPickup.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,8BAA8B,CAAC;AA6BtC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAO/C;AAuDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,mBAAmB,EAAE,aAAa,EAClC,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,EAC3C,aAAa,GAAE,CAAC,MAAM,EAAE,YAAY,KAAK,OAAoB,GAC5D,IAAI,CAaN"}
|
|
@@ -1,10 +1,85 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
1
4
|
local ____exports = {}
|
|
5
|
+
local prePickupCollision, postEffectRenderPickupEffect, PICKUP_EFFECT_VARIANT, PICKUP_EFFECT_SUB_TYPE, customPickupFunctionsMap
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
8
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
9
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
2
10
|
local ____featuresInitialized = require("featuresInitialized")
|
|
3
11
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
12
|
+
local ____entities = require("functions.entities")
|
|
13
|
+
local getEntityID = ____entities.getEntityID
|
|
14
|
+
local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
|
|
15
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
16
|
+
local spawnEffect = ____entitiesSpecific.spawnEffect
|
|
17
|
+
function prePickupCollision(self, pickup, collider)
|
|
18
|
+
local entityID = getEntityID(nil, pickup)
|
|
19
|
+
local customPickupFunctions = customPickupFunctionsMap:get(entityID)
|
|
20
|
+
if customPickupFunctions == nil then
|
|
21
|
+
return nil
|
|
22
|
+
end
|
|
23
|
+
local player = collider:ToPlayer()
|
|
24
|
+
if player == nil then
|
|
25
|
+
return nil
|
|
26
|
+
end
|
|
27
|
+
local shouldPickup = customPickupFunctions:collisionFunc(player)
|
|
28
|
+
if not shouldPickup then
|
|
29
|
+
return nil
|
|
30
|
+
end
|
|
31
|
+
pickup:Remove()
|
|
32
|
+
local pickupSprite = pickup:GetSprite()
|
|
33
|
+
local fileName = pickupSprite:GetFilename()
|
|
34
|
+
local effect = spawnEffect(nil, PICKUP_EFFECT_VARIANT, PICKUP_EFFECT_SUB_TYPE, pickup.Position)
|
|
35
|
+
local effectSprite = effect:GetSprite()
|
|
36
|
+
effectSprite:Load(fileName, true)
|
|
37
|
+
effectSprite:Play("Collect", true)
|
|
38
|
+
customPickupFunctions:collectFunc(player)
|
|
39
|
+
return nil
|
|
40
|
+
end
|
|
41
|
+
function postEffectRenderPickupEffect(self, effect)
|
|
42
|
+
if effect.SubType ~= PICKUP_EFFECT_SUB_TYPE then
|
|
43
|
+
return
|
|
44
|
+
end
|
|
45
|
+
local sprite = effect:GetSprite()
|
|
46
|
+
if sprite:IsFinished("Collect") then
|
|
47
|
+
effect:Remove()
|
|
48
|
+
end
|
|
49
|
+
end
|
|
4
50
|
local FEATURE_NAME = "customPickup"
|
|
5
|
-
|
|
51
|
+
PICKUP_EFFECT_VARIANT = EffectVariant.LADDER
|
|
52
|
+
PICKUP_EFFECT_SUB_TYPE = 103
|
|
53
|
+
customPickupFunctionsMap = __TS__New(Map)
|
|
54
|
+
function ____exports.customPickupInit(self, mod)
|
|
55
|
+
mod:AddCallback(ModCallback.PRE_PICKUP_COLLISION, prePickupCollision)
|
|
56
|
+
mod:AddCallback(ModCallback.POST_EFFECT_RENDER, postEffectRenderPickupEffect, PICKUP_EFFECT_VARIANT)
|
|
6
57
|
end
|
|
7
|
-
function
|
|
58
|
+
--- Helper function to register a custom pickup with the IsaacScript standard library. Use this
|
|
59
|
+
-- feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
|
|
60
|
+
--
|
|
61
|
+
-- When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
|
|
62
|
+
-- will be immediately removed, and an effect showing the pickup's respective `Collect` animation
|
|
63
|
+
-- will be spawned. (This emulates how a normal vanilla pickup would work.)
|
|
64
|
+
--
|
|
65
|
+
-- Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
|
|
66
|
+
-- of "5" and be associated with an anm2 file that has a "Collect" animation.
|
|
67
|
+
--
|
|
68
|
+
-- @param pickupVariantCustom The variant for the corresponding custom pickup.
|
|
69
|
+
-- @param subType The sub-type for the corresponding custom pickup.
|
|
70
|
+
-- @param collectFunc The function to run when the player collects this pickup.
|
|
71
|
+
-- @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
72
|
+
-- Default is a function that always returns true, meaning that the player will
|
|
73
|
+
-- always immediately collect the pickup when they collide with it. Specify
|
|
74
|
+
-- this function if your pickup should only be able to be collected under
|
|
75
|
+
-- certain conditions.
|
|
76
|
+
function ____exports.registerCustomPickup(self, pickupVariantCustom, subType, collectFunc, collisionFunc)
|
|
77
|
+
if collisionFunc == nil then
|
|
78
|
+
collisionFunc = function() return true end
|
|
79
|
+
end
|
|
8
80
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
81
|
+
local entityID = getEntityIDFromConstituents(nil, EntityType.PICKUP, pickupVariantCustom, subType)
|
|
82
|
+
local customPickupFunctions = {collectFunc = collectFunc, collisionFunc = collisionFunc}
|
|
83
|
+
customPickupFunctionsMap:set(entityID, customPickupFunctions)
|
|
9
84
|
end
|
|
10
85
|
return ____exports
|
|
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT,
|
|
5
|
+
local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT, BACKDROP_EFFECT_SUB_TYPE
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
8
8
|
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
@@ -42,7 +42,7 @@ function spawnWallEntity(self, customStage, rng, isExtraWall)
|
|
|
42
42
|
local wallEffect = spawnEffectWithSeed(
|
|
43
43
|
nil,
|
|
44
44
|
BACKDROP_EFFECT_VARIANT,
|
|
45
|
-
|
|
45
|
+
BACKDROP_EFFECT_SUB_TYPE,
|
|
46
46
|
VectorZero,
|
|
47
47
|
seed
|
|
48
48
|
)
|
|
@@ -181,7 +181,7 @@ WALL_OFFSET = Vector(-80, -80)
|
|
|
181
181
|
L_FLOOR_ANM2_LAYERS = {16, 17}
|
|
182
182
|
N_FLOOR_ANM2_LAYERS = {18, 19}
|
|
183
183
|
BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER
|
|
184
|
-
|
|
184
|
+
BACKDROP_EFFECT_SUB_TYPE = 101
|
|
185
185
|
local BACKDROP_ROOM_TYPE_SET = __TS__New(Set, {RoomType.DEFAULT, RoomType.BOSS, RoomType.MINI_BOSS})
|
|
186
186
|
function ____exports.setCustomStageBackdrop(self, customStage)
|
|
187
187
|
local room = game:GetRoom()
|
|
@@ -21,7 +21,7 @@ local v = ____v.default
|
|
|
21
21
|
-- We arbitrarily choose a ladder for this purpose because it will not automatically despawn after
|
|
22
22
|
-- time passes, like most other effects.
|
|
23
23
|
local SHADOW_EFFECT_VARIANT = EffectVariant.LADDER
|
|
24
|
-
local
|
|
24
|
+
local SHADOW_EFFECT_SUB_TYPE = 102
|
|
25
25
|
--- The animation comes from StageAPI.
|
|
26
26
|
local ROOM_SHAPE_TO_SHADOW_ANIMATION = {
|
|
27
27
|
[RoomShape.SHAPE_1x1] = "1x1",
|
|
@@ -54,7 +54,7 @@ function ____exports.setShadows(self, customStage)
|
|
|
54
54
|
local shadowEffect = spawnEffectWithSeed(
|
|
55
55
|
nil,
|
|
56
56
|
SHADOW_EFFECT_VARIANT,
|
|
57
|
-
|
|
57
|
+
SHADOW_EFFECT_SUB_TYPE,
|
|
58
58
|
centerPos,
|
|
59
59
|
seed
|
|
60
60
|
)
|
|
@@ -40,7 +40,7 @@ local ____gridEntities = require("functions.gridEntities")
|
|
|
40
40
|
local convertXMLGridEntityType = ____gridEntities.convertXMLGridEntityType
|
|
41
41
|
local getAllGridIndexes = ____gridEntities.getAllGridIndexes
|
|
42
42
|
local getGridEntities = ____gridEntities.getGridEntities
|
|
43
|
-
local
|
|
43
|
+
local removeAllGridEntitiesExcept = ____gridEntities.removeAllGridEntitiesExcept
|
|
44
44
|
local removeGridEntity = ____gridEntities.removeGridEntity
|
|
45
45
|
local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
|
|
46
46
|
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
@@ -157,7 +157,7 @@ function ____exports.emptyRoom(self, fillWithDecorations)
|
|
|
157
157
|
removeSpecificNPCs(nil)
|
|
158
158
|
removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.DEVIL)
|
|
159
159
|
removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.ANGEL)
|
|
160
|
-
|
|
160
|
+
removeAllGridEntitiesExcept(nil, GridEntityType.WALL, GridEntityType.DOOR)
|
|
161
161
|
setRoomCleared(nil)
|
|
162
162
|
if fillWithDecorations then
|
|
163
163
|
fillRoomWithDecorations(nil)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibleSet.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"collectibleSet.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAwD/D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,eAAe,EAAE,CAKhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,eAAe,CAAC,CAKhE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,SAAS,eAAe,EAAE,CAKtE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAAC,eAAe,CAAC,CAKtE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,SAAS,eAAe,EAAE,CAKvE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC,CAKvE"}
|
|
@@ -38,14 +38,14 @@ local function initCollectibleArraysAndSets(self)
|
|
|
38
38
|
::__continue4::
|
|
39
39
|
end
|
|
40
40
|
__TS__ArraySort(ALL_COLLECTIBLES_ARRAY)
|
|
41
|
-
__TS__ArraySort(VANILLA_COLLECTIBLES_ARRAY)
|
|
42
|
-
__TS__ArraySort(MODDED_COLLECTIBLES_ARRAY)
|
|
43
41
|
for ____, collectibleType in ipairs(ALL_COLLECTIBLES_ARRAY) do
|
|
44
42
|
ALL_COLLECTIBLES_SET:add(collectibleType)
|
|
45
43
|
end
|
|
44
|
+
__TS__ArraySort(VANILLA_COLLECTIBLES_ARRAY)
|
|
46
45
|
for ____, collectibleType in ipairs(VANILLA_COLLECTIBLES_ARRAY) do
|
|
47
46
|
VANILLA_COLLECTIBLES_SET:add(collectibleType)
|
|
48
47
|
end
|
|
48
|
+
__TS__ArraySort(MODDED_COLLECTIBLES_ARRAY)
|
|
49
49
|
for ____, collectibleType in ipairs(MODDED_COLLECTIBLES_ARRAY) do
|
|
50
50
|
MODDED_COLLECTIBLES_SET:add(collectibleType)
|
|
51
51
|
end
|
|
@@ -122,7 +122,7 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
122
122
|
* For example:
|
|
123
123
|
*
|
|
124
124
|
* ```ts
|
|
125
|
-
*
|
|
125
|
+
* removeAllGridEntitiesExcept(
|
|
126
126
|
* GridEntityType.WALL,
|
|
127
127
|
* GridEntityType.DOOR,
|
|
128
128
|
* );
|
|
@@ -130,7 +130,7 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
130
130
|
*
|
|
131
131
|
* @returns The grid entities that were removed.
|
|
132
132
|
*/
|
|
133
|
-
export declare function
|
|
133
|
+
export declare function removeAllGridEntitiesExcept(...gridEntityTypes: GridEntityType[]): GridEntity[];
|
|
134
134
|
/**
|
|
135
135
|
* Helper function to remove all of the grid entities in the room that match the grid entity types
|
|
136
136
|
* provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,cAAc,EACd,iBAAiB,EAGjB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgCvD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,GAAG,GACxB,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,CAqBnC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,EAAE,CAKzC;AAED;;;;;;GA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AAG,IAAI,CAGnE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,GAAG,GAAG,IAAI,CA4B1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAExB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAgCxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAkBtE"}
|
|
@@ -370,14 +370,14 @@ end
|
|
|
370
370
|
-- For example:
|
|
371
371
|
--
|
|
372
372
|
-- ```ts
|
|
373
|
-
--
|
|
373
|
+
-- removeAllGridEntitiesExcept(
|
|
374
374
|
-- GridEntityType.WALL,
|
|
375
375
|
-- GridEntityType.DOOR,
|
|
376
376
|
-- );
|
|
377
377
|
-- ```
|
|
378
378
|
--
|
|
379
379
|
-- @returns The grid entities that were removed.
|
|
380
|
-
function ____exports.
|
|
380
|
+
function ____exports.removeAllGridEntitiesExcept(self, ...)
|
|
381
381
|
local gridEntityTypes = {...}
|
|
382
382
|
local gridEntityTypeExceptions = __TS__New(Set, gridEntityTypes)
|
|
383
383
|
local gridEntities = ____exports.getGridEntities(nil)
|
package/dist/functions/npcs.lua
CHANGED
|
@@ -3,7 +3,7 @@ local Set = ____lualib.Set
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
5
|
local ____exports = {}
|
|
6
|
-
local NON_ALIVE_NPCS_TYPE_VARIANT,
|
|
6
|
+
local NON_ALIVE_NPCS_TYPE_VARIANT, NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local BegottenVariant = ____isaac_2Dtypescript_2Ddefinitions.BegottenVariant
|
|
9
9
|
local BigHornVariant = ____isaac_2Dtypescript_2Ddefinitions.BigHornVariant
|
|
@@ -34,7 +34,7 @@ function ____exports.isAliveExceptionNPC(self, npc)
|
|
|
34
34
|
return true
|
|
35
35
|
end
|
|
36
36
|
local entityTypeVariantSubType = (((tostring(npc.Type) .. ".") .. tostring(npc.Variant)) .. ".") .. tostring(npc.SubType)
|
|
37
|
-
if
|
|
37
|
+
if NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE:has(entityTypeVariantSubType) then
|
|
38
38
|
return true
|
|
39
39
|
end
|
|
40
40
|
if ____exports.isDyingEggyWithNoSpidersLeft(nil, npc) then
|
|
@@ -86,7 +86,7 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
|
86
86
|
(tostring(EntityType.DARK_ESAU) .. ".") .. tostring(DarkEsauVariant.PIT)
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
|
-
|
|
89
|
+
NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE = __TS__New(
|
|
90
90
|
Set,
|
|
91
91
|
{
|
|
92
92
|
(((tostring(EntityType.CHARGER) .. ".") .. tostring(ChargerVariant.CHARGER)) .. ".") .. tostring(ChargerSubType.MY_SHADOW),
|
|
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____coinSubTypeToValue = require("objects.coinSubTypeToValue")
|
|
5
|
-
local
|
|
5
|
+
local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
|
|
6
6
|
local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
|
|
7
7
|
local ____chestPickupVariantsSet = require("sets.chestPickupVariantsSet")
|
|
8
8
|
local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
|
|
@@ -17,7 +17,7 @@ local isHeart = ____pickupVariants.isHeart
|
|
|
17
17
|
--- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
18
18
|
-- sub-types.
|
|
19
19
|
function ____exports.getCoinValue(self, coinSubType)
|
|
20
|
-
local value =
|
|
20
|
+
local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
|
|
21
21
|
return value == nil and DEFAULT_COIN_VALUE or value
|
|
22
22
|
end
|
|
23
23
|
--- Helper function to get all of the red heart pickup entities in the room.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TrinketType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array containing every valid trinket type in the game, including modded trinkets.
|
|
4
|
+
*
|
|
5
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
6
|
+
* use the `getTrinketSet` helper function instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getModdedTrinketArray(): readonly TrinketType[];
|
|
9
|
+
/**
|
|
10
|
+
* Returns a set containing every valid trinket type in the game, including modded trinkets.
|
|
11
|
+
*
|
|
12
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
13
|
+
* use the `getTrinketArray` helper function instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getModdedTrinketSet(): ReadonlySet<TrinketType>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns an array containing every modded trinket type in the game.
|
|
18
|
+
*
|
|
19
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
20
|
+
* use the `getModdedTrinketSet` helper function instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getTrinketArray(): readonly TrinketType[];
|
|
23
|
+
/**
|
|
24
|
+
* Returns a set containing every modded trinket type in the game.
|
|
25
|
+
*
|
|
26
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
27
|
+
* use the `getModdedTrinketArray` helper function instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getTrinketSet(): ReadonlySet<TrinketType>;
|
|
30
|
+
/**
|
|
31
|
+
* Returns an array containing every valid vanilla trinket type in the game.
|
|
32
|
+
*
|
|
33
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
34
|
+
* use the `getVanillaTrinketSet` helper function instead.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getVanillaTrinketArray(): readonly TrinketType[];
|
|
37
|
+
/**
|
|
38
|
+
* Returns a set containing every valid vanilla trinket type in the game.
|
|
39
|
+
*
|
|
40
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
41
|
+
* use the `getVanillaTrinketArray` helper function instead.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getVanillaTrinketSet(): ReadonlySet<TrinketType>;
|
|
44
|
+
//# sourceMappingURL=trinketSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trinketSet.d.ts","sourceRoot":"","sources":["../../src/functions/trinketSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAwD3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,SAAS,WAAW,EAAE,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,WAAW,CAAC,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,SAAS,WAAW,EAAE,CAKxD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,WAAW,CAAC,WAAW,CAAC,CAKxD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,WAAW,EAAE,CAK/D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,WAAW,CAAC,CAK/D"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local ____cachedClasses = require("core.cachedClasses")
|
|
7
|
+
local itemConfig = ____cachedClasses.itemConfig
|
|
8
|
+
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
9
|
+
local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
|
|
10
|
+
local LAST_TRINKET_TYPE = ____constantsFirstLast.LAST_TRINKET_TYPE
|
|
11
|
+
local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
|
|
12
|
+
local ____utils = require("functions.utils")
|
|
13
|
+
local irange = ____utils.irange
|
|
14
|
+
local ALL_TRINKETS_ARRAY = {}
|
|
15
|
+
local VANILLA_TRINKETS_ARRAY = {}
|
|
16
|
+
local MODDED_TRINKETS_ARRAY = {}
|
|
17
|
+
local ALL_TRINKETS_SET = __TS__New(Set)
|
|
18
|
+
local VANILLA_TRINKETS_SET = __TS__New(Set)
|
|
19
|
+
local MODDED_TRINKETS_SET = __TS__New(Set)
|
|
20
|
+
local function initTrinketArraysAndSets(self)
|
|
21
|
+
if #ALL_TRINKETS_ARRAY ~= 0 then
|
|
22
|
+
return
|
|
23
|
+
end
|
|
24
|
+
local trinketTypeRange = irange(nil, FIRST_TRINKET_TYPE, LAST_TRINKET_TYPE)
|
|
25
|
+
for ____, trinketType in ipairs(trinketTypeRange) do
|
|
26
|
+
do
|
|
27
|
+
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
28
|
+
if itemConfigItem == nil then
|
|
29
|
+
goto __continue4
|
|
30
|
+
end
|
|
31
|
+
ALL_TRINKETS_ARRAY[#ALL_TRINKETS_ARRAY + 1] = trinketType
|
|
32
|
+
if trinketType <= LAST_VANILLA_TRINKET_TYPE then
|
|
33
|
+
VANILLA_TRINKETS_ARRAY[#VANILLA_TRINKETS_ARRAY + 1] = trinketType
|
|
34
|
+
else
|
|
35
|
+
MODDED_TRINKETS_ARRAY[#MODDED_TRINKETS_ARRAY + 1] = trinketType
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
::__continue4::
|
|
39
|
+
end
|
|
40
|
+
__TS__ArraySort(ALL_TRINKETS_ARRAY)
|
|
41
|
+
for ____, trinketType in ipairs(ALL_TRINKETS_ARRAY) do
|
|
42
|
+
ALL_TRINKETS_SET:add(trinketType)
|
|
43
|
+
end
|
|
44
|
+
__TS__ArraySort(VANILLA_TRINKETS_ARRAY)
|
|
45
|
+
for ____, trinketType in ipairs(VANILLA_TRINKETS_ARRAY) do
|
|
46
|
+
VANILLA_TRINKETS_SET:add(trinketType)
|
|
47
|
+
end
|
|
48
|
+
__TS__ArraySort(MODDED_TRINKETS_ARRAY)
|
|
49
|
+
for ____, trinketType in ipairs(MODDED_TRINKETS_ARRAY) do
|
|
50
|
+
MODDED_TRINKETS_SET:add(trinketType)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
--- Returns an array containing every valid trinket type in the game, including modded trinkets.
|
|
54
|
+
--
|
|
55
|
+
-- Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
56
|
+
-- use the `getTrinketSet` helper function instead.
|
|
57
|
+
function ____exports.getModdedTrinketArray(self)
|
|
58
|
+
initTrinketArraysAndSets(nil)
|
|
59
|
+
return MODDED_TRINKETS_ARRAY
|
|
60
|
+
end
|
|
61
|
+
--- Returns a set containing every valid trinket type in the game, including modded trinkets.
|
|
62
|
+
--
|
|
63
|
+
-- Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
64
|
+
-- use the `getTrinketArray` helper function instead.
|
|
65
|
+
function ____exports.getModdedTrinketSet(self)
|
|
66
|
+
initTrinketArraysAndSets(nil)
|
|
67
|
+
return MODDED_TRINKETS_SET
|
|
68
|
+
end
|
|
69
|
+
--- Returns an array containing every modded trinket type in the game.
|
|
70
|
+
--
|
|
71
|
+
-- Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
72
|
+
-- use the `getModdedTrinketSet` helper function instead.
|
|
73
|
+
function ____exports.getTrinketArray(self)
|
|
74
|
+
initTrinketArraysAndSets(nil)
|
|
75
|
+
return ALL_TRINKETS_ARRAY
|
|
76
|
+
end
|
|
77
|
+
--- Returns a set containing every modded trinket type in the game.
|
|
78
|
+
--
|
|
79
|
+
-- Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
80
|
+
-- use the `getModdedTrinketArray` helper function instead.
|
|
81
|
+
function ____exports.getTrinketSet(self)
|
|
82
|
+
initTrinketArraysAndSets(nil)
|
|
83
|
+
return ALL_TRINKETS_SET
|
|
84
|
+
end
|
|
85
|
+
--- Returns an array containing every valid vanilla trinket type in the game.
|
|
86
|
+
--
|
|
87
|
+
-- Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
88
|
+
-- use the `getVanillaTrinketSet` helper function instead.
|
|
89
|
+
function ____exports.getVanillaTrinketArray(self)
|
|
90
|
+
initTrinketArraysAndSets(nil)
|
|
91
|
+
return VANILLA_TRINKETS_ARRAY
|
|
92
|
+
end
|
|
93
|
+
--- Returns a set containing every valid vanilla trinket type in the game.
|
|
94
|
+
--
|
|
95
|
+
-- Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
96
|
+
-- use the `getVanillaTrinketArray` helper function instead.
|
|
97
|
+
function ____exports.getVanillaTrinketSet(self)
|
|
98
|
+
initTrinketArraysAndSets(nil)
|
|
99
|
+
return VANILLA_TRINKETS_SET
|
|
100
|
+
end
|
|
101
|
+
return ____exports
|
package/dist/index.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export * from "./functions/transformations";
|
|
|
140
140
|
export * from "./functions/trinketCacheFlag";
|
|
141
141
|
export * from "./functions/trinketGive";
|
|
142
142
|
export * from "./functions/trinkets";
|
|
143
|
+
export * from "./functions/trinketSet";
|
|
143
144
|
export * from "./functions/tstlClass";
|
|
144
145
|
export * from "./functions/types";
|
|
145
146
|
export * from "./functions/ui";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,SAAS,GACV,MAAM,2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,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC"}
|
package/dist/index.lua
CHANGED
|
@@ -1111,6 +1111,14 @@ do
|
|
|
1111
1111
|
end
|
|
1112
1112
|
end
|
|
1113
1113
|
end
|
|
1114
|
+
do
|
|
1115
|
+
local ____export = require("functions.trinketSet")
|
|
1116
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
1117
|
+
if ____exportKey ~= "default" then
|
|
1118
|
+
____exports[____exportKey] = ____exportValue
|
|
1119
|
+
end
|
|
1120
|
+
end
|
|
1121
|
+
end
|
|
1114
1122
|
do
|
|
1115
1123
|
local ____export = require("functions.tstlClass")
|
|
1116
1124
|
for ____exportKey, ____exportValue in pairs(____export) do
|
package/dist/initFeatures.lua
CHANGED
|
@@ -65,7 +65,7 @@ function initFeaturesMajor(self, mod)
|
|
|
65
65
|
customGridEntityInit(nil, mod)
|
|
66
66
|
end
|
|
67
67
|
function initFeaturesMinor(self, mod)
|
|
68
|
-
customPickupInit(nil)
|
|
68
|
+
customPickupInit(nil, mod)
|
|
69
69
|
customTrapdoorInit(nil, mod)
|
|
70
70
|
disableAllSoundInit(nil, mod)
|
|
71
71
|
disableInputsInit(nil, mod)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CoinSubType } from "isaac-typescript-definitions";
|
|
2
2
|
export declare const DEFAULT_COIN_VALUE = 1;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const COIN_SUB_TYPE_TO_VALUE: {
|
|
4
4
|
readonly [key in CoinSubType]: int;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=coinSubTypeToValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinSubTypeToValue.d.ts","sourceRoot":"","sources":["../../src/objects/coinSubTypeToValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"coinSubTypeToValue.d.ts","sourceRoot":"","sources":["../../src/objects/coinSubTypeToValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,eAAO,MAAM,sBAAsB,EAAE;IAAE,QAAQ,EAAE,GAAG,IAAI,WAAW,GAAG,GAAG;CAS/D,CAAC"}
|
|
@@ -2,7 +2,7 @@ local ____exports = {}
|
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
|
|
4
4
|
____exports.DEFAULT_COIN_VALUE = 1
|
|
5
|
-
____exports.
|
|
5
|
+
____exports.COIN_SUB_TYPE_TO_VALUE = {
|
|
6
6
|
[CoinSubType.NULL] = 0,
|
|
7
7
|
[CoinSubType.PENNY] = 1,
|
|
8
8
|
[CoinSubType.NICKEL] = 5,
|
package/package.json
CHANGED
|
@@ -1,9 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EffectVariant,
|
|
3
|
+
EntityType,
|
|
4
|
+
ModCallback,
|
|
5
|
+
PickupVariant,
|
|
6
|
+
} from "isaac-typescript-definitions";
|
|
1
7
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
8
|
+
import {
|
|
9
|
+
getEntityID,
|
|
10
|
+
getEntityIDFromConstituents,
|
|
11
|
+
} from "../functions/entities";
|
|
12
|
+
import { spawnEffect } from "../functions/entitiesSpecific";
|
|
2
13
|
|
|
3
14
|
const FEATURE_NAME = "customPickup";
|
|
4
15
|
|
|
5
|
-
|
|
16
|
+
interface CustomPickupFunctions {
|
|
17
|
+
collectFunc: (player: EntityPlayer) => void;
|
|
18
|
+
collisionFunc: (player: EntityPlayer) => boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Normally, we would make a custom entity to represent a fading-away pickup, but we don't want to
|
|
23
|
+
* interfere with the "entities2.xml" file in end-user mods. Thus, we must select a vanilla effect
|
|
24
|
+
* to masquerade as a backdrop effect.
|
|
25
|
+
*
|
|
26
|
+
* We arbitrarily choose a ladder for this purpose because it will not automatically despawn after
|
|
27
|
+
* time passes, like most other effects.
|
|
28
|
+
*/
|
|
29
|
+
const PICKUP_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
30
|
+
const PICKUP_EFFECT_SUB_TYPE = 103;
|
|
31
|
+
|
|
32
|
+
/** Indexed by entity ID. */
|
|
33
|
+
const customPickupFunctionsMap = new Map<string, CustomPickupFunctions>();
|
|
34
|
+
|
|
35
|
+
export function customPickupInit(mod: Mod): void {
|
|
36
|
+
mod.AddCallback(ModCallback.PRE_PICKUP_COLLISION, prePickupCollision); // 38
|
|
37
|
+
mod.AddCallback(
|
|
38
|
+
ModCallback.POST_EFFECT_RENDER,
|
|
39
|
+
postEffectRenderPickupEffect,
|
|
40
|
+
PICKUP_EFFECT_VARIANT,
|
|
41
|
+
); // 56
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ModCallback.PRE_PICKUP_COLLISION (38)
|
|
45
|
+
function prePickupCollision(
|
|
46
|
+
pickup: EntityPickup,
|
|
47
|
+
collider: Entity,
|
|
48
|
+
): boolean | undefined {
|
|
49
|
+
const entityID = getEntityID(pickup);
|
|
50
|
+
const customPickupFunctions = customPickupFunctionsMap.get(entityID);
|
|
51
|
+
if (customPickupFunctions === undefined) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const player = collider.ToPlayer();
|
|
56
|
+
if (player === undefined) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const shouldPickup = customPickupFunctions.collisionFunc(player);
|
|
61
|
+
if (!shouldPickup) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
pickup.Remove();
|
|
6
66
|
|
|
7
|
-
|
|
67
|
+
const pickupSprite = pickup.GetSprite();
|
|
68
|
+
const fileName = pickupSprite.GetFilename();
|
|
69
|
+
|
|
70
|
+
const effect = spawnEffect(
|
|
71
|
+
PICKUP_EFFECT_VARIANT,
|
|
72
|
+
PICKUP_EFFECT_SUB_TYPE,
|
|
73
|
+
pickup.Position,
|
|
74
|
+
);
|
|
75
|
+
const effectSprite = effect.GetSprite();
|
|
76
|
+
effectSprite.Load(fileName, true);
|
|
77
|
+
effectSprite.Play("Collect", true);
|
|
78
|
+
|
|
79
|
+
customPickupFunctions.collectFunc(player);
|
|
80
|
+
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ModCallback.POST_EFFECT_RENDER (56)
|
|
85
|
+
// PICKUP_EFFECT_VARIANT
|
|
86
|
+
function postEffectRenderPickupEffect(effect: EntityEffect) {
|
|
87
|
+
if (effect.SubType !== PICKUP_EFFECT_SUB_TYPE) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const sprite = effect.GetSprite();
|
|
92
|
+
if (sprite.IsFinished("Collect")) {
|
|
93
|
+
effect.Remove();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to register a custom pickup with the IsaacScript standard library. Use this
|
|
99
|
+
* feature for custom pickups that are intended to be picked up by the player, like keys and bombs.
|
|
100
|
+
*
|
|
101
|
+
* When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
|
|
102
|
+
* will be immediately removed, and an effect showing the pickup's respective `Collect` animation
|
|
103
|
+
* will be spawned. (This emulates how a normal vanilla pickup would work.)
|
|
104
|
+
*
|
|
105
|
+
* Note that when you specify your custom pickup in the "entities2.xml" file, it should have a type
|
|
106
|
+
* of "5" and be associated with an anm2 file that has a "Collect" animation.
|
|
107
|
+
*
|
|
108
|
+
* @param pickupVariantCustom The variant for the corresponding custom pickup.
|
|
109
|
+
* @param subType The sub-type for the corresponding custom pickup.
|
|
110
|
+
* @param collectFunc The function to run when the player collects this pickup.
|
|
111
|
+
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
|
|
112
|
+
* Default is a function that always returns true, meaning that the player will
|
|
113
|
+
* always immediately collect the pickup when they collide with it. Specify
|
|
114
|
+
* this function if your pickup should only be able to be collected under
|
|
115
|
+
* certain conditions.
|
|
116
|
+
*/
|
|
117
|
+
export function registerCustomPickup(
|
|
118
|
+
pickupVariantCustom: PickupVariant,
|
|
119
|
+
subType: int,
|
|
120
|
+
collectFunc: (player: EntityPlayer) => void,
|
|
121
|
+
collisionFunc: (player: EntityPlayer) => boolean = () => true,
|
|
122
|
+
): void {
|
|
8
123
|
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
124
|
+
|
|
125
|
+
const entityID = getEntityIDFromConstituents(
|
|
126
|
+
EntityType.PICKUP,
|
|
127
|
+
pickupVariantCustom,
|
|
128
|
+
subType,
|
|
129
|
+
);
|
|
130
|
+
const customPickupFunctions: CustomPickupFunctions = {
|
|
131
|
+
collectFunc,
|
|
132
|
+
collisionFunc,
|
|
133
|
+
};
|
|
134
|
+
customPickupFunctionsMap.set(entityID, customPickupFunctions);
|
|
9
135
|
}
|
|
@@ -83,7 +83,7 @@ const N_FLOOR_ANM2_LAYERS: readonly int[] = [18, 19];
|
|
|
83
83
|
* time passes, like most other effects.
|
|
84
84
|
*/
|
|
85
85
|
const BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
86
|
-
const
|
|
86
|
+
const BACKDROP_EFFECT_SUB_TYPE = 101;
|
|
87
87
|
|
|
88
88
|
const BACKDROP_ROOM_TYPE_SET: ReadonlySet<RoomType> = new Set([
|
|
89
89
|
RoomType.DEFAULT,
|
|
@@ -135,7 +135,7 @@ function spawnWallEntity(
|
|
|
135
135
|
const seed = 1 as Seed;
|
|
136
136
|
const wallEffect = spawnEffectWithSeed(
|
|
137
137
|
BACKDROP_EFFECT_VARIANT,
|
|
138
|
-
|
|
138
|
+
BACKDROP_EFFECT_SUB_TYPE,
|
|
139
139
|
VectorZero,
|
|
140
140
|
seed,
|
|
141
141
|
);
|
|
@@ -18,7 +18,7 @@ type ShadowAnimation = "1x1" | "1x2" | "2x1" | "2x2";
|
|
|
18
18
|
* time passes, like most other effects.
|
|
19
19
|
*/
|
|
20
20
|
const SHADOW_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
21
|
-
const
|
|
21
|
+
const SHADOW_EFFECT_SUB_TYPE = 102;
|
|
22
22
|
|
|
23
23
|
/** The animation comes from StageAPI. */
|
|
24
24
|
const ROOM_SHAPE_TO_SHADOW_ANIMATION: {
|
|
@@ -60,7 +60,7 @@ export function setShadows(customStage: CustomStage): void {
|
|
|
60
60
|
const seed = 1 as Seed;
|
|
61
61
|
const shadowEffect = spawnEffectWithSeed(
|
|
62
62
|
SHADOW_EFFECT_VARIANT,
|
|
63
|
-
|
|
63
|
+
SHADOW_EFFECT_SUB_TYPE,
|
|
64
64
|
centerPos,
|
|
65
65
|
seed,
|
|
66
66
|
);
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
convertXMLGridEntityType,
|
|
41
41
|
getAllGridIndexes,
|
|
42
42
|
getGridEntities,
|
|
43
|
-
|
|
43
|
+
removeAllGridEntitiesExcept,
|
|
44
44
|
removeGridEntity,
|
|
45
45
|
setGridEntityInvisible,
|
|
46
46
|
spawnGridEntityWithVariant,
|
|
@@ -341,7 +341,7 @@ export function emptyRoom(fillWithDecorations: boolean): void {
|
|
|
341
341
|
removeAllMatchingEntities(EntityType.EFFECT, EffectVariant.DEVIL);
|
|
342
342
|
removeAllMatchingEntities(EntityType.EFFECT, EffectVariant.ANGEL);
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
removeAllGridEntitiesExcept(
|
|
345
345
|
GridEntityType.WALL, // 15
|
|
346
346
|
GridEntityType.DOOR, // 16
|
|
347
347
|
);
|
|
@@ -39,15 +39,16 @@ function initCollectibleArraysAndSets() {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
ALL_COLLECTIBLES_ARRAY.sort();
|
|
42
|
-
VANILLA_COLLECTIBLES_ARRAY.sort();
|
|
43
|
-
MODDED_COLLECTIBLES_ARRAY.sort();
|
|
44
|
-
|
|
45
42
|
for (const collectibleType of ALL_COLLECTIBLES_ARRAY) {
|
|
46
43
|
ALL_COLLECTIBLES_SET.add(collectibleType);
|
|
47
44
|
}
|
|
45
|
+
|
|
46
|
+
VANILLA_COLLECTIBLES_ARRAY.sort();
|
|
48
47
|
for (const collectibleType of VANILLA_COLLECTIBLES_ARRAY) {
|
|
49
48
|
VANILLA_COLLECTIBLES_SET.add(collectibleType);
|
|
50
49
|
}
|
|
50
|
+
|
|
51
|
+
MODDED_COLLECTIBLES_ARRAY.sort();
|
|
51
52
|
for (const collectibleType of MODDED_COLLECTIBLES_ARRAY) {
|
|
52
53
|
MODDED_COLLECTIBLES_SET.add(collectibleType);
|
|
53
54
|
}
|
|
@@ -395,7 +395,7 @@ export function isPostBossVoidPortal(gridEntity: GridEntity): boolean {
|
|
|
395
395
|
* For example:
|
|
396
396
|
*
|
|
397
397
|
* ```ts
|
|
398
|
-
*
|
|
398
|
+
* removeAllGridEntitiesExcept(
|
|
399
399
|
* GridEntityType.WALL,
|
|
400
400
|
* GridEntityType.DOOR,
|
|
401
401
|
* );
|
|
@@ -403,7 +403,7 @@ export function isPostBossVoidPortal(gridEntity: GridEntity): boolean {
|
|
|
403
403
|
*
|
|
404
404
|
* @returns The grid entities that were removed.
|
|
405
405
|
*/
|
|
406
|
-
export function
|
|
406
|
+
export function removeAllGridEntitiesExcept(
|
|
407
407
|
...gridEntityTypes: GridEntityType[]
|
|
408
408
|
): GridEntity[] {
|
|
409
409
|
const gridEntityTypeExceptions = new Set(gridEntityTypes);
|
package/src/functions/npcs.ts
CHANGED
|
@@ -41,7 +41,7 @@ const NON_ALIVE_NPCS_TYPE_VARIANT: ReadonlySet<string> = new Set([
|
|
|
41
41
|
* Used to filter out certain NPCs when determining of an NPC is "alive" and/or should keep the
|
|
42
42
|
* doors open.
|
|
43
43
|
*/
|
|
44
|
-
const
|
|
44
|
+
const NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE: ReadonlySet<string> = new Set([
|
|
45
45
|
`${EntityType.CHARGER}.${ChargerVariant.CHARGER}.${ChargerSubType.MY_SHADOW}`, // 23.0.1
|
|
46
46
|
`${EntityType.MOTHER}.${MotherVariant.MOTHER_1}.${MotherSubType.PHASE_2}`, // 912
|
|
47
47
|
]);
|
|
@@ -81,7 +81,7 @@ export function isAliveExceptionNPC(npc: EntityNPC): boolean {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const entityTypeVariantSubType = `${npc.Type}.${npc.Variant}.${npc.SubType}`;
|
|
84
|
-
if (
|
|
84
|
+
if (NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE.has(entityTypeVariantSubType)) {
|
|
85
85
|
return true;
|
|
86
86
|
}
|
|
87
87
|
|
package/src/functions/pickups.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CoinSubType } from "isaac-typescript-definitions";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
COIN_SUB_TYPE_TO_VALUE,
|
|
4
4
|
DEFAULT_COIN_VALUE,
|
|
5
5
|
} from "../objects/coinSubTypeToValue";
|
|
6
6
|
import { CHEST_PICKUP_VARIANTS } from "../sets/chestPickupVariantsSet";
|
|
@@ -14,7 +14,7 @@ import { isHeart } from "./pickupVariants";
|
|
|
14
14
|
* sub-types.
|
|
15
15
|
*/
|
|
16
16
|
export function getCoinValue(coinSubType: CoinSubType): int {
|
|
17
|
-
const value =
|
|
17
|
+
const value = COIN_SUB_TYPE_TO_VALUE[coinSubType];
|
|
18
18
|
// Handle modded coin sub-types.
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
20
20
|
return value === undefined ? DEFAULT_COIN_VALUE : value;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { TrinketType } from "isaac-typescript-definitions";
|
|
2
|
+
import { itemConfig } from "../core/cachedClasses";
|
|
3
|
+
import {
|
|
4
|
+
FIRST_TRINKET_TYPE,
|
|
5
|
+
LAST_TRINKET_TYPE,
|
|
6
|
+
LAST_VANILLA_TRINKET_TYPE,
|
|
7
|
+
} from "../core/constantsFirstLast";
|
|
8
|
+
import { irange } from "./utils";
|
|
9
|
+
|
|
10
|
+
const ALL_TRINKETS_ARRAY: TrinketType[] = [];
|
|
11
|
+
const VANILLA_TRINKETS_ARRAY: TrinketType[] = [];
|
|
12
|
+
const MODDED_TRINKETS_ARRAY: TrinketType[] = [];
|
|
13
|
+
|
|
14
|
+
const ALL_TRINKETS_SET = new Set<TrinketType>();
|
|
15
|
+
const VANILLA_TRINKETS_SET = new Set<TrinketType>();
|
|
16
|
+
const MODDED_TRINKETS_SET = new Set<TrinketType>();
|
|
17
|
+
|
|
18
|
+
function initTrinketArraysAndSets() {
|
|
19
|
+
if (ALL_TRINKETS_ARRAY.length !== 0) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const trinketTypeRange = irange(
|
|
24
|
+
FIRST_TRINKET_TYPE,
|
|
25
|
+
LAST_TRINKET_TYPE,
|
|
26
|
+
) as TrinketType[];
|
|
27
|
+
for (const trinketType of trinketTypeRange) {
|
|
28
|
+
const itemConfigItem = itemConfig.GetTrinket(trinketType);
|
|
29
|
+
if (itemConfigItem === undefined) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ALL_TRINKETS_ARRAY.push(trinketType);
|
|
34
|
+
if (trinketType <= LAST_VANILLA_TRINKET_TYPE) {
|
|
35
|
+
VANILLA_TRINKETS_ARRAY.push(trinketType);
|
|
36
|
+
} else {
|
|
37
|
+
MODDED_TRINKETS_ARRAY.push(trinketType);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ALL_TRINKETS_ARRAY.sort();
|
|
42
|
+
for (const trinketType of ALL_TRINKETS_ARRAY) {
|
|
43
|
+
ALL_TRINKETS_SET.add(trinketType);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
VANILLA_TRINKETS_ARRAY.sort();
|
|
47
|
+
for (const trinketType of VANILLA_TRINKETS_ARRAY) {
|
|
48
|
+
VANILLA_TRINKETS_SET.add(trinketType);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
MODDED_TRINKETS_ARRAY.sort();
|
|
52
|
+
for (const trinketType of MODDED_TRINKETS_ARRAY) {
|
|
53
|
+
MODDED_TRINKETS_SET.add(trinketType);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns an array containing every valid trinket type in the game, including modded trinkets.
|
|
59
|
+
*
|
|
60
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
61
|
+
* use the `getTrinketSet` helper function instead.
|
|
62
|
+
*/
|
|
63
|
+
export function getModdedTrinketArray(): readonly TrinketType[] {
|
|
64
|
+
// Lazy initialize the arrays/sets.
|
|
65
|
+
initTrinketArraysAndSets();
|
|
66
|
+
|
|
67
|
+
return MODDED_TRINKETS_ARRAY;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns a set containing every valid trinket type in the game, including modded trinkets.
|
|
72
|
+
*
|
|
73
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
74
|
+
* use the `getTrinketArray` helper function instead.
|
|
75
|
+
*/
|
|
76
|
+
export function getModdedTrinketSet(): ReadonlySet<TrinketType> {
|
|
77
|
+
// Lazy initialize the arrays/sets.
|
|
78
|
+
initTrinketArraysAndSets();
|
|
79
|
+
|
|
80
|
+
return MODDED_TRINKETS_SET;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Returns an array containing every modded trinket type in the game.
|
|
85
|
+
*
|
|
86
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
87
|
+
* use the `getModdedTrinketSet` helper function instead.
|
|
88
|
+
*/
|
|
89
|
+
export function getTrinketArray(): readonly TrinketType[] {
|
|
90
|
+
// Lazy initialize the arrays/sets.
|
|
91
|
+
initTrinketArraysAndSets();
|
|
92
|
+
|
|
93
|
+
return ALL_TRINKETS_ARRAY;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns a set containing every modded trinket type in the game.
|
|
98
|
+
*
|
|
99
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
100
|
+
* use the `getModdedTrinketArray` helper function instead.
|
|
101
|
+
*/
|
|
102
|
+
export function getTrinketSet(): ReadonlySet<TrinketType> {
|
|
103
|
+
// Lazy initialize the arrays/sets.
|
|
104
|
+
initTrinketArraysAndSets();
|
|
105
|
+
|
|
106
|
+
return ALL_TRINKETS_SET;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns an array containing every valid vanilla trinket type in the game.
|
|
111
|
+
*
|
|
112
|
+
* Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
|
|
113
|
+
* use the `getVanillaTrinketSet` helper function instead.
|
|
114
|
+
*/
|
|
115
|
+
export function getVanillaTrinketArray(): readonly TrinketType[] {
|
|
116
|
+
// Lazy initialize the arrays/sets.
|
|
117
|
+
initTrinketArraysAndSets();
|
|
118
|
+
|
|
119
|
+
return VANILLA_TRINKETS_ARRAY;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns a set containing every valid vanilla trinket type in the game.
|
|
124
|
+
*
|
|
125
|
+
* Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
|
|
126
|
+
* use the `getVanillaTrinketArray` helper function instead.
|
|
127
|
+
*/
|
|
128
|
+
export function getVanillaTrinketSet(): ReadonlySet<TrinketType> {
|
|
129
|
+
// Lazy initialize the arrays/sets.
|
|
130
|
+
initTrinketArraysAndSets();
|
|
131
|
+
|
|
132
|
+
return VANILLA_TRINKETS_SET;
|
|
133
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -176,6 +176,7 @@ export * from "./functions/transformations";
|
|
|
176
176
|
export * from "./functions/trinketCacheFlag";
|
|
177
177
|
export * from "./functions/trinketGive";
|
|
178
178
|
export * from "./functions/trinkets";
|
|
179
|
+
export * from "./functions/trinketSet";
|
|
179
180
|
export * from "./functions/tstlClass";
|
|
180
181
|
export * from "./functions/types";
|
|
181
182
|
export * from "./functions/ui";
|
package/src/initFeatures.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CoinSubType } from "isaac-typescript-definitions";
|
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_COIN_VALUE = 1;
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const COIN_SUB_TYPE_TO_VALUE: { readonly [key in CoinSubType]: int } = {
|
|
6
6
|
[CoinSubType.NULL]: 0, // 0
|
|
7
7
|
[CoinSubType.PENNY]: 1, // 1
|
|
8
8
|
[CoinSubType.NICKEL]: 5, // 2
|