mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
Merge pull request #392 from Sandstorm-Station/accessories-stuf
Fixing accessories ™️
This commit is contained in:
@@ -27,10 +27,11 @@
|
|||||||
if(ishuman(M) && M.w_uniform)
|
if(ishuman(M) && M.w_uniform)
|
||||||
var/obj/item/clothing/under/U = M.w_uniform
|
var/obj/item/clothing/under/U = M.w_uniform
|
||||||
//SANDSTORM EDIT
|
//SANDSTORM EDIT
|
||||||
if(istype(U) && length(U.attached_accessories))
|
if(istype(U) && !CHECK_BITFIELD(U.flags_inv, HIDEACCESSORY))
|
||||||
for(var/obj/item/clothing/accessory/attached in U.attached_accessories)
|
for(var/obj/item/clothing/accessory/attached as anything in U.attached_accessories)
|
||||||
if(attached.above_suit)
|
if(CHECK_BITFIELD(attached.flags_inv, HIDEACCESSORY) || !attached.above_suit)
|
||||||
. += U.accessory_overlays
|
continue
|
||||||
|
. += attached.build_worn_icon()
|
||||||
//SANDSTORM EDIT END
|
//SANDSTORM EDIT END
|
||||||
|
|
||||||
/obj/item/clothing/suit/update_clothes_damaged_state()
|
/obj/item/clothing/suit/update_clothes_damaged_state()
|
||||||
|
|||||||
@@ -24,8 +24,7 @@
|
|||||||
var/dummy_thick = FALSE // is able to hold accessories on its item
|
var/dummy_thick = FALSE // is able to hold accessories on its item
|
||||||
//SANDSTORM EDIT - Removed the old attached accessory system. We use a list of accessories instead.
|
//SANDSTORM EDIT - Removed the old attached accessory system. We use a list of accessories instead.
|
||||||
var/max_accessories = 3
|
var/max_accessories = 3
|
||||||
var/list/obj/item/clothing/accessory/attached_accessories = list()
|
var/list/obj/item/clothing/accessory/attached_accessories
|
||||||
var/list/mutable_appearance/accessory_overlays = list()
|
|
||||||
//SANDSTORM EDIT END
|
//SANDSTORM EDIT END
|
||||||
|
|
||||||
/obj/item/clothing/under/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE)
|
/obj/item/clothing/under/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE)
|
||||||
@@ -36,8 +35,12 @@
|
|||||||
. += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform")
|
. += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform")
|
||||||
if(blood_DNA)
|
if(blood_DNA)
|
||||||
. += mutable_appearance('icons/effects/blood.dmi', "uniformblood", color = blood_DNA_to_color(), blend_mode = blood_DNA_to_blend())
|
. += mutable_appearance('icons/effects/blood.dmi', "uniformblood", color = blood_DNA_to_color(), blend_mode = blood_DNA_to_blend())
|
||||||
if(length(accessory_overlays))
|
if(CHECK_BITFIELD(flags_inv, HIDEACCESSORY))
|
||||||
. += accessory_overlays
|
return
|
||||||
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in attached_accessories)
|
||||||
|
if(CHECK_BITFIELD(attached_accessory.flags_inv, HIDEACCESSORY))
|
||||||
|
continue
|
||||||
|
. += attached_accessory.build_worn_icon()
|
||||||
|
|
||||||
/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
|
/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
|
||||||
if((sensordamage || (has_sensor < HAS_SENSORS && has_sensor != NO_SENSORS)) && istype(I, /obj/item/stack/cable_coil))
|
if((sensordamage || (has_sensor < HAS_SENSORS && has_sensor != NO_SENSORS)) && istype(I, /obj/item/stack/cable_coil))
|
||||||
@@ -125,68 +128,60 @@
|
|||||||
body_parts_covered |= CHEST
|
body_parts_covered |= CHEST
|
||||||
|
|
||||||
// Sandstorm edit
|
// Sandstorm edit
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in attached_accessories)
|
var/must_update = FALSE
|
||||||
if(attached_accessory && slot != ITEM_SLOT_HANDS && ishuman(user))
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in attached_accessories)
|
||||||
var/mob/living/carbon/human/H = user
|
if(attached_accessory && slot == ITEM_SLOT_ICLOTHING && ishuman(user))
|
||||||
attached_accessory.on_uniform_equip(src, user)
|
attached_accessory.on_uniform_equip(src, user)
|
||||||
if(attached_accessory.above_suit)
|
if(attached_accessory.above_suit)
|
||||||
H.update_inv_wear_suit()
|
must_update = TRUE
|
||||||
|
if(must_update)
|
||||||
|
user.update_inv_wear_suit()
|
||||||
//
|
//
|
||||||
|
|
||||||
/obj/item/clothing/under/dropped(mob/user)
|
/obj/item/clothing/under/dropped(mob/user)
|
||||||
// Sandstorm edit
|
// Sandstorm edit
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in attached_accessories)
|
var/must_update = FALSE
|
||||||
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in attached_accessories)
|
||||||
attached_accessory.on_uniform_dropped(src, user)
|
attached_accessory.on_uniform_dropped(src, user)
|
||||||
if(ishuman(user))
|
if(attached_accessory.above_suit)
|
||||||
var/mob/living/carbon/human/H = user
|
must_update = TRUE
|
||||||
if(attached_accessory.above_suit)
|
if(must_update)
|
||||||
H.update_inv_wear_suit()
|
user.update_inv_wear_suit()
|
||||||
//
|
//
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/clothing/under/proc/attach_accessory(obj/item/I, mob/user, notifyAttach = 1)
|
/obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/accessory, mob/user, notifyAttach = 1)
|
||||||
. = FALSE
|
. = FALSE
|
||||||
if(istype(I, /obj/item/clothing/accessory) && !istype(I, /obj/item/clothing/accessory/ring))
|
if(!istype(accessory))
|
||||||
var/obj/item/clothing/accessory/A = I
|
return
|
||||||
if(length(attached_accessories) >= max_accessories)
|
if(istype(accessory, /obj/item/clothing/accessory/ring))
|
||||||
if(user)
|
return
|
||||||
to_chat(user, "<span class='warning'>[src] already has [length(attached_accessories)] accessories.</span>")
|
if(length(attached_accessories) >= max_accessories)
|
||||||
return
|
if(user)
|
||||||
if(dummy_thick)
|
to_chat(user, span_warning("[src] already has [length(attached_accessories)] accessories."))
|
||||||
if(user)
|
return
|
||||||
to_chat(user, "<span class='warning'>[src] is too bulky and cannot have accessories attached to it!</span>")
|
if(dummy_thick)
|
||||||
return
|
if(user)
|
||||||
else
|
to_chat(user, span_warning("[src] is too bulky and cannot have accessories attached to it!"))
|
||||||
if(user && !user.temporarilyRemoveItemFromInventory(I))
|
return
|
||||||
return
|
if(user && !user.temporarilyRemoveItemFromInventory(accessory))
|
||||||
if(!A.attach(src, user))
|
return
|
||||||
return
|
if(!accessory.attach(src, user))
|
||||||
|
return
|
||||||
|
|
||||||
if(user && notifyAttach)
|
if(user && notifyAttach)
|
||||||
to_chat(user, "<span class='notice'>You attach [I] to [src].</span>")
|
to_chat(user, span_notice("You attach [accessory] to [src]."))
|
||||||
|
|
||||||
if((flags_inv & HIDEACCESSORY) || (A.flags_inv & HIDEACCESSORY))
|
if((flags_inv & HIDEACCESSORY) || (accessory.flags_inv & HIDEACCESSORY))
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
//SANDSTORM EDIT
|
if(ishuman(loc))
|
||||||
accessory_overlays = list(mutable_appearance('icons/mob/clothing/accessories.dmi', "blank"))
|
var/mob/living/carbon/human/H = loc
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in attached_accessories)
|
H.update_inv_w_uniform()
|
||||||
var/datum/element/polychromic/polychromic = LAZYACCESS(attached_accessory.comp_lookup, "item_worn_overlays")
|
if(accessory.above_suit)
|
||||||
if(!polychromic)
|
H.update_inv_wear_suit()
|
||||||
var/mutable_appearance/accessory_overlay = mutable_appearance(attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, ABOVE_HUD_LAYER)
|
|
||||||
accessory_overlay.alpha = attached_accessory.alpha
|
|
||||||
accessory_overlay.color = attached_accessory.color
|
|
||||||
accessory_overlays += accessory_overlay
|
|
||||||
else
|
|
||||||
polychromic.apply_worn_overlays(attached_accessory, FALSE, attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, NONE, accessory_overlays)
|
|
||||||
//SANDSTORM EDIT END
|
|
||||||
|
|
||||||
if(ishuman(loc))
|
return TRUE
|
||||||
var/mob/living/carbon/human/H = loc
|
|
||||||
H.update_inv_w_uniform()
|
|
||||||
H.update_inv_wear_suit()
|
|
||||||
|
|
||||||
return TRUE
|
|
||||||
|
|
||||||
/obj/item/clothing/under/proc/remove_accessory(mob/user)
|
/obj/item/clothing/under/proc/remove_accessory(mob/user)
|
||||||
if(!isliving(user))
|
if(!isliving(user))
|
||||||
@@ -194,22 +189,21 @@
|
|||||||
if(!can_use(user))
|
if(!can_use(user))
|
||||||
return
|
return
|
||||||
|
|
||||||
//SKYRAT EDIT
|
if(!LAZYLEN(attached_accessories))
|
||||||
if(length(attached_accessories))
|
return
|
||||||
var/obj/item/clothing/accessory/A = attached_accessories[length(attached_accessories)]
|
var/obj/item/clothing/accessory/accessory = attached_accessories[length(attached_accessories)]
|
||||||
//SKYRAT EDIT END
|
accessory.detach(src, user)
|
||||||
A.detach(src, user)
|
if(user.put_in_hands(accessory))
|
||||||
if(user.put_in_hands(A))
|
to_chat(user, span_notice("You detach [accessory] from [src]."))
|
||||||
to_chat(user, "<span class='notice'>You detach [A] from [src].</span>")
|
else
|
||||||
else
|
to_chat(user, span_notice("You detach [accessory] from [src] and it falls on the floor."))
|
||||||
to_chat(user, "<span class='notice'>You detach [A] from [src] and it falls on the floor.</span>")
|
|
||||||
|
|
||||||
if(ishuman(loc))
|
if(ishuman(loc))
|
||||||
var/mob/living/carbon/human/H = loc
|
var/mob/living/carbon/human/H = loc
|
||||||
H.update_inv_w_uniform()
|
H.update_inv_w_uniform()
|
||||||
|
if(accessory.above_suit)
|
||||||
H.update_inv_wear_suit()
|
H.update_inv_wear_suit()
|
||||||
|
|
||||||
|
|
||||||
/obj/item/clothing/under/examine(mob/user)
|
/obj/item/clothing/under/examine(mob/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(can_adjust)
|
if(can_adjust)
|
||||||
@@ -234,10 +228,9 @@
|
|||||||
. += "Its vital tracker appears to be enabled."
|
. += "Its vital tracker appears to be enabled."
|
||||||
if(SENSOR_COORDS)
|
if(SENSOR_COORDS)
|
||||||
. += "Its vital tracker and tracking beacon appear to be enabled."
|
. += "Its vital tracker and tracking beacon appear to be enabled."
|
||||||
if(length(attached_accessories))
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in attached_accessories)
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in attached_accessories)
|
. += "\A [attached_accessory] is attached to it."
|
||||||
. += "\A [attached_accessory] is attached to it."
|
//SANDSTORM EDIT END
|
||||||
//SKYRAT EDIT END
|
|
||||||
|
|
||||||
/obj/item/clothing/under/verb/toggle()
|
/obj/item/clothing/under/verb/toggle()
|
||||||
set name = "Adjust Suit Sensors"
|
set name = "Adjust Suit Sensors"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "Accessory"
|
name = "Accessory"
|
||||||
desc = "Something has gone wrong!"
|
desc = "Something has gone wrong!"
|
||||||
icon = 'icons/obj/clothing/accessories.dmi'
|
icon = 'icons/obj/clothing/accessories.dmi'
|
||||||
//skyrat edit
|
//sandstorm edit
|
||||||
mob_overlay_icon = 'icons/mob/clothing/accessories.dmi'
|
mob_overlay_icon = 'icons/mob/clothing/accessories.dmi'
|
||||||
//
|
//
|
||||||
icon_state = "plasma"
|
icon_state = "plasma"
|
||||||
@@ -13,48 +13,41 @@
|
|||||||
var/above_suit = FALSE
|
var/above_suit = FALSE
|
||||||
var/minimize_when_attached = TRUE // TRUE if shown as a small icon in corner, FALSE if overlayed
|
var/minimize_when_attached = TRUE // TRUE if shown as a small icon in corner, FALSE if overlayed
|
||||||
var/datum/component/storage/detached_pockets
|
var/datum/component/storage/detached_pockets
|
||||||
//skyrat edit
|
|
||||||
var/current_uniform = null
|
|
||||||
//
|
|
||||||
|
|
||||||
/obj/item/clothing/accessory/proc/attach(obj/item/clothing/under/U, user)
|
/obj/item/clothing/accessory/proc/attach(obj/item/clothing/under/uniform, user)
|
||||||
var/datum/component/storage/storage = GetComponent(/datum/component/storage)
|
var/datum/component/storage/storage = GetComponent(/datum/component/storage)
|
||||||
if(storage)
|
if(storage)
|
||||||
if(SEND_SIGNAL(U, COMSIG_CONTAINS_STORAGE))
|
if(SEND_SIGNAL(uniform, COMSIG_CONTAINS_STORAGE))
|
||||||
return FALSE
|
return FALSE
|
||||||
U.TakeComponent(storage)
|
uniform.TakeComponent(storage)
|
||||||
detached_pockets = storage
|
detached_pockets = storage
|
||||||
//SKYRAT EDIT
|
//SANDSTORM EDIT
|
||||||
U.attached_accessories |= src
|
LAZYADD(uniform.attached_accessories, src)
|
||||||
force_unto(U)
|
force_unto(uniform)
|
||||||
current_uniform = U
|
//SANDSTORM EDIT END
|
||||||
//SKYRAT EDIT END
|
forceMove(uniform)
|
||||||
forceMove(U)
|
|
||||||
|
|
||||||
if (islist(U.armor) || isnull(U.armor)) // This proc can run before /obj/Initialize has run for U and src,
|
if (islist(uniform.armor) || isnull(uniform.armor)) // This proc can run before /obj/Initialize has run for uniform and src,
|
||||||
U.armor = getArmor(arglist(U.armor)) // we have to check that the armor list has been transformed into a datum before we try to call a proc on it
|
uniform.armor = getArmor(arglist(uniform.armor)) // we have to check that the armor list has been transformed into a datum before we try to call a proc on it
|
||||||
// This is safe to do as /obj/Initialize only handles setting up the datum if actually needed.
|
// This is safe to do as /obj/Initialize only handles setting up the datum if actually needed.
|
||||||
if (islist(armor) || isnull(armor))
|
if (islist(armor) || isnull(armor))
|
||||||
armor = getArmor(arglist(armor))
|
armor = getArmor(arglist(armor))
|
||||||
|
|
||||||
U.armor = U.armor.attachArmor(armor)
|
uniform.armor = uniform.armor.attachArmor(armor)
|
||||||
|
|
||||||
if(isliving(user))
|
if(isliving(user))
|
||||||
on_uniform_equip(U, user)
|
on_uniform_equip(uniform, user)
|
||||||
|
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/obj/item/clothing/accessory/proc/detach(obj/item/clothing/under/U, user)
|
/obj/item/clothing/accessory/proc/detach(obj/item/clothing/under/uniform, user)
|
||||||
if(detached_pockets && detached_pockets.parent == U)
|
if(detached_pockets && detached_pockets.parent == uniform)
|
||||||
TakeComponent(detached_pockets)
|
TakeComponent(detached_pockets)
|
||||||
|
|
||||||
U.armor = U.armor.detachArmor(armor)
|
uniform.armor = uniform.armor.detachArmor(armor)
|
||||||
//SANDSTORM EDIT
|
|
||||||
current_uniform = null
|
|
||||||
//SANDSTORM EDIT END
|
|
||||||
|
|
||||||
if(isliving(user))
|
if(isliving(user))
|
||||||
on_uniform_dropped(U, user)
|
on_uniform_dropped(uniform, user)
|
||||||
|
|
||||||
if(minimize_when_attached)
|
if(minimize_when_attached)
|
||||||
transform *= 2
|
transform *= 2
|
||||||
@@ -62,48 +55,36 @@
|
|||||||
pixel_y = 0
|
pixel_y = 0
|
||||||
layer = initial(layer)
|
layer = initial(layer)
|
||||||
plane = initial(plane)
|
plane = initial(plane)
|
||||||
U.cut_overlays()
|
uniform.cut_overlays()
|
||||||
U.attached_accessories -= src
|
LAZYREMOVE(uniform.attached_accessories, src)
|
||||||
U.accessory_overlays = list()
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in uniform.attached_accessories)
|
||||||
if(length(U.attached_accessories))
|
uniform.add_overlay(attached_accessory)
|
||||||
U.accessory_overlays = list(mutable_appearance('icons/mob/clothing/accessories.dmi', "blank"))
|
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in U.attached_accessories)
|
|
||||||
attached_accessory.force_unto(U)
|
|
||||||
var/datum/element/polychromic/polychromic = LAZYACCESS(attached_accessory.comp_lookup, "item_worn_overlays")
|
|
||||||
if(!polychromic)
|
|
||||||
var/mutable_appearance/accessory_overlay = mutable_appearance(attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, ABOVE_HUD_LAYER)
|
|
||||||
accessory_overlay.alpha = attached_accessory.alpha
|
|
||||||
accessory_overlay.color = attached_accessory.color
|
|
||||||
U.accessory_overlays += accessory_overlay
|
|
||||||
else
|
|
||||||
polychromic.apply_worn_overlays(attached_accessory, FALSE, attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, NONE, U.accessory_overlays)
|
|
||||||
|
|
||||||
//SANDSTORM EDIT
|
//SANDSTORM EDIT
|
||||||
/obj/item/clothing/accessory/proc/force_unto(obj/item/clothing/under/U)
|
/obj/item/clothing/accessory/proc/force_unto(obj/item/clothing/under/uniform)
|
||||||
layer = FLOAT_LAYER
|
layer = FLOAT_LAYER
|
||||||
plane = FLOAT_PLANE
|
plane = FLOAT_PLANE
|
||||||
if(minimize_when_attached)
|
if(minimize_when_attached)
|
||||||
if(current_uniform != U)
|
transform *= 0.5 //halve the size so it doesn't overpower the under
|
||||||
transform *= 0.5 //halve the size so it doesn't overpower the under
|
pixel_x += 8
|
||||||
pixel_x += 8
|
pixel_y -= 8
|
||||||
pixel_y -= 8
|
if(length(uniform.attached_accessories) > 1)
|
||||||
if(length(U.attached_accessories) > 1)
|
switch(LAZYLEN(uniform.attached_accessories))
|
||||||
if(length(U.attached_accessories) <= 3 && !current_uniform)
|
if(2 to 3)
|
||||||
pixel_y += 8 * (length(U.attached_accessories) - 1)
|
pixel_y += 8 * (length(uniform.attached_accessories) - 1)
|
||||||
else if((length(U.attached_accessories) > 3) && (length(U.attached_accessories) <= 6) && !current_uniform)
|
if(4 to 6)
|
||||||
pixel_x -= 8
|
pixel_x -= 8
|
||||||
pixel_y += 8 * (length(U.attached_accessories) - 4)
|
pixel_y += 8 * (length(uniform.attached_accessories) - 4)
|
||||||
else if((length(U.attached_accessories) > 6) && (length(U.attached_accessories) <= 9) && !current_uniform)
|
if(7 to 9)
|
||||||
pixel_x -= 16
|
pixel_x -= 16
|
||||||
pixel_y += 8 * (length(U.attached_accessories) - 7)
|
pixel_y += 8 * (length(uniform.attached_accessories) - 7)
|
||||||
else
|
else
|
||||||
if(current_uniform != U)
|
|
||||||
//we ran out of space for accessories, so we just throw shit at the wall
|
//we ran out of space for accessories, so we just throw shit at the wall
|
||||||
pixel_x = 0
|
pixel_x = 0
|
||||||
pixel_y = 0
|
pixel_y = 0
|
||||||
pixel_x += rand(-16, 16)
|
pixel_x += rand(-16, 16)
|
||||||
pixel_y += rand(-16, 16)
|
pixel_y += rand(-16, 16)
|
||||||
U.add_overlay(src)
|
uniform.add_overlay(src)
|
||||||
//SANDSTORM EDIT END
|
//SANDSTORM EDIT END
|
||||||
|
|
||||||
/obj/item/clothing/accessory/proc/on_uniform_equip(obj/item/clothing/under/U, user)
|
/obj/item/clothing/accessory/proc/on_uniform_equip(obj/item/clothing/under/U, user)
|
||||||
@@ -122,9 +103,9 @@
|
|||||||
|
|
||||||
/obj/item/clothing/accessory/examine(mob/user)
|
/obj/item/clothing/accessory/examine(mob/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
. += "<span class='notice'>\The [src] can be attached to [istype(src, /obj/item/clothing/accessory/ring) ? "gloves" : "a uniform"]. Alt-click to remove it once attached.</span>"
|
. += span_notice("\The [src] can be attached to [istype(src, /obj/item/clothing/accessory/ring) ? "gloves" : "a uniform"]. <b>Alt-click</b> to remove it once attached.")
|
||||||
if(initial(above_suit))
|
if(initial(above_suit))
|
||||||
. += "<span class='notice'>\The [src] can be worn above or below your suit. Ctrl-click to toggle.</span>"
|
. += span_notice("\The [src] can be worn above or below your suit. <b>Ctrl-click</b> to toggle.")
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
//Waistcoats//
|
//Waistcoats//
|
||||||
|
|||||||
@@ -50,22 +50,15 @@
|
|||||||
//accessory
|
//accessory
|
||||||
var/accessory_msg
|
var/accessory_msg
|
||||||
if(istype(w_uniform, /obj/item/clothing/under))
|
if(istype(w_uniform, /obj/item/clothing/under))
|
||||||
var/obj/item/clothing/under/U = w_uniform
|
var/obj/item/clothing/under/worn_thing = w_uniform
|
||||||
if(length(U.attached_accessories) && !(U.flags_inv & HIDEACCESSORY))
|
if(!CHECK_BITFIELD(worn_thing.flags_inv, HIDEACCESSORY))
|
||||||
var/list/weehoo = list()
|
var/list/accessory_preparation
|
||||||
var/dumb_icons = ""
|
for(var/obj/item/clothing/accessory/attached_accessory as anything in worn_thing.attached_accessories)
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in U.attached_accessories)
|
if(CHECK_BITFIELD(attached_accessory.flags_inv, HIDEACCESSORY))
|
||||||
if(!(attached_accessory.flags_inv & HIDEACCESSORY))
|
continue
|
||||||
weehoo += "\a [attached_accessory]"
|
LAZYADD(accessory_preparation, "[icon2html(attached_accessory, user)] [attached_accessory]")
|
||||||
dumb_icons = "[dumb_icons][icon2html(attached_accessory, user)]"
|
if(length(accessory_preparation))
|
||||||
if(length(weehoo))
|
accessory_msg = " with [english_list(accessory_preparation)]"
|
||||||
accessory_msg += " with [dumb_icons]"
|
|
||||||
if(length(U.attached_accessories) >= 2)
|
|
||||||
accessory_msg += jointext(weehoo, ", ", 1, length(weehoo) - 1)
|
|
||||||
accessory_msg += " and [weehoo[length(weehoo)]]"
|
|
||||||
else
|
|
||||||
accessory_msg += weehoo[1]
|
|
||||||
|
|
||||||
|
|
||||||
. += "[t_He] [t_is] wearing [w_uniform.get_examine_string(user)][accessory_msg]."
|
. += "[t_He] [t_is] wearing [w_uniform.get_examine_string(user)][accessory_msg]."
|
||||||
//head
|
//head
|
||||||
@@ -88,7 +81,20 @@
|
|||||||
|
|
||||||
//gloves
|
//gloves
|
||||||
if(gloves && !(ITEM_SLOT_GLOVES in obscured))
|
if(gloves && !(ITEM_SLOT_GLOVES in obscured))
|
||||||
. += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands."
|
//accessory
|
||||||
|
var/accessory_msg
|
||||||
|
if(istype(gloves, /obj/item/clothing/gloves))
|
||||||
|
var/obj/item/clothing/gloves/worn_thing = gloves
|
||||||
|
if(!CHECK_BITFIELD(worn_thing.flags_inv, HIDEACCESSORY))
|
||||||
|
var/list/accessory_preparation
|
||||||
|
for(var/obj/item/clothing/accessory/ring/attached_accessory as anything in worn_thing.attached_accessories)
|
||||||
|
if(CHECK_BITFIELD(attached_accessory.flags_inv, HIDEACCESSORY))
|
||||||
|
continue
|
||||||
|
LAZYADD(accessory_preparation, "[icon2html(attached_accessory, user)] [attached_accessory]")
|
||||||
|
if(length(accessory_preparation))
|
||||||
|
accessory_msg = " with [english_list(accessory_preparation)] on [t_his] fingers"
|
||||||
|
|
||||||
|
. += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands[accessory_msg]."
|
||||||
else if(length(blood_DNA))
|
else if(length(blood_DNA))
|
||||||
var/hand_number = get_num_arms(FALSE)
|
var/hand_number = get_num_arms(FALSE)
|
||||||
if(hand_number)
|
if(hand_number)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/obj/item/clothing/gloves
|
/obj/item/clothing/gloves
|
||||||
var/dummy_thick = FALSE // is able to hold accessories on its item
|
var/dummy_thick = FALSE // is able to hold accessories on its item
|
||||||
var/max_accessories = 1
|
var/max_accessories = 1
|
||||||
var/list/obj/item/clothing/accessory/ring/attached_accessories = list()
|
var/list/obj/item/clothing/accessory/ring/attached_accessories
|
||||||
var/list/mutable_appearance/accessory_overlays = list()
|
|
||||||
|
|
||||||
/obj/item/clothing/gloves/Destroy()
|
/obj/item/clothing/gloves/Destroy()
|
||||||
QDEL_LIST(attached_accessories)
|
QDEL_LIST(attached_accessories)
|
||||||
@@ -10,9 +9,12 @@
|
|||||||
|
|
||||||
/obj/item/clothing/gloves/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE)
|
/obj/item/clothing/gloves/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(!isinhands)
|
if(CHECK_BITFIELD(flags_inv, HIDEACCESSORY))
|
||||||
if(length(accessory_overlays))
|
return
|
||||||
. += accessory_overlays
|
for(var/obj/item/clothing/accessory/ring/attached_accessory as anything in attached_accessories)
|
||||||
|
if(CHECK_BITFIELD(attached_accessory.flags_inv, HIDEACCESSORY))
|
||||||
|
continue
|
||||||
|
. += attached_accessory.build_worn_icon()
|
||||||
|
|
||||||
/obj/item/clothing/gloves/attackby(obj/item/I, mob/user, params)
|
/obj/item/clothing/gloves/attackby(obj/item/I, mob/user, params)
|
||||||
if(!attach_accessory(I, user))
|
if(!attach_accessory(I, user))
|
||||||
@@ -28,66 +30,43 @@
|
|||||||
/obj/item/clothing/gloves/equipped(mob/user, slot)
|
/obj/item/clothing/gloves/equipped(mob/user, slot)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
// Sandstorm edit
|
for(var/obj/item/clothing/accessory/ring/attached_accessory as anything in attached_accessories)
|
||||||
for(var/obj/item/clothing/accessory/ring/attached_accessory in attached_accessories)
|
if(attached_accessory && slot == ITEM_SLOT_HANDS && ishuman(user))
|
||||||
if(attached_accessory && slot != ITEM_SLOT_HANDS && ishuman(user))
|
|
||||||
var/mob/living/carbon/human/H = user
|
|
||||||
attached_accessory.on_uniform_equip(src, user)
|
attached_accessory.on_uniform_equip(src, user)
|
||||||
if(attached_accessory.above_suit)
|
|
||||||
H.update_inv_wear_suit()
|
|
||||||
// Sandstorm edit END
|
|
||||||
|
|
||||||
/obj/item/clothing/gloves/dropped(mob/user)
|
/obj/item/clothing/gloves/dropped(mob/user)
|
||||||
// Sandstorm edit
|
for(var/obj/item/clothing/accessory/ring/attached_accessory as anything in attached_accessories)
|
||||||
for(var/obj/item/clothing/accessory/ring/attached_accessory in attached_accessories)
|
|
||||||
attached_accessory.on_uniform_dropped(src, user)
|
attached_accessory.on_uniform_dropped(src, user)
|
||||||
if(ishuman(user))
|
|
||||||
var/mob/living/carbon/human/H = user
|
|
||||||
if(attached_accessory.above_suit)
|
|
||||||
H.update_inv_wear_suit()
|
|
||||||
// Sandstorm edit END
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/clothing/gloves/proc/attach_accessory(obj/item/I, mob/user, notifyAttach = 1)
|
/obj/item/clothing/gloves/proc/attach_accessory(obj/item/clothing/accessory/ring/accessory, mob/user, notifyAttach = 1)
|
||||||
. = FALSE
|
. = FALSE
|
||||||
if(istype(I, /obj/item/clothing/accessory/ring))
|
if(!istype(accessory))
|
||||||
var/obj/item/clothing/accessory/ring/A = I
|
return
|
||||||
if(length(attached_accessories) >= max_accessories)
|
if(length(attached_accessories) >= max_accessories)
|
||||||
if(user)
|
if(user)
|
||||||
to_chat(user, span_warning("[src] already has [length(attached_accessories)] accessories."))
|
to_chat(user, "<span class='warning'>[src] already has [length(attached_accessories)] accessories.</span>")
|
||||||
return
|
return
|
||||||
if(dummy_thick)
|
if(dummy_thick)
|
||||||
if(user)
|
if(user)
|
||||||
to_chat(user, span_warning("[src] is too bulky and cannot have accessories attached to it!"))
|
to_chat(user, "<span class='warning'>[src] is too bulky and cannot have accessories attached to it!</span>")
|
||||||
return
|
return
|
||||||
else
|
if(user && !user.temporarilyRemoveItemFromInventory(accessory))
|
||||||
if(user && !user.temporarilyRemoveItemFromInventory(I))
|
return
|
||||||
return
|
if(!accessory.attach(src, user))
|
||||||
if(!A.attach(src, user))
|
return
|
||||||
return
|
|
||||||
|
|
||||||
if(user && notifyAttach)
|
if(user && notifyAttach)
|
||||||
to_chat(user, span_notice("You attach [I] to [src]."))
|
to_chat(user, "<span class='notice'>You attach [accessory] to [src].</span>")
|
||||||
|
|
||||||
if((flags_inv & HIDEACCESSORY) || (A.flags_inv & HIDEACCESSORY))
|
if((flags_inv & HIDEACCESSORY) || (accessory.flags_inv & HIDEACCESSORY))
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
accessory_overlays = list(mutable_appearance('icons/mob/clothing/accessories.dmi', "blank"))
|
if(ishuman(loc))
|
||||||
for(var/obj/item/clothing/accessory/attached_accessory in attached_accessories)
|
var/mob/living/carbon/human/H = loc
|
||||||
var/datum/element/polychromic/polychromic = LAZYACCESS(attached_accessory.comp_lookup, "item_worn_overlays")
|
H.update_inv_gloves()
|
||||||
if(!polychromic)
|
|
||||||
var/mutable_appearance/accessory_overlay = mutable_appearance(attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, ABOVE_HUD_LAYER)
|
|
||||||
accessory_overlay.alpha = attached_accessory.alpha
|
|
||||||
accessory_overlay.color = attached_accessory.color
|
|
||||||
accessory_overlays += accessory_overlay
|
|
||||||
else
|
|
||||||
polychromic.apply_worn_overlays(attached_accessory, FALSE, attached_accessory.mob_overlay_icon, attached_accessory.item_state || attached_accessory.icon_state, NONE, accessory_overlays)
|
|
||||||
|
|
||||||
if(ishuman(loc))
|
return TRUE
|
||||||
var/mob/living/carbon/human/H = loc
|
|
||||||
H.update_inv_gloves()
|
|
||||||
|
|
||||||
return TRUE
|
|
||||||
|
|
||||||
/obj/item/clothing/gloves/proc/remove_accessory(mob/user)
|
/obj/item/clothing/gloves/proc/remove_accessory(mob/user)
|
||||||
if(!isliving(user))
|
if(!isliving(user))
|
||||||
@@ -95,20 +74,20 @@
|
|||||||
if(!can_use(user))
|
if(!can_use(user))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(length(attached_accessories))
|
if(!LAZYLEN(attached_accessories))
|
||||||
var/obj/item/clothing/accessory/ring/A = attached_accessories[length(attached_accessories)]
|
return
|
||||||
A.detach(src, user)
|
var/obj/item/clothing/accessory/ring/accessory = attached_accessories[length(attached_accessories)]
|
||||||
if(user.put_in_hands(A))
|
accessory.detach(src, user)
|
||||||
to_chat(user, span_notice("You detach [A] from [src]."))
|
if(user.put_in_hands(accessory))
|
||||||
else
|
to_chat(user, span_notice("You detach [accessory] from [src]."))
|
||||||
to_chat(user, span_notice("You detach [A] from [src] and it falls on the floor."))
|
else
|
||||||
|
to_chat(user, span_notice("You detach [accessory] from [src] and it falls on the floor."))
|
||||||
|
|
||||||
if(ishuman(loc))
|
if(ishuman(loc))
|
||||||
var/mob/living/carbon/human/H = loc
|
var/mob/living/carbon/human/H = loc
|
||||||
H.update_inv_gloves()
|
H.update_inv_gloves()
|
||||||
|
|
||||||
/obj/item/clothing/gloves/examine(mob/user)
|
/obj/item/clothing/gloves/examine(mob/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(length(attached_accessories))
|
for(var/obj/item/clothing/accessory/ring/attached_accessory as anything in attached_accessories)
|
||||||
for(var/obj/item/clothing/accessory/ring/attached_accessory in attached_accessories)
|
. += "\A [attached_accessory] is attached to one of its fingers."
|
||||||
. += "\A [attached_accessory] is attached to one of it's fingers."
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
icon_state = "ringgold"
|
icon_state = "ringgold"
|
||||||
item_state = "gring"
|
item_state = "gring"
|
||||||
strip_delay = 40
|
strip_delay = 40
|
||||||
|
/// Here as a reminder, do not add this, unsupported.
|
||||||
|
above_suit = FALSE
|
||||||
var/transfer_prints = FALSE
|
var/transfer_prints = FALSE
|
||||||
var/transfer_blood = 0
|
var/transfer_blood = 0
|
||||||
var/strip_mod = 1
|
var/strip_mod = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user