wow lotsa effort huh

This commit is contained in:
kevinz000
2020-04-26 04:10:38 -07:00
parent ff9f18bdbd
commit 2e35a42f43
3 changed files with 7 additions and 8 deletions
@@ -1,7 +1,6 @@
/obj/item/electronics/electrochromatic_kit
name = "electrochromatic kit"
desc = "A kit for upgrading a window into an electrochromatic one."
icon = 'icons/obj/device.dmi'
/// Electrochromatic ID
var/id
+7 -5
View File
@@ -211,9 +211,6 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
if(istype(I, /obj/item/electronics/electrochromatic_kit) && user.a_intent == INTENT_HELP)
var/obj/item/electronics/electrochromatic_kit/K = I
if(!user.temporarilyRemoveItemFromInventory(K))
to_chat(user, "<span class='warning'>[K] is stuck to your hand!</span>")
return
if(electrochromatic_status != NOT_ELECTROCHROMATIC)
to_chat(user, "<span class='warning'>[src] is already electrochromatic!</span>")
return
@@ -223,6 +220,9 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
if(!K.id)
to_chat(user, "<span class='warning'>[K] has no ID set!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(K))
to_chat(user, "<span class='warning'>[K] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] upgrades [src] with [I].</span>", "<span class='notice'>You upgrade [src] with [I].</span>")
make_electrochromatic(K.id)
qdel(K)
@@ -341,8 +341,10 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
if(electrochromatic_id)
GLOB.electrochromatic_window_lookup[electrochromatic_id] += src
/obj/structure/window/proc/make_electrochromatic(new_id)
/obj/structure/window/proc/make_electrochromatic(new_id = electrochromatic_id)
remove_electrochromatic()
if(!new_id)
CRASH("Attempted to make electrochromatic with null ID.")
electrochromatic_id = new_id
electrochromatic_status = ELECTROCHROMATIC_OFF
LAZYINITLIST(GLOB.electrochromatic_window_lookup["[electrochromatic_id]"])
@@ -352,7 +354,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
if((electrochromatic_status != ELECTROCHROMATIC_OFF) && (electrochromatic_status != ELECTROCHROMATIC_DIMMED))
return FALSE
. = ..()
if(color_hex2num(color) < 255)
if(color && (color_hex2num(color) < 255))
set_opacity(255)
else
set_opacity(FALSE)