isaacscript-common 1.0.573 → 1.0.577
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/itemPickup.lua +2 -6
- package/dist/callbacks/postBombInitLate.lua +1 -5
- package/dist/callbacks/postCursedTeleport.lua +8 -10
- package/dist/callbacks/postEffectInitLate.lua +1 -5
- package/dist/callbacks/postEsauJr.lua +2 -4
- package/dist/callbacks/postFamiliarInitLate.lua +1 -5
- package/dist/callbacks/postFlip.lua +2 -4
- package/dist/callbacks/postGridEntity.lua +8 -20
- package/dist/callbacks/postKnifeInitLate.lua +1 -5
- package/dist/callbacks/postLaserInitLate.lua +1 -5
- package/dist/callbacks/postNPCInitLate.lua +1 -5
- package/dist/callbacks/postPickupCollect.lua +1 -5
- package/dist/callbacks/postPickupInitLate.lua +1 -5
- package/dist/callbacks/postPlayerChangeHealth.lua +19 -23
- package/dist/callbacks/postPlayerChangeType.lua +1 -5
- package/dist/callbacks/postPlayerFatalDamage.lua +5 -9
- package/dist/callbacks/postPlayerInitLate.lua +1 -5
- package/dist/callbacks/postPlayerReordered.lua +8 -2
- package/dist/callbacks/postProjectileInitLate.lua +1 -5
- package/dist/callbacks/postPurchase.lua +19 -19
- 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 +1 -5
- package/dist/callbacks/postTearInitVeryLate.lua +1 -5
- package/dist/callbacks/postTransformation.lua +1 -5
- package/dist/callbacks/postTrinketBreak.lua +5 -9
- package/dist/callbacks/preNewLevel.lua +1 -1
- package/dist/callbacks/reorderedCallbacks.lua +4 -4
- package/dist/callbacks/subscriptions/PreNewLevel.lua +1 -2
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -2
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -5
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postEsauJr.lua +1 -2
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -2
- package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -2
- package/dist/callbacks/subscriptions/postFlip.lua +1 -2
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -5
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -5
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -5
- package/dist/callbacks/subscriptions/postItemPickup.lua +5 -8
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -2
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postPEffectUpdateReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -5
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPurchase.lua +8 -3
- package/dist/callbacks/subscriptions/postSacrifice.lua +1 -2
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -5
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postTearInitVeryLate.lua +3 -5
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -5
- package/dist/callbacks/subscriptions/postTrinketBreak.lua +3 -5
- package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -2
- package/dist/callbacks/subscriptions/preItemPickup.lua +5 -8
- package/dist/constants.lua +57 -6
- package/dist/features/deployJSONRoom.lua +95 -68
- package/dist/features/disableInputs.lua +9 -3
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +4 -10
- 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 -7
- package/dist/functions/array.lua +6 -10
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/challenges.lua +1 -1
- package/dist/functions/charge.lua +10 -12
- package/dist/functions/collectibles.lua +18 -23
- package/dist/functions/color.lua +9 -1
- package/dist/functions/deepCopy.lua +46 -28
- package/dist/functions/deepCopyTests.lua +12 -20
- package/dist/functions/doors.d.ts +10 -0
- package/dist/functions/doors.lua +19 -21
- package/dist/functions/entity.lua +8 -2
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +14 -9
- package/dist/functions/input.lua +17 -27
- package/dist/functions/jsonRoom.lua +3 -9
- package/dist/functions/language.lua +9 -1
- package/dist/functions/log.lua +33 -85
- package/dist/functions/math.lua +15 -17
- package/dist/functions/npc.lua +15 -17
- package/dist/functions/pickups.lua +14 -1
- package/dist/functions/player.lua +38 -60
- 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.d.ts +1 -1
- package/dist/functions/rooms.lua +42 -41
- package/dist/functions/spawnCollectible.lua +10 -2
- package/dist/functions/sprite.lua +2 -2
- package/dist/functions/stage.lua +11 -11
- package/dist/functions/tears.lua +1 -1
- package/dist/functions/transformations.lua +4 -10
- package/dist/functions/trinketGive.lua +3 -3
- package/dist/functions/trinkets.lua +10 -6
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.lua +6 -14
- package/dist/functions/vector.lua +8 -8
- package/dist/lualib_bundle.lua +795 -735
- package/dist/maps/cardDescriptionMap.lua +99 -1
- package/dist/maps/cardNameMap.lua +99 -1
- package/dist/maps/challengeNameMap.lua +47 -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/roomShapeToTopLeftWallGridIndexMap.lua +7 -1
- package/dist/maps/transformationMaps.lua +21 -16
- package/dist/maps/transformationNameMap.lua +17 -1
- 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 +95 -105
- package/package.json +5 -5
|
@@ -241,7 +241,7 @@ function ____exports.removeEntities(self, entities, cap)
|
|
|
241
241
|
local entity = entities[i + 1]
|
|
242
242
|
entity:Remove()
|
|
243
243
|
numEntitiesRemoved = numEntitiesRemoved + 1
|
|
244
|
-
if
|
|
244
|
+
if cap ~= nil and numEntitiesRemoved >= cap then
|
|
245
245
|
return true
|
|
246
246
|
end
|
|
247
247
|
i = i + 1
|
|
@@ -333,7 +333,13 @@ function ____exports.setEntityRandomColor(self, entity)
|
|
|
333
333
|
end
|
|
334
334
|
end
|
|
335
335
|
local color = Color(colorValues[1], colorValues[2], colorValues[3])
|
|
336
|
-
entity:SetColor(
|
|
336
|
+
entity:SetColor(
|
|
337
|
+
color,
|
|
338
|
+
100000,
|
|
339
|
+
100000,
|
|
340
|
+
false,
|
|
341
|
+
false
|
|
342
|
+
)
|
|
337
343
|
end
|
|
338
344
|
function ____exports.setEntityVelocities(self, entityVelocities, entities)
|
|
339
345
|
if entities == nil then
|
package/dist/functions/flag.lua
CHANGED
|
@@ -15,7 +15,7 @@ function ____exports.getTopLeftWallGridIndex(self)
|
|
|
15
15
|
local room = game:GetRoom()
|
|
16
16
|
local roomShape = room:GetRoomShape()
|
|
17
17
|
local topLeftWallGridIndex = ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP:get(roomShape)
|
|
18
|
-
return
|
|
18
|
+
return topLeftWallGridIndex == nil and DEFAULT_TOP_LEFT_WALL_GRID_INDEX or topLeftWallGridIndex
|
|
19
19
|
end
|
|
20
20
|
function ____exports.removeGridEntity(self, gridEntity, updateRoom)
|
|
21
21
|
if updateRoom == nil then
|
|
@@ -48,13 +48,11 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
|
|
|
48
48
|
end
|
|
49
49
|
local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
|
|
50
50
|
if gridEntityArray == nil then
|
|
51
|
-
error(
|
|
52
|
-
"Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
|
|
53
|
-
)
|
|
51
|
+
error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
|
|
54
52
|
end
|
|
55
53
|
local gridEntityType = gridEntityArray[1]
|
|
56
54
|
local gridEntityVariant = gridEntityArray[2]
|
|
57
|
-
if
|
|
55
|
+
if gridEntityType == GridEntityType.GRID_SPIKES_ONOFF or gridEntityType == GridEntityType.GRID_PRESSURE_PLATE or gridEntityType == GridEntityType.GRID_TELEPORTER then
|
|
58
56
|
gridEntityVariant = gridEntityXMLVariant
|
|
59
57
|
end
|
|
60
58
|
return {gridEntityType, gridEntityVariant}
|
|
@@ -100,7 +98,16 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
|
100
98
|
local room = game:GetRoom()
|
|
101
99
|
local gridWidth = room:GetGridWidth()
|
|
102
100
|
local gridIndex = gridEntity:GetGridIndex()
|
|
103
|
-
local surroundingGridIndexes = {
|
|
101
|
+
local surroundingGridIndexes = {
|
|
102
|
+
gridIndex - 1,
|
|
103
|
+
gridIndex + 1,
|
|
104
|
+
gridIndex - gridWidth - 1,
|
|
105
|
+
gridIndex - gridWidth,
|
|
106
|
+
gridIndex - gridWidth + 1,
|
|
107
|
+
gridIndex + gridWidth - 1,
|
|
108
|
+
gridIndex + gridWidth,
|
|
109
|
+
gridIndex + gridWidth + 1
|
|
110
|
+
}
|
|
104
111
|
local surroundingGridEntities = {}
|
|
105
112
|
for ____, surroundingGridIndex in ipairs(surroundingGridIndexes) do
|
|
106
113
|
local surroundingGridEntity = room:GetGridEntity(surroundingGridIndex)
|
|
@@ -117,9 +124,7 @@ function ____exports.isAllPressurePlatesPushed(self)
|
|
|
117
124
|
if not hasPressurePlates then
|
|
118
125
|
return true
|
|
119
126
|
end
|
|
120
|
-
for ____, gridEntity in ipairs(
|
|
121
|
-
____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)
|
|
122
|
-
) do
|
|
127
|
+
for ____, gridEntity in ipairs(____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)) do
|
|
123
128
|
local gridEntityDesc = gridEntity:GetSaveState()
|
|
124
129
|
if gridEntityDesc.State ~= 3 then
|
|
125
130
|
return false
|
package/dist/functions/input.lua
CHANGED
|
@@ -39,13 +39,9 @@ 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
|
-
for ____, ____value in ipairs(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
local key
|
|
46
|
-
key = ____value[1]
|
|
47
|
-
local controllerLiteralCode
|
|
48
|
-
controllerLiteralCode = ____value[2]
|
|
42
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(ControllerLiteral)) do
|
|
43
|
+
local key = ____value[1]
|
|
44
|
+
local controllerLiteralCode = ____value[2]
|
|
49
45
|
do
|
|
50
46
|
if type(key) ~= "string" then
|
|
51
47
|
goto __continue3
|
|
@@ -55,7 +51,13 @@ function ____exports.controllerToString(self, controller)
|
|
|
55
51
|
goto __continue3
|
|
56
52
|
end
|
|
57
53
|
local controllerName = key
|
|
58
|
-
for ____, prefix in ipairs({
|
|
54
|
+
for ____, prefix in ipairs({
|
|
55
|
+
"DPAD_",
|
|
56
|
+
"BUTTON_",
|
|
57
|
+
"BUMPER_",
|
|
58
|
+
"TRIGGER_",
|
|
59
|
+
"STICK_"
|
|
60
|
+
}) do
|
|
59
61
|
controllerName = __TS__StringReplace(controllerName, prefix, "")
|
|
60
62
|
end
|
|
61
63
|
return controllerName
|
|
@@ -92,9 +94,7 @@ function ____exports.isKeyboardPressed(self, key)
|
|
|
92
94
|
return Input.IsButtonPressed(key, 0)
|
|
93
95
|
end
|
|
94
96
|
function ____exports.isMoveActionPressedOnAnyInput(self)
|
|
95
|
-
for ____, buttonAction in __TS__Iterator(
|
|
96
|
-
MOVEMENT_ACTIONS:values()
|
|
97
|
-
) do
|
|
97
|
+
for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
|
|
98
98
|
if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
|
|
99
99
|
return true
|
|
100
100
|
end
|
|
@@ -102,9 +102,7 @@ function ____exports.isMoveActionPressedOnAnyInput(self)
|
|
|
102
102
|
return false
|
|
103
103
|
end
|
|
104
104
|
function ____exports.isMoveActionTriggeredOnAnyInput(self)
|
|
105
|
-
for ____, buttonAction in __TS__Iterator(
|
|
106
|
-
MOVEMENT_ACTIONS:values()
|
|
107
|
-
) do
|
|
105
|
+
for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
|
|
108
106
|
if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
|
|
109
107
|
return true
|
|
110
108
|
end
|
|
@@ -112,9 +110,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
|
|
|
112
110
|
return false
|
|
113
111
|
end
|
|
114
112
|
function ____exports.isShootActionPressedOnAnyInput(self)
|
|
115
|
-
for ____, buttonAction in __TS__Iterator(
|
|
116
|
-
SHOOTING_ACTIONS:values()
|
|
117
|
-
) do
|
|
113
|
+
for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
|
|
118
114
|
if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
|
|
119
115
|
return true
|
|
120
116
|
end
|
|
@@ -122,9 +118,7 @@ function ____exports.isShootActionPressedOnAnyInput(self)
|
|
|
122
118
|
return false
|
|
123
119
|
end
|
|
124
120
|
function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
125
|
-
for ____, buttonAction in __TS__Iterator(
|
|
126
|
-
SHOOTING_ACTIONS:values()
|
|
127
|
-
) do
|
|
121
|
+
for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
|
|
128
122
|
if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
|
|
129
123
|
return true
|
|
130
124
|
end
|
|
@@ -132,13 +126,9 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
|
132
126
|
return false
|
|
133
127
|
end
|
|
134
128
|
function ____exports.keyboardToString(self, keyboard)
|
|
135
|
-
for ____, ____value in ipairs(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
local keyName
|
|
139
|
-
keyName = ____value[1]
|
|
140
|
-
local keyCode
|
|
141
|
-
keyCode = ____value[2]
|
|
129
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(Keyboard)) do
|
|
130
|
+
local keyName = ____value[1]
|
|
131
|
+
local keyCode = ____value[2]
|
|
142
132
|
if keyCode == keyboard then
|
|
143
133
|
local withoutPrefix = __TS__StringSlice(keyName, #"KEY_")
|
|
144
134
|
local withoutUnderscores = string.gsub(withoutPrefix, "_", " ")
|
|
@@ -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
|
@@ -20,9 +20,7 @@ function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
if getParentFunctionDescription ~= nil then
|
|
23
|
-
return (tostring(
|
|
24
|
-
getParentFunctionDescription(numParentFunctions + 1)
|
|
25
|
-
) .. " - ") .. msg
|
|
23
|
+
return (tostring(getParentFunctionDescription(numParentFunctions + 1)) .. " - ") .. msg
|
|
26
24
|
end
|
|
27
25
|
return msg
|
|
28
26
|
end
|
|
@@ -40,17 +38,11 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
40
38
|
____exports.log(("Logging all " .. description) .. "flags:")
|
|
41
39
|
local hasNoFlags = true
|
|
42
40
|
local i = 1
|
|
43
|
-
for ____, ____value in ipairs(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
local key
|
|
47
|
-
key = ____value[1]
|
|
48
|
-
local value
|
|
49
|
-
value = ____value[2]
|
|
41
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(flagEnum)) do
|
|
42
|
+
local key = ____value[1]
|
|
43
|
+
local value = ____value[2]
|
|
50
44
|
if hasFlag(nil, flags, value) then
|
|
51
|
-
____exports.log(
|
|
52
|
-
(((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
53
|
-
)
|
|
45
|
+
____exports.log((((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")")
|
|
54
46
|
hasNoFlags = false
|
|
55
47
|
end
|
|
56
48
|
i = i + 1
|
|
@@ -70,19 +62,13 @@ function ____exports.logAllGameStateFlags()
|
|
|
70
62
|
____exports.log("Logging all game state flags:")
|
|
71
63
|
local hasNoFlags = true
|
|
72
64
|
local i = 1
|
|
73
|
-
for ____, ____value in ipairs(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
local key
|
|
77
|
-
key = ____value[1]
|
|
78
|
-
local value
|
|
79
|
-
value = ____value[2]
|
|
65
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(GameStateFlag)) do
|
|
66
|
+
local key = ____value[1]
|
|
67
|
+
local value = ____value[2]
|
|
80
68
|
local gameStateFlag = value
|
|
81
69
|
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
82
70
|
if flagValue then
|
|
83
|
-
____exports.log(
|
|
84
|
-
(((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
85
|
-
)
|
|
71
|
+
____exports.log((((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")")
|
|
86
72
|
hasNoFlags = false
|
|
87
73
|
end
|
|
88
74
|
i = i + 1
|
|
@@ -106,18 +92,12 @@ function ____exports.logAllSeedEffects()
|
|
|
106
92
|
____exports.log("Logging all seed effects:")
|
|
107
93
|
local hasNoSeedEffects = true
|
|
108
94
|
local i = 1
|
|
109
|
-
for ____, ____value in ipairs(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
local key
|
|
113
|
-
key = ____value[1]
|
|
114
|
-
local value
|
|
115
|
-
value = ____value[2]
|
|
95
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(SeedEffect)) do
|
|
96
|
+
local key = ____value[1]
|
|
97
|
+
local value = ____value[2]
|
|
116
98
|
local seedEffect = value
|
|
117
99
|
if seeds:HasSeedEffect(seedEffect) then
|
|
118
|
-
____exports.log(
|
|
119
|
-
(((((" " .. tostring(i)) .. ") ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
120
|
-
)
|
|
100
|
+
____exports.log((((((" " .. tostring(i)) .. ") ") .. key) .. " (") .. tostring(value)) .. ")")
|
|
121
101
|
hasNoSeedEffects = false
|
|
122
102
|
end
|
|
123
103
|
i = i + 1
|
|
@@ -131,43 +111,27 @@ function ____exports.logArray(array)
|
|
|
131
111
|
____exports.log("Array: " .. arrayString)
|
|
132
112
|
end
|
|
133
113
|
function ____exports.logColor(color)
|
|
134
|
-
____exports.log(
|
|
135
|
-
(((((((((((("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)
|
|
136
|
-
)
|
|
114
|
+
____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))
|
|
137
115
|
end
|
|
138
116
|
function ____exports.logEntity(entity)
|
|
139
|
-
____exports.log(
|
|
140
|
-
(((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
|
|
141
|
-
)
|
|
117
|
+
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
142
118
|
end
|
|
143
119
|
function ____exports.logKColor(kColor)
|
|
144
|
-
____exports.log(
|
|
145
|
-
(((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
|
|
146
|
-
)
|
|
120
|
+
____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
147
121
|
end
|
|
148
122
|
function ____exports.logMap(map)
|
|
149
123
|
____exports.log("Printing out a TSTL Map:")
|
|
150
|
-
for ____, ____value in __TS__Iterator(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
value = ____value[2]
|
|
157
|
-
____exports.log(
|
|
158
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
159
|
-
)
|
|
160
|
-
end
|
|
161
|
-
____exports.log(
|
|
162
|
-
"The size of the map was: " .. tostring(map.size)
|
|
163
|
-
)
|
|
124
|
+
for ____, ____value in __TS__Iterator(map:entries()) do
|
|
125
|
+
local key = ____value[1]
|
|
126
|
+
local value = ____value[2]
|
|
127
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
128
|
+
end
|
|
129
|
+
____exports.log("The size of the map was: " .. tostring(map.size))
|
|
164
130
|
end
|
|
165
131
|
function ____exports.logTable(____table)
|
|
166
132
|
____exports.log("Printing out a Lua table:")
|
|
167
133
|
for key, value in pairs(____table) do
|
|
168
|
-
____exports.log(
|
|
169
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
170
|
-
)
|
|
134
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
171
135
|
end
|
|
172
136
|
end
|
|
173
137
|
function ____exports.logTemporaryEffects(player)
|
|
@@ -184,50 +148,34 @@ function ____exports.logTemporaryEffects(player)
|
|
|
184
148
|
do
|
|
185
149
|
local effect = effectsList:Get(i)
|
|
186
150
|
if effect == nil then
|
|
187
|
-
goto
|
|
151
|
+
goto __continue39
|
|
188
152
|
end
|
|
189
153
|
if effect.Item:IsCollectible() then
|
|
190
154
|
local collectibleName = getCollectibleName(nil, effect.Item.ID)
|
|
191
|
-
____exports.log(
|
|
192
|
-
((" " .. tostring(i + 1)) .. ") ") .. collectibleName
|
|
193
|
-
)
|
|
155
|
+
____exports.log(((" " .. tostring(i + 1)) .. ") ") .. collectibleName)
|
|
194
156
|
elseif effect.Item:IsTrinket() then
|
|
195
157
|
local trinketName = getTrinketName(nil, effect.Item.ID)
|
|
196
|
-
____exports.log(
|
|
197
|
-
((" " .. tostring(i + 1)) .. ") ") .. trinketName
|
|
198
|
-
)
|
|
158
|
+
____exports.log(((" " .. tostring(i + 1)) .. ") ") .. trinketName)
|
|
199
159
|
elseif effect.Item:IsNull() then
|
|
200
|
-
____exports.log(
|
|
201
|
-
((" " .. tostring(i + 1)) .. ") Null item: ") .. tostring(effect.Item.ID)
|
|
202
|
-
)
|
|
160
|
+
____exports.log(((" " .. tostring(i + 1)) .. ") Null item: ") .. tostring(effect.Item.ID))
|
|
203
161
|
else
|
|
204
|
-
____exports.log(
|
|
205
|
-
((" " .. tostring(i + 1)) .. ") Unknown type of temporary effect: ") .. tostring(effect.Item.ID)
|
|
206
|
-
)
|
|
162
|
+
____exports.log(((" " .. tostring(i + 1)) .. ") Unknown type of temporary effect: ") .. tostring(effect.Item.ID))
|
|
207
163
|
end
|
|
208
164
|
end
|
|
209
|
-
::
|
|
165
|
+
::__continue39::
|
|
210
166
|
i = i + 1
|
|
211
167
|
end
|
|
212
168
|
end
|
|
213
169
|
end
|
|
214
170
|
function ____exports.logSet(set)
|
|
215
171
|
____exports.log("Printing out a TSTL Set:")
|
|
216
|
-
for ____, value in __TS__Iterator(
|
|
217
|
-
|
|
218
|
-
) do
|
|
219
|
-
____exports.log(
|
|
220
|
-
" Value: " .. tostring(value)
|
|
221
|
-
)
|
|
172
|
+
for ____, value in __TS__Iterator(set:values()) do
|
|
173
|
+
____exports.log(" Value: " .. tostring(value))
|
|
222
174
|
end
|
|
223
|
-
____exports.log(
|
|
224
|
-
"The size of the set was: " .. tostring(set.size)
|
|
225
|
-
)
|
|
175
|
+
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
226
176
|
end
|
|
227
177
|
function ____exports.logVector(vector)
|
|
228
|
-
____exports.log(
|
|
229
|
-
((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")"
|
|
230
|
-
)
|
|
178
|
+
____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
|
|
231
179
|
end
|
|
232
180
|
function ____exports.setLogFunctionsGlobal(self)
|
|
233
181
|
local globals = _G
|
package/dist/functions/math.lua
CHANGED
|
@@ -13,25 +13,25 @@ function getCircleInitialPosition(self, direction, radius)
|
|
|
13
13
|
return Vector.Zero
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
|
-
____cond6 = ____cond6 or
|
|
16
|
+
____cond6 = ____cond6 or ____switch6 == Direction.LEFT
|
|
17
17
|
if ____cond6 then
|
|
18
18
|
do
|
|
19
19
|
return Vector(-radius, 0)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
|
-
____cond6 = ____cond6 or
|
|
22
|
+
____cond6 = ____cond6 or ____switch6 == Direction.UP
|
|
23
23
|
if ____cond6 then
|
|
24
24
|
do
|
|
25
25
|
return Vector(0, -radius)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
|
-
____cond6 = ____cond6 or
|
|
28
|
+
____cond6 = ____cond6 or ____switch6 == Direction.RIGHT
|
|
29
29
|
if ____cond6 then
|
|
30
30
|
do
|
|
31
31
|
return Vector(radius, 0)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
-
____cond6 = ____cond6 or
|
|
34
|
+
____cond6 = ____cond6 or ____switch6 == Direction.DOWN
|
|
35
35
|
if ____cond6 then
|
|
36
36
|
do
|
|
37
37
|
return Vector(0, radius)
|
|
@@ -47,7 +47,7 @@ function getCircleInitialPosition(self, direction, radius)
|
|
|
47
47
|
end
|
|
48
48
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
49
49
|
local subtractedAngle = angle1 - angle2
|
|
50
|
-
return (
|
|
50
|
+
return (subtractedAngle + 180) % 360 - 180
|
|
51
51
|
end
|
|
52
52
|
function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoints, xMultiplier, yMultiplier, initialDirection)
|
|
53
53
|
if xMultiplier == nil then
|
|
@@ -64,7 +64,7 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
|
|
|
64
64
|
do
|
|
65
65
|
local i = 0
|
|
66
66
|
while i < numPoints do
|
|
67
|
-
local rotatedPosition = initialPosition:Rotated(
|
|
67
|
+
local rotatedPosition = initialPosition:Rotated(i * 360 / numPoints)
|
|
68
68
|
rotatedPosition.X = rotatedPosition.X * xMultiplier
|
|
69
69
|
rotatedPosition.Y = rotatedPosition.Y * yMultiplier
|
|
70
70
|
local positionFromCenter = centerPos + rotatedPosition
|
|
@@ -75,28 +75,26 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
|
|
|
75
75
|
return positions
|
|
76
76
|
end
|
|
77
77
|
function ____exports.isEven(self, num)
|
|
78
|
-
return
|
|
78
|
+
return num & 1 == 0
|
|
79
79
|
end
|
|
80
80
|
function ____exports.isOdd(self, num)
|
|
81
|
-
return
|
|
81
|
+
return num & 1 == 1
|
|
82
82
|
end
|
|
83
83
|
function ____exports.lerp(self, a, b, pos)
|
|
84
|
-
return a + (
|
|
84
|
+
return a + (b - a) * pos
|
|
85
85
|
end
|
|
86
86
|
function ____exports.lerpAngleDegrees(self, aStart, aEnd, percent)
|
|
87
|
-
return aStart +
|
|
87
|
+
return aStart + ____exports.getAngleDifference(nil, aStart, aEnd) * percent
|
|
88
88
|
end
|
|
89
89
|
function ____exports.round(self, num, numDecimalPlaces)
|
|
90
90
|
if numDecimalPlaces == nil then
|
|
91
91
|
numDecimalPlaces = 0
|
|
92
92
|
end
|
|
93
|
-
local roundedNum = tonumber(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
return ((roundedNum == nil) and 0) or roundedNum
|
|
93
|
+
local roundedNum = tonumber(string.format(
|
|
94
|
+
("%." .. tostring(numDecimalPlaces)) .. "f",
|
|
95
|
+
num
|
|
96
|
+
))
|
|
97
|
+
return roundedNum == nil and 0 or roundedNum
|
|
100
98
|
end
|
|
101
99
|
function ____exports.tanh(self, x)
|
|
102
100
|
return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
|
package/dist/functions/npc.lua
CHANGED
|
@@ -11,9 +11,7 @@ local getProjectiles = ____entity.getProjectiles
|
|
|
11
11
|
local removeEntities = ____entity.removeEntities
|
|
12
12
|
function ____exports.getBosses(self)
|
|
13
13
|
local bosses = {}
|
|
14
|
-
for ____, npc in ipairs(
|
|
15
|
-
____exports.getNPCs(nil)
|
|
16
|
-
) do
|
|
14
|
+
for ____, npc in ipairs(____exports.getNPCs(nil)) do
|
|
17
15
|
if npc:IsBoss() then
|
|
18
16
|
__TS__ArrayPush(bosses, npc)
|
|
19
17
|
end
|
|
@@ -24,7 +22,13 @@ function ____exports.getNPCs(self, matchingEntityType, matchingVariant, matching
|
|
|
24
22
|
if ignoreFriendly == nil then
|
|
25
23
|
ignoreFriendly = false
|
|
26
24
|
end
|
|
27
|
-
local entities = getEntities(
|
|
25
|
+
local entities = getEntities(
|
|
26
|
+
nil,
|
|
27
|
+
matchingEntityType,
|
|
28
|
+
matchingVariant,
|
|
29
|
+
matchingSubType,
|
|
30
|
+
ignoreFriendly
|
|
31
|
+
)
|
|
28
32
|
local npcs = {}
|
|
29
33
|
for ____, entity in ipairs(entities) do
|
|
30
34
|
local npc = entity:ToNPC()
|
|
@@ -52,10 +56,10 @@ function ____exports.isAliveExceptionNPC(self, npc)
|
|
|
52
56
|
return false
|
|
53
57
|
end
|
|
54
58
|
function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
|
|
55
|
-
return
|
|
59
|
+
return npc.State == NpcState.STATE_SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
56
60
|
end
|
|
57
61
|
function ____exports.isRaglingDeathPatch(self, npc)
|
|
58
|
-
return
|
|
62
|
+
return npc.Type == EntityType.ENTITY_RAGLING and npc.Variant == 1 and npc.State == NpcState.STATE_SPECIAL
|
|
59
63
|
end
|
|
60
64
|
NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
61
65
|
Set,
|
|
@@ -73,9 +77,7 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
|
73
77
|
)
|
|
74
78
|
NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE = __TS__New(
|
|
75
79
|
Set,
|
|
76
|
-
{
|
|
77
|
-
(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1
|
|
78
|
-
}
|
|
80
|
+
{(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1}
|
|
79
81
|
)
|
|
80
82
|
function ____exports.fireProjectiles(self, npc, position, velocity, projectilesMode, projectileParams)
|
|
81
83
|
if projectilesMode == nil then
|
|
@@ -91,10 +93,8 @@ function ____exports.fireProjectiles(self, npc, position, velocity, projectilesM
|
|
|
91
93
|
end
|
|
92
94
|
function ____exports.getAliveBosses(self)
|
|
93
95
|
local aliveBosses = {}
|
|
94
|
-
for ____, boss in ipairs(
|
|
95
|
-
____exports.
|
|
96
|
-
) do
|
|
97
|
-
if (not boss:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, boss)) then
|
|
96
|
+
for ____, boss in ipairs(____exports.getBosses(nil)) do
|
|
97
|
+
if not boss:IsDead() and not ____exports.isAliveExceptionNPC(nil, boss) then
|
|
98
98
|
__TS__ArrayPush(aliveBosses, boss)
|
|
99
99
|
end
|
|
100
100
|
end
|
|
@@ -102,10 +102,8 @@ function ____exports.getAliveBosses(self)
|
|
|
102
102
|
end
|
|
103
103
|
function ____exports.getAliveNPCs(self)
|
|
104
104
|
local aliveNPCs = {}
|
|
105
|
-
for ____, npc in ipairs(
|
|
106
|
-
____exports.
|
|
107
|
-
) do
|
|
108
|
-
if (not npc:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, npc)) then
|
|
105
|
+
for ____, npc in ipairs(____exports.getNPCs(nil)) do
|
|
106
|
+
if not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) then
|
|
109
107
|
__TS__ArrayPush(aliveNPCs, npc)
|
|
110
108
|
end
|
|
111
109
|
end
|
|
@@ -15,7 +15,20 @@ function ____exports.getRandomHeartSubType(self, seed, exceptions)
|
|
|
15
15
|
local heartSubTypes = getEnumValues(nil, HeartSubType)
|
|
16
16
|
return getRandomArrayElement(nil, heartSubTypes, seed, exceptions)
|
|
17
17
|
end
|
|
18
|
-
local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
|
|
18
|
+
local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
|
|
19
|
+
PickupVariant.PICKUP_CHEST,
|
|
20
|
+
PickupVariant.PICKUP_BOMBCHEST,
|
|
21
|
+
PickupVariant.PICKUP_SPIKEDCHEST,
|
|
22
|
+
PickupVariant.PICKUP_ETERNALCHEST,
|
|
23
|
+
PickupVariant.PICKUP_MIMICCHEST,
|
|
24
|
+
PickupVariant.PICKUP_OLDCHEST,
|
|
25
|
+
PickupVariant.PICKUP_WOODENCHEST,
|
|
26
|
+
PickupVariant.PICKUP_MEGACHEST,
|
|
27
|
+
PickupVariant.PICKUP_HAUNTEDCHEST,
|
|
28
|
+
PickupVariant.PICKUP_LOCKEDCHEST,
|
|
29
|
+
PickupVariant.PICKUP_REDCHEST,
|
|
30
|
+
PickupVariant.PICKUP_MOMSCHEST
|
|
31
|
+
})
|
|
19
32
|
function ____exports.isChest(self, pickup)
|
|
20
33
|
return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
|
|
21
34
|
end
|