isaacscript-common 1.2.134 → 1.2.137

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 (38) hide show
  1. package/dist/callbacks/customRevive.lua +24 -0
  2. package/dist/callbacks/postCustomDoorEnter.d.ts +8 -0
  3. package/dist/callbacks/postCustomDoorEnter.lua +35 -0
  4. package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +2 -0
  5. package/dist/callbacks/subscriptions/postCustomDoorEnter.lua +25 -0
  6. package/dist/constants.d.ts +5 -0
  7. package/dist/constants.lua +1 -0
  8. package/dist/features/extraConsoleCommands/commands.d.ts +162 -0
  9. package/dist/features/extraConsoleCommands/commands.lua +530 -0
  10. package/dist/features/extraConsoleCommands/init.d.ts +25 -0
  11. package/dist/features/extraConsoleCommands/init.lua +133 -0
  12. package/dist/features/extraConsoleCommands/v.d.ts +9 -0
  13. package/dist/features/extraConsoleCommands/v.lua +5 -0
  14. package/dist/functions/log.d.ts +5 -1
  15. package/dist/functions/log.lua +172 -2
  16. package/dist/functions/map.d.ts +16 -0
  17. package/dist/functions/map.lua +24 -0
  18. package/dist/functions/player.d.ts +1 -1
  19. package/dist/functions/run.d.ts +12 -0
  20. package/dist/functions/run.lua +25 -0
  21. package/dist/functions/utils.d.ts +0 -6
  22. package/dist/functions/utils.lua +0 -8
  23. package/dist/functions/vector.lua +8 -8
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.lua +46 -0
  26. package/dist/maps/cardMap.d.ts +3 -0
  27. package/dist/maps/cardMap.lua +202 -0
  28. package/dist/maps/characterMap.d.ts +3 -0
  29. package/dist/maps/characterMap.lua +90 -0
  30. package/dist/maps/pillEffectMap.d.ts +3 -0
  31. package/dist/maps/pillEffectMap.lua +88 -0
  32. package/dist/types/CallbackParametersCustom.d.ts +4 -0
  33. package/dist/types/ModCallbacksCustom.d.ts +2 -1
  34. package/dist/types/ModCallbacksCustom.lua +2 -0
  35. package/dist/types/ModUpgraded.lua +8 -0
  36. package/dist/types/PlayerIndex.d.ts +2 -2
  37. package/dist/upgradeMod.lua +3 -0
  38. package/package.json +1 -1
@@ -3,6 +3,8 @@ local ____exports = {}
3
3
  local hasSubscriptions, postRender, postPEffectUpdateReordered, checkWaitingForItemAnimation, postPlayerFatalDamage, preBerserkDeath, playerIsAboutToDie, CustomReviveState, v
4
4
  local ____cachedClasses = require("cachedClasses")
5
5
  local sfxManager = ____cachedClasses.sfxManager
6
+ local ____runInNFrames = require("features.runInNFrames")
7
+ local runNextGameFrame = ____runInNFrames.runNextGameFrame
6
8
  local ____exports = require("features.saveDataManager.exports")
7
9
  local saveDataManager = ____exports.saveDataManager
8
10
  local ____collectibles = require("functions.collectibles")
@@ -10,6 +12,7 @@ local removeCollectibleFromItemTracker = ____collectibles.removeCollectibleFromI
10
12
  local ____familiars = require("functions.familiars")
11
13
  local removeAllFamiliars = ____familiars.removeAllFamiliars
12
14
  local ____player = require("functions.player")
15
+ local getPlayerFromIndex = ____player.getPlayerFromIndex
13
16
  local getPlayerIndex = ____player.getPlayerIndex
14
17
  local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
15
18
  local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
@@ -83,6 +86,27 @@ function playerIsAboutToDie(self, player)
83
86
  player:AddCollectible(CollectibleType.COLLECTIBLE_1UP, 0, false)
