Мозговой Червь (#17)
* - add: Added Cortic Borer. * - fix: Removed unnecessary imports, unused fields, variables, methods. * - fix: Изменён принцип вселения: теперь не создаётся новый энтити с переходом разума, вместо этого хост хранит в себе контейнер для червя, в который последний и погружается * - fix: Убрано использование устаревших методов и полей, исправлена ошибка, из-за которой при вселении в носителя уровень сахара не проверялся * - fix: Изменено тестировочное значение добавления очков химикатов * - fix: Borer can't speak now * - fix: Some bug and shitcode fixes * - fix: Some bug and shitcode fixes * - fix: Added cooldown after releasing the humanoid's body * - fix: fix * - add: Added russian localization * - add: Убрал использование метода _chatManager.ChatMessageToOne в некоторых местах, т.к. popup включает в себя вывод сообщения в чат. * - fix: fix * - fix: fix
This commit is contained in:
28
Content.Server/Borer/ServerBorerHostSystem.cs
Normal file
28
Content.Server/Borer/ServerBorerHostSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Content.Shared.Borer;
|
||||
using Content.Shared.Mobs;
|
||||
using Robust.Server.Containers;
|
||||
|
||||
namespace Content.Server.Borer;
|
||||
|
||||
|
||||
public sealed class ServerBorerHostSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private ServerBorerSystem _borerSystem = default!;
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<BorerHostComponent, MobStateChangedEvent>(OnDamageChanged);
|
||||
}
|
||||
|
||||
private void OnDamageChanged(EntityUid uid, BorerHostComponent component, MobStateChangedEvent args)
|
||||
{
|
||||
if (args.NewMobState == MobState.Critical)
|
||||
{
|
||||
RaiseLocalEvent(uid, new BorerBrainReleaseEvent(), true);
|
||||
}
|
||||
else if (args.NewMobState == MobState.Dead)
|
||||
{
|
||||
_borerSystem.GetOut(component.BorerContainer.ContainedEntities[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user