Skip to content

Commit

Permalink
more colour effects
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Jan 28, 2025
1 parent d302689 commit 1b04df1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions _std/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
0,0,0,1,\
0,0,0,0)

#define COLOR_MATRIX_INVERSE_LABEL "inverse"
#define COLOR_MATRIX_INVERSE list(-1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1)

/// Takes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list
/proc/mult_color_matrix(var/list/Mat1, var/list/Mat2) // always 5x4 please
if (length(Mat1) != 20 || length(Mat2) != 20)
Expand Down
2 changes: 1 addition & 1 deletion code/WorkInProgress/tarmStuff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ TYPEINFO(/obj/item/device/geiger)
cell_type = /obj/item/ammo/power_cell/self_charging/ntso_signifer
from_frame_cell_type = /obj/item/ammo/power_cell/self_charging/ntso_signifer/bad
can_swap_cell = 0
color = list(-1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1)
color = COLOR_MATRIX_INVERSE

New()
set_current_projectile(new/datum/projectile/special/timegun/theBulletThatShootsTheFuture)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/materials/Mat_Materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ ABSTRACT_TYPE(/datum/material/metal)
mat_id = "negativematter"
name = "negative matter"
desc = "It seems to repel matter."
color = list(-1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1)
color = COLOR_MATRIX_INVERSE

New()
..()
Expand Down
21 changes: 17 additions & 4 deletions code/obj/artifacts/artifact_objects/lamp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
var/light_b = 1
var/datum/light/light
var/obj/effect/bonus_light
// valid color matrices for the "inverted lamp" effect. Works best if it's a dramatic change, otherwise it just looks kinda mid.
var/static/list/possible_color_matrices = list(
COLOR_MATRIX_GRAYSCALE,
COLOR_MATRIX_FLOCKMANGLED,
COLOR_MATRIX_FLOCKMIND,
COLOR_MATRIX_INVERSE)

New()
..()
Expand All @@ -18,8 +24,9 @@
light.set_brightness(light_brightness)
light.set_color(light_r, light_g, light_b)
light.attach(src)
if(prob(20)) //20 chance this is an inverting lamp
bonus_light = new /obj/effect/whackylight(src, light.radius)
if(prob(40)) //chance this is an inverting lamp
var/color = pick(possible_color_matrices)
bonus_light = new /obj/effect/whackylight(src, light.radius, color)
src.vis_contents += bonus_light

disposing()
Expand Down Expand Up @@ -65,12 +72,18 @@

var/radius
var/active = FALSE
New(loc, radius=2)

New(loc, radius=2, color=null)
.=..(get_turf(loc))
src.radius = radius
src.color = list(-1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 1, 1)
if(isnull(color))
src.color = COLOR_MATRIX_INVERSE
else
src.color = color
src.appearance_flags |= RESET_TRANSFORM
RegisterSignal(loc, COMSIG_MOVABLE_MOVED, PROC_REF(update_whacky))
update_whacky(loc, null, 0)
src.add_filter("test", 1, alpha_mask_filter(0,0,icon('icons/effects/overlays/knockout.dmi',"knockout")))

proc/update_whacky(var/atom/movable/thing, prev_loc, dir)
src.vis_contents.Cut()
Expand Down

0 comments on commit 1b04df1

Please sign in to comment.