isaacscript-common 2.0.22 → 2.0.23
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 +2 -0
- package/dist/constantsMax.lua +2 -0
- package/dist/functions/pills.d.ts +13 -0
- package/dist/functions/pills.lua +27 -0
- package/package.json +2 -2
package/dist/constantsMax.d.ts
CHANGED
|
@@ -23,3 +23,5 @@ export declare const FIRST_CHARACTER = PlayerType.ISAAC;
|
|
|
23
23
|
export declare const MAX_VANILLA_CHARACTER: PlayerType;
|
|
24
24
|
export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
|
|
25
25
|
export declare const MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
|
|
26
|
+
export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
|
|
27
|
+
export declare const MAX_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
|
package/dist/constantsMax.lua
CHANGED
|
@@ -35,4 +35,6 @@ ____exports.FIRST_CHARACTER = PlayerType.ISAAC
|
|
|
35
35
|
____exports.MAX_VANILLA_CHARACTER = getLastEnumValue(nil, PlayerType)
|
|
36
36
|
____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
|
|
37
37
|
____exports.MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
|
|
38
|
+
____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
|
|
39
|
+
____exports.MAX_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
|
|
38
40
|
return ____exports
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { ItemConfigPillEffectClass, ItemConfigPillEffectType, PillColor, PillEffect } from "isaac-typescript-definitions";
|
|
2
|
+
/** Helper function to get an array with every non-gold horse pill color. */
|
|
3
|
+
export declare function getAllHorsePillColors(): PillColor[];
|
|
4
|
+
/** Helper function to get an array with every non-gold and non-horse pill color. */
|
|
5
|
+
export declare function getAllNormalPillColors(): PillColor[];
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to get an array with every non-null pill color. This includes all gold colors and
|
|
8
|
+
* all horse colors.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAllPillColors(): PillColor[];
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to get an array with every valid pill effect. This includes modded pill effects.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAllPillEffects(): PillEffect[];
|
|
2
15
|
/**
|
|
3
16
|
* Helper function to get the corresponding horse pill color from a normal pill color.
|
|
4
17
|
*
|
package/dist/functions/pills.lua
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
1
3
|
local ____exports = {}
|
|
2
4
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
5
|
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
4
6
|
local ____cachedClasses = require("cachedClasses")
|
|
5
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
|
+
local ____constantsMax = require("constantsMax")
|
|
9
|
+
local FIRST_HORSE_PILL_COLOR = ____constantsMax.FIRST_HORSE_PILL_COLOR
|
|
10
|
+
local FIRST_PILL_COLOR = ____constantsMax.FIRST_PILL_COLOR
|
|
11
|
+
local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
|
|
12
|
+
local MAX_HORSE_PILL_COLOR = ____constantsMax.MAX_HORSE_PILL_COLOR
|
|
13
|
+
local MAX_NORMAL_PILL_COLOR = ____constantsMax.MAX_NORMAL_PILL_COLOR
|
|
14
|
+
local MAX_PILL_EFFECT = ____constantsMax.MAX_PILL_EFFECT
|
|
6
15
|
local ____pillEffectClasses = require("objects.pillEffectClasses")
|
|
7
16
|
local DEFAULT_PILL_EFFECT_CLASS = ____pillEffectClasses.DEFAULT_PILL_EFFECT_CLASS
|
|
8
17
|
local PILL_EFFECT_CLASSES = ____pillEffectClasses.PILL_EFFECT_CLASSES
|
|
@@ -12,10 +21,28 @@ local PILL_EFFECT_NAMES = ____pillEffectNames.PILL_EFFECT_NAMES
|
|
|
12
21
|
local ____pillEffectTypes = require("objects.pillEffectTypes")
|
|
13
22
|
local DEFAULT_PILL_EFFECT_TYPE = ____pillEffectTypes.DEFAULT_PILL_EFFECT_TYPE
|
|
14
23
|
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
24
|
+
local ____enums = require("functions.enums")
|
|
25
|
+
local getEnumValues = ____enums.getEnumValues
|
|
15
26
|
local ____flag = require("functions.flag")
|
|
16
27
|
local hasFlag = ____flag.hasFlag
|
|
28
|
+
local ____utils = require("functions.utils")
|
|
29
|
+
local irange = ____utils.irange
|
|
17
30
|
local HORSE_PILL_FLAG = 2047
|
|
18
31
|
local HORSE_PILL_ADJUSTMENT = 2048
|
|
32
|
+
function ____exports.getAllHorsePillColors(self)
|
|
33
|
+
return irange(nil, FIRST_HORSE_PILL_COLOR, MAX_HORSE_PILL_COLOR)
|
|
34
|
+
end
|
|
35
|
+
function ____exports.getAllNormalPillColors(self)
|
|
36
|
+
return irange(nil, FIRST_PILL_COLOR, MAX_NORMAL_PILL_COLOR)
|
|
37
|
+
end
|
|
38
|
+
function ____exports.getAllPillColors(self)
|
|
39
|
+
local pillColors = getEnumValues(nil, PillColor)
|
|
40
|
+
__TS__ArraySlice(pillColors)
|
|
41
|
+
return pillColors
|
|
42
|
+
end
|
|
43
|
+
function ____exports.getAllPillEffects(self)
|
|
44
|
+
return irange(nil, FIRST_PILL_EFFECT, MAX_PILL_EFFECT)
|
|
45
|
+
end
|
|
19
46
|
function ____exports.getHorsePillColor(self, pillColor)
|
|
20
47
|
return pillColor + HORSE_PILL_ADJUSTMENT
|
|
21
48
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^2.0.
|
|
28
|
+
"isaac-typescript-definitions": "^2.0.39"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"isaacscript-lint": "^1.0.157",
|