isaacscript-common 6.6.5 → 6.7.0
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/customRevive.lua +4 -4
- package/dist/callbacks/postCursedTeleport.lua +2 -2
- package/dist/callbacks/postCustomDoorEnter.lua +5 -5
- package/dist/callbacks/postDiceRoomActivated.lua +2 -2
- package/dist/callbacks/postFlip.lua +3 -3
- package/dist/callbacks/postGridEntity.lua +3 -3
- package/dist/callbacks/postGridEntityCollision.lua +3 -3
- package/dist/callbacks/postGridEntityRender.lua +2 -2
- package/dist/callbacks/postNewRoomEarly.lua +5 -5
- package/dist/callbacks/postPickupCollect.lua +2 -2
- package/dist/callbacks/postPitRender.lua +2 -2
- package/dist/callbacks/postPitUpdate.lua +2 -2
- package/dist/callbacks/postPlayerCollectible.lua +2 -2
- package/dist/callbacks/postPoopRender.lua +2 -2
- package/dist/callbacks/postPoopUpdate.lua +2 -2
- package/dist/callbacks/postPressurePlateRender.lua +2 -2
- package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
- package/dist/callbacks/postPurchase.lua +2 -2
- package/dist/callbacks/postRockRender.lua +2 -2
- package/dist/callbacks/postRockUpdate.lua +2 -2
- package/dist/callbacks/postSlotInitUpdate.lua +2 -2
- package/dist/callbacks/postSlotRender.lua +2 -2
- package/dist/callbacks/postSpikesRender.lua +2 -2
- package/dist/callbacks/postSpikesUpdate.lua +2 -2
- package/dist/callbacks/postTNTRender.lua +2 -2
- package/dist/callbacks/postTNTUpdate.lua +2 -2
- package/dist/callbacks/preBerserkDeath.lua +2 -2
- package/dist/callbacks/preNewLevel.lua +2 -2
- package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
- package/dist/features/characterStats.lua +2 -2
- package/dist/features/collectibleItemPoolType.lua +2 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +5 -5
- package/dist/features/customStage/backdrop.lua +2 -2
- package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
- package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
- package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
- package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
- package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
- package/dist/features/customStage/exports.lua +4 -4
- package/dist/features/customStage/init.lua +6 -6
- package/dist/features/customStage/shadows.lua +2 -2
- package/dist/features/customStage/versusScreen.lua +4 -4
- package/dist/features/debugDisplay/v.lua +4 -4
- package/dist/features/deployJSONRoom.lua +20 -20
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
- package/dist/features/pause.lua +2 -2
- package/dist/features/persistentEntities.lua +2 -2
- package/dist/features/preventCollectibleRotation.lua +2 -2
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/sirenHelpers.lua +2 -2
- package/dist/functions/ambush.lua +5 -5
- package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
- package/dist/functions/bosses.d.ts.map +1 -0
- package/dist/functions/{boss.lua → bosses.lua} +38 -13
- package/dist/functions/collectibleTag.lua +2 -2
- package/dist/functions/collectibles.lua +5 -5
- package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
- package/dist/functions/entities.d.ts.map +1 -0
- package/dist/functions/{entity.lua → entities.lua} +25 -20
- package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
- package/dist/functions/entitiesSpecific.d.ts.map +1 -0
- package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
- package/dist/functions/familiars.lua +2 -2
- package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
- package/dist/functions/gridEntities.d.ts.map +1 -0
- package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
- package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
- package/dist/functions/gridEntitiesSpecific.lua +366 -0
- package/dist/functions/log.lua +8 -8
- package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
- package/dist/functions/npcs.d.ts.map +1 -0
- package/dist/functions/{npc.lua → npcs.lua} +44 -9
- package/dist/functions/pickups.d.ts +4 -119
- package/dist/functions/pickups.d.ts.map +1 -1
- package/dist/functions/pickups.lua +10 -439
- package/dist/functions/pickupsSpecific.d.ts +229 -0
- package/dist/functions/pickupsSpecific.d.ts.map +1 -0
- package/dist/functions/pickupsSpecific.lua +560 -0
- package/dist/functions/playerHealth.lua +6 -6
- package/dist/functions/{player.d.ts → players.d.ts} +1 -1
- package/dist/functions/players.d.ts.map +1 -0
- package/dist/functions/{player.lua → players.lua} +0 -0
- package/dist/functions/pocketItems.lua +2 -2
- package/dist/functions/positionVelocity.lua +6 -6
- package/dist/functions/pressurePlate.d.ts +10 -0
- package/dist/functions/pressurePlate.d.ts.map +1 -0
- package/dist/functions/pressurePlate.lua +29 -0
- package/dist/functions/revive.lua +7 -7
- package/dist/functions/rooms.lua +2 -2
- package/dist/functions/saveFile.lua +3 -3
- package/dist/functions/spawnCollectible.lua +4 -4
- package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
- package/dist/functions/sprites.d.ts.map +1 -0
- package/dist/functions/{sprite.lua → sprites.lua} +0 -0
- package/dist/functions/transformations.lua +2 -2
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.lua +6 -6
- package/dist/functions/utils.d.ts +7 -0
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +35 -22
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +26 -10
- package/dist/types/AnyGridEntity.d.ts +10 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -0
- package/dist/types/AnyGridEntity.lua +2 -0
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +2 -2
- package/src/callbacks/postCursedTeleport.ts +1 -1
- package/src/callbacks/postCustomDoorEnter.ts +2 -2
- package/src/callbacks/postDiceRoomActivated.ts +1 -1
- package/src/callbacks/postFlip.ts +1 -1
- package/src/callbacks/postGridEntity.ts +1 -1
- package/src/callbacks/postGridEntityCollision.ts +1 -1
- package/src/callbacks/postGridEntityRender.ts +1 -1
- package/src/callbacks/postNewRoomEarly.ts +9 -3
- package/src/callbacks/postPickupCollect.ts +1 -1
- package/src/callbacks/postPitRender.ts +1 -1
- package/src/callbacks/postPitUpdate.ts +1 -1
- package/src/callbacks/postPlayerCollectible.ts +1 -1
- package/src/callbacks/postPoopRender.ts +1 -1
- package/src/callbacks/postPoopUpdate.ts +1 -1
- package/src/callbacks/postPressurePlateRender.ts +1 -1
- package/src/callbacks/postPressurePlateUpdate.ts +1 -1
- package/src/callbacks/postPurchase.ts +1 -1
- package/src/callbacks/postRockRender.ts +1 -1
- package/src/callbacks/postRockUpdate.ts +1 -1
- package/src/callbacks/postSlotInitUpdate.ts +1 -1
- package/src/callbacks/postSlotRender.ts +1 -1
- package/src/callbacks/postSpikesRender.ts +1 -1
- package/src/callbacks/postSpikesUpdate.ts +1 -1
- package/src/callbacks/postTNTRender.ts +1 -1
- package/src/callbacks/postTNTUpdate.ts +1 -1
- package/src/callbacks/preBerserkDeath.ts +1 -1
- package/src/callbacks/preNewLevel.ts +1 -1
- package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
- package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPitRender.ts +6 -7
- package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
- package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
- package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
- package/src/features/characterStats.ts +1 -1
- package/src/features/collectibleItemPoolType.ts +1 -1
- package/src/features/customGridEntity.ts +6 -3
- package/src/features/customStage/backdrop.ts +1 -1
- package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
- package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
- package/src/features/customStage/exports.ts +2 -2
- package/src/features/customStage/init.ts +1 -1
- package/src/features/customStage/shadows.ts +1 -1
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/debugDisplay/v.ts +2 -2
- package/src/features/deployJSONRoom.ts +11 -7
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
- package/src/features/extraConsoleCommands/listCommands.ts +10 -6
- package/src/features/pause.ts +1 -1
- package/src/features/persistentEntities.ts +1 -1
- package/src/features/preventCollectibleRotation.ts +1 -1
- package/src/features/saveDataManager/exports.ts +7 -4
- package/src/features/sirenHelpers.ts +1 -1
- package/src/functions/ambush.ts +2 -2
- package/src/functions/{boss.ts → bosses.ts} +29 -21
- package/src/functions/collectibleTag.ts +1 -1
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/{entity.ts → entities.ts} +23 -21
- package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
- package/src/functions/familiars.ts +1 -1
- package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
- package/src/functions/gridEntitiesSpecific.ts +490 -0
- package/src/functions/log.ts +3 -3
- package/src/functions/{npc.ts → npcs.ts} +42 -11
- package/src/functions/pickups.ts +8 -475
- package/src/functions/pickupsSpecific.ts +613 -0
- package/src/functions/playerHealth.ts +1 -1
- package/src/functions/{player.ts → players.ts} +0 -0
- package/src/functions/pocketItems.ts +1 -1
- package/src/functions/positionVelocity.ts +3 -3
- package/src/functions/pressurePlate.ts +29 -0
- package/src/functions/revive.ts +2 -2
- package/src/functions/rooms.ts +1 -1
- package/src/functions/saveFile.ts +1 -1
- package/src/functions/spawnCollectible.ts +2 -2
- package/src/functions/{sprite.ts → sprites.ts} +0 -0
- package/src/functions/transformations.ts +1 -1
- package/src/functions/trinketGive.ts +1 -1
- package/src/functions/trinkets.ts +3 -3
- package/src/functions/utils.ts +32 -13
- package/src/index.ts +10 -8
- package/src/types/AnyGridEntity.ts +9 -0
- package/dist/features/customStage/gridEntities.d.ts.map +0 -1
- package/dist/features/customStage/util.d.ts.map +0 -1
- package/dist/functions/boss.d.ts.map +0 -1
- package/dist/functions/entity.d.ts.map +0 -1
- package/dist/functions/entitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntity.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.d.ts +0 -29
- package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.lua +0 -114
- package/dist/functions/npc.d.ts.map +0 -1
- package/dist/functions/player.d.ts.map +0 -1
- package/dist/functions/sprite.d.ts.map +0 -1
- package/src/functions/gridEntitySpecific.ts +0 -143
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BatterySubType,
|
|
3
|
+
BombSubType,
|
|
4
|
+
Card,
|
|
5
|
+
CoinSubType,
|
|
6
|
+
CollectibleType,
|
|
7
|
+
HeartSubType,
|
|
8
|
+
KeySubType,
|
|
9
|
+
PickupVariant,
|
|
10
|
+
PillColor,
|
|
11
|
+
SackSubType,
|
|
12
|
+
TrinketType,
|
|
13
|
+
} from "isaac-typescript-definitions";
|
|
14
|
+
import { VectorZero } from "../constants";
|
|
15
|
+
import { getPickups, removeAllPickups, spawnPickup } from "./entitiesSpecific";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to get all of the battery entities in the room.
|
|
19
|
+
*
|
|
20
|
+
* @param batterySubType Optional. If specified, will only get the batteries that match the
|
|
21
|
+
* sub-type. Default is -1, which matches every sub-type.
|
|
22
|
+
*/
|
|
23
|
+
export function getBatteries(
|
|
24
|
+
batterySubType: BatterySubType = -1,
|
|
25
|
+
): EntityPickupBattery[] {
|
|
26
|
+
return getPickups(
|
|
27
|
+
PickupVariant.LIL_BATTERY,
|
|
28
|
+
batterySubType,
|
|
29
|
+
) as EntityPickupBattery[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Helper function to get all of the bomb entities in the room. (Specifically, this refers to bomb
|
|
34
|
+
* pickups, not the `EntityBomb` class.)
|
|
35
|
+
*
|
|
36
|
+
* @param bombSubType Optional. If specified, will only get the bombs that match the sub-type.
|
|
37
|
+
* Default is -1, which matches every sub-type.
|
|
38
|
+
*/
|
|
39
|
+
export function getBombPickups(
|
|
40
|
+
bombSubType: BombSubType = -1,
|
|
41
|
+
): EntityPickupBomb[] {
|
|
42
|
+
return getPickups(PickupVariant.BOMB, bombSubType) as EntityPickupBomb[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Helper function to get all of the card entities in the room.
|
|
47
|
+
*
|
|
48
|
+
* @param card Optional. If specified, will only get the cards that match the sub-type. Default is
|
|
49
|
+
* -1, which matches every sub-type.
|
|
50
|
+
*/
|
|
51
|
+
export function getCards(card: Card = -1): EntityPickupCard[] {
|
|
52
|
+
return getPickups(PickupVariant.TAROT_CARD, card) as EntityPickupCard[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Helper function to get all of the coin pickup entities in the room.
|
|
57
|
+
*
|
|
58
|
+
* @param coinSubType Optional. If specified, will only get the coins that match the sub-type.
|
|
59
|
+
* Default is -1, which matches every sub-type.
|
|
60
|
+
*/
|
|
61
|
+
export function getCoins(coinSubType: CoinSubType = -1): EntityPickupCoin[] {
|
|
62
|
+
return getPickups(PickupVariant.COIN, coinSubType) as EntityPickupCoin[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Helper function to get all of the collectible entities in the room.
|
|
67
|
+
*
|
|
68
|
+
* @param collectibleType Optional. If specified, will only get the collectibles that match the
|
|
69
|
+
* sub-type. Default is -1, which matches every sub-type.
|
|
70
|
+
*/
|
|
71
|
+
export function getCollectibles(
|
|
72
|
+
collectibleType: CollectibleType = -1,
|
|
73
|
+
): EntityPickupCollectible[] {
|
|
74
|
+
return getPickups(
|
|
75
|
+
PickupVariant.COLLECTIBLE,
|
|
76
|
+
collectibleType,
|
|
77
|
+
) as EntityPickupCollectible[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Helper function to get all of the heart pickup entities in the room.
|
|
82
|
+
*
|
|
83
|
+
* @param heartSubType Optional. If specified, will only get the hearts that match the sub-type.
|
|
84
|
+
* Default is -1, which matches every sub-type.
|
|
85
|
+
*/
|
|
86
|
+
export function getHearts(
|
|
87
|
+
heartSubType: HeartSubType = -1,
|
|
88
|
+
): EntityPickupHeart[] {
|
|
89
|
+
return getPickups(PickupVariant.HEART, heartSubType) as EntityPickupHeart[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Helper function to get all of the key pickup entities in the room.
|
|
94
|
+
*
|
|
95
|
+
* @param keySubType Optional. If specified, will only get the keys that match the sub-type. Default
|
|
96
|
+
* is -1, which matches every sub-type.
|
|
97
|
+
*/
|
|
98
|
+
export function getKeys(keySubType: KeySubType = -1): EntityPickupKey[] {
|
|
99
|
+
return getPickups(PickupVariant.KEY, keySubType) as EntityPickupKey[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Helper function to get all of the pill entities in the room.
|
|
104
|
+
*
|
|
105
|
+
* @param pillColor Optional. If specified, will only get the pills that match the sub-type. Default
|
|
106
|
+
* is -1, which matches every sub-type.
|
|
107
|
+
*/
|
|
108
|
+
export function getPills(pillColor: PillColor = -1): EntityPickupPill[] {
|
|
109
|
+
return getPickups(PickupVariant.PILL, pillColor) as EntityPickupPill[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Helper function to get all of the sack (i.e. grab bag) entities in the room.
|
|
114
|
+
*
|
|
115
|
+
* @param sackSubType Optional. If specified, will only get the sacks that match the sub-type.
|
|
116
|
+
* Default is -1, which matches every sub-type.
|
|
117
|
+
*/
|
|
118
|
+
export function getSacks(sackSubType: SackSubType = -1): EntityPickupSack[] {
|
|
119
|
+
return getPickups(PickupVariant.SACK, sackSubType) as EntityPickupSack[];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Helper function to get all of the trinket entities in the room.
|
|
124
|
+
*
|
|
125
|
+
* @param trinketType Optional. If specified, will only get the trinkets that match the sub-type.
|
|
126
|
+
* Default is -1, which matches every sub-type.
|
|
127
|
+
*/
|
|
128
|
+
export function getTrinkets(
|
|
129
|
+
trinketType: TrinketType = -1,
|
|
130
|
+
): EntityPickupTrinket[] {
|
|
131
|
+
return getPickups(
|
|
132
|
+
PickupVariant.TRINKET,
|
|
133
|
+
trinketType,
|
|
134
|
+
) as EntityPickupTrinket[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Helper function to remove all of the batteries in the room.
|
|
139
|
+
*
|
|
140
|
+
* @param batterySubType Optional. If specified, will only remove the batteries that match this
|
|
141
|
+
* sub-type. Default is -1, which matches every sub-type.
|
|
142
|
+
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
143
|
+
* @returns The batteries that were removed.
|
|
144
|
+
*/
|
|
145
|
+
export function removeAllBatteries(
|
|
146
|
+
batterySubType: BatterySubType = -1,
|
|
147
|
+
cap?: int,
|
|
148
|
+
): EntityPickupBattery[] {
|
|
149
|
+
return removeAllPickups(
|
|
150
|
+
PickupVariant.LIL_BATTERY,
|
|
151
|
+
batterySubType,
|
|
152
|
+
cap,
|
|
153
|
+
) as EntityPickupBattery[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Helper function to remove all of the bomb pickups in the room. (Specifically, this refers to bomb
|
|
158
|
+
* pickups, not the `EntityBomb` class.)
|
|
159
|
+
*
|
|
160
|
+
* @param bombSubType Optional. If specified, will only remove bombs that match this sub-type.
|
|
161
|
+
* Default is -1, which matches every sub-type.
|
|
162
|
+
* @param cap Optional. If specified, will only remove the given amount of bombs.
|
|
163
|
+
* @returns The bombs that were removed.
|
|
164
|
+
*/
|
|
165
|
+
export function removeAllBombPickups(
|
|
166
|
+
bombSubType: BombSubType = -1,
|
|
167
|
+
cap?: int,
|
|
168
|
+
): EntityPickupBomb[] {
|
|
169
|
+
return removeAllPickups(
|
|
170
|
+
PickupVariant.BOMB,
|
|
171
|
+
bombSubType,
|
|
172
|
+
cap,
|
|
173
|
+
) as EntityPickupBomb[];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Helper function to remove all of the cards in the room.
|
|
178
|
+
*
|
|
179
|
+
* @param card Optional. If specified, will only remove cards that match this sub-type. Default is
|
|
180
|
+
* -1, which matches every sub-type.
|
|
181
|
+
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
182
|
+
* @returns The cards that were removed.
|
|
183
|
+
*/
|
|
184
|
+
export function removeAllCards(card: Card = -1, cap?: int): EntityPickupCard[] {
|
|
185
|
+
return removeAllPickups(
|
|
186
|
+
PickupVariant.TAROT_CARD,
|
|
187
|
+
card,
|
|
188
|
+
cap,
|
|
189
|
+
) as EntityPickupCard[];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Helper function to remove all of the coins in the room.
|
|
194
|
+
*
|
|
195
|
+
* @param coinSubType Optional. If specified, will only remove coins that match this sub-type.
|
|
196
|
+
* Default is -1, which matches every sub-type.
|
|
197
|
+
* @param cap Optional. If specified, will only remove the given amount of coins.
|
|
198
|
+
* @returns The coins that were removed.
|
|
199
|
+
*/
|
|
200
|
+
export function removeAllCoins(
|
|
201
|
+
coinSubType?: CoinSubType,
|
|
202
|
+
cap?: int,
|
|
203
|
+
): EntityPickupCoin[] {
|
|
204
|
+
return removeAllPickups(
|
|
205
|
+
PickupVariant.COIN,
|
|
206
|
+
coinSubType,
|
|
207
|
+
cap,
|
|
208
|
+
) as EntityPickupCoin[];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Helper function to remove all of the collectibles in the room.
|
|
213
|
+
*
|
|
214
|
+
* @param collectibleType Optional. If specified, will only remove collectibles that match this
|
|
215
|
+
* sub-type. Default is -1, which matches every sub-type.
|
|
216
|
+
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
217
|
+
* @returns The collectibles that were removed.
|
|
218
|
+
*/
|
|
219
|
+
export function removeAllCollectibles(
|
|
220
|
+
collectibleType?: CollectibleType,
|
|
221
|
+
cap?: int,
|
|
222
|
+
): EntityPickupCollectible[] {
|
|
223
|
+
return removeAllPickups(
|
|
224
|
+
PickupVariant.COLLECTIBLE,
|
|
225
|
+
collectibleType,
|
|
226
|
+
cap,
|
|
227
|
+
) as EntityPickupCollectible[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Helper function to remove all of the heart pickup entities in the room.
|
|
232
|
+
*
|
|
233
|
+
* @param heartSubType Optional. If specified, will only remove hearts that match this sub-type.
|
|
234
|
+
* Default is -1, which matches every sub-type.
|
|
235
|
+
* @param cap Optional. If specified, will only remove the given amount of hearts.
|
|
236
|
+
* @returns The hearts that were removed.
|
|
237
|
+
*/
|
|
238
|
+
export function removeAllHearts(
|
|
239
|
+
heartSubType?: HeartSubType,
|
|
240
|
+
cap?: int,
|
|
241
|
+
): EntityPickupHeart[] {
|
|
242
|
+
return removeAllPickups(
|
|
243
|
+
PickupVariant.HEART,
|
|
244
|
+
heartSubType,
|
|
245
|
+
cap,
|
|
246
|
+
) as EntityPickupHeart[];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Helper function to remove all of the keys in the room.
|
|
251
|
+
*
|
|
252
|
+
* @param keySubType Optional. If specified, will only remove keys that match this sub-type. Default
|
|
253
|
+
* is -1, which matches every sub-type.
|
|
254
|
+
* @param cap Optional. If specified, will only remove the given amount of keys.
|
|
255
|
+
* @returns The keys that were removed.
|
|
256
|
+
*/
|
|
257
|
+
export function removeAllKeys(
|
|
258
|
+
keySubType?: KeySubType,
|
|
259
|
+
cap?: int,
|
|
260
|
+
): EntityPickupKey[] {
|
|
261
|
+
return removeAllPickups(
|
|
262
|
+
PickupVariant.KEY,
|
|
263
|
+
keySubType,
|
|
264
|
+
cap,
|
|
265
|
+
) as EntityPickupKey[];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Helper function to remove all of the pills in the room.
|
|
270
|
+
*
|
|
271
|
+
* @param pillColor Optional. If specified, will only remove pills that match this sub-type. Default
|
|
272
|
+
* is -1, which matches every sub-type.
|
|
273
|
+
* @param cap Optional. If specified, will only remove the given amount of pills.
|
|
274
|
+
* @returns The pills that were removed.
|
|
275
|
+
*/
|
|
276
|
+
export function removeAllPills(
|
|
277
|
+
pillColor?: PillColor,
|
|
278
|
+
cap?: int,
|
|
279
|
+
): EntityPickupPill[] {
|
|
280
|
+
return removeAllPickups(
|
|
281
|
+
PickupVariant.PILL,
|
|
282
|
+
pillColor,
|
|
283
|
+
cap,
|
|
284
|
+
) as EntityPickupPill[];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Helper function to remove all of the sacks (i.e. grab bags) in the room.
|
|
289
|
+
*
|
|
290
|
+
* @param sackSubType Optional. If specified, will only remove sacks that match this sub-type.
|
|
291
|
+
* Default is -1, which matches every sub-type.
|
|
292
|
+
* @param cap Optional. If specified, will only remove the given amount of sacks.
|
|
293
|
+
* @returns The sacks that were removed.
|
|
294
|
+
*/
|
|
295
|
+
export function removeAllSacks(
|
|
296
|
+
sackSubType?: SackSubType,
|
|
297
|
+
cap?: int,
|
|
298
|
+
): EntityPickupSack[] {
|
|
299
|
+
return removeAllPickups(
|
|
300
|
+
PickupVariant.TRINKET,
|
|
301
|
+
sackSubType,
|
|
302
|
+
cap,
|
|
303
|
+
) as EntityPickupSack[];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Helper function to remove all of the trinkets in the room.
|
|
308
|
+
*
|
|
309
|
+
* @param trinketType Optional. If specified, will only remove trinkets that match this sub-type.
|
|
310
|
+
* Default is -1, which matches every sub-type.
|
|
311
|
+
* @param cap Optional. If specified, will only remove the given amount of trinkets.
|
|
312
|
+
* @returns The trinkets that were removed.
|
|
313
|
+
*/
|
|
314
|
+
export function removeAllTrinkets(
|
|
315
|
+
trinketType?: TrinketType,
|
|
316
|
+
cap?: int,
|
|
317
|
+
): EntityPickupTrinket[] {
|
|
318
|
+
return removeAllPickups(
|
|
319
|
+
PickupVariant.TRINKET,
|
|
320
|
+
trinketType,
|
|
321
|
+
cap,
|
|
322
|
+
) as EntityPickupTrinket[];
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
|
|
327
|
+
*/
|
|
328
|
+
export function spawnBattery(
|
|
329
|
+
batterySubType: BatterySubType,
|
|
330
|
+
position: Vector,
|
|
331
|
+
velocity: Vector = VectorZero,
|
|
332
|
+
spawner: Entity | undefined = undefined,
|
|
333
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
334
|
+
): EntityPickupBattery {
|
|
335
|
+
return spawnPickup(
|
|
336
|
+
PickupVariant.LIL_BATTERY,
|
|
337
|
+
batterySubType,
|
|
338
|
+
position,
|
|
339
|
+
velocity,
|
|
340
|
+
spawner,
|
|
341
|
+
seedOrRNG,
|
|
342
|
+
) as EntityPickupBattery;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90)
|
|
347
|
+
* and a specific seed.
|
|
348
|
+
*/
|
|
349
|
+
export function spawnBatteryWithSeed(
|
|
350
|
+
batterySubType: BatterySubType,
|
|
351
|
+
position: Vector,
|
|
352
|
+
seedOrRNG: Seed | RNG,
|
|
353
|
+
velocity: Vector = VectorZero,
|
|
354
|
+
spawner: Entity | undefined = undefined,
|
|
355
|
+
): EntityPickupBattery {
|
|
356
|
+
return spawnBattery(batterySubType, position, velocity, spawner, seedOrRNG);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40). */
|
|
360
|
+
export function spawnBombPickup(
|
|
361
|
+
bombSubType: BombSubType,
|
|
362
|
+
position: Vector,
|
|
363
|
+
velocity: Vector = VectorZero,
|
|
364
|
+
spawner: Entity | undefined = undefined,
|
|
365
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
366
|
+
): EntityPickupBattery {
|
|
367
|
+
return spawnPickup(
|
|
368
|
+
PickupVariant.BOMB,
|
|
369
|
+
bombSubType,
|
|
370
|
+
position,
|
|
371
|
+
velocity,
|
|
372
|
+
spawner,
|
|
373
|
+
seedOrRNG,
|
|
374
|
+
) as EntityPickupBattery;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40) and a
|
|
379
|
+
* specific seed.
|
|
380
|
+
*/
|
|
381
|
+
export function spawnBombPickupWithSeed(
|
|
382
|
+
bombSubType: BombSubType,
|
|
383
|
+
position: Vector,
|
|
384
|
+
seedOrRNG: Seed | RNG,
|
|
385
|
+
velocity: Vector = VectorZero,
|
|
386
|
+
spawner: Entity | undefined = undefined,
|
|
387
|
+
): EntityPickupBattery {
|
|
388
|
+
return spawnBombPickup(bombSubType, position, velocity, spawner, seedOrRNG);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
|
|
393
|
+
*/
|
|
394
|
+
export function spawnCard(
|
|
395
|
+
subType: Card,
|
|
396
|
+
position: Vector,
|
|
397
|
+
velocity: Vector = VectorZero,
|
|
398
|
+
spawner: Entity | undefined = undefined,
|
|
399
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
400
|
+
): EntityPickupCard {
|
|
401
|
+
return spawnPickup(
|
|
402
|
+
PickupVariant.TAROT_CARD,
|
|
403
|
+
subType,
|
|
404
|
+
position,
|
|
405
|
+
velocity,
|
|
406
|
+
spawner,
|
|
407
|
+
seedOrRNG,
|
|
408
|
+
) as EntityPickupCard;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300)
|
|
413
|
+
* and a specific seed.
|
|
414
|
+
*/
|
|
415
|
+
export function spawnCardWithSeed(
|
|
416
|
+
subType: Card,
|
|
417
|
+
position: Vector,
|
|
418
|
+
seedOrRNG: Seed | RNG,
|
|
419
|
+
velocity: Vector = VectorZero,
|
|
420
|
+
spawner: Entity | undefined = undefined,
|
|
421
|
+
): EntityPickupCard {
|
|
422
|
+
return spawnCard(subType, position, velocity, spawner, seedOrRNG);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
|
|
426
|
+
export function spawnCoin(
|
|
427
|
+
subType: CoinSubType,
|
|
428
|
+
position: Vector,
|
|
429
|
+
velocity: Vector = VectorZero,
|
|
430
|
+
spawner: Entity | undefined = undefined,
|
|
431
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
432
|
+
): EntityPickupCoin {
|
|
433
|
+
return spawnPickup(
|
|
434
|
+
PickupVariant.COIN,
|
|
435
|
+
subType,
|
|
436
|
+
position,
|
|
437
|
+
velocity,
|
|
438
|
+
spawner,
|
|
439
|
+
seedOrRNG,
|
|
440
|
+
) as EntityPickupCoin;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20) and a
|
|
445
|
+
* specific seed.
|
|
446
|
+
*/
|
|
447
|
+
export function spawnCoinWithSeed(
|
|
448
|
+
subType: CoinSubType,
|
|
449
|
+
position: Vector,
|
|
450
|
+
seedOrRNG: Seed | RNG,
|
|
451
|
+
velocity: Vector = VectorZero,
|
|
452
|
+
spawner: Entity | undefined = undefined,
|
|
453
|
+
): EntityPickupCoin {
|
|
454
|
+
return spawnCoin(subType, position, velocity, spawner, seedOrRNG);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */
|
|
458
|
+
export function spawnHeart(
|
|
459
|
+
subType: HeartSubType,
|
|
460
|
+
position: Vector,
|
|
461
|
+
velocity: Vector = VectorZero,
|
|
462
|
+
spawner: Entity | undefined = undefined,
|
|
463
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
464
|
+
): EntityPickupHeart {
|
|
465
|
+
return spawnPickup(
|
|
466
|
+
PickupVariant.HEART,
|
|
467
|
+
subType,
|
|
468
|
+
position,
|
|
469
|
+
velocity,
|
|
470
|
+
spawner,
|
|
471
|
+
seedOrRNG,
|
|
472
|
+
) as EntityPickupHeart;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export function spawnHeartWithSeed(
|
|
476
|
+
subType: HeartSubType,
|
|
477
|
+
position: Vector,
|
|
478
|
+
seedOrRNG: Seed | RNG,
|
|
479
|
+
velocity: Vector = VectorZero,
|
|
480
|
+
spawner: Entity | undefined = undefined,
|
|
481
|
+
): EntityPickupHeart {
|
|
482
|
+
return spawnHeart(subType, position, velocity, spawner, seedOrRNG);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */
|
|
486
|
+
export function spawnKey(
|
|
487
|
+
subType: KeySubType,
|
|
488
|
+
position: Vector,
|
|
489
|
+
velocity: Vector = VectorZero,
|
|
490
|
+
spawner: Entity | undefined = undefined,
|
|
491
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
492
|
+
): EntityPickupKey {
|
|
493
|
+
return spawnPickup(
|
|
494
|
+
PickupVariant.KEY,
|
|
495
|
+
subType,
|
|
496
|
+
position,
|
|
497
|
+
velocity,
|
|
498
|
+
spawner,
|
|
499
|
+
seedOrRNG,
|
|
500
|
+
) as EntityPickupKey;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30) and a
|
|
505
|
+
* specific seed.
|
|
506
|
+
*/
|
|
507
|
+
export function spawnKeyWithSeed(
|
|
508
|
+
subType: KeySubType,
|
|
509
|
+
position: Vector,
|
|
510
|
+
seedOrRNG: Seed | RNG,
|
|
511
|
+
velocity: Vector = VectorZero,
|
|
512
|
+
spawner: Entity | undefined = undefined,
|
|
513
|
+
): EntityPickupKey {
|
|
514
|
+
return spawnKey(subType, position, velocity, spawner, seedOrRNG);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */
|
|
518
|
+
export function spawnPill(
|
|
519
|
+
pillColor: PillColor,
|
|
520
|
+
position: Vector,
|
|
521
|
+
velocity: Vector = VectorZero,
|
|
522
|
+
spawner: Entity | undefined = undefined,
|
|
523
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
524
|
+
): EntityPickupPill {
|
|
525
|
+
return spawnPickup(
|
|
526
|
+
PickupVariant.PILL,
|
|
527
|
+
pillColor,
|
|
528
|
+
position,
|
|
529
|
+
velocity,
|
|
530
|
+
spawner,
|
|
531
|
+
seedOrRNG,
|
|
532
|
+
) as EntityPickupPill;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70) and a
|
|
537
|
+
* specific seed.
|
|
538
|
+
*/
|
|
539
|
+
export function spawnPillWithSeed(
|
|
540
|
+
subType: PillColor,
|
|
541
|
+
position: Vector,
|
|
542
|
+
seedOrRNG: Seed | RNG,
|
|
543
|
+
velocity: Vector = VectorZero,
|
|
544
|
+
spawner: Entity | undefined = undefined,
|
|
545
|
+
): EntityPickupPill {
|
|
546
|
+
return spawnPill(subType, position, velocity, spawner, seedOrRNG);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69). */
|
|
550
|
+
export function spawnSack(
|
|
551
|
+
subType: SackSubType,
|
|
552
|
+
position: Vector,
|
|
553
|
+
velocity: Vector = VectorZero,
|
|
554
|
+
spawner: Entity | undefined = undefined,
|
|
555
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
556
|
+
): EntityPickupSack {
|
|
557
|
+
return spawnPickup(
|
|
558
|
+
PickupVariant.SACK,
|
|
559
|
+
subType,
|
|
560
|
+
position,
|
|
561
|
+
velocity,
|
|
562
|
+
spawner,
|
|
563
|
+
seedOrRNG,
|
|
564
|
+
) as EntityPickupSack;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69) and a
|
|
569
|
+
* specific seed.
|
|
570
|
+
*/
|
|
571
|
+
export function spawnSackWithSeed(
|
|
572
|
+
subType: SackSubType,
|
|
573
|
+
position: Vector,
|
|
574
|
+
seedOrRNG: Seed | RNG,
|
|
575
|
+
velocity: Vector = VectorZero,
|
|
576
|
+
spawner: Entity | undefined = undefined,
|
|
577
|
+
): EntityPickupSack {
|
|
578
|
+
return spawnSack(subType, position, velocity, spawner, seedOrRNG);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
|
|
583
|
+
*/
|
|
584
|
+
export function spawnTrinket(
|
|
585
|
+
subType: TrinketType,
|
|
586
|
+
position: Vector,
|
|
587
|
+
velocity: Vector = VectorZero,
|
|
588
|
+
spawner: Entity | undefined = undefined,
|
|
589
|
+
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
590
|
+
): EntityPickupTrinket {
|
|
591
|
+
return spawnPickup(
|
|
592
|
+
PickupVariant.TRINKET,
|
|
593
|
+
subType,
|
|
594
|
+
position,
|
|
595
|
+
velocity,
|
|
596
|
+
spawner,
|
|
597
|
+
seedOrRNG,
|
|
598
|
+
) as EntityPickupTrinket;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350) and
|
|
603
|
+
* a specific seed.
|
|
604
|
+
*/
|
|
605
|
+
export function spawnTrinketWithSeed(
|
|
606
|
+
subType: TrinketType,
|
|
607
|
+
position: Vector,
|
|
608
|
+
seedOrRNG: Seed | RNG,
|
|
609
|
+
velocity: Vector = VectorZero,
|
|
610
|
+
spawner: Entity | undefined = undefined,
|
|
611
|
+
): EntityPickupTrinket {
|
|
612
|
+
return spawnTrinket(subType, position, velocity, spawner, seedOrRNG);
|
|
613
|
+
}
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { PocketItemType } from "../enums/PocketItemType";
|
|
10
10
|
import { PocketItemDescription } from "../interfaces/PocketItemDescription";
|
|
11
11
|
import { getEnumValues } from "./enums";
|
|
12
|
-
import { isCharacter } from "./
|
|
12
|
+
import { isCharacter } from "./players";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Helper function to get the `PocketItemSlot` that the player's pocket active collectible item is
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
5
|
import { game } from "../cachedClasses";
|
|
6
6
|
import { DISTANCE_OF_GRID_TILE } from "../constants";
|
|
7
|
-
import { getEntities } from "./
|
|
8
|
-
import { getEffects } from "./
|
|
9
|
-
import { getPlayerCloserThan } from "./player";
|
|
7
|
+
import { getEntities } from "./entities";
|
|
8
|
+
import { getEffects } from "./entitiesSpecific";
|
|
10
9
|
import { getPlayers } from "./playerIndex";
|
|
10
|
+
import { getPlayerCloserThan } from "./players";
|
|
11
11
|
|
|
12
12
|
const MAX_FIND_FREE_POSITION_ATTEMPTS = 100;
|
|
13
13
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PressurePlateState,
|
|
3
|
+
PressurePlateVariant,
|
|
4
|
+
} from "isaac-typescript-definitions";
|
|
5
|
+
import { game } from "../cachedClasses";
|
|
6
|
+
import { getPressurePlates } from "./gridEntitiesSpecific";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to check if all of the pressure plates in the room are pushed.
|
|
10
|
+
*
|
|
11
|
+
* In this context, "pressure plates" refers to the grid entities that you have to press down in
|
|
12
|
+
* order for the room to be cleared. This function ignores other types of pressure plates, such as
|
|
13
|
+
* the ones that you press to get a reward, the ones that you press to start a Greed Mode wave, and
|
|
14
|
+
* so on.
|
|
15
|
+
*/
|
|
16
|
+
export function isAllPressurePlatesPushed(): boolean {
|
|
17
|
+
const room = game.GetRoom();
|
|
18
|
+
const hasPressurePlates = room.HasTriggerPressurePlates();
|
|
19
|
+
|
|
20
|
+
if (!hasPressurePlates) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const pressurePlates = getPressurePlates(PressurePlateVariant.PRESSURE_PLATE);
|
|
25
|
+
return pressurePlates.every(
|
|
26
|
+
(pressurePlate) =>
|
|
27
|
+
pressurePlate.State === PressurePlateState.PRESSURE_PLATE_PRESSED,
|
|
28
|
+
);
|
|
29
|
+
}
|
package/src/functions/revive.ts
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
getPlayerNumHitsRemaining,
|
|
17
17
|
hasLostCurse,
|
|
18
18
|
isKeeper,
|
|
19
|
-
} from "./
|
|
20
|
-
import { getLastFrameOfAnimation } from "./
|
|
19
|
+
} from "./players";
|
|
20
|
+
import { getLastFrameOfAnimation } from "./sprites";
|
|
21
21
|
import { giveTrinketsBack, temporarilyRemoveTrinket } from "./trinketGive";
|
|
22
22
|
|
|
23
23
|
/**
|
package/src/functions/rooms.ts
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
import { game } from "../cachedClasses";
|
|
8
8
|
import { PlayerIndex } from "../types/PlayerIndex";
|
|
9
9
|
import { getCollectibleSet } from "./collectibleSet";
|
|
10
|
-
import { anyPlayerHasCollectible, getPlayersOfType } from "./player";
|
|
11
10
|
import { mapGetPlayer, mapSetPlayer } from "./playerDataStructures";
|
|
12
11
|
import { getPlayers } from "./playerIndex";
|
|
12
|
+
import { anyPlayerHasCollectible, getPlayersOfType } from "./players";
|
|
13
13
|
import { repeat } from "./utils";
|
|
14
14
|
|
|
15
15
|
const COLLECTIBLES_THAT_AFFECT_ITEM_POOLS: readonly CollectibleType[] = [
|