# Effects

The Effects configuration is where you create or link global effects which will will be applied to ABC entities. Effects are applied from ability hits/collisions. There is over 50 effects you can choose from including inflicting damage, healing an ally or pushing an enemy away.&#x20;

New effects can be added from selecting the 'Add New Effect' dropdown or by linking/copying an effect from the 'Add Global Effect' dropdown.&#x20;

A list of what each ability effect does can be found here: Effect Breakdown

{% hint style="danger" %}
Objects require both the ABC State Manager and a Unity collider for effects to be applied by abilities.&#x20;
{% endhint %}

![](https://1755795481-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MhJfX9-yykdmh_ePph_%2F-Mi2pYeaLI6Gz8huG3o8%2F-Mi6ImOAAILkMajCh3Mk%2FEffects.PNG?alt=media\&token=0c023228-8fd3-4ccd-8e25-2d5a77d05e7f)

Effects will be inflicted one by one to the entity in the order that they appear and the effects can be reordered by clicking the 'Up' and 'Down' button next to each effect.

![](https://1755795481-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MhJfX9-yykdmh_ePph_%2F-Mi2pYeaLI6Gz8huG3o8%2F-Mi6JndxhZjQzQ2x0tA0%2FEffects_Ordering.PNG?alt=media\&token=1f375f1e-761d-4bb0-9b5d-6374f9996899)

## Applying Effects

Ability effects can be added to an entity if they do not already have the same effect applied by the ability. unless the effect has the “Allow Duplicate Effect Activation” setting enabled. This only applies per character.&#x20;

{% hint style="info" %}
For example: if a character has a Fireball ability and a Lightning ability and both abilities have a Adjust Health effect setup. Even though the 2 effects do the same thing they are unique.&#x20;

If the character activates 2 Fireball abilities and 1 Lightning ability and all 3 abilities hits an enemy at the exact same time then the enemy will be inflicted with the Adjust Health effect from the Lightning and the Adjust Health from only 1 Fireball ability. The effect from the second Fireball ability will not be applied as the enemy already has the Fireball effect active from this character.

In this same example another character can apply their own Fireball Adjust Health even though the enemy has a Fireball Adjust Health from the first character.
{% endhint %}

![](https://1755795481-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MhJfX9-yykdmh_ePph_%2F-MhscCb415n7sucZfW-P%2F-Mhsg6VwuI-PQJ0Cr4Eb%2F5Stages_End.PNG?alt=media\&token=ea8e660f-8acc-436d-8cd1-93e235ecda25)

## Effect Settings

Each effect comes with settings to customise what happens when the effect activates or how it activates. This ranges from what effect to activate, the delay and duration of the effect, who the effect will apply on, potency modification from stats, if the effect should stop movement or prevent/interrupt ability activation and any graphics or text which should display.&#x20;

When adding an effect you can access all the settings by clicking the 'More Settings' button.

{% hint style="info" %}
It is recommended that you copy or follow from the Global Effects library from ABC to get an idea of the kind of effects you can make
{% endhint %}

![](https://1755795481-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MhJfX9-yykdmh_ePph_%2F-Mi6NtfLj3FchRSAJdHc%2F-Mi6OxQYoCpuGjncE5M4%2FEffectSettings.PNG?alt=media\&token=d1d8be1a-78ca-4039-a5dc-06d1199e0eed)

## Modify Potency Using Stats&#x20;

It's possible to use stats from the entity hit by the ability and/or the originator who activated the ability to modify the potency value of an effect. Stats can be created in the [State Manager](../../../state-manager/settings/general-and-stats#stats) component.

This settings allows for entities stats to affect the power/force/value etc behind an effect. For example with an “AdjustHealth” effect the originators strength stat may modify the potency reducing more health (doing more damage) to the enemy hit, however the effect may also have it’s potency modified again depending on the enemies defence so it doesn’t reduce as much as it would have.

There is no limit to how many Stat Modifications that can be added to an effect. The stat modifications will be applied one by one in order of the list.

{% hint style="info" %}
Modifications can be added by pressing the “+” button. The modifications can be removed from the list by hitting the “X” button at the end of the row. Modifications can be ordered using the up and down arrows at the end of the row of each ability.&#x20;
{% endhint %}

Once a modification has been added the following settings appear in a line:

* Add/Minus/Divide/Multiply the stat
  * The atheromatic being applied to the potency (increase/decrease potency etc)
* Percentage Of
  * What percentage of the stat will be used in the calculation. I.e Add 30% of the Attack stat for example If Attack stat is 100 it will add 30 to the potency.
* Originator (entity that activates the ability) / Entity (entity hit by the ability) / Both Simultaneously
  * Who’s stat is being used in the calculation. A choice of Originator, Entity or Both can be used. For example use 30% of the Originators Attack stat.
* Integration type&#x20;
  * Choose between ABC's stat system or [Game Creators](../../integrations/untitled) (if setup)
* Stat
  * The name of the stat to use. The string needs to match the stat which has been setup in the [State Manager](../../../state-manager/settings/general-and-stats#stats) configuration or it will be ignored.

{% hint style="info" %}
An example of these settings being used can be found below. 2 Stat modifications are shown which take into account the originators attack stat and the target entities defence stat to work out how much health is reduced from the target entity.

Starting Potency -100 (reduce health by 100 as a base)

Modification 1: Minus 30% of Originators Attack (100) (-100) - (30) = -130

Modification 2: Add 100% of Entity Defence (20)

(-100) - (30) + (20) = -110

The potency is decreased by 30% of the originator attack (negative value/decreased as effect is adjusting health) but then is then increased by 100% of the entity defence making it -110 adjusted health i.e 110 damage the target will receive.
{% endhint %}

## Subscribing to an Effect Event

Within each effect is a setting called 'Event Type' which determines what happens when activating and deactivating effects. “Standard” will run the normal code integrated with the ABC system. “RaiseEvent” will only invoke the event delegate and “Both” will raise the event and run the normal code.

If set to "Raise Event" then it is possible to subscribe to a character's [State Manager](../../state-manager/state-manager) component to get notification of effects when they are raised. This can also be achieved using the [Effect Subscriber](../../../introduction/api-and-integration-with-abc#effect-subscriber-component) Component.&#x20;

```csharp
    private void OnEnable() {
        //Record transform
        meTransform = transform;

        //Get Statemanger script
        if (playerStateManager == null)
            playerStateManager = meTransform.GetComponent<ABC_StateManager>();

        //Subscribe to event
        playerStateManager.onEffectActivation += EffectListener;   
    }

    private void EffectListener(Effect effect, ABC_IEntity Target, ABC_IEntity Originator) {
        switch (effect.effectName) {
            case "CustomEffect":
                //add custom effect here
                break;
        }
    }

    private void OnDisable() {
        //unsubscribe from event
        playerStateManager.onEffectActivation -= EffectListener;
    }
```

## Notable Settings

|        **Setting**              | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| :-----------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|           **Potency**           | The potency of the effect for example how much to adjust health by. This is the power/force/value behind the effect. Details on how potency is used for each effect can be found in the Ability Effects section.                                                                                                                                                                                                                                                                                                                                                                                         |
|         **Start Delay**         | The delay before the effect will be applied to the entity. Effects are added in order from top to bottom one by one from the effect list. Any delays will prolong the other effects which are applied after. For example if Effect 1 has a delay of 5 then effect 2 will be applied 5 seconds after Effect 1 has been applied.                                                                                                                                                                                                                                                                           |
|         **Effect Name**         | The name of the effect. This will be used later on by the system to determine which code to run when the effect is applied. This box will be autofilled with the same name as the dropdown option selected but can be modified with any text. If the effect name does not match any code then no effect will occur however the graphics etc will still play out.                                                                                                                                                                                                                                         |
|         **Activate On**         | Determines who the effects actions will be processed on. Although the effect is applied, activated and tracked against the entity hit. The actual effect actions/code can be setup to either run against the originator who activated the ability in the first place, the entity which had the effect applied or both simultaneously.                                                                                                                                                                                                                                                                    |
|      **Hit Stops Movement**     | If enabled then the entities movements will be stopped for a duration when the effect is successfully applied, this requires the “Hits Can Stop Movement” global setting to be enabled in the entities ABC [State Manager](../../state-manager/state-manager) component.                                                                                                                                                                                                                                                                                                                                 |
|    **Hit Prevent Activation**   | If enabled then the entities ability activation will be restricted for a duration when the effect is successfully applied, this requires the “Hits Can Prevent Activation” global setting to be enabled in the entities ABC [Controller Manager](../../controller-manager/controller-manger) Settings. Once ticked the following settings will appear:                                                                                                                                                                                                                                                   |
|        **Repeat Effect**        | <p>If enabled then the effects action will be repeated on the entity for a set duration every defined interval. The repeat effect action will stop early if the effect is removed from the entity even if it’s before the amount of times the effect is set to repeat.</p><p></p><p>For example it can be setup so an AdjustHealth effect will repeat every 2 seconds for the next 10 seconds, which will result in the entity taking damage every 2 seconds for a 10 second period during play this can simulate a burn effect from a fireball ability or a poison infliction from another ability.</p> |
|         **Graphic Log**         | <p>If enabled then text can be set which will display on the entity's Graphic Log when the effect is applied and activated. The graphic log can be setup in the entities ABC <a href="../../state-manager/state-manager">State Manage</a>r configuration.</p><p></p><p>The graphic log will show as an in game object rather than on the UI. An example of its use is to add damage bubbles which shows when an entity takes damage.</p>                                                                                                                                                                 |
| **Effect Ignore/Required Tags** | ABC or Unity tags can be defined which will tell the system to only apply the effect to any entity that has a matching tag or ignore and don't apply effects to an entity that has a tag .2 tick boxes can be ticked detailing what part of the entity is checked for tags:                                                                                                                                                                                                                                                                                                                              |

{% hint style="warning" %}
It is highly recommended to read the tooltips in the blue boxes for a full description on what each setting does&#x20;
{% endhint %}
