Skip to content

Commit

Permalink
Merge pull request #3902 from MistakeNot4892/rework/accessories_jewelry
Browse files Browse the repository at this point in the history
Repathed lockets, rings onto /jewelry.
  • Loading branch information
out-of-phaze authored Apr 26, 2024
2 parents 2abc5c8 + 398c5d7 commit 31df733
Show file tree
Hide file tree
Showing 59 changed files with 264 additions and 212 deletions.
2 changes: 1 addition & 1 deletion code/_helpers/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -855,4 +855,4 @@ var/global/list/json_cache = list()

/// Is this a dense (all keys have non-null values) associative list with at least one entry?
/proc/is_dense_assoc(var/list/L)
return length(L) > 0 && !isnull(L[L[1]])
return length(L) > 0 && !isnull(L[L[1]])
11 changes: 11 additions & 0 deletions code/_helpers/types.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/proc/get_non_abstract_types(list/input_types)
. = list()
if(!input_types)
return
if(!islist(input_types))
input_types = list(input_types)
for(var/input_type in input_types)
for(var/input_subtype in typesof(input_type))
var/datum/input_atom = input_subtype
if(!TYPE_IS_ABSTRACT(input_atom))
. |= input_subtype
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_wallet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/obj/item/cosmetics,
/obj/item/grooming,
/obj/item/mirror,
/obj/item/clothing/accessory/locket,
/obj/item/clothing/neck/necklace/locket,
/obj/item/clothing/head/hairflower,
/obj/item/flashlight/pen,
/obj/item/flashlight,
Expand Down
26 changes: 13 additions & 13 deletions code/game/gamemodes/godmode/form_items/starlight_items.dm
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
/obj/item/clothing/ring/aura_ring
/obj/item/clothing/gloves/ring/aura_ring
var/obj/aura/granted_aura

/obj/item/clothing/ring/aura_ring/equipped(var/mob/living/L, var/slot)
/obj/item/clothing/gloves/ring/aura_ring/equipped(var/mob/living/L, var/slot)
..()
if(granted_aura && slot == slot_gloves_str)
L.add_aura(granted_aura)

/obj/item/clothing/ring/aura_ring/dropped(var/mob/living/L)
/obj/item/clothing/gloves/ring/aura_ring/dropped(var/mob/living/L)
..()
if(granted_aura)
L.remove_aura(granted_aura)

/obj/item/clothing/ring/aura_ring/Destroy()
/obj/item/clothing/gloves/ring/aura_ring/Destroy()
QDEL_NULL(granted_aura)
. = ..()

/obj/item/clothing/ring/aura_ring/talisman_of_starborn
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_starborn
name = "Talisman of the Starborn"
desc = "This ring seems to shine with more light than is put on it."
icon = 'icons/clothing/rings/ring_star.dmi'
icon = 'icons/clothing/accessories/jewelry/rings/ring_star.dmi'

/obj/item/clothing/ring/aura_ring/talisman_of_starborn/Initialize()
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_starborn/Initialize()
. = ..()
granted_aura = new /obj/aura/starborn()

/obj/item/clothing/ring/aura_ring/talisman_of_blueforged
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_blueforged
name = "Talisman of the Blueforged"
desc = "The gem on this ring is quite peculiar..."
icon = 'icons/clothing/rings/ring_blue.dmi'
icon = 'icons/clothing/accessories/jewelry/rings/ring_blue.dmi'

/obj/item/clothing/ring/aura_ring/talisman_of_blueforged/Initialize()
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_blueforged/Initialize()
. = ..()
granted_aura = new /obj/aura/blueforge_aura()

/obj/item/clothing/ring/aura_ring/talisman_of_shadowling
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_shadowling
name = "Talisman of the Shadowling"
desc = "If you weren't looking at this, you probably wouldn't have noticed it."
icon = 'icons/clothing/rings/ring_shadow.dmi'
icon = 'icons/clothing/accessories/jewelry/rings/ring_shadow.dmi'

/obj/item/clothing/ring/aura_ring/talisman_of_shadowling/Initialize()
/obj/item/clothing/gloves/ring/aura_ring/talisman_of_shadowling/Initialize()
. = ..()
granted_aura = new /obj/aura/shadowling_aura()

Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
return FALSE

/obj/item/examine(mob/user, distance)

var/list/desc_comp = list()
desc_comp += "It is a [w_class_description()] item."

