isaacscript-common 1.2.105 → 1.2.106

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.
@@ -17,7 +17,6 @@ local CHARACTERS_WITH_FREE_DEVIL_DEALS = ____constants.CHARACTERS_WITH_FREE_DEVI
17
17
  local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEARTS
18
18
  local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
19
19
  local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
20
- local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
21
20
  local MAX_VANILLA_CHARACTER = ____constants.MAX_VANILLA_CHARACTER
22
21
  local ____HealthType = require("types.HealthType")
23
22
  local HealthType = ____HealthType.HealthType
@@ -56,6 +55,12 @@ function ____exports.getCharacterMaxHeartContainers(self, character)
56
55
  if character == PlayerType.PLAYER_KEEPER then
57
56
  return 3
58
57
  end
58
+ if character == PlayerType.PLAYER_THEFORGOTTEN then
59
+ return 6
60
+ end
61
+ if character == PlayerType.PLAYER_THESOUL then
62
+ return 6
63
+ end
59
64
  if character == PlayerType.PLAYER_KEEPER_B then
60
65
  return 2
61
66
  end
@@ -91,15 +96,15 @@ end
91
96
  function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
92
97
  local character = player:GetPlayerType()
93
98
  repeat
94
- local ____switch66 = character
95
- local ____cond66 = ____switch66 == PlayerType.PLAYER_THESOUL
96
- if ____cond66 then
99
+ local ____switch68 = character
100
+ local ____cond68 = ____switch68 == PlayerType.PLAYER_THESOUL
101
+ if ____cond68 then
97
102
  do
98
103
  return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
99
104
  end
100
105
  end
101
- ____cond66 = ____cond66 or ____switch66 == PlayerType.PLAYER_LAZARUS2_B
102
- if ____cond66 then
106
+ ____cond68 = ____cond68 or ____switch68 == PlayerType.PLAYER_LAZARUS2_B
107
+ if ____cond68 then
103
108
  do
104
109
  return CollectibleType.COLLECTIBLE_INNER_EYE
105
110
  end
@@ -113,53 +118,56 @@ function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSo
113
118
  end
114
119
  function ____exports.getPlayerMaxHeartContainers(self, player)
115
120
  local character = player:GetPlayerType()
116
- local maxHeartContainers = ____exports.getCharacterMaxHeartContainers(nil, character)
121
+ local characterMaxHeartContainers = ____exports.getCharacterMaxHeartContainers(nil, character)
117
122
  if character == PlayerType.PLAYER_MAGDALENE and player:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT) then
118
- maxHeartContainers = maxHeartContainers + 6
123
+ local extraMaxHeartContainersFromBirthright = 6
124
+ return characterMaxHeartContainers + extraMaxHeartContainersFromBirthright
119
125
  end
120
- local numMothersKisses = player:GetTrinketMultiplier(TrinketType.TRINKET_MOTHERS_KISS)
121
- maxHeartContainers = maxHeartContainers + numMothersKisses
122
- if maxHeartContainers > MAX_PLAYER_HEART_CONTAINERS then
123
- maxHeartContainers = MAX_PLAYER_HEART_CONTAINERS
126
+ if ____exports.isKeeper(nil, player) then
127
+ local numMothersKisses = player:GetTrinketMultiplier(TrinketType.TRINKET_MOTHERS_KISS)
128
+ local hasGreedsGullet = player:HasCollectible(CollectibleType.COLLECTIBLE_GREEDS_GULLET)
129
+ local coins = player:GetNumCoins()
130
+ local greedsGulletCoinContainers = hasGreedsGullet and math.floor(coins / 25) or 0
131
+ return characterMaxHeartContainers + numMothersKisses + greedsGulletCoinContainers
124
132
  end
125
- return maxHeartContainers
133
+ return characterMaxHeartContainers
126
134
  end
127
135
  function getAdjustedPlayerName(self, player)
128
136
  local character = player:GetPlayerType()
129
137
  repeat
130
- local ____switch79 = character
131
- local ____cond79 = ____switch79 == PlayerType.PLAYER_BLUEBABY or ____switch79 == PlayerType.PLAYER_BLUEBABY_B
132
- if ____cond79 then
138
+ local ____switch81 = character
139
+ local ____cond81 = ____switch81 == PlayerType.PLAYER_BLUEBABY or ____switch81 == PlayerType.PLAYER_BLUEBABY_B
140
+ if ____cond81 then
133
141
  do
134
142
  return "Blue Baby"
135
143
  end
136
144
  end
