-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
clothing.dm
161 lines (121 loc) · 5.89 KB
/
clothing.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/proc/generate_values_for_underwear(icon_file, list/accessory_list, list/icons)
var/icon/lower_half = icon('icons/blanks/32x32.dmi', "nothing")
for (var/icon in icons)
lower_half.Blend(icon('icons/mob/human_parts_greyscale.dmi', icon), ICON_OVERLAY)
var/list/values = list()
for (var/accessory_name in accessory_list)
var/icon/icon_with_socks = new(lower_half)
if (accessory_name != "Nude")
var/datum/sprite_accessory/accessory = accessory_list[accessory_name]
var/icon/accessory_icon = icon(icon_file, accessory.icon_state)
icon_with_socks.Blend(accessory_icon, ICON_OVERLAY)
icon_with_socks.Crop(10, 1, 22, 13)
icon_with_socks.Scale(32, 32)
values[accessory_name] = icon_with_socks
return values
/// Backpack preference
/datum/preference/choiced/backpack
savefile_key = "backbag"
savefile_identifier = PREFERENCE_CHARACTER
main_feature_name = "Backpack"
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
/datum/preference/choiced/backpack/init_possible_values()
var/list/values = list()
values[GBACKPACK] = /obj/item/storage/backpack
values[GSATCHEL] = /obj/item/storage/backpack/satchel
values[LSATCHEL] = /obj/item/storage/backpack/satchel/leather
values[GDUFFELBAG] = /obj/item/storage/backpack/duffelbag
// In a perfect world, these would be your department's backpack.
// However, this doesn't factor in assistants, or no high slot, and would
// also increase the spritesheet size a lot.
// I play atmos, and so engi backpacks you get.
values[DBACKPACK] = /obj/item/storage/backpack/industrial
values[DSATCHEL] = /obj/item/storage/backpack/satchel/eng
values[DDUFFELBAG] = /obj/item/storage/backpack/duffelbag/engineering
return values
/datum/preference/choiced/backpack/create_default_value()
return GBACKPACK
/datum/preference/choiced/backpack/apply_to_human(mob/living/carbon/human/target, value)
target.backbag = value
/// Jumpsuit preference
/datum/preference/choiced/jumpsuit
savefile_key = "jumpsuit_style"
savefile_identifier = PREFERENCE_CHARACTER
main_feature_name = "Jumpsuit"
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
/datum/preference/choiced/jumpsuit/init_possible_values()
var/list/values = list()
values[PREF_SUIT] = /obj/item/clothing/under/color/grey
values[PREF_SKIRT] = /obj/item/clothing/under/skirt/color/grey
return values
/datum/preference/choiced/jumpsuit/apply_to_human(mob/living/carbon/human/target, value)
target.jumpsuit_style = value
/// Socks preference
/datum/preference/choiced/socks
savefile_key = "socks"
savefile_identifier = PREFERENCE_CHARACTER
main_feature_name = "Socks"
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
/datum/preference/choiced/socks/init_possible_values()
return generate_values_for_underwear('icons/mob/clothing/sprite_accessories/socks.dmi', GLOB.socks_list, list("human_r_leg", "human_l_leg"))
/datum/preference/choiced/socks/apply_to_human(mob/living/carbon/human/target, value)
target.socks = value
/datum/preference/choiced/socks/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)
/// Undershirt preference
/datum/preference/choiced/undershirt
savefile_key = "undershirt"
savefile_identifier = PREFERENCE_CHARACTER
main_feature_name = "Undershirt"
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
/datum/preference/choiced/undershirt/init_possible_values()
var/icon/body = icon('icons/mob/human_parts_greyscale.dmi', "human_r_leg")
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_leg"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_r_arm"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_arm"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_r_hand"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_hand"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_chest_m"), ICON_OVERLAY)
var/list/values = list()
for (var/accessory_name in GLOB.undershirt_list)
var/icon/icon_with_undershirt = icon(body)
if (accessory_name != "Nude")
var/datum/sprite_accessory/accessory = GLOB.undershirt_list[accessory_name]
icon_with_undershirt.Blend(icon('icons/mob/clothing/sprite_accessories/undershirt.dmi', accessory.icon_state), ICON_OVERLAY)
icon_with_undershirt.Crop(9, 9, 23, 23)
icon_with_undershirt.Scale(32, 32)
values[accessory_name] = icon_with_undershirt
return values
/datum/preference/choiced/undershirt/apply_to_human(mob/living/carbon/human/target, value)
target.undershirt = value
/datum/preference/choiced/undershirt/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)
/// Underwear preference
/datum/preference/choiced/underwear
savefile_key = "underwear"
savefile_identifier = PREFERENCE_CHARACTER
main_feature_name = "Underwear"
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
/datum/preference/choiced/underwear/init_possible_values()
return generate_values_for_underwear('icons/mob/clothing/sprite_accessories/underwear.dmi', GLOB.underwear_list, list("human_chest_m", "human_r_leg", "human_l_leg"))
/datum/preference/choiced/underwear/apply_to_human(mob/living/carbon/human/target, value)
target.underwear = value
/datum/preference/choiced/underwear/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)