Merge branch 'master' into 2020-08-19-firelocks

This commit is contained in:
Víctor Aguilera Puerto
2020-09-09 22:12:38 +02:00
committed by GitHub
21 changed files with 488 additions and 154 deletions

View File

@@ -260,6 +260,10 @@ namespace Content.Shared.GameObjects.Components.Mobs
public bool CanUnequip() => (!Stunned);
public bool CanChangeDirection() => true;
public bool CanShiver() => !Stunned;
public bool CanSweat() => true;
#endregion
[ViewVariables]

View File

@@ -69,5 +69,8 @@ namespace Content.Shared.GameObjects.Components.Mobs.State
{
return false;
}
public bool CanShiver() => false;
public bool CanSweat() => false;
}
}

View File

@@ -17,6 +17,8 @@ namespace Content.Shared.GameObjects.Components.Observer
public bool CanPickup() => false;
public bool CanEmote() => false;
public bool CanAttack() => false;
public bool CanShiver() => false;
public bool CanSweat() => false;
}
[Serializable, NetSerializable]

View File

@@ -1,4 +1,5 @@
using Robust.Shared.GameObjects.Systems;
using System.Linq;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.EntitySystems
@@ -24,6 +25,9 @@ namespace Content.Shared.GameObjects.EntitySystems
bool CanUnequip() => true;
bool CanChangeDirection() => true;
bool CanShiver() => true;
bool CanSweat() => true;
}
/// <summary>
@@ -35,10 +39,11 @@ namespace Content.Shared.GameObjects.EntitySystems
public static bool CanMove(IEntity entity)
{
bool canmove = true;
foreach(var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canmove &= actionblockercomponents.CanMove(); // Sets var to false if false
}
return canmove;
}
@@ -49,6 +54,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
caninteract &= actionblockercomponents.CanInteract();
}
return caninteract;
}
@@ -59,6 +65,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canuse &= actionblockercomponents.CanUse();
}
return canuse;
}
@@ -69,6 +76,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canthrow &= actionblockercomponents.CanThrow();
}
return canthrow;
}
@@ -79,6 +87,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canspeak &= actionblockercomponents.CanSpeak();
}
return canspeak;
}
@@ -89,8 +98,9 @@ namespace Content.Shared.GameObjects.EntitySystems
{
candrop &= actionblockercomponents.CanDrop();
}
return candrop;
}
}
public static bool CanPickup(IEntity entity)
{
@@ -99,6 +109,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canpickup &= actionblockercomponents.CanPickup();
}
return canpickup;
}
@@ -161,5 +172,25 @@ namespace Content.Shared.GameObjects.EntitySystems
return canchangedirection;
}
public static bool CanShiver(IEntity entity)
{
var canShiver = true;
foreach (var component in entity.GetAllComponents<IActionBlocker>())
{
canShiver &= component.CanShiver();
}
return canShiver;
}
public static bool CanSweat(IEntity entity)
{
var canSweat = true;
foreach (var component in entity.GetAllComponents<IActionBlocker>())
{
canSweat &= component.CanSweat();
}
return canSweat;
}
}
}