isaacscript-common 28.7.1 → 29.1.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/index.rollup.d.ts +24 -8
- package/dist/isaacscript-common.lua +12 -2
- package/dist/src/classes/features/other/PersistentEntities.d.ts +5 -2
- package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
- package/dist/src/classes/features/other/PersistentEntities.lua +1 -1
- package/dist/src/functions/doors.d.ts +6 -3
- package/dist/src/functions/doors.d.ts.map +1 -1
- package/dist/src/functions/doors.lua +6 -3
- package/dist/src/functions/gridEntities.d.ts +4 -0
- package/dist/src/functions/gridEntities.d.ts.map +1 -1
- package/dist/src/functions/gridEntities.lua +4 -0
- package/dist/src/functions/stage.d.ts +7 -3
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +15 -3
- package/package.json +1 -1
- package/src/classes/features/other/PersistentEntities.ts +3 -3
- package/src/functions/doors.ts +6 -3
- package/src/functions/gridEntities.ts +4 -0
- package/src/functions/merge.ts +1 -1
- package/src/functions/stage.ts +17 -3
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4870,9 +4870,12 @@ export declare function getDirectionName(direction: Direction): string | undefin
|
|
|
4870
4870
|
export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector>;
|
|
4871
4871
|
|
|
4872
4872
|
/**
|
|
4873
|
-
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
4874
|
-
*
|
|
4875
|
-
* room types
|
|
4873
|
+
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
4874
|
+
*
|
|
4875
|
+
* You can optionally specify one or more room types to return only the doors that match the
|
|
4876
|
+
* specified room types.
|
|
4877
|
+
*
|
|
4878
|
+
* @allowEmptyVariadic
|
|
4876
4879
|
*/
|
|
4877
4880
|
export declare function getDoors(...roomTypes: RoomType[]): GridEntityDoor[];
|
|
4878
4881
|
|
|
@@ -5192,6 +5195,8 @@ export declare function getGotoCommand(roomType: RoomType, roomVariant: int, use
|
|
|
5192
5195
|
* GridEntityType.ROCK_TINTED,
|
|
5193
5196
|
* );
|
|
5194
5197
|
* ```
|
|
5198
|
+
*
|
|
5199
|
+
* @allowEmptyVariadic
|
|
5195
5200
|
*/
|
|
5196
5201
|
export declare function getGridEntities(...gridEntityTypes: GridEntityType[]): GridEntity[];
|
|
5197
5202
|
|
|
@@ -5212,6 +5217,8 @@ export declare function getGridEntitiesInRadius(targetPosition: Vector, radius:
|
|
|
5212
5217
|
*
|
|
5213
5218
|
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
5214
5219
|
* arguments to match specific grid entity types.
|
|
5220
|
+
*
|
|
5221
|
+
* @allowEmptyVariadic
|
|
5215
5222
|
*/
|
|
5216
5223
|
export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
|
|
5217
5224
|
|
|
@@ -12840,7 +12847,7 @@ export declare function onDarkRoom(): boolean;
|
|
|
12840
12847
|
export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
|
|
12841
12848
|
|
|
12842
12849
|
/**
|
|
12843
|
-
* Helper function to check if the current
|
|
12850
|
+
* Helper function to check if the current stage matches one of the given stages. This uses the
|
|
12844
12851
|
* `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
|
|
12845
12852
|
*
|
|
12846
12853
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
@@ -12881,14 +12888,20 @@ export declare function onSetSeed(): boolean;
|
|
|
12881
12888
|
export declare function onSheol(): boolean;
|
|
12882
12889
|
|
|
12883
12890
|
/**
|
|
12884
|
-
* Helper function to check if the current
|
|
12891
|
+
* Helper function to check if the current stage matches one of the given stages.
|
|
12885
12892
|
*
|
|
12886
12893
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
12887
12894
|
*/
|
|
12888
12895
|
export declare function onStage(...stages: LevelStage[]): boolean;
|
|
12889
12896
|
|
|
12897
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
12898
|
+
export declare function onStageOrHigher(stage: LevelStage): boolean;
|
|
12899
|
+
|
|
12900
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
12901
|
+
export declare function onStageOrLower(stage: LevelStage): boolean;
|
|
12902
|
+
|
|
12890
12903
|
/**
|
|
12891
|
-
* Helper function to check if the current
|
|
12904
|
+
* Helper function to check if the current stage matches one of the given stage types.
|
|
12892
12905
|
*
|
|
12893
12906
|
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
12894
12907
|
*/
|
|
@@ -13028,10 +13041,13 @@ declare class PersistentEntities extends Feature {
|
|
|
13028
13041
|
*
|
|
13029
13042
|
* In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
|
|
13030
13043
|
*
|
|
13031
|
-
* @returns
|
|
13044
|
+
* @returns An object containing the entity and the persistent entity index. You can use the index
|
|
13032
13045
|
* with the `removePersistentEntity` function.
|
|
13033
13046
|
*/
|
|
13034
|
-
spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector):
|
|
13047
|
+
spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector): {
|
|
13048
|
+
entity: Entity;
|
|
13049
|
+
persistentIndex: int;
|
|
13050
|
+
};
|
|
13035
13051
|
}
|
|
13036
13052
|
|
|
13037
13053
|
export declare type PickingUpItem = PickingUpItemNull | PickingUpItemCollectible | PickingUpItemTrinket;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 29.1.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -27067,6 +27067,16 @@ function ____exports.onStage(self, ...)
|
|
|
27067
27067
|
function(____, stage) return stage == thisStage end
|
|
27068
27068
|
)
|
|
27069
27069
|
end
|
|
27070
|
+
function ____exports.onStageOrHigher(self, stage)
|
|
27071
|
+
local level = game:GetLevel()
|
|
27072
|
+
local thisStage = level:GetStage()
|
|
27073
|
+
return thisStage >= stage
|
|
27074
|
+
end
|
|
27075
|
+
function ____exports.onStageOrLower(self, stage)
|
|
27076
|
+
local level = game:GetLevel()
|
|
27077
|
+
local thisStage = level:GetStage()
|
|
27078
|
+
return thisStage <= stage
|
|
27079
|
+
end
|
|
27070
27080
|
function ____exports.onStageType(self, ...)
|
|
27071
27081
|
local stageTypes = {...}
|
|
27072
27082
|
local level = game:GetLevel()
|
|
@@ -50415,7 +50425,7 @@ function PersistentEntities.prototype.spawnPersistentEntity(self, entityType, va
|
|
|
50415
50425
|
position,
|
|
50416
50426
|
v.run.persistentEntityIndexCounter
|
|
50417
50427
|
)
|
|
50418
|
-
return {entity, v.run.persistentEntityIndexCounter}
|
|
50428
|
+
return {entity = entity, persistentIndex = v.run.persistentEntityIndexCounter}
|
|
50419
50429
|
end
|
|
50420
50430
|
__TS__Decorate({Exported}, PersistentEntities.prototype, "removePersistentEntity", true)
|
|
50421
50431
|
__TS__Decorate({Exported}, PersistentEntities.prototype, "spawnPersistentEntity", true)
|
|
@@ -38,9 +38,12 @@ export declare class PersistentEntities extends Feature {
|
|
|
38
38
|
*
|
|
39
39
|
* In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
|
|
40
40
|
*
|
|
41
|
-
* @returns
|
|
41
|
+
* @returns An object containing the entity and the persistent entity index. You can use the index
|
|
42
42
|
* with the `removePersistentEntity` function.
|
|
43
43
|
*/
|
|
44
|
-
spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector):
|
|
44
|
+
spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector): {
|
|
45
|
+
entity: Entity;
|
|
46
|
+
persistentIndex: int;
|
|
47
|
+
};
|
|
45
48
|
}
|
|
46
49
|
//# sourceMappingURL=PersistentEntities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistentEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PersistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAmChD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,WAAW,CAAc;IAqBjC,OAAO,CAAC,gBAAgB,CAgBtB;IAEF;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAoBrC,OAAO,CAAC,oBAAoB,CAkB1B;IAEF,OAAO,CAAC,aAAa;IAsBrB;;;;;;;;;;;OAWG;IAEI,sBAAsB,CAC3B,qBAAqB,EAAE,GAAG,EAC1B,YAAY,UAAO,GAClB,IAAI;IAiBP;;;;;;;;;;;;;;;;;OAiBG;IAEI,qBAAqB,CAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,GACf,
|
|
1
|
+
{"version":3,"file":"PersistentEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PersistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAmChD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,WAAW,CAAc;IAqBjC,OAAO,CAAC,gBAAgB,CAgBtB;IAEF;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAoBrC,OAAO,CAAC,oBAAoB,CAkB1B;IAEF,OAAO,CAAC,aAAa;IAsBrB;;;;;;;;;;;OAWG;IAEI,sBAAsB,CAC3B,qBAAqB,EAAE,GAAG,EAC1B,YAAY,UAAO,GAClB,IAAI;IAiBP;;;;;;;;;;;;;;;;;OAiBG;IAEI,qBAAqB,CAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,GACf;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,GAAG,CAAA;KAAE;CAa5C"}
|
|
@@ -147,7 +147,7 @@ function PersistentEntities.prototype.spawnPersistentEntity(self, entityType, va
|
|
|
147
147
|
position,
|
|
148
148
|
v.run.persistentEntityIndexCounter
|
|
149
149
|
)
|
|
150
|
-
return {entity, v.run.persistentEntityIndexCounter}
|
|
150
|
+
return {entity = entity, persistentIndex = v.run.persistentEntityIndexCounter}
|
|
151
151
|
end
|
|
152
152
|
__TS__Decorate({Exported}, PersistentEntities.prototype, "removePersistentEntity", true)
|
|
153
153
|
__TS__Decorate({Exported}, PersistentEntities.prototype, "spawnPersistentEntity", true)
|
|
@@ -56,9 +56,12 @@ export declare function getDoorSlotEnterPositionOffset(doorSlot: DoorSlot): Read
|
|
|
56
56
|
/** Helper function to get the possible door slots that can exist for a given room shape. */
|
|
57
57
|
export declare function getDoorSlotsForRoomShape(roomShape: RoomShape): ReadonlySet<DoorSlot>;
|
|
58
58
|
/**
|
|
59
|
-
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
60
|
-
*
|
|
61
|
-
* room types
|
|
59
|
+
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
60
|
+
*
|
|
61
|
+
* You can optionally specify one or more room types to return only the doors that match the
|
|
62
|
+
* specified room types.
|
|
63
|
+
*
|
|
64
|
+
* @allowEmptyVariadic
|
|
62
65
|
*/
|
|
63
66
|
export declare function getDoors(...roomTypes: RoomType[]): GridEntityDoor[];
|
|
64
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAKZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAuBtC,wBAAgB,aAAa,IAAI,I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
67
67
|
end
|
|
68
|
-
--- Helper function to get all of the doors in the room. By default, it will return every door.
|
|
69
|
-
--
|
|
70
|
-
-- room types
|
|
68
|
+
--- Helper function to get all of the doors in the room. By default, it will return every door.
|
|
69
|
+
--
|
|
70
|
+
-- You can optionally specify one or more room types to return only the doors that match the
|
|
71
|
+
-- specified room types.
|
|
72
|
+
--
|
|
73
|
+
-- @allowEmptyVariadic
|
|
71
74
|
function ____exports.getDoors(self, ...)
|
|
72
75
|
local roomTypes = {...}
|
|
73
76
|
local room = game:GetRoom()
|
|
@@ -46,6 +46,8 @@ export declare function getConstituentsFromGridEntityID(gridEntityID: GridEntity
|
|
|
46
46
|
* GridEntityType.ROCK_TINTED,
|
|
47
47
|
* );
|
|
48
48
|
* ```
|
|
49
|
+
*
|
|
50
|
+
* @allowEmptyVariadic
|
|
49
51
|
*/
|
|
50
52
|
export declare function getGridEntities(...gridEntityTypes: GridEntityType[]): GridEntity[];
|
|
51
53
|
/**
|
|
@@ -63,6 +65,8 @@ export declare function getGridEntitiesInRadius(targetPosition: Vector, radius:
|
|
|
63
65
|
*
|
|
64
66
|
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
65
67
|
* arguments to match specific grid entity types.
|
|
68
|
+
*
|
|
69
|
+
* @allowEmptyVariadic
|
|
66
70
|
*/
|
|
67
71
|
export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
|
|
68
72
|
/** Helper function to get the top left and bottom right corners of a given grid entity. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAgCrD;;;;GAIG;AACH,wBAAg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
246
|
+
-- @allowEmptyVariadic
|
|
245
247
|
function ____exports.getGridEntities(self, ...)
|
|
246
248
|
local gridEntityTypes = {...}
|
|
247
249
|
local gridEntities = getAllGridEntities(nil)
|
|
@@ -318,6 +320,8 @@ end
|
|
|
318
320
|
--
|
|
319
321
|
-- Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
320
322
|
-- arguments to match specific grid entity types.
|
|
323
|
+
--
|
|
324
|
+
-- @allowEmptyVariadic
|
|
321
325
|
function ____exports.getGridEntitiesMap(self, ...)
|
|
322
326
|
local gridEntities = ____exports.getGridEntities(nil, ...)
|
|
323
327
|
local gridEntityMap = __TS__New(Map)
|
|
@@ -69,7 +69,7 @@ export declare function onCathedral(): boolean;
|
|
|
69
69
|
export declare function onChest(): boolean;
|
|
70
70
|
export declare function onDarkRoom(): boolean;
|
|
71
71
|
/**
|
|
72
|
-
* Helper function to check if the current
|
|
72
|
+
* Helper function to check if the current stage matches one of the given stages. This uses the
|
|
73
73
|
* `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
|
|
74
74
|
*
|
|
75
75
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
@@ -98,13 +98,17 @@ export declare function onFirstFloor(): boolean;
|
|
|
98
98
|
export declare function onRepentanceStage(): boolean;
|
|
99
99
|
export declare function onSheol(): boolean;
|
|
100
100
|
/**
|
|
101
|
-
* Helper function to check if the current
|
|
101
|
+
* Helper function to check if the current stage matches one of the given stages.
|
|
102
102
|
*
|
|
103
103
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
104
104
|
*/
|
|
105
105
|
export declare function onStage(...stages: LevelStage[]): boolean;
|
|
106
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
107
|
+
export declare function onStageOrHigher(stage: LevelStage): boolean;
|
|
108
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
109
|
+
export declare function onStageOrLower(stage: LevelStage): boolean;
|
|
106
110
|
/**
|
|
107
|
-
* Helper function to check if the current
|
|
111
|
+
* Helper function to check if the current stage matches one of the given stage types.
|
|
108
112
|
*
|
|
109
113
|
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
110
114
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAS9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,iCAAiC,UAAQ,GACxC,MAAM,CAOR;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAa7E;AAED,iDAAiD;AACjD,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAIvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;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AUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxD;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAI1D;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAIzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAMrD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAK1D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAKzD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAS1D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAStD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAQlD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
|
|
@@ -179,7 +179,7 @@ function ____exports.onDarkRoom(self)
|
|
|
179
179
|
local stageType = level:GetStageType()
|
|
180
180
|
return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
|
|
181
181
|
end
|
|
182
|
-
--- Helper function to check if the current
|
|
182
|
+
--- Helper function to check if the current stage matches one of the given stages. This uses the
|
|
183
183
|
-- `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
|
|
184
184
|
--
|
|
185
185
|
-- This function is variadic, which means you can pass as many stages as you want to match for.
|
|
@@ -217,7 +217,7 @@ function ____exports.onSheol(self)
|
|
|
217
217
|
local stageType = level:GetStageType()
|
|
218
218
|
return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
|
|
219
219
|
end
|
|
220
|
-
--- Helper function to check if the current
|
|
220
|
+
--- Helper function to check if the current stage matches one of the given stages.
|
|
221
221
|
--
|
|
222
222
|
-- This function is variadic, which means you can pass as many stages as you want to match for.
|
|
223
223
|
function ____exports.onStage(self, ...)
|
|
@@ -229,7 +229,19 @@ function ____exports.onStage(self, ...)
|
|
|
229
229
|
function(____, stage) return stage == thisStage end
|
|
230
230
|
)
|
|
231
231
|
end
|
|
232
|
-
--- Helper function to check if the current
|
|
232
|
+
--- Helper function to check if the current stage is equal to or higher than the given stage.
|
|
233
|
+
function ____exports.onStageOrHigher(self, stage)
|
|
234
|
+
local level = game:GetLevel()
|
|
235
|
+
local thisStage = level:GetStage()
|
|
236
|
+
return thisStage >= stage
|
|
237
|
+
end
|
|
238
|
+
--- Helper function to check if the current stage is equal to or higher than the given stage.
|
|
239
|
+
function ____exports.onStageOrLower(self, stage)
|
|
240
|
+
local level = game:GetLevel()
|
|
241
|
+
local thisStage = level:GetStage()
|
|
242
|
+
return thisStage <= stage
|
|
243
|
+
end
|
|
244
|
+
--- Helper function to check if the current stage matches one of the given stage types.
|
|
233
245
|
--
|
|
234
246
|
-- This function is variadic, which means you can pass as many room types as you want to match for.
|
|
235
247
|
function ____exports.onStageType(self, ...)
|
package/package.json
CHANGED
|
@@ -201,7 +201,7 @@ export class PersistentEntities extends Feature {
|
|
|
201
201
|
*
|
|
202
202
|
* In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
|
|
203
203
|
*
|
|
204
|
-
* @returns
|
|
204
|
+
* @returns An object containing the entity and the persistent entity index. You can use the index
|
|
205
205
|
* with the `removePersistentEntity` function.
|
|
206
206
|
*/
|
|
207
207
|
@Exported
|
|
@@ -210,7 +210,7 @@ export class PersistentEntities extends Feature {
|
|
|
210
210
|
variant: int,
|
|
211
211
|
subType: int,
|
|
212
212
|
position: Vector,
|
|
213
|
-
):
|
|
213
|
+
): { entity: Entity; persistentIndex: int } {
|
|
214
214
|
v.run.persistentEntityIndexCounter++;
|
|
215
215
|
|
|
216
216
|
const entity = this.spawnAndTrack(
|
|
@@ -221,6 +221,6 @@ export class PersistentEntities extends Feature {
|
|
|
221
221
|
v.run.persistentEntityIndexCounter,
|
|
222
222
|
);
|
|
223
223
|
|
|
224
|
-
return
|
|
224
|
+
return { entity, persistentIndex: v.run.persistentEntityIndexCounter };
|
|
225
225
|
}
|
|
226
226
|
}
|
package/src/functions/doors.ts
CHANGED
|
@@ -183,9 +183,12 @@ export function getDoorSlotsForRoomShape(
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
|
-
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
187
|
-
*
|
|
188
|
-
* room types
|
|
186
|
+
* Helper function to get all of the doors in the room. By default, it will return every door.
|
|
187
|
+
*
|
|
188
|
+
* You can optionally specify one or more room types to return only the doors that match the
|
|
189
|
+
* specified room types.
|
|
190
|
+
*
|
|
191
|
+
* @allowEmptyVariadic
|
|
189
192
|
*/
|
|
190
193
|
export function getDoors(...roomTypes: RoomType[]): GridEntityDoor[] {
|
|
191
194
|
const room = game.GetRoom();
|
|
@@ -175,6 +175,8 @@ export function getConstituentsFromGridEntityID(
|
|
|
175
175
|
* GridEntityType.ROCK_TINTED,
|
|
176
176
|
* );
|
|
177
177
|
* ```
|
|
178
|
+
*
|
|
179
|
+
* @allowEmptyVariadic
|
|
178
180
|
*/
|
|
179
181
|
export function getGridEntities(
|
|
180
182
|
...gridEntityTypes: GridEntityType[]
|
|
@@ -281,6 +283,8 @@ export function getGridEntitiesInRadius(
|
|
|
281
283
|
*
|
|
282
284
|
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
283
285
|
* arguments to match specific grid entity types.
|
|
286
|
+
*
|
|
287
|
+
* @allowEmptyVariadic
|
|
284
288
|
*/
|
|
285
289
|
export function getGridEntitiesMap(
|
|
286
290
|
...gridEntityTypes: GridEntityType[]
|
package/src/functions/merge.ts
CHANGED
|
@@ -218,7 +218,7 @@ function mergeSerializedTable(
|
|
|
218
218
|
let oldValue = oldTable.get(key) as LuaMap<AnyNotNil, unknown>;
|
|
219
219
|
if (!isTable(oldValue)) {
|
|
220
220
|
// The child table does not exist on the old table. However, we still need to copy over
|
|
221
|
-
// the new table, because we need to handle data types like
|
|
221
|
+
// the new table, because we need to handle data types like `Foo | null`. Thus, set up a
|
|
222
222
|
// blank sub-table on the old table, and continue to recursively merge.
|
|
223
223
|
oldValue = new LuaMap();
|
|
224
224
|
oldTable.set(key, oldValue);
|
package/src/functions/stage.ts
CHANGED
|
@@ -239,7 +239,7 @@ export function onDarkRoom(): boolean {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* Helper function to check if the current
|
|
242
|
+
* Helper function to check if the current stage matches one of the given stages. This uses the
|
|
243
243
|
* `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
|
|
244
244
|
*
|
|
245
245
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
@@ -306,7 +306,7 @@ export function onSheol(): boolean {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
|
-
* Helper function to check if the current
|
|
309
|
+
* Helper function to check if the current stage matches one of the given stages.
|
|
310
310
|
*
|
|
311
311
|
* This function is variadic, which means you can pass as many stages as you want to match for.
|
|
312
312
|
*/
|
|
@@ -316,8 +316,22 @@ export function onStage(...stages: LevelStage[]): boolean {
|
|
|
316
316
|
return stages.some((stage) => stage === thisStage);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
320
|
+
export function onStageOrHigher(stage: LevelStage): boolean {
|
|
321
|
+
const level = game.GetLevel();
|
|
322
|
+
const thisStage = level.GetStage();
|
|
323
|
+
return thisStage >= stage;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/** Helper function to check if the current stage is equal to or higher than the given stage. */
|
|
327
|
+
export function onStageOrLower(stage: LevelStage): boolean {
|
|
328
|
+
const level = game.GetLevel();
|
|
329
|
+
const thisStage = level.GetStage();
|
|
330
|
+
return thisStage <= stage;
|
|
331
|
+
}
|
|
332
|
+
|
|
319
333
|
/**
|
|
320
|
-
* Helper function to check if the current
|
|
334
|
+
* Helper function to check if the current stage matches one of the given stage types.
|
|
321
335
|
*
|
|
322
336
|
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
323
337
|
*/
|