84
87
  removeAllFamiliars(nil, FamiliarVariant.ONE_UP)
85
88
  removeCollectibleFromItemTracker(nil, CollectibleType.COLLECTIBLE_1UP)
89
+ local character = player:GetPlayerType()
90
+ if character ~= PlayerType.PLAYER_SAMSON_B then
91
+ return
92
+ end
93
+ local playerIndex = getPlayerIndex(nil, player)
94
+ runNextGameFrame(
95
+ nil,
96
+ function()
97
+ local taintedSamson = getPlayerFromIndex(nil, playerIndex)
98
+ if taintedSamson == nil then
99
+ return
100
+ end
101
+ local effects = player:GetEffects()
102
+ local isBerserk = effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK)
103
+ if not isBerserk then
104
+ return
105
+ end
106
+ effects:RemoveCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK, -1)
107
+ removeAllFamiliars(nil, FamiliarVariant.ONE_UP)
108
+ end
109
+ )
86
110
  end
87
111
  CustomReviveState = CustomReviveState or ({})
88
112
  CustomReviveState.DISABLED = 0
@@ -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
@@ -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,162 @@
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
+ /** Warps to the Black Market for the floor. */
9
+ export declare function blackMarket(): void;
10
+ /** Gives a bomb. Provide a number to give a custom amount of bombs. */
11
+ export declare function bomb(params: string): void;
12
+ /** Gives 99 bombs. */
13
+ export declare function bombs(): void;
14
+ /** Warps to the first Boss Room on the floor. */
15
+ export declare function boss(): void;
16
+ /** Alias for the "blackmarket" command. */
17
+ export declare function bm(): void;
18
+ /**
19
+ * Gives the specified card. Accepts either the card sub-type or the partial name of the card.
20
+ *
21
+ * Example:
22
+ * - card 5 - Gives The Emperor.
23
+ * - card spa - Gives 2 of Spades.
24
+ */
25
+ export declare function card(params: string): void;
26
+ /** Spawns every card on the ground, starting at the top-left-most tile. */
27
+ export declare function cards(): void;
28
+ /** Alias for the "chaoscardtears" command. */
29
+ export declare function cc(): void;
30
+ /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
31
+ export declare function chaosCardTears(): void;
32
+ /**
33
+ * Restart as the specified character. Accepts either the character sub-type or the partial name of
34
+ * the character.
35
+ *
36
+ * Example:
37
+ * - character 2 - Restarts as Cain.
38
+ * - character ta - Restarts as Tainted Azazel.
39
+ */
40
+ export declare function characterCommand(params: string): void;
41
+ /** Gives a coin. Provide a number to give a custom amount of coins. */
42
+ export declare function coin(params: string): void;
43
+ /** Gives 999 coins. */
44
+ export declare function coins(): void;
45
+ /** Creates a crawlspace next to the player. */
46
+ export declare function crawlspace(): void;
47
+ /** Toggles extremely high-damage tears. */
48
+ export declare function damage(): void;
49
+ /** Alias for the "devil" command. */
50
+ export declare function dd(): void;
51
+ /**
52
+ * Warps to the Devil Room for the floor. If the Angel Room has already been visited or initialized,
53
+ * this will uninitialize it and make an Devil Room instead.
54
+ */
55
+ export declare function devil(): void;
56
+ /** Moves the player 0.5 units down. Provide a number to move a custom amount of units. */
57
+ export declare function down(params: string): void;
58
+ /** Logs the player's current temporary effects to the "log.txt" file. */
59
+ export declare function effects(): void;
60
+ /** Alias for the "iamerror" command. */
61
+ export declare function error(): void;
62
+ /** Alias for the "startingroom" command. */
63
+ export declare function fool(): void;
64
+ /** Alias for the "goldenbomb" command. */
65
+ export declare function goldBomb(): void;
66
+ /** Gives the player a golden bomb. */
67
+ export declare function goldenBomb(): void;
68
+ /** Alias for the "goldenkey" command. */
69
+ export declare function goldKey(): void;
70
+ /** Gives the player a golden key. */
71
+ export declare function goldenKey(): void;
72
+ /** Warps to the I AM ERROR room for the floor. */
73
+ export declare function IAMERROR(): void;
74
+ /** Gives a key. Provide a number to give a custom amount of key. */
75
+ export declare function key(params: string): void;
76
+ /** Gives 99 keys. */
77
+ export declare function keys(): void;
78
+ /**
79
+ * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
80
+ * `EntityType`.
81
+ *
82
+ * By default, this command will exclude background effects. If that is not desired, use the
83
+ * "listall" command instead.
84
+ */
85
+ export declare function list(params: string): void;
86
+ /**
87
+ * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
88
+ * `EntityType`.
89
+ */
90
+ export declare function listAll(params: string): void;
91
+ /**
92
+ * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
93
+ * specific `GridEntityType`.
94
+ *
95
+ * By default, this command will exclude walls. If that is not desired, use the "listgridall"
96
+ * command instead.
97
+ */
98
+ export declare function listGrid(params: string): void;
99
+ /**
100
+ * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
101
+ * specific `GridEntityType`.
102
+ */
103
+ export declare function listGridAll(params: string): void;
104
+ /** Sets every NPC in the room to 1 HP. */
105
+ export declare function lowHP(): void;
106
+ /** Alias for "debug 9". */
107
+ export declare function luck(): void;
108
+ /**
109
+ * Gives a pill with the specified pill effect. Accepts either the effect ID or the partial name of
110
+ * the effect.
111
+ *
112
+ * Example:
113
+ * - pill 5 - Gives a Full Health pill.
114
+ * - pill suns - Gives a Feels like I'm walking on sunshine! pill.
115
+ */
116
+ export declare function pill(params: string): void;
117
+ /** Spawns every pill on the ground, starting at the top-left-most tile. */
118
+ export declare function pills(): void;
119
+ /** Warps to the first Planetarium on the floor. */
120
+ export declare function planetarium(): void;
121
+ /** Sets the player's pocket item to the specified collectible type. */
122
+ export declare function pocket(params: string): void;
123
+ /** Prints the current position of all players. */
124
+ export declare function positionCommand(): void;
125
+ /** Logs information about the room to the "log.txt" file. */
126
+ export declare function roomCommand(): void;
127
+ /**
128
+ * Alias for the "stage" command.
129
+ *
130
+ * Example:
131
+ * - s 3 - Warps to Caves 1.
132
+ * - s 1c - Warps to Downpour 1.
133
+ */
134
+ export declare function s(params: string): void;
135
+ /** Logs all of the current run's seed effects to the "log.txt" file. */
136
+ export declare function seeds(): void;
137
+ /** Warps to the first shop on the floor. */
138
+ export declare function shop(): void;
139
+ /**
140
+ * Play the supplied sound effect.
141
+ *
142
+ * Example:
143
+ * - sound 1 - Plays the 1-Up sound effect.
144
+ */
145
+ export declare function sound(params: string): void;
146
+ /** Logs all of the currently playing sound effects to the "log.txt" file. */
147
+ export declare function sounds(): void;
148
+ /**
149
+ * Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
150
+ * "debug 10".
151
+ */
152
+ export declare function spam(): void;
153
+ /** Toggles maximum movement speed and flight. */
154
+ export declare function speed(): void;
155
+ /** Warps to the starting room of the floor. */
156
+ export declare function startingRoom(): void;
157
+ /** Creates a trapdoor next to the player. */
158
+ export declare function trapdoorCommand(): void;
159
+ /** Warps to the first Treasure Room on the floor. */
160
+ export declare function treasure(): void;
161
+ /** Warps to the first Ultra Secret Room on the floor. */
162
+ export declare function ultra(): void;