forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from Kaostico/verbs-module
Verbs module: Do, LOOC, Subtle and more!
- Loading branch information
Showing
44 changed files
with
825 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define MUTE_LOOC (1<<6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define BAN_LOOC "LOOC" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#define COMSIG_KB_LIVING_COMBAT_INDICATOR "keybinding_living_combat_indicator" | ||
#define COMSIG_KB_MOB_PIXEL_SHIFT_DOWN "keybinding_mob_pixel_shift_down" | ||
#define COMSIG_KB_MOB_PIXEL_SHIFT_UP "keybinding_mob_pixel_shift_up" | ||
#define COMSIG_KB_CLIENT_LOOC_DOWN "keybinding_client_looc_down" | ||
#define COMSIG_KB_CLIENT_WHISPER_DOWN "keybinding_client_whisper_down" | ||
#define COMSIG_KB_CLIENT_DO_DOWN "keybinding_client_do_down" | ||
#define COMSIG_KB_CLIENT_DO_LONGER_DOWN "keybinding_client_do_longer_down" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Logging types for log_message() | ||
#define LOG_SUBTLE (1 << 23) | ||
|
||
//Individual logging panel pages | ||
#undef INDIVIDUAL_EMOTE_LOG | ||
#define INDIVIDUAL_EMOTE_LOG (LOG_EMOTE | LOG_SUBTLE) | ||
#undef INDIVIDUAL_SHOW_ALL_LOG | ||
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_SUBTLE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_SHUTTLE | LOG_ECON) | ||
|
||
// Game categories | ||
#define LOG_CATEGORY_GAME_SUBTLE "game-subtle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define LOOC_RANGE 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define LOOC_CHANNEL "LOOC" // LOOC | ||
#define WHIS_CHANNEL "Whis" // Whisper | ||
#define DO_CHANNEL "Do" // Do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Returns a boolean based on whether or not the string contains a comma or an apostrophe, | ||
* to be used for emotes to decide whether or not to have a space between the name of the user | ||
* and the emote. | ||
* | ||
* Requires the message to be HTML decoded beforehand. Not doing it here for performance reasons. | ||
* | ||
* Returns TRUE if there should be a space, FALSE if there shouldn't. | ||
*/ | ||
/proc/should_have_space_before_emote(string) | ||
var/static/regex/no_spacing_emote_characters = regex(@"(,|')") | ||
return no_spacing_emote_characters.Find(string) ? FALSE : TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// This logs subtle emotes in game.log | ||
/proc/log_subtle(text, list/data) | ||
logger.Log(LOG_CATEGORY_GAME_SUBTLE, text, data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** Get all hearers in range, ignores walls and such. Code stolen from `/proc/get_hearers_in_view()` | ||
* Much faster and less expensive than range() | ||
*/ | ||
/proc/get_hearers_in_looc_range(atom/source, range_radius = LOOC_RANGE) | ||
var/turf/center_turf = get_turf(source) | ||
if(!center_turf) | ||
return | ||
|
||
. = list() | ||
var/old_luminosity = center_turf.luminosity | ||
if(range_radius <= 0) //special case for if only source cares | ||
for(var/atom/movable/target as anything in center_turf) | ||
var/list/recursive_contents = target.important_recursive_contents?[RECURSIVE_CONTENTS_HEARING_SENSITIVE] | ||
if(recursive_contents) | ||
. += recursive_contents | ||
return . | ||
|
||
var/list/hearables_from_grid = SSspatial_grid.orthogonal_range_search(source, RECURSIVE_CONTENTS_HEARING_SENSITIVE, range_radius) | ||
|
||
if(!length(hearables_from_grid))//we know that something is returned by the grid, but we dont know if we need to actually filter down the output | ||
return . | ||
|
||
var/list/assigned_oranges_ears = SSspatial_grid.assign_oranges_ears(hearables_from_grid) | ||
|
||
for(var/mob/oranges_ear/ear in range(range_radius, center_turf)) | ||
. += ear.references | ||
|
||
for(var/mob/oranges_ear/remaining_ear as anything in assigned_oranges_ears) //we need to clean up our mess | ||
remaining_ear.unassign() | ||
|
||
center_turf.luminosity = old_luminosity | ||
return . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// LOOC Module | ||
GLOBAL_VAR_INIT(looc_allowed, TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/datum/preference/toggle/admin | ||
abstract_type = /datum/preference/toggle/admin | ||
|
||
/datum/preference/toggle/admin/is_accessible(datum/preferences/preferences) | ||
if (!..(preferences)) | ||
return FALSE | ||
|
||
return is_admin(preferences.parent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
GLOBAL_LIST_EMPTY(hologram_impersonators) | ||
|
||
/obj/machinery/holopad/set_holo(mob/living/user, obj/effect/overlay/holo_pad_hologram/holo) | ||
if(holo.Impersonation) | ||
GLOB.hologram_impersonators[user] = holo | ||
holo.become_hearing_sensitive() // Well, we need to show up on "get_hearers_in_view()" | ||
. = ..() | ||
|
||
/obj/machinery/holopad/clear_holo(mob/living/user) | ||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user] | ||
if(hologram) | ||
hologram.lose_hearing_sensitivity() | ||
GLOB.hologram_impersonators -= user | ||
. = ..() |
Oops, something went wrong.