isaacscript-common 9.1.1 → 9.3.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.
@@ -116,6 +116,8 @@ export declare const MINUTE_IN_MILLISECONDS: number;
116
116
  export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
117
117
  /** After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount. */
118
118
  export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
119
+ /** For `GridEntityType.TELEPORTER` (23). */
120
+ export declare const TELEPORTER_ACTIVATION_DISTANCE: number;
119
121
  /**
120
122
  * This is the number of draw coordinates that each heart spans on the UI in the upper left hand
121
123
  * corner.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAMtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;GAIG;AAEH,eAAO,MAAM,+BAA+B,wDAAmC,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,8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AAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
@@ -97,6 +97,8 @@ ____exports.MINUTE_IN_MILLISECONDS = 60 * ____exports.SECOND_IN_MILLISECONDS
97
97
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
98
98
  --- After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount.
99
99
  ____exports.TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000
100
+ --- For `GridEntityType.TELEPORTER` (23).
101
+ ____exports.TELEPORTER_ACTIVATION_DISTANCE = ____exports.DISTANCE_OF_GRID_TILE / 2
100
102
  --- This is the number of draw coordinates that each heart spans on the UI in the upper left hand
101
103
  -- corner.
102
104
  ____exports.UI_HEART_WIDTH = 12
@@ -4,12 +4,6 @@ import { LevelStage, StageType } from "isaac-typescript-definitions";
4
4
  * want to create a custom trapdoor that goes to a vanilla stage instead, use the
5
5
  * `spawnCustomTrapdoorToVanilla` helper function.
6
6
  *
7
- * Custom trapdoors can have one or more of the following attributes:
8
- *
9
- * - custom destination (or custom logic for after the player enters)
10
- * - custom graphics
11
- * - custom logic for opening/closing
12
- *
13
7
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
14
8
  * respawned every time the player re-enters the room.
15
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,GAAG,EACxB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAcZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,EACrB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAkBZ"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,GAAG,EACxB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAcZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,EACrB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAkBZ"}
@@ -12,12 +12,6 @@ local spawnCustomTrapdoorToDestination = ____spawn.spawnCustomTrapdoorToDestinat
12
12
  -- want to create a custom trapdoor that goes to a vanilla stage instead, use the
13
13
  -- `spawnCustomTrapdoorToVanilla` helper function.
14
14
  --
15
- -- Custom trapdoors can have one or more of the following attributes:
16
- --
17
- -- - custom destination (or custom logic for after the player enters)
18
- -- - custom graphics
19
- -- - custom logic for opening/closing
20
- --
21
15
  -- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
22
16
  -- respawned every time the player re-enters the room.
23
17
  --
@@ -1054,7 +1054,7 @@ end
1054
1054
  -- "debug 10".
1055
1055
  function ____exports.spam(self)
1056
1056
  v.run.spamBloodRights = not v.run.spamBloodRights
1057
- printEnabled(nil, v.run.maxSpeed, "spamming Blood Rights")
1057
+ printEnabled(nil, v.run.spamBloodRights, "spamming Blood Rights")
1058
1058
  end
1059
1059
  --- Spawns a golden version of the specified trinket type.
1060
1060
  function ____exports.spawnGoldenTrinket(self, params)
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAKtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAsBrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAUlE;AAuED,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,CA4CN;AAiBD,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAsBrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAUlE;AAqFD,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,CA4CN;AAiBD,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C"}
@@ -17,6 +17,8 @@ local ____deepCopy = require("functions.deepCopy")
17
17
  local deepCopy = ____deepCopy.deepCopy
18
18
  local ____log = require("functions.log")
19
19
  local logError = ____log.logError
20
+ local ____stage = require("functions.stage")
21
+ local onFirstFloor = ____stage.onFirstFloor
20
22
  local ____table = require("functions.table")
21
23
  local clearTable = ____table.clearTable
22
24
  local iterateTableInOrder = ____table.iterateTableInOrder
@@ -55,7 +57,13 @@ function preGameExit(self)
55
57
  loadedDataOnThisRun = false
56
58
  end
57
59
  function postNewLevel(self)
60
+ if mod == nil then
61
+ error(("The mod for the " .. SAVE_DATA_MANAGER_FEATURE_NAME) .. " was not initialized.")
62
+ end
58
63
  restoreDefaults(nil, SaveDataKey.LEVEL)
64
+ if not onFirstFloor(nil) then
65
+ saveToDisk(nil, mod, saveDataMap, saveDataConditionalFuncMap)
66
+ end
59
67
  end
60
68
  function postNewRoomEarly(self)
61
69
  restoreDefaults(nil, SaveDataKey.ROOM)
@@ -127,6 +127,7 @@ export declare function inDoubleTrouble(): boolean;
127
127
  export declare function inGenesisRoom(): boolean;
128
128
  /** Helper function to determine if the current room shape is one of the four L room shapes. */
