diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index a8a7f2e04da6..23972b842607 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -1,11 +1,11 @@ ///Object doesn't use any of the light systems. Should be changed to add a light source to the object. #define NO_LIGHT_SUPPORT 0 ///Light made with the lighting datums, applying a matrix. -#define STATIC_LIGHT 1 +#define COMPLEX_LIGHT 1 ///Light made by masking the lighting darkness plane. -#define MOVABLE_LIGHT 2 +#define OVERLAY_LIGHT 2 ///Light made by masking the lighting darkness plane, and is directional. -#define MOVABLE_LIGHT_DIRECTIONAL 3 +#define OVERLAY_LIGHT_DIRECTIONAL 3 ///Light made by masking the lighting darkness plane, and is a directionally focused beam. #define MOVABLE_LIGHT_BEAM 4 /// Nonesensical value for light color, used for null checks. diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 1bb31541e9f4..c64d99251d92 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -46,7 +46,7 @@ // Displays static object lighting updates // Also enables some debug vars on sslighting that can be used to modify // How extensively we prune lighting corners to update -#define VISUALIZE_LIGHT_UPDATES +// #define VISUALIZE_LIGHT_UPDATES #define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green #define TRACK_MAX_SHARE //Allows max share tracking, for use in the atmos debugging ui diff --git a/code/datums/components/overlay_lighting.dm b/code/datums/components/overlay_lighting.dm index 800356d64020..95115d98629e 100644 --- a/code/datums/components/overlay_lighting.dm +++ b/code/datums/components/overlay_lighting.dm @@ -78,8 +78,8 @@ return COMPONENT_INCOMPATIBLE var/atom/movable/movable_parent = parent - if(movable_parent.light_system != MOVABLE_LIGHT && movable_parent.light_system != MOVABLE_LIGHT_DIRECTIONAL && movable_parent.light_system != MOVABLE_LIGHT_BEAM) - stack_trace("[type] added to [parent], with [movable_parent.light_system] value for the light_system var. Use [MOVABLE_LIGHT], [MOVABLE_LIGHT_DIRECTIONAL] or [MOVABLE_LIGHT_BEAM] instead.") + if(movable_parent.light_system != OVERLAY_LIGHT && movable_parent.light_system != OVERLAY_LIGHT_DIRECTIONAL && movable_parent.light_system != MOVABLE_LIGHT_BEAM) + stack_trace("[type] added to [parent], with [movable_parent.light_system] value for the light_system var. Use [OVERLAY_LIGHT], [OVERLAY_LIGHT_DIRECTIONAL] or [MOVABLE_LIGHT_BEAM] instead.") return COMPONENT_INCOMPATIBLE . = ..() @@ -371,7 +371,7 @@ if(directional) if(beam) cast_range = max(round(new_range * 0.5), 1) - else + else cast_range = clamp(round(new_range * 0.5), 1, 3) if(overlay_lighting_flags & LIGHTING_ON) make_luminosity_update() diff --git a/code/datums/elements/light_eaten.dm b/code/datums/elements/light_eaten.dm index e097b73f0887..292d646e6da3 100644 --- a/code/datums/elements/light_eaten.dm +++ b/code/datums/elements/light_eaten.dm @@ -17,7 +17,7 @@ /// Because the lighting system does not like movable lights getting set_light() called. switch(atom_target.light_system) - if(STATIC_LIGHT) + if(COMPLEX_LIGHT) target.set_light(0, 0, null, FALSE) else target.set_light_power(0) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index af4486d547ed..1475c8cdc908 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -96,7 +96,7 @@ var/list/alternate_appearances ///Light systems, both shouldn't be active at the same time. - var/light_system = STATIC_LIGHT + var/light_system = COMPLEX_LIGHT ///Range of the maximum brightness of light in tiles. Zero means no light. var/light_inner_range = 0 ///Range where light begins to taper into darkness in tiles. @@ -262,7 +262,7 @@ if(color) add_atom_colour(color, FIXED_COLOUR_PRIORITY) - if (light_system == STATIC_LIGHT && light_power && (light_inner_range || light_outer_range)) + if (light_system == COMPLEX_LIGHT && light_power && (light_inner_range || light_outer_range)) update_light() SETUP_SMOOTHING() @@ -1267,23 +1267,23 @@ /atom/vv_edit_var(var_name, var_value) switch(var_name) if(NAMEOF(src, light_inner_range)) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) set_light(l_inner_range = var_value) . = TRUE if(NAMEOF(src, light_outer_range)) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) set_light(l_outer_range = var_value) else set_light_range(var_value) . = TRUE if(NAMEOF(src, light_power)) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) set_light(l_power = var_value) else set_light_power(var_value) . = TRUE if(NAMEOF(src, light_color)) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) set_light(l_color = var_value) else set_light_color(var_value) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 5c7477e21f88..dd6f53c6442d 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -171,9 +171,9 @@ if(opacity) AddElement(/datum/element/light_blocking) switch(light_system) - if(MOVABLE_LIGHT) + if(OVERLAY_LIGHT) AddComponent(/datum/component/overlay_lighting) - if(MOVABLE_LIGHT_DIRECTIONAL) + if(OVERLAY_LIGHT_DIRECTIONAL) AddComponent(/datum/component/overlay_lighting, is_directional = TRUE) if(MOVABLE_LIGHT_BEAM) AddComponent(/datum/component/overlay_lighting, is_directional = TRUE, is_beam = TRUE) diff --git a/code/game/objects/effects/effect_system/effects_sparks.dm b/code/game/objects/effects/effect_system/effects_sparks.dm index 0603d8e81357..d1702d5a4d9b 100644 --- a/code/game/objects/effects/effect_system/effects_sparks.dm +++ b/code/game/objects/effects/effect_system/effects_sparks.dm @@ -16,7 +16,7 @@ name = "sparks" icon_state = "sparks" anchored = TRUE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 light_power = 0.5 light_color = LIGHT_COLOR_FIRE diff --git a/code/game/objects/effects/lighting.dm b/code/game/objects/effects/lighting.dm index 08c30a014d99..ff9f6ce9e26b 100644 --- a/code/game/objects/effects/lighting.dm +++ b/code/game/objects/effects/lighting.dm @@ -8,7 +8,7 @@ name = "lighting" desc = "Tell a coder if you're seeing this." icon_state = "nothing" - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = MINIMUM_USEFUL_LIGHT_RANGE light_color = COLOR_WHITE blocks_emissive = EMISSIVE_BLOCK_NONE diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 167d359551bd..acc5db8d0778 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -18,7 +18,7 @@ anchored = TRUE density = TRUE // dense for receiving bumbs layer = HIGH_OBJ_LAYER - light_system = STATIC_LIGHT + light_system = COMPLEX_LIGHT light_outer_range = 3 light_power = 1 light_on = TRUE diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index b3dd4b330beb..e34d64559bb9 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -743,7 +743,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM resistance_flags = FIRE_PROOF grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/fuel/oil = 5) custom_price = PAYCHECK_CREW * 1.1 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 light_power = 0.6 light_color = LIGHT_COLOR_FIRE diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index a64d1bab3b9b..2bd165ca2e64 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -19,7 +19,7 @@ slot_flags = ITEM_SLOT_BELT custom_materials = list(/datum/material/iron= SMALL_MATERIAL_AMOUNT * 0.5, /datum/material/glass= SMALL_MATERIAL_AMOUNT * 0.2) actions_types = list(/datum/action/item_action/toggle_light) - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_power = 1 light_on = FALSE @@ -61,7 +61,7 @@ if(!isnull(inhand_icon_state)) inhand_icon_state = initial(inhand_icon_state) set_light_on(on) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) update_light() /obj/item/flashlight/proc/toggle_light() @@ -325,7 +325,7 @@ righthand_file = 'icons/mob/inhands/items_righthand.dmi' force = 10 light_outer_range = 3.5 - light_system = STATIC_LIGHT + light_system = COMPLEX_LIGHT light_color = LIGHT_COLOR_FAINT_BLUE w_class = WEIGHT_CLASS_BULKY flags_1 = CONDUCT_1 @@ -358,7 +358,7 @@ actions_types = list() heat = 1000 light_color = LIGHT_COLOR_FLARE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT grind_results = list(/datum/reagent/sulfur = 15) sound_on = 'sound/items/match_strike.ogg' toggle_context = FALSE @@ -623,7 +623,7 @@ righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi' desc = "A mining lantern." light_outer_range = 6 // luminosity when on - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT /obj/item/flashlight/lantern/heirloom_moth name = "old lantern" @@ -654,7 +654,7 @@ slot_flags = ITEM_SLOT_BELT custom_materials = null light_outer_range = 7 //luminosity when on - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT /obj/item/flashlight/emp var/emp_max_charges = 4 @@ -718,7 +718,7 @@ custom_price = PAYCHECK_LOWER w_class = WEIGHT_CLASS_SMALL light_outer_range = 4 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT color = LIGHT_COLOR_GREEN icon_state = "glowstick" base_icon_state = "glowstick" @@ -825,7 +825,7 @@ name = "disco light" desc = "Groovy..." icon_state = null - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 4 light_power = 10 alpha = 0 @@ -853,7 +853,7 @@ desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure." icon_state = "flashdark" inhand_icon_state = "flashdark" - light_system = STATIC_LIGHT //The overlay light component is not yet ready to produce darkness. + light_system = COMPLEX_LIGHT //The overlay light component is not yet ready to produce darkness. light_outer_range = 0 ///Variable to preserve old lighting behavior in flashlights, to handle darkness. var/dark_light_outer_range = 2.5 @@ -871,7 +871,7 @@ /obj/item/flashlight/eyelight name = "eyelight" desc = "This shouldn't exist outside of someone's head, how are you seeing this?" - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 15 light_power = 1 flags_1 = CONDUCT_1 diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index 3084eb058843..a7c0199410ce 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -17,7 +17,7 @@ w_class = WEIGHT_CLASS_SMALL hitsound = SFX_SWING_HIT armour_penetration = 35 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 6 //TWICE AS BRIGHT AS A REGULAR ESWORD light_color = LIGHT_COLOR_ELECTRIC_GREEN light_on = FALSE diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 924585c62cd5..721497edf646 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -15,7 +15,7 @@ custom_materials = list(/datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT * 0.5) resistance_flags = FIRE_PROOF trigger_guard = TRIGGER_GUARD_NORMAL - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE var/status = FALSE var/lit = FALSE //on or off diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index f82bccac88cf..592fc8877154 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -5,7 +5,7 @@ attack_verb_continuous = list("hits", "taps", "pokes") attack_verb_simple = list("hit", "tap", "poke") resistance_flags = FIRE_PROOF - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 3 light_power = 1 light_on = FALSE diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index 2db5383a65fc..693bea55a370 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -716,7 +716,7 @@ var/has_creepy_icons = FALSE //for updating icons // only used for the base moth plush light - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 4 light_power = 1 @@ -767,7 +767,7 @@ update_brightness() set_light_on(on) - if(light_system == STATIC_LIGHT) + if(light_system == COMPLEX_LIGHT) update_light() return TRUE diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 55ce303d24e0..8ae5e8f21b81 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -17,7 +17,7 @@ usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg') drop_sound = 'sound/items/handling/weldingtool_drop.ogg' pickup_sound = 'sound/items/handling/weldingtool_pickup.ogg' - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 light_power = 0.75 light_color = LIGHT_COLOR_FIRE diff --git a/code/modules/antagonists/heretic/items/keyring.dm b/code/modules/antagonists/heretic/items/keyring.dm index 4d3a056bdcfa..ab7d883258fc 100644 --- a/code/modules/antagonists/heretic/items/keyring.dm +++ b/code/modules/antagonists/heretic/items/keyring.dm @@ -3,7 +3,7 @@ desc = "A crack in space, impossibly deep and painful to the eyes. Definitely not safe." icon = 'icons/effects/eldritch.dmi' icon_state = "realitycrack" - light_system = STATIC_LIGHT + light_system = COMPLEX_LIGHT light_power = 1 light_on = TRUE light_color = COLOR_GREEN diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 758f95804e20..412b8614ede5 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -10,7 +10,7 @@ throwforce = 0 w_class = WEIGHT_CLASS_TINY custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT*3, /datum/material/glass = SMALL_MATERIAL_AMOUNT*3) - light_system = MOVABLE_LIGHT //Used as a flash here. + light_system = OVERLAY_LIGHT //Used as a flash here. light_outer_range = FLASH_LIGHT_RANGE light_color = COLOR_WHITE light_power = FLASH_LIGHT_POWER diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 822335a8df35..4842234fdcdc 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -76,7 +76,7 @@ layer = GASFIRE_LAYER plane = ABOVE_GAME_PLANE blend_mode = BLEND_ADD - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = LIGHT_RANGE_FIRE light_power = 1 light_color = LIGHT_COLOR_FIRE diff --git a/code/modules/clothing/head/cakehat.dm b/code/modules/clothing/head/cakehat.dm index 1f489bdb4a59..f91a1bd4a842 100644 --- a/code/modules/clothing/head/cakehat.dm +++ b/code/modules/clothing/head/cakehat.dm @@ -11,7 +11,7 @@ flags_inv = HIDEEARS|HIDEHAIR armor_type = /datum/armor/none light_outer_range = 2 //luminosity when on - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT flags_cover = HEADCOVERSEYES heat = 999 diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index f147e2d450b8..6d9105e51ff9 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -13,7 +13,7 @@ clothing_flags = SNUG_FIT | PLASMAMAN_HELMET_EXEMPT resistance_flags = FIRE_PROOF - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_power = 0.8 light_on = FALSE diff --git a/code/modules/clothing/shoes/kindlekicks.dm b/code/modules/clothing/shoes/kindlekicks.dm index f1fb3305e0fa..c641c6718d73 100644 --- a/code/modules/clothing/shoes/kindlekicks.dm +++ b/code/modules/clothing/shoes/kindlekicks.dm @@ -4,7 +4,7 @@ icon_state = "kindleKicks" inhand_icon_state = null actions_types = list(/datum/action/item_action/kindle_kicks) - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 light_power = 3 light_on = FALSE diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index b34f979d3fbf..decb8bc2c3c3 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -52,7 +52,7 @@ tint = 2 armor_type = /datum/armor/space_plasmaman resistance_flags = FIRE_PROOF - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_on = FALSE var/helmet_on = FALSE diff --git a/code/modules/hydroponics/grown/ambrosia.dm b/code/modules/hydroponics/grown/ambrosia.dm index e0d3ebbb407a..ee01a447de7e 100644 --- a/code/modules/hydroponics/grown/ambrosia.dm +++ b/code/modules/hydroponics/grown/ambrosia.dm @@ -71,7 +71,7 @@ name = "ambrosia gaia branch" desc = "Eating this makes you immortal." icon_state = "ambrosia_gaia" - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 3 seed = /obj/item/seeds/ambrosia/gaia wine_power = 70 diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 575fbf91827a..2e168f608590 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -449,7 +449,7 @@ return var/obj/item/seeds/our_seed = our_plant.get_plant_seed() - our_plant.light_system = MOVABLE_LIGHT + our_plant.light_system = OVERLAY_LIGHT our_plant.AddComponent(/datum/component/overlay_lighting, glow_range(our_seed), glow_power(our_seed), glow_color) /* diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index 571adde8b212..a601229c83af 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -35,7 +35,7 @@ /atom/proc/update_light() SHOULD_NOT_SLEEP(TRUE) - if(light_system != STATIC_LIGHT) + if(light_system != COMPLEX_LIGHT) CRASH("update_light() for [src] with following light_system value: [light_system]") if (!light_power || !light_outer_range || !light_on) // We won't emit light anyways, destroy the light source. diff --git a/code/modules/lighting/lighting_corner.dm b/code/modules/lighting/lighting_corner.dm index 7678ba82ffad..dc0ad04162ae 100644 --- a/code/modules/lighting/lighting_corner.dm +++ b/code/modules/lighting/lighting_corner.dm @@ -37,50 +37,46 @@ var/needs_update = FALSE // Takes as an argument the coords to use as the bottom left (south west) of our corner -/datum/lighting_corner/New(turf/new_turf, diagonal) +/datum/lighting_corner/New(x, y, z) . = ..() - save_master(new_turf, turn(diagonal, 180)) - - var/vertical = diagonal & ~(diagonal - 1) // The horizontal directions (4 and 8) are bigger than the vertical ones (1 and 2), so we can reliably say the lsb is the horizontal direction. - var/horizontal = diagonal & ~vertical // Now that we know the horizontal one we can get the vertical one. - - x = new_turf.x + (horizontal == EAST ? 0.5 : -0.5) - y = new_turf.y + (vertical == NORTH ? 0.5 : -0.5) - - // My initial plan was to make this loop through a list of all the dirs (horizontal, vertical, diagonal). - // Issue being that the only way I could think of doing it was very messy, slow and honestly overengineered. - // So we'll have this hardcode instead. - var/turf/new_master_turf - - // Diagonal one is easy. - new_master_turf = get_step(new_turf, diagonal) - if (new_master_turf) // In case we're on the map's border. - save_master(new_master_turf, diagonal) - - // Now the horizontal one. - new_master_turf = get_step(new_turf, horizontal) - if (new_master_turf) // Ditto. - save_master(new_master_turf, ((new_master_turf.x > x) ? EAST : WEST) | ((new_master_turf.y > y) ? NORTH : SOUTH)) // Get the dir based on coordinates. - - // And finally the vertical one. - new_master_turf = get_step(new_turf, vertical) - if (new_master_turf) - save_master(new_master_turf, ((new_master_turf.x > x) ? EAST : WEST) | ((new_master_turf.y > y) ? NORTH : SOUTH)) // Get the dir based on coordinates. - -/datum/lighting_corner/proc/save_master(turf/master, dir) - switch (dir) - if (NORTHEAST) - master_NE = master - master.lighting_corner_SW = src - if (SOUTHEAST) - master_SE = master - master.lighting_corner_NW = src - if (SOUTHWEST) - master_SW = master - master.lighting_corner_NE = src - if (NORTHWEST) - master_NW = master - master.lighting_corner_SE = src + src.x = x + 0.5 + src.y = y + 0.5 + + // Alright. We're gonna take a set of coords, and from them do a loop clockwise + // To build out the turfs adjacent to us. This is pretty fast + var/turf/process_next = locate(x, y, z) + if(process_next) + master_SW = process_next + process_next.lighting_corner_NE = src + // Now, we go north! + process_next = get_step(process_next, NORTH) + else + // Yes this is slightly slower then having a guarenteeed turf, but there aren't many null turfs + // So this is pretty damn fast + process_next = locate(x, y + 1, z) + + // Ok, if we have a north turf, go there. otherwise, onto the next + if(process_next) + master_NW = process_next + process_next.lighting_corner_SE = src + // Now, TO THE EAST + process_next = get_step(process_next, EAST) + else + process_next = locate(x + 1, y + 1, z) + + // Etc etc + if(process_next) + master_NE = process_next + process_next.lighting_corner_SW = src + // Now, TO THE SOUTH AGAIN (SE) + process_next = get_step(process_next, SOUTH) + else + process_next = locate(x + 1, y, z) + + // anddd the last tile + if(process_next) + master_SE = process_next + process_next.lighting_corner_NW = src /datum/lighting_corner/proc/self_destruct_if_idle() if (!LAZYLEN(affecting) && !LAZYLEN(globAffect)) //monkestation edit + && !LAZYLEN(globAffect) diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm index 0951e1aafa0c..7b475d38b4f5 100644 --- a/code/modules/lighting/lighting_object.dm +++ b/code/modules/lighting/lighting_object.dm @@ -55,6 +55,12 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) return ..() /datum/lighting_object/proc/update() +#ifdef VISUALIZE_LIGHT_UPDATES + affected_turf.add_atom_colour(COLOR_BLUE_LIGHT, ADMIN_COLOUR_PRIORITY) + animate(affected_turf, 10, color = null) + addtimer(CALLBACK(affected_turf, /atom/proc/remove_atom_colour, ADMIN_COLOUR_PRIORITY, COLOR_BLUE_LIGHT), 10, TIMER_UNIQUE|TIMER_OVERRIDE) +#endif + // To the future coder who sees this and thinks // "Why didn't he just use a loop?" // Well my man, it's because the loop performed like shit. @@ -65,12 +71,7 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) var/static/datum/lighting_corner/dummy/dummy_lighting_corner = new - -#ifdef VISUALIZE_LIGHT_UPDATES - affected_turf.add_atom_colour(COLOR_BLUE_LIGHT, ADMIN_COLOUR_PRIORITY) - animate(affected_turf, 10, color = null) - addtimer(CALLBACK(affected_turf, TYPE_PROC_REF(/atom, remove_atom_colour), ADMIN_COLOUR_PRIORITY, COLOR_BLUE_LIGHT), 10, TIMER_UNIQUE|TIMER_OVERRIDE) -#endif + var/turf/affected_turf = src.affected_turf var/datum/lighting_corner/red_corner = affected_turf.lighting_corner_SW || dummy_lighting_corner var/datum/lighting_corner/green_corner = affected_turf.lighting_corner_SE || dummy_lighting_corner @@ -79,22 +80,6 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) var/max = max(red_corner.largest_color_luminosity, green_corner.largest_color_luminosity, blue_corner.largest_color_luminosity, alpha_corner.largest_color_luminosity) - var/rr = red_corner.cache_r - var/rg = red_corner.cache_g - var/rb = red_corner.cache_b - - var/gr = green_corner.cache_r - var/gg = green_corner.cache_g - var/gb = green_corner.cache_b - - var/br = blue_corner.cache_r - var/bg = blue_corner.cache_g - var/bb = blue_corner.cache_b - - var/ar = alpha_corner.cache_r - var/ag = alpha_corner.cache_g - var/ab = alpha_corner.cache_b - #if LIGHTING_SOFT_THRESHOLD != 0 var/set_luminosity = max > LIGHTING_SOFT_THRESHOLD #else @@ -103,7 +88,12 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) var/set_luminosity = max > 1e-6 #endif - if((rr & gr & br & ar) && (rg + gg + bg + ag + rb + gb + bb + ab == 8)) + var/mutable_appearance/current_underlay = src.current_underlay + affected_turf.underlays -= current_underlay + + if(red_corner.cache_r & green_corner.cache_r & blue_corner.cache_r & alpha_corner.cache_r && \ + (red_corner.cache_g + green_corner.cache_g + blue_corner.cache_g + alpha_corner.cache_g + \ + red_corner.cache_b + green_corner.cache_b + blue_corner.cache_b + alpha_corner.cache_b == 8)) //anything that passes the first case is very likely to pass the second, and addition is a little faster in this case affected_turf.underlays -= current_underlay current_underlay.icon_state = "lighting_transparent" @@ -118,43 +108,27 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) affected_turf.underlays -= current_underlay current_underlay.icon_state ="light" current_underlay.color = list( - rr, rg, rb, 00, - gr, gg, gb, 00, - br, bg, bb, 00, - ar, ag, ab, 00, + red_corner.cache_r, red_corner.cache_g, red_corner.cache_b, 00, + green_corner.cache_r, green_corner.cache_g, green_corner.cache_b, 00, + blue_corner.cache_r, blue_corner.cache_g, blue_corner.cache_b, 00, + alpha_corner.cache_r, alpha_corner.cache_g, alpha_corner.cache_b, 00, 00, 00, 00, 01 ) - affected_turf.underlays += current_underlay - if(red_corner.applying_additive || green_corner.applying_additive || blue_corner.applying_additive || alpha_corner.applying_additive) affected_turf.underlays -= additive_underlay additive_underlay.icon_state = "light" - var/arr = red_corner.add_r - var/arb = red_corner.add_b - var/arg = red_corner.add_g - - var/agr = green_corner.add_r - var/agb = green_corner.add_b - var/agg = green_corner.add_g - - var/abr = blue_corner.add_r - var/abb = blue_corner.add_b - var/abg = blue_corner.add_g - - var/aarr = alpha_corner.add_r - var/aarb = alpha_corner.add_b - var/aarg = alpha_corner.add_g additive_underlay.color = list( - arr, arg, arb, 00, - agr, agg, agb, 00, - abr, abg, abb, 00, - aarr, aarg, aarb, 00, + red_corner.add_r, red_corner.add_g, red_corner.add_b, 00, + green_corner.add_r, green_corner.add_g, green_corner.add_b, 00, + blue_corner.add_r, blue_corner.add_g, blue_corner.add_b, 00, + alpha_corner.add_r, alpha_corner.add_g, alpha_corner.add_b, 00, 00, 00, 00, 01 ) affected_turf.underlays += additive_underlay else affected_turf.underlays -= additive_underlay + affected_turf.underlays += current_underlay affected_turf.luminosity = set_luminosity diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 5d44469d7543..1c6da704dfd1 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -100,25 +100,14 @@ UnregisterSignal(old_atom_host, COMSIG_MOVABLE_MOVED) return TRUE -///signal handler for when our host atom moves and we need to update our effects -/datum/light_source/proc/update_host_lights(atom/movable/host) - SIGNAL_HANDLER - - if(QDELETED(host)) - return - - host.update_light() - // Yes this doesn't align correctly on anything other than 4 width tabs. // If you want it to go switch everybody to elastic tab stops. // Actually that'd be great if you could! -#define EFFECT_UPDATE(level) \ - if (needs_update == LIGHTING_NO_UPDATE) { \ - SSlighting.sources_queue += src; \ - } \ - if (needs_update < level) { \ - needs_update = level; \ - } +#define EFFECT_UPDATE(level) \ + if (needs_update == LIGHTING_NO_UPDATE) \ + SSlighting.sources_queue += src; \ + if (needs_update < level) \ + needs_update = level; \ /// This proc will cause the light source to update the top atom, and add itself to the update queue. @@ -149,7 +138,29 @@ // This is the define used to calculate falloff. // Assuming a brightness of 1 at range 1, formula should be (brightness = 1 / distance^2) // However, due to the weird range factor, brightness = (-(distance - full_dark_start) / (full_dark_start - full_light_end)) ^ light_max_bright -#define LUM_FALLOFF(C, T)(CLAMP01(-((((C.x - T.x) ** 2 +(C.y - T.y) ** 2) ** 0.5 - light_outer_range) / max(light_outer_range - light_inner_range, 1))) ** light_falloff_curve) +//#define LUM_FALLOFF(C, T)(CLAMP01(-((((C.x - T.x) ** 2 +(C.y - T.y) ** 2) ** 0.5 - light_outer_range) / max(light_outer_range - light_inner_range, 1))) ** light_falloff_curve) + +#define LUM_FALLOFF(C) (CLAMP01(-((((C.x - _turf_x) ** 2 +(C.y - _turf_y) ** 2) ** 0.5 - light_outer_range) / _range_divisor)) ** light_falloff_curve) + +// This exists so we can cache the vars used in this macro, and save MASSIVE time :) +// Most of this is saving off datum var accesses, tho some of it does actually cache computation +// You will NEED to call this before you call APPLY_CORNER +#define SETUP_CORNERS_CACHE(lighting_source) \ + var/_turf_x = lighting_source.pixel_turf.x; \ + var/_turf_y = lighting_source.pixel_turf.y; \ + var/_range_divisor = max(1, lighting_source.light_outer_range - lighting_source.light_inner_range); \ + var/_light_power = lighting_source.light_power; \ + var/_applied_lum_r = lighting_source.applied_lum_r; \ + var/_applied_lum_g = lighting_source.applied_lum_g; \ + var/_applied_lum_b = lighting_source.applied_lum_b; \ + var/_lum_r = lighting_source.lum_r; \ + var/_lum_g = lighting_source.lum_g; \ + var/_lum_b = lighting_source.lum_b; \ + +#define SETUP_CORNERS_REMOVAL_CACHE(lighting_source) \ + var/_applied_lum_r = lighting_source.applied_lum_r; \ + var/_applied_lum_g = lighting_source.applied_lum_g; \ + var/_applied_lum_b = lighting_source.applied_lum_b; // Macro that applies light to a new corner. // It is a macro in the interest of speed, yet not having to copy paste it. @@ -157,29 +168,30 @@ // As such this all gets counted as a single line. // The braces and semicolons are there to be able to do this on a single line. #define APPLY_CORNER(C) \ - . = LUM_FALLOFF(C, pixel_turf); \ - . *= (light_power ** 2); \ - . *= light_power < 0 ? -1:1; \ + . = LUM_FALLOFF(C); \ + . *= (_light_power ** 2); \ + . *= _light_power < 0 ? -1:1; \ var/OLD = effect_str[C]; \ \ C.update_lumcount \ ( \ - (. * lum_r) - (OLD * applied_lum_r), \ - (. * lum_g) - (OLD * applied_lum_g), \ - (. * lum_b) - (OLD * applied_lum_b) \ + (. * _lum_r) - (OLD * _applied_lum_r), \ + (. * _lum_g) - (OLD * _applied_lum_g), \ + (. * _lum_b) - (OLD * _applied_lum_b) \ ); \ #define REMOVE_CORNER(C) \ . = -effect_str[C]; \ C.update_lumcount \ ( \ - . * applied_lum_r, \ - . * applied_lum_g, \ - . * applied_lum_b \ + . * _applied_lum_r, \ + . * _applied_lum_g, \ + . * _applied_lum_b \ ); /// This is the define used to calculate falloff. /datum/light_source/proc/remove_lum() + SETUP_CORNERS_REMOVAL_CACHE(src) applied = FALSE for (var/datum/lighting_corner/corner as anything in effect_str) REMOVE_CORNER(corner) @@ -195,6 +207,7 @@ effect_str = null /datum/light_source/proc/recalc_corner(datum/lighting_corner/corner) + SETUP_CORNERS_CACHE(src) LAZYINITLIST(effect_str) if (effect_str[corner]) // Already have one. REMOVE_CORNER(corner) @@ -204,6 +217,22 @@ effect_str[corner] = . +// Keep in mind. Lighting corners accept the bottom left (northwest) set of cords to them as input +#define GENERATE_MISSING_CORNERS(gen_for) \ + if (!gen_for.lighting_corner_NE) { \ + gen_for.lighting_corner_NE = new /datum/lighting_corner(gen_for.x, gen_for.y, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_SE) { \ + gen_for.lighting_corner_SE = new /datum/lighting_corner(gen_for.x, gen_for.y - 1, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_SW) { \ + gen_for.lighting_corner_SW = new /datum/lighting_corner(gen_for.x - 1, gen_for.y - 1, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_NW) { \ + gen_for.lighting_corner_NW = new /datum/lighting_corner(gen_for.x - 1, gen_for.y, gen_for.z); \ + } \ + gen_for.lighting_corners_initialised = TRUE; + #define INSERT_CORNERS(insert_into, draw_from) \ if (!draw_from.lighting_corners_initialised) { \ @@ -287,7 +316,6 @@ return //nothing's changed var/list/datum/lighting_corner/corners = list() - var/list/turf/turfs = list() if (source_turf) var/uses_multiz = !!GET_LOWEST_STACK_OFFSET(source_turf.z) @@ -298,24 +326,25 @@ if(IS_OPAQUE_TURF(T)) continue if (!T.lighting_corners_initialised) - T.generate_missing_corners() + GENERATE_MISSING_CORNERS(T) + corners[T.lighting_corner_NE] = 0 corners[T.lighting_corner_SE] = 0 corners[T.lighting_corner_SW] = 0 corners[T.lighting_corner_NW] = 0 - turfs += T SSdemo.mark_turf(T) //Monkestation Edit: REPLAYS else for(var/turf/T in view(CEILING(light_outer_range, 1), source_turf)) if(IS_OPAQUE_TURF(T)) continue if (!T.lighting_corners_initialised) - T.generate_missing_corners() + GENERATE_MISSING_CORNERS(T) + corners[T.lighting_corner_NE] = 0 corners[T.lighting_corner_SE] = 0 corners[T.lighting_corner_SW] = 0 corners[T.lighting_corner_NW] = 0 - turfs += T + SSdemo.mark_turf(T) //Monkestation Edit: REPLAYS var/turf/below = GET_TURF_BELOW(T) var/turf/previous = T @@ -328,13 +357,15 @@ // Of this corner break // Now we do lighting things to it + if(IS_OPAQUE_TURF(below)) + continue if (!below.lighting_corners_initialised) - below.generate_missing_corners() + GENERATE_MISSING_CORNERS(below) + corners[below.lighting_corner_NE] = 0 corners[below.lighting_corner_SE] = 0 corners[below.lighting_corner_SW] = 0 corners[below.lighting_corner_NW] = 0 - turfs += below // ANNND then we add the one below it previous = below below = GET_TURF_BELOW(below) @@ -345,19 +376,22 @@ if(!istransparentturf(above) || IS_OPAQUE_TURF(above)) break if (!above.lighting_corners_initialised) - above.generate_missing_corners() + GENERATE_MISSING_CORNERS(above) + corners[above.lighting_corner_NE] = 0 corners[above.lighting_corner_SE] = 0 corners[above.lighting_corner_SW] = 0 corners[above.lighting_corner_NW] = 0 - turfs += above above = GET_TURF_ABOVE(above) SSdemo.mark_turf(T) //Monkestation Edit: REPLAYS source_turf.luminosity = oldlum - var/list/datum/lighting_corner/new_corners = (corners - effect_str) - LAZYINITLIST(effect_str) + SETUP_CORNERS_CACHE(src) + + var/list/datum/lighting_corner/new_corners = (corners - src.effect_str) + LAZYINITLIST(src.effect_str) + var/list/effect_str = src.effect_str if (needs_update == LIGHTING_VIS_UPDATE) for (var/datum/lighting_corner/corner as anything in new_corners) @@ -372,13 +406,16 @@ LAZYADD(corner.affecting, src) effect_str[corner] = . - for (var/datum/lighting_corner/corner as anything in corners - new_corners) // Existing corners - APPLY_CORNER(corner) - if (. != 0) - effect_str[corner] = . - else - LAZYREMOVE(corner.affecting, src) - effect_str -= corner + // New corners are a subset of corners. so if they're both the same length, there are NO old corners! + if(length(corners) != length(new_corners)) + for (var/datum/lighting_corner/corner as anything in corners - new_corners) // Existing corners + APPLY_CORNER(corner) + if (. != 0) + effect_str[corner] = . + else + LAZYREMOVE(corner.affecting, src) + effect_str -= corner + var/list/datum/lighting_corner/gone_corners = effect_str - corners for (var/datum/lighting_corner/corner as anything in gone_corners) @@ -390,9 +427,26 @@ applied_lum_g = lum_g applied_lum_b = lum_b - UNSETEMPTY(effect_str) + UNSETEMPTY(src.effect_str) + +///signal handler for when our host atom moves and we need to update our effects +/datum/light_source/proc/update_host_lights(atom/movable/host) + SIGNAL_HANDLER + if(QDELETED(host)) + return + + // If the host is our owner, we want to call their update so they can decide who the top atom should be + if(host == source_atom) + host.update_light() + return + + // Otherwise, our top atom just moved, so we trigger a normal rebuild + EFFECT_UPDATE(LIGHTING_CHECK_UPDATE) #undef APPLY_CORNER #undef EFFECT_UPDATE #undef INSERT_CORNERS #undef LUM_FALLOFF +#undef SETUP_CORNERS_REMOVAL_CACHE +#undef SETUP_CORNERS_CACHE +#undef GENERATE_MISSING_CORNERS diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index f3a137f1caf4..d2400097c343 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -128,18 +128,3 @@ // If we're changing into an area with no lighting, and we're lit, light ourselves if(!new_area.lighting_effects && old_area.lighting_effects && space_lit) overlays += GLOB.fullbright_overlays[GET_TURF_PLANE_OFFSET(src) + 1] - -/turf/proc/generate_missing_corners() - if (!lighting_corner_NE) - lighting_corner_NE = new/datum/lighting_corner(src, NORTH|EAST) - - if (!lighting_corner_SE) - lighting_corner_SE = new/datum/lighting_corner(src, SOUTH|EAST) - - if (!lighting_corner_SW) - lighting_corner_SW = new/datum/lighting_corner(src, SOUTH|WEST) - - if (!lighting_corner_NW) - lighting_corner_NW = new/datum/lighting_corner(src, NORTH|WEST) - - lighting_corners_initialised = TRUE diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index b902c47e5a21..f2713f5d48c0 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -21,7 +21,7 @@ sharpness = SHARP_EDGED actions_types = list(/datum/action/item_action/toggle_light) obj_flags = UNIQUE_RENAME - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 5 light_on = FALSE var/list/trophies = list() diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index 5cf3e7572966..ed0151b88eb8 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -275,7 +275,7 @@ desc = "Happy to light your way." icon = 'icons/obj/lighting.dmi' icon_state = "orb" - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 7 light_flags = LIGHT_ATTACHED layer = ABOVE_ALL_MOB_LAYER diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 1bbb63c9525f..fc8782763a46 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -17,7 +17,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) invisibility = INVISIBILITY_OBSERVER hud_type = /datum/hud/ghost movement_type = GROUND | FLYING - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 2 light_on = FALSE diff --git a/code/modules/mob/living/basic/guardian/guardian.dm b/code/modules/mob/living/basic/guardian/guardian.dm index 895a31eb2ecb..c84e9bca4525 100644 --- a/code/modules/mob/living/basic/guardian/guardian.dm +++ b/code/modules/mob/living/basic/guardian/guardian.dm @@ -38,7 +38,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 melee_attack_cooldown = CLICK_CD_MELEE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 3 light_on = FALSE diff --git a/code/modules/mob/living/basic/minebots/minebot.dm b/code/modules/mob/living/basic/minebots/minebot.dm index fbed972508b6..6457239bdce8 100644 --- a/code/modules/mob/living/basic/minebots/minebot.dm +++ b/code/modules/mob/living/basic/minebots/minebot.dm @@ -22,7 +22,7 @@ speak_emote = list("states") mob_biotypes = MOB_ROBOTIC death_message = "blows apart!" - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 6 light_on = FALSE ai_controller = /datum/ai_controller/basic_controller/minebot diff --git a/code/modules/mob/living/basic/space_fauna/ghost.dm b/code/modules/mob/living/basic/space_fauna/ghost.dm index b7230710e573..77050c993e3f 100644 --- a/code/modules/mob/living/basic/space_fauna/ghost.dm +++ b/code/modules/mob/living/basic/space_fauna/ghost.dm @@ -20,7 +20,7 @@ attack_sound = 'sound/hallucinations/growl1.ogg' death_message = "wails, disintegrating into a pile of ectoplasm!" gold_core_spawnable = NO_SPAWN //too spooky for science - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 // same glowing as visible player ghosts light_power = 2 ai_controller = /datum/ai_controller/basic_controller/ghost diff --git a/code/modules/mob/living/silicon/robot/robot_defines.dm b/code/modules/mob/living/silicon/robot/robot_defines.dm index 308a7a838c6e..96227f9e5fab 100644 --- a/code/modules/mob/living/silicon/robot/robot_defines.dm +++ b/code/modules/mob/living/silicon/robot/robot_defines.dm @@ -23,7 +23,7 @@ radio = /obj/item/radio/borg blocks_emissive = EMISSIVE_BLOCK_UNIQUE - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 00f446915763..10feaab1c42e 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -24,7 +24,7 @@ bubble_icon = "machine" speech_span = SPAN_ROBOT faction = list(FACTION_NEUTRAL, FACTION_SILICON, FACTION_TURRET) - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 3 light_power = 0.9 diff --git a/code/modules/mob/living/simple_animal/bot/vibebot.dm b/code/modules/mob/living/simple_animal/bot/vibebot.dm index 2f51f067eebc..86517dca3df9 100644 --- a/code/modules/mob/living/simple_animal/bot/vibebot.dm +++ b/code/modules/mob/living/simple_animal/bot/vibebot.dm @@ -9,7 +9,7 @@ health = 25 maxHealth = 25 pass_flags = PASSMOB | PASSFLAPS - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 7 light_power = 3 diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 28b348616769..a498f3a82748 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -170,7 +170,7 @@ icon_state = "at_shield2" layer = FLY_LAYER plane = ABOVE_GAME_PLANE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 duration = 8 var/target diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index a80bba158ca7..5ce86023956a 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -233,7 +233,7 @@ incompatible_modules = list(/obj/item/mod/module/flashlight) cooldown_time = 0.5 SECONDS overlay_state_inactive = "module_light" - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_color = COLOR_WHITE light_outer_range = 4 light_power = 1 diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index 14fbd4b3acaf..f5cd29622911 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -562,7 +562,7 @@ range = 6 suppressed = SUPPRESSED_VERY armor_flag = BOMB - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 1 light_color = COLOR_LIGHT_ORANGE @@ -581,7 +581,7 @@ icon = 'icons/obj/clothing/modsuit/mod_modules.dmi' anchored = TRUE resistance_flags = FIRE_PROOF|LAVA_PROOF - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 1 light_color = COLOR_LIGHT_ORANGE diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 2be75c7d0c65..9b83ee70371a 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -12,7 +12,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar integrity_failure = 0.5 max_integrity = 100 armor_type = /datum/armor/item_modular_computer - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL ///The ID currently stored in the computer. var/obj/item/card/id/computer_id_slot diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index 1d2b676fcb79..8c06be5ff8d2 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -16,7 +16,7 @@ light_flags = LIGHT_ATTACHED light_on = FALSE light_outer_range = 3 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT maxHealth = 500 mob_size = MOB_SIZE_TINY mobility_flags = MOBILITY_FLAGS_REST_CAPABLE_DEFAULT diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 6adcdd8a9551..f9d1a3505119 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -254,7 +254,7 @@ armour_penetration = 20 bare_wound_bonus = 10 item_flags = NO_BLOOD_ON_ITEM - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1.5 light_power = 0.75 light_color = COLOR_SOFT_RED diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 57806cd8178e..24d82816b538 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -10,7 +10,7 @@ worn_icon_state = "camera" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' - light_system = MOVABLE_LIGHT //Used as a flash here. + light_system = OVERLAY_LIGHT //Used as a flash here. light_outer_range = 8 light_color = COLOR_WHITE light_power = FLASH_LIGHT_POWER diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index e467a745f805..8d5d22da3cdc 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -9,7 +9,7 @@ armor_flag = LASER eyeblur = 4 SECONDS impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 1 light_color = COLOR_SOFT_RED diff --git a/code/modules/research/ordnance/doppler_array.dm b/code/modules/research/ordnance/doppler_array.dm index 3325439290c1..7928781f2adc 100644 --- a/code/modules/research/ordnance/doppler_array.dm +++ b/code/modules/research/ordnance/doppler_array.dm @@ -18,7 +18,7 @@ var/obj/item/computer_disk/inserted_disk // Lighting system to better communicate the directions. - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_power = 1 light_color = COLOR_RED diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index b815ceca40f4..604d59d7667f 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -77,7 +77,7 @@ hitsound = 'sound/items/welder.ogg' w_class = WEIGHT_CLASS_NORMAL toolspeed = 0.7 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_color = COLOR_SOFT_RED @@ -337,7 +337,7 @@ force = 16 w_class = WEIGHT_CLASS_NORMAL toolspeed = 0.7 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_color = LIGHT_COLOR_BLUE sharpness = SHARP_EDGED diff --git a/code/modules/vehicles/cars/clowncar.dm b/code/modules/vehicles/cars/clowncar.dm index 3e2648ece9af..cf4cf60ba609 100644 --- a/code/modules/vehicles/cars/clowncar.dm +++ b/code/modules/vehicles/cars/clowncar.dm @@ -9,7 +9,7 @@ movedelay = 0.6 car_traits = CAN_KIDNAP key_type = /obj/item/bikehorn - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 8 light_power = 2 light_on = FALSE diff --git a/code/modules/vehicles/cars/vim.dm b/code/modules/vehicles/cars/vim.dm index 0114fdaac390..44c1307b7134 100644 --- a/code/modules/vehicles/cars/vim.dm +++ b/code/modules/vehicles/cars/vim.dm @@ -13,7 +13,7 @@ enter_delay = 20 movedelay = 0.6 engine_sound_length = 0.3 SECONDS - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_power = 2 light_on = FALSE diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 2568ab06ff81..9e6adc5a877f 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -29,7 +29,7 @@ move_force = MOVE_FORCE_VERY_STRONG move_resist = MOVE_FORCE_EXTREMELY_STRONG COOLDOWN_DECLARE(mecha_bump_smash) - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE light_outer_range = 8 generic_canpass = FALSE diff --git a/code/modules/vehicles/mecha/combat/durand.dm b/code/modules/vehicles/mecha/combat/durand.dm index 4de7cd72f65b..679802abc185 100644 --- a/code/modules/vehicles/mecha/combat/durand.dm +++ b/code/modules/vehicles/mecha/combat/durand.dm @@ -162,7 +162,7 @@ own integrity back to max. Shield is automatically dropped if we run out of powe pixel_y = 4 max_integrity = 10000 anchored = TRUE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = MINIMUM_USEFUL_LIGHT_RANGE light_power = 5 light_color = LIGHT_COLOR_ELECTRIC_CYAN diff --git a/code/modules/wiremod/shell/bot.dm b/code/modules/wiremod/shell/bot.dm index 463dd52cc052..fc62a70d1de2 100644 --- a/code/modules/wiremod/shell/bot.dm +++ b/code/modules/wiremod/shell/bot.dm @@ -9,7 +9,7 @@ icon_state = "setup_medium_box" density = FALSE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE /obj/structure/bot/Initialize(mapload) diff --git a/code/modules/wiremod/shell/compact_remote.dm b/code/modules/wiremod/shell/compact_remote.dm index ef9168c3b178..9c0361518319 100644 --- a/code/modules/wiremod/shell/compact_remote.dm +++ b/code/modules/wiremod/shell/compact_remote.dm @@ -11,7 +11,7 @@ worn_icon_state = "electronic" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE /obj/item/compact_remote/Initialize(mapload) diff --git a/code/modules/wiremod/shell/controller.dm b/code/modules/wiremod/shell/controller.dm index 4b3beb233c53..4bf35d8020d7 100644 --- a/code/modules/wiremod/shell/controller.dm +++ b/code/modules/wiremod/shell/controller.dm @@ -12,7 +12,7 @@ worn_icon_state = "electronic" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE /obj/item/controller/Initialize(mapload) diff --git a/code/modules/wiremod/shell/dispenser.dm b/code/modules/wiremod/shell/dispenser.dm index 45dd321ddfef..f061610c6e01 100644 --- a/code/modules/wiremod/shell/dispenser.dm +++ b/code/modules/wiremod/shell/dispenser.dm @@ -9,7 +9,7 @@ icon_state = "setup_drone_arms" density = FALSE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE var/max_weight = WEIGHT_CLASS_NORMAL diff --git a/code/modules/wiremod/shell/drone.dm b/code/modules/wiremod/shell/drone.dm index 8688ada7ef71..3fdc931e61a2 100644 --- a/code/modules/wiremod/shell/drone.dm +++ b/code/modules/wiremod/shell/drone.dm @@ -10,7 +10,7 @@ maxHealth = 300 health = 300 living_flags = 0 - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE /mob/living/circuit_drone/Initialize(mapload) diff --git a/code/modules/wiremod/shell/gun.dm b/code/modules/wiremod/shell/gun.dm index 26e92409d4a3..448c10866c6e 100644 --- a/code/modules/wiremod/shell/gun.dm +++ b/code/modules/wiremod/shell/gun.dm @@ -11,7 +11,7 @@ ammo_type = list(/obj/item/ammo_casing/energy/wiremod_gun) cell_type = /obj/item/stock_parts/cell/emproof/wiremod_gun item_flags = NONE - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE automatic_charge_overlays = FALSE trigger_guard = TRIGGER_GUARD_ALLOW_ALL diff --git a/code/modules/wiremod/shell/keyboard.dm b/code/modules/wiremod/shell/keyboard.dm index cb15d710c07d..ed8f9ed270ba 100644 --- a/code/modules/wiremod/shell/keyboard.dm +++ b/code/modules/wiremod/shell/keyboard.dm @@ -6,7 +6,7 @@ worn_icon_state = "electronic" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE /obj/item/keyboard_shell/Initialize(mapload) diff --git a/code/modules/wiremod/shell/moneybot.dm b/code/modules/wiremod/shell/moneybot.dm index 0b406eb66c55..3ef170eaed8a 100644 --- a/code/modules/wiremod/shell/moneybot.dm +++ b/code/modules/wiremod/shell/moneybot.dm @@ -9,7 +9,7 @@ icon_state = "setup_large" density = FALSE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE var/stored_money = 0 diff --git a/code/modules/wiremod/shell/scanner.dm b/code/modules/wiremod/shell/scanner.dm index faf3c57bb8c9..05dfedfd4325 100644 --- a/code/modules/wiremod/shell/scanner.dm +++ b/code/modules/wiremod/shell/scanner.dm @@ -11,7 +11,7 @@ worn_icon_state = "electronic" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE /obj/item/wiremod_scanner/Initialize(mapload) diff --git a/code/modules/wiremod/shell/server.dm b/code/modules/wiremod/shell/server.dm index 4440c7a0e3ed..799b74a382cb 100644 --- a/code/modules/wiremod/shell/server.dm +++ b/code/modules/wiremod/shell/server.dm @@ -10,7 +10,7 @@ icon_state = "setup_stationary" density = TRUE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE /obj/structure/server/Initialize(mapload) diff --git a/monkestation/code/game/objects/items/implants/hardlight.dm b/monkestation/code/game/objects/items/implants/hardlight.dm index 5d7518b40a53..437b08570640 100644 --- a/monkestation/code/game/objects/items/implants/hardlight.dm +++ b/monkestation/code/game/objects/items/implants/hardlight.dm @@ -191,7 +191,7 @@ can_charge = FALSE //ITS A SPEAR item_flags = NEEDS_PERMIT | DROPDEL | ABSTRACT | NO_MAT_REDEMPTION resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 3 light_power = 1 max_charges = 1 diff --git a/monkestation/code/game/objects/items/miningweapons.dm b/monkestation/code/game/objects/items/miningweapons.dm index e75d782c75bc..fa46d9380358 100644 --- a/monkestation/code/game/objects/items/miningweapons.dm +++ b/monkestation/code/game/objects/items/miningweapons.dm @@ -25,7 +25,7 @@ sharpness = SHARP_EDGED actions_types = list(/datum/action/item_action/toggle_light) obj_flags = NONE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 5 light_on = FALSE charged = TRUE @@ -68,7 +68,7 @@ sharpness = SHARP_EDGED actions_types = list(/datum/action/item_action/toggle_light) obj_flags = UNIQUE_RENAME - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 8 light_on = FALSE charged = TRUE @@ -117,7 +117,7 @@ sharpness = NONE actions_types = list(/datum/action/item_action/toggle_light) obj_flags = UNIQUE_RENAME - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 5 light_on = FALSE charged = TRUE @@ -170,7 +170,7 @@ sharpness = SHARP_POINTY actions_types = list(/datum/action/item_action/toggle_light) obj_flags = UNIQUE_RENAME - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 4 light_on = FALSE charged = TRUE diff --git a/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm b/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm index 3ac5b1964ed6..6443ef06db38 100644 --- a/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm +++ b/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm @@ -44,7 +44,7 @@ ARTIFACT_SETUP(/obj/structure/artifact, SSobj) /obj/structure/artifact/lamp assoc_comp = /datum/component/artifact/lamp - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_on = FALSE /obj/structure/artifact/repulsor diff --git a/monkestation/code/modules/bloodsuckers/monster_hunters/hunter_weapons.dm b/monkestation/code/modules/bloodsuckers/monster_hunters/hunter_weapons.dm index 124dc71aa4ac..b254e7d2e435 100644 --- a/monkestation/code/modules/bloodsuckers/monster_hunters/hunter_weapons.dm +++ b/monkestation/code/modules/bloodsuckers/monster_hunters/hunter_weapons.dm @@ -45,7 +45,7 @@ block_chance = 20 on_force = 20 base_force = 17 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_color = "#59b3c9" light_outer_range = 2 light_power = 2 @@ -118,7 +118,7 @@ icon = 'icons/effects/effects.dmi' icon_state = "plasmasoul" damage = 25 - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 2 light_power = 1 light_color = "#44acb1" diff --git a/monkestation/code/modules/clothing/spacesuits/hardsuits/_helmet.dm b/monkestation/code/modules/clothing/spacesuits/hardsuits/_helmet.dm index 9e0fa7b478a1..69827e11db83 100644 --- a/monkestation/code/modules/clothing/spacesuits/hardsuits/_helmet.dm +++ b/monkestation/code/modules/clothing/spacesuits/hardsuits/_helmet.dm @@ -6,7 +6,7 @@ icon_state = "hardsuit0-engineering" max_integrity = 300 armor_type = /datum/armor/hardsuit - light_system = MOVABLE_LIGHT_DIRECTIONAL + light_system = OVERLAY_LIGHT_DIRECTIONAL light_outer_range = 4 light_power = 1 light_on = FALSE diff --git a/monkestation/code/modules/outdoors/code/sunlight/sunlight_object.dm b/monkestation/code/modules/outdoors/code/sunlight/sunlight_object.dm index e9987e6c4d35..16327bb51733 100644 --- a/monkestation/code/modules/outdoors/code/sunlight/sunlight_object.dm +++ b/monkestation/code/modules/outdoors/code/sunlight/sunlight_object.dm @@ -17,6 +17,22 @@ Sunlight System Emits light to SKY_BLOCKED tiles, and fully white to display the overlay color */ +// Keep in mind. Lighting corners accept the bottom left (northwest) set of cords to them as input +#define GENERATE_MISSING_CORNERS(gen_for) \ + if (!gen_for.lighting_corner_NE) { \ + gen_for.lighting_corner_NE = new /datum/lighting_corner(gen_for.x, gen_for.y, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_SE) { \ + gen_for.lighting_corner_SE = new /datum/lighting_corner(gen_for.x, gen_for.y - 1, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_SW) { \ + gen_for.lighting_corner_SW = new /datum/lighting_corner(gen_for.x - 1, gen_for.y - 1, gen_for.z); \ + } \ + if (!gen_for.lighting_corner_NW) { \ + gen_for.lighting_corner_NW = new /datum/lighting_corner(gen_for.x - 1, gen_for.y, gen_for.z); \ + } \ + gen_for.lighting_corners_initialised = TRUE; + /atom/movable/outdoor_effect name = "" mouse_opacity = 0 @@ -105,7 +121,7 @@ Sunlight System if(IS_OPAQUE_TURF(T)) /* get_corners used to do opacity checks for arse */ continue if (!T.lighting_corners_initialised) - T.generate_missing_corners() + GENERATE_MISSING_CORNERS(T) corners |= T.lighting_corner_NE corners |= T.lighting_corner_SE corners |= T.lighting_corner_SW @@ -383,3 +399,4 @@ Sunlight System #undef SUN_FALLOFF #undef hardSun +#undef GENERATE_MISSING_CORNERS diff --git a/monkestation/code/modules/security/code/weapons/lawbringer.dm b/monkestation/code/modules/security/code/weapons/lawbringer.dm index 7ea8e68406a1..d731efdbfea0 100644 --- a/monkestation/code/modules/security/code/weapons/lawbringer.dm +++ b/monkestation/code/modules/security/code/weapons/lawbringer.dm @@ -352,7 +352,7 @@ name = "hyperfocused disabler beam" icon_state = "gauss_silenced" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT damage = 0 damage_type = STAMINA stamina = 40 @@ -368,7 +368,7 @@ ricochet_shoots_firer = FALSE //something something biometrics impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser reflectable = REFLECT_NORMAL - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 1 light_color = LIGHT_COLOR_BLUE @@ -570,7 +570,7 @@ hitsound = 'sound/weapons/tap.ogg' impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser reflectable = REFLECT_NORMAL - light_system = MOVABLE_LIGHT + light_system = OVERLAY_LIGHT light_outer_range = 1 light_power = 1 light_color = LIGHT_COLOR_HALOGEN diff --git a/monkestation/code/modules/visual_changes/explosions.dm b/monkestation/code/modules/visual_changes/explosions.dm index 338b6d94c8ef..3a9678305953 100644 --- a/monkestation/code/modules/visual_changes/explosions.dm +++ b/monkestation/code/modules/visual_changes/explosions.dm @@ -228,7 +228,7 @@ name = "boom" icon = 'icons/effects/96x96.dmi' icon_state = "explosion" - light_system = STATIC_LIGHT + light_system = COMPLEX_LIGHT duration = 25 ///smoke wave particle holder var/obj/effect/abstract/particle_holder/smoke_wave