isaacscript-common 1.0.486 → 1.0.490
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 +0 -6
- package/dist/constants.lua +38 -6
- 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.d.ts +19 -7
- package/dist/functions/array.lua +32 -19
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/cards.d.ts +17 -11
- package/dist/functions/cards.lua +40 -30
- 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 +42 -22
- 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 +15 -10
- 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.d.ts +7 -2
- package/dist/functions/pickups.lua +19 -3
- package/dist/functions/pills.d.ts +1 -1
- package/dist/functions/player.lua +25 -47
- package/dist/functions/playerHealth.lua +19 -9
- package/dist/functions/pocketItems.lua +10 -10
- package/dist/functions/random.lua +2 -2
- package/dist/functions/revive.lua +4 -4
- package/dist/functions/rooms.lua +15 -18
- 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/index.d.ts +3 -0
- package/dist/index.lua +24 -0
- 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.d.ts +6 -0
- package/dist/maps/gridEntityXMLMap.lua +40 -0
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomTypeToItemPoolMap.d.ts +2 -0
- package/dist/maps/roomTypeToItemPoolMap.lua +19 -0
- 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.d.ts +25 -0
- package/dist/sets/cards.lua +106 -0
- package/dist/types/ModUpgraded.lua +82 -166
- package/dist/types/PocketItemDescription.d.ts +1 -0
- package/package.json +5 -5
|
@@ -39,18 +39,18 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
|
|
|
39
39
|
local hasTSTLMapBrand = false
|
|
40
40
|
local hasTSTLSetBrand = false
|
|
41
41
|
local hasTSTLClassBrand = false
|
|
42
|
-
if
|
|
42
|
+
if not __TS__InstanceOf(oldObject, Map) and not __TS__InstanceOf(oldObject, Set) and not isClass then
|
|
43
43
|
checkMetatable(nil, oldTable, traversalDescription)
|
|
44
44
|
hasTSTLMapBrand = oldTable[TSTL_MAP_BRAND] ~= nil
|
|
45
45
|
hasTSTLSetBrand = oldTable[TSTL_SET_BRAND] ~= nil
|
|
46
46
|
hasTSTLClassBrand = oldTable[TSTL_CLASS_BRAND] ~= nil
|
|
47
47
|
end
|
|
48
48
|
local newObject
|
|
49
|
-
if
|
|
49
|
+
if serializationType == ____exports.SerializationType.NONE and __TS__InstanceOf(oldObject, Map) or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLMapBrand then
|
|
50
50
|
newObject = __TS__New(Map)
|
|
51
|
-
elseif
|
|
51
|
+
elseif serializationType == ____exports.SerializationType.NONE and __TS__InstanceOf(oldObject, Set) or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLSetBrand then
|
|
52
52
|
newObject = __TS__New(Set)
|
|
53
|
-
elseif
|
|
53
|
+
elseif serializationType == ____exports.SerializationType.NONE and isClass or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLClassBrand then
|
|
54
54
|
newObject = cloneClass(nil, oldObject)
|
|
55
55
|
else
|
|
56
56
|
newObject = {}
|
|
@@ -66,31 +66,43 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
|
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
if __TS__InstanceOf(oldObject, Map) then
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
) do
|
|
72
|
-
local key
|
|
69
|
+
local value
|
|
70
|
+
local key
|
|
71
|
+
for ____, ____value in __TS__Iterator(oldObject:entries()) do
|
|
73
72
|
key = ____value[1]
|
|
74
|
-
local value
|
|
75
73
|
value = ____value[2]
|
|
76
74
|
do
|
|
77
75
|
if ____exports.isBrand(nil, key) then
|
|
78
76
|
goto __continue17
|
|
79
77
|
end
|
|
80
|
-
deepCopyValue(
|
|
78
|
+
deepCopyValue(
|
|
79
|
+
nil,
|
|
80
|
+
oldObject,
|
|
81
|
+
newObject,
|
|
82
|
+
key,
|
|
83
|
+
value,
|
|
84
|
+
traversalDescription,
|
|
85
|
+
serializationType
|
|
86
|
+
)
|
|
81
87
|
end
|
|
82
88
|
::__continue17::
|
|
83
89
|
end
|
|
84
90
|
elseif __TS__InstanceOf(oldObject, Set) then
|
|
85
|
-
for ____, key in __TS__Iterator(
|
|
86
|
-
oldObject:values()
|
|
87
|
-
) do
|
|
91
|
+
for ____, key in __TS__Iterator(oldObject:values()) do
|
|
88
92
|
do
|
|
89
93
|
if ____exports.isBrand(nil, key) then
|
|
90
94
|
goto __continue20
|
|
91
95
|
end
|
|
92
96
|
local value = ""
|
|
93
|
-
deepCopyValue(
|
|
97
|
+
deepCopyValue(
|
|
98
|
+
nil,
|
|
99
|
+
oldObject,
|
|
100
|
+
newObject,
|
|
101
|
+
key,
|
|
102
|
+
value,
|
|
103
|
+
traversalDescription,
|
|
104
|
+
serializationType
|
|
105
|
+
)
|
|
94
106
|
end
|
|
95
107
|
::__continue20::
|
|
96
108
|
end
|
|
@@ -100,7 +112,15 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
|
|
|
100
112
|
if ____exports.isBrand(nil, key) then
|
|
101
113
|
goto __continue23
|
|
102
114
|
end
|
|
103
|
-
deepCopyValue(
|
|
115
|
+
deepCopyValue(
|
|
116
|
+
nil,
|
|
117
|
+
oldObject,
|
|
118
|
+
newObject,
|
|
119
|
+
key,
|
|
120
|
+
value,
|
|
121
|
+
traversalDescription,
|
|
122
|
+
serializationType
|
|
123
|
+
)
|
|
104
124
|
end
|
|
105
125
|
::__continue23::
|
|
106
126
|
end
|
|
@@ -139,7 +159,7 @@ function getNewClassFromMetatable(self, metatable)
|
|
|
139
159
|
return newClass
|
|
140
160
|
end
|
|
141
161
|
function ____exports.isBrand(self, key)
|
|
142
|
-
return
|
|
162
|
+
return key == TSTL_MAP_BRAND or key == TSTL_SET_BRAND or key == TSTL_CLASS_BRAND or key == TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND or key == VECTOR_BRAND
|
|
143
163
|
end
|
|
144
164
|
function deepCopyValue(self, oldObject, newObject, key, value, traversalDescription, serializationType)
|
|
145
165
|
local valueType = type(value)
|
|
@@ -147,7 +167,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
|
|
|
147
167
|
local convertNumberKeysToString = false
|
|
148
168
|
local isTSTLObject = __TS__InstanceOf(oldObject, Map) or __TS__InstanceOf(oldObject, Set)
|
|
149
169
|
local keyType = type(key)
|
|
150
|
-
if
|
|
170
|
+
if serializationType == ____exports.SerializationType.SERIALIZE and isTSTLObject and keyType == "number" then
|
|
151
171
|
convertNumberKeysToString = true
|
|
152
172
|
local newTable = newObject
|
|
153
173
|
newTable[TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND] = ""
|
|
@@ -159,7 +179,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
|
|
|
159
179
|
if isVector(nil, value) then
|
|
160
180
|
local vector = value
|
|
161
181
|
newValue = copyVector(nil, vector, serializationType)
|
|
162
|
-
elseif ____exports.isSerializedVector(nil, value) and
|
|
182
|
+
elseif ____exports.isSerializedVector(nil, value) and serializationType == ____exports.SerializationType.DESERIALIZE then
|
|
163
183
|
local serializedVector = value
|
|
164
184
|
newValue = ____exports.deserializeVector(nil, serializedVector)
|
|
165
185
|
elseif valueType == "table" then
|
|
@@ -174,7 +194,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
|
|
|
174
194
|
elseif __TS__InstanceOf(newObject, Set) then
|
|
175
195
|
newObject:add(key)
|
|
176
196
|
else
|
|
177
|
-
local keyToUse =
|
|
197
|
+
local keyToUse = convertNumberKeysToString and tostring(key) or key
|
|
178
198
|
newObject[keyToUse] = newValue
|
|
179
199
|
end
|
|
180
200
|
end
|
|
@@ -207,14 +227,14 @@ function checkMetatable(self, ____table, traversalDescription)
|
|
|
207
227
|
if metatable == nil then
|
|
208
228
|
return
|
|
209
229
|
end
|
|
210
|
-
local tableDescription =
|
|
230
|
+
local tableDescription = traversalDescription == "" and "the table to copy" or ("\"" .. traversalDescription) .. "\""
|
|
211
231
|
error(("The deepCopy function detected that " .. tableDescription) .. " has a metatable. Copying tables with metatables is not supported (unless they are TypeScriptToLua Maps, Sets, or Classes).")
|
|
212
232
|
end
|
|
213
233
|
function validateValue(self, value, valueType, traversalDescription)
|
|
214
234
|
if isVector(nil, value) then
|
|
215
235
|
return
|
|
216
236
|
end
|
|
217
|
-
if
|
|
237
|
+
if valueType == "function" or valueType == "nil" or valueType == "thread" or valueType == "userdata" then
|
|
218
238
|
error(((("The deepCopy function detected that \"" .. traversalDescription) .. "\" is type ") .. valueType) .. ", which is not supported.")
|
|
219
239
|
end
|
|
220
240
|
end
|
|
@@ -231,7 +251,7 @@ function ____exports.isSerializedVector(self, object)
|
|
|
231
251
|
return false
|
|
232
252
|
end
|
|
233
253
|
local ____table = object
|
|
234
|
-
return
|
|
254
|
+
return ____table[VECTOR_BRAND] ~= nil and ____table.X ~= nil and ____table.Y ~= nil
|
|
235
255
|
end
|
|
236
256
|
____exports.SerializationType = SerializationType or ({})
|
|
237
257
|
____exports.SerializationType.NONE = 0
|
|
@@ -43,18 +43,14 @@ function copiedTableHasKeyAndValueNumber(self)
|
|
|
43
43
|
local newTable = newObject
|
|
44
44
|
local value = newTable[keyToLookFor]
|
|
45
45
|
if value == nil then
|
|
46
|
-
error(
|
|
47
|
-
"The copied object did not have a key of: " .. tostring(keyToLookFor)
|
|
48
|
-
)
|
|
46
|
+
error("The copied object did not have a key of: " .. tostring(keyToLookFor))
|
|
49
47
|
end
|
|
50
48
|
local valueType = type(value)
|
|
51
49
|
if valueType ~= "number" then
|
|
52
50
|
error("The copied object had a value type of: " .. valueType)
|
|
53
51
|
end
|
|
54
52
|
if value ~= valueToLookFor then
|
|
55
|
-
error(
|
|
56
|
-
"The copied object had a value of: " .. tostring(value)
|
|
57
|
-
)
|
|
53
|
+
error("The copied object had a value of: " .. tostring(value))
|
|
58
54
|
end
|
|
59
55
|
end
|
|
60
56
|
function copiedTableDoesNotCoerceTypes(self)
|
|
@@ -115,20 +111,20 @@ function copiedObjectHasNoReferencesForArray(self)
|
|
|
115
111
|
if not arrayEquals(nil, oldObject.abc, newObject.abc) then
|
|
116
112
|
error("The copied object does not have an equal array.")
|
|
117
113
|
end
|
|
118
|
-
local
|
|
119
|
-
|
|
114
|
+
local ____oldObject_abc_0, ____1_1 = oldObject.abc, 1
|
|
115
|
+
____oldObject_abc_0[____1_1] = ____oldObject_abc_0[____1_1] + 1
|
|
120
116
|
if arrayEquals(nil, oldObject.abc, newObject.abc) then
|
|
121
117
|
error("The copied object has an equal array after a modification to the old array.")
|
|
122
118
|
end
|
|
123
|
-
local
|
|
124
|
-
|
|
125
|
-
local
|
|
126
|
-
|
|
119
|
+
local ____oldObject_abc_2, ____1_3 = oldObject.abc, 1
|
|
120
|
+
____oldObject_abc_2[____1_3] = ____oldObject_abc_2[____1_3] - 1
|
|
121
|
+
local ____newObject_abc_4, ____1_5 = newObject.abc, 1
|
|
122
|
+
____newObject_abc_4[____1_5] = ____newObject_abc_4[____1_5] + 1
|
|
127
123
|
if arrayEquals(nil, oldObject.abc, newObject.abc) then
|
|
128
124
|
error("The copied object has an equal array after a modification to the new array.")
|
|
129
125
|
end
|
|
130
|
-
local
|
|
131
|
-
|
|
126
|
+
local ____newObject_abc_6, ____1_7 = newObject.abc, 1
|
|
127
|
+
____newObject_abc_6[____1_7] = ____newObject_abc_6[____1_7] - 1
|
|
132
128
|
end
|
|
133
129
|
function copiedObjectHasChildObject(self)
|
|
134
130
|
local childObjectIndex = "abc"
|
|
@@ -235,14 +231,10 @@ function copiedMapHasChildMap(self)
|
|
|
235
231
|
end
|
|
236
232
|
local value = newChildMap:get(childMapKey)
|
|
237
233
|
if value == nil then
|
|
238
|
-
error(
|
|
239
|
-
"The copied child Map did not have a key of: " .. tostring(childMapKey)
|
|
240
|
-
)
|
|
234
|
+
error("The copied child Map did not have a key of: " .. tostring(childMapKey))
|
|
241
235
|
end
|
|
242
236
|
if value ~= childMapValue then
|
|
243
|
-
error(
|
|
244
|
-
"The copied child Map did not have a value of: " .. tostring(childMapValue)
|
|
245
|
-
)
|
|
237
|
+
error("The copied child Map did not have a value of: " .. tostring(childMapValue))
|
|
246
238
|
end
|
|
247
239
|
end
|
|
248
240
|
function ____exports.deepCopyTests(self)
|
package/dist/functions/doors.lua
CHANGED
|
@@ -42,18 +42,14 @@ function ____exports.isSecretRoomDoor(self, door)
|
|
|
42
42
|
return filename == "gfx/grid/Door_08_HoleInWall.anm2"
|
|
43
43
|
end
|
|
44
44
|
function ____exports.closeAllDoors(self)
|
|
45
|
-
for ____, door in ipairs(
|
|
46
|
-
____exports.getDoors(nil)
|
|
47
|
-
) do
|
|
45
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
48
46
|
door.State = DoorState.STATE_CLOSED
|
|
49
47
|
local sprite = door:GetSprite()
|
|
50
48
|
sprite:Play("Close", true)
|
|
51
49
|
end
|
|
52
50
|
end
|
|
53
51
|
function ____exports.getAngelRoomDoor(self)
|
|
54
|
-
for ____, door in ipairs(
|
|
55
|
-
____exports.getDoors(nil)
|
|
56
|
-
) do
|
|
52
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
57
53
|
if ____exports.isAngelRoomDoor(nil, door) then
|
|
58
54
|
return door
|
|
59
55
|
end
|
|
@@ -61,9 +57,7 @@ function ____exports.getAngelRoomDoor(self)
|
|
|
61
57
|
return nil
|
|
62
58
|
end
|
|
63
59
|
function ____exports.getDevilRoomDoor(self)
|
|
64
|
-
for ____, door in ipairs(
|
|
65
|
-
____exports.getDoors(nil)
|
|
66
|
-
) do
|
|
60
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
67
61
|
if ____exports.isDevilRoomDoor(nil, door) then
|
|
68
62
|
return door
|
|
69
63
|
end
|
|
@@ -71,9 +65,7 @@ function ____exports.getDevilRoomDoor(self)
|
|
|
71
65
|
return nil
|
|
72
66
|
end
|
|
73
67
|
function ____exports.getDevilRoomOrAngelRoomDoor(self)
|
|
74
|
-
for ____, door in ipairs(
|
|
75
|
-
____exports.getDoors(nil)
|
|
76
|
-
) do
|
|
68
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
77
69
|
if ____exports.isDevilRoomDoor(nil, door) or ____exports.isAngelRoomDoor(nil, door) then
|
|
78
70
|
return door
|
|
79
71
|
end
|
|
@@ -81,9 +73,7 @@ function ____exports.getDevilRoomOrAngelRoomDoor(self)
|
|
|
81
73
|
return nil
|
|
82
74
|
end
|
|
83
75
|
function ____exports.getRepentanceDoor(self)
|
|
84
|
-
for ____, door in ipairs(
|
|
85
|
-
____exports.getDoors(nil)
|
|
86
|
-
) do
|
|
76
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
87
77
|
if ____exports.isRepentanceDoor(nil, door) then
|
|
88
78
|
return door
|
|
89
79
|
end
|
|
@@ -93,7 +83,7 @@ end
|
|
|
93
83
|
function ____exports.isHiddenSecretRoomDoor(self, door)
|
|
94
84
|
local sprite = door:GetSprite()
|
|
95
85
|
local animation = sprite:GetAnimation()
|
|
96
|
-
return ____exports.isSecretRoomDoor(nil, door) and
|
|
86
|
+
return ____exports.isSecretRoomDoor(nil, door) and animation == "Hidden"
|
|
97
87
|
end
|
|
98
88
|
function ____exports.isDoorToDownpour(self, door)
|
|
99
89
|
if not ____exports.isRepentanceDoor(nil, door) then
|
|
@@ -136,9 +126,7 @@ function ____exports.isDoorToMomsHeart(self, door)
|
|
|
136
126
|
return filename == "gfx/grid/Door_MomsHeart.anm2"
|
|
137
127
|
end
|
|
138
128
|
function ____exports.openAllDoors(self)
|
|
139
|
-
for ____, door in ipairs(
|
|
140
|
-
____exports.getDoors(nil)
|
|
141
|
-
) do
|
|
129
|
+
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
142
130
|
door:Open()
|
|
143
131
|
end
|
|
144
132
|
end
|
|
@@ -298,7 +298,13 @@ function ____exports.setEntityRandomColor(self, entity)
|
|
|
298
298
|
end
|
|
299
299
|
end
|
|
300
300
|
local color = Color(colorValues[1], colorValues[2], colorValues[3])
|
|
301
|
-
entity:SetColor(
|
|
301
|
+
entity:SetColor(
|
|
302
|
+
color,
|
|
303
|
+
100000,
|
|
304
|
+
100000,
|
|
305
|
+
false,
|
|
306
|
+
false
|
|
307
|
+
)
|
|
302
308
|
end
|
|
303
309
|
function ____exports.setEntityVelocities(self, entityVelocities, entities)
|
|
304
310
|
if entities == nil then
|
package/dist/functions/flag.lua
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
-
local
|
|
5
|
-
local GRID_ENTITY_XML_MAP =
|
|
4
|
+
local ____gridEntityXMLMap = require("maps.gridEntityXMLMap")
|
|
5
|
+
local GRID_ENTITY_XML_MAP = ____gridEntityXMLMap.GRID_ENTITY_XML_MAP
|
|
6
6
|
local ____rooms = require("functions.rooms")
|
|
7
7
|
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
8
8
|
function ____exports.removeGridEntity(self, gridEntity, updateRoom)
|
|
@@ -36,13 +36,11 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
|
|
|
36
36
|
end
|
|
37
37
|
local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
|
|
38
38
|
if gridEntityArray == nil then
|
|
39
|
-
error(
|
|
40
|
-
"Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
|
|
41
|
-
)
|
|
39
|
+
error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
|
|
42
40
|
end
|
|
43
41
|
local gridEntityType = gridEntityArray[1]
|
|
44
42
|
local gridEntityVariant = gridEntityArray[2]
|
|
45
|
-
if
|
|
43
|
+
if gridEntityType == GridEntityType.GRID_SPIKES_ONOFF or gridEntityType == GridEntityType.GRID_PRESSURE_PLATE or gridEntityType == GridEntityType.GRID_TELEPORTER then
|
|
46
44
|
gridEntityVariant = gridEntityXMLVariant
|
|
47
45
|
end
|
|
48
46
|
return {gridEntityType, gridEntityVariant}
|
|
@@ -82,7 +80,16 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
|
82
80
|
local room = game:GetRoom()
|
|
83
81
|
local gridWidth = room:GetGridWidth()
|
|
84
82
|
local gridIndex = gridEntity:GetGridIndex()
|
|
85
|
-
local surroundingGridIndexes = {
|
|
83
|
+
local surroundingGridIndexes = {
|
|
84
|
+
gridIndex - 1,
|
|
85
|
+
gridIndex + 1,
|
|
86
|
+
gridIndex - gridWidth - 1,
|
|
87
|
+
gridIndex - gridWidth,
|
|
88
|
+
gridIndex - gridWidth + 1,
|
|
89
|
+
gridIndex + gridWidth - 1,
|
|
90
|
+
gridIndex + gridWidth,
|
|
91
|
+
gridIndex + gridWidth + 1
|
|
92
|
+
}
|
|
86
93
|
local surroundingGridEntities = {}
|
|
87
94
|
for ____, surroundingGridIndex in ipairs(surroundingGridIndexes) do
|
|
88
95
|
local surroundingGridEntity = room:GetGridEntity(surroundingGridIndex)
|
|
@@ -99,9 +106,7 @@ function ____exports.isAllPressurePlatesPushed(self)
|
|
|
99
106
|
if not hasPressurePlates then
|
|
100
107
|
return true
|
|
101
108
|
end
|
|
102
|
-
for ____, gridEntity in ipairs(
|
|
103
|
-
____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)
|
|
104
|
-
) do
|
|
109
|
+
for ____, gridEntity in ipairs(____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)) do
|
|
105
110
|
local gridEntityDesc = gridEntity:GetSaveState()
|
|
106
111
|
if gridEntityDesc.State ~= 3 then
|
|
107
112
|
return false
|
package/dist/functions/input.lua
CHANGED
|
@@ -39,12 +39,10 @@ ControllerLiteral[ControllerLiteral.BUTTON_BACK] = "BUTTON_BACK"
|
|
|
39
39
|
ControllerLiteral.BUTTON_START = 15
|
|
40
40
|
ControllerLiteral[ControllerLiteral.BUTTON_START] = "BUTTON_START"
|
|
41
41
|
function ____exports.controllerToString(self, controller)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
) do
|
|
45
|
-
local key
|
|
42
|
+
local controllerLiteralCode
|
|
43
|
+
local key
|
|
44
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(ControllerLiteral)) do
|
|
46
45
|
key = ____value[1]
|
|
47
|
-
local controllerLiteralCode
|
|
48
46
|
controllerLiteralCode = ____value[2]
|
|
49
47
|
do
|
|
50
48
|
if type(key) ~= "string" then
|
|
@@ -55,7 +53,13 @@ function ____exports.controllerToString(self, controller)
|
|
|
55
53
|
goto __continue3
|
|
56
54
|
end
|
|
57
55
|
local controllerName = key
|
|
58
|
-
for ____, prefix in ipairs({
|
|
56
|
+
for ____, prefix in ipairs({
|
|
57
|
+
"DPAD_",
|
|
58
|
+
"BUTTON_",
|
|
59
|
+
"BUMPER_",
|
|
60
|
+
"TRIGGER_",
|
|
61
|
+
"STICK_"
|
|
62
|
+
}) do
|
|
59
63
|
controllerName = __TS__StringReplace(controllerName, prefix, "")
|
|
60
64
|
end
|
|
61
65
|
return controllerName
|
|
@@ -92,9 +96,7 @@ function ____exports.isKeyboardPressed(self, key)
|
|
|
92
96
|
return Input.IsButtonPressed(key, 0)
|
|
93
97
|
end
|
|
94
98
|
function ____exports.isMoveActionPressedOnAnyInput(self)
|
|
95
|
-
for ____, buttonAction in __TS__Iterator(
|
|
96
|
-
MOVEMENT_ACTIONS:values()
|
|
97
|
-
) do
|
|
99
|
+
for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
|
|
98
100
|
if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
|
|
99
101
|
return true
|
|
100
102
|
end
|
|
@@ -102,9 +104,7 @@ function ____exports.isMoveActionPressedOnAnyInput(self)
|
|
|
102
104
|
return false
|
|
103
105
|
end
|
|
104
106
|
function ____exports.isMoveActionTriggeredOnAnyInput(self)
|
|
105
|
-
for ____, buttonAction in __TS__Iterator(
|
|
106
|
-
MOVEMENT_ACTIONS:values()
|
|
107
|
-
) do
|
|
107
|
+
for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
|
|
108
108
|
if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
|
|
109
109
|
return true
|
|
110
110
|
end
|
|
@@ -112,9 +112,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
|
|
|
112
112
|
return false
|
|
113
113
|
end
|
|
114
114
|
function ____exports.isShootActionPressedOnAnyInput(self)
|
|
115
|
-
for ____, buttonAction in __TS__Iterator(
|
|
116
|
-
SHOOTING_ACTIONS:values()
|
|
117
|
-
) do
|
|
115
|
+
for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
|
|
118
116
|
if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
|
|
119
117
|
return true
|
|
120
118
|
end
|
|
@@ -122,9 +120,7 @@ function ____exports.isShootActionPressedOnAnyInput(self)
|
|
|
122
120
|
return false
|
|
123
121
|
end
|
|
124
122
|
function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
125
|
-
for ____, buttonAction in __TS__Iterator(
|
|
126
|
-
SHOOTING_ACTIONS:values()
|
|
127
|
-
) do
|
|
123
|
+
for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
|
|
128
124
|
if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
|
|
129
125
|
return true
|
|
130
126
|
end
|
|
@@ -30,9 +30,7 @@ function getJSONRoomWithChosenWeight(self, jsonRooms, chosenWeight)
|
|
|
30
30
|
end
|
|
31
31
|
chosenWeight = chosenWeight - roomWeight
|
|
32
32
|
end
|
|
33
|
-
error(
|
|
34
|
-
"Failed to get a room with chosen weight: " .. tostring(chosenWeight)
|
|
35
|
-
)
|
|
33
|
+
error("Failed to get a room with chosen weight: " .. tostring(chosenWeight))
|
|
36
34
|
return jsonRooms[1]
|
|
37
35
|
end
|
|
38
36
|
function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
|
|
@@ -65,15 +63,11 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seed, verbose)
|
|
|
65
63
|
end
|
|
66
64
|
local totalWeight = getTotalWeightOfJSONRooms(nil, jsonRooms)
|
|
67
65
|
if verbose then
|
|
68
|
-
log(
|
|
69
|
-
"Total weight of the JSON rooms provided: " .. tostring(totalWeight)
|
|
70
|
-
)
|
|
66
|
+
log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
|
|
71
67
|
end
|
|
72
68
|
local chosenWeight = getRandomFloat(nil, 0, totalWeight, seed)
|
|
73
69
|
if verbose then
|
|
74
|
-
log(
|
|
75
|
-
"Randomly chose weight: " .. tostring(chosenWeight)
|
|
76
|
-
)
|
|
70
|
+
log("Randomly chose weight: " .. tostring(chosenWeight))
|
|
77
71
|
end
|
|
78
72
|
return getJSONRoomWithChosenWeight(nil, jsonRooms, chosenWeight)
|
|
79
73
|
end
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____exports = {}
|
|
3
|
-
local LANGUAGE_NAMES = {
|
|
3
|
+
local LANGUAGE_NAMES = {
|
|
4
|
+
en = "English",
|
|
5
|
+
jp = "Japanese",
|
|
6
|
+
kr = "Korean",
|
|
7
|
+
zh = "Chinese (Simple)",
|
|
8
|
+
ru = "Russian",
|
|
9
|
+
de = "German",
|
|
10
|
+
es = "Spanish"
|
|
11
|
+
}
|
|
4
12
|
function ____exports.getLanguageName(self)
|
|
5
13
|
local languageAbbreviation = Options.Language
|
|
6
14
|
return LANGUAGE_NAMES[languageAbbreviation]
|
package/dist/functions/log.lua
CHANGED
|
@@ -16,9 +16,7 @@ function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
if getParentFunctionDescription ~= nil then
|
|
19
|
-
return (tostring(
|
|
20
|
-
getParentFunctionDescription(numParentFunctions + 1)
|
|
21
|
-
) .. " - ") .. msg
|
|
19
|
+
return (tostring(getParentFunctionDescription(numParentFunctions + 1)) .. " - ") .. msg
|
|
22
20
|
end
|
|
23
21
|
return msg
|
|
24
22
|
end
|
|
@@ -36,9 +34,7 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
36
34
|
____exports.log(("Logging all " .. description) .. "flags:")
|
|
37
35
|
for key, value in pairs(flagEnum) do
|
|
38
36
|
if hasFlag(nil, flags, value) then
|
|
39
|
-
____exports.log(
|
|
40
|
-
"- Has flag: " .. tostring(key)
|
|
41
|
-
)
|
|
37
|
+
____exports.log("- Has flag: " .. tostring(key))
|
|
42
38
|
end
|
|
43
39
|
end
|
|
44
40
|
end
|
|
@@ -51,12 +47,10 @@ end
|
|
|
51
47
|
function ____exports.logAllGameStateFlags()
|
|
52
48
|
local game = Game()
|
|
53
49
|
____exports.log("Logging all game state flags:")
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
) do
|
|
57
|
-
local key
|
|
50
|
+
local value
|
|
51
|
+
local key
|
|
52
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(GameStateFlag)) do
|
|
58
53
|
key = ____value[1]
|
|
59
|
-
local value
|
|
60
54
|
value = ____value[2]
|
|
61
55
|
local gameStateFlag = value
|
|
62
56
|
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
@@ -79,62 +73,40 @@ function ____exports.logArray(array)
|
|
|
79
73
|
____exports.log("Array: " .. arrayString)
|
|
80
74
|
end
|
|
81
75
|
function ____exports.logColor(color)
|
|
82
|
-
____exports.log(
|
|
83
|
-
(((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO)
|
|
84
|
-
)
|
|
76
|
+
____exports.log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
|
|
85
77
|
end
|
|
86
78
|
function ____exports.logEntity(entity)
|
|
87
|
-
____exports.log(
|
|
88
|
-
(((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
|
|
89
|
-
)
|
|
79
|
+
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
90
80
|
end
|
|
91
81
|
function ____exports.logKColor(kColor)
|
|
92
|
-
____exports.log(
|
|
93
|
-
(((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
|
|
94
|
-
)
|
|
82
|
+
____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
95
83
|
end
|
|
96
84
|
function ____exports.logMap(map)
|
|
97
85
|
____exports.log("Printing out a TSTL Map:")
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) do
|
|
101
|
-
local key
|
|
86
|
+
local value
|
|
87
|
+
local key
|
|
88
|
+
for ____, ____value in __TS__Iterator(map:entries()) do
|
|
102
89
|
key = ____value[1]
|
|
103
|
-
local value
|
|
104
90
|
value = ____value[2]
|
|
105
|
-
____exports.log(
|
|
106
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
107
|
-
)
|
|
91
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
108
92
|
end
|
|
109
|
-
____exports.log(
|
|
110
|
-
"The size of the map was: " .. tostring(map.size)
|
|
111
|
-
)
|
|
93
|
+
____exports.log("The size of the map was: " .. tostring(map.size))
|
|
112
94
|
end
|
|
113
95
|
function ____exports.logTable(____table)
|
|
114
96
|
____exports.log("Printing out a Lua table:")
|
|
115
97
|
for key, value in pairs(____table) do
|
|
116
|
-
____exports.log(
|
|
117
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
118
|
-
)
|
|
98
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
119
99
|
end
|
|
120
100
|
end
|
|
121
101
|
function ____exports.logSet(set)
|
|
122
102
|
____exports.log("Printing out a TSTL Set:")
|
|
123
|
-
for ____, value in __TS__Iterator(
|
|
124
|
-
|
|
125
|
-
) do
|
|
126
|
-
____exports.log(
|
|
127
|
-
" Value: " .. tostring(value)
|
|
128
|
-
)
|
|
103
|
+
for ____, value in __TS__Iterator(set:values()) do
|
|
104
|
+
____exports.log(" Value: " .. tostring(value))
|
|
129
105
|
end
|
|
130
|
-
____exports.log(
|
|
131
|
-
"The size of the set was: " .. tostring(set.size)
|
|
132
|
-
)
|
|
106
|
+
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
133
107
|
end
|
|
134
108
|
function ____exports.logVector(vector)
|
|
135
|
-
____exports.log(
|
|
136
|
-
((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")"
|
|
137
|
-
)
|
|
109
|
+
____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
|
|
138
110
|
end
|
|
139
111
|
function ____exports.setLogFunctionsGlobal(self)
|
|
140
112
|
local globals = _G
|