Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions Content.Client/_White/Contract/UI/ContractorBUI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Client._White.Contract.UI;

public sealed class ContractorBUI : BoundUserInterface
{
private ContractorWindow? _window;

public ContractorBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
}
42 changes: 42 additions & 0 deletions Content.Client/_White/Contract/UI/ContractorWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Аплинк контрактника"
MinWidth="500"
MinHeight="500"
Width="650"
Height="600">
<BoxContainer Orientation="Vertical" Margin="5">
<PanelContainer StyleClasses="SyndBackground" MinHeight="60">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" Margin="5">
<Label Text="SYNDICATE" StyleClasses="SyndHeader" Margin="5 0 0 0" VerticalAlignment="Center" />
<Control HorizontalExpand="True" />
<BoxContainer Orientation="Vertical" VerticalAlignment="Center" Margin="0 0 5 0">
<Label Text="Репутация:" HorizontalAlignment="Right" StyleClasses="SyndText" />
<Label Name="ReputationLabel" Text="0" HorizontalAlignment="Right" StyleClasses="SyndValue" />
</BoxContainer>
</BoxContainer>
</PanelContainer>

<BoxContainer Orientation="Vertical" VerticalExpand="True" Margin="0 10 0 0">
<Label Name="ContractsHeaderLabel"
Text="Доступные контракты:"
StyleClasses="SyndHeading"
HorizontalAlignment="Center"
Margin="0 0 0 5" />

<ScrollContainer VerticalExpand="True" HorizontalExpand="True">
<BoxContainer Name="ContractsContainer"
Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True" />
</ScrollContainer>

<PanelContainer StyleClasses="SyndTips" MinHeight="40" Margin="0 10 0 0">
<Label Text="Выполняйте контракты для повышения репутации и получения ТК."
HorizontalAlignment="Center"
VerticalAlignment="Center"
StyleClasses="SyndTipsText" />
</PanelContainer>
</BoxContainer>
</BoxContainer>
</DefaultWindow>
17 changes: 17 additions & 0 deletions Content.Client/_White/Contract/UI/ContractorWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client._White.Contract.UI;

[GenerateTypedNameReferences]
public sealed partial class ContractorWindow : DefaultWindow
{
private readonly ContractorBoundUserInterface _owner;
public ContractorWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}
}
2 changes: 2 additions & 0 deletions Content.Server/Guardian/GuardianComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,7 @@ public sealed partial class GuardianComponent : Component
public EntProtoId Action = "ActionToggleGuardian";

[DataField] public EntityUid? ActionEntity;

[DataField] public TimeSpan KnockDownCharger = TimeSpan.FromSeconds(2);
}
}
4 changes: 4 additions & 0 deletions Content.Server/Guardian/GuardianSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.Body.Systems;
using Content.Server.Lightning;
using Content.Server.Popups;
using Content.Server.Stunnable;
using Content.Shared._White.Guardian;
using Content.Shared.Actions;
using Content.Shared.Damage;
Expand Down Expand Up @@ -40,6 +41,7 @@ public sealed class GuardianSystem : EntitySystem
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
[Dependency] private readonly LightningSystem _lightningSystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly StunSystem _stunSystem = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -305,6 +307,8 @@ private void OnGuardianAttackAttempt(EntityUid uid, GuardianComponent component,
_handsSystem.TryDrop(target, hand);
}

_stunSystem.TryKnockdown(target, component.KnockDownCharger, true);

component.IsCharged = false;
}
}
Expand Down
51 changes: 51 additions & 0 deletions Content.Shared/_White/Contract/ContractEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Robust.Shared.Serialization;

namespace Content.Shared._White.Contract;

[Serializable, NetSerializable]
public sealed partial class ContractEntry
{
public string Id { get; set; } = string.Empty;

public string Name { get; set; } = string.Empty;

public string Description { get; set; } = string.Empty;

public ContractDifficulty Difficulty { get; set; } = ContractDifficulty.Easy;

public int TCReward { get; set; }

public int ReputationReward { get; set; }

public ContractStatus Status { get; set; } = ContractStatus.Available;

public EntityUid Target { get; set; }

public ContractEntry(string id, string name, string description, ContractDifficulty difficulty, int tcReward, int reputationReward, ContractStatus status, EntityUid target)
{
Id = id;
Name = name;
Description = description;
Difficulty = difficulty;
TCReward = tcReward;
ReputationReward = reputationReward;
Status = status;
Target = target;
}
}

public enum ContractStatus : byte
{
Available,
Active,
Completed,
Cancelled
}

public enum ContractDifficulty : byte
{
Easy,
Medium,
Hard
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Robust.Shared.Serialization;

namespace Content.Shared._White.Contract
{
[Serializable, NetSerializable]
public enum ContractorUplinkUiKey
{
Key
}

public sealed class ContractorBoundUserInterfaceState : BoundUserInterfaceState
{
public readonly List<ContractEntry> Contracts;
public readonly int Reputation;

public ContractorBoundUserInterfaceState(List<ContractEntry> contracts, int reputation)
{
Contracts = contracts;
Reputation = reputation;
}
}
}
9 changes: 5 additions & 4 deletions Resources/Prototypes/Entities/Mobs/Player/guardian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- type: MobMover
- type: InputMover
- type: Puller
needsHands: false
- type: MovementSpeedModifier
baseWalkSpeed: 4
baseSprintSpeed: 5.5
Expand Down Expand Up @@ -99,7 +100,7 @@

# From the uplink injector
- type: entity
name: HoloparasiteStandart
name: Holoparasite
id: MobHoloparasiteGuardianStandart
parent: MobGuardianBase
description: A mesmerising whirl of hard-light patterns weaves a marvelous, yet oddly familiar visage. It stands proud, tuning into its owner's life to sustain itself.
Expand Down Expand Up @@ -157,7 +158,7 @@
task: SimpleHumanoidHostileCompound

- type: entity
name: HoloparasiteAssasin
name: Holoparasite
id: MobHoloparasiteGuardianAssasin
parent: MobGuardianBase
description: A mesmerising whirl of hard-light patterns weaves a marvelous, yet oddly familiar visage. It stands proud, tuning into its owner's life to sustain itself.
Expand Down Expand Up @@ -215,7 +216,7 @@
task: SimpleHumanoidHostileCompound

- type: entity
name: HoloparasiteCharger
name: Holoparasite
id: MobHoloparasiteGuardianCharger
parent: MobGuardianBase
description: A mesmerising whirl of hard-light patterns weaves a marvelous, yet oddly familiar visage. It stands proud, tuning into its owner's life to sustain itself.
Expand Down Expand Up @@ -270,7 +271,7 @@
task: SimpleHumanoidHostileCompound

- type: entity
name: HoloparasiteLighting
name: Holoparasite
id: MobHoloparasiteGuardianLighting
parent: MobGuardianBase
description: A mesmerising whirl of hard-light patterns weaves a marvelous, yet oddly familiar visage. It stands proud, tuning into its owner's life to sustain itself.
Expand Down
13 changes: 13 additions & 0 deletions Resources/Prototypes/_White/Contract/contractUplink.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- type: entity
parent: BaseItem
id: SyndicateContractUplink
name: Аплинк контрактника
description: Suspiciously looking...
components:
- type: Sprite
sprite: White/Contract/contractor.rsi
state: icon
- type: Item
size: Normal
sprite: White/Contract/contractor.rsi
- type: GiftIgnore
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Resources/Textures/White/Contract/contractor.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Base sprite taken by tg station, remade by CaypenNow",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
}
]
}