Hunger ECS (#14939)

This commit is contained in:
Nemanja
2023-04-02 22:42:30 -04:00
committed by GitHub
parent 19277a2276
commit 0f0b534239
14 changed files with 440 additions and 364 deletions

View File

@@ -4,6 +4,8 @@ using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Atmos;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
@@ -11,9 +13,10 @@ namespace Content.Server.RatKing
{
public sealed class RatKingSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly ActionsSystem _action = default!;
[Dependency] private readonly AtmosphereSystem _atmos = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly TransformSystem _xform = default!;
public override void Initialize()
@@ -50,7 +53,7 @@ namespace Content.Server.RatKing
return;
}
args.Handled = true;
hunger.CurrentHunger -= component.HungerPerArmyUse;
_hunger.ModifyHunger(uid, -component.HungerPerArmyUse, hunger);
Spawn(component.ArmyMobSpawnId, Transform(uid).Coordinates); //spawn the little mouse boi
}
@@ -73,7 +76,7 @@ namespace Content.Server.RatKing
return;
}
args.Handled = true;
hunger.CurrentHunger -= component.HungerPerDomainUse;
_hunger.ModifyHunger(uid, -component.HungerPerDomainUse, hunger);
_popup.PopupEntity(Loc.GetString("rat-king-domain-popup"), uid);
@@ -84,6 +87,13 @@ namespace Content.Server.RatKing
}
}
public sealed class RatKingRaiseArmyActionEvent : InstantActionEvent { };
public sealed class RatKingDomainActionEvent : InstantActionEvent { };
public sealed class RatKingRaiseArmyActionEvent : InstantActionEvent
{
}
public sealed class RatKingDomainActionEvent : InstantActionEvent
{
}
};