Skip to content

Commit

Permalink
Merge branch 'xtray85:master' into Thinkies
Browse files Browse the repository at this point in the history
  • Loading branch information
JustKekc authored Apr 20, 2024
2 parents 2254e64 + b31307d commit f70b42c
Show file tree
Hide file tree
Showing 201 changed files with 702 additions and 298 deletions.
2 changes: 1 addition & 1 deletion ADT_STATION
25 changes: 16 additions & 9 deletions Content.Client/Overlays/ShowHealthIconsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Shared.Atmos.Rotting;
using Content.Shared.Damage;
using Content.Shared.Inventory.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Overlays;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
Expand All @@ -17,9 +19,6 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo

public HashSet<string> DamageContainers = new();

[ValidatePrototypeId<StatusIconPrototype>]
private const string HealthIconFine = "HealthIconFine";

public override void Initialize()
{
base.Initialize();
Expand All @@ -45,18 +44,20 @@ protected override void DeactivateInternal()
DamageContainers.Clear();
}

private void OnGetStatusIconsEvent(EntityUid uid, DamageableComponent damageableComponent, ref GetStatusIconsEvent args)
private void OnGetStatusIconsEvent(Entity<DamageableComponent> entity, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
return;

var healthIcons = DecideHealthIcons(damageableComponent);
var healthIcons = DecideHealthIcons(entity);

args.StatusIcons.AddRange(healthIcons);
}

