This commit is contained in:
2026-04-25 23:37:10 +02:00
commit 19d6bd934a
476 changed files with 9198 additions and 0 deletions
@@ -0,0 +1,38 @@
using RPGCore.BackpackEquipment.ObjectModules.Content.Events;
using RPGCore.BackpackEquipment.Objects;
using RPGCore.ObjectModules.ActionObjectModule;
namespace RPGCore.BackpackEquipment.ObjectModules.Content.Actions
{
public class DropAction : BaseAction
{
private readonly ItemObject _item;
public DropAction(ItemObject item)
{
_item = item;
}
public override void CanDoIt()
{
}
protected override void OnDoIt()
{
var dropEvent = new DropEvent { unit = unit, item = _item };
unit.events.InvokeBefore(dropEvent);
Check(!dropEvent.isPrevented, string.Format(ActionWasPreventedMessage, nameof(DropAction)));
unit.events.InvokeAfter(dropEvent);
unit.GetComponent<ContentModule>().Remove(_item);
}
protected override void OnEndIt()
{
}
protected override void OnCancelIt()
{
}
}
}