isaacscript-common 6.10.2 → 6.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/postFlip.lua +2 -2
- 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/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/{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/enums/ModCallbackCustom.d.ts +19 -17
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +3 -3
- 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 +8 -5
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +66 -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 +173 -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 +141 -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.map +1 -1
- package/dist/features/deployJSONRoom.lua +1 -1
- package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/init.lua +3 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +2 -2
- 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/deepCopyTests.lua +35 -45
- package/dist/functions/jsonHelpers.d.ts +6 -0
- package/dist/functions/jsonHelpers.d.ts.map +1 -1
- package/dist/functions/jsonHelpers.lua +9 -3
- package/dist/functions/log.lua +3 -3
- package/dist/functions/playerIndex.d.ts +11 -2
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +20 -8
- package/dist/functions/players.lua +4 -4
- package/dist/functions/revive.lua +2 -2
- package/dist/functions/table.d.ts +1 -1
- package/dist/functions/table.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +10 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +5 -2
- package/dist/initFeatures.d.ts +1 -2
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +10 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +2 -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/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 +390 -0
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +3 -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/upgradeMod.d.ts.map +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/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} +9 -29
- package/src/callbacks/postSlotInitUpdate.ts +5 -2
- package/src/callbacks/postSlotRender.ts +2 -2
- package/src/callbacks/reorderedCallbacks.ts +1 -1
- package/src/callbacks/subscriptions/postFirstFlip.ts +6 -3
- package/src/callbacks/subscriptions/postFlip.ts +6 -3
- package/src/callbacks/subscriptions/{postPlayerInitReordered.ts → postPlayerInitFirst.ts} +6 -6
- package/src/enums/ModCallbackCustom.ts +19 -17
- package/src/enums/private/StageTravelState.ts +8 -0
- package/src/enums/private/TrapdoorAnimation.ts +5 -0
- package/src/features/customGridEntity.ts +93 -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 +215 -0
- package/src/features/customTrapdoor/openClose.ts +103 -0
- package/src/features/customTrapdoor/touched.ts +175 -0
- package/src/features/customTrapdoor/v.ts +26 -0
- package/src/features/deployJSONRoom.ts +6 -1
- package/src/features/extraConsoleCommands/init.ts +5 -2
- package/src/features/extraConsoleCommands/listCommands.ts +1 -1
- package/src/features/saveDataManager/main.ts +1 -1
- package/src/features/taintedLazarusPlayers.ts +32 -31
- package/src/functions/{character.ts → characters.ts} +13 -0
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/deepCopyTests.ts +44 -48
- package/src/functions/entities.ts +1 -1
- package/src/functions/jsonHelpers.ts +9 -3
- package/src/functions/playerIndex.ts +18 -2
- package/src/functions/players.ts +1 -1
- package/src/functions/revive.ts +1 -1
- package/src/functions/rng.ts +1 -1
- package/src/functions/table.ts +2 -2
- package/src/index.ts +6 -2
- package/src/initCustomCallbacks.ts +3 -1
- package/src/initFeatures.ts +9 -2
- package/src/interfaces/AddCallbackParameterCustom.ts +2 -2
- package/src/interfaces/CustomGridEntityData.ts +7 -2
- package/src/interfaces/private/CustomTrapdoorDescription.ts +7 -0
- package/src/lib/jsonLua.d.ts +10 -0
- package/src/lib/jsonLua.lua +390 -0
- package/src/objects/callbackRegisterFunctions.ts +2 -3
- package/src/objects/characterDamageMultipliers.ts +49 -0
- package/src/upgradeMod.ts +2 -3
- 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,173 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
3
|
+
local Map = ____lualib.Map
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local postRender, checkAllPlayersJumpComplete, checkPixelationToBlackComplete, checkPausingOnBlackComplete, checkAllPlayersLayingDownComplete, goToCustomDestination, anyPlayerPlayingExtraAnimation, postPEffectUpdate, checkJumpComplete, postGridEntityUpdateTrapdoor
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
8
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
9
|
+
local RoomTransitionAnim = ____isaac_2Dtypescript_2Ddefinitions.RoomTransitionAnim
|
|
10
|
+
local ____cachedClasses = require("cachedClasses")
|
|
11
|
+
local game = ____cachedClasses.game
|
|
12
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
13
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
14
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
15
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
16
|
+
local ____playerCenter = require("functions.playerCenter")
|
|
17
|
+
local movePlayersToCenter = ____playerCenter.movePlayersToCenter
|
|
18
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
19
|
+
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
20
|
+
local ____roomData = require("functions.roomData")
|
|
21
|
+
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
22
|
+
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
23
|
+
local ____stage = require("functions.stage")
|
|
24
|
+
local setStage = ____stage.setStage
|
|
25
|
+
local ____types = require("functions.types")
|
|
26
|
+
local isString = ____types.isString
|
|
27
|
+
local ____exports = require("features.customStage.exports")
|
|
28
|
+
local setCustomStage = ____exports.setCustomStage
|
|
29
|
+
local ____streakText = require("features.customStage.streakText")
|
|
30
|
+
local topStreakTextStart = ____streakText.topStreakTextStart
|
|
31
|
+
local ____disableInputs = require("features.disableInputs")
|
|
32
|
+
local enableAllInputs = ____disableInputs.enableAllInputs
|
|
33
|
+
local ____runInNFrames = require("features.runInNFrames")
|
|
34
|
+
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
35
|
+
local ____runNextRoom = require("features.runNextRoom")
|
|
36
|
+
local runNextRoom = ____runNextRoom.runNextRoom
|
|
37
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
38
|
+
local saveDataManager = ____exports.saveDataManager
|
|
39
|
+
local ____blackSprite = require("features.customTrapdoor.blackSprite")
|
|
40
|
+
local drawBlackSprite = ____blackSprite.drawBlackSprite
|
|
41
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
42
|
+
local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
|
|
43
|
+
local PIXELATION_TO_BLACK_FRAMES = ____customTrapdoorConstants.PIXELATION_TO_BLACK_FRAMES
|
|
44
|
+
local ____openClose = require("features.customTrapdoor.openClose")
|
|
45
|
+
local checkCustomTrapdoorOpenClose = ____openClose.checkCustomTrapdoorOpenClose
|
|
46
|
+
local ____touched = require("features.customTrapdoor.touched")
|
|
47
|
+
local checkCustomTrapdoorPlayerTouched = ____touched.checkCustomTrapdoorPlayerTouched
|
|
48
|
+
local ____v = require("features.customTrapdoor.v")
|
|
49
|
+
local v = ____v.default
|
|
50
|
+
function postRender(self)
|
|
51
|
+
checkAllPlayersJumpComplete(nil)
|
|
52
|
+
checkPixelationToBlackComplete(nil)
|
|
53
|
+
checkPausingOnBlackComplete(nil)
|
|
54
|
+
checkAllPlayersLayingDownComplete(nil)
|
|
55
|
+
drawBlackSprite(nil)
|
|
56
|
+
end
|
|
57
|
+
function checkAllPlayersJumpComplete(self)
|
|
58
|
+
if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
|
|
59
|
+
return
|
|
60
|
+
end
|
|
61
|
+
if anyPlayerPlayingExtraAnimation(nil) then
|
|
62
|
+
return
|
|
63
|
+
end
|
|
64
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
65
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
66
|
+
v.run.state = StageTravelState.PIXELATION_TO_BLACK
|
|
67
|
+
v.run.stateRenderFrame = renderFrameCount
|
|
68
|
+
game:StartRoomTransition(roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
69
|
+
end
|
|
70
|
+
function checkPixelationToBlackComplete(self)
|
|
71
|
+
if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
|
|
72
|
+
return
|
|
73
|
+
end
|
|
74
|
+
local hud = game:GetHUD()
|
|
75
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
76
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
77
|
+
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
78
|
+
if renderFrameCount < renderFrameScreenBlack then
|
|
79
|
+
return
|
|
80
|
+
end
|
|
81
|
+
v.run.state = StageTravelState.PAUSING_ON_BLACK
|
|
82
|
+
v.run.stateRenderFrame = renderFrameCount
|
|
83
|
+
hud:SetVisible(false)
|
|
84
|
+
goToCustomDestination(nil)
|
|
85
|
+
game:StartRoomTransition(roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
86
|
+
end
|
|
87
|
+
function checkPausingOnBlackComplete(self)
|
|
88
|
+
if v.run.state ~= StageTravelState.PAUSING_ON_BLACK or v.run.stateRenderFrame == nil then
|
|
89
|
+
return
|
|
90
|
+
end
|
|
91
|
+
local hud = game:GetHUD()
|
|
92
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
93
|
+
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
94
|
+
if renderFrameCount < renderFrameScreenBlack then
|
|
95
|
+
return
|
|
96
|
+
end
|
|
97
|
+
v.run.state = StageTravelState.PIXELATION_TO_ROOM
|
|
98
|
+
hud:SetVisible(true)
|
|
99
|
+
runNextRoom(
|
|
100
|
+
nil,
|
|
101
|
+
function()
|
|
102
|
+
movePlayersToCenter(nil)
|
|
103
|
+
v.run.state = StageTravelState.PLAYERS_LAYING_DOWN
|
|
104
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
105
|
+
player:AnimateAppear()
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
)
|
|
109
|
+
runNextGameFrame(
|
|
110
|
+
nil,
|
|
111
|
+
function()
|
|
112
|
+
topStreakTextStart(nil)
|
|
113
|
+
end
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
function checkAllPlayersLayingDownComplete(self)
|
|
117
|
+
if v.run.state ~= StageTravelState.PLAYERS_LAYING_DOWN then
|
|
118
|
+
return
|
|
119
|
+
end
|
|
120
|
+
if anyPlayerPlayingExtraAnimation(nil) then
|
|
121
|
+
return
|
|
122
|
+
end
|
|
123
|
+
v.run.state = StageTravelState.NONE
|
|
124
|
+
enableAllInputs(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
|
|
125
|
+
end
|
|
126
|
+
function goToCustomDestination(self)
|
|
127
|
+
if v.run.destination == nil then
|
|
128
|
+
return
|
|
129
|
+
end
|
|
130
|
+
if isString(nil, v.run.destination) then
|
|
131
|
+
setCustomStage(nil, "Slaughterhouse")
|
|
132
|
+
else
|
|
133
|
+
local stage, stageType = table.unpack(v.run.destination)
|
|
134
|
+
setStage(nil, stage, stageType)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
function anyPlayerPlayingExtraAnimation(self)
|
|
138
|
+
local players = getAllPlayers(nil)
|
|
139
|
+
return __TS__ArraySome(
|
|
140
|
+
players,
|
|
141
|
+
function(____, player) return not player:IsExtraAnimationFinished() end
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
function postPEffectUpdate(self, player)
|
|
145
|
+
checkJumpComplete(nil, player)
|
|
146
|
+
end
|
|
147
|
+
function checkJumpComplete(self, player)
|
|
148
|
+
if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
|
|
149
|
+
return
|
|
150
|
+
end
|
|
151
|
+
local sprite = player:GetSprite()
|
|
152
|
+
if sprite:IsFinished("Trapdoor") then
|
|
153
|
+
player.Visible = false
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
function postGridEntityUpdateTrapdoor(self, gridEntity)
|
|
157
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
158
|
+
local gridIndex = gridEntity:GetGridIndex()
|
|
159
|
+
local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
|
|
160
|
+
local trapdoorDescription = roomTrapdoorMap:get(gridIndex)
|
|
161
|
+
if trapdoorDescription == nil then
|
|
162
|
+
return
|
|
163
|
+
end
|
|
164
|
+
checkCustomTrapdoorOpenClose(nil, gridEntity, trapdoorDescription)
|
|
165
|
+
checkCustomTrapdoorPlayerTouched(nil, gridEntity, trapdoorDescription)
|
|
166
|
+
end
|
|
167
|
+
function ____exports.customTrapdoorInit(self, mod)
|
|
168
|
+
saveDataManager(nil, CUSTOM_TRAPDOOR_FEATURE_NAME, v)
|
|
169
|
+
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
170
|
+
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
171
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_GRID_ENTITY_UPDATE, postGridEntityUpdateTrapdoor)
|
|
172
|
+
end
|
|
173
|
+
return ____exports
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
|
|
3
|
+
export declare function checkCustomTrapdoorOpenClose(gridEntity: GridEntity, trapdoorDescription: CustomTrapdoorDescription): void;
|
|
4
|
+
export declare function shouldTrapdoorSpawnOpen(gridEntity: GridEntity, firstSpawn: boolean): boolean;
|
|
5
|
+
//# sourceMappingURL=openClose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openClose.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/openClose.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAQ/F,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,yBAAyB,GAC7C,IAAI,CASN;AAoDD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,OAAO,GAClB,OAAO,CAuBT"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local shouldTrapdoorOpen, isPlayerCloseAfterBoss, shouldBeClosedFromStartingInRoomWithEnemies, open
|
|
3
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
|
+
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
5
|
+
local ____cachedClasses = require("cachedClasses")
|
|
6
|
+
local game = ____cachedClasses.game
|
|
7
|
+
local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
|
|
8
|
+
local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
9
|
+
local ____positionVelocity = require("functions.positionVelocity")
|
|
10
|
+
local anyPlayerCloserThan = ____positionVelocity.anyPlayerCloserThan
|
|
11
|
+
local ____roomClearFrame = require("features.roomClearFrame")
|
|
12
|
+
local getRoomClearGameFrame = ____roomClearFrame.getRoomClearGameFrame
|
|
13
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
14
|
+
local TRAPDOOR_BOSS_REACTION_FRAMES = ____customTrapdoorConstants.TRAPDOOR_BOSS_REACTION_FRAMES
|
|
15
|
+
local TRAPDOOR_OPEN_DISTANCE = ____customTrapdoorConstants.TRAPDOOR_OPEN_DISTANCE
|
|
16
|
+
local TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = ____customTrapdoorConstants.TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS
|
|
17
|
+
function shouldTrapdoorOpen(self, gridEntity, firstSpawn)
|
|
18
|
+
local room = game:GetRoom()
|
|
19
|
+
local roomClear = room:IsClear()
|
|
20
|
+
return not anyPlayerCloserThan(nil, gridEntity.Position, TRAPDOOR_OPEN_DISTANCE) and not isPlayerCloseAfterBoss(nil, gridEntity.Position) and not shouldBeClosedFromStartingInRoomWithEnemies(nil, firstSpawn, roomClear)
|
|
21
|
+
end
|
|
22
|
+
function isPlayerCloseAfterBoss(self, position)
|
|
23
|
+
local gameFrameCount = game:GetFrameCount()
|
|
24
|
+
local room = game:GetRoom()
|
|
25
|
+
local roomType = room:GetType()
|
|
26
|
+
local roomClearGameFrame = getRoomClearGameFrame(nil)
|
|
27
|
+
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or gameFrameCount >= roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES then
|
|
28
|
+
return false
|
|
29
|
+
end
|
|
30
|
+
return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
|
|
31
|
+
end
|
|
32
|
+
function shouldBeClosedFromStartingInRoomWithEnemies(self, firstSpawn, roomClear)
|
|
33
|
+
return firstSpawn and not roomClear
|
|
34
|
+
end
|
|
35
|
+
function open(self, gridEntity, trapdoorDescription)
|
|
36
|
+
trapdoorDescription.open = true
|
|
37
|
+
local sprite = gridEntity:GetSprite()
|
|
38
|
+
sprite:Play(TrapdoorAnimation.OPEN_ANIMATION, true)
|
|
39
|
+
end
|
|
40
|
+
function ____exports.checkCustomTrapdoorOpenClose(self, gridEntity, trapdoorDescription)
|
|
41
|
+
if trapdoorDescription.open then
|
|
42
|
+
return
|
|
43
|
+
end
|
|
44
|
+
if shouldTrapdoorOpen(nil, gridEntity, trapdoorDescription.firstSpawn) then
|
|
45
|
+
open(nil, gridEntity, trapdoorDescription)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
function ____exports.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
|
|
49
|
+
local room = game:GetRoom()
|
|
50
|
+
local roomFrameCount = room:GetFrameCount()
|
|
51
|
+
local roomClear = room:IsClear()
|
|
52
|
+
if roomFrameCount > 0 then
|
|
53
|
+
return false
|
|
54
|
+
end
|
|
55
|
+
if not roomClear then
|
|
56
|
+
return false
|
|
57
|
+
end
|
|
58
|
+
return shouldTrapdoorOpen(nil, gridEntity, firstSpawn)
|
|
59
|
+
end
|
|
60
|
+
return ____exports
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
|
|
3
|
+
export declare function checkCustomTrapdoorPlayerTouched(gridEntity: GridEntity, trapdoorDescription: CustomTrapdoorDescription): void;
|
|
4
|
+
//# sourceMappingURL=touched.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touched.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/touched.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAa/F,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,yBAAyB,GAC7C,IAAI,CA8BN"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local canPlayerInteractWithTrapdoor, playerTouchedCustomTrapdoor, startDelayedJump, adjustPlayerVelocityToTrapdoor, setPlayerAttributes, dropTaintedForgotten
|
|
5
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
|
|
7
|
+
local EntityPartition = ____isaac_2Dtypescript_2Ddefinitions.EntityPartition
|
|
8
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
9
|
+
local ____constants = require("constants")
|
|
10
|
+
local VectorZero = ____constants.VectorZero
|
|
11
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
12
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
13
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
14
|
+
local getOtherPlayers = ____playerIndex.getOtherPlayers
|
|
15
|
+
local getPlayers = ____playerIndex.getPlayers
|
|
16
|
+
local isChildPlayer = ____playerIndex.isChildPlayer
|
|
17
|
+
local ____players = require("functions.players")
|
|
18
|
+
local isCharacter = ____players.isCharacter
|
|
19
|
+
local ____disableInputs = require("features.disableInputs")
|
|
20
|
+
local disableAllInputs = ____disableInputs.disableAllInputs
|
|
21
|
+
local ____ponyDetection = require("features.ponyDetection")
|
|
22
|
+
local isPlayerUsingPony = ____ponyDetection.isPlayerUsingPony
|
|
23
|
+
local ____runInNFrames = require("features.runInNFrames")
|
|
24
|
+
local runInNGameFrames = ____runInNFrames.runInNGameFrames
|
|
25
|
+
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
26
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
27
|
+
local ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = ____customTrapdoorConstants.ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL
|
|
28
|
+
local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
|
|
29
|
+
local OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES
|
|
30
|
+
local OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
|
|
31
|
+
local TRAPDOOR_TOUCH_DISTANCE = ____customTrapdoorConstants.TRAPDOOR_TOUCH_DISTANCE
|
|
32
|
+
local ____v = require("features.customTrapdoor.v")
|
|
33
|
+
local v = ____v.default
|
|
34
|
+
function canPlayerInteractWithTrapdoor(self, player)
|
|
35
|
+
local sprite = player:GetSprite()
|
|
36
|
+
local animation = sprite:GetAnimation()
|
|
37
|
+
return not player:IsHoldingItem() and not ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL:has(animation)
|
|
38
|
+
end
|
|
39
|
+
function playerTouchedCustomTrapdoor(self, gridEntity, trapdoorDescription, player)
|
|
40
|
+
v.run.state = StageTravelState.PLAYERS_JUMPING_DOWN
|
|
41
|
+
v.run.destination = trapdoorDescription.destination
|
|
42
|
+
disableAllInputs(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
|
|
43
|
+
setPlayerAttributes(nil, player, gridEntity.Position)
|
|
44
|
+
dropTaintedForgotten(nil, player)
|
|
45
|
+
player:PlayExtraAnimation("Trapdoor")
|
|
46
|
+
local otherPlayers = getOtherPlayers(nil, player)
|
|
47
|
+
__TS__ArrayForEach(
|
|
48
|
+
otherPlayers,
|
|
49
|
+
function(____, otherPlayer, i)
|
|
50
|
+
local gameFramesToWaitBeforeJumping = OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES * (i + 1)
|
|
51
|
+
local otherPlayerPtr = EntityPtr(otherPlayer)
|
|
52
|
+
runInNGameFrames(
|
|
53
|
+
nil,
|
|
54
|
+
function()
|
|
55
|
+
startDelayedJump(nil, otherPlayerPtr, gridEntity.Position)
|
|
56
|
+
end,
|
|
57
|
+
gameFramesToWaitBeforeJumping
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
function startDelayedJump(self, entityPtr, trapdoorPosition)
|
|
63
|
+
local entity = entityPtr.Ref
|
|
64
|
+
if entity == nil then
|
|
65
|
+
return
|
|
66
|
+
end
|
|
67
|
+
local player = entity:ToPlayer()
|
|
68
|
+
if player == nil then
|
|
69
|
+
return
|
|
70
|
+
end
|
|
71
|
+
player:PlayExtraAnimation("Trapdoor")
|
|
72
|
+
adjustPlayerVelocityToTrapdoor(nil, entityPtr, player.Position, trapdoorPosition)
|
|
73
|
+
end
|
|
74
|
+
function adjustPlayerVelocityToTrapdoor(self, entityPtr, startPos, endPos)
|
|
75
|
+
local entity = entityPtr.Ref
|
|
76
|
+
if entity == nil then
|
|
77
|
+
return
|
|
78
|
+
end
|
|
79
|
+
local player = entity:ToPlayer()
|
|
80
|
+
if player == nil then
|
|
81
|
+
return
|
|
82
|
+
end
|
|
83
|
+
local sprite = player:GetSprite()
|
|
84
|
+
if sprite:IsFinished("Trapdoor") then
|
|
85
|
+
return
|
|
86
|
+
end
|
|
87
|
+
local frame = sprite:GetFrame()
|
|
88
|
+
if frame > OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES then
|
|
89
|
+
return
|
|
90
|
+
end
|
|
91
|
+
local totalDifference = endPos - startPos
|
|
92
|
+
local differencePerFrame = totalDifference / OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
|
|
93
|
+
local differenceForThisFrame = differencePerFrame * (frame + 1)
|
|
94
|
+
local targetPosition = startPos + differenceForThisFrame
|
|
95
|
+
local calculatedVelocity = player.Position - targetPosition
|
|
96
|
+
player.Velocity = calculatedVelocity
|
|
97
|
+
runNextGameFrame(
|
|
98
|
+
nil,
|
|
99
|
+
function()
|
|
100
|
+
adjustPlayerVelocityToTrapdoor(nil, entityPtr, startPos, endPos)
|
|
101
|
+
end
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
function setPlayerAttributes(self, trapdoorPlayer, position)
|
|
105
|
+
trapdoorPlayer.Position = position
|
|
106
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
107
|
+
player.Velocity = VectorZero
|
|
108
|
+
player.EntityCollisionClass = EntityCollisionClass.NONE
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
function dropTaintedForgotten(self, player)
|
|
112
|
+
if isCharacter(nil, player, PlayerType.THE_FORGOTTEN_B) then
|
|
113
|
+
local taintedSoul = player:GetOtherTwin()
|
|
114
|
+
if taintedSoul ~= nil then
|
|
115
|
+
taintedSoul:ThrowHeldEntity(VectorZero)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
function ____exports.checkCustomTrapdoorPlayerTouched(self, gridEntity, trapdoorDescription)
|
|
120
|
+
if v.run.state ~= StageTravelState.NONE then
|
|
121
|
+
return
|
|
122
|
+
end
|
|
123
|
+
if not trapdoorDescription.open then
|
|
124
|
+
return
|
|
125
|
+
end
|
|
126
|
+
local playersTouching = Isaac.FindInRadius(gridEntity.Position, TRAPDOOR_TOUCH_DISTANCE, EntityPartition.PLAYER)
|
|
127
|
+
for ____, playerEntity in ipairs(playersTouching) do
|
|
128
|
+
do
|
|
129
|
+
local player = playerEntity:ToPlayer()
|
|
130
|
+
if player == nil then
|
|
131
|
+
goto __continue5
|
|
132
|
+
end
|
|
133
|
+
if not isPlayerUsingPony(nil, player) and not isChildPlayer(nil, player) and canPlayerInteractWithTrapdoor(nil, player) then
|
|
134
|
+
playerTouchedCustomTrapdoor(nil, gridEntity, trapdoorDescription, player)
|
|
135
|
+
return
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
::__continue5::
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
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
|
|
@@ -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
|
|
@@ -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)
|
|
@@ -36,8 +36,8 @@ 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")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";AA+FA;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,GACnB,YAAY,GAAG,SAAS,CAK1B"}
|
|
@@ -8,17 +8,18 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
8
8
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
9
9
|
local ____featuresInitialized = require("featuresInitialized")
|
|
10
10
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
11
|
+
local ____log = require("functions.log")
|
|
12
|
+
local logError = ____log.logError
|
|
11
13
|
local ____exports = require("features.saveDataManager.exports")
|
|
12
14
|
local saveDataManager = ____exports.saveDataManager
|
|
13
15
|
function postPlayerInit(self, player)
|
|
14
|
-
local entityPtr = EntityPtr(player)
|
|
15
16
|
local character = player:GetPlayerType()
|
|
16
17
|
if character == PlayerType.LAZARUS_B then
|
|
17
18
|
local ____v_run_queuedTaintedLazarus_0 = v.run.queuedTaintedLazarus
|
|
18
|
-
____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] =
|
|
19
|
+
____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] = player
|
|
19
20
|
elseif character == PlayerType.LAZARUS_2_B then
|
|
20
21
|
local ____v_run_queuedDeadTaintedLazarus_1 = v.run.queuedDeadTaintedLazarus
|
|
21
|
-
____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] =
|
|
22
|
+
____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] = player
|
|
22
23
|
else
|
|
23
24
|
return
|
|
24
25
|
end
|
|
@@ -28,20 +29,19 @@ function checkDequeue(self)
|
|
|
28
29
|
if #v.run.queuedTaintedLazarus == 0 or #v.run.queuedDeadTaintedLazarus == 0 then
|
|
29
30
|
return
|
|
30
31
|
end
|
|
31
|
-
local
|
|
32
|
-
local
|
|
33
|
-
if taintedLazarusPtr == nil or deadTaintedLazarusPtr == nil then
|
|
34
|
-
return
|
|
35
|
-
end
|
|
36
|
-
local taintedLazarus = taintedLazarusPtr.Ref
|
|
37
|
-
local deadTaintedLazarus = deadTaintedLazarusPtr.Ref
|
|
32
|
+
local taintedLazarus = table.remove(v.run.queuedTaintedLazarus, 1)
|
|
33
|
+
local deadTaintedLazarus = table.remove(v.run.queuedDeadTaintedLazarus, 1)
|
|
38
34
|
if taintedLazarus == nil or deadTaintedLazarus == nil then
|
|
39
35
|
return
|
|
40
36
|
end
|
|
41
37
|
local taintedLazarusPtrHash = GetPtrHash(taintedLazarus)
|
|
42
38
|
local deadTaintedLazarusPtrHash = GetPtrHash(deadTaintedLazarus)
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
if taintedLazarusPtrHash == deadTaintedLazarusPtrHash then
|
|
40
|
+
logError("Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
|
|
41
|
+
return
|
|
42
|
+
end
|
|
43
|
+
v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarus)
|
|
44
|
+
v.run.subPlayerMap:set(deadTaintedLazarusPtrHash, taintedLazarus)
|
|
45
45
|
end
|
|
46
46
|
local FEATURE_NAME = "taintedLazarusPlayers"
|
|
47
47
|
v = {run = {
|
|
@@ -72,14 +72,6 @@ end
|
|
|
72
72
|
function ____exports.getTaintedLazarusSubPlayer(self, player)
|
|
73
73
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
74
74
|
local ptrHash = GetPtrHash(player)
|
|
75
|
-
|
|
76
|
-
if entityPtr == nil then
|
|
77
|
-
return nil
|
|
78
|
-
end
|
|
79
|
-
local entity = entityPtr.Ref
|
|
80
|
-
if entity == nil then
|
|
81
|
-
return nil
|
|
82
|
-
end
|
|
83
|
-
return entity:ToPlayer()
|
|
75
|
+
return v.run.subPlayerMap:get(ptrHash)
|
|
84
76
|
end
|
|
85
77
|
return ____exports
|
|
@@ -30,6 +30,8 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
|
|
|
30
30
|
* is considered to starts with the D6, but this is not the case on a brand new save file).
|
|
31
31
|
*/
|
|
32
32
|
export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
|
|
33
|
+
/** Helper function to get the numerical damage multiplier for a character. */
|
|
34
|
+
export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
|
|
33
35
|
/**
|
|
34
36
|
* - Most characters have a 56 frame death animation (i.e. the "Death" animation).
|
|
35
37
|
* - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
|
|
@@ -46,4 +48,4 @@ export declare function getCharacterMaxHeartContainers(character: PlayerType): i
|
|
|
46
48
|
export declare function getCharacterName(character: PlayerType): string;
|
|
47
49
|
export declare function isModdedCharacter(character: PlayerType): boolean;
|
|
48
50
|
export declare function isVanillaCharacter(character: PlayerType): boolean;
|
|
49
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=characters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAW1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
|
|
@@ -3,6 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
3
3
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
4
4
|
local ____constantsFirstLast = require("constantsFirstLast")
|
|
5
5
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
6
|
+
local ____characterDamageMultipliers = require("objects.characterDamageMultipliers")
|
|
7
|
+
local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
|
|
6
8
|
local ____characterNames = require("objects.characterNames")
|
|
7
9
|
local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
|
|
8
10
|
local ____charactersThatStartWithAnActiveItemSet = require("sets.charactersThatStartWithAnActiveItemSet")
|
|
@@ -54,6 +56,16 @@ end
|
|
|
54
56
|
function ____exports.characterStartsWithActiveItem(self, character)
|
|
55
57
|
return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
|
|
56
58
|
end
|
|
59
|
+
--- Helper function to get the numerical damage multiplier for a character.
|
|
60
|
+
function ____exports.getCharacterDamageMultiplier(self, character, hasWhoreOfBabylon)
|
|
61
|
+
if hasWhoreOfBabylon == nil then
|
|
62
|
+
hasWhoreOfBabylon = false
|
|
63
|
+
end
|
|
64
|
+
if character == PlayerType.EVE and hasWhoreOfBabylon then
|
|
65
|
+
return 1
|
|
66
|
+
end
|
|
67
|
+
return CHARACTER_DAMAGE_MULTIPLIERS[character]
|
|
68
|
+
end
|
|
57
69
|
--- - Most characters have a 56 frame death animation (i.e. the "Death" animation).
|
|
58
70
|
-- - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
|
|
59
71
|
-- - Tainted Forgotten have a 20 frame death animation (i.e. the "ForgottenDeath" animation).
|