Merge pull request #6987 from MagmaRam/labcoat

Reworked labcoat buttoning
This commit is contained in:
Chinsky
2014-11-17 04:17:16 +03:00
21 changed files with 132 additions and 250 deletions
+1 -1
View File
@@ -181,7 +181,7 @@
name = "Scientist"
corpseradio = /obj/item/device/radio/headset/headset_sci
corpseuniform = /obj/item/clothing/under/rank/scientist
corpsesuit = /obj/item/clothing/suit/storage/labcoat/science
corpsesuit = /obj/item/clothing/suit/storage/toggle/labcoat/science
corpseback = /obj/item/weapon/storage/backpack
corpseshoes = /obj/item/clothing/shoes/white
corpseid = 1
+5 -5
View File
@@ -18,13 +18,13 @@ var/global/list/gear_datums = list()
//create a list of gear datums to sort
for(var/type in typesof(/datum/gear)-/datum/gear)
var/datum/gear/G = new type()
var/category = (G.sort_category in sort_categories)? G.sort_category : "unknown"
sort_categories[category][G.display_name] = G
for (var/category in sort_categories)
gear_datums.Add(sortAssoc(sort_categories[category]))
return 1
/datum/gear
@@ -475,13 +475,13 @@ var/global/list/gear_datums = list()
/datum/gear/brown_jacket
display_name = "leather jacket, brown"
path = /obj/item/clothing/suit/storage/brown_jacket
path = /obj/item/clothing/suit/storage/toggle/brown_jacket
cost = 3
slot = slot_wear_suit
/datum/gear/brown_jacket_nt
display_name = "leather jacket, NanoTrasen, brown"
path = /obj/item/clothing/suit/storage/brown_jacket/nanotrasen
path = /obj/item/clothing/suit/storage/toggle/brown_jacket/nanotrasen
cost = 3
slot = slot_wear_suit
+9 -38
View File
@@ -141,11 +141,13 @@
sprite_sheets = list("Vox" = 'icons/mob/species/vox/suit.dmi')
//Lawyer
/obj/item/clothing/suit/storage/lawyer/bluejacket
/obj/item/clothing/suit/storage/toggle/lawyer/bluejacket
name = "Blue Suit Jacket"
desc = "A snappy dress jacket."
icon_state = "suitjacket_blue_open"
item_state = "suitjacket_blue_open"
icon_open = "suitjacket_blue_open"
icon_closed = "suitjacket_blue"
blood_overlay_type = "coat"
body_parts_covered = UPPER_TORSO|ARMS
@@ -158,62 +160,31 @@
body_parts_covered = UPPER_TORSO|ARMS
//Internal Affairs
/obj/item/clothing/suit/storage/internalaffairs
/obj/item/clothing/suit/storage/toggle/internalaffairs
name = "Internal Affairs Jacket"
desc = "A smooth black jacket."
icon_state = "ia_jacket_open"
item_state = "ia_jacket"
icon_open = "ia_jacket_open"
icon_closed = "ia_jacket"
blood_overlay_type = "coat"
body_parts_covered = UPPER_TORSO|ARMS
verb/toggle()
set name = "Toggle Coat Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
switch(icon_state)
if("ia_jacket_open")
src.icon_state = "ia_jacket"
usr << "You button up the jacket."
if("ia_jacket")
src.icon_state = "ia_jacket_open"
usr << "You unbutton the jacket."
else
usr << "You attempt to button-up the velcro on your [src], before promptly realising how retarded you are."
return
update_clothing_icon() //so our overlays update
//Medical
/obj/item/clothing/suit/storage/fr_jacket
/obj/item/clothing/suit/storage/toggle/fr_jacket
name = "first responder jacket"
desc = "A high-visibility jacket worn by medical first responders."
icon_state = "fr_jacket_open"
item_state = "fr_jacket"
icon_open = "fr_jacket_open"
icon_closed = "fr_jacket"
blood_overlay_type = "armor"
allowed = list(/obj/item/stack/medical, /obj/item/weapon/reagent_containers/dropper, /obj/item/weapon/reagent_containers/hypospray, /obj/item/weapon/reagent_containers/syringe, \
/obj/item/device/healthanalyzer, /obj/item/device/flashlight, /obj/item/device/radio, /obj/item/weapon/tank/emergency_oxygen)
body_parts_covered = UPPER_TORSO|ARMS
verb/toggle()
set name = "Toggle Jacket Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
switch(icon_state)
if("fr_jacket_open")
src.icon_state = "fr_jacket"
usr << "You button up the jacket."
if("fr_jacket")
src.icon_state = "fr_jacket_open"
usr << "You unbutton the jacket."
update_clothing_icon() //so our overlays update
//Mime
/obj/item/clothing/suit/suspenders
name = "suspenders"
+39 -112
View File
@@ -1,177 +1,104 @@
/obj/item/clothing/suit/storage/labcoat
/obj/item/clothing/suit/storage/toggle/labcoat
name = "labcoat"
desc = "A suit that protects against minor chemical spills."
icon_state = "labcoat_open"
item_state = "labcoat" //Is this even used for anything?
icon_open = "labcoat_open"
icon_closed = "labcoat"
blood_overlay_type = "coat"
body_parts_covered = UPPER_TORSO|ARMS
allowed = list(/obj/item/device/analyzer,/obj/item/stack/medical,/obj/item/weapon/dnainjector,/obj/item/weapon/reagent_containers/dropper,/obj/item/weapon/reagent_containers/syringe,/obj/item/weapon/reagent_containers/hypospray,/obj/item/device/healthanalyzer,/obj/item/device/flashlight/pen,/obj/item/weapon/reagent_containers/glass/bottle,/obj/item/weapon/reagent_containers/glass/beaker,/obj/item/weapon/reagent_containers/pill,/obj/item/weapon/storage/pill_bottle,/obj/item/weapon/paper)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 50, rad = 0)
sprite_sheets = list("Vox" = 'icons/mob/species/vox/suit.dmi')
verb/toggle()
set name = "Toggle Labcoat Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
//Why???
switch(icon_state)
if("labcoat_open")
src.icon_state = "labcoat"
usr << "You button up the labcoat."
if("labcoat")
src.icon_state = "labcoat_open"
usr << "You unbutton the labcoat."
if("red_labcoat_open")
src.icon_state = "red_labcoat"
usr << "You button up the labcoat."
if("red_labcoat")
src.icon_state = "red_labcoat_open"
usr << "You unbutton the labcoat."
if("blue_labcoat_open")
src.icon_state = "blue_labcoat"
usr << "You button up the labcoat."
if("blue_labcoat")
src.icon_state = "blue_labcoat_open"
usr << "You unbutton the labcoat."
if("purple_labcoat_open")
src.icon_state = "purple_labcoat"
usr << "You button up the labcoat."
if("purple_labcoat")
src.icon_state = "purple_labcoat_open"
usr << "You unbutton the labcoat."
if("green_labcoat_open")
src.icon_state = "green_labcoat"
usr << "You button up the labcoat."
if("green_labcoat")
src.icon_state = "green_labcoat_open"
usr << "You unbutton the labcoat."
if("orange_labcoat_open")
src.icon_state = "orange_labcoat"
usr << "You button up the labcoat."
if("orange_labcoat")
src.icon_state = "orange_labcoat_open"
usr << "You unbutton the labcoat."
if("labcoat_cmo_open")
src.icon_state = "labcoat_cmo"
usr << "You button up the labcoat."
if("labcoat_cmo")
src.icon_state = "labcoat_cmo_open"
usr << "You unbutton the labcoat."
if("labcoat_cmoalt_open")
src.icon_state = "labcoat_cmoalt"
usr << "You button up the labcoat."
if("labcoat_cmoalt")
src.icon_state = "labcoat_cmoalt_open"
usr << "You unbutton the labcoat."
if("labcoat_gen_open")
src.icon_state = "labcoat_gen"
usr << "You button up the labcoat."
if("labcoat_gen")
src.icon_state = "labcoat_gen_open"
usr << "You unbutton the labcoat."
if("labcoat_chem_open")
src.icon_state = "labcoat_chem"
usr << "You button up the labcoat."
if("labcoat_chem")
src.icon_state = "labcoat_chem_open"
usr << "You unbutton the labcoat."
if("labcoat_vir_open")
src.icon_state = "labcoat_vir"
usr << "You button up the labcoat."
if("labcoat_vir")
src.icon_state = "labcoat_vir_open"
usr << "You unbutton the labcoat."
if("labcoat_tox_open")
src.icon_state = "labcoat_tox"
usr << "You button up the labcoat."
if("labcoat_tox")
src.icon_state = "labcoat_tox_open"
usr << "You unbutton the labcoat."
if("labgreen_open")
src.icon_state = "labgreen"
usr << "You button up the labcoat."
if("labgreen")
src.icon_state = "labgreen_open"
usr << "You unbutton the labcoat."
if ("labcoat_black_open")
src.icon_state = "labcoat_black"
usr << "You button up the labcoat."
if ("labcoat_black")
src.icon_state = "labcoat_black_open"
usr << "You unbutton the labcoat."
else
usr << "You attempt to button-up the velcro on your [src], before promptly realising how silly you are."
return
update_clothing_icon() //so our overlays update
/obj/item/clothing/suit/storage/labcoat/red
/obj/item/clothing/suit/storage/toggle/labcoat/red
name = "red labcoat"
desc = "A suit that protects against minor chemical spills. This one is red."
icon_state = "red_labcoat_open"
item_state = "red_labcoat"
icon_open = "red_labcoat_open"
icon_closed = "red_labcoat"
/obj/item/clothing/suit/storage/labcoat/blue
/obj/item/clothing/suit/storage/toggle/labcoat/blue
name = "blue labcoat"
desc = "A suit that protects against minor chemical spills. This one is blue."
icon_state = "blue_labcoat_open"
item_state = "blue_labcoat"
icon_open = "blue_labcoat_open"
icon_closed = "blue_labcoat"
/obj/item/clothing/suit/storage/labcoat/purple
/obj/item/clothing/suit/storage/toggle/labcoat/purple
name = "purple labcoat"
desc = "A suit that protects against minor chemical spills. This one is purple."
icon_state = "purple_labcoat_open"
item_state = "purple_labcoat"
icon_open = "purple_labcoat_open"
icon_closed = "purple_labcoat"
/obj/item/clothing/suit/storage/labcoat/orange
/obj/item/clothing/suit/storage/toggle/labcoat/orange
name = "orange labcoat"
desc = "A suit that protects against minor chemical spills. This one is orange."
icon_state = "orange_labcoat_open"
item_state = "orange_labcoat"
icon_open = "orange_labcoat_open"
icon_closed = "orange_labcoat"
/obj/item/clothing/suit/storage/labcoat/green
/obj/item/clothing/suit/storage/toggle/labcoat/green
name = "green labcoat"
desc = "A suit that protects against minor chemical spills. This one is green."
icon_state = "green_labcoat_open"
item_state = "green_labcoat"
icon_open = "green_labcoat_open"
icon_closed = "green_labcoat"
/obj/item/clothing/suit/storage/labcoat/cmo
/obj/item/clothing/suit/storage/toggle/labcoat/cmo
name = "chief medical officer's labcoat"
desc = "Bluer than the standard model."
icon_state = "labcoat_cmo_open"
item_state = "labcoat_cmo"
icon_open = "labcoat_cmo_open"
icon_closed = "labcoat_cmo"
/obj/item/clothing/suit/storage/labcoat/cmoalt
/obj/item/clothing/suit/storage/toggle/labcoat/cmoalt
name = "chief medical officer labcoat"
desc = "A labcoat with command blue highlights."
icon_state = "labcoat_cmoalt_open"
icon_open = "labcoat_cmoalt_open"
icon_closed = "labcoat_cmoalt"
/obj/item/clothing/suit/storage/labcoat/mad
/obj/item/clothing/suit/storage/toggle/labcoat/mad
name = "The Mad's labcoat"
desc = "It makes you look capable of konking someone on the noggin and shooting them into space."
icon_state = "labgreen_open"
item_state = "labgreen"
icon_open = "labgreen_open"
icon_closed = "labgreen"
/obj/item/clothing/suit/storage/labcoat/genetics
/obj/item/clothing/suit/storage/toggle/labcoat/genetics
name = "Geneticist labcoat"
desc = "A suit that protects against minor chemical spills. Has a blue stripe on the shoulder."
icon_state = "labcoat_gen_open"
icon_open = "labcoat_gen_open"
icon_closed = "labcoat_gen"
/obj/item/clothing/suit/storage/labcoat/chemist
/obj/item/clothing/suit/storage/toggle/labcoat/chemist
name = "Chemist labcoat"
desc = "A suit that protects against minor chemical spills. Has an orange stripe on the shoulder."
icon_state = "labcoat_chem_open"
icon_open = "labcoat_chem_open"
icon_closed = "labcoat_chem"
/obj/item/clothing/suit/storage/labcoat/virologist
/obj/item/clothing/suit/storage/toggle/labcoat/virologist
name = "Virologist labcoat"
desc = "A suit that protects against minor chemical spills. Offers slightly more protection against biohazards than the standard model. Has a green stripe on the shoulder."
icon_state = "labcoat_vir_open"
icon_open = "labcoat_vir_open"
icon_closed = "labcoat_vir"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 60, rad = 0)
/obj/item/clothing/suit/storage/labcoat/science
/obj/item/clothing/suit/storage/toggle/labcoat/science
name = "Scientist labcoat"
desc = "A suit that protects against minor chemical spills. Has a purple stripe on the shoulder."
icon_state = "labcoat_tox_open"
icon_open = "labcoat_tox_open"
icon_closed = "labcoat_tox"
+6 -46
View File
@@ -199,28 +199,6 @@
item_state = "ianshirt"
body_parts_covered = UPPER_TORSO|ARMS
//Blue suit jacket toggle
/obj/item/clothing/suit/suit/verb/toggle()
set name = "Toggle Jacket Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
if(src.icon_state == "suitjacket_blue_open")
src.icon_state = "suitjacket_blue"
src.item_state = "suitjacket_blue"
usr << "You button up the suit jacket."
else if(src.icon_state == "suitjacket_blue")
src.icon_state = "suitjacket_blue_open"
src.item_state = "suitjacket_blue_open"
usr << "You unbutton the suit jacket."
else
usr << "You button-up some imaginary buttons on your [src]."
return
update_clothing_icon()
//pyjamas
//originally intended to be pinstripes >.>
@@ -401,38 +379,20 @@
icon_state = "leather_jacket_nt"
//This one has buttons for some reason
/obj/item/clothing/suit/storage/brown_jacket
/obj/item/clothing/suit/storage/toggle/brown_jacket
name = "leather jacket"
desc = "A brown leather coat."
icon_state = "brown_jacket"
item_state = "brown_jacket"
var/open_state = "brown_jacket_open"
icon_open = "brown_jacket_open"
icon_closed = "brown_jacket"
body_parts_covered = UPPER_TORSO|ARMS
/obj/item/clothing/suit/storage/brown_jacket/nanotrasen
/obj/item/clothing/suit/storage/toggle/brown_jacket/nanotrasen
desc = "A brown leather coat. The letters NT are proudly displayed on the back."
icon_state = "brown_jacket_nt"
open_state = "brown_jacket_nt_open"
/obj/item/clothing/suit/storage/brown_jacket/verb/toggle()
set name = "Toggle Jacket Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
//The inhand sprite (the mob sprite that appears when holding the item in your hand)
//is unchanged, so update only icon_state, not item_state.
if(icon_state == open_state)
usr << "You button up the jacket."
src.icon_state = initial(icon_state)
else if(icon_state == initial(icon_state))
usr << "You unbutton the jacket."
src.icon_state = open_state
update_clothing_icon() //so our overlays update
icon_open = "brown_jacket_nt_open"
icon_closed = "brown_jacket_nt"
/obj/item/clothing/suit/hoodie
name = "grey hoodie"
+23 -1
View File
@@ -26,4 +26,26 @@
/obj/item/clothing/suit/storage/hear_talk(mob/M, var/msg)
pockets.hear_talk(M, msg)
..()
..()
//Jackets with buttons, used for labcoats, IA jackets, First Responder jackets, and brown jackets.
/obj/item/clothing/suit/storage/toggle
var/icon_open
var/icon_closed
verb/toggle()
set name = "Toggle Coat Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
if(icon_state == icon_open) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user
icon_state = icon_closed
usr << "You button up the coat."
else if(icon_state == icon_closed)
icon_state = icon_open
usr << "You unbutton the coat."
else //in case some goofy admin switches icon states around without switching the icon_open or icon_closed
usr << "You attempt to button-up the velcro on your [src], before promptly realising how silly you are."
return
update_clothing_icon() //so our overlays update
+3 -3
View File
@@ -120,7 +120,7 @@
New()
..()
var/blocked = list(/obj/item/clothing/suit/chameleon, /obj/item/clothing/suit/space/space_ninja,
/obj/item/clothing/suit/golem, /obj/item/clothing/suit/suit, /obj/item/clothing/suit/cyborg_suit, /obj/item/clothing/suit/justice,
/obj/item/clothing/suit/golem, /obj/item/clothing/suit/cyborg_suit, /obj/item/clothing/suit/justice,
/obj/item/clothing/suit/greatcoat)//Prevent infinite loops and bad suits.
for(var/U in typesof(/obj/item/clothing/suit)-blocked)
var/obj/item/clothing/suit/V = new U
@@ -257,7 +257,7 @@
icon_state = A.icon_state
item_state = A.item_state
item_color = A.item_color
//so our overlays update.
if (ismob(src.loc))
var/mob/M = src.loc
@@ -464,7 +464,7 @@
icon_state = A.icon_state
item_state = A.item_state
flags_inv = A.flags_inv
//so our overlays update.
if (ismob(src.loc))
var/mob/M = src.loc
+3 -1
View File
@@ -865,11 +865,13 @@
icon_state = "mitlabcoat"
item_state = "mitlabcoat"
/obj/item/clothing/suit/storage/labcoat/fluff/epsilon //Devildabeast: Looping Song
/obj/item/clothing/suit/storage/toggle/labcoat/fluff/epsilon //Devildabeast: Looping Song
name = "e UMi labcoat"
desc = "A suit that protects against minor chemical spills. Has a black stripe on the shoulder. The abbreviation \"e UMi\" is written on the back in bold text."
icon = 'icons/obj/custom_items.dmi'
icon_state = "labcoat_black_open"
icon_open = "labcoat_black_open"
icon_closed = "labcoat_black"
item_state = "labcoat_black"
/obj/item/clothing/suit/storage/det_suit/fluff/leatherjack //atomicdog92: Seth Sealis