isaacscript-common 2.0.11 → 2.0.14
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/postCollectibleInitFirst.d.ts +1 -1
- package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts +2 -2
- package/dist/callbacks/subscriptions/postItemDischarged.d.ts +2 -2
- package/dist/callbacks/subscriptions/postItemPickup.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/postNPCInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPEffectUpdateReordered.d.ts +2 -2
- package/dist/callbacks/subscriptions/postPickupCollect.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +1 -1
- package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPurchase.d.ts +1 -1
- package/dist/callbacks/subscriptions/postTearInitLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postTearInitVeryLate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postTrinketBreak.d.ts +2 -2
- package/dist/callbacks/subscriptions/preItemPickup.d.ts +1 -1
- package/dist/classes/DefaultMap.d.ts +2 -1
- package/dist/constants.d.ts +16 -7
- package/dist/constants.lua +2 -2
- package/dist/enums/ModCallbackCustom.d.ts +0 -3
- package/dist/features/characterHealthConversion.d.ts +1 -1
- package/dist/features/characterStats.d.ts +1 -1
- package/dist/features/deployJSONRoom.d.ts +16 -9
- package/dist/features/deployJSONRoom.lua +2 -2
- package/dist/features/disableInputs.d.ts +6 -6
- package/dist/features/disableSound.d.ts +2 -2
- package/dist/features/extraConsoleCommands/commands.d.ts +12 -9
- package/dist/features/extraConsoleCommands/commands.lua +14 -0
- package/dist/features/extraConsoleCommands/init.lua +1 -0
- package/dist/features/preventCollectibleRotate.d.ts +1 -1
- package/dist/features/runInNFrames.d.ts +2 -1
- package/dist/features/saveDataManager/exports.d.ts +8 -6
- package/dist/features/sirenHelpers.d.ts +2 -2
- package/dist/functions/array.d.ts +10 -9
- package/dist/functions/benchmark.d.ts +1 -1
- package/dist/functions/boss.d.ts +3 -3
- package/dist/functions/cards.d.ts +10 -8
- package/dist/functions/character.d.ts +10 -10
- package/dist/functions/charge.d.ts +6 -3
- package/dist/functions/collectibleCacheFlag.d.ts +2 -2
- package/dist/functions/collectibleSet.d.ts +1 -1
- package/dist/functions/collectibleTag.d.ts +3 -3
- package/dist/functions/collectibles.d.ts +22 -19
- package/dist/functions/collectibles.lua +2 -1
- package/dist/functions/color.d.ts +1 -1
- package/dist/functions/deepCopy.d.ts +2 -1
- package/dist/functions/entity.d.ts +16 -13
- package/dist/functions/entity.lua +1 -1
- package/dist/functions/entitySpecific.d.ts +58 -49
- package/dist/functions/enums.d.ts +6 -5
- package/dist/functions/enums.lua +1 -1
- package/dist/functions/familiars.d.ts +5 -5
- package/dist/functions/familiars.lua +1 -1
- package/dist/functions/flag.d.ts +6 -2
- package/dist/functions/flying.d.ts +4 -4
- package/dist/functions/gridEntity.d.ts +15 -10
- package/dist/functions/gridEntity.lua +0 -4
- package/dist/functions/kColor.d.ts +1 -1
- package/dist/functions/level.d.ts +1 -0
- package/dist/functions/level.lua +29 -0
- package/dist/functions/log.d.ts +2 -2
- package/dist/functions/map.d.ts +2 -1
- package/dist/functions/math.d.ts +8 -1
- package/dist/functions/math.lua +6 -0
- package/dist/functions/npc.d.ts +3 -3
- package/dist/functions/pickups.d.ts +26 -26
- package/dist/functions/pills.d.ts +5 -4
- package/dist/functions/player.d.ts +19 -19
- package/dist/functions/playerIndex.d.ts +2 -1
- package/dist/functions/positionVelocity.d.ts +9 -5
- package/dist/functions/random.d.ts +7 -5
- package/dist/functions/rng.d.ts +1 -1
- package/dist/functions/rooms.d.ts +29 -5
- package/dist/functions/rooms.lua +56 -21
- package/dist/functions/run.d.ts +1 -1
- package/dist/functions/set.d.ts +1 -1
- package/dist/functions/spawnCollectible.d.ts +5 -5
- package/dist/functions/transformations.d.ts +4 -3
- package/dist/functions/trinketCacheFlag.d.ts +2 -2
- package/dist/functions/trinketGive.d.ts +3 -3
- package/dist/functions/trinketSet.d.ts +1 -1
- package/dist/functions/trinkets.d.ts +12 -9
- package/dist/functions/trinkets.lua +2 -2
- package/dist/functions/ui.d.ts +2 -2
- package/dist/functions/utils.d.ts +4 -2
- package/dist/functions/vector.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/objects/roomShapeToDoorSlots.d.ts +1 -1
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +3 -3
- package/dist/sets/mineShaftRoomSubTypesSet.d.ts +2 -0
- package/dist/sets/mineShaftRoomSubTypesSet.lua +14 -0
- package/dist/types/CollectibleIndex.d.ts +2 -1
- package/dist/types/PickingUpItem.d.ts +1 -1
- package/dist/types/PlayerIndex.d.ts +2 -1
- package/dist/types/TrinketSituation.d.ts +3 -3
- package/dist/upgradeMod.d.ts +2 -4
- package/package.json +4 -3
|
@@ -3,7 +3,8 @@ import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
|
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to get all of the `EntityType.BOMB` in the room.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* For example:
|
|
7
|
+
*
|
|
7
8
|
* ```ts
|
|
8
9
|
* // Make all of the bombs in the room invisible
|
|
9
10
|
* for (const bomb of getBombs()) {
|
|
@@ -11,11 +12,12 @@ import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
|
|
|
11
12
|
* }
|
|
12
13
|
* ```
|
|
13
14
|
*/
|
|
14
|
-
export declare function getBombs(bombVariant?: BombVariant
|
|
15
|
+
export declare function getBombs(bombVariant?: BombVariant, subType?: number): EntityBomb[];
|
|
15
16
|
/**
|
|
16
17
|
* Helper function to get all of the `EntityType.EFFECT` in the room.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
+
* For example:
|
|
20
|
+
*
|
|
19
21
|
* ```ts
|
|
20
22
|
* // Make all of the effects in the room invisible
|
|
21
23
|
* for (const effect of getEffects()) {
|
|
@@ -23,11 +25,12 @@ export declare function getBombs(bombVariant?: BombVariant | int, subType?: numb
|
|
|
23
25
|
* }
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
26
|
-
export declare function getEffects(effectVariant?: EffectVariant
|
|
28
|
+
export declare function getEffects(effectVariant?: EffectVariant, subType?: number): EntityEffect[];
|
|
27
29
|
/**
|
|
28
30
|
* Helper function to get all of the familiars in the room.
|
|
29
31
|
*
|
|
30
|
-
*
|
|
32
|
+
* For example:
|
|
33
|
+
*
|
|
31
34
|
* ```ts
|
|
32
35
|
* // Make all of the familiars in the room invisible
|
|
33
36
|
* for (const familiar of getFamiliars()) {
|
|
@@ -35,11 +38,12 @@ export declare function getEffects(effectVariant?: EffectVariant | int, subType?
|
|
|
35
38
|
* }
|
|
36
39
|
* ```
|
|
37
40
|
*/
|
|
38
|
-
export declare function getFamiliars(familiarVariant?: FamiliarVariant
|
|
41
|
+
export declare function getFamiliars(familiarVariant?: FamiliarVariant, subType?: number): EntityFamiliar[];
|
|
39
42
|
/**
|
|
40
43
|
* Helper function to get all of the `EntityType.KNIFE` in the room.
|
|
41
44
|
*
|
|
42
|
-
*
|
|
45
|
+
* For example:
|
|
46
|
+
*
|
|
43
47
|
* ```ts
|
|
44
48
|
* // Make all of the knives in the room invisible
|
|
45
49
|
* for (const knife of getKnives()) {
|
|
@@ -47,11 +51,12 @@ export declare function getFamiliars(familiarVariant?: FamiliarVariant | int, su
|
|
|
47
51
|
* }
|
|
48
52
|
* ```
|
|
49
53
|
*/
|
|
50
|
-
export declare function getKnives(knifeVariant?: KnifeVariant
|
|
54
|
+
export declare function getKnives(knifeVariant?: KnifeVariant, subType?: number): EntityKnife[];
|
|
51
55
|
/**
|
|
52
56
|
* Helper function to get all of the `EntityType.LASER` in the room.
|
|
53
57
|
*
|
|
54
|
-
*
|
|
58
|
+
* For example:
|
|
59
|
+
*
|
|
55
60
|
* ```ts
|
|
56
61
|
* // Make all of the lasers in the room invisible
|
|
57
62
|
* for (const laser of getLasers()) {
|
|
@@ -59,13 +64,14 @@ export declare function getKnives(knifeVariant?: KnifeVariant | int, subType?: n
|
|
|
59
64
|
* }
|
|
60
65
|
* ```
|
|
61
66
|
*/
|
|
62
|
-
export declare function getLasers(laserVariant?: LaserVariant
|
|
67
|
+
export declare function getLasers(laserVariant?: LaserVariant, subType?: number): EntityLaser[];
|
|
63
68
|
/** The same thing as the `getEntities` function, but returns only NPCs. */
|
|
64
|
-
export declare function getNPCs(entityType?: EntityType
|
|
69
|
+
export declare function getNPCs(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
65
70
|
/**
|
|
66
71
|
* Helper function to get all of the pickups in the room.
|
|
67
72
|
*
|
|
68
|
-
*
|
|
73
|
+
* For example:
|
|
74
|
+
*
|
|
69
75
|
* ```ts
|
|
70
76
|
* // Make all of the pickups in the room invisible
|
|
71
77
|
* for (const pickup of getPickups()) {
|
|
@@ -73,11 +79,12 @@ export declare function getNPCs(entityType?: EntityType | int, variant?: int, su
|
|
|
73
79
|
* }
|
|
74
80
|
* ```
|
|
75
81
|
*/
|
|
76
|
-
export declare function getPickups(pickupVariant?: PickupVariant
|
|
82
|
+
export declare function getPickups(pickupVariant?: PickupVariant, subType?: number): EntityPickup[];
|
|
77
83
|
/**
|
|
78
84
|
* Helper function to get all of the `EntityType.PROJECTILE` in the room.
|
|
79
85
|
*
|
|
80
|
-
*
|
|
86
|
+
* For example:
|
|
87
|
+
*
|
|
81
88
|
* ```ts
|
|
82
89
|
* // Make all of the projectiles in the room invisible
|
|
83
90
|
* for (const projectile of getProjectiles()) {
|
|
@@ -85,11 +92,12 @@ export declare function getPickups(pickupVariant?: PickupVariant | int, subType?
|
|
|
85
92
|
* }
|
|
86
93
|
* ```
|
|
87
94
|
*/
|
|
88
|
-
export declare function getProjectiles(projectileVariant?: ProjectileVariant
|
|
95
|
+
export declare function getProjectiles(projectileVariant?: ProjectileVariant, subType?: number): EntityProjectile[];
|
|
89
96
|
/**
|
|
90
97
|
* Helper function to get all of the `EntityType.SLOT` in the room.
|
|
91
98
|
*
|
|
92
|
-
*
|
|
99
|
+
* For example:
|
|
100
|
+
*
|
|
93
101
|
* ```ts
|
|
94
102
|
* // Make all of the slots in the room invisible
|
|
95
103
|
* for (const slot of getSlots()) {
|
|
@@ -97,11 +105,12 @@ export declare function getProjectiles(projectileVariant?: ProjectileVariant | i
|
|
|
97
105
|
* }
|
|
98
106
|
* ```
|
|
99
107
|
*/
|
|
100
|
-
export declare function getSlots(slotVariant?: SlotVariant
|
|
108
|
+
export declare function getSlots(slotVariant?: SlotVariant, subType?: number): Entity[];
|
|
101
109
|
/**
|
|
102
110
|
* Helper function to get all of the `EntityType.TEAR` in the room.
|
|
103
111
|
*
|
|
104
|
-
*
|
|
112
|
+
* For example:
|
|
113
|
+
*
|
|
105
114
|
* ```ts
|
|
106
115
|
* // Make all of the tears in the room invisible
|
|
107
116
|
* for (const tear of getTears()) {
|
|
@@ -109,7 +118,7 @@ export declare function getSlots(slotVariant?: SlotVariant | int, subType?: numb
|
|
|
109
118
|
* }
|
|
110
119
|
* ```
|
|
111
120
|
*/
|
|
112
|
-
export declare function getTears(tearVariant?: TearVariant
|
|
121
|
+
export declare function getTears(tearVariant?: TearVariant, subType?: number): EntityTear[];
|
|
113
122
|
/**
|
|
114
123
|
* Helper function to remove all of the `EntityType.BOMB` in the room.
|
|
115
124
|
*
|
|
@@ -118,7 +127,7 @@ export declare function getTears(tearVariant?: TearVariant | int, subType?: numb
|
|
|
118
127
|
* @param cap Optional. If specified, will only remove the given amount of bombs.
|
|
119
128
|
* @returns True if one or more bombs were removed, false otherwise.
|
|
120
129
|
*/
|
|
121
|
-
export declare function removeAllBombs(bombVariant?: BombVariant
|
|
130
|
+
export declare function removeAllBombs(bombVariant?: BombVariant, subType?: int, cap?: int): boolean;
|
|
122
131
|
/**
|
|
123
132
|
* Helper function to remove all of the effects in the room.
|
|
124
133
|
*
|
|
@@ -127,17 +136,17 @@ export declare function removeAllBombs(bombVariant?: BombVariant | int, subType?
|
|
|
127
136
|
* @param cap Optional. If specified, will only remove the given amount of effects.
|
|
128
137
|
* @returns True if one or more effects were removed, false otherwise.
|
|
129
138
|
*/
|
|
130
|
-
export declare function removeAllEffects(effectVariant?: EffectVariant
|
|
139
|
+
export declare function removeAllEffects(effectVariant?: EffectVariant, subType?: int, cap?: int): boolean;
|
|
131
140
|
/**
|
|
132
141
|
* Helper function to remove all of the familiars in the room.
|
|
133
142
|
*
|
|
134
143
|
* @param familiarVariant Optional. If specified, will only remove familiars that match this
|
|
135
|
-
*
|
|
144
|
+
* variant.
|
|
136
145
|
* @param subType Optional. If specified, will only remove familiars that match this sub-type.
|
|
137
146
|
* @param cap Optional. If specified, will only remove the given amount of familiars.
|
|
138
147
|
* @returns True if one or more familiars were removed, false otherwise.
|
|
139
148
|
*/
|
|
140
|
-
export declare function removeAllFamiliars(familiarVariant?: FamiliarVariant
|
|
149
|
+
export declare function removeAllFamiliars(familiarVariant?: FamiliarVariant, subType?: int, cap?: int): boolean;
|
|
141
150
|
/**
|
|
142
151
|
* Helper function to remove all of the `EntityType.KNIFE` in the room.
|
|
143
152
|
*
|
|
@@ -146,7 +155,7 @@ export declare function removeAllFamiliars(familiarVariant?: FamiliarVariant | i
|
|
|
146
155
|
* @param cap Optional. If specified, will only remove the given amount of knives.
|
|
147
156
|
* @returns True if one or more knives were removed, false otherwise.
|
|
148
157
|
*/
|
|
149
|
-
export declare function removeAllKnives(knifeVariant?: KnifeVariant
|
|
158
|
+
export declare function removeAllKnives(knifeVariant?: KnifeVariant, subType?: int, cap?: int): boolean;
|
|
150
159
|
/**
|
|
151
160
|
* Helper function to remove all of the `EntityType.LASER` in the room.
|
|
152
161
|
*
|
|
@@ -155,7 +164,7 @@ export declare function removeAllKnives(knifeVariant?: KnifeVariant | int, subTy
|
|
|
155
164
|
* @param cap Optional. If specified, will only remove the given amount of lasers.
|
|
156
165
|
* @returns True if one or more lasers were removed, false otherwise.
|
|
157
166
|
*/
|
|
158
|
-
export declare function removeAllLasers(laserVariant?: LaserVariant
|
|
167
|
+
export declare function removeAllLasers(laserVariant?: LaserVariant, subType?: int, cap?: int): boolean;
|
|
159
168
|
/**
|
|
160
169
|
* Helper function to remove all NPCs in the room.
|
|
161
170
|
*
|
|
@@ -171,17 +180,17 @@ export declare function removeAllNPCs(cap?: int): boolean;
|
|
|
171
180
|
* @param cap Optional. If specified, will only remove the given amount of pickups.
|
|
172
181
|
* @returns True if one or more pickups were removed, false otherwise.
|
|
173
182
|
*/
|
|
174
|
-
export declare function removeAllPickups(pickupVariant?: PickupVariant
|
|
183
|
+
export declare function removeAllPickups(pickupVariant?: PickupVariant, subType?: int, cap?: int): boolean;
|
|
175
184
|
/**
|
|
176
185
|
* Helper function to remove all of the `EntityType.PROJECTILE` in the room.
|
|
177
186
|
*
|
|
178
187
|
* @param projectileVariant Optional. If specified, will only remove projectiles that match this
|
|
179
|
-
*
|
|
188
|
+
* variant.
|
|
180
189
|
* @param subType Optional. If specified, will only remove projectiles that match this sub-type.
|
|
181
190
|
* @param cap Optional. If specified, will only remove the given amount of projectiles.
|
|
182
191
|
* @returns True if one or more projectiles were removed, false otherwise.
|
|
183
192
|
*/
|
|
184
|
-
export declare function removeAllProjectiles(projectileVariant?: ProjectileVariant
|
|
193
|
+
export declare function removeAllProjectiles(projectileVariant?: ProjectileVariant, subType?: int, cap?: int): boolean;
|
|
185
194
|
/**
|
|
186
195
|
* Helper function to remove all of the `EntityType.SLOT` in the room.
|
|
187
196
|
*
|
|
@@ -190,7 +199,7 @@ export declare function removeAllProjectiles(projectileVariant?: ProjectileVaria
|
|
|
190
199
|
* @param cap Optional. If specified, will only remove the given amount of slots.
|
|
191
200
|
* @returns True if one or more slots were removed, false otherwise.
|
|
192
201
|
*/
|
|
193
|
-
export declare function removeAllSlots(slotVariant?: SlotVariant
|
|
202
|
+
export declare function removeAllSlots(slotVariant?: SlotVariant, subType?: int, cap?: int): boolean;
|
|
194
203
|
/**
|
|
195
204
|
* Helper function to remove all of the `EntityType.TEAR` in the room.
|
|
196
205
|
*
|
|
@@ -199,44 +208,44 @@ export declare function removeAllSlots(slotVariant?: SlotVariant | int, subType?
|
|
|
199
208
|
* @param cap Optional. If specified, will only remove the given amount of tears.
|
|
200
209
|
* @returns True if one or more tears were removed, false otherwise.
|
|
201
210
|
*/
|
|
202
|
-
export declare function removeAllTears(tearVariant?: TearVariant
|
|
211
|
+
export declare function removeAllTears(tearVariant?: TearVariant, subType?: int, cap?: int): boolean;
|
|
203
212
|
/** Helper function to spawn a `EntityType.BOMB` (4). */
|
|
204
|
-
export declare function spawnBomb(bombVariant: BombVariant
|
|
213
|
+
export declare function spawnBomb(bombVariant: BombVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityBomb;
|
|
205
214
|
/** Helper function to spawn a `EntityType.BOMB` (4) with a specific seed. */
|
|
206
|
-
export declare function spawnBombWithSeed(bombVariant: BombVariant
|
|
215
|
+
export declare function spawnBombWithSeed(bombVariant: BombVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityBomb;
|
|
207
216
|
/** Helper function to spawn a `EntityType.EFFECT` (1000). */
|
|
208
|
-
export declare function spawnEffect(effectVariant: EffectVariant
|
|
217
|
+
export declare function spawnEffect(effectVariant: EffectVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityEffect;
|
|
209
218
|
/** Helper function to spawn a `EntityType.EFFECT` (1000) with a specific seed. */
|
|
210
|
-
export declare function spawnEffectWithSeed(effectVariant: EffectVariant
|
|
219
|
+
export declare function spawnEffectWithSeed(effectVariant: EffectVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityEffect;
|
|
211
220
|
/** Helper function to spawn a `EntityType.FAMILIAR` (3). */
|
|
212
|
-
export declare function spawnFamiliar(familiarVariant: FamiliarVariant
|
|
221
|
+
export declare function spawnFamiliar(familiarVariant: FamiliarVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityFamiliar;
|
|
213
222
|
/** Helper function to spawn a `EntityType.FAMILIAR` (3) with a specific seed. */
|
|
214
|
-
export declare function spawnFamiliarWithSeed(familiarVariant: FamiliarVariant
|
|
223
|
+
export declare function spawnFamiliarWithSeed(familiarVariant: FamiliarVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityFamiliar;
|
|
215
224
|
/** Helper function to spawn a `EntityType.KNIFE` (8). */
|
|
216
|
-
export declare function spawnKnife(knifeVariant: KnifeVariant
|
|
225
|
+
export declare function spawnKnife(knifeVariant: KnifeVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityKnife;
|
|
217
226
|
/** Helper function to spawn a `EntityType.KNIFE` (8) with a specific seed. */
|
|
218
|
-
export declare function spawnKnifeWithSeed(knifeVariant: KnifeVariant
|
|
227
|
+
export declare function spawnKnifeWithSeed(knifeVariant: KnifeVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityKnife;
|
|
219
228
|
/** Helper function to spawn a `EntityType.LASER` (7). */
|
|
220
|
-
export declare function spawnLaser(laserVariant: LaserVariant
|
|
229
|
+
export declare function spawnLaser(laserVariant: LaserVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityLaser;
|
|
221
230
|
/** Helper function to spawn a `EntityType.LASER` (7) with a specific seed. */
|
|
222
|
-
export declare function spawnLaserWithSeed(laserVariant: LaserVariant
|
|
231
|
+
export declare function spawnLaserWithSeed(laserVariant: LaserVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
|
|
223
232
|
/** Helper function to spawn an NPC. */
|
|
224
|
-
export declare function spawnNPC<T extends
|
|
233
|
+
export declare function spawnNPC<T extends EntityType>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
|
|
225
234
|
/** Helper function to spawn an NPC with a specific seed. */
|
|
226
|
-
export declare function spawnNPCWithSeed(entityType:
|
|
235
|
+
export declare function spawnNPCWithSeed<T extends EntityType>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
|
|
227
236
|
/** Helper function to spawn a `EntityType.PICKUP` (5). */
|
|
228
|
-
export declare function spawnPickup(pickupVariant: PickupVariant
|
|
237
|
+
export declare function spawnPickup(pickupVariant: PickupVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
229
238
|
/** Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed. */
|
|
230
|
-
export declare function spawnPickupWithSeed(pickupVariant: PickupVariant
|
|
239
|
+
export declare function spawnPickupWithSeed(pickupVariant: PickupVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
231
240
|
/** Helper function to spawn a `EntityType.PROJECTILE` (9). */
|
|
232
|
-
export declare function spawnProjectile(projectileVariant: ProjectileVariant
|
|
241
|
+
export declare function spawnProjectile(projectileVariant: ProjectileVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityProjectile;
|
|
233
242
|
/** Helper function to spawn a `EntityType.PROJECTILE` (9) with a specific seed. */
|
|
234
|
-
export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVariant
|
|
243
|
+
export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityProjectile;
|
|
235
244
|
/** Helper function to spawn a `EntityType.SLOT` (6). */
|
|
236
|
-
export declare function spawnSlot(slotVariant: SlotVariant
|
|
245
|
+
export declare function spawnSlot(slotVariant: SlotVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): Entity;
|
|
237
246
|
/** Helper function to spawn a `EntityType.SLOT` (6) with a specific seed. */
|
|
238
247
|
export declare function spawnSlotWithSeed(slotVariant: int | SlotVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
|
|
239
248
|
/** Helper function to spawn a `EntityType.TEAR` (2). */
|
|
240
|
-
export declare function spawnTear(tearVariant: TearVariant
|
|
249
|
+
export declare function spawnTear(tearVariant: TearVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityTear;
|
|
241
250
|
/** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
|
|
242
|
-
export declare function spawnTearWithSeed(tearVariant: TearVariant
|
|
251
|
+
export declare function spawnTearWithSeed(tearVariant: TearVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityTear;
|
|
@@ -55,19 +55,20 @@ export declare function getEnumLength<T>(transpiledEnum: T): int;
|
|
|
55
55
|
export declare function getEnumValues<T>(transpiledEnum: T): Array<T[keyof T]>;
|
|
56
56
|
export declare function getLastEnumValue<T>(transpiledEnum: T): T[keyof T];
|
|
57
57
|
/**
|
|
58
|
-
* Helper function to get a random
|
|
58
|
+
* Helper function to get a random value from the provided enum.
|
|
59
59
|
*
|
|
60
|
-
* @param transpiledEnum The enum to get
|
|
60
|
+
* @param transpiledEnum The enum to get the value from.
|
|
61
61
|
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
62
|
-
*
|
|
62
|
+
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
63
63
|
* @param exceptions Optional. An array of elements to skip over if selected.
|
|
64
64
|
*/
|
|
65
|
-
export declare function
|
|
65
|
+
export declare function getRandomEnumValue<T>(transpiledEnum: T, seedOrRNG?: Seed | RNG, exceptions?: Array<T[keyof T]> | ReadonlyArray<T[keyof T]>): T[keyof T];
|
|
66
66
|
/**
|
|
67
67
|
* Helper function to check every value of a custom enum for -1. This is helpful as a run-time check
|
|
68
68
|
* because many methods of the Isaac class return -1 if they fail.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
70
|
+
* For example:
|
|
71
|
+
*
|
|
71
72
|
* ```ts
|
|
72
73
|
* enum EntityTypeCustom {
|
|
73
74
|
* FOO = Isaac.GetEntityTypeByName("Foo"),
|
package/dist/functions/enums.lua
CHANGED
|
@@ -63,7 +63,7 @@ function ____exports.getLastEnumValue(self, transpiledEnum)
|
|
|
63
63
|
end
|
|
64
64
|
return lastElement
|
|
65
65
|
end
|
|
66
|
-
function ____exports.
|
|
66
|
+
function ____exports.getRandomEnumValue(self, transpiledEnum, seedOrRNG, exceptions)
|
|
67
67
|
if seedOrRNG == nil then
|
|
68
68
|
seedOrRNG = getRandomSeed(nil)
|
|
69
69
|
end
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
* @param player The player that owns the familiars.
|
|
23
23
|
* @param collectibleType The collectible type of the collectible associated with this familiar.
|
|
24
24
|
* @param targetCount The number of familiars that should exist. This function will add or remove
|
|
25
|
-
*
|
|
25
|
+
* familiars until it matches the target count.
|
|
26
26
|
* @param familiarVariant The variant of the familiar to spawn or remove.
|
|
27
27
|
* @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
|
|
28
|
-
*
|
|
29
|
-
* sub-type of 0.
|
|
28
|
+
* specified, it will search for existing familiars of all sub-types, and
|
|
29
|
+
* spawn new familiars with a sub-type of 0.
|
|
30
30
|
*/
|
|
31
31
|
export declare function checkFamiliar(player: EntityPlayer, collectibleType: int, targetCount: int, familiarVariant: int, familiarSubType?: int): void;
|
|
32
32
|
/**
|
|
@@ -53,8 +53,8 @@ export declare function checkFamiliar(player: EntityPlayer, collectibleType: int
|
|
|
53
53
|
* @param collectibleType The collectible type of the collectible associated with this familiar.
|
|
54
54
|
* @param familiarVariant The variant of the familiar to spawn or remove.
|
|
55
55
|
* @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
|
|
56
|
-
*
|
|
57
|
-
* sub-type of 0.
|
|
56
|
+
* specified, it will search for existing familiars of all sub-types, and
|
|
57
|
+
* spawn new familiars with a sub-type of 0.
|
|
58
58
|
*/
|
|
59
59
|
export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: int, familiarVariant: int, familiarSubType?: int): void;
|
|
60
60
|
export declare function isFamiliarThatShootsPlayerTears(familiar: EntityFamiliar): boolean;
|
|
@@ -28,6 +28,6 @@ function ____exports.checkFamiliarFromCollectibles(self, player, collectibleType
|
|
|
28
28
|
)
|
|
29
29
|
end
|
|
30
30
|
function ____exports.isFamiliarThatShootsPlayerTears(self, familiar)
|
|
31
|
-
return FAMILIARS_THAT_SHOOT_PLAYER_TEARS_SET:has(familiar.
|
|
31
|
+
return FAMILIARS_THAT_SHOOT_PLAYER_TEARS_SET:has(familiar.Variant)
|
|
32
32
|
end
|
|
33
33
|
return ____exports
|
package/dist/functions/flag.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { DamageFlag } from "isaac-typescript-definitions";
|
|
|
5
5
|
* This is a variadic function, so pass as many flags as you want to add.
|
|
6
6
|
*
|
|
7
7
|
* Example 1:
|
|
8
|
+
*
|
|
8
9
|
* ```ts
|
|
9
10
|
* // Give the player spectral tears
|
|
10
11
|
* const player = Isaac.GetPlayer();
|
|
@@ -12,6 +13,7 @@ import { DamageFlag } from "isaac-typescript-definitions";
|
|
|
12
13
|
* ```
|
|
13
14
|
*
|
|
14
15
|
* Example 2:
|
|
16
|
+
*
|
|
15
17
|
* ```ts
|
|
16
18
|
* // Give the player spectral and homing tears
|
|
17
19
|
* const player = Isaac.GetPlayer();
|
|
@@ -51,7 +53,8 @@ export declare function getFlagName<T extends BitFlag | BitFlag128>(flag: BitFla
|
|
|
51
53
|
* This is a variadic function, so pass as many flags as you want to check for. If passed multiple
|
|
52
54
|
* flags, it will only return true if all of the flags are set.
|
|
53
55
|
*
|
|
54
|
-
*
|
|
56
|
+
* For example:
|
|
57
|
+
*
|
|
55
58
|
* ```ts
|
|
56
59
|
* const player = Isaac.GetPlayer();
|
|
57
60
|
* if (hasFlag(player.TearFlags, TearFlags.TEAR_SPECTRAL) {
|
|
@@ -81,7 +84,8 @@ export declare function isSelfDamage(damageFlags: DamageFlag | BitFlags<DamageFl
|
|
|
81
84
|
*
|
|
82
85
|
* This is a variadic function, so pass as many flags as you want to remove.
|
|
83
86
|
*
|
|
84
|
-
*
|
|
87
|
+
* For example:
|
|
88
|
+
*
|
|
85
89
|
* ```ts
|
|
86
90
|
* // Remove spectral tears from the player, if present
|
|
87
91
|
* const player = Isaac.GetPlayer();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectibleType } from "isaac-typescript-definitions";
|
|
1
|
+
import { CollectibleType, TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a set of all of the collectibles that grant flight. This is derived from collectibles
|
|
4
4
|
* that have `CacheFlag.FLYING` set in the "items.xml" file.
|
|
@@ -7,13 +7,13 @@ import { CollectibleType } from "isaac-typescript-definitions";
|
|
|
7
7
|
* Vessel should be checked for via the `hasFlyingTemporaryEffect` function.
|
|
8
8
|
*
|
|
9
9
|
* @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
|
|
10
|
-
*
|
|
10
|
+
* should be included in the set (like Empty Vessel).
|
|
11
11
|
*/
|
|
12
|
-
export declare function getFlyingCollectibles(pruneConditionalItems: boolean): Set<CollectibleType
|
|
12
|
+
export declare function getFlyingCollectibles(pruneConditionalItems: boolean): Set<CollectibleType>;
|
|
13
13
|
/**
|
|
14
14
|
* Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
|
|
15
15
|
* conditionally, like Bat Wing.)
|
|
16
16
|
*/
|
|
17
|
-
export declare function getFlyingTrinkets(): ReadonlySet<
|
|
17
|
+
export declare function getFlyingTrinkets(): ReadonlySet<TrinketType>;
|
|
18
18
|
export declare function hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
|
|
19
19
|
export declare function isFlyingCharacter(player: EntityPlayer): boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GridEntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import { GridEntityType, GridEntityXMLType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to convert the grid entity type found in a room XML file to the corresponding
|
|
4
4
|
* grid entity type and variant normally used by the game. For example, a rock is represented as
|
|
5
5
|
* 1000.0 in a room XML file, but `GridEntityType.ROCK` is equal to 2.
|
|
6
6
|
*/
|
|
7
|
-
export declare function convertXMLGridEntityType(gridEntityXMLType:
|
|
7
|
+
export declare function convertXMLGridEntityType(gridEntityXMLType: GridEntityXMLType, gridEntityXMLVariant: int): [GridEntityType, int] | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* Gets the entities that have a hitbox that overlaps with any part of the square that the grid
|
|
10
10
|
* entity is on.
|
|
@@ -19,14 +19,16 @@ export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntit
|
|
|
19
19
|
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
|
|
20
20
|
* arguments to match specific grid entity types.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* For example:
|
|
23
|
+
*
|
|
23
24
|
* ```ts
|
|
24
25
|
* for (const gridEntity of getGridEntities()) {
|
|
25
26
|
* print(gridEntity.GetType())
|
|
26
27
|
* }
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
29
|
-
*
|
|
30
|
+
* For example:
|
|
31
|
+
*
|
|
30
32
|
* ```ts
|
|
31
33
|
* const rocks = getGridEntities(
|
|
32
34
|
* GridEntityType.ROCK,
|
|
@@ -77,7 +79,8 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
77
79
|
* Helper function to all grid entities in the room except for ones matching the grid entity types
|
|
78
80
|
* provided.
|
|
79
81
|
*
|
|
80
|
-
*
|
|
82
|
+
* For example:
|
|
83
|
+
*
|
|
81
84
|
* ```ts
|
|
82
85
|
* removeAllGridEntitiesExceptFor(
|
|
83
86
|
* GridEntityType.WALL,
|
|
@@ -92,7 +95,8 @@ export declare function removeAllGridExcept(...gridEntityTypes: GridEntityType[]
|
|
|
92
95
|
* Helper function to remove all of the grid entities in the room that match the grid entity types
|
|
93
96
|
* provided.
|
|
94
97
|
*
|
|
95
|
-
*
|
|
98
|
+
* For example:
|
|
99
|
+
*
|
|
96
100
|
* ```ts
|
|
97
101
|
* removeAllMatchingGridEntities(
|
|
98
102
|
* GridEntityType.ROCK,
|
|
@@ -109,10 +113,11 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
|
|
|
109
113
|
*
|
|
110
114
|
* @param gridEntity The grid entity to remove.
|
|
111
115
|
* @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
|
|
112
|
-
*
|
|
113
|
-
* unable to spawn another grid entity on the same tile until
|
|
114
|
-
* this is expensive, since it involves a call
|
|
115
|
-
* need to invoke this
|
|
116
|
+
* Default is true. This is generally a good idea because if the room is not
|
|
117
|
+
* updated, you will be unable to spawn another grid entity on the same tile until
|
|
118
|
+
* a frame has passed. However, doing this is expensive, since it involves a call
|
|
119
|
+
* to `Isaac.GetRoomEntities`, so set it to false if you need to invoke this
|
|
120
|
+
* function multiple times.
|
|
116
121
|
*/
|
|
117
122
|
export declare function removeGrid(gridEntity: GridEntity, updateRoom?: boolean): void;
|
|
118
123
|
/**
|
|
@@ -7,7 +7,6 @@ local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
|
7
7
|
local ____exports = {}
|
|
8
8
|
local getAllGridEntities
|
|
9
9
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
10
|
-
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
11
10
|
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
12
11
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
13
12
|
local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
|
|
@@ -109,9 +108,6 @@ local BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS = __TS__New(
|
|
|
109
108
|
{(tostring(GridEntityType.STATUE) .. ".") .. tostring(StatueVariant.ANGEL)}
|
|
110
109
|
)
|
|
111
110
|
function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntityXMLVariant)
|
|
112
|
-
if gridEntityXMLType == EntityType.TRIGGER_OUTPUT then
|
|
113
|
-
return nil
|
|
114
|
-
end
|
|
115
111
|
local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
|
|
116
112
|
if gridEntityArray == nil then
|
|
117
113
|
error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
|
|
@@ -13,7 +13,7 @@ interface CopyKColorReturn {
|
|
|
13
13
|
* Helper function to copy a `KColor` object.
|
|
14
14
|
*
|
|
15
15
|
* @param kColor The KColor object to copy. In the case of deserialization, this will actually be a
|
|
16
|
-
*
|
|
16
|
+
* Lua table instead of an instantiated KColor class.
|
|
17
17
|
* @param serializationType Default is `SerializationType.NONE`.
|
|
18
18
|
*/
|
|
19
19
|
export declare function copyKColor<K extends KColor | SerializedKColor, S extends SerializationType>(kColor: K, serializationType: S): CopyKColorReturn[S];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fillLevelWithRedRooms(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
4
|
+
local ____cachedClasses = require("cachedClasses")
|
|
5
|
+
local game = ____cachedClasses.game
|
|
6
|
+
local ____enums = require("functions.enums")
|
|
7
|
+
local getEnumValues = ____enums.getEnumValues
|
|
8
|
+
local ____rooms = require("functions.rooms")
|
|
9
|
+
local getNumRooms = ____rooms.getNumRooms
|
|
10
|
+
local getRooms = ____rooms.getRooms
|
|
11
|
+
local isDoorSlotValidAtGridIndexForRedRoom = ____rooms.isDoorSlotValidAtGridIndexForRedRoom
|
|
12
|
+
function ____exports.fillLevelWithRedRooms(self)
|
|
13
|
+
local level = game:GetLevel()
|
|
14
|
+
local numRooms
|
|
15
|
+
repeat
|
|
16
|
+
do
|
|
17
|
+
local rooms = getRooms(nil)
|
|
18
|
+
numRooms = #rooms
|
|
19
|
+
for ____, roomDescriptor in ipairs(rooms) do
|
|
20
|
+
for ____, doorSlot in ipairs(getEnumValues(nil, DoorSlot)) do
|
|
21
|
+
if isDoorSlotValidAtGridIndexForRedRoom(nil, doorSlot, roomDescriptor.GridIndex) then
|
|
22
|
+
level:MakeRedRoomDoor(roomDescriptor.GridIndex, doorSlot)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
until not (numRooms ~= getNumRooms(nil))
|
|
28
|
+
end
|
|
29
|
+
return ____exports
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function logColor(this: void, color: Color): void;
|
|
|
17
17
|
export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
|
|
18
18
|
export declare function logEffects(this: void, player: EntityPlayer): void;
|
|
19
19
|
/** Helper function for printing out every entity (or filtered entity) in the current room. */
|
|
20
|
-
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType
|
|
20
|
+
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void;
|
|
21
21
|
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
22
22
|
export declare function logEntityFlags(this: void, flags: EntityFlag | BitFlags<EntityFlag>): void;
|
|
23
23
|
export declare function logEntityID(this: void, entity: Entity): void;
|
|
@@ -37,7 +37,7 @@ export declare function logGameStateFlags(this: void): void;
|
|
|
37
37
|
/**
|
|
38
38
|
* Helper function for printing out every grid entity (or filtered grid entity) in the current room.
|
|
39
39
|
*/
|
|
40
|
-
export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType
|
|
40
|
+
export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType): void;
|
|
41
41
|
export declare function logKColor(this: void, kColor: KColor): void;
|
|
42
42
|
/**
|
|
43
43
|
* Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
package/dist/functions/map.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
|
5
5
|
* purposes of this function, both search text and map keys are converted to lowercase before
|
|
6
6
|
* attempting to find a match.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* For example:
|
|
9
|
+
*
|
|
9
10
|
* ```ts
|
|
10
11
|
* const map = new <string, number>Map([
|
|
11
12
|
* ["foo", 123],
|
package/dist/functions/math.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Direction } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to normalize an integer.
|
|
4
|
+
*
|
|
5
|
+
* - If `x` is less than `min`, then it will be clamped to `min`.
|
|
6
|
+
* - If `x` is greater than `max`, then it will be clamped to `max`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function clamp(x: int, min: int, max: int): int;
|
|
2
9
|
export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
3
10
|
/**
|
|
4
11
|
* Helper function to get an array of equidistant points on the circumference around a circle.
|
|
@@ -10,7 +17,7 @@ export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
|
10
17
|
* @param xMultiplier An optional multiplier to get the points around an oval. Default is 1.
|
|
11
18
|
* @param yMultiplier An optional multiplier to get the points around an oval. Default is 1.
|
|
12
19
|
* @param initialDirection By default, the first point on the circle will be on the top center, but
|
|
13
|
-
*
|
|
20
|
+
* this can be optionally changed by specifying this argument.
|
|
14
21
|
*/
|
|
15
22
|
export declare function getCircleDiscretizedPoints(centerPos: Vector, radius: float, numPoints: int, xMultiplier?: number, yMultiplier?: number, initialDirection?: Direction): Vector[];
|
|
16
23
|
/**
|
package/dist/functions/math.lua
CHANGED
|
@@ -3,6 +3,12 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
3
3
|
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
4
4
|
local ____direction = require("functions.direction")
|
|
5
5
|
local directionToVector = ____direction.directionToVector
|
|
6
|
+
function ____exports.clamp(self, x, min, max)
|
|
7
|
+
return math.max(
|
|
8
|
+
min,
|
|
9
|
+
math.min(x, max)
|
|
10
|
+
)
|
|
11
|
+
end
|
|
6
12
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
7
13
|
local subtractedAngle = angle1 - angle2
|
|
8
14
|
return (subtractedAngle + 180) % 360 - 180
|
package/dist/functions/npc.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ import { EntityType, ProjectilesMode } from "isaac-typescript-definitions";
|
|
|
7
7
|
* @param position The staring position of the projectile.
|
|
8
8
|
* @param velocity The starting velocity of the projectile.
|
|
9
9
|
* @param projectilesMode The mode of the projectile. Optional. Default is
|
|
10
|
-
*
|
|
10
|
+
* `ProjectilesMode.ONE_PROJECTILE`.
|
|
11
11
|
* @param projectileParams The parameters of the projectile. Optional. Default is
|
|
12
|
-
*
|
|
12
|
+
* `ProjectileParams()`.
|
|
13
13
|
* @returns The fired projectile.
|
|
14
14
|
*/
|
|
15
15
|
export declare function fireProjectiles(npc: EntityNPC, position: Vector, velocity: Vector, projectilesMode?: ProjectilesMode, projectileParams?: ProjectileParams): EntityProjectile[];
|
|
@@ -19,7 +19,7 @@ export declare function fireProjectiles(npc: EntityNPC, position: Vector, veloci
|
|
|
19
19
|
* This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
|
|
20
20
|
* holes.
|
|
21
21
|
*/
|
|
22
|
-
export declare function getAliveNPCs(matchingEntityType?: EntityType
|
|
22
|
+
export declare function getAliveNPCs(matchingEntityType?: EntityType, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
23
23
|
/**
|
|
24
24
|
* Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
25
25
|
* not actually keep the doors closed (like Death's scythes).
|