mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Merge pull request #8539 from VOREStation/upstream-merge-7358
[MIRROR] Makes using BYOND Filters easier.
This commit is contained in:
@@ -20,7 +20,10 @@
|
||||
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.
|
||||
var/wire_colors_replace = null // If set, the client will have wires replaced by the given replacement list. For colorblindness.
|
||||
var/wire_colors_replace = null // If set, the client will have wires replaced by the given replacement list. For colorblindness. //VOREStation Add
|
||||
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.
|
||||
|
||||
// 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 +86,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 +156,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)
|
||||
Reference in New Issue
Block a user