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.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/classes/DefaultMap.d.ts +1 -1
  3. package/classes/ModUpgraded.d.ts +8 -2
  4. package/constants.d.ts +5 -5
  5. package/constants.lua +1 -1
  6. package/{constantsMax.d.ts → constantsFirstLast.d.ts} +0 -0
  7. package/{constantsMax.lua → constantsFirstLast.lua} +0 -0
  8. package/enums/HealthType.d.ts +2 -2
  9. package/enums/ModCallbackCustom.d.ts +753 -2
  10. package/features/debugDisplay/exports.d.ts +36 -36
  11. package/features/deployJSONRoom.d.ts +1 -1
  12. package/features/extraConsoleCommands/commandsDisplay.d.ts +18 -18
  13. package/features/extraConsoleCommands/init.d.ts +3 -2
  14. package/features/extraConsoleCommands/init.lua +76 -76
  15. package/features/extraConsoleCommands/{commands.d.ts → listCommands.d.ts} +17 -17
  16. package/features/extraConsoleCommands/{commands.lua → listCommands.lua} +9 -9
  17. package/features/{isPonyActive.d.ts → ponyDetection.d.ts} +0 -0
  18. package/features/{isPonyActive.lua → ponyDetection.lua} +2 -2
  19. package/features/{preventCollectibleRotate.d.ts → preventCollectibleRotation.d.ts} +1 -1
  20. package/features/{preventCollectibleRotate.lua → preventCollectibleRotation.lua} +3 -3
  21. package/features/saveDataManager/exports.d.ts +13 -10
  22. package/features/saveDataManager/load.d.ts +1 -1
  23. package/features/saveDataManager/main.d.ts +1 -1
  24. package/features/saveDataManager/maps.d.ts +1 -1
  25. package/features/saveDataManager/save.d.ts +1 -1
  26. package/functions/cards.lua +5 -5
  27. package/functions/character.lua +2 -2
  28. package/functions/chargeBar.d.ts +1 -1
  29. package/functions/collectibleCacheFlag.d.ts +4 -4
  30. package/functions/collectibleSet.lua +2 -2
  31. package/functions/collectibles.lua +5 -5
  32. package/functions/enums.d.ts +3 -3
  33. package/functions/jsonRoom.d.ts +1 -1
  34. package/functions/pills.lua +9 -9
  35. package/functions/playerDataStructures.d.ts +51 -0
  36. package/functions/playerDataStructures.lua +4 -0
  37. package/functions/playerHealth.d.ts +1 -1
  38. package/functions/pocketItems.d.ts +1 -1
  39. package/functions/run.lua +2 -2
  40. package/functions/spawnCollectible.lua +3 -3
  41. package/functions/trinketGive.d.ts +1 -1
  42. package/functions/trinkets.lua +5 -5
  43. package/functions/utils.d.ts +2 -2
  44. package/index.d.ts +14 -13
  45. package/index.lua +12 -12
  46. package/initFeatures.lua +6 -6
  47. package/{types → interfaces}/AddCallbackParameterCustom.d.ts +0 -0
  48. package/{types → interfaces}/AddCallbackParameterCustom.lua +0 -0
  49. package/{types → interfaces}/ChargeBarSprites.d.ts +0 -0
  50. package/{types → interfaces}/ChargeBarSprites.lua +0 -0
  51. package/{types → interfaces}/JSONDoor.d.ts +1 -0
  52. package/{types → interfaces}/JSONDoor.lua +0 -0
  53. package/{types → interfaces}/JSONEntity.d.ts +1 -0
  54. package/{types → interfaces}/JSONEntity.lua +0 -0
  55. package/{types → interfaces}/JSONRoom.d.ts +1 -5
  56. package/{types → interfaces}/JSONRoom.lua +0 -0
  57. package/{types → interfaces}/JSONRooms.d.ts +0 -0
  58. package/{types → interfaces}/JSONRooms.lua +0 -0
  59. package/{types → interfaces}/JSONSpawn.d.ts +1 -0
  60. package/{types → interfaces}/JSONSpawn.lua +0 -0
  61. package/{types → interfaces}/PlayerHealth.d.ts +1 -0
  62. package/{types → interfaces}/PlayerHealth.lua +0 -0
  63. package/{types → interfaces}/PocketItemDescription.d.ts +1 -0
  64. package/{types → interfaces}/PocketItemDescription.lua +0 -0
  65. package/interfaces/SaveData.d.ts +29 -0
  66. package/{types → interfaces}/SaveData.lua +0 -0
  67. package/{types → interfaces}/TrinketSituation.d.ts +1 -0
  68. package/{types → interfaces}/TrinketSituation.lua +0 -0
  69. package/{types → interfaces}/private/TSTLClassMetatable.d.ts +0 -0
  70. package/{types → interfaces}/private/TSTLClassMetatable.lua +0 -0
  71. package/maps/cardMap.lua +85 -85
  72. package/maps/characterMap.lua +58 -58
  73. package/maps/pillEffectMap.lua +39 -39
  74. package/maps/roomTypeMap.lua +12 -12
  75. package/objects/callbackRegisterFunctions.d.ts +1 -1
  76. package/objects/roomTypeNames.lua +1 -1
  77. package/package.json +1 -1
  78. package/types/PickingUpItem.d.ts +12 -2
  79. package/types/PickingUpItem.lua +3 -0
  80. package/upgradeMod.d.ts +2 -1
  81. package/types/SaveData.d.ts +0 -28
