Skip to main content

Character Stats

Easily create custom characters that have base stats different from that of Isaac.

Hierarchy

  • Feature

    CharacterStats

Methods

registerCharacterStats

registerCharacterStats(playerType, statMap): void

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

NameType
playerTypePlayerType
statMapReadonlyMap<CacheFlagValue, number>

Returns

void

Defined in

packages/isaacscript-common/src/classes/features/other/CharacterStats.ts:66