mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Fedoras hold small and gimmick items (#44139)
* This was probably originally intended... * Fedoras hold small items, and exceptions for gimmicks * Only create cache once * Cache exception_hold, and adds other katana type
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
/datum/component/storage/concrete/pockets/small
|
||||
max_items = 1
|
||||
max_w_class = WEIGHT_CLASS_SMALL
|
||||
attack_hand_interact = FALSE
|
||||
|
||||
/datum/component/storage/concrete/pockets/tiny
|
||||
@@ -24,7 +25,15 @@
|
||||
max_w_class = WEIGHT_CLASS_TINY
|
||||
attack_hand_interact = FALSE
|
||||
|
||||
/datum/component/storage/concrete/pockets/small/detective
|
||||
/datum/component/storage/concrete/pockets/small/fedora/Initialize()
|
||||
. = ..()
|
||||
var/static/list/exception_cache = typecacheof(list(
|
||||
/obj/item/katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana,
|
||||
/obj/item/energy_katana, /obj/item/gun/ballistic/automatic/tommygun
|
||||
))
|
||||
exception_hold = exception_cache
|
||||
|
||||
/datum/component/storage/concrete/pockets/small/fedora/detective
|
||||
attack_hand_interact = TRUE // so the detectives would discover pockets in their hats
|
||||
|
||||
/datum/component/storage/concrete/pockets/shoes
|
||||
@@ -79,4 +88,4 @@
|
||||
/datum/component/storage/concrete/pockets/small/helmet/Initialize()
|
||||
. = ..()
|
||||
can_hold = typecacheof(list(/obj/item/reagent_containers/glass/bottle,
|
||||
/obj/item/ammo_box/a762))
|
||||
/obj/item/ammo_box/a762))
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
var/datum/component/storage/concrete/master //If not null, all actions act on master and this is just an access point.
|
||||
|
||||
var/list/can_hold //if this is set, only things in this typecache will fit.
|
||||
var/list/can_hold //if this is set, only things in this typecache will fit, if within the size limit.
|
||||
var/list/cant_hold //if this is set, anything in this typecache will not be able to fit.
|
||||
var/list/exception_hold //if set, these items will be the exception to the max size of object that can fit.
|
||||
|
||||
var/list/mob/is_using //lazy list of mobs looking at the contents of this storage.
|
||||
|
||||
@@ -576,7 +577,7 @@
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
|
||||
return FALSE
|
||||
if(I.w_class > max_w_class)
|
||||
if(I.w_class > max_w_class && !is_type_in_typecache(I, exception_hold))
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[I] is too big for [host]!</span>")
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user