Add more spell effects
This commit is contained in:
@@ -33,5 +33,7 @@ public enum UsableItemTag
|
||||
Clone,
|
||||
MeltAllEquipment,
|
||||
RestoreStats,
|
||||
GlueAllEquipment
|
||||
GlueAllEquipment,
|
||||
DoubleStackedItems,
|
||||
IdentifyRandomItem
|
||||
}
|
||||
|
||||
@@ -1,16 +1,38 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Chickensoft.Serialization;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
[Meta, Id("rescued_items")]
|
||||
public partial class RescuedItemDatabase
|
||||
public class RescuedItemDatabase
|
||||
{
|
||||
[Save("rescued_item_list")]
|
||||
public List<IBaseInventoryItem> Items { get; init; }
|
||||
private List<IBaseInventoryItem> _items { get; init; }
|
||||
private int _maxSize { get; init; } = 20;
|
||||
|
||||
public RescuedItemDatabase()
|
||||
public RescuedItemDatabase(int maxSize)
|
||||
{
|
||||
Items = new List<IBaseInventoryItem>();
|
||||
_items = [];
|
||||
_maxSize = maxSize;
|
||||
}
|
||||
|
||||
public RescuedItemDatabase(List<IBaseInventoryItem> items, int maxSize)
|
||||
{
|
||||
_items = items;
|
||||
_maxSize = maxSize;
|
||||
}
|
||||
|
||||
public bool TryAdd(IBaseInventoryItem item)
|
||||
{
|
||||
if (_items.Count >= _maxSize)
|
||||
return false;
|
||||
if (item is IEquipableItem equipable)
|
||||
equipable.Glued = false;
|
||||
_items.Add(item);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Remove(IBaseInventoryItem item) => _items.Remove(item);
|
||||
|
||||
public List<IBaseInventoryItem> GetItems() => _items;
|
||||
|
||||
public void Clear() => _items.Clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user