isaacscript-common 1.2.135 → 1.2.138

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.
Files changed (43) hide show
  1. package/dist/callbacks/customRevive.lua +1 -0
  2. package/dist/callbacks/postCustomDoorEnter.d.ts +8 -0
  3. package/dist/callbacks/postCustomDoorEnter.lua +35 -0
  4. package/dist/callbacks/postPlayerChangeHealth.lua +4 -64
  5. package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +2 -0
  6. package/dist/callbacks/subscriptions/postCustomDoorEnter.lua +25 -0
  7. package/dist/constants.d.ts +5 -0
  8. package/dist/constants.lua +1 -0
  9. package/dist/features/extraConsoleCommands/commands.d.ts +250 -0
  10. package/dist/features/extraConsoleCommands/commands.lua +658 -0
  11. package/dist/features/extraConsoleCommands/init.d.ts +25 -0
  12. package/dist/features/extraConsoleCommands/init.lua +153 -0
  13. package/dist/features/extraConsoleCommands/v.d.ts +9 -0
  14. package/dist/features/extraConsoleCommands/v.lua +5 -0
  15. package/dist/functions/log.d.ts +5 -1
  16. package/dist/functions/log.lua +172 -2
  17. package/dist/functions/map.d.ts +16 -0
  18. package/dist/functions/map.lua +24 -0
  19. package/dist/functions/player.d.ts +2 -2
  20. package/dist/functions/playerHealth.d.ts +3 -0
  21. package/dist/functions/playerHealth.lua +142 -0
  22. package/dist/functions/run.d.ts +12 -0
  23. package/dist/functions/run.lua +25 -0
  24. package/dist/functions/utils.d.ts +0 -6
  25. package/dist/functions/utils.lua +0 -8
  26. package/dist/functions/vector.lua +8 -8
  27. package/dist/index.d.ts +6 -0
  28. package/dist/index.lua +46 -0
  29. package/dist/maps/cardMap.d.ts +3 -0
  30. package/dist/maps/cardMap.lua +202 -0
  31. package/dist/maps/characterMap.d.ts +3 -0
  32. package/dist/maps/characterMap.lua +90 -0
  33. package/dist/maps/pillEffectMap.d.ts +3 -0
  34. package/dist/maps/pillEffectMap.lua +88 -0
  35. package/dist/types/CallbackParametersCustom.d.ts +4 -0
  36. package/dist/types/HealthType.d.ts +4 -2
  37. package/dist/types/HealthType.lua +3 -1
  38. package/dist/types/ModCallbacksCustom.d.ts +2 -1
  39. package/dist/types/ModCallbacksCustom.lua +2 -0
  40. package/dist/types/ModUpgraded.lua +8 -0
  41. package/dist/types/PlayerIndex.d.ts +2 -2
  42. package/dist/upgradeMod.lua +3 -0
  43. package/package.json +1 -1
@@ -104,6 +104,7 @@ function playerIsAboutToDie(self, player)
104
104
  return
105
105
  end
106
106
  effects:RemoveCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK, -1)
107
+ removeAllFamiliars(nil, FamiliarVariant.ONE_UP)
107
108
  end
108
109
  )
109
110
  end
@@ -0,0 +1,8 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Helper function to spawn a custom muting all sound effects and music.
4
+ *
5
+ * Use this function to set things back to normal after having used [[`disableAllSounds`]].
6
+ *
7
+ */
8
+ export declare function spawnCustomDoor(_customDoorType: int, _anm2: string, _slot: DoorSlot): void;
@@ -0,0 +1,35 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local Set = ____lualib.Set
4
+ local __TS__New = ____lualib.__TS__New
5
+ local ____exports = {}
6
+ local hasSubscriptions, postRender
7
+ local ____exports = require("features.saveDataManager.exports")
8
+ local saveDataManager = ____exports.saveDataManager
9
+ local ____doors = require("functions.doors")
10
+ local getDoors = ____doors.getDoors
11
+ local ____postCustomDoorEnter = require("callbacks.subscriptions.postCustomDoorEnter")
12
+ local postCustomDoorEnterFire = ____postCustomDoorEnter.postCustomDoorEnterFire
13
+ local postCustomDoorEnterHasSubscriptions = ____postCustomDoorEnter.postCustomDoorEnterHasSubscriptions
14
+ function hasSubscriptions(self)
15
+ return postCustomDoorEnterHasSubscriptions(nil)
16
+ end
17
+ function postRender(self)
18
+ if not hasSubscriptions(nil) then
19
+ return
20
+ end
21
+ local doors = getDoors(nil)
22
+ if #doors == 0 then
23
+ return
24
+ end
25
+ local door = doors[1]
26
+ postCustomDoorEnterFire(nil, door)
27
+ end
28
+ local v = {run = {disableSoundSet = __TS__New(Set)}}
29
+ function ____exports.postCustomDoorEnterCallbackInit(self, mod)
30
+ saveDataManager(nil, "postCustomDoorEnter", v, hasSubscriptions)
31
+ mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
32
+ end
33
+ function ____exports.spawnCustomDoor(self, _customDoorType, _anm2, _slot)
34
+ end
35
+ return ____exports
@@ -3,16 +3,14 @@ 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, getCurrentHealthValue, v
6
+ local hasSubscriptions, postPEffectUpdateReordered, v
7
7
  local ____exports = require("features.saveDataManager.exports")
