Data Rework Content Edition (#82)
* WiP Data Rework. * Convert stationstation to new map format. * stationstation.yml v2 * Update submodule
This commit is contained in:
committed by
GitHub
parent
8c874c76dc
commit
b34591ab59
@@ -7,13 +7,13 @@ using SS14.Client.UserInterface.Controls;
|
||||
using SS14.Client.UserInterface.CustomControls;
|
||||
using SS14.Shared.ContentPack;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Input;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Log;
|
||||
using SS14.Shared.Maths;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -37,7 +37,7 @@ namespace Content.Client.GameObjects
|
||||
Window.Dispose();
|
||||
}
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using SS14.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Shared.GameObjects;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -35,13 +36,16 @@ namespace Content.Server.GameObjects
|
||||
|
||||
public event EventHandler<DamageThresholdPassedEventArgs> DamageThresholdPassed;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
if (mapping.TryGetNode("resistanceset", out YamlNode node))
|
||||
base.ExposeData(serializer);
|
||||
|
||||
// TODO: Writing.
|
||||
serializer.DataReadFunction("resistanceset", "honk", name =>
|
||||
{
|
||||
Resistances = ResistanceSet.GetResistanceSet(node.AsString());
|
||||
}
|
||||
Resistances = ResistanceSet.GetResistanceSet(name);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -6,7 +6,7 @@ using SS14.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Shared.GameObjects;
|
||||
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -27,26 +27,22 @@ namespace Content.Server.GameObjects
|
||||
/// </summary>
|
||||
public DamageThreshold Threshold { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
//TODO currently only supports one threshold pair; gotta figure out YAML better
|
||||
base.ExposeData(serializer);
|
||||
|
||||
YamlNode node;
|
||||
|
||||
DamageType damageType = DamageType.Total;
|
||||
int damageValue = 0;
|
||||
|
||||
if (mapping.TryGetNode("thresholdtype", out node))
|
||||
// TODO: Writing
|
||||
if (serializer.Reading)
|
||||
{
|
||||
damageType = node.AsEnum<DamageType>();
|
||||
}
|
||||
if (mapping.TryGetNode("thresholdvalue", out node))
|
||||
{
|
||||
damageValue = node.AsInt();
|
||||
}
|
||||
DamageType damageType = DamageType.Total;
|
||||
int damageValue = 0;
|
||||
|
||||
Threshold = new DamageThreshold(damageType, damageValue);
|
||||
serializer.DataReadFunction("thresholdtype", DamageType.Total, type => damageType = type);
|
||||
serializer.DataReadFunction("thresholdvalue", 0, val => damageValue = val);
|
||||
|
||||
Threshold = new DamageThreshold(damageType, damageValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -3,13 +3,13 @@ using Content.Server.Interfaces.GameObjects;
|
||||
using Content.Shared.GameObjects;
|
||||
using SS14.Server.GameObjects;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects.Components;
|
||||
using SS14.Shared.Log;
|
||||
using SS14.Shared.Maths;
|
||||
using SS14.Shared.IoC;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace Content.Server.GameObjects
|
||||
private string OpenSprite;
|
||||
private string CloseSprite;
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventory
|
||||
using static Content.Shared.GameObjects.SharedInventoryComponent.ServerInventoryMessage;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Server.Interfaces.Player;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.ContentPack;
|
||||
using System.Linq;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -22,12 +22,15 @@ namespace Content.Server.GameObjects
|
||||
private Dictionary<Slots, ContainerSlot> SlotContainers = new Dictionary<Slots, ContainerSlot>();
|
||||
string TemplateName = "HumanInventory"; //stored for serialization purposes
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref TemplateName, "Template", "HumanInventory");
|
||||
CreateInventory(TemplateName);
|
||||
if (serializer.Reading)
|
||||
{
|
||||
CreateInventory(TemplateName);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateInventory(string TemplateName)
|
||||
|
||||
@@ -8,11 +8,11 @@ using SS14.Server.GameObjects;
|
||||
using SS14.Server.GameObjects.Components.Container;
|
||||
using SS14.Server.Interfaces.Player;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Input;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -45,10 +45,11 @@ namespace Content.Server.GameObjects
|
||||
private InputCommand DropCommand;
|
||||
private InputCommand ActivateItemInHandCommand;
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
// TODO: This does not serialize what objects are held.
|
||||
serializer.DataField(ref orderedHands, "hands", new List<string>(0));
|
||||
if (serializer.Reading)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
@@ -9,16 +10,20 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
/// <summary>
|
||||
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
|
||||
/// </summary>
|
||||
public float SpeedModifier { get; set; } = 1;
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public float SpeedModifier
|
||||
{
|
||||
if (mapping.TryGetNode("Speed", out YamlNode node))
|
||||
{
|
||||
SpeedModifier = node.AsFloat();
|
||||
}
|
||||
get => _speedModifier;
|
||||
set => _speedModifier = value;
|
||||
}
|
||||
|
||||
private float _speedModifier = 1;
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _speedModifier, "Speed", 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Status modifier which determines whether or not we can act as a tool at this time
|
||||
/// </summary>
|
||||
|
||||
@@ -4,6 +4,7 @@ using SS14.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using SS14.Server.GameObjects;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
{
|
||||
@@ -19,12 +20,22 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
/// <summary>
|
||||
/// Maximum fuel capacity the welder can hold
|
||||
/// </summary>
|
||||
public float FuelCapacity { get; set; } = 50;
|
||||
public float FuelCapacity
|
||||
{
|
||||
get => _fuelCapacity;
|
||||
set => _fuelCapacity = value;
|
||||
}
|
||||
private float _fuelCapacity = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Fuel the welder has to do tasks
|
||||
/// </summary>
|
||||
public float Fuel { get; set; } = 0;
|
||||
public float Fuel
|
||||
{
|
||||
get => _fuel;
|
||||
set => _fuel = value;
|
||||
}
|
||||
private float _fuel = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Default Cost of using the welder fuel for an action
|
||||
@@ -51,33 +62,12 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
spriteComponent = Owner.GetComponent<SpriteComponent>();
|
||||
}
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.LoadParameters(mapping);
|
||||
base.ExposeData(serializer);
|
||||
|
||||
if (mapping.TryGetNode("Capacity", out YamlNode node))
|
||||
{
|
||||
FuelCapacity = node.AsFloat();
|
||||
}
|
||||
|
||||
//if (mapping.TryGetNode("On", out node))
|
||||
//{
|
||||
// OnSprite = node.AsString();
|
||||
//}
|
||||
|
||||
//if (mapping.TryGetNode("Off", out node))
|
||||
//{
|
||||
// OffSprite = node.AsString();
|
||||
//}
|
||||
|
||||
if (mapping.TryGetNode("Fuel", out node))
|
||||
{
|
||||
Fuel = node.AsFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
Fuel = FuelCapacity;
|
||||
}
|
||||
serializer.DataField(ref _fuelCapacity, "Capacity", 50);
|
||||
serializer.DataField(ref _fuel, "Fuel", FuelCapacity);
|
||||
}
|
||||
|
||||
public void OnUpdate(float frameTime)
|
||||
@@ -142,7 +132,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
|
||||
string IExamine.Examine()
|
||||
{
|
||||
if(Activated)
|
||||
if (Activated)
|
||||
{
|
||||
return "The welding tool is currently lit";
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -14,16 +14,18 @@ namespace Content.Server.GameObjects
|
||||
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required
|
||||
private List<string> slotstrings = new List<string>(); //serialization
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref slotstrings, "Slots", new List<string>(0));
|
||||
|
||||
foreach(var slotflagsloaded in slotstrings)
|
||||
// TODO: Writing.
|
||||
serializer.DataReadFunction("Slots", new List<string>(0), list =>
|
||||
{
|
||||
SlotFlags |= (SlotFlags)Enum.Parse(typeof(SlotFlags), slotflagsloaded.ToUpper());
|
||||
}
|
||||
foreach (var slotflagsloaded in slotstrings)
|
||||
{
|
||||
SlotFlags |= (SlotFlags)Enum.Parse(typeof(SlotFlags), slotflagsloaded.ToUpper());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ using SS14.Server.Interfaces.Player;
|
||||
using SS14.Server.Player;
|
||||
using SS14.Shared.Enums;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Log;
|
||||
using SS14.Shared.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects
|
||||
storage = ContainerManagerComponent.Create<Container>("storagebase", Owner);
|
||||
}
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using SS14.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -14,7 +14,7 @@ namespace Content.Server.GameObjects
|
||||
|
||||
public int ObjectSize = 0;
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using SS14.Server.GameObjects;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -21,7 +22,12 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// <summary>
|
||||
/// The method of draw we will try to use to place our load set via component parameter, defaults to using power providers
|
||||
/// </summary>
|
||||
public virtual DrawTypes DrawType { get; protected set; } = DrawTypes.Provider;
|
||||
public virtual DrawTypes DrawType
|
||||
{
|
||||
get => _drawType;
|
||||
protected set => _drawType = value;
|
||||
}
|
||||
private DrawTypes _drawType = DrawTypes.Provider;
|
||||
|
||||
/// <summary>
|
||||
/// The power draw method we are currently connected to and using
|
||||
@@ -62,8 +68,12 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// <summary>
|
||||
/// Priority for powernet draw, lower will draw first, defined in powernet.cs
|
||||
/// </summary>
|
||||
public virtual Powernet.Priority Priority { get; protected set; } = Powernet.Priority.Medium;
|
||||
|
||||
public virtual Powernet.Priority Priority
|
||||
{
|
||||
get => _priority;
|
||||
protected set => _priority = value;
|
||||
}
|
||||
private Powernet.Priority _priority = Powernet.Priority.Medium;
|
||||
|
||||
private float _load = 100; //arbitrary magic number to start
|
||||
/// <summary>
|
||||
@@ -152,20 +162,13 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
base.Shutdown();
|
||||
}
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
if (mapping.TryGetNode("drawtype", out YamlNode node))
|
||||
{
|
||||
DrawType = node.AsEnum<DrawTypes>();
|
||||
}
|
||||
if (mapping.TryGetNode("load", out node))
|
||||
{
|
||||
Load = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("priority", out node))
|
||||
{
|
||||
Priority = node.AsEnum<Powernet.Priority>();
|
||||
}
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _drawType, "drawtype", DrawTypes.Provider);
|
||||
serializer.DataField(ref _load, "load", 100);
|
||||
serializer.DataField(ref _priority, "priority", Powernet.Priority.Medium);
|
||||
}
|
||||
|
||||
string IExamine.Examine()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Log;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using System;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
@@ -25,12 +26,11 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
set { UpdateSupply(value); }
|
||||
}
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
if (mapping.TryGetNode("supply", out YamlNode node))
|
||||
{
|
||||
Supply = node.AsFloat();
|
||||
}
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _supply, "supply", 1000);
|
||||
}
|
||||
|
||||
public override void OnAdd()
|
||||
|
||||
@@ -3,6 +3,7 @@ using SS14.Server.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Log;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -24,7 +25,12 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// <summary>
|
||||
/// Variable that determines the range that the power provider will try to supply power to
|
||||
/// </summary>
|
||||
public int PowerRange { get; private set; } = 0;
|
||||
public int PowerRange
|
||||
{
|
||||
get => _range;
|
||||
private set => _range = value;
|
||||
}
|
||||
private int _range = 0;
|
||||
|
||||
/// <summary>
|
||||
/// List storing all the power devices that we are currently providing power to
|
||||
@@ -56,16 +62,11 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
AdvertisedDevices.Clear();
|
||||
}
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
if (mapping.TryGetNode("range", out YamlNode node))
|
||||
{
|
||||
PowerRange = node.AsInt();
|
||||
}
|
||||
if (mapping.TryGetNode("priority", out node))
|
||||
{
|
||||
Priority = node.AsEnum<Powernet.Priority>();
|
||||
}
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _range, "range", 0);
|
||||
}
|
||||
|
||||
internal override void ProcessInternalPower(float frametime)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Serialization;
|
||||
using SS14.Shared.Utility;
|
||||
using System;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
@@ -22,25 +23,29 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// Maximum amount of energy the internal battery can store.
|
||||
/// In Joules.
|
||||
/// </summary>
|
||||
public float Capacity { get; private set; } = 10000; //arbitrary value replace
|
||||
public float Capacity => _capacity;
|
||||
private float _capacity = 10000; // Arbitrary value, replace.
|
||||
|
||||
/// <summary>
|
||||
/// Energy the battery is currently storing.
|
||||
/// In Joules.
|
||||
/// </summary>
|
||||
public float Charge { get; private set; } = 0;
|
||||
public float Charge => _charge;
|
||||
private float _charge = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Rate at which energy will be taken to charge internal battery.
|
||||
/// In Watts.
|
||||
/// </summary>
|
||||
public float ChargeRate { get; private set; } = 1000;
|
||||
public float ChargeRate => _chargeRate;
|
||||
private float _chargeRate = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Rate at which energy will be distributed to the powernet if needed.
|
||||
/// In Watts.
|
||||
/// </summary>
|
||||
public float DistributionRate { get; private set; } = 1000;
|
||||
public float DistributionRate => _distributionRate;
|
||||
private float _distributionRate = 1000;
|
||||
|
||||
public bool Full => Charge >= Capacity;
|
||||
|
||||
@@ -63,29 +68,15 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
if (mapping.TryGetNode("capacity", out YamlNode node))
|
||||
{
|
||||
Capacity = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("charge", out node))
|
||||
{
|
||||
Charge = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("chargerate", out node))
|
||||
{
|
||||
ChargeRate = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("distributionrate", out node))
|
||||
{
|
||||
DistributionRate = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("chargepowernet", out node))
|
||||
{
|
||||
_chargepowernet = node.AsBool();
|
||||
}
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _capacity, "capacity", 10000);
|
||||
serializer.DataField(ref _charge, "charge", 0);
|
||||
serializer.DataField(ref _chargeRate, "chargerate", 1000);
|
||||
serializer.DataField(ref _distributionRate, "distributionrate", 1000);
|
||||
serializer.DataField(ref _chargepowernet, "chargepowernet", false);
|
||||
}
|
||||
|
||||
public override void OnAdd()
|
||||
@@ -134,14 +125,14 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// </summary>
|
||||
public void DeductCharge(float todeduct)
|
||||
{
|
||||
Charge = Math.Max(0, Charge - todeduct);
|
||||
_charge = Math.Max(0, Charge - todeduct);
|
||||
LastChargeState = ChargeState.Discharging;
|
||||
LastChargeStateChange = DateTime.Now;
|
||||
}
|
||||
|
||||
public void AddCharge(float charge)
|
||||
{
|
||||
Charge = Math.Min(Capacity, Charge + charge);
|
||||
_charge = Math.Min(Capacity, Charge + charge);
|
||||
LastChargeState = ChargeState.Charging;
|
||||
LastChargeStateChange = DateTime.Now;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using Content.Shared.GameObjects;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -29,19 +30,12 @@ namespace Content.Server.GameObjects
|
||||
|
||||
float _secondsSinceLastDamageUpdate = 0;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void LoadParameters(YamlMappingNode mapping)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
YamlNode node;
|
||||
base.ExposeData(serializer);
|
||||
|
||||
if (mapping.TryGetNode("firedamagethreshold", out node))
|
||||
{
|
||||
_fireDamageThreshold = node.AsFloat();
|
||||
}
|
||||
if (mapping.TryGetNode("firedamagecoefficient", out node))
|
||||
{
|
||||
_fireDamageCoefficient = node.AsFloat();
|
||||
}
|
||||
serializer.DataField(ref _fireDamageThreshold, "firedamagethreshold", 0);
|
||||
serializer.DataField(ref _fireDamageCoefficient, "firedamagecoefficient", 1);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.GameObjects.Serialization;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Map;
|
||||
@@ -10,6 +9,7 @@ using SS14.Shared.Maths;
|
||||
using SS14.Server.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Timing;
|
||||
using SS14.Shared.GameObjects.EntitySystemMessages;
|
||||
using SS14.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
{
|
||||
@@ -21,14 +21,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
public float Range = 1;
|
||||
public float ArcWidth = 90;
|
||||
|
||||
public override void ExposeData(EntitySerializer serializer)
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref Damage, "damage", 5);
|
||||
serializer.DataField(ref Range, "damage", 1);
|
||||
serializer.DataField(ref ArcWidth, "damage", 90);
|
||||
|
||||
serializer.DataField(ref Range, "range", 1);
|
||||
serializer.DataField(ref ArcWidth, "arcwidth", 90);
|
||||
}
|
||||
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
engine
2
engine
Submodule engine updated: 5c2bd4049c...bceda76bf8
Reference in New Issue
Block a user