isaacscript-common 8.4.5 → 8.6.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/callbacks/postCursedTeleport.lua +4 -4
- package/dist/callbacks/postPlayerFatalDamage.lua +7 -7
- package/dist/callbacks/postSacrifice.lua +2 -2
- package/dist/callbacks/postTrinketBreak.lua +2 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +2 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +4 -4
- package/dist/features/characterStats.d.ts.map +1 -1
- package/dist/features/characterStats.lua +1 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +3 -36
- package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/init.lua +1 -1
- package/dist/features/firstLast.d.ts +6 -3
- package/dist/features/firstLast.d.ts.map +1 -1
- package/dist/features/firstLast.lua +6 -3
- package/dist/features/playerInventory.d.ts +11 -3
- package/dist/features/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +14 -3
- package/dist/functions/bosses.d.ts +8 -2
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +14 -6
- package/dist/functions/collectibleCacheFlag.d.ts +1 -1
- package/dist/functions/collectibleCacheFlag.d.ts.map +1 -1
- package/dist/functions/collectibleCacheFlag.lua +1 -2
- package/dist/functions/collectibleSet.lua +32 -32
- package/dist/functions/collectibleTag.d.ts +1 -1
- package/dist/functions/collectibleTag.d.ts.map +1 -1
- package/dist/functions/collectibleTag.lua +1 -3
- package/dist/functions/eden.d.ts +1 -1
- package/dist/functions/eden.d.ts.map +1 -1
- package/dist/functions/eden.lua +1 -2
- package/dist/functions/flag.d.ts +1 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/flying.d.ts +1 -1
- package/dist/functions/flying.d.ts.map +1 -1
- package/dist/functions/flying.lua +5 -2
- package/dist/functions/input.d.ts +2 -2
- package/dist/functions/input.d.ts.map +1 -1
- package/dist/functions/input.lua +2 -4
- package/dist/functions/playerHealth.d.ts +93 -0
- package/dist/functions/playerHealth.d.ts.map +1 -1
- package/dist/functions/playerHealth.lua +216 -33
- package/dist/functions/players.d.ts +1 -111
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +20 -279
- package/dist/functions/revive.d.ts +1 -1
- package/dist/functions/revive.d.ts.map +1 -1
- package/dist/functions/revive.lua +5 -4
- package/dist/functions/stats.d.ts +16 -0
- package/dist/functions/stats.d.ts.map +1 -1
- package/dist/functions/stats.lua +78 -0
- package/dist/functions/transformations.d.ts +1 -1
- package/dist/functions/transformations.d.ts.map +1 -1
- package/dist/functions/trinketCacheFlag.d.ts +1 -1
- package/dist/functions/trinketCacheFlag.d.ts.map +1 -1
- package/dist/functions/trinketCacheFlag.lua +1 -3
- package/dist/functions/trinketSet.lua +32 -32
- package/dist/index.d.ts +37 -36
- package/dist/sets/bossSets.d.ts +1 -0
- package/dist/sets/bossSets.d.ts.map +1 -1
- package/dist/sets/bossSets.lua +23 -0
- package/package.json +2 -2
- package/src/callbacks/postCursedTeleport.ts +7 -7
- package/src/callbacks/postPlayerFatalDamage.ts +9 -16
- package/src/callbacks/postSacrifice.ts +5 -5
- package/src/callbacks/postTrinketBreak.ts +5 -5
- package/src/callbacks/subscriptions/postPlayerFatalDamage.ts +9 -9
- package/src/features/characterStats.ts +1 -2
- package/src/features/customGridEntity.ts +0 -55
- package/src/features/extraConsoleCommands/init.ts +8 -1
- package/src/features/firstLast.ts +6 -3
- package/src/features/playerInventory.ts +24 -4
- package/src/functions/bosses.ts +18 -6
- package/src/functions/collectibleCacheFlag.ts +3 -3
- package/src/functions/collectibleSet.ts +32 -32
- package/src/functions/collectibleTag.ts +2 -3
- package/src/functions/eden.ts +3 -3
- package/src/functions/flag.ts +1 -1
- package/src/functions/flying.ts +4 -4
- package/src/functions/input.ts +4 -5
- package/src/functions/playerHealth.ts +269 -7
- package/src/functions/players.ts +1 -348
- package/src/functions/revive.ts +6 -10
- package/src/functions/stats.ts +75 -0
- package/src/functions/transformations.ts +1 -1
- package/src/functions/trinketCacheFlag.ts +2 -3
- package/src/functions/trinketSet.ts +32 -32
- package/src/sets/bossSets.ts +33 -0
|
@@ -8,42 +8,42 @@ local ____firstLast = require("features.firstLast")
|
|
|
8
8
|
local getModdedCollectibleTypes = ____firstLast.getModdedCollectibleTypes
|
|
9
9
|
local ____collectibles = require("functions.collectibles")
|
|
10
10
|
local getVanillaCollectibleTypeRange = ____collectibles.getVanillaCollectibleTypeRange
|
|
11
|
-
local
|
|
12
|
-
local
|
|
13
|
-
local
|
|
14
|
-
local
|
|
15
|
-
local
|
|
16
|
-
local
|
|
17
|
-
local function
|
|
18
|
-
if #
|
|
11
|
+
local ALL_COLLECTIBLE_TYPES_ARRAY = {}
|
|
12
|
+
local ALL_COLLECTIBLE_TYPES_SET = __TS__New(Set)
|
|
13
|
+
local VANILLA_COLLECTIBLE_TYPES_ARRAY = {}
|
|
14
|
+
local VANILLA_COLLECTIBLE_TYPES_SET = __TS__New(Set)
|
|
15
|
+
local MODDED_COLLECTIBLE_TYPES_ARRAY = {}
|
|
16
|
+
local MODDED_COLLECTIBLE_TYPES_SET = __TS__New(Set)
|
|
17
|
+
local function lazyInitVanillaCollectibleTypes(self)
|
|
18
|
+
if #VANILLA_COLLECTIBLE_TYPES_ARRAY > 0 then
|
|
19
19
|
return
|
|
20
20
|
end
|
|
21
21
|
local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
|
|
22
22
|
for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
|
|
23
23
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
24
24
|
if itemConfigItem ~= nil then
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
VANILLA_COLLECTIBLE_TYPES_ARRAY[#VANILLA_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
|
|
26
|
+
VANILLA_COLLECTIBLE_TYPES_SET:add(collectibleType)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
|
-
local function
|
|
31
|
-
if #
|
|
30
|
+
local function lazyInitModdedCollectibleTypes(self)
|
|
31
|
+
if #MODDED_COLLECTIBLE_TYPES_ARRAY > 0 then
|
|
32
32
|
return
|
|
33
33
|
end
|
|
34
|
-
|
|
35
|
-
for ____, collectibleType in ipairs(
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
lazyInitVanillaCollectibleTypes(nil)
|
|
35
|
+
for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES_ARRAY) do
|
|
36
|
+
ALL_COLLECTIBLE_TYPES_ARRAY[#ALL_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
|
|
37
|
+
ALL_COLLECTIBLE_TYPES_SET:add(collectibleType)
|
|
38
38
|
end
|
|
39
39
|
local moddedCollectibleTypes = getModdedCollectibleTypes(nil)
|
|
40
40
|
for ____, collectibleType in ipairs(moddedCollectibleTypes) do
|
|
41
41
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
42
42
|
if itemConfigItem ~= nil then
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
MODDED_COLLECTIBLE_TYPES_ARRAY[#MODDED_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
|
|
44
|
+
MODDED_COLLECTIBLE_TYPES_SET:add(collectibleType)
|
|
45
|
+
ALL_COLLECTIBLE_TYPES_ARRAY[#ALL_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
|
|
46
|
+
ALL_COLLECTIBLE_TYPES_SET:add(collectibleType)
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
end
|
|
@@ -56,8 +56,8 @@ end
|
|
|
56
56
|
-- This function can only be called if at least one callback has been executed. This is because not
|
|
57
57
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
58
58
|
function ____exports.getCollectibleArray(self)
|
|
59
|
-
|
|
60
|
-
return
|
|
59
|
+
lazyInitModdedCollectibleTypes(nil)
|
|
60
|
+
return ALL_COLLECTIBLE_TYPES_ARRAY
|
|
61
61
|
end
|
|
62
62
|
--- Returns a set containing every valid collectible type in the game, including modded collectibles.
|
|
63
63
|
--
|
|
@@ -67,8 +67,8 @@ end
|
|
|
67
67
|
-- This function can only be called if at least one callback has been executed. This is because not
|
|
68
68
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
69
69
|
function ____exports.getCollectibleSet(self)
|
|
70
|
-
|
|
71
|
-
return
|
|
70
|
+
lazyInitModdedCollectibleTypes(nil)
|
|
71
|
+
return ALL_COLLECTIBLE_TYPES_SET
|
|
72
72
|
end
|
|
73
73
|
--- Returns an array containing every modded collectible type in the game.
|
|
74
74
|
--
|
|
@@ -78,8 +78,8 @@ end
|
|
|
78
78
|
-- This function can only be called if at least one callback has been executed. This is because not
|
|
79
79
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
80
80
|
function ____exports.getModdedCollectibleArray(self)
|
|
81
|
-
|
|
82
|
-
return
|
|
81
|
+
lazyInitModdedCollectibleTypes(nil)
|
|
82
|
+
return MODDED_COLLECTIBLE_TYPES_ARRAY
|
|
83
83
|
end
|
|
84
84
|
--- Returns a set containing every modded collectible type in the game.
|
|
85
85
|
--
|
|
@@ -89,23 +89,23 @@ end
|
|
|
89
89
|
-- This function can only be called if at least one callback has been executed. This is because not
|
|
90
90
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
91
91
|
function ____exports.getModdedCollectibleSet(self)
|
|
92
|
-
|
|
93
|
-
return
|
|
92
|
+
lazyInitModdedCollectibleTypes(nil)
|
|
93
|
+
return MODDED_COLLECTIBLE_TYPES_SET
|
|
94
94
|
end
|
|
95
95
|
--- Returns an array containing every valid vanilla collectible type in the game.
|
|
96
96
|
--
|
|
97
97
|
-- Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
98
98
|
-- then use the `getVanillaCollectibleSet` helper function instead.
|
|
99
99
|
function ____exports.getVanillaCollectibleArray(self)
|
|
100
|
-
|
|
101
|
-
return
|
|
100
|
+
lazyInitVanillaCollectibleTypes(nil)
|
|
101
|
+
return VANILLA_COLLECTIBLE_TYPES_ARRAY
|
|
102
102
|
end
|
|
103
103
|
--- Returns a set containing every valid vanilla collectible type in the game.
|
|
104
104
|
--
|
|
105
105
|
-- Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
106
106
|
-- then use the `getVanillaCollectibleArray` helper function instead.
|
|
107
107
|
function ____exports.getVanillaCollectibleSet(self)
|
|
108
|
-
|
|
109
|
-
return
|
|
108
|
+
lazyInitVanillaCollectibleTypes(nil)
|
|
109
|
+
return VANILLA_COLLECTIBLE_TYPES_SET
|
|
110
110
|
end
|
|
111
111
|
return ____exports
|
|
@@ -10,7 +10,7 @@ export declare function collectibleHasTag(collectibleType: CollectibleType, tag:
|
|
|
10
10
|
* const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag):
|
|
13
|
+
export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
|
|
14
14
|
/** Returns the number of items that a player has towards a particular transformation. */
|
|
15
15
|
export declare function getPlayerNumCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): int;
|
|
16
16
|
export declare function isQuestCollectible(collectibleType: CollectibleType): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibleTag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"collectibleTag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAoC9E,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,eAAe,EAChC,GAAG,EAAE,aAAa,GACjB,OAAO,CAOT;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,aAAa,GAC3B,WAAW,CAAC,eAAe,CAAC,CAc9B;AAED,yFAAyF;AACzF,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,GAC3B,GAAG,CAGL;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAE5E"}
|
|
@@ -16,8 +16,6 @@ local ____flag = require("functions.flag")
|
|
|
16
16
|
local getFlagName = ____flag.getFlagName
|
|
17
17
|
local ____players = require("functions.players")
|
|
18
18
|
local getPlayerCollectibleCount = ____players.getPlayerCollectibleCount
|
|
19
|
-
local ____set = require("functions.set")
|
|
20
|
-
local copySet = ____set.copySet
|
|
21
19
|
function ____exports.collectibleHasTag(self, collectibleType, tag)
|
|
22
20
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
23
21
|
if itemConfigItem == nil then
|
|
@@ -66,7 +64,7 @@ function ____exports.getCollectibleTypesWithTag(self, itemConfigTag)
|
|
|
66
64
|
if collectibleTypes == nil then
|
|
67
65
|
error(("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the ItemConfigTag enum.")
|
|
68
66
|
end
|
|
69
|
-
return
|
|
67
|
+
return collectibleTypes
|
|
70
68
|
end
|
|
71
69
|
--- Returns the number of items that a player has towards a particular transformation.
|
|
72
70
|
function ____exports.getPlayerNumCollectiblesWithTag(self, player, itemConfigTag)
|
package/dist/functions/eden.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
-
export declare function getEdenPassives():
|
|
2
|
+
export declare function getEdenPassives(): ReadonlySet<CollectibleType>;
|
|
3
3
|
export declare function getRandomEdenPassive(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
|
|
4
4
|
//# sourceMappingURL=eden.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,
|
|
1
|
+
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,CAO9D;AAED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe,CAWjB"}
|
package/dist/functions/eden.lua
CHANGED
|
@@ -14,7 +14,6 @@ local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
|
14
14
|
local ____rng = require("functions.rng")
|
|
15
15
|
local getRandomSeed = ____rng.getRandomSeed
|
|
16
16
|
local ____set = require("functions.set")
|
|
17
|
-
local copySet = ____set.copySet
|
|
18
17
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
19
18
|
local EDEN_PASSIVE_COLLECTIBLES_SET = __TS__New(Set)
|
|
20
19
|
local function initCollectibleSet(self)
|
|
@@ -28,7 +27,7 @@ function ____exports.getEdenPassives(self)
|
|
|
28
27
|
if EDEN_PASSIVE_COLLECTIBLES_SET.size == 0 then
|
|
29
28
|
initCollectibleSet(nil)
|
|
30
29
|
end
|
|
31
|
-
return
|
|
30
|
+
return EDEN_PASSIVE_COLLECTIBLES_SET
|
|
32
31
|
end
|
|
33
32
|
function ____exports.getRandomEdenPassive(self, seedOrRNG, exceptions)
|
|
34
33
|
if seedOrRNG == nil then
|
package/dist/functions/flag.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export declare function hasFlag<T extends BitFlag | BitFlag128>(flags: T | BitFl
|
|
|
74
74
|
*/
|
|
75
75
|
export declare function isEmptyFlag<T extends BitFlag | BitFlag128>(flag: T): boolean;
|
|
76
76
|
/**
|
|
77
|
-
* Helper function to determine whether damage to a player in the
|
|
77
|
+
* Helper function to determine whether damage to a player in the `ENTITY_TAKE_DMG` callback was
|
|
78
78
|
* self-inflicted. For example, damage from a Curse Room door, a Razor, or a Blood Donation Machine
|
|
79
79
|
* would count as self-inflicted damage.
|
|
80
80
|
*/
|
package/dist/functions/flag.lua
CHANGED
|
@@ -92,7 +92,7 @@ end
|
|
|
92
92
|
function ____exports.isEmptyFlag(self, flag)
|
|
93
93
|
return flag == 0
|
|
94
94
|
end
|
|
95
|
-
--- Helper function to determine whether damage to a player in the
|
|
95
|
+
--- Helper function to determine whether damage to a player in the `ENTITY_TAKE_DMG` callback was
|
|
96
96
|
-- self-inflicted. For example, damage from a Curse Room door, a Razor, or a Blood Donation Machine
|
|
97
97
|
-- would count as self-inflicted damage.
|
|
98
98
|
function ____exports.isSelfDamage(self, damageFlags)
|
|
@@ -9,7 +9,7 @@ import { CollectibleType, TrinketType } from "isaac-typescript-definitions";
|
|
|
9
9
|
* @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
|
|
10
10
|
* should be included in the set (like Empty Vessel).
|
|
11
11
|
*/
|
|
12
|
-
export declare function getFlyingCollectibles(pruneConditionalItems: boolean):
|
|
12
|
+
export declare function getFlyingCollectibles(pruneConditionalItems: boolean): ReadonlySet<CollectibleType>;
|
|
13
13
|
/**
|
|
14
14
|
* Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
|
|
15
15
|
* conditionally, like Bat Wing.)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flying.d.ts","sourceRoot":"","sources":["../../src/functions/flying.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,qBAAqB,EAAE,OAAO,GAC7B,
|
|
1
|
+
{"version":3,"file":"flying.d.ts","sourceRoot":"","sources":["../../src/functions/flying.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,qBAAqB,EAAE,OAAO,GAC7B,WAAW,CAAC,eAAe,CAAC,CAwB9B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,WAAW,CAAC,CAI5D;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CA0BtE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG/D"}
|
|
@@ -34,7 +34,10 @@ local CONDITIONAL_FLYING_COLLECTIBLE_TYPES = {CollectibleType.BIBLE, Collectible
|
|
|
34
34
|
-- @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
|
|
35
35
|
-- should be included in the set (like Empty Vessel).
|
|
36
36
|
function ____exports.getFlyingCollectibles(self, pruneConditionalItems)
|
|
37
|
-
local collectiblesWithFlyingCacheFlag =
|
|
37
|
+
local collectiblesWithFlyingCacheFlag = copySet(
|
|
38
|
+
nil,
|
|
39
|
+
getCollectiblesForCacheFlag(nil, CacheFlag.FLYING)
|
|
40
|
+
)
|
|
38
41
|
local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.ALL)
|
|
39
42
|
deleteSetsFromSet(nil, collectiblesWithFlyingCacheFlag, collectiblesWithAllCacheFlag)
|
|
40
43
|
if pruneConditionalItems then
|
|
@@ -47,7 +50,7 @@ end
|
|
|
47
50
|
--- Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
|
|
48
51
|
-- conditionally, like Bat Wing.)
|
|
49
52
|
function ____exports.getFlyingTrinkets(self)
|
|
50
|
-
return
|
|
53
|
+
return FLYING_TRINKETS
|
|
51
54
|
end
|
|
52
55
|
function ____exports.hasFlyingTemporaryEffect(self, player)
|
|
53
56
|
local effects = player:GetEffects()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonAction, Controller, Keyboard } from "isaac-typescript-definitions";
|
|
2
2
|
/** Helper function to get the enum name for the specified `Controller` value. */
|
|
3
3
|
export declare function controllerToString(controller: Controller): string | undefined;
|
|
4
|
-
export declare function getMoveActions():
|
|
5
|
-
export declare function getShootActions():
|
|
4
|
+
export declare function getMoveActions(): ReadonlySet<ButtonAction>;
|
|
5
|
+
export declare function getShootActions(): ReadonlySet<ButtonAction>;
|
|
6
6
|
/** Iterates over all inputs to determine if a particular button is pressed (i.e. held down). */
|
|
7
7
|
export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): boolean;
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAsCtC,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAO7E;AAED,wBAAgB,cAAc,IAAI,WAAW,CAAC,YAAY,CAAC,CAE1D;AAED,wBAAgB,eAAe,IAAI,WAAW,CAAC,YAAY,CAAC,CAE3D;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAK7E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,GACzB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
|
package/dist/functions/input.lua
CHANGED
|
@@ -12,8 +12,6 @@ local ____keyboardToString = require("maps.keyboardToString")
|
|
|
12
12
|
local KEYBOARD_TO_STRING = ____keyboardToString.KEYBOARD_TO_STRING
|
|
13
13
|
local ____enums = require("functions.enums")
|
|
14
14
|
local getEnumValues = ____enums.getEnumValues
|
|
15
|
-
local ____set = require("functions.set")
|
|
16
|
-
local copySet = ____set.copySet
|
|
17
15
|
local ____string = require("functions.string")
|
|
18
16
|
local trimPrefix = ____string.trimPrefix
|
|
19
17
|
local MODIFIER_KEYS = {
|
|
@@ -39,10 +37,10 @@ function ____exports.controllerToString(self, controller)
|
|
|
39
37
|
return trimPrefix(nil, key, "BUTTON_")
|
|
40
38
|
end
|
|
41
39
|
function ____exports.getMoveActions(self)
|
|
42
|
-
return
|
|
40
|
+
return MOVEMENT_ACTIONS_SET
|
|
43
41
|
end
|
|
44
42
|
function ____exports.getShootActions(self)
|
|
45
|
-
return
|
|
43
|
+
return SHOOTING_ACTIONS_SET
|
|
46
44
|
end
|
|
47
45
|
--- Iterates over all inputs to determine if a particular button is pressed (i.e. held down).
|
|
48
46
|
function ____exports.isActionPressedOnAnyInput(self, buttonAction)
|
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
import { HealthType } from "../enums/HealthType";
|
|
4
4
|
import { PlayerHealth } from "../interfaces/PlayerHealth";
|
|
5
5
|
export declare function addPlayerHealthType(player: EntityPlayer, healthType: HealthType, numHearts: int): void;
|
|
6
|
+
/**
|
|
7
|
+
* Returns whether or not all of the player's soul-heart-type hearts are black hearts.
|
|
8
|
+
*
|
|
9
|
+
* Note that this function does not consider red heart containers.
|
|
10
|
+
*
|
|
11
|
+
* For example:
|
|
12
|
+
*
|
|
13
|
+
* - If the player has one black heart, this function would return true.
|
|
14
|
+
* - If the player has one soul heart and two black hearts, this function would return false.
|
|
15
|
+
* - If the player has no black hearts, this function will return false.
|
|
16
|
+
* - If the player has one red heart container and three black hearts, this function would return
|
|
17
|
+
* true.
|
|
18
|
+
*/
|
|
19
|
+
export declare function doesPlayerHaveAllBlackHearts(player: EntityPlayer): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether or not all of the player's soul-heart-type hearts are soul hearts.
|
|
22
|
+
*
|
|
23
|
+
* Note that this function does not consider red heart containers.
|
|
24
|
+
*
|
|
25
|
+
* For example:
|
|
26
|
+
*
|
|
27
|
+
* - If the player has two soul hearts and one black heart, this function would return false.
|
|
28
|
+
* - If the player has no soul hearts, this function will return false.
|
|
29
|
+
* - If the player has one red heart container and three soul hearts, this function would return
|
|
30
|
+
* true.
|
|
31
|
+
*/
|
|
32
|
+
export declare function doesPlayerHaveAllSoulHearts(player: EntityPlayer): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the number of slots that the player has remaining for new heart containers, accounting
|
|
35
|
+
* for broken hearts. For example, if the player is Judas and has 1 red heart containers and 2 full
|
|
36
|
+
* soul hearts and 3 broken hearts, then this function would return 6 (i.e. 12 - 1 - 2 - 3).
|
|
37
|
+
*/
|
|
38
|
+
export declare function getPlayerAvailableHeartSlots(player: EntityPlayer): int;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the number of black hearts that the player has, excluding any soul hearts. For example,
|
|
41
|
+
* if the player has one full black heart, one full soul heart, and one half black heart, this
|
|
42
|
+
* function returns 3.
|
|
43
|
+
*
|
|
44
|
+
* This is different from the `EntityPlayer.GetBlackHearts` method, since that returns a bitmask.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getPlayerBlackHearts(player: EntityPlayer): int;
|
|
6
47
|
/**
|
|
7
48
|
* Helper function to get an object representing the player's health. You can use this in
|
|
8
49
|
* combination with the `setPlayerHealth` function to restore the player's health back to a certain
|
|
@@ -12,6 +53,47 @@ export declare function addPlayerHealthType(player: EntityPlayer, healthType: He
|
|
|
12
53
|
*/
|
|
13
54
|
export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
|
|
14
55
|
export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the number of red hearts that the player has, excluding any rotten hearts. For example,
|
|
58
|
+
* if the player has one full black heart, one full soul heart, and one half black heart, this
|
|
59
|
+
* function returns 3.
|
|
60
|
+
*
|
|
61
|
+
* This is different from the `EntityPlayer.GetHearts` method, since that returns a value that
|
|
62
|
+
* includes rotten hearts.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getPlayerHearts(player: EntityPlayer): int;
|
|
65
|
+
/**
|
|
66
|
+
* Helper function that returns the type of the rightmost heart. This does not including golden
|
|
67
|
+
* hearts or broken hearts, since they cannot be damaged directly.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getPlayerLastHeart(player: EntityPlayer): HealthType;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the maximum heart containers that the provided player can have. Normally, this is 12, but
|
|
72
|
+
* it can change depending on the character (e.g. Keeper) and other things (e.g. Mother's Kiss).
|
|
73
|
+
* This function does not account for Broken Hearts; use the `getPlayerAvailableHeartSlots` helper
|
|
74
|
+
* function for that.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getPlayerMaxHeartContainers(player: EntityPlayer): int;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the number of soul hearts that the player has, excluding any black hearts. For example,
|
|
79
|
+
* if the player has one full black heart, one full soul heart, and one half black heart, this
|
|
80
|
+
* function returns 2.
|
|
81
|
+
*
|
|
82
|
+
* This is different from the `EntityPlayer.GetSoulHearts` method, since that returns the combined
|
|
83
|
+
* number of soul hearts and black hearts.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getPlayerSoulHearts(player: EntityPlayer): int;
|
|
86
|
+
/**
|
|
87
|
+
* Helper function to determine how many heart containers that Tainted Magdalene has that will not
|
|
88
|
+
* be automatically depleted over time. By default, this is 2, but this function will return 4 so
|
|
89
|
+
* that it is consistent with the `player.GetHearts` and `player.GetMaxHearts` methods.
|
|
90
|
+
*
|
|
91
|
+
* If Tainted Magdalene has Birthright, she will gained an additional non-temporary heart container.
|
|
92
|
+
*
|
|
93
|
+
* This function does not validate whether or not the provided player is Tainted Magdalene; that
|
|
94
|
+
* should be accomplished before invoking this function.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): int;
|
|
15
97
|
/** Returns a `PlayerHealth` object with all zeros. */
|
|
16
98
|
export declare function newPlayerHealth(): PlayerHealth;
|
|
17
99
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
@@ -32,4 +114,15 @@ export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
|
32
114
|
* Based on the `REVEL.LoadHealth` function in the Revelations mod.
|
|
33
115
|
*/
|
|
34
116
|
export declare function setPlayerHealth(player: EntityPlayer, playerHealth: PlayerHealth): void;
|
|
117
|
+
/**
|
|
118
|
+
* Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
|
|
119
|
+
* Magdalene.
|
|
120
|
+
*
|
|
121
|
+
* Tainted Magdalene has "permanent" health and "temporary" health. When standing still and doing
|
|
122
|
+
* nothing, all of Tainted Magdalene's temporary health will eventually go away.
|
|
123
|
+
*
|
|
124
|
+
* Before using this function, it is expected that you check to see if the player is Tainted
|
|
125
|
+
* Magdalene first, or else it will give a nonsensical result.
|
|
126
|
+
*/
|
|
127
|
+
export declare function wouldDamageTaintedMagdaleneNonTemporaryHeartContainers(player: EntityPlayer, damageAmount: float): boolean;
|
|
35
128
|
//# sourceMappingURL=playerHealth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../src/functions/playerHealth.ts"],"names":[],"mappings":";;
|
|
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,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAQzE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;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,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED,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,CAsHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|