Skip to content

Commit

Permalink
Merge branch 'master' into semena
Browse files Browse the repository at this point in the history
  • Loading branch information
FrisKisDr authored Nov 30, 2024
2 parents ba0a250 + fdafbd8 commit 2611324
Show file tree
Hide file tree
Showing 398 changed files with 538,670 additions and 485,342 deletions.
7 changes: 7 additions & 0 deletions Content.Client/ADT/Material/AutoMaterialInsertSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.ADT.Materials;

namespace Content.Client.ADT.Materials;

public sealed class AutoMaterialInsertSystem : SharedAutoMaterialInsertSystem
{
}
1 change: 1 addition & 0 deletions Content.Client/ADT/Roadmap/RoadmapItem.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Message;
using Content.Shared.ADT.Roadmap;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
Expand Down
9 changes: 0 additions & 9 deletions Content.Client/ADT/Roadmap/RoadmapItemState.cs

This file was deleted.

19 changes: 7 additions & 12 deletions Content.Client/ADT/Roadmap/RoadmapUIController.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using Content.Client.Lobby;
using System.Linq;
using Content.Client.Lobby;
using Content.Shared.ADT.Roadmap;
using Robust.Client.UserInterface.Controllers;
using Robust.Shared.Prototypes;

namespace Content.Client.ADT.Roadmap;

public sealed class RoadmapUIController : UIController, IOnStateEntered<LobbyState>
public sealed class RoadmapUIController : UIController
{
[Dependency] private readonly IPrototypeManager _proto = default!;
private RoadmapWindow? _window;
private bool _shown;

public void OnStateEntered(LobbyState state)
{
if (_shown || _window != null)
return;

ToggleRoadmap();
}

public void ToggleRoadmap()
{
Expand All @@ -24,10 +19,10 @@ public void ToggleRoadmap()
return;
}

_shown = true;
_window = new RoadmapWindow();
_window.OnClose += () => _window = null;

_window.OpenCentered();
_window.Populate(_proto.EnumeratePrototypes<RoadmapItemPrototype>().ToList());
}
}
31 changes: 6 additions & 25 deletions Content.Client/ADT/Roadmap/RoadmapWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,14 @@
</BoxContainer>
</BoxContainer>
<BoxContainer Name="Columns" Access="Public" Orientation="Horizontal">
<BoxContainer Name="FirstVersion" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="Текущая версия" />
<controls:RoadmapItem ItemState="InProgress" HeaderText="Модули для оружия" Text="Перенос модулей для оружия c колониальных морпехов, которые существенно изменят ваш взгляд на стрельбу" />
<controls:RoadmapItem ItemState="InProgress" HeaderText="Корабельные бои" Text="Огромный и совершенно новый режим, который откроет вам не только возможности для стрельбы и РДМа, но и для РП, а также подарит уникальные впечатления: высадки на планеты, масштабные сражения на земле, артиллерия, корабельные бои, абордажи и, конечно же, битвы на космобайках!" />
<controls:RoadmapItem ItemState="InProgress" HeaderText="Обновления Ниндзя" Text="Крупное обновление мидраунд-антагониста — Космического Ниндзя, которое существенно изменит его геймплей, подарит новые цели, способности и, соответственно, возможности!" />
<controls:RoadmapItem ItemState="InProgress" HeaderText="Обновление Зомби" Text="Обновление антагониста — режим Зомби, который даст ему хотя бы небольшое право на существование :D" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Новый Генокрад!" Text="Всеми известный генокрад был возвращён на сервер Время Приключений и, как обычно для этого сервера, сильно переработан! Новые способности! Новые возможности! Уже ждут вас!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Новые газы" Text="Настоящий рай для атмосов, которые уже освоили эту игру! Множество новых, интересных и полезных газов!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Система языков" Text="Уникальная система языков рас!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Коллективный разум" Text="Коллективный разум для дион, генокрадов, космических карпов и дракона!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Уникальные блюда и напитки" Text="Сервис - на высоте!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Новые газы" Text="Уникальные газы - рай для атмосов! Гайд - на нашей вики!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Стильномат" Text="Для самых модных сотрудников станции!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Механика лежания" Text="Новые возможности для ПВП и РП!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Расширение спавна пауков" Text="Новые и опасные пауки ждут момента, чтобы атаковать экипаж!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Экономика" Text="Получайте зарплату, тратьте её на товары, а также на некоторые услуги (у уборщика, бармена, повара). Гайд - на вики. Подробности о ценах на товары и услуги - в СРП Сервисного отдела!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Обновление Священника" Text="Священный меч, вера и сила - всё для борьбы с бушующими духами!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Фантом" Text="Космический призрак, проклятие магов, коллективная галлюцинация или межпланетарный путешественник, попавший на станцию случайно или с определенными целями. Подробности на нашей вики!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Обновление ОБР" Text="Отряд Быстрого Реагирования обзавелся новейшей Блюспейс оружейной ОБР (Б.О.О.Б.Р), работающим по аналогии с аплинком, а также получил собственных мехов!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Мехи" Text="Новые, стильные, уникально разработанные и крутые мехи!" />
<controls:RoadmapItem ItemState="Complete" HeaderText="Обновление революции" Text="Скучнейшая революция получила обновление, и добавила в нее побольше РП и шансов на победу!" />
<BoxContainer Name="Complete" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="Выполнено" />
</BoxContainer>
<BoxContainer Name="SecondVersion" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="Предстоящее" />
<BoxContainer Name="InProgress" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="В процессе" />
</BoxContainer>
<BoxContainer Name="ThirdVersion" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="На будущее" />
<BoxContainer Name="Planned" Access="Public" Orientation="Vertical" HorizontalExpand="True" Margin="0 0 20 0">
<controls:RoadmapVersionHeader Text="Запланировано" />
</BoxContainer>
</BoxContainer>
</BoxContainer>
Expand Down
45 changes: 44 additions & 1 deletion Content.Client/ADT/Roadmap/RoadmapWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Robust.Client.AutoGenerated;
using Content.Shared.ADT.Roadmap;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
Expand All @@ -17,4 +19,45 @@ public RoadmapWindow()
msg.AddMarkupOrThrow($"[font size=24]ДОРОЖНАЯ КАРТА [bold]{currentYear}[/bold][/font]");
Header.SetMessage(msg);
}

