Exemple #1
0
 /// <summary>
 /// Apply a given status to a player.
 /// </summary>
 /// <param name="status">The status to apply to the player.</param>
 public bool ApplyStatus(ICreatureStatus status)
 {
     if (!_currentStatuses.TryAdd(status.Icon, status))
     {
         return(false);
     }
     if (this is User)
     {
         (this as User).SendStatusUpdate(status);
     }
     status.OnStart();
     UpdateAttributes(StatUpdateFlags.Full);
     return(true);
 }
Exemple #2
0
 /// <summary>
 /// Apply a given status to a player.
 /// </summary>
 /// <param name="status">The status to apply to the player.</param>
 public bool ApplyStatus(ICreatureStatus status, bool sendUpdates = true)
 {
     if (!_currentStatuses.TryAdd(status.Icon, status))
     {
         return(false);
     }
     if (this is User && sendUpdates)
     {
         (this as User).SendStatusUpdate(status);
     }
     status.OnStart(sendUpdates);
     if (sendUpdates)
     {
         UpdateAttributes(StatUpdateFlags.Full);
     }
     Game.World.EnqueueStatusCheck(this);
     return(true);
 }