isaacscript-common 72.7.0 → 72.8.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.
@@ -8718,7 +8718,7 @@ export declare function isActiveCollectible(collectibleType: CollectibleType): b
8718
8718
 
8719
8719
  /**
8720
8720
  * Helper function to detect if a particular entity is an active enemy. Use this over the
8721
- * `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Doors,
8721
+ * `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Greed,
8722
8722
  * and Mother.
8723
8723
  */
8724
8724
  export declare function isActiveEnemy(entity: Entity): boolean;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 72.7.0
3
+ isaacscript-common 72.8.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -10444,6 +10444,50 @@ ____exports.ColostomiaState.FART_ATTACK = 11
10444
10444
  ____exports.ColostomiaState[____exports.ColostomiaState.FART_ATTACK] = "FART_ATTACK"
10445
10445
  ____exports.ColostomiaState.TRANSITION_TO_PHASE_2 = 16
10446
10446
  ____exports.ColostomiaState[____exports.ColostomiaState.TRANSITION_TO_PHASE_2] = "TRANSITION_TO_PHASE_2"
10447
+ --- For `EntityType.ULTRA_GREED` (406), `UltraGreedVariant.ULTRA_GREED` (0).
10448
+ ____exports.UltraGreedState = {}
10449
+ ____exports.UltraGreedState.HANGING = 2
10450
+ ____exports.UltraGreedState[____exports.UltraGreedState.HANGING] = "HANGING"
10451
+ ____exports.UltraGreedState.IDLE = 3
10452
+ ____exports.UltraGreedState[____exports.UltraGreedState.IDLE] = "IDLE"
10453
+ ____exports.UltraGreedState.MOVE = 4
10454
+ ____exports.UltraGreedState[____exports.UltraGreedState.MOVE] = "MOVE"
10455
+ ____exports.UltraGreedState.GOLD_STATUE_BREAKING_OUT = 16
10456
+ ____exports.UltraGreedState[____exports.UltraGreedState.GOLD_STATUE_BREAKING_OUT] = "GOLD_STATUE_BREAKING_OUT"
10457
+ ____exports.UltraGreedState.EYES_SPINNING = 100
10458
+ ____exports.UltraGreedState[____exports.UltraGreedState.EYES_SPINNING] = "EYES_SPINNING"
10459
+ ____exports.UltraGreedState.STOMPING = 200
10460
+ ____exports.UltraGreedState[____exports.UltraGreedState.STOMPING] = "STOMPING"
10461
+ ____exports.UltraGreedState.BLOCKING_WITH_ARMS = 400
10462
+ ____exports.UltraGreedState[____exports.UltraGreedState.BLOCKING_WITH_ARMS] = "BLOCKING_WITH_ARMS"
10463
+ ____exports.UltraGreedState.SPIN_ATTACK = 510
10464
+ ____exports.UltraGreedState[____exports.UltraGreedState.SPIN_ATTACK] = "SPIN_ATTACK"
10465
+ ____exports.UltraGreedState.SHOOT_4_COINS = 600
10466
+ ____exports.UltraGreedState[____exports.UltraGreedState.SHOOT_4_COINS] = "SHOOT_4_COINS"
10467
+ ____exports.UltraGreedState.DYING = 9000
10468
+ ____exports.UltraGreedState[____exports.UltraGreedState.DYING] = "DYING"
10469
+ ____exports.UltraGreedState.GOLD_STATUE = 9001
10470
+ ____exports.UltraGreedState[____exports.UltraGreedState.GOLD_STATUE] = "GOLD_STATUE"
10471
+ --- For `EntityType.ULTRA_GREED` (406), `UltraGreedVariant.ULTRA_GREEDIER` (1).
10472
+ ____exports.UltraGreedierState = {}
10473
+ ____exports.UltraGreedierState.IDLE = 3
10474
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.IDLE] = "IDLE"
10475
+ ____exports.UltraGreedierState.MOVE = 4
10476
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.MOVE] = "MOVE"
10477
+ ____exports.UltraGreedierState.JUMP = 6
10478
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.JUMP] = "JUMP"
10479
+ ____exports.UltraGreedierState.STOMPING = 200
10480
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.STOMPING] = "STOMPING"
10481
+ ____exports.UltraGreedierState.SHOOT_4_COINS = 600
10482
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.SHOOT_4_COINS] = "SHOOT_4_COINS"
10483
+ ____exports.UltraGreedierState.FIST_POUND = 700
10484
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.FIST_POUND] = "FIST_POUND"
10485
+ ____exports.UltraGreedierState.FIST_POUND_TRIPLE = 710
10486
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.FIST_POUND_TRIPLE] = "FIST_POUND_TRIPLE"
10487
+ ____exports.UltraGreedierState.DYING = 9000
10488
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.DYING] = "DYING"
10489
+ ____exports.UltraGreedierState.POST_EXPLOSION = 9001
10490
+ ____exports.UltraGreedierState[____exports.UltraGreedierState.POST_EXPLOSION] = "POST_EXPLOSION"
10447
10491
  return ____exports
