isaacscript-common 1.2.136 → 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.
- package/dist/callbacks/postCustomDoorEnter.d.ts +8 -0
- package/dist/callbacks/postCustomDoorEnter.lua +35 -0
- package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +2 -0
- package/dist/callbacks/subscriptions/postCustomDoorEnter.lua +25 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.lua +1 -0
- package/dist/features/extraConsoleCommands/commands.d.ts +162 -0
- package/dist/features/extraConsoleCommands/commands.lua +530 -0
- package/dist/features/extraConsoleCommands/init.d.ts +25 -0
- package/dist/features/extraConsoleCommands/init.lua +133 -0
- package/dist/features/extraConsoleCommands/v.d.ts +9 -0
- package/dist/features/extraConsoleCommands/v.lua +5 -0
- package/dist/functions/log.d.ts +5 -1
- package/dist/functions/log.lua +172 -2
- package/dist/functions/map.d.ts +16 -0
- package/dist/functions/map.lua +24 -0
- package/dist/functions/run.d.ts +12 -0
- package/dist/functions/run.lua +25 -0
- package/dist/functions/utils.d.ts +0 -6
- package/dist/functions/utils.lua +0 -8
- package/dist/functions/vector.lua +8 -8
- package/dist/index.d.ts +6 -0
- package/dist/index.lua +46 -0
- package/dist/maps/cardMap.d.ts +3 -0
- package/dist/maps/cardMap.lua +202 -0
- package/dist/maps/characterMap.d.ts +3 -0
- package/dist/maps/characterMap.lua +90 -0
- package/dist/maps/pillEffectMap.d.ts +3 -0
- package/dist/maps/pillEffectMap.lua +88 -0
- package/dist/types/CallbackParametersCustom.d.ts +4 -0
- package/dist/types/ModCallbacksCustom.d.ts +2 -1
- package/dist/types/ModCallbacksCustom.lua +2 -0
- package/dist/types/ModUpgraded.lua +8 -0
- package/dist/types/PlayerIndex.d.ts +2 -2
- package/dist/upgradeMod.lua +3 -0
- package/package.json +1 -1
package/dist/functions/log.d.ts
CHANGED
|
@@ -36,11 +36,15 @@ export declare function logAllUseFlags(this: void, _flags: int): void;
|
|
|
36
36
|
export declare function logArray<T>(this: void, array: T[]): void;
|
|
37
37
|
export declare function logColor(this: void, color: Color): void;
|
|
38
38
|
export declare function logEntity(this: void, entity: Entity): void;
|
|
39
|
+
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
|
|
40
|
+
export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType | int): void;
|
|
39
41
|
export declare function logKColor(this: void, kColor: KColor): void;
|
|
40
42
|
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
|
|
41
43
|
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
42
|
-
/** Helper function for
|
|
44
|
+
/** Helper function for logging information about the current room. */
|
|
43
45
|
export declare function logRoom(this: void): void;
|
|
46
|
+
/** Helper function for logging every sound effect that is currently playing. */
|
|
47
|
+
export declare function logSounds(this: void): void;
|
|
44
48
|
export declare function logTable(this: void, table: unknown, parentTables?: number): void;
|
|
45
49
|
export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
|
|
46
50
|
export declare function logSet(this: void, set: Set<AnyNotNil>): void;
|
package/dist/functions/log.lua
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local Set = ____lualib.Set
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
3
6
|
local Map = ____lualib.Map
|
|
4
7
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
5
8
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
6
|
-
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
7
|
-
local Set = ____lualib.Set
|
|
8
9
|
local ____exports = {}
|
|
9
10
|
local ____cachedClasses = require("cachedClasses")
|
|
10
11
|
local game = ____cachedClasses.game
|
|
12
|
+
local sfxManager = ____cachedClasses.sfxManager
|
|
11
13
|
local ____array = require("functions.array")
|
|
12
14
|
local arrayToString = ____array.arrayToString
|
|
13
15
|
local ____collectibles = require("functions.collectibles")
|
|
14
16
|
local getCollectibleName = ____collectibles.getCollectibleName
|
|
17
|
+
local ____entity = require("functions.entity")
|
|
18
|
+
local getEntities = ____entity.getEntities
|
|
19
|
+
local getEntityID = ____entity.getEntityID
|
|
15
20
|
local ____flag = require("functions.flag")
|
|
16
21
|
local hasFlag = ____flag.hasFlag
|
|
22
|
+
local ____gridEntity = require("functions.gridEntity")
|
|
23
|
+
local getGridEntities = ____gridEntity.getGridEntities
|
|
24
|
+
local ____math = require("functions.math")
|
|
25
|
+
local range = ____math.range
|
|
17
26
|
local ____player = require("functions.player")
|
|
18
27
|
local getEffectsList = ____player.getEffectsList
|
|
19
28
|
local getPlayerName = ____player.getPlayerName
|
|
@@ -65,6 +74,17 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
65
74
|
____exports.log(" n/a (no flags)")
|
|
66
75
|
end
|
|
67
76
|
end
|
|
77
|
+
local IGNORE_EFFECT_VARIANTS = __TS__New(Set, {
|
|
78
|
+
EffectVariant.BLOOD_EXPLOSION,
|
|
79
|
+
EffectVariant.BLOOD_PARTICLE,
|
|
80
|
+
EffectVariant.TINY_BUG,
|
|
81
|
+
EffectVariant.TINY_FLY,
|
|
82
|
+
EffectVariant.WATER_DROPLET,
|
|
83
|
+
EffectVariant.WALL_BUG,
|
|
84
|
+
EffectVariant.FALLING_EMBER,
|
|
85
|
+
EffectVariant.LIGHT,
|
|
86
|
+
EffectVariant.TADPOLE
|
|
87
|
+
})
|
|
68
88
|
function ____exports.logAllDamageFlags(flags)
|
|
69
89
|
____exports.logAllFlags(flags, DamageFlag, "damage")
|
|
70
90
|
end
|
|
@@ -120,6 +140,145 @@ end
|
|
|
120
140
|
function ____exports.logEntity(entity)
|
|
121
141
|
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
122
142
|
end
|
|
143
|
+
function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
144
|
+
local headerMsg = "Entities in the room"
|
|
145
|
+
if entityTypeFilter ~= nil then
|
|
146
|
+
headerMsg = headerMsg .. (" (filtered to entity type " .. tostring(entityTypeFilter)) .. ")"
|
|
147
|
+
end
|
|
148
|
+
if not includeBackgroundEffects then
|
|
149
|
+
headerMsg = headerMsg .. " (not excluding background effects)"
|
|
150
|
+
end
|
|
151
|
+
headerMsg = headerMsg .. ":"
|
|
152
|
+
____exports.log(headerMsg)
|
|
153
|
+
local entities = getEntities(nil)
|
|
154
|
+
local numMatchedEntities = 0
|
|
155
|
+
__TS__ArrayForEach(
|
|
156
|
+
entities,
|
|
157
|
+
function(____, entity, i)
|
|
158
|
+
if entityTypeFilter ~= nil and entity.Type ~= entityTypeFilter then
|
|
159
|
+
return
|
|
160
|
+
end
|
|
161
|
+
if not includeBackgroundEffects and entity.Type == EntityType.ENTITY_EFFECT and IGNORE_EFFECT_VARIANTS:has(entity.Variant) then
|
|
162
|
+
return
|
|
163
|
+
end
|
|
164
|
+
local entityID = getEntityID(nil, entity)
|
|
165
|
+
local debugString = (tostring(i + 1) .. " - ") .. entityID
|
|
166
|
+
local bomb = entity:ToBomb()
|
|
167
|
+
if bomb ~= nil then
|
|
168
|
+
debugString = debugString .. " (bomb)"
|
|
169
|
+
end
|
|
170
|
+
local effect = entity:ToEffect()
|
|
171
|
+
if effect ~= nil then
|
|
172
|
+
debugString = debugString .. ("." .. tostring(effect.State)) .. " (effect)"
|
|
173
|
+
end
|
|
174
|
+
local familiar = entity:ToFamiliar()
|
|
175
|
+
if familiar ~= nil then
|
|
176
|
+
debugString = debugString .. ("." .. tostring(familiar.State)) .. " (familiar)"
|
|
177
|
+
end
|
|
178
|
+
local knife = entity:ToKnife()
|
|
179
|
+
if knife ~= nil then
|
|
180
|
+
debugString = debugString .. " (knife)"
|
|
181
|
+
end
|
|
182
|
+
local laser = entity:ToLaser()
|
|
183
|
+
if laser ~= nil then
|
|
184
|
+
debugString = debugString .. " (laser)"
|
|
185
|
+
end
|
|
186
|
+
local npc = entity:ToNPC()
|
|
187
|
+
if npc ~= nil then
|
|
188
|
+
debugString = debugString .. ((("." .. tostring(npc.State)) .. " (NPC) (CanShutDoors: ") .. tostring(npc.CanShutDoors)) .. ")"
|
|
189
|
+
end
|
|
190
|
+
local pickup = entity:ToPickup()
|
|
191
|
+
if pickup ~= nil then
|
|
192
|
+
debugString = debugString .. ("." .. tostring(pickup.State)) .. " (pickup)"
|
|
193
|
+
end
|
|
194
|
+
local player = entity:ToPlayer()
|
|
195
|
+
if player ~= nil then
|
|
196
|
+
debugString = debugString .. " (player)"
|
|
197
|
+
end
|
|
198
|
+
local projectile = entity:ToProjectile()
|
|
199
|
+
if projectile ~= nil then
|
|
200
|
+
debugString = debugString .. " (projectile)"
|
|
201
|
+
end
|
|
202
|
+
local tear = entity:ToTear()
|
|
203
|
+
if tear ~= nil then
|
|
204
|
+
debugString = debugString .. " (tear)"
|
|
205
|
+
end
|
|
206
|
+
debugString = debugString .. (" (InitSeed: " .. tostring(entity.InitSeed)) .. ")"
|
|
207
|
+
debugString = debugString .. (" (DropSeed: " .. tostring(entity.DropSeed)) .. ")"
|
|
208
|
+
debugString = debugString .. (((" (Position: " .. tostring(entity.Position.X)) .. ", ") .. tostring(entity.Position.Y)) .. ")"
|
|
209
|
+
debugString = debugString .. (((" (Velocity: " .. tostring(entity.Velocity.X)) .. ", ") .. tostring(entity.Velocity.Y)) .. ")"
|
|
210
|
+
____exports.log(debugString)
|
|
211
|
+
numMatchedEntities = numMatchedEntities + 1
|
|
212
|
+
end
|
|
213
|
+
)
|
|
214
|
+
if numMatchedEntities == 0 then
|
|
215
|
+
____exports.log("(no entities matched)")
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
function ____exports.logGridEntities(includeWalls, gridEntityTypeFilter)
|
|
219
|
+
local headerMsg = "Grid entities in the room"
|
|
220
|
+
if gridEntityTypeFilter ~= nil then
|
|
221
|
+
headerMsg = headerMsg .. (" (filtered to grid entity type " .. tostring(gridEntityTypeFilter)) .. ")"
|
|
222
|
+
end
|
|
223
|
+
if not includeWalls then
|
|
224
|
+
headerMsg = headerMsg .. " (not including walls)"
|
|
225
|
+
end
|
|
226
|
+
____exports.log(headerMsg)
|
|
227
|
+
local gridEntities = getGridEntities(nil)
|
|
228
|
+
local numMatchedEntities = 0
|
|
229
|
+
__TS__ArrayForEach(
|
|
230
|
+
gridEntities,
|
|
231
|
+
function(____, gridEntity)
|
|
232
|
+
local gridEntityIndex = gridEntity:GetGridIndex()
|
|
233
|
+
local gridEntityType = gridEntity:GetType()
|
|
234
|
+
local gridEntityVariant = gridEntity:GetVariant()
|
|
235
|
+
local gridEntityDesc = gridEntity:GetSaveState()
|
|
236
|
+
if gridEntityTypeFilter ~= nil and gridEntityType ~= gridEntityTypeFilter then
|
|
237
|
+
return
|
|
238
|
+
end
|
|
239
|
+
if not includeWalls and gridEntityType == GridEntityType.GRID_WALL and gridEntityTypeFilter ~= GridEntityType.GRID_WALL then
|
|
240
|
+
return
|
|
241
|
+
end
|
|
242
|
+
local debugString = (((((tostring(gridEntityIndex) .. " - ") .. tostring(gridEntityType)) .. ".") .. tostring(gridEntityVariant)) .. ".") .. tostring(gridEntity.State)
|
|
243
|
+
local door = gridEntity:ToDoor()
|
|
244
|
+
if door ~= nil then
|
|
245
|
+
debugString = debugString .. (((((((" (door) (Slot: " .. tostring(door.Slot)) .. ", Direction: ") .. tostring(door.Direction)) .. ", TargetRoomIndex: ") .. tostring(door.TargetRoomIndex)) .. ", TargetRoomType: ") .. tostring(door.TargetRoomType)) .. ")"
|
|
246
|
+
end
|
|
247
|
+
local pit = gridEntity:ToPit()
|
|
248
|
+
if pit ~= nil then
|
|
249
|
+
debugString = debugString .. " (pit)"
|
|
250
|
+
end
|
|
251
|
+
local poop = gridEntity:ToPoop()
|
|
252
|
+
if poop ~= nil then
|
|
253
|
+
debugString = debugString .. " (poop)"
|
|
254
|
+
end
|
|
255
|
+
local pressurePlate = gridEntity:ToPressurePlate()
|
|
256
|
+
if pressurePlate ~= nil then
|
|
257
|
+
debugString = debugString .. " (pressurePlate)"
|
|
258
|
+
end
|
|
259
|
+
local rock = gridEntity:ToRock()
|
|
260
|
+
if rock ~= nil then
|
|
261
|
+
debugString = debugString .. " (rock)"
|
|
262
|
+
end
|
|
263
|
+
local spikes = gridEntity:ToSpikes()
|
|
264
|
+
if spikes ~= nil then
|
|
265
|
+
debugString = debugString .. " (spikes)"
|
|
266
|
+
end
|
|
267
|
+
local tnt = gridEntity:ToTNT()
|
|
268
|
+
if tnt ~= nil then
|
|
269
|
+
debugString = debugString .. " (TNT)"
|
|
270
|
+
end
|
|
271
|
+
debugString = debugString .. (" (VarData: " .. tostring(gridEntity.VarData)) .. ")"
|
|
272
|
+
debugString = debugString .. (((" (Position: " .. tostring(gridEntity.Position.X)) .. ", ") .. tostring(gridEntity.Position.Y)) .. ")"
|
|
273
|
+
debugString = debugString .. (((" (SpawnSeed: " .. tostring(gridEntityDesc.SpawnSeed)) .. ", VariableSeed: ") .. tostring(gridEntityDesc.VariableSeed)) .. ")"
|
|
274
|
+
____exports.log(debugString)
|
|
275
|
+
numMatchedEntities = numMatchedEntities + 1
|
|
276
|
+
end
|
|
277
|
+
)
|
|
278
|
+
if numMatchedEntities == 0 then
|
|
279
|
+
____exports.log("(no grid entities matched)")
|
|
280
|
+
end
|
|
281
|
+
end
|
|
123
282
|
function ____exports.logKColor(kColor)
|
|
124
283
|
____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
125
284
|
end
|
|
@@ -161,6 +320,13 @@ function ____exports.logRoom()
|
|
|
161
320
|
____exports.log("Current room grid index: " .. tostring(roomGridIndex))
|
|
162
321
|
____exports.log("Current room list index: " .. tostring(roomListIndex))
|
|
163
322
|
end
|
|
323
|
+
function ____exports.logSounds()
|
|
324
|
+
for ____, soundEffect in ipairs(range(nil, 0, SoundEffect.NUM_SOUND_EFFECTS - 1)) do
|
|
325
|
+
if sfxManager:IsPlaying(soundEffect) then
|
|
326
|
+
____exports.log("Currently playing sound effect: " .. tostring(soundEffect))
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
end
|
|
164
330
|
function ____exports.logTable(____table, parentTables)
|
|
165
331
|
if parentTables == nil then
|
|
166
332
|
parentTables = 0
|
|
@@ -233,11 +399,15 @@ function ____exports.setLogFunctionsGlobal(self)
|
|
|
233
399
|
globals.logArray = ____exports.logArray
|
|
234
400
|
globals.logColor = ____exports.logColor
|
|
235
401
|
globals.logEntity = ____exports.logEntity
|
|
402
|
+
globals.logEntities = ____exports.logEntities
|
|
403
|
+
globals.logGridEntities = ____exports.logGridEntities
|
|
236
404
|
globals.logKColor = ____exports.logKColor
|
|
237
405
|
globals.logMap = ____exports.logMap
|
|
406
|
+
globals.logRoom = ____exports.logRoom
|
|
238
407
|
globals.logTable = ____exports.logTable
|
|
239
408
|
globals.logTemporaryEffects = ____exports.logTemporaryEffects
|
|
240
409
|
globals.logSet = ____exports.logSet
|
|
410
|
+
globals.logSounds = ____exports.logSounds
|
|
241
411
|
globals.logVector = ____exports.logVector
|
|
242
412
|
end
|
|
243
413
|
return ____exports
|
package/dist/functions/map.d.ts
CHANGED
|
@@ -7,6 +7,22 @@ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
|
7
7
|
* manually getting the current value, incrementing it, and then setting it.
|
|
8
8
|
*/
|
|
9
9
|
export declare function defaultMapGetNextSeed<K, A extends unknown[]>(map: DefaultMap<K, Seed, A>, key: K, ...extraArgs: A): Seed;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to get the closest value from a map based on partial search text. For the
|
|
12
|
+
* purposes of this function, both search text and map keys are converted to lowercase before
|
|
13
|
+
* attempting to find a match.
|
|
14
|
+
*
|
|
15
|
+
* Example:
|
|
16
|
+
* ```ts
|
|
17
|
+
* const map = new <string, number>Map([
|
|
18
|
+
* ["foo", 123],
|
|
19
|
+
* ["bar", 456],
|
|
20
|
+
* ]);
|
|
21
|
+
* const searchText = "f";
|
|
22
|
+
* const match = getMapPartialMatch(map, searchText); // match is now equal to 123
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyMap<string, T>): T | undefined;
|
|
10
26
|
/**
|
|
11
27
|
* Helper function to make using maps with `Seed` values easier. Use this instead of manually
|
|
12
28
|
* getting the current value, incrementing it, and then setting it.
|
package/dist/functions/map.lua
CHANGED
|
@@ -3,6 +3,11 @@ local ____lualib = require("lualib_bundle")
|
|
|
3
3
|
local Map = ____lualib.Map
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
|
+
local __TS__Spread = ____lualib.__TS__Spread
|
|
7
|
+
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
8
|
+
local __TS__StringReplaceAll = ____lualib.__TS__StringReplaceAll
|
|
9
|
+
local __TS__StringStartsWith = ____lualib.__TS__StringStartsWith
|
|
10
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
11
|
local ____exports = {}
|
|
7
12
|
local ____random = require("functions.random")
|
|
8
13
|
local nextSeed = ____random.nextSeed
|
|
@@ -24,6 +29,25 @@ function ____exports.defaultMapGetNextSeed(self, map, key, ...)
|
|
|
24
29
|
map:set(key, newSeed)
|
|
25
30
|
return newSeed
|
|
26
31
|
end
|
|
32
|
+
function ____exports.getMapPartialMatch(self, searchText, map)
|
|
33
|
+
local keys = {__TS__Spread(map:keys())}
|
|
34
|
+
__TS__ArraySort(keys)
|
|
35
|
+
searchText = string.lower(searchText)
|
|
36
|
+
searchText = __TS__StringReplaceAll(searchText, " ", "")
|
|
37
|
+
local matchingKeys = __TS__ArrayFilter(
|
|
38
|
+
keys,
|
|
39
|
+
function(____, key) return __TS__StringStartsWith(
|
|
40
|
+
string.lower(key),
|
|
41
|
+
searchText
|
|
42
|
+
) end
|
|
43
|
+
)
|
|
44
|
+
__TS__ArraySort(matchingKeys)
|
|
45
|
+
local matchingKey = matchingKeys[1]
|
|
46
|
+
if matchingKey == nil then
|
|
47
|
+
return nil
|
|
48
|
+
end
|
|
49
|
+
return map:get(matchingKey)
|
|
50
|
+
end
|
|
27
51
|
function ____exports.mapGetNextSeed(self, map, key)
|
|
28
52
|
local seed = map:get(key)
|
|
29
53
|
if seed == nil then
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
|
|
4
|
+
* pressing tab on the character selection screen). When the player resets the game on a set seed,
|
|
5
|
+
* the game will not switch to a different seed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function onSetSeed(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to restart the game using the console command of "restart". You can optionally
|
|
10
|
+
* specify a `PlayerType` to restart the game as that character.
|
|
11
|
+
*/
|
|
12
|
+
export declare function restart(character?: PlayerType): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____cachedClasses = require("cachedClasses")
|
|
4
|
+
local game = ____cachedClasses.game
|
|
5
|
+
local ____log = require("functions.log")
|
|
6
|
+
local log = ____log.log
|
|
7
|
+
function ____exports.onSetSeed(self)
|
|
8
|
+
local seeds = game:GetSeeds()
|
|
9
|
+
local customRun = seeds:IsCustomRun()
|
|
10
|
+
local challenge = Isaac.GetChallenge()
|
|
11
|
+
return challenge == Challenge.CHALLENGE_NULL and customRun
|
|
12
|
+
end
|
|
13
|
+
function ____exports.restart(self, character)
|
|
14
|
+
if character == nil then
|
|
15
|
+
log("Restarting.")
|
|
16
|
+
Isaac.ExecuteCommand("restart")
|
|
17
|
+
return
|
|
18
|
+
end
|
|
19
|
+
if character < 0 or character >= PlayerType.NUM_PLAYER_TYPES then
|
|
20
|
+
error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
|
|
21
|
+
end
|
|
22
|
+
log("Restarting as character: " .. tostring(character))
|
|
23
|
+
Isaac.ExecuteCommand("restart " .. tostring(character))
|
|
24
|
+
end
|
|
25
|
+
return ____exports
|
|
@@ -71,12 +71,6 @@ export declare function hexToKColor(hexString: string, alpha: float): KColor;
|
|
|
71
71
|
* is enabled or not.
|
|
72
72
|
*/
|
|
73
73
|
export declare function isLuaDebugEnabled(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
|
|
76
|
-
* pressing tab on the character selection screen). When the player resets the game on a set seed,
|
|
77
|
-
* the game will not switch to a different seed.
|
|
78
|
-
*/
|
|
79
|
-
export declare function onSetSeed(): boolean;
|
|
80
74
|
/**
|
|
81
75
|
* Helper function to print something to the in-game console. Use this instead of invoking the
|
|
82
76
|
* `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
|
package/dist/functions/utils.lua
CHANGED
|
@@ -5,8 +5,6 @@ local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
|
5
5
|
local __TS__StringReplace = ____lualib.__TS__StringReplace
|
|
6
6
|
local __TS__StringSubstr = ____lualib.__TS__StringSubstr
|
|
7
7
|
local ____exports = {}
|
|
8
|
-
local ____cachedClasses = require("cachedClasses")
|
|
9
|
-
local game = ____cachedClasses.game
|
|
10
8
|
local HEX_STRING_LENGTH = 6
|
|
11
9
|
____exports.ensureAllCases = function(____, obj) return obj end
|
|
12
10
|
function ____exports.getEnumValues(self, transpiledEnum)
|
|
@@ -45,12 +43,6 @@ end
|
|
|
45
43
|
function ____exports.isLuaDebugEnabled(self)
|
|
46
44
|
return package ~= nil
|
|
47
45
|
end
|
|
48
|
-
function ____exports.onSetSeed(self)
|
|
49
|
-
local seeds = game:GetSeeds()
|
|
50
|
-
local customRun = seeds:IsCustomRun()
|
|
51
|
-
local challenge = Isaac.GetChallenge()
|
|
52
|
-
return challenge == Challenge.CHALLENGE_NULL and customRun
|
|
53
|
-
end
|
|
54
46
|
function ____exports.printConsole(self, msg)
|
|
55
47
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
56
48
|
end
|
|
@@ -8,10 +8,10 @@ end
|
|
|
8
8
|
function ____exports.directionToVector(self, direction)
|
|
9
9
|
repeat
|
|
10
10
|
local ____switch4 = direction
|
|
11
|
-
local ____cond4 = ____switch4 == Direction.
|
|
11
|
+
local ____cond4 = ____switch4 == Direction.NO_DIRECTION
|
|
12
12
|
if ____cond4 then
|
|
13
13
|
do
|
|
14
|
-
return Vector
|
|
14
|
+
return Vector.Zero
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
____cond4 = ____cond4 or ____switch4 == Direction.LEFT
|
|
@@ -20,22 +20,22 @@ function ____exports.directionToVector(self, direction)
|
|
|
20
20
|
return Vector(-1, 0)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
____cond4 = ____cond4 or ____switch4 == Direction.
|
|
23
|
+
____cond4 = ____cond4 or ____switch4 == Direction.UP
|
|
24
24
|
if ____cond4 then
|
|
25
25
|
do
|
|
26
|
-
return Vector(
|
|
26
|
+
return Vector(0, -1)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
|
-
____cond4 = ____cond4 or ____switch4 == Direction.
|
|
29
|
+
____cond4 = ____cond4 or ____switch4 == Direction.RIGHT
|
|
30
30
|
if ____cond4 then
|
|
31
31
|
do
|
|
32
|
-
return Vector(
|
|
32
|
+
return Vector(1, 0)
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
____cond4 = ____cond4 or ____switch4 == Direction.
|
|
35
|
+
____cond4 = ____cond4 or ____switch4 == Direction.DOWN
|
|
36
36
|
if ____cond4 then
|
|
37
37
|
do
|
|
38
|
-
return Vector
|
|
38
|
+
return Vector(0, 1)
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
do
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from "./cachedClasses";
|
|
2
|
+
export { spawnCustomDoor } from "./callbacks/postCustomDoorEnter";
|
|
2
3
|
export { forceNewLevelCallback, forceNewRoomCallback, } from "./callbacks/reorderedCallbacks";
|
|
3
4
|
export * from "./constants";
|
|
4
5
|
export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/deployJSONRoom";
|
|
5
6
|
export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
|
|
6
7
|
export { disableAllSound, enableAllSound } from "./features/disableSound";
|
|
8
|
+
export { addConsoleCommand, enableExtraConsoleCommands, removeConsoleCommand, } from "./features/extraConsoleCommands/init";
|
|
7
9
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
8
10
|
export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
|
|
9
11
|
export * from "./features/isPonyActive";
|
|
@@ -49,6 +51,7 @@ export * from "./functions/positionVelocity";
|
|
|
49
51
|
export * from "./functions/random";
|
|
50
52
|
export * from "./functions/revive";
|
|
51
53
|
export * from "./functions/rooms";
|
|
54
|
+
export * from "./functions/run";
|
|
52
55
|
export * from "./functions/seeds";
|
|
53
56
|
export * from "./functions/set";
|
|
54
57
|
export * from "./functions/sound";
|
|
@@ -67,13 +70,16 @@ export * from "./functions/ui";
|
|
|
67
70
|
export * from "./functions/utils";
|
|
68
71
|
export * from "./functions/vector";
|
|
69
72
|
export * from "./maps/cardDescriptionMap";
|
|
73
|
+
export * from "./maps/cardMap";
|
|
70
74
|
export * from "./maps/cardNameMap";
|
|
71
75
|
export * from "./maps/challengeNameMap";
|
|
76
|
+
export * from "./maps/characterMap";
|
|
72
77
|
export * from "./maps/collectibleDescriptionMap";
|
|
73
78
|
export * from "./maps/collectibleNameMap";
|
|
74
79
|
export * from "./maps/gridEntityTypeToBrokenStateMap";
|
|
75
80
|
export * from "./maps/gridEntityXMLMap";
|
|
76
81
|
export * from "./maps/pillEffectClassMap";
|
|
82
|
+
export * from "./maps/pillEffectMap";
|
|
77
83
|
export * from "./maps/pillEffectNameMap";
|
|
78
84
|
export * from "./maps/pillEffectTypeMap";
|
|
79
85
|
export * from "./maps/roomShapeToTopLeftWallGridIndexMap";
|
package/dist/index.lua
CHANGED
|
@@ -8,6 +8,11 @@ do
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
|
+
do
|
|
12
|
+
local ____postCustomDoorEnter = require("callbacks.postCustomDoorEnter")
|
|
13
|
+
local spawnCustomDoor = ____postCustomDoorEnter.spawnCustomDoor
|
|
14
|
+
____exports.spawnCustomDoor = spawnCustomDoor
|
|
15
|
+
end
|
|
11
16
|
do
|
|
12
17
|
local ____reorderedCallbacks = require("callbacks.reorderedCallbacks")
|
|
13
18
|
local forceNewLevelCallback = ____reorderedCallbacks.forceNewLevelCallback
|
|
@@ -54,6 +59,15 @@ do
|
|
|
54
59
|
____exports.disableAllSound = disableAllSound
|
|
55
60
|
____exports.enableAllSound = enableAllSound
|
|
56
61
|
end
|
|
62
|
+
do
|
|
63
|
+
local ____init = require("features.extraConsoleCommands.init")
|
|
64
|
+
local addConsoleCommand = ____init.addConsoleCommand
|
|
65
|
+
local enableExtraConsoleCommands = ____init.enableExtraConsoleCommands
|
|
66
|
+
local removeConsoleCommand = ____init.removeConsoleCommand
|
|
67
|
+
____exports.addConsoleCommand = addConsoleCommand
|
|
68
|
+
____exports.enableExtraConsoleCommands = enableExtraConsoleCommands
|
|
69
|
+
____exports.removeConsoleCommand = removeConsoleCommand
|
|
70
|
+
end
|
|
57
71
|
do
|
|
58
72
|
local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
59
73
|
local forgottenSwitch = ____forgottenSwitch.forgottenSwitch
|
|
@@ -401,6 +415,14 @@ do
|
|
|
401
415
|
end
|
|
402
416
|
end
|
|
403
417
|
end
|
|
418
|
+
do
|
|
419
|
+
local ____export = require("functions.run")
|
|
420
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
421
|
+
if ____exportKey ~= "default" then
|
|
422
|
+
____exports[____exportKey] = ____exportValue
|
|
423
|
+
end
|
|
424
|
+
end
|
|
425
|
+
end
|
|
404
426
|
do
|
|
405
427
|
local ____export = require("functions.seeds")
|
|
406
428
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -545,6 +567,14 @@ do
|
|
|
545
567
|
end
|
|
546
568
|
end
|
|
547
569
|
end
|
|
570
|
+
do
|
|
571
|
+
local ____export = require("maps.cardMap")
|
|
572
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
573
|
+
if ____exportKey ~= "default" then
|
|
574
|
+
____exports[____exportKey] = ____exportValue
|
|
575
|
+
end
|
|
576
|
+
end
|
|
577
|
+
end
|
|
548
578
|
do
|
|
549
579
|
local ____export = require("maps.cardNameMap")
|
|
550
580
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -561,6 +591,14 @@ do
|
|
|
561
591
|
end
|
|
562
592
|
end
|
|
563
593
|
end
|
|
594
|
+
do
|
|
595
|
+
local ____export = require("maps.characterMap")
|
|
596
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
597
|
+
if ____exportKey ~= "default" then
|
|
598
|
+
____exports[____exportKey] = ____exportValue
|
|
599
|
+
end
|
|
600
|
+
end
|
|
601
|
+
end
|
|
564
602
|
do
|
|
565
603
|
local ____export = require("maps.collectibleDescriptionMap")
|
|
566
604
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -601,6 +639,14 @@ do
|
|
|
601
639
|
end
|
|
602
640
|
end
|
|
603
641
|
end
|
|
642
|
+
do
|
|
643
|
+
local ____export = require("maps.pillEffectMap")
|
|
644
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
645
|
+
if ____exportKey ~= "default" then
|
|
646
|
+
____exports[____exportKey] = ____exportValue
|
|
647
|
+
end
|
|
648
|
+
end
|
|
649
|
+
end
|
|
604
650
|
do
|
|
605
651
|
local ____export = require("maps.pillEffectNameMap")
|
|
606
652
|
for ____exportKey, ____exportValue in pairs(____export) do
|