Files
Paradise/code/__DEFINES/emotes.dm
Luc 96aab66dc6 Add cooldown for unintentional emotes (#19078)
* Add cooldown for unintentional emotes

* Oops, let's try that again.
- Adds a separate cooldown system for unintentional emotes.
- Unintentional emotes will fire audio at most once every 2 seconds.
- Emotes like deathgasp can override this out of necessity.
- Scream's is longer because...come on.

* The part that makes the rest of it actualy work
2022-09-25 17:31:26 +01:00

80 lines
3.3 KiB
Plaintext

/**
* 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 emote-emitted audio.
#define AUDIO_EMOTE_COOLDOWN (5 SECONDS)
/// Cooldown for emotes that are emitted unintentionally, to prevent them from getting audibly spammy.
#define AUDIO_EMOTE_UNINTENTIONAL_COOLDOWN (2 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
/// List of emotes useable by ghosties
#define USABLE_DEAD_EMOTES list("*flip", "*spin")