Merge pull request #6330 from FlimFlamm/box_sprite_addition

Large Cardboard Box Decals/Sprites
This commit is contained in:
Crazy Lemon
2017-02-14 23:12:41 -08:00
committed by GitHub
2 changed files with 25 additions and 1 deletions
@@ -1,6 +1,7 @@
/obj/structure/closet/cardboard
name = "large cardboard box"
desc = "Just a box..."
icon = 'icons/obj/cardboard_boxes.dmi'
icon_state = "cardboard"
icon_opened = "cardboard_open"
icon_closed = "cardboard"
@@ -43,7 +44,7 @@
/mob/living/proc/do_alert_animation(atom/A)
var/image/I
I = image('icons/obj/closet.dmi', A, "cardboard_special", A.layer+1)
I = image('icons/obj/cardboard_boxes.dmi', A, "cardboard_special", A.layer+1)
var/list/viewing = list()
for(var/mob/M in viewers(A))
if(M.client)
@@ -52,6 +53,7 @@
I.alpha = 0
animate(I, pixel_z = 32, alpha = 255, time = 5, easing = ELASTIC_EASING)
/obj/structure/closet/cardboard/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(src.opened)
if(istype(W, /obj/item/weapon/weldingtool))
@@ -62,3 +64,25 @@
for(var/mob/M in viewers(src))
M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WC].</span>", 3, "You hear cutting.", 2)
qdel(src)
return
if(istype(W, /obj/item/weapon/pen))
var/decalselection = input("Please select a decal") as null|anything in list("Atmospherics", "Bartender", "Barber", "Blueshield", "Brig Physician", "Captain",
"Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Civilian", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP",
"HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Mechanic", "Medical", "Mime", "Mining", "NT Representative", "Paramedic", "Pod Pilot",
"Prisoner", "Research Director", "Security", "Syndicate", "Therapist", "Virology", "Warden", "Xenobiology")
if(!decalselection)
return
if(user.incapacitated())
to_chat(user, "You're in no condition to perform this action.")
return
if(W != user.get_active_hand())
to_chat(user, "You must be holding the pen to perform this action.")
return
if(! Adjacent(user))
to_chat(user, "You have moved too far away from the cardboard box.")
return
decalselection = replacetext(decalselection, " ", "_")
decalselection = lowertext(decalselection)
icon_opened = ("cardboard_open_"+decalselection)
icon_closed = ("cardboard_"+decalselection)
update_icon() // a proc declared in the closets parent file used to update opened/closed sprites on normal closets