10448
10492
  end,
10449
10493
  ["lua_modules.isaac-typescript-definitions.dist.src.enums.WeaponType"] = function(...)
@@ -23658,6 +23702,9 @@ local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
23658
23702
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
23659
23703
  local MotherVariant = ____isaac_2Dtypescript_2Ddefinitions.MotherVariant
23660
23704
  local NPCState = ____isaac_2Dtypescript_2Ddefinitions.NPCState
23705
+ local UltraGreedState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedState
23706
+ local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
23707
+ local UltraGreedierState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedierState
23661
23708
  local ____cachedClasses = require("src.core.cachedClasses")
23662
23709
  local game = ____cachedClasses.game
23663
23710
  local ____constants = require("src.core.constants")
@@ -23679,6 +23726,7 @@ local setSpriteOpacity = ____sprites.setSpriteOpacity
23679
23726
  local ____tstlClass = require("src.functions.tstlClass")
23680
23727
  local isTSTLSet = ____tstlClass.isTSTLSet
23681
23728
  local ____types = require("src.functions.types")
23729
+ local asNPCState = ____types.asNPCState
23682
23730
  local isPrimitive = ____types.isPrimitive
23683
23731
  local ____utils = require("src.functions.utils")
23684
23732
  local assertDefined = ____utils.assertDefined
@@ -23904,14 +23952,70 @@ function ____exports.isActiveEnemy(self, entity)
23904
23952
  end
23905
23953
  local room = game:GetRoom()
23906
23954
  local isClear = room:IsClear()
23907
- if isClear and (entity.Type == EntityType.GRIMACE or entity.Type == EntityType.ULTRA_DOOR) then
23908
- return false
23909
- end
23910
- if entity.Type == EntityType.MOTHER and entity.Variant == MotherVariant.MOTHER_1 then
23911
- local npc = entity:ToNPC()
23912
- if npc ~= nil and npc.State == NPCState.SPECIAL then
23913
- return false
23914
- end
23955
+ if isClear then
23956
+ repeat
23957
+ local ____switch36 = entity.Type
23958
+ local ____cond36 = ____switch36 == EntityType.GRIMACE
23959
+ if ____cond36 then
23960
+ do
23961
+ return false
23962
+ end
23963
+ end
23964
+ ____cond36 = ____cond36 or ____switch36 == EntityType.ULTRA_DOOR
23965
+ if ____cond36 then
23966
+ do
23967
+ return false
23968
+ end
23969
+ end
23970
+ ____cond36 = ____cond36 or ____switch36 == EntityType.ULTRA_GREED
23971
+ if ____cond36 then
23972
+ do
23973
+ local npc = entity:ToNPC()
23974
+ if npc ~= nil then
23975
+ local ultraGreedVariant = npc.Variant
23976
+ repeat
23977
+ local ____switch41 = ultraGreedVariant
23978
+ local ____cond41 = ____switch41 == UltraGreedVariant.ULTRA_GREED
23979
+ if ____cond41 then
23980
+ do
23981
+ if npc.State == asNPCState(nil, UltraGreedState.GOLD_STATUE) then
23982
+ return false
23983
+ end
23984
+ break
23985
+ end
23986
+ end
23987
+ ____cond41 = ____cond41 or ____switch41 == UltraGreedVariant.ULTRA_GREEDIER
23988
+ if ____cond41 then
23989
+ do
23990
+ if npc.State == asNPCState(nil, UltraGreedierState.POST_EXPLOSION) then
23991
+ return false
23992
+ end
23993
+ break
23994
+ end
23995
+ end
23996
+ until true
23997
+ end
23998
+ break
23999
+ end
24000
+ end
24001
+ ____cond36 = ____cond36 or ____switch36 == EntityType.MOTHER
24002
+ if ____cond36 then
24003
+ do
24004
+ if entity.Variant == MotherVariant.MOTHER_1 then
24005
+ local npc = entity:ToNPC()
24006
+ if npc ~= nil and npc.State == NPCState.SPECIAL then
24007
+ return false
24008
+ end
24009
+ end
24010
+ break
24011
+ end
24012
+ end
24013
+ do
24014
+ do
24015
+ break
24016
+ end
24017
+ end
24018
+ until true
23915
24019
  end
