Keybindable emotes followup (#47868)

Keybindable emotes followup
This commit is contained in:
Emmett Gaines
2019-11-20 00:54:30 +00:00
committed by Rob Bailey
parent eb4a43cab5
commit 53952e7622
7 changed files with 50 additions and 9 deletions

View File

@@ -153,7 +153,7 @@
return FALSE
/mob/living/split_personality/emote(act, m_type = null, message = null, intentional = FALSE)
return
return FALSE
///////////////BRAINWASHING////////////////////

View File

@@ -23,6 +23,7 @@
var/sound //Sound to play when emote is called
var/vary = FALSE //used for the honk borg emote
var/only_forced_audio = FALSE //can only code call this event instead of the player.
var/cooldown = 0.8 SECONDS
/datum/emote/New()
if (ispath(mob_type_allowed_typecache))
@@ -75,6 +76,17 @@
else
user.visible_message(msg)
/// For handling emote cooldown, return true to allow the emote to happen
/datum/emote/proc/check_cooldown(mob/user, intentional)
if(!intentional)
return TRUE
if(user.emotes_used && user.emotes_used[src] + cooldown > world.time)
return FALSE
if(!user.emotes_used)
user.emotes_used = list()
user.emotes_used[src] = world.time
return TRUE
/datum/emote/proc/get_sound(mob/living/user)
return sound //by default just return this var.

View File

@@ -12,4 +12,4 @@
/datum/keybinding/emote/down(client/user)
. = ..()
user.mob.emote(emote_key)
return user.mob.emote(emote_key, intentional=TRUE)