Xeno improvements (#6032)
This commit is contained in:
@@ -18,34 +18,42 @@ namespace Content.Client.MobState
|
||||
private int? _originalDrawDepth;
|
||||
|
||||
[DataField("normal")]
|
||||
private string? normal;
|
||||
private string? _normal;
|
||||
|
||||
[DataField("crit")]
|
||||
private string? crit;
|
||||
private string? _crit;
|
||||
|
||||
[DataField("dead")]
|
||||
private string? dead;
|
||||
private string? _dead;
|
||||
|
||||
/// <summary>
|
||||
/// Should noRot be turned off when crit / dead.
|
||||
/// </summary>
|
||||
[DataField("rotate")]
|
||||
private bool _rotate;
|
||||
|
||||
void ISerializationHooks.BeforeSerialization()
|
||||
{
|
||||
_stateMap.TryGetValue(DamageState.Alive, out normal);
|
||||
_stateMap.TryGetValue(DamageState.Critical, out crit);
|
||||
_stateMap.TryGetValue(DamageState.Dead, out dead);
|
||||
_stateMap.TryGetValue(DamageState.Alive, out _normal);
|
||||
_stateMap.TryGetValue(DamageState.Critical, out _crit);
|
||||
_stateMap.TryGetValue(DamageState.Dead, out _dead);
|
||||
}
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
if (normal != null)
|
||||
if (_normal != null)
|
||||
{
|
||||
_stateMap.Add(DamageState.Alive, normal);
|
||||
_stateMap.Add(DamageState.Alive, _normal);
|
||||
}
|
||||
|
||||
if (crit != null)
|
||||
if (_crit != null)
|
||||
{
|
||||
_stateMap.Add(DamageState.Critical, crit);
|
||||
_stateMap.Add(DamageState.Critical, _crit);
|
||||
}
|
||||
|
||||
if (dead != null)
|
||||
if (_dead != null)
|
||||
{
|
||||
_stateMap.Add(DamageState.Dead, dead);
|
||||
_stateMap.Add(DamageState.Dead, _dead);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +73,16 @@ namespace Content.Client.MobState
|
||||
|
||||
_data = data;
|
||||
|
||||
if (_rotate)
|
||||
{
|
||||
sprite.NoRotation = data switch
|
||||
{
|
||||
DamageState.Critical => false,
|
||||
DamageState.Dead => false,
|
||||
_ => true
|
||||
};
|
||||
}
|
||||
|
||||
if (_stateMap.TryGetValue(_data, out var state))
|
||||
{
|
||||
sprite.LayerSetState(DamageStateVisualLayers.Base, state);
|
||||
|
||||
Reference in New Issue
Block a user