diff --git a/code/datums/beam.dm b/code/datums/beam.dm index f0149edf7ad..bb67f55632d 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -28,14 +28,17 @@ var/beam_type = /obj/effect/ebeam ///This is used as the visual_contents of beams, so you can apply one effect to this and the whole beam will look like that. never gets deleted on redrawing. var/obj/effect/ebeam/visuals + ///The color of the beam we're drawing. + var/beam_color -/datum/beam/New(beam_origin,beam_target,beam_icon='icons/effects/beam.dmi',beam_icon_state="b_beam",time=INFINITY,maxdistance=INFINITY,btype = /obj/effect/ebeam) - origin = beam_origin - target = beam_target - max_distance = maxdistance - icon = beam_icon - icon_state = beam_icon_state - beam_type = btype +/datum/beam/New(origin, target, icon = 'icons/effects/beam.dmi', icon_state = "b_beam", time = INFINITY, max_distance = INFINITY, beam_type = /obj/effect/ebeam, beam_color = null) + src.origin = origin + src.target = target + src.icon = icon + src.icon_state = icon_state + src.max_distance = max_distance + src.beam_type = beam_type + src.beam_color = beam_color if(time < INFINITY) QDEL_IN(src, time) @@ -46,6 +49,9 @@ visuals = new beam_type() visuals.icon = icon visuals.icon_state = icon_state + visuals.color = beam_color + visuals.layer = ABOVE_ALL_MOB_LAYER + visuals.update_appearance() Draw() RegisterSignal(origin, COMSIG_MOVABLE_MOVED, .proc/redrawing) RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/redrawing) @@ -139,6 +145,10 @@ anchored = TRUE var/datum/beam/owner +/obj/effect/ebeam/update_overlays() + . = ..() + . += emissive_appearance(icon, icon_state) + /obj/effect/ebeam/Destroy() owner = null return ..() @@ -160,7 +170,7 @@ * maxdistance: how far the beam will go before stopping itself. Used mainly for two things: preventing lag if the beam may go in that direction and setting a range to abilities that use beams. * beam_type: The type of your custom beam. This is for adding other wacky stuff for your beam only. Most likely, you won't (and shouldn't) change it. */ -/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=INFINITY,maxdistance=INFINITY,beam_type=/obj/effect/ebeam) - var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type) +/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=INFINITY,maxdistance=INFINITY,beam_type=/obj/effect/ebeam, beam_color = null) + var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type, beam_color) INVOKE_ASYNC(newbeam, /datum/beam/.proc/Start) return newbeam diff --git a/code/modules/power/supermatter/supermatter_process.dm b/code/modules/power/supermatter/supermatter_process.dm index e60be796a7a..4c55959031a 100644 --- a/code/modules/power/supermatter/supermatter_process.dm +++ b/code/modules/power/supermatter/supermatter_process.dm @@ -279,13 +279,16 @@ var/power_multiplier = max(0, (1 + (power_transmission_bonus / (10 - (gas_comp[/datum/gas/bz] * BZ_RADIOACTIVITY_MODIFIER)))) * freonbonus)// RadModBZ(500%) var/pressure_multiplier = max((1 / ((env.return_pressure() ** pressure_bonus_curve_angle) + 1) * pressure_bonus_derived_steepness) + pressure_bonus_derived_constant, 1) var/co2_power_increase = max(gas_comp[/datum/gas/carbon_dioxide] * 2, 1) + hue_angle_shift = clamp(903 * log(10, (power + 8000)) - 3590, -50, 240) + var/zap_color = color_matrix_rotate_hue(hue_angle_shift) supermatter_zap( zapstart = src, range = 3, zap_str = 2.5 * power * power_multiplier * pressure_multiplier * co2_power_increase, zap_flags = ZAP_SUPERMATTER_FLAGS, zap_cutoff = 300, - power_level = power + power_level = power, + color = zap_color, ) last_power_zap = world.time