From 634e511efccc1c2db42d471fa0f8bc91e5f8f77b Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Wed, 21 Sep 2022 21:42:35 -0400
Subject: [PATCH] Mechs can now be emaged to remove dna lock and access
(#19006)
* Mechs can now be emaged to remove dna lock and access
* Update code/game/mecha/mecha.dm
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
---
code/game/mecha/combat/marauder.dm | 3 +++
code/game/mecha/mecha.dm | 11 +++++++++--
code/game/mecha/working/ripley.dm | 5 +----
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm
index 914e3ab3bc9..a4bc0a71808 100644
--- a/code/game/mecha/combat/marauder.dm
+++ b/code/game/mecha/combat/marauder.dm
@@ -18,6 +18,7 @@
max_equip = 5
starting_voice = /obj/item/mecha_modkit/voice/nanotrasen
destruction_sleep_duration = 2 SECONDS
+ emag_proof = TRUE //no stealing CC mechs.
/obj/mecha/combat/marauder/GrantActions(mob/living/user, human_occupant = 0)
. = ..()
@@ -55,6 +56,7 @@
max_temperature = 40000
wreckage = /obj/structure/mecha_wreckage/ares
max_equip = 4
+ emag_proof = FALSE //Gamma armory can be stolen however.
/obj/mecha/combat/marauder/ares/loaded/Initialize(mapload)
. = ..()
@@ -112,6 +114,7 @@
operation_req_access = list(ACCESS_SYNDICATE)
wreckage = /obj/structure/mecha_wreckage/mauler
starting_voice = /obj/item/mecha_modkit/voice/syndicate
+ emag_proof = FALSE //The crew can steal a syndicate mech. As a treat.
/obj/mecha/combat/marauder/mauler/loaded/Initialize(mapload)
. = ..()
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 0e43ac3d10d..d4c5f70ad52 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -40,6 +40,7 @@
var/frozen = FALSE
var/repairing = FALSE
var/emp_proof = FALSE //If it is immune to emps
+ var/emag_proof = FALSE //If it is immune to emagging. Used by CC mechs.
//inner atmos
var/use_internal_tank = 0
@@ -878,8 +879,14 @@
. = ..()
/obj/mecha/emag_act(mob/user)
- to_chat(user, "[src]'s ID slot rejects the card.")
- return
+ if(emag_proof)
+ to_chat(user, "[src]'s ID slot rejects the card.")
+ return
+ user.visible_message("[user] slides a card through [src]'s id slot.", "You slide the card through [src]'s ID slot, resetting the DNA and access locks.")
+ playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
+ dna = null
+ operation_req_access = list()
+
/////////////////////////////////////
diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm
index 3e6ebbd60d9..7f342286431 100644
--- a/code/game/mecha/working/ripley.dm
+++ b/code/game/mecha/working/ripley.dm
@@ -209,8 +209,5 @@
/obj/mecha/working/ripley/emag_act(mob/user)
if(!emagged)
emagged = TRUE
- to_chat(user, "You slide the card through [src]'s ID slot.")
- playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
desc += "The mech's equipment slots spark dangerously!"
- else
- to_chat(user, "[src]'s ID slot rejects the card.")
+ return ..()