Unstable 0.17.0.0
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Barotrauma.Items.Components
|
||||
public Vector2 Offset;
|
||||
public float Size;
|
||||
|
||||
public PlantSlot(XElement element)
|
||||
public PlantSlot(ContentXElement element)
|
||||
{
|
||||
Offset = element.GetAttributeVector2("offset", Vector2.Zero);
|
||||
Size = element.GetAttributeFloat("size", 0.5f);
|
||||
@@ -64,14 +64,14 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private float fertilizer;
|
||||
|
||||
[Serialize(0f, true, "How much fertilizer the planter has.")]
|
||||
[Serialize(0f, IsPropertySaveable.Yes, "How much fertilizer the planter has.")]
|
||||
public float Fertilizer
|
||||
{
|
||||
get => fertilizer;
|
||||
set => fertilizer = Math.Clamp(value, 0, FertilizerCapacity);
|
||||
}
|
||||
|
||||
[Serialize(100f, true, "How much fertilizer can the planter hold.")]
|
||||
[Serialize(100f, IsPropertySaveable.Yes, "How much fertilizer can the planter hold.")]
|
||||
public float FertilizerCapacity { get; set; }
|
||||
|
||||
public Growable?[] GrowableSeeds = new Growable?[0];
|
||||
@@ -81,11 +81,11 @@ namespace Barotrauma.Items.Components
|
||||
private ItemContainer? container;
|
||||
private float growthTickTimer;
|
||||
|
||||
public Planter(Item item, XElement element) : base(item, element)
|
||||
public Planter(Item item, ContentXElement element) : base(item, element)
|
||||
{
|
||||
canBePicked = true;
|
||||
SerializableProperty.DeserializeProperties(this, element);
|
||||
foreach (XElement subElement in element.Elements())
|
||||
foreach (var subElement in element.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
{
|
||||
@@ -117,7 +117,7 @@ namespace Barotrauma.Items.Components
|
||||
GrowableSeeds = new Growable[container.Capacity];
|
||||
}
|
||||
|
||||
public override bool HasRequiredItems(Character character, bool addMessage, string? msg = null)
|
||||
public override bool HasRequiredItems(Character character, bool addMessage, LocalizedString? msg = null)
|
||||
{
|
||||
if (container?.Inventory == null) { return false; }
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Barotrauma.Items.Components
|
||||
if (!anyDecayed || seed.Decayed || seed.FullyGrown)
|
||||
{
|
||||
container?.Inventory.RemoveItem(seed.Item);
|
||||
Entity.Spawner?.AddToRemoveQueue(seed.Item);
|
||||
Entity.Spawner?.AddItemToRemoveQueue(seed.Item);
|
||||
GrowableSeeds[i] = null;
|
||||
ApplyStatusEffects(ActionType.OnPicked, 1.0f, character);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user