isaacscript-common 1.2.107 → 1.2.110

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,11 +2,13 @@
2
2
  local ____lualib = require("lualib_bundle")
3
3
  local Map = ____lualib.Map
4
4
  local __TS__New = ____lualib.__TS__New
5
+ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
6
+ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
7
+ local Set = ____lualib.Set
5
8
  local __TS__Iterator = ____lualib.__TS__Iterator
6
9
  local __TS__ArrayFind = ____lualib.__TS__ArrayFind
7
- local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
8
10
  local ____exports = {}
9
- local hasSubscriptions, postUpdate, checkPickupsPurchased, getPlayerThatIsNoLongerHoldingAnItem, storePickupsInMap, storePlayersInMap, pickupAtIndexStillExists, v
11
+ local hasSubscriptions, postUpdate, checkPickupsPurchased, getPlayerThatIsNoLongerHoldingAnItem, storePickupsInMap, storePlayersInMap, v
10
12
  local ____exports = require("features.saveDataManager.exports")
11
13
  local saveDataManager = ____exports.saveDataManager
12
14
  local ____pickups = require("functions.pickups")
@@ -14,6 +16,10 @@ local getPickups = ____pickups.getPickups
14
16
  local ____player = require("functions.player")
15
17
  local getPlayerIndex = ____player.getPlayerIndex
16
18
  local getPlayers = ____player.getPlayers
19
+ local ____DefaultMap = require("types.DefaultMap")
20
+ local DefaultMap = ____DefaultMap.DefaultMap
21
+ local ____PickupDescription = require("types.PickupDescription")
22
+ local getPickupDescription = ____PickupDescription.getPickupDescription
17
23
  local ____postPurchase = require("callbacks.subscriptions.postPurchase")
18
24
  local postPurchaseFire = ____postPurchase.postPurchaseFire
19
25
  local postPurchaseHasSubscriptions = ____postPurchase.postPurchaseHasSubscriptions
@@ -25,65 +31,64 @@ function postUpdate(self)
25
31
  return
26
32
  end
27
33
  local pickups = getPickups(nil)
34
+ local pickupsWithPrice = __TS__ArrayFilter(
35
+ pickups,
36
+ function(____, pickup) return pickup:Exists() and pickup.Price ~= 0 end
37
+ )
28
38
  local players = getPlayers(nil)
29
- checkPickupsPurchased(nil, pickups, players)
30
- storePickupsInMap(nil, pickups)
39
+ checkPickupsPurchased(nil, pickupsWithPrice, players)
40
+ storePickupsInMap(nil, pickupsWithPrice)
31
41
  storePlayersInMap(nil, players)
32
42
  end
33
- function checkPickupsPurchased(self, pickups, players)
43
+ function checkPickupsPurchased(self, nonCollectiblesWithPrice, players)
44
+ local pickupIndexes = __TS__ArrayMap(
45
+ nonCollectiblesWithPrice,
46
+ function(____, pickup) return pickup.Index end
47
+ )
48
+ local pickupIndexSet = __TS__New(Set, pickupIndexes)
34
49
  for ____, ____value in __TS__Iterator(v.room.pickupMap:entries()) do
35
50
  local index = ____value[1]
36
51
  local pickupDescription = ____value[2]
37
52
  do
38
- if pickupAtIndexStillExists(nil, index, pickups) then
39
- goto __continue7
53
+ if pickupIndexSet:has(index) then
54
+ goto __continue9
40
55
  end
41
- v.room.pickupMap:delete(index)
42
56
  local player = getPlayerThatIsNoLongerHoldingAnItem(nil, players)
43
57
  if player ~= nil then
44
58
  postPurchaseFire(nil, player, pickupDescription)
45
59
  end
46
60
  end
47
- ::__continue7::
61
+ ::__continue9::
48
62
  end
49
63
  end
50
64
  function getPlayerThatIsNoLongerHoldingAnItem(self, players)
