diff --git a/code/game/objects/effects/temporary_visuals.dm b/code/game/objects/effects/temporary_visuals.dm index d05e7789b1d5..7117f12a932d 100644 --- a/code/game/objects/effects/temporary_visuals.dm +++ b/code/game/objects/effects/temporary_visuals.dm @@ -119,3 +119,17 @@ 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), easing = easing_type) +//------------------------------------------ +//Block +//------------------------------------------ + +/obj/effect/temp_visual/block //color is white by default, set to whatever is needed + name = "blocking glow" + icon_state = "block" + color = COLOR_YELLOW + duration = 6.7 + +/obj/effect/temp_visual/block/Initialize(mapload) + . = ..() + pixel_x = rand(-12, 12) + pixel_y = rand(-9, 0) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 09ce5bb9c149..414238ee9941 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -94,6 +94,8 @@ Contains most of the procs that are called when a mob is attacked by something return FALSE /mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", combistick=0) + var/block_effect = /obj/effect/temp_visual/block + var/owner_turf = get_turf(src) if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3) if(combistick && istype(l_hand,/obj/item/weapon/yautja/combistick) && prob(66)) var/obj/item/weapon/yautja/combistick/C = l_hand @@ -110,12 +112,16 @@ Contains most of the procs that are called when a mob is attacked by something shield_blocked_l = TRUE if(shield_blocked_l) + new block_effect(owner_turf) + playsound(src, 'sound/items/block_shield.ogg', 70, vary = TRUE) visible_message(SPAN_DANGER("[src] blocks [attack_text] with the [l_hand.name]!"), null, null, 5) return TRUE // We cannot return FALSE on fail here, because we haven't checked r_hand yet. Dual-wielding shields perhaps! var/obj/item/weapon/I = l_hand if(I.IsShield() && !istype(I, /obj/item/weapon/shield) && (prob(50 - floor(damage / 3)))) // 'other' shields, like predweapons. Make sure that item/weapon/shield does not apply here, no double-rolls. + new block_effect(owner_turf) + playsound(src, 'sound/items/parry.ogg', 70, vary = TRUE) visible_message(SPAN_DANGER("[src] blocks [attack_text] with the [l_hand.name]!"), null, null, 5) return TRUE @@ -135,11 +141,15 @@ Contains most of the procs that are called when a mob is attacked by something shield_blocked_r = TRUE if(shield_blocked_r) + new block_effect(owner_turf) + playsound(src, 'sound/items/block_shield.ogg', 70, vary = TRUE) visible_message(SPAN_DANGER("[src] blocks [attack_text] with the [r_hand.name]!"), null, null, 5) return TRUE var/obj/item/weapon/I = r_hand if(I.IsShield() && !istype(I, /obj/item/weapon/shield) && (prob(50 - floor(damage / 3)))) // other shields. Don't doublecheck activable here. + new block_effect(owner_turf) + playsound(src, 'sound/items/parry.ogg', 70, vary = TRUE) visible_message(SPAN_DANGER("[src] blocks [attack_text] with the [r_hand.name]!"), null, null, 5) return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index de0cefeea76d..d42ec40d410c 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -34,7 +34,6 @@ if(check_shields(0, attacking_xeno.name)) // Blocking check attacking_xeno.visible_message(SPAN_DANGER("[attacking_xeno]'s grab is blocked by [src]'s shield!"), \ SPAN_DANGER("Our grab was blocked by [src]'s shield!"), null, 5, CHAT_TYPE_XENO_COMBAT) - playsound(loc, 'sound/weapons/alien_claw_block.ogg', 25, 1) //Feedback return XENO_ATTACK_ACTION if(Adjacent(attacking_xeno)) //Logic! @@ -64,7 +63,6 @@ if(check_shields(0, attacking_xeno.name)) // Blocking check attacking_xeno.visible_message(SPAN_DANGER("[attacking_xeno]'s slash is blocked by [src]'s shield!"), \ SPAN_DANGER("Our slash is blocked by [src]'s shield!"), null, 5, CHAT_TYPE_XENO_COMBAT) - playsound(loc, 'sound/weapons/alien_claw_block.ogg', 25, 1) //Feedback return XENO_ATTACK_ACTION //From this point, we are certain a full attack will go out. Calculate damage and modifiers @@ -186,7 +184,6 @@ if(check_shields(0, attacking_xeno.name)) // Blocking check attacking_xeno.visible_message(SPAN_DANGER("[attacking_xeno]'s tackle is blocked by [src]'s shield!"), \ SPAN_DANGER("We tackle is blocked by [src]'s shield!"), null, 5, CHAT_TYPE_XENO_COMBAT) - playsound(loc, 'sound/weapons/alien_claw_block.ogg', 25, 1) //Feedback return XENO_ATTACK_ACTION attacking_xeno.flick_attack_overlay(src, "disarm") diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index 692fc5e49405..9842357a5c0e 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ diff --git a/sound/items/block_shield.ogg b/sound/items/block_shield.ogg new file mode 100644 index 000000000000..86b0bda6fd9f Binary files /dev/null and b/sound/items/block_shield.ogg differ diff --git a/sound/items/parry.ogg b/sound/items/parry.ogg new file mode 100644 index 000000000000..f9d5638b85f7 Binary files /dev/null and b/sound/items/parry.ogg differ