isaacscript-common 44.0.0 → 44.1.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/index.rollup.d.ts +12 -4
- package/dist/isaacscript-common.lua +5334 -5211
- package/dist/src/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/ItemPoolDetection.lua +2 -1
- package/dist/src/classes/features/other/Pause.lua +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +4 -3
- package/dist/src/functions/characters.d.ts +9 -2
- package/dist/src/functions/characters.d.ts.map +1 -1
- package/dist/src/functions/characters.lua +13 -4
- package/dist/src/functions/charge.lua +2 -2
- package/dist/src/functions/playerCollectibles.d.ts +127 -0
- package/dist/src/functions/playerCollectibles.d.ts.map +1 -0
- package/dist/src/functions/playerCollectibles.lua +308 -0
- package/dist/src/functions/playerHealth.d.ts.map +1 -1
- package/dist/src/functions/playerHealth.lua +3 -2
- package/dist/src/functions/playerTrinkets.d.ts +69 -0
- package/dist/src/functions/playerTrinkets.d.ts.map +1 -0
- package/dist/src/functions/playerTrinkets.lua +160 -0
- package/dist/src/functions/players.d.ts +5 -166
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +20 -389
- package/dist/src/functions/trinketGive.lua +2 -2
- package/dist/src/functions/trinkets.d.ts +0 -30
- package/dist/src/functions/trinkets.d.ts.map +1 -1
- package/dist/src/functions/trinkets.lua +0 -71
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +16 -0
- package/dist/src/objects/{characterStartingCollectibles.d.ts → characterStartingCollectibleTypes.d.ts} +2 -2
- package/dist/src/objects/characterStartingCollectibleTypes.d.ts.map +1 -0
- package/dist/src/objects/{characterStartingCollectibles.lua → characterStartingCollectibleTypes.lua} +1 -1
- package/dist/src/objects/characterStartingTrinketTypes.d.ts +46 -0
- package/dist/src/objects/characterStartingTrinketTypes.d.ts.map +1 -0
- package/dist/src/objects/characterStartingTrinketTypes.lua +49 -0
- package/package.json +1 -1
- package/src/classes/features/other/ItemPoolDetection.ts +2 -4
- package/src/classes/features/other/Pause.ts +1 -1
- package/src/classes/features/other/extraConsoleCommands/commands.ts +3 -3
- package/src/functions/characters.ts +20 -4
- package/src/functions/charge.ts +1 -1
- package/src/functions/playerCollectibles.ts +372 -0
- package/src/functions/playerHealth.ts +2 -6
- package/src/functions/playerTrinkets.ts +184 -0
- package/src/functions/players.ts +16 -481
- package/src/functions/trinketGive.ts +1 -1
- package/src/functions/trinkets.ts +1 -84
- package/src/index.ts +2 -0
- package/src/objects/{characterStartingCollectibles.ts → characterStartingCollectibleTypes.ts} +1 -1
- package/src/objects/characterStartingTrinketTypes.ts +129 -0
- package/dist/src/objects/characterStartingCollectibles.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemPoolDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ItemPoolDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ItemPoolDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ItemPoolDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AActC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAahD,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IAWtD;;;;;OAKG;IAEI,yBAAyB,CAC9B,YAAY,EAAE,YAAY,GACzB,eAAe,EAAE;IAOpB;;;;;;;;;;;OAWG;IAEI,uBAAuB,CAC5B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO;IA+DV;;;;;;;;;;;;;;;OAeG;IAEI,qBAAqB,CAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO;CAOX"}
|
|
@@ -20,13 +20,14 @@ local ____ISCFeature = require("src.enums.ISCFeature")
|
|
|
20
20
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
21
21
|
local ____collectibleTag = require("src.functions.collectibleTag")
|
|
22
22
|
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
23
|
+
local ____playerCollectibles = require("src.functions.playerCollectibles")
|
|
24
|
+
local anyPlayerHasCollectible = ____playerCollectibles.anyPlayerHasCollectible
|
|
23
25
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
24
26
|
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
25
27
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
26
28
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
27
29
|
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
28
30
|
local ____players = require("src.functions.players")
|
|
29
|
-
local anyPlayerHasCollectible = ____players.anyPlayerHasCollectible
|
|
30
31
|
local getPlayersOfType = ____players.getPlayersOfType
|
|
31
32
|
local ____utils = require("src.functions.utils")
|
|
32
33
|
local ____repeat = ____utils["repeat"]
|
|
@@ -26,10 +26,10 @@ local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
|
26
26
|
local isTear = ____isaacAPIClass.isTear
|
|
27
27
|
local ____logMisc = require("src.functions.logMisc")
|
|
28
28
|
local logError = ____logMisc.logError
|
|
29
|
+
local ____playerCollectibles = require("src.functions.playerCollectibles")
|
|
30
|
+
local useActiveItemTemp = ____playerCollectibles.useActiveItemTemp
|
|
29
31
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
30
32
|
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
31
|
-
local ____players = require("src.functions.players")
|
|
32
|
-
local useActiveItemTemp = ____players.useActiveItemTemp
|
|
33
33
|
local ____tstlClass = require("src.functions.tstlClass")
|
|
34
34
|
local getTSTLClassName = ____tstlClass.getTSTLClassName
|
|
35
35
|
local ____utils = require("src.functions.utils")
|
|
@@ -76,13 +76,14 @@ local spawnPill = ____pickupsSpecific.spawnPill
|
|
|
76
76
|
local spawnTrinketFunction = ____pickupsSpecific.spawnTrinket
|
|
77
77
|
local ____pills = require("src.functions.pills")
|
|
78
78
|
local getPillEffectName = ____pills.getPillEffectName
|
|
79
|
+
local ____playerCollectibles = require("src.functions.playerCollectibles")
|
|
80
|
+
local addCollectibleCostume = ____playerCollectibles.addCollectibleCostume
|
|
81
|
+
local removeCollectibleCostume = ____playerCollectibles.removeCollectibleCostume
|
|
82
|
+
local useActiveItemTemp = ____playerCollectibles.useActiveItemTemp
|
|
79
83
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
80
84
|
local getPlayers = ____playerIndex.getPlayers
|
|
81
85
|
local ____players = require("src.functions.players")
|
|
82
|
-
local addCollectibleCostume = ____players.addCollectibleCostume
|
|
83
86
|
local getPlayerName = ____players.getPlayerName
|
|
84
|
-
local removeCollectibleCostume = ____players.removeCollectibleCostume
|
|
85
|
-
local useActiveItemTemp = ____players.useActiveItemTemp
|
|
86
87
|
local ____roomGrid = require("src.functions.roomGrid")
|
|
87
88
|
local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
|
|
88
89
|
local ____roomTransition = require("src.functions.roomTransition")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectibleType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { CollectibleType, TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to determine if the given character can have red heart containers. Returns true
|
|
@@ -53,7 +53,14 @@ export declare function getCharacterName(character: PlayerType): string;
|
|
|
53
53
|
*
|
|
54
54
|
* Note that this will return an empty array for Eden and Tainted Eden.
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function getCharacterStartingCollectibleTypes(character: PlayerType): readonly CollectibleType[];
|
|
57
|
+
/**
|
|
58
|
+
* Helper function to get the trinket that is granted to a particular character at the beginning of
|
|
59
|
+
* a run. Returns undefined if the character does not start with a trinket.
|
|
60
|
+
*
|
|
61
|
+
* Note that this will return undefined for Eden and Tainted Eden.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getCharacterStartingTrinketType(character: PlayerType): TrinketType | undefined;
|
|
57
64
|
export declare function isFlyingCharacter(character: PlayerType): boolean;
|
|
58
65
|
/**
|
|
59
66
|
* Helper function to check if the provided character is one of the characters that are selectable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAkB1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,UAAU,GACpB,SAAS,eAAe,EAAE,CAE5B;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,UAAU,GACpB,WAAW,GAAG,SAAS,CAEzB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
|
|
@@ -12,8 +12,10 @@ local ____characterDamageMultipliers = require("src.objects.characterDamageMulti
|
|
|
12
12
|
local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
|
|
13
13
|
local ____characterNames = require("src.objects.characterNames")
|
|
14
14
|
local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
|
|
15
|
-
local
|
|
16
|
-
local
|
|
15
|
+
local ____characterStartingCollectibleTypes = require("src.objects.characterStartingCollectibleTypes")
|
|
16
|
+
local CHARACTER_STARTING_COLLECTIBLE_TYPES = ____characterStartingCollectibleTypes.CHARACTER_STARTING_COLLECTIBLE_TYPES
|
|
17
|
+
local ____characterStartingTrinketTypes = require("src.objects.characterStartingTrinketTypes")
|
|
18
|
+
local CHARACTER_STARTING_TRINKET_TYPE = ____characterStartingTrinketTypes.CHARACTER_STARTING_TRINKET_TYPE
|
|
17
19
|
local ____charactersThatStartWithAnActiveItemSet = require("src.sets.charactersThatStartWithAnActiveItemSet")
|
|
18
20
|
local CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET = ____charactersThatStartWithAnActiveItemSet.CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET
|
|
19
21
|
local ____charactersWithBlackHeartFromEternalHeartSet = require("src.sets.charactersWithBlackHeartFromEternalHeartSet")
|
|
@@ -118,8 +120,15 @@ end
|
|
|
118
120
|
-- beginning of a run.
|
|
119
121
|
--
|
|
120
122
|
-- Note that this will return an empty array for Eden and Tainted Eden.
|
|
121
|
-
function ____exports.
|
|
122
|
-
return
|
|
123
|
+
function ____exports.getCharacterStartingCollectibleTypes(self, character)
|
|
124
|
+
return CHARACTER_STARTING_COLLECTIBLE_TYPES[character]
|
|
125
|
+
end
|
|
126
|
+
--- Helper function to get the trinket that is granted to a particular character at the beginning of
|
|
127
|
+
-- a run. Returns undefined if the character does not start with a trinket.
|
|
128
|
+
--
|
|
129
|
+
-- Note that this will return undefined for Eden and Tainted Eden.
|
|
130
|
+
function ____exports.getCharacterStartingTrinketType(self, character)
|
|
131
|
+
return CHARACTER_STARTING_TRINKET_TYPE[character]
|
|
123
132
|
end
|
|
124
133
|
function ____exports.isFlyingCharacter(self, character)
|
|
125
134
|
return FLYING_CHARACTERS_SET:has(character)
|
|
@@ -14,10 +14,10 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
14
14
|
local ____collectibles = require("src.functions.collectibles")
|
|
15
15
|
local getCollectibleChargeType = ____collectibles.getCollectibleChargeType
|
|
16
16
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
17
|
+
local ____playerCollectibles = require("src.functions.playerCollectibles")
|
|
18
|
+
local getActiveItemSlots = ____playerCollectibles.getActiveItemSlots
|
|
17
19
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
18
20
|
local getPlayers = ____playerIndex.getPlayers
|
|
19
|
-
local ____players = require("src.functions.players")
|
|
20
|
-
local getActiveItemSlots = ____players.getActiveItemSlots
|
|
21
21
|
local ____roomShape = require("src.functions.roomShape")
|
|
22
22
|
local getRoomShapeCharges = ____roomShape.getRoomShapeCharges
|
|
23
23
|
--- Helper function to add a charge to the player's active item. Will flash the HUD and play the
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ActiveSlot, CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to add one or more collectibles to a player.
|
|
4
|
+
*
|
|
5
|
+
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
6
|
+
* add.
|
|
7
|
+
*/
|
|
8
|
+
export declare function addCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
|
|
9
|
+
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to check to see if any player has a particular collectible.
|
|
12
|
+
*
|
|
13
|
+
* @param collectibleType The collectible type to check for.
|
|
14
|
+
* @param ignoreModifiers If set to true, only counts collectibles the player actually owns and
|
|
15
|
+
* ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton.
|
|
16
|
+
* Default is false.
|
|
17
|
+
*/
|
|
18
|
+
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to find the active slots that the player has the corresponding collectible type
|
|
21
|
+
* in. Returns an empty array if the player does not have the collectible in any active slot.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getActiveItemSlots(player: EntityPlayer, collectibleType: CollectibleType): ActiveSlot[];
|
|
24
|
+
/**
|
|
25
|
+
* Helper function to return the total amount of collectibles that a player has that match the
|
|
26
|
+
* collectible type(s) provided.
|
|
27
|
+
*
|
|
28
|
+
* This function is variadic, meaning that you can specify N collectible types.
|
|
29
|
+
*
|
|
30
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): int;
|
|
33
|
+
/**
|
|
34
|
+
* Helper function to get only the players that have a certain collectible.
|
|
35
|
+
*
|
|
36
|
+
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
37
|
+
* check for. It only returns the players that have all of the collectibles.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPlayersWithCollectible(...collectibleTypes: CollectibleType[]): EntityPlayer[];
|
|
40
|
+
/**
|
|
41
|
+
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
42
|
+
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
43
|
+
*
|
|
44
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to check to see if a player has one or more collectibles.
|
|
49
|
+
*
|
|
50
|
+
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
51
|
+
* check for. Returns true if the player has any of the supplied collectible types.
|
|
52
|
+
*
|
|
53
|
+
* This function always passes `false` to the `ignoreModifiers` argument.
|
|
54
|
+
*/
|
|
55
|
+
export declare function hasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Helper function to check to see if a player has a specific collectible in one or more active
|
|
58
|
+
* slots.
|
|
59
|
+
*
|
|
60
|
+
* This function is variadic, meaning that you can specify as many active slots as you want to check
|
|
61
|
+
* for. This function will return true if the collectible type is located in any of the active slots
|
|
62
|
+
* provided.
|
|
63
|
+
*/
|
|
64
|
+
export declare function hasCollectibleInActiveSlot(player: EntityPlayer, collectibleType: CollectibleType, ...activeSlots: ActiveSlot[]): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Returns whether the player can hold an additional active item, beyond what they are currently
|
|
67
|
+
* carrying. This takes the Schoolbag into account.
|
|
68
|
+
*
|
|
69
|
+
* If the player is the Tainted Soul, this always returns false, since that character cannot pick up
|
|
70
|
+
* items. (Only Tainted Forgotten can pick up items.)
|
|
71
|
+
*/
|
|
72
|
+
export declare function hasOpenActiveItemSlot(player: EntityPlayer): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Helper function to check if the active slot of a particular player is empty.
|
|
75
|
+
*
|
|
76
|
+
* @param player The player to check.
|
|
77
|
+
* @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Helper function to remove all of the active items from a player. This includes the Schoolbag item
|
|
82
|
+
* and any pocket actives.
|
|
83
|
+
*/
|
|
84
|
+
export declare function removeAllActiveItems(player: EntityPlayer): void;
|
|
85
|
+
/**
|
|
86
|
+
* Helper function to remove one or more collectibles to a player.
|
|
87
|
+
*
|
|
88
|
+
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
89
|
+
* remove.
|
|
90
|
+
*/
|
|
91
|
+
export declare function removeCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
94
|
+
* having to request the collectible from the item config.
|
|
95
|
+
*/
|
|
96
|
+
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to remove one or more collectibles from all players. If any player has more than
|
|
99
|
+
* one copy of the item, then all copies of it will be removed.
|
|
100
|
+
*
|
|
101
|
+
* This function is variadic, meaning that you can specify as many collectibles as you want to
|
|
102
|
+
* remove.
|
|
103
|
+
*/
|
|
104
|
+
export declare function removeCollectibleFromAllPlayers(...collectibleTypes: CollectibleType[]): void;
|
|
105
|
+
/**
|
|
106
|
+
* Helper function to set an active collectible to a particular slot. This has different behavior
|
|
107
|
+
* than calling the `player.AddCollectible` method with the `activeSlot` argument, because this
|
|
108
|
+
* function will not shift existing items into the Schoolbag and it handles
|
|
109
|
+
* `ActiveSlot.SLOT_POCKET2`.
|
|
110
|
+
*
|
|
111
|
+
* Note that if an item is set to `ActiveSlot.SLOT_POCKET2`, it will disappear after being used and
|
|
112
|
+
* will be automatically removed upon entering a new room.
|
|
113
|
+
*
|
|
114
|
+
* @param player The player to give the item to.
|
|
115
|
+
* @param collectibleType The collectible type of the item to give.
|
|
116
|
+
* @param activeSlot Optional. The slot to set. Default is `ActiveSlot.PRIMARY`.
|
|
117
|
+
* @param charge Optional. The argument of charges to set. If not specified, the item will be set
|
|
118
|
+
* with maximum charges.
|
|
119
|
+
* @param keepInPools Optional. Whether to remove the item from pools. Default is false.
|
|
120
|
+
*/
|
|
121
|
+
export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot?: ActiveSlot, charge?: int, keepInPools?: boolean): void;
|
|
122
|
+
/**
|
|
123
|
+
* Helper function to use an active item without showing an animation, keeping the item, or adding
|
|
124
|
+
* any costumes.
|
|
125
|
+
*/
|
|
126
|
+
export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
127
|
+
//# sourceMappingURL=playerCollectibles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerCollectibles.d.ts","sourceRoot":"","sources":["../../../src/functions/playerCollectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAStC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,EAAE,CAKd;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,GAAG,CAQL;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,YAAY,EAAE,CAQhB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAQL;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,OAAO,CAIT;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,GAAG,WAAW,EAAE,UAAU,EAAE,GAC3B,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAiBnE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,aAAqB,GAC9B,OAAO,CAGT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAQN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
3
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
4
|
+
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
5
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
6
|
+
local __TS__New = ____lualib.__TS__New
|
|
7
|
+
local ____exports = {}
|
|
8
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
|
+
local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
10
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
11
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
12
|
+
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
13
|
+
local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
|
|
14
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
15
|
+
local game = ____cachedClasses.game
|
|
16
|
+
local itemConfig = ____cachedClasses.itemConfig
|
|
17
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
18
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
19
|
+
local ____array = require("src.functions.array")
|
|
20
|
+
local sumArray = ____array.sumArray
|
|
21
|
+
local ____collectibles = require("src.functions.collectibles")
|
|
22
|
+
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
23
|
+
local ____playerIndex = require("src.functions.playerIndex")
|
|
24
|
+
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
25
|
+
local getPlayers = ____playerIndex.getPlayers
|
|
26
|
+
local ____players = require("src.functions.players")
|
|
27
|
+
local isCharacter = ____players.isCharacter
|
|
28
|
+
--- Helper function to add one or more collectibles to a player.
|
|
29
|
+
--
|
|
30
|
+
-- This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
31
|
+
-- add.
|
|
32
|
+
function ____exports.addCollectible(self, player, ...)
|
|
33
|
+
local collectibleTypes = {...}
|
|
34
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
35
|
+
player:AddCollectible(collectibleType)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
function ____exports.addCollectibleCostume(self, player, collectibleType)
|
|
39
|
+
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
40
|
+
if itemConfigItem == nil then
|
|
41
|
+
return
|
|
42
|
+
end
|
|
43
|
+
player:AddCostume(itemConfigItem, false)
|
|
44
|
+
end
|
|
45
|
+
--- Helper function to check to see if any player has a particular collectible.
|
|
46
|
+
--
|
|
47
|
+
-- @param collectibleType The collectible type to check for.
|
|
48
|
+
-- @param ignoreModifiers If set to true, only counts collectibles the player actually owns and
|
|
49
|
+
-- ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton.
|
|
50
|
+
-- Default is false.
|
|
51
|
+
function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifiers)
|
|
52
|
+
local players = getAllPlayers(nil)
|
|
53
|
+
return __TS__ArraySome(
|
|
54
|
+
players,
|
|
55
|
+
function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
--- Helper function to find the active slots that the player has the corresponding collectible type
|
|
59
|
+
-- in. Returns an empty array if the player does not have the collectible in any active slot.
|
|
60
|
+
function ____exports.getActiveItemSlots(self, player, collectibleType)
|
|
61
|
+
return __TS__ArrayFilter(
|
|
62
|
+
ACTIVE_SLOT_VALUES,
|
|
63
|
+
function(____, activeSlot)
|
|
64
|
+
local activeItem = player:GetActiveItem(activeSlot)
|
|
65
|
+
return activeItem == collectibleType
|
|
66
|
+
end
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
--- Helper function to return the total amount of collectibles that a player has that match the
|
|
70
|
+
-- collectible type(s) provided.
|
|
71
|
+
--
|
|
72
|
+
-- This function is variadic, meaning that you can specify N collectible types.
|
|
73
|
+
--
|
|
74
|
+
-- Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
75
|
+
function ____exports.getPlayerCollectibleCount(self, player, ...)
|
|
76
|
+
local collectibleTypes = {...}
|
|
77
|
+
local numCollectibles = 0
|
|
78
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
79
|
+
numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType, true)
|
|
80
|
+
end
|
|
81
|
+
return numCollectibles
|
|
82
|
+
end
|
|
83
|
+
--- Helper function to get only the players that have a certain collectible.
|
|
84
|
+
--
|
|
85
|
+
-- This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
86
|
+
-- check for. It only returns the players that have all of the collectibles.
|
|
87
|
+
function ____exports.getPlayersWithCollectible(self, ...)
|
|
88
|
+
local collectibleTypes = {...}
|
|
89
|
+
local players = getPlayers(nil)
|
|
90
|
+
return __TS__ArrayFilter(
|
|
91
|
+
players,
|
|
92
|
+
function(____, player) return __TS__ArrayEvery(
|
|
93
|
+
collectibleTypes,
|
|
94
|
+
function(____, collectibleType) return player:HasCollectible(collectibleType) end
|
|
95
|
+
) end
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
--- Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
99
|
+
-- Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
100
|
+
--
|
|
101
|
+
-- Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
102
|
+
function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
103
|
+
local players = getPlayers(nil)
|
|
104
|
+
local numCollectiblesArray = __TS__ArrayMap(
|
|
105
|
+
players,
|
|
106
|
+
function(____, player) return player:GetCollectibleNum(collectibleType, true) end
|
|
107
|
+
)
|
|
108
|
+
return sumArray(nil, numCollectiblesArray)
|
|
109
|
+
end
|
|
110
|
+
--- Helper function to check to see if a player has one or more collectibles.
|
|
111
|
+
--
|
|
112
|
+
-- This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
113
|
+
-- check for. Returns true if the player has any of the supplied collectible types.
|
|
114
|
+
--
|
|
115
|
+
-- This function always passes `false` to the `ignoreModifiers` argument.
|
|
116
|
+
function ____exports.hasCollectible(self, player, ...)
|
|
117
|
+
local collectibleTypes = {...}
|
|
118
|
+
return __TS__ArraySome(
|
|
119
|
+
collectibleTypes,
|
|
120
|
+
function(____, collectibleType) return player:HasCollectible(collectibleType) end
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
--- Helper function to check to see if a player has a specific collectible in one or more active
|
|
124
|
+
-- slots.
|
|
125
|
+
--
|
|
126
|
+
-- This function is variadic, meaning that you can specify as many active slots as you want to check
|
|
127
|
+
-- for. This function will return true if the collectible type is located in any of the active slots
|
|
128
|
+
-- provided.
|
|
129
|
+
function ____exports.hasCollectibleInActiveSlot(self, player, collectibleType, ...)
|
|
130
|
+
local activeSlots = {...}
|
|
131
|
+
local matchingActiveSlotsSet = __TS__New(ReadonlySet, activeSlots)
|
|
132
|
+
local activeItemSlots = ____exports.getActiveItemSlots(nil, player, collectibleType)
|
|
133
|
+
return __TS__ArraySome(
|
|
134
|
+
activeItemSlots,
|
|
135
|
+
function(____, activeSlot) return matchingActiveSlotsSet:has(activeSlot) end
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
--- Returns whether the player can hold an additional active item, beyond what they are currently
|
|
139
|
+
-- carrying. This takes the Schoolbag into account.
|
|
140
|
+
--
|
|
141
|
+
-- If the player is the Tainted Soul, this always returns false, since that character cannot pick up
|
|
142
|
+
-- items. (Only Tainted Forgotten can pick up items.)
|
|
143
|
+
function ____exports.hasOpenActiveItemSlot(self, player)
|
|
144
|
+
if isCharacter(nil, player, PlayerType.SOUL_B) then
|
|
145
|
+
return false
|
|
146
|
+
end
|
|
147
|
+
local activeItemPrimary = player:GetActiveItem(ActiveSlot.PRIMARY)
|
|
148
|
+
local activeItemSecondary = player:GetActiveItem(ActiveSlot.SECONDARY)
|
|
149
|
+
local hasSchoolbag = player:HasCollectible(CollectibleType.SCHOOLBAG)
|
|
150
|
+
if hasSchoolbag then
|
|
151
|
+
return activeItemPrimary == CollectibleType.NULL or activeItemSecondary == CollectibleType.NULL
|
|
152
|
+
end
|
|
153
|
+
return activeItemPrimary == CollectibleType.NULL
|
|
154
|
+
end
|
|
155
|
+
--- Helper function to check if the active slot of a particular player is empty.
|
|
156
|
+
--
|
|
157
|
+
-- @param player The player to check.
|
|
158
|
+
-- @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`.
|
|
159
|
+
function ____exports.isActiveSlotEmpty(self, player, activeSlot)
|
|
160
|
+
if activeSlot == nil then
|
|
161
|
+
activeSlot = ActiveSlot.PRIMARY
|
|
162
|
+
end
|
|
163
|
+
local activeCollectibleType = player:GetActiveItem(activeSlot)
|
|
164
|
+
return activeCollectibleType == CollectibleType.NULL
|
|
165
|
+
end
|
|
166
|
+
--- Helper function to remove all of the active items from a player. This includes the Schoolbag item
|
|
167
|
+
-- and any pocket actives.
|
|
168
|
+
function ____exports.removeAllActiveItems(self, player)
|
|
169
|
+
for ____, activeSlot in ipairs(ACTIVE_SLOT_VALUES) do
|
|
170
|
+
do
|
|
171
|
+
local collectibleType = player:GetActiveItem(activeSlot)
|
|
172
|
+
if collectibleType == CollectibleType.NULL then
|
|
173
|
+
goto __continue28
|
|
174
|
+
end
|
|
175
|
+
local stillHasCollectible
|
|
176
|
+
repeat
|
|
177
|
+
do
|
|
178
|
+
player:RemoveCollectible(collectibleType)
|
|
179
|
+
stillHasCollectible = player:HasCollectible(collectibleType)
|
|
180
|
+
end
|
|
181
|
+
until not stillHasCollectible
|
|
182
|
+
end
|
|
183
|
+
::__continue28::
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
--- Helper function to remove one or more collectibles to a player.
|
|
187
|
+
--
|
|
188
|
+
-- This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
189
|
+
-- remove.
|
|
190
|
+
function ____exports.removeCollectible(self, player, ...)
|
|
191
|
+
local collectibleTypes = {...}
|
|
192
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
193
|
+
player:RemoveCollectible(collectibleType)
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
--- Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
197
|
+
-- having to request the collectible from the item config.
|
|
198
|
+
function ____exports.removeCollectibleCostume(self, player, collectibleType)
|
|
199
|
+
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
200
|
+
if itemConfigItem == nil then
|
|
201
|
+
return
|
|
202
|
+
end
|
|
203
|
+
player:RemoveCostume(itemConfigItem)
|
|
204
|
+
end
|
|
205
|
+
--- Helper function to remove one or more collectibles from all players. If any player has more than
|
|
206
|
+
-- one copy of the item, then all copies of it will be removed.
|
|
207
|
+
--
|
|
208
|
+
-- This function is variadic, meaning that you can specify as many collectibles as you want to
|
|
209
|
+
-- remove.
|
|
210
|
+
function ____exports.removeCollectibleFromAllPlayers(self, ...)
|
|
211
|
+
local collectibleTypes = {...}
|
|
212
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
213
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
214
|
+
while player:HasCollectible(collectibleType, true) do
|
|
215
|
+
player:RemoveCollectible(collectibleType)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
--- Helper function to set an active collectible to a particular slot. This has different behavior
|
|
221
|
+
-- than calling the `player.AddCollectible` method with the `activeSlot` argument, because this
|
|
222
|
+
-- function will not shift existing items into the Schoolbag and it handles
|
|
223
|
+
-- `ActiveSlot.SLOT_POCKET2`.
|
|
224
|
+
--
|
|
225
|
+
-- Note that if an item is set to `ActiveSlot.SLOT_POCKET2`, it will disappear after being used and
|
|
226
|
+
-- will be automatically removed upon entering a new room.
|
|
227
|
+
--
|
|
228
|
+
-- @param player The player to give the item to.
|
|
229
|
+
-- @param collectibleType The collectible type of the item to give.
|
|
230
|
+
-- @param activeSlot Optional. The slot to set. Default is `ActiveSlot.PRIMARY`.
|
|
231
|
+
-- @param charge Optional. The argument of charges to set. If not specified, the item will be set
|
|
232
|
+
-- with maximum charges.
|
|
233
|
+
-- @param keepInPools Optional. Whether to remove the item from pools. Default is false.
|
|
234
|
+
function ____exports.setActiveItem(self, player, collectibleType, activeSlot, charge, keepInPools)
|
|
235
|
+
if activeSlot == nil then
|
|
236
|
+
activeSlot = ActiveSlot.PRIMARY
|
|
237
|
+
end
|
|
238
|
+
if keepInPools == nil then
|
|
239
|
+
keepInPools = false
|
|
240
|
+
end
|
|
241
|
+
local itemPool = game:GetItemPool()
|
|
242
|
+
local primaryCollectibleType = player:GetActiveItem(ActiveSlot.PRIMARY)
|
|
243
|
+
local primaryCharge = player:GetActiveCharge(ActiveSlot.PRIMARY)
|
|
244
|
+
local secondaryCollectibleType = player:GetActiveItem(ActiveSlot.SECONDARY)
|
|
245
|
+
if charge == nil then
|
|
246
|
+
charge = getCollectibleMaxCharges(nil, collectibleType)
|
|
247
|
+
end
|
|
248
|
+
if not keepInPools then
|
|
249
|
+
itemPool:RemoveCollectible(collectibleType)
|
|
250
|
+
end
|
|
251
|
+
repeat
|
|
252
|
+
local ____switch46 = activeSlot
|
|
253
|
+
local ____cond46 = ____switch46 == ActiveSlot.PRIMARY
|
|
254
|
+
if ____cond46 then
|
|
255
|
+
do
|
|
256
|
+
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
257
|
+
player:RemoveCollectible(primaryCollectibleType)
|
|
258
|
+
end
|
|
259
|
+
player:AddCollectible(collectibleType, charge, false)
|
|
260
|
+
break
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
____cond46 = ____cond46 or ____switch46 == ActiveSlot.SECONDARY
|
|
264
|
+
if ____cond46 then
|
|
265
|
+
do
|
|
266
|
+
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
267
|
+
player:RemoveCollectible(primaryCollectibleType)
|
|
268
|
+
end
|
|
269
|
+
if secondaryCollectibleType ~= CollectibleType.NULL then
|
|
270
|
+
player:RemoveCollectible(secondaryCollectibleType)
|
|
271
|
+
end
|
|
272
|
+
player:AddCollectible(secondaryCollectibleType, charge, false)
|
|
273
|
+
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
274
|
+
player:AddCollectible(primaryCollectibleType, primaryCharge, false)
|
|
275
|
+
end
|
|
276
|
+
break
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
____cond46 = ____cond46 or ____switch46 == ActiveSlot.POCKET
|
|
280
|
+
if ____cond46 then
|
|
281
|
+
do
|
|
282
|
+
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
283
|
+
player:SetActiveCharge(charge, activeSlot)
|
|
284
|
+
break
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
____cond46 = ____cond46 or ____switch46 == ActiveSlot.POCKET_SINGLE_USE
|
|
288
|
+
if ____cond46 then
|
|
289
|
+
do
|
|
290
|
+
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
291
|
+
break
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
until true
|
|
295
|
+
end
|
|
296
|
+
--- Helper function to use an active item without showing an animation, keeping the item, or adding
|
|
297
|
+
-- any costumes.
|
|
298
|
+
function ____exports.useActiveItemTemp(self, player, collectibleType)
|
|
299
|
+
player:UseActiveItem(
|
|
300
|
+
collectibleType,
|
|
301
|
+
false,
|
|
302
|
+
false,
|
|
303
|
+
true,
|
|
304
|
+
false,
|
|
305
|
+
-1
|
|
306
|
+
)
|
|
307
|
+
end
|
|
308
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAQ9E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CA2ElE;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAmDL;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAKzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAoDnE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAqCrE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,YAAY,GACnB,GAAG,CAML;AAED,sDAAsD;AACtD,wBAAgB,eAAe,IAAI,YAAY,CAc9C;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAwBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,GACzB,IAAI,CAyHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -20,11 +20,12 @@ local ____characters = require("src.functions.characters")
|
|
|
20
20
|
local getCharacterMaxHeartContainers = ____characters.getCharacterMaxHeartContainers
|
|
21
21
|
local ____charge = require("src.functions.charge")
|
|
22
22
|
local getTotalCharge = ____charge.getTotalCharge
|
|
23
|
+
local ____playerCollectibles = require("src.functions.playerCollectibles")
|
|
24
|
+
local getActiveItemSlots = ____playerCollectibles.getActiveItemSlots
|
|
25
|
+
local setActiveItem = ____playerCollectibles.setActiveItem
|
|
23
26
|
local ____players = require("src.functions.players")
|
|
24
|
-
local getActiveItemSlots = ____players.getActiveItemSlots
|
|
25
27
|
local isCharacter = ____players.isCharacter
|
|
26
28
|
local isKeeper = ____players.isKeeper
|
|
27
|
-
local setActiveItem = ____players.setActiveItem
|
|
28
29
|
local ____utils = require("src.functions.utils")
|
|
29
30
|
local ____repeat = ____utils["repeat"]
|
|
30
31
|
--- Returns the number of black hearts that the player has, excluding any soul hearts. For example,
|