From 365aadec54fddff9323a6efd7aba0abddccc292b Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 3 Jul 2020 00:55:18 +0300 Subject: [PATCH] Trying to fix the dna t --- code/controllers/subsystem/atoms.dm | 2 +- code/game/machinery/computer/dna_console.dm | 58 +++++++++++++++++---- code/game/machinery/dna_scanner.dm | 2 +- code/modules/client/client_defines.dm | 8 --- tgui/packages/tgui/interfaces/DnaConsole.js | 2 +- tgui/packages/tgui/interfaces/Vending.js | 30 ++++++----- 6 files changed, 68 insertions(+), 34 deletions(-) diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index 5dde6c6985..c5e7e592f5 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -115,7 +115,7 @@ SUBSYSTEM_DEF(atoms) for(var/i in 1 to LAZYLEN(mutations)) var/path = mutations[i] //byond gets pissy when we do it in one line var/datum/mutation/human/B = new path () - B.alias = "Mutation #[i]" + B.alias = "Mutation [i]" GLOB.all_mutations[B.type] = B GLOB.full_sequences[B.type] = generate_gene_sequence(B.blocks) GLOB.alias_mutations[B.alias] = B.type diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index d3ca5a3934..115de6da07 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -156,11 +156,13 @@ // 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 + // Insert disk into DNA Console if (!user.transferItemToLoc(I,src)) return + // If insertion was successful and there's already a diskette in the console, eject the old one. if(diskette) - diskette.forceMove(drop_location()) - diskette = null + eject_disk(user) + // Set the new diskette. diskette = I to_chat(user, "You insert [I].") return @@ -189,6 +191,14 @@ return ..() + +/obj/machinery/computer/scan_consolenew/AltClick(mob/user) + // Make sure the user can interact with the machine. + if(!user.canUseTopic(src, !issilicon(user))) + return + + eject_disk(user) + /obj/machinery/computer/scan_consolenew/Initialize() . = ..() @@ -289,7 +299,10 @@ data["isViableSubject"] = is_viable_occupant if(is_viable_occupant) data["subjectName"] = scanner_occupant.name - data["subjectStatus"] = scanner_occupant.stat + if(scanner_occupant.transformation_timer) + data["subjectStatus"] = STATUS_TRANSFORMING + else + data["subjectStatus"] = scanner_occupant.stat data["subjectHealth"] = scanner_occupant.health data["subjectRads"] = scanner_occupant.radiation/(RAD_MOB_SAFE/100) data["subjectEnzymes"] = scanner_occupant.dna.unique_enzymes @@ -463,10 +476,16 @@ if(!(scanner_occupant == connected_scanner.occupant)) return + // GUARD CHECK - Is the occupant currently undergoing some form of + // transformation? If so, we don't want to be pulsing genes. + if(scanner_occupant.transformation_timer) + to_chat(usr,"Gene pulse failed: The scanner occupant undergoing a transformation.") + return + // Resolve mutation's BYOND path from the alias var/alias = params["alias"] var/path = GET_MUTATION_TYPE_FROM_ALIAS(alias) - + to_chat(usr,"[path] [alias]") // Make sure the occupant still has this mutation if(!(path in scanner_occupant.dna.mutation_index)) return @@ -1039,13 +1058,7 @@ // Eject stored diskette from console if("eject_disk") - // GUARD CHECK - This code shouldn't even be callable without a diskette - // inserted. Unexpected result - if(!diskette) - return - - diskette.forceMove(drop_location()) - diskette = null + eject_disk(usr) return // Create a Genetic Makeup injector. These injectors are timed and thus are @@ -1977,6 +1990,29 @@ tgui_view_state["storageConsSubMode"] = "mutations" tgui_view_state["storageDiskSubMode"] = "mutations" +/** + * Ejects the DNA Disk from the console. + * + * Will insert into the user's hand if possible, otherwise will drop it at the + * console's location. + * + * Arguments: + * * user - The mob that is attempting to eject the diskette. + */ +/obj/machinery/computer/scan_consolenew/proc/eject_disk(mob/user) + // Check for diskette. + if(!diskette) + return + + to_chat(user, "You eject [diskette] from [src].") + + // Reset the state to console storage. + tgui_view_state["storageMode"] = "console" + + // If the disk shouldn't pop into the user's hand for any reason, drop it on the console instead. + if(!istype(user) || !Adjacent(user) || !user.put_in_active_hand(diskette)) + diskette.forceMove(drop_location()) + diskette = null #undef INJECTOR_TIMEOUT #undef NUMBER_OF_BUFFERS diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index cf82b502f5..95552d931b 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -1,7 +1,7 @@ /obj/machinery/dna_scannernew name = "\improper DNA scanner" desc = "It scans DNA structures." - icon = 'icons/obj/machines/cloning.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "scanner" density = TRUE use_power = IDLE_POWER_USE diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index c4dc57ebfa..12536b4382 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -144,11 +144,3 @@ //world.time of when the crew manifest can be accessed var/crew_manifest_delay - - // List of all asset filenames sent to this client by the asset cache, along with their assoicated md5s - var/list/sent_assets = list() - /// List of all completed blocking send jobs awaiting acknowledgement by send_asset - var/list/completed_asset_jobs = list() - /// Last asset send job id. - var/last_asset_job = 0 - var/last_completed_asset_job = 0 diff --git a/tgui/packages/tgui/interfaces/DnaConsole.js b/tgui/packages/tgui/interfaces/DnaConsole.js index 3cca81918d..b12bdcda34 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole.js +++ b/tgui/packages/tgui/interfaces/DnaConsole.js @@ -804,7 +804,7 @@ const DnaConsoleSequencer = (props, context) => { ) || (isMonkey && mutation?.Name !== 'Monkified') && (
- Genetic sequence corrupted. Subject diagnostic report: MONKEY. + Genetic sequence corrupted. Subject diagnostic report: MONKEY. Scramble DNA to humanize.
) || (subjectStatus === SUBJECT_TRANSFORMING) && (
diff --git a/tgui/packages/tgui/interfaces/Vending.js b/tgui/packages/tgui/interfaces/Vending.js index 0a90e8a737..c2f10161e4 100644 --- a/tgui/packages/tgui/interfaces/Vending.js +++ b/tgui/packages/tgui/interfaces/Vending.js @@ -10,16 +10,19 @@ const VendingRow = (props, context) => { productStock, custom, } = props; + const to_pay = (!product.premium + ? Math.round(product.price * data.cost_mult) + : product.price + ); + const pay_text = (!product.premium + ? to_pay + ' cr' + data.cost_text + : to_pay + ' cr' + ); const free = ( !data.onstation || product.price === 0 - || ( - !product.premium - && data.department - && data.user - && data.department === data.user.department - ) ); + return ( @@ -69,13 +72,16 @@ const VendingRow = (props, context) => {