isaacscript-common 2.0.2 → 2.0.5
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/constantsMax.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PillColor, PlayerType } from "isaac-typescript-definitions";
|
|
1
2
|
export declare const NUM_CARDS: number;
|
|
2
3
|
export declare const MAX_CARD: number;
|
|
3
4
|
export declare const NUM_VANILLA_CARDS: number;
|
|
@@ -14,3 +15,5 @@ export declare const NUM_TRINKET_TYPES: number;
|
|
|
14
15
|
export declare const MAX_TRINKET_TYPE: number;
|
|
15
16
|
export declare const NUM_VANILLA_TRINKET_TYPES: number;
|
|
16
17
|
export declare const MAX_VANILLA_TRINKET_TYPE: number;
|
|
18
|
+
export declare const MAX_VANILLA_PLAYER_TYPE: PlayerType;
|
|
19
|
+
export declare const MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
|
package/dist/constantsMax.lua
CHANGED
|
@@ -2,12 +2,15 @@ local ____exports = {}
|
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
|
|
4
4
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
5
|
+
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
5
6
|
local PillEffect = ____isaac_2Dtypescript_2Ddefinitions.PillEffect
|
|
7
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
6
8
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
7
9
|
local ____cachedClasses = require("cachedClasses")
|
|
8
10
|
local itemConfig = ____cachedClasses.itemConfig
|
|
9
11
|
local ____enums = require("functions.enums")
|
|
10
12
|
local getEnumLength = ____enums.getEnumLength
|
|
13
|
+
local getLastEnumValue = ____enums.getLastEnumValue
|
|
11
14
|
____exports.NUM_CARDS = itemConfig:GetCards().Size - 1
|
|
12
15
|
____exports.MAX_CARD = ____exports.NUM_CARDS
|
|
13
16
|
____exports.NUM_VANILLA_CARDS = getEnumLength(nil, Card) - 1
|
|
@@ -24,4 +27,6 @@ ____exports.NUM_TRINKET_TYPES = itemConfig:GetTrinkets().Size - 1
|
|
|
24
27
|
____exports.MAX_TRINKET_TYPE = ____exports.NUM_COLLECTIBLE_TYPES - 1
|
|
25
28
|
____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
|
|
26
29
|
____exports.MAX_VANILLA_TRINKET_TYPE = ____exports.NUM_VANILLA_COLLECTIBLE_TYPES
|
|
30
|
+
____exports.MAX_VANILLA_PLAYER_TYPE = getLastEnumValue(nil, PlayerType)
|
|
31
|
+
____exports.MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
|
|
27
32
|
return ____exports
|
|
@@ -6,6 +6,14 @@ import { ItemConfigPillEffectClass, ItemConfigPillEffectType, PillColor, PillEff
|
|
|
6
6
|
* corresponds to the horse pill color for blue/blue.
|
|
7
7
|
*/
|
|
8
8
|
export declare function getHorsePillColor(pillColor: PillColor): PillColor;
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to get the corresponding normal pill color from a horse pill color.
|
|
11
|
+
*
|
|
12
|
+
* For example, passing 2049 would result in `PillColor.BLUE_BLUE`.
|
|
13
|
+
*
|
|
14
|
+
* If called with a non-horse pill color, this function will return back the same color.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getNormalPillColorFromHorse(pillColor: PillColor): PillColor;
|
|
9
17
|
/**
|
|
10
18
|
* Helper function to get a pill effect class from a PillEffect enum value. In this context, the
|
|
11
19
|
* class is equal to the numerical prefix in the "class" tag in the "pocketitems.xml" file. Use the
|
package/dist/functions/pills.lua
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
2
4
|
local ____cachedClasses = require("cachedClasses")
|
|
3
5
|
local itemConfig = ____cachedClasses.itemConfig
|
|
4
6
|
local ____pillEffectClasses = require("objects.pillEffectClasses")
|
|
@@ -17,6 +19,10 @@ local HORSE_PILL_ADJUSTMENT = 2048
|
|
|
17
19
|
function ____exports.getHorsePillColor(self, pillColor)
|
|
18
20
|
return pillColor + HORSE_PILL_ADJUSTMENT
|
|
19
21
|
end
|
|
22
|
+
function ____exports.getNormalPillColorFromHorse(self, pillColor)
|
|
23
|
+
local normalPillColor = pillColor - HORSE_PILL_ADJUSTMENT
|
|
24
|
+
return normalPillColor > PillColor.NULL and normalPillColor or pillColor
|
|
25
|
+
end
|
|
20
26
|
function ____exports.getPillEffectClass(self, pillEffect)
|
|
21
27
|
local pillEffectClass = PILL_EFFECT_CLASSES[pillEffect]
|
|
22
28
|
return pillEffectClass == nil and DEFAULT_PILL_EFFECT_CLASS or pillEffectClass
|