isaacscript-common 12.1.0 → 12.1.1
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 +2 -1
- package/dist/isaacscript-common.lua +5 -4
- package/dist/package.lua +1 -1
- package/dist/src/functions/players.d.ts +2 -1
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +3 -2
- package/package.json +1 -1
- package/src/functions/players.ts +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -4110,7 +4110,8 @@ export declare function getPlayerFamiliars(player: EntityPlayer): EntityFamiliar
|
|
|
4110
4110
|
* Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
|
|
4111
4111
|
* does not correspond to any particular player.
|
|
4112
4112
|
*
|
|
4113
|
-
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order).
|
|
4113
|
+
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
|
|
4114
|
+
* a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
|
|
4114
4115
|
*/
|
|
4115
4116
|
export declare function getPlayerFromEntity(entity: Entity): EntityPlayer | undefined;
|
|
4116
4117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 12.1.
|
|
3
|
+
isaacscript-common 12.1.1
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -26308,7 +26308,8 @@ end
|
|
|
26308
26308
|
--- Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
|
|
26309
26309
|
-- does not correspond to any particular player.
|
|
26310
26310
|
--
|
|
26311
|
-
-- This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order).
|
|
26311
|
+
-- This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
|
|
26312
|
+
-- a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
|
|
26312
26313
|
function ____exports.getPlayerFromEntity(self, entity)
|
|
26313
26314
|
if entity.Parent ~= nil then
|
|
26314
26315
|
local player = entity.Parent:ToPlayer()
|
|
@@ -26330,7 +26331,7 @@ function ____exports.getPlayerFromEntity(self, entity)
|
|
|
26330
26331
|
return familiar.Player
|
|
26331
26332
|
end
|
|
26332
26333
|
end
|
|
26333
|
-
return
|
|
26334
|
+
return entity:ToPlayer()
|
|
26334
26335
|
end
|
|
26335
26336
|
--- Helper function to get the proper name of the player. Use this instead of the
|
|
26336
26337
|
-- `EntityPlayer.GetName` method because it accounts for Blue Baby, Lazarus II, and Tainted
|
|
@@ -47035,7 +47036,7 @@ return ____exports
|
|
|
47035
47036
|
["package"] = function(...)
|
|
47036
47037
|
return {
|
|
47037
47038
|
name = "isaacscript-common",
|
|
47038
|
-
version = "12.1.
|
|
47039
|
+
version = "12.1.1",
|
|
47039
47040
|
description = "Helper functions and features for IsaacScript mods.",
|
|
47040
47041
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
47041
47042
|
homepage = "https://isaacscript.github.io/",
|
package/dist/package.lua
CHANGED
|
@@ -77,7 +77,8 @@ export declare function getPlayerCollectibleMap(player: EntityPlayer): Map<Colle
|
|
|
77
77
|
* Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
|
|
78
78
|
* does not correspond to any particular player.
|
|
79
79
|
*
|
|
80
|
-
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order).
|
|
80
|
+
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
|
|
81
|
+
* a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
|
|
81
82
|
*/
|
|
82
83
|
export declare function getPlayerFromEntity(entity: Entity): EntityPlayer | undefined;
|
|
83
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EA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,CACvC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,GAAG,CASL;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GACnB,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,CAc3B;AAED
|
|
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,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,GAAG,SAAS,CAMxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,GAAG,KAAK,GACvC,KAAK,CAMP;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,IAAI,UAAU,EAAE,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAiB/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MA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GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;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"}
|
|
@@ -247,7 +247,8 @@ end
|
|
|
247
247
|
--- Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
|
|
248
248
|
-- does not correspond to any particular player.
|
|
249
249
|
--
|
|
250
|
-
-- This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order).
|
|
250
|
+
-- This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
|
|
251
|
+
-- a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
|
|
251
252
|
function ____exports.getPlayerFromEntity(self, entity)
|
|
252
253
|
if entity.Parent ~= nil then
|
|
253
254
|
local player = entity.Parent:ToPlayer()
|
|
@@ -269,7 +270,7 @@ function ____exports.getPlayerFromEntity(self, entity)
|
|
|
269
270
|
return familiar.Player
|
|
270
271
|
end
|
|
271
272
|
end
|
|
272
|
-
return
|
|
273
|
+
return entity:ToPlayer()
|
|
273
274
|
end
|
|
274
275
|
--- Helper function to get the proper name of the player. Use this instead of the
|
|
275
276
|
-- `EntityPlayer.GetName` method because it accounts for Blue Baby, Lazarus II, and Tainted
|
package/package.json
CHANGED
package/src/functions/players.ts
CHANGED
|
@@ -268,7 +268,8 @@ export function getPlayerCollectibleMap(
|
|
|
268
268
|
* Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
|
|
269
269
|
* does not correspond to any particular player.
|
|
270
270
|
*
|
|
271
|
-
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order).
|
|
271
|
+
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
|
|
272
|
+
* a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
|
|
272
273
|
*/
|
|
273
274
|
export function getPlayerFromEntity(entity: Entity): EntityPlayer | undefined {
|
|
274
275
|
if (entity.Parent !== undefined) {
|
|
@@ -295,7 +296,7 @@ export function getPlayerFromEntity(entity: Entity): EntityPlayer | undefined {
|
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
|
|
298
|
-
return
|
|
299
|
+
return entity.ToPlayer();
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
/**
|