Makes medal boxes fancy.

This commit is contained in:
Expletive
2017-06-12 13:53:50 -07:00
parent e7c698fe0a
commit 1609a4aeb1
5 changed files with 63 additions and 36 deletions
@@ -8,8 +8,9 @@
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 4
req_access = list(GLOB.access_armory)
var/locked = 1
var/broken = 0
var/locked = TRUE
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
@@ -48,8 +49,8 @@
/obj/item/weapon/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = 1
locked = 0
broken = TRUE
locked = FALSE
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
@@ -67,6 +68,7 @@
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return 0
open = TRUE
return ..()
/obj/item/weapon/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
@@ -74,6 +76,15 @@
return 0
return ..()
/obj/item/weapon/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
open = TRUE
update_icon()
return ..()
/obj/item/weapon/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
open = TRUE
update_icon()
return ..()
/obj/item/weapon/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
req_access = list(GLOB.access_security)
@@ -107,51 +118,67 @@
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/weapon/storage/lockbox/medal/AltClick()
if(!locked)
open = (open ? FALSE : TRUE)
update_icon()
..()
/obj/item/weapon/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/bronze_heart(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/conduct(src)
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/plasma(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/gold/heroism(src)
/obj/item/weapon/storage/lockbox/secmedal
/obj/item/weapon/storage/lockbox/medal/update_icon()
cut_overlays()
if(locked)
icon_state = "medalbox+l"
open = FALSE
else
icon_state = "medalbox"
if(open)
icon_state += "open"
if(broken)
icon_state += "+b"
if(contents && open)
for (var/i in 1 to contents.len)
var/medaltype = "medal"
var/obj/item/clothing/accessory/medal/M = contents[i]
if(istype(M, /obj/item/clothing/accessory/medal/gold))
medaltype += "-gold"
if(istype(M, /obj/item/clothing/accessory/medal/silver))
medaltype += "-silver"
if(istype(M, /obj/item/clothing/accessory/medal/plasma))
medaltype += "-plasma"
var/icon/medalicon = icon(initial(icon), medaltype)
if(i > 1 && i <= 5)
medalicon.Shift(EAST, (i-1)*3)
else if(i > 5)
medalicon.Shift(SOUTH, 7)
medalicon.Shift(WEST, 2)
medalicon.Shift(EAST, (i-6)*3)
add_overlay(medalicon)
/obj/item/weapon/storage/lockbox/medal/sec
name = "security medal box"
desc = "A locked box used to store medals to be given to members of the security department."
icon_state = "medalbox+l"
item_state = "syringe_kit"
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
storage_slots = 10
max_combined_w_class = 20
req_access = list(GLOB.access_hos)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/weapon/storage/lockbox/secmedal/PopulateContents()
/obj/item/weapon/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/security(src)
/obj/item/weapon/storage/lockbox/scimedal
/obj/item/weapon/storage/lockbox/medal/sci
name = "science medal box"
desc = "A locked box used to store medals to be given to members of the science department."
icon_state = "medalbox+l"
item_state = "syringe_kit"
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
storage_slots = 10
max_combined_w_class = 20
req_access = list(GLOB.access_rd)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/weapon/storage/lockbox/scimedal/PopulateContents()
/obj/item/weapon/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
@@ -24,4 +24,4 @@
new /obj/item/device/laser_pointer(src)
new /obj/item/weapon/door_remote/research_director(src)
new /obj/item/weapon/storage/box/firingpins(src)
new /obj/item/weapon/storage/lockbox/scimedal(src)
new /obj/item/weapon/storage/lockbox/medal/sci(src)
@@ -83,7 +83,7 @@
new /obj/item/device/flashlight/seclite(src)
new /obj/item/weapon/pinpointer(src)
new /obj/item/clothing/under/rank/head_of_security/grey(src)
new /obj/item/weapon/storage/lockbox/secmedal(src)
new /obj/item/weapon/storage/lockbox/medal/sec(src)
/obj/structure/closet/secure_closet/warden
name = "\proper warden's locker"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 57 KiB

+1 -1
View File
@@ -13,7 +13,7 @@
// END_PREFERENCES
// BEGIN_INCLUDE
#include "_maps\basemap.dm"
#include "_maps\runtimestation.dm"
#include "code\_compile_options.dm"
#include "code\world.dm"
#include "code\__DATASTRUCTURES\globals.dm"