isaacscript-common 7.7.1 → 7.9.1
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/callbacks/postPlayerReorderedCallbacks.d.ts +2 -2
- package/dist/callbacks/postPlayerReorderedCallbacks.d.ts.map +1 -1
- package/dist/callbacks/postPlayerReorderedCallbacks.lua +5 -3
- package/dist/enums/ModCallbackCustom.d.ts +2 -0
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/features/preventChildEntities.d.ts +13 -0
- package/dist/features/preventChildEntities.d.ts.map +1 -0
- package/dist/features/preventChildEntities.lua +33 -0
- package/dist/functions/doors.d.ts +4 -4
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +7 -7
- package/dist/functions/players.d.ts +11 -0
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +5 -0
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +3 -0
- package/package.json +1 -1
- package/src/callbacks/postPlayerReorderedCallbacks.ts +8 -3
- package/src/enums/ModCallbackCustom.ts +2 -0
- package/src/features/preventChildEntities.ts +44 -0
- package/src/functions/doors.ts +6 -12
- package/src/functions/players.ts +40 -0
- package/src/index.ts +1 -0
- package/src/initFeatures.ts +2 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function postPlayerReorderedCallbacksInit(mod:
|
|
1
|
+
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
2
|
+
export declare function postPlayerReorderedCallbacksInit(mod: ModUpgraded): void;
|
|
3
3
|
//# sourceMappingURL=postPlayerReorderedCallbacks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postPlayerReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../src/callbacks/postPlayerReorderedCallbacks.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"postPlayerReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../src/callbacks/postPlayerReorderedCallbacks.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA6BrD,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUvE"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local hasSubscriptions, postPEffectUpdate, postPlayerUpdate, postPlayerRender,
|
|
2
|
+
local hasSubscriptions, postPEffectUpdate, postPlayerUpdate, postPlayerRender, postGameStartedReordered, dequeue, v
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
4
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
5
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
6
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
5
7
|
local ____exports = require("features.saveDataManager.exports")
|
|
6
8
|
local saveDataManager = ____exports.saveDataManager
|
|
7
9
|
local ____array = require("functions.array")
|
|
@@ -57,7 +59,7 @@ function postPlayerRender(self, player)
|
|
|
57
59
|
____v_run_postPlayerRenderQueue_2[#____v_run_postPlayerRenderQueue_2 + 1] = playerIndex
|
|
58
60
|
end
|
|
59
61
|
end
|
|
60
|
-
function
|
|
62
|
+
function postGameStartedReordered(self)
|
|
61
63
|
if not hasSubscriptions(nil) then
|
|
62
64
|
return
|
|
63
65
|
end
|
|
@@ -79,8 +81,8 @@ v = {run = {postGameStartedFiredOnThisRun = false, postPEffectUpdateQueue = {},
|
|
|
79
81
|
function ____exports.postPlayerReorderedCallbacksInit(self, mod)
|
|
80
82
|
saveDataManager(nil, "postPlayerReordered", v, hasSubscriptions)
|
|
81
83
|
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
82
|
-
mod:AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted)
|
|
83
84
|
mod:AddCallback(ModCallback.POST_PLAYER_UPDATE, postPlayerUpdate)
|
|
84
85
|
mod:AddCallback(ModCallback.POST_PLAYER_RENDER, postPlayerRender)
|
|
86
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_GAME_STARTED_REORDERED, postGameStartedReordered)
|
|
85
87
|
end
|
|
86
88
|
return ____exports
|
|
@@ -461,6 +461,8 @@ export declare enum ModCallbackCustom {
|
|
|
461
461
|
*
|
|
462
462
|
* (Leaving a room with a grid entity does not count as "removing" it.)
|
|
463
463
|
*
|
|
464
|
+
* This will fire when a Polty/Kineti picks up a grid entity.
|
|
465
|
+
*
|
|
464
466
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
465
467
|
* only fire if it matches the `GridEntityType` provided.
|
|
466
468
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;OAUG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;OAUG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;OASG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;OAYG;IACH,mBAAmB,IAAA;IAEnB;;;;;;OAMG;IACH,eAAe,IAAA;IAEf;;;;;;;;;;;;;OAaG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,IAAA;IAE3B;;;;;;;;OAQG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;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H,eAAe,KAAA;IAEf;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;OAYG;IACH,aAAa,KAAA;CACd"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
+
export declare function preventChildEntitiesInit(mod: Mod): void;
|
|
4
|
+
/**
|
|
5
|
+
* Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs
|
|
6
|
+
* like Squirts. This behavior will only last for the current room.
|
|
7
|
+
*
|
|
8
|
+
* Under the hood, this function will remove any new NPCs spawned that have a `Entity.SpawnerEntity`
|
|
9
|
+
* or `Entity.Parent` value that matches the provided entity. (They are removed during the
|
|
10
|
+
* `POST_NPC_INIT` callback specifically.)
|
|
11
|
+
*/
|
|
12
|
+
export declare function preventChildEntities(entity: Entity): void;
|
|
13
|
+
//# sourceMappingURL=preventChildEntities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preventChildEntities.d.ts","sourceRoot":"","sources":["../../src/features/preventChildEntities.ts"],"names":[],"mappings":";;AAWA,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAIvD;AAiBD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAGzD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local postNPCInit, v
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
8
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
9
|
+
local saveDataManager = ____exports.saveDataManager
|
|
10
|
+
function postNPCInit(self, npc)
|
|
11
|
+
local spawnerEntityMatch = npc.SpawnerEntity ~= nil and v.room.preventingEntities:has(GetPtrHash(npc.SpawnerEntity))
|
|
12
|
+
local parentMatch = npc.Parent ~= nil and v.room.preventingEntities:has(GetPtrHash(npc.Parent))
|
|
13
|
+
if spawnerEntityMatch or parentMatch then
|
|
14
|
+
npc:Remove()
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
local FEATURE_NAME = "preventChildEntities"
|
|
18
|
+
v = {room = {preventingEntities = __TS__New(Set)}}
|
|
19
|
+
function ____exports.preventChildEntitiesInit(self, mod)
|
|
20
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
21
|
+
mod:AddCallback(ModCallback.POST_NPC_INIT, postNPCInit)
|
|
22
|
+
end
|
|
23
|
+
--- Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs
|
|
24
|
+
-- like Squirts. This behavior will only last for the current room.
|
|
25
|
+
--
|
|
26
|
+
-- Under the hood, this function will remove any new NPCs spawned that have a `Entity.SpawnerEntity`
|
|
27
|
+
-- or `Entity.Parent` value that matches the provided entity. (They are removed during the
|
|
28
|
+
-- `POST_NPC_INIT` callback specifically.)
|
|
29
|
+
function ____exports.preventChildEntities(self, entity)
|
|
30
|
+
local ptrHash = GetPtrHash(entity)
|
|
31
|
+
v.room.preventingEntities:add(ptrHash)
|
|
32
|
+
end
|
|
33
|
+
return ____exports
|
|
@@ -25,16 +25,16 @@ export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefine
|
|
|
25
25
|
* Helper function to get the position that a player will enter a room at.
|
|
26
26
|
*
|
|
27
27
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
28
|
-
* they would immediately collide with the loading zone. Instead, they
|
|
29
|
-
*
|
|
28
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
29
|
+
* to the door.
|
|
30
30
|
*/
|
|
31
31
|
export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector>;
|
|
32
32
|
/**
|
|
33
33
|
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
34
34
|
*
|
|
35
35
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
36
|
-
* they would immediately collide with the loading zone. Instead, they
|
|
37
|
-
*
|
|
36
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
37
|
+
* to the door.
|
|
38
38
|
*/
|
|
39
39
|
export declare function getDoorSlotEnterPositionOffset(doorSlot: DoorSlot): Readonly<Vector>;
|
|
40
40
|
/** Helper function to get the possible door slots that can exist for a given room shape. */
|
|
@@ -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,EAIZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAIZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAmBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;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,YAAY,IAAI,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,CAK5D;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAI5D"}
|
package/dist/functions/doors.lua
CHANGED
|
@@ -7,7 +7,6 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
7
7
|
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
8
8
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
9
9
|
local ____exports = {}
|
|
10
|
-
local ROOM_ENTRY_OFFSET_FROM_DOOR
|
|
11
10
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
12
11
|
local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
13
12
|
local DoorSlotFlag = ____isaac_2Dtypescript_2Ddefinitions.DoorSlotFlag
|
|
@@ -17,6 +16,8 @@ local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
|
17
16
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
18
17
|
local ____cachedClasses = require("core.cachedClasses")
|
|
19
18
|
local game = ____cachedClasses.game
|
|
19
|
+
local ____constants = require("core.constants")
|
|
20
|
+
local DISTANCE_OF_GRID_TILE = ____constants.DISTANCE_OF_GRID_TILE
|
|
20
21
|
local ____doorSlotFlagToDoorSlot = require("objects.doorSlotFlagToDoorSlot")
|
|
21
22
|
local DEFAULT_DOOR_SLOT = ____doorSlotFlagToDoorSlot.DEFAULT_DOOR_SLOT
|
|
22
23
|
local DOOR_SLOT_FLAG_TO_DOOR_SLOT = ____doorSlotFlagToDoorSlot.DOOR_SLOT_FLAG_TO_DOOR_SLOT
|
|
@@ -48,13 +49,13 @@ end
|
|
|
48
49
|
--- Helper function to get the offset from a door position that a player will enter a room at.
|
|
49
50
|
--
|
|
50
51
|
-- When players enter a room, they do not appear exactly on the location of the door, because then
|
|
51
|
-
-- they would immediately collide with the loading zone. Instead, they
|
|
52
|
-
--
|
|
52
|
+
-- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
53
|
+
-- to the door.
|
|
53
54
|
function ____exports.getDoorSlotEnterPositionOffset(self, doorSlot)
|
|
54
55
|
local direction = ____exports.doorSlotToDirection(nil, doorSlot)
|
|
55
56
|
local vector = directionToVector(nil, direction)
|
|
56
57
|
local oppositeVector = vector * -1
|
|
57
|
-
return oppositeVector *
|
|
58
|
+
return oppositeVector * DISTANCE_OF_GRID_TILE
|
|
58
59
|
end
|
|
59
60
|
--- Helper function to get all of the doors in the room. By default, it will return every door. You
|
|
60
61
|
-- can optionally specify one or more room types to return only the doors that match the specified
|
|
@@ -106,7 +107,6 @@ function ____exports.removeDoors(self, ...)
|
|
|
106
107
|
____exports.removeDoor(nil, door)
|
|
107
108
|
end
|
|
108
109
|
end
|
|
109
|
-
ROOM_ENTRY_OFFSET_FROM_DOOR = 40
|
|
110
110
|
function ____exports.closeAllDoors(self)
|
|
111
111
|
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
112
112
|
door:Close(true)
|
|
@@ -181,8 +181,8 @@ end
|
|
|
181
181
|
--- Helper function to get the position that a player will enter a room at.
|
|
182
182
|
--
|
|
183
183
|
-- When players enter a room, they do not appear exactly on the location of the door, because then
|
|
184
|
-
-- they would immediately collide with the loading zone. Instead, they
|
|
185
|
-
--
|
|
184
|
+
-- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
185
|
+
-- to the door.
|
|
186
186
|
function ____exports.getDoorEnterPosition(self, door)
|
|
187
187
|
local offset = ____exports.getDoorSlotEnterPositionOffset(nil, door.Slot)
|
|
188
188
|
return door.Position + offset
|
|
@@ -328,4 +328,15 @@ export declare function setBlindfold(player: EntityPlayer, enabled: boolean, mod
|
|
|
328
328
|
* any costumes.
|
|
329
329
|
*/
|
|
330
330
|
export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
331
|
+
/**
|
|
332
|
+
* Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
|
|
333
|
+
* Magdalene.
|
|
334
|
+
*
|
|
335
|
+
* Tainted Magdalene has "permanent" health and "temporary" health. When standing still and doing
|
|
336
|
+
* nothing, all of Tainted Magdalene's temporary health will eventually go away.
|
|
337
|
+
*
|
|
338
|
+
* Before using this function, it is expected that you check to see if the player is Tainted
|
|
339
|
+
* Magdalene first, or else it will give a nonsensical result.
|
|
340
|
+
*/
|
|
341
|
+
export declare function wouldDamageTaintedMagdaleneNonTemporaryHeartContainers(player: EntityPlayer, damageAmount: float): boolean;
|
|
331
342
|
//# sourceMappingURL=players.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CA4CN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE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AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,C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MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -827,4 +827,28 @@ function ____exports.useActiveItemTemp(self, player, collectibleType)
|
|
|
827
827
|
-1
|
|
828
828
|
)
|
|
829
829
|
end
|
|
830
|
+
--- Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
|
|
831
|
+
-- Magdalene.
|
|
832
|
+
--
|
|
833
|
+
-- Tainted Magdalene has "permanent" health and "temporary" health. When standing still and doing
|
|
834
|
+
-- nothing, all of Tainted Magdalene's temporary health will eventually go away.
|
|
835
|
+
--
|
|
836
|
+
-- Before using this function, it is expected that you check to see if the player is Tainted
|
|
837
|
+
-- Magdalene first, or else it will give a nonsensical result.
|
|
838
|
+
function ____exports.wouldDamageTaintedMagdaleneNonTemporaryHeartContainers(self, player, damageAmount)
|
|
839
|
+
local soulHearts = player:GetSoulHearts()
|
|
840
|
+
if soulHearts > 0 then
|
|
841
|
+
return false
|
|
842
|
+
end
|
|
843
|
+
local boneHearts = player:GetBoneHearts()
|
|
844
|
+
if boneHearts > 0 then
|
|
845
|
+
return false
|
|
846
|
+
end
|
|
847
|
+
local hearts = player:GetHearts()
|
|
848
|
+
local rottenHearts = player:GetRottenHearts()
|
|
849
|
+
local effectiveDamageAmount = damageAmount + math.min(rottenHearts, damageAmount)
|
|
850
|
+
local heartsAfterDamage = hearts - effectiveDamageAmount
|
|
851
|
+
local nonTemporaryMaxHearts = ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(nil, player)
|
|
852
|
+
return heartsAfterDamage < nonTemporaryMaxHearts
|
|
853
|
+
end
|
|
830
854
|
return ____exports
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { removePersistentEntity, spawnPersistentEntity, } from "./features/persi
|
|
|
34
34
|
export * from "./features/pickupIndex";
|
|
35
35
|
export { getPlayerInventory } from "./features/playerInventory";
|
|
36
36
|
export { anyPlayerUsingPony, isPlayerUsingPony, } from "./features/ponyDetection";
|
|
37
|
+
export { preventChildEntities } from "./features/preventChildEntities";
|
|
37
38
|
export { preventCollectibleRotation } from "./features/preventCollectibleRotation";
|
|
38
39
|
export { registerHotkey, unregisterHotkey } from "./features/registerHotkey";
|
|
39
40
|
export { getRoomClearGameFrame, getRoomClearRoomFrame, } from "./features/roomClearFrame";
|
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,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE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B,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
|
@@ -272,6 +272,11 @@ do
|
|
|
272
272
|
____exports.anyPlayerUsingPony = anyPlayerUsingPony
|
|
273
273
|
____exports.isPlayerUsingPony = isPlayerUsingPony
|
|
274
274
|
end
|
|
275
|
+
do
|
|
276
|
+
local ____preventChildEntities = require("features.preventChildEntities")
|
|
277
|
+
local preventChildEntities = ____preventChildEntities.preventChildEntities
|
|
278
|
+
____exports.preventChildEntities = preventChildEntities
|
|
279
|
+
end
|
|
275
280
|
do
|
|
276
281
|
local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
|
|
277
282
|
local preventCollectibleRotation = ____preventCollectibleRotation.preventCollectibleRotation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initFeatures.d.ts","sourceRoot":"","sources":["../src/initFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"initFeatures.d.ts","sourceRoot":"","sources":["../src/initFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA6BpD,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAGnD"}
|
package/dist/initFeatures.lua
CHANGED
|
@@ -34,6 +34,8 @@ local ____playerInventory = require("features.playerInventory")
|
|
|
34
34
|
local playerInventoryInit = ____playerInventory.playerInventoryInit
|
|
35
35
|
local ____ponyDetection = require("features.ponyDetection")
|
|
36
36
|
local ponyDetectionInit = ____ponyDetection.ponyDetectionInit
|
|
37
|
+
local ____preventChildEntities = require("features.preventChildEntities")
|
|
38
|
+
local preventChildEntitiesInit = ____preventChildEntities.preventChildEntitiesInit
|
|
37
39
|
local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
|
|
38
40
|
local preventCollectibleRotationInit = ____preventCollectibleRotation.preventCollectibleRotationInit
|
|
39
41
|
local ____registerHotkey = require("features.registerHotkey")
|
|
@@ -73,6 +75,7 @@ function initFeaturesMinor(self, mod)
|
|
|
73
75
|
pickupIndexInit(nil, mod)
|
|
74
76
|
playerInventoryInit(nil, mod)
|
|
75
77
|
ponyDetectionInit(nil, mod)
|
|
78
|
+
preventChildEntitiesInit(nil, mod)
|
|
76
79
|
preventCollectibleRotationInit(nil, mod)
|
|
77
80
|
registerHotkeyInit(nil, mod)
|
|
78
81
|
roomClearFrameInit(nil, mod)
|
package/package.json
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// - POST_PLAYER_UPDATE_REORDERED
|
|
5
5
|
|
|
6
6
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
7
|
+
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
8
|
+
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
7
9
|
import { saveDataManager } from "../features/saveDataManager/exports";
|
|
8
10
|
import { emptyArray } from "../functions/array";
|
|
9
11
|
import { getPlayerFromIndex, getPlayerIndex } from "../functions/playerIndex";
|
|
@@ -31,13 +33,16 @@ const v = {
|
|
|
31
33
|
},
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
export function postPlayerReorderedCallbacksInit(mod:
|
|
36
|
+
export function postPlayerReorderedCallbacksInit(mod: ModUpgraded): void {
|
|
35
37
|
saveDataManager("postPlayerReordered", v, hasSubscriptions);
|
|
36
38
|
|
|
37
39
|
mod.AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate); // 4
|
|
38
|
-
mod.AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted); // 15
|
|
39
40
|
mod.AddCallback(ModCallback.POST_PLAYER_UPDATE, postPlayerUpdate); // 31
|
|
40
41
|
mod.AddCallback(ModCallback.POST_PLAYER_RENDER, postPlayerRender); // 32
|
|
42
|
+
mod.AddCallbackCustom(
|
|
43
|
+
ModCallbackCustom.POST_GAME_STARTED_REORDERED,
|
|
44
|
+
postGameStartedReordered,
|
|
45
|
+
);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
function hasSubscriptions() {
|
|
@@ -94,7 +99,7 @@ function postPlayerRender(player: EntityPlayer) {
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
// ModCallback.POST_GAME_STARTED (15)
|
|
97
|
-
function
|
|
102
|
+
function postGameStartedReordered() {
|
|
98
103
|
if (!hasSubscriptions()) {
|
|
99
104
|
return;
|
|
100
105
|
}
|
|
@@ -503,6 +503,8 @@ export enum ModCallbackCustom {
|
|
|
503
503
|
*
|
|
504
504
|
* (Leaving a room with a grid entity does not count as "removing" it.)
|
|
505
505
|
*
|
|
506
|
+
* This will fire when a Polty/Kineti picks up a grid entity.
|
|
507
|
+
*
|
|
506
508
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
507
509
|
* only fire if it matches the `GridEntityType` provided.
|
|
508
510
|
*
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
|
+
import { saveDataManager } from "./saveDataManager/exports";
|
|
3
|
+
|
|
4
|
+
const FEATURE_NAME = "preventChildEntities";
|
|
5
|
+
|
|
6
|
+
const v = {
|
|
7
|
+
room: {
|
|
8
|
+
preventingEntities: new Set<PtrHash>(),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function preventChildEntitiesInit(mod: Mod): void {
|
|
13
|
+
saveDataManager(FEATURE_NAME, v);
|
|
14
|
+
|
|
15
|
+
mod.AddCallback(ModCallback.POST_NPC_INIT, postNPCInit); // 27
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ModCallback.POST_NPC_INIT (27)
|
|
19
|
+
function postNPCInit(npc: EntityNPC) {
|
|
20
|
+
const spawnerEntityMatch =
|
|
21
|
+
npc.SpawnerEntity !== undefined &&
|
|
22
|
+
v.room.preventingEntities.has(GetPtrHash(npc.SpawnerEntity));
|
|
23
|
+
|
|
24
|
+
const parentMatch =
|
|
25
|
+
npc.Parent !== undefined &&
|
|
26
|
+
v.room.preventingEntities.has(GetPtrHash(npc.Parent));
|
|
27
|
+
|
|
28
|
+
if (spawnerEntityMatch || parentMatch) {
|
|
29
|
+
npc.Remove();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs
|
|
35
|
+
* like Squirts. This behavior will only last for the current room.
|
|
36
|
+
*
|
|
37
|
+
* Under the hood, this function will remove any new NPCs spawned that have a `Entity.SpawnerEntity`
|
|
38
|
+
* or `Entity.Parent` value that matches the provided entity. (They are removed during the
|
|
39
|
+
* `POST_NPC_INIT` callback specifically.)
|
|
40
|
+
*/
|
|
41
|
+
export function preventChildEntities(entity: Entity): void {
|
|
42
|
+
const ptrHash = GetPtrHash(entity);
|
|
43
|
+
v.room.preventingEntities.add(ptrHash);
|
|
44
|
+
}
|
package/src/functions/doors.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
RoomType,
|
|
10
10
|
} from "isaac-typescript-definitions";
|
|
11
11
|
import { game } from "../core/cachedClasses";
|
|
12
|
+
import { DISTANCE_OF_GRID_TILE } from "../core/constants";
|
|
12
13
|
import {
|
|
13
14
|
DEFAULT_DOOR_SLOT,
|
|
14
15
|
DOOR_SLOT_FLAG_TO_DOOR_SLOT,
|
|
@@ -25,13 +26,6 @@ import { hasFlag } from "./flag";
|
|
|
25
26
|
import { isTSTLSet } from "./tstlClass";
|
|
26
27
|
import { asNumber } from "./types";
|
|
27
28
|
|
|
28
|
-
/**
|
|
29
|
-
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
30
|
-
* they would immediately collide with the loading zone. Instead, they are offset by this amount of
|
|
31
|
-
* units.
|
|
32
|
-
*/
|
|
33
|
-
const ROOM_ENTRY_OFFSET_FROM_DOOR = 40;
|
|
34
|
-
|
|
35
29
|
export function closeAllDoors(): void {
|
|
36
30
|
for (const door of getDoors()) {
|
|
37
31
|
door.Close(true);
|
|
@@ -123,8 +117,8 @@ export function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined {
|
|
|
123
117
|
* Helper function to get the position that a player will enter a room at.
|
|
124
118
|
*
|
|
125
119
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
126
|
-
* they would immediately collide with the loading zone. Instead, they
|
|
127
|
-
*
|
|
120
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
121
|
+
* to the door.
|
|
128
122
|
*/
|
|
129
123
|
export function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector> {
|
|
130
124
|
const offset = getDoorSlotEnterPositionOffset(door.Slot);
|
|
@@ -135,8 +129,8 @@ export function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector> {
|
|
|
135
129
|
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
136
130
|
*
|
|
137
131
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
138
|
-
* they would immediately collide with the loading zone. Instead, they
|
|
139
|
-
*
|
|
132
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
133
|
+
* to the door.
|
|
140
134
|
*/
|
|
141
135
|
export function getDoorSlotEnterPositionOffset(
|
|
142
136
|
doorSlot: DoorSlot,
|
|
@@ -147,7 +141,7 @@ export function getDoorSlotEnterPositionOffset(
|
|
|
147
141
|
// The player appears in the opposite direction of the way that the door is oriented in the room.
|
|
148
142
|
const oppositeVector = vector.mul(-1);
|
|
149
143
|
|
|
150
|
-
return oppositeVector.mul(
|
|
144
|
+
return oppositeVector.mul(DISTANCE_OF_GRID_TILE);
|
|
151
145
|
}
|
|
152
146
|
|
|
153
147
|
/** Helper function to get the possible door slots that can exist for a given room shape. */
|
package/src/functions/players.ts
CHANGED
|
@@ -1058,3 +1058,43 @@ export function useActiveItemTemp(
|
|
|
1058
1058
|
): void {
|
|
1059
1059
|
player.UseActiveItem(collectibleType, false, false, true, false, -1);
|
|
1060
1060
|
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
|
|
1064
|
+
* Magdalene.
|
|
1065
|
+
*
|
|
1066
|
+
* Tainted Magdalene has "permanent" health and "temporary" health. When standing still and doing
|
|
1067
|
+
* nothing, all of Tainted Magdalene's temporary health will eventually go away.
|
|
1068
|
+
*
|
|
1069
|
+
* Before using this function, it is expected that you check to see if the player is Tainted
|
|
1070
|
+
* Magdalene first, or else it will give a nonsensical result.
|
|
1071
|
+
*/
|
|
1072
|
+
export function wouldDamageTaintedMagdaleneNonTemporaryHeartContainers(
|
|
1073
|
+
player: EntityPlayer,
|
|
1074
|
+
damageAmount: float,
|
|
1075
|
+
): boolean {
|
|
1076
|
+
// Regardless of the damage amount, damage to a player cannot remove a soul heart and a red heart
|
|
1077
|
+
// at the same time.
|
|
1078
|
+
const soulHearts = player.GetSoulHearts();
|
|
1079
|
+
if (soulHearts > 0) {
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// Regardless of the damage amount, damage to a player cannot remove a bone heart and a red heart
|
|
1084
|
+
// at the same time.
|
|
1085
|
+
const boneHearts = player.GetBoneHearts();
|
|
1086
|
+
if (boneHearts > 0) {
|
|
1087
|
+
return false;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
// Account for rotten hearts eating away at more red hearts than usual.
|
|
1091
|
+
const hearts = player.GetHearts();
|
|
1092
|
+
const rottenHearts = player.GetRottenHearts();
|
|
1093
|
+
const effectiveDamageAmount =
|
|
1094
|
+
damageAmount + Math.min(rottenHearts, damageAmount);
|
|
1095
|
+
|
|
1096
|
+
const heartsAfterDamage = hearts - effectiveDamageAmount;
|
|
1097
|
+
const nonTemporaryMaxHearts =
|
|
1098
|
+
getTaintedMagdaleneNonTemporaryMaxHearts(player);
|
|
1099
|
+
return heartsAfterDamage < nonTemporaryMaxHearts;
|
|
1100
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ export {
|
|
|
57
57
|
anyPlayerUsingPony,
|
|
58
58
|
isPlayerUsingPony,
|
|
59
59
|
} from "./features/ponyDetection";
|
|
60
|
+
export { preventChildEntities } from "./features/preventChildEntities";
|
|
60
61
|
export { preventCollectibleRotation } from "./features/preventCollectibleRotation";
|
|
61
62
|
export { registerHotkey, unregisterHotkey } from "./features/registerHotkey";
|
|
62
63
|
export {
|
package/src/initFeatures.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { persistentEntitiesInit } from "./features/persistentEntities";
|
|
|
16
16
|
import { pickupIndexInit } from "./features/pickupIndex";
|
|
17
17
|
import { playerInventoryInit } from "./features/playerInventory";
|
|
18
18
|
import { ponyDetectionInit } from "./features/ponyDetection";
|
|
19
|
+
import { preventChildEntitiesInit } from "./features/preventChildEntities";
|
|
19
20
|
import { preventCollectibleRotationInit } from "./features/preventCollectibleRotation";
|
|
20
21
|
import { registerHotkeyInit } from "./features/registerHotkey";
|
|
21
22
|
import { roomClearFrameInit } from "./features/roomClearFrame";
|
|
@@ -53,6 +54,7 @@ function initFeaturesMinor(mod: ModUpgraded) {
|
|
|
53
54
|
pickupIndexInit(mod);
|
|
54
55
|
playerInventoryInit(mod);
|
|
55
56
|
ponyDetectionInit(mod);
|
|
57
|
+
preventChildEntitiesInit(mod);
|
|
56
58
|
preventCollectibleRotationInit(mod);
|
|
57
59
|
registerHotkeyInit(mod);
|
|
58
60
|
roomClearFrameInit(mod);
|