Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

генокрады #669

Merged
merged 53 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
93051bd
пизда
Inconnu1337 Oct 15, 2024
3e8c4f8
ыыаыааыа..ыаы.а.ы:3
Inconnu1337 Oct 16, 2024
9b5dead
шредя хочет занырнуть ко мне в веточку <3
Inconnu1337 Oct 17, 2024
85e931b
часть 1
Inconnu1337 Oct 17, 2024
4ffc79a
часть 2 (много ошибок ъъъъъъъъъъъъъъъъъъъъъъъъъъ)
Inconnu1337 Oct 20, 2024
b51ebfc
Merge branch 'AdventureTimeSS14:master' into ADTPizdec
Inconnu1337 Oct 21, 2024
19b57cc
пипяо
Inconnu1337 Oct 21, 2024
ef42eb9
Merge branch 'ADTPizdec' of https://github.com/Inconnu1337/space_stat…
Inconnu1337 Oct 23, 2024
977d10b
Начало лютого рефактора этого щиткода
FaDeOkno Oct 24, 2024
9b91c6d
Продолжаю, сделал радиальное меню
FaDeOkno Oct 24, 2024
822b513
Оно запустилось
FaDeOkno Oct 25, 2024
69cef3b
радиальные меню
FaDeOkno Oct 25, 2024
9050092
тяжело
FaDeOkno Oct 28, 2024
3e3bc7d
не, нахуй
FaDeOkno Oct 30, 2024
b038553
ъуъ прототипы
Inconnu1337 Oct 31, 2024
86bb3c7
уберу конфликт компонента стелса?
FaDeOkno Oct 31, 2024
dc75be8
Молот + сортировка и чистка
FaDeOkno Oct 31, 2024
976282a
Фиксики фиксики
FaDeOkno Oct 31, 2024
00ea6bc
я забыл подтянуть коммиты :d
Inconnu1337 Oct 31, 2024
df8fcf6
Merge branch 'ADTPizdec' of https://github.com/Inconnu1337/space_stat…
Inconnu1337 Oct 31, 2024
baf78e6
фиксики
Inconnu1337 Nov 1, 2024
734f7ef
память как у рыбки бляььььььььььььььььььььььььььь
Inconnu1337 Nov 1, 2024
3e0f240
фиксики2
Inconnu1337 Nov 1, 2024
ce64367
уэээ
FaDeOkno Nov 1, 2024
8a542d9
work in progress
FaDeOkno Nov 1, 2024
291a8f9
ъуъ
Inconnu1337 Nov 2, 2024
8f0b647
Merge branch 'master' into ADTPizdec
Inconnu1337 Nov 3, 2024
fa3273d
прогресс
FaDeOkno Nov 2, 2024
4e0b883
ы
FaDeOkno Nov 4, 2024
0cec258
фиксики
FaDeOkno Nov 5, 2024
23f2708
fix linter
FaDeOkno Nov 5, 2024
60cc123
fix linter 2
FaDeOkno Nov 5, 2024
a7e7b6f
Merge branch 'master' into ADTPizdec
Inconnu1337 Nov 6, 2024
e00dc9e
фиксики апстрима
Inconnu1337 Nov 6, 2024
3218c47
Фикс тестера
FaDeOkno Nov 7, 2024
d7a0859
Увеличил урон от мускул
FaDeOkno Nov 7, 2024
03cc580
Переводы магазина
FaDeOkno Nov 8, 2024
33d0707
ы
FaDeOkno Nov 8, 2024
10b7b25
Merge branch 'master' into ADTPizdec
Schrodinger71 Nov 8, 2024
9499187
режим "генокрады" + повышение цены молота
Inconnu1337 Nov 10, 2024
48fb156
Merge branch 'ADTPizdec' of https://github.com/Inconnu1337/space_stat…
Inconnu1337 Nov 10, 2024
0540a31
fixix
FaDeOkno Nov 9, 2024
936e0df
ещё фиксы
FaDeOkno Nov 10, 2024
345dacb
Merge branch 'master' into ADTPizdec
FaDeOkno Nov 10, 2024
fa68017
ЩтооООооо, новые способности?!?!
FaDeOkno Nov 12, 2024
ead5ec5
закомментить
FaDeOkno Nov 13, 2024
d57f17a
Merge branch 'master' into ADTPizdec
FaDeOkno Nov 13, 2024
c4dbf94
ГЕЙмрул починен (карта вроде тоже)
FaDeOkno Nov 13, 2024
0f25fb2
у э э э
FaDeOkno Nov 13, 2024
885d8d0
ы
FaDeOkno Nov 13, 2024
bf3df31
Merge branch 'master' into ADTPizdec
FaDeOkno Nov 14, 2024
8343418
ь!
Inconnu1337 Nov 14, 2024
316a4ee
кешраш
Inconnu1337 Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Content.Client/ADT/Changeling/UI/ChangelingTransformMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<ui:RadialMenu xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
BackButtonStyleClass="RadialMenuBackButton"
CloseButtonStyleClass="RadialMenuCloseButton"
VerticalExpand="True"
HorizontalExpand="True"
MinSize="450 450">

