generic parent type for both sabre sheaths (#92300)
## About The Pull Request puts both the grass and normal sabre sheath types under a shared parent type for shared behavior. considered subtyping the storage datum but it seemed overkill. can do if requested. ## Why It's Good For The Game less copy paste. good if someone wants to add a clay-more sheath for similar (believe that exists somewhere downstream), would have done it myself but no sprites. ## Changelog N/A
@@ -119,7 +119,7 @@
|
||||
|
||||
/datum/crafting_recipe/grass_sheath
|
||||
name = "Grass Sabre Sheath"
|
||||
result = /obj/item/storage/belt/grass_sabre
|
||||
result = /obj/item/storage/belt/sheath/grass_sabre
|
||||
reqs = list(/obj/item/food/grown/grass = 4,
|
||||
/obj/item/food/grown/grass/fairy = 2)
|
||||
time = 4 SECONDS
|
||||
|
||||
@@ -964,11 +964,11 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new())
|
||||
|
||||
/datum/objective_item/steal/spy/captain_sabre_sheathe
|
||||
name = "the captain's sabre sheathe"
|
||||
targetitem = /obj/item/storage/belt/sabre
|
||||
targetitem = /obj/item/storage/belt/sheath/sabre
|
||||
excludefromjob = list(JOB_CAPTAIN)
|
||||
exists_on_map = TRUE
|
||||
difficulty = 3
|
||||
steal_hint = "The sheathe for the captain's sabre, found in their closet or strapped to their waist at all times."
|
||||
|
||||
/obj/item/storage/belt/sabre/add_stealing_item_objective()
|
||||
return add_item_to_steal(src, /obj/item/storage/belt/sabre)
|
||||
/obj/item/storage/belt/sheath/sabre/add_stealing_item_objective()
|
||||
return add_item_to_steal(src, /obj/item/storage/belt/sheath/sabre)
|
||||
|
||||
@@ -583,88 +583,63 @@
|
||||
new /obj/item/reagent_containers/cup/blastoff_ampoule(src)
|
||||
new /obj/item/reagent_containers/hypospray/medipen/methamphetamine(src)
|
||||
|
||||
/obj/item/storage/belt/sabre
|
||||
/obj/item/storage/belt/sheath
|
||||
desc = "holds like, blades and stuff. You should not be seeing this."
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
interaction_flags_click = parent_type::interaction_flags_click | NEED_DEXTERITY | NEED_HANDS
|
||||
var/stored_blade
|
||||
|
||||
/obj/item/storage/belt/sheath/Initialize(mapload)
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
/obj/item/storage/belt/sheath/examine(mob/user)
|
||||
. = ..()
|
||||
if(length(contents))
|
||||
. += span_notice("Alt-click it to quickly draw the blade.")
|
||||
|
||||
/obj/item/storage/belt/sheath/click_alt(mob/user)
|
||||
if(length(contents))
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message(span_notice("[user] takes [I] out of [src]."), span_notice("You take [I] out of [src]."))
|
||||
user.put_in_hands(I)
|
||||
update_appearance()
|
||||
else
|
||||
balloon_alert(user, "it's empty!")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/storage/belt/sheath/update_icon_state()
|
||||
icon_state = initial(inhand_icon_state)
|
||||
inhand_icon_state = initial(inhand_icon_state)
|
||||
worn_icon_state = initial(worn_icon_state)
|
||||
if(contents.len)
|
||||
icon_state += "-full"
|
||||
inhand_icon_state += "-full"
|
||||
worn_icon_state += "-full"
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/belt/sheath/PopulateContents()
|
||||
if(stored_blade)
|
||||
new stored_blade(src)
|
||||
update_appearance()
|
||||
|
||||
/obj/item/storage/belt/sheath/sabre
|
||||
name = "sabre sheath"
|
||||
desc = "An ornate sheath designed to hold an officer's blade."
|
||||
icon_state = "sheath"
|
||||
inhand_icon_state = "sheath"
|
||||
worn_icon_state = "sheath"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
interaction_flags_click = parent_type::interaction_flags_click | NEED_DEXTERITY | NEED_HANDS
|
||||
storage_type = /datum/storage/sabre_belt
|
||||
stored_blade = /obj/item/melee/sabre
|
||||
|
||||
/obj/item/storage/belt/sabre/Initialize(mapload)
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
/obj/item/storage/belt/sabre/examine(mob/user)
|
||||
. = ..()
|
||||
if(length(contents))
|
||||
. += span_notice("Alt-click it to quickly draw the blade.")
|
||||
|
||||
/obj/item/storage/belt/sabre/click_alt(mob/user)
|
||||
if(length(contents))
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message(span_notice("[user] takes [I] out of [src]."), span_notice("You take [I] out of [src]."))
|
||||
user.put_in_hands(I)
|
||||
update_appearance()
|
||||
else
|
||||
balloon_alert(user, "it's empty!")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/storage/belt/sabre/update_icon_state()
|
||||
icon_state = initial(inhand_icon_state)
|
||||
inhand_icon_state = initial(inhand_icon_state)
|
||||
worn_icon_state = initial(worn_icon_state)
|
||||
if(contents.len)
|
||||
icon_state += "-sabre"
|
||||
inhand_icon_state += "-sabre"
|
||||
worn_icon_state += "-sabre"
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/belt/sabre/PopulateContents()
|
||||
new /obj/item/melee/sabre(src)
|
||||
update_appearance()
|
||||
|
||||
/obj/item/storage/belt/grass_sabre
|
||||
/obj/item/storage/belt/sheath/grass_sabre
|
||||
name = "sabre sheath"
|
||||
desc = "A simple grass sheath designed to hold a sabre of... some sort. An actual metal one might be too sharp, though..."
|
||||
icon_state = "grass_sheath"
|
||||
inhand_icon_state = "grass_sheath"
|
||||
worn_icon_state = "grass_sheath"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
interaction_flags_click = parent_type::interaction_flags_click | NEED_DEXTERITY | NEED_HANDS
|
||||
storage_type = /datum/storage/green_sabre_belt
|
||||
|
||||
/obj/item/storage/belt/grass_sabre/Initialize(mapload)
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
/obj/item/storage/belt/grass_sabre/examine(mob/user)
|
||||
. = ..()
|
||||
if(length(contents))
|
||||
. += span_notice("Alt-click it to quickly draw the blade.")
|
||||
|
||||
/obj/item/storage/belt/grass_sabre/click_alt(mob/user)
|
||||
if(length(contents))
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message(span_notice("[user] takes [I] out of [src]."), span_notice("You take [I] out of [src]."))
|
||||
user.put_in_hands(I)
|
||||
update_appearance()
|
||||
else
|
||||
balloon_alert(user, "it's empty!")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/storage/belt/grass_sabre/update_icon_state()
|
||||
icon_state = initial(inhand_icon_state)
|
||||
inhand_icon_state = initial(inhand_icon_state)
|
||||
worn_icon_state = initial(worn_icon_state)
|
||||
if(contents.len)
|
||||
icon_state += "-sabre"
|
||||
inhand_icon_state += "-sabre"
|
||||
worn_icon_state += "-sabre"
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/belt/plant
|
||||
name = "botanical belt"
|
||||
desc = "A sturdy leather belt used to hold most hydroponics supplies."
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/obj/structure/closet/secure_closet/captains/populate_contents_immediate()
|
||||
new /obj/item/gun/energy/e_gun(src)
|
||||
new /obj/item/storage/belt/sabre(src)
|
||||
new /obj/item/storage/belt/sheath/sabre(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/hop
|
||||
name = "head of personnel's locker"
|
||||
|
||||
@@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(mystery_box_extended, list(
|
||||
/obj/item/clothing/gloves/rapid,
|
||||
/obj/item/shield/riot/flash,
|
||||
/obj/item/grenade/stingbang/mega,
|
||||
/obj/item/storage/belt/sabre,
|
||||
/obj/item/storage/belt/sheath/sabre,
|
||||
/obj/item/knife/combat,
|
||||
/obj/item/melee/baton/security/loaded,
|
||||
/obj/item/reagent_containers/hypospray/combat,
|
||||
|
||||
@@ -420,7 +420,7 @@
|
||||
/obj/item/food/cake/birthday = 1,
|
||||
/obj/item/storage/box/fireworks = 3,
|
||||
)
|
||||
belt = /obj/item/storage/belt/sabre
|
||||
belt = /obj/item/storage/belt/sheath/sabre
|
||||
head = /obj/item/clothing/head/hats/coordinator
|
||||
l_pocket = /obj/item/knife/kitchen
|
||||
l_hand = /obj/item/toy/balloon
|
||||
|
||||
@@ -585,7 +585,7 @@
|
||||
neck = /obj/item/bedsheet/captain
|
||||
glasses = /obj/item/clothing/glasses/sunglasses
|
||||
gloves = /obj/item/clothing/gloves/captain
|
||||
belt = /obj/item/storage/belt/sabre
|
||||
belt = /obj/item/storage/belt/sheath/sabre
|
||||
l_hand = /obj/item/gun/energy/laser/captain
|
||||
r_pocket = /obj/item/assembly/flash
|
||||
l_pocket = /obj/item/melee/baton/telescopic
|
||||
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,2 @@
|
||||
/obj/item/storage/belt/sabre : /obj/item/storage/belt/sheath/sabre
|
||||
/obj/item/storage/belt/grass_sabre : /obj/item/storage/belt/sheath/grass_sabre
|
||||