51
65
  return __TS__ArrayFind(
52
66
  players,
53
67
  function(____, player)
54
- local playerHoldingItem = player:IsHoldingItem()
68
+ local playerHoldingItemNow = player:IsHoldingItem()
55
69
  local playerIndex = getPlayerIndex(nil, player)
56
- local playerHoldingItemLastFrame = v.room.playerHoldingItemLastFrameMap:get(playerIndex)
57
- return playerHoldingItemLastFrame == false and playerHoldingItem
70
+ local playerHoldingItemOnLastFrame = v.room.playersHoldingItemOnLastFrameMap:getAndSetDefault(playerIndex)
71
+ return not playerHoldingItemOnLastFrame and playerHoldingItemNow
58
72
  end
59
73
  )
60
74
  end
61
- function storePickupsInMap(self, pickups)
62
- local pickupsWithPrice = __TS__ArrayFilter(
63
- pickups,
64
- function(____, pickup) return pickup.Price ~= 0 end
65
- )
66
- for ____, pickup in ipairs(pickupsWithPrice) do
67
- v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subType = pickup.SubType, price = pickup.Price, initSeed = pickup.InitSeed})
75
+ function storePickupsInMap(self, nonCollectiblesWithPrice)
76
+ v.room.pickupMap:clear()
77
+ for ____, pickup in ipairs(nonCollectiblesWithPrice) do
78
+ local pickupDescription = getPickupDescription(nil, pickup)
79
+ v.room.pickupMap:set(pickup.Index, pickupDescription)
68
80
  end
69
81
  end
70
82
  function storePlayersInMap(self, players)
71
83
  for ____, player in ipairs(players) do
72
84
  local playerIndex = getPlayerIndex(nil, player)
73
85
  local holdingItem = player:IsHoldingItem()
74
- v.room.playerHoldingItemLastFrameMap:set(playerIndex, holdingItem)
86
+ v.room.playersHoldingItemOnLastFrameMap:set(playerIndex, holdingItem)
75
87
  end
76
88
  end
77
- function pickupAtIndexStillExists(self, index, pickups)
78
- local pickupAtIndex = __TS__ArrayFind(
79
- pickups,
80
- function(____, pickup) return pickup.Index end
81
- )
82
- return pickupAtIndex ~= nil and pickupAtIndex:Exists()
83
- end
84
89
  v = {room = {
85
90
  pickupMap = __TS__New(Map),
86
- playerHoldingItemLastFrameMap = __TS__New(Map)
91
+ playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false)
87
92
  }}
88
93
  function ____exports.postPurchaseCallbackInit(self, mod)
89
94
  saveDataManager(nil, "postPurchase", v, hasSubscriptions)
@@ -6,6 +6,8 @@ local ____exports = {}
6
6
  local postPickupInitCollectible, v
7
7
  local ____errors = require("errors")
8
8
  local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
9
+ local ____entity = require("functions.entity")
10
+ local getEntityID = ____entity.getEntityID
9
11
  local ____rooms = require("functions.rooms")
10
12
  local getRoomItemPoolType = ____rooms.getRoomItemPoolType
11
13
  local ____exports = require("features.saveDataManager.exports")
@@ -31,7 +33,8 @@ function ____exports.getCollectibleItemPoolType(self, collectible)
31
33
  error(msg)
32
34
  end
33
35
  if collectible.Type ~= EntityType.ENTITY_PICKUP or collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
