• Manual
  • Scripting API
  • Changelog
  • Contact
Search Results for

    Show / Hide Table of Contents
    • BattleBehaviour
      • BattleBehaviour.Fusion
        • FusionManager
        • GameCharacterFusion
      • Battle
      • BossSize
      • CharacterGroup
      • ScriptableBattlePosition
      • ScriptableBattleStage
      • TeamData
      • BattleBehaviour.Backup
        • BackupState
        • BattleBackup
    • GameActors
      • GameActor
      • GameCharacter
      • GameCharacter.AIState
      • GameItem
    • States
      • BattleState
      • ChangeStageState
      • FightState
      • FightState.LoseCondition
      • FightState.WinCondition
      • PreparationState
      • ResetSceneState
    • Battlefield
      • BattleGrid
      • BattleGrid.GridType
      • Bench
      • GridCell
      • GridCellEffect
      • SellZone
    • BattleUI
      • CharacterEnergyUI
      • CharacterHealthUI
      • CharacterStatsUI
      • DamagePopup
      • ItemDescriptionUI
      • ShopExpBarUI
      • StageUI
      • TraitDescriptionUI
      • TraitListUI
      • TraitListUI.OrderBy
      • TraitStatsUI
      • TraitUI
    • EditorScripts
      • BattleGridEditor
      • BattlePositionEditor
      • BenchEditor
      • GameCharacterEditor
      • NetworkObjectsListEditor
      • NFO_GameCharacterEditor
      • NGO_MenuActions
      • ReadOnlyDrawer
    • Formulas
      • BattleFormulas
      • BattleFormulas.DamageType
    • Movement
      • ApproximateAstarMovement
      • ExactAstarMovement
      • IBattleMovement
      • PathFinding2D
    • Multiplayer
      • BattleBehaviour
        • NetworkObjectList
        • StatsStruct
        • GameActors
          • NGO_GameCharacter
          • NGO_GameItem
        • Player
          • GamePlayer
          • IPlayer
        • States
          • MP_ConnectionState
          • MP_FightState
          • MP_PreparationState
      • ClientTransform
        • ClientNetworkTransform
      • EditorScripts
        • NGO_MenuActions
      • GamingServices
        • GamingServices
          • GamingServices.RelayHostData
          • GamingServices.RelayJoinData
      • UI
        • NetworkManagerUI
    • Shop
      • ScriptableShopItem
      • ShopCharacter
      • ShopGameItem
      • ShopItemInfo
      • ShopLevel
      • ShopLevelManager
      • ShopManager
      • ShopGUI
        • CurrencyUI
        • EquippedItemDescriptionUI
        • ShopItemUI
        • ShopUI
        • SpecialAttackDescriptionUI
        • Timer
      • ShopList
        • IShopList
        • ScriptableDeckList
        • ScriptableGroupItemList
        • ScriptableIndividualItemList
        • ShopItemList
    • Skills
      • ApplyBuffOnHitEffect
      • ApplyDebuffOnHitEffect
      • ArrowEffect
      • BuffEffect
      • BuffEffectInfo
      • FixedDamageOverTimeEffect
      • HealthMeteoriteAllEffect
      • HealthStealEffect
      • IAttackEffect
      • MeleeEffect
      • MeteoriteEffect
      • OnHitEffect
      • Projectile
      • RangedEffect
      • SimpleBuffEffect
      • SwordEffect
      • VariableDamageOverTimeEffect
    • Stats
      • CharacterStats
      • CharacterStats.CharacterStat
      • ItemModificator
      • StatModificator
      • StatsModificator
      • StatsModificator.ModificatorType
      • Trait
      • TraitOption
      • TraitOption.TraitTarget
    • Utility
      • AutoBattleSettings
      • ReadOnlyAttribute
      • UIUtility

    Class BattleFormulas

    Class in charge of calculating the damage between an attacking and a defending GameCharacter, and of reducing the life of the latter.

    Inheritance
    Object
    BattleFormulas
    Namespace: AutoBattleFramework.Formulas
    Assembly: cs.temp.dll.dll
    Syntax
    public class BattleFormulas

    Methods

    AddEnergyOnAttack(Single, GameCharacter, GameCharacter, Boolean)

    Adds Energy to the attacking (based on EnergyRecoveryPerAttack) and defending (based on EnergyRecoveryOnHit) GameCharacter.
    CurrentStats should be entered as parameters in most cases.

    Declaration
    protected static void AddEnergyOnAttack(float damage, GameCharacter defending, GameCharacter attacking, bool IsSpecial)
    Parameters
    Type Name Description
    Single damage

    Amount of pre-calculatedd damage.

    GameCharacter defending

    Character who will recieve damage.

    GameCharacter attacking

    Character who makes damage.

    Boolean IsSpecial

    if is special damage, only the defending one gets energy.

    BasicAttackDamage(BattleFormulas.DamageType, GameCharacter, GameCharacter)

    Calculates the normal attack damage between the CharacterStats of an attacking and a defending GameCharacter.
    Check if the damage has been critical (based on CriticalProbability) and apply the critical damage bonus (based on CriticalDamage) accordingly.
    Applies OnHitEffect of OnHitEffects, equipped GameItem (itemModificators), TraitModificators and active buffs (BuffList).
    Subtract the calculated damage from the defender's remaining Health.
    Adds Energy to the attacking (based on EnergyRecoveryPerAttack) and defending (based on EnergyRecoveryOnHit) GameCharacter.
    CurrentStats should be entered as parameters in most cases.

    Declaration
    public static float BasicAttackDamage(BattleFormulas.DamageType damageType, GameCharacter defending, GameCharacter attacking)
    Parameters
    Type Name Description
    BattleFormulas.DamageType damageType

    Type of the infringed damage.

    GameCharacter defending

    Character who will recieve damage.

    GameCharacter attacking

    Character who makes damage.

    Returns
    Type Description
    Single

    Damage done to the defending character.

    CalculateDamage(BattleFormulas.DamageType, CharacterStats, CharacterStats)

    Calculates the damage between the CharacterStats of an attacking and a defending GameCharacter.
    CurrentStats should be entered as parameters in most cases.

    Declaration
    protected static float CalculateDamage(BattleFormulas.DamageType damageType, CharacterStats defending, CharacterStats attacking)
    Parameters
    Type Name Description
    BattleFormulas.DamageType damageType

    Type of the infringed damage.

    CharacterStats defending

    Character who will recieve damage.

    CharacterStats attacking

    Character who makes damage.

    Returns
    Type Description
    Single

    CalculateSpecialDamage(BattleFormulas.DamageType, Single, CharacterStats, CharacterStats)

    Calculates the damage between the CharacterStats of an attacking and a defending GameCharacter, given a pre-calculated damage (usually from a special ability).
    CurrentStats should be entered as parameters in most cases.

    Declaration
    protected static float CalculateSpecialDamage(BattleFormulas.DamageType damageType, float damage, CharacterStats defending, CharacterStats attacking)
    Parameters
    Type Name Description
    BattleFormulas.DamageType damageType

    Type of the infringed damage.

    Single damage

    Amount of pre-calculatedd damage.

    CharacterStats defending

    Character who will recieve damage.

    CharacterStats attacking

    Character who makes damage.

    Returns
    Type Description
    Single

    CriticalHit(Single)

    Returns true if an attack has been critical, given a probability (CriticalProbability in most cases).

    Declaration
    protected static bool CriticalHit(float probability)
    Parameters
    Type Name Description
    Single probability

    Probability of attack being critical.

    Returns
    Type Description
    Boolean

    RecieveDamage(GameCharacter, Single, BattleFormulas.DamageType, Color)

    Subtracts Health from a GameCharacter and creates a popup with the damage received.

    Declaration
    public static void RecieveDamage(GameCharacter character, float damage, BattleFormulas.DamageType damageType, Color damageColor)
    Parameters
    Type Name Description
    GameCharacter character

    Character who will recieve damage.

    Single damage

    Fixed amount of damage.

    BattleFormulas.DamageType damageType

    Type of damage being inflicted.

    Color damageColor

    Color of popup text.

    SpecialAttackDamage(BattleFormulas.DamageType, Single, GameCharacter, GameCharacter)

    Calculates the special attack damage between the CharacterStats of an attacking and a defending GameCharacter.
    Subtract the calculated damage from the defender's remaining Health.
    /// Applies OnHitEffect of OnHitEffects.
    Adds Energy to the defending (based on EnergyRecoveryOnHit) GameCharacter.
    CurrentStats should be entered as parameters in most cases.

    Declaration
    public static float SpecialAttackDamage(BattleFormulas.DamageType damageType, float damage, GameCharacter defending, GameCharacter attacking)
    Parameters
    Type Name Description
    BattleFormulas.DamageType damageType

    Type of the infringed damage.

    Single damage

    Amount of pre-calculatedd damage.

    GameCharacter defending

    Character who will recieve damage.

    GameCharacter attacking

    Character who makes damage.

    Returns
    Type Description
    Single

    Damage done to the defending character.

    In This Article
    Back to top Auto-Battle Framework documentation