129
129
  export declare function inLRoom(): boolean;
130
+ /** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */
130
131
  export declare function inMegaSatanRoom(): boolean;
131
132
  /**
132
133
  * Helper function to determine if the current room is part of the Repentance "escape sequence" in
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EACZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;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AACH,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -305,6 +305,7 @@ function ____exports.inLRoom(self)
305
305
  local roomShape = room:GetRoomShape()
306
306
  return roomShape == RoomShape.LTL or roomShape == RoomShape.LTR or roomShape == RoomShape.LBL or roomShape == RoomShape.LBR
307
307
  end
308
+ --- Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`.
308
309
  function ____exports.inMegaSatanRoom(self)
309
310
  local roomGridIndex = getRoomGridIndex(nil)
310
311
  return roomGridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
@@ -26,6 +26,10 @@ export declare function getStage(): LevelStage;
26
26
  export declare function getStageType(): StageType;
27
27
  /** Helper function to directly warp to a specific stage using the "stage" console command. */
28
28
  export declare function goToStage(stage: LevelStage, stageType: StageType): void;
29
+ /**
30
+ * Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
31
+ * `StageType.REPENTANCE_B`.
32
+ */
29
33
  export declare function isRepentanceStage(stageType: StageType): boolean;
30
34
  export declare function onAscent(): boolean;
31
35
  export declare function onCathedral(): boolean;
@@ -40,6 +44,17 @@ export declare function onDarkRoom(): boolean;
40
44
  * I AM ERROR room is never entered into the list of possibilities.
41
45
  */
42
46
  export declare function onFinalFloor(): boolean;
47
+ /**
48
+ * Returns whether or not the player is on the first floor of the particular run.
49
+ *
50
+ * This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
51
+ * first floor and The Ascent.
52
+ */
53
+ export declare function onFirstFloor(): boolean;
54
+ /**
55
+ * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
56
+ * `StageType.REPENTANCE_B`.
57
+ */
43
58
  export declare function onRepentanceStage(): boolean;
44
59
  export declare function onSheol(): boolean;
45
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAOtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CASvC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,MAAM,CAG3E;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED,iDAAiD;AACjD,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAIvE;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAI/D;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED,wBAAgB,OAAO,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;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,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
@@ -14,9 +14,13 @@ local STAGE_TYPE_TO_LETTER = ____stageTypeToLetter.STAGE_TYPE_TO_LETTER
14
14
  local ____types = require("functions.types")
15
15
  local asLevelStage = ____types.asLevelStage
16
16
  local asNumber = ____types.asNumber
17
+ --- Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
18
+ -- `StageType.REPENTANCE_B`.
17
19
  function ____exports.isRepentanceStage(self, stageType)
18
20
  return stageType == StageType.REPENTANCE or stageType == StageType.REPENTANCE_B
19
21
  end
22
+ --- Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
23
+ -- `StageType.REPENTANCE_B`.
20
24
  function ____exports.onRepentanceStage(self)
21
25
  local level = game:GetLevel()
22
26
  local stageType = level:GetStageType()
@@ -125,6 +129,15 @@ function ____exports.onFinalFloor(self)
125
129
  local stage = level:GetStage()
126
130
  return stage == LevelStage.DARK_ROOM_CHEST or stage == LevelStage.THE_VOID or stage == LevelStage.HOME or stage == LevelStage.WOMB_2 and ____exports.onRepentanceStage(nil)
127
131
  end
