isaacscript-common 4.2.5 → 4.2.6
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/functions/character.lua +5 -7
- package/package.json +1 -1
package/functions/character.lua
CHANGED
|
@@ -5,7 +5,6 @@ local ____constantsFirstLast = require("constantsFirstLast")
|
|
|
5
5
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
6
6
|
local ____characterNames = require("objects.characterNames")
|
|
7
7
|
local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
|
|
8
|
-
local DEFAULT_CHARACTER_NAME = ____characterNames.DEFAULT_CHARACTER_NAME
|
|
9
8
|
local ____charactersThatStartWithAnActiveItemSet = require("sets.charactersThatStartWithAnActiveItemSet")
|
|
10
9
|
local CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET = ____charactersThatStartWithAnActiveItemSet.CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET
|
|
11
10
|
local ____charactersWithBlackHeartFromEternalHeartSet = require("sets.charactersWithBlackHeartFromEternalHeartSet")
|
|
@@ -18,6 +17,9 @@ local ____charactersWithNoSoulHeartsSet = require("sets.charactersWithNoSoulHear
|
|
|
18
17
|
local CHARACTERS_WITH_NO_SOUL_HEARTS_SET = ____charactersWithNoSoulHeartsSet.CHARACTERS_WITH_NO_SOUL_HEARTS_SET
|
|
19
18
|
local ____lostStyleCharactersSet = require("sets.lostStyleCharactersSet")
|
|
20
19
|
local LOST_STYLE_CHARACTERS_SET = ____lostStyleCharactersSet.LOST_STYLE_CHARACTERS_SET
|
|
20
|
+
function ____exports.isModdedCharacter(self, character)
|
|
21
|
+
return not ____exports.isVanillaCharacter(nil, character)
|
|
22
|
+
end
|
|
21
23
|
function ____exports.isVanillaCharacter(self, character)
|
|
22
24
|
return character <= LAST_VANILLA_CHARACTER
|
|
23
25
|
end
|
|
@@ -84,13 +86,9 @@ function ____exports.getCharacterMaxHeartContainers(self, character)
|
|
|
84
86
|
end
|
|
85
87
|
--- Helper function to get the name of a character. Returns "unknown" for modded characters.
|
|
86
88
|
function ____exports.getCharacterName(self, character)
|
|
87
|
-
if ____exports.
|
|
89
|
+
if ____exports.isModdedCharacter(nil, character) then
|
|
88
90
|
return "unknown"
|
|
89
91
|
end
|
|
90
|
-
|
|
91
|
-
return characterName == nil and DEFAULT_CHARACTER_NAME or characterName
|
|
92
|
-
end
|
|
93
|
-
function ____exports.isModdedCharacter(self, character)
|
|
94
|
-
return not ____exports.isVanillaCharacter(nil, character)
|
|
92
|
+
return CHARACTER_NAMES[character]
|
|
95
93
|
end
|
|
96
94
|
return ____exports
|