isaacscript-common 1.2.238 → 1.2.239
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/functions/pickups.d.ts +28 -12
- package/dist/functions/pickups.lua +45 -0
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/** Helper function to get all of the battery entities in the room. */
|
|
3
|
+
export declare function getBatteries(matchingSubType?: number): EntityPickup[];
|
|
2
4
|
/** Helper function to get all of the card entities in the room. */
|
|
3
5
|
export declare function getCards(matchingSubType?: number): EntityPickup[];
|
|
4
6
|
/** Helper function to get all of the coin pickup entities in the room. */
|
|
@@ -17,6 +19,14 @@ export declare function getRedHearts(): EntityPickup[];
|
|
|
17
19
|
export declare function getTrinkets(matchingSubType?: number): EntityPickup[];
|
|
18
20
|
export declare function isChest(pickup: EntityPickup): boolean;
|
|
19
21
|
export declare function isRedHeart(pickup: EntityPickup): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Helper function to remove all of the batteries in the room.
|
|
24
|
+
*
|
|
25
|
+
* @param batterySubType Optional. If specified, will only remove cards that match this sub-type.
|
|
26
|
+
* @param cap Optional. If specified, will only remove the given amount of cards.
|
|
27
|
+
* @returns True if one or more cards were removed, false otherwise.
|
|
28
|
+
*/
|
|
29
|
+
export declare function removeAllBatteries(batterySubType?: BatterySubType | int, cap?: int): boolean;
|
|
20
30
|
/**
|
|
21
31
|
* Helper function to remove all of the cards in the room.
|
|
22
32
|
*
|
|
@@ -75,39 +85,45 @@ export declare function removeAllPills(pillColor?: PillColor, cap?: int): boolea
|
|
|
75
85
|
* @returns True if one or more trinkets were removed, false otherwise.
|
|
76
86
|
*/
|
|
77
87
|
export declare function removeAllTrinkets(trinketType?: TrinketType | int, cap?: int): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
90
|
+
* `PickupVariant.PICKUP_LIL_BATTERY` (90).
|
|
91
|
+
*/
|
|
92
|
+
export declare function spawnBattery(subType: BatterySubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
93
|
+
export declare function spawnBatteryWithSeed(subType: BatterySubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
78
94
|
/**
|
|
79
95
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
80
96
|
* `PickupVariant.PICKUP_TAROTCARD` (300).
|
|
81
97
|
*/
|
|
82
|
-
export declare function spawnCard(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
83
|
-
export declare function spawnCardWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
98
|
+
export declare function spawnCard(subType: Card | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
99
|
+
export declare function spawnCardWithSeed(subType: Card | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
84
100
|
/**
|
|
85
101
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
86
102
|
* `PickupVariant.PICKUP_COIN` (20).
|
|
87
103
|
*/
|
|
88
|
-
export declare function spawnCoin(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
89
|
-
export declare function spawnCoinWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
104
|
+
export declare function spawnCoin(subType: CoinSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
105
|
+
export declare function spawnCoinWithSeed(subType: CoinSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
90
106
|
/**
|
|
91
107
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
92
108
|
* `PickupVariant.PICKUP_HEART` (10).
|
|
93
109
|
*/
|
|
94
|
-
export declare function spawnHeart(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
95
|
-
export declare function spawnHeartWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
110
|
+
export declare function spawnHeart(subType: HeartSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
111
|
+
export declare function spawnHeartWithSeed(subType: HeartSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
96
112
|
/**
|
|
97
113
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
98
114
|
* `PickupVariant.PICKUP_KEY` (30).
|
|
99
115
|
*/
|
|
100
|
-
export declare function spawnKey(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
101
|
-
export declare function spawnKeyWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
116
|
+
export declare function spawnKey(subType: KeySubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
117
|
+
export declare function spawnKeyWithSeed(subType: KeySubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
102
118
|
/**
|
|
103
119
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
104
120
|
* `PickupVariant.PICKUP_PILL` (70).
|
|
105
121
|
*/
|
|
106
|
-
export declare function spawnPill(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
107
|
-
export declare function spawnPillWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
122
|
+
export declare function spawnPill(subType: PillColor | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
123
|
+
export declare function spawnPillWithSeed(subType: PillColor | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
108
124
|
/**
|
|
109
125
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
110
126
|
* `PickupVariant.PICKUP_TRINKET` (350).
|
|
111
127
|
*/
|
|
112
|
-
export declare function spawnTrinket(subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
113
|
-
export declare function spawnTrinketWithSeed(subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
128
|
+
export declare function spawnTrinket(subType: TrinketType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
129
|
+
export declare function spawnTrinketWithSeed(subType: TrinketType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
@@ -11,6 +11,12 @@ local ____entitySpecific = require("functions.entitySpecific")
|
|
|
11
11
|
local getPickups = ____entitySpecific.getPickups
|
|
12
12
|
local removeAllPickups = ____entitySpecific.removeAllPickups
|
|
13
13
|
local spawnPickup = ____entitySpecific.spawnPickup
|
|
14
|
+
function ____exports.getBatteries(self, matchingSubType)
|
|
15
|
+
if matchingSubType == nil then
|
|
16
|
+
matchingSubType = -1
|
|
17
|
+
end
|
|
18
|
+
return getPickups(nil, 90, matchingSubType)
|
|
19
|
+
end
|
|
14
20
|
function ____exports.getCards(self, matchingSubType)
|
|
15
21
|
if matchingSubType == nil then
|
|
16
22
|
matchingSubType = -1
|
|
@@ -66,6 +72,9 @@ end
|
|
|
66
72
|
function ____exports.isRedHeart(self, pickup)
|
|
67
73
|
return pickup.Variant == 10 and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
|
|
68
74
|
end
|
|
75
|
+
function ____exports.removeAllBatteries(self, batterySubType, cap)
|
|
76
|
+
return removeAllPickups(nil, 90, batterySubType, cap)
|
|
77
|
+
end
|
|
69
78
|
function ____exports.removeAllCards(self, card, cap)
|
|
70
79
|
return removeAllPickups(nil, 300, card, cap)
|
|
71
80
|
end
|
|
@@ -87,6 +96,42 @@ end
|
|
|
87
96
|
function ____exports.removeAllTrinkets(self, trinketType, cap)
|
|
88
97
|
return removeAllPickups(nil, 350, trinketType, cap)
|
|
89
98
|
end
|
|
99
|
+
function ____exports.spawnBattery(self, subType, position, velocity, spawner, seed)
|
|
100
|
+
if velocity == nil then
|
|
101
|
+
velocity = VectorZero
|
|
102
|
+
end
|
|
103
|
+
if spawner == nil then
|
|
104
|
+
spawner = nil
|
|
105
|
+
end
|
|
106
|
+
if seed == nil then
|
|
107
|
+
seed = nil
|
|
108
|
+
end
|
|
109
|
+
return spawnPickup(
|
|
110
|
+
nil,
|
|
111
|
+
90,
|
|
112
|
+
subType,
|
|
113
|
+
position,
|
|
114
|
+
velocity,
|
|
115
|
+
spawner,
|
|
116
|
+
seed
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
function ____exports.spawnBatteryWithSeed(self, subType, position, seed, velocity, spawner)
|
|
120
|
+
if velocity == nil then
|
|
121
|
+
velocity = VectorZero
|
|
122
|
+
end
|
|
123
|
+
if spawner == nil then
|
|
124
|
+
spawner = nil
|
|
125
|
+
end
|
|
126
|
+
return ____exports.spawnBattery(
|
|
127
|
+
nil,
|
|
128
|
+
subType,
|
|
129
|
+
position,
|
|
130
|
+
velocity,
|
|
131
|
+
spawner,
|
|
132
|
+
seed
|
|
133
|
+
)
|
|
134
|
+
end
|
|
90
135
|
function ____exports.spawnCard(self, subType, position, velocity, spawner, seed)
|
|
91
136
|
if velocity == nil then
|
|
92
137
|
velocity = VectorZero
|