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
|
@@ -88,9 +88,9 @@ function renderSprite(self, customStage, sprite, position)
|
|
|
88
88
|
local adjustment = 0
|
|
89
89
|
local scale = VectorOne
|
|
90
90
|
repeat
|
|
91
|
-
local
|
|
92
|
-
local
|
|
93
|
-
if
|
|
91
|
+
local ____switch27 = animation
|
|
92
|
+
local ____cond27 = ____switch27 == UIStreakAnimation.TEXT
|
|
93
|
+
if ____cond27 then
|
|
94
94
|
do
|
|
95
95
|
if frame < TEXT_STAY_FRAME then
|
|
96
96
|
adjustment = TEXT_IN_ADJUSTMENTS[frame + 1] or 0
|
|
@@ -103,16 +103,16 @@ function renderSprite(self, customStage, sprite, position)
|
|
|
103
103
|
break
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
|
-
|
|
107
|
-
if
|
|
106
|
+
____cond27 = ____cond27 or ____switch27 == UIStreakAnimation.TEXT_IN
|
|
107
|
+
if ____cond27 then
|
|
108
108
|
do
|
|
109
109
|
adjustment = TEXT_IN_ADJUSTMENTS[frame + 1] or 0
|
|
110
110
|
scale = TEXT_IN_SCALES[frame + 1] or VectorOne
|
|
111
111
|
break
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
|
-
|
|
115
|
-
if
|
|
114
|
+
____cond27 = ____cond27 or ____switch27 == UIStreakAnimation.TEXT_OUT
|
|
115
|
+
if ____cond27 then
|
|
116
116
|
do
|
|
117
117
|
adjustment = TEXT_OUT_ADJUSTMENTS[frame + 1] or 0
|
|
118
118
|
scale = TEXT_OUT_SCALES[frame + 1] or VectorOne
|
|
@@ -127,7 +127,6 @@ function renderSprite(self, customStage, sprite, position)
|
|
|
127
127
|
until true
|
|
128
128
|
local adjustedX = centeredX + adjustment
|
|
129
129
|
local adjustedY = position.Y + STREAK_TEXT_BOTTOM_Y_OFFSET
|
|
130
|
-
sprite:RenderLayer(0, position)
|
|
131
130
|
font:DrawStringScaled(
|
|
132
131
|
name,
|
|
133
132
|
adjustedX,
|
|
@@ -203,11 +202,16 @@ TEXT_OUT_SCALES = {
|
|
|
203
202
|
Vector(3, 0.2)
|
|
204
203
|
}
|
|
205
204
|
topStreakSprite = Sprite()
|
|
206
|
-
topStreakSprite:Load("resources/gfx/ui/ui_streak.anm2", false)
|
|
207
|
-
topStreakSprite.PlaybackSpeed = TEXT_PLAYBACK_SPEED
|
|
208
205
|
bottomStreakSprite = Sprite()
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
--- We must load the sprites in an init function to prevent issues with mods that replace the vanilla
|
|
207
|
+
-- files. (For some reason, loading the sprites will cause the overwrite to no longer apply on the
|
|
208
|
+
-- second and subsequent runs.)
|
|
209
|
+
function ____exports.streakTextInit(self)
|
|
210
|
+
topStreakSprite:Load("resources/gfx/ui/ui_streak.anm2", false)
|
|
211
|
+
topStreakSprite.PlaybackSpeed = TEXT_PLAYBACK_SPEED
|
|
212
|
+
bottomStreakSprite:Load("resources/gfx/ui/ui_streak.anm2", false)
|
|
213
|
+
bottomStreakSprite.PlaybackSpeed = TEXT_PLAYBACK_SPEED
|
|
214
|
+
end
|
|
211
215
|
function ____exports.streakTextPostRender(self)
|
|
212
216
|
checkEndTopStreakText(nil)
|
|
213
217
|
trackMapInputPressed(nil)
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { CustomStage } from "../../interfaces/CustomStage";
|
|
2
|
+
/**
|
|
3
|
+
* We must load the sprites in an init function to prevent issues with mods that replace the vanilla
|
|
4
|
+
* files. (For some reason, loading the sprites will cause the overwrite to no longer apply on the
|
|
5
|
+
* second and subsequent runs.)
|
|
6
|
+
*/
|
|
7
|
+
export declare function versusScreenInit(): void;
|
|
2
8
|
export declare function playVersusScreenAnimation(customStage: CustomStage): void;
|
|
3
9
|
export declare function versusScreenPostRender(): void;
|
|
4
10
|
//# sourceMappingURL=versusScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAqE3D;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAuDxE;AA+ED,wBAAgB,sBAAsB,IAAI,IAAI,CAoC7C"}
|
|
@@ -107,17 +107,22 @@ PNG_PATH_PREFIX = "gfx/ui/boss"
|
|
|
107
107
|
PLAYER_PORTRAIT_PNG_PATH_PREFIX = "gfx/ui/stage"
|
|
108
108
|
local VANILLA_VERSUS_PLAYBACK_SPEED = 0.5
|
|
109
109
|
local versusScreenSprite = Sprite()
|
|
110
|
-
versusScreenSprite:Load("gfx/ui/boss/versusscreen.anm2", false)
|
|
111
|
-
versusScreenSprite:ReplaceSpritesheet(OVERLAY_ANM2_LAYER, ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/overlay.png")
|
|
112
|
-
versusScreenSprite:LoadGraphics()
|
|
113
110
|
--- Unfortunately, we must split the background layer into an entirely different sprite so that we
|
|
114
111
|
-- can color it with the `Color` property.
|
|
115
112
|
local versusScreenBackgroundSprite = Sprite()
|
|
116
|
-
versusScreenBackgroundSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
|
|
117
113
|
--- Unfortunately, we must split the dirt layer into an entirely different sprite so that we can
|
|
118
114
|
-- color it with the `Color` property.
|
|
119
115
|
local versusScreenDirtSpotSprite = Sprite()
|
|
120
|
-
|
|
116
|
+
--- We must load the sprites in an init function to prevent issues with mods that replace the vanilla
|
|
117
|
+
-- files. (For some reason, loading the sprites will cause the overwrite to no longer apply on the
|
|
118
|
+
-- second and subsequent runs.)
|
|
119
|
+
function ____exports.versusScreenInit(self)
|
|
120
|
+
versusScreenSprite:Load("gfx/ui/boss/versusscreen.anm2", false)
|
|
121
|
+
versusScreenSprite:ReplaceSpritesheet(OVERLAY_ANM2_LAYER, ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/overlay.png")
|
|
122
|
+
versusScreenSprite:LoadGraphics()
|
|
123
|
+
versusScreenBackgroundSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
|
|
124
|
+
versusScreenDirtSpotSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
|
|
125
|
+
end
|
|
121
126
|
function ____exports.playVersusScreenAnimation(self, customStage)
|
|
122
127
|
local room = game:GetRoom()
|
|
123
128
|
local roomType = room:GetType()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blackSprite.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/blackSprite.ts"],"names":[],"mappings":"AASA,wBAAgB,eAAe,IAAI,IAAI,CAMtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____constants = require("constants")
|
|
3
|
+
local VectorZero = ____constants.VectorZero
|
|
4
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
5
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
6
|
+
local ____customStageConstants = require("features.customStage.customStageConstants")
|
|
7
|
+
local ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = ____customStageConstants.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH
|
|
8
|
+
local ____v = require("features.customTrapdoor.v")
|
|
9
|
+
local v = ____v.default
|
|
10
|
+
local sprite = Sprite()
|
|
11
|
+
sprite:Load(ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/black.anm2", true)
|
|
12
|
+
sprite:SetFrame("Default", 0)
|
|
13
|
+
function ____exports.drawBlackSprite(self)
|
|
14
|
+
if v.run.state ~= StageTravelState.PAUSING_ON_BLACK then
|
|
15
|
+
return
|
|
16
|
+
end
|
|
17
|
+
sprite:RenderLayer(0, VectorZero)
|
|
18
|
+
end
|
|
19
|
+
return ____exports
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GridEntityType } from "isaac-typescript-definitions";
|
|
2
|
+
export declare const CUSTOM_TRAPDOOR_FEATURE_NAME = "customTrapdoor";
|
|
3
|
+
export declare const GridEntityTypeCustom: {
|
|
4
|
+
readonly TRAPDOOR_CUSTOM: GridEntityType;
|
|
5
|
+
};
|
|
6
|
+
/** This also applies to crawl spaces. The value was determined through trial and error. */
|
|
7
|
+
export declare const TRAPDOOR_OPEN_DISTANCE = 60;
|
|
8
|
+
export declare const TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS: number;
|
|
9
|
+
export declare const TRAPDOOR_BOSS_REACTION_FRAMES = 30;
|
|
10
|
+
export declare const TRAPDOOR_TOUCH_DISTANCE = 16.5;
|
|
11
|
+
export declare const ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL: ReadonlySet<string>;
|
|
12
|
+
export declare const PIXELATION_TO_BLACK_FRAMES = 52;
|
|
13
|
+
export declare const OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = 6;
|
|
14
|
+
export declare const OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = 5;
|
|
15
|
+
//# sourceMappingURL=customTrapdoorConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customTrapdoorConstants.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/customTrapdoorConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D,eAAO,MAAM,oBAAoB;;CAEvB,CAAC;AAEX,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,eAAO,MAAM,iCAAiC,QAA+B,CAAC;AAC9E,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,eAAO,MAAM,oCAAoC,EAAE,WAAW,CAAC,MAAM,CAClC,CAAC;AAEpC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,4CAA4C,IAAI,CAAC;AAC9D,eAAO,MAAM,+CAA+C,IAAI,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
____exports.CUSTOM_TRAPDOOR_FEATURE_NAME = "customTrapdoor"
|
|
6
|
+
____exports.GridEntityTypeCustom = {TRAPDOOR_CUSTOM = 1000}
|
|
7
|
+
--- This also applies to crawl spaces. The value was determined through trial and error.
|
|
8
|
+
____exports.TRAPDOOR_OPEN_DISTANCE = 60
|
|
9
|
+
____exports.TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = ____exports.TRAPDOOR_OPEN_DISTANCE * 2.5
|
|
10
|
+
____exports.TRAPDOOR_BOSS_REACTION_FRAMES = 30
|
|
11
|
+
____exports.TRAPDOOR_TOUCH_DISTANCE = 16.5
|
|
12
|
+
____exports.ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = __TS__New(Set, {"Happy", "Sad", "Jump"})
|
|
13
|
+
____exports.PIXELATION_TO_BLACK_FRAMES = 52
|
|
14
|
+
____exports.OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = 6
|
|
15
|
+
____exports.OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = 5
|
|
16
|
+
return ____exports
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to spawn a trapdoor grid entity that will have one or more of the following
|
|
4
|
+
* attributes:
|
|
5
|
+
*
|
|
6
|
+
* - custom destination (or custom logic for after the player enters)
|
|
7
|
+
* - custom graphics
|
|
8
|
+
* - custom logic for opening/closing
|
|
9
|
+
* - TODO: player jumping animation?
|
|
10
|
+
*
|
|
11
|
+
* You can use this function to take the player to your custom stage.
|
|
12
|
+
*
|
|
13
|
+
* Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
14
|
+
* respawned every time the player re-enters the room.
|
|
15
|
+
*
|
|
16
|
+
* @param gridIndexOrPosition The location in the room to spawn the trapdoor.
|
|
17
|
+
* @param destination Optional. Used to specify where the player will go after jumping into the
|
|
18
|
+
* trapdoor. Can either be a tuple containing the stage and stage type, or a
|
|
19
|
+
* string containing the name of a custom stage. If not specified at all, then
|
|
20
|
+
* the "normal" destination corresponding to the current stage and room will be
|
|
21
|
+
* used (e.g. the next floor).
|
|
22
|
+
* @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
|
|
23
|
+
* of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
|
|
24
|
+
* have animations called "Opened", "Closed", and "Open Animation".
|
|
25
|
+
* @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
|
|
26
|
+
* behavior will be used that emulates a vanilla trapdoor.
|
|
27
|
+
*/
|
|
28
|
+
export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destination?: [stage: LevelStage, stageType: StageType] | string, anm2Path?: string, spawnOpen?: boolean): GridEntity;
|
|
29
|
+
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAgBtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,EAChE,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAwCZ"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local getDefaultDestination
|
|
5
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
7
|
+
local ____cachedClasses = require("cachedClasses")
|
|
8
|
+
local game = ____cachedClasses.game
|
|
9
|
+
local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
|
|
10
|
+
local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
11
|
+
local ____featuresInitialized = require("featuresInitialized")
|
|
12
|
+
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
13
|
+
local ____nextStage = require("functions.nextStage")
|
|
14
|
+
local getNextStage = ____nextStage.getNextStage
|
|
15
|
+
local getNextStageType = ____nextStage.getNextStageType
|
|
16
|
+
local ____roomData = require("functions.roomData")
|
|
17
|
+
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
18
|
+
local ____vector = require("functions.vector")
|
|
19
|
+
local isVector = ____vector.isVector
|
|
20
|
+
local ____customGridEntity = require("features.customGridEntity")
|
|
21
|
+
local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
|
|
22
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
23
|
+
local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
|
|
24
|
+
local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
|
|
25
|
+
local ____openClose = require("features.customTrapdoor.openClose")
|
|
26
|
+
local shouldTrapdoorSpawnOpen = ____openClose.shouldTrapdoorSpawnOpen
|
|
27
|
+
local ____v = require("features.customTrapdoor.v")
|
|
28
|
+
local v = ____v.default
|
|
29
|
+
function getDefaultDestination(self)
|
|
30
|
+
local nextStage = getNextStage(nil)
|
|
31
|
+
local nextStageType = getNextStageType(nil)
|
|
32
|
+
return {nextStage, nextStageType}
|
|
33
|
+
end
|
|
34
|
+
--- Helper function to spawn a trapdoor grid entity that will have one or more of the following
|
|
35
|
+
-- attributes:
|
|
36
|
+
--
|
|
37
|
+
-- - custom destination (or custom logic for after the player enters)
|
|
38
|
+
-- - custom graphics
|
|
39
|
+
-- - custom logic for opening/closing
|
|
40
|
+
-- - TODO: player jumping animation?
|
|
41
|
+
--
|
|
42
|
+
-- You can use this function to take the player to your custom stage.
|
|
43
|
+
--
|
|
44
|
+
-- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
45
|
+
-- respawned every time the player re-enters the room.
|
|
46
|
+
--
|
|
47
|
+
-- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
|
|
48
|
+
-- @param destination Optional. Used to specify where the player will go after jumping into the
|
|
49
|
+
-- trapdoor. Can either be a tuple containing the stage and stage type, or a
|
|
50
|
+
-- string containing the name of a custom stage. If not specified at all, then
|
|
51
|
+
-- the "normal" destination corresponding to the current stage and room will be
|
|
52
|
+
-- used (e.g. the next floor).
|
|
53
|
+
-- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
|
|
54
|
+
-- of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
|
|
55
|
+
-- have animations called "Opened", "Closed", and "Open Animation".
|
|
56
|
+
-- @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
|
|
57
|
+
-- behavior will be used that emulates a vanilla trapdoor.
|
|
58
|
+
function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, destination, anm2Path, spawnOpen)
|
|
59
|
+
if anm2Path == nil then
|
|
60
|
+
anm2Path = "gfx/grid/door_11_trapdoor.anm2"
|
|
61
|
+
end
|
|
62
|
+
errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
|
|
63
|
+
local room = game:GetRoom()
|
|
64
|
+
local roomFrameCount = room:GetFrameCount()
|
|
65
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
66
|
+
local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
|
|
67
|
+
local gridEntity = spawnCustomGridEntity(
|
|
68
|
+
nil,
|
|
69
|
+
GridEntityTypeCustom.TRAPDOOR_CUSTOM,
|
|
70
|
+
gridIndexOrPosition,
|
|
71
|
+
GridCollisionClass.NONE,
|
|
72
|
+
anm2Path,
|
|
73
|
+
TrapdoorAnimation.OPENED
|
|
74
|
+
)
|
|
75
|
+
local firstSpawn = roomFrameCount ~= 0
|
|
76
|
+
local ____temp_0
|
|
77
|
+
if spawnOpen == nil then
|
|
78
|
+
____temp_0 = shouldTrapdoorSpawnOpen(nil, gridEntity, firstSpawn)
|
|
79
|
+
else
|
|
80
|
+
____temp_0 = spawnOpen
|
|
81
|
+
end
|
|
82
|
+
local open = ____temp_0
|
|
83
|
+
local destinationToUse = destination == nil and getDefaultDestination(nil) or destination
|
|
84
|
+
local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
|
|
85
|
+
local customTrapdoorDescription = {open = open, destination = destinationToUse, firstSpawn = firstSpawn}
|
|
86
|
+
roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
|
|
87
|
+
if not open then
|
|
88
|
+
local sprite = gridEntity:GetSprite()
|
|
89
|
+
sprite:Play(TrapdoorAnimation.CLOSED, true)
|
|
90
|
+
end
|
|
91
|
+
return gridEntity
|
|
92
|
+
end
|
|
93
|
+
return ____exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAwBxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
|
|
@@ -0,0 +1,174 @@
|
|
|
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, postGridEntityCustomUpdateTrapdoor
|
|
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 GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
|
|
44
|
+
local PIXELATION_TO_BLACK_FRAMES = ____customTrapdoorConstants.PIXELATION_TO_BLACK_FRAMES
|
|
45
|
+
local ____openClose = require("features.customTrapdoor.openClose")
|
|
46
|
+
local checkCustomTrapdoorOpenClose = ____openClose.checkCustomTrapdoorOpenClose
|
|
47
|
+
local ____touched = require("features.customTrapdoor.touched")
|
|
48
|
+
local checkCustomTrapdoorPlayerTouched = ____touched.checkCustomTrapdoorPlayerTouched
|
|
49
|
+
local ____v = require("features.customTrapdoor.v")
|
|
50
|
+
local v = ____v.default
|
|
51
|
+
function postRender(self)
|
|
52
|
+
checkAllPlayersJumpComplete(nil)
|
|
53
|
+
checkPixelationToBlackComplete(nil)
|
|
54
|
+
checkPausingOnBlackComplete(nil)
|
|
55
|
+
checkAllPlayersLayingDownComplete(nil)
|
|
56
|
+
drawBlackSprite(nil)
|
|
57
|
+
end
|
|
58
|
+
function checkAllPlayersJumpComplete(self)
|
|
59
|
+
if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
|
|
60
|
+
return
|
|
61
|
+
end
|
|
62
|
+
if anyPlayerPlayingExtraAnimation(nil) then
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
66
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
67
|
+
v.run.state = StageTravelState.PIXELATION_TO_BLACK
|
|
68
|
+
v.run.stateRenderFrame = renderFrameCount
|
|
69
|
+
game:StartRoomTransition(roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
70
|
+
end
|
|
71
|
+
function checkPixelationToBlackComplete(self)
|
|
72
|
+
if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
|
|
73
|
+
return
|
|
74
|
+
end
|
|
75
|
+
local hud = game:GetHUD()
|
|
76
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
77
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
78
|
+
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
79
|
+
if renderFrameCount < renderFrameScreenBlack then
|
|
80
|
+
return
|
|
81
|
+
end
|
|
82
|
+
v.run.state = StageTravelState.PAUSING_ON_BLACK
|
|
83
|
+
v.run.stateRenderFrame = renderFrameCount
|
|
84
|
+
hud:SetVisible(false)
|
|
85
|
+
goToCustomDestination(nil)
|
|
86
|
+
game:StartRoomTransition(roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
87
|
+
end
|
|
88
|
+
function checkPausingOnBlackComplete(self)
|
|
89
|
+
if v.run.state ~= StageTravelState.PAUSING_ON_BLACK or v.run.stateRenderFrame == nil then
|
|
90
|
+
return
|
|
91
|
+
end
|
|
92
|
+
local hud = game:GetHUD()
|
|
93
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
94
|
+
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
95
|
+
if renderFrameCount < renderFrameScreenBlack then
|
|
96
|
+
return
|
|
97
|
+
end
|
|
98
|
+
v.run.state = StageTravelState.PIXELATION_TO_ROOM
|
|
99
|
+
hud:SetVisible(true)
|
|
100
|
+
runNextRoom(
|
|
101
|
+
nil,
|
|
102
|
+
function()
|
|
103
|
+
movePlayersToCenter(nil)
|
|
104
|
+
v.run.state = StageTravelState.PLAYERS_LAYING_DOWN
|
|
105
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
106
|
+
player:AnimateAppear()
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
)
|
|
110
|
+
runNextGameFrame(
|
|
111
|
+
nil,
|
|
112
|
+
function()
|
|
113
|
+
topStreakTextStart(nil)
|
|
114
|
+
end
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
function checkAllPlayersLayingDownComplete(self)
|
|
118
|
+
if v.run.state ~= StageTravelState.PLAYERS_LAYING_DOWN then
|
|
119
|
+
return
|
|
120
|
+
end
|
|
121
|
+
if anyPlayerPlayingExtraAnimation(nil) then
|
|
122
|
+
return
|
|
123
|
+
end
|
|
124
|
+
v.run.state = StageTravelState.NONE
|
|
125
|
+
enableAllInputs(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
|
|
126
|
+
end
|
|
127
|
+
function goToCustomDestination(self)
|
|
128
|
+
if v.run.destination == nil then
|
|
129
|
+
return
|
|
130
|
+
end
|
|
131
|
+
if isString(nil, v.run.destination) then
|
|
132
|
+
setCustomStage(nil, "Slaughterhouse")
|
|
133
|
+
else
|
|
134
|
+
local stage, stageType = table.unpack(v.run.destination)
|
|
135
|
+
setStage(nil, stage, stageType)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
function anyPlayerPlayingExtraAnimation(self)
|
|
139
|
+
local players = getAllPlayers(nil)
|
|
140
|
+
return __TS__ArraySome(
|
|
141
|
+
players,
|
|
142
|
+
function(____, player) return not player:IsExtraAnimationFinished() end
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
function postPEffectUpdate(self, player)
|
|
146
|
+
checkJumpComplete(nil, player)
|
|
147
|
+
end
|
|
148
|
+
function checkJumpComplete(self, player)
|
|
149
|
+
if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
|
|
150
|
+
return
|
|
151
|
+
end
|
|
152
|
+
local sprite = player:GetSprite()
|
|
153
|
+
if sprite:IsFinished("Trapdoor") then
|
|
154
|
+
player.Visible = false
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
function postGridEntityCustomUpdateTrapdoor(self, gridEntity)
|
|
158
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
159
|
+
local gridIndex = gridEntity:GetGridIndex()
|
|
160
|
+
local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
|
|
161
|
+
local trapdoorDescription = roomTrapdoorMap:get(gridIndex)
|
|
162
|
+
if trapdoorDescription == nil then
|
|
163
|
+
return
|
|
164
|
+
end
|
|
165
|
+
checkCustomTrapdoorOpenClose(nil, gridEntity, trapdoorDescription)
|
|
166
|
+
checkCustomTrapdoorPlayerTouched(nil, gridEntity, trapdoorDescription)
|
|
167
|
+
end
|
|
168
|
+
function ____exports.customTrapdoorInit(self, mod)
|
|
169
|
+
saveDataManager(nil, CUSTOM_TRAPDOOR_FEATURE_NAME, v)
|
|
170
|
+
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
171
|
+
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
172
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE, postGridEntityCustomUpdateTrapdoor, GridEntityTypeCustom.TRAPDOOR_CUSTOM)
|
|
173
|
+
end
|
|
174
|
+
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":";AAgBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAa/F,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,yBAAyB,GAC7C,IAAI,CA8BN"}
|