8
8
  local saveDataManager = ____exports.saveDataManager
9
9
  local ____player = require("functions.player")
10
- local getBlackHearts = ____player.getBlackHearts
11
- local getHearts = ____player.getHearts
12
10
  local getPlayerIndex = ____player.getPlayerIndex
13
- local getSoulHearts = ____player.getSoulHearts
11
+ local ____playerHealth = require("functions.playerHealth")
12
+ local getPlayerHealthType = ____playerHealth.getPlayerHealthType
14
13
  local ____utils = require("functions.utils")
15
- local ensureAllCases = ____utils.ensureAllCases
16
14
  local getEnumValues = ____utils.getEnumValues
17
15
  local ____DefaultMap = require("types.DefaultMap")
18
16
  local DefaultMap = ____DefaultMap.DefaultMap
@@ -34,7 +32,7 @@ function postPEffectUpdateReordered(self, player)
34
32
  local playerHealthMap = v.run.playersHealthMap:getAndSetDefault(playerIndex)
35
33
  for ____, healthType in ipairs(getEnumValues(nil, HealthType)) do
36
34
  local storedHealthValue = playerHealthMap:get(healthType)
37
- local currentHealthValue = getCurrentHealthValue(nil, player, healthType)
35
+ local currentHealthValue = getPlayerHealthType(nil, player, healthType)
38
36
  playerHealthMap:set(healthType, currentHealthValue)
39
37
  if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
40
38
  local amount = currentHealthValue - storedHealthValue
@@ -42,64 +40,6 @@ function postPEffectUpdateReordered(self, player)
42
40
  end
43
41
  end
44
42
  end
