-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into tac-refactor
- Loading branch information
Showing
169 changed files
with
2,305 additions
and
847 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,13 @@ | ||
#undef ASSERT | ||
|
||
/// Override BYOND's native ASSERT to optionally specify a message | ||
#define ASSERT(condition, message...) \ | ||
if (!(condition)) { \ | ||
CRASH(assertion_message(__FILE__, __LINE__, #condition, ##message)) \ | ||
} | ||
|
||
/proc/assertion_message(file, line, condition, message) | ||
if (!isnull(message)) | ||
message = " - [message]" | ||
|
||
return "[file]:[line]:Assertion failed: [condition][message]" |
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,26 @@ | ||
/// (charge_amount) | ||
#define COMSIG_CELL_USE_CHARGE "cell_use_charge" | ||
#define COMPONENT_CELL_NO_USE_CHARGE (1<<0) | ||
|
||
/// (charge_amount) | ||
#define COMSIG_CELL_ADD_CHARGE "cell_add_charge" | ||
|
||
#define COMSIG_CELL_START_TICK_DRAIN "cell_start_tick_drain" | ||
|
||
#define COMSIG_CELL_STOP_TICK_DRAIN "cell_stop_tick_drain" | ||
|
||
/// (mob/living/user) | ||
#define COMSIG_CELL_TRY_RECHARGING "cell_try_recharging" | ||
#define COMPONENT_CELL_NO_RECHARGE (1<<0) | ||
|
||
#define COMSIG_CELL_OUT_OF_CHARGE "cell_out_of_charge" | ||
|
||
/// (charge_amount) | ||
#define COMSIG_CELL_CHECK_CHARGE "cell_check_charge" | ||
#define COMPONENT_CELL_CHARGE_INSUFFICIENT (1<<0) | ||
|
||
#define COMSIG_CELL_TRY_INSERT_CELL "cell_try_insert_cell" | ||
#define COMPONENT_CANCEL_CELL_INSERT (1<<0) | ||
|
||
/// (mob/living/user) | ||
#define COMSIG_CELL_REMOVE_CELL "cell_remove_cell" |
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,43 @@ | ||
#define TRAIT_CALLBACK_ADD(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitAdd), ##target, ##trait, ##source) | ||
#define TRAIT_CALLBACK_REMOVE(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitRemove), ##target, ##trait, ##source) | ||
|
||
///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. | ||
/proc/___TraitAdd(target,trait,source) | ||
if(!target || !trait || !source) | ||
return | ||
if(islist(target)) | ||
for(var/i in target) | ||
if(!isatom(i)) | ||
continue | ||
var/atom/the_atom = i | ||
ADD_TRAIT(the_atom,trait,source) | ||
else if(isatom(target)) | ||
var/atom/the_atom2 = target | ||
ADD_TRAIT(the_atom2,trait,source) | ||
|
||
///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. | ||
/proc/___TraitRemove(target,trait,source) | ||
if(!target || !trait || !source) | ||
return | ||
if(islist(target)) | ||
for(var/i in target) | ||
if(!isatom(i)) | ||
continue | ||
var/atom/the_atom = i | ||
REMOVE_TRAIT(the_atom,trait,source) | ||
else if(isatom(target)) | ||
var/atom/the_atom2 = target | ||
REMOVE_TRAIT(the_atom2,trait,source) | ||
|
||
|
||
/// Proc that handles adding multiple traits to a target via a list. Must have a common source and target. | ||
/datum/proc/add_traits(list/list_of_traits, source) | ||
ASSERT(islist(list_of_traits), "Invalid arguments passed to add_traits! Invoked on [src] with [list_of_traits], source being [source].") | ||
for(var/trait in list_of_traits) | ||
ADD_TRAIT(src, trait, source) | ||
|
||
/// Proc that handles removing multiple traits from a target via a list. Must have a common source and target. | ||
/datum/proc/remove_traits(list/list_of_traits, source) | ||
ASSERT(islist(list_of_traits), "Invalid arguments passed to remove_traits! Invoked on [src] with [list_of_traits], source being [source].") | ||
for(var/trait in list_of_traits) | ||
REMOVE_TRAIT(src, trait, source) |
Oops, something went wrong.