Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds wrist accessory slots to gloves and uniforms plus a crappy wrist watch #8064

Merged
Merged
2 changes: 2 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ GLOBAL_LIST_INIT(slot_to_contained_sprite_shorthand, list(
#define ACCESSORY_SLOT_PONCHO "Ponchos"
#define ACCESSORY_SLOT_TROPHY "Trophy"
#define ACCESSORY_SLOT_MASK "Mask"
#define ACCESSORY_SLOT_WRIST_L "Left wrist"
#define ACCESSORY_SLOT_WRIST_R "Right wrist"

/// Used for uniform armor inserts.
#define ACCESSORY_SLOT_ARMOR_C "Chest armor"
Expand Down
20 changes: 10 additions & 10 deletions code/game/objects/items/devices/personal_data_transmitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
icon_state = "pdt_locator_tube"
w_class = SIZE_SMALL

var/obj/item/clothing/accessory/pdt_bracelet/linked_bracelet
var/obj/item/clothing/accessory/wrist/pdt_bracelet/linked_bracelet
var/obj/item/cell/crap/battery

/obj/item/device/pdt_locator_tube/Initialize(mapload, obj/item/clothing/accessory/pdt_bracelet/bracelet)
/obj/item/device/pdt_locator_tube/Initialize(mapload, obj/item/clothing/accessory/wrist/pdt_bracelet/bracelet)
. = ..()
if(bracelet)
linked_bracelet = bracelet
Expand Down Expand Up @@ -142,7 +142,7 @@
QDEL_NULL(battery)
return ..()

/obj/item/clothing/accessory/pdt_bracelet
/obj/item/clothing/accessory/wrist/pdt_bracelet
name = "\improper PDT bracelet"
desc = "A personal data transmitter bracelet, also known as a PDT, is a form of personal locator typically surgically implanted into the body of extrasolar colonists, among others. Its purpose is to allow rapid location of the associated personnel anywhere within a certain radius of the receiving equipment, sometimes up to 30km distance. This bracelet forms part of the PDT/L variant, which is a wearable version of the PDT technology. Both it and the linked locator tube share a serial number for ease of detection in case of mixup."
icon = 'icons/obj/items/clothing/accessory/watches.dmi'
Expand All @@ -154,12 +154,12 @@
var/dummy_icon_state = "pdt_watch"
var/copied_serial_number = null

/obj/item/clothing/accessory/pdt_bracelet/get_examine_text(mob/user)
/obj/item/clothing/accessory/wrist/pdt_bracelet/get_examine_text(mob/user)
. = ..()
if(!isxeno(user) && (get_dist(user, src) < 2 || isobserver(user)) && copied_serial_number)
. += SPAN_INFO("The serial number is [copied_serial_number].")

/obj/item/clothing/accessory/pdt_bracelet/Initialize()
/obj/item/clothing/accessory/wrist/pdt_bracelet/Initialize()
. = ..()
icon_state = "[dummy_icon_state]_[rand(0, 2)]"

Expand All @@ -169,14 +169,14 @@
desc_lore = "This kit was distributed in the 200th (Season 4) Issue of the Boots! magazine, 'Privates die without their battlebuddy!', to drive up sales. Many have noted the poor battery life of these units, leading many to speculate that these were faulty units that were repackaged and shipped off to various USCM-adjacent mil-surplus good stores. The Department of the Navy Observation in Photographs (DNOP) has not released a statement regarding these theories."
icon = 'icons/obj/items/storage/kits.dmi'
icon_state = "pdt_box"
can_hold = list(/obj/item/device/pdt_locator_tube, /obj/item/clothing/accessory/pdt_bracelet)
can_hold = list(/obj/item/device/pdt_locator_tube, /obj/item/clothing/accessory/wrist/pdt_bracelet)
foldable = /obj/item/stack/sheet/cardboard
storage_slots = 3
w_class = SIZE_SMALL
max_w_class = SIZE_SMALL

/obj/item/storage/box/pdt_kit/fill_preset_inventory()
new /obj/item/device/pdt_locator_tube(src, new /obj/item/clothing/accessory/pdt_bracelet(src))
new /obj/item/device/pdt_locator_tube(src, new /obj/item/clothing/accessory/wrist/pdt_bracelet(src))
new /obj/item/cell/crap(src) //it not fitting is intentional

/// THE ADVANCED VERSION... ADMIN SPAWN ONLY... USES TGUI RADAR... ///
Expand All @@ -186,14 +186,14 @@
desc = "Contains a PDT/L set, consisting of the advanced PDT bracelet and its sister locator tube, alongside a spare cell seemingly wedged into the kit."

/obj/item/storage/box/pdt_kit/advanced/fill_preset_inventory()
new /obj/item/device/pdt_locator_tube/advanced(src, new /obj/item/clothing/accessory/pdt_bracelet/advanced(src))
new /obj/item/device/pdt_locator_tube/advanced(src, new /obj/item/clothing/accessory/wrist/pdt_bracelet/advanced(src))
new /obj/item/cell/crap(src) //it not fitting is intentional

/obj/item/device/pdt_locator_tube/advanced
name = "advanced PDT locator tube"
var/datum/radar/advanced_pdtl/radar

/obj/item/device/pdt_locator_tube/advanced/Initialize(mapload, obj/item/clothing/accessory/pdt_bracelet/bracelet)
/obj/item/device/pdt_locator_tube/advanced/Initialize(mapload, obj/item/clothing/accessory/wrist/pdt_bracelet/bracelet)
. = ..()
radar = new /datum/radar/advanced_pdtl(src)

Expand All @@ -208,5 +208,5 @@
/obj/item/device/pdt_locator_tube/advanced/locate_bracelet(mob/user)
radar.tgui_interact(user)

/obj/item/clothing/accessory/pdt_bracelet/advanced
/obj/item/clothing/accessory/wrist/pdt_bracelet/advanced
name = "advanced PDT bracelet"
5 changes: 5 additions & 0 deletions code/modules/client/preferences_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -992,3 +992,8 @@ GLOBAL_LIST_EMPTY_TYPED(gear_datums_by_name, /datum/gear)
display_name = "Cut-throat razor"
path = /obj/item/weapon/straight_razor
cost = 3

/datum/gear/misc/watch
display_name = "Cheap wrist watch"
path = /obj/item/clothing/accessory/wrist/watch
cost = 1 // Cheap and crappy
2 changes: 2 additions & 0 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@
flags_armor_protection = BODY_FLAG_HANDS
flags_equip_slot = SLOT_HANDS
attack_verb = list("challenged")
valid_accessory_slots = list(ACCESSORY_SLOT_WRIST_L, ACCESSORY_SLOT_WRIST_R)
restricted_accessory_slots = list(ACCESSORY_SLOT_WRIST_L, ACCESSORY_SLOT_WRIST_R) // To prevent infinitely putting watches/wrist accessories on your gloves. That can be reserved for uniforms, where you have the whole ARM to put shit on
sprite_sheets = list(SPECIES_MONKEY = 'icons/mob/humans/species/monkeys/onmob/hands_monkey.dmi')
blood_overlay_type = "hands"
var/gloves_blood_amt = 0 //taken from blood.dm
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/clothing_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
/obj/item/clothing/get_examine_text(mob/user)
. = ..()
for(var/obj/item/clothing/accessory/A in accessories)
. += "[icon2html(A, user)] \A [A] is attached to it[A.additional_examine_text()]" //The spacing of the examine text proc is deliberate. By default it returns ".".
. += "[icon2html(A, user)] \A [A] is [A.additional_examine_text()]" //The spacing of the examine text proc is deliberate. By default it returns ".".

/**
* Attach accessory A to src
Expand Down
55 changes: 54 additions & 1 deletion code/modules/clothing/under/ties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

///Extra text to append when attached to another clothing item and the host clothing is examined.
/obj/item/clothing/accessory/proc/additional_examine_text()
return "."
return "attached to it."

/obj/item/clothing/accessory/blue
name = "blue tie"
Expand Down Expand Up @@ -1052,3 +1052,56 @@
desc = "This is a fancy-looking ballistics vest, meant to be attached to a uniform." //No stats for these yet, just placeholder implementation.
icon_state = "owlf_vest"
item_state = "owlf_vest"

/*
Wrist Accessories
*/

/obj/item/clothing/accessory/wrist
name = "bracelet"
desc = "A simple bracelet made from a strip of fabric."
icon = 'icons/obj/items/clothing/accessory/wrist_accessories.dmi'
icon_state = "bracelet"
inv_overlay_icon = null
slot = ACCESSORY_SLOT_WRIST_L
var/which_wrist = "left wrist"

/obj/item/clothing/accessory/wrist/get_examine_text(mob/user)
. = ..()

switch(slot)
if(ACCESSORY_SLOT_WRIST_L)
which_wrist = "left wrist"
if(ACCESSORY_SLOT_WRIST_R)
which_wrist = "right wrist"
. += "It will be worn on the [which_wrist]."

/obj/item/clothing/accessory/wrist/additional_examine_text()
return "on the [which_wrist]."

/obj/item/clothing/accessory/wrist/attack_self(mob/user)
..()

switch(slot)
if(ACCESSORY_SLOT_WRIST_L)
slot = ACCESSORY_SLOT_WRIST_R
to_chat(user, SPAN_NOTICE("The [src] will be worn on the right wrist."))
if(ACCESSORY_SLOT_WRIST_R)
slot = ACCESSORY_SLOT_WRIST_L
to_chat(user, SPAN_NOTICE("The [src] will be worn on the left wrist."))
harryob marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/clothing/accessory/wrist/watch
name = "digital wrist watch"
desc = "A cheap 24-hour only digital wrist watch. It has a crappy red display, great for looking at in the dark!"
icon = 'icons/obj/items/clothing/accessory/watches.dmi'
icon_state = "cheap_watch"

/obj/item/clothing/accessory/wrist/watch/get_examine_text(mob/user)
. = ..()

. += "It reads: [SPAN_NOTICE("[worldtime2text()]")]"

/obj/item/clothing/accessory/wrist/watch/additional_examine_text()
. = ..()

. += " It reads: [SPAN_NOTICE("[worldtime2text()]")]"
2 changes: 1 addition & 1 deletion code/modules/clothing/under/under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
var/worn_state = null
var/hood_state //for uniforms with hoods.
drag_unequip = TRUE
valid_accessory_slots = list(ACCESSORY_SLOT_UTILITY, ACCESSORY_SLOT_ARMBAND, ACCESSORY_SLOT_RANK, ACCESSORY_SLOT_DECOR, ACCESSORY_SLOT_MEDAL, ACCESSORY_SLOT_ARMOR_C)
valid_accessory_slots = list(ACCESSORY_SLOT_UTILITY, ACCESSORY_SLOT_ARMBAND, ACCESSORY_SLOT_RANK, ACCESSORY_SLOT_DECOR, ACCESSORY_SLOT_MEDAL, ACCESSORY_SLOT_ARMOR_C, ACCESSORY_SLOT_WRIST_L, ACCESSORY_SLOT_WRIST_R)
restricted_accessory_slots = list(ACCESSORY_SLOT_UTILITY, ACCESSORY_SLOT_ARMBAND, ACCESSORY_SLOT_RANK, ACCESSORY_SLOT_ARMOR_C)
sprite_sheets = list(SPECIES_MONKEY = 'icons/mob/humans/species/monkeys/onmob/uniform_monkey_0.dmi')
equip_sounds = list('sound/handling/clothing_on.ogg')
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_marines/radar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
/datum/radar/advanced_pdtl/scan()
. = ..()
objects = list()
var/obj/item/clothing/accessory/pdt_bracelet/bracelet = typed_holder.linked_bracelet
var/obj/item/clothing/accessory/wrist/pdt_bracelet/bracelet = typed_holder.linked_bracelet
if(!bracelet)
return
objects += list(list(
Expand Down
4 changes: 3 additions & 1 deletion code/modules/cm_tech/implements/armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
. += SPAN_NOTICE(get_damage_status())

/obj/item/clothing/accessory/health/additional_examine_text()
return ". [get_damage_status()]"
. = ..()

. += "[get_damage_status()]"

/obj/item/clothing/accessory/health/on_attached(obj/item/clothing/S, mob/living/carbon/human/user)
. = ..()
Expand Down
Binary file modified icons/obj/items/clothing/accessory/watches.dmi
Binary file not shown.
Binary file not shown.
Loading