isaacscript-common 2.1.0 → 2.2.0
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/README.md +1 -1
- package/classes/DefaultMap.d.ts +1 -1
- package/classes/ModUpgraded.d.ts +8 -2
- package/constants.d.ts +5 -5
- package/constants.lua +1 -1
- package/{constantsMax.d.ts → constantsFirstLast.d.ts} +0 -0
- package/{constantsMax.lua → constantsFirstLast.lua} +0 -0
- package/enums/HealthType.d.ts +2 -2
- package/enums/ModCallbackCustom.d.ts +753 -2
- package/features/debugDisplay/exports.d.ts +36 -36
- package/features/deployJSONRoom.d.ts +1 -1
- package/features/extraConsoleCommands/commandsDisplay.d.ts +18 -18
- package/features/extraConsoleCommands/init.d.ts +3 -2
- package/features/extraConsoleCommands/init.lua +76 -76
- package/features/extraConsoleCommands/{commands.d.ts → listCommands.d.ts} +17 -17
- package/features/extraConsoleCommands/{commands.lua → listCommands.lua} +9 -9
- package/features/{isPonyActive.d.ts → ponyDetection.d.ts} +0 -0
- package/features/{isPonyActive.lua → ponyDetection.lua} +2 -2
- package/features/{preventCollectibleRotate.d.ts → preventCollectibleRotation.d.ts} +1 -1
- package/features/{preventCollectibleRotate.lua → preventCollectibleRotation.lua} +3 -3
- package/features/saveDataManager/exports.d.ts +13 -10
- package/features/saveDataManager/load.d.ts +1 -1
- package/features/saveDataManager/main.d.ts +1 -1
- package/features/saveDataManager/maps.d.ts +1 -1
- package/features/saveDataManager/save.d.ts +1 -1
- package/functions/cards.lua +5 -5
- package/functions/character.lua +2 -2
- package/functions/chargeBar.d.ts +1 -1
- package/functions/collectibleCacheFlag.d.ts +4 -4
- package/functions/collectibleSet.lua +2 -2
- package/functions/collectibles.lua +5 -5
- package/functions/enums.d.ts +3 -3
- package/functions/jsonRoom.d.ts +1 -1
- package/functions/pills.lua +9 -9
- package/functions/playerDataStructures.d.ts +51 -0
- package/functions/playerDataStructures.lua +4 -0
- package/functions/playerHealth.d.ts +1 -1
- package/functions/pocketItems.d.ts +1 -1
- package/functions/run.lua +2 -2
- package/functions/spawnCollectible.lua +3 -3
- package/functions/trinketGive.d.ts +1 -1
- package/functions/trinkets.lua +5 -5
- package/functions/utils.d.ts +2 -2
- package/index.d.ts +14 -13
- package/index.lua +12 -12
- package/initFeatures.lua +6 -6
- package/{types → interfaces}/AddCallbackParameterCustom.d.ts +0 -0
- package/{types → interfaces}/AddCallbackParameterCustom.lua +0 -0
- package/{types → interfaces}/ChargeBarSprites.d.ts +0 -0
- package/{types → interfaces}/ChargeBarSprites.lua +0 -0
- package/{types → interfaces}/JSONDoor.d.ts +1 -0
- package/{types → interfaces}/JSONDoor.lua +0 -0
- package/{types → interfaces}/JSONEntity.d.ts +1 -0
- package/{types → interfaces}/JSONEntity.lua +0 -0
- package/{types → interfaces}/JSONRoom.d.ts +1 -5
- package/{types → interfaces}/JSONRoom.lua +0 -0
- package/{types → interfaces}/JSONRooms.d.ts +0 -0
- package/{types → interfaces}/JSONRooms.lua +0 -0
- package/{types → interfaces}/JSONSpawn.d.ts +1 -0
- package/{types → interfaces}/JSONSpawn.lua +0 -0
- package/{types → interfaces}/PlayerHealth.d.ts +1 -0
- package/{types → interfaces}/PlayerHealth.lua +0 -0
- package/{types → interfaces}/PocketItemDescription.d.ts +1 -0
- package/{types → interfaces}/PocketItemDescription.lua +0 -0
- package/interfaces/SaveData.d.ts +29 -0
- package/{types → interfaces}/SaveData.lua +0 -0
- package/{types → interfaces}/TrinketSituation.d.ts +1 -0
- package/{types → interfaces}/TrinketSituation.lua +0 -0
- package/{types → interfaces}/private/TSTLClassMetatable.d.ts +0 -0
- package/{types → interfaces}/private/TSTLClassMetatable.lua +0 -0
- package/maps/cardMap.lua +85 -85
- package/maps/characterMap.lua +58 -58
- package/maps/pillEffectMap.lua +39 -39
- package/maps/roomTypeMap.lua +12 -12
- package/objects/callbackRegisterFunctions.d.ts +1 -1
- package/objects/roomTypeNames.lua +1 -1
- package/package.json +1 -1
- package/types/PickingUpItem.d.ts +12 -2
- package/types/PickingUpItem.lua +3 -0
- package/upgradeMod.d.ts +2 -1
- package/types/SaveData.d.ts +0 -28
|
@@ -27,7 +27,7 @@ export declare function blackMarket(): void;
|
|
|
27
27
|
* charges. (You can use negative numbers to remove charges.)
|
|
28
28
|
*/
|
|
29
29
|
export declare function bloodCharges(params: string): void;
|
|
30
|
-
/** Alias for the "
|
|
30
|
+
/** Alias for the "blackMarket" command. */
|
|
31
31
|
export declare function bm(): void;
|
|
32
32
|
/**
|
|
33
33
|
* Gives a bomb. Provide a number to give a custom amount of bombs. (You can use negative numbers to
|
|
@@ -63,7 +63,7 @@ export declare function brokenHearts(params: string): void;
|
|
|
63
63
|
export declare function card(params: string): void;
|
|
64
64
|
/** Spawns every card on the ground, starting at the top-left-most tile. */
|
|
65
65
|
export declare function cards(): void;
|
|
66
|
-
/** Alias for the "
|
|
66
|
+
/** Alias for the "chaosCardTears" command. */
|
|
67
67
|
export declare function cc(): void;
|
|
68
68
|
/** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
|
|
69
69
|
export declare function chaosCardTears(): void;
|
|
@@ -76,7 +76,7 @@ export declare function chaosCardTears(): void;
|
|
|
76
76
|
* - character ta - Restarts as Tainted Azazel.
|
|
77
77
|
*/
|
|
78
78
|
export declare function characterCommand(params: string): void;
|
|
79
|
-
/** Alias for the "
|
|
79
|
+
/** Alias for the "addCharges" command. */
|
|
80
80
|
export declare function charge(params: string): void;
|
|
81
81
|
/** Warps to the first Clean Bedroom on the floor. */
|
|
82
82
|
export declare function cleanBedroom(): void;
|
|
@@ -115,16 +115,16 @@ export declare function down(params: string): void;
|
|
|
115
115
|
export declare function dungeon(): void;
|
|
116
116
|
/** Logs the player's current temporary effects to the "log.txt" file. */
|
|
117
117
|
export declare function effects(): void;
|
|
118
|
-
/** Alias for the "
|
|
118
|
+
/** Alias for the "eternalHearts" command. */
|
|
119
119
|
export declare function eh(params: string): void;
|
|
120
|
-
/** Alias for the "
|
|
120
|
+
/** Alias for the "iAmError" command. */
|
|
121
121
|
export declare function error(): void;
|
|
122
122
|
/**
|
|
123
123
|
* Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
124
124
|
* numbers to remove hearts.)
|
|
125
125
|
*/
|
|
126
126
|
export declare function eternalHearts(params: string): void;
|
|
127
|
-
/** Alias for the "
|
|
127
|
+
/** Alias for the "startingRoom" command. */
|
|
128
128
|
export declare function fool(): void;
|
|
129
129
|
/** Prints the current position of all players. */
|
|
130
130
|
export declare function getPosition(): void;
|
|
@@ -133,11 +133,11 @@ export declare function getPosition(): void;
|
|
|
133
133
|
* numbers to remove bombs.)
|
|
134
134
|
*/
|
|
135
135
|
export declare function gigaBomb(params: string): void;
|
|
136
|
-
/** Alias for the "
|
|
136
|
+
/** Alias for the "goldenBomb" command. */
|
|
137
137
|
export declare function goldBomb(): void;
|
|
138
|
-
/** Alias for the "
|
|
138
|
+
/** Alias for the "goldenHearts" command. */
|
|
139
139
|
export declare function goldHearts(params: string): void;
|
|
140
|
-
/** Alias for the "
|
|
140
|
+
/** Alias for the "goldenKey" command. */
|
|
141
141
|
export declare function goldKey(): void;
|
|
142
142
|
/** Gives the player a golden bomb. */
|
|
143
143
|
export declare function goldenBomb(): void;
|
|
@@ -184,7 +184,7 @@ export declare function library(): void;
|
|
|
184
184
|
* `EntityType`.
|
|
185
185
|
*
|
|
186
186
|
* By default, this command will exclude background effects. If that is not desired, use the
|
|
187
|
-
* "
|
|
187
|
+
* "listAll" command instead.
|
|
188
188
|
*/
|
|
189
189
|
export declare function list(params: string): void;
|
|
190
190
|
/**
|
|
@@ -196,7 +196,7 @@ export declare function listAll(params: string): void;
|
|
|
196
196
|
* Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
|
|
197
197
|
* specific `GridEntityType`.
|
|
198
198
|
*
|
|
199
|
-
* By default, this command will exclude walls. If that is not desired, use the "
|
|
199
|
+
* By default, this command will exclude walls. If that is not desired, use the "listGridAll"
|
|
200
200
|
* command instead.
|
|
201
201
|
*/
|
|
202
202
|
export declare function listGrid(params: string): void;
|
|
@@ -216,11 +216,11 @@ export declare function map(): void;
|
|
|
216
216
|
* use negative numbers to remove heart containers.)
|
|
217
217
|
*/
|
|
218
218
|
export declare function maxHearts(params: string): void;
|
|
219
|
-
/** Alias for the "
|
|
219
|
+
/** Alias for the "maxHearts" command. */
|
|
220
220
|
export declare function mh(params: string): void;
|
|
221
221
|
/** Warps to the first Miniboss Room on the floor. */
|
|
222
222
|
export declare function miniboss(): void;
|
|
223
|
-
/** Alias for the "
|
|
223
|
+
/** Alias for the "disableCurses" command. */
|
|
224
224
|
export declare function noCurses(): void;
|
|
225
225
|
/** Sets every NPC in the room to 1 HP. */
|
|
226
226
|
export declare function oneHP(): void;
|
|
@@ -247,11 +247,11 @@ export declare function pocket(params: string): void;
|
|
|
247
247
|
* amount of charges. (You can use negative numbers to remove charges.)
|
|
248
248
|
*/
|
|
249
249
|
export declare function poopMana(params: string): void;
|
|
250
|
-
/** Alias for the "
|
|
250
|
+
/** Alias for the "getPosition" command. */
|
|
251
251
|
export declare function positionCommand(): void;
|
|
252
252
|
/** Alias for the "hearts" command. */
|
|
253
253
|
export declare function redHearts(params: string): void;
|
|
254
|
-
/** Alias for the "
|
|
254
|
+
/** Alias for the "redHearts" command. */
|
|
255
255
|
export declare function rh(params: string): void;
|
|
256
256
|
/** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
|
|
257
257
|
export declare function right(params: string): void;
|
|
@@ -287,10 +287,10 @@ export declare function setCharges(params: string): void;
|
|
|
287
287
|
* Moves the first player to the specified position.
|
|
288
288
|
*
|
|
289
289
|
* For example:
|
|
290
|
-
* -
|
|
290
|
+
* - setPosition 100 50
|
|
291
291
|
*/
|
|
292
292
|
export declare function setPosition(params: string): void;
|
|
293
|
-
/** Alias for the "
|
|
293
|
+
/** Alias for the "soulHearts" command. */
|
|
294
294
|
export declare function sh(params: string): void;
|
|
295
295
|
/** Warps to the first shop on the floor. */
|
|
296
296
|
export declare function shop(): void;
|
|
@@ -25,13 +25,13 @@ local FIRST_STAGE = ____constants.FIRST_STAGE
|
|
|
25
25
|
local LAST_ROOM_TYPE = ____constants.LAST_ROOM_TYPE
|
|
26
26
|
local LAST_STAGE = ____constants.LAST_STAGE
|
|
27
27
|
local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
|
|
28
|
-
local
|
|
29
|
-
local FIRST_CARD =
|
|
30
|
-
local FIRST_CHARACTER =
|
|
31
|
-
local FIRST_PILL_EFFECT =
|
|
32
|
-
local LAST_CARD =
|
|
33
|
-
local LAST_PILL_EFFECT =
|
|
34
|
-
local LAST_VANILLA_CHARACTER =
|
|
28
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
29
|
+
local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
|
|
30
|
+
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
31
|
+
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
32
|
+
local LAST_CARD = ____constantsFirstLast.LAST_CARD
|
|
33
|
+
local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
|
|
34
|
+
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
35
35
|
local ____HealthType = require("enums.HealthType")
|
|
36
36
|
local HealthType = ____HealthType.HealthType
|
|
37
37
|
local ____cards = require("functions.cards")
|
|
@@ -779,12 +779,12 @@ function ____exports.setCharges(self, params)
|
|
|
779
779
|
end
|
|
780
780
|
function ____exports.setPosition(self, params)
|
|
781
781
|
if params == "" then
|
|
782
|
-
printConsole(nil, "You must specify a position. (e.g. \"
|
|
782
|
+
printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
|
|
783
783
|
return
|
|
784
784
|
end
|
|
785
785
|
local args = __TS__StringSplit(params, " ")
|
|
786
786
|
if #args ~= 2 then
|
|
787
|
-
printConsole(nil, "You must specify a position. (e.g. \"
|
|
787
|
+
printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
|
|
788
788
|
return
|
|
789
789
|
end
|
|
790
790
|
local xString, yString = table.unpack(args)
|
|
File without changes
|
|
@@ -38,8 +38,8 @@ end
|
|
|
38
38
|
local FEATURE_NAME = "pony activation detector"
|
|
39
39
|
FLAGS_WHEN_PONY_IS_ACTIVE = {EntityFlag.NO_KNOCKBACK, EntityFlag.NO_PHYSICS_KNOCKBACK, EntityFlag.NO_DAMAGE_BLINK}
|
|
40
40
|
v = {run = {playersIsPonyActive = __TS__New(Set)}}
|
|
41
|
-
function ____exports.
|
|
42
|
-
saveDataManager(nil, "
|
|
41
|
+
function ____exports.ponyDetectionInit(self, mod)
|
|
42
|
+
saveDataManager(nil, "ponyDetection", v)
|
|
43
43
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
|
|
44
44
|
end
|
|
45
45
|
function ____exports.isPonyActive(self, player)
|
|
@@ -8,4 +8,4 @@ import { CollectibleType } from "isaac-typescript-definitions";
|
|
|
8
8
|
* It is required to pass the intended collectible type to this function since it is possible for
|
|
9
9
|
* collectibles to rotate on the first frame that they are spawned.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function preventCollectibleRotation(collectible: EntityPickup, collectibleType: CollectibleType): void;
|
|
@@ -40,12 +40,12 @@ function getMapIndex(self, collectible)
|
|
|
40
40
|
end
|
|
41
41
|
local FEATURE_NAME = "prevent collectible rotation"
|
|
42
42
|
v = {room = {trackedCollectibles = __TS__New(Map)}}
|
|
43
|
-
function ____exports.
|
|
44
|
-
saveDataManager(nil, "
|
|
43
|
+
function ____exports.preventCollectibleRotationInit(self, mod)
|
|
44
|
+
saveDataManager(nil, "preventCollectibleRotation", v)
|
|
45
45
|
mod:AddCallback(ModCallback.POST_USE_CARD, useCardSoulOfIsaac, Card.SOUL_ISAAC)
|
|
46
46
|
mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdateCollectible, PickupVariant.COLLECTIBLE)
|
|
47
47
|
end
|
|
48
|
-
function ____exports.
|
|
48
|
+
function ____exports.preventCollectibleRotation(self, collectible, collectibleType)
|
|
49
49
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
50
50
|
if not isCollectible(nil, collectible) then
|
|
51
51
|
local entityID = getEntityID(nil, collectible)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaveData } from "../../
|
|
1
|
+
import { SaveData } from "../../interfaces/SaveData";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point to the save data manager, a system which provides two major features:
|
|
4
4
|
*
|
|
@@ -36,7 +36,7 @@ import { SaveData } from "../../types/SaveData";
|
|
|
36
36
|
*
|
|
37
37
|
* // These variables are reset at the beginning of every room.
|
|
38
38
|
* room: {
|
|
39
|
-
*
|
|
39
|
+
* foo4: 0,
|
|
40
40
|
* },
|
|
41
41
|
* };
|
|
42
42
|
* // Every child object is optional; only create the ones that you need.
|
|
@@ -50,7 +50,7 @@ import { SaveData } from "../../types/SaveData";
|
|
|
50
50
|
* // Elsewhere in the file, use your variables.
|
|
51
51
|
* function feature1Function() {
|
|
52
52
|
* if (v.run.foo1 > 0) {
|
|
53
|
-
* //
|
|
53
|
+
* // Insert code here.
|
|
54
54
|
* }
|
|
55
55
|
* }
|
|
56
56
|
* ```
|
|
@@ -59,7 +59,9 @@ import { SaveData } from "../../types/SaveData";
|
|
|
59
59
|
* can possibly run).
|
|
60
60
|
* - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
|
|
61
61
|
*
|
|
62
|
-
* Note that before using the save data manager, you must call the `upgradeMod` function.
|
|
62
|
+
* Note that before using the save data manager, you must call the `upgradeMod` function. (Upgrade
|
|
63
|
+
* your mod before registering any of your own callbacks so that the save data manager will run
|
|
64
|
+
* before any of your code does.)
|
|
63
65
|
*
|
|
64
66
|
* If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
|
|
65
67
|
* the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
|
|
@@ -77,10 +79,10 @@ import { SaveData } from "../../types/SaveData";
|
|
|
77
79
|
* @param conditionalFunc An optional function to run upon saving this key to disk. For example,
|
|
78
80
|
* this allows features to only save data to disk if the feature is enabled.
|
|
79
81
|
* Specify a value of `() => false` to completely disable saving this feature
|
|
80
|
-
* to disk.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* keys.
|
|
82
|
+
* to disk. Disabling saving to disk is useful if you are using data that is
|
|
83
|
+
* not serializable. Alternatively, it could be useful if you want to use the
|
|
84
|
+
* save data manager to automatically reset variables on run/level/room, but
|
|
85
|
+
* not clutter the the "save#.dat" file with unnecessary keys.
|
|
84
86
|
*/
|
|
85
87
|
export declare function saveDataManager(key: string, v: SaveData, conditionalFunc?: () => boolean): void;
|
|
86
88
|
/**
|
|
@@ -88,7 +90,8 @@ export declare function saveDataManager(key: string, v: SaveData, conditionalFun
|
|
|
88
90
|
* when a new run is started). Use this function to explicitly force the save data manager to load
|
|
89
91
|
* all of its variables from disk immediately.
|
|
90
92
|
*
|
|
91
|
-
*
|
|
93
|
+
* Obviously, doing this will overwrite the current data, so using this function can potentially
|
|
94
|
+
* result in lost state.
|
|
92
95
|
*/
|
|
93
96
|
export declare function saveDataManagerLoad(): void;
|
|
94
97
|
/**
|
|
@@ -112,7 +115,7 @@ export declare function saveDataManagerSetGlobal(): void;
|
|
|
112
115
|
*
|
|
113
116
|
* For example:
|
|
114
117
|
*
|
|
115
|
-
* ```
|
|
118
|
+
* ```ts
|
|
116
119
|
* const v = {
|
|
117
120
|
* room: {
|
|
118
121
|
* foo: 123,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
|
-
import { SaveData } from "../../
|
|
3
|
+
import { SaveData } from "../../interfaces/SaveData";
|
|
4
4
|
export declare function loadFromDisk(mod: Mod, oldSaveData: LuaTable<string, SaveData>): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SaveDataKey } from "../../enums/private/SaveDataKey";
|
|
2
|
-
import { SaveData } from "../../
|
|
2
|
+
import { SaveData } from "../../interfaces/SaveData";
|
|
3
3
|
export declare function restoreDefaultSaveData(subscriberName: string, saveData: SaveData, saveDataKey: SaveDataKey): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
-
import { SaveData } from "../../
|
|
2
|
+
import { SaveData } from "../../interfaces/SaveData";
|
|
3
3
|
/**
|
|
4
4
|
* The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
5
5
|
* Maps for the master map so that we can access the variables via the in-game console when
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
|
-
import { SaveData } from "../../
|
|
3
|
+
import { SaveData } from "../../interfaces/SaveData";
|
|
4
4
|
export declare function saveToDisk(mod: Mod, saveDataMap: LuaTable<string, SaveData>, saveDataConditionalFuncMap: Map<string, () => boolean>): void;
|
package/functions/cards.lua
CHANGED
|
@@ -10,11 +10,11 @@ local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
|
|
|
10
10
|
local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardType
|
|
11
11
|
local ____cachedClasses = require("cachedClasses")
|
|
12
12
|
local itemConfig = ____cachedClasses.itemConfig
|
|
13
|
-
local
|
|
14
|
-
local FIRST_CARD =
|
|
15
|
-
local FIRST_MODDED_CARD =
|
|
16
|
-
local LAST_CARD =
|
|
17
|
-
local MAX_VANILLA_CARD =
|
|
13
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
14
|
+
local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
|
|
15
|
+
local FIRST_MODDED_CARD = ____constantsFirstLast.FIRST_MODDED_CARD
|
|
16
|
+
local LAST_CARD = ____constantsFirstLast.LAST_CARD
|
|
17
|
+
local MAX_VANILLA_CARD = ____constantsFirstLast.MAX_VANILLA_CARD
|
|
18
18
|
local ____cardDescriptions = require("objects.cardDescriptions")
|
|
19
19
|
local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
|
|
20
20
|
local DEFAULT_CARD_DESCRIPTION = ____cardDescriptions.DEFAULT_CARD_DESCRIPTION
|
package/functions/character.lua
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
4
|
-
local
|
|
5
|
-
local LAST_VANILLA_CHARACTER =
|
|
4
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
5
|
+
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
6
6
|
local ____characterNames = require("objects.characterNames")
|
|
7
7
|
local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
|
|
8
8
|
local DEFAULT_CHARACTER_NAME = ____characterNames.DEFAULT_CHARACTER_NAME
|
package/functions/chargeBar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
import { ChargeBarSprites } from "../
|
|
2
|
+
import { ChargeBarSprites } from "../interfaces/ChargeBarSprites";
|
|
3
3
|
/**
|
|
4
4
|
* Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar`
|
|
5
5
|
* helper function.
|
|
@@ -9,14 +9,14 @@ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<C
|
|
|
9
9
|
* Returns an array containing every collectible type that the player has that matches the provided
|
|
10
10
|
* CacheFlag.
|
|
11
11
|
*
|
|
12
|
-
* For example, if
|
|
13
|
-
* return:
|
|
12
|
+
* For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
13
|
+
* two Dead Doves, then this function would return:
|
|
14
14
|
*
|
|
15
15
|
* ```ts
|
|
16
16
|
* [
|
|
17
17
|
* CollectibleType.LORD_OF_THE_PIT,
|
|
18
|
-
* CollectibleType.
|
|
19
|
-
* CollectibleType.
|
|
18
|
+
* CollectibleType.DEAD_DOVE,
|
|
19
|
+
* CollectibleType.DEAD_DOVE,
|
|
20
20
|
* ]
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
@@ -4,8 +4,8 @@ local __TS__New = ____lualib.__TS__New
|
|
|
4
4
|
local ____exports = {}
|
|
5
5
|
local ____cachedClasses = require("cachedClasses")
|
|
6
6
|
local itemConfig = ____cachedClasses.itemConfig
|
|
7
|
-
local
|
|
8
|
-
local LAST_VANILLA_COLLECTIBLE_TYPE =
|
|
7
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
8
|
+
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
9
9
|
local ____collectibles = require("functions.collectibles")
|
|
10
10
|
local getCollectibleTypeRange = ____collectibles.getCollectibleTypeRange
|
|
11
11
|
local ____set = require("functions.set")
|
|
@@ -13,11 +13,11 @@ local game = ____cachedClasses.game
|
|
|
13
13
|
local itemConfig = ____cachedClasses.itemConfig
|
|
14
14
|
local ____constants = require("constants")
|
|
15
15
|
local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
|
|
16
|
-
local
|
|
17
|
-
local FIRST_COLLECTIBLE_TYPE =
|
|
18
|
-
local FIRST_MODDED_COLLECTIBLE_TYPE =
|
|
19
|
-
local LAST_COLLECTIBLE_TYPE =
|
|
20
|
-
local LAST_VANILLA_COLLECTIBLE_TYPE =
|
|
16
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
17
|
+
local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
|
|
18
|
+
local FIRST_MODDED_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_MODDED_COLLECTIBLE_TYPE
|
|
19
|
+
local LAST_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_COLLECTIBLE_TYPE
|
|
20
|
+
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
21
21
|
local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
|
|
22
22
|
local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
|
|
23
23
|
local DEFAULT_COLLECTIBLE_DESCRIPTION = ____collectibleDescriptionMap.DEFAULT_COLLECTIBLE_DESCRIPTION
|
package/functions/enums.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* Also see the `getEnumKeys` and `getEnumValues` helper functions.
|
|
15
15
|
*
|
|
16
16
|
* For a more in depth explanation, see:
|
|
17
|
-
* https://isaacscript.github.io/
|
|
17
|
+
* https://isaacscript.github.io/gotchas#iterating-over-enums
|
|
18
18
|
*/
|
|
19
19
|
export declare function getEnumEntries<T>(transpiledEnum: T): Array<[key: string, value: T[keyof T]]>;
|
|
20
20
|
/**
|
|
@@ -31,7 +31,7 @@ export declare function getEnumEntries<T>(transpiledEnum: T): Array<[key: string
|
|
|
31
31
|
* Also see the `getEnumEntries` and `getEnumValues` helper functions.
|
|
32
32
|
*
|
|
33
33
|
* For a more in depth explanation, see:
|
|
34
|
-
* https://isaacscript.github.io/
|
|
34
|
+
* https://isaacscript.github.io/gotchas#iterating-over-enums
|
|
35
35
|
*/
|
|
36
36
|
export declare function getEnumKeys<T>(transpiledEnum: T): string[];
|
|
37
37
|
/** Helper function to get the amount of entries inside of an enum. */
|
|
@@ -50,7 +50,7 @@ export declare function getEnumLength<T>(transpiledEnum: T): int;
|
|
|
50
50
|
* Also see the `getEnumEntries` and `getEnumKeys` helper functions.
|
|
51
51
|
*
|
|
52
52
|
* For a more in depth explanation, see:
|
|
53
|
-
* https://isaacscript.github.io/
|
|
53
|
+
* https://isaacscript.github.io/gotchas#iterating-over-enums
|
|
54
54
|
*/
|
|
55
55
|
export declare function getEnumValues<T>(transpiledEnum: T): Array<T[keyof T]>;
|
|
56
56
|
export declare function getLastEnumValue<T>(transpiledEnum: T): T[keyof T];
|
package/functions/jsonRoom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
import { JSONRoom } from "../
|
|
2
|
+
import { JSONRoom } from "../interfaces/JSONRoom";
|
|
3
3
|
export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[], variant: int): JSONRoom | undefined;
|
|
4
4
|
export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[], subType: int): JSONRoom[];
|
|
5
5
|
/**
|
package/functions/pills.lua
CHANGED
|
@@ -5,15 +5,15 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
5
5
|
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
6
6
|
local ____cachedClasses = require("cachedClasses")
|
|
7
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
|
-
local
|
|
9
|
-
local FIRST_HORSE_PILL_COLOR =
|
|
10
|
-
local FIRST_MODDED_PILL_EFFECT =
|
|
11
|
-
local FIRST_PILL_COLOR =
|
|
12
|
-
local FIRST_PILL_EFFECT =
|
|
13
|
-
local LAST_HORSE_PILL_COLOR =
|
|
14
|
-
local LAST_NORMAL_PILL_COLOR =
|
|
15
|
-
local LAST_PILL_EFFECT =
|
|
16
|
-
local LAST_VANILLA_PILL_EFFECT =
|
|
8
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
9
|
+
local FIRST_HORSE_PILL_COLOR = ____constantsFirstLast.FIRST_HORSE_PILL_COLOR
|
|
10
|
+
local FIRST_MODDED_PILL_EFFECT = ____constantsFirstLast.FIRST_MODDED_PILL_EFFECT
|
|
11
|
+
local FIRST_PILL_COLOR = ____constantsFirstLast.FIRST_PILL_COLOR
|
|
12
|
+
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
13
|
+
local LAST_HORSE_PILL_COLOR = ____constantsFirstLast.LAST_HORSE_PILL_COLOR
|
|
14
|
+
local LAST_NORMAL_PILL_COLOR = ____constantsFirstLast.LAST_NORMAL_PILL_COLOR
|
|
15
|
+
local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
|
|
16
|
+
local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
|
|
17
17
|
local ____pillEffectClasses = require("objects.pillEffectClasses")
|
|
18
18
|
local DEFAULT_PILL_EFFECT_CLASS = ____pillEffectClasses.DEFAULT_PILL_EFFECT_CLASS
|
|
19
19
|
local PILL_EFFECT_CLASSES = ____pillEffectClasses.PILL_EFFECT_CLASSES
|
|
@@ -4,6 +4,20 @@ import { PlayerIndex } from "../types/PlayerIndex";
|
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to make using default maps with an index of `PlayerIndex` easier. Use this
|
|
6
6
|
* instead of the `DefaultMap.getAndSetDefault` method if you have a default map of this type.
|
|
7
|
+
*
|
|
8
|
+
* For example:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const v = {
|
|
12
|
+
* run: {
|
|
13
|
+
* playersSpeedBoost: new DefaultMap<PlayerIndex, int>(0),
|
|
14
|
+
* },
|
|
15
|
+
* };
|
|
16
|
+
*
|
|
17
|
+
* function evaluateCacheSpeed(player: EntityPlayer) {
|
|
18
|
+
* player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
7
21
|
*/
|
|
8
22
|
export declare function defaultMapGetPlayer<V, A extends unknown[]>(map: DefaultMap<PlayerIndex, V, A>, player: EntityPlayer, ...extraArgs: A): V;
|
|
9
23
|
/**
|
|
@@ -17,11 +31,48 @@ export declare function defaultMapSetPlayer<V>(map: Map<PlayerIndex, V>, player:
|
|
|
17
31
|
/**
|
|
18
32
|
* Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
|
|
19
33
|
* `Map.get` method if you have a map of this type.
|
|
34
|
+
*
|
|
35
|
+
* For example:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const v = {
|
|
39
|
+
* run: {
|
|
40
|
+
* playersSpeedBoost: new Map<PlayerIndex, int>(),
|
|
41
|
+
* },
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* function incrementSpeedBoost(player: EntityPlayer) {
|
|
45
|
+
* const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player);
|
|
46
|
+
* const newSpeedBoost = oldSpeedBoost + 0.1;
|
|
47
|
+
* mapSetPlayer(v.run.playersSpeedBoost, player);
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
20
50
|
*/
|
|
21
51
|
export declare function mapGetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer): V | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
|
|
54
|
+
* `Map.has` method if you have a map of this type.
|
|
55
|
+
*/
|
|
56
|
+
export declare function mapHasPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer): boolean;
|
|
22
57
|
/**
|
|
23
58
|
* Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
|
|
24
59
|
* `Map.set` method if you have a map of this type.
|
|
60
|
+
*
|
|
61
|
+
* For example:
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* const v = {
|
|
65
|
+
* run: {
|
|
66
|
+
* playersSpeedBoost: new Map<PlayerIndex, int>(),
|
|
67
|
+
* },
|
|
68
|
+
* };
|
|
69
|
+
*
|
|
70
|
+
* function incrementSpeedBoost(player: EntityPlayer) {
|
|
71
|
+
* const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player);
|
|
72
|
+
* const newSpeedBoost = oldSpeedBoost + 0.1;
|
|
73
|
+
* mapSetPlayer(v.run.playersSpeedBoost, player);
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
25
76
|
*/
|
|
26
77
|
export declare function mapSetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer, value: V): void;
|
|
27
78
|
/**
|
|
@@ -19,6 +19,10 @@ function ____exports.mapGetPlayer(self, map, player)
|
|
|
19
19
|
local playerIndex = getPlayerIndex(nil, player)
|
|
20
20
|
return map:get(playerIndex)
|
|
21
21
|
end
|
|
22
|
+
function ____exports.mapHasPlayer(self, map, player)
|
|
23
|
+
local playerIndex = getPlayerIndex(nil, player)
|
|
24
|
+
return map:has(playerIndex)
|
|
25
|
+
end
|
|
22
26
|
function ____exports.setAddPlayer(self, set, player)
|
|
23
27
|
local playerIndex = getPlayerIndex(nil, player)
|
|
24
28
|
return set:add(playerIndex)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
import { HealthType } from "../enums/HealthType";
|
|
3
|
-
import { PlayerHealth } from "../
|
|
3
|
+
import { PlayerHealth } from "../interfaces/PlayerHealth";
|
|
4
4
|
export declare function addPlayerHealthType(player: EntityPlayer, healthType: HealthType, numHearts: int): void;
|
|
5
5
|
/**
|
|
6
6
|
* Helper function to get an object representing the player's health. You can use this in
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PocketItemSlot } from "isaac-typescript-definitions";
|
|
2
|
-
import { PocketItemDescription } from "../
|
|
2
|
+
import { PocketItemDescription } from "../interfaces/PocketItemDescription";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to get the `PocketItemSlot` that the player's pocket active collectible item is
|
|
5
5
|
* in, if any. Returns undefined if the player does not have a pocket active item.
|
package/functions/run.lua
CHANGED
|
@@ -3,8 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
3
3
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
4
4
|
local ____cachedClasses = require("cachedClasses")
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
|
-
local
|
|
7
|
-
local FIRST_CHARACTER =
|
|
6
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
7
|
+
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
8
8
|
local ____log = require("functions.log")
|
|
9
9
|
local log = ____log.log
|
|
10
10
|
function ____exports.onSetSeed(self)
|
|
@@ -5,8 +5,8 @@ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
|
5
5
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
6
6
|
local ____constants = require("constants")
|
|
7
7
|
local VectorZero = ____constants.VectorZero
|
|
8
|
-
local
|
|
9
|
-
local
|
|
8
|
+
local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
|
|
9
|
+
local preventCollectibleRotation = ____preventCollectibleRotation.preventCollectibleRotation
|
|
10
10
|
local ____featuresInitialized = require("featuresInitialized")
|
|
11
11
|
local areFeaturesInitialized = ____featuresInitialized.areFeaturesInitialized
|
|
12
12
|
local ____collectibles = require("functions.collectibles")
|
|
@@ -48,7 +48,7 @@ function ____exports.spawnCollectible(self, collectibleType, position, seedOrRNG
|
|
|
48
48
|
collectible.Price = 15
|
|
49
49
|
end
|
|
50
50
|
if isQuestCollectible(nil, collectibleType) and areFeaturesInitialized(nil) then
|
|
51
|
-
|
|
51
|
+
preventCollectibleRotation(nil, collectible, collectibleType)
|
|
52
52
|
end
|
|
53
53
|
return collectible
|
|
54
54
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TrinketType } from "isaac-typescript-definitions";
|
|
2
|
-
import { TrinketSituation } from "../
|
|
2
|
+
import { TrinketSituation } from "../interfaces/TrinketSituation";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to restore the player's trinkets back to the way they were before the
|
|
5
5
|
* `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
|
package/functions/trinkets.lua
CHANGED
|
@@ -5,11 +5,11 @@ local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
|
5
5
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
6
6
|
local ____cachedClasses = require("cachedClasses")
|
|
7
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
|
-
local
|
|
9
|
-
local FIRST_MODDED_TRINKET_TYPE =
|
|
10
|
-
local FIRST_TRINKET_TYPE =
|
|
11
|
-
local LAST_TRINKET_TYPE =
|
|
12
|
-
local LAST_VANILLA_TRINKET_TYPE =
|
|
8
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
9
|
+
local FIRST_MODDED_TRINKET_TYPE = ____constantsFirstLast.FIRST_MODDED_TRINKET_TYPE
|
|
10
|
+
local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
|
|
11
|
+
local LAST_TRINKET_TYPE = ____constantsFirstLast.LAST_TRINKET_TYPE
|
|
12
|
+
local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
|
|
13
13
|
local ____trinketDescriptionMap = require("maps.trinketDescriptionMap")
|
|
14
14
|
local DEFAULT_TRINKET_DESCRIPTION = ____trinketDescriptionMap.DEFAULT_TRINKET_DESCRIPTION
|
|
15
15
|
local TRINKET_DESCRIPTION_MAP = ____trinketDescriptionMap.TRINKET_DESCRIPTION_MAP
|
package/functions/utils.d.ts
CHANGED
|
@@ -101,8 +101,8 @@ export declare function printEnabled(enabled: boolean, description: string): voi
|
|
|
101
101
|
export declare function repeat(n: int, func: (i: int) => void): void;
|
|
102
102
|
/**
|
|
103
103
|
* Helper function to signify that the enclosing code block is not yet complete. Using this function
|
|
104
|
-
* is similar to writing a "TODO" comment, but it has the benefit of preventing
|
|
105
|
-
*
|
|
104
|
+
* is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to
|
|
105
|
+
* early returns.
|
|
106
106
|
*
|
|
107
107
|
* When you see this function, it simply means that the programmer intends to add in more code to
|
|
108
108
|
* this spot later.
|