isaacscript-common 1.0.608-dev.4 → 1.2.2

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.
@@ -244,3 +244,8 @@ export declare function setActiveItem(player: EntityPlayer, collectibleType: Col
244
244
  * @param modifyCostume Optional. Whether to add or remove the blindfold costume. True by default.
245
245
  */
246
246
  export declare function setBlindfold(player: EntityPlayer, enabled: boolean, modifyCostume?: boolean): void;
247
+ /**
248
+ * Helper function to use an active item without showing an animation, keeping the item, or adding
249
+ * any costumes.
250
+ */
251
+ export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType | int): void;
@@ -535,4 +535,13 @@ function ____exports.setBlindfold(self, player, enabled, modifyCostume)
535
535
  end
536
536
  end
537
537
  end
538
+ function ____exports.useActiveItemTemp(self, player, collectibleType)
539
+ player:UseActiveItem(
540
+ collectibleType,
541
+ false,
542
+ false,
543
+ true,
544
+ false
545
+ )
546
+ end
538
547
  return ____exports
@@ -2,6 +2,8 @@
2
2
  local ____exports = {}
3
3
  local ____constants = require("constants")
4
4
  local GOLDEN_TRINKET_SHIFT = ____constants.GOLDEN_TRINKET_SHIFT
5
+ local ____player = require("functions.player")
6
+ local useActiveItemTemp = ____player.useActiveItemTemp
5
7
  function ____exports.temporarilyRemoveTrinket(self, player, trinketType)
6
8
  if not player:HasTrinket(trinketType) then
7
9
  return nil
@@ -54,7 +56,7 @@ function ____exports.giveTrinketsBack(self, player, trinketSituation)
54
56
  local i = 0
55
57
  while i < trinketSituation.numSmeltedTrinkets do
56
58
  player:AddTrinket(trinketSituation.trinketTypeRemoved, false)
57
- player:UseActiveItem(CollectibleType.COLLECTIBLE_SMELTER, UseFlag.USE_NOANIM)
59
+ useActiveItemTemp(nil, player, CollectibleType.COLLECTIBLE_SMELTER)
58
60
  i = i + 1
59
61
  end
60
62
  end
@@ -10,6 +10,8 @@ local ____trinketNameMap = require("maps.trinketNameMap")
10
10
  local TRINKET_NAME_MAP = ____trinketNameMap.TRINKET_NAME_MAP
11
11
  local ____entity = require("functions.entity")
12
12
  local getPickups = ____entity.getPickups
13
+ local ____player = require("functions.player")
14
+ local useActiveItemTemp = ____player.useActiveItemTemp
13
15
  local ____trinketGive = require("functions.trinketGive")
14
16
  local giveTrinketsBack = ____trinketGive.giveTrinketsBack
15
17
  local temporarilyRemoveTrinkets = ____trinketGive.temporarilyRemoveTrinkets
@@ -90,13 +92,7 @@ function ____exports.smeltTrinket(self, player, trinketType, numTrinkets)
90
92
  local i = 0
91
93
  while i < numTrinkets do
92
94
  player:AddTrinket(trinketType)
93
- player:UseActiveItem(
94
- CollectibleType.COLLECTIBLE_SMELTER,
95
- false,
96
- false,
97
- true,
98
- false
99
- )
95
+ useActiveItemTemp(nil, player, CollectibleType.COLLECTIBLE_SMELTER)
100
96
  i = i + 1
101
97
  end
102
98
  end
@@ -86,6 +86,8 @@ local sirenHelpersInit = ____sirenHelpers.sirenHelpersInit
86
86
  local ____initialized = require("initialized")
87
87
  local areFeaturesInitialized = ____initialized.areFeaturesInitialized
88
88
  local setFeaturesInitialized = ____initialized.setFeaturesInitialized
89
+ local ____patchErrorFunctions = require("patchErrorFunctions")
90
+ local patchErrorFunction = ____patchErrorFunctions.patchErrorFunction
89
91
  local ____ModUpgraded = require("types.ModUpgraded")
90
92
  local ModUpgraded = ____ModUpgraded.ModUpgraded
91
93
  function initCustomCallbacks(self, mod)
@@ -134,6 +136,7 @@ function ____exports.upgradeMod(self, modVanilla, verbose)
134
136
  if verbose == nil then
135
137
  verbose = false
136
138
  end
139
+ patchErrorFunction(nil)
137
140
  local mod = __TS__New(ModUpgraded, modVanilla, verbose)
138
141
  if not areFeaturesInitialized(nil) then
139
142
  setFeaturesInitialized(nil)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.608-dev.4",
3
+ "version": "1.2.2",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,8 +25,8 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "@zamiell/typescript-to-lua": "1.3.3-dev.1",
29
- "isaac-typescript-definitions": "^1.0.333",
28
+ "@zamiell/typescript-to-lua": "^1.4.0",
29
+ "isaac-typescript-definitions": "^1.0.334",
30
30
  "isaacscript-lint": "^1.0.79",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.11",