23916
24020
  return entity:IsActiveEnemy(false)
23917
24021
  end
@@ -115,7 +115,7 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
115
115
  export declare function hasArmor(entity: Entity): boolean;
116
116
  /**
117
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,
118
+ * `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Greed,
119
119
  * and Mother.
120
120
  */
121
121
  export declare function isActiveEnemy(entity: Entity): boolean;
@@ -1 +1 @@
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;;;;;;;;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GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAGnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAUzD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,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,CAoCR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,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"}
@@ -13,6 +13,9 @@ local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
13
13
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
14
14
  local MotherVariant = ____isaac_2Dtypescript_2Ddefinitions.MotherVariant
15
15
  local NPCState = ____isaac_2Dtypescript_2Ddefinitions.NPCState
16
+ local UltraGreedState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedState
17
+ local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
18
+ local UltraGreedierState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedierState
16
19
  local ____cachedClasses = require("src.core.cachedClasses")
17
20
  local game = ____cachedClasses.game
18
21
  local ____constants = require("src.core.constants")
@@ -34,6 +37,7 @@ local setSpriteOpacity = ____sprites.setSpriteOpacity
34
37
  local ____tstlClass = require("src.functions.tstlClass")
35
38
  local isTSTLSet = ____tstlClass.isTSTLSet
36
39
  local ____types = require("src.functions.types")
40
+ local asNPCState = ____types.asNPCState
37
41
  local isPrimitive = ____types.isPrimitive
38
42
  local ____utils = require("src.functions.utils")
39
43
  local assertDefined = ____utils.assertDefined
@@ -339,7 +343,7 @@ function ____exports.hasArmor(self, entity)
339
343
  return ENTITIES_WITH_ARMOR_SET:has(typeVariantString)
340
344
  end
341
345
  --- 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,