package/README.md CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/isaacscript-common.svg)](https://www.npmjs.com/package/isaacscript-common)
4
4
 
5
- This package contains helper functions and extra features for IsaacScript mods. Start by [browsing the auto-generated documentation](https://isaacscript.github.io/docs/api).
5
+ This package contains helper functions and extra features for IsaacScript mods. Start by [browsing the auto-generated documentation](https://isaacscript.github.io/isaacscript-common).
6
6
 
7
7
  For more information about IsaacScript, see the [official website](https://isaacscript.github.io/).
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A function that creates the value for your default map. For example, if it was a default map
3
- * containing a map, the factory function would be: `() => new Map()`
3
+ * containing maps, the factory function would be: `() => new Map()`
4
4
  */
5
5
  export declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs: Args) => V;
6
6
  declare type FirstArg<K, V, Args extends unknown[]> = Iterable<[K, V]> | V | FactoryFunction<V, Args>;
@@ -1,7 +1,13 @@
1
1
  import { ModCallback } from "isaac-typescript-definitions";
2
2
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
3
- import { AddCallbackParameterCustom } from "../types/AddCallbackParameterCustom";
4
- /** `isaacscript-common` allows for custom callbacks, so it provides an upgraded Mod object. */
3
+ import { AddCallbackParameterCustom } from "../interfaces/AddCallbackParameterCustom";
4
+ /**
5
+ * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
6
+ * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
7
+ * extends the base class and adds a new method of `AddCallbackCustom`.
8
+ *
9
+ * To upgrade your mod, use the `upgradeMod` helper function.
10
+ */
5
11
  export declare class ModUpgraded implements Mod {
6
12
  Name: string;
7
13
  /** We store a copy of the original mod object so that we can re-implement its functions. */
package/constants.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare const BOMB_EXPLODE_FRAME = 45;
14
14
  export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE;
15
15
  /** This is also the distance that a player spawns from the door that they enter a room from. */
16
16
  export declare const DISTANCE_OF_GRID_TILE = 40;
17
- export declare const DOOR_HITBOX_DISTANCE = 11;
17
+ export declare const DOOR_HITBOX_RADIUS = 11;
18
18
  /**
19
19
  * When Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and spawn 14 Swarm Spiders
20
20
  * while their StateFrame ticks upwards. The 14th spider appears when the StateFrame is at this
@@ -93,12 +93,12 @@ export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
93
93
  */
94
94
  export declare const UI_HEART_WIDTH = 12;
95
95
  /**
96
- * This is a safer version of the `Vector.One` constant. (Other mods can mutate this vector, so it
97
- * is not safe to use.)
96
+ * This is a safer version of the `Vector.One` constant. (Other mods can mutate this `Vector.One`,
97
+ * so it is not safe to use.)
98
98
  */
99
99
  export declare const VectorOne: Readonly<Vector>;
100
100
  /**
101
- * This is a safer version of the `Vector.Zero` constant. (Other mods can mutate this vector, so it
102
- * is not safe to use.)
101
+ * This is a safer version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero`
102
+ * vector, so it is not safe to use.)
103
103
  */
104
104
  export declare const VectorZero: Readonly<Vector>;
package/constants.lua CHANGED
@@ -13,7 +13,7 @@ ____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
13
13
  ____exports.BOMB_EXPLODE_FRAME = 45
14
14
  ____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE
15
15
  ____exports.DISTANCE_OF_GRID_TILE = 40
16
- ____exports.DOOR_HITBOX_DISTANCE = 11
16
+ ____exports.DOOR_HITBOX_RADIUS = 11
17
17
  ____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
18
18
  ____exports.EMPTY_PNG_PATH = "gfx/none.png"
19
19
  ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This represents the type of health that is either given or taken away from a player. Note that we
3
- * cannot use the HeartSubType enum for this purpose this since it has no value for broken hearts or
4
- * max hearts.
3
+ * cannot use the `HeartSubType` enum for this purpose this since it has no value for broken hearts
4
+ * or max hearts.
5
5
  */
6
6
  export declare enum HealthType {
7
7
  RED = 0,