Semi-port jump emote from TG. (#30072)

* jump emote

* ci pass

* better code
This commit is contained in:
Contrabang
2025-08-19 13:33:59 +00:00
committed by GitHub
parent 1c6dbb6fa7
commit 4ff7e00979
4 changed files with 49 additions and 10 deletions
+1 -1
View File
@@ -76,7 +76,7 @@
#define EMOTE_ACT_STOP_EXECUTION 1
/// List of emotes useable by ghosties
#define USABLE_DEAD_EMOTES list("*flip", "*spin")
#define USABLE_DEAD_EMOTES list("*flip", "*spin", "*jump")
// Strings used for the rock paper scissors emote and status effect
#define RPS_EMOTE_ROCK "rock"
+4 -4
View File
@@ -17,6 +17,10 @@
linked_emote = /datum/emote/spin
name = "Spin"
/datum/keybinding/emote/jump
linked_emote = /datum/emote/jump
name = "Jump"
/datum/keybinding/emote/blush
linked_emote = /datum/emote/living/blush
name = "Blush"
@@ -41,10 +45,6 @@
linked_emote = /datum/emote/living/dance
name = "Dance"
/datum/keybinding/emote/jump
linked_emote = /datum/emote/living/jump
name = "Jump"
/datum/keybinding/emote/deathgasp
linked_emote = /datum/emote/living/deathgasp
name = "Deathgasp"
-5
View File
@@ -56,11 +56,6 @@
key_third_person = "dances"
message = "dances around happily."
/datum/emote/living/jump
key = "jump"
key_third_person = "jumps"
message = "jumps!"
/datum/emote/living/deathgasp
key = "deathgasp"
key_third_person = "deathgasps"
+44
View File
@@ -200,3 +200,47 @@
if(istype(L))
L.Dizzy(24 SECONDS)
L.Confused(24 SECONDS)
/datum/emote/jump
key = "jump"
key_third_person = "jumps"
message = "jumps!"
emote_type = EMOTE_VISIBLE | EMOTE_FORCE_NO_RUNECHAT
mob_type_allowed_typecache = list(/mob/living, /mob/dead/observer)
mob_type_blacklist_typecache = list(/mob/living/brain, /mob/camera, /mob/living/silicon/ai)
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
cooldown = 0.25 SECONDS // bhop until you're stamina-less if you want lmao
audio_cooldown = 0.25 SECONDS
/datum/emote/jump/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE
jump_animation(user)
if(isliving(user))
var/mob/living/L = user
L.adjustStaminaLoss(30)
/datum/emote/jump/proc/jump_animation(mob/user)
var/original_transform = user.transform
animate(user, transform = user.transform.Translate(0, 8), time = 0.15 SECONDS, flags = ANIMATION_PARALLEL, easing = QUAD_EASING|EASE_OUT)
animate(transform = original_transform, time = 0.15 SECONDS, easing = QUAD_EASING|EASE_IN)
/datum/emote/jump/get_sound(mob/user)
return 'sound/weapons/thudswoosh.ogg'
// Avoids playing sounds if we're a ghost
/datum/emote/jump/should_play_sound(mob/user, intentional)
if(isliving(user))
return ..()
return FALSE
/datum/emote/jump/can_run_emote(mob/user, status_check, intentional)
if(user.buckled || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !isturf(user.loc))
return FALSE
if(isliving(user))
var/mob/living/L = user
if(IS_HORIZONTAL(L))
return FALSE
return ..()