isaacscript-common 1.2.255 → 1.2.256

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.
@@ -3,6 +3,11 @@
3
3
  export declare function getBatteries(matchingSubType?: number): EntityPickup[];
4
4
  /** Helper function to get all of the card entities in the room. */
5
5
  export declare function getCards(matchingSubType?: number): EntityPickup[];
6
+ /**
7
+ * Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
8
+ * sub-types.
9
+ */
10
+ export declare function getCoinValue(coinSubType: CoinSubType): int;
6
11
  /** Helper function to get all of the coin pickup entities in the room. */
7
12
  export declare function getCoins(matchingSubType?: number): EntityPickup[];
8
13
  /** Helper function to get all of the collectible entities in the room. */
@@ -3,6 +3,9 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
3
3
  local ____exports = {}
4
4
  local ____constants = require("constants")
5
5
  local VectorZero = ____constants.VectorZero
6
+ local ____coinSubTypeToValue = require("objects.coinSubTypeToValue")
7
+ local COIN_SUBTYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUBTYPE_TO_VALUE
8
+ local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
6
9
  local ____chestPickupVariantsSet = require("sets.chestPickupVariantsSet")
7
10
  local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
8
11
  local ____redHeartSubTypesSet = require("sets.redHeartSubTypesSet")
@@ -23,6 +26,10 @@ function ____exports.getCards(self, matchingSubType)
23
26
  end
24
27
  return getPickups(nil, 300, matchingSubType)
25
28
  end
29
+ function ____exports.getCoinValue(self, coinSubType)
30
+ local value = COIN_SUBTYPE_TO_VALUE[coinSubType]
31
+ return value == nil and DEFAULT_COIN_VALUE or value
32
+ end
26
33
  function ____exports.getCoins(self, matchingSubType)
27
34
  if matchingSubType == nil then
28
35
  matchingSubType = -1
@@ -0,0 +1,5 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare const DEFAULT_COIN_VALUE = 1;
3
+ export declare const COIN_SUBTYPE_TO_VALUE: {
4
+ readonly [key in CoinSubType]: int;
5
+ };
@@ -0,0 +1,13 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ ____exports.DEFAULT_COIN_VALUE = 1
4
+ ____exports.COIN_SUBTYPE_TO_VALUE = {
5
+ [CoinSubType.COIN_PENNY] = 1,
6
+ [CoinSubType.COIN_NICKEL] = 5,
7
+ [CoinSubType.COIN_DIME] = 10,
8
+ [CoinSubType.COIN_DOUBLEPACK] = 2,
9
+ [CoinSubType.COIN_LUCKYPENNY] = 1,
10
+ [CoinSubType.COIN_STICKYNICKEL] = 5,
11
+ [CoinSubType.COIN_GOLDEN] = 1
12
+ }
13
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.255",
3
+ "version": "1.2.256",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",