Class BuffEffect
It represents an effect that modifies statistics or adds new effects, temporarily.
Inheritance
Inherited Members
Namespace: AutoBattleFramework.Skills
Assembly: cs.temp.dll.dll
Syntax
public abstract class BuffEffect : IAttackEffect
Fields
duration
Duration of the buff, in seconds.
Declaration
public float duration
Field Value
Type | Description |
---|---|
Single |
maxStacks
If the buff is applied multiple times, the max number of the same effect that can be applied.
Declaration
public int maxStacks
Field Value
Type | Description |
---|---|
Int32 |
modificator
Modification of the stats and/or aggregation of new effects.
Declaration
public StatsModificator modificator
Field Value
Type | Description |
---|---|
StatsModificator |
RestartTimeWhenRepeated
If the buff is applied when it already exists, it should reset the time.
Declaration
public bool RestartTimeWhenRepeated
Field Value
Type | Description |
---|---|
Boolean |
Methods
AddModificator(BuffEffectInfo, StatsModificator)
Add the buff to the GameCharacter and applies its effects.
Declaration
protected void AddModificator(BuffEffectInfo info, StatsModificator modificator)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
StatsModificator | modificator | Temporal stats modificator. |
Attack(GameCharacter, Transform)
Applies the buff to the GameCharacter.
Declaration
public override void Attack(GameCharacter ai, Transform shootingPoint)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | ai | GameCharacter that will recieve the buff. |
Transform | shootingPoint | It should be null. |
Overrides
OnBuffEnd(BuffEffectInfo)
Method that is called once when the buff will end.
Declaration
protected abstract void OnBuffEnd(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
OnBuffStart(BuffEffectInfo)
Method that is called once when the buff will be applied.
Declaration
protected abstract void OnBuffStart(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
OnBuffUpdate(BuffEffectInfo)
Method that is called while the buff is applied.
Declaration
protected abstract void OnBuffUpdate(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
OnHit(GameCharacter)
When the buff hits, calls OnBuffStart(BuffEffectInfo).
Declaration
public override void OnHit(GameCharacter target)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | target | The target of the character or projectile. |
Overrides
OnRepeatedBuff(BuffEffectInfo)
Method that is called once when the buff is applied and there is another instance of the buff previously applied.
Declaration
protected abstract void OnRepeatedBuff(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
RemoveBuff(BuffEffectInfo)
Remove the buff from the GameCharacter and removes its effects.
Declaration
public void RemoveBuff(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
RemoveModificator(BuffEffectInfo, StatsModificator)
Remove the buff from the GameCharacter and removes its effects.
Declaration
protected void RemoveModificator(BuffEffectInfo info, StatsModificator modificator)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |
StatsModificator | modificator | Temporal stats modificator to be removed. |
UpdateBuff(BuffEffectInfo)
It checks that the buff is still active, updates the elapsed time and calls OnBuffEnd(BuffEffectInfo) and OnBuffUpdate(BuffEffectInfo) methods when the time is right.
Declaration
public void UpdateBuff(BuffEffectInfo info)
Parameters
Type | Name | Description |
---|---|---|
BuffEffectInfo | info | Buff information. |