From a39b3eddbde5bca73b6e129fa2079df0fc6eb3cc Mon Sep 17 00:00:00 2001 From: Arendian <137322659+Arendian@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:48:09 +0200 Subject: [PATCH] New implanters for uplink (#18038) * New implants for uplink * made changes based on reviews * was meant to be 3 --- .../Implants/SubdermalImplantSystem.cs | 30 +++++++++++++++++++ .../Components/SubdermalImplantComponent.cs | 5 ++++ Resources/Locale/en-US/implant/implant.ftl | 13 +++++++- .../Locale/en-US/store/uplink-catalog.ftl | 6 ++++ Resources/Prototypes/Actions/types.yml | 25 ++++++++++++++++ .../Prototypes/Catalog/uplink_catalog.yml | 24 ++++++++++++++- .../Prototypes/Entities/Mobs/Player/human.yml | 8 +++++ .../Entities/Objects/Misc/implanters.yml | 20 +++++++++++++ .../Objects/Misc/subdermal_implants.yml | 25 ++++++++++++++++ Resources/Prototypes/Polymorphs/polymorph.yml | 8 +++++ 10 files changed, 162 insertions(+), 2 deletions(-) diff --git a/Content.Server/Implants/SubdermalImplantSystem.cs b/Content.Server/Implants/SubdermalImplantSystem.cs index 92694b6a82..e87a955fd1 100644 --- a/Content.Server/Implants/SubdermalImplantSystem.cs +++ b/Content.Server/Implants/SubdermalImplantSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.Implants; using Content.Shared.Implants.Components; using Content.Shared.Interaction; using Content.Shared.Popups; +using Content.Server.Polymorph.Systems; namespace Content.Server.Implants; @@ -14,6 +15,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem [Dependency] private readonly CuffableSystem _cuffable = default!; [Dependency] private readonly StoreSystem _store = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; + [Dependency] private readonly PolymorphSystem _polymorph = default!; public override void Initialize() { @@ -21,6 +23,9 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem SubscribeLocalEvent(OnFreedomImplant); SubscribeLocalEvent>(OnStoreRelay); + SubscribeLocalEvent(OnActivateImplantEvent); + SubscribeLocalEvent(OnDnaScramblerImplant); + } private void OnStoreRelay(EntityUid uid, StoreComponent store, ImplantRelayEvent implantRelay) @@ -56,4 +61,29 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem _cuffable.Uncuff(component.ImplantedEntity.Value, cuffs.LastAddedCuffs, cuffs.LastAddedCuffs); args.Handled = true; } + + private void OnActivateImplantEvent(EntityUid uid, SubdermalImplantComponent component, ActivateImplantEvent args) + { + args.Handled = true; + } + + private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent component, UseDnaScramblerImplantEvent args) + { + if (component.ImplantedEntity == null) + return; + + var newIdentity = _polymorph.PolymorphEntity(component.ImplantedEntity.Value, "Scrambled"); + + //checks if someone is trying to use a dna scrambler implant while already scrambled + if (newIdentity == null) + { + _popup.PopupEntity(Loc.GetString("scramble-attempt-while-scrambled-popup"), component.ImplantedEntity.Value, component.ImplantedEntity.Value); + return; + } + + _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup", ("identity", newIdentity.Value)), newIdentity.Value, newIdentity.Value); + + args.Handled = true; + QueueDel(uid); + } } diff --git a/Content.Shared/Implants/Components/SubdermalImplantComponent.cs b/Content.Shared/Implants/Components/SubdermalImplantComponent.cs index a7dd56f2a0..680955c266 100644 --- a/Content.Shared/Implants/Components/SubdermalImplantComponent.cs +++ b/Content.Shared/Implants/Components/SubdermalImplantComponent.cs @@ -61,3 +61,8 @@ public sealed class OpenUplinkImplantEvent : InstantActionEvent { } + +public sealed class UseDnaScramblerImplantEvent : InstantActionEvent +{ + +} diff --git a/Resources/Locale/en-US/implant/implant.ftl b/Resources/Locale/en-US/implant/implant.ftl index 2ed667bedf..0548ff79a2 100644 --- a/Resources/Locale/en-US/implant/implant.ftl +++ b/Resources/Locale/en-US/implant/implant.ftl @@ -30,7 +30,18 @@ open-uplink-implant-action-description = Opens the syndicate uplink embedded und action-name-honk = Honk! action-desc-honk = Activates your honking implant, which will produce the signature sound of the clown. -## Implanter Messages +use-emp-implant-action-name = Activate EMP +use-emp-implant-action-description = Triggers a small EMP pulse around you + +use-dna-scrambler-implant-action-name = Scramble DNA +use-dna-scrambler-implant-action-description = LING IN MAINTS! + +## Implant Popups + +scramble-attempt-while-scrambled-popup = Scrambled DNA detected, please extract implant before undoing the current scramble. +scramble-implant-activated-popup = You transformed into {$identity} + +## Implant Messages deathrattle-implant-dead-message = {$user} has died at {$position}. deathrattle-implant-critical-message = {$user} life signs critical, immediate assistance required at {$position}. diff --git a/Resources/Locale/en-US/store/uplink-catalog.ftl b/Resources/Locale/en-US/store/uplink-catalog.ftl index ba07ce1df9..39aae85b9a 100644 --- a/Resources/Locale/en-US/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/store/uplink-catalog.ftl @@ -109,6 +109,12 @@ uplink-storage-implanter-desc = Hide goodies inside of yourself with new bluespa uplink-freedom-implanter-name = Freedom Implanter uplink-freedom-implanter-desc = Get away from those nasty sec officers with this three use implant! +uplink-dna-scrambler-implanter-name = DNA Scrambler Implanter +uplink-dna-scrambler-implanter-desc = A single use implant that can be activated to modify your DNA and give you a completely new look, also has the function of undoing the change. Unable to scramble already scrambled DNA. + +uplink-emp-implanter-name = EMP Implanter +uplink-emp-implanter-desc = Detonates a small EMP pulse on activation that drains nearby electronics of their power, can be used three times before the internal battery runs out. + uplink-macro-bomb-implanter-name = Macro Bomb Implanter uplink-macro-bomb-implanter-desc = Inject this and on death you'll create a large explosion. Huge team casualty cost, use at own risk. Replaces internal micro bomb. diff --git a/Resources/Prototypes/Actions/types.yml b/Resources/Prototypes/Actions/types.yml index e9cab0978e..d3540053ff 100644 --- a/Resources/Prototypes/Actions/types.yml +++ b/Resources/Prototypes/Actions/types.yml @@ -69,6 +69,31 @@ state: old-radio event: !type:OpenUplinkImplantEvent +- type: instantAction + id: ActivateEmpImplant + name: use-emp-implant-action-name + description: use-emp-implant-action-description + charges: 3 + useDelay: 5 + itemIconStyle: BigAction + priority: -20 + icon: + sprite: Objects/Weapons/Grenades/empgrenade.rsi + state: icon + event: !type:ActivateImplantEvent + +- type: instantAction + id: ActivateDnaScramblerImplant + name: use-dna-scrambler-implant-action-name + description: use-dna-scrambler-implant-action-description + charges: 1 + itemIconStyle: BigAction + priority: -20 + icon: + sprite: Clothing/OuterClothing/Hardsuits/lingspacesuit.rsi + state: icon + event: !type:UseDnaScramblerImplantEvent + - type: instantAction id: ToggleSuitHelmet name: action-name-hardsuit diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 24b89bd6d2..039512ebe3 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -169,7 +169,7 @@ description: uplink-emp-grenade-desc productEntity: EmpGrenade cost: - Telecrystal: 4 + Telecrystal: 3 categories: - UplinkExplosives @@ -398,6 +398,28 @@ tags: - NukeOpsUplink +- type: listing + id: UplinkDnaScramblerImplant + name: uplink-dna-scrambler-implanter-name + description: uplink-dna-scrambler-implanter-desc + icon: { sprite: /Textures/Mobs/Species/Human/parts.rsi, state: full } + productEntity: DnaScramblerImplanter + cost: + Telecrystal: 10 + categories: + - UplinkImplants + +- type: listing + id: UplinkEmpImplanter + name: uplink-emp-implanter-name + description: uplink-emp-implanter-desc + icon: { sprite: /Textures/Objects/Magic/magicactions.rsi, state: shield } + productEntity: EmpImplanter + cost: + Telecrystal: 5 + categories: + - UplinkImplants + - type: listing id: UplinkMacroBombImplanter name: uplink-macro-bomb-implanter-name diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index 86a8842a4d..374bf87ba4 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -77,3 +77,11 @@ - type: NpcFactionMember factions: - Syndicate + +# DNA Scrambler +- type: entity + parent: MobHuman + id: MobHumanScrambled + name: Scrambled Human + components: + - type: RandomHumanoidAppearance diff --git a/Resources/Prototypes/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/Entities/Objects/Misc/implanters.yml index 1086432385..572705e93e 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/implanters.yml @@ -141,6 +141,26 @@ - type: Implanter implant: UplinkImplant +- type: entity + id: EmpImplanter + name: EMP implanter + description: a single use implanter, the implant creates an EMP pulse when you activate it. + parent: BaseImplantOnlyImplanter + components: + - type: Implanter + implant: EmpImplant + +- type: entity + id: DnaScramblerImplanter + name: dna scrambler implanter + description: a single use implanter, the implant allows you to randomly change your appearance and name once. + parent: BaseImplantOnlyImplanter + components: + - type: Implanter + implant: DnaScramblerImplant + currentMode: Inject + implantOnly: false + #Nuclear Operative/Special implanters - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml index 6ecd8860f9..45c46e2cf5 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml @@ -156,6 +156,31 @@ - key: enum.StoreUiKey.Key type: StoreBoundUserInterface +- type: entity + parent: BaseSubdermalImplant + id: EmpImplant + name: EMP implant + description: allows the user to release a small EMP pulse + noSpawn: true + components: + - type: SubdermalImplant + implantAction: ActivateEmpImplant + - type: TriggerImplantAction + - type: EmpOnTrigger + range: 1.75 + energyConsumption: 50000 + disableDuration: 10 + +- type: entity + parent: BaseSubdermalImplant + id: DnaScramblerImplant + name: DNA scrambler implant + description: allows the user to change their appearance and name + noSpawn: true + components: + - type: SubdermalImplant + implantAction: ActivateDnaScramblerImplant + #Nuclear Operative/Special Exclusive implants - type: entity diff --git a/Resources/Prototypes/Polymorphs/polymorph.yml b/Resources/Prototypes/Polymorphs/polymorph.yml index ccc35ae47a..e51722437e 100644 --- a/Resources/Prototypes/Polymorphs/polymorph.yml +++ b/Resources/Prototypes/Polymorphs/polymorph.yml @@ -4,6 +4,14 @@ forced: true duration: 30 +- type: polymorph + id: Scrambled + entity: MobHumanScrambled + forced: false + inventory: Transfer + revertOnCrit: true + revertOnDeath: true + - type: polymorph id: Chicken entity: MobChicken