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:
Akrilla
2019-05-28 09:57:59 -04:00
committed by Emmett Gaines
parent 82dea9658a
commit 55ed0ebf35
4 changed files with 23 additions and 13 deletions
@@ -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))
+3 -2
View File
@@ -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
+2 -2
View File
@@ -59,7 +59,7 @@
icon_state = "nun_hood"
flags_inv = HIDEHAIR
flags_cover = HEADCOVERSEYES
/obj/item/clothing/head/bishopmitre
name = "bishop mitre"
desc = "An opulent hat that functions as a radio to God. Or as a lightning rod, depending on who you ask."
@@ -72,7 +72,7 @@
armor = list("melee" = 25, "bullet" = 5, "laser" = 25, "energy" = 10, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 50)
icon_state = "detective"
var/candy_cooldown = 0
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/detective
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/fedora/detective
dog_fashion = /datum/dog_fashion/head/detective
/obj/item/clothing/head/fedora/det_hat/Initialize()
+7 -7
View File
@@ -204,7 +204,7 @@
icon_state = "fedora"
item_state = "fedora"
desc = "A really cool hat if you're a mobster. A really lame hat if you're not."
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/fedora
/obj/item/clothing/head/fedora/suicide_act(mob/user)
if(user.gender == FEMALE)
@@ -367,28 +367,28 @@
if(prob(3))
M += pick(" Honh honh honh!"," Honh!"," Zut Alors!")
return trim(M)
/obj/item/clothing/head/clownmitre
name = "Hat of the Honkmother"
desc = "It's hard for parishoners to see a banana peel on the floor when they're looking up at your glorious chapeau."
icon_state = "clownmitre"
/obj/item/clothing/head/kippah
name = "kippah"
desc = "Signals that you follow the Jewish Halakha. Keeps the head covered and the soul extra-Orthodox."
desc = "Signals that you follow the Jewish Halakha. Keeps the head covered and the soul extra-Orthodox."
icon_state = "kippah"
/obj/item/clothing/head/medievaljewhat
name = "medieval Jew hat"
desc = "A silly looking hat, intended to be placed on the heads of the station's oppressed religious minorities."
icon_state = "medievaljewhat"
/obj/item/clothing/head/taqiyahwhite
name = "white taqiyah"
desc = "An extra-mustahabb way of showing your devotion to Allah."
icon_state = "taqiyahwhite"
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small
/obj/item/clothing/head/taqiyahred
name = "red taqiyah"
desc = "An extra-mustahabb way of showing your devotion to Allah."