isaacscript-common 1.2.174 → 1.2.175
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/classes/null.d.ts +6 -7
- package/dist/classes/null.lua +5 -5
- package/dist/constants.d.ts +10 -10
- package/dist/constants.lua +3 -3
- package/dist/features/collectiblesSeen.d.ts +6 -0
- package/dist/features/collectiblesSeen.lua +43 -0
- package/dist/features/deployJSONRoom.lua +2 -1
- package/dist/features/extraConsoleCommands/commands.d.ts +11 -11
- package/dist/features/extraConsoleCommands/commands.lua +23 -22
- package/dist/features/extraConsoleCommands/init.lua +6 -6
- package/dist/features/playerInventory.d.ts +10 -2
- package/dist/features/playerInventory.lua +51 -15
- package/dist/features/saveDataManager/constants.d.ts +1 -1
- package/dist/features/saveDataManager/constants.lua +1 -1
- package/dist/features/saveDataManager/exports.d.ts +6 -6
- package/dist/features/saveDataManager/exports.lua +4 -4
- package/dist/features/saveDataManager/merge.lua +5 -3
- package/dist/featuresInitialized.d.ts +1 -1
- package/dist/featuresInitialized.lua +3 -3
- package/dist/functions/array.d.ts +39 -39
- package/dist/functions/array.lua +79 -79
- package/dist/functions/cards.d.ts +3 -3
- package/dist/functions/cards.lua +7 -7
- package/dist/functions/charge.d.ts +11 -11
- package/dist/functions/charge.lua +13 -13
- package/dist/functions/collectibles.d.ts +53 -15
- package/dist/functions/collectibles.lua +44 -21
- package/dist/functions/color.d.ts +2 -2
- package/dist/functions/color.lua +6 -6
- package/dist/functions/deepCopy.d.ts +0 -3
- package/dist/functions/deepCopy.lua +5 -22
- package/dist/functions/doors.d.ts +8 -8
- package/dist/functions/doors.lua +16 -16
- package/dist/functions/entity.d.ts +13 -14
- package/dist/functions/entity.lua +27 -34
- package/dist/functions/gridEntity.d.ts +1 -1
- package/dist/functions/gridEntity.lua +5 -5
- package/dist/functions/jsonHelpers.d.ts +7 -7
- package/dist/functions/jsonHelpers.lua +10 -11
- package/dist/functions/log.d.ts +21 -21
- package/dist/functions/log.lua +75 -74
- package/dist/functions/math.d.ts +1 -1
- package/dist/functions/math.lua +3 -3
- package/dist/functions/player.d.ts +6 -8
- package/dist/functions/player.lua +22 -29
- package/dist/functions/playerHealth.d.ts +1 -1
- package/dist/functions/playerHealth.lua +20 -20
- package/dist/functions/positionVelocity.d.ts +3 -0
- package/dist/functions/positionVelocity.lua +19 -5
- package/dist/functions/random.d.ts +7 -7
- package/dist/functions/revive.d.ts +5 -5
- package/dist/functions/revive.lua +8 -8
- package/dist/functions/roomData.d.ts +96 -0
- package/dist/functions/roomData.lua +57 -0
- package/dist/functions/rooms.d.ts +1 -96
- package/dist/functions/rooms.lua +30 -75
- package/dist/functions/set.d.ts +2 -2
- package/dist/functions/set.lua +7 -7
- package/dist/functions/trinketCacheFlag.d.ts +4 -4
- package/dist/functions/trinketCacheFlag.lua +3 -2
- package/dist/functions/trinketGive.d.ts +7 -7
- package/dist/functions/trinketGive.lua +27 -27
- package/dist/functions/trinkets.d.ts +2 -2
- package/dist/functions/trinkets.lua +6 -6
- package/dist/functions/ui.d.ts +13 -13
- package/dist/functions/ui.lua +28 -28
- package/dist/functions/utils.d.ts +6 -0
- package/dist/functions/utils.lua +7 -0
- package/dist/functions/vector.d.ts +2 -0
- package/dist/functions/vector.lua +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.lua +8 -0
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +1 -1
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -1
- package/dist/types/CollectibleIndex.d.ts +15 -0
- package/dist/types/CollectibleIndex.lua +3 -0
- package/dist/upgradeMod.lua +3 -0
- package/package.json +2 -2
package/dist/functions/log.d.ts
CHANGED
|
@@ -10,44 +10,44 @@ export declare function getDebugPrependString(msg: string, numParentFunctions?:
|
|
|
10
10
|
* and the line number before the string.
|
|
11
11
|
*/
|
|
12
12
|
export declare function log(this: void, msg: string): void;
|
|
13
|
+
export declare function logArray<T>(this: void, array: T[]): void;
|
|
14
|
+
export declare function logColor(this: void, color: Color): void;
|
|
13
15
|
/** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
|
|
14
|
-
export declare function
|
|
16
|
+
export declare function logDamageFlags(this: void, flags: int): void;
|
|
17
|
+
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
|
|
18
|
+
export declare function logEntity(this: void, entity: Entity): void;
|
|
15
19
|
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
16
|
-
export declare function
|
|
20
|
+
export declare function logEntityFlags(this: void, flags: int): void;
|
|
17
21
|
/** Helper function for printing out every flag that is turned on. Useful when debugging. */
|
|
18
|
-
export declare function
|
|
22
|
+
export declare function logFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
|
|
19
23
|
/**
|
|
20
24
|
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
21
25
|
*/
|
|
22
|
-
export declare function
|
|
26
|
+
export declare function logGameStateFlags(this: void): void;
|
|
27
|
+
export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType | int): void;
|
|
28
|
+
export declare function logKColor(this: void, kColor: KColor): void;
|
|
29
|
+
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
|
|
30
|
+
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
23
31
|
/**
|
|
24
32
|
* Helper function for printing out every projectile flag that is turned on. Useful when debugging.
|
|
25
33
|
*/
|
|
26
|
-
export declare function
|
|
34
|
+
export declare function logProjectileFlags(this: void, flags: int): void;
|
|
35
|
+
/** Helper function for logging information about the current room. */
|
|
36
|
+
export declare function logRoom(this: void): void;
|
|
27
37
|
/**
|
|
28
38
|
* Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
|
|
29
39
|
* particular run.
|
|
30
40
|
*/
|
|
31
|
-
export declare function
|
|
32
|
-
|
|
33
|
-
export declare function logAllTearFlags(this: void, flags: int): void;
|
|
34
|
-
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
35
|
-
export declare function logAllUseFlags(this: void, _flags: int): void;
|
|
36
|
-
export declare function logArray<T>(this: void, array: T[]): void;
|
|
37
|
-
export declare function logColor(this: void, color: Color): void;
|
|
38
|
-
export declare function logEntity(this: void, entity: Entity): void;
|
|
39
|
-
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
|
|
40
|
-
export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType | int): void;
|
|
41
|
-
export declare function logKColor(this: void, kColor: KColor): void;
|
|
42
|
-
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
|
|
43
|
-
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
44
|
-
/** Helper function for logging information about the current room. */
|
|
45
|
-
export declare function logRoom(this: void): void;
|
|
41
|
+
export declare function logSeedEffects(this: void): void;
|
|
42
|
+
export declare function logSet(this: void, set: Set<AnyNotNil>): void;
|
|
46
43
|
/** Helper function for logging every sound effect that is currently playing. */
|
|
47
44
|
export declare function logSounds(this: void): void;
|
|
48
45
|
export declare function logTable(this: void, table: unknown, parentTables?: number): void;
|
|
46
|
+
/** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
|
|
47
|
+
export declare function logTearFlags(this: void, flags: int): void;
|
|
49
48
|
export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
|
|
50
|
-
|
|
49
|
+
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
50
|
+
export declare function logUseFlags(this: void, _flags: int): void;
|
|
51
51
|
export declare function logVector(this: void, vector: Vector): void;
|
|
52
52
|
/**
|
|
53
53
|
* Converts every `isaacscript-common` function that begins with "log" to a global function.
|
package/dist/functions/log.lua
CHANGED
|
@@ -28,10 +28,10 @@ local getEffectsList = ____player.getEffectsList
|
|
|
28
28
|
local getPlayerName = ____player.getPlayerName
|
|
29
29
|
local ____playerHealth = require("functions.playerHealth")
|
|
30
30
|
local getPlayerHealth = ____playerHealth.getPlayerHealth
|
|
31
|
-
local
|
|
32
|
-
local getRoomData =
|
|
33
|
-
local getRoomGridIndex =
|
|
34
|
-
local getRoomListIndex =
|
|
31
|
+
local ____roomData = require("functions.roomData")
|
|
32
|
+
local getRoomData = ____roomData.getRoomData
|
|
33
|
+
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
34
|
+
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
35
35
|
local ____set = require("functions.set")
|
|
36
36
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
37
37
|
local ____trinkets = require("functions.trinkets")
|
|
@@ -55,7 +55,7 @@ function ____exports.log(msg)
|
|
|
55
55
|
local debugMsg = ____exports.getDebugPrependString(nil, msg)
|
|
56
56
|
Isaac.DebugString(debugMsg)
|
|
57
57
|
end
|
|
58
|
-
function ____exports.
|
|
58
|
+
function ____exports.logFlags(flags, flagEnum, description)
|
|
59
59
|
if description == nil then
|
|
60
60
|
description = ""
|
|
61
61
|
end
|
|
@@ -72,19 +72,19 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
|
-
____exports.log(((("Logging
|
|
75
|
+
____exports.log(((("Logging " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
|
|
76
76
|
local hasNoFlags = true
|
|
77
77
|
for key, value in pairs(flagEnum) do
|
|
78
78
|
do
|
|
79
79
|
if type(value) ~= "number" then
|
|
80
|
-
goto
|
|
80
|
+
goto __continue34
|
|
81
81
|
end
|
|
82
82
|
if hasFlag(nil, flags, value) then
|
|
83
83
|
____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
|
|
84
84
|
hasNoFlags = false
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
|
-
::
|
|
87
|
+
::__continue34::
|
|
88
88
|
end
|
|
89
89
|
if hasNoFlags then
|
|
90
90
|
____exports.log(" n/a (no flags)")
|
|
@@ -101,51 +101,6 @@ local IGNORE_EFFECT_VARIANTS = __TS__New(Set, {
|
|
|
101
101
|
EffectVariant.LIGHT,
|
|
102
102
|
EffectVariant.TADPOLE
|
|
103
103
|
})
|
|
104
|
-
function ____exports.logAllDamageFlags(flags)
|
|
105
|
-
____exports.logAllFlags(flags, DamageFlag, "damage")
|
|
106
|
-
end
|
|
107
|
-
function ____exports.logAllEntityFlags(flags)
|
|
108
|
-
____exports.logAllFlags(flags, EntityFlag, "entity")
|
|
109
|
-
end
|
|
110
|
-
function ____exports.logAllGameStateFlags()
|
|
111
|
-
____exports.log("Logging all game state flags:")
|
|
112
|
-
local hasNoFlags = true
|
|
113
|
-
for key, value in pairs(GameStateFlag) do
|
|
114
|
-
local gameStateFlag = value
|
|
115
|
-
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
116
|
-
if flagValue then
|
|
117
|
-
____exports.log((((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")")
|
|
118
|
-
hasNoFlags = false
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
if hasNoFlags then
|
|
122
|
-
____exports.log(" n/a (no flags)")
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
function ____exports.logAllProjectileFlags(flags)
|
|
126
|
-
____exports.logAllFlags(flags, ProjectileFlags, "projectile")
|
|
127
|
-
end
|
|
128
|
-
function ____exports.logAllSeedEffects()
|
|
129
|
-
local seeds = game:GetSeeds()
|
|
130
|
-
____exports.log("Logging all seed effects:")
|
|
131
|
-
local hasNoSeedEffects = true
|
|
132
|
-
for key, value in pairs(SeedEffect) do
|
|
133
|
-
local seedEffect = value
|
|
134
|
-
if seeds:HasSeedEffect(seedEffect) then
|
|
135
|
-
____exports.log((((" " .. key) .. " (") .. tostring(value)) .. ")")
|
|
136
|
-
hasNoSeedEffects = false
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
if hasNoSeedEffects then
|
|
140
|
-
____exports.log(" n/a (no seed effects)")
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
function ____exports.logAllTearFlags(flags)
|
|
144
|
-
____exports.logAllFlags(flags, TearFlags, "tear")
|
|
145
|
-
end
|
|
146
|
-
function ____exports.logAllUseFlags(_flags)
|
|
147
|
-
____exports.log("The \"logAllUseFlags\" helper function is temporarily disabled while the UseFlag enum remains unpatched in vanilla.")
|
|
148
|
-
end
|
|
149
104
|
function ____exports.logArray(array)
|
|
150
105
|
local arrayString = arrayToString(nil, array)
|
|
151
106
|
____exports.log("Array: " .. arrayString)
|
|
@@ -153,8 +108,8 @@ end
|
|
|
153
108
|
function ____exports.logColor(color)
|
|
154
109
|
____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))
|
|
155
110
|
end
|
|
156
|
-
function ____exports.
|
|
157
|
-
____exports.
|
|
111
|
+
function ____exports.logDamageFlags(flags)
|
|
112
|
+
____exports.logFlags(flags, DamageFlag, "damage")
|
|
158
113
|
end
|
|
159
114
|
function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
160
115
|
local headerMsg = "Entities in the room"
|
|
@@ -234,6 +189,27 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
|
234
189
|
____exports.log(("(" .. tostring(numMatchedEntities)) .. " total entities)")
|
|
235
190
|
end
|
|
236
191
|
end
|
|
192
|
+
function ____exports.logEntity(entity)
|
|
193
|
+
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
194
|
+
end
|
|
195
|
+
function ____exports.logEntityFlags(flags)
|
|
196
|
+
____exports.logFlags(flags, EntityFlag, "entity")
|
|
197
|
+
end
|
|
198
|
+
function ____exports.logGameStateFlags()
|
|
199
|
+
____exports.log("Logging game state flags:")
|
|
200
|
+
local hasNoFlags = true
|
|
201
|
+
for key, value in pairs(GameStateFlag) do
|
|
202
|
+
local gameStateFlag = value
|
|
203
|
+
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
204
|
+
if flagValue then
|
|
205
|
+
____exports.log((((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")")
|
|
206
|
+
hasNoFlags = false
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
if hasNoFlags then
|
|
210
|
+
____exports.log(" n/a (no flags)")
|
|
211
|
+
end
|
|
212
|
+
end
|
|
237
213
|
function ____exports.logGridEntities(includeWalls, gridEntityTypeFilter)
|
|
238
214
|
local headerMsg = "Grid entities in the room"
|
|
239
215
|
if gridEntityTypeFilter ~= nil then
|
|
@@ -329,6 +305,9 @@ function ____exports.logPlayerHealth(player)
|
|
|
329
305
|
____exports.log(" Blood charges: " .. tostring(playerHealth.bloodCharges))
|
|
330
306
|
____exports.log((" Soul heart types: [" .. table.concat(playerHealth.soulHeartTypes, "," or ",")) .. "]")
|
|
331
307
|
end
|
|
308
|
+
function ____exports.logProjectileFlags(flags)
|
|
309
|
+
____exports.logFlags(flags, ProjectileFlags, "projectile")
|
|
310
|
+
end
|
|
332
311
|
function ____exports.logRoom()
|
|
333
312
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
334
313
|
local roomListIndex = getRoomListIndex(nil)
|
|
@@ -343,6 +322,29 @@ function ____exports.logRoom()
|
|
|
343
322
|
____exports.log("Current room grid index: " .. tostring(roomGridIndex))
|
|
344
323
|
____exports.log("Current room list index: " .. tostring(roomListIndex))
|
|
345
324
|
end
|
|
325
|
+
function ____exports.logSeedEffects()
|
|
326
|
+
local seeds = game:GetSeeds()
|
|
327
|
+
____exports.log("Logging seed effects:")
|
|
328
|
+
local hasNoSeedEffects = true
|
|
329
|
+
for key, value in pairs(SeedEffect) do
|
|
330
|
+
local seedEffect = value
|
|
331
|
+
if seeds:HasSeedEffect(seedEffect) then
|
|
332
|
+
____exports.log((((" " .. key) .. " (") .. tostring(value)) .. ")")
|
|
333
|
+
hasNoSeedEffects = false
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
if hasNoSeedEffects then
|
|
337
|
+
____exports.log(" n/a (no seed effects)")
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
function ____exports.logSet(set)
|
|
341
|
+
____exports.log("Printing out a TSTL Set:")
|
|
342
|
+
local setValues = getSortedSetValues(nil, set)
|
|
343
|
+
for ____, value in ipairs(setValues) do
|
|
344
|
+
____exports.log(" Value: " .. tostring(value))
|
|
345
|
+
end
|
|
346
|
+
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
347
|
+
end
|
|
346
348
|
function ____exports.logSounds()
|
|
347
349
|
for ____, soundEffect in ipairs(range(nil, 0, SoundEffect.NUM_SOUND_EFFECTS - 1)) do
|
|
348
350
|
if sfxManager:IsPlaying(soundEffect) then
|
|
@@ -377,9 +379,12 @@ function ____exports.logTable(____table, parentTables)
|
|
|
377
379
|
end
|
|
378
380
|
____exports.log("The size of the table was: " .. tostring(numKeys))
|
|
379
381
|
end
|
|
382
|
+
function ____exports.logTearFlags(flags)
|
|
383
|
+
____exports.logFlags(flags, TearFlags, "tear")
|
|
384
|
+
end
|
|
380
385
|
function ____exports.logTemporaryEffects(player)
|
|
381
386
|
local effects = getEffectsList(nil, player)
|
|
382
|
-
____exports.log("Logging
|
|
387
|
+
____exports.log("Logging player temporary effects:")
|
|
383
388
|
if #effects == 0 then
|
|
384
389
|
____exports.log(" n/a (no temporary effects)")
|
|
385
390
|
return
|
|
@@ -401,13 +406,8 @@ function ____exports.logTemporaryEffects(player)
|
|
|
401
406
|
end
|
|
402
407
|
)
|
|
403
408
|
end
|
|
404
|
-
function ____exports.
|
|
405
|
-
____exports.log("
|
|
406
|
-
local setValues = getSortedSetValues(nil, set)
|
|
407
|
-
for ____, value in ipairs(setValues) do
|
|
408
|
-
____exports.log(" Value: " .. tostring(value))
|
|
409
|
-
end
|
|
410
|
-
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
409
|
+
function ____exports.logUseFlags(_flags)
|
|
410
|
+
____exports.log("The \"logUseFlags\" helper function is temporarily disabled while the UseFlag enum remains unpatched in vanilla.")
|
|
411
411
|
end
|
|
412
412
|
function ____exports.logVector(vector)
|
|
413
413
|
____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
|
|
@@ -415,26 +415,27 @@ end
|
|
|
415
415
|
function ____exports.setLogFunctionsGlobal(self)
|
|
416
416
|
local globals = _G
|
|
417
417
|
globals.log = ____exports.log
|
|
418
|
-
globals.logAllDamageFlags = ____exports.logAllDamageFlags
|
|
419
|
-
globals.logAllEntityFlags = ____exports.logAllEntityFlags
|
|
420
|
-
globals.logAllFlags = ____exports.logAllFlags
|
|
421
|
-
globals.logAllGameStateFlags = ____exports.logAllGameStateFlags
|
|
422
|
-
globals.logAllProjectileFlags = ____exports.logAllProjectileFlags
|
|
423
|
-
globals.logAllSeedEffects = ____exports.logAllSeedEffects
|
|
424
|
-
globals.logAllTearFlags = ____exports.logAllTearFlags
|
|
425
|
-
globals.logAllUseFlags = ____exports.logAllUseFlags
|
|
426
418
|
globals.logArray = ____exports.logArray
|
|
427
419
|
globals.logColor = ____exports.logColor
|
|
428
|
-
globals.
|
|
420
|
+
globals.logDamageFlags = ____exports.logDamageFlags
|
|
429
421
|
globals.logEntities = ____exports.logEntities
|
|
422
|
+
globals.logEntity = ____exports.logEntity
|
|
423
|
+
globals.logEntityFlags = ____exports.logEntityFlags
|
|
424
|
+
globals.logFlags = ____exports.logFlags
|
|
425
|
+
globals.logGameStateFlags = ____exports.logGameStateFlags
|
|
430
426
|
globals.logGridEntities = ____exports.logGridEntities
|
|
431
427
|
globals.logKColor = ____exports.logKColor
|
|
432
428
|
globals.logMap = ____exports.logMap
|
|
429
|
+
globals.logPlayerHealth = ____exports.logPlayerHealth
|
|
430
|
+
globals.logProjectileFlags = ____exports.logProjectileFlags
|
|
433
431
|
globals.logRoom = ____exports.logRoom
|
|
434
|
-
globals.
|
|
435
|
-
globals.logTemporaryEffects = ____exports.logTemporaryEffects
|
|
432
|
+
globals.logSeedEffects = ____exports.logSeedEffects
|
|
436
433
|
globals.logSet = ____exports.logSet
|
|
437
434
|
globals.logSounds = ____exports.logSounds
|
|
435
|
+
globals.logTable = ____exports.logTable
|
|
436
|
+
globals.logTearFlags = ____exports.logTearFlags
|
|
437
|
+
globals.logTemporaryEffects = ____exports.logTemporaryEffects
|
|
438
|
+
globals.logUseFlags = ____exports.logUseFlags
|
|
438
439
|
globals.logVector = ____exports.logVector
|
|
439
440
|
end
|
|
440
441
|
return ____exports
|
package/dist/functions/math.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export declare function range(start: int, end: int): int[];
|
|
|
36
36
|
* @param numDecimalPlaces Default is 0.
|
|
37
37
|
*/
|
|
38
38
|
export declare function round(num: float, numDecimalPlaces?: number): float;
|
|
39
|
-
export declare function tanh(x: number): number;
|
|
40
39
|
/**
|
|
41
40
|
* @returns 1 if n is positive, -1 if n is negative, or 0 if n is 0.
|
|
42
41
|
*/
|
|
43
42
|
export declare function sign(n: number): int;
|
|
43
|
+
export declare function tanh(x: number): number;
|
package/dist/functions/math.lua
CHANGED
|
@@ -83,9 +83,6 @@ function ____exports.round(self, num, numDecimalPlaces)
|
|
|
83
83
|
))
|
|
84
84
|
return roundedNum == nil and 0 or roundedNum
|
|
85
85
|
end
|
|
86
|
-
function ____exports.tanh(self, x)
|
|
87
|
-
return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
|
|
88
|
-
end
|
|
89
86
|
function ____exports.sign(self, n)
|
|
90
87
|
if n > 0 then
|
|
91
88
|
return 1
|
|
@@ -95,4 +92,7 @@ function ____exports.sign(self, n)
|
|
|
95
92
|
end
|
|
96
93
|
return 0
|
|
97
94
|
end
|
|
95
|
+
function ____exports.tanh(self, x)
|
|
96
|
+
return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
|
|
97
|
+
end
|
|
98
98
|
return ____exports
|
|
@@ -3,8 +3,6 @@ import { HealthType } from "../enums/HealthType";
|
|
|
3
3
|
import { PlayerIndex } from "../types/PlayerIndex";
|
|
4
4
|
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
|
|
5
5
|
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
6
|
-
/** Iterates over all players and checks if any player is close enough to the specified position. */
|
|
7
|
-
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
|
|
8
6
|
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
|
|
9
7
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
10
8
|
/**
|
|
@@ -24,6 +22,11 @@ export declare function anyPlayerIs(...matchingCharacters: Array<PlayerType | in
|
|
|
24
22
|
* - the player has Stompy (transformation 13)
|
|
25
23
|
*/
|
|
26
24
|
export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Helper function for detecting when a player is one of the characters that can take free Devil
|
|
27
|
+
* Deals. (e.g. The Lost, Tainted Lost, etc.)
|
|
28
|
+
*/
|
|
29
|
+
export declare function canTakeFreeDevilDeals(player: EntityPlayer): boolean;
|
|
27
30
|
/**
|
|
28
31
|
* Helper function to determine if the provided character can have red heart containers. Returns
|
|
29
32
|
* true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
|
|
@@ -284,16 +287,11 @@ export declare function isJacobOrEsau(player: EntityPlayer): boolean;
|
|
|
284
287
|
export declare function isKeeper(player: EntityPlayer): boolean;
|
|
285
288
|
/** Helper function for detecting when a player is The Lost or Tainted Lost. */
|
|
286
289
|
export declare function isLost(player: EntityPlayer): boolean;
|
|
287
|
-
|
|
288
|
-
* Helper function for detecting when a player is one of the characters that can take free Devil
|
|
289
|
-
* Deals. (e.g. The Lost, Tainted Lost, etc.)
|
|
290
|
-
*/
|
|
291
|
-
export declare function canTakeFreeDevilDeals(player: EntityPlayer): boolean;
|
|
290
|
+
export declare function isModdedCharacter(player: EntityPlayer): boolean;
|
|
292
291
|
/** Helper function for detecting if a player is one of the Tainted characters. */
|
|
293
292
|
export declare function isTainted(player: EntityPlayer): boolean;
|
|
294
293
|
/** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
|
|
295
294
|
export declare function isTaintedLazarus(player: EntityPlayer): boolean;
|
|
296
|
-
export declare function isModdedCharacter(player: EntityPlayer): boolean;
|
|
297
295
|
export declare function isVanillaCharacter(player: EntityPlayer): boolean;
|
|
298
296
|
/**
|
|
299
297
|
* Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
@@ -96,15 +96,15 @@ end
|
|
|
96
96
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
97
97
|
local character = player:GetPlayerType()
|
|
98
98
|
repeat
|
|
99
|
-
local
|
|
100
|
-
local
|
|
101
|
-
if
|
|
99
|
+
local ____switch71 = character
|
|
100
|
+
local ____cond71 = ____switch71 == PlayerType.PLAYER_THESOUL
|
|
101
|
+
if ____cond71 then
|
|
102
102
|
do
|
|
103
103
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
|
-
|
|
107
|
-
if
|
|
106
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_LAZARUS2_B
|
|
107
|
+
if ____cond71 then
|
|
108
108
|
do
|
|
109
109
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
110
110
|
end
|
|
@@ -172,16 +172,16 @@ function ____exports.isKeeper(self, player)
|
|
|
172
172
|
local character = player:GetPlayerType()
|
|
173
173
|
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
174
174
|
end
|
|
175
|
+
function ____exports.isModdedCharacter(self, player)
|
|
176
|
+
local character = player:GetPlayerType()
|
|
177
|
+
return character > MAX_VANILLA_CHARACTER
|
|
178
|
+
end
|
|
175
179
|
function isTaintedModded(self, player)
|
|
176
180
|
local character = player:GetPlayerType()
|
|
177
181
|
local name = player:GetName()
|
|
178
182
|
local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
|
|
179
183
|
return character == taintedCharacter
|
|
180
184
|
end
|
|
181
|
-
function ____exports.isModdedCharacter(self, player)
|
|
182
|
-
local character = player:GetPlayerType()
|
|
183
|
-
return character > MAX_VANILLA_CHARACTER
|
|
184
|
-
end
|
|
185
185
|
function ____exports.isVanillaCharacter(self, player)
|
|
186
186
|
return not ____exports.isModdedCharacter(nil, player)
|
|
187
187
|
end
|
|
@@ -201,13 +201,6 @@ function ____exports.addTrinketCostume(self, player, trinketType)
|
|
|
201
201
|
end
|
|
202
202
|
player:AddCostume(itemConfigTrinket, false)
|
|
203
203
|
end
|
|
204
|
-
function ____exports.anyPlayerCloserThan(self, position, distance)
|
|
205
|
-
local players = ____exports.getPlayers(nil)
|
|
206
|
-
return __TS__ArraySome(
|
|
207
|
-
players,
|
|
208
|
-
function(____, player) return player.Position:Distance(position) <= distance end
|
|
209
|
-
)
|
|
210
|
-
end
|
|
211
204
|
function ____exports.anyPlayerHasCollectible(self, collectibleType)
|
|
212
205
|
local players = ____exports.getPlayers(nil)
|
|
213
206
|
return __TS__ArraySome(
|
|
@@ -235,6 +228,10 @@ function ____exports.canPlayerCrushRocks(self, player)
|
|
|
235
228
|
local effects = player:GetEffects()
|
|
236
229
|
return player:HasCollectible(CollectibleType.COLLECTIBLE_LEO) or player:HasCollectible(CollectibleType.COLLECTIBLE_THUNDER_THIGHS) or effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_MEGA_MUSH) or player:HasPlayerForm(PlayerForm.PLAYERFORM_STOMPY)
|
|
237
230
|
end
|
|
231
|
+
function ____exports.canTakeFreeDevilDeals(self, player)
|
|
232
|
+
local character = player:GetPlayerType()
|
|
233
|
+
return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
|
|
234
|
+
end
|
|
238
235
|
function ____exports.characterCanHaveRedHearts(self, character)
|
|
239
236
|
return not CHARACTERS_WITH_NO_RED_HEARTS:has(character)
|
|
240
237
|
end
|
|
@@ -515,10 +512,6 @@ function ____exports.isLost(self, player)
|
|
|
515
512
|
local character = player:GetPlayerType()
|
|
516
513
|
return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
|
|
517
514
|
end
|
|
518
|
-
function ____exports.canTakeFreeDevilDeals(self, player)
|
|
519
|
-
local character = player:GetPlayerType()
|
|
520
|
-
return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
|
|
521
|
-
end
|
|
522
515
|
function ____exports.isTainted(self, player)
|
|
523
516
|
local character = player:GetPlayerType()
|
|
524
517
|
local ____isVanillaCharacter_result_0
|
|
@@ -571,9 +564,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
571
564
|
itemPool:RemoveCollectible(collectibleType)
|
|
572
565
|
end
|
|
573
566
|
repeat
|
|
574
|
-
local
|
|
575
|
-
local
|
|
576
|
-
if
|
|
567
|
+
local ____switch124 = activeSlot
|
|
568
|
+
local ____cond124 = ____switch124 == ActiveSlot.SLOT_PRIMARY
|
|
569
|
+
if ____cond124 then
|
|
577
570
|
do
|
|
578
571
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
579
572
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -582,8 +575,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
582
575
|
break
|
|
583
576
|
end
|
|
584
577
|
end
|
|
585
|
-
|
|
586
|
-
if
|
|
578
|
+
____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_SECONDARY
|
|
579
|
+
if ____cond124 then
|
|
587
580
|
do
|
|
588
581
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
589
582
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -598,16 +591,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
598
591
|
break
|
|
599
592
|
end
|
|
600
593
|
end
|
|
601
|
-
|
|
602
|
-
if
|
|
594
|
+
____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_POCKET
|
|
595
|
+
if ____cond124 then
|
|
603
596
|
do
|
|
604
597
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
605
598
|
player:SetActiveCharge(charge, activeSlot)
|
|
606
599
|
break
|
|
607
600
|
end
|
|
608
601
|
end
|
|
609
|
-
|
|
610
|
-
if
|
|
602
|
+
____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_POCKET2
|
|
603
|
+
if ____cond124 then
|
|
611
604
|
do
|
|
612
605
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
613
606
|
break
|
|
@@ -11,6 +11,7 @@ export declare function addPlayerHealthType(player: EntityPlayer, healthType: He
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
|
|
13
13
|
export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
|
|
14
|
+
export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
14
15
|
/**
|
|
15
16
|
* Helper function to set a player's health to a specific state. You can use this in combination
|
|
16
17
|
* with the `getPlayerHealth` function to restore the player's health back to a certain
|
|
@@ -19,4 +20,3 @@ export declare function getPlayerHealthType(player: EntityPlayer, healthType: He
|
|
|
19
20
|
* Based on the `REVEL.LoadHealth` function in the Revelations mod.
|
|
20
21
|
*/
|
|
21
22
|
export declare function setPlayerHealth(player: EntityPlayer, playerHealth: PlayerHealth): void;
|
|
22
|
-
export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
@@ -14,26 +14,6 @@ local getSoulHearts = ____player.getSoulHearts
|
|
|
14
14
|
local ____utils = require("functions.utils")
|
|
15
15
|
local ensureAllCases = ____utils.ensureAllCases
|
|
16
16
|
local ____repeat = ____utils["repeat"]
|
|
17
|
-
function ____exports.removeAllPlayerHealth(self, player)
|
|
18
|
-
local character = player:GetPlayerType()
|
|
19
|
-
local goldenHearts = player:GetGoldenHearts()
|
|
20
|
-
local eternalHearts = player:GetEternalHearts()
|
|
21
|
-
local boneHearts = player:GetBoneHearts()
|
|
22
|
-
local brokenHearts = player:GetBrokenHearts()
|
|
23
|
-
player:AddGoldenHearts(goldenHearts * -1)
|
|
24
|
-
player:AddEternalHearts(eternalHearts * -1)
|
|
25
|
-
player:AddBoneHearts(boneHearts * -1)
|
|
26
|
-
player:AddBrokenHearts(brokenHearts * -1)
|
|
27
|
-
player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
|
|
28
|
-
player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
|
|
29
|
-
if character == PlayerType.PLAYER_THESOUL then
|
|
30
|
-
local forgotten = player:GetSubPlayer()
|
|
31
|
-
if forgotten ~= nil then
|
|
32
|
-
local forgottenBoneHearts = forgotten:GetBoneHearts()
|
|
33
|
-
forgotten:AddBoneHearts(forgottenBoneHearts * -1)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
17
|
function ____exports.addPlayerHealthType(self, player, healthType, numHearts)
|
|
38
18
|
repeat
|
|
39
19
|
local ____switch3 = healthType
|
|
@@ -233,6 +213,26 @@ function ____exports.getPlayerHealthType(self, player, healthType)
|
|
|
233
213
|
end
|
|
234
214
|
until true
|
|
235
215
|
end
|
|
216
|
+
function ____exports.removeAllPlayerHealth(self, player)
|
|
217
|
+
local character = player:GetPlayerType()
|
|
218
|
+
local goldenHearts = player:GetGoldenHearts()
|
|
219
|
+
local eternalHearts = player:GetEternalHearts()
|
|
220
|
+
local boneHearts = player:GetBoneHearts()
|
|
221
|
+
local brokenHearts = player:GetBrokenHearts()
|
|
222
|
+
player:AddGoldenHearts(goldenHearts * -1)
|
|
223
|
+
player:AddEternalHearts(eternalHearts * -1)
|
|
224
|
+
player:AddBoneHearts(boneHearts * -1)
|
|
225
|
+
player:AddBrokenHearts(brokenHearts * -1)
|
|
226
|
+
player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
|
|
227
|
+
player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
|
|
228
|
+
if character == PlayerType.PLAYER_THESOUL then
|
|
229
|
+
local forgotten = player:GetSubPlayer()
|
|
230
|
+
if forgotten ~= nil then
|
|
231
|
+
local forgottenBoneHearts = forgotten:GetBoneHearts()
|
|
232
|
+
forgotten:AddBoneHearts(forgottenBoneHearts * -1)
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
236
|
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
237
237
|
local character = player:GetPlayerType()
|
|
238
238
|
local subPlayer = player:GetSubPlayer()
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare function anyEntityCloserThan(entities: Entity[], position: Vector, distance: int): boolean;
|
|
3
|
+
/** Iterates over all players and checks if any player is close enough to the specified position. */
|
|
4
|
+
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
|
|
2
5
|
/**
|
|
3
6
|
* Helper function to get a room position that is not overlapping with a grid entity, a heaven door,
|
|
4
7
|
* or a player. The `Room.FindFreePickupSpawnPosition` method will return locations that overlap
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
3
4
|
local Map = ____lualib.Map
|
|
4
5
|
local __TS__New = ____lualib.__TS__New
|
|
5
6
|
local ____exports = {}
|
|
@@ -8,13 +9,26 @@ local game = ____cachedClasses.game
|
|
|
8
9
|
local ____constants = require("constants")
|
|
9
10
|
local DISTANCE_OF_GRID_TILE = ____constants.DISTANCE_OF_GRID_TILE
|
|
10
11
|
local ____entity = require("functions.entity")
|
|
11
|
-
local anyEntityCloserThan = ____entity.anyEntityCloserThan
|
|
12
12
|
local getEntities = ____entity.getEntities
|
|
13
13
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
14
14
|
local getEffects = ____entitySpecific.getEffects
|
|
15
15
|
local ____player = require("functions.player")
|
|
16
16
|
local getPlayerCloserThan = ____player.getPlayerCloserThan
|
|
17
|
+
local getPlayers = ____player.getPlayers
|
|
17
18
|
local MAX_FIND_FREE_POSITION_ATTEMPTS = 100
|
|
19
|
+
function ____exports.anyEntityCloserThan(self, entities, position, distance)
|
|
20
|
+
return __TS__ArraySome(
|
|
21
|
+
entities,
|
|
22
|
+
function(____, entity) return position:Distance(entity.Position) <= distance end
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
function ____exports.anyPlayerCloserThan(self, position, distance)
|
|
26
|
+
local players = getPlayers(nil)
|
|
27
|
+
return __TS__ArraySome(
|
|
28
|
+
players,
|
|
29
|
+
function(____, player) return player.Position:Distance(position) <= distance end
|
|
30
|
+
)
|
|
31
|
+
end
|
|
18
32
|
function ____exports.findFreePosition(self, startingPosition, avoidActiveEntities)
|
|
19
33
|
if avoidActiveEntities == nil then
|
|
20
34
|
avoidActiveEntities = false
|
|
@@ -28,15 +42,15 @@ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntitie
|
|
|
28
42
|
local position = room:FindFreePickupSpawnPosition(startingPosition, i, avoidActiveEntities)
|
|
29
43
|
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE)
|
|
30
44
|
if closePlayer ~= nil then
|
|
31
|
-
goto
|
|
45
|
+
goto __continue7
|
|
32
46
|
end
|
|
33
|
-
local isCloseHeavenDoor = anyEntityCloserThan(nil, heavenDoors, position, DISTANCE_OF_GRID_TILE)
|
|
47
|
+
local isCloseHeavenDoor = ____exports.anyEntityCloserThan(nil, heavenDoors, position, DISTANCE_OF_GRID_TILE)
|
|
34
48
|
if isCloseHeavenDoor then
|
|
35
|
-
goto
|
|
49
|
+
goto __continue7
|
|
36
50
|
end
|
|
37
51
|
return position
|
|
38
52
|
end
|
|
39
|
-
::
|
|
53
|
+
::__continue7::
|
|
40
54
|
i = i + 1
|
|
41
55
|
end
|
|
42
56
|
end
|
|
@@ -25,13 +25,6 @@ export declare function getRandomFloat(min: int, max: int, seed?: Seed): float;
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export declare function getRandomInt(min: int, max: int, seed?: Seed): int;
|
|
28
|
-
/**
|
|
29
|
-
* Helper function to get the next seed value.
|
|
30
|
-
*
|
|
31
|
-
* This function is useful because it is standard practice to work with seed values directly over
|
|
32
|
-
* RNG objects, since the latter are not serializable.
|
|
33
|
-
*/
|
|
34
|
-
export declare function nextSeed(seed: Seed): Seed;
|
|
35
28
|
/**
|
|
36
29
|
* Helper function to initialize an RNG object.
|
|
37
30
|
*
|
|
@@ -48,3 +41,10 @@ export declare function nextSeed(seed: Seed): Seed;
|
|
|
48
41
|
* @param seed The seed to initialize it with. Default is `Random()`.
|
|
49
42
|
*/
|
|
50
43
|
export declare function initRNG(seed?: Seed): RNG;
|
|
44
|
+
/**
|
|
45
|
+
* Helper function to get the next seed value.
|
|
46
|
+
*
|
|
47
|
+
* This function is useful because it is standard practice to work with seed values directly over
|
|
48
|
+
* RNG objects, since the latter are not serializable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function nextSeed(seed: Seed): Seed;
|