isaacscript-common 12.1.1 → 12.2.0
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 +7 -0
- package/dist/isaacscript-common.lua +18 -2
- package/dist/package.lua +1 -1
- package/dist/src/functions/entities.d.ts +6 -0
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +16 -0
- package/package.json +1 -1
- package/src/functions/entities.ts +20 -0
package/dist/index.d.ts
CHANGED
|
@@ -10764,6 +10764,13 @@ export declare function setDoorDisplay(textCallback: (door: GridEntityDoor) => s
|
|
|
10764
10764
|
*/
|
|
10765
10765
|
export declare function setEffectDisplay(textCallback: (effect: EntityEffect) => string): void;
|
|
10766
10766
|
|
|
10767
|
+
/**
|
|
10768
|
+
* Helper function to make an entity flash red like it is taking damage. This is useful when you
|
|
10769
|
+
* want to make it appear as if an entity is taking damage without actually dealing any damage to
|
|
10770
|
+
* it.
|
|
10771
|
+
*/
|
|
10772
|
+
export declare function setEntityDamageFlash(entity: Entity): void;
|
|
10773
|
+
|
|
10767
10774
|
/**
|
|
10768
10775
|
* Helper function to set the position of every entity in the room based on a map of positions. If
|
|
10769
10776
|
* an entity is found that does not have matching element in the provided map, then that entity will
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 12.
|
|
3
|
+
isaacscript-common 12.2.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -20380,6 +20380,16 @@ function ____exports.removeEntities(self, entities, cap)
|
|
|
20380
20380
|
end
|
|
20381
20381
|
return entitiesRemoved
|
|
20382
20382
|
end
|
|
20383
|
+
--- From DeadInfinity.
|
|
20384
|
+
local DAMAGE_FLASH_COLOR = Color(
|
|
20385
|
+
0.5,
|
|
20386
|
+
0.5,
|
|
20387
|
+
0.5,
|
|
20388
|
+
1,
|
|
20389
|
+
200 / 255,
|
|
20390
|
+
0 / 255,
|
|
20391
|
+
0 / 255
|
|
20392
|
+
)
|
|
20383
20393
|
--- Helper function to count the number of entities in room. Use this over the vanilla
|
|
20384
20394
|
-- `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
20385
20395
|
-- enemies.
|
|
@@ -20672,6 +20682,12 @@ function ____exports.rerollEnemy(self, entity)
|
|
|
20672
20682
|
end
|
|
20673
20683
|
return filteredNewEntities[1]
|
|
20674
20684
|
end
|
|
20685
|
+
--- Helper function to make an entity flash red like it is taking damage. This is useful when you
|
|
20686
|
+
-- want to make it appear as if an entity is taking damage without actually dealing any damage to
|
|
20687
|
+
-- it.
|
|
20688
|
+
function ____exports.setEntityDamageFlash(self, entity)
|
|
20689
|
+
entity:SetColor(DAMAGE_FLASH_COLOR, 2, 0)
|
|
20690
|
+
end
|
|
20675
20691
|
function ____exports.setEntityRandomColor(self, entity)
|
|
20676
20692
|
local rng = newRNG(nil, entity.InitSeed)
|
|
20677
20693
|
local r = getRandom(nil, rng)
|
|
@@ -47036,7 +47052,7 @@ return ____exports
|
|
|
47036
47052
|
["package"] = function(...)
|
|
47037
47053
|
return {
|
|
47038
47054
|
name = "isaacscript-common",
|
|
47039
|
-
version = "12.
|
|
47055
|
+
version = "12.2.0",
|
|
47040
47056
|
description = "Helper functions and features for IsaacScript mods.",
|
|
47041
47057
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
47042
47058
|
homepage = "https://isaacscript.github.io/",
|
package/dist/package.lua
CHANGED
|
@@ -151,6 +151,12 @@ export declare function removeEntities<T extends AnyEntity>(entities: T[], cap?:
|
|
|
151
151
|
* rerolled entity.
|
|
152
152
|
*/
|
|
153
153
|
export declare function rerollEnemy(entity: Entity): Entity | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Helper function to make an entity flash red like it is taking damage. This is useful when you
|
|
156
|
+
* want to make it appear as if an entity is taking damage without actually dealing any damage to
|
|
157
|
+
* it.
|
|
158
|
+
*/
|
|
159
|
+
export declare function setEntityDamageFlash(entity: Entity): void;
|
|
154
160
|
export declare function setEntityRandomColor(entity: Entity): void;
|
|
155
161
|
/**
|
|
156
162
|
* Helper function to spawn an entity. Use this instead of the `Isaac.Spawn` method if you do not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAkB/C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,GAAG,CAcL;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,OAAO,CAGT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,SAAS,EACpD,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,CAAC,EAAE,GACZ,CAAC,GAAG,SAAS,CAaf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,WAAW,CACzB,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,MAAM,EAAE,CAMV;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GACb,MAAM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,CAAC,EAAE,EACb,GAAG,CAAC,EAAE,GAAG,GACR,CAAC,EAAE,CAgBL;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgB9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CASzD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAsCR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
|
|
@@ -59,6 +59,16 @@ function ____exports.removeEntities(self, entities, cap)
|
|
|
59
59
|
end
|
|
60
60
|
return entitiesRemoved
|
|
61
61
|
end
|
|
62
|
+
--- From DeadInfinity.
|
|
63
|
+
local DAMAGE_FLASH_COLOR = Color(
|
|
64
|
+
0.5,
|
|
65
|
+
0.5,
|
|
66
|
+
0.5,
|
|
67
|
+
1,
|
|
68
|
+
200 / 255,
|
|
69
|
+
0 / 255,
|
|
70
|
+
0 / 255
|
|
71
|
+
)
|
|
62
72
|
--- Helper function to count the number of entities in room. Use this over the vanilla
|
|
63
73
|
-- `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
64
74
|
-- enemies.
|
|
@@ -351,6 +361,12 @@ function ____exports.rerollEnemy(self, entity)
|
|
|
351
361
|
end
|
|
352
362
|
return filteredNewEntities[1]
|
|
353
363
|
end
|
|
364
|
+
--- Helper function to make an entity flash red like it is taking damage. This is useful when you
|
|
365
|
+
-- want to make it appear as if an entity is taking damage without actually dealing any damage to
|
|
366
|
+
-- it.
|
|
367
|
+
function ____exports.setEntityDamageFlash(self, entity)
|
|
368
|
+
entity:SetColor(DAMAGE_FLASH_COLOR, 2, 0)
|
|
369
|
+
end
|
|
354
370
|
function ____exports.setEntityRandomColor(self, entity)
|
|
355
371
|
local rng = newRNG(nil, entity.InitSeed)
|
|
356
372
|
local r = getRandom(nil, rng)
|
package/package.json
CHANGED
|
@@ -9,6 +9,17 @@ import { isRNG, newRNG } from "./rng";
|
|
|
9
9
|
import { asNumber, isPrimitive } from "./types";
|
|
10
10
|
import { isVector, vectorToString } from "./vector";
|
|
11
11
|
|
|
12
|
+
/** From DeadInfinity. */
|
|
13
|
+
const DAMAGE_FLASH_COLOR: Readonly<Color> = Color(
|
|
14
|
+
0.5,
|
|
15
|
+
0.5,
|
|
16
|
+
0.5,
|
|
17
|
+
1.0,
|
|
18
|
+
200 / 255,
|
|
19
|
+
0 / 255,
|
|
20
|
+
0 / 255,
|
|
21
|
+
);
|
|
22
|
+
|
|
12
23
|
/**
|
|
13
24
|
* Helper function to count the number of entities in room. Use this over the vanilla
|
|
14
25
|
* `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
@@ -404,6 +415,15 @@ export function rerollEnemy(entity: Entity): Entity | undefined {
|
|
|
404
415
|
return filteredNewEntities[0];
|
|
405
416
|
}
|
|
406
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Helper function to make an entity flash red like it is taking damage. This is useful when you
|
|
420
|
+
* want to make it appear as if an entity is taking damage without actually dealing any damage to
|
|
421
|
+
* it.
|
|
422
|
+
*/
|
|
423
|
+
export function setEntityDamageFlash(entity: Entity): void {
|
|
424
|
+
entity.SetColor(DAMAGE_FLASH_COLOR, 2, 0);
|
|
425
|
+
}
|
|
426
|
+
|
|
407
427
|
export function setEntityRandomColor(entity: Entity): void {
|
|
408
428
|
const rng = newRNG(entity.InitSeed);
|
|
409
429
|
|