isaacscript-common 1.2.25 → 1.2.26

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.
@@ -2,7 +2,7 @@
2
2
  local ____lualib = require("lualib_bundle")
3
3
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
4
4
  local ____exports = {}
5
- local postNPCInitSirenHelper, checkReturnFamiliarToPlayer, blacklistEntryExists, v
5
+ local postNPCInitSirenHelper, checkReturnFamiliarToPlayer, blacklistEntryExists, getSirenHelper, v
6
6
  local ____errors = require("errors")
7
7
  local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
8
8
  local ____entity = require("functions.entity")
@@ -38,6 +38,16 @@ function blacklistEntryExists(self, incomingFamiliarVariant, incomingFamiliarSub
38
38
  end
39
39
  return false
40
40
  end
41
+ function getSirenHelper(self, familiar)
42
+ local familiarHash = GetPtrHash(familiar)
43
+ local sirenHelpers = getEntities(nil, EntityType.ENTITY_SIREN_HELPER)
44
+ for ____, sirenHelper in ipairs(sirenHelpers) do
45
+ if sirenHelper.Target ~= nil and GetPtrHash(sirenHelper.Target) == familiarHash then
46
+ return sirenHelper
47
+ end
48
+ end
49
+ return nil
50
+ end
41
51
  local FEATURE_NAME = "siren helpers"
42
52
  local initialized = false
43
53
  v = {run = {familiarBlacklist = {}}}
@@ -56,16 +66,6 @@ function ____exports.setFamiliarNoSirenSteal(self, familiarVariant, familiarSubT
56
66
  end
57
67
  __TS__ArrayPush(v.run.familiarBlacklist, {familiarVariant, familiarSubType})
58
68
  end
59
- local function getSirenHelper(self, familiar)
60
- local familiarHash = GetPtrHash(familiar)
61
- local sirenHelpers = getEntities(nil, EntityType.ENTITY_SIREN_HELPER)
62
- for ____, sirenHelper in ipairs(sirenHelpers) do
63
- if sirenHelper.Target ~= nil and GetPtrHash(sirenHelper.Target) == familiarHash then
64
- return sirenHelper
65
- end
66
- end
67
- return nil
68
- end
69
69
  function ____exports.hasSirenStolenFamiliar(self, familiar)
70
70
  return getSirenHelper(nil, familiar) ~= nil
71
71
  end
@@ -18,6 +18,7 @@ local FLYING_CHARACTERS = __TS__New(Set, {
18
18
  PlayerType.PLAYER_THESOUL_B
19
19
  })
20
20
  local FLYING_TRINKETS = __TS__New(Set, {TrinketType.TRINKET_BAT_WING, TrinketType.TRINKET_AZAZELS_STUMP})
21
+ local FLYING_NULL_ITEMS = {NullItemID.ID_REVERSE_SUN, NullItemID.ID_SPIRIT_SHACKLES_SOUL}
21
22
  function ____exports.getFlyingCollectibles(self, pruneConditionalItems)
22
23
  local collectiblesWithFlyingCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_FLYING)
23
24
  local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_ALL)
@@ -47,6 +48,11 @@ function ____exports.hasFlyingTemporaryEffect(self, player)
47
48
  return true
48
49
  end
49
50
  end
51
+ for ____, nullItemID in ipairs(FLYING_NULL_ITEMS) do
52
+ if effects:HasNullEffect(nullItemID) then
53
+ return true
54
+ end
55
+ end
50
56
  return false
51
57
  end
52
58
  function ____exports.isFlyingCharacter(self, player)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",