Singularity hotfix (#18295)

* Budget singularity gravitational lensing

Added singularity effect layer and displacement map

* Fixed lighting bug and made gravitational singularity its own object class

Removed line that was accidentally clearing all lighting filters and moved singularity effects into singularity/gravitational because other objects that inherit from singularity (i.e. narsie) was also inheriting the visual effects.
This commit is contained in:
Kaithyl
2023-03-20 11:55:03 -07:00
committed by GitHub
parent 960aaf2469
commit c8ad2e98ae
7 changed files with 80 additions and 3 deletions

View File

@@ -8,6 +8,9 @@
#define PLANE_SPACE_PARALLAX -90
#define PLANE_SPACE_PARALLAX_RENDER_TARGET "PLANE_SPACE_PARALLAX"
#define SINGULARITY_EFFECT_PLANE -80
#define SINGULARITY_RENDER_TARGET "*SINGULARITY_EFFECTS_PLANE"
#define FLOOR_PLANE -2
#define FLOOR_PLANE_RENDER_TARGET "FLOOR_PLANE"
#define GAME_PLANE -1

View File

@@ -9,6 +9,7 @@
/obj/effect,
/obj/docking_port,
/obj/item/projectile,
/atom/movable/gravity_lens
))
var/list/processing_list = list(location)
. = list()

View File

