Files
SoundScopes ff68c9e1f3 Scopes updates all merged and stuff
A lot of these will probably get edited again
2015-05-14 21:02:12 +01:00

700 lines
20 KiB
Plaintext

/obj/item/clothing
name = "clothing"
var/list/species_restricted = null //Only these species can wear this kit.
var/gsr = 0
/*
Sprites used when the clothing item is refit. This is done by setting icon_override.
For best results, if this is set then sprite_sheets should be null and vice versa, but that is by no means necessary.
Ideally, sprite_sheets_refit should be used for "hard" clothing items that can't change shape very well to fit the wearer (e.g. helmets, hardsuits),
while sprite_sheets should be used for "flexible" clothing items that do not need to be refitted (e.g. vox wearing jumpsuits).
*/
var/list/sprite_sheets_refit = null
//Updates the icons of the mob wearing the clothing item, if any.
/obj/item/clothing/proc/update_clothing_icon()
return
//BS12: Species-restricted clothing check.
/obj/item/clothing/mob_can_equip(M as mob, slot)
//if we can't equip the item anyway, don't bother with species_restricted (cuts down on spam)
if (!..())
return 0
if(species_restricted && istype(M,/mob/living/carbon/human))
var/wearable = null
var/exclusive = null
var/mob/living/carbon/human/H = M
if("exclude" in species_restricted)
exclusive = 1
if(H.species)
if(exclusive)
if(!(H.species.name in species_restricted))
wearable = 1
else
if(H.species.name in species_restricted)
wearable = 1
if(!wearable && (slot != 15 && slot != 16)) //Pockets.
M << "\red Your species cannot wear [src]."
return 0
return 1
/obj/item/clothing/proc/refit_for_species(var/target_species)
//Set species_restricted list
switch(target_species)
if("Human", "Skrell") //humanoid bodytypes
species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
else
species_restricted = list(target_species)
//Set icon
if (sprite_sheets_refit && (target_species in sprite_sheets_refit))
icon_override = sprite_sheets_refit[target_species]
else
icon_override = initial(icon_override)
if (sprite_sheets_obj && (target_species in sprite_sheets_obj))
icon = sprite_sheets_obj[target_species]
else
icon = initial(icon)
/obj/item/clothing/head/helmet/refit_for_species(var/target_species)
//Set species_restricted list
switch(target_species)
if("Skrell")
species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
if("Human")
species_restricted = list("exclude","Skrell","Unathi","Tajaran","Diona","Vox")
else
species_restricted = list(target_species)
//Set icon
if (sprite_sheets_refit && (target_species in sprite_sheets_refit))
icon_override = sprite_sheets_refit[target_species]
else
icon_override = initial(icon_override)
if (sprite_sheets_obj && (target_species in sprite_sheets_obj))
icon = sprite_sheets_obj[target_species]
else
icon = initial(icon)
//Ears: headsets, earmuffs and tiny objects
/obj/item/clothing/ears
name = "ears"
w_class = 1.0
throwforce = 2
slot_flags = SLOT_EARS
/obj/item/clothing/ears/attack_hand(mob/user as mob)
if (!user) return
if (src.loc != user || !istype(user,/mob/living/carbon/human))
..()
return
var/mob/living/carbon/human/H = user
if(H.l_ear != src && H.r_ear != src)
..()
return
if(!canremove)
return
var/obj/item/clothing/ears/O
if(slot_flags & SLOT_TWOEARS )
O = (H.l_ear == src ? H.r_ear : H.l_ear)
user.u_equip(O)
if(!istype(src,/obj/item/clothing/ears/offear))
del(O)
O = src
else
O = src
user.u_equip(src)
if (O)
user.put_in_hands(O)
O.add_fingerprint(user)
if(istype(src,/obj/item/clothing/ears/offear))
del(src)
/obj/item/clothing/ears/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_ears()
/obj/item/clothing/ears/offear
name = "Other ear"
w_class = 5.0
icon = 'icons/mob/screen1_Midnight.dmi'
icon_state = "block"
slot_flags = SLOT_EARS | SLOT_TWOEARS
New(var/obj/O)
name = O.name
desc = O.desc
icon = O.icon
icon_state = O.icon_state
dir = O.dir
/obj/item/clothing/ears/earmuffs
name = "earmuffs"
desc = "Protects your hearing from loud noises, and quiet ones as well."
icon_state = "earmuffs"
item_state = "earmuffs"
slot_flags = SLOT_EARS | SLOT_TWOEARS
//Glasses
/obj/item/clothing/glasses
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
w_class = 2.0
flags = GLASSESCOVERSEYES
slot_flags = SLOT_EYES
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/invisa_view = 0
sprite_sheets = list("Vox" = 'icons/mob/species/vox/eyes.dmi')
/*
SEE_SELF // can see self, no matter what
SEE_MOBS // can see all mobs, no matter what
SEE_OBJS // can see all objs, no matter what
SEE_TURFS // can see all turfs (and areas), no matter what
SEE_PIXELS// if an object is located on an unlit area, but some of its pixels are
// in a lit area (via pixel_x,y or smooth movement), can see those pixels
BLIND // can't see anything
*/
/obj/item/clothing/glasses/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_glasses()
//Gloves
/obj/item/clothing/gloves
name = "gloves"
gender = PLURAL //Carn: for grammarically correct text-parsing
w_class = 2.0
icon = 'icons/obj/clothing/gloves.dmi'
siemens_coefficient = 0.50
var/wired = 0
var/obj/item/weapon/cell/cell = 0
var/clipped = 0
body_parts_covered = HANDS
slot_flags = SLOT_GLOVES
attack_verb = list("challenged")
species_restricted = list("exclude","Unathi","Tajaran")
sprite_sheets = list("Vox" = 'icons/mob/species/vox/gloves.dmi')
/obj/item/clothing/gloves/examine()
set src in usr
..()
return
/obj/item/clothing/gloves/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_gloves()
/obj/item/clothing/gloves/emp_act(severity)
if(cell)
//why is this not part of the powercell code?
cell.charge -= 1000 / severity
if (cell.charge < 0)
cell.charge = 0
if(cell.reliability != 100 && prob(50/severity))
cell.reliability -= 10 / severity
..()
// Called just before an attack_hand(), in mob/UnarmedAttack()
/obj/item/clothing/gloves/proc/Touch(var/atom/A, var/proximity)
return 0 // return 1 to cancel attack_hand()
/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
if (clipped)
user << "<span class='notice'>The [src] have already been clipped!</span>"
update_icon()
return
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("\red [user] cuts the fingertips off of the [src].","\red You cut the fingertips off of the [src].")
clipped = 1
name = "mangled [name]"
desc = "[desc]<br>They have had the fingertips cut off of them."
if("exclude" in species_restricted)
species_restricted -= "Unathi"
species_restricted -= "Tajaran"
return
//Head
/obj/item/clothing/head
name = "head"
icon = 'icons/obj/clothing/hats.dmi'
body_parts_covered = HEAD
slot_flags = SLOT_HEAD
w_class = 2.0
/obj/item/clothing/head/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_head()
///////////////////////////////////////////////////////////////////////
//Mask
/obj/item/clothing/mask
name = "mask"
icon = 'icons/obj/clothing/masks.dmi'
body_parts_covered = HEAD
slot_flags = SLOT_MASK
// body_parts_covered = FACE|EYES
sprite_sheets = list("Vox" = 'icons/mob/species/vox/masks.dmi')
/obj/item/clothing/mask/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_wear_mask()
/obj/item/clothing/mask/proc/filter_air(datum/gas_mixture/air)
return
//Shoes
/obj/item/clothing/shoes
name = "shoes"
icon = 'icons/obj/clothing/shoes.dmi'
desc = "Comfortable-looking shoes."
gender = PLURAL //Carn: for grammarically correct text-parsing
siemens_coefficient = 0.9
body_parts_covered = FEET
slot_flags = SLOT_FEET
permeability_coefficient = 0.50
slowdown = SHOES_SLOWDOWN
species_restricted = list("exclude","Unathi","Tajaran")
sprite_sheets = list("Vox" = 'icons/mob/species/vox/shoes.dmi')
var/silent = 0
/obj/item/clothing/shoes/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_shoes()
/obj/item/proc/negates_gravity()
return 0
//Suit
/obj/item/clothing/suit
icon = 'icons/obj/clothing/suits.dmi'
name = "suit"
var/fire_resist = T0C+100
flags = FPRINT | TABLEPASS
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS|LEGS
allowed = list(/obj/item/weapon/tank/emergency_oxygen)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
slot_flags = SLOT_OCLOTHING
var/blood_overlay_type = "suit"
siemens_coefficient = 0.9
w_class = 3
/obj/item/clothing/suit/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_wear_suit()
//Spacesuit
//Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together.
// Meaning the the suit is defined directly after the corrisponding helmet. Just like below!
/obj/item/clothing/head/helmet/space
name = "Space helmet"
icon_state = "space"
desc = "A special helmet designed for work in a hazardous, low-pressure environment."
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | THICKMATERIAL
item_state = "space"
permeability_coefficient = 0.01
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50)
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
// body_parts_covered = HEAD|FACE|EYES
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
siemens_coefficient = 0.9
species_restricted = list("exclude","Diona","Vox")
/obj/item/clothing/suit/space
name = "Space suit"
desc = "A suit that protects against low pressure environments. Has a big 13 on the back."
icon_state = "space"
item_state = "s_suit"
w_class = 4//bulky item
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE | THICKMATERIAL
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit)
slowdown = 3
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50)
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL
cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS
min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE
siemens_coefficient = 0.9
species_restricted = list("exclude","Diona","Vox")
var/list/supporting_limbs //If not-null, automatically splints breaks. Checked when removing the suit.
/obj/item/clothing/suit/space/equipped(mob/M)
check_limb_support()
..()
/obj/item/clothing/suit/space/dropped()
check_limb_support()
..()
// Some space suits are equipped with reactive membranes that support
// broken limbs - at the time of writing, only the ninja suit, but
// I can see it being useful for other suits as we expand them. ~ Z
// The actual splinting occurs in /datum/organ/external/proc/fracture()
/obj/item/clothing/suit/space/proc/check_limb_support()
// If this isn't set, then we don't need to care.
if(!supporting_limbs || !supporting_limbs.len)
return
var/mob/living/carbon/human/H = src.loc
// If the holder isn't human, or the holder IS and is wearing the suit, it keeps supporting the limbs.
if(!istype(H) || H.wear_suit == src)
return
// Otherwise, remove the splints.
for(var/datum/organ/external/E in supporting_limbs)
E.status &= ~ ORGAN_SPLINTED
supporting_limbs = list()
//Under clothing
/obj/item/clothing/under
icon = 'icons/obj/clothing/uniforms.dmi'
name = "under"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
permeability_coefficient = 0.90
flags = FPRINT | TABLEPASS
slot_flags = SLOT_ICLOTHING
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
w_class = 3
var/has_sensor = 1//For the crew computer 2 = unable to change mode
var/sensor_mode = 0
/*
1 = Report living/dead
2 = Report detailed damages
3 = Report location
*/
var/obj/item/clothing/tie/hastie = null
var/obj/item/clothing/tie/armband/aband = null
var/obj/item/clothing/tie/holster/holster = null
var/obj/item/clothing/tie/storage/webbing = null
var/displays_id = 1
var/rolled_down = 0
var/rolled_sleeves = 0
var/basecolor
sprite_sheets = list("Vox" = 'icons/mob/species/vox/uniform.dmi')
/obj/item/clothing/under/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_w_uniform()
/obj/item/clothing/under/attackby(obj/item/I, mob/user)
var/bandType = 0 //Tracking for hastie becuase I don't want to recode the lot yet
if(istype(I, /obj/item/clothing/tie))
if(istype(I, /obj/item/clothing/tie/armband))
if(!aband)
user.drop_item()
aband = I
aband.on_attached(src, user)
if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
return
bandType = 1
if(istype(I, /obj/item/clothing/tie/holster))
if(!holster && !webbing)
user.drop_item()
holster = I
holster.on_attached(src, user)
if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
return
bandType = 2
if(istype(I, /obj/item/clothing/tie/storage))
if(!holster && !webbing)
user.drop_item()
webbing = I
webbing.on_attached(src, user)
if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
return
bandType = 3
if(!hastie && !bandType)
user.drop_item()
hastie = I
hastie.on_attached(src, user)
if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
return
if(istype(I, /obj/item/weapon/gun))
if(holster)
holster.attackby(I, user)
return
if(webbing && bandType != 3)
webbing.attackby(I, user)
return
if(hastie)
hastie.attackby(I, user)
return
..()
/obj/item/clothing/under/attack_hand(mob/user as mob)
//only forward to the attached accessory if the clothing is equipped (not in a storage)
if(webbing && src.loc == user)
webbing.attack_hand(user)
return
if(holster && src.loc == user)
holster.attack_hand(user)
return
if(hastie && src.loc == user)
hastie.attack_hand(user)
return
if ((ishuman(usr) || ismonkey(usr)) && src.loc == user) //make it harder to accidentally undress yourself
return
..()
//This is to ensure people can take off suits when there is an attached accessory
/obj/item/clothing/under/MouseDrop(obj/over_object as obj)
if (ishuman(usr) || ismonkey(usr))
//makes sure that the clothing is equipped so that we can't drag it into our hand from miles away.
if (!(src.loc == usr))
return
if (!( usr.restrained() ) && !( usr.stat ))
switch(over_object.name)
if("r_hand")
usr.u_equip(src)
usr.put_in_r_hand(src)
if("l_hand")
usr.u_equip(src)
usr.put_in_l_hand(src)
src.add_fingerprint(usr)
return
return
/obj/item/clothing/under/examine()
set src in view()
..()
switch(src.sensor_mode)
if(0)
usr << "Its sensors appear to be disabled."
if(1)
usr << "Its binary life sensors appear to be enabled."
if(2)
usr << "Its vital tracker appears to be enabled."
if(3)
usr << "Its vital tracker and tracking beacon appear to be enabled."
if(hastie)
usr << "\A [hastie] is clipped to it."
if(aband)
usr << "\A [aband] is wrapped around the sleeve."
if(webbing)
usr << "\A [webbing] is attached to it."
if(holster)
usr << "\A [holster] is attached to it."
/obj/item/clothing/under/proc/set_sensors(mob/usr as mob)
var/mob/M = usr
if (istype(M, /mob/dead/)) return
if (usr.stat || usr.restrained()) return
if(has_sensor >= 2)
usr << "The controls are locked."
return 0
if(has_sensor <= 0)
usr << "This suit does not have any sensors."
return 0
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
if(get_dist(usr, src) > 1)
usr << "You have moved too far away."
return
sensor_mode = modes.Find(switchMode) - 1
if (src.loc == usr)
switch(sensor_mode)
if(0)
usr << "You disable your suit's remote sensing equipment."
if(1)
usr << "Your suit will now report whether you are live or dead."
if(2)
usr << "Your suit will now report your vital lifesigns."
if(3)
usr << "Your suit will now report your vital lifesigns as well as your coordinate position."
else if (istype(src.loc, /mob))
switch(sensor_mode)
if(0)
for(var/mob/V in viewers(usr, 1))
V.show_message("\red [usr] disables [src.loc]'s remote sensing equipment.", 1)
if(1)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] turns [src.loc]'s remote sensors to binary.", 1)
if(2)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] sets [src.loc]'s sensors to track vitals.", 1)
if(3)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] sets [src.loc]'s sensors to maximum.", 1)
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"
set category = "Object"
set src in usr
set_sensors(usr)
..()
/obj/item/clothing/under/verb/rollsuit()
set name = "Roll Down Jumpsuit"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if(copytext(item_color,-2) != "_d" && rolled_sleeves == 0)
basecolor = item_color
if(basecolor + "_d_s" in icon_states('icons/mob/uniform.dmi'))
body_parts_covered = "[basecolor]" ? LEGS|LOWER_TORSO : UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
item_color = item_color == "[basecolor]" ? "[basecolor]_d" : "[basecolor]"
update_clothing_icon()
if(rolled_down)
usr << "You roll [src] up"
rolled_down = 0
else
if(rolled_sleeves)
usr << "You roll [src] sleeves down"
rolled_sleeves = 0
else
usr << "You roll [src] down"
rolled_down = 1
/obj/item/clothing/under/verb/rollsleeve()
set name = "Roll Up Sleeves"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if(copytext(item_color,-2) != "_r" && rolled_down == 0)
basecolor = item_color
if(basecolor + "_r_s" in icon_states('icons/mob/uniform.dmi'))
item_color = item_color == "[basecolor]" ? "[basecolor]_r" : "[basecolor]"
update_clothing_icon()
if(rolled_sleeves)
usr << "You roll [src] sleeves down"
rolled_sleeves = 0
else
if(rolled_down)
usr << "You roll [src] up"
rolled_down = 0
else
usr << "You roll [src] sleeves up"
rolled_sleeves = 1
/obj/item/clothing/under/proc/remove_accessory(mob/user as mob)
var/list/attachedItems = list()
if(aband)
attachedItems += "armband"
if(holster)
attachedItems += "holster"
if(webbing)
attachedItems += "webbing"
if(hastie)
attachedItems += "other"
if(!attachedItems)
return
var/selection = input("Select what Accessory to remove","",null) as null|anything in attachedItems
if(!selection)
return
switch(selection)
if("armband")
aband.on_removed(user)
aband = null
if("holster")
holster.on_removed(user)
holster = null
if("webbing")
webbing.on_removed(user)
webbing = null
if("other")
hastie.on_removed(user)
hastie = null
update_clothing_icon()
/obj/item/clothing/under/verb/removetie()
set name = "Remove Accessory"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
src.remove_accessory(usr)
/*
/obj/item/clothing/under/proc/remove_armband(mob/user as mob)
if(!aband)
return
aband.on_removed(user)
aband = null
update_clothing_icon()
/obj/item/clothing/under/verb/removearmband()
set name = "Remove Armband"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
src.remove_armband(usr)
*/
/obj/item/clothing/under/rank/New()
sensor_mode = pick(0,1,2,3)
..()
/obj/item/clothing/under/emp_act(severity)
if (hastie)
hastie.emp_act(severity)
if (webbing)
webbing.emp_act(severity)
if (holster)
holster.emp_act(severity)
..()