Makes using BYOND Filters easier.

This commit is contained in:
Atermonera
2020-07-30 12:32:56 -07:00
committed by VirgoBot
parent daa3307d25
commit 0f20fbd268
4 changed files with 58 additions and 0 deletions
+11
View File
@@ -20,7 +20,13 @@
var/light_intensity = null // Ditto. Not implemented yet.
var/mob_overlay_state = null // Icon_state for an overlay to apply to a (human) mob while this exists. This is actually implemented.
var/client_color = null // If set, the client will have the world be shown in this color, from their perspective.
<<<<<<< HEAD
var/wire_colors_replace = null // If set, the client will have wires replaced by the given replacement list. For colorblindness.
=======
var/list/filter_parameters = null // If set, will add a filter to the holder with the parameters in this var. Must be a list.
var/filter_priority = 1 // Used to make filters be applied in a specific order, if that is important.
var/filter_instance = null // Instance of a filter created with the `filter_parameters` list. This exists to make `animate()` calls easier. Don't set manually.
>>>>>>> a255ca0... Merge pull request #7358 from Neerti/filter_stuff
// Now for all the different effects.
// Percentage modifiers are expressed as a multipler. (e.g. +25% damage should be written as 1.25)
@@ -83,6 +89,8 @@
holder.update_transform()
if(client_color)
holder.update_client_color()
if(LAZYLEN(filter_parameters))
holder.remove_filter(REF(src))
qdel(src)
// Override this for special effects when it gets added to the mob.
@@ -151,6 +159,9 @@
update_transform()
if(mod.client_color)
update_client_color()
if(LAZYLEN(mod.filter_parameters))
add_filter(REF(mod), mod.filter_priority, mod.filter_parameters)
mod.filter_instance = get_filter(REF(mod))
return mod
@@ -388,3 +388,13 @@ the artifact triggers the rage.
if(holder.stat != DEAD)
holder.visible_message("<span class='alien'>\The [holder] collapses, the life draining from their body.</span>")
holder.death()
/datum/modifier/outline_test
name = "Outline Test"
desc = "This only exists to prove filter effects work and gives an example of how to animate() the resulting filter object."
filter_parameters = list(type = "outline", size = 1, color = "#FFFFFF", flags = OUTLINE_SHARP)
/datum/modifier/outline_test/tick()
animate(filter_instance, size = 3, time = 0.25 SECONDS)
animate(size = 1, 0.25 SECONDS)