GASify
  • Introduction
  • Overview
  • Installation
  • Basic Usage
  • Ability System Component (ASC)
    • Attributes
    • Attribute Processors
    • Targetting System
  • Gameplay Ability (GA)
    • Gameplay Ability Implementations
    • Creating New Abilities
  • Gameplay Effect (GE)
    • Modifier
    • Calculation (GEC)
    • Behaviour (GEB)
  • Gameplay Tag
  • Gameplay Cue
  • Data Groups
  • Cookbook 🥣
  • Multiplayer / Networking
  • Contact & Note
Powered by GitBook
On this page
  1. Gameplay Effect (GE)

Calculation (GEC)

PreviousModifierNextBehaviour (GEB)

Last updated 1 year ago

GameplayEffectCalculations (GEC) are way to execute any custom code when an GameplayEffect is applied. They can be attached to any GameplayEffect. They usually involve doing some sort of "calculation" (e.g. Damage formula involving multiple Attributes like MinDmg, MaxDmg, CritChance, CritBonus) and returning a list of Modifiers to be applied. Calculations are only applied when used with Instant or Periodic Effects (GE)

Creating your own GECs

  1. Inherit from GameplayEffectCalculation

  2. Override the Execute method and implement whatever you want (e.g. DamageCalculation)

  3. Create an ScriptableObject container (e.g. GameplayEffectCalculationSO_DamageCalculation)

    namespace GAS {
        [CreateAssetMenu(menuName = "GAS/GameplayEffectCalculationSO_DamageCalculation", fileName = "GameplayEffectCalculationSO_DamageCalculation")]
        [Serializable]
        public class GameplayEffectCalculationSO_DamageCalculation : GameplayEffectCalculationSO {
            public GameplayEffectCalculationSO_DamageCalculation() {
                calc = new DamageCalculation();
            }
        }
    }