346
+ -- `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Greed,
343
347
  -- and Mother.
344
348
  function ____exports.isActiveEnemy(self, entity)
345
349
  if entity:HasEntityFlags(EntityFlag.FRIENDLY) then
@@ -347,14 +351,70 @@ function ____exports.isActiveEnemy(self, entity)
347
351
  end
348
352
  local room = game:GetRoom()
349
353
  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
354
+ if isClear then
355
+ repeat
356
+ local ____switch36 = entity.Type
357
+ local ____cond36 = ____switch36 == EntityType.GRIMACE
358
+ if ____cond36 then
359
+ do
360
+ return false
361
+ end
362
+ end
363
+ ____cond36 = ____cond36 or ____switch36 == EntityType.ULTRA_DOOR
364
+ if ____cond36 then
365
+ do
366
+ return false
367
+ end
368
+ end
369
+ ____cond36 = ____cond36 or ____switch36 == EntityType.ULTRA_GREED
370
+ if ____cond36 then
371
+ do
372
+ local npc = entity:ToNPC()
373
+ if npc ~= nil then
374
+ local ultraGreedVariant = npc.Variant
375
+ repeat
376
+ local ____switch41 = ultraGreedVariant
377
+ local ____cond41 = ____switch41 == UltraGreedVariant.ULTRA_GREED
378
+ if ____cond41 then
379
+ do
380
+ if npc.State == asNPCState(nil, UltraGreedState.GOLD_STATUE) then
381
+ return false
382
+ end
383
+ break
384
+ end
385
+ end
386
+ ____cond41 = ____cond41 or ____switch41 == UltraGreedVariant.ULTRA_GREEDIER
387
+ if ____cond41 then
388
+ do
389
+ if npc.State == asNPCState(nil, UltraGreedierState.POST_EXPLOSION) then
390
+ return false
391
+ end
392
+ break
393
+ end
394
+ end
395
+ until true
396
+ end
397
+ break
398
+ end
399
+ end
400
+ ____cond36 = ____cond36 or ____switch36 == EntityType.MOTHER
401
+ if ____cond36 then
402
+ do
403
+ if entity.Variant == MotherVariant.MOTHER_1 then
404
+ local npc = entity:ToNPC()
405
+ if npc ~= nil and npc.State == NPCState.SPECIAL then
406
+ return false
407
+ end
408
+ end
409
+ break
410
+ end
411
+ end
412
+ do
413
+ do
414
+ break
415
+ end
416
+ end
417
+ until true
358
418
  end
359
419
  return entity:IsActiveEnemy(false)
360
420
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "72.7.0",
3
+ "version": "72.8.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.1.0"
28
+ "isaac-typescript-definitions": "^36.2.0"
29
29
  }
30
30
  }
@@ -3,6 +3,9 @@ import {
3
3
  EntityType,
4
4
  MotherVariant,
5
5
  NPCState,
6
+ UltraGreedState,
7
+ UltraGreedVariant,
8
+ UltraGreedierState,
6
9
  } from "isaac-typescript-definitions";
7
10
  import { game } from "../core/cachedClasses";
8
11
  import { VectorZero } from "../core/constants";
@@ -15,7 +18,7 @@ import { newReadonlyColor } from "./readOnly";
15
18
  import { getRandomSeed, isRNG, newRNG } from "./rng";
16
19
  import { setSpriteOpacity } from "./sprites";
17
20
  import { isTSTLSet } from "./tstlClass";
18
- import { isPrimitive } from "./types";
21
+ import { asNPCState, isPrimitive } from "./types";
19
22
  import { assertDefined } from "./utils";
20
23
  import { doesVectorHaveLength, isVector, vectorToString } from "./vector";
21
24
 
@@ -355,7 +358,7 @@ export function hasArmor(entity: Entity): boolean {
355
358
 
356
359
  /**
357
360
  * 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,
361
+ * `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Greed,
359
362
  * and Mother.
360
363
  */
361
364
  export function isActiveEnemy(entity: Entity): boolean {
@@ -367,22 +370,61 @@ export function isActiveEnemy(entity: Entity): boolean {
367
370
  const isClear = room.IsClear();
368
371
 
369
372
  // 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;
373
+ if (isClear) {
374
+ switch (entity.Type) {
375
+ // 42
376
+ case EntityType.GRIMACE: {
377
+ return false;
378
+ }
379
+
380
+ // 294
381
+ case EntityType.ULTRA_DOOR: {
382
+ return false;
383
+ }
384
+
385
+ // 406
386
+ case EntityType.ULTRA_GREED: {
387
+ const npc = entity.ToNPC();
388
+ if (npc !== undefined) {
389
+ const ultraGreedVariant = npc.Variant as UltraGreedVariant;
390
+
391
+ switch (ultraGreedVariant) {
392
+ case UltraGreedVariant.ULTRA_GREED: {
393
+ if (npc.State === asNPCState(UltraGreedState.GOLD_STATUE)) {
394
+ return false;
395
+ }
396
+
397
+ break;
398
+ }
399
+
400
+ case UltraGreedVariant.ULTRA_GREEDIER: {
401
+ if (npc.State === asNPCState(UltraGreedierState.POST_EXPLOSION)) {
402
+ return false;
403
+ }
404
+
405
+ break;
406
+ }
407
+ }
408
+ }
409
+
410
+ break;
411
+ }
412
+
413
+ // 912
414
+ case EntityType.MOTHER: {
415
+ if (entity.Variant === MotherVariant.MOTHER_1) {
416
+ const npc = entity.ToNPC();
417
+ if (npc !== undefined && npc.State === NPCState.SPECIAL) {
418
+ return false;
419
+ }
420
+ }
421
+
422
+ break;
423
+ }
424
+
425
+ default: {
426
+ break;
427
+ }
386
428
  }
387
429
  }
388
430