public void Populate(List<RoadmapItemPrototype> list)
{
foreach (var item in list)
{
var name = Loc.GetString(item.Name);
var desc = Loc.GetString(item.Description);
RoadmapItem roadmapItem = new()
{
HeaderText = name,
Text = desc,
ItemState = item.State
};

switch (item.State)
{
case RoadmapItemState.Planned:
{
Planned.AddChild(roadmapItem);
break;
}
case RoadmapItemState.InProgress:
{
InProgress.AddChild(roadmapItem);
break;
}
case RoadmapItemState.Partial:
{
InProgress.AddChild(roadmapItem);
break;
}
case RoadmapItemState.Complete:
{
Complete.AddChild(roadmapItem);
break;
}
default:
throw new IndexOutOfRangeException();
}
}
}
}
1 change: 1 addition & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public override void Init()
_prototypeManager.RegisterIgnore("stationGoal"); // Corvax-StationGoal
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");
_prototypeManager.RegisterIgnore("ghostbarMap"); ///ADT-ghostber
_prototypeManager.RegisterIgnore("additionalMap"); ///ADT-additionalMap

_componentFactory.GenerateNetIds();
_adminManager.Initialize();
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Materials/MaterialStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public override bool TryInsertMaterialEntity(EntityUid user,
EntityUid receiver,
MaterialStorageComponent? storage = null,
MaterialComponent? material = null,
PhysicalCompositionComponent? composition = null)
PhysicalCompositionComponent? composition = null,
bool showPopup = true) // ADT tweak
{
if (!base.TryInsertMaterialEntity(user, toInsert, receiver, storage, material, composition))
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Content.Server.GameTicking;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;

// Author: by TornadoTech
namespace Content.Server.ADT.AdditionalMapLoader;

public sealed class AdditionalMapLoaderSystem : EntitySystem
{
[Dependency] private readonly GameTicking.GameTicker _gameTicker = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<LoadingMapsEvent>(OnGetMaps);
}

private void OnGetMaps(LoadingMapsEvent args)
{
var firstMap = args.Maps[0];
if (!_prototypeManager.TryIndex<AdditionalMapPrototype>(firstMap.ID, out var proto))
return;

foreach (var mapProtoId in proto.MapProtoIds)
{
if (!_prototypeManager.TryIndex(mapProtoId, out var mapProto))
{
Log.Error($"Prototype not found with ID '{mapProtoId.Id}' in '{proto.ID}'. " +
$"Please ensure this prototype exists in '- type: additionalMap' check `maps:`!!");
continue;
}
CreateAndInitializeMap(mapProto);
}
}
private void CreateAndInitializeMap(Maps.GameMapPrototype mapProto)
{
var map = _mapManager.CreateMap();
_mapManager.AddUninitializedMap(map);
_gameTicker.LoadGameMap(mapProto, map, null);
_mapManager.DoMapInitialize(map);
}
}
15 changes: 15 additions & 0 deletions Content.Server/ADT/AdditionalMapLoader/AdditionalMapPrototype.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Content.Server.Maps;
using Robust.Shared.Prototypes;

