protected override bool OnEffectStart(DynamicObject caster, DynamicObject affectedObject, float magnitude, float duration) { GameValuesContainer container = affectedObject.GetObjectScript <GameValuesContainer>(); if (byTime) { return(true); } return(container.ModifyValue(valueName, componentToModify, behavior, magnitude)); }
public override void OnEffectRemove(DynamicObject caster, DynamicObject target, float magnitude, float duration) { if (byTime) { return; } GameValuesContainer container = target.GetObjectScript <GameValuesContainer>(); if (container != null) { if (behavior == GameValueModifierBehavior.Multiply) { container.ModifyValue(valueName, componentToModify, behavior, 1f / magnitude); } else if (behavior == GameValueModifierBehavior.Add) { container.ModifyValue(valueName, componentToModify, behavior, -magnitude); } } }