-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
ghost.dm
185 lines (151 loc) · 5.21 KB
/
ghost.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/// Determines what accessories your ghost will look like they have.
/datum/preference/choiced/ghost_accessories
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "ghost_accs"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/choiced/ghost_accessories/init_possible_values()
return list(GHOST_ACCS_NONE, GHOST_ACCS_DIR, GHOST_ACCS_FULL)
/datum/preference/choiced/ghost_accessories/create_default_value()
return GHOST_ACCS_DEFAULT_OPTION
/datum/preference/choiced/ghost_accessories/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
ghost.ghost_accs = value
ghost.update_appearance(UPDATE_ICON)
/datum/preference/choiced/ghost_accessories/deserialize(input, datum/preferences/preferences)
// Old ghost preferences used to be 1/50/100.
// Whoever did that wasted an entire day of my time trying to get those sent
// properly, so I'm going to buck them.
if (isnum(input))
switch (input)
if (1)
input = GHOST_ACCS_NONE
if (50)
input = GHOST_ACCS_DIR
if (100)
input = GHOST_ACCS_FULL
return ..(input)
/// Determines the appearance of your ghost to others, when you are a BYOND member
/datum/preference/choiced/ghost_form
savefile_key = "ghost_form"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
should_generate_icons = TRUE
var/static/list/ghost_forms = list(
"catghost" = "Cat",
"ghost" = "Default",
"ghost_black" = "Black",
"ghost_blazeit" = "Blaze it",
"ghost_blue" = "Blue",
"ghost_camo" = "Camo",
"ghost_cyan" = "Cyan",
"ghost_dblue" = "Dark blue",
"ghost_dcyan" = "Dark cyan",
"ghost_dgreen" = "Dark green",
"ghost_dpink" = "Dark pink",
"ghost_dred" = "Dark red",
"ghost_dyellow" = "Dark yellow",
"ghost_fire" = "Fire",
"ghost_funkypurp" = "Funky purple",
"ghost_green" = "Green",
"ghost_grey" = "Grey",
"ghost_mellow" = "Mellow",
"ghost_pink" = "Pink",
"ghost_pinksherbert" = "Pink Sherbert",
"ghost_purpleswirl" = "Purple Swirl",
"ghost_rainbow" = "Rainbow",
"ghost_red" = "Red",
"ghost_yellow" = "Yellow",
"ghostian2" = "Ian",
"ghostking" = "King",
"ghostmoth" = "Moff",
"snakeghost" = "Snake",
"slugghost" = "Cat Slug",
"crabghost" = "Crab",
"skeleghost" = "Skeleton",
)
/datum/preference/choiced/ghost_form/init_possible_values()
var/list/values = list()
for (var/ghost_form in ghost_forms)
values[ghost_form] = icon('icons/mob/mob.dmi', ghost_form)
return values
/datum/preference/choiced/ghost_form/create_default_value()
return "ghost"
/datum/preference/choiced/ghost_form/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
if (!is_donator(client))
return
ghost.update_icon(ALL, value)
/datum/preference/choiced/ghost_form/compile_constant_data()
var/list/data = ..()
data[CHOICED_PREFERENCE_DISPLAY_NAMES] = ghost_forms
return data
/// Toggles the HUD for ghosts
/datum/preference/toggle/ghost_hud
savefile_key = "ghost_hud"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/toggle/ghost_hud/apply_to_client(client/client, value)
if (isobserver(client?.mob))
client?.mob.hud_used?.show_hud()
/// Determines what ghosts orbiting look like to you.
/datum/preference/choiced/ghost_orbit
savefile_key = "ghost_orbit"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/choiced/ghost_orbit/init_possible_values()
return list(
GHOST_ORBIT_CIRCLE,
GHOST_ORBIT_TRIANGLE,
GHOST_ORBIT_SQUARE,
GHOST_ORBIT_HEXAGON,
GHOST_ORBIT_PENTAGON,
)
/datum/preference/choiced/ghost_orbit/create_default_value()
return GHOST_ORBIT_DEFAULT_OPTION
/datum/preference/choiced/ghost_orbit/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
if (!is_donator(client))
return
ghost.ghost_orbit = value
/// Determines how to show other ghosts
/datum/preference/choiced/ghost_others
savefile_key = "ghost_others"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/choiced/ghost_others/init_possible_values()
return list(
GHOST_OTHERS_SIMPLE,
GHOST_OTHERS_DEFAULT_SPRITE,
GHOST_OTHERS_THEIR_SETTING,
)
/datum/preference/choiced/ghost_others/create_default_value()
return GHOST_OTHERS_DEFAULT_OPTION
/datum/preference/choiced/ghost_others/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
ghost.update_sight()
/datum/preference/choiced/ghost_others/deserialize(input, datum/preferences/preferences)
// Old ghost preferences used to be 1/50/100.
// Whoever did that wasted an entire day of my time trying to get those sent
// properly, so I'm going to buck them.
if (isnum(input))
switch (input)
if (1)
input = GHOST_OTHERS_SIMPLE
if (50)
input = GHOST_OTHERS_DEFAULT_SPRITE
if (100)
input = GHOST_OTHERS_THEIR_SETTING
return ..(input, preferences)
/// Whether or not ghosts can examine things by clicking on them.
/datum/preference/toggle/inquisitive_ghost
savefile_key = "inquisitive_ghost"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES