diff --git a/code/modules/mob/_modifiers/aura.dm b/code/modules/mob/_modifiers/aura.dm new file mode 100644 index 0000000000..f72ca67d1a --- /dev/null +++ b/code/modules/mob/_modifiers/aura.dm @@ -0,0 +1,18 @@ +/* +'Aura' modifiers are semi-permanent, in that they do not have a set duration, but will expire if out of range of the 'source' of the aura. +Note: The source is defined as an argument in New(), and if not specified, it is assumed the holder is the source, +making it not expire ever, which is likely not what you want. +*/ + +/datum/modifier/aura + var/aura_max_distance = 5 // If more than this many tiles away from the source, the modifier expires next tick. + +/datum/modifier/aura/check_if_valid() + if(!origin) + expire() + var/atom/A = origin.resolve() + if(istype(A)) // Make sure we're not null. + if(get_dist(holder, A) > aura_max_distance) + expire() + else + expire() // Source got deleted or something. \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 83dd5c93d4..8c98185806 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1913,6 +1913,7 @@ #include "code\modules\mob\transform_procs.dm" #include "code\modules\mob\typing_indicator.dm" #include "code\modules\mob\update_icons.dm" +#include "code\modules\mob\_modifiers\aura.dm" #include "code\modules\mob\_modifiers\cloning.dm" #include "code\modules\mob\_modifiers\modifiers.dm" #include "code\modules\mob\_modifiers\modifiers_misc.dm"