Ports emote decls from Bay + automatic pain emotes. (#9215)

This commit is contained in:
Matt Atlas
2020-07-03 20:14:23 +02:00
committed by GitHub
parent 431949383f
commit 107bbc58d8
30 changed files with 1369 additions and 908 deletions
+207
View File
@@ -0,0 +1,207 @@
/mob
var/list/default_emotes = list()
var/list/usable_emotes = list()
/mob/proc/update_emotes(var/skip_sort)
usable_emotes.Cut()
for(var/emote in default_emotes)
var/decl/emote/emote_datum = decls_repository.get_decl(emote)
if(emote_datum.check_user(src))
usable_emotes[emote_datum.key] = emote_datum
if(!skip_sort)
usable_emotes = sortAssoc(usable_emotes)
/mob/Initialize()
. = ..()
update_emotes()
// Specific defines follow.
/mob/living/carbon/alien
default_emotes = list(
/decl/emote/visible,
/decl/emote/visible/scratch,
/decl/emote/visible/drool,
/decl/emote/visible/nod,
/decl/emote/visible/sway,
/decl/emote/visible/sulk,
/decl/emote/visible/twitch,
/decl/emote/visible/dance,
/decl/emote/visible/roll,
/decl/emote/visible/shake,
/decl/emote/visible/jump,
/decl/emote/visible/shiver,
/decl/emote/visible/collapse,
/decl/emote/audible/hiss,
/decl/emote/audible,
/decl/emote/audible/deathgasp_alien,
/decl/emote/audible/whimper,
/decl/emote/audible/gasp,
/decl/emote/audible/scretch,
/decl/emote/audible/choke,
/decl/emote/audible/moan,
/decl/emote/audible/gnarl
)
/mob/living/carbon/alien/diona
default_emotes = list(
/decl/emote/visible,
/decl/emote/visible/scratch,
/decl/emote/visible/drool,
/decl/emote/visible/nod,
/decl/emote/visible/sway,
/decl/emote/visible/sulk,
/decl/emote/visible/twitch,
/decl/emote/visible/dance,
/decl/emote/visible/roll,
/decl/emote/visible/shake,
/decl/emote/visible/jump,
/decl/emote/visible/shiver,
/decl/emote/visible/collapse,
/decl/emote/audible/hiss,
/decl/emote/audible,
/decl/emote/audible/scretch,
/decl/emote/audible/choke,
/decl/emote/audible/gnarl,
/decl/emote/audible/chirp
)
/mob/living/carbon/brain/can_emote()
return (istype(container, /obj/item/device/mmi) && ..())
/mob/living/carbon/brain
default_emotes = list(
/decl/emote/audible/alarm,
/decl/emote/audible/alert,
/decl/emote/audible/notice,
/decl/emote/audible/whistle,
/decl/emote/audible/synth,
/decl/emote/audible/boop,
/decl/emote/visible/blink,
/decl/emote/visible/flash
)
/mob/living/carbon/human
default_emotes = list(
/decl/emote/visible/blink,
/decl/emote/audible/synth,
/decl/emote/audible/synth/ping,
/decl/emote/audible/synth/buzz,
/decl/emote/audible/synth/confirm,
/decl/emote/audible/synth/deny,
/decl/emote/visible/nod,
/decl/emote/visible/shake,
/decl/emote/visible/shiver,
/decl/emote/visible/collapse,
/decl/emote/audible/gasp,
/decl/emote/audible/sneeze,
/decl/emote/audible/sniff,
/decl/emote/audible/snore,
/decl/emote/audible/whimper,
/decl/emote/audible/yawn,
/decl/emote/audible/clap,
/decl/emote/audible/golfclap,
/decl/emote/audible/chuckle,
/decl/emote/audible/cough,
/decl/emote/audible/cry,
/decl/emote/audible/sigh,
/decl/emote/audible/laugh,
/decl/emote/audible/mumble,
/decl/emote/audible/grumble,
/decl/emote/audible/groan,
/decl/emote/audible/moan,
/decl/emote/audible/grunt,
/decl/emote/audible/slap,
/decl/emote/audible/snap,
/decl/emote/human,
/decl/emote/human/deathgasp,
/decl/emote/audible/giggle,
/decl/emote/audible/scream,
/decl/emote/visible/airguitar,
/decl/emote/visible/blink_r,
/decl/emote/visible/bow,
/decl/emote/visible/salute,
/decl/emote/visible/flap,
/decl/emote/visible/aflap,
/decl/emote/visible/drool,
/decl/emote/visible/eyebrow,
/decl/emote/visible/twitch,
/decl/emote/visible/twitch_v,
/decl/emote/visible/faint,
/decl/emote/visible/frown,
/decl/emote/visible/blush,
/decl/emote/visible/wave,
/decl/emote/visible/glare,
/decl/emote/visible/stare,
/decl/emote/visible/look,
/decl/emote/visible/point,
/decl/emote/visible/raise,
/decl/emote/visible/grin,
/decl/emote/visible/shrug,
/decl/emote/visible/smile,
/decl/emote/visible/pale,
/decl/emote/visible/tremble,
/decl/emote/visible/wink,
/decl/emote/visible/hug,
/decl/emote/visible/dap,
/decl/emote/visible/signal,
/decl/emote/visible/handshake,
/decl/emote/visible/afold,
/decl/emote/visible/alook,
/decl/emote/visible/eroll,
/decl/emote/visible/hbow,
/decl/emote/visible/hip,
/decl/emote/visible/holdup,
/decl/emote/visible/hshrug,
/decl/emote/visible/crub,
/decl/emote/visible/erub,
/decl/emote/visible/fslap,
/decl/emote/visible/ftap,
/decl/emote/visible/hrub,
/decl/emote/visible/hspread,
/decl/emote/visible/pocket,
/decl/emote/visible/rsalute,
/decl/emote/visible/rshoulder,
/decl/emote/visible/squint,
/decl/emote/visible/tfist,
/decl/emote/visible/tilt
)
/mob/living/silicon/robot
default_emotes = list(
/decl/emote/audible/clap,
/decl/emote/visible/bow,
/decl/emote/visible/salute,
/decl/emote/visible/flap,
/decl/emote/visible/aflap,
/decl/emote/visible/twitch,
/decl/emote/visible/twitch_v,
/decl/emote/visible/nod,
/decl/emote/visible/shake,
/decl/emote/visible/glare,
/decl/emote/visible/look,
/decl/emote/visible/stare,
/decl/emote/visible/deathgasp_robot,
/decl/emote/audible/synth,
/decl/emote/audible/synth/ping,
/decl/emote/audible/synth/buzz,
/decl/emote/audible/synth/confirm,
/decl/emote/audible/synth/deny,
)
/mob/living/carbon/slime
default_emotes = list(
/decl/emote/audible/moan,
/decl/emote/visible/twitch,
/decl/emote/visible/sway,
/decl/emote/visible/shiver,
/decl/emote/visible/bounce,
/decl/emote/visible/jiggle,
/decl/emote/visible/lightup,
/decl/emote/visible/vibrate,
/decl/emote/slime,
/decl/emote/slime/pout,
/decl/emote/slime/sad,
/decl/emote/slime/angry,
/decl/emote/slime/frown,
/decl/emote/slime/smile
)
@@ -0,0 +1,79 @@
/datum/species
var/list/default_emotes = list()
/mob/living/carbon/update_emotes()
. = ..(skip_sort=1)
if(species)
for(var/emote in species.default_emotes)
var/decl/emote/emote_datum = decls_repository.get_decl(emote)
if(emote_datum.check_user(src))
usable_emotes[emote_datum.key] = emote_datum
usable_emotes = sortAssoc(usable_emotes)
// Specific defines follow.
/datum/species/slime
default_emotes = list(
/decl/emote/visible/bounce,
/decl/emote/visible/jiggle,
/decl/emote/visible/lightup,
/decl/emote/visible/vibrate
)
/datum/species/unathi
default_emotes = list(
/decl/emote/human/swish,
/decl/emote/human/wag,
/decl/emote/human/sway,
/decl/emote/human/qwag,
/decl/emote/human/fastsway,
/decl/emote/human/swag,
/decl/emote/human/stopsway,
/decl/emote/audible/lizard_bellow
)
pain_emotes_with_pain_level = list(
list(/decl/emote/audible/roar, /decl/emote/audible/whimper, /decl/emote/audible/moan) = 70,
list(/decl/emote/audible/grunt, /decl/emote/audible/groan, /decl/emote/audible/moan) = 40,
list(/decl/emote/audible/grunt, /decl/emote/audible/groan) = 10,
)
/datum/species/diona
default_emotes = list(
/decl/emote/audible/chirp,
/decl/emote/audible/multichirp,
/decl/emote/audible/nymphsqueal,
/decl/emote/audible/painrustle,
/decl/emote/audible/paincreak
)
pain_emotes_with_pain_level = list(
list(/decl/emote/audible/painrustle, /decl/emote/audible/paincreak, /decl/emote/audible/nymphsqueal) = 70,
list(/decl/emote/audible/painrustle, /decl/emote/audible/nymphsqueal) = 40,
list(/decl/emote/audible/paincreak) = 10,
)
/datum/species/bug
default_emotes = list(
/decl/emote/audible/hiss,
/decl/emote/audible/chitter,
/decl/emote/audible/shriek,
/decl/emote/audible/screech
)
pain_emotes_with_pain_level = list(
list(/decl/emote/audible/screech, /decl/emote/audible/shriek) = 70,
list(/decl/emote/audible/shriek, /decl/emote/audible/hiss) = 40,
list(/decl/emote/audible/hiss) = 10,
)
/datum/species/tajaran
default_emotes = list(
/decl/emote/audible/howl,
/decl/emote/audible/hiss
)
pain_emotes_with_pain_level = list(
list(/decl/emote/audible/scream, /decl/emote/audible/whimper, /decl/emote/audible/moan, /decl/emote/audible/cry, /decl/emote/audible/howl) = 70,
list(/decl/emote/audible/grunt, /decl/emote/audible/groan, /decl/emote/audible/moan, /decl/emote/audible/hiss) = 40,
list(/decl/emote/audible/grunt, /decl/emote/audible/groan, /decl/emote/audible/hiss) = 10,
)
/mob/living/carbon/human/set_species(var/new_species, var/default_colour = 1)
UNLINT(. = ..())
update_emotes()
+223
View File
@@ -0,0 +1,223 @@
/decl/emote/audible
key = "burp"
emote_message_3p = "USER burps."
message_type = AUDIBLE_MESSAGE
var/emote_sound
/decl/emote/audible/do_extra(var/atom/user)
var/sound_to_play
if(emote_sound)
if(islist(emote_sound))
sound_to_play = pick(emote_sound)
else
sound_to_play = emote_sound
playsound(user.loc, sound_to_play, 50, 0, vary = FALSE)
/decl/emote/audible/deathgasp_alien
key = "deathgasp"
emote_message_3p = "USER lets out a waning guttural screech, green blood bubbling from its maw."
/decl/emote/audible/whimper
key ="whimper"
emote_message_3p = "USER whimpers."
/decl/emote/audible/gasp
key ="gasp"
emote_message_3p = "USER gasps."
conscious = 0
/decl/emote/audible/scretch
key ="scretch"
emote_message_3p = "USER scretches."
/decl/emote/audible/choke
key ="choke"
emote_message_3p = "USER chokes."
conscious = 0
/decl/emote/audible/gnarl
key ="gnarl"
emote_message_3p = "USER gnarls and shows its teeth.."
/decl/emote/audible/chirp
key ="chirp"
emote_message_3p = "USER chirps!"
emote_sound = 'sound/misc/nymphchirp.ogg'
/decl/emote/audible/multichirp
key ="mchirp"
emote_message_3p = "USER chirps a chorus of notes!"
emote_sound = 'sound/misc/multichirp.ogg'
/decl/emote/audible/paincreak
key ="pcreak"
emote_message_3p = "USER creaks in pain!"
/decl/emote/audible/painrustle
key ="prustle"
emote_message_3p = "USER rustles in agony!"
/decl/emote/audible/nymphsqueal
key ="psqueal"
emote_message_3p = "USER's nymphs squeal in pain!"
/decl/emote/audible/chitter
key = "chitter"
emote_message_3p = "USER chitters."
emote_sound = list('sound/misc/zapsplat/chitter1.ogg', 'sound/misc/zapsplat/chitter2.ogg', 'sound/misc/zapsplat/chitter3.ogg')
/decl/emote/audible/shriek
key = "shriek"
emote_message_3p = "USER shrieks!"
/decl/emote/audible/screech
key = "screech"
emote_message_3p = "USER screeches!"
/decl/emote/audible/alarm
key = "alarm"
emote_message_1p = "You sound an alarm."
emote_message_3p = "USER sounds an alarm."
/decl/emote/audible/alert
key = "alert"
emote_message_1p = "You let out a distressed noise."
emote_message_3p = "USER lets out a distressed noise."
/decl/emote/audible/notice
key = "notice"
emote_message_1p = "You play a loud tone."
emote_message_3p = "USER plays a loud tone."
/decl/emote/audible/whistle
key = "whistle"
emote_message_1p = "You whistle."
emote_message_3p = "USER whistles."
/decl/emote/audible/boop
key = "boop"
emote_message_1p = "You boop."
emote_message_3p = "USER boops."
/decl/emote/audible/sneeze
key = "sneeze"
emote_message_3p = "USER sneezes."
/decl/emote/audible/sniff
key = "sniff"
emote_message_3p = "USER sniffs."
/decl/emote/audible/snore
key = "snore"
emote_message_3p = "USER snores."
conscious = 0
/decl/emote/audible/whimper
key = "whimper"
emote_message_3p = "USER whimpers."
/decl/emote/audible/yawn
key = "yawn"
emote_message_3p = "USER yawns."
/decl/emote/audible/clap
key = "clap"
emote_message_3p = "USER claps!"
emote_sound = 'sound/effects/clap.ogg'
/decl/emote/audible/golfclap
key = "golfclap"
emote_message_3p = "USER claps, clearly unimpressed."
emote_sound = 'sound/effects/golfclap.ogg'
/decl/emote/audible/chuckle
key = "chuckle"
emote_message_3p = "USER chuckles."
/decl/emote/audible/cough
key = "cough"
emote_message_3p = "USER coughs!"
conscious = 0
/decl/emote/audible/cry
key = "cry"
emote_message_3p = "USER cries."
/decl/emote/audible/sigh
key = "sigh"
emote_message_3p = "USER sighs."
/decl/emote/audible/laugh
key = "laugh"
emote_message_3p_target = "USER laughs at TARGET."
emote_message_3p = "USER laughs."
/decl/emote/audible/mumble
key = "mumble"
emote_message_3p = "USER mumbles!"
/decl/emote/audible/grumble
key = "grumble"
emote_message_3p = "USER grumbles!"
/decl/emote/audible/groan
key = "groan"
emote_message_3p = "USER groans!"
conscious = 0
/decl/emote/audible/moan
key = "moan"
emote_message_3p = "USER moans!"
conscious = 0
/decl/emote/audible/giggle
key = "giggle"
emote_message_3p = "USER giggles."
/decl/emote/audible/scream
key = "scream"
emote_message_3p = "USER screams!"
/decl/emote/audible/grunt
key = "grunt"
emote_message_3p = "USER grunts."
/decl/emote/audible/slap
key = "slap"
emote_message_1p_target = "<span class='warning'>You slap TARGET across the face!</span>"
emote_message_1p = "You slap yourself across the face!"
emote_message_3p_target = "<span class='warning'>USER slaps TARGET across the face!</span>"
emote_message_3p = "USER slaps USER_SELF across the face!"
emote_sound = 'sound/effects/snap.ogg'
/decl/emote/audible/snap
key = "snap"
emote_message_3p = "USER snaps USER_THEIR fingers."
emote_sound = 'sound/effects/fingersnap.ogg'
/decl/emote/audible/roar
key = "roar"
emote_message_3p = "USER roars!"
/decl/emote/audible/bellow
key = "bellow"
emote_message_3p = "USER bellows!"
/decl/emote/audible/howl
key = "howl"
emote_message_3p = "USER howls!"
/decl/emote/audible/wheeze
key = "wheeze"
emote_message_3p = "USER wheezes."
/decl/emote/audible/hiss
key ="hiss_"
emote_message_3p_target = "USER hisses softly at TARGET."
emote_message_3p = "USER hisses softly."
/decl/emote/audible/lizard_bellow
key = "bellow"
emote_message_3p_target = "USER bellows deeply at TARGET!"
emote_message_3p = "USER bellows!"
emote_sound = 'sound/voice/LizardBellow.ogg'
@@ -0,0 +1,41 @@
/decl/emote/exertion/biological
key = "esweat"
emote_range = 4
emote_message_1p = "You are sweating heavily."
emote_message_3p = "USER is sweating heavily."
/decl/emote/exertion/biological/check_user(mob/living/user)
if(istype(user) && !user.isSynthetic())
return ..()
return FALSE
/decl/emote/exertion/biological/breath
key = "ebreath"
emote_message_1p = "You feel out of breath."
emote_message_3p = "USER looks out of breath."
/decl/emote/exertion/biological/pant
key = "epant"
emote_range = 3
message_type = AUDIBLE_MESSAGE
emote_message_1p = "You pant to catch your breath."
emote_message_3p = "USER pants for air."
emote_message_impaired = "You can see USER breathing heavily."
/decl/emote/exertion/synthetic
key = "ewhine"
emote_range = 3
message_type = AUDIBLE_MESSAGE
emote_message_1p = "You overstress your actuators."
emote_message_3p = "USER's actuators whine with strain."
/decl/emote/exertion/synthetic/check_user(mob/living/user)
if(istype(user) && user.isSynthetic())
return ..()
return FALSE
/decl/emote/exertion/synthetic/creak
key = "ecreak"
emote_message_1p = "Your chassis stress indicators spike."
emote_message_3p = "USER's joints creak with stress."
+56
View File
@@ -0,0 +1,56 @@
/decl/emote/human
key = "vomit"
/decl/emote/human/check_user(var/mob/living/carbon/human/user)
return (istype(user) && user.check_has_mouth() && !user.isSynthetic())
/decl/emote/human/do_emote(var/mob/living/carbon/human/user)
user.vomit(deliberate = TRUE)
/decl/emote/human/deathgasp
key = "deathgasp"
/decl/emote/human/deathgasp/get_emote_message_3p(var/mob/living/carbon/human/user)
return "USER [user.species.death_message]"
/decl/emote/human/swish
key = "swish"
/decl/emote/human/swish/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_once()
/decl/emote/human/wag
key = "wag"
/decl/emote/human/wag/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_start()
/decl/emote/human/sway
key = "sway"
/decl/emote/human/sway/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_start()
/decl/emote/human/qwag
key = "qwag"
/decl/emote/human/qwag/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_fast()
/decl/emote/human/fastsway
key = "fastsway"
/decl/emote/human/fastsway/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_fast()
/decl/emote/human/swag
key = "swag"
/decl/emote/human/swag/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_stop()
/decl/emote/human/stopsway
key = "stopsway"
/decl/emote/human/stopsway/do_emote(var/mob/living/carbon/human/user)
user.animate_tail_stop()
+30
View File
@@ -0,0 +1,30 @@
/decl/emote/slime
key = "nomood"
var/mood
/decl/emote/slime/do_extra(var/mob/living/carbon/slime/user)
user.mood = mood
user.regenerate_icons()
/decl/emote/slime/check_user(var/atom/user)
return istype(user, /mob/living/carbon/slime)
/decl/emote/slime/pout
key = "pout"
mood = "pout"
/decl/emote/slime/sad
key = "sad"
mood = "sad"
/decl/emote/slime/angry
key = "angry"
mood = "angry"
/decl/emote/slime/frown
key = "frown"
mood = "mischevous"
/decl/emote/slime/smile
key = "smile"
mood = ":3"
@@ -0,0 +1,29 @@
/decl/emote/audible/synth
key = "beep"
emote_message_3p = "USER beeps."
emote_sound = 'sound/machines/twobeep.ogg'
/decl/emote/audible/synth/check_user(var/mob/living/user)
if(istype(user) && user.isSynthetic())
return ..()
return FALSE
/decl/emote/audible/synth/ping
key = "ping"
emote_message_3p = "USER pings."
emote_sound = 'sound/machines/ping.ogg'
/decl/emote/audible/synth/buzz
key = "buzz"
emote_message_3p = "USER buzzes."
emote_sound = 'sound/machines/buzz-sigh.ogg'
/decl/emote/audible/synth/confirm
key = "confirm"
emote_message_3p = "USER emits an affirmative blip."
emote_sound = 'sound/machines/synth_yes.ogg'
/decl/emote/audible/synth/deny
key = "deny"
emote_message_3p = "USER emits a negative blip."
emote_sound = 'sound/machines/synth_no.ogg'
+336
View File
@@ -0,0 +1,336 @@
/decl/emote/visible
key ="tail"
emote_message_3p = "USER waves USER_THEIR tail."
message_type = VISIBLE_MESSAGE
/decl/emote/visible/scratch
key = "scratch"
check_restraints = TRUE
emote_message_3p = "USER scratches."
/decl/emote/visible/drool
key ="drool"
emote_message_3p = "USER drools."
conscious = 0
/decl/emote/visible/nod
key ="nod"
emote_message_3p_target = "USER nods USER_THEIR head at TARGET."
emote_message_3p = "USER nods USER_THEIR head."
/decl/emote/visible/sway
key ="sway"
emote_message_3p = "USER sways around dizzily."
/decl/emote/visible/sulk
key ="sulk"
emote_message_3p = "USER sulks down sadly."
/decl/emote/visible/dance
key ="dance"
check_restraints = TRUE
emote_message_3p = "USER dances around happily."
/decl/emote/visible/roll
key ="roll"
check_restraints = TRUE
emote_message_3p = "USER rolls."
/decl/emote/visible/shake
key ="shake"
emote_message_3p = "USER shakes USER_THEIR head."
/decl/emote/visible/jump
key ="jump"
emote_message_3p = "USER jumps!"
/decl/emote/visible/shiver
key ="shiver"
emote_message_3p = "USER shivers."
conscious = 0
/decl/emote/visible/collapse
key ="collapse"
emote_message_3p = "USER collapses!"
/decl/emote/visible/collapse/do_extra(var/mob/user)
if(istype(user))
user.Paralyse(2)
/decl/emote/visible/flash
key = "flash"
emote_message_3p = "The lights on USER flash quickly."
/decl/emote/visible/blink
key = "blink"
emote_message_3p = "USER blinks."
/decl/emote/visible/airguitar
key = "airguitar"
check_restraints = TRUE
emote_message_3p = "USER is strumming the air and headbanging like a safari chimp."
/decl/emote/visible/blink_r
key = "blink_r"
emote_message_3p = "USER blinks rapidly."
/decl/emote/visible/bow
key = "bow"
emote_message_3p_target = "USER bows to TARGET."
emote_message_3p = "USER bows."
/decl/emote/visible/salute
key = "salute"
emote_message_3p_target = "USER salutes TARGET."
emote_message_3p = "USER salutes."
/decl/emote/visible/flap
key = "flap"
check_restraints = TRUE
emote_message_3p = "USER flaps USER_THEIR wings."
/decl/emote/visible/aflap
key = "aflap"
check_restraints = TRUE
emote_message_3p = "USER flaps USER_THEIR wings ANGRILY!"
/decl/emote/visible/eyebrow
key = "eyebrow"
emote_message_3p = "USER raises an eyebrow."
/decl/emote/visible/twitch
key = "twitch"
emote_message_3p = "USER twitches."
conscious = 0
/decl/emote/visible/twitch_v
key = "twitch_v"
emote_message_3p = "USER twitches violently."
conscious = 0
/decl/emote/visible/faint
key = "faint"
emote_message_3p = "USER faints."
/decl/emote/visible/faint/do_extra(var/mob/user)
if(istype(user) && user.sleeping <= 0)
user.sleeping += 10
/decl/emote/visible/frown
key = "frown"
emote_message_3p = "USER frowns."
/decl/emote/visible/blush
key = "blush"
emote_message_3p = "USER blushes."
/decl/emote/visible/wave
key = "wave"
emote_message_3p_target = "USER waves at TARGET."
emote_message_3p = "USER waves."
/decl/emote/visible/glare
key = "glare"
emote_message_3p_target = "USER glares at TARGET."
emote_message_3p = "USER glares."
/decl/emote/visible/stare
key = "stare"
emote_message_3p_target = "USER stares at TARGET."
emote_message_3p = "USER stares."
/decl/emote/visible/look
key = "look"
emote_message_3p_target = "USER looks at TARGET."
emote_message_3p = "USER looks."
/decl/emote/visible/point
key = "point"
check_restraints = TRUE
emote_message_3p_target = "USER points to TARGET."
emote_message_3p = "USER points."
/decl/emote/visible/raise
key = "raise"
check_restraints = TRUE
emote_message_3p = "USER raises a hand."
/decl/emote/visible/grin
key = "grin"
emote_message_3p_target = "USER grins at TARGET."
emote_message_3p = "USER grins."
/decl/emote/visible/shrug
key = "shrug"
emote_message_3p = "USER shrugs."
/decl/emote/visible/smile
key = "smile"
emote_message_3p_target = "USER smiles at TARGET."
emote_message_3p = "USER smiles."
/decl/emote/visible/pale
key = "pale"
emote_message_3p = "USER goes pale for a second."
/decl/emote/visible/tremble
key = "tremble"
emote_message_3p = "USER trembles in fear!"
/decl/emote/visible/wink
key = "wink"
emote_message_3p_target = "USER winks at TARGET."
emote_message_3p = "USER winks."
/decl/emote/visible/hug
key = "hug"
check_restraints = TRUE
emote_message_3p_target = "USER hugs TARGET."
emote_message_3p = "USER hugs USER_SELF."
/decl/emote/visible/dap
key = "dap"
check_restraints = TRUE
emote_message_3p_target = "USER gives daps to TARGET."
emote_message_3p = "USER sadly can't find anybody to give daps to, and daps USER_SELF."
/decl/emote/visible/signal
key = "signal"
check_restraints = TRUE
emote_message_3p = "USER signals."
/decl/emote/visible/signal/check_user(var/atom/user)
return ismob(user)
/decl/emote/visible/bounce
key = "bounce"
emote_message_3p = "USER bounces in place."
/decl/emote/visible/jiggle
key = "jiggle"
emote_message_3p = "USER jiggles!"
/decl/emote/visible/lightup
key = "light"
emote_message_3p = "USER lights up for a bit, then stops."
/decl/emote/visible/vibrate
key = "vibrate"
emote_message_3p = "USER vibrates!"
/decl/emote/visible/deathgasp_robot
key = "deathgasp"
emote_message_3p = "USER shudders violently for a moment, then becomes motionless, USER_THEIR eyes slowly darkening."
/decl/emote/visible/handshake
key = "handshake"
check_restraints = TRUE
emote_message_3p_target = "USER shakes hands with TARGET."
emote_message_3p = "USER shakes hands with USER_SELF."
message_type = VISIBLE_MESSAGE
/decl/emote/visible/handshake/get_emote_message_3p(var/atom/user, var/atom/target, var/extra_params)
if(target && !user.Adjacent(target))
return "USER holds out USER_THEIR hand out to TARGET."
return ..()
/decl/emote/visible/signal
key = "signal"
emote_message_3p_target = "USER signals at TARGET."
emote_message_3p = "USER signals."
message_type = VISIBLE_MESSAGE
/decl/emote/visible/signal/get_emote_message_3p(var/mob/user, var/atom/target, var/extra_params)
if(istype(user) && !(user.r_hand && user.l_hand))
var/t1 = round(text2num(extra_params))
if(isnum(t1) && t1 <= 5)
return "USER raises [t1] finger\s."
return .. ()
/decl/emote/visible/afold
key = "afold"
check_restraints = TRUE
emote_message_3p = "USER folds USER_THEIR arms."
/decl/emote/visible/alook
key = "alook"
emote_message_3p = "USER looks away."
/decl/emote/visible/hbow
key = "hbow"
emote_message_3p = "USER bows USER_THEIR head."
/decl/emote/visible/hip
key = "hip"
check_restraints = TRUE
emote_message_3p = "USER puts USER_THEIR hands on USER_THEIR hips."
/decl/emote/visible/holdup
key = "holdup"
check_restraints = TRUE
emote_message_3p = "USER holds up USER_THEIR palms."
/decl/emote/visible/hshrug
key = "hshrug"
emote_message_3p = "USER gives a half shrug."
/decl/emote/visible/crub
key = "crub"
check_restraints = TRUE
emote_message_3p = "USER rubs USER_THEIR chin."
/decl/emote/visible/eroll
key = "eroll"
emote_message_3p = "USER rolls USER_THEIR eyes."
emote_message_3p_target = "USER rolls USER_THEIR eyes at TARGET."
/decl/emote/visible/erub
key = "erub"
check_restraints = TRUE
emote_message_3p = "USER rubs USER_THEIR eyes."
/decl/emote/visible/fslap
key = "fslap"
check_restraints = TRUE
emote_message_3p = "USER slaps USER_THEIR forehead."
/decl/emote/visible/ftap
key = "ftap"
emote_message_3p = "USER taps USER_THEIR foot."
/decl/emote/visible/hrub
key = "hrub"
check_restraints = TRUE
emote_message_3p = "USER rubs USER_THEIR hands together."
/decl/emote/visible/hspread
key = "hspread"
check_restraints = TRUE
emote_message_3p = "USER spreads USER_THEIR hands."
/decl/emote/visible/pocket
key = "pocket"
check_restraints = TRUE
emote_message_3p = "USER shoves USER_THEIR hands in USER_THEIR pockets."
/decl/emote/visible/rsalute
key = "rsalute"
check_restraints = TRUE
emote_message_3p = "USER returns the salute."
/decl/emote/visible/rshoulder
key = "rshoulder"
emote_message_3p = "USER rolls USER_THEIR shoulders."
/decl/emote/visible/squint
key = "squint"
emote_message_3p = "USER squints."
emote_message_3p_target = "USER squints at TARGET."
/decl/emote/visible/tfist
key = "tfist"
emote_message_3p = "USER tightens USER_THEIR hands into fists."
/decl/emote/visible/tilt
key = "tilt"
emote_message_3p = "USER tilts USER_THEIR head."
+105
View File
@@ -0,0 +1,105 @@
// Note about emote messages:
// - USER / TARGET will be replaced with the relevant name, in bold.
// - USER_THEM / TARGET_THEM / USER_THEIR / TARGET_THEIR will be replaced with a
// gender-appropriate version of the same.
// - Impaired messages do not do any substitutions.
/decl/emote
var/key // Command to use emote ie. '*[key]'
var/emote_message_1p // First person message ('You do a flip!')
var/emote_message_3p // Third person message ('Urist McShitter does a flip!')
var/emote_message_impaired // Deaf/blind message ('You hear someone flipping out.', 'You see someone opening and closing their mouth')
var/emote_message_1p_target // 'You do a flip at Urist McTarget!'
var/emote_message_3p_target // 'Urist McShitter does a flip at Urist McTarget!'
var/message_type = VISIBLE_MESSAGE // Audible/visual flag
var/targetted_emote // Whether or not this emote needs a target.
var/check_restraints // Can this emote be used while restrained?
var/conscious = 1 // Do we need to be awake to emote this?
var/emote_range = 0 // If >0, restricts emote visibility to viewers within range.
/decl/emote/proc/get_emote_message_1p(var/atom/user, var/atom/target, var/extra_params)
if(target)
return emote_message_1p_target
return emote_message_1p
/decl/emote/proc/get_emote_message_3p(var/atom/user, var/atom/target, var/extra_params)
if(target)
return emote_message_3p_target
return emote_message_3p
/decl/emote/proc/do_emote(var/atom/user, var/extra_params)
if(ismob(user) && check_restraints)
var/mob/M = user
if(M.restrained())
to_chat(user, "<span class='warning'>You are restrained and cannot do that.</span>")
return
var/atom/target
if(can_target() && extra_params)
extra_params = lowertext(extra_params)
for(var/atom/thing in view(user))
if(extra_params == lowertext(thing.name))
target = thing
break
var/datum/gender/user_gender = gender_datums[user.gender]
var/datum/gender/target_gender
if(target)
target_gender = gender_datums[target.gender]
var/use_3p
var/use_1p
if(emote_message_1p)
if(target && emote_message_1p_target)
use_1p = get_emote_message_1p(user, target, extra_params)
use_1p = replacetext(use_1p, "TARGET_THEM", target_gender.him)
use_1p = replacetext(use_1p, "TARGET_THEIR", target_gender.his)
use_1p = replacetext(use_1p, "TARGET_SELF", target_gender.self)
use_1p = replacetext(use_1p, "TARGET", "<b>\the [target]</b>")
else
use_1p = get_emote_message_1p(user, null, extra_params)
use_1p = capitalize(use_1p)
if(emote_message_3p)
if(target && emote_message_3p_target)
use_3p = get_emote_message_3p(user, target, extra_params)
use_3p = replacetext(use_3p, "TARGET_THEM", target_gender.him)
use_3p = replacetext(use_3p, "TARGET_THEIR", target_gender.his)
use_3p = replacetext(use_3p, "TARGET_SELF", target_gender.self)
use_3p = replacetext(use_3p, "TARGET", "<b>\the [target]</b>")
else
use_3p = get_emote_message_3p(user, null, extra_params)
use_3p = replacetext(use_3p, "USER_THEM", user_gender.him)
use_3p = replacetext(use_3p, "USER_THEIR", user_gender.his)
use_3p = replacetext(use_3p, "USER_SELF", user_gender.self)
use_3p = replacetext(use_3p, "USER", "<b>\the [user]</b>")
use_3p = capitalize(use_3p)
var/use_range = emote_range
if (!use_range)
use_range = world.view
if(ismob(user))
var/mob/M = user
if(message_type == AUDIBLE_MESSAGE)
M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range)
else
M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range)
do_extra(user, target)
/decl/emote/proc/do_extra(var/atom/user, var/atom/target)
return
/decl/emote/proc/check_user(var/atom/user)
return TRUE
/decl/emote/proc/can_target()
return (emote_message_1p_target || emote_message_3p_target)
/decl/emote/dd_SortValue()
return key
+167
View File
@@ -0,0 +1,167 @@
/mob/proc/can_emote(var/emote_type)
return (stat == CONSCIOUS)
/mob/living/can_emote(var/emote_type)
return (..() && !(silent && emote_type == AUDIBLE_MESSAGE))
/mob/proc/emote(var/act, var/m_type, var/message)
// s-s-snowflake
if(src.stat == DEAD && act != "deathgasp")
return
if(usr == src) //client-called emote
if (client && (client.prefs.muted & MUTE_IC))
to_chat(src, "<span class='warning'>You cannot send IC messages (muted).</span>")
return
if(act == "help")
to_chat(src,"<b>Usable emotes:</b> [english_list(usable_emotes)]")
return
if(!can_emote(m_type))
to_chat(src, "<span class='warning'>You cannot currently [m_type == AUDIBLE_MESSAGE ? "audibly" : "visually"] emote!</span>")
return
if(act == "me")
return custom_emote(m_type, message)
if(act == "custom")
if(!message)
message = sanitize(input("Enter an emote to display.") as text|null)
if(!message)
return
if (!m_type)
if(alert(src, "Is this an audible emote?", "Emote", "Yes", "No") == "No")
m_type = VISIBLE_MESSAGE
else
m_type = AUDIBLE_MESSAGE
return custom_emote(m_type, message)
var/splitpoint = findtext(act, " ")
if(splitpoint > 0)
var/tempstr = act
act = copytext(tempstr,1,splitpoint)
message = copytext(tempstr,splitpoint+1,0)
var/decl/emote/use_emote = usable_emotes[act]
if(!use_emote)
to_chat(src, "<span class='warning'>Unknown emote '[act]'. Type <b>say *help</b> for a list of usable emotes.</span>")
return
if(m_type != use_emote.message_type && use_emote.conscious && stat != CONSCIOUS)
return
if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled())
audible_message("<b>\The [src]</b> makes a muffled sound.")
return
else
use_emote.do_emote(src, message)
for (var/obj/item/implant/I in src)
if (I.implanted)
I.trigger(act, src)
/mob/proc/format_emote(var/emoter = null, var/message = null)
var/pretext
var/subtext
var/nametext
var/end_char
var/start_char
var/name_anchor
var/anchor_char = "!"
if(!message || !emoter)
return
message = html_decode(message)
name_anchor = findtext(message, anchor_char)
if(name_anchor > 0) // User supplied emote with visible_emote token (default ^)
pretext = copytext(message, 1, name_anchor)
subtext = copytext(message, name_anchor + 1, length(message) + 1)
else
// No token. Just the emote as usual.
subtext = message
// Oh shit, we got this far! Let's see... did the user attempt to use more than one token?
if(findtext(subtext, anchor_char))
// abort abort!
to_chat(emoter, "<span class='warning'>You may use only one \"[anchor_char]\" symbol in your emote.</span>")
return
if(pretext)
// Add a space at the end if we didn't already supply one.
end_char = copytext(pretext, length(pretext), length(pretext) + 1)
if(end_char != " ")
pretext += " "
// Grab the last character of the emote message.
end_char = copytext(subtext, length(subtext), length(subtext) + 1)
if(!(end_char in list(".", "?", "!", "\"", "-", "~"))) // gotta include ~ for all you fucking weebs
// No punctuation supplied. Tack a period on the end.
subtext += "."
// Add a space to the subtext, unless it begins with an apostrophe or comma.
if(subtext != ".")
// First, let's get rid of any existing space, to account for sloppy emoters ("X, ^ , Y")
subtext = trim_left(subtext)
start_char = copytext(subtext, 1, 2)
if(start_char != "," && start_char != "'")
subtext = " " + subtext
pretext = capitalize(html_encode(pretext))
nametext = html_encode(nametext)
subtext = html_encode(subtext)
// Store the player's name in a nice bold, naturalement
nametext = "<B>[emoter]</B>"
return pretext + nametext + subtext
/mob/proc/custom_emote(var/m_type = VISIBLE_MESSAGE, var/message = null)
if((usr && stat) || (!use_me && usr == src))
to_chat(src, "You are unable to emote.")
return
var/input
if(!message)
input = sanitize(input(src,"Choose an emote to display.") as text|null)
else
input = message
if(input)
message = format_emote(src, message)
else
return
if (message)
log_emote("[name]/[key] : [message]")
if(m_type == VISIBLE_MESSAGE)
visible_message(message)
else
audible_message(message)
// Specific mob type exceptions below.
/mob/living/silicon/ai/emote(var/act, var/type, var/message)
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.masters[src]) //Is the AI using a holopad?
src.holopad_emote(message)
else //Emote normally, then.
..()
/mob/living/captive_brain/emote(var/message)
return
/mob/abstract/observer/emote(var/act, var/type, var/message)
if(!message)
return
if(act != "me")
return
log_emote("Ghost/[src.key] : [message]",ckey=key_name(src))
if(src.client)
if(src.client.prefs.muted & (MUTE_DEADCHAT|MUTE_IC))
to_chat(src, "<span class='warning'>You cannot emote in deadchat (muted).</span>")
return
. = src.emote_dead(message)