isaacscript-common 20.3.1 → 20.4.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.d.ts +111 -53
- package/dist/isaacscript-common.lua +414 -389
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +0 -8
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostSlotDestroyed.lua +3 -51
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts +36 -0
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.lua +91 -0
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +2 -3
- package/dist/src/classes/features/other/RoomHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/RoomHistory.lua +6 -1
- package/dist/src/classes/features/other/SaveDataManager.d.ts +3 -2
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +69 -127
- package/dist/src/classes/features/other/extraConsoleCommands/subroutines.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +11 -22
- package/dist/src/enums/ISCFeature.d.ts +44 -43
- package/dist/src/enums/ISCFeature.d.ts.map +1 -1
- package/dist/src/enums/ISCFeature.lua +45 -43
- package/dist/src/enums/ModCallbackCustom.d.ts +5 -1
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/enums/SlotDestructionType.d.ts +13 -0
- package/dist/src/enums/SlotDestructionType.d.ts.map +1 -1
- package/dist/src/features.d.ts +46 -43
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/features.lua +3 -0
- package/dist/src/functions/deepCopyTests.d.ts.map +1 -1
- package/dist/src/functions/deepCopyTests.lua +1 -3
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +1 -3
- package/dist/src/functions/mergeTests.d.ts.map +1 -1
- package/dist/src/functions/mergeTests.lua +2 -5
- package/dist/src/functions/slots.d.ts +4 -0
- package/dist/src/functions/slots.d.ts.map +1 -0
- package/dist/src/functions/slots.lua +27 -0
- package/dist/src/functions/utils.d.ts +3 -4
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +8 -6
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/dist/src/interfaces/RoomDescription.d.ts +1 -0
- package/dist/src/interfaces/RoomDescription.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/callbacks/PostSlotDestroyed.ts +2 -72
- package/src/classes/features/callbackLogic/SlotDestroyedDetection.ts +163 -0
- package/src/classes/features/other/ExtraConsoleCommands.ts +3 -6
- package/src/classes/features/other/RoomHistory.ts +6 -0
- package/src/classes/features/other/SaveDataManager.ts +3 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +70 -78
- package/src/classes/features/other/extraConsoleCommands/subroutines.ts +11 -12
- package/src/enums/ISCFeature.ts +1 -0
- package/src/enums/ModCallbackCustom.ts +5 -1
- package/src/enums/SlotDestructionType.ts +14 -0
- package/src/features.ts +6 -0
- package/src/functions/deepCopyTests.ts +1 -2
- package/src/functions/logMisc.ts +1 -2
- package/src/functions/mergeTests.ts +2 -4
- package/src/functions/slots.ts +23 -0
- package/src/functions/utils.ts +7 -6
- package/src/index.ts +1 -0
- package/src/interfaces/RoomDescription.ts +1 -0
|
@@ -9,8 +9,6 @@ local ____SerializationType = require("src.enums.SerializationType")
|
|
|
9
9
|
local SerializationType = ____SerializationType.SerializationType
|
|
10
10
|
local ____deepCopy = require("src.functions.deepCopy")
|
|
11
11
|
local deepCopy = ____deepCopy.deepCopy
|
|
12
|
-
local ____log = require("src.functions.log")
|
|
13
|
-
local log = ____log.log
|
|
14
12
|
local ____merge = require("src.functions.merge")
|
|
15
13
|
local merge = ____merge.merge
|
|
16
14
|
local ____rng = require("src.functions.rng")
|
|
@@ -19,7 +17,7 @@ local newRNG = ____rng.newRNG
|
|
|
19
17
|
local ____serialization = require("src.functions.serialization")
|
|
20
18
|
local isSerializedIsaacAPIClass = ____serialization.isSerializedIsaacAPIClass
|
|
21
19
|
local ____utils = require("src.functions.utils")
|
|
22
|
-
local
|
|
20
|
+
local logAndPrint = ____utils.logAndPrint
|
|
23
21
|
local ____vector = require("src.functions.vector")
|
|
24
22
|
local isVector = ____vector.isVector
|
|
25
23
|
local serializeVector = ____vector.serializeVector
|
|
@@ -254,7 +252,6 @@ function ____exports.runMergeTests(self)
|
|
|
254
252
|
oldTableHasRNG(nil)
|
|
255
253
|
oldTableHasRNGSerialized(nil)
|
|
256
254
|
local successText = "All merge tests passed!"
|
|
257
|
-
|
|
258
|
-
printConsole(nil, successText)
|
|
255
|
+
logAndPrint(nil, successText)
|
|
259
256
|
end
|
|
260
257
|
return ____exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/functions/slots.ts"],"names":[],"mappings":";AAeA,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAMrD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
|
|
7
|
+
local ____entityTypes = require("src.functions.entityTypes")
|
|
8
|
+
local isSlot = ____entityTypes.isSlot
|
|
9
|
+
local SLOT_MACHINE_VARIANTS = __TS__New(Set, {
|
|
10
|
+
SlotVariant.SLOT_MACHINE,
|
|
11
|
+
SlotVariant.BLOOD_DONATION_MACHINE,
|
|
12
|
+
SlotVariant.FORTUNE_TELLING_MACHINE,
|
|
13
|
+
SlotVariant.DONATION_MACHINE,
|
|
14
|
+
SlotVariant.SHOP_RESTOCK_MACHINE,
|
|
15
|
+
SlotVariant.GREED_DONATION_MACHINE,
|
|
16
|
+
SlotVariant.MOMS_DRESSING_TABLE,
|
|
17
|
+
SlotVariant.CRANE_GAME,
|
|
18
|
+
SlotVariant.CONFESSIONAL
|
|
19
|
+
})
|
|
20
|
+
--- Returns true for the specific variants of `EntityType.SLOT` that are machines.
|
|
21
|
+
function ____exports.isSlotMachine(self, entity)
|
|
22
|
+
if not isSlot(nil, entity) then
|
|
23
|
+
return false
|
|
24
|
+
end
|
|
25
|
+
return SLOT_MACHINE_VARIANTS:has(entity.Variant)
|
|
26
|
+
end
|
|
27
|
+
return ____exports
|
|
@@ -57,11 +57,10 @@ export declare function isReflectionRender(): boolean;
|
|
|
57
57
|
*/
|
|
58
58
|
export declare function isVanillaConsoleCommand(commandName: string): boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Helper function to
|
|
61
|
-
*
|
|
62
|
-
* of the message (which `Isaac.ConsoleOutput` does not do by default).
|
|
60
|
+
* Helper function to log a message to the "log.txt" file and to print it to the screen at the same
|
|
61
|
+
* time.
|
|
63
62
|
*/
|
|
64
|
-
export declare function
|
|
63
|
+
export declare function logAndPrint(msg: string): void;
|
|
65
64
|
/** Helper function to print whether something was enabled or disabled to the in-game console. */
|
|
66
65
|
export declare function printEnabled(enabled: boolean, description: string): void;
|
|
67
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mapp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,GAAG,CAAC,CAqB1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,4BAA4B,CAE1C,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,EAC/B,IAAI,SAAS,MAAM,GAAG,MAAM,KACzB,IAAI,CAAG"}
|
|
@@ -5,6 +5,8 @@ local ____cachedClasses = require("src.core.cachedClasses")
|
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
6
|
local ____consoleCommandsSet = require("src.sets.consoleCommandsSet")
|
|
7
7
|
local CONSOLE_COMMANDS_SET = ____consoleCommandsSet.CONSOLE_COMMANDS_SET
|
|
8
|
+
local ____log = require("src.functions.log")
|
|
9
|
+
local log = ____log.log
|
|
8
10
|
--- Helper function to return an array of integers with the specified range, inclusive on the lower
|
|
9
11
|
-- end and exclusive on the high end. (The "e" stands for exclusive.)
|
|
10
12
|
--
|
|
@@ -89,16 +91,16 @@ end
|
|
|
89
91
|
function ____exports.isVanillaConsoleCommand(self, commandName)
|
|
90
92
|
return CONSOLE_COMMANDS_SET:has(commandName)
|
|
91
93
|
end
|
|
92
|
-
--- Helper function to
|
|
93
|
-
--
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
--- Helper function to log a message to the "log.txt" file and to print it to the screen at the same
|
|
95
|
+
-- time.
|
|
96
|
+
function ____exports.logAndPrint(self, msg)
|
|
97
|
+
log(nil, msg)
|
|
98
|
+
print(msg)
|
|
97
99
|
end
|
|
98
100
|
--- Helper function to print whether something was enabled or disabled to the in-game console.
|
|
99
101
|
function ____exports.printEnabled(self, enabled, description)
|
|
100
102
|
local enabledText = enabled and "Enabled" or "Disabled"
|
|
101
|
-
|
|
103
|
+
print(((enabledText .. " ") .. description) .. ".")
|
|
102
104
|
end
|
|
103
105
|
--- Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
|
|
104
106
|
--
|
package/dist/src/index.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export * from "./functions/run";
|
|
|
103
103
|
export * from "./functions/seeds";
|
|
104
104
|
export * from "./functions/serialization";
|
|
105
105
|
export * from "./functions/set";
|
|
106
|
+
export * from "./functions/slots";
|
|
106
107
|
export * from "./functions/sound";
|
|
107
108
|
export * from "./functions/spawnCollectible";
|
|
108
109
|
export * from "./functions/sprites";
|
package/dist/src/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,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,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,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACz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C;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
package/dist/src/index.lua
CHANGED
|
@@ -839,6 +839,14 @@ do
|
|
|
839
839
|
end
|
|
840
840
|
end
|
|
841
841
|
end
|
|
842
|
+
do
|
|
843
|
+
local ____export = require("src.functions.slots")
|
|
844
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
845
|
+
if ____exportKey ~= "default" then
|
|
846
|
+
____exports[____exportKey] = ____exportValue
|
|
847
|
+
end
|
|
848
|
+
end
|
|
849
|
+
end
|
|
842
850
|
do
|
|
843
851
|
local ____export = require("src.functions.sound")
|
|
844
852
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dimension, LevelStage, RoomType, StageID, StageType } from "isaac-typescript-definitions";
|
|
2
2
|
/** This is used by the room history feature of the standard library. */
|
|
3
3
|
export interface RoomDescription {
|
|
4
|
+
startSeedString: string;
|
|
4
5
|
stage: LevelStage;
|
|
5
6
|
stageType: StageType;
|
|
6
7
|
stageID: StageID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/RoomDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"RoomDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/RoomDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -1,84 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EntityGridCollisionClass,
|
|
3
|
-
EntityType,
|
|
4
|
-
ModCallback,
|
|
5
|
-
} from "isaac-typescript-definitions";
|
|
6
|
-
import { game } from "../../core/cachedClasses";
|
|
1
|
+
import { ISCFeature } from "../../enums/ISCFeature";
|
|
7
2
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
8
|
-
import { SlotDestructionType } from "../../enums/SlotDestructionType";
|
|
9
3
|
import { shouldFireSlot } from "../../shouldFire";
|
|
10
4
|
import { CustomCallback } from "../private/CustomCallback";
|
|
11
5
|
|
|
12
|
-
const PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL = 3;
|
|
13
|
-
|
|
14
6
|
export class PostSlotDestroyed extends CustomCallback<ModCallbackCustom.POST_SLOT_DESTROYED> {
|
|
15
|
-
public override v = {
|
|
16
|
-
room: {
|
|
17
|
-
brokenSlots: new Set<PtrHash>(),
|
|
18
|
-
slotPrizeAnimationGameFrame: new Map<PtrHash, int>(),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
7
|
constructor() {
|
|
23
8
|
super();
|
|
24
9
|
|
|
25
|
-
this.
|
|
26
|
-
// 67
|
|
27
|
-
[
|
|
28
|
-
ModCallback.POST_ENTITY_REMOVE,
|
|
29
|
-
this.postEntityRemoveSlot,
|
|
30
|
-
[EntityType.SLOT],
|
|
31
|
-
],
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
this.customCallbacksUsed = [
|
|
35
|
-
[
|
|
36
|
-
ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED,
|
|
37
|
-
this.postSlotAnimationChanged,
|
|
38
|
-
],
|
|
39
|
-
];
|
|
10
|
+
this.featuresUsed = [ISCFeature.SLOT_DESTROYED_DETECTION];
|
|
40
11
|
}
|
|
41
12
|
|
|
42
13
|
protected override shouldFire = shouldFireSlot;
|
|
43
|
-
|
|
44
|
-
// ModCallback.POST_ENTITY_REMOVE (67)
|
|
45
|
-
// EntityType.SLOT (6)
|
|
46
|
-
private postEntityRemoveSlot = (entity: Entity) => {
|
|
47
|
-
const slot = entity as EntitySlot;
|
|
48
|
-
const ptrHash = GetPtrHash(slot);
|
|
49
|
-
const gameFrameCount = game.GetFrameCount();
|
|
50
|
-
|
|
51
|
-
const prizeFrame = this.v.room.slotPrizeAnimationGameFrame.get(ptrHash);
|
|
52
|
-
if (prizeFrame === undefined) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (prizeFrame + PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL === gameFrameCount) {
|
|
57
|
-
this.fire(slot, SlotDestructionType.COLLECTIBLE_PAYOUT);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED
|
|
62
|
-
private postSlotAnimationChanged = (slot: EntitySlot) => {
|
|
63
|
-
const ptrHash = GetPtrHash(slot);
|
|
64
|
-
const gameFrameCount = game.GetFrameCount();
|
|
65
|
-
|
|
66
|
-
const alreadyBroken = this.v.room.brokenSlots.has(ptrHash);
|
|
67
|
-
if (alreadyBroken) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (slot.GridCollisionClass === EntityGridCollisionClass.GROUND) {
|
|
72
|
-
this.v.room.brokenSlots.add(ptrHash);
|
|
73
|
-
this.fire(slot, SlotDestructionType.NORMAL);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const sprite = slot.GetSprite();
|
|
77
|
-
const animation = sprite.GetAnimation();
|
|
78
|
-
if (animation === "Prize") {
|
|
79
|
-
this.v.room.slotPrizeAnimationGameFrame.set(ptrHash, gameFrameCount);
|
|
80
|
-
} else {
|
|
81
|
-
this.v.room.slotPrizeAnimationGameFrame.delete(ptrHash);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
14
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// For machines, destruction is detected in two ways:
|
|
2
|
+
|
|
3
|
+
// 1) The main way is via a change in grid entity class. This happens when the machine is destroyed
|
|
4
|
+
// with a bomb, for example. For this case, the slot will remain until the player leaves the
|
|
5
|
+
// room.
|
|
6
|
+
|
|
7
|
+
// 2) In the specific case of a machine spawning a collectible, the machine will be immediately
|
|
8
|
+
// removed. The collectible will not have the `SpawnerEntity` or `Parent` in this case. Thus, we
|
|
9
|
+
// store all despawning slots in an array and then cross reference the array when a new pickup
|
|
10
|
+
// spawns.
|
|
11
|
+
|
|
12
|
+
// For beggars, destruction is detected by monitoring for when a beggar despawns mid-room. Beggars
|
|
13
|
+
// that are paying out with a collectible will always be playing the "Teleport" animation.
|
|
14
|
+
// Otherwise, the beggar won't be playing any animation in particular.
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
EntityGridCollisionClass,
|
|
18
|
+
EntityType,
|
|
19
|
+
ModCallback,
|
|
20
|
+
PickupVariant,
|
|
21
|
+
} from "isaac-typescript-definitions";
|
|
22
|
+
import { game } from "../../../core/cachedClasses";
|
|
23
|
+
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
24
|
+
import { SlotDestructionType } from "../../../enums/SlotDestructionType";
|
|
25
|
+
import { isSlotMachine } from "../../../functions/slots";
|
|
26
|
+
import { vectorEquals } from "../../../functions/vector";
|
|
27
|
+
import { PostSlotDestroyed } from "../../callbacks/PostSlotDestroyed";
|
|
28
|
+
import { Feature } from "../../private/Feature";
|
|
29
|
+
import { RoomHistory } from "../other/RoomHistory";
|
|
30
|
+
|
|
31
|
+
type DespawnedSlotTuple = [
|
|
32
|
+
gameFrame: int,
|
|
33
|
+
position: Vector,
|
|
34
|
+
entityPtr: EntityPtr,
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export class SlotDestroyedDetection extends Feature {
|
|
38
|
+
public override v = {
|
|
39
|
+
room: {
|
|
40
|
+
destroyedSlotSet: new Set<PtrHash>(),
|
|
41
|
+
despawnedSlots: [] as DespawnedSlotTuple[],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
private postSlotDestroyed: PostSlotDestroyed;
|
|
46
|
+
private roomHistory: RoomHistory;
|
|
47
|
+
|
|
48
|
+
constructor(postSlotDestroyed: PostSlotDestroyed, roomHistory: RoomHistory) {
|
|
49
|
+
super();
|
|
50
|
+
|
|
51
|
+
this.callbacksUsed = [
|
|
52
|
+
// 34
|
|
53
|
+
[
|
|
54
|
+
ModCallback.POST_PICKUP_INIT,
|
|
55
|
+
this.postPickupInitCollectible,
|
|
56
|
+
[PickupVariant.COLLECTIBLE],
|
|
57
|
+
],
|
|
58
|
+
|
|
59
|
+
// 67
|
|
60
|
+
[
|
|
61
|
+
ModCallback.POST_ENTITY_REMOVE,
|
|
62
|
+
this.postEntityRemoveSlot,
|
|
63
|
+
[EntityType.SLOT],
|
|
64
|
+
],
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
this.customCallbacksUsed = [
|
|
68
|
+
[ModCallbackCustom.POST_SLOT_UPDATE, this.postSlotUpdate],
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
this.postSlotDestroyed = postSlotDestroyed;
|
|
72
|
+
this.roomHistory = roomHistory;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ModCallback.POST_PICKUP_INIT (34)
|
|
76
|
+
// PickupVariant.COLLECTIBLE (100)
|
|
77
|
+
private postPickupInitCollectible = (pickup: EntityPickup) => {
|
|
78
|
+
const gameFrameCount = game.GetFrameCount();
|
|
79
|
+
|
|
80
|
+
// Go through the despawning slots to see if they match this pickup.
|
|
81
|
+
for (const despawnedSlotTuple of this.v.room.despawnedSlots) {
|
|
82
|
+
const [gameFrame, position, entityPtr] = despawnedSlotTuple;
|
|
83
|
+
if (
|
|
84
|
+
gameFrame === gameFrameCount &&
|
|
85
|
+
vectorEquals(position, pickup.Position)
|
|
86
|
+
) {
|
|
87
|
+
const entity = entityPtr.Ref;
|
|
88
|
+
if (entity !== undefined) {
|
|
89
|
+
const slot = entity as EntitySlot;
|
|
90
|
+
this.postSlotDestroyed.fire(
|
|
91
|
+
slot,
|
|
92
|
+
SlotDestructionType.COLLECTIBLE_PAYOUT,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// ModCallback.POST_ENTITY_REMOVE (67)
|
|
100
|
+
// EntityType.SLOT (6)
|
|
101
|
+
private postEntityRemoveSlot = (entity: Entity) => {
|
|
102
|
+
const slot = entity as EntitySlot;
|
|
103
|
+
|
|
104
|
+
// The `POST_ENTITY_REMOVE` callback will fire for slots that are naturally despawning as a
|
|
105
|
+
// player leaves a room. We want to ignore all slots that despawn for this reason.
|
|
106
|
+
if (this.roomHistory.isLeavingRoom()) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (isSlotMachine(slot)) {
|
|
111
|
+
this.postEntityRemoveSlotMachine(slot);
|
|
112
|
+
} else {
|
|
113
|
+
this.postEntityRemoveBeggar(slot);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
private postEntityRemoveSlotMachine(slot: EntitySlot) {
|
|
118
|
+
const gameFrameCount = game.GetFrameCount();
|
|
119
|
+
const entityPtr = EntityPtr(slot);
|
|
120
|
+
const despawnedSlotTuple: DespawnedSlotTuple = [
|
|
121
|
+
gameFrameCount,
|
|
122
|
+
slot.Position,
|
|
123
|
+
entityPtr,
|
|
124
|
+
];
|
|
125
|
+
this.v.room.despawnedSlots.push(despawnedSlotTuple);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private postEntityRemoveBeggar(slot: EntitySlot) {
|
|
129
|
+
const sprite = slot.GetSprite();
|
|
130
|
+
const animation = sprite.GetAnimation();
|
|
131
|
+
const slotDestructionType =
|
|
132
|
+
animation === "Teleport"
|
|
133
|
+
? SlotDestructionType.COLLECTIBLE_PAYOUT
|
|
134
|
+
: SlotDestructionType.NORMAL;
|
|
135
|
+
this.postSlotDestroyed.fire(slot, slotDestructionType);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ModCallbackCustom.POST_SLOT_UPDATE
|
|
139
|
+
private postSlotUpdate = (slot: EntitySlot) => {
|
|
140
|
+
const ptrHash = GetPtrHash(slot);
|
|
141
|
+
|
|
142
|
+
const alreadyDestroyed = this.v.room.destroyedSlotSet.has(ptrHash);
|
|
143
|
+
if (alreadyDestroyed) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
this.checkDestroyedFromCollisionClass(slot);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Slots normally have an entity collision class of `EntityCollisionClass.ALL` (4) and a grid
|
|
152
|
+
* collision class of `EntityGridCollisionClass.NONE` (0). When they are destroyed with a bomb,
|
|
153
|
+
* the entity collision class stays the same, but the grid collision class switches to
|
|
154
|
+
* `EntityGridCollisionClass.GROUND` (5).
|
|
155
|
+
*/
|
|
156
|
+
private checkDestroyedFromCollisionClass(slot: EntitySlot) {
|
|
157
|
+
if (slot.GridCollisionClass === EntityGridCollisionClass.GROUND) {
|
|
158
|
+
const ptrHash = GetPtrHash(slot);
|
|
159
|
+
this.v.room.destroyedSlotSet.add(ptrHash);
|
|
160
|
+
this.postSlotDestroyed.fire(slot, SlotDestructionType.NORMAL);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -10,10 +10,7 @@ import { Exported } from "../../../decorators";
|
|
|
10
10
|
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
11
11
|
import { addFlag, bitFlags } from "../../../functions/flag";
|
|
12
12
|
import { getMapPartialMatch } from "../../../functions/map";
|
|
13
|
-
import {
|
|
14
|
-
isVanillaConsoleCommand,
|
|
15
|
-
printConsole,
|
|
16
|
-
} from "../../../functions/utils";
|
|
13
|
+
import { isVanillaConsoleCommand } from "../../../functions/utils";
|
|
17
14
|
import { Feature } from "../../private/Feature";
|
|
18
15
|
import * as commands from "./extraConsoleCommands/commands";
|
|
19
16
|
import { v } from "./extraConsoleCommands/v";
|
|
@@ -176,12 +173,12 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
176
173
|
private executeCmd = (command: string, params: string) => {
|
|
177
174
|
const resultTuple = getMapPartialMatch(command, this.commandFunctionMap);
|
|
178
175
|
if (resultTuple === undefined) {
|
|
179
|
-
|
|
176
|
+
print("That is an invalid console command.");
|
|
180
177
|
return;
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
const [commandName, commandFunction] = resultTuple;
|
|
184
|
-
|
|
181
|
+
print(`Command: ${commandName}`);
|
|
185
182
|
commandFunction(params);
|
|
186
183
|
};
|
|
187
184
|
|
|
@@ -39,6 +39,8 @@ export class RoomHistory extends Feature {
|
|
|
39
39
|
const stageType = level.GetStageType();
|
|
40
40
|
const room = game.GetRoom();
|
|
41
41
|
const roomType = room.GetType();
|
|
42
|
+
const seeds = game.GetSeeds();
|
|
43
|
+
const startSeedString = seeds.GetStartSeedString();
|
|
42
44
|
const stageID = getRoomStageID();
|
|
43
45
|
const dimension = getDimension();
|
|
44
46
|
const roomVariant = getRoomVariant();
|
|
@@ -49,6 +51,7 @@ export class RoomHistory extends Feature {
|
|
|
49
51
|
const roomVisitedCount = getRoomVisitedCount();
|
|
50
52
|
|
|
51
53
|
const roomDescription: RoomDescription = {
|
|
54
|
+
startSeedString,
|
|
52
55
|
stage,
|
|
53
56
|
stageType,
|
|
54
57
|
stageID,
|
|
@@ -133,6 +136,8 @@ export class RoomHistory extends Feature {
|
|
|
133
136
|
const level = game.GetLevel();
|
|
134
137
|
const stage = level.GetStage();
|
|
135
138
|
const stageType = level.GetStageType();
|
|
139
|
+
const seeds = game.GetSeeds();
|
|
140
|
+
const startSeedString = seeds.GetStartSeedString();
|
|
136
141
|
const roomListIndex = getRoomListIndex();
|
|
137
142
|
const roomVisitedCount = getRoomVisitedCount();
|
|
138
143
|
const latestRoomDescription = this.getLatestRoomDescription();
|
|
@@ -144,6 +149,7 @@ export class RoomHistory extends Feature {
|
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
return (
|
|
152
|
+
startSeedString !== latestRoomDescription.startSeedString ||
|
|
147
153
|
stage !== latestRoomDescription.stage ||
|
|
148
154
|
stageType !== latestRoomDescription.stageType ||
|
|
149
155
|
roomListIndex !== latestRoomDescription.roomListIndex ||
|
|
@@ -214,8 +214,9 @@ export class SaveDataManager extends Feature {
|
|
|
214
214
|
/**
|
|
215
215
|
* This is the entry point to the save data manager, a system which provides two major features:
|
|
216
216
|
*
|
|
217
|
-
* 1.
|
|
218
|
-
*
|
|
217
|
+
* 1. Automatic resetting of variables on a new run, on a new level, or on a new room (as
|
|
218
|
+
* desired).
|
|
219
|
+
* 2. Automatic saving and loading of all tracked data to the "save#.dat" file.
|
|
219
220
|
*
|
|
220
221
|
* You feed this function with an object containing your variables, and then it will automatically
|
|
221
222
|
* manage them for you. (See below for an example.)
|