132
+ --- Returns whether or not the player is on the first floor of the particular run.
133
+ --
134
+ -- This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
135
+ -- first floor and The Ascent.
136
+ function ____exports.onFirstFloor(self)
137
+ local effectiveStage = ____exports.getEffectiveStage(nil)
138
+ local isOnAscent = ____exports.onAscent(nil)
139
+ return effectiveStage == 1 and not isOnAscent
140
+ end
128
141
  function ____exports.onSheol(self)
129
142
  local level = game:GetLevel()
130
143
  local stage = level:GetStage()
package/dist/index.d.ts CHANGED
@@ -5433,6 +5433,7 @@ export declare function initCustomDoor(mod: ModUpgraded, effectVariant: EffectVa
5433
5433
  /** Helper function to determine if the current room shape is one of the four L room shapes. */
5434
5434
  export declare function inLRoom(): boolean;
5435
5435
 
5436
+ /** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */
5436
5437
  export declare function inMegaSatanRoom(): boolean;
5437
5438
 
5438
5439
  /**
@@ -6049,6 +6050,10 @@ export declare function isReflectionRender(): boolean;
6049
6050
  */
6050
6051
  export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
6051
6052
 
6053
+ /**
6054
+ * Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
6055
+ * `StageType.REPENTANCE_B`.
6056
+ */
6052
6057
  export declare function isRepentanceStage(stageType: StageType): boolean;
6053
6058
 
6054
6059
  /** Returns true for cards that have `ItemConfigCardType.TAROT_REVERSE`. */
@@ -8255,6 +8260,18 @@ export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
8255
8260
  */
8256
8261
  export declare function onFinalFloor(): boolean;
8257
8262
 
8263
+ /**
8264
+ * Returns whether or not the player is on the first floor of the particular run.
8265
+ *
8266
+ * This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
8267
+ * first floor and The Ascent.
8268
+ */
8269
+ export declare function onFirstFloor(): boolean;
8270
+
8271
+ /**
8272
+ * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
8273
+ * `StageType.REPENTANCE_B`.
8274
+ */
8258
8275
  export declare function onRepentanceStage(): boolean;
8259
8276
 
8260
8277
  /**
@@ -10863,12 +10880,6 @@ export declare function spawnCustomGridEntity(gridEntityTypeCustom: GridEntityTy
10863
10880
  * want to create a custom trapdoor that goes to a vanilla stage instead, use the
10864
10881
  * `spawnCustomTrapdoorToVanilla` helper function.
10865
10882
  *
10866
- * Custom trapdoors can have one or more of the following attributes:
10867
- *
10868
- * - custom destination (or custom logic for after the player enters)
10869
- * - custom graphics
10870
- * - custom logic for opening/closing
10871
- *
10872
10883
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
10873
10884
  * respawned every time the player re-enters the room.
10874
10885
  *
@@ -11283,6 +11294,9 @@ export declare function tanh(x: number): number;
11283
11294
  */
11284
11295
  export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim, force?: boolean): void;
11285
11296
 
11297
+ /** For `GridEntityType.TELEPORTER` (23). */
11298
+ export declare const TELEPORTER_ACTIVATION_DISTANCE: number;
11299
+
11286
11300
  /**
11287
11301
  * Helper function to temporarily remove a specific kind of trinket from the player. Use this in
11288
11302
  * combination with the `giveTrinketsBack` function to take away and give back a trinket on the same
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "9.1.1",
3
+ "version": "9.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -161,6 +161,9 @@ export const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
161
161
  /** After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount. */
162
162
  export const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
163
163
 
164
+ /** For `GridEntityType.TELEPORTER` (23). */
165
+ export const TELEPORTER_ACTIVATION_DISTANCE = DISTANCE_OF_GRID_TILE / 2;
166
+
164
167
  /**
165
168
  * This is the number of draw coordinates that each heart spans on the UI in the upper left hand
166
169
  * corner.
@@ -10,12 +10,6 @@ import { spawnCustomTrapdoorToDestination } from "./spawn";
10
10
  * want to create a custom trapdoor that goes to a vanilla stage instead, use the
11
11
  * `spawnCustomTrapdoorToVanilla` helper function.
12
12
  *
13
- * Custom trapdoors can have one or more of the following attributes:
14
- *
15
- * - custom destination (or custom logic for after the player enters)
16
- * - custom graphics
17
- * - custom logic for opening/closing
18
- *
19
13
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
20
14
  * respawned every time the player re-enters the room.
21
15
  *
@@ -1249,7 +1249,7 @@ export function sounds(): void {
1249
1249
  */