private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(DamageableComponent damageableComponent)
private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(Entity<DamageableComponent> entity)
{
var damageableComponent = entity.Comp;

if (damageableComponent.DamageContainerID == null ||
!DamageContainers.Contains(damageableComponent.DamageContainerID))
{
Expand All @@ -66,10 +67,16 @@ private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(DamageableComponent
var result = new List<StatusIconPrototype>();

// Here you could check health status, diseases, mind status, etc. and pick a good icon, or multiple depending on whatever.
if (damageableComponent?.DamageContainerID == "Biological" &&
_prototypeMan.TryIndex<StatusIconPrototype>(HealthIconFine, out var healthyIcon))
if (damageableComponent?.DamageContainerID == "Biological")
{
result.Add(healthyIcon);
if (TryComp<MobStateComponent>(entity, out var state))
{
// Since there is no MobState for a rotting mob, we have to deal with this case first.
if (HasComp<RottingComponent>(entity) && _prototypeMan.TryIndex(damageableComponent.RottingIcon, out var rottingIcon))
result.Add(rottingIcon);
else if (damageableComponent.HealthIcons.TryGetValue(state.CurrentState, out var value) && _prototypeMan.TryIndex(value, out var icon))
result.Add(icon);
}
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowHungerIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, HungerComponent hungerComponent, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer || args.HasStealthComponent)
if (!IsActive || args.InContainer)
return;

var hungerIcons = DecideHungerIcon(uid, hungerComponent);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowSecurityIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref GetStatusIconsEvent @event)
{
if (!IsActive || @event.InContainer || @event.HasStealthComponent)
if (!IsActive || @event.InContainer)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowThirstIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent thirstComponent, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer || args.HasStealthComponent)
if (!IsActive || args.InContainer)
return;

var thirstIcons = DecideThirstIcon(uid, thirstComponent);
Expand Down
3 changes: 1 addition & 2 deletions Content.Client/SSDIndicator/SSDIndicatorSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.CCVar;
using Content.Shared.CCVar;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.NPC;
Expand Down Expand Up @@ -31,7 +31,6 @@ private void OnGetStatusIcon(EntityUid uid, SSDIndicatorComponent component, ref
if (component.IsSSD &&
_cfg.GetCVar(CCVars.ICShowSSDIndicator) &&
!args.InContainer &&
!args.HasStealthComponent &&
!_mobState.IsDead(uid) &&
!HasComp<ActiveNPCComponent>(uid) &&
TryComp<MindContainerComponent>(uid, out var mindContainer) &&
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/StatusIcon/StatusIconOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetL += texture.Height;
countL++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = -(bounds.Width + sprite.Offset.X) / 2f;

}
Expand All @@ -106,7 +106,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetR += texture.Height;
countR++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;

}
Expand Down
5 changes: 1 addition & 4 deletions Content.Client/StatusIcon/StatusIconSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Shared.CCVar;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Content.Shared.Stealth.Components;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;

Expand All @@ -14,7 +13,6 @@ public sealed class StatusIconSystem : SharedStatusIconSystem
{
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] private readonly IOverlayManager _overlay = default!;
[Dependency] private readonly IEntityManager _entManager = default!;

private bool _globalEnabled;
private bool _localEnabled;
Expand Down Expand Up @@ -57,8 +55,7 @@ public List<StatusIconData> GetStatusIcons(EntityUid uid, MetaDataComponent? met
return list;

var inContainer = (meta.Flags & MetaDataFlags.InContainer) != 0;
var hasStealthComponent = _entManager.HasComponent<StealthComponent>(uid);
var ev = new GetStatusIconsEvent(list, inContainer, hasStealthComponent);
var ev = new GetStatusIconsEvent(list, inContainer);
RaiseLocalEvent(uid, ref ev);
return ev.StatusIcons;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Defusable/Components/DefusableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class DefusableComponent : Component
/// The bomb will play this sound on defusal.
/// </summary>
[ViewVariables(VVAccess.ReadOnly), DataField("defusalSound")]
public SoundSpecifier DefusalSound = new SoundPathSpecifier("/Audio/Misc/notice2.ogg");
public SoundSpecifier DefusalSound = new SoundPathSpecifier("/Audio/Misc/notice2_2.ogg");

/// <summary>
/// The bomb will play this sound on bolt.
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Nuke/NukeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public sealed partial class NukeComponent : SharedNukeComponent
public SoundSpecifier ArmSound = new SoundPathSpecifier("/Audio/Misc/notice1.ogg");

[DataField("disarmSound")]
public SoundSpecifier DisarmSound = new SoundPathSpecifier("/Audio/Misc/notice2.ogg");
public SoundSpecifier DisarmSound = new SoundPathSpecifier("/Audio/Misc/notice2_2.ogg");

[DataField("armMusic")]
public SoundSpecifier ArmMusic = new SoundCollectionSpecifier("NukeMusic");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public sealed partial class ShuttleSystem
public const float DefaultTravelTime = 20f;
public const float DefaultArrivalTime = 5f;
private const float FTLCooldown = 10f;
public const float FTLMassLimit = 300f;
public const float FTLMassLimit = 600f;

// I'm too lazy to make CVars.

Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public static readonly CVarDef<bool>
CVarDef.Create("traitor.min_players", 5);

public static readonly CVarDef<int> TraitorMaxTraitors =
CVarDef.Create("traitor.max_traitors", 4); // Assuming average server maxes somewhere from like 50-80 people
CVarDef.Create("traitor.max_traitors", 6); // Assuming average server maxes somewhere from like 50-80 people

public static readonly CVarDef<int> TraitorPlayersPerTraitor =
CVarDef.Create("traitor.players_per_traitor", 12);
Expand Down Expand Up @@ -516,10 +516,10 @@ public static readonly CVarDef<bool>

public static readonly CVarDef<int> ChangelingMinPlayers =

CVarDef.Create("changeling.min_players", 5);
CVarDef.Create("changeling.min_players", 15);

public static readonly CVarDef<int> ChangelingMaxChangelings =
CVarDef.Create("changeling.max_lings", 2); // Assuming average server maxes somewhere from like 50-80 people. Upd: У нас генокрады вместе с предателями, куда бля! Порезал в 2 раза лимит.
CVarDef.Create("changeling.max_lings", 4); // Assuming average server maxes somewhere from like 50-80 people. Upd: У нас генокрады вместе с предателями, куда бля! Порезал в 2 раза лимит.

public static readonly CVarDef<int> ChangelingPlayersPerChangeling =
CVarDef.Create("changeling.players_per_traitor", 15);
Expand Down
16 changes: 15 additions & 1 deletion Content.Shared/Damage/Components/DamageableComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Content.Shared.Mobs;
using Content.Shared.StatusIcon;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
Expand Down Expand Up @@ -62,7 +65,18 @@ public sealed partial class DamageableComponent : Component
public FixedPoint2 TotalDamage;

[DataField("radiationDamageTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
public List<string> RadiationDamageTypeIDs = new() {"Radiation"};
public List<string> RadiationDamageTypeIDs = new() { "Radiation" };

[DataField]
public Dictionary<MobState, ProtoId<StatusIconPrototype>> HealthIcons = new()
{
{ MobState.Alive, "HealthIconFine" },
{ MobState.Critical, "HealthIconCritical" },
{ MobState.Dead, "HealthIconDead" },
};

[DataField]
public ProtoId<StatusIconPrototype> RottingIcon = "HealthIconRotting";
}

[Serializable, NetSerializable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed partial class StatusIconComponent : Component
/// </summary>
/// <param name="StatusIcons"></param>
[ByRefEvent]
public record struct GetStatusIconsEvent(List<StatusIconData> StatusIcons, bool InContainer, bool HasStealthComponent);
public record struct GetStatusIconsEvent(List<StatusIconData> StatusIcons, bool InContainer);

/// <summary>
/// Event raised on the Client-side to determine whether to display a status icon on an entity.
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/StatusIcon/StatusIconPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public int CompareTo(StatusIconData? other)
/// </summary>
[DataField]
public StatusIconLayer Layer = StatusIconLayer.Base;

/// <summary>
/// Offset of the status icon, up and down only.
/// </summary>
[DataField]
public int Offset = 0;
}

/// <summary>
Expand Down
Binary file added Resources/Audio/ADT/Ambience/me1.ogg
Binary file not shown.
Binary file added Resources/Audio/ADT/Ambience/me2.ogg
Binary file not shown.
Binary file added Resources/Audio/ADT/Ambience/me3.ogg
Binary file not shown.
Binary file added Resources/Audio/ADT/Ambience/wolfpack.ogg
Binary file not shown.
Binary file modified Resources/Audio/Announcements/war.ogg
Binary file not shown.
8 changes: 8 additions & 0 deletions Resources/Locale/ru-RU/ADT/Clothing/Back/Backpack.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@ ent-ADTClothingSatchelParamedic = сумка парамедика
ent-ADTClothingCriminalistBackpack = рюкзак криминалиста
.desc = Рюкзак криминалиста, для переноски улик и специальных средств.
.suffix = { "Криминалист" }
ent-ADTClothingBackpackMilitarySatchelFleetPilot = сумка пилота
.desc = Вмещает то, что необходимо пилоту истребителя.
.suffix = { "Космические бои" }
ent-ClothingBackpackMilitarySatchelEngineer = сумка корабельного инженера
.desc = Вмещает то, что необходимо инженеру корабля.
.suffix = { "Космические бои" }
4 changes: 4 additions & 0 deletions Resources/Locale/ru-RU/ADT/Clothing/Belt/belt.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ ent-ADTClothingBeltSheathOCK = сабельные ножны ЦентКом
ent-ADTClothingBeltCriminalist = жилет криминалиста
.desc = Жилет, разработанный специально для следователей и криминалистов СБ, вмещает в себя всё необходимое для криминалистической экспертизы места преступления..
.suffix = { "Криминалист" }
ent-ADTClothingBeltAssault = пояс пилота
.desc = Довольно вместительные поясные сумки со всем, что нужно пилоту.
.suffix = { "Космические бои" }
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/ADT/Clothing/Hands/gloves.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ent-ADTClothingHandsNovaGloves = перчатки Новы
.desc = Это перчатки Новы. Как она их получила? Секрет.
ent-ADTClothingHandsRedjiGloves = Перчатки старика Реджи
.desc = Старая пара перчаток без пальцев
.desc = Старая пара перчаток. Скорее всего беспалыми они стали со временем.
ent-ADTClothingHandsRabbitGloves = кроличьи перчатки
.desc = Ох. Фурри.
Expand Down
8 changes: 4 additions & 4 deletions Resources/Locale/ru-RU/ADT/Clothing/Uniform/jumpsuits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ ent-ADTClothingUniformPriestPrimalSuit = традиционный наряд ж
ent-ADTClothingUniformJumpsuitMaugly = штурмовой костюм "Маугли"
.desc = Удобный и прочный современный штурмовой костюм из плотной палаточной хлопчатобумажной ткани, который хорошо показал себя на войне в джунглях.
.suffix = { "" }
ent-ADTClothingUniformRedgiJumpskirt = юбка-костюм заведующей отелем
.desc = Потёртый, но от того не менее стильный, костюм для женской половины персонала
ent-ADTClothingUniformRedjiJumpskirt = юбка-костюм заведующей отелем
.desc = Как гласит официальное заявление, НТ выпустило этот вариант формы из-за многочисленных жалоб со стороны женской половины барменов, поскольку изначально был только мужской костюм. В действительности это волновало человека 3 от силы.
.suffix = { "" }
ent-ADTClothingUniformRedgiSuit = костюм заведующего отелем
.desc = Потёртый, но от того не менее стильный, костюм
ent-ADTClothingUniformRedjiSuit = костюм заведующего отелем
.desc = Легенды гласят, что в этот костюм пренадлежал некоему Реджинальду, что разливал всем корневое пиво.
.suffix = { "" }
ent-ADTClothingUniformNewBarmanSuit = обновлённый костюм бармена
.desc = Обновлённый комплект одежды для более изысканого разлития напитков
Expand Down
8 changes: 4 additions & 4 deletions Resources/Locale/ru-RU/ADT/Clothing/alljaycloth.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ ent-ADTInquisitoryHead = шлем скафандра ОБР инквизици
ent-ADTImpmonk = роба инквизитора
.desc = Создано из самой технологичной ткани.
.suffix = { "инквизиция" }
ent-ADTPilotSuit = скафандр пилота
ent-ADTPilotSuit = скафандр пилота NT
.desc = Для тех кто любит скорость и звёзды.
.suffix = { "" }
ent-ADTPilotSuitSEC = скафандр пилота СБ
ent-ADTPilotSuitSEC = скафандр пилота Горлакса
.desc = Для хранителей порядка среди звезд.
.suffix = { "" }
ent-ADTPilotSuitHelm = шлем скафандра пилота
ent-ADTPilotSuitHelm = шлем скафандра пилота NT
.desc = Кто то впечатался в нём в руль.
.suffix = { "" }
ent-ADTPilotSuitHelmSEC = шлем скафандра пилота СБ
ent-ADTPilotSuitHelmSEC = шлем скафандра пилота Горлакса
.desc = Вас вдохноляет порядок.
.suffix = { "" }
ent-ADTClothingOuterCoatLabSec = лабараторный халат СБ
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/ADT/Clothing/outerclothing.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ent-ADTClothingOuterJacketBartender = барная жилетка
.desc = удобная барная жилетка для повседневной носки.
.desc = Удобная и стильная жилетка. Смотрите, не испорьте удобство и стиль разлитым напитком.
.suffix = { "" }
ent-ADTClothingOuterCoatPyotrCoat = шинель Петра Шахина
Expand Down
8 changes: 8 additions & 0 deletions Resources/Locale/ru-RU/ADT/Clothing/wiki_items.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ent-ADTFlowerCrownBlue = цветочный венок
.desc = Аккуратный венок из роскошных цветов бирюзового, голубого и синего оттенков, источающих приятный, успокаивающий аромат. Отлично служит дополнением к изящным волосам аналогичного цвета.
ent-ADTClothingNeckScarfUnrobust = шарф анробаста
.desc = Шарф, подтверждающий, что его носитель достоин звания самого главного анробаста в галактике, который не выиграл ни одного сражения. Шарф является клеймом того, что его носитель всегда будет обречен на неудачу и высмеивание со стороны окружающих. Однако он будет носить его с гордостью и достоинством, готовый к следующей неудаче.
ent-ADTClothingUnderSocksLiExEr = носки Кетуи
.desc = Носки для программистов с вырезом под острые коготочки вульпы! Пахнет мандаринами.
ent-ADTClothingEyesEyepatchTretyakova = белая глазная повязка Третьяковой
.desc = Белая повязка, созданная одним малоизвестным ателье для правого глаза Ксении Третьяковой.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ent-ADTReagentContainerCocoaSolid = пачка какао-порошка
.desc = Большая пачка порошкового какао. Разбавьте водой перед употреблением!
.desc = Большая пачка порошкового какао. Разбавьте водой перед употреблением! Упаковка выглядет крайне знакомой, однако почему понять трудно.
Loading

0 comments on commit f70b42c

Please sign in to comment.