mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Besrserkjuice doesn't spam chat (#6893)
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
// Checks if the modifier should be allowed to be applied to the mob before attaching it.
|
||||
// Override for special criteria, e.g. forbidding robots from receiving it.
|
||||
/datum/modifier/proc/can_apply(var/mob/living/L)
|
||||
/datum/modifier/proc/can_apply(var/mob/living/L, var/suppress_output = FALSE)
|
||||
return TRUE
|
||||
|
||||
// Checks to see if this datum should continue existing.
|
||||
@@ -113,7 +113,8 @@
|
||||
// Call this to add a modifier to a mob. First argument is the modifier type you want, second is how long it should last, in ticks.
|
||||
// Third argument is the 'source' of the modifier, if it's from someone else. If null, it will default to the mob being applied to.
|
||||
// The SECONDS/MINUTES macro is very helpful for this. E.g. M.add_modifier(/datum/modifier/example, 5 MINUTES)
|
||||
/mob/living/proc/add_modifier(var/modifier_type, var/expire_at = null, var/mob/living/origin = null)
|
||||
// The fourth argument is a boolean to suppress failure messages, set it to true if the modifier is repeatedly applied (as chem-based modifiers are) to prevent chat-spam
|
||||
/mob/living/proc/add_modifier(var/modifier_type, var/expire_at = null, var/mob/living/origin = null, var/suppress_failure = FALSE)
|
||||
// First, check if the mob already has this modifier.
|
||||
for(var/datum/modifier/M in modifiers)
|
||||
if(ispath(modifier_type, M))
|
||||
@@ -130,7 +131,7 @@
|
||||
|
||||
// If we're at this point, the mob doesn't already have it, or it does but stacking is allowed.
|
||||
var/datum/modifier/mod = new modifier_type(src, origin)
|
||||
if(!mod.can_apply(src))
|
||||
if(!mod.can_apply(src, suppress_failure))
|
||||
qdel(mod)
|
||||
return
|
||||
if(expire_at)
|
||||
|
||||
Reference in New Issue
Block a user