Character Stats
Classes
Section titled “Classes”CharacterStats
Section titled “CharacterStats”Defined in: packages/isaacscript-common/src/classes/features/other/CharacterStats.ts:10
Easily create custom characters that have base stats different from that of Isaac.
Extends
Section titled “Extends”Feature
Methods
Section titled “Methods”registerCharacterStats()
Section titled “registerCharacterStats()”registerCharacterStats(
playerType,statMap):void
Defined in: packages/isaacscript-common/src/classes/features/other/CharacterStats.ts:66
Helper function to manage the stats for a vanilla or custom character. Call this function once at the beginning of your mod to declare the starting stats.
You must provide this function with a map of CacheFlag to the default stat amount. For example, the default amount of damage is 3.5. To make a custom character start with 4.5 damage:
const fooDefaultStats = new Map<CacheFlag, number>([ [CacheFlag.DAMAGE, 4.5],])registerCharacterStats(PlayerTypeCustom.FOO, fooDefaultStats);Note that the format for the CacheFlag.FIRE_DELAY value should be in the tears stat format,
not the MaxFireDelay format.
In order to use this function, you must upgrade your mod with ISCFeature.CHARACTER_STATS.
Parameters
Section titled “Parameters”playerType
Section titled “playerType”PlayerType
statMap
Section titled “statMap”ReadonlyMap<CacheFlagValue, number>
Returns
Section titled “Returns”void