45
- function getCurrentHealthValue(self, player, healthType)
46
- repeat
47
- local ____switch11 = healthType
48
- local ____cond11 = ____switch11 == HealthType.RED
49
- if ____cond11 then
50
- do
51
- return getHearts(nil, player)
52
- end
53
- end
54
- ____cond11 = ____cond11 or ____switch11 == HealthType.SOUL
55
- if ____cond11 then
56
- do
57
- return getSoulHearts(nil, player)
58
- end
59
- end
60
- ____cond11 = ____cond11 or ____switch11 == HealthType.ETERNAL
61
- if ____cond11 then
62
- do
63
- return player:GetEternalHearts()
64
- end
65
- end
66
- ____cond11 = ____cond11 or ____switch11 == HealthType.BLACK
67
- if ____cond11 then
68
- do
69
- return getBlackHearts(nil, player)
70
- end
71
- end
72
- ____cond11 = ____cond11 or ____switch11 == HealthType.GOLDEN
73
- if ____cond11 then
74
- do
75
- return player:GetGoldenHearts()
76
- end
77
- end
78
- ____cond11 = ____cond11 or ____switch11 == HealthType.BONE
79
- if ____cond11 then
80
- do
81
- return player:GetBoneHearts()
82
- end
83
- end
84
- ____cond11 = ____cond11 or ____switch11 == HealthType.ROTTEN
85
- if ____cond11 then
86
- do
87
- return player:GetRottenHearts()
88
- end
89
- end
90
- ____cond11 = ____cond11 or ____switch11 == HealthType.MAX_HEARTS
91
- if ____cond11 then
92
- do
93
- return player:GetMaxHearts()
94
- end
95
- end
96
- do
97
- do
98
- return ensureAllCases(nil, healthType)
99
- end
100
- end
101
- until true
102
- end
103
43
  v = {run = {playersHealthMap = __TS__New(
104
44
  DefaultMap,
105
45
  function() return __TS__New(Map) end
@@ -0,0 +1,2 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostCustomDoorEnterCallbackType = (door: GridEntityDoor) => void;
@@ -0,0 +1,25 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local __TS__ArrayPush = ____lualib.__TS__ArrayPush
4
+ local ____exports = {}
5
+ local subscriptions = {}
6
+ function ____exports.postCustomDoorEnterHasSubscriptions(self)
7
+ return #subscriptions > 0
8
+ end
9
+ function ____exports.postCustomDoorEnterRegister(self, callback, doorVariant)
10
+ __TS__ArrayPush(subscriptions, {callback, doorVariant})
11
+ end
12
+ function ____exports.postCustomDoorEnterFire(self, door)
13
+ for ____, ____value in ipairs(subscriptions) do
14
+ local callback = ____value[1]
15
+ local doorVariant = ____value[2]
16
+ do
17
+ if doorVariant ~= nil and doorVariant ~= door:GetVariant() then
18
+ goto __continue5
19
+ end
20
+ callback(nil, door)
21
+ end
22
+ ::__continue5::
23
+ end
24
+ end
25
+ return ____exports
@@ -81,6 +81,11 @@ export declare const MAX_NUM_DOORS = 8;
81
81
  export declare const MAX_NUM_FAMILIARS = 64;
82
82
  /** The game can only handle up to four different players. */
83
83
  export declare const MAX_NUM_INPUTS = 4;
84
+ /**
85
+ * The maximum speed stat that a player can have. Any additional speed beyond this will not take
86
+ * effect.
87
+ */
88
+ export declare const MAX_SPEED_STAT = 2;
84
89
  /** With Birthright, it is possible for Magdalene to have 18 heart containers. */
85
90
  export declare const MAX_PLAYER_HEART_CONTAINERS = 18;
86
91
  export declare const MAX_PLAYER_POCKET_ITEM_SLOTS = 4;
@@ -92,6 +92,7 @@ ____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {
92
92
  ____exports.MAX_NUM_DOORS = 8
93
93
  ____exports.MAX_NUM_FAMILIARS = 64
94
94
  ____exports.MAX_NUM_INPUTS = 4
95
+ ____exports.MAX_SPEED_STAT = 2
95
96
  ____exports.MAX_PLAYER_HEART_CONTAINERS = 18
96
97
  ____exports.MAX_PLAYER_POCKET_ITEM_SLOTS = 4
97
98
  ____exports.MAX_PLAYER_SPEED_IN_UNITS = 9.8
@@ -0,0 +1,250 @@
1
+ /**
2
+ * Warps to the Angel Room for the floor. If the Devil Room has already been visited or initialized,
3
+ * this will uninitialize it and make an Angel Room instead.
4
+ */
5
+ export declare function angel(): void;
6
+ /** Activates the flags for the Ascent (i.e. Backwards Path). */
7
+ export declare function ascent(): void;
8
+ /** Alias for the "blackhearts" command. */
9
+ export declare function bh(params: string): void;
10
+ /**
11
+ * Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
12
+ * negative numbers to remove hearts.)
13
+ */
14
+ export declare function blackHearts(params: string): void;
15
+ /** Warps to the Black Market for the floor. */
16
+ export declare function blackMarket(): void;
17
+ /**
18
+ * Gives a blood charge. This only affects Bethany. Provide a number to give a custom amount of
19
+ * charges. (You can use negative numbers to remove charges.)
20
+ */
21
+ export declare function bloodCharges(params: string): void;
22
+ /**
23
+ * Gives a bomb. Provide a number to give a custom amount of bombs. (You can use negative numbers to
24
+ * remove bombs.)
25
+ */
26
+ export declare function bomb(params: string): void;
27
+ /**
28
+ * Gives 99 bombs. Provide a number to give a custom amount of bombs. (You can use negative numbers
29
+ * to remove bombs.)
30
+ */
31
+ export declare function bombs(params: string): void;
32
+ /**
33
+ * Gives a bone heart. Provide a number to give a custom amount of hearts. (You can use negative
34
+ * numbers to remove hearts.)
35
+ */
36
+ export declare function boneHearts(params: string): void;
37
+ /** Warps to the first Boss Room on the floor. */
38
+ export declare function boss(): void;
39
+ /** Alias for the "blackmarket" command. */
40
+ export declare function bm(): void;
41
+ /**
42
+ * Gives a broken heart. Provide a number to give a custom amount of hearts. (You can use negative
43
+ * numbers to remove hearts.)
44
+ */
45
+ export declare function brokenHearts(params: string): void;
46
+ /**
47
+ * Gives the specified card. Accepts either the card sub-type or the partial name of the card.
48
+ *
49
+ * Example:
50
+ * - card 5 - Gives The Emperor.
51
+ * - card spa - Gives 2 of Spades.
52
+ */
53
+ export declare function card(params: string): void;
54
+ /** Spawns every card on the ground, starting at the top-left-most tile. */
55
+ export declare function cards(): void;
56
+ /** Alias for the "chaoscardtears" command. */
57
+ export declare function cc(): void;
58
+ /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
59
+ export declare function chaosCardTears(): void;
60
+ /**
61
+ * Restart as the specified character. Accepts either the character sub-type or the partial name of
62
+ * the character.
63
+ *
64
+ * Example:
65
+ * - character 2 - Restarts as Cain.
66
+ * - character ta - Restarts as Tainted Azazel.
67
+ */
68
+ export declare function characterCommand(params: string): void;
69
+ /**
70
+ * Gives a coin. Provide a number to give a custom amount of coins. (You can use negative numbers to
71
+ * remove coins.)
72
+ */
73
+ export declare function coin(params: string): void;
74
+ /**
75
+ * Gives 999 coins. Provide a number to give a custom amount of coins. (You can use negative numbers
76
+ * to remove coins.)
77
+ */
78
+ export declare function coins(params: string): void;
79
+ /** Creates a crawlspace next to the player. */
80
+ export declare function crawlspace(): void;
81
+ /** Uses the D6. */
82
+ export declare function d6(): void;
83
+ /** Uses the D20. */
84
+ export declare function d20(): void;
85
+ /** Toggles extremely high-damage tears. */
86
+ export declare function damage(): void;
87
+ /** Alias for the "devil" command. */
88
+ export declare function dd(): void;
89
+ /**
90
+ * Warps to the Devil Room for the floor. If the Angel Room has already been visited or initialized,
91
+ * this will uninitialize it and make an Devil Room instead.
92
+ */
93
+ export declare function devil(): void;
94
+ /** Moves the player 0.5 units down. Provide a number to move a custom amount of units. */
95
+ export declare function down(params: string): void;
96
+ /** Logs the player's current temporary effects to the "log.txt" file. */
97
+ export declare function effects(): void;
98
+ /** Alias for the "eternalhearts" command. */
99
+ export declare function eh(params: string): void;
100
+ /** Alias for the "iamerror" command. */
101
+ export declare function error(): void;
102
+ /**
103
+ * Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
104
+ * numbers to remove hearts.)
105
+ */
106
+ export declare function eternalHearts(params: string): void;
107
+ /** Alias for the "startingroom" command. */
108
+ export declare function fool(): void;
109
+ /** Alias for the "goldenbomb" command. */
110
+ export declare function goldBomb(): void;
111
+ /** Gives the player a golden bomb. */
112
+ export declare function goldenBomb(): void;
113
+ /** Alias for the "goldenkey" command. */
114
+ export declare function goldKey(): void;
115
+ /** Gives the player a golden key. */
116
+ export declare function goldenKey(): void;
117
+ /** Alias for the "hearts" command. */
118
+ export declare function h(params: string): void;
119
+ /**
120
+ * Gives a half red heart. Provide a number to give a custom amount of hearts. (You can use
121
+ * negative numbers to remove hearts.)
122
+ */
123
+ export declare function hearts(params: string): void;
124
+ /** Warps to the I AM ERROR room for the floor. */
125
+ export declare function IAMERROR(): void;
126
+ /**
127
+ * Gives a key. Provide a number to give a custom amount of key. (You can use negative numbers to
128
+ * remove keys.)
129
+ */
130
+ export declare function key(params: string): void;
131
+ /**
132
+ * Gives 99 keys. Provide a number to give a custom amount of coins. (You can use negative numbers
133
+ * to remove keys.)
134
+ */
135
+ export declare function keys(params: string): void;
136
+ /**
137
+ * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
138
+ * `EntityType`.
139
+ *
140
+ * By default, this command will exclude background effects. If that is not desired, use the
141
+ * "listall" command instead.
142
+ */
143
+ export declare function list(params: string): void;
144
+ /**
145
+ * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
146
+ * `EntityType`.
147
+ */
148
+ export declare function listAll(params: string): void;
149
+ /**
150
+ * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
151
+ * specific `GridEntityType`.
152
+ *
153
+ * By default, this command will exclude walls. If that is not desired, use the "listgridall"
154
+ * command instead.
155
+ */
156
+ export declare function listGrid(params: string): void;
157
+ /**
158
+ * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
159
+ * specific `GridEntityType`.
160
+ */
161
+ export declare function listGridAll(params: string): void;
162
+ /** Sets every NPC in the room to 1 HP. */
163
+ export declare function lowHP(): void;
164
+ /** Alias for "debug 9". */
165
+ export declare function luck(): void;
166
+ /**
167
+ * Gives a heart container. Provide a number to give a custom amount of heart containers. (You can
168
+ * use negative numbers to remove heart containers.)
169
+ */
170
+ export declare function maxHearts(params: string): void;
171
+ /** Alias for the "maxhearts" command. */
172
+ export declare function mh(params: string): void;
173
+ /**
174
+ * Gives a pill with the specified pill effect. Accepts either the effect ID or the partial name of
175
+ * the effect.
176
+ *
177
+ * Example:
178
+ * - pill 5 - Gives a Full Health pill.
179
+ * - pill suns - Gives a Feels like I'm walking on sunshine! pill.
180
+ */
181
+ export declare function pill(params: string): void;
182
+ /** Spawns every pill on the ground, starting at the top-left-most tile. */
183
+ export declare function pills(): void;
184
+ /** Warps to the first Planetarium on the floor. */
185
+ export declare function planetarium(): void;
186
+ /** Sets the player's pocket item to the specified collectible type. */
187
+ export declare function pocket(params: string): void;
188
+ /** Prints the current position of all players. */
189
+ export declare function positionCommand(): void;
190
+ /** Alias for the "hearts" command. */
191
+ export declare function redHearts(params: string): void;
192
+ /** Alias for the "redhearts" command. */
193
+ export declare function rh(params: string): void;
194
+ /** Logs information about the room to the "log.txt" file. */
195
+ export declare function roomCommand(): void;
196
+ /**
197
+ * Gives a rotten heart. Provide a number to give a custom amount of hearts. (You can use negative
198
+ * numbers to remove hearts.)
199
+ */
200
+ export declare function rottenHearts(params: string): void;
201
+ /**
202
+ * Alias for the "stage" command.
203
+ *
204
+ * Example:
205
+ * - s 3 - Warps to Caves 1.
206
+ * - s 1c - Warps to Downpour 1.
207
+ */
208
+ export declare function s(params: string): void;
209
+ /** Logs all of the current run's seed effects to the "log.txt" file. */
210
+ export declare function seeds(): void;
211
+ /** Alias for the "soulhearts" command. */
212
+ export declare function sh(params: string): void;
213
+ /** Warps to the first shop on the floor. */
214
+ export declare function shop(): void;
215
+ /** Uses the Smelter to smelt the current player's trinket. */
216
+ export declare function smelt(): void;
217
+ /**
218
+ * Gives a soul charge. This only affects Tainted Bethany. Provide a number to give a custom amount
219
+ * of charges. (You can use negative numbers to remove charges.)
220
+ */
221
+ export declare function soulCharges(params: string): void;
222
+ /**
223
+ * Gives a half soul heart. Provide a number to give a custom amount of hearts. (You can use
224
+ * negative numbers to remove hearts.)
225
+ */
226
+ export declare function soulHearts(params: string): void;
227
+ /**
228
+ * Play the supplied sound effect.
229
+ *
230
+ * Example:
231
+ * - sound 1 - Plays the 1-Up sound effect.
232
+ */
233
+ export declare function sound(params: string): void;
234
+ /** Logs all of the currently playing sound effects to the "log.txt" file. */
235
+ export declare function sounds(): void;
236
+ /**
237
+ * Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
238
+ * "debug 10".
239
+ */
240
+ export declare function spam(): void;
241
+ /** Toggles maximum movement speed and flight. */
242
+ export declare function speed(): void;
243
+ /** Warps to the starting room of the floor. */
244
+ export declare function startingRoom(): void;
245
+ /** Creates a trapdoor next to the player. */
246
+ export declare function trapdoorCommand(): void;
247
+ /** Warps to the first Treasure Room on the floor. */
248
+ export declare function treasure(): void;
249
+ /** Warps to the first Ultra Secret Room on the floor. */
250
+ export declare function ultra(): void;