@@ -51,6 +51,8 @@
filters = list()
if(istype(mymob) && mymob.eye_blurry)
filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3))
// Should be moved to the world render plate when render plates get ported in
filters += filter(type="displace", render_source = SINGULARITY_RENDER_TARGET, size=75)
///Contains most things in the game world
/atom/movable/screen/plane_master/game_world
@@ -65,6 +67,8 @@
filters += AMBIENT_OCCLUSION
if(istype(mymob) && mymob.eye_blurry)
filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3))
// Should be moved to the world render plate when render plates get ported in
filters += filter(type="displace", render_source = SINGULARITY_RENDER_TARGET, size=75)
///Contains all lighting objects
@@ -79,6 +83,8 @@
filters += filter(type="alpha", render_source = EMISSIVE_RENDER_TARGET, flags = MASK_INVERSE)
filters += filter(type="alpha", render_source = EMISSIVE_UNBLOCKABLE_RENDER_TARGET, flags = MASK_INVERSE)
filters += filter(type="alpha", render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE)
// Should be moved to the world render plate when render plates get ported in
filters += filter(type="displace", render_source = SINGULARITY_RENDER_TARGET, size=75)
/**
* Things placed on this mask the lighting plane. Doesn't render directly.
@@ -95,6 +101,8 @@
/atom/movable/screen/plane_master/emissive/Initialize()
. = ..()
filters += filter(type="alpha", render_source=EMISSIVE_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
// Should be moved to the world render plate when render plates get ported in
filters += filter(type="displace", render_source = SINGULARITY_RENDER_TARGET, size=75)
/**
* Things placed on this always mask the lighting plane. Doesn't render directly.
@@ -131,6 +139,8 @@
. = ..()
if(HAS_TRAIT(SSstation, STATION_TRAIT_STATION_ADRIFT))
SpinAnimation(15 MINUTES)
// Should be moved to the world render plate when render plates get ported in
filters += filter(type="displace", render_source = SINGULARITY_RENDER_TARGET, size=75)
/atom/movable/screen/plane_master/parallax_white
name = "parallax whitifier plane master"
@@ -140,6 +150,12 @@
mymob.overlay_fullscreen("lighting_backdrop_lit", /atom/movable/screen/fullscreen/lighting_backdrop/lit)
mymob.overlay_fullscreen("lighting_backdrop_unlit", /atom/movable/screen/fullscreen/lighting_backdrop/unlit)
/atom/movable/screen/plane_master/singularity_effect
name = "singularity plane master"
plane = SINGULARITY_EFFECT_PLANE
render_target = SINGULARITY_RENDER_TARGET
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/atom/movable/screen/plane_master/camera_static
name = "camera static plane master"
plane = CAMERA_STATIC_PLANE

View File

@@ -624,7 +624,7 @@
. = ..()
if(proximity_flag)
var/turf/T = get_turf(target)
var/obj/singularity/S = new(T)
var/obj/singularity/gravitational/S = new(T)
S.consume(target)
else
return FALSE
@@ -632,7 +632,7 @@
/obj/item/melee/singularity_sword/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..()
var/turf/T = get_turf(hit_atom)
var/obj/singularity/S = new(T)
var/obj/singularity/gravitational/S = new(T)
S.consume(hit_atom)
/// Simple whip that does additional damage(8 brute to be exact) to simple animals

View File

@@ -15,7 +15,7 @@
buckle_requires_restraints = TRUE
var/energy = 0
var/creation_type = /obj/singularity
var/creation_type = /obj/singularity/gravitational
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
if(W.tool_behaviour == TOOL_WRENCH)

View File

@@ -3,6 +3,14 @@
#define SINGULARITY_INTEREST_OBJECT 7.5
#define SINGULARITY_INTEREST_NONSPACE 2
/atom/movable/gravity_lens
plane = SINGULARITY_EFFECT_PLANE
//plane = GHOST_LAYER
appearance_flags = PIXEL_SCALE | RESET_TRANSFORM
icon = 'icons/effects/512x512.dmi'
icon_state = "gravitational_lensing"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/singularity
name = "gravitational singularity"
desc = "A gravitational singularity."
@@ -37,6 +45,8 @@
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION
var/atom/movable/gravity_lens/grav_lens
/obj/singularity/Initialize(mapload, starting_energy = 50)
//CARN: admin-alert for chuckle-fuckery.
admin_investigate_setup()
@@ -57,6 +67,9 @@
var/shardstage = text2path("/obj/item/singularity_shard/stage[maxStage]")
var/turf/T = get_turf(src)
new shardstage(T, src)
if(grav_lens)
vis_contents -= grav_lens
QDEL_NULL(grav_lens)
STOP_PROCESSING(SSobj, src)
GLOB.poi_list.Remove(src)
GLOB.singularities.Remove(src)
@@ -203,6 +216,10 @@
dissipate_strength = 1
if(maxStage < 1)
maxStage = 1
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(0.5), time = 10)
grav_lens.pixel_x = -240
grav_lens.pixel_y = -240
if(STAGE_TWO)
if(check_cardinals_range(1, TRUE))
current_size = STAGE_TWO
@@ -217,6 +234,11 @@
dissipate_strength = 5
if(maxStage < 2)
maxStage = 2
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(0.75), time = 10)
grav_lens.pixel_x = -208
grav_lens.pixel_y = -208
grav_lens.filters = list()
if(STAGE_THREE)
if(check_cardinals_range(2, TRUE))
current_size = STAGE_THREE
@@ -231,6 +253,10 @@
dissipate_strength = 20
if(maxStage < 3)
maxStage = 3
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(1), time = 10)
grav_lens.pixel_x = -176
grav_lens.pixel_y = -176
if(STAGE_FOUR)
if(check_cardinals_range(3, TRUE))
current_size = STAGE_FOUR
@@ -245,6 +271,10 @@
dissipate_strength = 10
if(maxStage < 4)
maxStage = 4
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(1.25), time = 10)
grav_lens.pixel_x = -144
grav_lens.pixel_y = -144
if(STAGE_FIVE)//this one also lacks a check for gens because it eats everything
current_size = STAGE_FIVE
icon = 'icons/effects/288x288.dmi'
@@ -256,6 +286,10 @@
dissipate = 0 //It cant go smaller due to e loss
if(maxStage < 5)
maxStage = 5
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(1.5), time = 10)
grav_lens.pixel_x = -112
grav_lens.pixel_y = -112
if(STAGE_SIX) //This only happens if a stage 5 singulo consumes a supermatter shard.
current_size = STAGE_SIX
icon = 'icons/effects/352x352.dmi'
@@ -267,6 +301,10 @@
dissipate = 0
if(maxStage < 6)
maxStage = 6
if(grav_lens)
animate(grav_lens, transform = matrix().Scale(1.75), time = 10)
grav_lens.pixel_x = -80
grav_lens.pixel_y = -80
if(current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size]</font>", INVESTIGATE_SINGULO)
return 1
@@ -519,6 +557,25 @@
qdel(src)
return(gain)
/obj/singularity/gravitational
name = "gravitational singularity"
desc = "A gravitational singularity."
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
/obj/singularity/gravitational/Initialize(mapload, starting_energy)
. = ..()
if (!grav_lens)
grav_lens = new(src)
grav_lens.transform = matrix().Scale(0.5)
grav_lens.pixel_x = -240
grav_lens.pixel_y = -240
// Radioactive green glow messes with the displacement map
/*var/datum/component/radioactive/c = grav_lens.GetComponent(/datum/component/radioactive)
if(c)
c.RemoveComponent()*/
vis_contents += grav_lens
/obj/item/singularity_shard
name = "singularity shard"
desc = "THIS SHOULDN'T EXIST. TELL A CODER HOW YOU GOT THIS."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 KiB

After

Width:  |  Height:  |  Size: 546 KiB