Unknown
2021-05-22 16:02:13 -04:00
parent 45e710fa51
commit 21d5da0f1b
25 changed files with 80 additions and 76 deletions
-16
View File
@@ -24,19 +24,3 @@ var/list/_default_mob_emotes = list(
/decl/emote/audible/moan,
/decl/emote/audible/gnarl,
)
/mob
var/list/usable_emotes
var/nextemote = 1 //VOREStation Add
/mob/proc/update_emotes(var/skip_sort)
usable_emotes = list()
for(var/emote in get_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/proc/get_default_emotes()
return global._default_mob_emotes
+4 -8
View File
@@ -1,11 +1,7 @@
/datum/species
var/list/default_emotes = list()
/mob/living/carbon/update_emotes(var/skip_sort)
. = ..(skip_sort = TRUE)
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)
/mob/living/carbon/get_available_emotes()
. = ..()
if(length(species?.default_emotes))
. |= species.default_emotes
+2 -2
View File
@@ -4,7 +4,7 @@
emote_message_1p = "You are sweating heavily."
emote_message_3p = "is sweating heavily."
/decl/emote/exertion/biological/check_user(mob/living/user)
/decl/emote/exertion/biological/mob_can_use(mob/living/user)
if(istype(user) && !user.isSynthetic())
return ..()
return FALSE
@@ -29,7 +29,7 @@
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)
/decl/emote/exertion/synthetic/mob_can_use(mob/living/user)
if(istype(user) && user.isSynthetic())
return ..()
return FALSE
+2 -8
View File
@@ -1,11 +1,5 @@
/decl/emote/human
key = "vomit"
/decl/emote/human/check_user(var/mob/living/carbon/human/user)
return (istype(user))//VOREStation Edit - What does a mouth have to do with wagging?? && user.check_has_mouth() && !user.isSynthetic())
/decl/emote/human/do_emote(var/mob/living/carbon/human/user)
user.vomit()
/decl/emote/human/mob_can_use(var/mob/living/carbon/human/user)
return ..() && (istype(user))//VOREStation Edit - What does a mouth have to do with wagging?? && user.check_has_mouth() && !user.isSynthetic())
/decl/emote/human/deathgasp
key = "deathgasp"
+2 -2
View File
@@ -8,8 +8,8 @@
user.mood = mood
user.update_icon()
/decl/emote/slime/check_user(var/atom/user)
return isslime(user)
/decl/emote/slime/mob_can_use(var/atom/user)
return ..() && isslime(user)
/decl/emote/slime/pout
key = "pout"
@@ -3,7 +3,7 @@
emote_message_3p = "beeps."
emote_sound = 'sound/machines/twobeep.ogg'
/decl/emote/audible/synth/check_user(var/mob/living/user)
/decl/emote/audible/synth/mob_can_use(var/mob/living/user)
if(istype(user) && user.isSynthetic())
return ..()
return FALSE
@@ -34,8 +34,8 @@
emote_message_3p_target = "shows TARGET USER_THEIR legal authorization barcode."
emote_sound = 'sound/voice/biamthelaw.ogg'
/decl/emote/audible/synth/security/check_user(var/mob/living/silicon/robot/user)
return (istype(user) && (istype(user.module, /obj/item/weapon/robot_module/robot/security) || istype(user.module, /obj/item/weapon/robot_module/robot/knine))) //VOREStation Add - knine module
/decl/emote/audible/synth/security/mob_can_use(var/mob/living/silicon/robot/user)
return ..() && (istype(user) && (istype(user.module, /obj/item/weapon/robot_module/robot/security) || istype(user.module, /obj/item/weapon/robot_module/robot/knine))) //VOREStation Add - knine module
/decl/emote/audible/synth/security/halt
key = "halt"
@@ -237,9 +237,6 @@
emote_message_3p = "signals."
check_restraints = TRUE
/decl/emote/visible/signal/check_user(atom/user)
return ismob(user)
/decl/emote/visible/signal/get_emote_message_3p(var/mob/living/user, var/atom/target, var/extra_params)
if(istype(user) && (!user.get_active_hand() || !user.get_inactive_hand()))
var/t1 = round(text2num(extra_params))
@@ -2,6 +2,7 @@
key = "spin"
check_restraints = TRUE
emote_message_3p = "spins!"
emote_delay = 2 SECONDS
/decl/emote/visible/spin/do_extra(mob/user)
if(istype(user))
@@ -11,6 +12,7 @@
key = "sidestep"
check_restraints = TRUE
emote_message_3p = "steps rhythmically and moves side to side."
emote_delay = 1.2 SECONDS
/decl/emote/visible/sidestep/do_extra(mob/user)
if(istype(user))
@@ -24,6 +26,7 @@
emote_message_1p = "You do a flip!"
emote_message_3p = "does a flip!"
emote_sound = 'sound/effects/bodyfall4.ogg'
emote_delay = 1.2 SECONDS
/decl/emote/visible/flip/do_extra(mob/user)
. = ..()
@@ -39,6 +42,7 @@
key = "floorspin"
emote_message_1p = "You spin around on the floor!"
emote_message_3p = "spins around on the floor!"
emote_delay = 1.2 SECONDS
var/static/list/spin_dirs = list(
NORTH,
SOUTH,
+15 -2
View File
@@ -4,6 +4,13 @@
// gender-appropriate version of the same.
// - Impaired messages do not do any substitutions.
var/global/list/emotes_by_key
/proc/get_emote_by_key(var/key)
if(!global.emotes_by_key)
decls_repository.get_decls_of_type(/decl/emote) // emotes_by_key will be updated in emote Initialize()
return global.emotes_by_key[key]
/decl/emote
var/key // Command to use emote ie. '*[key]'
var/emote_message_1p // First person message ('You do a flip!')
@@ -28,6 +35,7 @@
var/list/emote_sound_synthetic // As above, but used when check_synthetic() is true.
var/emote_volume = 50 // Volume of sound to play.
var/emote_volume_synthetic = 50 // As above, but used when check_synthetic() is true.
var/emote_delay = 0 // Time in ds that this emote will block further emote use (spam prevention).
var/message_type = VISIBLE_MESSAGE // Audible/visual flag
var/check_restraints // Can this emote be used while restrained?
@@ -35,6 +43,11 @@
var/conscious = TRUE // Do we need to be awake to emote this?
var/emote_range = 0 // If >0, restricts emote visibility to viewers within range.
/decl/emote/Initialize()
. = ..()
if(key)
LAZYSET(global.emotes_by_key, key, src)
/decl/emote/proc/get_emote_message_1p(var/atom/user, var/atom/target, var/extra_params)
if(target)
if(emote_message_synthetic_1p_target && check_synthetic(user))
@@ -162,8 +175,8 @@
if(sound_to_play)
playsound(user.loc, sound_to_play, use_sound["vol"], 0, preference = /datum/client_preference/emote_noises) //VOREStation Add - Preference
/decl/emote/proc/check_user(var/atom/user)
return TRUE
/decl/emote/proc/mob_can_use(var/mob/user)
return istype(user) && user.stat != DEAD && (type in user.get_available_emotes())
/decl/emote/proc/can_target()
return (emote_message_1p_target || emote_message_3p_target)
+32 -10
View File
@@ -1,11 +1,15 @@
/mob
var/next_emote
var/next_emote_refresh
var/last_emote_summary
/mob/proc/get_available_emotes()
return global._default_mob_emotes
/mob/proc/can_emote(var/emote_type)
//VOREStation Add
if(src.nextemote >= world.time)
return FALSE
src.nextemote = world.time + 12
//VOREStation Add End
return (stat == CONSCIOUS)
#define EMOTE_REFRESH_SPAM_COOLDOWN (5 SECONDS)
/mob/living/can_emote(var/emote_type)
return (..() && !(silent && emote_type == AUDIBLE_MESSAGE))
@@ -20,8 +24,20 @@
to_chat(src, "<span class='warning'>You cannot send IC messages (muted).</span>")
return
if(world.time < next_emote)
to_chat(src, SPAN_WARNING("You cannot use another emote yet."))
return
if(act == "help")
to_chat(src,"<b>Usable emotes:</b> [english_list(usable_emotes)].")
if(world.time >= next_emote_refresh)
var/list/usable_emotes = list()
next_emote_refresh = world.time + EMOTE_REFRESH_SPAM_COOLDOWN
for(var/emote in get_available_emotes())
var/decl/emote/emote_datum = decls_repository.get_decl(emote)
if(emote_datum.mob_can_use(src))
usable_emotes[emote_datum.key] = emote_datum
last_emote_summary = english_list(sortAssoc(usable_emotes))
to_chat(src,"<b>Usable emotes:</b> [last_emote_summary].")
return
if(!can_emote(m_type))
@@ -57,24 +73,30 @@
return nme(message)
//VOREStation Add End
var/decl/emote/use_emote = usable_emotes[act]
if(!use_emote)
var/decl/emote/use_emote = get_emote_by_key(act)
if(!istype(use_emote))
to_chat(src, SPAN_WARNING("Unknown emote '[act]'. Type <b>say *help</b> for a list of usable emotes."))
return
if(!use_emote.mob_can_use(src))
to_chat(src, SPAN_WARNING("You cannot use the emote '[act]'. Type <b>say *help</b> for a list of usable emotes."))
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> [use_emote.emote_message_muffled || "makes a muffled sound."]")
return
else
use_emote.do_emote(src, message)
next_emote = world.time + use_emote.emote_delay
use_emote.do_emote(src, message)
for (var/obj/item/weapon/implant/I in src)
if (I.implanted)
I.trigger(act, src)
#undef EMOTE_REFRESH_SPAM_COOLDOWN
/mob/proc/format_emote(var/emoter = null, var/message = null)
var/pretext
var/subtext