isaacscript-common 1.0.559 → 1.0.560

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,3 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** Get the proper name for a `Challenge` enum. This will only work for vanilla challenges. */
3
+ export declare function getChallengeName(challenge: Challenge): string;
@@ -0,0 +1,9 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local ____challengeNameMap = require("maps.challengeNameMap")
4
+ local CHALLENGE_NAME_MAP = ____challengeNameMap.CHALLENGE_NAME_MAP
5
+ function ____exports.getChallengeName(self, challenge)
6
+ local challengeName = CHALLENGE_NAME_MAP:get(challenge)
7
+ return ((challengeName == nil) and "Unknown") or challengeName
8
+ end
9
+ return ____exports
@@ -1,6 +1,8 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
+ local ____constants = require("constants")
5
+ local MAX_PLAYER_POCKET_ITEM_SLOTS = ____constants.MAX_PLAYER_POCKET_ITEM_SLOTS
4
6
  local ____PocketItemType = require("types.PocketItemType")
5
7
  local PocketItemType = ____PocketItemType.PocketItemType
6
8
  function ____exports.getPocketItems(self, player)
@@ -14,7 +16,7 @@ function ____exports.getPocketItems(self, player)
14
16
  local pocketItem2Identified = false
15
17
  do
16
18
  local slot = 0
17
- while slot < 4 do
19
+ while slot < MAX_PLAYER_POCKET_ITEM_SLOTS do
18
20
  local card = player:GetCard(slot)
19
21
  local pill = player:GetPill(slot)
20
22
  if card ~= Card.CARD_NULL then
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { hasSirenStolenFamiliar, setFamiliarNoSirenSteal, } from "./features/sir
11
11
  export * from "./functions/array";
12
12
  export * from "./functions/bitwise";
13
13
  export * from "./functions/cards";
14
+ export * from "./functions/challenges";
14
15
  export * from "./functions/charge";
15
16
  export * from "./functions/collectibles";
16
17
  export * from "./functions/collectibleSet";
package/dist/index.lua CHANGED
@@ -100,6 +100,14 @@ do
100
100
  end
101
101
  end
102
102
  end
103
+ do
104
+ local ____export = require("functions.challenges")
105
+ for ____exportKey, ____exportValue in pairs(____export) do
106
+ if ____exportKey ~= "default" then
107
+ ____exports[____exportKey] = ____exportValue
108
+ end
109
+ end
110
+ end
103
111
  do
104
112
  local ____export = require("functions.charge")
105
113
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -0,0 +1,2 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare const CHALLENGE_NAME_MAP: Map<Challenge, string>;
@@ -0,0 +1,5 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ require("lualib_bundle");
3
+ local ____exports = {}
4
+ ____exports.CHALLENGE_NAME_MAP = __TS__New(Map, {{Challenge.CHALLENGE_PITCH_BLACK, "Pitch Black"}, {Challenge.CHALLENGE_HIGH_BROW, "High Brow"}, {Challenge.CHALLENGE_HEAD_TRAUMA, "Head Trauma"}, {Challenge.CHALLENGE_DARKNESS_FALLS, "Darkness Falls"}, {Challenge.CHALLENGE_THE_TANK, "The Tank"}, {Challenge.CHALLENGE_SOLAR_SYSTEM, "Solar System"}, {Challenge.CHALLENGE_SUICIDE_KING, "Suicide King"}, {Challenge.CHALLENGE_CAT_GOT_YOUR_TONGUE, "Cat Got Your Tongue"}, {Challenge.CHALLENGE_DEMO_MAN, "Demo Man"}, {Challenge.CHALLENGE_CURSED, "Cursed!"}, {Challenge.CHALLENGE_GLASS_CANNON, "Glass Cannon"}, {Challenge.CHALLENGE_WHEN_LIFE_GIVES_LEMONS, "When Life Gives You Lemons"}, {Challenge.CHALLENGE_BEANS, "Beans!"}, {Challenge.CHALLENGE_ITS_IN_THE_CARDS, "It's In The Cards"}, {Challenge.CHALLENGE_SLOW_ROLL, "Slow Roll"}, {Challenge.CHALLENGE_COMPUTER_SAVY, "Computer Savvy"}, {Challenge.CHALLENGE_WAKA_WAKA, "Waka Waka"}, {Challenge.CHALLENGE_THE_HOST, "The Host"}, {Challenge.CHALLENGE_THE_FAMILY_MAN, "The Family Man"}, {Challenge.CHALLENGE_PURIST, "Purist"}, {Challenge.CHALLENGE_XXXXXXXXL, "XXXXXXXXL"}, {Challenge.CHALLENGE_SPEED, "SPEED!"}, {Challenge.CHALLENGE_BLUE_BOMBER, "Blue Bomber"}, {Challenge.CHALLENGE_PAY_TO_PLAY, "PAY TO PLAY"}, {Challenge.CHALLENGE_HAVE_A_HEART, "Have a Heart"}, {Challenge.CHALLENGE_I_RULE, "I RULE!"}, {Challenge.CHALLENGE_BRAINS, "BRAINS!"}, {Challenge.CHALLENGE_PRIDE_DAY, "PRIDE DAY!"}, {Challenge.CHALLENGE_ONANS_STREAK, "Onan's Streak"}, {Challenge.CHALLENGE_GUARDIAN, "The Guardian"}, {Challenge.CHALLENGE_BACKASSWARDS, "Backasswards"}, {Challenge.CHALLENGE_APRILS_FOOL, "Aprils Fool"}, {Challenge.CHALLENGE_POKEY_MANS, "Pokey Mans"}, {Challenge.CHALLENGE_ULTRA_HARD, "Ultra Hard"}, {Challenge.CHALLENGE_PONG, "Pong"}, {Challenge.CHALLENGE_SCAT_MAN, "Scat Man"}, {Challenge.CHALLENGE_BLOODY_MARY, "Bloody Mary"}, {Challenge.CHALLENGE_BAPTISM_BY_FIRE, "Baptism By Fire"}, {Challenge.CHALLENGE_ISAACS_AWAKENING, "Isaac's Awakening"}, {Challenge.CHALLENGE_SEEING_DOUBLE, "Seeing Double"}, {Challenge.CHALLENGE_PICA_RUN, "Pica Run"}, {Challenge.CHALLENGE_HOT_POTATO, "Hot Potato"}, {Challenge.CHALLENGE_CANTRIPPED, "Cantripped!"}, {Challenge.CHALLENGE_RED_REDEMPTION, "Red Redemption"}, {Challenge.CHALLENGE_DELETE_THIS, "DELETE THIS"}})
5
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.559",
3
+ "version": "1.0.560",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,7 +25,7 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "isaac-typescript-definitions": "^1.0.307",
28
+ "isaac-typescript-definitions": "^1.0.310",
29
29
  "isaacscript-lint": "^1.0.74",
30
30
  "typedoc": "^0.22.10",
31
31
  "typescript": "4.4.4",