isaacscript-common 1.2.53 → 1.2.54

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,7 +3,7 @@ local ____lualib = require("lualib_bundle")
3
3
  local Map = ____lualib.Map
4
4
  local __TS__New = ____lualib.__TS__New
5
5
  local ____exports = {}
6
- local hasSubscriptions, postPEffectUpdateReordered, queueEmpty, queueNotEmpty, getPickingUpItemForPlayer, v
6
+ local hasSubscriptions, postPEffectUpdateReordered, queueEmpty, resetPickingUpItem, queueNotEmpty, getPickingUpItemForPlayer, v
7
7
  local ____exports = require("features.saveDataManager.exports")
8
8
  local saveDataManager = ____exports.saveDataManager
9
9
  local ____player = require("functions.player")
@@ -31,20 +31,32 @@ function postPEffectUpdateReordered(self, player)
31
31
  end
32
32
  end
33
33
  function queueEmpty(self, player, pickingUpItem)
34
- if pickingUpItem.id ~= CollectibleType.COLLECTIBLE_NULL then
35
- postItemPickupFire(nil, player, pickingUpItem)
36
- pickingUpItem.id = CollectibleType.COLLECTIBLE_NULL
37
- pickingUpItem.type = ItemType.ITEM_NULL
34
+ if pickingUpItem.subType == CollectibleType.COLLECTIBLE_NULL then
35
+ return
36
+ end
37
+ postItemPickupFire(nil, player, pickingUpItem)
38
+ resetPickingUpItem(nil, pickingUpItem)
39
+ local character = player:GetPlayerType()
40
+ if character == PlayerType.PLAYER_THEFORGOTTEN then
41
+ local theSoul = player:GetSubPlayer()
42
+ if theSoul ~= nil then
43
+ local theSoulPickingUpItem = getPickingUpItemForPlayer(nil, theSoul)
44
+ resetPickingUpItem(nil, theSoulPickingUpItem)
45
+ end
38
46
  end
39
47
  end
48
+ function resetPickingUpItem(self, pickingUpItem)
49
+ pickingUpItem.itemType = ItemType.ITEM_NULL
50
+ pickingUpItem.subType = CollectibleType.COLLECTIBLE_NULL
51
+ end
40
52
  function queueNotEmpty(self, player, pickingUpItem)
41
53
  local queuedItem = player.QueuedItem.Item
42
54
  if queuedItem == nil then
43
55
  return
44
56
  end
45
- if queuedItem.Type ~= pickingUpItem.type or queuedItem.ID ~= pickingUpItem.id then
46
- pickingUpItem.type = queuedItem.Type
47
- pickingUpItem.id = queuedItem.ID
57
+ if queuedItem.Type ~= pickingUpItem.itemType or queuedItem.ID ~= pickingUpItem.subType then
58
+ pickingUpItem.itemType = queuedItem.Type
59
+ pickingUpItem.subType = queuedItem.ID
48
60
  preItemPickupFire(nil, player, pickingUpItem)
49
61
  end
50
62
  end
@@ -52,7 +64,7 @@ function getPickingUpItemForPlayer(self, player)
52
64
  local index = getPlayerIndex(nil, player)
53
65
  local pickingUpItem = v.run.pickingUpItem:get(index)
54
66
  if pickingUpItem == nil then
55
- pickingUpItem = {id = CollectibleType.COLLECTIBLE_NULL, type = ItemType.ITEM_NULL}
67
+ pickingUpItem = {itemType = ItemType.ITEM_NULL, subType = CollectibleType.COLLECTIBLE_NULL}
56
68
  v.run.pickingUpItem:set(index, pickingUpItem)
57
69
  end
58
70
  return pickingUpItem
@@ -15,10 +15,10 @@ function ____exports.postItemPickupFire(self, player, pickingUpItem)
15
15
  local itemType = ____value[2]
16
16
  local itemID = ____value[3]
17
17
  do
18
- if itemType ~= nil and itemType ~= pickingUpItem.type then
18
+ if itemType ~= nil and itemType ~= pickingUpItem.itemType then
19
19
  goto __continue5
20
20
  end
21
- if itemID ~= nil and itemID ~= pickingUpItem.id then
21
+ if itemID ~= nil and itemID ~= pickingUpItem.subType then
22
22
  goto __continue5
23
23
  end
24
24
  callback(nil, player, pickingUpItem)
@@ -15,10 +15,10 @@ function ____exports.preItemPickupFire(self, player, pickingUpItem)
15
15
  local itemType = ____value[2]
16
16
  local itemID = ____value[3]
17
17
  do
18
- if itemType ~= nil and itemType ~= pickingUpItem.type then
18
+ if itemType ~= nil and itemType ~= pickingUpItem.itemType then
19
19
  goto __continue5
20
20
  end
21
- if itemID ~= nil and itemID ~= pickingUpItem.id then
21
+ if itemID ~= nil and itemID ~= pickingUpItem.subType then
22
22
  goto __continue5
23
23
  end
24
24
  callback(nil, player, pickingUpItem)
@@ -1,6 +1,7 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export interface PickingUpItem {
3
3
  /** Needed so that we can distinguish between picking up a collectible and a trinket. */
4
- type: ItemType;
5
- id: int;
4
+ itemType: ItemType;
5
+ /** Equal to either the collectible type or the trinket type. */
6
+ subType: CollectibleType | TrinketType | int;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",