isaacscript-common 1.2.85 → 1.2.88

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.
@@ -45,7 +45,7 @@ function checkPickupsPurchased(self, pickups, players)
45
45
  nil,
46
46
  player,
47
47
  pickupDescription.variant,
48
- pickupDescription.subtype,
48
+ pickupDescription.subType,
49
49
  pickupDescription.price
50
50
  )
51
51
  end
@@ -70,7 +70,7 @@ function storePickupsInMap(self, pickups)
70
70
  function(____, pickup) return pickup.Price ~= 0 end
71
71
  )
72
72
  for ____, pickup in ipairs(pickupsWithPrice) do
73
- v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subtype = pickup.SubType, price = pickup.Price})
73
+ v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subType = pickup.SubType, price = pickup.Price})
74
74
  end
75
75
  end
76
76
  function storePlayersInMap(self, players)
@@ -4,8 +4,8 @@
4
4
  * beginning of every run.
5
5
  *
6
6
  * @param familiarVariant The familiar variant to blacklist.
7
- * @param familiarSubType The subtype to blacklist. Optional. The default is to blacklist all
8
- * subtypes of the given variant.
7
+ * @param familiarSubType The sub-type to blacklist. Optional. The default is to blacklist all
8
+ * sub-types of the given variant.
9
9
  */
10
10
  export declare function setFamiliarNoSirenSteal(familiarVariant: FamiliarVariant | int, familiarSubType?: int): void;
11
11
  /**
@@ -0,0 +1,3 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function testInit(mod: Mod): void;
3
+ export declare function test(): void;
@@ -0,0 +1,24 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local Set = ____lualib.Set
4
+ local __TS__New = ____lualib.__TS__New
5
+ local ____exports = {}
6
+ local postPEffectUpdate
7
+ local ____errors = require("errors")
8
+ local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
9
+ function postPEffectUpdate(self, _player)
10
+ end
11
+ local FEATURE_NAME = "test"
12
+ local initialized = false
13
+ local v = {run = {playersIsPonyActive = __TS__New(Set)}}
14
+ function ____exports.testInit(self, mod)
15
+ initialized = true
16
+ mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, postPEffectUpdate)
17
+ end
18
+ function ____exports.test(self)
19
+ if not initialized then
20
+ local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
21
+ error(msg)
22
+ end
23
+ end
24
+ return ____exports
@@ -19,16 +19,16 @@ export declare function fireProjectiles(npc: EntityNPC, position: Vector, veloci
19
19
  * This function will not include bosses on an internal blacklist, such as Death's scythes or Big
20
20
  * Horn holes.
21
21
  */
22
- export declare function getAliveBosses(): EntityNPC[];
22
+ export declare function getAliveBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
23
23
  /**
24
24
  * Helper function to get all of the non-dead NPCs in the room.
25
25
  *
26
26
  * This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
27
27
  * holes.
28
28
  */
29
- export declare function getAliveNPCs(): EntityNPC[];
29
+ export declare function getAliveNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
30
30
  /** Helper function to get all of the bosses in the room. */
31
- export declare function getBosses(): EntityNPC[];
31
+ export declare function getBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
32
32
  /** The same thing as the `getEntities()` function, but returns only NPCs. */
33
33
  export declare function getNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
34
34
  /**
@@ -14,8 +14,17 @@ local getFilteredNewEntities = ____entity.getFilteredNewEntities
14
14
  local removeEntities = ____entity.removeEntities
15
15
  local ____entitySpecific = require("functions.entitySpecific")
16
16
  local getProjectiles = ____entitySpecific.getProjectiles
17
- function ____exports.getAliveNPCs(self)
18
- local npcs = ____exports.getNPCs(nil)
17
+ function ____exports.getAliveNPCs(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
18
+ if ignoreFriendly == nil then
19
+ ignoreFriendly = false
20
+ end
21
+ local npcs = ____exports.getNPCs(
22
+ nil,
23
+ matchingEntityType,
24
+ matchingVariant,
25
+ matchingSubType,
26
+ ignoreFriendly
27
+ )
19
28
  return __TS__ArrayFilter(
20
29
  npcs,
21
30
  function(____, npc) return not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) end
@@ -99,15 +108,33 @@ function ____exports.fireProjectiles(self, npc, position, velocity, projectilesM
99
108
  local newProjectiles = getProjectiles(nil, projectileParams.Variant)
100
109
  return getFilteredNewEntities(nil, oldProjectiles, newProjectiles)
101
110
  end
102
- function ____exports.getAliveBosses(self)
103
- local aliveNPCs = ____exports.getAliveNPCs(nil)
111
+ function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
112
+ if ignoreFriendly == nil then
113
+ ignoreFriendly = false
114
+ end
115
+ local aliveNPCs = ____exports.getAliveNPCs(
116
+ nil,
117
+ matchingEntityType,
118
+ matchingVariant,
119
+ matchingSubType,
120
+ ignoreFriendly
121
+ )
104
122
  return __TS__ArrayFilter(
105
123
  aliveNPCs,
106
124
  function(____, aliveNPC) return aliveNPC:IsBoss() end
107
125
  )
108
126
  end
109
- function ____exports.getBosses(self)
110
- local npcs = ____exports.getNPCs(nil)
127
+ function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
128
+ if ignoreFriendly == nil then
129
+ ignoreFriendly = false
130
+ end
131
+ local npcs = ____exports.getNPCs(
132
+ nil,
133
+ matchingEntityType,
134
+ matchingVariant,
135
+ matchingSubType,
136
+ ignoreFriendly
137
+ )
111
138
  return __TS__ArrayFilter(
112
139
  npcs,
113
140
  function(____, npc) return npc:IsBoss() end
@@ -23,15 +23,11 @@ export declare function getCurrentRoomDescriptorReadOnly(): RoomDescriptorReadOn
23
23
  */
