[#13] poprawki i wyrzucenie predefiniowanych statusów
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RPGCore.Core;
|
||||
using RPGCore.Core.Objects;
|
||||
using RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Effects;
|
||||
using RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Events;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -21,12 +20,6 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
internal List<Status> statuses { get; private set; } = new();
|
||||
[SerializeField] internal StatusUpdateType updateType;
|
||||
|
||||
/// <summary>Checks if any <see cref="Status"/> has <see cref="NotControllableEffect"/>.</summary>
|
||||
public virtual bool IsControllable()
|
||||
{
|
||||
return !statuses.Any(status => status.definition.effects.Any(effect => effect is NotControllableEffect));
|
||||
}
|
||||
|
||||
/// <summary>Checks if any active <see cref="Status"/> that uses <see cref="StatusDefinitionSO"/> is present.</summary>
|
||||
public bool Check(StatusDefinitionSO definition)
|
||||
{
|
||||
@@ -34,12 +27,12 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
}
|
||||
|
||||
/// <summary>Adds new <see cref="Status"/>.</summary>
|
||||
public Status Apply(StatusDefinitionSO definition)
|
||||
public Status Apply(StatusDefinitionSO definition, BaseObject source = null)
|
||||
{
|
||||
var status = new Status(definition, this);
|
||||
var status = new Status(definition, this, source);
|
||||
statuses.Add(status);
|
||||
status.OnApply_Internal();
|
||||
parent.events.Invoke(new StatusStartEvent { status = status, target = parent });
|
||||
parent.events.Invoke(new StatusStartEvent { status = status, target = parent, source = source });
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user