isaacscript-common 6.6.3 → 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.d.ts +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +6 -6
- 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/enums/private/SerializationBrand.d.ts +0 -4
- package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
- 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/saveDataManager/merge.lua +4 -3
- package/dist/features/sirenHelpers.lua +2 -2
- package/dist/functions/ambush.lua +5 -5
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/array.lua +1 -1
- 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/deepCopy.d.ts +8 -5
- package/dist/functions/deepCopy.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +142 -38
- package/dist/functions/deepCopyTests.d.ts +6 -1
- package/dist/functions/deepCopyTests.d.ts.map +1 -1
- package/dist/functions/deepCopyTests.lua +19 -16
- 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.d.ts +1 -1
- package/dist/functions/log.d.ts.map +1 -1
- package/dist/functions/log.lua +16 -12
- package/dist/functions/mergeTests.d.ts +7 -1
- package/dist/functions/mergeTests.d.ts.map +1 -1
- package/dist/functions/mergeTests.lua +86 -7
- 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/table.d.ts +1 -1
- package/dist/functions/table.lua +1 -1
- 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 +2 -2
- package/src/callbacks/postCustomDoorEnter.ts +3 -3
- 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 +2 -2
- 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/postSacrifice.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/enums/private/SerializationBrand.ts +0 -4
- 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 +13 -9
- package/src/features/pause.ts +1 -1
- package/src/features/persistentEntities.ts +2 -2
- package/src/features/preventCollectibleRotation.ts +1 -1
- package/src/features/saveDataManager/exports.ts +7 -4
- package/src/features/saveDataManager/merge.ts +3 -3
- package/src/features/sirenHelpers.ts +1 -1
- package/src/functions/ambush.ts +2 -2
- package/src/functions/array.ts +5 -2
- package/src/functions/bitwise.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/deepCopy.ts +98 -19
- package/src/functions/deepCopyTests.ts +75 -19
- 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 +19 -10
- package/src/functions/mergeTests.ts +152 -4
- 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/table.ts +1 -1
- package/src/functions/transformations.ts +1 -1
- package/src/functions/trinketGive.ts +4 -4
- package/src/functions/trinkets.ts +3 -3
- package/src/functions/tstlClass.ts +1 -1
- package/src/functions/ui.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
package/src/functions/pickups.ts
CHANGED
|
@@ -1,43 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BatterySubType,
|
|
3
|
-
Card,
|
|
4
|
-
CoinSubType,
|
|
5
|
-
CollectibleType,
|
|
6
|
-
HeartSubType,
|
|
7
|
-
KeySubType,
|
|
8
|
-
PickupVariant,
|
|
9
|
-
PillColor,
|
|
10
|
-
SackSubType,
|
|
11
|
-
TrinketType,
|
|
12
|
-
} from "isaac-typescript-definitions";
|
|
13
|
-
import { VectorZero } from "../constants";
|
|
1
|
+
import { CoinSubType } from "isaac-typescript-definitions";
|
|
14
2
|
import {
|
|
15
3
|
COIN_SUBTYPE_TO_VALUE,
|
|
16
4
|
DEFAULT_COIN_VALUE,
|
|
17
5
|
} from "../objects/coinSubTypeToValue";
|
|
18
6
|
import { CHEST_PICKUP_VARIANTS } from "../sets/chestPickupVariantsSet";
|
|
19
7
|
import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
|
|
20
|
-
import {
|
|
8
|
+
import { removeEntities } from "./entities";
|
|
9
|
+
import { getHearts } from "./pickupsSpecific";
|
|
21
10
|
import { isHeart } from "./pickupVariants";
|
|
22
11
|
|
|
23
|
-
/** Helper function to get all of the battery entities in the room. */
|
|
24
|
-
export function getBatteries(
|
|
25
|
-
matchingSubType: BatterySubType | -1 = -1,
|
|
26
|
-
): EntityPickupBattery[] {
|
|
27
|
-
return getPickups(
|
|
28
|
-
PickupVariant.LIL_BATTERY,
|
|
29
|
-
matchingSubType,
|
|
30
|
-
) as EntityPickupBattery[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Helper function to get all of the card entities in the room. */
|
|
34
|
-
export function getCards(matchingSubType: Card | -1 = -1): EntityPickupCard[] {
|
|
35
|
-
return getPickups(
|
|
36
|
-
PickupVariant.TAROT_CARD,
|
|
37
|
-
matchingSubType,
|
|
38
|
-
) as EntityPickupCard[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
12
|
/**
|
|
42
13
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
43
14
|
* sub-types.
|
|
@@ -49,70 +20,12 @@ export function getCoinValue(coinSubType: CoinSubType): int {
|
|
|
49
20
|
return value === undefined ? DEFAULT_COIN_VALUE : value;
|
|
50
21
|
}
|
|
51
22
|
|
|
52
|
-
/** Helper function to get all of the coin pickup entities in the room. */
|
|
53
|
-
export function getCoins(
|
|
54
|
-
matchingSubType: CoinSubType | -1 = -1,
|
|
55
|
-
): EntityPickupCoin[] {
|
|
56
|
-
return getPickups(PickupVariant.COIN, matchingSubType) as EntityPickupCoin[];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Helper function to get all of the collectible entities in the room. */
|
|
60
|
-
export function getCollectibles(
|
|
61
|
-
matchingSubType: CollectibleType | -1 = -1,
|
|
62
|
-
): EntityPickupCollectible[] {
|
|
63
|
-
return getPickups(
|
|
64
|
-
PickupVariant.COLLECTIBLE,
|
|
65
|
-
matchingSubType,
|
|
66
|
-
) as EntityPickupCollectible[];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Helper function to get all of the heart pickup entities in the room. */
|
|
70
|
-
export function getHearts(
|
|
71
|
-
matchingSubType: HeartSubType | -1 = -1,
|
|
72
|
-
): EntityPickupHeart[] {
|
|
73
|
-
return getPickups(
|
|
74
|
-
PickupVariant.HEART,
|
|
75
|
-
matchingSubType,
|
|
76
|
-
) as EntityPickupHeart[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Helper function to get all of the key pickup entities in the room. */
|
|
80
|
-
export function getKeys(
|
|
81
|
-
matchingSubType: KeySubType | -1 = -1,
|
|
82
|
-
): EntityPickupKey[] {
|
|
83
|
-
return getPickups(PickupVariant.KEY, matchingSubType) as EntityPickupKey[];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** Helper function to get all of the pill entities in the room. */
|
|
87
|
-
export function getPills(
|
|
88
|
-
matchingSubType: PillColor | -1 = -1,
|
|
89
|
-
): EntityPickupPill[] {
|
|
90
|
-
return getPickups(PickupVariant.PILL, matchingSubType) as EntityPickupPill[];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
23
|
/** Helper function to get all of the red heart pickup entities in the room. */
|
|
94
24
|
export function getRedHearts(): EntityPickupHeart[] {
|
|
95
25
|
const hearts = getHearts();
|
|
96
26
|
return hearts.filter((heart) => RED_HEART_SUB_TYPES_SET.has(heart.SubType));
|
|
97
27
|
}
|
|
98
28
|
|
|
99
|
-
/** Helper function to get all of the sack (i.e. grab bag) entities in the room. */
|
|
100
|
-
export function getSacks(
|
|
101
|
-
matchingSubType: SackSubType | -1 = -1,
|
|
102
|
-
): EntityPickupSack[] {
|
|
103
|
-
return getPickups(PickupVariant.SACK, matchingSubType) as EntityPickupSack[];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** Helper function to get all of the trinket entities in the room. */
|
|
107
|
-
export function getTrinkets(
|
|
108
|
-
matchingSubType: TrinketType | -1 = -1,
|
|
109
|
-
): EntityPickupTrinket[] {
|
|
110
|
-
return getPickups(
|
|
111
|
-
PickupVariant.TRINKET,
|
|
112
|
-
matchingSubType,
|
|
113
|
-
) as EntityPickupTrinket[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
29
|
export function isChest(pickup: EntityPickup): boolean {
|
|
117
30
|
return CHEST_PICKUP_VARIANTS.has(pickup.Variant);
|
|
118
31
|
}
|
|
@@ -122,392 +35,12 @@ export function isRedHeart(pickup: EntityPickup): boolean {
|
|
|
122
35
|
}
|
|
123
36
|
|
|
124
37
|
/**
|
|
125
|
-
* Helper function to remove all of the
|
|
38
|
+
* Helper function to remove all of the red heart pickup entities in the room.
|
|
126
39
|
*
|
|
127
|
-
* @param batterySubType Optional. If specified, will only remove cards that match this sub-type.
|
|
128
|
-
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
129
|
-
* @returns True if one or more cards were removed, false otherwise.
|
|
130
|
-
*/
|
|
131
|
-
export function removeAllBatteries(
|
|
132
|
-
batterySubType?: BatterySubType,
|
|
133
|
-
cap?: int,
|
|
134
|
-
): EntityPickupBattery[] {
|
|
135
|
-
return removeAllPickups(
|
|
136
|
-
PickupVariant.LIL_BATTERY,
|
|
137
|
-
batterySubType,
|
|
138
|
-
cap,
|
|
139
|
-
) as EntityPickupBattery[];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Helper function to remove all of the cards in the room.
|
|
144
|
-
*
|
|
145
|
-
* @param card Optional. If specified, will only remove cards that match this sub-type.
|
|
146
|
-
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
147
|
-
* @returns True if one or more cards were removed, false otherwise.
|
|
148
|
-
*/
|
|
149
|
-
export function removeAllCards(card?: Card, cap?: int): EntityPickupCard[] {
|
|
150
|
-
return removeAllPickups(
|
|
151
|
-
PickupVariant.TAROT_CARD,
|
|
152
|
-
card,
|
|
153
|
-
cap,
|
|
154
|
-
) as EntityPickupCard[];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Helper function to remove all of the coins in the room.
|
|
159
|
-
*
|
|
160
|
-
* @param coinSubType Optional. If specified, will only remove coins that match this sub-type.
|
|
161
|
-
* @param cap Optional. If specified, will only remove the given amount of coins.
|
|
162
|
-
* @returns True if one or more coins were removed, false otherwise.
|
|
163
|
-
*/
|
|
164
|
-
export function removeAllCoins(
|
|
165
|
-
coinSubType?: CoinSubType,
|
|
166
|
-
cap?: int,
|
|
167
|
-
): EntityPickupCoin[] {
|
|
168
|
-
return removeAllPickups(
|
|
169
|
-
PickupVariant.COIN,
|
|
170
|
-
coinSubType,
|
|
171
|
-
cap,
|
|
172
|
-
) as EntityPickupCoin[];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Helper function to remove all of the collectibles in the room.
|
|
177
|
-
*
|
|
178
|
-
* @param collectibleType Optional. If specified, will only remove collectibles that match this
|
|
179
|
-
* collectible type.
|
|
180
|
-
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
181
|
-
* @returns True if one or more collectibles were removed, false otherwise.
|
|
182
|
-
*/
|
|
183
|
-
export function removeAllCollectibles(
|
|
184
|
-
collectibleType?: CollectibleType,
|
|
185
|
-
cap?: int,
|
|
186
|
-
): EntityPickupCollectible[] {
|
|
187
|
-
return removeAllPickups(
|
|
188
|
-
PickupVariant.COLLECTIBLE,
|
|
189
|
-
collectibleType,
|
|
190
|
-
cap,
|
|
191
|
-
) as EntityPickupCollectible[];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Helper function to remove all of the hearts in the room.
|
|
196
|
-
*
|
|
197
|
-
* @param heartSubType Optional. If specified, will only remove hearts that match this sub-type.
|
|
198
40
|
* @param cap Optional. If specified, will only remove the given amount of hearts.
|
|
199
|
-
* @returns
|
|
200
|
-
*/
|
|
201
|
-
export function removeAllHearts(
|
|
202
|
-
heartSubType?: HeartSubType,
|
|
203
|
-
cap?: int,
|
|
204
|
-
): EntityPickupHeart[] {
|
|
205
|
-
return removeAllPickups(
|
|
206
|
-
PickupVariant.HEART,
|
|
207
|
-
heartSubType,
|
|
208
|
-
cap,
|
|
209
|
-
) as EntityPickupHeart[];
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Helper function to remove all of the keys in the room.
|
|
214
|
-
*
|
|
215
|
-
* @param keySubType Optional. If specified, will only remove keys that match this sub-type.
|
|
216
|
-
* @param cap Optional. If specified, will only remove the given amount of keys.
|
|
217
|
-
* @returns True if one or more keys were removed, false otherwise.
|
|
218
|
-
*/
|
|
219
|
-
export function removeAllKeys(
|
|
220
|
-
keySubType?: KeySubType,
|
|
221
|
-
cap?: int,
|
|
222
|
-
): EntityPickupKey[] {
|
|
223
|
-
return removeAllPickups(
|
|
224
|
-
PickupVariant.KEY,
|
|
225
|
-
keySubType,
|
|
226
|
-
cap,
|
|
227
|
-
) as EntityPickupKey[];
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Helper function to remove all of the pills in the room.
|
|
232
|
-
*
|
|
233
|
-
* @param pillColor Optional. If specified, will only remove pills that match this color.
|
|
234
|
-
* @param cap Optional. If specified, will only remove the given amount of pills.
|
|
235
|
-
* @returns True if one or more pills were removed, false otherwise.
|
|
41
|
+
* @returns The red hearts that were removed.
|
|
236
42
|
*/
|
|
237
|
-
export function
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
): EntityPickupPill[] {
|
|
241
|
-
return removeAllPickups(
|
|
242
|
-
PickupVariant.PILL,
|
|
243
|
-
pillColor,
|
|
244
|
-
cap,
|
|
245
|
-
) as EntityPickupPill[];
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Helper function to remove all of the sacks (i.e. grab bags) in the room.
|
|
250
|
-
*
|
|
251
|
-
* @param sackSubType Optional. If specified, will only remove sacks that match this sub-type.
|
|
252
|
-
* @param cap Optional. If specified, will only remove the given amount of trinkets.
|
|
253
|
-
* @returns True if one or more trinkets were removed, false otherwise.
|
|
254
|
-
*/
|
|
255
|
-
export function removeAllSacks(
|
|
256
|
-
sackSubType?: SackSubType,
|
|
257
|
-
cap?: int,
|
|
258
|
-
): EntityPickupSack[] {
|
|
259
|
-
return removeAllPickups(
|
|
260
|
-
PickupVariant.TRINKET,
|
|
261
|
-
sackSubType,
|
|
262
|
-
cap,
|
|
263
|
-
) as EntityPickupSack[];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Helper function to remove all of the trinkets in the room.
|
|
268
|
-
*
|
|
269
|
-
* @param trinketType Optional. If specified, will only remove trinkets that match this trinket
|
|
270
|
-
* type.
|
|
271
|
-
* @param cap Optional. If specified, will only remove the given amount of trinkets.
|
|
272
|
-
* @returns True if one or more trinkets were removed, false otherwise.
|
|
273
|
-
*/
|
|
274
|
-
export function removeAllTrinkets(
|
|
275
|
-
trinketType?: TrinketType,
|
|
276
|
-
cap?: int,
|
|
277
|
-
): EntityPickupTrinket[] {
|
|
278
|
-
return removeAllPickups(
|
|
279
|
-
PickupVariant.TRINKET,
|
|
280
|
-
trinketType,
|
|
281
|
-
cap,
|
|
282
|
-
) as EntityPickupTrinket[];
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
|
|
287
|
-
*/
|
|
288
|
-
export function spawnBattery(
|
|
289
|
-
subType: BatterySubType,
|
|
290
|
-
position: Vector,
|
|
291
|
-
velocity: Vector = VectorZero,
|
|
292
|
-
spawner: Entity | undefined = undefined,
|
|
293
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
294
|
-
): EntityPickupBattery {
|
|
295
|
-
return spawnPickup(
|
|
296
|
-
PickupVariant.LIL_BATTERY,
|
|
297
|
-
subType,
|
|
298
|
-
position,
|
|
299
|
-
velocity,
|
|
300
|
-
spawner,
|
|
301
|
-
seedOrRNG,
|
|
302
|
-
) as EntityPickupBattery;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export function spawnBatteryWithSeed(
|
|
306
|
-
subType: BatterySubType,
|
|
307
|
-
position: Vector,
|
|
308
|
-
seedOrRNG: Seed | RNG,
|
|
309
|
-
velocity: Vector = VectorZero,
|
|
310
|
-
spawner: Entity | undefined = undefined,
|
|
311
|
-
): EntityPickupBattery {
|
|
312
|
-
return spawnBattery(subType, position, velocity, spawner, seedOrRNG);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
|
|
317
|
-
*/
|
|
318
|
-
export function spawnCard(
|
|
319
|
-
subType: Card,
|
|
320
|
-
position: Vector,
|
|
321
|
-
velocity: Vector = VectorZero,
|
|
322
|
-
spawner: Entity | undefined = undefined,
|
|
323
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
324
|
-
): EntityPickupCard {
|
|
325
|
-
return spawnPickup(
|
|
326
|
-
PickupVariant.TAROT_CARD,
|
|
327
|
-
subType,
|
|
328
|
-
position,
|
|
329
|
-
velocity,
|
|
330
|
-
spawner,
|
|
331
|
-
seedOrRNG,
|
|
332
|
-
) as EntityPickupCard;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export function spawnCardWithSeed(
|
|
336
|
-
subType: Card,
|
|
337
|
-
position: Vector,
|
|
338
|
-
seedOrRNG: Seed | RNG,
|
|
339
|
-
velocity: Vector = VectorZero,
|
|
340
|
-
spawner: Entity | undefined = undefined,
|
|
341
|
-
): EntityPickupCard {
|
|
342
|
-
return spawnCard(subType, position, velocity, spawner, seedOrRNG);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
|
|
346
|
-
export function spawnCoin(
|
|
347
|
-
subType: CoinSubType,
|
|
348
|
-
position: Vector,
|
|
349
|
-
velocity: Vector = VectorZero,
|
|
350
|
-
spawner: Entity | undefined = undefined,
|
|
351
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
352
|
-
): EntityPickupCoin {
|
|
353
|
-
return spawnPickup(
|
|
354
|
-
PickupVariant.COIN,
|
|
355
|
-
subType,
|
|
356
|
-
position,
|
|
357
|
-
velocity,
|
|
358
|
-
spawner,
|
|
359
|
-
seedOrRNG,
|
|
360
|
-
) as EntityPickupCoin;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export function spawnCoinWithSeed(
|
|
364
|
-
subType: CoinSubType,
|
|
365
|
-
position: Vector,
|
|
366
|
-
seedOrRNG: Seed | RNG,
|
|
367
|
-
velocity: Vector = VectorZero,
|
|
368
|
-
spawner: Entity | undefined = undefined,
|
|
369
|
-
): EntityPickupCoin {
|
|
370
|
-
return spawnCoin(subType, position, velocity, spawner, seedOrRNG);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */
|
|
374
|
-
export function spawnHeart(
|
|
375
|
-
subType: HeartSubType,
|
|
376
|
-
position: Vector,
|
|
377
|
-
velocity: Vector = VectorZero,
|
|
378
|
-
spawner: Entity | undefined = undefined,
|
|
379
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
380
|
-
): EntityPickupHeart {
|
|
381
|
-
return spawnPickup(
|
|
382
|
-
PickupVariant.HEART,
|
|
383
|
-
subType,
|
|
384
|
-
position,
|
|
385
|
-
velocity,
|
|
386
|
-
spawner,
|
|
387
|
-
seedOrRNG,
|
|
388
|
-
) as EntityPickupHeart;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
export function spawnHeartWithSeed(
|
|
392
|
-
subType: HeartSubType,
|
|
393
|
-
position: Vector,
|
|
394
|
-
seedOrRNG: Seed | RNG,
|
|
395
|
-
velocity: Vector = VectorZero,
|
|
396
|
-
spawner: Entity | undefined = undefined,
|
|
397
|
-
): EntityPickupHeart {
|
|
398
|
-
return spawnHeart(subType, position, velocity, spawner, seedOrRNG);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */
|
|
402
|
-
export function spawnKey(
|
|
403
|
-
subType: KeySubType,
|
|
404
|
-
position: Vector,
|
|
405
|
-
velocity: Vector = VectorZero,
|
|
406
|
-
spawner: Entity | undefined = undefined,
|
|
407
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
408
|
-
): EntityPickupKey {
|
|
409
|
-
return spawnPickup(
|
|
410
|
-
PickupVariant.KEY,
|
|
411
|
-
subType,
|
|
412
|
-
position,
|
|
413
|
-
velocity,
|
|
414
|
-
spawner,
|
|
415
|
-
seedOrRNG,
|
|
416
|
-
) as EntityPickupKey;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
export function spawnKeyWithSeed(
|
|
420
|
-
subType: KeySubType,
|
|
421
|
-
position: Vector,
|
|
422
|
-
seedOrRNG: Seed | RNG,
|
|
423
|
-
velocity: Vector = VectorZero,
|
|
424
|
-
spawner: Entity | undefined = undefined,
|
|
425
|
-
): EntityPickupKey {
|
|
426
|
-
return spawnKey(subType, position, velocity, spawner, seedOrRNG);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */
|
|
430
|
-
export function spawnPill(
|
|
431
|
-
pillColor: PillColor,
|
|
432
|
-
position: Vector,
|
|
433
|
-
velocity: Vector = VectorZero,
|
|
434
|
-
spawner: Entity | undefined = undefined,
|
|
435
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
436
|
-
): EntityPickupPill {
|
|
437
|
-
return spawnPickup(
|
|
438
|
-
PickupVariant.PILL,
|
|
439
|
-
pillColor,
|
|
440
|
-
position,
|
|
441
|
-
velocity,
|
|
442
|
-
spawner,
|
|
443
|
-
seedOrRNG,
|
|
444
|
-
) as EntityPickupPill;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
export function spawnPillWithSeed(
|
|
448
|
-
subType: PillColor,
|
|
449
|
-
position: Vector,
|
|
450
|
-
seedOrRNG: Seed | RNG,
|
|
451
|
-
velocity: Vector = VectorZero,
|
|
452
|
-
spawner: Entity | undefined = undefined,
|
|
453
|
-
): EntityPickupPill {
|
|
454
|
-
return spawnPill(subType, position, velocity, spawner, seedOrRNG);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69). */
|
|
458
|
-
export function spawnSack(
|
|
459
|
-
subType: SackSubType,
|
|
460
|
-
position: Vector,
|
|
461
|
-
velocity: Vector = VectorZero,
|
|
462
|
-
spawner: Entity | undefined = undefined,
|
|
463
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
464
|
-
): EntityPickupSack {
|
|
465
|
-
return spawnPickup(
|
|
466
|
-
PickupVariant.SACK,
|
|
467
|
-
subType,
|
|
468
|
-
position,
|
|
469
|
-
velocity,
|
|
470
|
-
spawner,
|
|
471
|
-
seedOrRNG,
|
|
472
|
-
) as EntityPickupSack;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export function spawnSackWithSeed(
|
|
476
|
-
subType: SackSubType,
|
|
477
|
-
position: Vector,
|
|
478
|
-
seedOrRNG: Seed | RNG,
|
|
479
|
-
velocity: Vector = VectorZero,
|
|
480
|
-
spawner: Entity | undefined = undefined,
|
|
481
|
-
): EntityPickupSack {
|
|
482
|
-
return spawnSack(subType, position, velocity, spawner, seedOrRNG);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
|
|
487
|
-
*/
|
|
488
|
-
export function spawnTrinket(
|
|
489
|
-
subType: TrinketType,
|
|
490
|
-
position: Vector,
|
|
491
|
-
velocity: Vector = VectorZero,
|
|
492
|
-
spawner: Entity | undefined = undefined,
|
|
493
|
-
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
494
|
-
): EntityPickupTrinket {
|
|
495
|
-
return spawnPickup(
|
|
496
|
-
PickupVariant.TRINKET,
|
|
497
|
-
subType,
|
|
498
|
-
position,
|
|
499
|
-
velocity,
|
|
500
|
-
spawner,
|
|
501
|
-
seedOrRNG,
|
|
502
|
-
) as EntityPickupTrinket;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
export function spawnTrinketWithSeed(
|
|
506
|
-
subType: TrinketType,
|
|
507
|
-
position: Vector,
|
|
508
|
-
seedOrRNG: Seed | RNG,
|
|
509
|
-
velocity: Vector = VectorZero,
|
|
510
|
-
spawner: Entity | undefined = undefined,
|
|
511
|
-
): EntityPickupTrinket {
|
|
512
|
-
return spawnTrinket(subType, position, velocity, spawner, seedOrRNG);
|
|
43
|
+
export function removeAllRedHearts(cap?: int): EntityPickupHeart[] {
|
|
44
|
+
const redHearts = getRedHearts();
|
|
45
|
+
return removeEntities(redHearts, cap);
|
|
513
46
|
}
|