isaacscript-common 72.5.0 → 72.7.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.rollup.d.ts +20 -0
- package/dist/isaacscript-common.lua +6631 -6591
- package/dist/src/functions/entities.d.ts +7 -1
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +23 -0
- package/dist/src/functions/itemPool.d.ts +4 -0
- package/dist/src/functions/itemPool.d.ts.map +1 -1
- package/dist/src/functions/itemPool.lua +6 -0
- package/dist/src/functions/logEntities.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +2 -0
- package/dist/src/functions/logMisc.d.ts +8 -1
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +18 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +2 -3
- package/package.json +2 -2
- package/src/functions/entities.ts +43 -2
- package/src/functions/itemPool.ts +8 -0
- package/src/functions/logEntities.ts +2 -0
- package/src/functions/logMisc.ts +30 -1
- package/src/functions/rooms.ts +2 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
-
import
|
|
2
|
+
import { EntityType } from "isaac-typescript-definitions";
|
|
3
3
|
import type { AnyEntity } from "../types/AnyEntity";
|
|
4
4
|
import type { EntityID } from "../types/EntityID";
|
|
5
5
|
/**
|
|
@@ -113,6 +113,12 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
|
|
|
113
113
|
* For more on armor, see the wiki: https://bindingofisaacrebirth.fandom.com/wiki/Damage_Scaling
|
|
114
114
|
*/
|
|
115
115
|
export declare function hasArmor(entity: Entity): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Helper function to detect if a particular entity is an active enemy. Use this over the
|
|
118
|
+
* `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Doors,
|
|
119
|
+
* and Mother.
|
|
120
|
+
*/
|
|
121
|
+
export declare function isActiveEnemy(entity: Entity): boolean;
|
|
116
122
|
/**
|
|
117
123
|
* Helper function to measure an entity's velocity to see if it is moving.
|
|
118
124
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGX,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAsBlD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,GAAG,CA4BL;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EACP,UAAU,EAAE,GACZ,SAAS,UAAU,EAAE,GACrB,GAAG,CAAC,UAAU,CAAC,GACf,WAAW,CAAC,UAAU,CAAC,EAC3B,cAAc,UAAQ,GACrB,OAAO,CAQT;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,SAAS,EACpD,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,CAAC,EAAE,EACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,GAClC,CAAC,GAAG,SAAS,CAgBf;A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AAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
|
|
@@ -10,6 +10,9 @@ local ____exports = {}
|
|
|
10
10
|
local setPrimitiveEntityFields
|
|
11
11
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
12
12
|
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
13
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
14
|
+
local MotherVariant = ____isaac_2Dtypescript_2Ddefinitions.MotherVariant
|
|
15
|
+
local NPCState = ____isaac_2Dtypescript_2Ddefinitions.NPCState
|
|
13
16
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
14
17
|
local game = ____cachedClasses.game
|
|
15
18
|
local ____constants = require("src.core.constants")
|
|
@@ -335,6 +338,26 @@ function ____exports.hasArmor(self, entity)
|
|
|
335
338
|
local typeVariantString = (tostring(entity.Type) .. ".") .. tostring(entity.Variant)
|
|
336
339
|
return ENTITIES_WITH_ARMOR_SET:has(typeVariantString)
|
|
337
340
|
end
|
|
341
|
+
--- Helper function to detect if a particular entity is an active enemy. Use this over the
|
|
342
|
+
-- `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Doors,
|
|
343
|
+
-- and Mother.
|
|
344
|
+
function ____exports.isActiveEnemy(self, entity)
|
|
345
|
+
if entity:HasEntityFlags(EntityFlag.FRIENDLY) then
|
|
346
|
+
return false
|
|
347
|
+
end
|
|
348
|
+
local room = game:GetRoom()
|
|
349
|
+
local isClear = room:IsClear()
|
|
350
|
+
if isClear and (entity.Type == EntityType.GRIMACE or entity.Type == EntityType.ULTRA_DOOR) then
|
|
351
|
+
return false
|
|
352
|
+
end
|
|
353
|
+
if entity.Type == EntityType.MOTHER and entity.Variant == MotherVariant.MOTHER_1 then
|
|
354
|
+
local npc = entity:ToNPC()
|
|
355
|
+
if npc ~= nil and npc.State == NPCState.SPECIAL then
|
|
356
|
+
return false
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
return entity:IsActiveEnemy(false)
|
|
360
|
+
end
|
|
338
361
|
--- Helper function to measure an entity's velocity to see if it is moving.
|
|
339
362
|
--
|
|
340
363
|
-- Use this helper function over checking if the velocity length is equal to 0 because entities can
|
|
@@ -13,6 +13,10 @@ export declare function getDefaultCollectibleTypesInItemPool(itemPoolType: ItemP
|
|
|
13
13
|
* "normal" item pools when playing in Greed Mode.
|
|
14
14
|
*/
|
|
15
15
|
export declare function getDefaultItemPoolsForCollectibleType(collectibleType: CollectibleType): ItemPoolType[];
|
|
16
|
+
/**
|
|
17
|
+
* Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getItemPoolName(itemPoolType: ItemPoolType): string;
|
|
16
20
|
/**
|
|
17
21
|
* Helper function to get a random item pool. This is not as simple as getting a random value from
|
|
18
22
|
* the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAyC5D;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,YAAY,GACzB,GAAG,CAAC,eAAe,CAAC,CAEtB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,eAAe,GAC/B,YAAY,EAAE,CAgBhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAElE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAM3E"}
|
|
@@ -10,6 +10,8 @@ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
|
10
10
|
local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
|
|
11
11
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
12
12
|
local game = ____cachedClasses.game
|
|
13
|
+
local ____itemPoolTypeToItemPoolName = require("src.maps.itemPoolTypeToItemPoolName")
|
|
14
|
+
local ITEM_POOL_TYPE_TO_ITEM_POOL_NAME = ____itemPoolTypeToItemPoolName.ITEM_POOL_TYPE_TO_ITEM_POOL_NAME
|
|
13
15
|
local ____itemPoolTypeToCollectibleTypesSet = require("src.objects.itemPoolTypeToCollectibleTypesSet")
|
|
14
16
|
local ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET = ____itemPoolTypeToCollectibleTypesSet.ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET
|
|
15
17
|
local ____array = require("src.functions.array")
|
|
@@ -77,6 +79,10 @@ function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType
|
|
|
77
79
|
end
|
|
78
80
|
return collectibleItemPoolTypes
|
|
79
81
|
end
|
|
82
|
+
--- Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
|
|
83
|
+
function ____exports.getItemPoolName(self, itemPoolType)
|
|
84
|
+
return ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType]
|
|
85
|
+
end
|
|
80
86
|
--- Helper function to get a random item pool. This is not as simple as getting a random value from
|
|
81
87
|
-- the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
|
|
82
88
|
-- Greed Mode item pools should be excluded if not playing in Greed Mode.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/logEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,cAAc,EAOf,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"logEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/logEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,cAAc,EAOf,MAAM,8BAA8B,CAAC;AAqBtC,8FAA8F;AAC9F,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,wBAAwB,EAAE,OAAO,EACjC,gBAAgB,CAAC,EAAE,UAAU,GAC5B,IAAI,CA2CN;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,YAAY,UAAQ,EACpB,oBAAoB,CAAC,EAAE,cAAc,GACpC,IAAI,CA+CN;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAIhE;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAG1D;AA8ID,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAI5E;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAGtE;AA+DD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAQ7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAInE"}
|
|
@@ -194,6 +194,8 @@ local IGNORE_EFFECT_VARIANTS = __TS__New(ReadonlySet, {
|
|
|
194
194
|
EffectVariant.WALL_BUG,
|
|
195
195
|
EffectVariant.FALLING_EMBER,
|
|
196
196
|
EffectVariant.LIGHT,
|
|
197
|
+
EffectVariant.MIST,
|
|
198
|
+
EffectVariant.BACKDROP_DECORATION,
|
|
197
199
|
EffectVariant.TADPOLE
|
|
198
200
|
})
|
|
199
201
|
--- Helper function for printing out every entity (or filtered entity) in the current room.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
-
import type { CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
+
import type { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
3
3
|
import { DamageFlag, DisplayFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to log all of the values in an array.
|
|
@@ -33,6 +33,13 @@ export declare function logEntityID(this: void, entity: Entity): void;
|
|
|
33
33
|
export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
|
|
34
34
|
/** Helper function for logging every game state flag that is turned on. Useful when debugging. */
|
|
35
35
|
export declare function logGameStateFlags(this: void): void;
|
|
36
|
+
/**
|
|
37
|
+
* Helper function to log the names of a item pool type array.
|
|
38
|
+
*
|
|
39
|
+
* @param itemPoolTypes The item pool types to log.
|
|
40
|
+
* @param name Optional. The name of the array, which will be logged before the elements.
|
|
41
|
+
*/
|
|
42
|
+
export declare function logItemPoolTypes(this: void, itemPoolTypes: ItemPoolType[] | readonly ItemPoolType[], name?: string): void;
|
|
36
43
|
/**
|
|
37
44
|
* Helper function to log a `KColor` object.
|
|
38
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAId,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAuBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IA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AI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,EACjB,YAAY,SAAI,GACf,IAAI,CAuCN;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACxD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CAgCN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAkBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CAqBN;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACvC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACpC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
|
|
@@ -45,6 +45,8 @@ local ____flag = require("src.functions.flag")
|
|
|
45
45
|
local hasFlag = ____flag.hasFlag
|
|
46
46
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
47
47
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
48
|
+
local ____itemPool = require("src.functions.itemPool")
|
|
49
|
+
local getItemPoolName = ____itemPool.getItemPoolName
|
|
48
50
|
local ____log = require("src.functions.log")
|
|
49
51
|
local log = ____log.log
|
|
50
52
|
local ____playerHealth = require("src.functions.playerHealth")
|
|
@@ -169,6 +171,22 @@ function ____exports.logGameStateFlags()
|
|
|
169
171
|
log(" n/a (no flags)")
|
|
170
172
|
end
|
|
171
173
|
end
|
|
174
|
+
--- Helper function to log the names of a item pool type array.
|
|
175
|
+
--
|
|
176
|
+
-- @param itemPoolTypes The item pool types to log.
|
|
177
|
+
-- @param name Optional. The name of the array, which will be logged before the elements.
|
|
178
|
+
function ____exports.logItemPoolTypes(itemPoolTypes, name)
|
|
179
|
+
if name == nil then
|
|
180
|
+
name = "item pool types"
|
|
181
|
+
end
|
|
182
|
+
log(("Logging " .. name) .. ":")
|
|
183
|
+
local i = 1
|
|
184
|
+
for ____, itemPoolType in ipairs(itemPoolTypes) do
|
|
185
|
+
local itemPoolName = getItemPoolName(nil, itemPoolType)
|
|
186
|
+
log(((((tostring(i) .. ") ") .. itemPoolName) .. " (") .. tostring(itemPoolType)) .. ")")
|
|
187
|
+
i = i + 1
|
|
188
|
+
end
|
|
189
|
+
end
|
|
172
190
|
--- Helper function to log a `KColor` object.
|
|
173
191
|
--
|
|
174
192
|
-- @param kColor The `KColor` object to log.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,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Ddefinitions.DoorSlotFlag
|
|
20
20
|
local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
|
|
21
21
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
22
|
-
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
23
|
-
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
24
22
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
25
23
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
26
24
|
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
@@ -50,6 +48,7 @@ local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
|
50
48
|
local openDoorFast = ____doors.openDoorFast
|
|
51
49
|
local ____entities = require("src.functions.entities")
|
|
52
50
|
local getEntities = ____entities.getEntities
|
|
51
|
+
local isActiveEnemy = ____entities.isActiveEnemy
|
|
53
52
|
local ____flag = require("src.functions.flag")
|
|
54
53
|
local hasFlag = ____flag.hasFlag
|
|
55
54
|
local ____positionVelocity = require("src.functions.positionVelocity")
|
|
@@ -636,7 +635,7 @@ function ____exports.isRoomDangerous(self)
|
|
|
636
635
|
local entities = getEntities(nil)
|
|
637
636
|
if __TS__ArraySome(
|
|
638
637
|
entities,
|
|
639
|
-
function(____, entity) return
|
|
638
|
+
function(____, entity) return isActiveEnemy(nil, entity) end
|
|
640
639
|
) then
|
|
641
640
|
return true
|
|
642
641
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "72.
|
|
3
|
+
"version": "72.7.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"main": "dist/src/index",
|
|
26
26
|
"types": "dist/index.rollup.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^36.
|
|
28
|
+
"isaac-typescript-definitions": "^36.1.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
EntityFlag,
|
|
3
|
+
EntityType,
|
|
4
|
+
MotherVariant,
|
|
5
|
+
NPCState,
|
|
6
|
+
} from "isaac-typescript-definitions";
|
|
3
7
|
import { game } from "../core/cachedClasses";
|
|
4
8
|
import { VectorZero } from "../core/constants";
|
|
5
9
|
import { ENTITIES_WITH_ARMOR_SET } from "../sets/entitiesWithArmorSet";
|
|
@@ -349,6 +353,43 @@ export function hasArmor(entity: Entity): boolean {
|
|
|
349
353
|
return ENTITIES_WITH_ARMOR_SET.has(typeVariantString);
|
|
350
354
|
}
|
|
351
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Helper function to detect if a particular entity is an active enemy. Use this over the
|
|
358
|
+
* `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Doors,
|
|
359
|
+
* and Mother.
|
|
360
|
+
*/
|
|
361
|
+
export function isActiveEnemy(entity: Entity): boolean {
|
|
362
|
+
if (entity.HasEntityFlags(EntityFlag.FRIENDLY)) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const room = game.GetRoom();
|
|
367
|
+
const isClear = room.IsClear();
|
|
368
|
+
|
|
369
|
+
// Some entities count as being "active" enemies, but they deactivate when the room is cleared.
|
|
370
|
+
if (
|
|
371
|
+
isClear &&
|
|
372
|
+
(entity.Type === EntityType.GRIMACE || // 42
|
|
373
|
+
entity.Type === EntityType.ULTRA_DOOR) // 294
|
|
374
|
+
) {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// The `Entity.IsActiveEnemy` function does not work properly with Mother.
|
|
379
|
+
if (
|
|
380
|
+
entity.Type === EntityType.MOTHER &&
|
|
381
|
+
entity.Variant === MotherVariant.MOTHER_1
|
|
382
|
+
) {
|
|
383
|
+
const npc = entity.ToNPC();
|
|
384
|
+
if (npc !== undefined && npc.State === NPCState.SPECIAL) {
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
390
|
+
return entity.IsActiveEnemy(false);
|
|
391
|
+
}
|
|
392
|
+
|
|
352
393
|
/**
|
|
353
394
|
* Helper function to measure an entity's velocity to see if it is moving.
|
|
354
395
|
*
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
import { ItemPoolType } from "isaac-typescript-definitions";
|
|
6
6
|
import { ITEM_POOL_TYPE_VALUES } from "../arrays/cachedEnumValues";
|
|
7
7
|
import { game } from "../core/cachedClasses";
|
|
8
|
+
import { ITEM_POOL_TYPE_TO_ITEM_POOL_NAME } from "../maps/itemPoolTypeToItemPoolName";
|
|
8
9
|
import { ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET } from "../objects/itemPoolTypeToCollectibleTypesSet";
|
|
9
10
|
import { arrayRemove, getRandomArrayElement } from "./array";
|
|
10
11
|
|
|
@@ -79,6 +80,13 @@ export function getDefaultItemPoolsForCollectibleType(
|
|
|
79
80
|
return collectibleItemPoolTypes;
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
|
|
85
|
+
*/
|
|
86
|
+
export function getItemPoolName(itemPoolType: ItemPoolType): string {
|
|
87
|
+
return ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType];
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
/**
|
|
83
91
|
* Helper function to get a random item pool. This is not as simple as getting a random value from
|
|
84
92
|
* the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
|
|
@@ -26,6 +26,8 @@ const IGNORE_EFFECT_VARIANTS = new ReadonlySet<EffectVariant>([
|
|
|
26
26
|
EffectVariant.WALL_BUG, // 68
|
|
27
27
|
EffectVariant.FALLING_EMBER, // 87
|
|
28
28
|
EffectVariant.LIGHT, // 121
|
|
29
|
+
EffectVariant.MIST, // 138
|
|
30
|
+
EffectVariant.BACKDROP_DECORATION, // 140
|
|
29
31
|
EffectVariant.TADPOLE, // 158
|
|
30
32
|
]);
|
|
31
33
|
|
package/src/functions/logMisc.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CollectibleType,
|
|
3
|
+
ItemPoolType,
|
|
4
|
+
} from "isaac-typescript-definitions";
|
|
2
5
|
import {
|
|
3
6
|
DamageFlag,
|
|
4
7
|
DisplayFlag,
|
|
@@ -25,6 +28,7 @@ import { getEntityID } from "./entities";
|
|
|
25
28
|
import { getEnumEntries } from "./enums";
|
|
26
29
|
import { hasFlag } from "./flag";
|
|
27
30
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
31
|
+
import { getItemPoolName } from "./itemPool";
|
|
28
32
|
import { log } from "./log";
|
|
29
33
|
import { getPlayerHealth } from "./playerHealth";
|
|
30
34
|
import { getEffectsList, getPlayerName } from "./players";
|
|
@@ -178,6 +182,31 @@ export function logGameStateFlags(this: void): void {
|
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Helper function to log the names of a item pool type array.
|
|
187
|
+
*
|
|
188
|
+
* @param itemPoolTypes The item pool types to log.
|
|
189
|
+
* @param name Optional. The name of the array, which will be logged before the elements.
|
|
190
|
+
*/
|
|
191
|
+
export function logItemPoolTypes(
|
|
192
|
+
this: void,
|
|
193
|
+
itemPoolTypes: ItemPoolType[] | readonly ItemPoolType[],
|
|
194
|
+
name?: string,
|
|
195
|
+
): void {
|
|
196
|
+
if (name === undefined) {
|
|
197
|
+
name = "item pool types";
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
log(`Logging ${name}:`);
|
|
201
|
+
|
|
202
|
+
let i = 1;
|
|
203
|
+
for (const itemPoolType of itemPoolTypes) {
|
|
204
|
+
const itemPoolName = getItemPoolName(itemPoolType);
|
|
205
|
+
log(`${i}) ${itemPoolName} (${itemPoolType})`);
|
|
206
|
+
i++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
181
210
|
/**
|
|
182
211
|
* Helper function to log a `KColor` object.
|
|
183
212
|
*
|
package/src/functions/rooms.ts
CHANGED
|
@@ -11,8 +11,6 @@ import {
|
|
|
11
11
|
DoorSlotFlag,
|
|
12
12
|
DownpourRoomSubType,
|
|
13
13
|
DungeonSubType,
|
|
14
|
-
EntityFlag,
|
|
15
|
-
EntityType,
|
|
16
14
|
GridRoom,
|
|
17
15
|
HomeRoomSubType,
|
|
18
16
|
ProjectileFlag,
|
|
@@ -34,7 +32,7 @@ import {
|
|
|
34
32
|
isHiddenSecretRoomDoor,
|
|
35
33
|
openDoorFast,
|
|
36
34
|
} from "./doors";
|
|
37
|
-
import { getEntities } from "./entities";
|
|
35
|
+
import { getEntities, isActiveEnemy } from "./entities";
|
|
38
36
|
import { hasFlag } from "./flag";
|
|
39
37
|
import {
|
|
40
38
|
getEntityPositions,
|
|
@@ -820,15 +818,7 @@ export function isRoomDangerous(): boolean {
|
|
|
820
818
|
|
|
821
819
|
const entities = getEntities();
|
|
822
820
|
|
|
823
|
-
if (
|
|
824
|
-
entities.some(
|
|
825
|
-
(entity) =>
|
|
826
|
-
entity.IsActiveEnemy(false) &&
|
|
827
|
-
!entity.HasEntityFlags(EntityFlag.FRIENDLY) &&
|
|
828
|
-
// Grimaces count as being "active" enemies, but they go to sleep when the room is cleared.
|
|
829
|
-
entity.Type !== EntityType.GRIMACE,
|
|
830
|
-
)
|
|
831
|
-
) {
|
|
821
|
+
if (entities.some((entity) => isActiveEnemy(entity))) {
|
|
832
822
|
return true;
|
|
833
823
|
}
|
|
834
824
|
|