isaacscript-common 1.0.490 → 1.0.494
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.
- package/dist/callbacks/subscriptions/postBombInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPickupCollect.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPurchase.d.ts +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.d.ts +1 -1
- package/dist/constants.d.ts +9 -0
- package/dist/constants.lua +3 -0
- package/dist/functions/collectibles.d.ts +8 -1
- package/dist/functions/collectibles.lua +3 -3
- package/dist/functions/deepCopy.lua +3 -3
- package/dist/functions/entity.d.ts +82 -11
- package/dist/functions/entity.lua +42 -45
- package/dist/functions/gridEntity.d.ts +16 -2
- package/dist/functions/gridEntity.lua +2 -2
- package/dist/functions/npc.d.ts +6 -1
- package/dist/functions/npc.lua +3 -4
- package/dist/functions/player.d.ts +12 -0
- package/dist/functions/player.lua +23 -15
- package/dist/types/CallbackParametersCustom.d.ts +9 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostBombInitLateCallbackType = (bomb: EntityBomb) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostBombInitLateCallbackType, bombVariant?: BombVariant): void;
|
|
4
|
+
export declare function register(callback: PostBombInitLateCallbackType, bombVariant?: BombVariant | int): void;
|
|
5
5
|
export declare function fire(bomb: EntityBomb): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostFamiliarInitLateCallbackType = (familiar: EntityFamiliar) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostFamiliarInitLateCallbackType, familiarVariant?: FamiliarVariant): void;
|
|
4
|
+
export declare function register(callback: PostFamiliarInitLateCallbackType, familiarVariant?: FamiliarVariant | int): void;
|
|
5
5
|
export declare function fire(familiar: EntityFamiliar): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostKnifeInitLateCallbackType = (knife: EntityKnife) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostKnifeInitLateCallbackType, knifeVariant?: KnifeVariant): void;
|
|
4
|
+
export declare function register(callback: PostKnifeInitLateCallbackType, knifeVariant?: KnifeVariant | int): void;
|
|
5
5
|
export declare function fire(knife: EntityKnife): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostLaserInitLateCallbackType = (laser: EntityLaser) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostLaserInitLateCallbackType, laserVariant?: LaserVariant): void;
|
|
4
|
+
export declare function register(callback: PostLaserInitLateCallbackType, laserVariant?: LaserVariant | int): void;
|
|
5
5
|
export declare function fire(laser: EntityLaser): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostPickupCollectCallbackType = (pickup: EntityPickup, player: EntityPlayer) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostPickupCollectCallbackType, pickupVariant?: PickupVariant): void;
|
|
4
|
+
export declare function register(callback: PostPickupCollectCallbackType, pickupVariant?: PickupVariant | int): void;
|
|
5
5
|
export declare function fire(pickup: EntityPickup, player: EntityPlayer): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostPickupInitLateCallbackType = (pickup: EntityPickup) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostPickupInitLateCallbackType, pickupVariant?: PickupVariant): void;
|
|
4
|
+
export declare function register(callback: PostPickupInitLateCallbackType, pickupVariant?: PickupVariant | int): void;
|
|
5
5
|
export declare function fire(pickup: EntityPickup): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostProjectileInitLateCallbackType = (projectile: EntityProjectile) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostProjectileInitLateCallbackType, projectileVariant?: ProjectileVariant): void;
|
|
4
|
+
export declare function register(callback: PostProjectileInitLateCallbackType, projectileVariant?: ProjectileVariant | int): void;
|
|
5
5
|
export declare function fire(projectile: EntityProjectile): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
export declare type PostPurchaseCallbackType = (player: EntityPlayer, pickupVariant: PickupVariant, pickupSubType: int, pickupPrice: int) => void;
|
|
2
|
+
export declare type PostPurchaseCallbackType = (player: EntityPlayer, pickupVariant: PickupVariant | int, pickupSubType: int, pickupPrice: int) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostPurchaseCallbackType, pickupVariant?: PickupVariant, pickupSubType?: int): void;
|
|
5
|
-
export declare function fire(player: EntityPlayer, pickupVariant: PickupVariant, pickupSubType: int, pickupPrice: int): void;
|
|
4
|
+
export declare function register(callback: PostPurchaseCallbackType, pickupVariant?: PickupVariant | int, pickupSubType?: int): void;
|
|
5
|
+
export declare function fire(player: EntityPlayer, pickupVariant: PickupVariant | int, pickupSubType: int, pickupPrice: int): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PostTearInitLateCallbackType = (tear: EntityTear) => void;
|
|
3
3
|
export declare function hasSubscriptions(): boolean;
|
|
4
|
-
export declare function register(callback: PostTearInitLateCallbackType, tearVariant?: TearVariant): void;
|
|
4
|
+
export declare function register(callback: PostTearInitLateCallbackType, tearVariant?: TearVariant | int): void;
|
|
5
5
|
export declare function fire(tear: EntityTear): void;
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,7 +7,16 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
|
7
7
|
/** Bombs explode when their frame count is equal to this value. */
|
|
8
8
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
9
9
|
export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
|
|
10
|
+
/**
|
|
11
|
+
* The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
|
|
12
|
+
* Baby). This set includes The Lost and Tainted Lost.
|
|
13
|
+
*/
|
|
10
14
|
export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
|
|
15
|
+
/**
|
|
16
|
+
* The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
|
|
17
|
+
* set includes The Lost and Tainted Lost.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
|
|
11
20
|
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
|
|
12
21
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
13
22
|
export declare const DISTANCE_OF_GRID_TILE = 40;
|
package/dist/constants.lua
CHANGED
|
@@ -18,12 +18,15 @@ ____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
|
|
|
18
18
|
})
|
|
19
19
|
____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
|
|
20
20
|
PlayerType.PLAYER_BLUEBABY,
|
|
21
|
+
PlayerType.PLAYER_THELOST,
|
|
21
22
|
PlayerType.PLAYER_BLACKJUDAS,
|
|
22
23
|
PlayerType.PLAYER_JUDAS_B,
|
|
23
24
|
PlayerType.PLAYER_BLUEBABY_B,
|
|
25
|
+
PlayerType.PLAYER_THELOST_B,
|
|
24
26
|
PlayerType.PLAYER_THEFORGOTTEN_B,
|
|
25
27
|
PlayerType.PLAYER_BETHANY_B
|
|
26
28
|
})
|
|
29
|
+
____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B})
|
|
27
30
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
|
|
28
31
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
29
32
|
____exports.DOOR_HITBOX_DISTANCE = 11
|
|
@@ -56,7 +56,14 @@ export declare function isGlitchedCollectible(entity: Entity): boolean;
|
|
|
56
56
|
*/
|
|
57
57
|
export declare function isPassiveCollectible(collectibleType: CollectibleType | int): boolean;
|
|
58
58
|
export declare function isQuestCollectible(collectibleType: CollectibleType | int): boolean;
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to remove all of the collectibles in the room.
|
|
61
|
+
*
|
|
62
|
+
* @param collectibleType Optional. If specified, will only remove collectibles that match this
|
|
63
|
+
* collectible type.
|
|
64
|
+
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
65
|
+
*/
|
|
66
|
+
export declare function removeAllCollectibles(collectibleType?: CollectibleType | int, cap?: int): void;
|
|
60
67
|
/**
|
|
61
68
|
* Helper function to remove all pickup delay on a collectible. By default, collectibles have a 20
|
|
62
69
|
* frame delay before they can be picked up by a player.
|
|
@@ -7,7 +7,7 @@ local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DE
|
|
|
7
7
|
local ____collectibleNameMap = require("maps.collectibleNameMap")
|
|
8
8
|
local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
9
9
|
local ____entity = require("functions.entity")
|
|
10
|
-
local
|
|
10
|
+
local removeAllPickups = ____entity.removeAllPickups
|
|
11
11
|
function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
12
12
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
13
13
|
error("You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant))
|
|
@@ -136,8 +136,8 @@ end
|
|
|
136
136
|
function ____exports.isQuestCollectible(self, collectibleType)
|
|
137
137
|
return ____exports.collectibleHasTag(nil, collectibleType, 32768)
|
|
138
138
|
end
|
|
139
|
-
function ____exports.removeAllCollectibles(self)
|
|
140
|
-
|
|
139
|
+
function ____exports.removeAllCollectibles(self, collectibleType, cap)
|
|
140
|
+
removeAllPickups(nil, PickupVariant.PICKUP_COLLECTIBLE, collectibleType, cap)
|
|
141
141
|
end
|
|
142
142
|
function ____exports.removeCollectiblePickupDelay(self, collectible)
|
|
143
143
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
-
local isTSTLClass,
|
|
4
|
+
local isTSTLClass, copyClass, getNewClassFromMetatable, deepCopyValue, copyVector, checkMetatable, validateValue, TSTL_CLASS_KEYS
|
|
5
5
|
local ____constantsInternal = require("constantsInternal")
|
|
6
6
|
local TSTL_CLASS_BRAND = ____constantsInternal.TSTL_CLASS_BRAND
|
|
7
7
|
local TSTL_MAP_BRAND = ____constantsInternal.TSTL_MAP_BRAND
|
|
@@ -51,7 +51,7 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
|
|
|
51
51
|
elseif serializationType == ____exports.SerializationType.NONE and __TS__InstanceOf(oldObject, Set) or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLSetBrand then
|
|
52
52
|
newObject = __TS__New(Set)
|
|
53
53
|
elseif serializationType == ____exports.SerializationType.NONE and isClass or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLClassBrand then
|
|
54
|
-
newObject =
|
|
54
|
+
newObject = copyClass(nil, oldObject)
|
|
55
55
|
else
|
|
56
56
|
newObject = {}
|
|
57
57
|
end
|
|
@@ -144,7 +144,7 @@ function isTSTLClass(self, object)
|
|
|
144
144
|
end
|
|
145
145
|
return numKeys == TSTL_CLASS_KEYS.size
|
|
146
146
|
end
|
|
147
|
-
function
|
|
147
|
+
function copyClass(self, oldClass)
|
|
148
148
|
local metatable = getmetatable(oldClass)
|
|
149
149
|
local newClass = getNewClassFromMetatable(nil, metatable)
|
|
150
150
|
for key, value in pairs(oldClass) do
|
|
@@ -152,17 +152,88 @@ export declare function getSlots(matchingVariant?: number, matchingSubType?: num
|
|
|
152
152
|
* ```
|
|
153
153
|
*/
|
|
154
154
|
export declare function getTears(matchingVariant?: number, matchingSubType?: number): EntityTear[];
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
export declare function
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Helper function to remove all of the entities in the supplied array.
|
|
157
|
+
*
|
|
158
|
+
* @param entities The array of entities to remove.
|
|
159
|
+
* @param cap Optional. If specified, will only remove the given amount of entities.
|
|
160
|
+
*/
|
|
161
|
+
export declare function removeEntities(entities: Entity[], cap?: int): void;
|
|
162
|
+
/**
|
|
163
|
+
* Helper function to remove all of the bombs in the room.
|
|
164
|
+
*
|
|
165
|
+
* @param variant Optional. If specified, will only remove bombs that match this variant.
|
|
166
|
+
* @param subType Optional. If specified, will only remove bombs that match this sub-type.
|
|
167
|
+
* @param cap Optional. If specified, will only remove the given amount of bombs.
|
|
168
|
+
*/
|
|
169
|
+
export declare function removeAllBombs(variant?: BombVariant | int, subType?: int, cap?: int): void;
|
|
170
|
+
/**
|
|
171
|
+
* Helper function to remove all of the effects in the room.
|
|
172
|
+
*
|
|
173
|
+
* @param variant Optional. If specified, will only remove effects that match this variant.
|
|
174
|
+
* @param subType Optional. If specified, will only remove effects that match this sub-type.
|
|
175
|
+
* @param cap Optional. If specified, will only remove the given amount of effects.
|
|
176
|
+
*/
|
|
177
|
+
export declare function removeAllEffects(variant?: EffectVariant, subType?: int, cap?: int): void;
|
|
178
|
+
/**
|
|
179
|
+
* Helper function to remove all of the familiars in the room.
|
|
180
|
+
*
|
|
181
|
+
* @param variant Optional. If specified, will only remove familiars that match this variant.
|
|
182
|
+
* @param subType Optional. If specified, will only remove familiars that match this sub-type.
|
|
183
|
+
* @param cap Optional. If specified, will only remove the given amount of familiars.
|
|
184
|
+
*/
|
|
185
|
+
export declare function removeAllFamiliars(variant?: FamiliarVariant | int, subType?: int, cap?: int): void;
|
|
186
|
+
/**
|
|
187
|
+
* Helper function to remove all of the knives in the room.
|
|
188
|
+
*
|
|
189
|
+
* @param variant Optional. If specified, will only remove knives that match this variant.
|
|
190
|
+
* @param subType Optional. If specified, will only remove knives that match this sub-type.
|
|
191
|
+
* @param cap Optional. If specified, will only remove the given amount of knives.
|
|
192
|
+
*/
|
|
193
|
+
export declare function removeAllKnives(variant?: KnifeVariant | int, subType?: int, cap?: int): void;
|
|
194
|
+
/**
|
|
195
|
+
* Helper function to remove all of the lasers in the room.
|
|
196
|
+
*
|
|
197
|
+
* @param variant Optional. If specified, will only remove lasers that match this variant.
|
|
198
|
+
* @param subType Optional. If specified, will only remove lasers that match this sub-type.
|
|
199
|
+
* @param cap Optional. If specified, will only remove the given amount of lasers.
|
|
200
|
+
*/
|
|
201
|
+
export declare function removeAllLasers(variant?: LaserVariant | int, subType?: int, cap?: int): void;
|
|
202
|
+
/**
|
|
203
|
+
* Helper function to remove all of the matching entities in the room.
|
|
204
|
+
*
|
|
205
|
+
* @param entityType The entity type to match.
|
|
206
|
+
* @param entityVariant Optional. The variant to match. -1 by default (which will match every
|
|
207
|
+
* variant).
|
|
208
|
+
* @param entitySubType Optional. The sub-type to match. -1 by default (which will match every
|
|
209
|
+
* sub-type).
|
|
210
|
+
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
211
|
+
*/
|
|
212
|
+
export declare function removeAllMatchingEntities(entityType: int, entityVariant?: number, entitySubType?: number, cap?: int | undefined): void;
|
|
213
|
+
/**
|
|
214
|
+
* Helper function to remove all of the pickups in the room.
|
|
215
|
+
*
|
|
216
|
+
* @param variant Optional. If specified, will only remove pickups that match this variant.
|
|
217
|
+
* @param subType Optional. If specified, will only remove pickups that match this sub-type.
|
|
218
|
+
* @param cap Optional. If specified, will only remove the given amount of pickups.
|
|
219
|
+
*/
|
|
220
|
+
export declare function removeAllPickups(variant?: PickupVariant | int, subType?: int, cap?: int): void;
|
|
221
|
+
/**
|
|
222
|
+
* Helper function to remove all of the projectiles in the room.
|
|
223
|
+
*
|
|
224
|
+
* @param variant Optional. If specified, will only remove projectiles that match this variant.
|
|
225
|
+
* @param subType Optional. If specified, will only remove projectiles that match this sub-type.
|
|
226
|
+
* @param cap Optional. If specified, will only remove the given amount of projectiles.
|
|
227
|
+
*/
|
|
228
|
+
export declare function removeAllProjectiles(variant?: ProjectileVariant | int, subType?: int, cap?: int): void;
|
|
229
|
+
/**
|
|
230
|
+
* Helper function to remove all of the tears in the room.
|
|
231
|
+
*
|
|
232
|
+
* @param variant Optional. If specified, will only remove tears that match this variant.
|
|
233
|
+
* @param subType Optional. If specified, will only remove tears that match this sub-type.
|
|
234
|
+
* @param cap Optional. If specified, will only remove the given amount of tears.
|
|
235
|
+
*/
|
|
236
|
+
export declare function removeAllTears(variant?: TearVariant | int, subType?: int, cap?: int): void;
|
|
166
237
|
/**
|
|
167
238
|
* Helper function to set the position of every entity in the room based on a map of positions. If
|
|
168
239
|
* an entity is found that does not have matching element in the provided map, then that entity will
|
|
@@ -210,68 +210,65 @@ function ____exports.getTears(self, matchingVariant, matchingSubType)
|
|
|
210
210
|
end
|
|
211
211
|
return tears
|
|
212
212
|
end
|
|
213
|
-
function ____exports.removeEntities(self, entities)
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
function ____exports.removeEntities(self, entities, cap)
|
|
214
|
+
local numEntitiesRemoved = 0
|
|
215
|
+
do
|
|
216
|
+
local i = 0
|
|
217
|
+
while i < #entities do
|
|
218
|
+
local entity = entities[i + 1]
|
|
219
|
+
entity:Remove()
|
|
220
|
+
numEntitiesRemoved = numEntitiesRemoved + 1
|
|
221
|
+
if cap ~= nil and numEntitiesRemoved >= cap then
|
|
222
|
+
return
|
|
223
|
+
end
|
|
224
|
+
i = i + 1
|
|
225
|
+
end
|
|
216
226
|
end
|
|
217
227
|
end
|
|
218
|
-
function ____exports.removeAllBombs(self)
|
|
219
|
-
local bombs = ____exports.getBombs(nil)
|
|
220
|
-
|
|
221
|
-
bomb:Remove()
|
|
222
|
-
end
|
|
228
|
+
function ____exports.removeAllBombs(self, variant, subType, cap)
|
|
229
|
+
local bombs = ____exports.getBombs(nil, variant, subType)
|
|
230
|
+
____exports.removeEntities(nil, bombs, cap)
|
|
223
231
|
end
|
|
224
|
-
function ____exports.removeAllEffects(self)
|
|
225
|
-
local effects = ____exports.getEffects(nil)
|
|
226
|
-
|
|
227
|
-
effect:Remove()
|
|
228
|
-
end
|
|
232
|
+
function ____exports.removeAllEffects(self, variant, subType, cap)
|
|
233
|
+
local effects = ____exports.getEffects(nil, variant, subType)
|
|
234
|
+
____exports.removeEntities(nil, effects, cap)
|
|
229
235
|
end
|
|
230
|
-
function ____exports.removeAllFamiliars(self)
|
|
231
|
-
local familiars = ____exports.getFamiliars(nil)
|
|
232
|
-
|
|
233
|
-
familiar:Remove()
|
|
234
|
-
end
|
|
236
|
+
function ____exports.removeAllFamiliars(self, variant, subType, cap)
|
|
237
|
+
local familiars = ____exports.getFamiliars(nil, variant, subType)
|
|
238
|
+
____exports.removeEntities(nil, familiars, cap)
|
|
235
239
|
end
|
|
236
|
-
function ____exports.removeAllKnives(self)
|
|
237
|
-
local knives = ____exports.getKnives(nil)
|
|
238
|
-
|
|
239
|
-
knife:Remove()
|
|
240
|
-
end
|
|
240
|
+
function ____exports.removeAllKnives(self, variant, subType, cap)
|
|
241
|
+
local knives = ____exports.getKnives(nil, variant, subType)
|
|
242
|
+
____exports.removeEntities(nil, knives, cap)
|
|
241
243
|
end
|
|
242
|
-
function ____exports.removeAllLasers(self)
|
|
243
|
-
local lasers = ____exports.getLasers(nil)
|
|
244
|
-
|
|
245
|
-
laser:Remove()
|
|
246
|
-
end
|
|
244
|
+
function ____exports.removeAllLasers(self, variant, subType, cap)
|
|
245
|
+
local lasers = ____exports.getLasers(nil, variant, subType)
|
|
246
|
+
____exports.removeEntities(nil, lasers, cap)
|
|
247
247
|
end
|
|
248
|
-
function ____exports.removeAllMatchingEntities(self, entityType, entityVariant, entitySubType)
|
|
248
|
+
function ____exports.removeAllMatchingEntities(self, entityType, entityVariant, entitySubType, cap)
|
|
249
249
|
if entityVariant == nil then
|
|
250
250
|
entityVariant = -1
|
|
251
251
|
end
|
|
252
252
|
if entitySubType == nil then
|
|
253
253
|
entitySubType = -1
|
|
254
254
|
end
|
|
255
|
+
if cap == nil then
|
|
256
|
+
cap = nil
|
|
257
|
+
end
|
|
255
258
|
local entities = Isaac.FindByType(entityType, entityVariant, entitySubType)
|
|
256
|
-
____exports.removeEntities(nil, entities)
|
|
259
|
+
____exports.removeEntities(nil, entities, cap)
|
|
257
260
|
end
|
|
258
|
-
function ____exports.removeAllPickups(self)
|
|
259
|
-
local pickups = ____exports.getPickups(nil)
|
|
260
|
-
|
|
261
|
-
pickup:Remove()
|
|
262
|
-
end
|
|
261
|
+
function ____exports.removeAllPickups(self, variant, subType, cap)
|
|
262
|
+
local pickups = ____exports.getPickups(nil, variant, subType)
|
|
263
|
+
____exports.removeEntities(nil, pickups, cap)
|
|
263
264
|
end
|
|
264
|
-
function ____exports.removeAllProjectiles(self)
|
|
265
|
-
local projectiles = ____exports.getProjectiles(nil)
|
|
266
|
-
|
|
267
|
-
projectile:Remove()
|
|
268
|
-
end
|
|
265
|
+
function ____exports.removeAllProjectiles(self, variant, subType, cap)
|
|
266
|
+
local projectiles = ____exports.getProjectiles(nil, variant, subType)
|
|
267
|
+
____exports.removeEntities(nil, projectiles, cap)
|
|
269
268
|
end
|
|
270
|
-
function ____exports.removeAllTears(self)
|
|
271
|
-
local tears = ____exports.getTears(nil)
|
|
272
|
-
|
|
273
|
-
tear:Remove()
|
|
274
|
-
end
|
|
269
|
+
function ____exports.removeAllTears(self, variant, subType, cap)
|
|
270
|
+
local tears = ____exports.getTears(nil, variant, subType)
|
|
271
|
+
____exports.removeEntities(nil, tears, cap)
|
|
275
272
|
end
|
|
276
273
|
function ____exports.setEntityPositions(self, entityPositions, entities)
|
|
277
274
|
if entities == nil then
|
|
@@ -39,7 +39,8 @@ export declare function isAllPressurePlatesPushed(): boolean;
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
41
41
|
/**
|
|
42
|
-
* Helper function to
|
|
42
|
+
* Helper function to all grid entities in the room except for ones matching the grid entity types
|
|
43
|
+
* provided.
|
|
43
44
|
*
|
|
44
45
|
* Example:
|
|
45
46
|
* ```
|
|
@@ -50,7 +51,20 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
50
51
|
* ```
|
|
51
52
|
*/
|
|
52
53
|
export declare function removeAllGridEntitiesExceptFor(...gridEntityTypes: GridEntityType[]): void;
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Helper function to remove all of the grid entities in the room that match the grid entity types
|
|
56
|
+
* provided.
|
|
57
|
+
*
|
|
58
|
+
* Example:
|
|
59
|
+
* ```
|
|
60
|
+
* removeAllMatchingGridEntities(
|
|
61
|
+
* GridEntityType.GRID_ROCK,
|
|
62
|
+
* GridEntityType.GRID_ROCKB,
|
|
63
|
+
* GridEntityType.GRID_ROCKT,
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function removeAllMatchingGridEntities(...gridEntityType: GridEntityType[]): void;
|
|
54
68
|
/**
|
|
55
69
|
* Helper function to remove a grid entity simply by providing the grid entity object.
|
|
56
70
|
*
|
|
@@ -130,8 +130,8 @@ function ____exports.removeAllGridEntitiesExceptFor(self, ...)
|
|
|
130
130
|
end
|
|
131
131
|
roomUpdateSafe(nil)
|
|
132
132
|
end
|
|
133
|
-
function ____exports.removeAllMatchingGridEntities(self,
|
|
134
|
-
local gridEntities = ____exports.getGridEntities(nil,
|
|
133
|
+
function ____exports.removeAllMatchingGridEntities(self, ...)
|
|
134
|
+
local gridEntities = ____exports.getGridEntities(nil, ...)
|
|
135
135
|
for ____, gridEntity in ipairs(gridEntities) do
|
|
136
136
|
____exports.removeGridEntity(nil, gridEntity, false)
|
|
137
137
|
end
|
package/dist/functions/npc.d.ts
CHANGED
|
@@ -35,4 +35,9 @@ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean;
|
|
|
35
35
|
* enemies.
|
|
36
36
|
*/
|
|
37
37
|
export declare function isRaglingDeathPatch(npc: EntityNPC): boolean;
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to remove all NPCs in the room.
|
|
40
|
+
*
|
|
41
|
+
* @param cap Optional. If specified, will only remove the given amount of NPCs.
|
|
42
|
+
*/
|
|
43
|
+
export declare function removeAllNPCs(cap?: int): void;
|
package/dist/functions/npc.lua
CHANGED
|
@@ -6,6 +6,7 @@ local ____constants = require("constants")
|
|
|
6
6
|
local EGGY_STATE_FRAME_OF_FINAL_SPIDER = ____constants.EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
7
7
|
local ____entity = require("functions.entity")
|
|
8
8
|
local getEntities = ____entity.getEntities
|
|
9
|
+
local removeEntities = ____entity.removeEntities
|
|
9
10
|
function ____exports.getBosses(self)
|
|
10
11
|
local bosses = {}
|
|
11
12
|
for ____, npc in ipairs(____exports.getNPCs(nil)) do
|
|
@@ -94,10 +95,8 @@ function ____exports.getAliveNPCs(self)
|
|
|
94
95
|
end
|
|
95
96
|
return aliveNPCs
|
|
96
97
|
end
|
|
97
|
-
function ____exports.removeAllNPCs(self)
|
|
98
|
+
function ____exports.removeAllNPCs(self, cap)
|
|
98
99
|
local npcs = ____exports.getNPCs(nil)
|
|
99
|
-
|
|
100
|
-
npc:Remove()
|
|
101
|
-
end
|
|
100
|
+
removeEntities(nil, npcs, cap)
|
|
102
101
|
end
|
|
103
102
|
return ____exports
|
|
@@ -20,6 +20,18 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
|
|
|
20
20
|
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
|
|
21
21
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
22
22
|
export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Helper function to see if the provided character can have red heart containers. Returns true for
|
|
25
|
+
* characters like Isaac, Magdalene, or Cain. Returns false for characters like Blue Baby. Returns
|
|
26
|
+
* false for The Lost and Tainted Lost.
|
|
27
|
+
*/
|
|
28
|
+
export declare function characterCanHaveRedHearts(character: PlayerType): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Helper function to see if the provided character can have soul hearts. Returns true for
|
|
31
|
+
* characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
|
|
32
|
+
* false for The Lost and Tainted Lost.
|
|
33
|
+
*/
|
|
34
|
+
export declare function characterCanHaveSoulHearts(character: PlayerType): boolean;
|
|
23
35
|
/**
|
|
24
36
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
25
37
|
* `EntityPlayer` object or a tear height stat.
|
|
@@ -3,6 +3,8 @@ require("lualib_bundle");
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local EXCLUDED_CHARACTERS
|
|
5
5
|
local ____constants = require("constants")
|
|
6
|
+
local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEARTS
|
|
7
|
+
local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
|
|
6
8
|
local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
|
|
7
9
|
local ____HealthType = require("types.HealthType")
|
|
8
10
|
local HealthType = ____HealthType.HealthType
|
|
@@ -27,18 +29,18 @@ function ____exports.getPlayers(self, performExclusions)
|
|
|
27
29
|
do
|
|
28
30
|
local player = Isaac.GetPlayer(i)
|
|
29
31
|
if player == nil then
|
|
30
|
-
goto
|
|
32
|
+
goto __continue53
|
|
31
33
|
end
|
|
32
34
|
if ____exports.isChildPlayer(nil, player) then
|
|
33
|
-
goto
|
|
35
|
+
goto __continue53
|
|
34
36
|
end
|
|
35
37
|
local character = player:GetPlayerType()
|
|
36
38
|
if performExclusions and EXCLUDED_CHARACTERS:has(character) then
|
|
37
|
-
goto
|
|
39
|
+
goto __continue53
|
|
38
40
|
end
|
|
39
41
|
__TS__ArrayPush(players, player)
|
|
40
42
|
end
|
|
41
|
-
::
|
|
43
|
+
::__continue53::
|
|
42
44
|
i = i + 1
|
|
43
45
|
end
|
|
44
46
|
end
|
|
@@ -104,6 +106,12 @@ function ____exports.anyPlayerIs(self, matchingCharacter)
|
|
|
104
106
|
end
|
|
105
107
|
return false
|
|
106
108
|
end
|
|
109
|
+
function ____exports.characterCanHaveRedHearts(self, character)
|
|
110
|
+
return not CHARACTERS_WITH_NO_RED_HEARTS:has(character)
|
|
111
|
+
end
|
|
112
|
+
function ____exports.characterCanHaveSoulHearts(self, character)
|
|
113
|
+
return not CHARACTERS_WITH_NO_SOUL_HEARTS:has(character)
|
|
114
|
+
end
|
|
107
115
|
function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
|
|
108
116
|
local tearHeight = tonumber(playerOrTearHeight)
|
|
109
117
|
if tearHeight == nil then
|
|
@@ -243,14 +251,14 @@ function ____exports.getPlayerIndexVanilla(self, playerToFind)
|
|
|
243
251
|
do
|
|
244
252
|
local player = Isaac.GetPlayer(i)
|
|
245
253
|
if player == nil then
|
|
246
|
-
goto
|
|
254
|
+
goto __continue62
|
|
247
255
|
end
|
|
248
256
|
local playerHash = GetPtrHash(player)
|
|
249
257
|
if playerHash == playerToFindHash then
|
|
250
258
|
return i
|
|
251
259
|
end
|
|
252
260
|
end
|
|
253
|
-
::
|
|
261
|
+
::__continue62::
|
|
254
262
|
i = i + 1
|
|
255
263
|
end
|
|
256
264
|
end
|
|
@@ -356,9 +364,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
356
364
|
itemPool:RemoveCollectible(collectibleType)
|
|
357
365
|
end
|
|
358
366
|
repeat
|
|
359
|
-
local
|
|
360
|
-
local
|
|
361
|
-
if
|
|
367
|
+
local ____switch89 = activeSlot
|
|
368
|
+
local ____cond89 = ____switch89 == ActiveSlot.SLOT_PRIMARY
|
|
369
|
+
if ____cond89 then
|
|
362
370
|
do
|
|
363
371
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
364
372
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -367,8 +375,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
367
375
|
break
|
|
368
376
|
end
|
|
369
377
|
end
|
|
370
|
-
|
|
371
|
-
if
|
|
378
|
+
____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_SECONDARY
|
|
379
|
+
if ____cond89 then
|
|
372
380
|
do
|
|
373
381
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
374
382
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -383,16 +391,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
383
391
|
break
|
|
384
392
|
end
|
|
385
393
|
end
|
|
386
|
-
|
|
387
|
-
if
|
|
394
|
+
____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_POCKET
|
|
395
|
+
if ____cond89 then
|
|
388
396
|
do
|
|
389
397
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
390
398
|
player:SetActiveCharge(charge, activeSlot)
|
|
391
399
|
break
|
|
392
400
|
end
|
|
393
401
|
end
|
|
394
|
-
|
|
395
|
-
if
|
|
402
|
+
____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_POCKET2
|
|
403
|
+
if ____cond89 then
|
|
396
404
|
do
|
|
397
405
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
398
406
|
break
|
|
@@ -67,31 +67,31 @@ export interface CallbackParametersCustom {
|
|
|
67
67
|
];
|
|
68
68
|
[ModCallbacksCustom.MC_POST_TEAR_INIT_LATE]: [
|
|
69
69
|
callback: PostTearInitLateCallbackType,
|
|
70
|
-
tearVariant?: TearVariant
|
|
70
|
+
tearVariant?: TearVariant | int
|
|
71
71
|
];
|
|
72
72
|
[ModCallbacksCustom.MC_POST_FAMILIAR_INIT_LATE]: [
|
|
73
73
|
callback: PostFamiliarInitLateCallbackType,
|
|
74
|
-
familiarVariant?: FamiliarVariant
|
|
74
|
+
familiarVariant?: FamiliarVariant | int
|
|
75
75
|
];
|
|
76
76
|
[ModCallbacksCustom.MC_POST_BOMB_INIT_LATE]: [
|
|
77
77
|
callback: PostBombInitLateCallbackType,
|
|
78
|
-
bombVariant?: BombVariant
|
|
78
|
+
bombVariant?: BombVariant | int
|
|
79
79
|
];
|
|
80
80
|
[ModCallbacksCustom.MC_POST_PICKUP_INIT_LATE]: [
|
|
81
81
|
callback: PostPickupInitLateCallbackType,
|
|
82
|
-
pickupVariant?: PickupVariant
|
|
82
|
+
pickupVariant?: PickupVariant | int
|
|
83
83
|
];
|
|
84
84
|
[ModCallbacksCustom.MC_POST_LASER_INIT_LATE]: [
|
|
85
85
|
callback: PostLaserInitLateCallbackType,
|
|
86
|
-
laserVariant?: LaserVariant
|
|
86
|
+
laserVariant?: LaserVariant | int
|
|
87
87
|
];
|
|
88
88
|
[ModCallbacksCustom.MC_POST_KNIFE_INIT_LATE]: [
|
|
89
89
|
callback: PostKnifeInitLateCallbackType,
|
|
90
|
-
knifeVariant?: KnifeVariant
|
|
90
|
+
knifeVariant?: KnifeVariant | int
|
|
91
91
|
];
|
|
92
92
|
[ModCallbacksCustom.MC_POST_PROJECTILE_INIT_LATE]: [
|
|
93
93
|
callback: PostProjectileInitLateCallbackType,
|
|
94
|
-
projectileVariant?: ProjectileVariant
|
|
94
|
+
projectileVariant?: ProjectileVariant | int
|
|
95
95
|
];
|
|
96
96
|
[ModCallbacksCustom.MC_POST_NPC_INIT_LATE]: [
|
|
97
97
|
callback: PostNPCInitLateCallbackType,
|
|
@@ -103,7 +103,7 @@ export interface CallbackParametersCustom {
|
|
|
103
103
|
];
|
|
104
104
|
[ModCallbacksCustom.MC_POST_PICKUP_COLLECT]: [
|
|
105
105
|
callback: PostPickupCollectCallbackType,
|
|
106
|
-
pickupVariant?: PickupVariant
|
|
106
|
+
pickupVariant?: PickupVariant | int
|
|
107
107
|
];
|
|
108
108
|
[ModCallbacksCustom.MC_PRE_ITEM_PICKUP]: [
|
|
109
109
|
callback: PreItemPickupCallbackType,
|
|
@@ -146,7 +146,7 @@ export interface CallbackParametersCustom {
|
|
|
146
146
|
];
|
|
147
147
|
[ModCallbacksCustom.MC_POST_PURCHASE]: [
|
|
148
148
|
callback: PostPurchaseCallbackType,
|
|
149
|
-
pickupVariant?: PickupVariant,
|
|
149
|
+
pickupVariant?: PickupVariant | int,
|
|
150
150
|
pickupSubType?: int
|
|
151
151
|
];
|
|
152
152
|
[ModCallbacksCustom.MC_POST_SACRIFICE]: [callback: PostSacrificeCallbackType];
|