Skip to content

Commit

Permalink
Merge pull request #568 from Gboster-0/emotes
Browse files Browse the repository at this point in the history
[Mirror] animates the *jump, *shiver, *sway, *tremble, *twitch and *twitch_s emotes
  • Loading branch information
dwasint authored Nov 17, 2023
2 parents e1f57d1 + 56e8ec1 commit adb827d
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions code/modules/mob/living/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@
message = "jumps!"
hands_use_check = TRUE

/datum/emote/living/jump/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_y = user.pixel_y + 4, time = 0.1 SECONDS)
animate(pixel_y = user.pixel_y - 4, time = 0.1 SECONDS)

/datum/emote/living/jump/get_sound(mob/living/user)
return 'sound/weapons/thudswoosh.ogg'

/datum/emote/living/kiss
key = "kiss"
key_third_person = "kisses"
Expand Down Expand Up @@ -347,6 +357,18 @@
key_third_person = "shiver"
message = "shivers."

#define SHIVER_LOOP_DURATION (1 SECONDS)
/datum/emote/living/shiver/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_x = user.pixel_x + 1, time = 0.1 SECONDS)
for(var/i in 1 to SHIVER_LOOP_DURATION / (0.2 SECONDS)) //desired total duration divided by the iteration duration to give the necessary iteration count
animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS)
#undef SHIVER_LOOP_DURATION

/datum/emote/living/sigh
key = "sigh"
key_third_person = "sighs"
Expand Down Expand Up @@ -437,6 +459,16 @@
key_third_person = "sways"
message = "sways around dizzily."

/datum/emote/living/sway/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_x = user.pixel_x + 2, time = 0.5 SECONDS)
for(var/i in 1 to 2)
animate(pixel_x = user.pixel_x - 4, time = 1.0 SECONDS)
animate(pixel_x = user.pixel_x + 4, time = 1.0 SECONDS)
animate(pixel_x = user.pixel_x - 2, time = 0.5 SECONDS)

/datum/emote/living/tilt
key = "tilt"
key_third_person = "tilts"
Expand All @@ -447,15 +479,44 @@
key_third_person = "trembles"
message = "trembles in fear!"

#define TREMBLE_LOOP_DURATION (4.4 SECONDS)
/datum/emote/living/tremble/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_x = user.pixel_x + 2, time = 0.2 SECONDS)
for(var/i in 1 to TREMBLE_LOOP_DURATION / (0.4 SECONDS)) //desired total duration divided by the iteration duration to give the necessary iteration count
animate(pixel_x = user.pixel_x - 2, time = 0.2 SECONDS)
animate(pixel_x = user.pixel_x + 2, time = 0.2 SECONDS)
animate(pixel_x = user.pixel_x - 2, time = 0.2 SECONDS)
#undef TREMBLE_LOOP_DURATION

/datum/emote/living/twitch
key = "twitch"
key_third_person = "twitches"
message = "twitches violently."

/datum/emote/living/twitch/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_x = user.pixel_x - 1, time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS)
animate(time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS)

/datum/emote/living/twitch_s
key = "twitch_s"
message = "twitches."

/datum/emote/living/twitch_s/run_emote(mob/living/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
animate(user, pixel_x = user.pixel_x - 1, time = 0.1 SECONDS)
animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS)

/datum/emote/living/wave
key = "wave"
key_third_person = "waves"
Expand Down

0 comments on commit adb827d

Please sign in to comment.