/// <summary> /// Called when the effect is meant to be deactivated /// </summary> public override void Deactivate() { if (mMessage != null) { if (ResetOnDeactivate) { float lCurrentValue = mActorCore.AttributeSource.GetAttributeValue <float>(mMessage.AttributeID); mActorCore.AttributeSource.SetAttributeValue(mMessage.AttributeID, lCurrentValue - mChange); } mMessage.Release(); mMessage = null; } base.Deactivate(); }
/// <summary> /// Sets the message that will be run each time damage should be processed /// </summary> /// <param name="rMessage">Message containing information about the damage</param> /// <param name="rTriggerDelay">Time in seconds between triggering</param> /// <param name="rMaxAge">Max amount of time the effect can last</param> public void Activate(float rTriggerDelay, float rMaxAge, AttributeMessageOld rMessage) { mChange = 0f; mMessage = rMessage; base.Activate(rTriggerDelay, rMaxAge); }