mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-30 12:03:11 +00:00
A lot of new defines are now in inventory_sizes.dm, which contains; All the size identifiers (the thing that tells the game if something is bulky, or w/e). Storage costs for all the sizes, which are exponents of two, as previously. A few constants for inventory size. Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it. This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files. In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke. The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
111 lines
3.8 KiB
Plaintext
111 lines
3.8 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
|
|
|
/obj/item/weapon/storage/lockbox
|
|
name = "lockbox"
|
|
desc = "A locked box."
|
|
icon_state = "lockbox+l"
|
|
item_state_slots = list(slot_r_hand_str = "syringe_kit", slot_l_hand_str = "syringe_kit")
|
|
w_class = ITEMSIZE_LARGE
|
|
max_w_class = ITEMSIZE_NORMAL
|
|
max_storage_space = ITEMSIZE_COST_NORMAL * 4 //The sum of the w_classes of all the items in this storage item.
|
|
req_access = list(access_armory)
|
|
var/locked = 1
|
|
var/broken = 0
|
|
var/icon_locked = "lockbox+l"
|
|
var/icon_closed = "lockbox"
|
|
var/icon_broken = "lockbox+b"
|
|
|
|
|
|
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if (istype(W, /obj/item/weapon/card/id))
|
|
if(src.broken)
|
|
user << "<span class='warning'>It appears to be broken.</span>"
|
|
return
|
|
if(src.allowed(user))
|
|
src.locked = !( src.locked )
|
|
if(src.locked)
|
|
src.icon_state = src.icon_locked
|
|
user << "<span class='notice'>You lock \the [src]!</span>"
|
|
close_all()
|
|
return
|
|
else
|
|
src.icon_state = src.icon_closed
|
|
user << "<span class='notice'>You unlock \the [src]!</span>"
|
|
return
|
|
else
|
|
user << "<span class='warning'>Access Denied</span>"
|
|
else if(istype(W, /obj/item/weapon/melee/energy/blade))
|
|
if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
|
|
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
|
spark_system.set_up(5, 0, src.loc)
|
|
spark_system.start()
|
|
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
|
playsound(src.loc, "sparks", 50, 1)
|
|
if(!locked)
|
|
..()
|
|
else
|
|
user << "<span class='warning'>It's locked!</span>"
|
|
return
|
|
|
|
|
|
show_to(mob/user as mob)
|
|
if(locked)
|
|
user << "<span class='warning'>It's locked!</span>"
|
|
else
|
|
..()
|
|
return
|
|
|
|
/obj/item/weapon/storage/lockbox/emag_act(var/remaining_charges, var/mob/user, var/emag_source, var/visual_feedback = "", var/audible_feedback = "")
|
|
if(!broken)
|
|
if(visual_feedback)
|
|
visual_feedback = "<span class='warning'>[visual_feedback]</span>"
|
|
else
|
|
visual_feedback = "<span class='warning'>The locker has been sliced open by [user] with an electromagnetic card!</span>"
|
|
if(audible_feedback)
|
|
audible_feedback = "<span class='warning'>[audible_feedback]</span>"
|
|
else
|
|
audible_feedback = "<span class='warning'>You hear a faint electrical spark.</span>"
|
|
|
|
broken = 1
|
|
locked = 0
|
|
desc = "It appears to be broken."
|
|
icon_state = src.icon_broken
|
|
visible_message(visual_feedback, audible_feedback)
|
|
return 1
|
|
|
|
/obj/item/weapon/storage/lockbox/loyalty
|
|
name = "lockbox of loyalty implants"
|
|
req_access = list(access_security)
|
|
|
|
New()
|
|
..()
|
|
new /obj/item/weapon/implantcase/loyalty(src)
|
|
new /obj/item/weapon/implantcase/loyalty(src)
|
|
new /obj/item/weapon/implantcase/loyalty(src)
|
|
new /obj/item/weapon/implanter/loyalty(src)
|
|
|
|
|
|
/obj/item/weapon/storage/lockbox/clusterbang
|
|
name = "lockbox of clusterbangs"
|
|
desc = "You have a bad feeling about opening this."
|
|
req_access = list(access_security)
|
|
|
|
New()
|
|
..()
|
|
new /obj/item/weapon/grenade/flashbang/clusterbang(src)
|
|
|
|
/obj/item/weapon/storage/lockbox/medal
|
|
name = "lockbox of medals"
|
|
desc = "A lockbox filled with commemorative medals, it has the NanoTrasen logo stamped on it."
|
|
req_access = list(access_heads)
|
|
storage_slots = 7
|
|
|
|
New()
|
|
..()
|
|
new /obj/item/clothing/accessory/medal/conduct(src)
|
|
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
|
new /obj/item/clothing/accessory/medal/nobel_science(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/gold/captain(src)
|
|
new /obj/item/clothing/accessory/medal/gold/heroism(src) |