Merge pull request #4862 from Anewbe/steals_more_armor

Adds/steals more armor code, inventory changes
This commit is contained in:
Atermonera
2018-02-22 18:55:01 -08:00
committed by GitHub
22 changed files with 325 additions and 79 deletions
+16 -16
View File
@@ -133,7 +133,7 @@
msg += "<br>"
//uniform
if(w_uniform && !skipjumpsuit)
if(w_uniform && !skipjumpsuit && w_uniform.show_examine)
//Ties
var/tie_msg
if(istype(w_uniform,/obj/item/clothing/under) && !skiptie)
@@ -142,7 +142,7 @@
if(skipholster)
var/list/accessories_visible = new/list() //please let this fix the stupid fucking runtimes
for(var/obj/item/clothing/accessory/A in U.accessories)
if(A.concealed_holster == 0)
if(A.concealed_holster == 0 && A.show_examine)
accessories_visible.Add(A)
if(accessories_visible.len)
tie_msg += ". Attached to it is [lowertext(english_list(accessories_visible))]"
@@ -154,7 +154,7 @@
msg += "[T.He] [T.is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n"
//head
if(head)
if(head && head.show_examine)
if(head.blood_DNA)
msg += "<span class='warning'>[T.He] [T.is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [(head.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [head.name] on [T.his] head!</span>\n"
else
@@ -174,35 +174,35 @@
msg += "[T.He] [T.is] wearing \icon[wear_suit] \a [wear_suit][tie_msg].\n"
//suit/armour storage
if(s_store && !skipsuitstorage)
if(s_store && !skipsuitstorage && s_store.show_examine)
if(s_store.blood_DNA)
msg += "<span class='warning'>[T.He] [T.is] carrying \icon[s_store] [s_store.gender==PLURAL?"some":"a"] [(s_store.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [s_store.name] on [T.his] [wear_suit.name]!</span>\n"
else
msg += "[T.He] [T.is] carrying \icon[s_store] \a [s_store] on [T.his] [wear_suit.name].\n"
//back
if(back)
if(back && back.show_examine)
if(back.blood_DNA)
msg += "<span class='warning'>[T.He] [T.has] \icon[back] [back.gender==PLURAL?"some":"a"] [(back.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [back] on [T.his] back.</span>\n"
else
msg += "[T.He] [T.has] \icon[back] \a [back] on [T.his] back.\n"
//left hand
if(l_hand)
if(l_hand && l_hand.show_examine)
if(l_hand.blood_DNA)
msg += "<span class='warning'>[T.He] [T.is] holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] [(l_hand.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [l_hand.name] in [T.his] left hand!</span>\n"
else
msg += "[T.He] [T.is] holding \icon[l_hand] \a [l_hand] in [T.his] left hand.\n"
//right hand
if(r_hand)
if(r_hand && r_hand.show_examine)
if(r_hand.blood_DNA)
msg += "<span class='warning'>[T.He] [T.is] holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] [(r_hand.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [r_hand.name] in [T.his] right hand!</span>\n"
else
msg += "[T.He] [T.is] holding \icon[r_hand] \a [r_hand] in [T.his] right hand.\n"
//gloves
if(gloves && !skipgloves)
if(gloves && !skipgloves && gloves.show_examine)
if(gloves.blood_DNA)
msg += "<span class='warning'>[T.He] [T.has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] [(gloves.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [gloves.name] on [T.his] hands!</span>\n"
else
@@ -211,7 +211,7 @@
msg += "<span class='warning'>[T.He] [T.has] [(hand_blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained hands!</span>\n"
//handcuffed?
if(handcuffed)
if(handcuffed && handcuffed.show_examine)
if(istype(handcuffed, /obj/item/weapon/handcuffs/cable))
msg += "<span class='warning'>[T.He] [T.is] \icon[handcuffed] restrained with cable!</span>\n"
else
@@ -222,14 +222,14 @@
msg += "<span class='warning'>[T.He] [T.is] \icon[buckled] buckled to [buckled]!</span>\n"
//belt
if(belt)
if(belt && belt.show_examine)
if(belt.blood_DNA)
msg += "<span class='warning'>[T.He] [T.has] \icon[belt] [belt.gender==PLURAL?"some":"a"] [(belt.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [belt.name] about [T.his] waist!</span>\n"
else
msg += "[T.He] [T.has] \icon[belt] \a [belt] about [T.his] waist.\n"
//shoes
if(shoes && !skipshoes)
if(shoes && !skipshoes && shoes.show_examine)
if(shoes.blood_DNA)
msg += "<span class='warning'>[T.He] [T.is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] [(shoes.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [shoes.name] on [T.his] feet!</span>\n"
else
@@ -238,7 +238,7 @@
msg += "<span class='warning'>[T.He] [T.has] [(feet_blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained feet!</span>\n"
//mask
if(wear_mask && !skipmask)
if(wear_mask && !skipmask && wear_mask.show_examine)
var/descriptor = "on [T.his] face"
if(istype(wear_mask, /obj/item/weapon/grenade) && check_has_mouth())
descriptor = "in [T.his] mouth"
@@ -249,22 +249,22 @@
msg += "[T.He] [T.has] \icon[wear_mask] \a [wear_mask] [descriptor].\n"
//eyes
if(glasses && !skipeyes)
if(glasses && !skipeyes && glasses.show_examine)
if(glasses.blood_DNA)
msg += "<span class='warning'>[T.He] [T.has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] [(glasses.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [glasses] covering [T.his] eyes!</span>\n"
else
msg += "[T.He] [T.has] \icon[glasses] \a [glasses] covering [T.his] eyes.\n"
//left ear
if(l_ear && !skipears)
if(l_ear && !skipears && l_ear.show_examine)
msg += "[T.He] [T.has] \icon[l_ear] \a [l_ear] on [T.his] left ear.\n"
//right ear
if(r_ear && !skipears)
if(r_ear && !skipears && r_ear.show_examine)
msg += "[T.He] [T.has] \icon[r_ear] \a [r_ear] on [T.his] right ear.\n"
//ID
if(wear_id)
if(wear_id && wear_id.show_examine)
/*var/id
if(istype(wear_id, /obj/item/device/pda))
var/obj/item/device/pda/pda = wear_id
@@ -3,6 +3,9 @@ Add fingerprints to items when we put them in our hands.
This saves us from having to call add_fingerprint() any time something is put in a human's hands programmatically.
*/
/mob/living/carbon/human
var/list/worn_clothing = list() //Contains all CLOTHING items worn
/mob/living/carbon/human/verb/quick_equip()
set name = "quick-equip"
set hidden = 1
@@ -86,6 +89,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if (W == wear_suit)
if(s_store)
drop_from_inventory(s_store)
worn_clothing -= wear_suit
wear_suit = null
update_inv_wear_suit()
else if (W == w_uniform)
@@ -96,16 +100,21 @@ This saves us from having to call add_fingerprint() any time something is put in
if (wear_id)
drop_from_inventory(wear_id)
if (belt)
worn_clothing -= belt
drop_from_inventory(belt)
worn_clothing -= w_uniform
w_uniform = null
update_inv_w_uniform()
else if (W == gloves)
worn_clothing -= gloves
gloves = null
update_inv_gloves()
else if (W == glasses)
worn_clothing -= glasses
glasses = null
update_inv_glasses()
else if (W == head)
worn_clothing -= head
head = null
if(istype(W, /obj/item))
var/obj/item/I = W
@@ -121,12 +130,15 @@ This saves us from having to call add_fingerprint() any time something is put in
r_ear = null
update_inv_ears()
else if (W == shoes)
worn_clothing -= shoes
shoes = null
update_inv_shoes()
else if (W == belt)
worn_clothing -= belt
belt = null
update_inv_belt()
else if (W == wear_mask)
worn_clothing -= wear_mask
wear_mask = null
if(istype(W, /obj/item))
var/obj/item/I = W
@@ -187,15 +199,21 @@ This saves us from having to call add_fingerprint() any time something is put in
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
if(!slot) return
if(!istype(W)) return
if(!has_organ_for_slot(slot)) return
if(!species || !species.hud || !(slot in species.hud.equip_slots)) return
if(!slot)
return
if(!istype(W))
return
if(!has_organ_for_slot(slot))
return
if(!species || !species.hud || !(slot in species.hud.equip_slots))
return
W.loc = src
switch(slot)
if(slot_back)
src.back = W
W.equipped(src, slot)
worn_clothing += back
update_inv_back(redraw_mob)
if(slot_wear_mask)
src.wear_mask = W
@@ -203,6 +221,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_hair(redraw_mob) //rebuild hair
update_inv_ears(0)
W.equipped(src, slot)
worn_clothing += wear_mask
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
src.handcuffed = W
@@ -222,6 +241,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_belt)
src.belt = W
W.equipped(src, slot)
worn_clothing += belt
update_inv_belt(redraw_mob)
if(slot_wear_id)
src.wear_id = W
@@ -252,6 +272,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_gloves)
src.gloves = W
W.equipped(src, slot)
worn_clothing += glasses
update_inv_gloves(redraw_mob)
if(slot_head)
src.head = W
@@ -262,18 +283,22 @@ This saves us from having to call add_fingerprint() any time something is put in
if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src)
W.equipped(src, slot)
worn_clothing += head
update_inv_head(redraw_mob)
if(slot_shoes)
src.shoes = W
W.equipped(src, slot)
worn_clothing += shoes
update_inv_shoes(redraw_mob)
if(slot_wear_suit)
src.wear_suit = W
W.equipped(src, slot)
worn_clothing += wear_suit
update_inv_wear_suit(redraw_mob)
if(slot_w_uniform)
src.w_uniform = W
W.equipped(src, slot)
worn_clothing += w_uniform
update_inv_w_uniform(redraw_mob)
if(slot_l_store)
src.l_store = W
@@ -292,8 +317,8 @@ This saves us from having to call add_fingerprint() any time something is put in
src.remove_from_mob(W)
W.loc = src.back
if(slot_tie)
var/obj/item/clothing/under/uniform = src.w_uniform
uniform.attackby(W,src)
for(var/obj/item/clothing/C in worn_clothing)
C.attackby(W, usr)
else
src << "<font color='red'>You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it...</font>"
return
@@ -1006,6 +1006,13 @@ var/global/list/damage_icon_parts = list()
standing = image(base)
else
standing.color = head.color
// Accessories - copied from uniform, BOILERPLATE because fuck this system.
var/obj/item/clothing/head/hat = head
if(istype(hat) && hat.accessories.len)
for(var/obj/item/clothing/accessory/A in hat.accessories)
standing.overlays |= A.get_mob_overlay()
overlays_standing[HEAD_LAYER] = standing
else