Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Monkey used injector to generate CRISPR Charge #65552

Merged
merged 5 commits into from
Apr 14, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 21 additions & 19 deletions code/game/machinery/computer/dna_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,50 +160,52 @@
genetic_damage_pulse()
return

/obj/machinery/computer/scan_consolenew/attackby(obj/item/I, mob/user, params)
/obj/machinery/computer/scan_consolenew/attackby(obj/item/Item, mob/user, params)
MrNihil marked this conversation as resolved.
Show resolved Hide resolved
// Store chromosomes in the console if there's room
if (istype(I, /obj/item/chromosome))
I.forceMove(src)
stored_chromosomes += I
to_chat(user, span_notice("You insert [I]."))
if (istype(Item, /obj/item/chromosome))
Item.forceMove(src)
stored_chromosomes += Item
to_chat(user, span_notice("You insert [Item]."))
return

// Insert data disk if console disk slot is empty
// Swap data disk if there is one already a disk in the console
if (istype(I, /obj/item/disk/data)) //INSERT SOME DISKETTES
if (istype(Item, /obj/item/disk/data)) //INSERT SOME DISKETTES
// Insert disk into DNA Console
if (!user.transferItemToLoc(I,src))
if (!user.transferItemToLoc(Item,src))
return
// If insertion was successful and there's already a diskette in the console, eject the old one.
if(diskette)
eject_disk(user)
// Set the new diskette.
diskette = I
to_chat(user, span_notice("You insert [I]."))
diskette = Item
to_chat(user, span_notice("You insert [Item]."))
return

// Recycle non-activator used injectors
// Turn activator used injectors (aka research injectors) to chromosomes
if(istype(I, /obj/item/dnainjector/activator))
var/obj/item/dnainjector/activator/A = I
if(A.used)
to_chat(user,span_notice("Recycled [I]."))
if(A.research && A.filled)
if(istype(Item, /obj/item/dnainjector/activator))
var/obj/item/dnainjector/activator/Activator = Item
if(Activator.used)
if(Activator.research && Activator.filled)
if(prob(60))
var/c_typepath = generate_chromosome()
var/obj/item/chromosome/CM = new c_typepath (src)
stored_chromosomes += CM
to_chat(user,span_notice("[capitalize(CM.name)] added to storage."))
else
to_chat(user, span_notice("There was not enough genetic data to extract a viable chromosome."))
if(A.crispr_charge)
crispr_charges++
qdel(I)
if(Activator.crispr_charge)
crispr_charges++
to_chat(user, span_notice("CRISPR charge added."))
qdel(Item)
to_chat(user,span_notice("Recycled [Item]."))
return
if(!Activator.used)
MrNihil marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user,span_notice("Cannot recycle unused activators."))
return

return ..()


/obj/machinery/computer/scan_consolenew/AltClick(mob/user)
// Make sure the user can interact with the machine.
. = ..()
Expand Down