isaacscript-common 1.2.186 → 1.2.189

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.
@@ -0,0 +1,7 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Returns the starting stat that Isaac (the default character) starts with.
4
+ *
5
+ * For example, if you pass this function `CacheFlag.CACHE_DAMAGE`, it will return 3.5.
6
+ */
7
+ export declare function getDefaultPlayerStat(cacheFlag: CacheFlag): float | boolean | undefined;
@@ -0,0 +1,9 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local ____exports = {}
4
+ local ____defaultPlayerStatMap = require("maps.defaultPlayerStatMap")
5
+ local DEFAULT_PLAYER_STAT_MAP = ____defaultPlayerStatMap.DEFAULT_PLAYER_STAT_MAP
6
+ function ____exports.getDefaultPlayerStat(self, cacheFlag)
7
+ return DEFAULT_PLAYER_STAT_MAP:get(cacheFlag)
8
+ end
9
+ return ____exports
@@ -9,4 +9,4 @@ export declare function onSetSeed(): boolean;
9
9
  * Helper function to restart the game using the console command of "restart". You can optionally
10
10
  * specify a `PlayerType` to restart the game as that character.
11
11
  */
12
- export declare function restart(character?: PlayerType): void;
12
+ export declare function restart(character?: PlayerType | int): void;
@@ -16,7 +16,7 @@ function ____exports.restart(self, character)
16
16
  Isaac.ExecuteCommand("restart")
17
17
  return
18
18
  end
19
- if character < 0 or character >= PlayerType.NUM_PLAYER_TYPES then
19
+ if character < 0 then
20
20
  error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
21
21
  end
22
22
  log("Restarting as character: " .. tostring(character))
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export { hasSirenStolenFamiliar, setFamiliarNoSirenSteal, } from "./features/sir
29
29
  export { getTaintedLazarusSubPlayer } from "./features/taintedLazarusPlayers";
30
30
  export * from "./functions/array";
31
31
  export * from "./functions/bitwise";
32
+ export * from "./functions/cacheFlag";
32
33
  export * from "./functions/cards";
33
34
  export * from "./functions/challenges";
34
35
  export * from "./functions/charge";
package/dist/index.lua CHANGED
@@ -241,6 +241,14 @@ do
241
241
  end
242
242
  end
243
243
  end
244
+ do
245
+ local ____export = require("functions.cacheFlag")
246
+ for ____exportKey, ____exportValue in pairs(____export) do
247
+ if ____exportKey ~= "default" then
248
+ ____exports[____exportKey] = ____exportValue
249
+ end
250
+ end
251
+ end
244
252
  do
245
253
  local ____export = require("functions.cards")
246
254
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -0,0 +1,2 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare const DEFAULT_PLAYER_STAT_MAP: Map<CacheFlag, number | boolean>;
@@ -0,0 +1,14 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local ____exports = {}
5
+ ____exports.DEFAULT_PLAYER_STAT_MAP = __TS__New(Map, {
6
+ {CacheFlag.CACHE_DAMAGE, 3.5},
7
+ {CacheFlag.CACHE_FIREDELAY, 10},
8
+ {CacheFlag.CACHE_SHOTSPEED, 1},
9
+ {CacheFlag.CACHE_RANGE, 6.5},
10
+ {CacheFlag.CACHE_SPEED, 1},
11
+ {CacheFlag.CACHE_FLYING, false},
12
+ {CacheFlag.CACHE_LUCK, 0}
13
+ })
14
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.186",
3
+ "version": "1.2.189",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",