Skip to content

Commit

Permalink
Adds the skull codpiece, an accessory that can be worn above or below…
Browse files Browse the repository at this point in the history
… an exosuit. (tgstation#28479)

* Adds the skull codpiece, an accessory that can be worn above or below an exosuit.

* woops
  • Loading branch information
Expletive authored and Cyberboss committed Jun 23, 2017
1 parent 69b8a6a commit 814d34d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
38 changes: 28 additions & 10 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,13 @@ BLIND // can't see anything
. += mutable_appearance('icons/effects/item_damage.dmi', "damaged[blood_overlay_type]")
if(blood_DNA)
. += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood")
var/mob/living/carbon/human/M = loc
if(ishuman(M) && M.w_uniform)
var/obj/item/clothing/under/U = M.w_uniform
if(istype(U) && U.attached_accessory)
var/obj/item/clothing/accessory/A = U.attached_accessory
if(A.above_suit)
. += U.accessory_overlay

/obj/item/clothing/suit/update_clothes_damaged_state(damaging = TRUE)
..()
Expand Down Expand Up @@ -545,25 +552,19 @@ BLIND // can't see anything
var/adjusted = NORMAL_STYLE
var/alt_covers_chest = 0 // for adjusted/rolled-down jumpsuits, 0 = exposes chest and arms, 1 = exposes arms only
var/obj/item/clothing/accessory/attached_accessory
var/mutable_appearance/accessory_overlay
var/mutantrace_variation = NO_MUTANTRACE_VARIATION //Are there special sprites for specific situations? Don't use this unless you need to.

/obj/item/clothing/under/worn_overlays(isinhands = FALSE)
. = list()

if(!isinhands)

if(damaged_clothes)
. += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform")
if(blood_DNA)
. += mutable_appearance('icons/effects/blood.dmi', "uniformblood")
if(attached_accessory)
var/accessory_color = attached_accessory.item_color
if(!accessory_color)
accessory_color = attached_accessory.icon_state
var/mutable_appearance/accessory = mutable_appearance('icons/mob/accessories.dmi', "[accessory_color]")
accessory.alpha = attached_accessory.alpha
accessory.color = attached_accessory.color
. += accessory
if(accessory_overlay)
. += accessory_overlay

/obj/item/clothing/under/attackby(obj/item/W, mob/user, params)
if((has_sensor == BROKEN_SENSORS) && istype(W, /obj/item/stack/cable_coil))
Expand Down Expand Up @@ -602,12 +603,20 @@ BLIND // can't see anything
adjusted = DIGITIGRADE_STYLE
H.update_inv_w_uniform()

if(attached_accessory && slot != slot_hands)
if(attached_accessory && slot != slot_hands && ishuman(user))
var/mob/living/carbon/human/H = user
attached_accessory.on_uniform_equip(src, user)
if(attached_accessory.above_suit)
H.update_inv_wear_suit()

/obj/item/clothing/under/dropped(mob/user)
if(attached_accessory)
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()

..()

/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
Expand All @@ -631,9 +640,17 @@ BLIND // can't see anything
if(user && notifyAttach)
to_chat(user, "<span class='notice'>You attach [I] to [src].</span>")

var/accessory_color = attached_accessory.item_color
if(!accessory_color)
accessory_color = attached_accessory.icon_state
accessory_overlay = mutable_appearance('icons/mob/accessories.dmi', "[accessory_color]")
accessory_overlay.alpha = attached_accessory.alpha
accessory_overlay.color = attached_accessory.color

if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
H.update_inv_wear_suit()

return TRUE

Expand All @@ -654,6 +671,7 @@ BLIND // can't see anything
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
H.update_inv_wear_suit()


/obj/item/clothing/under/examine(mob/user)
Expand Down
18 changes: 18 additions & 0 deletions code/modules/clothing/under/accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
item_color = "plasma" //On accessories, this controls the worn sprite. That's a bit weird.
slot_flags = 0
w_class = WEIGHT_CLASS_SMALL
var/above_suit = FALSE
var/minimize_when_attached = TRUE // TRUE if shown as a small icon in corner, FALSE if overlayed

/obj/item/clothing/accessory/proc/attach(obj/item/clothing/under/U, user)
Expand Down Expand Up @@ -55,16 +56,24 @@
plane = initial(plane)
U.cut_overlays()
U.attached_accessory = null
U.accessory_overlay = null

/obj/item/clothing/accessory/proc/on_uniform_equip(obj/item/clothing/under/U, user)
return

/obj/item/clothing/accessory/proc/on_uniform_dropped(obj/item/clothing/under/U, user)
return

/obj/item/clothing/accessory/AltClick()
if(initial(above_suit))
above_suit = !above_suit
to_chat(usr, "\The [src] will be worn [above_suit ? "above" : "below"] your suit.")

/obj/item/clothing/accessory/examine(mob/user)
..()
to_chat(user, "<span class='notice'>\The [src] can be attached to a uniform. Alt-click to remove it once attached.</span>")
if(initial(above_suit))
to_chat(user, "<span class='notice'>\The [src] can be worn above or below your suit. Alt-click to toggle.</span>")

/obj/item/clothing/accessory/waistcoat
name = "waistcoat"
Expand Down Expand Up @@ -285,3 +294,12 @@
icon_state = "talisman"
item_color = "talisman"
armor = list(melee = 5, bullet = 5, laser = 5, energy = 5, bomb = 20, bio = 20, rad = 5, fire = 0, acid = 25)


/obj/item/clothing/accessory/skullcodpiece
name = "skull codpiece"
desc = "A skull shaped ornament, intended to protect the important things in life."
icon_state = "skull"
item_color = "skull"
above_suit = TRUE
armor = list(melee = 5, bullet = 5, laser = 5, energy = 5, bomb = 20, bio = 20, rad = 5, fire = 0, acid = 25)
8 changes: 8 additions & 0 deletions code/modules/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,14 @@
/obj/item/stack/sheet/sinew = 1)
category = CAT_PRIMAL

/datum/crafting_recipe/bonecodpiece
name = "Skull Codpiece"
result = /obj/item/clothing/accessory/skullcodpiece
time = 20
reqs = list(/obj/item/stack/sheet/bone = 2,
/obj/item/stack/sheet/animalhide/goliath_hide = 1)
category = CAT_PRIMAL

/datum/crafting_recipe/bracers
name = "Bone Bracers"
result = /obj/item/clothing/gloves/bracer
Expand Down
Binary file modified icons/mob/accessories.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/accessories.dmi
Binary file not shown.
Binary file modified icons/obj/mining.dmi
Binary file not shown.

0 comments on commit 814d34d

Please sign in to comment.