<!-- Main -->
<ui:RadialContainer Name="Main" VerticalExpand="True" HorizontalExpand="True" Radius="64" ReserveSpaceForHiddenChildren="False">

</ui:RadialContainer>

</ui:RadialMenu>
105 changes: 105 additions & 0 deletions Content.Client/ADT/Changeling/UI/ChangelingTransformMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Speech;
using Content.Shared.Whitelist;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Shared.ADT.Phantom;
using Robust.Shared.Utility;
using Content.Shared.Humanoid.Prototypes;
using Content.Client.Humanoid;
using Content.Shared.Preferences;
using Robust.Shared.Map;
using Content.Shared.Humanoid;
using System.Linq;
using Content.Shared.Changeling;

namespace Content.Client.ADT.Changeling.UI;

[GenerateTypedNameReferences]
public sealed partial class ChangelingTransformMenu : RadialMenu
{
[Dependency] private readonly EntityManager _entManager = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;

private readonly HumanoidAppearanceSystem _appearanceSystem;
private readonly SpriteSystem _spriteSystem;
public List<NetEntity> Forms = new();
public ChangelingMenuType Type = ChangelingMenuType.Transform;
public NetEntity Target = NetEntity.Invalid;

public event Action<NetEntity>? OnSelectForm;

public ChangelingTransformMenu()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

_spriteSystem = _entManager.System<SpriteSystem>();
_appearanceSystem = _entManager.System<HumanoidAppearanceSystem>();
}

public void Populate(RequestChangelingFormsMenuEvent args)
{
var parent = FindControl<RadialContainer>("Main");

foreach (var item in args.HumanoidData)
{
if (Forms.Contains(item.NetEntity))
return;

var dummy = _entManager.SpawnEntity(_proto.Index(item.Profile.Species).DollPrototype, MapCoordinates.Nullspace);
_appearanceSystem.LoadProfile(dummy, item.Profile);
var face = new SpriteView();
face.SetEntity(dummy);

var button = new ChangelingTransformMenuButton
{
StyleClasses = { "RadialMenuButton" },
SetSize = new Vector2(64f, 64f),
ToolTip = Loc.GetString(item.Name ?? String.Empty),
Entity = item.NetEntity,
Profile = item.Profile,
Name = item.Name,
};

face.Scale *= 1f;
button.AddChild(face);
parent.AddChild(button);
Forms.Add(item.NetEntity);
}
foreach (var child in Children)
{
if (child is not RadialContainer container)
continue;
AddLingClickAction(container);
}
}
private void AddLingClickAction(RadialContainer container)
{
foreach (var child in container.Children)
{
if (child is not ChangelingTransformMenuButton castChild)
continue;

castChild.OnButtonUp += _ =>
{
OnSelectForm?.Invoke(castChild.Entity);
};
}
}
}


public sealed class ChangelingTransformMenuButton : RadialMenuTextureButton
{
public NetEntity Entity;
public HumanoidCharacterProfile? Profile;
public string? Name;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface.Controllers;
using Robust.Shared.Player;
using Content.Shared.Changeling;

namespace Content.Client.ADT.Changeling.UI;

[UsedImplicitly]
public sealed class ChangelingTransformUIController : UIController//, IOnStateChanged<GameplayState>
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IClyde _displayManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;

private ChangelingTransformMenu? _menu;

public override void Initialize()
{
EntityManager.EventBus.SubscribeEvent<RequestChangelingFormsMenuEvent>(EventSource.Network, this, OnRequestMenu);
}

private void OnRequestMenu(RequestChangelingFormsMenuEvent ev)
{
ToggleMenu(ev);
}

private void ToggleMenu(RequestChangelingFormsMenuEvent ev)
{
if (_menu == null)
{
// setup window
_menu = UIManager.CreateWindow<ChangelingTransformMenu>();
_menu.OnClose += OnWindowClosed;
_menu.OnOpen += OnWindowOpen;
_menu.OnSelectForm += OnSelectForm;

_menu.Type = ev.Type;
_menu.Target = ev.Target;

_menu.Populate(ev);

_menu.OpenCentered();
}
else
{
_menu.OnClose -= OnWindowClosed;
_menu.OnOpen -= OnWindowOpen;
_menu.OnSelectForm -= OnSelectForm;
_menu.Forms.Clear();

CloseMenu();
}
}

private void OnWindowClosed()
{
CloseMenu();
}

private void OnWindowOpen()
{
}

private void CloseMenu()
{
if (_menu == null)
return;

_menu.Dispose();
_menu = null;
}

private void OnSelectForm(NetEntity ent)
{
if (_menu == null)
return;

var player = _entityManager.GetNetEntity(_playerManager.LocalSession?.AttachedEntity ?? EntityUid.Invalid);

var ev = new SelectChangelingFormEvent(player, _menu.Target, ent, _menu.Type);
_entityManager.RaisePredictiveEvent(ev);

CloseMenu();
}
}
31 changes: 31 additions & 0 deletions Content.Client/ADT/Stealth/StealthSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Client.Interactable.Components;
using Content.Client.StatusIcon;
using Content.Shared.ADT.Stealth.Components;
using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Content.Shared.Tag;
using Content.Shared.Whitelist;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Prototypes;