Expand Down Expand Up @@ -1102,3 +1102,5 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
return TRUE
return ..()

/obj/item/proc/loadout_setup(mob/wearer, metadata)
return
6 changes: 3 additions & 3 deletions code/game/objects/items/weapons/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
/obj/item/clothing/gloves/chameleon,
/obj/item/clothing/glasses/chameleon,
/obj/item/radio/headset/chameleon,
/obj/item/clothing/accessory/chameleon,
/obj/item/clothing/accessory/chameleon,
/obj/item/clothing/accessory/chameleon
/obj/item/clothing/chameleon,
/obj/item/clothing/chameleon,
/obj/item/clothing/chameleon
)

// Clerical uplink kit
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/memorial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
var/list/fallen = list()

/obj/structure/memorial/attackby(var/obj/D, var/mob/user)
if(istype(D, /obj/item/clothing/badge/tags))
var/obj/item/clothing/badge/tags/T = D
if(istype(D, /obj/item/clothing/dog_tags))
var/obj/item/clothing/dog_tags/T = D
to_chat(user, "<span class='warning'>You add \the [T.owner_name]'s \the [T] to \the [src].</span>")
fallen += "[T.owner_rank] [T.owner_name] | [T.owner_branch]"
qdel(T)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

/decl/loadout_option/accessory/locket
name = "locket"
path = /obj/item/clothing/accessory/locket
path = /obj/item/clothing/neck/necklace/locket

/decl/loadout_option/accessory/necklace
name = "necklace, colour select"
path = /obj/item/clothing/accessory/necklace
path = /obj/item/clothing/neck/necklace
loadout_flags = GEAR_HAS_COLOR_SELECTION

/decl/loadout_option/accessory/bow
Expand All @@ -57,6 +57,6 @@

/decl/loadout_option/accessory/bracelet
name = "bracelet, color select"
path = /obj/item/clothing/accessory/bracelet
path = /obj/item/clothing/gloves/bracelet
cost = 1
loadout_flags = GEAR_HAS_COLOR_SELECTION
24 changes: 12 additions & 12 deletions code/modules/client/preference_setup/loadout/lists/gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@

/decl/loadout_option/ring
name = "ring"
path = /obj/item/clothing/ring
path = /obj/item/clothing/gloves/ring
cost = 2

/decl/loadout_option/ring/get_gear_tweak_options()
. = ..()
LAZYINITLIST(.[/datum/gear_tweak/path])
.[/datum/gear_tweak/path] |= list(
"engagement ring" = /obj/item/clothing/ring/engagement,
"signet ring" = /obj/item/clothing/ring/seal/signet,
"masonic ring" = /obj/item/clothing/ring/seal/mason,
"ring, steel" = /obj/item/clothing/ring/material/steel,
"ring, bronze" = /obj/item/clothing/ring/material/bronze,
"ring, silver" = /obj/item/clothing/ring/material/silver,
"ring, gold" = /obj/item/clothing/ring/material/gold,
"ring, platinum" = /obj/item/clothing/ring/material/platinum,
"ring, glass" = /obj/item/clothing/ring/material/glass,
"ring, wood" = /obj/item/clothing/ring/material/wood,
"ring, plastic" = /obj/item/clothing/ring/material/plastic
"engagement ring" = /obj/item/clothing/gloves/ring/engagement,
"signet ring" = /obj/item/clothing/gloves/ring/seal/signet,
"masonic ring" = /obj/item/clothing/gloves/ring/seal/mason,
"ring, steel" = /obj/item/clothing/gloves/ring/material/steel,
"ring, bronze" = /obj/item/clothing/gloves/ring/material/bronze,
"ring, silver" = /obj/item/clothing/gloves/ring/material/silver,
"ring, gold" = /obj/item/clothing/gloves/ring/material/gold,
"ring, platinum" = /obj/item/clothing/gloves/ring/material/platinum,
"ring, glass" = /obj/item/clothing/gloves/ring/material/glass,
"ring, wood" = /obj/item/clothing/gloves/ring/material/wood,
"ring, plastic" = /obj/item/clothing/gloves/ring/material/plastic
)
2 changes: 2 additions & 0 deletions code/modules/client/preference_setup/loadout/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ var/global/list/gear_datums = list()
if(!item)
return

item.loadout_setup(wearer, metadata)

