isaacscript-common 15.6.1 → 15.6.2
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.d.ts +15 -9
- package/dist/isaacscript-common.lua +70 -79
- package/dist/src/callbacks.d.ts +1 -1
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/classes/DefaultMap.d.ts +1 -1
- package/dist/src/classes/DefaultMap.d.ts.map +1 -1
- package/dist/src/classes/ModUpgradedBase.lua +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts +1 -1
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts +3 -3
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPurchase.d.ts +1 -1
- package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTransformation.d.ts +1 -1
- package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomRevive.lua +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomHotkeys.lua +2 -2
- package/dist/src/classes/features/other/CustomStages.lua +4 -4
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts +2 -2
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +33 -48
- package/dist/src/classes/features/other/RoomHistory.d.ts +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +1 -1
- package/dist/src/classes/private/CustomCallback.d.ts +2 -2
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.d.ts +1 -1
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/functions/bitSet128.d.ts +1 -1
- package/dist/src/functions/bitSet128.d.ts.map +1 -1
- package/dist/src/functions/color.d.ts +1 -1
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/flag.lua +5 -1
- package/dist/src/functions/gridIndex.lua +1 -1
- package/dist/src/functions/input.d.ts +1 -1
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +0 -3
- package/dist/src/functions/kColor.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +9 -9
- package/dist/src/functions/logMisc.lua +1 -4
- package/dist/src/functions/pills.d.ts +3 -3
- package/dist/src/functions/pills.lua +3 -3
- package/dist/src/functions/rng.d.ts +1 -1
- package/dist/src/functions/rng.d.ts.map +1 -1
- package/dist/src/functions/roomShapeWalls.lua +2 -2
- package/dist/src/functions/run.lua +1 -1
- package/dist/src/functions/ui.d.ts +1 -1
- package/dist/src/functions/ui.lua +1 -1
- package/dist/src/functions/vector.d.ts +7 -1
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +4 -0
- package/dist/src/interfaces/CustomStageTSConfig.d.ts +1 -1
- package/dist/src/interfaces/CustomStageTSConfig.d.ts.map +1 -1
- package/dist/src/interfaces/PlayerHealth.d.ts +1 -1
- package/dist/src/interfaces/PlayerHealth.d.ts.map +1 -1
- package/dist/src/interfaces/SaveData.d.ts +12 -12
- package/dist/src/interfaces/SaveData.d.ts.map +1 -1
- package/dist/src/interfaces/private/CustomStage.d.ts +3 -3
- package/dist/src/interfaces/private/CustomStage.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts +2 -2
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
- package/dist/src/types/AllButFirst.d.ts +1 -1
- package/dist/src/types/AllButFirst.d.ts.map +1 -1
- package/dist/src/types/AllButLast.d.ts +1 -1
- package/dist/src/types/AllButLast.d.ts.map +1 -1
- package/dist/src/types/AnyClass.d.ts +1 -1
- package/dist/src/types/AnyClass.d.ts.map +1 -1
- package/dist/src/types/AnyEntity.d.ts +1 -1
- package/dist/src/types/AnyEntity.d.ts.map +1 -1
- package/dist/src/types/AnyFunction.d.ts +1 -1
- package/dist/src/types/AnyFunction.d.ts.map +1 -1
- package/dist/src/types/AnyGridEntity.d.ts +1 -1
- package/dist/src/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/src/types/CollectibleIndex.d.ts +1 -1
- package/dist/src/types/CollectibleIndex.d.ts.map +1 -1
- package/dist/src/types/ConversionHeartSubType.d.ts +1 -1
- package/dist/src/types/ConversionHeartSubType.d.ts.map +1 -1
- package/dist/src/types/EntityID.d.ts +1 -1
- package/dist/src/types/EntityID.d.ts.map +1 -1
- package/dist/src/types/FunctionTuple.d.ts +1 -1
- package/dist/src/types/FunctionTuple.d.ts.map +1 -1
- package/dist/src/types/GridEntityID.d.ts +1 -1
- package/dist/src/types/GridEntityID.d.ts.map +1 -1
- package/dist/src/types/HasAllEnumKeys.d.ts +1 -1
- package/dist/src/types/HasAllEnumKeys.d.ts.map +1 -1
- package/dist/src/types/HasFunction.d.ts +1 -1
- package/dist/src/types/HasFunction.d.ts.map +1 -1
- package/dist/src/types/Immutable.d.ts +6 -6
- package/dist/src/types/Immutable.d.ts.map +1 -1
- package/dist/src/types/LowercaseKeys.d.ts +1 -1
- package/dist/src/types/LowercaseKeys.d.ts.map +1 -1
- package/dist/src/types/ModUpgraded.d.ts +3 -3
- package/dist/src/types/ModUpgraded.d.ts.map +1 -1
- package/dist/src/types/PickingUpItem.d.ts +1 -1
- package/dist/src/types/PickingUpItem.d.ts.map +1 -1
- package/dist/src/types/PickupIndex.d.ts +1 -1
- package/dist/src/types/PickupIndex.d.ts.map +1 -1
- package/dist/src/types/PlayerIndex.d.ts +1 -1
- package/dist/src/types/PlayerIndex.d.ts.map +1 -1
- package/dist/src/types/PossibleStatType.d.ts +1 -1
- package/dist/src/types/PossibleStatType.d.ts.map +1 -1
- package/dist/src/types/PublicInterface.d.ts +1 -1
- package/dist/src/types/PublicInterface.d.ts.map +1 -1
- package/dist/src/types/StartsWithLowercase.d.ts +1 -1
- package/dist/src/types/StartsWithLowercase.d.ts.map +1 -1
- package/dist/src/types/StartsWithUppercase.d.ts +1 -1
- package/dist/src/types/StartsWithUppercase.d.ts.map +1 -1
- package/dist/src/types/TSTLClass.d.ts +1 -1
- package/dist/src/types/TSTLClass.d.ts.map +1 -1
- package/dist/src/types/TupleToIntersection.d.ts +1 -1
- package/dist/src/types/TupleToIntersection.d.ts.map +1 -1
- package/dist/src/types/TupleToUnion.d.ts +1 -1
- package/dist/src/types/TupleToUnion.d.ts.map +1 -1
- package/dist/src/types/UnionToIntersection.d.ts +1 -1
- package/dist/src/types/UnionToIntersection.d.ts.map +1 -1
- package/dist/src/types/UppercaseKeys.d.ts +1 -1
- package/dist/src/types/UppercaseKeys.d.ts.map +1 -1
- package/dist/src/types/WeightedArray.d.ts +1 -1
- package/dist/src/types/WeightedArray.d.ts.map +1 -1
- package/dist/src/types/Writable.d.ts +1 -1
- package/dist/src/types/Writable.d.ts.map +1 -1
- package/dist/src/types/private/AllButFirst.d.ts +1 -1
- package/dist/src/types/private/AllButFirst.d.ts.map +1 -1
- package/dist/src/types/private/CallbackTuple.d.ts +2 -2
- package/dist/src/types/private/CallbackTuple.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/features/other/PickupIndexCreation.ts +43 -53
- package/src/classes/features/other/RoomHistory.ts +2 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -0
- package/src/functions/flag.ts +1 -1
- package/src/functions/input.ts +1 -5
- package/src/functions/pills.ts +3 -3
- package/src/functions/ui.ts +1 -1
- package/src/functions/vector.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicInterface.d.ts","sourceRoot":"","sources":["../../../src/types/PublicInterface.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"PublicInterface.d.ts","sourceRoot":"","sources":["../../../src/types/PublicInterface.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Helper type to ensure that the given string starts with an lowercase letter. */
|
|
2
|
-
export
|
|
2
|
+
export type StartsWithLowercase<S> = S extends string ? Extract<S, Uncapitalize<S>> : never;
|
|
3
3
|
//# sourceMappingURL=StartsWithLowercase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartsWithLowercase.d.ts","sourceRoot":"","sources":["../../../src/types/StartsWithLowercase.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"StartsWithLowercase.d.ts","sourceRoot":"","sources":["../../../src/types/StartsWithLowercase.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACjD,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GAC3B,KAAK,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Helper type to ensure that the given string starts with an uppercase letter. */
|
|
2
|
-
export
|
|
2
|
+
export type StartsWithUppercase<S> = S extends string ? Extract<S, Capitalize<S>> : never;
|
|
3
3
|
//# sourceMappingURL=StartsWithUppercase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartsWithUppercase.d.ts","sourceRoot":"","sources":["../../../src/types/StartsWithUppercase.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"StartsWithUppercase.d.ts","sourceRoot":"","sources":["../../../src/types/StartsWithUppercase.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACjD,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,GACzB,KAAK,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This type is used by the save data manager to when copying, serializing, and deserializing.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type TSTLClass = LuaMap<AnyNotNil, unknown> & {
|
|
8
8
|
readonly __tstlClassBrand: symbol;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=TSTLClass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../../src/types/TSTLClass.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../../src/types/TSTLClass.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACnD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TupleToIntersection.d.ts","sourceRoot":"","sources":["../../../src/types/TupleToIntersection.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"TupleToIntersection.d.ts","sourceRoot":"","sources":["../../../src/types/TupleToIntersection.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS;IAC/D,MAAM,CAAC;IACP,GAAG,MAAM,CAAC;CACX,GACG,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TupleToUnion.d.ts","sourceRoot":"","sources":["../../../src/types/TupleToUnion.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"TupleToUnion.d.ts","sourceRoot":"","sources":["../../../src/types/TupleToUnion.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Helper type to convert a union to an intersection. */
|
|
2
|
-
export
|
|
2
|
+
export type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
|
|
3
3
|
//# sourceMappingURL=UnionToIntersection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnionToIntersection.d.ts","sourceRoot":"","sources":["../../../src/types/UnionToIntersection.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"UnionToIntersection.d.ts","sourceRoot":"","sources":["../../../src/types/UnionToIntersection.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CACnC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAClC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GACvB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACb,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StartsWithUppercase } from "./StartsWithUppercase";
|
|
2
2
|
/** Helper type to match all of the uppercase keys of an object. */
|
|
3
|
-
export
|
|
3
|
+
export type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
|
|
4
4
|
//# sourceMappingURL=UppercaseKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UppercaseKeys.d.ts","sourceRoot":"","sources":["../../../src/types/UppercaseKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"UppercaseKeys.d.ts","sourceRoot":"","sources":["../../../src/types/UppercaseKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,mEAAmE;AACnE,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/** An array where each element is paired with a number indicating that elements 'weight'. */
|
|
3
|
-
export
|
|
3
|
+
export type WeightedArray<T> = Array<[T, float]>;
|
|
4
4
|
//# sourceMappingURL=WeightedArray.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeightedArray.d.ts","sourceRoot":"","sources":["../../../src/types/WeightedArray.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"WeightedArray.d.ts","sourceRoot":"","sources":["../../../src/types/WeightedArray.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Writable.d.ts","sourceRoot":"","sources":["../../../src/types/Writable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"Writable.d.ts","sourceRoot":"","sources":["../../../src/types/Writable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllButFirst.d.ts","sourceRoot":"","sources":["../../../../src/types/private/AllButFirst.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"AllButFirst.d.ts","sourceRoot":"","sources":["../../../../src/types/private/AllButFirst.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS;IACvD,OAAO;IACP,GAAG,MAAM,IAAI;CACd,GACG,IAAI,GACJ,OAAO,EAAE,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbac
|
|
|
6
6
|
* This is so that the respective callback functions can be added/removed on demand as subscribers
|
|
7
7
|
* get added/removed.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type CallbackTuple = {
|
|
10
10
|
[K in ModCallback]: [K, AddCallbackParameters[K]];
|
|
11
11
|
}[ModCallback];
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ export declare type CallbackTuple = {
|
|
|
14
14
|
* arguments). This is so that the respective callback functions can be added/removed on demand as
|
|
15
15
|
* subscribers get added/removed.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type CustomCallbackTuple = {
|
|
18
18
|
[K in ModCallbackCustom]: [K, AddCallbackParametersCustom[K]];
|
|
19
19
|
}[ModCallbackCustom];
|
|
20
20
|
//# sourceMappingURL=CallbackTuple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallbackTuple.d.ts","sourceRoot":"","sources":["../../../../src/types/private/CallbackTuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAEnG;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"CallbackTuple.d.ts","sourceRoot":"","sources":["../../../../src/types/private/CallbackTuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAEnG;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;CAClD,CAAC,WAAW,CAAC,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,iBAAiB,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC;CAC9D,CAAC,iBAAiB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,9 +6,7 @@ import {
|
|
|
6
6
|
import { game } from "../../../core/cachedClasses";
|
|
7
7
|
import { Exported } from "../../../decorators";
|
|
8
8
|
import { ISCFeature } from "../../../enums/ISCFeature";
|
|
9
|
-
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
10
9
|
import { getEntityID } from "../../../functions/entities";
|
|
11
|
-
import { getPickups } from "../../../functions/entitiesSpecific";
|
|
12
10
|
import { getRoomListIndex } from "../../../functions/roomData";
|
|
13
11
|
import { onAscent } from "../../../functions/stage";
|
|
14
12
|
import { vectorEquals } from "../../../functions/vector";
|
|
@@ -60,40 +58,61 @@ export class PickupIndexCreation extends Feature {
|
|
|
60
58
|
], // 67
|
|
61
59
|
];
|
|
62
60
|
|
|
63
|
-
this.customCallbacksUsed = [
|
|
64
|
-
[ModCallbackCustom.POST_NEW_ROOM_REORDERED, [this.postNewRoomReordered]],
|
|
65
|
-
];
|
|
66
|
-
|
|
67
61
|
this.roomHistory = roomHistory;
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
// ModCallback.POST_PICKUP_INIT (34)
|
|
71
65
|
private postPickupInit = (pickup: EntityPickup) => {
|
|
72
|
-
this.
|
|
66
|
+
this.setPickupIndex(pickup);
|
|
73
67
|
};
|
|
74
68
|
|
|
75
|
-
private
|
|
69
|
+
private setPickupIndex(pickup: EntityPickup): void {
|
|
76
70
|
const ptrHash = GetPtrHash(pickup);
|
|
77
71
|
|
|
78
|
-
// In certain situations, pickups can be morphed,
|
|
79
|
-
// counter. (For example, the collectible rotation
|
|
72
|
+
// In certain situations, pickups can be morphed, which will trigger the `POST_PICKUP_INIT`
|
|
73
|
+
// callback but should not incur a new pickup counter. (For example, the collectible rotation
|
|
74
|
+
// with Tainted Isaac.) For these situations, we will already be tracking an index for this
|
|
75
|
+
// pointer hash.
|
|
80
76
|
if (this.v.room.pickupIndexes.has(ptrHash)) {
|
|
81
77
|
return;
|
|
82
78
|
}
|
|
83
79
|
|
|
84
|
-
//
|
|
85
|
-
//
|
|
80
|
+
// First, handle the special case of re-entering a room with a previously tracked pickup. If we
|
|
81
|
+
// find a match in the level pickup data, we will use the pickup index from the match.
|
|
82
|
+
const pickupIndexFromLevelData =
|
|
83
|
+
this.getPickupIndexFromPreviousData(pickup);
|
|
86
84
|
const room = game.GetRoom();
|
|
87
85
|
const isFirstVisit = room.IsFirstVisit();
|
|
88
86
|
const roomFrameCount = room.GetFrameCount();
|
|
89
|
-
if (
|
|
87
|
+
if (
|
|
88
|
+
pickupIndexFromLevelData !== undefined &&
|
|
89
|
+
!isFirstVisit &&
|
|
90
|
+
roomFrameCount <= 0
|
|
91
|
+
) {
|
|
92
|
+
this.v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
92
95
|
|
|
96
|
+
// This is a brand new pickup that we have not previously seen on this run.
|
|
93
97
|
this.v.run.pickupCounter++;
|
|
94
98
|
this.v.room.pickupIndexes.set(ptrHash, this.v.run.pickupCounter);
|
|
95
99
|
}
|
|
96
100
|
|
|
101
|
+
private getPickupIndexFromPreviousData(
|
|
102
|
+
pickup: EntityPickup,
|
|
103
|
+
): PickupIndex | undefined {
|
|
104
|
+
const roomListIndex = getRoomListIndex();
|
|
105
|
+
const pickupDescriptions =
|
|
106
|
+
this.v.level.pickupData.getAndSetDefault(roomListIndex);
|
|
107
|
+
|
|
108
|
+
let pickupIndex = getStoredPickupIndex(pickup, pickupDescriptions);
|
|
109
|
+
if (pickupIndex === undefined) {
|
|
110
|
+
pickupIndex = this.getPostAscentPickupIndex(pickup);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return pickupIndex;
|
|
114
|
+
}
|
|
115
|
+
|
|
97
116
|
// ModCallback.POST_ENTITY_REMOVE (67)
|
|
98
117
|
// EntityType.PICKUP (5)
|
|
99
118
|
private postEntityRemovePickup = (entity: Entity) => {
|
|
@@ -123,7 +142,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
123
142
|
pickupIndex: PickupIndex,
|
|
124
143
|
) {
|
|
125
144
|
// The "latest" room description is really the previous room, because the `POST_NEW_ROOM`
|
|
126
|
-
// callback
|
|
145
|
+
// callback has not fired yet.
|
|
127
146
|
const previousRoomDescription = this.roomHistory.getLatestRoomDescription();
|
|
128
147
|
if (previousRoomDescription === undefined) {
|
|
129
148
|
return;
|
|
@@ -167,39 +186,9 @@ export class PickupIndexCreation extends Feature {
|
|
|
167
186
|
}
|
|
168
187
|
}
|
|
169
188
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const isFirstVisit = room.IsFirstVisit();
|
|
174
|
-
|
|
175
|
-
if (isFirstVisit) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const roomListIndex = getRoomListIndex();
|
|
180
|
-
const pickupDescriptions =
|
|
181
|
-
this.v.level.pickupData.getAndSetDefault(roomListIndex);
|
|
182
|
-
|
|
183
|
-
for (const pickup of getPickups()) {
|
|
184
|
-
let pickupIndex = getStoredPickupIndex(pickup, pickupDescriptions);
|
|
185
|
-
if (pickupIndex === undefined) {
|
|
186
|
-
pickupIndex = this.getPostAscentPickupIndex(pickup);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (pickupIndex === undefined) {
|
|
190
|
-
// At this point, if we do not already have an existing pickup index, we need to create a
|
|
191
|
-
// new one in order to cover the cases where mods spawn items in the `POST_NEW_ROOM`
|
|
192
|
-
// callback.
|
|
193
|
-
this.v.run.pickupCounter++;
|
|
194
|
-
pickupIndex = this.v.run.pickupCounter;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const ptrHash = GetPtrHash(pickup);
|
|
198
|
-
this.v.room.pickupIndexes.set(ptrHash, pickupIndex);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
private getPostAscentPickupIndex(pickup: EntityPickup) {
|
|
189
|
+
private getPostAscentPickupIndex(
|
|
190
|
+
pickup: EntityPickup,
|
|
191
|
+
): PickupIndex | undefined {
|
|
203
192
|
// If we have not found the pickup index yet, we might be re-entering a post-Ascent Treasure
|
|
204
193
|
// Room or Boss Room.
|
|
205
194
|
if (!onAscent()) {
|
|
@@ -244,17 +233,18 @@ export class PickupIndexCreation extends Feature {
|
|
|
244
233
|
public getPickupIndex(pickup: EntityPickup): PickupIndex {
|
|
245
234
|
const ptrHash = GetPtrHash(pickup);
|
|
246
235
|
const pickupIndexInitial = this.v.room.pickupIndexes.get(ptrHash);
|
|
247
|
-
if (pickupIndexInitial
|
|
248
|
-
|
|
236
|
+
if (pickupIndexInitial !== undefined) {
|
|
237
|
+
return pickupIndexInitial;
|
|
249
238
|
}
|
|
250
239
|
|
|
240
|
+
this.setPickupIndex(pickup);
|
|
251
241
|
const pickupIndex = this.v.room.pickupIndexes.get(ptrHash);
|
|
252
|
-
if (pickupIndex
|
|
253
|
-
|
|
254
|
-
error(`Failed to generate a new pickup index for pickup: ${entityID}`);
|
|
242
|
+
if (pickupIndex !== undefined) {
|
|
243
|
+
return pickupIndex;
|
|
255
244
|
}
|
|
256
245
|
|
|
257
|
-
|
|
246
|
+
const entityID = getEntityID(pickup);
|
|
247
|
+
error(`Failed to generate a new pickup index for pickup: ${entityID}`);
|
|
258
248
|
}
|
|
259
249
|
}
|
|
260
250
|
|
|
@@ -120,8 +120,8 @@ export class RoomHistory extends Feature {
|
|
|
120
120
|
/**
|
|
121
121
|
* Helper function to detect if the game is in the state where the room index has changed to a new
|
|
122
122
|
* room, but the entities from the previous room are currently in the process of despawning. (At
|
|
123
|
-
* this point, the `POST_NEW_ROOM` callback
|
|
124
|
-
* entry in the room history array for the current room.)
|
|
123
|
+
* this point, the `POST_NEW_ROOM` callback and the `POST_NEW_ROOM_EARLY` callback will not have
|
|
124
|
+
* fired yet, and there will not be an entry in the room history array for the current room.)
|
|
125
125
|
*
|
|
126
126
|
* This function is intended to be used in the `POST_ENTITY_REMOVE` callback to detect when an
|
|
127
127
|
* entity is despawning.
|
|
@@ -652,6 +652,8 @@ export function getChallenge(): void {
|
|
|
652
652
|
const challenge = Isaac.GetChallenge();
|
|
653
653
|
const challengeName = Challenge[challenge];
|
|
654
654
|
const challengeDescription =
|
|
655
|
+
// Handle modded challenges.
|
|
656
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
655
657
|
challengeName === undefined
|
|
656
658
|
? `${challenge} (custom)`
|
|
657
659
|
: `Challenge.${challengeName} (${challenge})`;
|
package/src/functions/flag.ts
CHANGED
|
@@ -66,7 +66,7 @@ export function getFlagName<T extends BitFlag | BitFlag128>(
|
|
|
66
66
|
flag: BitFlag,
|
|
67
67
|
flagEnum: Record<string, T>,
|
|
68
68
|
): string | undefined {
|
|
69
|
-
for (const [key, value] of
|
|
69
|
+
for (const [key, value] of Object.entries(flagEnum)) {
|
|
70
70
|
if (value === flag) {
|
|
71
71
|
return key;
|
|
72
72
|
}
|
package/src/functions/input.ts
CHANGED
|
@@ -45,12 +45,8 @@ export const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
|
|
|
45
45
|
* Helper function to get the enum name for the specified `Controller` value. Note that this will
|
|
46
46
|
* trim off the "BUTTON_" prefix.
|
|
47
47
|
*/
|
|
48
|
-
export function controllerToString(controller: Controller): string
|
|
48
|
+
export function controllerToString(controller: Controller): string {
|
|
49
49
|
const key = Controller[controller];
|
|
50
|
-
if (key === undefined) {
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
50
|
return trimPrefix(key, "BUTTON_");
|
|
55
51
|
}
|
|
56
52
|
|
package/src/functions/pills.ts
CHANGED
|
@@ -150,9 +150,9 @@ export function getPillEffectName(pillEffect: PillEffect): string {
|
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
152
|
* Helper function to get a pill effect type from a PillEffect enum value. In this context, the type
|
|
153
|
-
* is equal to positive, negative, or neutral. This is derived from the suffix of the
|
|
154
|
-
*
|
|
155
|
-
*
|
|
153
|
+
* is equal to positive, negative, or neutral. This is derived from the suffix of the "class" tag in
|
|
154
|
+
* the "pocketitems.xml" file. Use the `getPillEffectClass` helper function to determine the "power"
|
|
155
|
+
* of the pill.
|
|
156
156
|
*
|
|
157
157
|
* Due to limitations in the API, this function will not work properly for modded pill effects, and
|
|
158
158
|
* will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
|
package/src/functions/ui.ts
CHANGED
|
@@ -52,7 +52,7 @@ export function getHeartRowLength(player: EntityPlayer): int {
|
|
|
52
52
|
/**
|
|
53
53
|
* Helper function to get the width of the first player's hearts on the UI. This is useful for
|
|
54
54
|
* drawing UI elements to the right of where the player's hearts are. Make sure to use this in
|
|
55
|
-
* combination with the
|
|
55
|
+
* combination with the `getHUDOffsetVector` helper function.
|
|
56
56
|
*/
|
|
57
57
|
export function getHeartsUIWidth(): int {
|
|
58
58
|
const level = game.GetLevel();
|
package/src/functions/vector.ts
CHANGED
|
@@ -117,6 +117,12 @@ export function serializeVector(vector: Vector): SerializedVector {
|
|
|
117
117
|
return vectorTable as SerializedVector;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Helper function to compare two vectors for equality.
|
|
122
|
+
*
|
|
123
|
+
* This function is useful because vectors are not directly comparable. In other words, `Vector(1.2)
|
|
124
|
+
* === Vector(1.2)` will be equal to false.
|
|
125
|
+
*/
|
|
120
126
|
export function vectorEquals(vector1: Vector, vector2: Vector): boolean {
|
|
121
127
|
return isaacAPIClassEquals(vector1, vector2, KEYS);
|
|
122
128
|
}
|