Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vigers Ray 2024-12-10 02:35:42 +03:00
commit aba216ebbb
3 changed files with 13 additions and 1 deletions

View file

@ -46,10 +46,16 @@ namespace Content.Server.RatKing
if (!TryComp<HungerComponent>(uid, out var hunger))
return;
if (component.Servants.Count >= component.MaxArmyCount)
{
_popup.PopupEntity(Loc.GetString("rat-king-max-army"), uid, uid);
return;
}
//make sure the hunger doesn't go into the negatives
if (hunger.CurrentHunger < component.HungerPerArmyUse)
{
_popup.PopupEntity(Loc.GetString("rat-king-too-hungry"), uid, uid);
_popup.PopupEntity(Loc.GetString("rat-king-too-hungry", ("amount", component.MaxArmyCount)), uid, uid);
return;
}
args.Handled = true;

View file

@ -99,6 +99,11 @@ public sealed partial class RatKingComponent : Component
{ RatKingOrderType.CheeseEm, "RatKingCommandCheeseEm" },
{ RatKingOrderType.Loose, "RatKingCommandLoose" }
};
// Sunrise-start
[DataField]
public int MaxArmyCount = 12;
// Sunrise-end
}
[Serializable, NetSerializable]

View file

@ -0,0 +1 @@
rat-king-too-hungry = У вас превышено максимальное количество подданных: { $amount }