CollidableComponent and ICollideableComponent namespace was changed in the engine.
Minor code cleanup.
This commit is contained in:
@@ -5,7 +5,7 @@ using Content.Server.GameObjects.EntitySystems;
|
|||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Robust.Server.AI;
|
using Robust.Server.AI;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.Physics;
|
using Robust.Shared.Interfaces.Physics;
|
||||||
using Robust.Shared.Interfaces.Timing;
|
using Robust.Shared.Interfaces.Timing;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Content.Server.GameObjects.EntitySystems;
|
|||||||
using Content.Shared.GameObjects.Components.Doors;
|
using Content.Shared.GameObjects.Components.Doors;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.Network;
|
using Robust.Shared.Interfaces.Network;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ using Robust.Server.GameObjects;
|
|||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
|
||||||
using Robust.Shared.Interfaces.Network;
|
using Robust.Shared.Interfaces.Network;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
@@ -81,7 +81,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
|||||||
_userInterface.SetState(newState);
|
_userInterface.SetState(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MedicalScannerStatus GetStatusFromDamageState(DamageState damageState)
|
private MedicalScannerStatus GetStatusFromDamageState(IDamageState damageState)
|
||||||
{
|
{
|
||||||
switch (damageState)
|
switch (damageState)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Components.Mobs;
|
using Content.Shared.GameObjects.Components.Mobs;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects
|
namespace Content.Server.GameObjects
|
||||||
@@ -8,7 +9,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines the blocking effect of each damage state, and what effects to apply upon entering or exiting the state
|
/// Defines the blocking effect of each damage state, and what effects to apply upon entering or exiting the state
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface DamageState : IActionBlocker
|
public interface IDamageState : IActionBlocker
|
||||||
{
|
{
|
||||||
void EnterState(IEntity entity);
|
void EnterState(IEntity entity);
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Standard state that a species is at with no damage or negative effect
|
/// Standard state that a species is at with no damage or negative effect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct NormalState : DamageState
|
public struct NormalState : IDamageState
|
||||||
{
|
{
|
||||||
public void EnterState(IEntity entity)
|
public void EnterState(IEntity entity)
|
||||||
{
|
{
|
||||||
@@ -71,7 +72,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A state in which you are disabled from acting due to damage
|
/// A state in which you are disabled from acting due to damage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct CriticalState : DamageState
|
public struct CriticalState : IDamageState
|
||||||
{
|
{
|
||||||
public void EnterState(IEntity entity)
|
public void EnterState(IEntity entity)
|
||||||
{
|
{
|
||||||
@@ -122,7 +123,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A damage state which will allow ghosting out of mobs
|
/// A damage state which will allow ghosting out of mobs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct DeadState : DamageState
|
public struct DeadState : IDamageState
|
||||||
{
|
{
|
||||||
public void EnterState(IEntity entity)
|
public void EnterState(IEntity entity)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Map of ALL POSSIBLE damage states to the threshold enum value that will trigger them, normal state wont be triggered by this value but is a default that is fell back onto
|
/// Map of ALL POSSIBLE damage states to the threshold enum value that will trigger them, normal state wont be triggered by this value but is a default that is fell back onto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Dictionary<ThresholdType, DamageState> StateThresholdMap = new Dictionary<ThresholdType, DamageState>()
|
public static Dictionary<ThresholdType, IDamageState> StateThresholdMap = new Dictionary<ThresholdType, IDamageState>()
|
||||||
{
|
{
|
||||||
{ ThresholdType.None, new NormalState() },
|
{ ThresholdType.None, new NormalState() },
|
||||||
{ ThresholdType.Critical, new CriticalState() },
|
{ ThresholdType.Critical, new CriticalState() },
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Damagestates are reached by reaching a certain damage threshold, they will block actions after being reached
|
/// Damagestates are reached by reaching a certain damage threshold, they will block actions after being reached
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DamageState CurrentDamageState { get; private set; } = new NormalState();
|
public IDamageState CurrentDamageState { get; private set; } = new NormalState();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Damage state enum for current health, set only via change damage state //TODO: SETTER
|
/// Damage state enum for current health, set only via change damage state //TODO: SETTER
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Shared.GameObjects.Components.Movement;
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Components.Movement;
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
@@ -6,6 +6,7 @@ using Robust.Server.GameObjects;
|
|||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
using Robust.Shared.Interfaces.Random;
|
using Robust.Shared.Interfaces.Random;
|
||||||
|
|||||||
@@ -2,14 +2,11 @@
|
|||||||
using Content.Server.Interfaces.GameObjects.Components.Movement;
|
using Content.Server.Interfaces.GameObjects.Components.Movement;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
|
||||||
using Robust.Server.Interfaces.Player;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
|
||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
using Robust.Shared.Interfaces.Network;
|
using Robust.Shared.Interfaces.Network;
|
||||||
using Robust.Shared.Interfaces.Timing;
|
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
@@ -20,11 +17,12 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[ComponentReference(typeof(IMoverComponent))]
|
[ComponentReference(typeof(IMoverComponent))]
|
||||||
class ShuttleControllerComponent : Component, IMoverComponent
|
internal class ShuttleControllerComponent : Component, IMoverComponent
|
||||||
{
|
{
|
||||||
[Dependency] IMapManager mapManager;
|
#pragma warning disable 649
|
||||||
[Dependency] IEntityManager entityManager;
|
[Dependency] private readonly IMapManager _mapManager;
|
||||||
[Dependency] IGameTiming gameTiming;
|
[Dependency] private readonly IEntityManager _entityManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
private bool _movingUp;
|
private bool _movingUp;
|
||||||
private bool _movingDown;
|
private bool _movingDown;
|
||||||
@@ -37,7 +35,7 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
public float WalkMoveSpeed { get; set; } = 8;
|
public float WalkMoveSpeed { get; set; } = 8;
|
||||||
public float SprintMoveSpeed { get; set; }
|
public float SprintMoveSpeed { get; set; }
|
||||||
public bool Sprinting { get; set; }
|
public bool Sprinting { get; set; }
|
||||||
public Vector2 VelocityDir { get; }
|
public Vector2 VelocityDir { get; } = Vector2.Zero;
|
||||||
public GridCoordinates LastPosition { get; set; }
|
public GridCoordinates LastPosition { get; set; }
|
||||||
public float StepSoundDistance { get; set; }
|
public float StepSoundDistance { get; set; }
|
||||||
|
|
||||||
@@ -45,7 +43,7 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
{
|
{
|
||||||
var gridId = Owner.Transform.GridID;
|
var gridId = Owner.Transform.GridID;
|
||||||
|
|
||||||
if (mapManager.TryGetGrid(gridId, out var grid) && entityManager.TryGetEntity(grid.GridEntityId, out var gridEntity))
|
if (_mapManager.TryGetGrid(gridId, out var grid) && _entityManager.TryGetEntity(grid.GridEntityId, out var gridEntity))
|
||||||
{
|
{
|
||||||
//TODO: Switch to shuttle component
|
//TODO: Switch to shuttle component
|
||||||
if (!gridEntity.TryGetComponent(out PhysicsComponent physComp))
|
if (!gridEntity.TryGetComponent(out PhysicsComponent physComp))
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using Content.Server.GameObjects.Components.Mobs;
|
|||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ using Content.Shared.GameObjects;
|
|||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components
|
namespace Content.Server.GameObjects.Components
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
class ThrownItemComponent : ProjectileComponent, ICollideBehavior
|
internal class ThrownItemComponent : ProjectileComponent, ICollideBehavior
|
||||||
{
|
{
|
||||||
#pragma warning disable 649
|
#pragma warning disable 649
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
@@ -322,7 +323,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
if (userEntity.TryGetComponent(out CombatModeComponent combatMode) && combatMode.IsInCombatMode)
|
if (userEntity.TryGetComponent(out CombatModeComponent combatMode) && combatMode.IsInCombatMode)
|
||||||
{
|
{
|
||||||
DoAttack(userEntity, coords, uid);
|
DoAttack(userEntity, coords);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -747,7 +748,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoAttack(IEntity player, GridCoordinates coordinates, EntityUid uid)
|
private void DoAttack(IEntity player, GridCoordinates coordinates)
|
||||||
{
|
{
|
||||||
// Verify player is on the same map as the entity he clicked on
|
// Verify player is on the same map as the entity he clicked on
|
||||||
if (_mapManager.GetGrid(coordinates.GridID).ParentMapId != player.Transform.MapID)
|
if (_mapManager.GetGrid(coordinates.GridID).ParentMapId != player.Transform.MapID)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Robust.Server.GameObjects.EntitySystemMessages;
|
|||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
|||||||
Submodule RobustToolbox updated: 22bf1516cf...78a33076f9
Reference in New Issue
Block a user