mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Supermatter zaps now are colored based on the power (#13444)
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
+19
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user