isaacscript-common 1.2.74 → 1.2.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/postFlip.lua +11 -8
- package/dist/callbacks/postGridEntityCollision.lua +24 -24
- package/dist/features/runInNFrames.lua +5 -6
- package/dist/functions/array.d.ts +8 -2
- package/dist/functions/array.lua +14 -2
- package/dist/functions/familiars.lua +4 -8
- package/dist/functions/globals.d.ts +1 -1
- package/dist/functions/globals.lua +9 -6
- package/dist/functions/log.lua +5 -6
- package/dist/functions/player.d.ts +13 -3
- package/dist/functions/player.lua +63 -57
- package/dist/functions/playerHealth.lua +5 -6
- package/dist/functions/sprite.lua +4 -11
- package/dist/patchErrorFunctions.lua +9 -15
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
2
4
|
local ____exports = {}
|
|
3
5
|
local hasSubscriptions, useItemFlip, getNewLazarus, v
|
|
4
6
|
local ____exports = require("features.saveDataManager.exports")
|
|
5
7
|
local saveDataManager = ____exports.saveDataManager
|
|
6
8
|
local ____player = require("functions.player")
|
|
7
|
-
local
|
|
9
|
+
local getPlayersOfType = ____player.getPlayersOfType
|
|
8
10
|
local isTaintedLazarus = ____player.isTaintedLazarus
|
|
9
11
|
local ____postFirstFlip = require("callbacks.subscriptions.postFirstFlip")
|
|
10
12
|
local postFirstFlipFire = ____postFirstFlip.postFirstFlipFire
|
|
@@ -23,6 +25,9 @@ function useItemFlip(self, _collectibleType, _rng, player, _useFlags, _activeSlo
|
|
|
23
25
|
return
|
|
24
26
|
end
|
|
25
27
|
local newLazarus = getNewLazarus(nil, player)
|
|
28
|
+
if newLazarus == nil then
|
|
29
|
+
return
|
|
30
|
+
end
|
|
26
31
|
if not v.run.usedFlipAtLeastOnce then
|
|
27
32
|
v.run.usedFlipAtLeastOnce = true
|
|
28
33
|
postFirstFlipFire(nil, newLazarus)
|
|
@@ -39,13 +44,11 @@ function getNewLazarus(self, oldLazarus)
|
|
|
39
44
|
else
|
|
40
45
|
error("Failed to determine the character in the postFlip callback.")
|
|
41
46
|
end
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
end
|
|
48
|
-
return error("Failed to find the player entity for the new Lazarus.")
|
|
47
|
+
local playersOfType = getPlayersOfType(nil, newCharacter)
|
|
48
|
+
return __TS__ArrayFind(
|
|
49
|
+
playersOfType,
|
|
50
|
+
function(____, player) return player.FrameCount == oldLazarus.FrameCount end
|
|
51
|
+
)
|
|
49
52
|
end
|
|
50
53
|
v = {run = {usedFlipAtLeastOnce = false}}
|
|
51
54
|
function ____exports.postFlipCallbacksInit(self, mod)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local Set = ____lualib.Set
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
6
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
6
7
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
7
8
|
local ____exports = {}
|
|
@@ -23,33 +24,32 @@ function postUpdate(self)
|
|
|
23
24
|
if not hasSubscriptions(nil) then
|
|
24
25
|
return
|
|
25
26
|
end
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
local gridEntities = getGridEntities(nil)
|
|
28
|
+
local gridEntitiesWithCollision = __TS__ArrayFilter(
|
|
29
|
+
gridEntities,
|
|
30
|
+
function(____, gridEntity) return gridEntity.CollisionClass ~= GridCollisionClass.COLLISION_NONE end
|
|
31
|
+
)
|
|
32
|
+
for ____, gridEntity in ipairs(gridEntitiesWithCollision) do
|
|
33
|
+
local gridEntityPtrHash = GetPtrHash(gridEntity)
|
|
34
|
+
local oldCollidingEntities = v.room.collidingEntitiesMap:getAndSetDefault(gridEntityPtrHash)
|
|
35
|
+
local collidingEntities = getCollidingEntitiesWithGridEntity(nil, gridEntity)
|
|
36
|
+
for ____, entity in ipairs(collidingEntities) do
|
|
37
|
+
local entityPtrHash = GetPtrHash(entity)
|
|
38
|
+
if not oldCollidingEntities:has(entityPtrHash) then
|
|
39
|
+
oldCollidingEntities:add(entityPtrHash)
|
|
40
|
+
postGridEntityCollisionFire(nil, gridEntity, entity)
|
|
30
41
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
end
|
|
41
|
-
local collidingEntitiesPtrHashes = __TS__ArrayMap(
|
|
42
|
-
collidingEntities,
|
|
43
|
-
function(____, entity) return GetPtrHash(entity) end
|
|
44
|
-
)
|
|
45
|
-
local collidingEntitiesPtrHashSet = __TS__New(Set, collidingEntitiesPtrHashes)
|
|
46
|
-
for ____, oldCollidingEntityPtrHash in __TS__Iterator(oldCollidingEntities:values()) do
|
|
47
|
-
if not collidingEntitiesPtrHashSet:has(oldCollidingEntityPtrHash) then
|
|
48
|
-
oldCollidingEntities:delete(oldCollidingEntityPtrHash)
|
|
49
|
-
end
|
|
42
|
+
end
|
|
43
|
+
local collidingEntitiesPtrHashes = __TS__ArrayMap(
|
|
44
|
+
collidingEntities,
|
|
45
|
+
function(____, entity) return GetPtrHash(entity) end
|
|
46
|
+
)
|
|
47
|
+
local collidingEntitiesPtrHashSet = __TS__New(Set, collidingEntitiesPtrHashes)
|
|
48
|
+
for ____, oldCollidingEntityPtrHash in __TS__Iterator(oldCollidingEntities:values()) do
|
|
49
|
+
if not collidingEntitiesPtrHashSet:has(oldCollidingEntityPtrHash) then
|
|
50
|
+
oldCollidingEntities:delete(oldCollidingEntityPtrHash)
|
|
50
51
|
end
|
|
51
52
|
end
|
|
52
|
-
::__continue7::
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
v = {room = {collidingEntitiesMap = __TS__New(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
4
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
4
5
|
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
|
|
5
6
|
local ____exports = {}
|
|
6
7
|
local postUpdate, postRender, checkExecuteQueuedFunctions, v
|
|
@@ -20,18 +21,16 @@ end
|
|
|
20
21
|
function checkExecuteQueuedFunctions(self, frameCount, functionTuples)
|
|
21
22
|
local functionsToFire = {}
|
|
22
23
|
local indexesToRemove = {}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
local functionTuple = functionTuples[i + 1]
|
|
24
|
+
__TS__ArrayForEach(
|
|
25
|
+
functionTuples,
|
|
26
|
+
function(____, functionTuple, i)
|
|
27
27
|
local frame, func = table.unpack(functionTuple)
|
|
28
28
|
if frameCount >= frame then
|
|
29
29
|
__TS__ArrayPush(functionsToFire, func)
|
|
30
30
|
__TS__ArrayPush(indexesToRemove, i)
|
|
31
31
|
end
|
|
32
|
-
i = i + 1
|
|
33
32
|
end
|
|
34
|
-
|
|
33
|
+
)
|
|
35
34
|
for ____, indexToRemove in ipairs(indexesToRemove) do
|
|
36
35
|
__TS__ArraySplice(functionTuples, indexToRemove, 1)
|
|
37
36
|
end
|
|
@@ -6,8 +6,14 @@
|
|
|
6
6
|
* combine N arrays. Note that this will only perform a shallow copy of the array elements.
|
|
7
7
|
*/
|
|
8
8
|
export declare function combineArray<T>(...arrays: Array<T[] | readonly T[]>): T[];
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to perform a shallow copy.
|
|
11
|
+
*
|
|
12
|
+
* @param oldArray The array to copy.
|
|
13
|
+
* @param numElements Optional. If specified, will only copy the first N elements. By default, the
|
|
14
|
+
* entire array will be copied.
|
|
15
|
+
*/
|
|
16
|
+
export declare function copyArray<T>(oldArray: T[] | readonly T[], numElements?: int): T[];
|
|
11
17
|
export declare function emptyArray<T>(array: T[]): void;
|
|
12
18
|
/**
|
|
13
19
|
* Helper function for determining if two arrays contain the exact same elements. Note that this
|
package/dist/functions/array.lua
CHANGED
|
@@ -48,8 +48,20 @@ function ____exports.combineArray(self, ...)
|
|
|
48
48
|
end
|
|
49
49
|
return elements
|
|
50
50
|
end
|
|
51
|
-
function ____exports.copyArray(self,
|
|
52
|
-
|
|
51
|
+
function ____exports.copyArray(self, oldArray, numElements)
|
|
52
|
+
if numElements == nil then
|
|
53
|
+
numElements = #oldArray
|
|
54
|
+
end
|
|
55
|
+
local newArray = {}
|
|
56
|
+
do
|
|
57
|
+
local i = 0
|
|
58
|
+
while i < numElements do
|
|
59
|
+
local oldElement = oldArray[i + 1]
|
|
60
|
+
__TS__ArrayPush(newArray, oldElement)
|
|
61
|
+
i = i + 1
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
return newArray
|
|
53
65
|
end
|
|
54
66
|
function ____exports.emptyArray(self, array)
|
|
55
67
|
__TS__ArraySplice(array, 0, #array)
|
|
@@ -5,6 +5,8 @@ local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
|
5
5
|
local ____exports = {}
|
|
6
6
|
local ____constants = require("constants")
|
|
7
7
|
local FAMILIARS_THAT_SHOOT_PLAYER_TEARS = ____constants.FAMILIARS_THAT_SHOOT_PLAYER_TEARS
|
|
8
|
+
local ____array = require("functions.array")
|
|
9
|
+
local copyArray = ____array.copyArray
|
|
8
10
|
local ____entity = require("functions.entity")
|
|
9
11
|
local getEntities = ____entity.getEntities
|
|
10
12
|
local removeEntities = ____entity.removeEntities
|
|
@@ -41,14 +43,8 @@ function ____exports.checkFamiliar(self, player, collectibleType, numTargetFamil
|
|
|
41
43
|
end
|
|
42
44
|
if #familiarsForThisPlayer > numTargetFamiliars then
|
|
43
45
|
local numFamiliarsToRemove = #familiarsForThisPlayer - numTargetFamiliars
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
while i < numFamiliarsToRemove do
|
|
47
|
-
local familiar = familiarsForThisPlayer[i + 1]
|
|
48
|
-
familiar:Remove()
|
|
49
|
-
i = i + 1
|
|
50
|
-
end
|
|
51
|
-
end
|
|
46
|
+
local familiarsToRemove = copyArray(nil, familiarsForThisPlayer, numFamiliarsToRemove)
|
|
47
|
+
removeEntities(nil, familiarsToRemove)
|
|
52
48
|
return numFamiliarsToRemove * -1
|
|
53
49
|
end
|
|
54
50
|
local numFamiliarsToSpawn = numTargetFamiliars - #familiarsForThisPlayer
|
|
@@ -10,5 +10,5 @@ export declare function getDefaultGlobals(): Set<string>;
|
|
|
10
10
|
* Helper function to get an array of any added global variables in the Isaac Lua environment.
|
|
11
11
|
* Returns an array of key/value tuples.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getNewGlobals(): [AnyNotNil, unknown]
|
|
13
|
+
export declare function getNewGlobals(): Array<[AnyNotNil, unknown]>;
|
|
14
14
|
export declare function logNewGlobals(): void;
|
|
@@ -4,6 +4,7 @@ local Set = ____lualib.Set
|
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
6
6
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
7
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
7
8
|
local ____exports = {}
|
|
8
9
|
local twoDimensionalSort
|
|
9
10
|
local ____log = require("functions.log")
|
|
@@ -214,13 +215,15 @@ function ____exports.logNewGlobals(self)
|
|
|
214
215
|
if #newGlobals == 0 then
|
|
215
216
|
log("- n/a (no extra global variables found)")
|
|
216
217
|
end
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
local
|
|
218
|
+
__TS__ArrayForEach(
|
|
219
|
+
newGlobals,
|
|
220
|
+
function(____, ____bindingPattern0, i)
|
|
221
|
+
local value
|
|
222
|
+
local key
|
|
223
|
+
key = ____bindingPattern0[1]
|
|
224
|
+
value = ____bindingPattern0[2]
|
|
221
225
|
log((((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value))
|
|
222
|
-
i = i + 1
|
|
223
226
|
end
|
|
224
|
-
|
|
227
|
+
)
|
|
225
228
|
end
|
|
226
229
|
return ____exports
|
package/dist/functions/log.lua
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local Map = ____lualib.Map
|
|
4
4
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
5
6
|
local Set = ____lualib.Set
|
|
6
7
|
local ____exports = {}
|
|
7
8
|
local ____array = require("functions.array")
|
|
@@ -154,10 +155,9 @@ function ____exports.logTemporaryEffects(player)
|
|
|
154
155
|
____exports.log(" n/a (no temporary effects)")
|
|
155
156
|
return
|
|
156
157
|
end
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
local effect = effects[i + 1]
|
|
158
|
+
__TS__ArrayForEach(
|
|
159
|
+
effects,
|
|
160
|
+
function(____, effect, i)
|
|
161
161
|
if effect.Item:IsCollectible() then
|
|
162
162
|
local collectibleName = getCollectibleName(nil, effect.Item.ID)
|
|
163
163
|
____exports.log(((" " .. tostring(i + 1)) .. ") ") .. collectibleName)
|
|
@@ -169,9 +169,8 @@ function ____exports.logTemporaryEffects(player)
|
|
|
169
169
|
else
|
|
170
170
|
____exports.log(((" " .. tostring(i + 1)) .. ") Unknown type of temporary effect: ") .. tostring(effect.Item.ID))
|
|
171
171
|
end
|
|
172
|
-
i = i + 1
|
|
173
172
|
end
|
|
174
|
-
|
|
173
|
+
)
|
|
175
174
|
end
|
|
176
175
|
function ____exports.logSet(set)
|
|
177
176
|
____exports.log("Printing out a TSTL Set:")
|
|
@@ -45,6 +45,14 @@ export declare function characterCanHaveSoulHearts(character: PlayerType | int):
|
|
|
45
45
|
* Otherwise, returns false.
|
|
46
46
|
*/
|
|
47
47
|
export declare function characterGetsBlackHeartFromEternalHeart(character: PlayerType | int): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Helper function to get every player with no restrictions, by using `Game.GetNumPlayers` and
|
|
50
|
+
* `Isaac.GetPlayer`.
|
|
51
|
+
*
|
|
52
|
+
* This function is almost never what you want to use. For most intents and purposes, use the
|
|
53
|
+
* `getPlayers()` helper function instead to get a more filtered list of players.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getAllPlayers(): EntityPlayer[];
|
|
48
56
|
/**
|
|
49
57
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
50
58
|
* `EntityPlayer` object or a tear height stat.
|
|
@@ -167,10 +175,12 @@ export declare function getPlayerNumHitsRemaining(player: EntityPlayer): int;
|
|
|
167
175
|
* This function always excludes players with a non-undefined parent, since they are not real
|
|
168
176
|
* players. (e.g. the Strawman Keeper)
|
|
169
177
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
178
|
+
* If this is not desired, use the `getAllPlayers` helper function instead.
|
|
179
|
+
*
|
|
180
|
+
* @param performCharacterExclusions Whether or not to exclude characters that are not directly
|
|
181
|
+
* controlled by the player (i.e. Esau & Tainted Soul). False by default.
|
|
172
182
|
*/
|
|
173
|
-
export declare function getPlayers(
|
|
183
|
+
export declare function getPlayers(performCharacterExclusions?: boolean): EntityPlayer[];
|
|
174
184
|
/**
|
|
175
185
|
* Helper function to get all of the players that are a certain character.
|
|
176
186
|
*
|
|
@@ -3,8 +3,8 @@ local ____lualib = require("lualib_bundle")
|
|
|
3
3
|
local Set = ____lualib.Set
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
6
|
-
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
7
6
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
7
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
8
8
|
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
9
9
|
local Map = ____lualib.Map
|
|
10
10
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
@@ -35,6 +35,21 @@ local stringContains = ____string.stringContains
|
|
|
35
35
|
local trimPrefix = ____string.trimPrefix
|
|
36
36
|
local ____utils = require("functions.utils")
|
|
37
37
|
local ensureAllCases = ____utils.ensureAllCases
|
|
38
|
+
local ____repeat = ____utils["repeat"]
|
|
39
|
+
function ____exports.getAllPlayers(self)
|
|
40
|
+
local game = Game()
|
|
41
|
+
local numPlayers = game:GetNumPlayers()
|
|
42
|
+
local players = {}
|
|
43
|
+
do
|
|
44
|
+
local i = 0
|
|
45
|
+
while i < numPlayers do
|
|
46
|
+
local player = Isaac.GetPlayer(i)
|
|
47
|
+
__TS__ArrayPush(players, player)
|
|
48
|
+
i = i + 1
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
return players
|
|
52
|
+
end
|
|
38
53
|
function ____exports.getCharacterMaxHeartContainers(self, character)
|
|
39
54
|
if character == PlayerType.PLAYER_KEEPER then
|
|
40
55
|
return 3
|
|
@@ -74,15 +89,15 @@ end
|
|
|
74
89
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
75
90
|
local character = player:GetPlayerType()
|
|
76
91
|
repeat
|
|
77
|
-
local
|
|
78
|
-
local
|
|
79
|
-
if
|
|
92
|
+
local ____switch64 = character
|
|
93
|
+
local ____cond64 = ____switch64 == PlayerType.PLAYER_THESOUL
|
|
94
|
+
if ____cond64 then
|
|
80
95
|
do
|
|
81
96
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
82
97
|
end
|
|
83
98
|
end
|
|
84
|
-
|
|
85
|
-
if
|
|
99
|
+
____cond64 = ____cond64 or ____switch64 == PlayerType.PLAYER_LAZARUS2_B
|
|
100
|
+
if ____cond64 then
|
|
86
101
|
do
|
|
87
102
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
88
103
|
end
|
|
@@ -110,39 +125,39 @@ end
|
|
|
110
125
|
function getAdjustedPlayerName(self, player)
|
|
111
126
|
local character = player:GetPlayerType()
|
|
112
127
|
repeat
|
|
113
|
-
local
|
|
114
|
-
local
|
|
115
|
-
if
|
|
128
|
+
local ____switch77 = character
|
|
129
|
+
local ____cond77 = ____switch77 == PlayerType.PLAYER_BLUEBABY or ____switch77 == PlayerType.PLAYER_BLUEBABY_B
|
|
130
|
+
if ____cond77 then
|
|
116
131
|
do
|
|
117
132
|
return "Blue Baby"
|
|
118
133
|
end
|
|
119
134
|
end
|
|
120
|
-
|
|
121
|
-
if
|
|
135
|
+
____cond77 = ____cond77 or ____switch77 == PlayerType.PLAYER_LAZARUS2
|
|
136
|
+
if ____cond77 then
|
|
122
137
|
do
|
|
123
138
|
return "Lazarus II"
|
|
124
139
|
end
|
|
125
140
|
end
|
|
126
|
-
|
|
127
|
-
if
|
|
141
|
+
____cond77 = ____cond77 or ____switch77 == PlayerType.PLAYER_BLACKJUDAS
|
|
142
|
+
if ____cond77 then
|
|
128
143
|
do
|
|
129
144
|
return "Dark Judas"
|
|
130
145
|
end
|
|
131
146
|
end
|
|
132
|
-
|
|
133
|
-
if
|
|
147
|
+
____cond77 = ____cond77 or ____switch77 == PlayerType.PLAYER_JACOB
|
|
148
|
+
if ____cond77 then
|
|
134
149
|
do
|
|
135
150
|
return "Jacob & Esau"
|
|
136
151
|
end
|
|
137
152
|
end
|
|
138
|
-
|
|
139
|
-
if
|
|
153
|
+
____cond77 = ____cond77 or ____switch77 == PlayerType.PLAYER_LAZARUS2_B
|
|
154
|
+
if ____cond77 then
|
|
140
155
|
do
|
|
141
156
|
return "Dead Tainted Lazarus"
|
|
142
157
|
end
|
|
143
158
|
end
|
|
144
|
-
|
|
145
|
-
if
|
|
159
|
+
____cond77 = ____cond77 or ____switch77 == PlayerType.PLAYER_JACOB2_B
|
|
160
|
+
if ____cond77 then
|
|
146
161
|
do
|
|
147
162
|
return "Dead Tainted Jacob"
|
|
148
163
|
end
|
|
@@ -154,32 +169,23 @@ function getAdjustedPlayerName(self, player)
|
|
|
154
169
|
end
|
|
155
170
|
until true
|
|
156
171
|
end
|
|
157
|
-
function ____exports.getPlayers(self,
|
|
158
|
-
if
|
|
159
|
-
|
|
172
|
+
function ____exports.getPlayers(self, performCharacterExclusions)
|
|
173
|
+
if performCharacterExclusions == nil then
|
|
174
|
+
performCharacterExclusions = false
|
|
160
175
|
end
|
|
161
|
-
local
|
|
162
|
-
local
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
end
|
|
172
|
-
local character = player:GetPlayerType()
|
|
173
|
-
if performExclusions and EXCLUDED_CHARACTERS:has(character) then
|
|
174
|
-
goto __continue85
|
|
175
|
-
end
|
|
176
|
-
__TS__ArrayPush(players, player)
|
|
177
|
-
end
|
|
178
|
-
::__continue85::
|
|
179
|
-
i = i + 1
|
|
176
|
+
local players = ____exports.getAllPlayers(nil)
|
|
177
|
+
local nonChildPlayers = __TS__ArrayFilter(
|
|
178
|
+
players,
|
|
179
|
+
function(____, player) return not ____exports.isChildPlayer(nil, player) end
|
|
180
|
+
)
|
|
181
|
+
local nonChildPlayersFiltered = __TS__ArrayFilter(
|
|
182
|
+
nonChildPlayers,
|
|
183
|
+
function(____, player)
|
|
184
|
+
local character = player:GetPlayerType()
|
|
185
|
+
return not EXCLUDED_CHARACTERS:has(character)
|
|
180
186
|
end
|
|
181
|
-
|
|
182
|
-
return
|
|
187
|
+
)
|
|
188
|
+
return performCharacterExclusions and nonChildPlayersFiltered or nonChildPlayers
|
|
183
189
|
end
|
|
184
190
|
function ____exports.getSubPlayerParent(self, subPlayer)
|
|
185
191
|
local subPlayerPtrHash = GetPtrHash(subPlayer)
|
|
@@ -534,13 +540,13 @@ function ____exports.removeCollectibleCostume(self, player, collectibleType)
|
|
|
534
540
|
player:RemoveCostume(itemConfigItem)
|
|
535
541
|
end
|
|
536
542
|
function ____exports.removeDeadEyeMultiplier(self, player)
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
543
|
+
____repeat(
|
|
544
|
+
nil,
|
|
545
|
+
100,
|
|
546
|
+
function()
|
|
540
547
|
player:ClearDeadEyeCharge()
|
|
541
|
-
i = i + 1
|
|
542
548
|
end
|
|
543
|
-
|
|
549
|
+
)
|
|
544
550
|
end
|
|
545
551
|
function ____exports.removeTrinketCostume(self, player, trinketType)
|
|
546
552
|
local itemConfig = Isaac.GetItemConfig()
|
|
@@ -566,9 +572,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
566
572
|
itemPool:RemoveCollectible(collectibleType)
|
|
567
573
|
end
|
|
568
574
|
repeat
|
|
569
|
-
local
|
|
570
|
-
local
|
|
571
|
-
if
|
|
575
|
+
local ____switch122 = activeSlot
|
|
576
|
+
local ____cond122 = ____switch122 == ActiveSlot.SLOT_PRIMARY
|
|
577
|
+
if ____cond122 then
|
|
572
578
|
do
|
|
573
579
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
574
580
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -577,8 +583,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
577
583
|
break
|
|
578
584
|
end
|
|
579
585
|
end
|
|
580
|
-
|
|
581
|
-
if
|
|
586
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.SLOT_SECONDARY
|
|
587
|
+
if ____cond122 then
|
|
582
588
|
do
|
|
583
589
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
584
590
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -593,16 +599,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
593
599
|
break
|
|
594
600
|
end
|
|
595
601
|
end
|
|
596
|
-
|
|
597
|
-
if
|
|
602
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.SLOT_POCKET
|
|
603
|
+
if ____cond122 then
|
|
598
604
|
do
|
|
599
605
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
600
606
|
player:SetActiveCharge(charge, activeSlot)
|
|
601
607
|
break
|
|
602
608
|
end
|
|
603
609
|
end
|
|
604
|
-
|
|
605
|
-
if
|
|
610
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.SLOT_POCKET2
|
|
611
|
+
if ____cond122 then
|
|
606
612
|
do
|
|
607
613
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
608
614
|
break
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
4
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
4
5
|
local ____exports = {}
|
|
5
6
|
local ____constants = require("constants")
|
|
6
7
|
local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
|
|
@@ -90,10 +91,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
90
91
|
end
|
|
91
92
|
player:AddEternalHearts(playerHealth.eternalHearts)
|
|
92
93
|
local soulHeartsRemaining = playerHealth.soulHearts
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
local heartType = playerHealth.soulHeartTypes[i + 1]
|
|
94
|
+
__TS__ArrayForEach(
|
|
95
|
+
playerHealth.soulHeartTypes,
|
|
96
|
+
function(____, heartType, i)
|
|
97
97
|
local isHalf = playerHealth.soulHearts + playerHealth.boneHearts * 2 < (i + 1) * 2
|
|
98
98
|
local addAmount = 2
|
|
99
99
|
if isHalf or heartType == HeartSubType.HEART_BONE or soulHeartsRemaining < 2 then
|
|
@@ -108,9 +108,8 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
108
108
|
elseif heartType == HeartSubType.HEART_BONE then
|
|
109
109
|
player:AddBoneHearts(addAmount)
|
|
110
110
|
end
|
|
111
|
-
i = i + 1
|
|
112
111
|
end
|
|
113
|
-
|
|
112
|
+
)
|
|
114
113
|
player:AddRottenHearts(playerHealth.rottenHearts)
|
|
115
114
|
player:AddHearts(playerHealth.hearts)
|
|
116
115
|
player:AddGoldenHearts(playerHealth.goldenHearts)
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
-
local ____lualib = require("lualib_bundle")
|
|
3
|
-
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
4
2
|
local ____exports = {}
|
|
5
3
|
local ____constants = require("constants")
|
|
6
4
|
local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
|
|
5
|
+
local ____math = require("functions.math")
|
|
6
|
+
local range = ____math.range
|
|
7
7
|
function ____exports.clearSprite(self, sprite, ...)
|
|
8
8
|
local layerIDs = {...}
|
|
9
|
-
local numLayers = sprite:GetLayerCount()
|
|
10
9
|
if #layerIDs == 0 then
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
local i = 0
|
|
14
|
-
while i < numLayers do
|
|
15
|
-
__TS__ArrayPush(layerIDs, i)
|
|
16
|
-
i = i + 1
|
|
17
|
-
end
|
|
18
|
-
end
|
|
10
|
+
local numLayers = sprite:GetLayerCount()
|
|
11
|
+
layerIDs = range(nil, 0, numLayers - 1)
|
|
19
12
|
end
|
|
20
13
|
for ____, layerID in ipairs(layerIDs) do
|
|
21
14
|
sprite:ReplaceSpritesheet(layerID, EMPTY_PNG_PATH)
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
4
4
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
5
|
-
local
|
|
5
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local errorWithTraceback, slimTracebackOutput,
|
|
7
|
+
local errorWithTraceback, slimTracebackOutput, removeLinesContaining, LINE_SEPARATOR, USELESS_TRACEBACK_MESSAGES, vanillaError
|
|
8
8
|
local ____debug = require("functions.debug")
|
|
9
9
|
local getTraceback = ____debug.getTraceback
|
|
10
10
|
local ____utils = require("functions.utils")
|
|
@@ -24,23 +24,17 @@ function errorWithTraceback(message, level)
|
|
|
24
24
|
end
|
|
25
25
|
function slimTracebackOutput(self, tracebackOutput)
|
|
26
26
|
for ____, msg in ipairs(USELESS_TRACEBACK_MESSAGES) do
|
|
27
|
-
tracebackOutput =
|
|
27
|
+
tracebackOutput = removeLinesContaining(nil, tracebackOutput, msg)
|
|
28
28
|
end
|
|
29
29
|
return tracebackOutput
|
|
30
30
|
end
|
|
31
|
-
function
|
|
31
|
+
function removeLinesContaining(self, msg, containsMsg)
|
|
32
32
|
local lines = __TS__StringSplit(msg, LINE_SEPARATOR)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
__TS__ArraySplice(lines, i, 1)
|
|
39
|
-
end
|
|
40
|
-
i = i + 1
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
return table.concat(lines, LINE_SEPARATOR or ",")
|
|
33
|
+
local linesThatDontContain = __TS__ArrayFilter(
|
|
34
|
+
lines,
|
|
35
|
+
function(____, line) return not __TS__StringIncludes(line, containsMsg) end
|
|
36
|
+
)
|
|
37
|
+
return table.concat(linesThatDontContain, LINE_SEPARATOR or ",")
|
|
44
38
|
end
|
|
45
39
|
LINE_SEPARATOR = "\n"
|
|
46
40
|
USELESS_TRACEBACK_MESSAGES = {"in upvalue 'getTraceback'", "in function 'sandbox.GetTraceback'", "in function 'error'"}
|