Refactor ghost boo to ECS (#4511)

* Moved ghost boo to ecs

* Fixed small light exception

* No need to inject EM

* Moved cooldown and time to fields

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Alex Evgrashin
2021-08-31 11:33:55 +03:00
committed by GitHub
parent 4b4c8a41d7
commit 4c873e53f2
6 changed files with 82 additions and 69 deletions

View File

@@ -31,12 +31,11 @@ namespace Content.Server.Actions.Actions
var booCounter = 0;
foreach (var ent in ents)
{
var boos = ent.GetAllComponents<IGhostBooAffected>().ToList();
foreach (var boo in boos)
{
if (boo.AffectedByGhostBoo(args))
booCounter++;
}
var ghostBoo = new GhostBooEvent();
ent.EntityManager.EventBus.RaiseLocalEvent(ent.Uid, ghostBoo);
if (ghostBoo.Handled)
booCounter++;
if (booCounter >= _maxTargets)
break;