137
- ____cond79 = ____cond79 or ____switch79 == PlayerType.PLAYER_LAZARUS2
138
- if ____cond79 then
145
+ ____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_LAZARUS2
146
+ if ____cond81 then
139
147
  do
140
148
  return "Lazarus II"
141
149
  end
142
150
  end
143
- ____cond79 = ____cond79 or ____switch79 == PlayerType.PLAYER_BLACKJUDAS
144
- if ____cond79 then
151
+ ____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_BLACKJUDAS
152
+ if ____cond81 then
145
153
  do
146
154
  return "Dark Judas"
147
155
  end
148
156
  end
149
- ____cond79 = ____cond79 or ____switch79 == PlayerType.PLAYER_JACOB
150
- if ____cond79 then
157
+ ____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_JACOB
158
+ if ____cond81 then
151
159
  do
152
160
  return "Jacob & Esau"
153
161
  end
154
162
  end
155
- ____cond79 = ____cond79 or ____switch79 == PlayerType.PLAYER_LAZARUS2_B
156
- if ____cond79 then
163
+ ____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_LAZARUS2_B
164
+ if ____cond81 then
157
165
  do
158
166
  return "Dead Tainted Lazarus"
159
167
  end
160
168
  end
161
- ____cond79 = ____cond79 or ____switch79 == PlayerType.PLAYER_JACOB2_B
162
- if ____cond79 then
169
+ ____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_JACOB2_B
170
+ if ____cond81 then
163
171
  do
164
172
  return "Dead Tainted Jacob"
165
173
  end
@@ -207,6 +215,10 @@ end
207
215
  function ____exports.isChildPlayer(self, player)
208
216
  return player.Parent ~= nil
209
217
  end
218
+ function ____exports.isKeeper(self, player)
219
+ local character = player:GetPlayerType()
220
+ return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
221
+ end
210
222
  function ____exports.isTainted(self, player)
211
223
  local character = player:GetPlayerType()
212
224
  local ____isVanillaCharacter_result_1
@@ -532,10 +544,6 @@ function ____exports.isJacobOrEsau(self, player)
532
544
  local character = player:GetPlayerType()
533
545
  return character == PlayerType.PLAYER_JACOB or character == PlayerType.PLAYER_ESAU
534
546
  end
535
- function ____exports.isKeeper(self, player)
536
- local character = player:GetPlayerType()
537
- return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
538
- end
539
547
  function ____exports.isLost(self, player)
540
548
  local character = player:GetPlayerType()
541
549
  return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
@@ -589,9 +597,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
589
597
  itemPool:RemoveCollectible(collectibleType)
590
598
  end
591
599
  repeat
592
- local ____switch125 = activeSlot
593
- local ____cond125 = ____switch125 == ActiveSlot.SLOT_PRIMARY
594
- if ____cond125 then
600
+ local ____switch127 = activeSlot
601
+ local ____cond127 = ____switch127 == ActiveSlot.SLOT_PRIMARY
602
+ if ____cond127 then
595
603
  do
596
604
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
597
605
  player:RemoveCollectible(primaryCollectibleType)
@@ -600,8 +608,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
600
608
  break
601
609
  end
602
610
  end
603
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_SECONDARY
604
- if ____cond125 then
611
+ ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_SECONDARY
612
+ if ____cond127 then
605
613
  do
606
614
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
607
615
  player:RemoveCollectible(primaryCollectibleType)
@@ -616,16 +624,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
616
624
  break
617
625
  end
618
626
  end
619
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_POCKET
620
- if ____cond125 then
627
+ ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET
628
+ if ____cond127 then
621
629
  do
622
630
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
623
631
  player:SetActiveCharge(charge, activeSlot)
624
632
  break
625
633
  end
626
634
  end
627
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.SLOT_POCKET2
628
- if ____cond125 then
635
+ ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET2
636
+ if ____cond127 then
629
637
  do
630
638
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
631
639
  break
@@ -178,9 +178,9 @@ export declare function inMegaSatanRoom(): boolean;
178
178
  */
179
179
  export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
180
180
  /**
181
- * Helper function for checking if the room room is a secret shop from the Member Card collectible.
181
+ * Helper function for checking if the room is a secret shop (from the Member Card collectible).
182
182
  *
183
- * Secret shops are simply copies of normal shops but with the backdrop of a secret room. In other
183
+ * Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other
184
184
  * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
185
185
  * the only way to detect them is by using the grid index.
186
186
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.105",
3
+ "version": "1.2.106",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",