var/obj/item/old_item = wearer.get_equipped_item(slot)
if(wearer.equip_to_slot_if_possible(item, slot, del_on_fail = TRUE, force = TRUE, delete_old_item = FALSE, ignore_equipped = TRUE))
. = item
Expand Down
21 changes: 19 additions & 2 deletions code/modules/clothing/_clothing_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,25 @@

/obj/item/clothing/OnDisguise(obj/item/copy, mob/user)
. = ..()
if(!QDELETED(copy))
fallback_slot = copy.get_fallback_slot()

if(istype(copy, /obj/item/clothing))
var/obj/item/clothing/clothes = copy
accessory_hide_on_states = clothes.accessory_hide_on_states?.Copy()
accessory_hide_on_states = clothes.accessory_hide_on_states?.Copy()
accessory_slot = clothes.accessory_slot
accessory_removable = clothes.accessory_removable
accessory_visibility = clothes.accessory_visibility
accessory_slowdown = clothes.accessory_slowdown
mimicking_state_modifiers = TRUE
clothing_state_modifiers = clothes.clothing_state_modifiers?.Copy()
else
accessory_hide_on_states = get_initial_accessory_hide_on_states()
accessory_hide_on_states = get_initial_accessory_hide_on_states()
accessory_slot = initial(accessory_slot)
accessory_removable = initial(accessory_removable)
accessory_visibility = initial(accessory_visibility)
accessory_slowdown = initial(accessory_slowdown)
mimicking_state_modifiers = FALSE
clothing_state_modifiers = null

update_clothing_state_toggles()
29 changes: 15 additions & 14 deletions code/modules/clothing/chameleon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -312,39 +312,40 @@
//**Chameleon Accessory**
//***********************

/obj/item/clothing/accessory/chameleon
/obj/item/clothing/chameleon
name = "tie"
icon = 'icons/clothing/accessories/ties/tie.dmi'
desc = "A neosilk clip-on tie. It seems to have a small dial on its back."
origin_tech = @'{"esoteric":3}'
item_flags = ITEM_FLAG_INVALID_FOR_CHAMELEON
w_class = ITEM_SIZE_SMALL
var/static/list/clothing_choices

/obj/item/clothing/accessory/chameleon/Initialize()
var/static/list/decor_types = list(
/obj/item/clothing/neck,
/obj/item/clothing/badge,
/obj/item/clothing/medal,
/obj/item/clothing/suspenders,
/obj/item/clothing/armband,
/obj/item/clothing/webbing,
/obj/item/clothing/sensor
)

/obj/item/clothing/chameleon/Initialize()
. = ..()
if(!clothing_choices)
clothing_choices = generate_chameleon_choices(/obj/item/clothing/accessory)
clothing_choices = generate_chameleon_choices(get_non_abstract_types(decor_types))

/obj/item/clothing/accessory/chameleon/verb/change(picked in clothing_choices)
/obj/item/clothing/chameleon/verb/change(picked in clothing_choices)
set name = "Change Accessory Appearance"
set category = "Chameleon Items"
set src in usr

if (!(usr.incapacitated()))
if(!ispath(clothing_choices[picked]))
return

disguise(clothing_choices[picked], usr)
update_clothing_icon() //so our overlays update.

/obj/item/clothing/accessory/chameleon/disguise(var/newtype, var/mob/user)
var/obj/item/clothing/copy = ..()
if (!copy)
return
accessory_slot = copy.accessory_slot
accessory_visibility = copy.accessory_visibility
return copy

//*****************
//**Chameleon Gun**
//*****************
Expand Down
3 changes: 3 additions & 0 deletions code/modules/clothing/clothing_state/_clothing_state.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

/obj/item/clothing
var/mimicking_state_modifiers = FALSE
var/list/clothing_state_modifiers

/obj/item/clothing/proc/get_flat_accessory_list()
Expand All @@ -29,6 +30,8 @@
return null

/obj/item/clothing/proc/update_clothing_state_toggles()
if(mimicking_state_modifiers && clothing_state_modifiers)
return FALSE
clothing_state_modifiers = null
for(var/decl/clothing_state_modifier/modifier in get_available_clothing_state_modifiers())
LAZYSET(clothing_state_modifiers, modifier.type, FALSE)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/gloves/_gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
blood_overlay_type = "bloodyhands"
bodytype_equip_flags = BODY_FLAG_HUMANOID
fallback_slot = slot_gloves_str
var/obj/item/clothing/ring/covering_ring
var/obj/item/clothing/gloves/ring/covering_ring

