isaacscript-common 10.2.0 → 10.2.2
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/index.d.ts +8 -8
- package/dist/isaacscript-common.lua +16 -17
- package/dist/package.lua +1 -1
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +2 -3
- package/dist/src/functions/tears.d.ts +8 -8
- package/dist/src/functions/tears.lua +12 -12
- package/package.json +1 -1
- package/src/functions/players.ts +2 -9
- package/src/functions/tears.ts +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -6443,11 +6443,11 @@ export declare function isTear(variable: unknown): variable is EntityTear;
|
|
|
6443
6443
|
* is determined by looking at the parent.
|
|
6444
6444
|
*
|
|
6445
6445
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
6446
|
-
* player. The parent of the tear is the player on
|
|
6447
|
-
*
|
|
6448
|
-
* callback or on frame
|
|
6446
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
6447
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
6448
|
+
* callback or on frame 1+.
|
|
6449
6449
|
*
|
|
6450
|
-
* If this function is called on frame 0
|
|
6450
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
6451
6451
|
*/
|
|
6452
6452
|
export declare function isTearFromFamiliar(tear: EntityTear): boolean;
|
|
6453
6453
|
|
|
@@ -6456,11 +6456,11 @@ export declare function isTearFromFamiliar(tear: EntityTear): boolean;
|
|
|
6456
6456
|
* is determined by looking at the parent.
|
|
6457
6457
|
*
|
|
6458
6458
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
6459
|
-
* player. The parent of the tear is the player on
|
|
6460
|
-
*
|
|
6461
|
-
* callback or on frame
|
|
6459
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
6460
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
6461
|
+
* callback or on frame 1+.
|
|
6462
6462
|
*
|
|
6463
|
-
* If this function is called on frame 0
|
|
6463
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
6464
6464
|
*/
|
|
6465
6465
|
export declare function isTearFromPlayer(tear: EntityTear): boolean;
|
|
6466
6466
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 10.2.
|
|
3
|
+
isaacscript-common 10.2.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -26070,7 +26070,6 @@ local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
|
26070
26070
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
26071
26071
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
26072
26072
|
local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
26073
|
-
local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
|
|
26074
26073
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
26075
26074
|
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
26076
26075
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
@@ -26309,7 +26308,7 @@ function ____exports.getPlayerFromTear(self, entity)
|
|
|
26309
26308
|
return player
|
|
26310
26309
|
end
|
|
26311
26310
|
local familiar = entity.Parent:ToFamiliar()
|
|
26312
|
-
if familiar ~= nil
|
|
26311
|
+
if familiar ~= nil then
|
|
26313
26312
|
return familiar.Player
|
|
26314
26313
|
end
|
|
26315
26314
|
end
|
|
@@ -26319,7 +26318,7 @@ function ____exports.getPlayerFromTear(self, entity)
|
|
|
26319
26318
|
return player
|
|
26320
26319
|
end
|
|
26321
26320
|
local familiar = entity.SpawnerEntity:ToFamiliar()
|
|
26322
|
-
if familiar ~= nil
|
|
26321
|
+
if familiar ~= nil then
|
|
26323
26322
|
return familiar.Player
|
|
26324
26323
|
end
|
|
26325
26324
|
end
|
|
@@ -39251,14 +39250,14 @@ end
|
|
|
39251
39250
|
-- is determined by looking at the parent.
|
|
39252
39251
|
--
|
|
39253
39252
|
-- For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
39254
|
-
-- player. The parent of the tear is the player on
|
|
39255
|
-
--
|
|
39256
|
-
-- callback or on frame
|
|
39253
|
+
-- player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
39254
|
+
-- onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
39255
|
+
-- callback or on frame 1+.
|
|
39257
39256
|
--
|
|
39258
|
-
-- If this function is called on frame 0
|
|
39257
|
+
-- If this function is called on frame 0, it will throw a run-time error.
|
|
39259
39258
|
function ____exports.isTearFromFamiliar(self, tear)
|
|
39260
|
-
if tear.FrameCount == 0
|
|
39261
|
-
error(
|
|
39259
|
+
if tear.FrameCount == 0 then
|
|
39260
|
+
error("Failed to check if the given tear was from a player since the tear's frame count was equal to 0. (The \"isTearFromFamiliar\" function must only be used in the \"POST_TEAR_INIT_VERY_LATE\" callback or on frame 1 and onwards.)")
|
|
39262
39261
|
end
|
|
39263
39262
|
if tear.Parent == nil then
|
|
39264
39263
|
return false
|
|
@@ -39270,14 +39269,14 @@ end
|
|
|
39270
39269
|
-- is determined by looking at the parent.
|
|
39271
39270
|
--
|
|
39272
39271
|
-- For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
39273
|
-
-- player. The parent of the tear is the player on
|
|
39274
|
-
--
|
|
39275
|
-
-- callback or on frame
|
|
39272
|
+
-- player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
39273
|
+
-- onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
39274
|
+
-- callback or on frame 1+.
|
|
39276
39275
|
--
|
|
39277
|
-
-- If this function is called on frame 0
|
|
39276
|
+
-- If this function is called on frame 0, it will throw a run-time error.
|
|
39278
39277
|
function ____exports.isTearFromPlayer(self, tear)
|
|
39279
|
-
if tear.FrameCount == 0
|
|
39280
|
-
error(
|
|
39278
|
+
if tear.FrameCount == 0 then
|
|
39279
|
+
error("Failed to check if the given tear was from a player since the tear's frame count was equal to 0. (The \"isTearFromPlayer\" function must only be used in the \"POST_TEAR_INIT_VERY_LATE\" callback or on frame 1 and onwards.)")
|
|
39281
39280
|
end
|
|
39282
39281
|
if tear.Parent == nil then
|
|
39283
39282
|
return false
|
|
@@ -46948,7 +46947,7 @@ return ____exports
|
|
|
46948
46947
|
["package"] = function(...)
|
|
46949
46948
|
return {
|
|
46950
46949
|
name = "isaacscript-common",
|
|
46951
|
-
version = "10.2.
|
|
46950
|
+
version = "10.2.2",
|
|
46952
46951
|
description = "Helper functions and features for IsaacScript mods.",
|
|
46953
46952
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
46954
46953
|
homepage = "https://isaacscript.github.io/",
|
package/dist/package.lua
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAetC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAA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ED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -14,7 +14,6 @@ local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
|
14
14
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
15
15
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
16
16
|
local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
17
|
-
local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
|
|
18
17
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
19
18
|
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
20
19
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
@@ -253,7 +252,7 @@ function ____exports.getPlayerFromTear(self, entity)
|
|
|
253
252
|
return player
|
|
254
253
|
end
|
|
255
254
|
local familiar = entity.Parent:ToFamiliar()
|
|
256
|
-
if familiar ~= nil
|
|
255
|
+
if familiar ~= nil then
|
|
257
256
|
return familiar.Player
|
|
258
257
|
end
|
|
259
258
|
end
|
|
@@ -263,7 +262,7 @@ function ____exports.getPlayerFromTear(self, entity)
|
|
|
263
262
|
return player
|
|
264
263
|
end
|
|
265
264
|
local familiar = entity.SpawnerEntity:ToFamiliar()
|
|
266
|
-
if familiar ~= nil
|
|
265
|
+
if familiar ~= nil then
|
|
267
266
|
return familiar.Player
|
|
268
267
|
end
|
|
269
268
|
end
|
|
@@ -28,11 +28,11 @@ export declare function getTearsStat(fireDelay: float): float;
|
|
|
28
28
|
* is determined by looking at the parent.
|
|
29
29
|
*
|
|
30
30
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
31
|
-
* player. The parent of the tear is the player on
|
|
32
|
-
*
|
|
33
|
-
* callback or on frame
|
|
31
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
32
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
33
|
+
* callback or on frame 1+.
|
|
34
34
|
*
|
|
35
|
-
* If this function is called on frame 0
|
|
35
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
36
36
|
*/
|
|
37
37
|
export declare function isTearFromFamiliar(tear: EntityTear): boolean;
|
|
38
38
|
/**
|
|
@@ -40,11 +40,11 @@ export declare function isTearFromFamiliar(tear: EntityTear): boolean;
|
|
|
40
40
|
* is determined by looking at the parent.
|
|
41
41
|
*
|
|
42
42
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
43
|
-
* player. The parent of the tear is the player on
|
|
44
|
-
*
|
|
45
|
-
* callback or on frame
|
|
43
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
44
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
45
|
+
* callback or on frame 1+.
|
|
46
46
|
*
|
|
47
|
-
* If this function is called on frame 0
|
|
47
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
48
48
|
*/
|
|
49
49
|
export declare function isTearFromPlayer(tear: EntityTear): boolean;
|
|
50
50
|
//# sourceMappingURL=tears.d.ts.map
|
|
@@ -28,14 +28,14 @@ end
|
|
|
28
28
|
-- is determined by looking at the parent.
|
|
29
29
|
--
|
|
30
30
|
-- For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
31
|
-
-- player. The parent of the tear is the player on
|
|
32
|
-
--
|
|
33
|
-
-- callback or on frame
|
|
31
|
+
-- player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
32
|
+
-- onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
33
|
+
-- callback or on frame 1+.
|
|
34
34
|
--
|
|
35
|
-
-- If this function is called on frame 0
|
|
35
|
+
-- If this function is called on frame 0, it will throw a run-time error.
|
|
36
36
|
function ____exports.isTearFromFamiliar(self, tear)
|
|
37
|
-
if tear.FrameCount == 0
|
|
38
|
-
error(
|
|
37
|
+
if tear.FrameCount == 0 then
|
|
38
|
+
error("Failed to check if the given tear was from a player since the tear's frame count was equal to 0. (The \"isTearFromFamiliar\" function must only be used in the \"POST_TEAR_INIT_VERY_LATE\" callback or on frame 1 and onwards.)")
|
|
39
39
|
end
|
|
40
40
|
if tear.Parent == nil then
|
|
41
41
|
return false
|
|
@@ -47,14 +47,14 @@ end
|
|
|
47
47
|
-- is determined by looking at the parent.
|
|
48
48
|
--
|
|
49
49
|
-- For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
50
|
-
-- player. The parent of the tear is the player on
|
|
51
|
-
--
|
|
52
|
-
-- callback or on frame
|
|
50
|
+
-- player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
51
|
+
-- onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
52
|
+
-- callback or on frame 1+.
|
|
53
53
|
--
|
|
54
|
-
-- If this function is called on frame 0
|
|
54
|
+
-- If this function is called on frame 0, it will throw a run-time error.
|
|
55
55
|
function ____exports.isTearFromPlayer(self, tear)
|
|
56
|
-
if tear.FrameCount == 0
|
|
57
|
-
error(
|
|
56
|
+
if tear.FrameCount == 0 then
|
|
57
|
+
error("Failed to check if the given tear was from a player since the tear's frame count was equal to 0. (The \"isTearFromPlayer\" function must only be used in the \"POST_TEAR_INIT_VERY_LATE\" callback or on frame 1 and onwards.)")
|
|
58
58
|
end
|
|
59
59
|
if tear.Parent == nil then
|
|
60
60
|
return false
|
package/package.json
CHANGED
package/src/functions/players.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
Challenge,
|
|
4
4
|
CollectibleType,
|
|
5
5
|
ControllerIndex,
|
|
6
|
-
FamiliarVariant,
|
|
7
6
|
NullItemID,
|
|
8
7
|
PlayerForm,
|
|
9
8
|
PlayerType,
|
|
@@ -274,10 +273,7 @@ export function getPlayerFromTear(entity: Entity): EntityPlayer | undefined {
|
|
|
274
273
|
}
|
|
275
274
|
|
|
276
275
|
const familiar = entity.Parent.ToFamiliar();
|
|
277
|
-
if (
|
|
278
|
-
familiar !== undefined &&
|
|
279
|
-
familiar.Variant === FamiliarVariant.INCUBUS
|
|
280
|
-
) {
|
|
276
|
+
if (familiar !== undefined) {
|
|
281
277
|
return familiar.Player;
|
|
282
278
|
}
|
|
283
279
|
}
|
|
@@ -289,10 +285,7 @@ export function getPlayerFromTear(entity: Entity): EntityPlayer | undefined {
|
|
|
289
285
|
}
|
|
290
286
|
|
|
291
287
|
const familiar = entity.SpawnerEntity.ToFamiliar();
|
|
292
|
-
if (
|
|
293
|
-
familiar !== undefined &&
|
|
294
|
-
familiar.Variant === FamiliarVariant.INCUBUS
|
|
295
|
-
) {
|
|
288
|
+
if (familiar !== undefined) {
|
|
296
289
|
return familiar.Player;
|
|
297
290
|
}
|
|
298
291
|
}
|
package/src/functions/tears.ts
CHANGED
|
@@ -37,16 +37,16 @@ export function getTearsStat(fireDelay: float): float {
|
|
|
37
37
|
* is determined by looking at the parent.
|
|
38
38
|
*
|
|
39
39
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
40
|
-
* player. The parent of the tear is the player on
|
|
41
|
-
*
|
|
42
|
-
* callback or on frame
|
|
40
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
41
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
42
|
+
* callback or on frame 1+.
|
|
43
43
|
*
|
|
44
|
-
* If this function is called on frame 0
|
|
44
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
45
45
|
*/
|
|
46
46
|
export function isTearFromFamiliar(tear: EntityTear): boolean {
|
|
47
|
-
if (tear.FrameCount === 0
|
|
47
|
+
if (tear.FrameCount === 0) {
|
|
48
48
|
error(
|
|
49
|
-
|
|
49
|
+
'Failed to check if the given tear was from a player since the tear\'s frame count was equal to 0. (The "isTearFromFamiliar" function must only be used in the "POST_TEAR_INIT_VERY_LATE" callback or on frame 1 and onwards.)',
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -64,16 +64,16 @@ export function isTearFromFamiliar(tear: EntityTear): boolean {
|
|
|
64
64
|
* is determined by looking at the parent.
|
|
65
65
|
*
|
|
66
66
|
* For the special case of Incubus and Blood Babies, the spawner entity of the tear is always the
|
|
67
|
-
* player. The parent of the tear is the player on
|
|
68
|
-
*
|
|
69
|
-
* callback or on frame
|
|
67
|
+
* player. The parent of the tear is the player on frame 0 and it is the familiar on frame 1 and
|
|
68
|
+
* onwards. For this reason, you can only use this function in the `POST_TEAR_INIT_VERY_LATE`
|
|
69
|
+
* callback or on frame 1+.
|
|
70
70
|
*
|
|
71
|
-
* If this function is called on frame 0
|
|
71
|
+
* If this function is called on frame 0, it will throw a run-time error.
|
|
72
72
|
*/
|
|
73
73
|
export function isTearFromPlayer(tear: EntityTear): boolean {
|
|
74
|
-
if (tear.FrameCount === 0
|
|
74
|
+
if (tear.FrameCount === 0) {
|
|
75
75
|
error(
|
|
76
|
-
|
|
76
|
+
'Failed to check if the given tear was from a player since the tear\'s frame count was equal to 0. (The "isTearFromPlayer" function must only be used in the "POST_TEAR_INIT_VERY_LATE" callback or on frame 1 and onwards.)',
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|