Datumized Emotes (#17544)

* Add raw tg emote datums

* Some more initial implementation

* First (big) commit

* More reworks, most emotes seem to work but cooldowns are weird

* Add the remaining emote species

* Add simple mobs

* Update defines, add more comments

* Remove unnecessary intentional calls

* Fix some bugs, add more functionality
- Silicon mobs/bots can't use all the living emotes
- Sound volume can now be specified for emotes
- Added a define for emotes to not go thru runechat
- Reorganized some emotes
- Some human emotes that need breath will gasp
- IPCs can beep boop
- Restore power warn for robits
- Sneezing and coughing have sound effects

* Fixes emote species separation not working in *help

* Reorganize emotes based on what's available on paradise

* mouthful mode

* Update implants to use emote signals

* Update species whitelist to use a typecache

* Cleanups

* More small changes
- Remove old extraneous typecache
- Reconfigure drask emotes
- Make all mime emotes visible (since they're silent)

* Remove old emote functions

* Update emote sounds, volume

* Rework more emotes into EMOTE_VISIBLE

* *rumble*

* More slight testing and cleanup
- Drop audio emote cooldown from 10 to 5 seconds
- Change clapping behaivor slightly, putting it into run_emote
- Update some emote flags here and there
- Fix up johnny, though remind me why this one exists?

* Fix indentation, missing typecast

* fix some returns

* More review

* Rename emote files

* Add'l review

* Even more emote fixes!

- Move defines out into an emote define file
- Integrate audio and general emote cooldowns
- change some 1 and 2 into visible/audible
- Try to fix monkey screech

* Add ability for admins to mute users' emotes.

* Rename cooldowns, add general mob emote cooldown.

* Fix flip not always geting the right message

* Add some emote target handling, docs

* Fix admin rights, indentation

* Update emote.dm

set default mode to ANY

* General implant fixes

- The way implant triggers are handled is now improved, with separate checks for death and emotes instead of just checking deathgasp.
- Implants can choose to be triggered for the first death or for every death.
- Voice of God play dead now activates sad trombone

read: voice of god can now no longer lowtiergod nukies

* Bunch of other changes and bugfixes

- Adds number flag for behavior
- Reworks how muzzling/vocalizing emotes works
- Breaks out sound effects
- Drops cooldown to 1.5s

* Fix people being able to snore/nightmare while awake.

* Bump paralysis on living emotes

* First review pass

* Clean up implants (while we're here) and fix compile errors

* in living error

* More outstanding review fixes

* use more isx() checks

* Add pre-emote signal, try_run_emote()

* Prevent silicons from playing their deathgasp multiple times

* Add emote postfix behavior for adding parameters to non-message params.

Also adds a signal to intercept emote actions.

* Fix linter complaints

* Remove new player checks on GLOB.dead_mob_list

* Fix species emotes not being distinguished, remove weird legacy code

* monkey ball

* better docs == better code

* Fix audio cooldown, silicon emotes

* Fix ghost emotes (don't worry they're staying)

* Restore spin to 2 seconds

* oh johnny boy

* Make fainting last two seconds instead of .2 seconds

* Remove extra highfive message

* Tick friendly emotes

* Fix up friendly emotes, ghost emotes

* Add some emote message safeguards, prevent flip from showing twice

* Fix ghost vision message format

* Fix hands_use_check on non-carbon mobs

* Bring emotes in line with say re. oxyloss

* Add option for death implants to not trigger on gib

* Try adding some unit testing

* Include emote unit tests

* More attempts at unit testing

* More attempts at unit testing?

* forget it this is fine

* Housekeeping

* Little bit more

* Remove extra bolding from ghostsight emotes

* More sanity checks, fix snore

* Remove stack trace when unintentional emote fails

* Update code/modules/mob/living/silicon/silicon_emote.dm

oops

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* More implant cleanups

* Oh I missed this

* Silence wagging, more review fixes

* Oops 2

* ensure everything can swear

* High-five fixes and status effect stuff
- Adds new on_timeout() function that gets triggered when a status effect expires
- Fixes up passing arguments to status effects
- Ensures high-five explosions don't kill the wizards

* More review stuff
- Add a stat to text to make things easier
- Make it harder to delete emotes
- BIG DANGER
- pose can no longer be set while unconscious

* Remove extra high five logic, godmode changes

* forgor

* Fix gasp not working

* Update docs for good measure

* Some review and custom emote fixes

* Fixes death alarms being broken

* Better handle stat_allowed, more review comments.

* ..() conventions

* This is why unit tests are nice

* Remove drone snowflake emote stuff

* Linting

* No more flipping on the ground

* Snap doesn't require hands free

* Does it make complete sense? no, but it's Fun

* Apply suggestions from code review

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* Fix revenant messages, power warning

* epic webedit fail, laugh at this user

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
Luc
2022-06-14 23:06:24 +01:00
committed by GitHub
co-authored by AffectedArc07
parent 9dc65f5cf0
commit 747d8111ca
82 changed files with 3035 additions and 2331 deletions
+2 -1
View File
@@ -6,7 +6,8 @@
#define MUTE_PRAY 4
#define MUTE_ADMINHELP 8
#define MUTE_DEADCHAT 16
#define MUTE_ALL 31
#define MUTE_EMOTE 32
#define MUTE_ALL 63
//Number of identical messages required to get the spam-prevention automute thing to trigger warnings and automutes
#define SPAM_TRIGGER_WARNING 5
+20 -1
View File
@@ -335,12 +335,31 @@
///from /mob/say_dead(): (mob/speaker, message)
#define COMSIG_MOB_DEADSAY "mob_deadsay"
#define MOB_DEADSAY_SIGNAL_INTERCEPT (1<<0)
///from /mob/living/emote(): ()
/// Signal fired when an emote is used but before it's executed.
///from /datum/emote/proc/try_run_emote(): (key, intentional)
#define COMSIG_MOB_PREEMOTE "mob_preemote"
// Use these to block execution of emotes from components.
/// Return this to block an emote and let the user know the emote is unusable.
#define COMPONENT_BLOCK_EMOTE_UNUSABLE (1<<0)
/// Return this to block an emote silently.
#define COMPONENT_BLOCK_EMOTE_SILENT (1<<1)
/// General signal fired when a mob does any old emote
///from /datum/emote/proc/run_emote(): (key, intentional)
#define COMSIG_MOB_EMOTE "mob_emote"
/// Specific signal used to track when a specific emote is used.
/// From /datum/emote/run_emote(): (P, key, m_type, message, intentional)
#define COMSIG_MOB_EMOTED(emote_key) "mob_emoted_[emote_key]"
/// From /datum/emote/select_param(): (target, key, intentional)
#define COMSIG_MOB_EMOTE_AT "mob_emote_at"
#define COMPONENT_BLOCK_EMOTE_ACTION (1<<2)
///from base of mob/swap_hand(): (obj/item)
#define COMSIG_MOB_SWAP_HANDS "mob_swap_hands"
#define COMPONENT_BLOCK_SWAP (1<<0)
// /mob/living signals
///from base of mob/living/resist() (/mob/living)
+73
View File
@@ -0,0 +1,73 @@
/**
* General defines used for emotes
*/
// Emote types.
// These determine how the emote is treated when not directly visible (or audible).
// These are also used in some cases for visible/audible messages.
/// Emote is visible. These emotes will be runechatted.
#define EMOTE_VISIBLE (1<<0)
/// Emote is audible (in character).
#define EMOTE_AUDIBLE (1<<1)
/// Emote makes a sound. These emotes will specifically not be runechatted.
#define EMOTE_SOUND (1<<2)
/// Regardless of its existing flags, an emote with this flag will not be sent to runechat.
#define EMOTE_FORCE_NO_RUNECHAT (1<<3)
/// This emote uses the mouth, and so should be blocked if the user is muzzled or can't breathe (for humans).
#define EMOTE_MOUTH (1<<4)
// User audio cooldown system.
// This is a value stored on the user and represents their current ability to perform audio emotes.
/// The user is not on emote cooldown, and is ready to emote whenever.
#define EMOTE_READY 0
/// The user can spam emotes to their heart's content.
#define EMOTE_INFINITE 1
/// The user cannot emote as they have been blocked by an admin.
#define EMOTE_ADMIN_BLOCKED 2
/// The user cannot emote until their cooldown expires.
#define EMOTE_ON_COOLDOWN 3
/// Marker to separate an emote key from its parameters in user input.
#define EMOTE_PARAM_SEPARATOR "-"
/// Default cooldown for normal (non-audio) emotes.
#define DEFAULT_EMOTE_COOLDOWN (1.5 SECONDS)
// Each mob can only play an emote with audio every AUDIO_EMOTE_COOLDOWN seconds, unless a given emote overrides its own audio cooldown.
/// Default cooldown for audio that comes from emotes.
#define AUDIO_EMOTE_COOLDOWN (5 SECONDS)
// Emote parameter types
// If nothing is passed in for a target, this can determine the possible target.
// Our emote code will search around the user to find a matching target to use, based on the second set of defines.
// This first set of defines denotes the behavior if a match can't be found.
/// If this is set and a valid target is not found, the emote will not execute.
#define EMOTE_TARGET_BHVR_MUST_MATCH 1
/// If this is set and a valid target is not found, the emote will just ignore the parameter entirely.
#define EMOTE_TARGET_BHVR_DEFAULT_TO_BASE 2
/// If this is set and a valid target is not found, the emote will work with the params that it has.
#define EMOTE_TARGET_BHVR_USE_PARAMS_ANYWAY 3
/// No matching/processing will be performed, and the target will be purely what's passed in.
#define EMOTE_TARGET_BHVR_RAW 4
/// The emote target should be just a number. Anything else will be rejected.
#define EMOTE_TARGET_BHVR_NUM 5
// This set determines the type of target that we want to check for.
/// The target will check all nearby living mobs.
#define EMOTE_TARGET_MOB (1<<0)
/// The target will check all objects nearby.
#define EMOTE_TARGET_OBJ (1<<1)
/// The target will check nearby mobs and objects.
#define EMOTE_TARGET_ANY (EMOTE_TARGET_MOB | EMOTE_TARGET_OBJ)
/// If passed as message_param, will default to using the message's postfix.
#define EMOTE_PARAM_USE_POSTFIX 1
/// If returned from act_on_target(), emote execution will stop.
#define EMOTE_ACT_STOP_EXECUTION 1
-3
View File
@@ -191,9 +191,6 @@
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
#define EYE_SHINE_THRESHOLD 6 //dark_view threshold past which a humanoid's eyes will 'shine' in the dark.
#define EMOTE_VISUAL 1 //A mob emote is visual
#define EMOTE_SOUND 2 //A mob emote is sound
#define STATUS_UPDATE_HEALTH 1
#define STATUS_UPDATE_STAT 2
#define STATUS_UPDATE_STAMINA 8