From 1bbd25c2861e4a6982c336b066073eb48295e32c Mon Sep 17 00:00:00 2001 From: GrrrKitten Date: Wed, 13 Mar 2024 19:40:42 -0400 Subject: [PATCH 1/7] adds shockwaves to explosions via Tivi+Ivanmixo --- code/__DEFINES/layers.dm | 3 +++ code/__DEFINES/qdel.dm | 1 + code/_onclick/hud/rendering/plane_master.dm | 7 +++++++ code/_onclick/hud/rendering/render_plate.dm | 4 ++++ code/datums/autocells/explosion.dm | 3 +++ code/game/objects/effects/temporary_visuals.dm | 17 +++++++++++++++++ 6 files changed, 35 insertions(+) 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/__DEFINES/qdel.dm b/code/__DEFINES/qdel.dm index 2093f80be50e..624602307b9f 100644 --- a/code/__DEFINES/qdel.dm +++ b/code/__DEFINES/qdel.dm @@ -54,6 +54,7 @@ #define QDESTROYING(X) (!X || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) #define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE) +#define QDEL_IN_STOPPABLE(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE) #define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME) #define QDEL_NULL(item) qdel(item); item = null #define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) }}; if(x) {x.Cut(); x = null } // Second x check to handle items that LAZYREMOVE on qdel. 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..a449dbdc843c 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/temp_visual/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..6aca5453e6fa 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -96,3 +96,20 @@ splatter_type = "csplatter" color = BLOOD_COLOR_SYNTHETIC +//------------------------------------------ +//Shockwaves +//------------------------------------------ + +/obj/effect/temp_visual/shockwave + icon = 'icons/effects/light_overlays/shockwave.dmi' + icon_state = "shockwave" + plane = DISPLACEMENT_PLATE_RENDER_LAYER + pixel_x = -496 + pixel_y = -496 + +/obj/effect/temp_visual/shockwave/Initialize(mapload, radius) + . = ..() + deltimer(timerid) + timerid = QDEL_IN_STOPPABLE(src, 0.5 * radius) + transform = matrix().Scale(32 / 1024, 32 / 1024) + animate(src, time = 1/2 * radius, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5)) From 85d466cf6bb74efb570c097a441458666cac54ee Mon Sep 17 00:00:00 2001 From: GrrrKitten <158611449+GrrrKitten@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:25:18 -0400 Subject: [PATCH 2/7] Update code/datums/autocells/explosion.dm Co-authored-by: harryob --- code/datums/autocells/explosion.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/autocells/explosion.dm b/code/datums/autocells/explosion.dm index a449dbdc843c..ecc6f9925800 100644 --- a/code/datums/autocells/explosion.dm +++ b/code/datums/autocells/explosion.dm @@ -283,7 +283,7 @@ as having entered the turf. return if(power >= 150) //shockwave for anything over 150 power - new /obj/effect/temp_visual/shockwave(epicenter, power/60) + new /obj/effect/shockwave(epicenter, power/60) E.power = power E.power_falloff = falloff From bfa87657038bdbdc952f47b86bd7d7bb68283041 Mon Sep 17 00:00:00 2001 From: GrrrKitten <158611449+GrrrKitten@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:25:29 -0400 Subject: [PATCH 3/7] Update code/game/objects/effects/temporary_visuals.dm Co-authored-by: harryob --- code/game/objects/effects/temporary_visuals.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index 6aca5453e6fa..f08b8ba436d7 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -110,6 +110,6 @@ /obj/effect/temp_visual/shockwave/Initialize(mapload, radius) . = ..() deltimer(timerid) - timerid = QDEL_IN_STOPPABLE(src, 0.5 * radius) + QDEL_IN(src, 0.5 * radius) transform = matrix().Scale(32 / 1024, 32 / 1024) animate(src, time = 1/2 * radius, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5)) From d5bd4f349392712e706802d2d2562a2ef395dd99 Mon Sep 17 00:00:00 2001 From: GrrrKitten <158611449+GrrrKitten@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:26:05 -0400 Subject: [PATCH 4/7] Update code/game/objects/effects/temporary_visuals.dm Co-authored-by: harryob --- code/game/objects/effects/temporary_visuals.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index f08b8ba436d7..45a48a6f01af 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -100,14 +100,14 @@ //Shockwaves //------------------------------------------ -/obj/effect/temp_visual/shockwave +/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/temp_visual/shockwave/Initialize(mapload, radius) +/obj/effect/shockwave/Initialize(mapload, radius) . = ..() deltimer(timerid) QDEL_IN(src, 0.5 * radius) From f7eb8e6dc0a3548a5c7c1b6529c9f7d0fff4d1fb Mon Sep 17 00:00:00 2001 From: GrrrKitten Date: Mon, 25 Mar 2024 22:26:39 -0400 Subject: [PATCH 5/7] removes qdel in stoppable --- code/__DEFINES/qdel.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/__DEFINES/qdel.dm b/code/__DEFINES/qdel.dm index 624602307b9f..2093f80be50e 100644 --- a/code/__DEFINES/qdel.dm +++ b/code/__DEFINES/qdel.dm @@ -54,7 +54,6 @@ #define QDESTROYING(X) (!X || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) #define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE) -#define QDEL_IN_STOPPABLE(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE) #define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME) #define QDEL_NULL(item) qdel(item); item = null #define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) }}; if(x) {x.Cut(); x = null } // Second x check to handle items that LAZYREMOVE on qdel. From 8dba9adaa4ad24e2d9a8c502da970c856149faa1 Mon Sep 17 00:00:00 2001 From: GrrrKitten Date: Mon, 25 Mar 2024 22:55:17 -0400 Subject: [PATCH 6/7] whoopsies forgot to commit --- code/game/objects/effects/temporary_visuals.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index 45a48a6f01af..af3f3692587f 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -109,7 +109,6 @@ /obj/effect/shockwave/Initialize(mapload, radius) . = ..() - deltimer(timerid) QDEL_IN(src, 0.5 * radius) transform = matrix().Scale(32 / 1024, 32 / 1024) animate(src, time = 1/2 * radius, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5)) From 96d088437b22290c0b3cd88248a2927c26828326 Mon Sep 17 00:00:00 2001 From: GrrrKitten Date: Tue, 26 Mar 2024 15:16:38 -0400 Subject: [PATCH 7/7] adds shockwaves to xeno screeches (queen + predalien) --- .../game/objects/effects/temporary_visuals.dm | 12 +++- .../mob/living/carbon/xenomorph/Abilities.dm | 2 +- .../abilities/predalien/predalien_powers.dm | 3 +- .../living/carbon/xenomorph/update_icons.dm | 60 +++++++++++-------- 4 files changed, 46 insertions(+), 31 deletions(-) diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index af3f3692587f..9357476c5c68 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -107,8 +107,14 @@ pixel_x = -496 pixel_y = -496 -/obj/effect/shockwave/Initialize(mapload, radius) +/obj/effect/shockwave/Initialize(mapload, radius, speed, y_offset, x_offset) . = ..() - QDEL_IN(src, 0.5 * radius) + 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 = 1/2 * radius, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5)) + 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 806b0646590d..e2c6e361bbb2 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, 21) //Adds the visual effect. Wom wom wom, 21 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..7ab69bd28288 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, 10) //Adds the visual effect. Wom wom wom, 10 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 571f261ab981..abd5cb846002 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -196,31 +196,41 @@ 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 + + //shockwaves are iterated, counting down once per shriekwave, with the total amount being determined on the respective xeno ability tile + if(shriekwaves_left > 18) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, 11, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 2) + return + if(shriekwaves_left > 12) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, 10, 0.5, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 2) + return + if(shriekwaves_left > 4) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, 9, 0.7, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 2) + return + if(shriekwaves_left > 1) + shriekwaves_left-- + new /obj/effect/shockwave(epicenter, 7.5, 0.7, offset_y) + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 2) + return + if(shriekwaves_left == 1) + shriekwaves_left-- + addtimer(CALLBACK(src, PROC_REF(create_shriekwave), epicenter, shriekwaves_left), 1) /mob/living/carbon/xenomorph/proc/create_stomp() remove_suit_layer()