From 96d088437b22290c0b3cd88248a2927c26828326 Mon Sep 17 00:00:00 2001 From: GrrrKitten Date: Tue, 26 Mar 2024 15:16:38 -0400 Subject: [PATCH] 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()