/obj/item/clothing/gloves/get_associated_equipment_slots()
. = ..()
Expand All @@ -26,7 +26,7 @@
return "material from a pair of [name]."

/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE, force = FALSE, ignore_equipped = FALSE)
var/obj/item/clothing/ring/check_ring
var/obj/item/clothing/gloves/ring/check_ring
var/obj/item/gloves = user?.get_equipped_item(slot_gloves_str)
if(slot == slot_gloves_str && gloves)
if(!ignore_equipped && gloves != src)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/clothing/gloves/jewelry/bracelet.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/obj/item/clothing/gloves/bracelet
name = "bracelet"
desc = "A simple bracelet with a clasp."
icon = 'icons/clothing/accessories/jewelry/bracelet.dmi'
slot_flags = SLOT_HANDS
w_class = ITEM_SIZE_SMALL
accessory_slot = ACCESSORY_SLOT_DECOR
material = /decl/material/solid/metal/silver
6 changes: 6 additions & 0 deletions code/modules/clothing/gloves/jewelry/rings/_ring.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/obj/item/clothing/gloves/ring
name = "ring"
icon = 'icons/clothing/accessories/jewelry/rings/ring.dmi'
w_class = ITEM_SIZE_TINY
gender = NEUTER
var/can_fit_under_gloves = TRUE
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/////////////////////////////////////////
//Material Rings
// TODO: Merge this into /obj/item/clothing/ring?
/obj/item/clothing/ring/material
// TODO: Merge this into /obj/item/clothing/gloves/ring?
/obj/item/clothing/gloves/ring/material
material_alteration = MAT_FLAG_ALTERATION_ALL

/obj/item/clothing/ring/material/set_material(var/new_material)
/obj/item/clothing/gloves/ring/material/set_material(var/new_material)
. = ..()
if(istype(material) && (material_alteration & MAT_FLAG_ALTERATION_DESC))
desc = "A ring made from [material.solid_name]."

/obj/item/clothing/ring/material/attackby(var/obj/item/S, var/mob/user)
/obj/item/clothing/gloves/ring/material/attackby(var/obj/item/S, var/mob/user)
if(S.sharp)
var/inscription = sanitize(input("Enter an inscription to engrave.", "Inscription") as null|text)
if(!user.stat && !user.incapacitated() && user.Adjacent(src) && S.loc == user)
Expand All @@ -19,31 +19,31 @@
to_chat(user, "<span class='warning'>You carve \"[inscription]\" into \the [src].</span>")
desc += "<br>Written on \the [src] is the inscription \"[inscription]\""

/obj/item/clothing/ring/material/OnTopic(var/mob/user, var/list/href_list)
/obj/item/clothing/gloves/ring/material/OnTopic(var/mob/user, var/list/href_list)
if(href_list["examine"])
if(istype(user))
var/mob/living/carbon/human/H = get_recursive_loc_of_type(/mob/living/carbon/human)
if(H.Adjacent(user))
user.examinate(src)
return TOPIC_HANDLED

/obj/item/clothing/ring/material/get_examine_line()
/obj/item/clothing/gloves/ring/material/get_examine_line()
. = ..()
. += " <a href='?src=\ref[src];examine=1'>\[View\]</a>"

/obj/item/clothing/ring/material/wood
/obj/item/clothing/gloves/ring/material/wood
material = /decl/material/solid/organic/wood/walnut
/obj/item/clothing/ring/material/plastic
/obj/item/clothing/gloves/ring/material/plastic
material = /decl/material/solid/organic/plastic
/obj/item/clothing/ring/material/steel
/obj/item/clothing/gloves/ring/material/steel
material = /decl/material/solid/metal/steel
/obj/item/clothing/ring/material/silver
/obj/item/clothing/gloves/ring/material/silver
material = /decl/material/solid/metal/silver
/obj/item/clothing/ring/material/gold
/obj/item/clothing/gloves/ring/material/gold
material = /decl/material/solid/metal/gold
/obj/item/clothing/ring/material/platinum
/obj/item/clothing/gloves/ring/material/platinum
material = /decl/material/solid/metal/platinum
/obj/item/clothing/ring/material/bronze
/obj/item/clothing/gloves/ring/material/bronze
material = /decl/material/solid/metal/bronze
/obj/item/clothing/ring/material/glass
/obj/item/clothing/gloves/ring/material/glass
material = /decl/material/solid/glass
Loading

0 comments on commit 31df733

Please sign in to comment.