diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 63e79cdf676d..ee958d87f580 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -11,6 +11,9 @@ //#define AREA_LAYER 1 +#define DISPLACEMENT_PLATE_RENDER_LAYER 1 +#define DISPLACEMENT_PLATE_RENDER_TARGET "*DISPLACEMENT_PLATE_RENDER_TARGET" + #define UNDER_TURF_LAYER 1.99 #define TURF_LAYER 2 diff --git a/code/_onclick/hud/rendering/plane_master.dm b/code/_onclick/hud/rendering/plane_master.dm index 6625120d1514..c4f070bdd842 100644 --- a/code/_onclick/hud/rendering/plane_master.dm +++ b/code/_onclick/hud/rendering/plane_master.dm @@ -189,3 +189,10 @@ plane = ESCAPE_MENU_PLANE appearance_flags = PLANE_MASTER|NO_CLIENT_COLOR render_relay_plane = RENDER_PLANE_MASTER + +/atom/movable/screen/plane_master/displacement + name = "displacement plane" + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + plane = DISPLACEMENT_PLATE_RENDER_LAYER + render_target = DISPLACEMENT_PLATE_RENDER_TARGET + render_relay_plane = null diff --git a/code/_onclick/hud/rendering/render_plate.dm b/code/_onclick/hud/rendering/render_plate.dm index 18236c6ee759..cb579eb4ff6a 100644 --- a/code/_onclick/hud/rendering/render_plate.dm +++ b/code/_onclick/hud/rendering/render_plate.dm @@ -39,6 +39,10 @@ plane = RENDER_PLANE_GAME render_relay_plane = RENDER_PLANE_MASTER +/atom/movable/screen/plane_master/rendering_plate/game_world/Initialize(mapload, datum/hud/hud_owner) + . = ..() + add_filter("displacer", 1, displacement_map_filter(render_source = DISPLACEMENT_PLATE_RENDER_TARGET, size = 10)) + ///render plate for OOC stuff like ghosts, hud-screen effects, etc /atom/movable/screen/plane_master/rendering_plate/non_game name = "non-game rendering plate" diff --git a/code/datums/autocells/explosion.dm b/code/datums/autocells/explosion.dm index 367567a6d40d..ecc6f9925800 100644 --- a/code/datums/autocells/explosion.dm +++ b/code/datums/autocells/explosion.dm @@ -282,6 +282,9 @@ as having entered the turf. if(QDELETED(E)) return + if(power >= 150) //shockwave for anything over 150 power + new /obj/effect/shockwave(epicenter, power/60) + E.power = power E.power_falloff = falloff E.falloff_shape = falloff_shape diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index 4dc07b76f3cb..9357476c5c68 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -96,3 +96,25 @@ splatter_type = "csplatter" color = BLOOD_COLOR_SYNTHETIC +//------------------------------------------ +//Shockwaves +//------------------------------------------ + +/obj/effect/shockwave + icon = 'icons/effects/light_overlays/shockwave.dmi' + icon_state = "shockwave" + plane = DISPLACEMENT_PLATE_RENDER_LAYER + pixel_x = -496 + pixel_y = -496 + +/obj/effect/shockwave/Initialize(mapload, radius, speed, y_offset, x_offset) + . = ..() + if(!speed) + speed = 1 + if(y_offset) + pixel_y += y_offset + if(x_offset) + pixel_x += x_offset + QDEL_IN(src, 0.5 * radius * speed) + transform = matrix().Scale(32 / 1024, 32 / 1024) + animate(src, time = 0.5 * radius * speed, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5)) diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index 3bf0c67ef721..84d233881487 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -142,7 +142,7 @@ playsound(xeno.loc, pick(xeno.screech_sound_effect_list), 75, 0, status = 0) xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] emits an ear-splitting guttural roar!")) - xeno.create_shriekwave() //Adds the visual effect. Wom wom wom + xeno.create_shriekwave(xeno, 15) //Adds the visual effect. Wom wom wom, 15 shriekwaves for(var/mob/mob in view()) if(mob && mob.client) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index 6e6fef86a2f4..c64634b9a9bd 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -12,8 +12,7 @@ playsound(xeno.loc, pick(predalien_roar), 75, 0, status = 0) xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] emits a guttural roar!")) - xeno.create_shriekwave(color = "#FF0000") - + xeno.create_shriekwave(xeno, 8) //Adds the visual effect. Wom wom wom, 8 shriekwaves for(var/mob/living/carbon/carbon in view(7, xeno)) if(ishuman(carbon)) var/mob/living/carbon/human/human = carbon diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index cf84312657a3..665bdfccf234 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -207,31 +207,45 @@ overlays_standing[X_LEGCUFF_LAYER] = image("icon" = 'icons/mob/xenos/effects.dmi', "icon_state" = "legcuff", "layer" =-X_LEGCUFF_LAYER) apply_overlay(X_LEGCUFF_LAYER) -/mob/living/carbon/xenomorph/proc/create_shriekwave(color = null) - var/image/screech_image - - var/offset_x = 0 - var/offset_y = 0 - if(mob_size <= MOB_SIZE_XENO) - offset_x = -7 - offset_y = -10 - - if (color) - screech_image = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state" = "shriek_waves_greyscale") // For Praetorian screech - screech_image.color = color - else - screech_image = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state" = "shriek_waves") //Ehh, suit layer's not being used. - - screech_image.pixel_x = offset_x - screech_image.pixel_y = offset_y - - screech_image.appearance_flags |= RESET_COLOR - - remove_suit_layer() - - overlays_standing[X_SUIT_LAYER] = screech_image - apply_overlay(X_SUIT_LAYER) - addtimer(CALLBACK(src, PROC_REF(remove_overlay), X_SUIT_LAYER), 30) +/mob/living/carbon/xenomorph/proc/create_shriekwave(shrieking_xeno, shriekwaves_left) + var/offset_y = 8 + if(mob_size == MOB_SIZE_XENO) + offset_y = 24 + if(mob_size == MOB_SIZE_IMMOBILE) + offset_y = 28 + + //the shockwave center is updated eachtime shockwave is called and offset relative to the mob_size. + //due to the speed of the shockwaves, it isn't required to be tied to the exact mob movements + var/epicenter = src.loc ///center of the shockwave, set at the center of the tile that the mob is currently standing on + var/stage1_radius = rand(11, 12) + var/stage2_radius = rand(9, 11) + var/stage3_radius = rand(8, 10) + var/stage4_radius = 7.5 + + //shockwaves are iterated, counting down once per shriekwave, with the total amount being determined on the respective xeno ability tile + if(shriekwaves_left > 12) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, stage1_radius, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 2) + return + if(shriekwaves_left > 8) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, stage2_radius, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 3) + return + if(shriekwaves_left > 4) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, stage3_radius, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 3) + return + if(shriekwaves_left > 1) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, stage4_radius, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 3) + return + if(shriekwaves_left == 1) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, 10, 0.6, offset_y) /mob/living/carbon/xenomorph/proc/create_stomp() remove_suit_layer()