firebreath change + update to tg genetics + calc patch
This commit is contained in:
@@ -786,7 +786,7 @@ SLIME SCANNER
|
||||
item_state = "healthanalyzer"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
desc = "A hand-held scanner able to swiftly scan someone for potential mutations. Hold near a DNA console to update from their database."
|
||||
desc = "A hand-held scanner for analyzing someones gene sequence on the fly. Hold near a DNA console to update the internal database."
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = NOBLUDGEON
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
@@ -796,13 +796,25 @@ SLIME SCANNER
|
||||
throw_range = 7
|
||||
materials = list(MAT_METAL=200)
|
||||
var/list/discovered = list() //hit a dna console to update the scanners database
|
||||
var/list/buffer
|
||||
var/ready = TRUE
|
||||
var/cooldown = 200
|
||||
|
||||
/obj/item/sequence_scanner/attack(mob/living/M, mob/living/carbon/human/user)
|
||||
user.visible_message("<span class='notice'>[user] has analyzed [M]'s genetic sequence.</span>")
|
||||
|
||||
add_fingerprint(user)
|
||||
if (!HAS_TRAIT(M, TRAIT_RADIMMUNE)) //no scanning if its a husk or DNA-less Species
|
||||
user.visible_message("<span class='notice'>[user] analyzes [M]'s genetic sequence.</span>", \
|
||||
"<span class='notice'>You analyze [M]'s genetic sequence.</span>")
|
||||
gene_scan(M, user)
|
||||
|
||||
gene_scan(M, user, src)
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] failed to analyse [M]'s genetic sequence.</span>", "<span class='warning'>[M] has no readable genetic sequence!</span>")
|
||||
|
||||
/obj/item/sequence_scanner/attack_self(mob/user)
|
||||
display_sequence(user)
|
||||
|
||||
/obj/item/sequence_scanner/attack_self_tk(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/sequence_scanner/afterattack(obj/O, mob/user, proximity)
|
||||
. = ..()
|
||||
@@ -812,28 +824,58 @@ SLIME SCANNER
|
||||
if(istype(O, /obj/machinery/computer/scan_consolenew))
|
||||
var/obj/machinery/computer/scan_consolenew/C = O
|
||||
if(C.stored_research)
|
||||
to_chat(user, "<span class='notice'>[name] database updated.</span>")
|
||||
to_chat(user, "<span class='notice'>[name] linked to central research database.</span>")
|
||||
discovered = C.stored_research.discovered_mutations
|
||||
else
|
||||
to_chat(user,"<span class='warning'>No database to update from.</span>")
|
||||
|
||||
/proc/gene_scan(mob/living/carbon/C, mob/living/user, obj/item/sequence_scanner/G)
|
||||
/obj/item/sequence_scanner/proc/gene_scan(mob/living/carbon/C, mob/living/user)
|
||||
if(!iscarbon(C) || !C.has_dna())
|
||||
return
|
||||
to_chat(user, "<span class='notice'>[C.name]'s potential mutations.")
|
||||
for(var/A in C.dna.mutation_index)
|
||||
var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(A)
|
||||
var/mut_name
|
||||
if(G && (A in G.discovered))
|
||||
mut_name = "[HM.name] ([HM.alias])"
|
||||
else
|
||||
mut_name = HM.alias
|
||||
var/temp = GET_GENE_STRING(HM.type, C.dna)
|
||||
var/display
|
||||
for(var/i in 0 to length(temp) / DNA_MUTATION_BLOCKS-1)
|
||||
if(i)
|
||||
display += "-"
|
||||
display += copytext(temp, 1 + i*DNA_MUTATION_BLOCKS, DNA_MUTATION_BLOCKS*(1+i) + 1)
|
||||
buffer = C.dna.mutation_index
|
||||
to_chat(user, "<span class='notice'>Subject [C.name]'s DNA sequence has been saved to buffer.</span>")
|
||||
if(LAZYLEN(buffer))
|
||||
for(var/A in buffer)
|
||||
to_chat(user, "<span class='notice'>[get_display_name(A)]</span>")
|
||||
|
||||
|
||||
to_chat(user, "<span class='boldnotice'>- [mut_name] > [display]</span>")
|
||||
/obj/item/sequence_scanner/proc/display_sequence(mob/living/user)
|
||||
if(!LAZYLEN(buffer) || !ready)
|
||||
return
|
||||
var/list/options = list()
|
||||
for(var/A in buffer)
|
||||
options += get_display_name(A)
|
||||
|
||||
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options)
|
||||
if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
var/sequence
|
||||
for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list
|
||||
if(get_display_name(A) == answer)
|
||||
sequence = buffer[A]
|
||||
break
|
||||
|
||||
if(sequence)
|
||||
var/display
|
||||
for(var/i in 0 to length_char(sequence) / DNA_MUTATION_BLOCKS-1)
|
||||
if(i)
|
||||
display += "-"
|
||||
display += copytext_char(sequence, 1 + i*DNA_MUTATION_BLOCKS, DNA_MUTATION_BLOCKS*(1+i) + 1)
|
||||
|
||||
to_chat(user, "<span class='boldnotice'>[display]</span><br>")
|
||||
|
||||
ready = FALSE
|
||||
icon_state = "[icon_state]_recharging"
|
||||
addtimer(CALLBACK(src, .proc/recharge), cooldown, TIMER_UNIQUE)
|
||||
|
||||
/obj/item/sequence_scanner/proc/recharge()
|
||||
icon_state = initial(icon_state)
|
||||
ready = TRUE
|
||||
|
||||
/obj/item/sequence_scanner/proc/get_display_name(mutation)
|
||||
var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(mutation)
|
||||
if(!HM)
|
||||
return "ERROR"
|
||||
if(mutation in discovered)
|
||||
return "[HM.name] ([HM.alias])"
|
||||
else
|
||||
return HM.alias
|
||||
Reference in New Issue
Block a user