pokemon-rogue-battle
    Preparing search index...

    Function toDmgValue

    • This function is used in the context of a Pokémon battle game to calculate the actual integer damage value from a float result. Many damage calculation formulas involve various parameters and result in float values. The actual damage applied to a Pokémon's HP must be an integer. This function helps in ensuring that by flooring the float value and enforcing a minimum damage value.

      Parameters

      • value: number

        The float value to convert.

      • minValue: number = 1

        The minimum integer value to return. Defaults to 1.

      Returns number

      The converted value as an integer.