Species Component (#130)
* Fix this fug oksure Creates the initial species component, damage states, and threshold templates and hooks them into the damageable component * More rebase fixes * test * Pre future rebase * Please * Lol * Lol2 * SHADERS * Update Engine * yml file * Fix an initialization issue, injects dependencies * Fix error in loading shaders * Makes a master character ui controller component added upon client attachment to entity and remove upon client detachment from entity * Fixes just about everytrhing * Address PJB's comments * geeze * Make overlays work in worldspace instead of screen space and not cover user interfaces * update submodule
This commit is contained in:
committed by
Pieter-Jan Briers
parent
b8becf4a56
commit
37df61113e
@@ -0,0 +1,47 @@
|
||||
using SS14.Shared.GameObjects.Systems;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public interface IActionBlocker
|
||||
{
|
||||
bool CanMove();
|
||||
|
||||
bool CanInteract();
|
||||
|
||||
bool CanUse();
|
||||
}
|
||||
|
||||
public class ActionBlockerSystem : EntitySystem
|
||||
{
|
||||
public static bool CanMove(IEntity entity)
|
||||
{
|
||||
bool canmove = true;
|
||||
foreach(var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canmove &= actionblockercomponents.CanMove(); //sets var to false if false
|
||||
}
|
||||
return canmove;
|
||||
}
|
||||
|
||||
public static bool CanInteract(IEntity entity)
|
||||
{
|
||||
bool caninteract = true;
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
caninteract &= actionblockercomponents.CanInteract();
|
||||
}
|
||||
return caninteract;
|
||||
}
|
||||
|
||||
public static bool CanUse(IEntity entity)
|
||||
{
|
||||
bool canuse = true;
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canuse &= actionblockercomponents.CanUse();
|
||||
}
|
||||
return canuse;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,10 +178,9 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
var item = hands.GetActiveHand?.Owner;
|
||||
|
||||
if (!MobCanInteract(player))
|
||||
if (!ActionBlockerSystem.CanInteract(player))
|
||||
return;
|
||||
//TODO: Mob status code that allows or rejects interactions based on current mob status
|
||||
//Check if client should be able to see that object to click on it in the first place, prevent using locaters by firing a laser or something
|
||||
//TODO: Check if client should be able to see that object to click on it in the first place, prevent using locaters by firing a laser or something
|
||||
|
||||
|
||||
//Clicked on empty space behavior, try using ranged attack
|
||||
@@ -239,15 +238,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO function for blocking activity based on mob status
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static bool MobCanInteract(IEntity user)
|
||||
{
|
||||
return true; //Hook into future planned mob status system
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// We didn't click on any entity, try doing an afterattack on the click location
|
||||
/// </summary>
|
||||
@@ -324,7 +314,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="used"></param>
|
||||
public static void TryUseInteraction(IEntity user, IEntity used)
|
||||
{
|
||||
if (user != null && used != null && MobCanInteract(user))
|
||||
if (user != null && used != null && ActionBlockerSystem.CanUse(user))
|
||||
{
|
||||
UseInteraction(user, used);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user