isaacscript-common 1.0.567 → 1.0.568
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/functions/log.d.ts +1 -0
- package/dist/functions/log.lua +45 -0
- package/package.json +1 -1
package/dist/functions/log.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export declare function logEntity(this: void, entity: Entity): void;
|
|
|
39
39
|
export declare function logKColor(this: void, kColor: KColor): void;
|
|
40
40
|
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
|
|
41
41
|
export declare function logTable(this: void, table: unknown): void;
|
|
42
|
+
export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
|
|
42
43
|
export declare function logSet(this: void, set: Set<AnyNotNil>): void;
|
|
43
44
|
export declare function logVector(this: void, vector: Vector): void;
|
|
44
45
|
/**
|
package/dist/functions/log.lua
CHANGED
|
@@ -3,8 +3,12 @@ require("lualib_bundle");
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____array = require("functions.array")
|
|
5
5
|
local arrayToString = ____array.arrayToString
|
|
6
|
+
local ____collectibles = require("functions.collectibles")
|
|
7
|
+
local getCollectibleName = ____collectibles.getCollectibleName
|
|
6
8
|
local ____flag = require("functions.flag")
|
|
7
9
|
local hasFlag = ____flag.hasFlag
|
|
10
|
+
local ____trinkets = require("functions.trinkets")
|
|
11
|
+
local getTrinketName = ____trinkets.getTrinketName
|
|
8
12
|
function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
9
13
|
if numParentFunctions == nil then
|
|
10
14
|
numParentFunctions = 3
|
|
@@ -166,6 +170,47 @@ function ____exports.logTable(____table)
|
|
|
166
170
|
)
|
|
167
171
|
end
|
|
168
172
|
end
|
|
173
|
+
function ____exports.logTemporaryEffects(player)
|
|
174
|
+
local effects = player:GetEffects()
|
|
175
|
+
local effectsList = effects:GetEffectsList()
|
|
176
|
+
____exports.log("Logging all player temporary effects:")
|
|
177
|
+
if effectsList.Size == 0 then
|
|
178
|
+
____exports.log(" n/a (no temporary effects)")
|
|
179
|
+
return
|
|
180
|
+
end
|
|
181
|
+
do
|
|
182
|
+
local i = 0
|
|
183
|
+
while i < effectsList.Size do
|
|
184
|
+
do
|
|
185
|
+
local effect = effectsList:Get(i)
|
|
186
|
+
if effect == nil then
|
|
187
|
+
goto __continue35
|
|
188
|
+
end
|
|
189
|
+
if effect.Item:IsCollectible() then
|
|
190
|
+
local collectibleName = getCollectibleName(nil, effect.Item.ID)
|
|
191
|
+
____exports.log(
|
|
192
|
+
((" " .. tostring(i + 1)) .. ") ") .. collectibleName
|
|
193
|
+
)
|
|
194
|
+
elseif effect.Item:IsTrinket() then
|
|
195
|
+
local trinketName = getTrinketName(nil, effect.Item.ID)
|
|
196
|
+
____exports.log(
|
|
197
|
+
((" " .. tostring(i + 1)) .. ") ") .. trinketName
|
|
198
|
+
)
|
|
199
|
+
elseif effect.Item:IsNull() then
|
|
200
|
+
____exports.log(
|
|
201
|
+
((" " .. tostring(i + 1)) .. ") Null item: ") .. tostring(effect.Item.ID)
|
|
202
|
+
)
|
|
203
|
+
else
|
|
204
|
+
____exports.log(
|
|
205
|
+
((" " .. tostring(i + 1)) .. ") Unknown type of temporary effect: ") .. tostring(effect.Item.ID)
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
::__continue35::
|
|
210
|
+
i = i + 1
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
169
214
|
function ____exports.logSet(set)
|
|
170
215
|
____exports.log("Printing out a TSTL Set:")
|
|
171
216
|
for ____, value in __TS__Iterator(
|