isaacscript-common 6.11.0 → 6.12.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/callbacks/postFlip.lua +2 -2
- package/dist/callbacks/postGridEntityCustomRender.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomRender.lua +36 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomUpdate.lua +36 -0
- package/dist/callbacks/postNewRoomEarly.lua +2 -2
- package/dist/callbacks/postPickupInitFirst.lua +1 -20
- package/dist/callbacks/postPlayerFatalDamage.lua +1 -1
- package/dist/callbacks/postPlayerInitFirst.d.ts +2 -0
- package/dist/callbacks/postPlayerInitFirst.d.ts.map +1 -0
- package/dist/callbacks/postPlayerInitFirst.lua +42 -0
- package/dist/callbacks/postPlayerInitLate.lua +5 -5
- package/dist/callbacks/postPlayerReorderedCallbacks.d.ts +2 -0
- package/dist/callbacks/postPlayerReorderedCallbacks.d.ts.map +1 -0
- package/dist/callbacks/{postPlayerReordered.lua → postPlayerReorderedCallbacks.lua} +11 -37
- package/dist/callbacks/reorderedCallbacks.d.ts +5 -5
- package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -1
- package/dist/callbacks/reorderedCallbacks.lua +5 -5
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +2 -2
- package/dist/callbacks/subscriptions/postFlip.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFlip.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postFlip.lua +2 -2
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.lua +29 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.lua +29 -0
- package/dist/callbacks/subscriptions/{postPlayerInitReordered.d.ts → postPlayerInitFirst.d.ts} +2 -2
- package/dist/callbacks/subscriptions/postPlayerInitFirst.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/{postPlayerInitReordered.lua → postPlayerInitFirst.lua} +3 -3
- package/dist/constants.d.ts +1 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.lua +0 -7
- package/dist/constantsFirstLast.d.ts +5 -1
- package/dist/constantsFirstLast.d.ts.map +1 -1
- package/dist/constantsFirstLast.lua +6 -0
- package/dist/enums/ModCallbackCustom.d.ts +106 -81
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +63 -59
- package/dist/enums/private/StageTravelState.d.ts +9 -0
- package/dist/enums/private/StageTravelState.d.ts.map +1 -0
- package/dist/enums/private/StageTravelState.lua +15 -0
- package/dist/enums/private/TrapdoorAnimation.d.ts +6 -0
- package/dist/enums/private/TrapdoorAnimation.d.ts.map +1 -0
- package/dist/enums/private/TrapdoorAnimation.lua +6 -0
- package/dist/features/customGridEntity.d.ts +17 -5
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +86 -17
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +0 -13
- package/dist/features/customStage/init.d.ts.map +1 -1
- package/dist/features/customStage/init.lua +24 -2
- package/dist/features/customStage/streakText.d.ts +6 -0
- package/dist/features/customStage/streakText.d.ts.map +1 -1
- package/dist/features/customStage/streakText.lua +16 -12
- package/dist/features/customStage/versusScreen.d.ts +6 -0
- package/dist/features/customStage/versusScreen.d.ts.map +1 -1
- package/dist/features/customStage/versusScreen.lua +10 -5
- package/dist/features/customTrapdoor/blackSprite.d.ts +2 -0
- package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -0
- package/dist/features/customTrapdoor/blackSprite.lua +19 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +15 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.lua +16 -0
- package/dist/features/customTrapdoor/exports.d.ts +29 -0
- package/dist/features/customTrapdoor/exports.d.ts.map +1 -0
- package/dist/features/customTrapdoor/exports.lua +93 -0
- package/dist/features/customTrapdoor/init.d.ts +3 -0
- package/dist/features/customTrapdoor/init.d.ts.map +1 -0
- package/dist/features/customTrapdoor/init.lua +174 -0
- package/dist/features/customTrapdoor/openClose.d.ts +5 -0
- package/dist/features/customTrapdoor/openClose.d.ts.map +1 -0
- package/dist/features/customTrapdoor/openClose.lua +60 -0
- package/dist/features/customTrapdoor/touched.d.ts +4 -0
- package/dist/features/customTrapdoor/touched.d.ts.map +1 -0
- package/dist/features/customTrapdoor/touched.lua +159 -0
- package/dist/features/customTrapdoor/v.d.ts +18 -0
- package/dist/features/customTrapdoor/v.d.ts.map +1 -0
- package/dist/features/customTrapdoor/v.lua +17 -0
- package/dist/features/deployJSONRoom.d.ts +2 -2
- package/dist/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/features/deployJSONRoom.lua +3 -3
- package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/init.lua +3 -1
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +6 -6
- package/dist/features/pause.d.ts +1 -1
- package/dist/features/pause.d.ts.map +1 -1
- package/dist/features/pause.lua +87 -8
- package/dist/features/persistentEntities.d.ts.map +1 -1
- package/dist/features/persistentEntities.lua +7 -7
- package/dist/features/pickupIndex.d.ts +19 -0
- package/dist/features/pickupIndex.d.ts.map +1 -0
- package/dist/features/pickupIndex.lua +197 -0
- package/dist/features/roomHistory.d.ts +24 -0
- package/dist/features/roomHistory.d.ts.map +1 -0
- package/dist/features/roomHistory.lua +89 -0
- package/dist/features/taintedLazarusPlayers.d.ts.map +1 -1
- package/dist/features/taintedLazarusPlayers.lua +13 -21
- package/dist/functions/{character.d.ts → characters.d.ts} +3 -1
- package/dist/functions/characters.d.ts.map +1 -0
- package/dist/functions/{character.lua → characters.lua} +12 -0
- package/dist/functions/collectibles.d.ts +26 -13
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +26 -13
- package/dist/functions/entities.d.ts +3 -3
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/entities.lua +8 -3
- package/dist/functions/gridEntities.d.ts +2 -2
- package/dist/functions/gridEntities.lua +2 -2
- package/dist/functions/isaacAPIClass.d.ts +64 -0
- package/dist/functions/isaacAPIClass.d.ts.map +1 -1
- package/dist/functions/isaacAPIClass.lua +84 -1
- package/dist/functions/log.lua +3 -3
- package/dist/functions/pickupVariants.d.ts +2 -2
- package/dist/functions/pickupVariants.d.ts.map +1 -1
- package/dist/functions/pickupVariants.lua +2 -2
- package/dist/functions/playerCenter.lua +2 -2
- package/dist/functions/playerIndex.d.ts +11 -5
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +19 -26
- package/dist/functions/players.lua +4 -4
- package/dist/functions/revive.lua +2 -2
- package/dist/functions/roomData.d.ts +3 -2
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.lua +3 -2
- package/dist/functions/rooms.d.ts +6 -6
- package/dist/functions/rooms.lua +6 -6
- package/dist/functions/stage.d.ts +1 -0
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +4 -0
- package/dist/functions/table.d.ts +1 -1
- package/dist/functions/table.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +33 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +11 -2
- package/dist/initFeatures.d.ts +1 -2
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +16 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +6 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/CustomGridEntityData.d.ts +6 -2
- package/dist/interfaces/CustomGridEntityData.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +14 -0
- package/dist/interfaces/RoomDescription.d.ts.map +1 -0
- package/dist/interfaces/RoomDescription.lua +2 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +7 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.lua +2 -0
- package/dist/lib/jsonLua.lua +2 -0
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +9 -3
- package/dist/objects/characterDamageMultipliers.d.ts +6 -0
- package/dist/objects/characterDamageMultipliers.d.ts.map +1 -0
- package/dist/objects/characterDamageMultipliers.lua +49 -0
- package/dist/types/CollectibleIndex.d.ts +1 -1
- package/dist/types/PickupIndex.d.ts +17 -0
- package/dist/types/PickupIndex.d.ts.map +1 -0
- package/dist/types/PickupIndex.lua +2 -0
- package/dist/types/PlayerIndex.d.ts +1 -1
- package/dist/upgradeMod.lua +2 -4
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +3 -3
- package/src/callbacks/itemPickup.ts +3 -3
- package/src/callbacks/postAmbush.ts +3 -3
- package/src/callbacks/postEsauJr.ts +3 -3
- package/src/callbacks/postFlip.ts +6 -5
- package/src/callbacks/postGridEntity.ts +5 -5
- package/src/callbacks/postGridEntityCustomRender.ts +44 -0
- package/src/callbacks/postGridEntityCustomUpdate.ts +44 -0
- package/src/callbacks/postNewRoomEarly.ts +2 -2
- package/src/callbacks/postPickupInitFirst.ts +1 -32
- package/src/callbacks/postPlayerCollectible.ts +2 -2
- package/src/callbacks/postPlayerFatalDamage.ts +5 -0
- package/src/callbacks/postPlayerInitFirst.ts +57 -0
- package/src/callbacks/postPlayerInitLate.ts +9 -5
- package/src/callbacks/{postPlayerReordered.ts → postPlayerReorderedCallbacks.ts} +12 -32
- package/src/callbacks/postSlotInitUpdate.ts +5 -2
- package/src/callbacks/postSlotRender.ts +2 -2
- package/src/callbacks/reorderedCallbacks.ts +10 -9
- package/src/callbacks/subscriptions/postFirstFlip.ts +6 -3
- package/src/callbacks/subscriptions/postFlip.ts +6 -3
- package/src/callbacks/subscriptions/postGridEntityCustomRender.ts +41 -0
- package/src/callbacks/subscriptions/postGridEntityCustomUpdate.ts +41 -0
- package/src/callbacks/subscriptions/{postPlayerInitReordered.ts → postPlayerInitFirst.ts} +6 -6
- package/src/constants.ts +1 -9
- package/src/constantsFirstLast.ts +16 -0
- package/src/enums/ModCallbackCustom.ts +52 -25
- package/src/enums/private/StageTravelState.ts +8 -0
- package/src/enums/private/TrapdoorAnimation.ts +5 -0
- package/src/features/customGridEntity.ts +118 -12
- package/src/features/customStage/exports.ts +3 -22
- package/src/features/customStage/init.ts +30 -1
- package/src/features/customStage/streakText.ts +13 -5
- package/src/features/customStage/versusScreen.ts +20 -12
- package/src/features/customTrapdoor/blackSprite.ts +16 -0
- package/src/features/customTrapdoor/customTrapdoorConstants.ts +23 -0
- package/src/features/customTrapdoor/exports.ts +99 -0
- package/src/features/customTrapdoor/init.ts +217 -0
- package/src/features/customTrapdoor/openClose.ts +103 -0
- package/src/features/customTrapdoor/touched.ts +195 -0
- package/src/features/customTrapdoor/v.ts +26 -0
- package/src/features/deployJSONRoom.ts +10 -5
- package/src/features/extraConsoleCommands/init.ts +5 -2
- package/src/features/extraConsoleCommands/listCommands.ts +6 -8
- package/src/features/pause.ts +97 -7
- package/src/features/persistentEntities.ts +9 -8
- package/src/features/pickupIndex.ts +257 -0
- package/src/features/playerInventory.ts +2 -2
- package/src/features/roomHistory.ts +113 -0
- package/src/features/saveDataManager/main.ts +3 -3
- package/src/features/taintedLazarusPlayers.ts +37 -36
- package/src/functions/{character.ts → characters.ts} +13 -0
- package/src/functions/collectibles.ts +26 -13
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/entities.ts +7 -4
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/isaacAPIClass.ts +106 -1
- package/src/functions/pickupVariants.ts +2 -2
- package/src/functions/playerCenter.ts +2 -2
- package/src/functions/playerIndex.ts +26 -23
- package/src/functions/players.ts +1 -1
- package/src/functions/revive.ts +1 -1
- package/src/functions/rng.ts +1 -1
- package/src/functions/roomData.ts +3 -2
- package/src/functions/rooms.ts +6 -6
- package/src/functions/stage.ts +10 -1
- package/src/functions/table.ts +2 -2
- package/src/index.ts +9 -2
- package/src/initCustomCallbacks.ts +7 -1
- package/src/initFeatures.ts +13 -2
- package/src/interfaces/AddCallbackParameterCustom.ts +6 -2
- package/src/interfaces/CustomGridEntityData.ts +7 -2
- package/src/interfaces/RoomDescription.ts +19 -0
- package/src/interfaces/private/CustomTrapdoorDescription.ts +7 -0
- package/src/lib/jsonLua.lua +2 -0
- package/src/objects/callbackRegisterFunctions.ts +8 -3
- package/src/objects/characterDamageMultipliers.ts +49 -0
- package/src/types/CollectibleIndex.ts +1 -1
- package/src/types/PickupIndex.ts +15 -0
- package/src/types/PlayerIndex.ts +1 -1
- package/src/upgradeMod.ts +4 -4
- package/dist/callbacks/postPlayerReordered.d.ts +0 -2
- package/dist/callbacks/postPlayerReordered.d.ts.map +0 -1
- package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts.map +0 -1
- package/dist/functions/character.d.ts.map +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local canPlayerInteractWithTrapdoor, playerTouchedCustomTrapdoor, setPlayerAttributes, dropTaintedForgotten, startDelayedJump, adjustPlayerPositionToTrapdoor
|
|
7
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
9
|
+
local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
|
|
10
|
+
local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
|
|
11
|
+
local EntityPartition = ____isaac_2Dtypescript_2Ddefinitions.EntityPartition
|
|
12
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
13
|
+
local ____constants = require("constants")
|
|
14
|
+
local VectorZero = ____constants.VectorZero
|
|
15
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
16
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
17
|
+
local ____easing = require("functions.easing")
|
|
18
|
+
local easeOutSine = ____easing.easeOutSine
|
|
19
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
20
|
+
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
21
|
+
local getOtherPlayers = ____playerIndex.getOtherPlayers
|
|
22
|
+
local isChildPlayer = ____playerIndex.isChildPlayer
|
|
23
|
+
local ____players = require("functions.players")
|
|
24
|
+
local isCharacter = ____players.isCharacter
|
|
25
|
+
local ____disableInputs = require("features.disableInputs")
|
|
26
|
+
local disableAllInputsExceptFor = ____disableInputs.disableAllInputsExceptFor
|
|
27
|
+
local ____ponyDetection = require("features.ponyDetection")
|
|
28
|
+
local isPlayerUsingPony = ____ponyDetection.isPlayerUsingPony
|
|
29
|
+
local ____runInNFrames = require("features.runInNFrames")
|
|
30
|
+
local runInNGameFrames = ____runInNFrames.runInNGameFrames
|
|
31
|
+
local runNextRenderFrame = ____runInNFrames.runNextRenderFrame
|
|
32
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
33
|
+
local ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = ____customTrapdoorConstants.ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL
|
|
34
|
+
local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
|
|
35
|
+
local OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES
|
|
36
|
+
local OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
|
|
37
|
+
local TRAPDOOR_TOUCH_DISTANCE = ____customTrapdoorConstants.TRAPDOOR_TOUCH_DISTANCE
|
|
38
|
+
local ____v = require("features.customTrapdoor.v")
|
|
39
|
+
local v = ____v.default
|
|
40
|
+
function canPlayerInteractWithTrapdoor(self, player)
|
|
41
|
+
local sprite = player:GetSprite()
|
|
42
|
+
local animation = sprite:GetAnimation()
|
|
43
|
+
return not player:IsHoldingItem() and not ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL:has(animation)
|
|
44
|
+
end
|
|
45
|
+
function playerTouchedCustomTrapdoor(self, gridEntity, trapdoorDescription, player)
|
|
46
|
+
v.run.state = StageTravelState.PLAYERS_JUMPING_DOWN
|
|
47
|
+
v.run.destination = trapdoorDescription.destination
|
|
48
|
+
local whitelist = __TS__New(Set, {ButtonAction.CONSOLE})
|
|
49
|
+
disableAllInputsExceptFor(nil, CUSTOM_TRAPDOOR_FEATURE_NAME, whitelist)
|
|
50
|
+
setPlayerAttributes(nil, player, gridEntity.Position)
|
|
51
|
+
dropTaintedForgotten(nil, player)
|
|
52
|
+
player:PlayExtraAnimation("Trapdoor")
|
|
53
|
+
local otherPlayers = getOtherPlayers(nil, player)
|
|
54
|
+
__TS__ArrayForEach(
|
|
55
|
+
otherPlayers,
|
|
56
|
+
function(____, otherPlayer, i)
|
|
57
|
+
local gameFramesToWaitBeforeJumping = OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES * (i + 1)
|
|
58
|
+
local otherPlayerPtr = EntityPtr(otherPlayer)
|
|
59
|
+
runInNGameFrames(
|
|
60
|
+
nil,
|
|
61
|
+
function()
|
|
62
|
+
startDelayedJump(nil, otherPlayerPtr, gridEntity.Position)
|
|
63
|
+
end,
|
|
64
|
+
gameFramesToWaitBeforeJumping
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
function setPlayerAttributes(self, trapdoorPlayer, position)
|
|
70
|
+
trapdoorPlayer.Position = position
|
|
71
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
72
|
+
player.ControlsEnabled = false
|
|
73
|
+
player.Velocity = VectorZero
|
|
74
|
+
player.EntityCollisionClass = EntityCollisionClass.NONE
|
|
75
|
+
player.GridCollisionClass = EntityGridCollisionClass.NONE
|
|
76
|
+
player.SubType = -1
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
function dropTaintedForgotten(self, player)
|
|
80
|
+
if isCharacter(nil, player, PlayerType.THE_FORGOTTEN_B) then
|
|
81
|
+
local taintedSoul = player:GetOtherTwin()
|
|
82
|
+
if taintedSoul ~= nil then
|
|
83
|
+
taintedSoul:ThrowHeldEntity(VectorZero)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
function startDelayedJump(self, entityPtr, trapdoorPosition)
|
|
88
|
+
local entity = entityPtr.Ref
|
|
89
|
+
if entity == nil then
|
|
90
|
+
return
|
|
91
|
+
end
|
|
92
|
+
local player = entity:ToPlayer()
|
|
93
|
+
if player == nil then
|
|
94
|
+
return
|
|
95
|
+
end
|
|
96
|
+
player:PlayExtraAnimation("Trapdoor")
|
|
97
|
+
adjustPlayerPositionToTrapdoor(nil, entityPtr, player.Position, trapdoorPosition)
|
|
98
|
+
end
|
|
99
|
+
function adjustPlayerPositionToTrapdoor(self, entityPtr, startPos, endPos)
|
|
100
|
+
if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
|
|
101
|
+
return
|
|
102
|
+
end
|
|
103
|
+
local entity = entityPtr.Ref
|
|
104
|
+
if entity == nil then
|
|
105
|
+
return
|
|
106
|
+
end
|
|
107
|
+
local player = entity:ToPlayer()
|
|
108
|
+
if player == nil then
|
|
109
|
+
return
|
|
110
|
+
end
|
|
111
|
+
runNextRenderFrame(
|
|
112
|
+
nil,
|
|
113
|
+
function()
|
|
114
|
+
adjustPlayerPositionToTrapdoor(nil, entityPtr, startPos, endPos)
|
|
115
|
+
end
|
|
116
|
+
)
|
|
117
|
+
local sprite = player:GetSprite()
|
|
118
|
+
if sprite:IsFinished("Trapdoor") then
|
|
119
|
+
player.Position = endPos
|
|
120
|
+
player.Velocity = VectorZero
|
|
121
|
+
return
|
|
122
|
+
end
|
|
123
|
+
local frame = sprite:GetFrame()
|
|
124
|
+
if frame >= OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES then
|
|
125
|
+
player.Position = endPos
|
|
126
|
+
player.Velocity = VectorZero
|
|
127
|
+
return
|
|
128
|
+
end
|
|
129
|
+
local totalDifference = endPos - startPos
|
|
130
|
+
local progress = frame / OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
|
|
131
|
+
local easeProgress = easeOutSine(nil, progress)
|
|
132
|
+
local differenceForThisFrame = totalDifference * easeProgress
|
|
133
|
+
local targetPosition = startPos + differenceForThisFrame
|
|
134
|
+
player.Position = targetPosition
|
|
135
|
+
player.Velocity = VectorZero
|
|
136
|
+
end
|
|
137
|
+
function ____exports.checkCustomTrapdoorPlayerTouched(self, gridEntity, trapdoorDescription)
|
|
138
|
+
if v.run.state ~= StageTravelState.NONE then
|
|
139
|
+
return
|
|
140
|
+
end
|
|
141
|
+
if not trapdoorDescription.open then
|
|
142
|
+
return
|
|
143
|
+
end
|
|
144
|
+
local playersTouching = Isaac.FindInRadius(gridEntity.Position, TRAPDOOR_TOUCH_DISTANCE, EntityPartition.PLAYER)
|
|
145
|
+
for ____, playerEntity in ipairs(playersTouching) do
|
|
146
|
+
do
|
|
147
|
+
local player = playerEntity:ToPlayer()
|
|
148
|
+
if player == nil then
|
|
149
|
+
goto __continue5
|
|
150
|
+
end
|
|
151
|
+
if not isPlayerUsingPony(nil, player) and not isChildPlayer(nil, player) and canPlayerInteractWithTrapdoor(nil, player) then
|
|
152
|
+
playerTouchedCustomTrapdoor(nil, gridEntity, trapdoorDescription, player)
|
|
153
|
+
return
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
::__continue5::
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
return ____exports
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { DefaultMap } from "../../classes/DefaultMap";
|
|
3
|
+
import { StageTravelState } from "../../enums/private/StageTravelState";
|
|
4
|
+
import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
|
|
5
|
+
declare const v: {
|
|
6
|
+
run: {
|
|
7
|
+
state: StageTravelState;
|
|
8
|
+
/** The render frame that this state was reached. */
|
|
9
|
+
stateRenderFrame: number | null;
|
|
10
|
+
destination: string | [stage: LevelStage, stageType: StageType] | null;
|
|
11
|
+
};
|
|
12
|
+
level: {
|
|
13
|
+
/** Indexed by room list index and grid index. */
|
|
14
|
+
trapdoors: DefaultMap<number, Map<number, CustomTrapdoorDescription>, []>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default v;
|
|
18
|
+
//# sourceMappingURL=v.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE/F,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAUpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
6
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
7
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
8
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
9
|
+
local v = {
|
|
10
|
+
run = {state = StageTravelState.NONE, stateRenderFrame = nil, destination = nil},
|
|
11
|
+
level = {trapdoors = __TS__New(
|
|
12
|
+
DefaultMap,
|
|
13
|
+
function() return __TS__New(Map) end
|
|
14
|
+
)}
|
|
15
|
+
}
|
|
16
|
+
____exports.default = v
|
|
17
|
+
return ____exports
|
|
@@ -6,7 +6,7 @@ import { JSONRoom } from "../interfaces/JSONRoomsFile";
|
|
|
6
6
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
7
7
|
* all of the entries and grid entities in the provided JSON room.
|
|
8
8
|
*
|
|
9
|
-
* This function is meant to be used in the
|
|
9
|
+
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
10
10
|
*
|
|
11
11
|
* For example:
|
|
12
12
|
*
|
|
@@ -30,7 +30,7 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
|
|
|
30
30
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
31
31
|
* all of the entries and grid entities in one of the provided JSON rooms.
|
|
32
32
|
*
|
|
33
|
-
* This function is meant to be used in the
|
|
33
|
+
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
34
34
|
*
|
|
35
35
|
* Note that this function does not simply choose a random element in the provided array; it will
|
|
36
36
|
* properly account for each room weight using the algorithm from:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAuDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAuKvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
|
|
@@ -66,7 +66,7 @@ local ____runInNFrames = require("features.runInNFrames")
|
|
|
66
66
|
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
67
67
|
local ____exports = require("features.saveDataManager.exports")
|
|
68
68
|
local saveDataManager = ____exports.saveDataManager
|
|
69
|
-
function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player)
|
|
69
|
+
function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
|
|
70
70
|
if v.room.manuallyUsingShovel then
|
|
71
71
|
return nil
|
|
72
72
|
end
|
|
@@ -481,7 +481,7 @@ end
|
|
|
481
481
|
-- Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
482
482
|
-- all of the entries and grid entities in the provided JSON room.
|
|
483
483
|
--
|
|
484
|
-
-- This function is meant to be used in the
|
|
484
|
+
-- This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
485
485
|
--
|
|
486
486
|
-- For example:
|
|
487
487
|
--
|
|
@@ -528,7 +528,7 @@ end
|
|
|
528
528
|
-- Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
529
529
|
-- all of the entries and grid entities in one of the provided JSON rooms.
|
|
530
530
|
--
|
|
531
|
-
-- This function is meant to be used in the
|
|
531
|
+
-- This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
532
532
|
--
|
|
533
533
|
-- Note that this function does not simply choose a random element in the provided array; it will
|
|
534
534
|
-- properly account for each room weight using the algorithm from:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAWxD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAK/D"}
|
|
@@ -11,6 +11,8 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
11
11
|
local TearVariant = ____isaac_2Dtypescript_2Ddefinitions.TearVariant
|
|
12
12
|
local ____constants = require("constants")
|
|
13
13
|
local MAX_SPEED_STAT = ____constants.MAX_SPEED_STAT
|
|
14
|
+
local ____flag = require("functions.flag")
|
|
15
|
+
local bitFlags = ____flag.bitFlags
|
|
14
16
|
local ____map = require("functions.map")
|
|
15
17
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
16
18
|
local ____utils = require("functions.utils")
|
|
@@ -212,7 +214,7 @@ function entityTakeDmgPlayer(self)
|
|
|
212
214
|
return nil
|
|
213
215
|
end
|
|
214
216
|
function postCurseEval(self, curses)
|
|
215
|
-
return v.persistent.disableCurses and LevelCurse.NONE or curses
|
|
217
|
+
return v.persistent.disableCurses and bitFlags(nil, LevelCurse.NONE) or curses
|
|
216
218
|
end
|
|
217
219
|
function executeCmd(self, command, params)
|
|
218
220
|
local resultTuple = getMapPartialMatch(nil, command, extraConsoleCommandsFunctionMap)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AAmGA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,G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ED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -20,24 +20,24 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
20
20
|
local game = ____cachedClasses.game
|
|
21
21
|
local sfxManager = ____cachedClasses.sfxManager
|
|
22
22
|
local ____constants = require("constants")
|
|
23
|
-
local FIRST_ROOM_TYPE = ____constants.FIRST_ROOM_TYPE
|
|
24
|
-
local FIRST_STAGE = ____constants.FIRST_STAGE
|
|
25
|
-
local LAST_ROOM_TYPE = ____constants.LAST_ROOM_TYPE
|
|
26
|
-
local LAST_STAGE = ____constants.LAST_STAGE
|
|
27
23
|
local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
|
|
28
24
|
local ____constantsFirstLast = require("constantsFirstLast")
|
|
29
25
|
local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
|
|
30
26
|
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
31
27
|
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
28
|
+
local FIRST_ROOM_TYPE = ____constantsFirstLast.FIRST_ROOM_TYPE
|
|
29
|
+
local FIRST_STAGE = ____constantsFirstLast.FIRST_STAGE
|
|
32
30
|
local LAST_CARD = ____constantsFirstLast.LAST_CARD
|
|
33
31
|
local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
|
|
32
|
+
local LAST_ROOM_TYPE = ____constantsFirstLast.LAST_ROOM_TYPE
|
|
33
|
+
local LAST_STAGE = ____constantsFirstLast.LAST_STAGE
|
|
34
34
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
35
35
|
local ____HealthType = require("enums.HealthType")
|
|
36
36
|
local HealthType = ____HealthType.HealthType
|
|
37
37
|
local ____cards = require("functions.cards")
|
|
38
38
|
local getCardName = ____cards.getCardName
|
|
39
|
-
local
|
|
40
|
-
local getCharacterName =
|
|
39
|
+
local ____characters = require("functions.characters")
|
|
40
|
+
local getCharacterName = ____characters.getCharacterName
|
|
41
41
|
local ____charge = require("functions.charge")
|
|
42
42
|
local addCharge = ____charge.addCharge
|
|
43
43
|
local ____collectibles = require("functions.collectibles")
|
package/dist/features/pause.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Under the hood, this function:
|
|
6
6
|
* - uses the Pause collectible on every game frame
|
|
7
|
-
* - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
|
|
7
|
+
* - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and `ButtonAction.CONSOLE`)
|
|
8
8
|
*/
|
|
9
9
|
export declare function pause(): void;
|
|
10
10
|
/** Helper function to put things back to normal after the `pause` function was used. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":"AA6GA;;;;;;;GAOG;AACH,wBAAgB,KAAK,IAAI,IAAI,CA8C5B;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,IAAI,CAqB9B"}
|
package/dist/features/pause.lua
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
5
|
+
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
6
|
+
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
7
|
+
local Set = ____lualib.Set
|
|
4
8
|
local ____exports = {}
|
|
5
|
-
local postUpdate, inputActionGetActionValue, v
|
|
9
|
+
local postUpdate, stopTearsAndProjectilesFromMoving, inputActionGetActionValue, v
|
|
6
10
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
11
|
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
8
12
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
13
|
local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
|
|
10
14
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
15
|
+
local ____constants = require("constants")
|
|
16
|
+
local VectorZero = ____constants.VectorZero
|
|
17
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
18
|
+
local getProjectiles = ____entitiesSpecific.getProjectiles
|
|
19
|
+
local getTears = ____entitiesSpecific.getTears
|
|
20
|
+
local removeAllProjectiles = ____entitiesSpecific.removeAllProjectiles
|
|
21
|
+
local removeAllTears = ____entitiesSpecific.removeAllTears
|
|
22
|
+
local ____isaacAPIClass = require("functions.isaacAPIClass")
|
|
23
|
+
local isTear = ____isaacAPIClass.isTear
|
|
11
24
|
local ____log = require("functions.log")
|
|
12
25
|
local logError = ____log.logError
|
|
26
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
27
|
+
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
13
28
|
local ____players = require("functions.players")
|
|
14
29
|
local useActiveItemTemp = ____players.useActiveItemTemp
|
|
15
30
|
local ____disableInputs = require("features.disableInputs")
|
|
@@ -21,8 +36,37 @@ function postUpdate(self)
|
|
|
21
36
|
if not v.run.isPseudoPaused then
|
|
22
37
|
return
|
|
23
38
|
end
|
|
24
|
-
local
|
|
25
|
-
useActiveItemTemp(nil,
|
|
39
|
+
local firstPlayer = Isaac.GetPlayer()
|
|
40
|
+
useActiveItemTemp(nil, firstPlayer, CollectibleType.PAUSE)
|
|
41
|
+
stopTearsAndProjectilesFromMoving(nil)
|
|
42
|
+
end
|
|
43
|
+
function stopTearsAndProjectilesFromMoving(self)
|
|
44
|
+
local ____array_0 = __TS__SparseArrayNew(table.unpack(getTears(nil)))
|
|
45
|
+
__TS__SparseArrayPush(
|
|
46
|
+
____array_0,
|
|
47
|
+
table.unpack(getProjectiles(nil))
|
|
48
|
+
)
|
|
49
|
+
local tearsAndProjectiles = {__TS__SparseArraySpread(____array_0)}
|
|
50
|
+
for ____, tearOrProjectile in ipairs(tearsAndProjectiles) do
|
|
51
|
+
do
|
|
52
|
+
local ptrHash = GetPtrHash(tearOrProjectile)
|
|
53
|
+
local initialDescription = v.run.initialDescriptions:get(ptrHash)
|
|
54
|
+
if initialDescription == nil then
|
|
55
|
+
goto __continue6
|
|
56
|
+
end
|
|
57
|
+
tearOrProjectile.Position = initialDescription.position
|
|
58
|
+
tearOrProjectile.PositionOffset = initialDescription.positionOffset
|
|
59
|
+
tearOrProjectile.Velocity = VectorZero
|
|
60
|
+
tearOrProjectile.Height = initialDescription.height
|
|
61
|
+
tearOrProjectile.FallingSpeed = 0
|
|
62
|
+
if isTear(nil, tearOrProjectile) then
|
|
63
|
+
tearOrProjectile.FallingAcceleration = initialDescription.fallingAcceleration
|
|
64
|
+
else
|
|
65
|
+
tearOrProjectile.FallingAccel = initialDescription.fallingAcceleration
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
::__continue6::
|
|
69
|
+
end
|
|
26
70
|
end
|
|
27
71
|
function inputActionGetActionValue(self, _entity, _inputHook, buttonAction)
|
|
28
72
|
if buttonAction ~= ButtonAction.SHOOT_RIGHT then
|
|
@@ -35,7 +79,11 @@ function inputActionGetActionValue(self, _entity, _inputHook, buttonAction)
|
|
|
35
79
|
return 1
|
|
36
80
|
end
|
|
37
81
|
local FEATURE_NAME = "pause"
|
|
38
|
-
v = {run = {
|
|
82
|
+
v = {run = {
|
|
83
|
+
isPseudoPaused = false,
|
|
84
|
+
shouldUnpause = false,
|
|
85
|
+
initialDescriptions = __TS__New(Map)
|
|
86
|
+
}}
|
|
39
87
|
---
|
|
40
88
|
-- @internal
|
|
41
89
|
function ____exports.pauseInit(self, mod)
|
|
@@ -48,15 +96,41 @@ end
|
|
|
48
96
|
--
|
|
49
97
|
-- Under the hood, this function:
|
|
50
98
|
-- - uses the Pause collectible on every game frame
|
|
51
|
-
-- - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
|
|
99
|
+
-- - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and `ButtonAction.CONSOLE`)
|
|
52
100
|
function ____exports.pause(self)
|
|
53
101
|
if v.run.isPseudoPaused then
|
|
54
102
|
logError("Failed to pseudo-pause the game, since it was already pseudo-paused.")
|
|
55
103
|
return
|
|
56
104
|
end
|
|
57
105
|
v.run.isPseudoPaused = true
|
|
58
|
-
|
|
106
|
+
v.run.initialDescriptions:clear()
|
|
107
|
+
local ____array_1 = __TS__SparseArrayNew(table.unpack(getTears(nil)))
|
|
108
|
+
__TS__SparseArrayPush(
|
|
109
|
+
____array_1,
|
|
110
|
+
table.unpack(getProjectiles(nil))
|
|
111
|
+
)
|
|
112
|
+
local tearsAndProjectiles = {__TS__SparseArraySpread(____array_1)}
|
|
113
|
+
for ____, tearOrProjectile in ipairs(tearsAndProjectiles) do
|
|
114
|
+
local ptrHash = GetPtrHash(tearOrProjectile)
|
|
115
|
+
local initialDescription = {
|
|
116
|
+
position = tearOrProjectile.Position,
|
|
117
|
+
positionOffset = tearOrProjectile.PositionOffset,
|
|
118
|
+
velocity = tearOrProjectile.Velocity,
|
|
119
|
+
height = tearOrProjectile.Height,
|
|
120
|
+
fallingSpeed = tearOrProjectile.FallingSpeed,
|
|
121
|
+
fallingAcceleration = isTear(nil, tearOrProjectile) and tearOrProjectile.FallingAcceleration or tearOrProjectile.FallingAccel
|
|
122
|
+
}
|
|
123
|
+
v.run.initialDescriptions:set(ptrHash, initialDescription)
|
|
124
|
+
end
|
|
125
|
+
local firstPlayer = Isaac.GetPlayer()
|
|
126
|
+
useActiveItemTemp(nil, firstPlayer, CollectibleType.PAUSE)
|
|
127
|
+
local whitelist = __TS__New(Set, {ButtonAction.MENU_CONFIRM, ButtonAction.CONSOLE})
|
|
59
128
|
disableAllInputsExceptFor(nil, FEATURE_NAME, whitelist)
|
|
129
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
130
|
+
player.ControlsEnabled = false
|
|
131
|
+
player.Velocity = VectorZero
|
|
132
|
+
end
|
|
133
|
+
stopTearsAndProjectilesFromMoving(nil)
|
|
60
134
|
end
|
|
61
135
|
--- Helper function to put things back to normal after the `pause` function was used.
|
|
62
136
|
function ____exports.unpause(self)
|
|
@@ -65,7 +139,12 @@ function ____exports.unpause(self)
|
|
|
65
139
|
return
|
|
66
140
|
end
|
|
67
141
|
v.run.isPseudoPaused = false
|
|
68
|
-
enableAllInputs(nil, FEATURE_NAME)
|
|
69
142
|
v.run.shouldUnpause = true
|
|
143
|
+
enableAllInputs(nil, FEATURE_NAME)
|
|
144
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
145
|
+
player.ControlsEnabled = true
|
|
146
|
+
end
|
|
147
|
+
removeAllTears(nil)
|
|
148
|
+
removeAllProjectiles(nil)
|
|
70
149
|
end
|
|
71
150
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistentEntities.d.ts","sourceRoot":"","sources":["../../src/features/persistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"persistentEntities.d.ts","sourceRoot":"","sources":["../../src/features/persistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAkGtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,GACf,CAAC,MAAM,EAAE,GAAG,CAAC,CAcf;AAwBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,qBAAqB,EAAE,GAAG,EAC1B,YAAY,UAAO,GAClB,IAAI,CAiBN"}
|
|
@@ -7,8 +7,6 @@ local postEntityRemove, postNewRoomReordered, spawnAndTrack, v
|
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
9
9
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
10
|
-
local ____cachedClasses = require("cachedClasses")
|
|
11
|
-
local game = ____cachedClasses.game
|
|
12
10
|
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
13
11
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
14
12
|
local ____featuresInitialized = require("featuresInitialized")
|
|
@@ -17,6 +15,8 @@ local ____entities = require("functions.entities")
|
|
|
17
15
|
local spawn = ____entities.spawn
|
|
18
16
|
local ____roomData = require("functions.roomData")
|
|
19
17
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
18
|
+
local ____roomHistory = require("features.roomHistory")
|
|
19
|
+
local getLatestRoomDescription = ____roomHistory.getLatestRoomDescription
|
|
20
20
|
local ____exports = require("features.saveDataManager.exports")
|
|
21
21
|
local saveDataManager = ____exports.saveDataManager
|
|
22
22
|
function postEntityRemove(self, entity)
|
|
@@ -26,16 +26,16 @@ function postEntityRemove(self, entity)
|
|
|
26
26
|
return
|
|
27
27
|
end
|
|
28
28
|
local index = tuple[1]
|
|
29
|
-
local
|
|
30
|
-
local
|
|
31
|
-
local
|
|
32
|
-
v.level.persistentEntities:set(index, {
|
|
29
|
+
local previousRoomDescription = getLatestRoomDescription(nil)
|
|
30
|
+
local previousRoomListIndex = previousRoomDescription.roomListIndex
|
|
31
|
+
local persistentEntityDescription = {
|
|
33
32
|
entityType = entity.Type,
|
|
34
33
|
variant = entity.Variant,
|
|
35
34
|
subType = entity.SubType,
|
|
36
35
|
roomListIndex = previousRoomListIndex,
|
|
37
36
|
position = entity.Position
|
|
38
|
-
}
|
|
37
|
+
}
|
|
38
|
+
v.level.persistentEntities:set(index, persistentEntityDescription)
|
|
39
39
|
end
|
|
40
40
|
function postNewRoomReordered(self)
|
|
41
41
|
local roomListIndex = getRoomListIndex(nil)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
3
|
+
import { PickupIndex } from "../types/PickupIndex";
|
|
4
|
+
export declare function pickupIndexInit(mod: ModUpgraded): void;
|
|
5
|
+
/**
|
|
6
|
+
* Mods often have to track variables relating to a pickups. Finding an index for these kinds of
|
|
7
|
+
* data structures is difficult, since pickups are respawned every time a player re-enters a room,
|
|
8
|
+
* so the `PtrHash` will change.
|
|
9
|
+
*
|
|
10
|
+
* Use this function to get a unique index for a pickup to use in these data structures.
|
|
11
|
+
*
|
|
12
|
+
* Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
|
|
13
|
+
* current run. For example, the first pickup spawned will have an index of 1, the second one will
|
|
14
|
+
* have an index of 2, and so on.
|
|
15
|
+
*
|
|
16
|
+
* Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getPickupIndex(pickup: EntityPickup): PickupIndex;
|
|
19
|
+
//# sourceMappingURL=pickupIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickupIndex.d.ts","sourceRoot":"","sources":["../../src/features/pickupIndex.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAgCnD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAatD;AA0KD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAahE"}
|