Merge branch 'master' into 2020-05-18-midi
This commit is contained in:
@@ -22,6 +22,9 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
bool CanEmote() => true;
|
||||
|
||||
bool CanAttack() => true;
|
||||
bool CanEquip() => true;
|
||||
bool CanUnequip() => true;
|
||||
bool CanChangeDirection() => true;
|
||||
}
|
||||
|
||||
public class ActionBlockerSystem : EntitySystem
|
||||
@@ -119,5 +122,41 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
return canattack;
|
||||
}
|
||||
|
||||
public static bool CanEquip(IEntity entity)
|
||||
{
|
||||
bool canequip = true;
|
||||
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canequip &= actionblockercomponents.CanEquip();
|
||||
}
|
||||
|
||||
return canequip;
|
||||
}
|
||||
|
||||
public static bool CanUnequip(IEntity entity)
|
||||
{
|
||||
bool canunequip = true;
|
||||
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canunequip &= actionblockercomponents.CanUnequip();
|
||||
}
|
||||
|
||||
return canunequip;
|
||||
}
|
||||
|
||||
public static bool CanChangeDirection(IEntity entity)
|
||||
{
|
||||
bool canchangedirection = true;
|
||||
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canchangedirection &= actionblockercomponents.CanChangeDirection();
|
||||
}
|
||||
|
||||
return canchangedirection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,13 +451,14 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
var item = hands.GetActiveHand?.Owner;
|
||||
|
||||
if(ActionBlockerSystem.CanChangeDirection(player))
|
||||
playerTransform.LocalRotation = new Angle(coordinates.ToMapPos(_mapManager) - playerTransform.MapPosition.Position);
|
||||
|
||||
if (!ActionBlockerSystem.CanInteract(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
playerTransform.LocalRotation = new Angle(coordinates.ToMapPos(_mapManager) - playerTransform.MapPosition.Position);
|
||||
|
||||
// TODO: Check if client should be able to see that object to click on it in the first place
|
||||
|
||||
// Clicked on empty space behavior, try using ranged attack
|
||||
|
||||
28
Content.Server/GameObjects/EntitySystems/StunSystem.cs
Normal file
28
Content.Server/GameObjects/EntitySystems/StunSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class StunSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
EntityQuery = new TypeEntityQuery(typeof(StunnableComponent));
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
foreach (var entity in RelevantEntities)
|
||||
{
|
||||
entity.GetComponent<StunnableComponent>().Update(frameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user