isaacscript-common 1.0.536 → 1.0.537
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.
|
@@ -19,7 +19,13 @@ export declare function addTrinketCostume(player: EntityPlayer, trinketType: Tri
|
|
|
19
19
|
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
|
|
20
20
|
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
|
|
21
21
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Helper function to determine if the given character is present.
|
|
24
|
+
*
|
|
25
|
+
* This function is variadic, meaning that you can supply as many characters as you want to check
|
|
26
|
+
* for. Returns true if any of the characters supplied are present.
|
|
27
|
+
*/
|
|
28
|
+
export declare function anyPlayerIs(...characters: PlayerType[]): boolean;
|
|
23
29
|
/**
|
|
24
30
|
* Helper function to determine if the provided character can have red heart containers. Returns
|
|
25
31
|
* true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
|
|
@@ -126,12 +126,14 @@ function ____exports.anyPlayerHasTrinket(self, trinketType)
|
|
|
126
126
|
end
|
|
127
127
|
return false
|
|
128
128
|
end
|
|
129
|
-
function ____exports.anyPlayerIs(self,
|
|
129
|
+
function ____exports.anyPlayerIs(self, ...)
|
|
130
|
+
local characters = {...}
|
|
131
|
+
local characterSet = __TS__New(Set, characters)
|
|
130
132
|
for ____, player in ipairs(
|
|
131
133
|
____exports.getPlayers(nil)
|
|
132
134
|
) do
|
|
133
135
|
local character = player:GetPlayerType()
|
|
134
|
-
if character
|
|
136
|
+
if characterSet:has(character) then
|
|
135
137
|
return true
|
|
136
138
|
end
|
|
137
139
|
end
|