namespace Content.Client.Stealth;

public sealed partial class StealthSystem
{
private void InitializeADT()
{
_player.LocalPlayerAttached += OnAttachedChanged;
_player.LocalPlayerDetached += OnAttachedChanged;
}

private void OnAttachedChanged(EntityUid uid)
{
var query = AllEntityQuery<StealthComponent, DigitalCamouflageComponent>();
while (query.MoveNext(out var ent, out var comp, out _))
{
SetShader(ent, comp.Enabled);
}
}
}
13 changes: 12 additions & 1 deletion Content.Client/Stealth/StealthSystem.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
using Content.Client.Interactable.Components;
using Content.Client.StatusIcon;
using Content.Shared.ADT.Stealth.Components;
using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Content.Shared.Tag;
using Content.Shared.Whitelist;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Prototypes;

namespace Content.Client.Stealth;

public sealed class StealthSystem : SharedStealthSystem
public sealed partial class StealthSystem : SharedStealthSystem
{
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly IPlayerManager _player = default!;

private ShaderInstance _shader = default!;

Expand All @@ -24,6 +29,8 @@ public override void Initialize()
SubscribeLocalEvent<StealthComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<StealthComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<StealthComponent, BeforePostShaderRenderEvent>(OnShaderRender);

InitializeADT(); // ADT tweak
}

public override void SetEnabled(EntityUid uid, bool value, StealthComponent? component = null)
Expand All @@ -39,6 +46,10 @@ private void SetShader(EntityUid uid, bool enabled, StealthComponent? component
{
if (!Resolve(uid, ref component, ref sprite, false))
return;
// ADT start
if (!CheckStealthWhitelist(_player.LocalEntity, uid))
enabled = false;
// ADT end

sprite.Color = Color.White;
sprite.PostShader = enabled ? _shader : null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Shared.Changeling.Components;
using Content.Shared.Store;

namespace Content.Server.Store.Conditions;

/// <summary>
/// Only allows a listing to be purchased while buyer can refresh.
/// </summary>
public sealed partial class ChangelingActionNotPresentCondition : ListingCondition
{
public override bool Condition(ListingConditionArgs args)
{
if (!args.EntityManager.TryGetComponent<ChangelingComponent>(args.Buyer, out var ling))
return false;

foreach (var item in ling.BoughtActions)
{
if (args.EntityManager.TryGetComponent<MetaDataComponent>(item, out var meta) && meta.EntityPrototype?.ID == args.Listing.ProductAction)
return false;
}
return true;
}
}
16 changes: 16 additions & 0 deletions Content.Server/ADT/Changeling/ChangelingCanRefreshCondition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Content.Shared.Changeling.Components;
using Content.Shared.Store;

namespace Content.Server.Store.Conditions;

/// <summary>
/// Only allows a listing to be purchased while buyer can refresh.
/// </summary>
public sealed partial class ChangelingCanRefreshCondition : ListingCondition
{

public override bool Condition(ListingConditionArgs args)
{
return args.EntityManager.TryGetComponent<ChangelingComponent>(args.Buyer, out var ling) && ling.CanRefresh;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Content.Shared.Changeling.Components;
using Content.Shared.Store;

namespace Content.Server.Store.Conditions;

/// <summary>
/// Only allows a listing to be purchased while buyer can refresh.
/// </summary>
public sealed partial class ChangelingLastResortNotUsedCondition : ListingCondition
{
public override bool Condition(ListingConditionArgs args)
{
if (!args.EntityManager.TryGetComponent<ChangelingComponent>(args.Buyer, out var ling))
return false;
if (ling.LastResortUsed)
return false;

return true;
}
}
8 changes: 8 additions & 0 deletions Content.Server/ADT/Changeling/Role/ChangelingRoleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Shared.Roles;

namespace Content.Server.Roles;

[RegisterComponent]
public sealed partial class ChangelingRoleComponent : BaseMindRoleComponent
{
}
Loading
Loading