34
- error((((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType))
36
+ local entityID = getEntityID(nil, collectible)
37
+ error("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. entityID)
35
38
  end
36
39
  local ptrHash = GetPtrHash(collectible)
37
40
  local itemPoolType = v.run.collectibleItemPoolTypeMap:get(ptrHash)
@@ -1,5 +1,7 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ import { CollectiblePedestalType } from "../types/CollectiblePedestalType";
2
3
  export declare function collectibleHasTag(collectibleType: CollectibleType | int, tag: ItemConfigTag): boolean;
4
+ export declare function clearCollectibleSprite(collectible: EntityPickup): void;
3
5
  export declare function collectibleHasCacheFlag(collectibleType: CollectibleType | int, cacheFlag: CacheFlag): boolean;
4
6
  /**
5
7
  * Helper function to get the in-game description for a collectible. Returns "Unknown" if the
@@ -47,6 +49,7 @@ export declare function getCollectibleMaxCharges(collectibleType: CollectibleTyp
47
49
  * ```
48
50
  */
49
51
  export declare function getCollectibleName(collectibleType: CollectibleType | int): string;
52
+ export declare function getCollectiblePedestalType(collectible: EntityPickup): CollectiblePedestalType;
50
53
  /** Helper function to get all of the collectible entities in the room. */
51
54
  export declare function getCollectibles(matchingSubType?: number): EntityPickup[];
52
55
  export declare function getMaxCollectibleType(): int;
@@ -55,7 +58,7 @@ export declare function getMaxCollectibleType(): int;
55
58
  * glitched items once a player has TMTRAINER. However, glitched items can also "naturally" appear
56
59
  * in secret rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
57
60
  */
58
- export declare function isGlitchedCollectible(entity: Entity): boolean;
61
+ export declare function isGlitchedCollectible(pickup: EntityPickup): boolean;
59
62
  /**
60
63
  * Returns true if the item type in the item config is equal to `ItemType.ITEM_PASSIVE` or
61
64
  * `ItemType.ITEM_FAMILIAR`.
@@ -98,24 +101,24 @@ export declare function setCollectiblesRerolledForItemTracker(): void;
98
101
  export declare function setCollectibleBlind(collectible: EntityPickup): void;
99
102
  /**
100
103
  * Helper function to remove the collectible from a collectible pedestal and make it appear as if a
101
- * player has already taken the item. This is accomplished by setting its sprite to an empty/missing
102
- * PNG file.
104
+ * player has already taken the item. This is accomplished by changing the sub-type to
105
+ * `CollectibleType.COLLECTIBLE_NULL` and then setting the sprite to an empty/missing PNG file.
103
106
  *
104
- * For more information, see the documentation for the "emptySprite" helper function.
107
+ * For more information, see the documentation for the "clearSprite" helper function.
105
108
  */
106
109
  export declare function setCollectibleEmpty(collectible: EntityPickup): void;
107
110
  /**
108
111
  * Helper function to change the sprite of a collectible pedestal entity.
109
112
  *
110
113
  * For more information about removing the collectible sprite, see the documentation for the
111
- * "emptySprite" helper function.
114
+ * "clearSprite" helper function.
112
115
  *
113
116
  * @param collectible The collectible whose sprite you want to modify.
114
- * @param pngPath Optional. Equal to the spritesheet path to load (e.g.
115
- * "gfx/items/collectibles/collectibles_001_thesadonion.png"). If not specified, will remove the
116
- * sprite, making it appear like the collectible has already been taken by the player.
117
+ * @param pngPath Equal to either the spritesheet path to load (e.g.
118
+ * "gfx/items/collectibles/collectibles_001_thesadonion.png") or undefined. If undefined, the sprite
119
+ * will be removed, making it appear like the collectible has already been taken by the player.
117
120
  */
118
- export declare function setCollectibleSprite(collectible: EntityPickup, pngPath?: string): void;
121
+ export declare function setCollectibleSprite(collectible: EntityPickup, pngPath: string | undefined): void;
119
122
  /**
120
123
  * Helper function to change the collectible on a pedestal. Simply updating the SubType property is
121
124
  * not sufficient because the sprite will not change.
@@ -38,6 +38,9 @@ function ____exports.collectibleHasTag(self, collectibleType, tag)
38
38
  end
39
39
  return itemConfigItem:HasTags(tag)
40
40
  end
41
+ function ____exports.clearCollectibleSprite(self, collectible)
42
+ ____exports.setCollectibleSprite(nil, collectible, nil)
43
+ end
41
44
  function ____exports.collectibleHasCacheFlag(self, collectibleType, cacheFlag)
42
45
  local itemConfig = Isaac.GetItemConfig()
43
46
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
@@ -135,6 +138,13 @@ function ____exports.getCollectibleName(self, collectibleType)
135
138
  end
136
139
  return itemConfigItem.Name
137
140
  end
141
+ function ____exports.getCollectiblePedestalType(self, collectible)
142
+ if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
143
+ error("You cannot get the pedestal type for pickups of variant: " .. tostring(collectible.Variant))
144
+ end
145
+ local sprite = collectible:GetSprite()
146
+ return sprite:GetOverlayFrame()
147
+ end
138
148
  function ____exports.getCollectibles(self, matchingSubType)
139
149
  if matchingSubType == nil then
140
150
  matchingSubType = -1
@@ -145,8 +155,8 @@ function ____exports.getMaxCollectibleType(self)
145
155
  local itemConfig = Isaac.GetItemConfig()
146
156
  return itemConfig:GetCollectibles().Size - 1
147
157
  end
148
- function ____exports.isGlitchedCollectible(self, entity)
149
- return entity.Type == EntityType.ENTITY_PICKUP and entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and entity.SubType > GLITCHED_ITEM_THRESHOLD
158
+ function ____exports.isGlitchedCollectible(self, pickup)
159
+ return pickup.Variant == PickupVariant.PICKUP_COLLECTIBLE and pickup.SubType > GLITCHED_ITEM_THRESHOLD
150
160
  end
151
161
  function ____exports.isPassiveCollectible(self, collectibleType)
152
162
  local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
@@ -185,7 +195,7 @@ function ____exports.setCollectibleEmpty(self, collectible)
185
195
  error("You cannot set a collectible to be empty for pickups of variant: " .. tostring(collectible.Variant))
186
196
  end
187
197
  collectible.SubType = CollectibleType.COLLECTIBLE_NULL
188
- ____exports.setCollectibleSprite(nil, collectible)
198
+ ____exports.clearCollectibleSprite(nil, collectible)
189
199
  end
190
200
  function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
191
201
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
@@ -53,6 +53,8 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
53
53
  * returned. False by default. Will only be taken into account if `matchingEntityType` is specified.
54
54
  */
55
55
  export declare function getEntities(matchingEntityType?: EntityType | int, matchingVariant?: number, matchingSubType?: number, ignoreFriendly?: boolean): Entity[];
56
+ /** Helper function to return a string containing an entity's type, variant, and sub-type. */
57
+ export declare function getEntityID(entity: Entity): string;
56
58
  /**
57
59
  * Helper function to measure an entity's velocity to see if it is moving.
58
60
  *
@@ -88,6 +88,9 @@ function ____exports.getEntities(self, matchingEntityType, matchingVariant, matc
88
88
  end
89
89
  return Isaac.FindByType(matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
90
90
  end
91
+ function ____exports.getEntityID(self, entity)
92
+ return (((tostring(entity.Type) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
93
+ end
91
94
  function ____exports.isEntityMoving(self, entity, threshold)
92
95
  if threshold == nil then
93
96
  threshold = 0.01
@@ -13,3 +13,12 @@
13
13
  * Tainted Keeper. False by default.
14
14
  */
15
15
  export declare function spawnCollectible(collectibleType: CollectibleType | int, position: Vector, seed?: number, options?: boolean, forceFreeItem?: boolean): EntityPickup;
16
+ /**
17
+ * Helper function to spawn an empty collectible. Doing this is tricky since spawning a collectible
18
+ * with `CollectibleType.COLLECTIBLE_NULL` will result in spawning a collectible with a random type
19
+ * from the current room's item pool.
20
+ *
21
+ * Instead, this function arbitrarily spawns a collectible with
22
+ * `CollectibleType.COLLECTIBLE_SAD_ONION`, and then converts it to an empty pedestal afterward.
23
+ */
24
+ export declare function spawnEmptyCollectible(position: Vector, seed?: number): void;
@@ -6,6 +6,7 @@ local ____featuresInitialized = require("featuresInitialized")
6
6
  local areFeaturesInitialized = ____featuresInitialized.areFeaturesInitialized
7
7
  local ____collectibles = require("functions.collectibles")
8
8
  local isQuestCollectible = ____collectibles.isQuestCollectible
9
+ local setCollectibleEmpty = ____collectibles.setCollectibleEmpty
9
10
  local ____player = require("functions.player")
10
11
  local anyPlayerIs = ____player.anyPlayerIs
11
12
  function ____exports.spawnCollectible(self, collectibleType, position, seed, options, forceFreeItem)
@@ -46,4 +47,18 @@ function ____exports.spawnCollectible(self, collectibleType, position, seed, opt
46
47
  end
47
48
  return collectible
48
49
  end
50
+ function ____exports.spawnEmptyCollectible(self, position, seed)
51
+ if seed == nil then
52
+ seed = Random()
53
+ end
54
+ local collectible = ____exports.spawnCollectible(
55
+ nil,
56
+ CollectibleType.COLLECTIBLE_SAD_ONION,
57
+ position,
58
+ seed,
59
+ false,
60
+ true
61
+ )
62
+ setCollectibleEmpty(nil, collectible)
63
+ end
49
64
  return ____exports
package/dist/index.lua CHANGED
@@ -674,6 +674,14 @@ do
674
674
  end
675
675
  end
676
676
  end
677
+ do
678
+ local ____export = require("types.PickupDescription")
679
+ for ____exportKey, ____exportValue in pairs(____export) do
680
+ if ____exportKey ~= "default" then
681
+ ____exports[____exportKey] = ____exportValue
682
+ end
683
+ end
684
+ end
677
685
  do
678
686
  local ____export = require("types.PillEffectClass")
679
687
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -0,0 +1,38 @@
1
+ /** Corresponds to the overlay frame number in "005.100_collectible.anm2". */
2
+ export declare enum CollectiblePedestalType {
3
+ /**
4
+ * Used for e.g. shop collectibles. In the "005.100_collectible.anm2" file, this is represented by
5
+ * the final frame.
6
+ */
7
+ NONE = -1,
8
+ /** The normal grey pedestal. */
9
+ NORMAL = 0,
10
+ /** From SlotVariant.FORTUNE_TELLING_MACHINE (3) */
11
+ FORTUNE_TELLING_MACHINE = 1,
12
+ /** From SlotVariant.BLOOD_DONATION_MACHINE (2) */
13
+ BLOOD_DONATION_MACHINE = 2,
14
+ /** From SlotVariant.SLOT_MACHINE (1) */
15
+ SLOT_MACHINE = 3,
16
+ /** From PickupVariant.LOCKEDCHEST (60) */
17
+ LOCKEDCHEST = 4,
18
+ /** From PickupVariant.PICKUP_REDCHEST (360) */
19
+ REDCHEST = 5,
20
+ /** From PickupVariant.PICKUP_BOMBCHEST (51) */
21
+ BOMBCHEST = 6,
22
+ /** From PickupVariant.PICKUP_SPIKEDCHEST (52) */
23
+ SPIKEDCHEST = 7,
24
+ /** From PickupVariant.PICKUP_ETERNALCHEST (53) */
25
+ ETERNALCHEST = 8,
26
+ /** From SlotVariant.MOMS_DRESSING_TABLE (12) */
27
+ MOMS_DRESSING_TABLE = 9,
28
+ /** From PickupVariant.PICKUP_CHEST (50) */
29
+ CHEST = 10,
30
+ /** From PickupVariant.PICKUP_MOMSCHEST (390) */
31
+ MOMSCHEST = 11,
32
+ /** From PickupVariant.PICKUP_OLDCHEST (55) */
33
+ OLDCHEST = 12,
34
+ /** From PickupVariant.PICKUP_WOODENCHEST (56) */
35
+ WOODENCHEST = 13,
36
+ /** From PickupVariant.PICKUP_MEGACHEST (57) */
37
+ MEGACHEST = 14
38
+ }
@@ -0,0 +1,36 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ ____exports.CollectiblePedestalType = CollectiblePedestalType or ({})
4
+ ____exports.CollectiblePedestalType.NONE = -1
5
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.NONE] = "NONE"
6
+ ____exports.CollectiblePedestalType.NORMAL = 0
7
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.NORMAL] = "NORMAL"
8
+ ____exports.CollectiblePedestalType.FORTUNE_TELLING_MACHINE = 1
9
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.FORTUNE_TELLING_MACHINE] = "FORTUNE_TELLING_MACHINE"
10
+ ____exports.CollectiblePedestalType.BLOOD_DONATION_MACHINE = 2
11
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.BLOOD_DONATION_MACHINE] = "BLOOD_DONATION_MACHINE"
12
+ ____exports.CollectiblePedestalType.SLOT_MACHINE = 3
13
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.SLOT_MACHINE] = "SLOT_MACHINE"
14
+ ____exports.CollectiblePedestalType.LOCKEDCHEST = 4
15
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.LOCKEDCHEST] = "LOCKEDCHEST"
16
+ ____exports.CollectiblePedestalType.REDCHEST = 5
17
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.REDCHEST] = "REDCHEST"
18
+ ____exports.CollectiblePedestalType.BOMBCHEST = 6
19
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.BOMBCHEST] = "BOMBCHEST"
20
+ ____exports.CollectiblePedestalType.SPIKEDCHEST = 7
21
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.SPIKEDCHEST] = "SPIKEDCHEST"
22
+ ____exports.CollectiblePedestalType.ETERNALCHEST = 8
23
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.ETERNALCHEST] = "ETERNALCHEST"
24
+ ____exports.CollectiblePedestalType.MOMS_DRESSING_TABLE = 9
25
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.MOMS_DRESSING_TABLE] = "MOMS_DRESSING_TABLE"
26
+ ____exports.CollectiblePedestalType.CHEST = 10
27
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.CHEST] = "CHEST"
28
+ ____exports.CollectiblePedestalType.MOMSCHEST = 11
29
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.MOMSCHEST] = "MOMSCHEST"
30
+ ____exports.CollectiblePedestalType.OLDCHEST = 12
31
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.OLDCHEST] = "OLDCHEST"
32
+ ____exports.CollectiblePedestalType.WOODENCHEST = 13
33
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.WOODENCHEST] = "WOODENCHEST"
34
+ ____exports.CollectiblePedestalType.MEGACHEST = 14
35
+ ____exports.CollectiblePedestalType[____exports.CollectiblePedestalType.MEGACHEST] = "MEGACHEST"
36
+ return ____exports
@@ -2,6 +2,9 @@
2
2
  export interface PickupDescription {
3
3
  variant: PickupVariant | int;
4
4
  subType: int;
5
+ position: Vector;
6
+ velocity: Vector;
5
7
  price: int;
6
8
  initSeed: int;
7
9
  }
10
+ export declare function getPickupDescription(pickup: EntityPickup): PickupDescription;
@@ -1,3 +1,13 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
+ function ____exports.getPickupDescription(self, pickup)
4
+ return {
5
+ variant = pickup.Variant,
6
+ subType = pickup.SubType,
7
+ position = pickup.Position,
8
+ velocity = pickup.Velocity,
9
+ price = pickup.Price,
10
+ initSeed = pickup.InitSeed
11
+ }
12
+ end
3
13
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.107",
3
+ "version": "1.2.110",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",