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

Еретики #63

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
809ea7c
Part 0
AverageNotDoingAnythingEnjoyer Nov 15, 2024
906167d
condemn zillions (#601)
whateverusername0 Sep 7, 2024
0aa66a3
Heretics changes part 1 (#615)
whateverusername0 Sep 9, 2024
7f94bcf
Heretics changes part 2 (#628)
whateverusername0 Sep 11, 2024
2bf4287
Heretics update part 3 (#726)
whateverusername0 Oct 5, 2024
6e41c24
Heretic rituals radial menu (#723)
BombasterDS Oct 10, 2024
bb25fd9
Heretics update part 4 (#795)
whateverusername0 Nov 3, 2024
97b3f1b
Переименование папок
AverageNotDoingAnythingEnjoyer Nov 15, 2024
f603763
upstream mind roles (#827)
whateverusername0 Nov 7, 2024
f89f867
Обожаю конфликты
AverageNotDoingAnythingEnjoyer Nov 15, 2024
526101f
Уэээ, конфликты
AverageNotDoingAnythingEnjoyer Nov 15, 2024
23732e1
53 _
AverageNotDoingAnythingEnjoyer Nov 15, 2024
6d718cf
Minor stuff fixes (#766)
BombasterDS Oct 15, 2024
49f4878
Fixed some Ritual of Knowledge items not working (#794)
TGRCdev Oct 30, 2024
d87c77c
fix objectives (#840)
whateverusername0 Nov 11, 2024
8941ecd
Локализация и попытка фикса
AverageNotDoingAnythingEnjoyer Nov 16, 2024
4e4b6a1
Begone noSpawn
AverageNotDoingAnythingEnjoyer Nov 17, 2024
d0f1f26
Бум
AverageNotDoingAnythingEnjoyer Nov 17, 2024
142e724
Хм
AverageNotDoingAnythingEnjoyer Nov 17, 2024
67845ff
Пупупу
AverageNotDoingAnythingEnjoyer Nov 17, 2024
a741116
Chat, am I stupid, chat?
AverageNotDoingAnythingEnjoyer Nov 19, 2024
8de6a55
Попытка в локаль номер Раз
AverageNotDoingAnythingEnjoyer Nov 19, 2024
cb6c183
Бум
AverageNotDoingAnythingEnjoyer Nov 19, 2024
a20cd00
Merge branch 'master' into Heretics
AverageNotDoingAnythingEnjoyer Nov 27, 2024
43bae10
Жужас
AverageNotDoingAnythingEnjoyer Nov 27, 2024
ee26024
Почему тут уже эти тэги есть, увы
AverageNotDoingAnythingEnjoyer Nov 27, 2024
5bf334e
Бум, и тэги уехали
AverageNotDoingAnythingEnjoyer Nov 27, 2024
ed583be
fix a lot of things (Heretics newstore fix)
AverageNotDoingAnythingEnjoyer Nov 27, 2024
457f9f0
Heretics update part 5 (#945)
whateverusername0 Nov 26, 2024
f429de6
Кто?
AverageNotDoingAnythingEnjoyer Nov 27, 2024
c1e5651
_GoobStation > _CorvaxNext
AwareFoxy Dec 6, 2024
f1a0482
Переводы
AwareFoxy Dec 7, 2024
927d991
bunch of fixes
AwareFoxy Dec 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@
</ItemGroup>
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
<Import Project="..\RobustToolbox\MSBuild\XamlIL.targets" />
<ItemGroup>
<EmbeddedResource Update="_Goobstation\Heretic\UI\HereticRitualRuneRadialMenu.xaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
61 changes: 61 additions & 0 deletions Content.Client/_CorvaxNext/Heretic/HereticCombatMarkSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Content.Shared.Heretic;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;

namespace Content.Client.Heretic;

public sealed partial class HereticCombatMarkSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HereticCombatMarkComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<HereticCombatMarkComponent, ComponentShutdown>(OnShutdown);
}
public override void Update(float frameTime)
{
base.Update(frameTime);

// i can't think of a better way to do this. everything else has failed
// god i hate client server i hate client server i hate client server i hate
foreach (var mark in EntityQuery<HereticCombatMarkComponent>())
{
if (!TryComp<SpriteComponent>(mark.Owner, out var sprite))
continue;

if (!sprite.LayerMapTryGet(0, out var layer))
continue;

sprite.LayerSetState(layer, mark.Path.ToLower());
}
}

private void OnStartup(Entity<HereticCombatMarkComponent> ent, ref ComponentStartup args)
{
if (!TryComp<SpriteComponent>(ent, out var sprite))
return;

if (sprite.LayerMapTryGet(0, out var l))
{
sprite.LayerSetState(l, ent.Comp.Path.ToLower());
return;
}

var rsi = new SpriteSpecifier.Rsi(new ResPath("_CorvaxNext/Heretic/combat_marks.rsi"), ent.Comp.Path.ToLower());
var layer = sprite.AddLayer(rsi);

sprite.LayerMapSet(0, layer);
sprite.LayerSetShader(layer, "unshaded");
}
private void OnShutdown(Entity<HereticCombatMarkComponent> ent, ref ComponentShutdown args)
{
if (!TryComp<SpriteComponent>(ent, out var sprite))
return;

if (!sprite.LayerMapTryGet(0, out var layer))
return;

sprite.RemoveLayer(layer);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Content.Client._CorvaxNext.Heretic.UI;
using Content.Shared._CorvaxNext.Heretic.Components;
using Content.Shared.Heretic.Prototypes;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;

namespace Content.Client._CorvaxNext.Heretic;

public sealed class HereticRitualRuneBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IClyde _displayManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!;

private HereticRitualRuneRadialMenu? _hereticRitualMenu;

public HereticRitualRuneBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this);
}

protected override void Open()
{
base.Open();

_hereticRitualMenu = this.CreateWindow<HereticRitualRuneRadialMenu>();
_hereticRitualMenu.SetEntity(Owner);
_hereticRitualMenu.SendHereticRitualRuneMessageAction += SendHereticRitualMessage;

var vpSize = _displayManager.ScreenSize;
_hereticRitualMenu.OpenCenteredAt(_inputManager.MouseScreenPosition.Position / vpSize);
}

private void SendHereticRitualMessage(ProtoId<HereticRitualPrototype> protoId)
{
SendMessage(new HereticRitualMessage(protoId));
}
}
68 changes: 68 additions & 0 deletions Content.Client/_CorvaxNext/Heretic/Ritual.CustomBehaviors.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using Content.Shared.Heretic.Prototypes;

namespace Content.Client.Heretic;

// these do nothing and are there just for yaml limter to shut the fuck up.
// make sure they stay up in sync with the server counterpart.
// regards.
// - john

public sealed partial class RitualAshAscendBehavior : RitualSacrificeBehavior { }
public sealed partial class RitualBladeAscendBehavior : RitualSacrificeBehavior { }
public sealed partial class RitualMuteGhoulifyBehavior : RitualSacrificeBehavior { }

[Virtual] public partial class RitualSacrificeBehavior : RitualCustomBehavior
{
public override bool Execute(RitualData args, out string? outstr)
{
outstr = null;
return true;
}

public override void Finalize(RitualData args)
{
// do nothing
}
}

public sealed partial class RitualTemperatureBehavior : RitualCustomBehavior
{
public override bool Execute(RitualData args, out string? outstr)
{
outstr = null;
return true;
}

public override void Finalize(RitualData args)
{
// do nothing
}
}

public sealed partial class RitualReagentPuddleBehavior : RitualCustomBehavior
{
public override bool Execute(RitualData args, out string? outstr)
{
outstr = null;
return true;
}

public override void Finalize(RitualData args)
{
// do nothing
}
}

public sealed partial class RitualKnowledgeBehavior : RitualCustomBehavior
{
public override bool Execute(RitualData args, out string? outstr)
{
outstr = null;
return true;
}

public override void Finalize(RitualData args)
{
// do nothing
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Heretic;
using Content.Shared.Heretic.Prototypes;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using System.Numerics;

namespace Content.Client._CorvaxNext.Heretic.UI;

public sealed partial class HereticRitualRuneRadialMenu : RadialMenu
{
[Dependency] private readonly EntityManager _entityManager = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
private readonly SpriteSystem _spriteSystem;

public event Action<ProtoId<HereticRitualPrototype>>? SendHereticRitualRuneMessageAction;

public EntityUid Entity { get; set; }

public HereticRitualRuneRadialMenu()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);
_spriteSystem = _entitySystem.GetEntitySystem<SpriteSystem>();
}

public void SetEntity(EntityUid uid)
{
Entity = uid;
RefreshUI();
}

private void RefreshUI()
{
var main = FindControl<RadialContainer>("Main");
if (main == null)
return;

var player = _playerManager.LocalEntity;

if (!_entityManager.TryGetComponent<HereticComponent>(player, out var heretic))
return;

foreach (var ritual in heretic.KnownRituals)
{
if (!_prototypeManager.TryIndex(ritual, out var ritualPrototype))
continue;

var button = new HereticRitualMenuButton
{
StyleClasses = { "RadialMenuButton" },
SetSize = new Vector2(64, 64),
ToolTip = Loc.GetString(ritualPrototype.LocName),
ProtoId = ritualPrototype.ID
};

var texture = new TextureRect
{
VerticalAlignment = VAlignment.Center,
HorizontalAlignment = HAlignment.Center,
Texture = _spriteSystem.Frame0(ritualPrototype.Icon),
TextureScale = new Vector2(2f, 2f)
};

button.AddChild(texture);
main.AddChild(button);
}

AddHereticRitualMenuButtonOnClickAction(main);
}

private void AddHereticRitualMenuButtonOnClickAction(RadialContainer mainControl)
{
if (mainControl == null)
return;

foreach(var child in mainControl.Children)
{
var castChild = child as HereticRitualMenuButton;

if (castChild == null)
continue;

castChild.OnButtonUp += _ =>
{
SendHereticRitualRuneMessageAction?.Invoke(castChild.ProtoId);
Close();
};
}
}

public sealed class HereticRitualMenuButton : RadialMenuTextureButton
{
public ProtoId<HereticRitualPrototype> ProtoId { get; set; }
}
}
16 changes: 16 additions & 0 deletions Content.Client/_CorvaxNext/Heretic/UI/LivingHeartMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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">

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


</ui:RadialMenu>
Loading
Loading