diff --git a/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEui.cs b/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEui.cs new file mode 100644 index 00000000000..ca5ae4f8eb2 --- /dev/null +++ b/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEui.cs @@ -0,0 +1,45 @@ +using Content.Client.Eui; +using Content.Shared.Cloning; +using JetBrains.Annotations; +using Robust.Client.Graphics; +using Content.Shared.Revolutionary; +using Content.Shared.Bible.Components; + +namespace Content.Client.Revolutionary; + +[UsedImplicitly] +public sealed class AcceptRevolutionEui : BaseEui +{ + private readonly AcceptRevolutionWindow _window; + + public AcceptRevolutionEui() + { + _window = new AcceptRevolutionWindow(); + + _window.DenyButton.OnPressed += _ => + { + SendMessage(new AcceptRevolutionChoiceMessage(AcceptRevolutionButton.Deny)); + _window.Close(); + }; + + _window.OnClose += () => SendMessage(new AcceptRevolutionChoiceMessage(AcceptRevolutionButton.Deny)); + + _window.AcceptButton.OnPressed += _ => + { + SendMessage(new AcceptRevolutionChoiceMessage(AcceptRevolutionButton.Accept)); + _window.Close(); + }; + } + + public override void Opened() + { + IoCManager.Resolve().RequestWindowAttention(); + _window.OpenCentered(); + } + + public override void Closed() + { + _window.Close(); + } + +} diff --git a/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEuiWindow.cs b/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEuiWindow.cs new file mode 100644 index 00000000000..a014a2a1c1b --- /dev/null +++ b/Content.Client/ADT/Revolutionary/EUI/AcceptRevolutionEuiWindow.cs @@ -0,0 +1,61 @@ +using System.Numerics; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.CustomControls; +using Robust.Shared.Localization; +using static Robust.Client.UserInterface.Controls.BoxContainer; + +namespace Content.Client.Revolutionary; + +public sealed class AcceptRevolutionWindow : DefaultWindow +{ + public readonly Button DenyButton; + public readonly Button AcceptButton; + + public AcceptRevolutionWindow() + { + + Title = Loc.GetString("accept-revolution-window-title"); + + Contents.AddChild(new BoxContainer + { + Orientation = LayoutOrientation.Vertical, + Children = + { + new BoxContainer + { + Orientation = LayoutOrientation.Vertical, + Children = + { + (new Label() + { + Text = Loc.GetString("accept-revolution-window-prompt-text-part") + }), + new BoxContainer + { + Orientation = LayoutOrientation.Horizontal, + Align = AlignMode.Center, + Children = + { + (AcceptButton = new Button + { + Text = Loc.GetString("accept-revolution-window-accept-button"), + }), + + (new Control() + { + MinSize = new Vector2(20, 0) + }), + + (DenyButton = new Button + { + Text = Loc.GetString("accept-revolution-window-deny-button"), + }) + } + }, + } + }, + } + }); + } +} diff --git a/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs b/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs new file mode 100644 index 00000000000..8baecebfbfe --- /dev/null +++ b/Content.Server/ADT/Revolitionary/EUI/AcceptRevolutionEui.cs @@ -0,0 +1,40 @@ +using Content.Server.EUI; +using Content.Shared.Revolutionary; +using Content.Shared.Eui; +using Content.Shared.Bible.Components; +using Content.Server.Bible; +using Content.Shared.Revolutionary.Components; +using Content.Server.GameTicking.Rules; + +namespace Content.Server.Revolutionary; + +public sealed class AcceptRevolutionEui : BaseEui +{ + private readonly EntityUid _uid; + private readonly EntityUid _target; + private readonly HeadRevolutionaryComponent _comp; + private readonly RevolutionaryRuleSystem _headrev; + + public AcceptRevolutionEui(EntityUid uid, EntityUid target, HeadRevolutionaryComponent comp, RevolutionaryRuleSystem headrev) + { + _uid = uid; + _target = target; + _comp = comp; + _headrev = headrev; + } + + public override void HandleMessage(EuiMessageBase msg) + { + base.HandleMessage(msg); + + if (msg is not AcceptRevolutionChoiceMessage choice || + choice.Button == AcceptRevolutionButton.Deny) + { + Close(); + return; + } + + _headrev.MakeEntRev(_uid, _target, _comp); + Close(); + } +} diff --git a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs index e1011f16d0f..3de9f916d7e 100644 --- a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs @@ -63,7 +63,6 @@ public override void Initialize() SubscribeLocalEvent(OnHeadRevMobStateChanged); SubscribeLocalEvent(OnGetBriefing); - } protected override void Started(EntityUid uid, RevolutionaryRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) @@ -144,6 +143,16 @@ private void OnPostFlash(EntityUid uid, HeadRevolutionaryComponent comp, ref Aft return; } + //ADT rerev start + if (mind == null || mind.Session == null || ev.User == null) + return; + + if (comp.ConvertedCount <= 15) + { + _euiMan.OpenEui(new AcceptRevolutionEui(ev.User.Value, ev.Target, comp, this), mind.Session); + return; + } + //ADT rerev end _npcFaction.AddFaction(ev.Target, RevolutionaryNpcFaction); var revComp = EnsureComp(ev.Target); @@ -155,8 +164,9 @@ private void OnPostFlash(EntityUid uid, HeadRevolutionaryComponent comp, ref Aft if (_mind.TryGetMind(ev.User.Value, out var revMindId, out _)) { - if (_role.MindHasRole(revMindId, out var role)) - role.Value.Comp2.ConvertedCount++; + // if (_role.MindHasRole(revMindId, out var role)) //ADT rerev start + // role.Value.Comp2.ConvertedCount++; + comp.ConvertedCount++; //ADT rerev end } } @@ -203,8 +213,8 @@ private void OnHeadRevMobStateChanged(EntityUid uid, HeadRevolutionaryComponent /// private bool CheckRevsLose() { - ///ADT метод полностью переписан - ///ADT start + //ADT метод полностью переписан + //ADT start var headRevList = new List(); var headRevs = AllEntityQuery(); @@ -256,7 +266,7 @@ private bool IsGroupDead(List list, bool checkOffStation, int? Dead = return dead == list.Count || list.Count == 0; } - ///ADT end + //ADT end @@ -311,4 +321,23 @@ private bool IsGroupDetainedOrDead(List list, bool checkOffStation, b // revs lost and heads died "rev-stalemate" }; + //ADT rerev start + + public void MakeEntRev(EntityUid user, EntityUid target, HeadRevolutionaryComponent comp) + { + if (!_mind.TryGetMind(target, out var mindId, out var mind)) + return; + + _npcFaction.AddFaction(target, RevolutionaryNpcFaction); + var revComp = EnsureComp(target); + + + _adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(user)} converted {ToPrettyString(target)} into a Revolutionary"); + + comp.ConvertedCount++; + + if (mind?.Session != null) + _antag.SendBriefing(mind.Session, Loc.GetString("rev-role-greeting"), Color.Red, revComp.RevStartSound); + } + //ADT rerev end } diff --git a/Content.Shared/ADT/Revolutinary/EUI/AcceptRevolutionEuiMessage.cs b/Content.Shared/ADT/Revolutinary/EUI/AcceptRevolutionEuiMessage.cs new file mode 100644 index 00000000000..4ed6a5c30f6 --- /dev/null +++ b/Content.Shared/ADT/Revolutinary/EUI/AcceptRevolutionEuiMessage.cs @@ -0,0 +1,22 @@ +using Content.Shared.Eui; +using Robust.Shared.Serialization; + +namespace Content.Shared.Revolutionary; + +[Serializable, NetSerializable] +public enum AcceptRevolutionButton +{ + Deny, + Accept, +} + +[Serializable, NetSerializable] +public sealed class AcceptRevolutionChoiceMessage : EuiMessageBase +{ + public readonly AcceptRevolutionButton Button; + + public AcceptRevolutionChoiceMessage(AcceptRevolutionButton button) + { + Button = button; + } +} diff --git a/Content.Shared/Revolutionary/Components/HeadRevolutionaryComponent.cs b/Content.Shared/Revolutionary/Components/HeadRevolutionaryComponent.cs index 12589850e66..0a544ee798b 100644 --- a/Content.Shared/Revolutionary/Components/HeadRevolutionaryComponent.cs +++ b/Content.Shared/Revolutionary/Components/HeadRevolutionaryComponent.cs @@ -24,4 +24,26 @@ public sealed partial class HeadRevolutionaryComponent : Component public TimeSpan StunTime = TimeSpan.FromSeconds(3); public override bool SessionSpecific => true; + + /// + /// ADT - wizden bugfix + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public uint ConvertedCount = 0; +} +// ADT rerev start +[ByRefEvent] +public sealed class ConvertAttemtEvent +{ + public EntityUid User; + public EntityUid Target; + public HeadRevolutionaryComponent? Comp; + + public ConvertAttemtEvent(EntityUid user, EntityUid target, HeadRevolutionaryComponent? comp) + { + Target = target; + User = user; + Comp = comp; + } } +// ADT rerev end diff --git a/Resources/Locale/ru-RU/ADT/Objects/Tools/emag.ftl b/Resources/Locale/ru-RU/ADT/Objects/Tools/emag.ftl new file mode 100644 index 00000000000..44d26d4b918 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/Objects/Tools/emag.ftl @@ -0,0 +1,3 @@ +ent-ADTEmagHandMade = модифицированная ID карта + .desc = Выглядит как айди карта, к котрой привязали мультитул, бумагу, а так же ещё несколько инструментов. Пахнет довольно красновато. + diff --git a/Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Specific/revtoolbox.ftl b/Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Specific/revtoolbox.ftl new file mode 100644 index 00000000000..74ff55d7546 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Specific/revtoolbox.ftl @@ -0,0 +1,2 @@ +ent-ADTToolboxRevolution = аварийный ящик инструментов + .desc = Довольно компактный, однако. diff --git a/Resources/Locale/ru-RU/ADT/revolution/eui.ftl b/Resources/Locale/ru-RU/ADT/revolution/eui.ftl new file mode 100644 index 00000000000..21a0321f1f7 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/revolution/eui.ftl @@ -0,0 +1,5 @@ +# EUI +accept-revolution-window-title = Революция +accept-revolution-window-prompt-text-part = Что-то стремится подчинить вашу волю себе, вы ощущаете сильное желание перемен и мятежа. Сопротивляетесь ли вы, или подчинитесь их воле? +accept-revolution-window-accept-button = Поддатся +accept-revolution-window-deny-button = Сопротивлятся diff --git a/Resources/Locale/ru-RU/ADT/revolution/toolbox.ftl b/Resources/Locale/ru-RU/ADT/revolution/toolbox.ftl new file mode 100644 index 00000000000..e2c437aa894 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/revolution/toolbox.ftl @@ -0,0 +1,37 @@ +revolution-toolbox-category-all-hands-master-name = Набор мастера на все руки + +revolution-toolbox-category-all-hands-master-description = + Набор для по-настоящему универсальных революционеров! + Содержит: подозрительный ящик инструментов, прототип + криптографического ключа, МК58 + +revolution-toolbox-category-subversion-name = Набор юного подрывника + +revolution-toolbox-category-subversion-description = + Набор, чтобы устроить настоящий хаос на станции! + влючает в себя: 3 кувшина калия, 1 кувшин угля, + 1 кувшин серы, 4 хим. заряда, 3 таймер-триггера, + 3 сигнальных триггера, продвинутый передатчик сигналов + +revolution-toolbox-category-technolover-name = Набор любителя технологий + +revolution-toolbox-category-technolover-description = + Для любителей хакинга, ИИ, боргов а так же троллiiн2а + влючает в себя: айди карта с доступом в кабинет научного + руководлителя, мультитул, плата загрузки законов ИИ, + мониторинг экипажа и набор тролля "близнецы" + +revolution-toolbox-category-gunsmith-name = Набор юного оружейника + +revolution-toolbox-category-gunsmith-description = + Выдайте вам и вашим товарищам по пистолету! + Включает в себя: 3 самодельных пистолета, + 3 самодельных лазера, 1 инспектор и бензопилу + +revolution-toolbox-category-printing-name = Набор печатания + +revolution-toolbox-category-printing-description = + Вы что-то хотите? Напечатайте! + включает в себя: плата автолата, плата протолата, + плата фабрикатора экзоклстюмов, плата ТехФаба патронов, + плата охранного техфаба. \ No newline at end of file diff --git a/Resources/Prototypes/ADT/Catalog/Fills/Boxes/boxes.yml b/Resources/Prototypes/ADT/Catalog/Fills/Boxes/boxes.yml index 6621ce414d5..26fea765e66 100644 --- a/Resources/Prototypes/ADT/Catalog/Fills/Boxes/boxes.yml +++ b/Resources/Prototypes/ADT/Catalog/Fills/Boxes/boxes.yml @@ -687,6 +687,12 @@ - id: ADTClothingHeadHatHornsSollux - id: ADTClothingShoesBootsSollux - id: ADTClothingUniformJumpsuitSollux + - type: Storage + maxItemSize: Normal + grid: + - 0,0,3,2 + - type: Item + size: Large # Bad Police diff --git a/Resources/Prototypes/ADT/Catalog/revolution_toolbox_sets.yml b/Resources/Prototypes/ADT/Catalog/revolution_toolbox_sets.yml new file mode 100644 index 00000000000..e2dd0d4fd1d --- /dev/null +++ b/Resources/Prototypes/ADT/Catalog/revolution_toolbox_sets.yml @@ -0,0 +1,79 @@ +- type: thiefBackpackSet + id: ADTAllHandMaster + name: revolution-toolbox-category-all-hands-master-name + description: revolution-toolbox-category-all-hands-master-description + sprite: + sprite: /Textures/Objects/Tools/Toolboxes/toolbox_syn.rsi + state: icon-open + content: + - ADTEmagHandMade + - WeaponPistolMk58 + - ToolboxSyndicateFilled + +- type: thiefBackpackSet + id: ADTSubversion + name: revolution-toolbox-category-subversion-name + description: revolution-toolbox-category-subversion-description + sprite: + sprite: /Textures/Objects/Weapons/Grenades/modular.rsi + state: no-trigger + content: + - JugPotassium + - JugPotassium + - JugPotassium + - JugSulfur + - ADTJugCharcoal + - TimerTrigger + - TimerTrigger + - TimerTrigger + - SignalTrigger + - SignalTrigger + - SignalTrigger + - ChemicalPayload + - ChemicalPayload + - ChemicalPayload + - ChemicalPayload + +- type: thiefBackpackSet + id: ADTTechnolover + name: revolution-toolbox-category-technolover-name + description: revolution-toolbox-category-technolover-description + sprite: + sprite: /Textures/Mobs/Silicon/station_ai.rsi + state: ai_dead + content: + - ADTPassagerRDIDCard + - ADTCustomLawCircuitBoard + - HandheldCrewMonitor + - ADTBoxSollux + +- type: thiefBackpackSet + id: ADTGunsmith + name: revolution-toolbox-category-gunsmith-name + description: revolution-toolbox-category-gunsmith-description + sprite: + sprite: /Textures/Objects/Weapons/Guns/Shotguns/hm_pistol.rsi + state: bolt-open + content: + - WeaponShotgunHandmade + - WeaponShotgunHandmade + - WeaponShotgunHandmade + - WeaponMakeshiftLaser + - WeaponMakeshiftLaser + - WeaponMakeshiftLaser + - WeaponRevolverInspector + - Chainsaw + +- type: thiefBackpackSet + id: ADTPrinting + name: revolution-toolbox-category-printing-name + description: revolution-toolbox-category-printing-description + sprite: + sprite: /Textures/Objects/Misc/module.rsi + state: generic + content: + - AutolatheMachineCircuitboard + - ProtolatheMachineCircuitboard + - ExosuitFabricatorMachineCircuitboard + - AmmoTechFabCircuitboard + - SecurityTechFabCircuitboard \ No newline at end of file diff --git a/Resources/Prototypes/ADT/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/ADT/Entities/Objects/Misc/identification_cards.yml index 4430368566e..469e22d75d0 100644 --- a/Resources/Prototypes/ADT/Entities/Objects/Misc/identification_cards.yml +++ b/Resources/Prototypes/ADT/Entities/Objects/Misc/identification_cards.yml @@ -180,3 +180,13 @@ - state: id-guardofficer - type: PresetIdCard job: ADTGuardOfficer + +- type: entity + parent: PassengerIDCard + id: ADTPassagerRDIDCard + components: + - type: PresetIdCard + job: Passenger + - type: Access + groups: + - Research \ No newline at end of file diff --git a/Resources/Prototypes/ADT/Entities/Objects/Specific/chemical-containers.yml b/Resources/Prototypes/ADT/Entities/Objects/Specific/chemical-containers.yml new file mode 100644 index 00000000000..9c6be4e1852 --- /dev/null +++ b/Resources/Prototypes/ADT/Entities/Objects/Specific/chemical-containers.yml @@ -0,0 +1,14 @@ +- type: entity + parent: Jug + suffix: charcoal + id: ADTJugCharcoal + categories: [ HideSpawnMenu ] + components: + - type: Label + currentLabel: reagent-name-Charcoal + - type: SolutionContainerManager + solutions: + beaker: + reagents: + - ReagentId: Charcoal + Quantity: 200 \ No newline at end of file diff --git a/Resources/Prototypes/ADT/Entities/Objects/Specific/revtoolbox.yml b/Resources/Prototypes/ADT/Entities/Objects/Specific/revtoolbox.yml new file mode 100644 index 00000000000..0af144de2e3 --- /dev/null +++ b/Resources/Prototypes/ADT/Entities/Objects/Specific/revtoolbox.yml @@ -0,0 +1,23 @@ + +- type: entity + id: ADTToolboxRevolution + name: emergency toolbox + description: A bright red toolbox, stocked with emergency tools. + parent: BaseItem + components: + - type: Sprite + sprite: Objects/Tools/Toolboxes/toolbox_red.rsi + state: icon + - type: ThiefUndeterminedBackpack + possibleSets: + - ADTAllHandMaster + - ADTSubversion + - ADTTechnolover + - ADTGunsmith + - ADTPrinting + - type: ActivatableUI + key: enum.ThiefBackpackUIKey.Key + - type: UserInterface + interfaces: + enum.ThiefBackpackUIKey.Key: + type: ThiefBackpackBoundUserInterface \ No newline at end of file diff --git a/Resources/Prototypes/ADT/Entities/Objects/Tools/emag.yml b/Resources/Prototypes/ADT/Entities/Objects/Tools/emag.yml new file mode 100644 index 00000000000..b411c4b5660 --- /dev/null +++ b/Resources/Prototypes/ADT/Entities/Objects/Tools/emag.yml @@ -0,0 +1,16 @@ +- type: entity + parent: BaseItem + id: ADTEmagHandMade + name: modificated ID card + description: A hand-made emag analog. It smells pretty red. + components: + - type: Emag + - type: Sprite + sprite: ADT/Objects/Tools/emag_handmade.rsi + state: icon + - type: Item + sprite: ADT/Objects/Tools/emag_handmade.rsi + storedRotation: -90 + - type: LimitedCharges + charges: 10 + maxCharges: 10 \ No newline at end of file diff --git a/Resources/Prototypes/Roles/Antags/revolutionary.yml b/Resources/Prototypes/Roles/Antags/revolutionary.yml index 7beeeb41f6e..21353574541 100644 --- a/Resources/Prototypes/Roles/Antags/revolutionary.yml +++ b/Resources/Prototypes/Roles/Antags/revolutionary.yml @@ -23,3 +23,4 @@ back: - Flash - ClothingEyesGlassesSunglasses + - ADTToolboxRevolution #ADT revolution diff --git a/Resources/Prototypes/secret_weights.yml b/Resources/Prototypes/secret_weights.yml index da668a7ba2d..5a5ba7010b9 100644 --- a/Resources/Prototypes/secret_weights.yml +++ b/Resources/Prototypes/secret_weights.yml @@ -2,12 +2,12 @@ id: Secret weights: Nukeops: 0.15 - Traitor: 0.44 + Traitor: 0.30 Zombie: 0 Zombieteors: 0 #Survival: 0.1 KesslerSyndrome: 0.01 #Phantom: 0.15 - Revolutionary: 0 + Revolutionary: 0.14 Heretic: 0.15 diff --git a/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/icon.png b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/icon.png new file mode 100644 index 00000000000..f501c843e00 Binary files /dev/null and b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/icon.png differ diff --git a/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-left.png b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-left.png new file mode 100644 index 00000000000..f273903cb6e Binary files /dev/null and b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-left.png differ diff --git a/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-right.png b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-right.png new file mode 100644 index 00000000000..f6933973f2b Binary files /dev/null and b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/inhand-right.png differ diff --git a/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/meta.json b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/meta.json new file mode 100644 index 00000000000..027b8b003c9 --- /dev/null +++ b/Resources/Textures/ADT/Objects/Tools/emag_handmade.rsi/meta.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Made by Ratyyy", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "icon" + } + ] +}