forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Thief minor antagonist (space-wizards#21520)
* start working * add right-click thief antagins some architecture restruct * add meh thief greeting audio * add thief subgamemode to Traitors gamemode * add late join thief (not tested yet) add briefing * add pacifism * add Steal tasks to thief * fix crash thief+traitor on person * add new condition: collection steal * add tracking of succes collection objective * add stamp collection target remove some boring steal target add check pulling entity to collection target * finalize first 2 group objective * start merging stealing objective systems * merging * finish merging. Now traitor steal objective work better * we don't check the items of pullable sentient entity * clear naming, enable thief signle item objective start * objective pack add * finish with steal item objectives * convert string to ProtoId<> * some clean up * add thieves to revolution game mode * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Flareguy <[email protected]> * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Flareguy <[email protected]> * update pacifism: fix crashing, monkey-thief without pacified * adaptive animal briefing, cleaning locales * add structure steal objectives * remove RCD target * add thiefs to manifest, but bug with traitor duplications * add escape objective * add chat briefing * setup animal objective group system * add animal steal objectives * add animal objectives notroleconditions * add morty * now thief mode has a chance of not launching Now there are a random number of thieves per round from 1 to 3 * 6 hours of trying to fix duplicate tasks. Failure * added thief pinpointer (buggy) * start thief backpack UI work * revert pinpointer for scope reason * UI continue work * add thief starter kits content * remove ERP kit * finally! giving starting items to thief. Now it playable, but still need more work * clean up * fix * fox * add merged items into thief new Starting Kit (buggy) * fix YES antag menu * objection tweaks * remove hearts objective, working on spawning things from toolbox * smug * fixes * add race specifier objective condition LAMPS * meh * fix fix fix * the alive * Adding stamps * Update backpack.ftl * Revert1 * Revert ftl * add voice mask to communicator kit * Update Resources/Locale/en-US/administration/antag.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/objectives/conditions/steal.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/prototypes/roles/antags.ftl Co-authored-by: Colin-Tel <[email protected]> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <[email protected]> * update * fix * more reusable function, add documentation * fix doc * faint fixes --------- Co-authored-by: Flareguy <[email protected]> Co-authored-by: Colin-Tel <[email protected]>
- Loading branch information
Showing
94 changed files
with
2,544 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Content.Shared.Thief; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Thief; | ||
|
||
[UsedImplicitly] | ||
public sealed class ThiefBackpackBoundUserInterface : BoundUserInterface | ||
{ | ||
private ThiefBackpackMenu? _window; | ||
|
||
public ThiefBackpackBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
_window = new ThiefBackpackMenu(this); | ||
_window.OnClose += Close; | ||
_window.OpenCentered(); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
_window?.Dispose(); | ||
_window = null; | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
|
||
if (state is not ThiefBackpackBoundUserInterfaceState current) | ||
return; | ||
|
||
_window?.UpdateState(current); | ||
} | ||
|
||
public void SendChangeSelected(int setNumber) | ||
{ | ||
SendMessage(new ThiefBackpackChangeSetMessage(setNumber)); | ||
} | ||
|
||
public void SendApprove() | ||
{ | ||
SendMessage(new ThiefBackpackApproveMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
Title="{Loc 'thief-backpack-window-title'}" | ||
MinSize="700 700"> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True"> | ||
<!-- First Informational panel --> | ||
<Label Text="{Loc 'thief-backpack-window-description'}" Margin="5 5"/> | ||
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/> | ||
<Label Name="SelectedSets" Text="{Loc 'thief-backpack-window-selected'}" Margin="5 5"/> | ||
|
||
<!-- Second sets panel --> | ||
<PanelContainer Margin="5 5"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#050505" /> | ||
</PanelContainer.PanelOverride> | ||
<ScrollContainer | ||
HScrollEnabled="False" | ||
MinSize="0 600" | ||
SizeFlagsStretchRatio="2" | ||
VerticalExpand="True"> | ||
<BoxContainer Name="SetsGrid" Orientation="Vertical" MinSize="460 200"> | ||
<!-- Sets is filled by code --> | ||
|
||
</BoxContainer> | ||
</ScrollContainer> | ||
</PanelContainer> | ||
|
||
<!-- Third approve button panel --> | ||
<PanelContainer Margin="10"> | ||
<Button Name="ApproveButton" | ||
Text="{Loc 'thief-backpack-window-approve-button'}" | ||
Margin="0 5" | ||
Access="Public" | ||
HorizontalAlignment ="Right" | ||
StyleClasses="OpenRight"/> | ||
</PanelContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared.Thief; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client.Thief; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ThiefBackpackMenu : FancyWindow | ||
{ | ||
[Dependency] private readonly IEntitySystemManager _sysMan = default!; | ||
private readonly SpriteSystem _spriteSystem; | ||
|
||
private readonly ThiefBackpackBoundUserInterface _owner; | ||
|
||
public ThiefBackpackMenu(ThiefBackpackBoundUserInterface owner) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
_spriteSystem = _sysMan.GetEntitySystem<SpriteSystem>(); | ||
|
||
_owner = owner; | ||
|
||
ApproveButton.OnButtonDown += (args) => | ||
{ | ||
_owner.SendApprove(); | ||
}; | ||
} | ||
|
||
public void UpdateState(ThiefBackpackBoundUserInterfaceState state) | ||
{ | ||
SetsGrid.RemoveAllChildren(); | ||
int count = 0; | ||
int selectedNumber = 0; | ||
foreach (var set in state.Sets) | ||
{ | ||
var child = new ThiefBackpackSet(set.Value, _spriteSystem); | ||
|
||
child.SetButton.OnButtonDown += (args) => | ||
{ | ||
_owner.SendChangeSelected(set.Key); | ||
}; | ||
|
||
SetsGrid.AddChild(child); | ||
|
||
count++; | ||
|
||
if (set.Value.Selected) | ||
selectedNumber++; | ||
} | ||
|
||
SelectedSets.Text = Loc.GetString("thief-backpack-window-selected", ("selectedCount", selectedNumber), ("maxCount", state.MaxSelectedSets)); | ||
ApproveButton.Disabled = selectedNumber == state.MaxSelectedSets ? false : true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Control xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"> | ||
<!-- Name and button --> | ||
<PanelContainer Margin="5 5 0 5"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#18211b" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="True"> | ||
<GridContainer Margin="5" Columns="2" MinSize="600 0"> | ||
<Label Name="SetName" Text="Set" StyleClasses="StatusFieldTitle"></Label> | ||
<Button Margin="0 10" Name="SetButton" Text="Select" StyleClasses="OpenRight" Access="Public" HorizontalAlignment="Right"/> | ||
</GridContainer> | ||
<controls:HLine Color="#404040" Thickness="1" Margin="0 5"/> | ||
<!-- Icon and Description --> | ||
<GridContainer Margin="0 5" Columns="2"> | ||
<TextureRect Name="Icon" Margin="10" Stretch="KeepAspectCentered" | ||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="64 64"/> | ||
<Label Name="SetDescription" Text="Description"></Label> | ||
</GridContainer> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</Control> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.XAML; | ||
using Content.Shared.Thief; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Thief; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ThiefBackpackSet : Control | ||
{ | ||
public ThiefBackpackSet(ThiefBackpackSetInfo set, SpriteSystem spriteSystem) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
Icon.Texture = spriteSystem.Frame0(set.Sprite); | ||
SetName.Text = Loc.GetString(set.Name); | ||
SetDescription.Text = Loc.GetString(set.Description); | ||
SetButton.Text = Loc.GetString(set.Selected ? "thief-backpack-button-deselect" : "thief-backpack-button-select"); | ||
SetButton.ModulateSelfOverride = set.Selected ? new Color(40, 84, 35) : new Color(68, 75, 103); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Content.Server/GameTicking/Rules/Components/ThiefRuleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.Roles; | ||
using Robust.Shared.Player; | ||
using Content.Shared.Preferences; | ||
|
||
namespace Content.Server.GameTicking.Rules.Components; | ||
|
||
/// <summary> | ||
/// Stores data for <see cref="ThiefRuleSystem/">. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(ThiefRuleSystem))] | ||
public sealed partial class ThiefRuleComponent : Component | ||
{ | ||
/// <summary> | ||
/// A chance for this mode to be added to the game. | ||
/// </summary> | ||
[DataField] | ||
public float RuleChance = 1f; | ||
|
||
[DataField] | ||
public ProtoId<AntagPrototype> ThiefPrototypeId = "Thief"; | ||
|
||
public Dictionary<ICommonSession, HumanoidCharacterProfile> StartCandidates = new(); | ||
|
||
[DataField] | ||
public float MaxObjectiveDifficulty = 2.5f; | ||
|
||
[DataField] | ||
public int MaxStealObjectives = 10; | ||
|
||
/// <summary> | ||
/// Things that will be given to thieves | ||
/// </summary> | ||
[DataField] | ||
public List<EntProtoId> StarterItems = new List<EntProtoId> { "ToolboxThief", "ClothingHandsChameleonThief" }; //TO DO - replace to chameleon thieving gloves whem merg | ||
|
||
/// <summary> | ||
/// All Thiefes created by this rule | ||
/// </summary> | ||
public readonly List<EntityUid> ThiefMinds = new(); | ||
|
||
/// <summary> | ||
/// Max Thiefs created by rule on roundstart | ||
/// </summary> | ||
[DataField] | ||
public int MaxAllowThief = 3; | ||
|
||
/// <summary> | ||
/// Sound played when making the player a thief via antag control or ghost role | ||
/// </summary> | ||
[DataField] | ||
public SoundSpecifier? GreetingSound = new SoundPathSpecifier("/Audio/Misc/thief_greeting.ogg"); | ||
} |
Oops, something went wrong.