-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathemote.dm
412 lines (346 loc) · 12.8 KB
/
emote.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
/datum/emote/living/carbon/human
mob_type_allowed_typecache = list(/mob/living/carbon/human)
/// The time it takes for the crying visual to be removed
#define CRY_DURATION 12.8 SECONDS
/datum/emote/living/carbon/human/cry
key = "cry"
key_third_person = "cries"
message = "cries."
emote_type = EMOTE_AUDIBLE
stat_allowed = SOFT_CRIT
/datum/emote/living/carbon/human/cry/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(. && ishuman(user)) // Give them a visual crying effect if they're human
var/mob/living/carbon/human/human_user = user
ADD_TRAIT(human_user, TRAIT_CRYING, "[type]")
human_user.update_body()
// Use a timer to remove the effect after the defined duration has passed
var/list/key_emotes = GLOB.emote_list["cry"]
for(var/datum/emote/living/carbon/human/cry/human_emote in key_emotes)
// The existing timer restarts if it is already running
addtimer(CALLBACK(human_emote, PROC_REF(end_visual), human_user), CRY_DURATION, TIMER_UNIQUE | TIMER_OVERRIDE)
/datum/emote/living/carbon/human/cry/proc/end_visual(mob/living/carbon/human/human_user)
if(!QDELETED(human_user))
REMOVE_TRAIT(human_user, TRAIT_CRYING, "[type]")
human_user.update_body()
/datum/emote/living/carbon/human/cry/get_sound(mob/living/carbon/human/user)
if(!istype(user))
return
return user.dna.species.get_cry_sound(user)
#undef CRY_DURATION
/datum/emote/living/carbon/human/dap
key = "dap"
key_third_person = "daps"
message = "sadly can't find anybody to give daps to, and daps themself. Shameful."
message_param = "gives daps to %t."
hands_use_check = TRUE
/datum/emote/living/carbon/human/eyebrow
key = "eyebrow"
message = "raises an eyebrow."
/datum/emote/living/carbon/human/grumble
key = "grumble"
key_third_person = "grumbles"
message = "grumbles!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/handshake
key = "handshake"
message = "shakes their own hands."
message_param = "shakes hands with %t."
hands_use_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/hiss
key = "hiss"
key_third_person = "hisses"
message = "hisses."
message_param = "hisses at %t."
emote_type = EMOTE_AUDIBLE
var/list/viable_tongues = list(/obj/item/organ/tongue/lizard, /obj/item/organ/tongue/polysmorph)
/datum/emote/living/carbon/hiss/get_sound(mob/living/user)
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE)
if(istype(T, /obj/item/organ/tongue/lizard))
return 'sound/voice/lizard/hiss.ogg'
if(istype(T, /obj/item/organ/tongue/polysmorph))
return pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
if(iscatperson(user))//yogs: catpeople can hiss!
return pick('sound/voice/feline/hiss1.ogg', 'sound/voice/feline/hiss2.ogg', 'sound/voice/feline/hiss3.ogg')
/datum/emote/living/carbon/hiss/can_run_emote(mob/living/user, status_check = TRUE, intentional)
if(!ishuman(user))
return FALSE
var/mob/living/carbon/human/H = user
var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE)
if(iscatperson(user)) //yogs: cat people can hiss!
return TRUE
return is_type_in_list(T, viable_tongues)
/datum/emote/living/carbon/human/hug
key = "hug"
key_third_person = "hugs"
message = "hugs themself."
message_param = "hugs %t."
hands_use_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/mumble
key = "mumble"
key_third_person = "mumbles"
message = "mumbles!"
emote_type = EMOTE_AUDIBLE
stat_allowed = SOFT_CRIT
/datum/emote/living/carbon/human/scream
key = "scream"
key_third_person = "screams"
message = "screams!"
emote_type = EMOTE_AUDIBLE
cooldown = 10 SECONDS
vary = TRUE
/datum/emote/living/carbon/human/scream/get_sound(mob/living/user)
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
if(H.mind?.miming || !H.can_speak_vocal())
return
if(H.dna?.species)
return H.dna.species.get_scream_sound(H)
/datum/emote/living/carbon/human/rattle
key = "rattle"
key_third_person = "rattles"
message = "rattles their bones!"
message_param = "rattles %t bones!"
emote_type = EMOTE_AUDIBLE
sound = 'sound/voice/rattled.ogg'
/datum/emote/living/carbon/human/rattle/can_run_emote(mob/living/user, status_check = TRUE, intentional)
return (isskeleton(user) || isplasmaman(user)) && ..()
/datum/emote/living/carbon/human/pale
key = "pale"
message = "goes pale for a second."
/datum/emote/living/carbon/human/raise
key = "raise"
key_third_person = "raises"
message = "raises a hand."
hands_use_check = TRUE
/datum/emote/living/carbon/human/salute
key = "salute"
key_third_person = "salutes"
message = "salutes."
message_param = "salutes to %t."
hands_use_check = TRUE
/datum/emote/living/carbon/human/shrug
key = "shrug"
key_third_person = "shrugs"
message = "shrugs."
// Tail thump! Lizard-tail exclusive emote.
/datum/emote/living/carbon/human/tailthump
key = "thump"
key_third_person = "thumps their tail"
message = "thumps their tail!"
emote_type = EMOTE_AUDIBLE
vary = TRUE
/datum/emote/living/carbon/human/tailthump/get_sound(mob/living/user)
var/obj/item/organ/tail/lizard/tail = user.getorganslot(ORGAN_SLOT_TAIL)
return tail?.sound_override || 'sound/voice/lizard/tailthump.ogg' // Source: https://freesound.org/people/TylerAM/sounds/389665/
/datum/emote/living/carbon/human/tailthump/can_run_emote(mob/user, status_check = TRUE, intentional)
. = ..()
if(!.)
return FALSE
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species)
return FALSE
if(H.IsParalyzed() || H.IsStun()) // No thumping allowed. Taken from can_wag_tail().
return FALSE
return ("tail_lizard" in H.dna.species.mutant_bodyparts) || ("waggingtail_lizard" in H.dna.species.mutant_bodyparts)
/datum/emote/living/carbon/human/wag
key = "wag"
key_third_person = "wags"
message = "wags their tail."
/datum/emote/living/carbon/human/wag/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(!.)
return
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species || !H.dna.species.can_wag_tail(H))
return
if(!H.dna.species.is_wagging_tail())
H.dna.species.start_wagging_tail(H)
else
H.dna.species.stop_wagging_tail(H)
/datum/emote/living/carbon/human/wag/can_run_emote(mob/user, status_check = TRUE , intentional)
. = ..()
if(!.)
return FALSE
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species) // Here to prevent a runtime when a silicon does *help.
return FALSE
return H.dna.species.can_wag_tail(user)
/datum/emote/living/carbon/human/wag/select_message_type(mob/user, intentional)
. = ..()
var/mob/living/carbon/human/H = user
if(!H.dna || !H.dna.species)
return
if(H.dna.species.is_wagging_tail())
. = null
/datum/emote/living/carbon/human/flap
key = "flap"
key_third_person = "flaps"
message = "flaps their wings."
hands_use_check = TRUE
var/wing_time = 20
/datum/emote/living/carbon/human/flap/can_run_emote(mob/user, status_check, intentional)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.dna.features["wings"] == "None")
return FALSE
return ..()
/datum/emote/living/carbon/human/flap/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(. && ishuman(user))
var/mob/living/carbon/human/H = user
var/open = FALSE
if(H.dna.features["wings"] != "None")
if("wingsopen" in H.dna.species.mutant_bodyparts)
open = TRUE
H.CloseWings()
else
H.OpenWings()
addtimer(CALLBACK(H, open ? TYPE_PROC_REF(/mob/living/carbon/human, OpenWings) : TYPE_PROC_REF(/mob/living/carbon/human, CloseWings)), wing_time)
/datum/emote/living/carbon/human/flap/get_sound(mob/living/carbon/human/user)
if(ismoth(user))
return 'sound/voice/moth/moth_flutter.ogg'
return ..()
/datum/emote/living/carbon/human/flap/aflap
key = "aflap"
key_third_person = "aflaps"
message = "flaps their wings ANGRILY!"
hands_use_check = TRUE
wing_time = 10
/datum/emote/living/carbon/human/wing
key = "wing"
key_third_person = "wings"
message = "their wings."
/datum/emote/living/carbon/human/wing/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(.)
var/mob/living/carbon/human/H = user
if(findtext(select_message_type(user,intentional), "open"))
H.OpenWings()
else
H.CloseWings()
/datum/emote/living/carbon/human/wing/select_message_type(mob/user, intentional)
. = ..()
var/mob/living/carbon/human/H = user
if("wings" in H.dna.species.mutant_bodyparts)
. = "opens " + message
else
. = "closes " + message
/datum/emote/living/carbon/human/wing/can_run_emote(mob/user, status_check = TRUE, intentional)
. = ..()
if(!.)
return FALSE
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species) // Here to prevent a runtime when a silicon does *help.
return FALSE
return (H.dna.species["wings"] != "None")
/mob/living/carbon/human/proc/OpenWings()
if(!dna || !dna.species)
return
if("wings" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wings"
dna.species.mutant_bodyparts |= "wingsopen"
if("wingsdetail" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wingsdetail"
dna.species.mutant_bodyparts |= "wingsdetailopen"
if("moth_wings" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts |= "moth_wingsopen"
dna.features["moth_wingsopen"] = "moth_wings"
dna.species.mutant_bodyparts -= "moth_wings"
update_body()
/mob/living/carbon/human/proc/CloseWings()
if(!dna || !dna.species)
return
if("wingsopen" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wingsopen"
dna.species.mutant_bodyparts |= "wings"
if("wingsdetailopen" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wingsdetailopen"
dna.species.mutant_bodyparts |= "wingsdetail"
if("moth_wingsopen" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "moth_wingsopen"
dna.species.mutant_bodyparts |= "moth_wings"
update_body()
if(isturf(loc))
var/turf/T = loc
T.Entered(src)
/datum/emote/living/carbon/human/robot_tongue
emote_type = EMOTE_AUDIBLE //emotes that require robotic voicebox are audible by default, because it's a sound-making device
/datum/emote/living/carbon/human/robot_tongue/can_run_emote(mob/user, status_check = TRUE , intentional)
. = ..()
if(!.)
return FALSE
var/obj/item/organ/tongue/T = user.getorganslot("tongue")
if(!istype(T) || T.status != ORGAN_ROBOTIC)
return FALSE
/datum/emote/living/carbon/human/robot_tongue/beep
key = "beep"
key_third_person = "beeps"
message = "beeps."
message_param = "beeps at %t."
/datum/emote/living/carbon/human/robot_tongue/beep/get_sound(mob/living/user)
return 'sound/machines/twobeep.ogg'
/datum/emote/living/carbon/human/robot_tongue/boop
key = "boop"
key_third_person = "boops"
message = "boops."
/datum/emote/living/carbon/human/robot_tongue/boop/get_sound(mob/living/user)
return 'sound/machines/boop.ogg'
/datum/emote/living/carbon/human/robot_tongue/buzz
key = "buzz"
key_third_person = "buzzes"
message = "buzzes."
message_param = "buzzes at %t."
/datum/emote/living/carbon/human/robot_tongue/buzz/get_sound(mob/living/user)
return 'sound/machines/buzz-sigh.ogg'
/datum/emote/living/carbon/human/robot_tongue/buzz2
key = "buzz2"
message = "buzzes twice."
/datum/emote/living/carbon/human/robot_tongue/buzz2/get_sound(mob/living/user)
return 'sound/machines/buzz-two.ogg'
/datum/emote/living/carbon/human/robot_tongue/chime
key = "chime"
key_third_person = "chimes"
message = "chimes."
/datum/emote/living/carbon/human/robot_tongue/chime/get_sound(mob/living/user)
return 'sound/machines/chime.ogg'
/datum/emote/living/carbon/human/robot_tongue/ping
key = "ping"
key_third_person = "pings"
message = "pings."
message_param = "pings at %t."
/datum/emote/living/carbon/human/robot_tongue/ping/get_sound(mob/living/user)
return 'sound/machines/ping.ogg'
/datum/emote/living/carbon/human/robot_tongue/warn
key = "warn"
key_third_person = "warns"
message = "blares an alarm!"
message_param = "blares an alarm at %t!"
/datum/emote/living/carbon/human/robot_tongue/warn/get_sound(mob/living/user)
return 'sound/machines/warning-buzzer.ogg'
// Emotes only for clowns who use a robotic tongue. Honk!
/datum/emote/living/carbon/human/robot_tongue/clown/can_run_emote(mob/user, status_check = TRUE, intentional)
. = ..()
if(!.)
return FALSE
if(!user || !user.mind || !user.mind.assigned_role || user.mind.assigned_role != "Clown")
return FALSE
return TRUE
/datum/emote/living/carbon/human/robot_tongue/clown/honk
key = "honk"
key_third_person = "honks"
message = "honks."
/datum/emote/living/carbon/human/robot_tongue/clown/honk/get_sound(mob/living/user)
return 'sound/items/bikehorn.ogg'
/datum/emote/living/carbon/human/robot_tongue/clown/sad
key = "sad"
key_third_person = "plays a sad trombone..."
message = "plays a sad trombone..."
/datum/emote/living/carbon/human/robot_tongue/clown/sad/get_sound(mob/living/user)
return 'sound/misc/sadtrombone.ogg'