// Author: by TornadoTech
namespace Content.Server.ADT.AdditionalMapLoader;

[Prototype("additionalMap")]
public sealed class AdditionalMapPrototype : IPrototype
{
[IdDataField]
public string ID { get; } = string.Empty;

[DataField("maps")]
public List<ProtoId<GameMapPrototype>> MapProtoIds = new();
}
12 changes: 6 additions & 6 deletions Content.Server/ADT/Changeling/Systems/ChangelingSystem.Useful.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ private void OnStasisDeathAction(EntityUid uid, ChangelingComponent component, S

if (component.StasisDeathActive)
{
if (!TryUseAbility(uid, component, args.Cost))
return;
if (!TryUseAbility(uid, component, args.Cost))
return;

args.Handled = true;

Expand All @@ -368,8 +368,8 @@ private void OnStasisDeathAction(EntityUid uid, ChangelingComponent component, S
return;
}

if (!TryUseAbility(uid, component, args.Cost))
return;
if (!TryUseAbility(uid, component, args.Cost))
return;

args.Handled = true;

Expand Down Expand Up @@ -472,8 +472,8 @@ private void OnLesserForm(EntityUid uid, ChangelingComponent component, Changeli

if (!component.LesserFormActive)
{
if (!TryUseAbility(uid, component, args.Cost))
return;
if (!TryUseAbility(uid, component, args.Cost))
return;

RemoveShieldEntity(uid, component);
RemoveBladeEntity(uid, component);
Expand Down
16 changes: 13 additions & 3 deletions Content.Server/ADT/Changeling/Systems/ChangelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,17 +331,21 @@ public void CopyLing(EntityUid from, EntityUid to, ChangelingComponent? comp = n
var newLingComponent = new ChangelingComponent();
newLingComponent.Chemicals = comp.Chemicals;
newLingComponent.ChemicalsPerSecond = comp.ChemicalsPerSecond;

newLingComponent.StoredDNA = comp.StoredDNA;
newLingComponent.SelectedDNA = comp.SelectedDNA;

newLingComponent.ArmBladeActive = comp.ArmBladeActive;
newLingComponent.ChameleonSkinActive = comp.ChameleonSkinActive;
newLingComponent.LingArmorActive = comp.LingArmorActive;
newLingComponent.CanRefresh = comp.CanRefresh;
newLingComponent.LesserFormActive = comp.LesserFormActive;

newLingComponent.AbsorbedDnaModifier = comp.AbsorbedDnaModifier;
newLingComponent.DNAStolen = comp.DNAStolen;
newLingComponent.LastResortUsed = comp.LastResortUsed;
newLingComponent.CanRefresh = comp.CanRefresh;

newLingComponent.BasicTransferredActions = comp.BasicTransferredActions;
newLingComponent.BoughtActions = comp.BoughtActions;
newLingComponent.LastResortUsed = comp.LastResortUsed;
newLingComponent.GainedActions = true;
RemComp(from, comp);
AddComp(to, newLingComponent);
Expand Down Expand Up @@ -596,9 +600,15 @@ public bool StealDNA(EntityUid uid, EntityUid target, ChangelingComponent compon
_popup.PopupEntity(selfMessage, uid, uid);
return false;
}
else if (HasComp<ForceTransformedComponent>(target))
{
_popup.PopupEntity(Loc.GetString("changeling-transform-sting-fail-already", ("target", Identity.Entity(target, EntityManager))), uid, uid);
return false;
}

else
{
component.DNAStolen++;
component.StoredDNA.Add(newHumanoidData.Value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
using Content.Server.Afk;
using Content.Shared.Ghost;
using Content.Shared.GameTicking;
using Robust.Server.Player;
using Content.Server.Maps;


namespace Content.Server.ADT.Discord.Adminwho;

Expand All @@ -21,6 +24,9 @@ public sealed class DiscordAdminInfoSenderSystem : EntitySystem
[Dependency] private readonly IGameTiming _time = default!;
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;

private TimeSpan _nextSendTime = TimeSpan.MinValue;
private readonly TimeSpan _delayInterval = TimeSpan.FromMinutes(15);
Expand Down Expand Up @@ -76,6 +82,9 @@ private async void SendAdminInfoToDiscord()
sb.AppendLine();
}

if (sb.Length == 0)
sb.Append("Null админов");

var serverName = _cfg.GetCVar(CCVars.GameHostName);

var gameTicker = _entitySystemManager.GetEntitySystem<GameTicker>();
Expand All @@ -90,6 +99,11 @@ private async void SendAdminInfoToDiscord()
$"{gameTicker.RunLevel} was not matched."),
};

var countPlayer = _playerManager.PlayerCount;
var countPlayerMax = _cfg.GetCVar(CCVars.SoftMaxPlayers);
var mapName = _gameMapManager.GetSelectedMap();
var selectGameRule = _gameTicker.CurrentPreset;

var embed = new WebhookEmbed
{
Title = Loc.GetString("title-embed-webhook-adminwho"),
Expand All @@ -102,6 +116,12 @@ private async void SendAdminInfoToDiscord()
},
};

embed.Fields.Add(new WebhookEmbedField { Name = "Player", Value = $"{countPlayer}/{countPlayerMax}", Inline = true });
if (mapName != null)
embed.Fields.Add(new WebhookEmbedField { Name = "Карта", Value = mapName.MapName, Inline = true });
if (selectGameRule != null)
embed.Fields.Add(new WebhookEmbedField { Name = "Режим", Value = Loc.GetString(selectGameRule.ModeTitle), Inline = true });

var payload = new WebhookPayload
{
Embeds = new List<WebhookEmbed> { embed },
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/ADT/Materials/AutoMaterialInsertSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.ADT.Materials;

namespace Content.Server.ADT.Materials;

public sealed class AutoMaterialInsertSystem : SharedAutoMaterialInsertSystem
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
namespace Content.Server.Objectives.Components;

/// <summary>
/// Requires that the player is on the emergency shuttle's grid when docking to CentCom.
/// Требование генокраду украсть определённое количество штаммов ДНК
/// </summary>
[RegisterComponent, Access(typeof(AbsorbDnaConditionSystem))]
public sealed partial class AbsorbDnaConditionComponent : Component
[RegisterComponent, Access(typeof(StealDnaConditionSystem))]
public sealed partial class StealDnaConditionComponent : Component
{
[DataField]
public int AbsorbDnaCount = 4;

[DataField]
public int MaxDnaCount = 4;
public int MaxDnaCount = 13;

[DataField]
public int MinDnaCount = 2;
public int MinDnaCount = 10;

[DataField(required: true)]
public LocId ObjectiveText;
Expand Down
Loading

0 comments on commit 2611324

Please sign in to comment.