Make component states dependant on the player getting them (#3280)
* Make component states dependant on the player getting them Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> * Updated submodule to v0.3.7. Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: Acruid <shatter66@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Actions;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -76,7 +77,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
}
|
||||
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new ActionComponentState(_actions, _itemActions);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Alert;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
_alerts = state.Alerts;
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new AlertsComponentState(_alerts);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -47,7 +48,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
}
|
||||
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new CombatModeComponentState(IsInCombatMode, ActiveZone);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -49,7 +50,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new HumanoidAppearanceComponentState(Appearance, Sex, Gender);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Content.Shared.Alert;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -28,6 +29,7 @@ namespace Content.Shared.GameObjects.Components.Mobs.State
|
||||
/// States that this <see cref="SharedMobStateComponent"/> mapped to
|
||||
/// the amount of damage at which they are triggered.
|
||||
/// A threshold is reached when the total damage of an entity is equal
|
||||
/// A threshold is reached when the total damage of an entity is equal
|
||||
/// to or higher than the int key, but lower than the next threshold.
|
||||
/// Ordered from lowest to highest.
|
||||
/// </summary>
|
||||
@@ -75,7 +77,7 @@ namespace Content.Shared.GameObjects.Components.Mobs.State
|
||||
base.OnRemove();
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new MobStateComponentState(CurrentThreshold);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user