From cea958f822e38dadebe0416ea1420a38ac46215c Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 28 May 2020 09:36:57 +0200 Subject: [PATCH] Fixing various issues. (#12368) * Fixing various issues. * Lights. --- code/datums/dna.dm | 22 +++++----- code/datums/wires/apc.dm | 2 + code/game/machinery/doors/airlock.dm | 10 ++++- code/game/objects/items/devices/paicard.dm | 2 +- .../items/implants/implant_abductor.dm | 44 ++++++++----------- code/modules/power/apc.dm | 1 + code/modules/power/lighting.dm | 7 ++- 7 files changed, 47 insertions(+), 41 deletions(-) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 747db3d6ce..ed5104e296 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -391,16 +391,6 @@ /mob/living/carbon/human/proc/hardset_dna(ui, list/mutation_index, newreal_name, newblood_type, datum/species/mrace, newfeatures) - if(newfeatures) - var/old_size = dna.features["body_size"] - dna.features = newfeatures - dna.update_body_size(old_size) - - if(mrace) - var/datum/species/newrace = new mrace.type - newrace.copy_properties_from(mrace) - set_species(newrace, icon_update=0) - if(newreal_name) real_name = newreal_name dna.generate_unique_enzymes() @@ -410,7 +400,17 @@ if(ui) dna.uni_identity = ui - updateappearance(icon_update=0) + updateappearance(icon_update=FALSE) + + if(newfeatures) + var/old_size = dna.features["body_size"] + dna.features = newfeatures + dna.update_body_size(old_size) + + if(mrace) + var/datum/species/newrace = new mrace.type + newrace.copy_properties_from(mrace) + set_species(newrace, icon_update=FALSE) if(LAZYLEN(mutation_index)) dna.mutation_index = mutation_index.Copy() diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm index 997c77aa51..19b2b8dda8 100644 --- a/code/datums/wires/apc.dm +++ b/code/datums/wires/apc.dm @@ -30,6 +30,7 @@ if(WIRE_POWER1, WIRE_POWER2) // Short for a long while. if(!A.shorted) A.shorted = TRUE + A.update() addtimer(CALLBACK(A, /obj/machinery/power/apc.proc/reset, wire), 1200) if(WIRE_IDSCAN) // Unlock for a little while. A.locked = FALSE @@ -49,6 +50,7 @@ else A.shorted = TRUE A.shock(usr, 50) + A.update() if(WIRE_AI) // Disable AI control. if(mend) A.aidisabled = FALSE diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 4c12809184..477cd69746 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -577,11 +577,17 @@ cut_overlays() add_overlay(frame_overlay) add_overlay(filling_overlay) - add_overlay(lights_overlay) + if(lights_overlay) + add_overlay(lights_overlay) + var/mutable_appearance/lights_vis = mutable_appearance(lights_overlay.icon, lights_overlay.icon_state) + add_overlay(lights_vis) add_overlay(panel_overlay) add_overlay(weld_overlay) add_overlay(sparks_overlay) - add_overlay(damag_overlay) + if(damag_overlay) + add_overlay(damag_overlay) + var/mutable_appearance/damage_vis = mutable_appearance(damag_overlay.icon, damag_overlay.icon_state) + add_overlay(damage_vis) add_overlay(note_overlay) check_unres() diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 5b332cda46..7450cb937c 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -99,7 +99,7 @@ if(href_list["reset_radio_short"]) pai.unshort_radio() if(href_list["setlaws"]) - var/newlaws = stripped_multiline_input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", MAX_MESSAGE_LEN) + var/newlaws = stripped_multiline_input(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", "", MAX_MESSAGE_LEN) if(newlaws && pai) pai.add_supplied_law(0,newlaws) if(href_list["toggle_holo"]) diff --git a/code/game/objects/items/implants/implant_abductor.dm b/code/game/objects/items/implants/implant_abductor.dm index 0c50beadea..e0765e7951 100644 --- a/code/game/objects/items/implants/implant_abductor.dm +++ b/code/game/objects/items/implants/implant_abductor.dm @@ -5,36 +5,30 @@ icon_state = "implant" activated = 1 var/obj/machinery/abductor/pad/home - var/cooldown = 30 + var/next_use = 0 /obj/item/implant/abductor/activate() . = ..() - if(cooldown == initial(cooldown)) + if(next_use <= world.time) home.Retrieve(imp_in,1) - cooldown = 0 - START_PROCESSING(SSobj, src) + next_use = world.time + 60 SECONDS else - to_chat(imp_in, "You must wait [30 - cooldown] seconds to use [src] again!") - -/obj/item/implant/abductor/process() - if(cooldown < initial(cooldown)) - cooldown++ - if(cooldown == initial(cooldown)) - STOP_PROCESSING(SSobj, src) + to_chat(imp_in, "You must wait [DisplayTimeText(next_use - world.time)] to use [src] again!") /obj/item/implant/abductor/implant(mob/living/target, mob/user) - if(..()) - var/obj/machinery/abductor/console/console - if(ishuman(target)) - var/datum/antagonist/abductor/A = target.mind.has_antag_datum(/datum/antagonist/abductor) - if(A) - console = get_abductor_console(A.team.team_number) - home = console.pad - - if(!home) - var/list/consoles = list() - for(var/obj/machinery/abductor/console/C in GLOB.machines) - consoles += C - console = pick(consoles) + . = ..() + if(!.) + return + var/obj/machinery/abductor/console/console + if(ishuman(target)) + var/datum/antagonist/abductor/A = target.mind.has_antag_datum(/datum/antagonist/abductor) + if(A) + console = get_abductor_console(A.team.team_number) home = console.pad - return TRUE + + if(!home) + var/list/consoles = list() + for(var/obj/machinery/abductor/console/C in GLOB.machines) + consoles += C + console = pick(consoles) + home = console.pad diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index f1108189c7..dc091cb451 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1411,6 +1411,7 @@ if(WIRE_POWER1, WIRE_POWER2) if(!wires.is_cut(WIRE_POWER1) && !wires.is_cut(WIRE_POWER2)) shorted = FALSE + update() if(WIRE_AI) if(!wires.is_cut(WIRE_AI)) aidisabled = FALSE diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 344d41071d..3c3f3c9541 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -314,8 +314,11 @@ . = ..() SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) if(on && status == LIGHT_OK) - SSvis_overlays.add_vis_overlay(src, overlayicon, base_state, EMISSIVE_UNBLOCKABLE_LAYER, EMISSIVE_UNBLOCKABLE_PLANE, dir, clamp(light_power*250, 30, 200)) - + var/overlay_alpha = clamp(light_power*250, 30, 200) + SSvis_overlays.add_vis_overlay(src, overlayicon, base_state, EMISSIVE_UNBLOCKABLE_LAYER, EMISSIVE_UNBLOCKABLE_PLANE, dir, overlay_alpha) + var/mutable_appearance/M = mutable_appearance(overlayicon, base_state) + M.alpha = overlay_alpha + . += M // update the icon_state and luminosity of the light depending on its state /obj/machinery/light/proc/update(trigger = TRUE)