[MIRROR] Fixes magic locker sprite being weird (#2249)

* Fixes magic locker sprite being weird (#55589)

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>

* Fixes magic locker sprite being weird

Co-authored-by: Time-Green <timkoster1@hotmail.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-12-20 01:58:10 +01:00
committed by GitHub
co-authored by Jared-Fogle Time-Green
parent 13b7402c45
commit 18ca91f911
+6 -14
View File
@@ -396,7 +396,7 @@
var/weld = TRUE
var/created = FALSE //prevents creation of more then one locker if it has multiple hits
var/locker_suck = TRUE
var/obj/structure/closet/locker_temp_instance = /obj/structure/closet/decay
var/obj/structure/closet/decay/locker_temp_instance
/obj/projectile/magic/locker/Initialize()
. = ..()
@@ -434,7 +434,7 @@
/obj/structure/closet/decay
breakout_time = 600
icon_welded = null
var/magic_icon = "cursed"
icon_state = "cursed"
var/weakened_icon = "decursed"
var/auto_destroy = TRUE
@@ -442,18 +442,12 @@
. = ..()
if(auto_destroy)
addtimer(CALLBACK(src, .proc/bust_open), 5 MINUTES)
addtimer(CALLBACK(src, .proc/magicly_lock), 5)
/obj/structure/closet/decay/proc/magicly_lock()
if(!welded)
return
icon_state = magic_icon
update_icon()
/obj/structure/closet/decay/after_weld(weld_state)
if(weld_state)
unmagify()
///Fade away into nothing
/obj/structure/closet/decay/proc/decay()
animate(src, alpha = 0, time = 30)
addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, src), 30)
@@ -461,16 +455,14 @@
/obj/structure/closet/decay/open(mob/living/user, force = FALSE)
. = ..()
if(.)
if(icon_state == magic_icon) //check if we used the magic icon at all before giving it the lesser magic icon
unmagify()
else
addtimer(CALLBACK(src, .proc/decay), 15 SECONDS)
unmagify()
///Give it the lesser magic icon and tell it to delete itself
/obj/structure/closet/decay/proc/unmagify()
icon_state = weakened_icon
update_icon()
addtimer(CALLBACK(src, .proc/decay), 15 SECONDS)
icon_welded = "welded"
/obj/projectile/magic/flying
name = "bolt of flying"