Skip to content

Stats

addPlayerStat(player, cacheFlag, amount): void

Defined in: packages/isaacscript-common/src/functions/stats.ts:32

Helper function to add a stat to a player based on the CacheFlag provided. Call this function from the EVALUATE_CACHE callback.

Note that for CacheFlag.FIRE_DELAY, the “amount” argument will be interpreted as the tear stat to add (and not the amount to mutate EntityPlayer.MaxFireDelay by).

This function supports the following cache flags:

  • CacheFlag.DAMAGE (1 << 0)
  • CacheFlag.FIRE_DELAY (1 << 1)
  • CacheFlag.SHOT_SPEED (1 << 2)
  • CacheFlag.RANGE (1 << 3)
  • CacheFlag.SPEED (1 << 4)
  • CacheFlag.LUCK (1 << 10)

EntityPlayer

CacheFlagValue

number

void


getDefaultPlayerStat(cacheFlag): number | undefined

Defined in: packages/isaacscript-common/src/functions/stats.ts:92

Returns the starting stat that Isaac (the default character) starts with. For example, if you pass this function CacheFlag.DAMAGE, it will return 3.5.

Note that the default fire delay is represented in the tear stat, not the MaxFireDelay value.

CacheFlagValue

number | undefined


getPlayerStat<T>(player, playerStat): PlayerStats[T]

Defined in: packages/isaacscript-common/src/functions/stats.ts:97

Helper function to get the stat for a player corresponding to the StatType.

T extends PlayerStat

EntityPlayer

T

PlayerStats[T]


getPlayerStats(player): PlayerStats

Defined in: packages/isaacscript-common/src/functions/stats.ts:106

Helper function to get all of the stat for a player.

EntityPlayer

PlayerStats