/// Creates a clone of this effect public object clone() { AbilityEffect copy = MemberwiseClone() as AbilityEffect; if (AnimationAsset != null) { copy.AnimationAsset = AnimationAsset.clone() as GameAsset <SpriteAnimation>; } return(copy); }
/// Attaches a new instance of this effect /// to the passed creature public void attach(Creature user, Creature victim) { AbilityEffect copy = clone() as AbilityEffect; copy.User = user; copy.Victim = victim; copy.CurrentTurn = 1; copy.IsActive = true; copy.MaxTurns = user.RNG.Next(TurnsToLast.X, TurnsToLast.Y + 1); victim.Effects.Add(copy); copy.apply(); // affects are applied once when attached (TODO test) }