24
24
  export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined;
25
25
  /**
26
- * Helper function to get the type of a room from the XML/STB data. The room data type will
27
- * correspond to different things depending on what XML/STB file it draws from. For example, in the
28
- * "00.special rooms.stb" file, a room type of 2 corresponds to a shop, a room type of 3 corresponds
29
- * to an I AM ERROR room, and so on.
26
+ * Helper function for getting the type of the room with the given grid index.
30
27
  *
31
- * @param roomGridIndex Optional. Equal to the current room index by default.
32
28
  * @returns The room data type. Returns -1 if the type was not found.
33
29
  */
34
- export declare function getRoomDataType(roomGridIndex?: int): int;
30
+ export declare function getRoomType(roomGridIndex: int): RoomType;
35
31
  /**
36
32
  * Helper function to get the descriptor for a room.
37
33
  *
@@ -97,13 +93,13 @@ export declare function getRoomSafeGridIndex(roomGridIndex?: int): int;
97
93
  */
98
94
  export declare function getRoomStageID(roomGridIndex?: int): StageID;
99
95
  /**
100
- * Helper function to get the subtype for a room from the XML/STB data. The room subtype will
96
+ * Helper function to get the sub-type for a room from the XML/STB data. The room sub-type will
101
97
  * correspond to different things depending on what XML/STB file it draws from. For example, in the
102
- * "00.special rooms.stb" file, an Angel Room with a subtype of 0 will correspond to a normal Angel
103
- * Room and a subtype of 1 will correspond to an Angel Room shop for The Stairway.
98
+ * "00.special rooms.stb" file, an Angel Room with a sub-type of 0 will correspond to a normal Angel
99
+ * Room and a sub-type of 1 will correspond to an Angel Room shop for The Stairway.
104
100
  *
105
101
  * @param roomGridIndex Optional. Equal to the current room index by default.
106
- * @returns The room subtype. Returns -1 if the subtype was not found.
102
+ * @returns The room sub-type. Returns -1 if the sub-type was not found.
107
103
  */
108
104
  export declare function getRoomSubType(roomGridIndex?: int): int;
109
105
  /**
@@ -129,7 +129,7 @@ function ____exports.getCurrentDimension(self)
129
129
  end
130
130
  return error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
131
131
  end
132
- function ____exports.getRoomDataType(self, roomGridIndex)
132
+ function ____exports.getRoomType(self, roomGridIndex)
133
133
  local roomData = ____exports.getRoomData(nil, roomGridIndex)
134
134
  return roomData == nil and -1 or roomData.Type
135
135
  end
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/dep
4
4
  export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
5
5
  export { forgottenSwitch } from "./features/forgottenSwitch";
6
6
  export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
7
- export { isPonyActive } from "./features/isPonyActive";
8
7
  export { preventCollectibleRotate } from "./features/preventCollectibleRotate";
9
8
  export { runInNGameFrames, runInNRenderFrames, runNextGameFrame, runNextRenderFrame, } from "./features/runInNFrames";
10
9
  export * from "./features/saveDataManager/exports";
package/dist/index.lua CHANGED
@@ -49,11 +49,6 @@ do
49
49
  local getCollectibleItemPoolType = ____getCollectibleItemPoolType.getCollectibleItemPoolType
50
50
  ____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
51
51
  end
52
- do
53
- local ____isPonyActive = require("features.isPonyActive")
54
- local isPonyActive = ____isPonyActive.isPonyActive
55
- ____exports.isPonyActive = isPonyActive
56
- end
57
52
  do
58
53
  local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
59
54
  local preventCollectibleRotate = ____preventCollectibleRotate.preventCollectibleRotate
@@ -79,8 +79,6 @@ local ____forgottenSwitch = require("features.forgottenSwitch")
79
79
  local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
80
80
  local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
81
81
  local getCollectibleItemPoolTypeInit = ____getCollectibleItemPoolType.getCollectibleItemPoolTypeInit
82
- local ____isPonyActive = require("features.isPonyActive")
83
- local isPonyActiveInit = ____isPonyActive.isPonyActiveInit
84
82
  local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
85
83
  local preventCollectibleRotateInit = ____preventCollectibleRotate.preventCollectibleRotateInit
86
84
  local ____runInNFrames = require("features.runInNFrames")
@@ -139,7 +137,6 @@ function initFeatures(self, mod)
139
137
  preventCollectibleRotateInit(nil, mod)
140
138
  runInNFramesInit(nil, mod)
141
139
  sirenHelpersInit(nil, mod)
142
- isPonyActiveInit(nil, mod)
143
140
  end
144
141
  function ____exports.upgradeMod(self, modVanilla, verbose)
145
142
  if verbose == nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.85",
3
+ "version": "1.2.88",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",