isaacscript-common 1.0.488 → 1.0.492
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/README.md +2 -0
- package/dist/callbacks/itemPickup.lua +2 -6
- package/dist/callbacks/postBombInitLate.lua +6 -8
- package/dist/callbacks/postCursedTeleport.lua +8 -10
- package/dist/callbacks/postEffectInitLate.lua +6 -8
- package/dist/callbacks/postEsauJr.lua +2 -4
- package/dist/callbacks/postFamiliarInitLate.lua +6 -8
- package/dist/callbacks/postFlip.lua +2 -4
- package/dist/callbacks/postGridEntity.lua +8 -18
- package/dist/callbacks/postKnifeInitLate.lua +6 -8
- package/dist/callbacks/postLaserInitLate.lua +6 -8
- package/dist/callbacks/postNPCInitLate.lua +6 -8
- package/dist/callbacks/postPickupCollect.lua +1 -5
- package/dist/callbacks/postPickupInitLate.lua +6 -8
- package/dist/callbacks/postPlayerChangeHealth.lua +9 -13
- package/dist/callbacks/postPlayerChangeType.lua +1 -5
- package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
- package/dist/callbacks/postPlayerInitLate.lua +1 -5
- package/dist/callbacks/postPlayerReordered.lua +1 -1
- package/dist/callbacks/postProjectileInitLate.lua +6 -8
- package/dist/callbacks/postPurchase.lua +10 -14
- package/dist/callbacks/postSacrifice.lua +3 -3
- package/dist/callbacks/postSlotInitUpdate.lua +3 -11
- package/dist/callbacks/postSlotRenderBroken.lua +2 -8
- package/dist/callbacks/postTearInitLate.lua +6 -8
- package/dist/callbacks/postTransformation.lua +1 -5
- package/dist/callbacks/reorderedCallbacks.lua +4 -4
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPurchase.lua +8 -2
- package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
- package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
- package/dist/constants.d.ts +9 -0
- package/dist/constants.lua +41 -4
- package/dist/features/deployJSONRoom.lua +90 -61
- package/dist/features/disableInputs.lua +9 -3
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +10 -14
- package/dist/features/preventCollectibleRotate.lua +3 -9
- package/dist/features/saveDataManager/load.lua +2 -6
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/features/saveDataManager/merge.lua +2 -4
- package/dist/features/sirenHelpers.lua +5 -5
- package/dist/functions/array.lua +5 -7
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/cards.d.ts +2 -2
- package/dist/functions/charge.lua +10 -12
- package/dist/functions/collectibles.d.ts +23 -2
- package/dist/functions/collectibles.lua +26 -21
- package/dist/functions/color.lua +9 -1
- package/dist/functions/deepCopy.lua +45 -25
- package/dist/functions/deepCopyTests.lua +12 -20
- package/dist/functions/doors.lua +7 -19
- package/dist/functions/entity.lua +7 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +13 -8
- package/dist/functions/input.lua +14 -18
- package/dist/functions/jsonRoom.lua +3 -9
- package/dist/functions/language.lua +9 -1
- package/dist/functions/log.lua +18 -46
- package/dist/functions/math.lua +15 -17
- package/dist/functions/npc.lua +15 -17
- package/dist/functions/pickups.lua +14 -1
- package/dist/functions/pills.d.ts +1 -1
- package/dist/functions/player.d.ts +12 -0
- package/dist/functions/player.lua +45 -59
- package/dist/functions/playerHealth.lua +19 -9
- package/dist/functions/pocketItems.lua +4 -4
- package/dist/functions/random.lua +2 -2
- package/dist/functions/revive.lua +4 -4
- package/dist/functions/rooms.lua +13 -17
- package/dist/functions/spawnCollectible.lua +10 -2
- package/dist/functions/sprite.lua +2 -2
- package/dist/functions/stage.lua +6 -6
- package/dist/functions/tears.lua +1 -1
- package/dist/functions/transformations.lua +4 -10
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.d.ts +6 -2
- package/dist/functions/trinkets.lua +3 -5
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.lua +4 -8
- package/dist/functions/vector.lua +8 -8
- package/dist/lualib_bundle.lua +603 -555
- package/dist/maps/cardDescriptionMap.lua +99 -1
- package/dist/maps/cardNameMap.lua +99 -1
- package/dist/maps/collectibleDescriptionMap.lua +722 -1
- package/dist/maps/collectibleNameMap.lua +722 -1
- package/dist/maps/gridEntityXMLMap.lua +36 -1
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
- package/dist/maps/transformationMap.lua +19 -12
- package/dist/maps/trinketDescriptionMap.lua +190 -1
- package/dist/maps/trinketNameMap.lua +190 -1
- package/dist/sets/cards.lua +98 -2
- package/dist/types/ModUpgraded.lua +82 -166
- package/package.json +5 -5
|
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, slotVariant})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, slot)
|
|
12
|
+
local slotVariant
|
|
13
|
+
local callback
|
|
12
14
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
15
|
callback = ____value[1]
|
|
15
|
-
local slotVariant
|
|
16
16
|
slotVariant = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if
|
|
18
|
+
if slotVariant ~= nil and slotVariant ~= slot.Variant then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, slot)
|
|
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, slotVariant})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, slot)
|
|
12
|
+
local slotVariant
|
|
13
|
+
local callback
|
|
12
14
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
15
|
callback = ____value[1]
|
|
15
|
-
local slotVariant
|
|
16
16
|
slotVariant = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if
|
|
18
|
+
if slotVariant ~= nil and slotVariant ~= slot.Variant then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, slot)
|
|
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, slotVariant})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, slot)
|
|
12
|
+
local slotVariant
|
|
13
|
+
local callback
|
|
12
14
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
15
|
callback = ____value[1]
|
|
15
|
-
local slotVariant
|
|
16
16
|
slotVariant = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if
|
|
18
|
+
if slotVariant ~= nil and slotVariant ~= slot.Variant then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, slot)
|
|
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, tearVariant)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, tearVariant})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, tear)
|
|
12
|
+
local tearVariant
|
|
13
|
+
local callback
|
|
12
14
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
15
|
callback = ____value[1]
|
|
15
|
-
local tearVariant
|
|
16
16
|
tearVariant = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if
|
|
18
|
+
if tearVariant ~= nil and tearVariant ~= tear.Variant then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, tear)
|
|
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, playerForm)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, playerForm})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, player, playerForm, hasForm)
|
|
12
|
+
local callbackPlayerForm
|
|
13
|
+
local callback
|
|
12
14
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
15
|
callback = ____value[1]
|
|
15
|
-
local callbackPlayerForm
|
|
16
16
|
callbackPlayerForm = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if
|
|
18
|
+
if callbackPlayerForm ~= nil and callbackPlayerForm ~= playerForm then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, player, playerForm, hasForm)
|
|
@@ -9,8 +9,8 @@ function ____exports.register(self, callback)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, player)
|
|
12
|
+
local callback
|
|
12
13
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
14
|
callback = ____value[1]
|
|
15
15
|
local revivalType = callback(nil, player)
|
|
16
16
|
if revivalType ~= nil then
|
|
@@ -9,18 +9,18 @@ function ____exports.register(self, callback, itemType, itemID)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, itemType, itemID})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.fire(self, player, pickingUpItem)
|
|
12
|
+
local itemID
|
|
13
|
+
local itemType
|
|
14
|
+
local callback
|
|
12
15
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
-
local callback
|
|
14
16
|
callback = ____value[1]
|
|
15
|
-
local itemType
|
|
16
17
|
itemType = ____value[2]
|
|
17
|
-
local itemID
|
|
18
18
|
itemID = ____value[3]
|
|
19
19
|
do
|
|
20
|
-
if
|
|
20
|
+
if itemType ~= nil and itemType ~= pickingUpItem.type then
|
|
21
21
|
goto __continue5
|
|
22
22
|
end
|
|
23
|
-
if
|
|
23
|
+
if itemID ~= nil and itemID ~= pickingUpItem.id then
|
|
24
24
|
goto __continue5
|
|
25
25
|
end
|
|
26
26
|
callback(nil, player, pickingUpItem)
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,7 +7,16 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
|
7
7
|
/** Bombs explode when their frame count is equal to this value. */
|
|
8
8
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
9
9
|
export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
|
|
10
|
+
/**
|
|
11
|
+
* The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
|
|
12
|
+
* Baby). This set includes The Lost and Tainted Lost.
|
|
13
|
+
*/
|
|
10
14
|
export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
|
|
15
|
+
/**
|
|
16
|
+
* The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
|
|
17
|
+
* set includes The Lost and Tainted Lost.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
|
|
11
20
|
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
|
|
12
21
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
13
22
|
export declare const DISTANCE_OF_GRID_TILE = 40;
|
package/dist/constants.lua
CHANGED
|
@@ -3,8 +3,30 @@ require("lualib_bundle");
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
5
5
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
6
|
-
____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
|
|
7
|
-
|
|
6
|
+
____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
|
|
7
|
+
PlayerType.PLAYER_ISAAC,
|
|
8
|
+
PlayerType.PLAYER_MAGDALENE,
|
|
9
|
+
PlayerType.PLAYER_JUDAS,
|
|
10
|
+
PlayerType.PLAYER_BLUEBABY,
|
|
11
|
+
PlayerType.PLAYER_EVE,
|
|
12
|
+
PlayerType.PLAYER_EDEN,
|
|
13
|
+
PlayerType.PLAYER_THELOST,
|
|
14
|
+
PlayerType.PLAYER_LILITH,
|
|
15
|
+
PlayerType.PLAYER_KEEPER,
|
|
16
|
+
PlayerType.PLAYER_APOLLYON,
|
|
17
|
+
PlayerType.PLAYER_EDEN_B
|
|
18
|
+
})
|
|
19
|
+
____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
|
|
20
|
+
PlayerType.PLAYER_BLUEBABY,
|
|
21
|
+
PlayerType.PLAYER_THELOST,
|
|
22
|
+
PlayerType.PLAYER_BLACKJUDAS,
|
|
23
|
+
PlayerType.PLAYER_JUDAS_B,
|
|
24
|
+
PlayerType.PLAYER_BLUEBABY_B,
|
|
25
|
+
PlayerType.PLAYER_THELOST_B,
|
|
26
|
+
PlayerType.PLAYER_THEFORGOTTEN_B,
|
|
27
|
+
PlayerType.PLAYER_BETHANY_B
|
|
28
|
+
})
|
|
29
|
+
____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B})
|
|
8
30
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
|
|
9
31
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
10
32
|
____exports.DOOR_HITBOX_DISTANCE = 11
|
|
@@ -16,7 +38,13 @@ ____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
|
|
|
16
38
|
____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
|
|
17
39
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
|
18
40
|
____exports.ISAAC_FRAMES_PER_SECOND = 60
|
|
19
|
-
____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {
|
|
41
|
+
____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {
|
|
42
|
+
PlayerType.PLAYER_THELOST,
|
|
43
|
+
PlayerType.PLAYER_THESOUL,
|
|
44
|
+
PlayerType.PLAYER_THELOST_B,
|
|
45
|
+
PlayerType.PLAYER_JACOB2_B,
|
|
46
|
+
PlayerType.PLAYER_THESOUL_B
|
|
47
|
+
})
|
|
20
48
|
____exports.MAX_NUM_DOORS = 8
|
|
21
49
|
____exports.MAX_NUM_FAMILIARS = 64
|
|
22
50
|
____exports.MAX_NUM_INPUTS = 4
|
|
@@ -28,7 +56,16 @@ ____exports.MAX_ROOM_INDEX = 168
|
|
|
28
56
|
____exports.MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING
|
|
29
57
|
____exports.MOVEMENT_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_LEFT, ButtonAction.ACTION_RIGHT, ButtonAction.ACTION_UP, ButtonAction.ACTION_DOWN})
|
|
30
58
|
____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
|
|
31
|
-
____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {
|
|
59
|
+
____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {
|
|
60
|
+
CollectibleType.COLLECTIBLE_FORGET_ME_NOW,
|
|
61
|
+
CollectibleType.COLLECTIBLE_EDENS_SOUL,
|
|
62
|
+
CollectibleType.COLLECTIBLE_ALABASTER_BOX,
|
|
63
|
+
CollectibleType.COLLECTIBLE_PLAN_C,
|
|
64
|
+
CollectibleType.COLLECTIBLE_MAMA_MEGA,
|
|
65
|
+
CollectibleType.COLLECTIBLE_SACRIFICIAL_ALTAR,
|
|
66
|
+
CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE,
|
|
67
|
+
CollectibleType.COLLECTIBLE_R_KEY
|
|
68
|
+
})
|
|
32
69
|
____exports.SHOOTING_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_SHOOTLEFT, ButtonAction.ACTION_SHOOTRIGHT, ButtonAction.ACTION_SHOOTUP, ButtonAction.ACTION_SHOOTDOWN})
|
|
33
70
|
____exports.UI_HEART_WIDTH = 12
|
|
34
71
|
return ____exports
|
|
@@ -63,7 +63,14 @@ function respawnPersistentEntities(self)
|
|
|
63
63
|
end
|
|
64
64
|
for ____, persistentEntity in ipairs(persistentEntities) do
|
|
65
65
|
local position = room:GetGridPosition(persistentEntity.gridIndex)
|
|
66
|
-
Isaac.Spawn(
|
|
66
|
+
Isaac.Spawn(
|
|
67
|
+
persistentEntity.type,
|
|
68
|
+
persistentEntity.variant,
|
|
69
|
+
persistentEntity.subType,
|
|
70
|
+
position,
|
|
71
|
+
Vector.Zero,
|
|
72
|
+
nil
|
|
73
|
+
)
|
|
67
74
|
end
|
|
68
75
|
end
|
|
69
76
|
function ____exports.emptyRoom(self, fillWithDecorations)
|
|
@@ -88,14 +95,12 @@ end
|
|
|
88
95
|
function removeSpecificNPCs(self)
|
|
89
96
|
local game = Game()
|
|
90
97
|
local room = game:GetRoom()
|
|
91
|
-
for ____, npc in ipairs(
|
|
92
|
-
getNPCs(nil)
|
|
93
|
-
) do
|
|
98
|
+
for ____, npc in ipairs(getNPCs(nil)) do
|
|
94
99
|
do
|
|
95
100
|
if NPC_TYPES_TO_NOT_REMOVE:has(npc.Type) then
|
|
96
101
|
goto __continue25
|
|
97
102
|
end
|
|
98
|
-
if
|
|
103
|
+
if npc:HasEntityFlags(EntityFlag.FLAG_CHARM) or npc:HasEntityFlags(EntityFlag.FLAG_FRIENDLY) or npc:HasEntityFlags(EntityFlag.FLAG_PERSISTENT) then
|
|
99
104
|
goto __continue25
|
|
100
105
|
end
|
|
101
106
|
npc:ClearEntityFlags(EntityFlag.FLAG_APPEAR)
|
|
@@ -164,34 +169,40 @@ function spawnAllEntities(self, jsonRoom, seed, verbose)
|
|
|
164
169
|
local variantString = xmlEntity["$"].variant
|
|
165
170
|
local variant = tonumber(variantString)
|
|
166
171
|
if variant == nil then
|
|
167
|
-
error(
|
|
168
|
-
"Failed to convert the entity variant to a number: " .. tostring(variant)
|
|
169
|
-
)
|
|
172
|
+
error("Failed to convert the entity variant to a number: " .. tostring(variant))
|
|
170
173
|
end
|
|
171
174
|
local subTypeString = xmlEntity["$"].subtype
|
|
172
175
|
local subType = tonumber(subTypeString)
|
|
173
176
|
if subType == nil then
|
|
174
|
-
error(
|
|
175
|
-
"Failed to convert the entity sub-type to a number: " .. tostring(subType)
|
|
176
|
-
)
|
|
177
|
+
error("Failed to convert the entity sub-type to a number: " .. tostring(subType))
|
|
177
178
|
end
|
|
178
179
|
if entityType >= 1000 then
|
|
179
180
|
if verbose then
|
|
180
|
-
log(
|
|
181
|
-
((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
|
|
182
|
-
)
|
|
181
|
+
log(((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
|
|
183
182
|
end
|
|
184
|
-
spawnGridEntity(
|
|
183
|
+
spawnGridEntity(
|
|
184
|
+
nil,
|
|
185
|
+
entityType,
|
|
186
|
+
variant,
|
|
187
|
+
x,
|
|
188
|
+
y
|
|
189
|
+
)
|
|
185
190
|
else
|
|
186
191
|
seed = nextSeed(nil, seed)
|
|
187
192
|
if verbose then
|
|
188
|
-
log(
|
|
189
|
-
((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
|
|
190
|
-
)
|
|
193
|
+
log(((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
|
|
191
194
|
end
|
|
192
|
-
local entity = spawnNormalEntity(
|
|
195
|
+
local entity = spawnNormalEntity(
|
|
196
|
+
nil,
|
|
197
|
+
entityType,
|
|
198
|
+
variant,
|
|
199
|
+
subType,
|
|
200
|
+
x,
|
|
201
|
+
y,
|
|
202
|
+
seed
|
|
203
|
+
)
|
|
193
204
|
local npc = entity:ToNPC()
|
|
194
|
-
if
|
|
205
|
+
if npc ~= nil and npc.CanShutDoors then
|
|
195
206
|
shouldUnclearRoom = true
|
|
196
207
|
end
|
|
197
208
|
end
|
|
@@ -233,13 +244,27 @@ function spawnNormalEntity(self, entityType, variant, subType, x, y, seed)
|
|
|
233
244
|
local roomType = room:GetType()
|
|
234
245
|
local position = gridToPos(nil, x, y)
|
|
235
246
|
local entity
|
|
236
|
-
if
|
|
247
|
+
if entityType == EntityType.ENTITY_PICKUP and variant == PickupVariant.PICKUP_COLLECTIBLE then
|
|
237
248
|
local options = roomType == RoomType.ROOM_ANGEL
|
|
238
|
-
entity = spawnCollectible(
|
|
249
|
+
entity = spawnCollectible(
|
|
250
|
+
nil,
|
|
251
|
+
subType,
|
|
252
|
+
position,
|
|
253
|
+
seed,
|
|
254
|
+
options
|
|
255
|
+
)
|
|
239
256
|
else
|
|
240
|
-
entity = game:Spawn(
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
entity = game:Spawn(
|
|
258
|
+
entityType,
|
|
259
|
+
variant,
|
|
260
|
+
position,
|
|
261
|
+
Vector.Zero,
|
|
262
|
+
nil,
|
|
263
|
+
subType,
|
|
264
|
+
seed
|
|
265
|
+
)
|
|
266
|
+
end
|
|
267
|
+
if entityType == EntityType.ENTITY_PITFALL and variant == 0 then
|
|
243
268
|
entity.EntityCollisionClass = EntityCollisionClass.ENTCOLL_ENEMIES
|
|
244
269
|
entity.GridCollisionClass = EntityGridCollisionClass.GRIDCOLL_WALLS
|
|
245
270
|
end
|
|
@@ -267,12 +292,10 @@ function fixPitGraphics(self)
|
|
|
267
292
|
local room = game:GetRoom()
|
|
268
293
|
local gridWidth = room:GetGridWidth()
|
|
269
294
|
local pitMap = getPitMap(nil)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
) do
|
|
273
|
-
local gridIndex
|
|
295
|
+
local gridEntity
|
|
296
|
+
local gridIndex
|
|
297
|
+
for ____, ____value in __TS__Iterator(pitMap:entries()) do
|
|
274
298
|
gridIndex = ____value[1]
|
|
275
|
-
local gridEntity
|
|
276
299
|
gridEntity = ____value[2]
|
|
277
300
|
local gridIndexLeft = gridIndex - 1
|
|
278
301
|
local L = pitMap:has(gridIndexLeft)
|
|
@@ -282,24 +305,32 @@ function fixPitGraphics(self)
|
|
|
282
305
|
local U = pitMap:has(gridIndexUp)
|
|
283
306
|
local gridIndexDown = gridIndex + gridWidth
|
|
284
307
|
local D = pitMap:has(gridIndexDown)
|
|
285
|
-
local gridIndexUpLeft =
|
|
308
|
+
local gridIndexUpLeft = gridIndex - gridWidth - 1
|
|
286
309
|
local UL = pitMap:has(gridIndexUpLeft)
|
|
287
|
-
local gridIndexUpRight =
|
|
310
|
+
local gridIndexUpRight = gridIndex - gridWidth + 1
|
|
288
311
|
local UR = pitMap:has(gridIndexUpRight)
|
|
289
|
-
local gridIndexDownLeft =
|
|
312
|
+
local gridIndexDownLeft = gridIndex + gridWidth - 1
|
|
290
313
|
local DL = pitMap:has(gridIndexDownLeft)
|
|
291
|
-
local gridIndexDownRight =
|
|
314
|
+
local gridIndexDownRight = gridIndex + gridWidth + 1
|
|
292
315
|
local DR = pitMap:has(gridIndexDownRight)
|
|
293
|
-
local pitFrame = getPitFrame(
|
|
316
|
+
local pitFrame = getPitFrame(
|
|
317
|
+
nil,
|
|
318
|
+
L,
|
|
319
|
+
R,
|
|
320
|
+
U,
|
|
321
|
+
D,
|
|
322
|
+
UL,
|
|
323
|
+
UR,
|
|
324
|
+
DL,
|
|
325
|
+
DR
|
|
326
|
+
)
|
|
294
327
|
local sprite = gridEntity:GetSprite()
|
|
295
328
|
sprite:SetFrame(pitFrame)
|
|
296
329
|
end
|
|
297
330
|
end
|
|
298
331
|
function getPitMap(self)
|
|
299
332
|
local pitMap = __TS__New(Map)
|
|
300
|
-
for ____, gridEntity in ipairs(
|
|
301
|
-
getGridEntities(nil, GridEntityType.GRID_PIT)
|
|
302
|
-
) do
|
|
333
|
+
for ____, gridEntity in ipairs(getGridEntities(nil, GridEntityType.GRID_PIT)) do
|
|
303
334
|
local gridIndex = gridEntity:GetGridIndex()
|
|
304
335
|
pitMap:set(gridIndex, gridEntity)
|
|
305
336
|
end
|
|
@@ -319,52 +350,52 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
|
|
|
319
350
|
if D then
|
|
320
351
|
F = F | 8
|
|
321
352
|
end
|
|
322
|
-
if
|
|
353
|
+
if U and L and not UL and not R and not D then
|
|
323
354
|
F = 17
|
|
324
355
|
end
|
|
325
|
-
if
|
|
356
|
+
if U and R and not UR and not L and not D then
|
|
326
357
|
F = 18
|
|
327
358
|
end
|
|
328
|
-
if
|
|
359
|
+
if L and D and not DL and not U and not R then
|
|
329
360
|
F = 19
|
|
330
361
|
end
|
|
331
|
-
if
|
|
362
|
+
if R and D and not DR and not L and not U then
|
|
332
363
|
F = 20
|
|
333
364
|
end
|
|
334
|
-
if
|
|
365
|
+
if L and U and R and D and not UL then
|
|
335
366
|
F = 21
|
|
336
367
|
end
|
|
337
|
-
if
|
|
368
|
+
if L and U and R and D and not UR then
|
|
338
369
|
F = 22
|
|
339
370
|
end
|
|
340
|
-
if
|
|
371
|
+
if U and R and D and not L and not UR then
|
|
341
372
|
F = 25
|
|
342
373
|
end
|
|
343
|
-
if
|
|
374
|
+
if L and U and D and not R and not UL then
|
|
344
375
|
F = 26
|
|
345
376
|
end
|
|
346
|
-
if
|
|
377
|
+
if L and U and R and D and not DL and not DR then
|
|
347
378
|
F = 24
|
|
348
379
|
end
|
|
349
|
-
if
|
|
380
|
+
if L and U and R and D and not UR and not UL then
|
|
350
381
|
F = 23
|
|
351
382
|
end
|
|
352
|
-
if
|
|
383
|
+
if L and U and R and UL and not UR and not D then
|
|
353
384
|
F = 27
|
|
354
385
|
end
|
|
355
|
-
if
|
|
386
|
+
if L and U and R and UR and not UL and not D then
|
|
356
387
|
F = 28
|
|
357
388
|
end
|
|
358
|
-
if
|
|
389
|
+
if L and U and R and not D and not UR and not UL then
|
|
359
390
|
F = 29
|
|
360
391
|
end
|
|
361
|
-
if
|
|
392
|
+
if L and R and D and DL and not U and not DR then
|
|
362
393
|
F = 30
|
|
363
394
|
end
|
|
364
|
-
if
|
|
395
|
+
if L and R and D and DR and not U and not DL then
|
|
365
396
|
F = 31
|
|
366
397
|
end
|
|
367
|
-
if
|
|
398
|
+
if L and R and D and not U and not DL and not DR then
|
|
368
399
|
F = 32
|
|
369
400
|
end
|
|
370
401
|
return F
|
|
@@ -373,13 +404,11 @@ FEATURE_NAME = "JSON room deployer"
|
|
|
373
404
|
NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.ENTITY_DARK_ESAU})
|
|
374
405
|
PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.ENTITY_WALL_HUGGER})
|
|
375
406
|
initialized = false
|
|
376
|
-
v = {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
}
|
|
407
|
+
v = {level = {
|
|
408
|
+
deployedRoomIndexes = __TS__New(Set),
|
|
409
|
+
persistentEntities = __TS__New(Map),
|
|
410
|
+
decorationGridIndexes = __TS__New(Map)
|
|
411
|
+
}}
|
|
383
412
|
function ____exports.deployJSONRoomInit(self, mod)
|
|
384
413
|
initialized = true
|
|
385
414
|
saveDataManager(nil, "deployJSONRoom", v)
|
|
@@ -18,14 +18,20 @@ function getActionValue(self, _entity, _inputHook, buttonAction)
|
|
|
18
18
|
return getReturnValue(nil, buttonAction, false)
|
|
19
19
|
end
|
|
20
20
|
function getReturnValue(self, buttonAction, booleanCallback)
|
|
21
|
-
local
|
|
21
|
+
local ____booleanCallback_0
|
|
22
|
+
if booleanCallback then
|
|
23
|
+
____booleanCallback_0 = false
|
|
24
|
+
else
|
|
25
|
+
____booleanCallback_0 = 0
|
|
26
|
+
end
|
|
27
|
+
local disableValue = ____booleanCallback_0
|
|
22
28
|
if not v.run.enableSomeInputs then
|
|
23
29
|
return disableValue
|
|
24
30
|
end
|
|
25
|
-
if
|
|
31
|
+
if v.run.whitelist ~= nil and not v.run.whitelist:has(buttonAction) then
|
|
26
32
|
return disableValue
|
|
27
33
|
end
|
|
28
|
-
if
|
|
34
|
+
if v.run.blacklist ~= nil and v.run.blacklist:has(buttonAction) then
|
|
29
35
|
return disableValue
|
|
30
36
|
end
|
|
31
37
|
return nil
|
|
@@ -6,7 +6,7 @@ local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
|
|
|
6
6
|
local ____exports = require("features.saveDataManager.exports")
|
|
7
7
|
local saveDataManager = ____exports.saveDataManager
|
|
8
8
|
function isActionTriggered(self, _entity, _inputHook, buttonAction)
|
|
9
|
-
if
|
|
9
|
+
if buttonAction == ButtonAction.ACTION_DROP and v.run.shouldSwitch then
|
|
10
10
|
v.run.shouldSwitch = false
|
|
11
11
|
return true
|
|
12
12
|
end
|
|
@@ -23,7 +23,7 @@ end
|
|
|
23
23
|
function preGetCollectible(self, itemPoolType, _decrease, _seed)
|
|
24
24
|
local roomIndex = getRoomIndex(nil)
|
|
25
25
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
26
|
-
if
|
|
26
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
27
27
|
v.run.currentRoomIndex = roomIndex
|
|
28
28
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
29
29
|
arrayEmpty(nil, v.run.collectibleQueue)
|
|
@@ -33,14 +33,12 @@ function preGetCollectible(self, itemPoolType, _decrease, _seed)
|
|
|
33
33
|
end
|
|
34
34
|
local FEATURE_NAME = "get collectible item pool type"
|
|
35
35
|
local initialized = false
|
|
36
|
-
v = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}
|
|
36
|
+
v = {run = {
|
|
37
|
+
collectibleQueue = {},
|
|
38
|
+
collectibleItemPoolTypeMap = __TS__New(Map),
|
|
39
|
+
currentRoomIndex = nil,
|
|
40
|
+
currentRoomVisitedCount = nil
|
|
41
|
+
}}
|
|
44
42
|
function ____exports.getCollectibleItemPoolTypeInit(self, mod)
|
|
45
43
|
initialized = true
|
|
46
44
|
saveDataManager(nil, "getCollectibleItemPoolType", v)
|
|
@@ -52,13 +50,11 @@ function ____exports.getCollectibleItemPoolType(self, collectible)
|
|
|
52
50
|
local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
|
|
53
51
|
error(msg)
|
|
54
52
|
end
|
|
55
|
-
if
|
|
56
|
-
error(
|
|
57
|
-
(((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType)
|
|
58
|
-
)
|
|
53
|
+
if collectible.Type ~= EntityType.ENTITY_PICKUP or collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
54
|
+
error((((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType))
|
|
59
55
|
end
|
|
60
56
|
local ptrHash = GetPtrHash(collectible)
|
|
61
57
|
local itemPoolType = v.run.collectibleItemPoolTypeMap:get(ptrHash)
|
|
62
|
-
return
|
|
58
|
+
return itemPoolType == nil and getRoomItemPoolType(nil) or itemPoolType
|
|
63
59
|
end
|
|
64
60
|
return ____exports
|
|
@@ -16,17 +16,13 @@ function postPickupUpdateCollectible(self, pickup)
|
|
|
16
16
|
return
|
|
17
17
|
end
|
|
18
18
|
local trackedCollectibleType = v.room.trackedItems:get(pickup.InitSeed)
|
|
19
|
-
if
|
|
19
|
+
if trackedCollectibleType ~= nil and pickup.SubType ~= trackedCollectibleType then
|
|
20
20
|
setCollectibleSubType(nil, pickup, trackedCollectibleType)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
local FEATURE_NAME = "prevent collectible rotation"
|
|
24
24
|
local initialized = false
|
|
25
|
-
v = {
|
|
26
|
-
room = {
|
|
27
|
-
trackedItems = __TS__New(Map)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
25
|
+
v = {room = {trackedItems = __TS__New(Map)}}
|
|
30
26
|
function ____exports.preventCollectibleRotateInit(self, mod)
|
|
31
27
|
initialized = true
|
|
32
28
|
saveDataManager(nil, "preventCollectibleRotate", v)
|
|
@@ -39,9 +35,7 @@ function ____exports.preventCollectibleRotate(self, collectible, collectibleType
|
|
|
39
35
|
error(msg)
|
|
40
36
|
end
|
|
41
37
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
42
|
-
error(
|
|
43
|
-
"You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant)
|
|
44
|
-
)
|
|
38
|
+
error("You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant))
|
|
45
39
|
end
|
|
46
40
|
v.room.trackedItems:set(collectible.InitSeed, collectibleType)
|
|
47
41
|
postPickupUpdateCollectible(nil, collectible)
|
|
@@ -14,9 +14,7 @@ function readSaveDatFile(self, mod)
|
|
|
14
14
|
local isaacFrameCount = Isaac.GetFrameCount()
|
|
15
15
|
local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
|
|
16
16
|
if not ok then
|
|
17
|
-
log(
|
|
18
|
-
(("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg
|
|
19
|
-
)
|
|
17
|
+
log((("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg)
|
|
20
18
|
return DEFAULT_MOD_DATA
|
|
21
19
|
end
|
|
22
20
|
if jsonStringOrErrMsg == nil then
|
|
@@ -56,9 +54,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData)
|
|
|
56
54
|
goto __continue5
|
|
57
55
|
end
|
|
58
56
|
if DEBUG then
|
|
59
|
-
log(
|
|
60
|
-
"Merging in stored data for feature: " .. tostring(key)
|
|
61
|
-
)
|
|
57
|
+
log("Merging in stored data for feature: " .. tostring(key))
|
|
62
58
|
end
|
|
63
59
|
merge(nil, oldSaveDataForSubscriber, value, key)
|
|
64
60
|
end
|
|
@@ -56,7 +56,7 @@ function restoreDefaultsAll(self)
|
|
|
56
56
|
restoreDefaults(nil, SaveDataKeys.Room)
|
|
57
57
|
end
|
|
58
58
|
function restoreDefaults(self, childTableName)
|
|
59
|
-
if
|
|
59
|
+
if childTableName ~= SaveDataKeys.Run and childTableName ~= SaveDataKeys.Level and childTableName ~= SaveDataKeys.Room then
|
|
60
60
|
error("Unknown child table name of: " .. childTableName)
|
|
61
61
|
end
|
|
62
62
|
for subscriberName, saveData in pairs(saveDataMap) do
|
|
@@ -42,7 +42,7 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription)
|
|
|
42
42
|
end
|
|
43
43
|
function mergeArray(self, oldObject, newTable)
|
|
44
44
|
local oldArray = oldObject
|
|
45
|
-
if
|
|
45
|
+
if not isArray(nil, oldArray) or not isArray(nil, newTable) then
|
|
46
46
|
return false
|
|
47
47
|
end
|
|
48
48
|
tableClear(nil, oldArray)
|
|
@@ -102,9 +102,7 @@ function mergeTable(self, oldTable, newTable, traversalDescription)
|
|
|
102
102
|
end
|
|
103
103
|
else
|
|
104
104
|
if DEBUG then
|
|
105
|
-
log(
|
|
106
|
-
(("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value)
|
|
107
|
-
)
|
|
105
|
+
log((("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value))
|
|
108
106
|
end
|
|
109
107
|
oldTable[key] = value
|
|
110
108
|
end
|