Makes DNA locking chips not work if you have no DNA (#18905)

* Makes DNA locking chips not work if you have no DNA

* Makes artifact gun casings delete on use
This commit is contained in:
Cameron Lennox
2025-12-28 14:22:07 +01:00
committed by GitHub
parent 1e8e67cdb3
commit 6e1551bcb6
2 changed files with 19 additions and 12 deletions
+18 -12
View File
@@ -13,6 +13,7 @@
var/exploding = 0
/obj/item/dnalockingchip/Destroy(force, ...)
stored_dna.Cut()
. = ..()
/obj/item/gun/proc/get_dna(mob/user)
@@ -21,17 +22,22 @@
if(attached_lock.stored_dna && (M.dna.unique_enzymes in attached_lock.stored_dna))
to_chat(M, span_warning("\The [src] buzzes and displays a symbol showing the gun already contains your DNA."))
return 0
return FALSE
else if(ishuman(M))
var/mob/living/carbon/human/human = user
if(human.species.flags & NO_DNA)
to_chat(human, span_warning("\The [src] buzzes and displays an NO DNA DETECTED symbol."))
return FALSE
else
attached_lock.stored_dna += M.dna.unique_enzymes
to_chat(M, span_notice("\The [src] pings and a needle flicks out from the grip, taking a DNA sample from you."))
if(!attached_lock.controller_dna)
attached_lock.controller_dna = M.dna.unique_enzymes
to_chat(M, span_notice("\The [src] processes the dna sample and pings, acknowledging you as the primary controller."))
return 1
return TRUE
else
to_chat(M, span_warning("\The [src] buzzes and displays a locked symbol. It is not allowing DNA samples at this time."))
return 0
return FALSE
/obj/item/gun/verb/give_dna()
set name = "Give DNA"
@@ -44,18 +50,18 @@
if(!attached_lock.controller_lock)
if(!authorized_user(M))
to_chat(M, span_warning("\The [src] buzzes and displays an invalid user symbol."))
return 0
return FALSE
else
attached_lock.stored_dna -= user.dna.unique_enzymes
to_chat(M, span_notice("\The [src] beeps and clears the DNA it has stored."))
if(M.dna.unique_enzymes == attached_lock.controller_dna)
to_chat(M, span_notice("\The [src] beeps and removes you as the primary controller."))
if(attached_lock.controller_lock)
attached_lock.controller_lock = 0
return 1
attached_lock.controller_lock = FALSE
return TRUE
else
to_chat(M, span_warning("\The [src] buzzes and displays a locked symbol. It is not allowing DNA modifcation at this time."))
return 0
return FALSE
/obj/item/gun/verb/remove_dna()
set name = "Remove DNA"
@@ -67,10 +73,10 @@
var/mob/living/M = user
if(authorized_user(M) && user.dna.unique_enzymes == attached_lock.controller_dna)
if(!attached_lock.controller_lock)
attached_lock.controller_lock = 1
attached_lock.controller_lock = TRUE
to_chat(M, span_notice("\The [src] beeps and displays a locked symbol, informing you it will no longer allow DNA samples."))
else
attached_lock.controller_lock = 0
attached_lock.controller_lock = FALSE
to_chat(M, span_notice("\The [src] beeps and displays an unlocked symbol, informing you it will now allow DNA samples."))
else
to_chat(M, span_warning("\The [src] buzzes and displays an invalid user symbol."))
@@ -83,7 +89,7 @@
/obj/item/gun/proc/authorized_user(mob/user)
if(!attached_lock.stored_dna || !attached_lock.stored_dna.len)
return 1
return TRUE
if(!(user.dna.unique_enzymes in attached_lock.stored_dna))
return 0
return 1
return FALSE
return TRUE
@@ -34,6 +34,7 @@
drop_sound = 'sound/items/drop/ring.ogg'
pickup_sound = 'sound/items/pickup/ring.ogg'
projectile_type = /obj/item/projectile/bullet/cap //Just a placeholder. Doesn't actually matter what this is. All that matters is what the projecttile_type of our BB is.
caseless = TRUE
/obj/item/ammo_casing/artifact/Initialize(mapload) //These should ONLY ever be in artifact weapons. If you spawn outside of artifact weapons, it'll have a riot foam dart inside of it as the bullet.
. = ..()