1250
1250
  export function spam(): void {
1251
1251
  v.run.spamBloodRights = !v.run.spamBloodRights;
1252
- printEnabled(v.run.maxSpeed, "spamming Blood Rights");
1252
+ printEnabled(v.run.spamBloodRights, "spamming Blood Rights");
1253
1253
  }
1254
1254
 
1255
1255
  /** Spawns a golden version of the specified trinket type. */
@@ -6,6 +6,7 @@ import { SaveDataKey } from "../../enums/SaveDataKey";
6
6
  import { SerializationType } from "../../enums/SerializationType";
7
7
  import { deepCopy } from "../../functions/deepCopy";
8
8
  import { logError } from "../../functions/log";
9
+ import { onFirstFloor } from "../../functions/stage";
9
10
  import { clearTable, iterateTableInOrder } from "../../functions/table";
10
11
  import { SaveData } from "../../interfaces/SaveData";
11
12
  import { loadFromDisk } from "./load";
@@ -49,6 +50,8 @@ function postPlayerInit() {
49
50
  );
50
51
  }
51
52
 
53
+ // We want to only load data once per run to handle the case of a player using Genesis, a second
54
+ // player joining the run, and so on.
52
55
  if (loadedDataOnThisRun) {
53
56
  return;
54
57
  }
@@ -86,7 +89,19 @@ function preGameExit() {
86
89
 
87
90
  // ModCallback.POST_NEW_LEVEL (18)
88
91
  function postNewLevel() {
92
+ if (mod === null) {
93
+ error(
94
+ `The mod for the ${SAVE_DATA_MANAGER_FEATURE_NAME} was not initialized.`,
95
+ );
96
+ }
97
+
89
98
  restoreDefaults(SaveDataKey.LEVEL);
99
+
100
+ // We save data to disk at the beginning of every floor (for the 2nd floor and beyond) to emulate
101
+ // what the game does internally. (This mitigates data loss in the event of a crash).
102
+ if (!onFirstFloor()) {
103
+ saveToDisk(mod, saveDataMap, saveDataConditionalFuncMap);
104
+ }
90
105
  }
91
106
 
92
107
  // ModCallbackCustom.POST_NEW_ROOM_EARLY
@@ -388,6 +388,7 @@ export function inLRoom(): boolean {
388
388
  );
389
389
  }
390
390
 
391
+ /** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */
391
392
  export function inMegaSatanRoom(): boolean {
392
393
  const roomGridIndex = getRoomGridIndex();
393
394
 
@@ -116,6 +116,10 @@ export function goToStage(stage: LevelStage, stageType: StageType): void {
116
116
  Isaac.ExecuteCommand(command);
117
117
  }
118
118
 
119
+ /**
120
+ * Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
121
+ * `StageType.REPENTANCE_B`.
122
+ */
119
123
  export function isRepentanceStage(stageType: StageType): boolean {
120
124
  return (
121
125
  stageType === StageType.REPENTANCE || stageType === StageType.REPENTANCE_B
@@ -178,6 +182,23 @@ export function onFinalFloor(): boolean {
178
182
  );
179
183
  }
180
184
 
185
+ /**
186
+ * Returns whether or not the player is on the first floor of the particular run.
187
+ *
188
+ * This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
189
+ * first floor and The Ascent.
190
+ */
191
+ export function onFirstFloor(): boolean {
192
+ const effectiveStage = getEffectiveStage();
193
+ const isOnAscent = onAscent();
194
+
195
+ return effectiveStage === 1 && !isOnAscent;
196
+ }
197
+
198
+ /**
199
+ * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
200
+ * `StageType.REPENTANCE_B`.
201
+ */
181
202
  export function onRepentanceStage(): boolean {
182
203
  const level = game.GetLevel();
183
204
  const stageType = level.GetStageType();