Dswords now return melee attack on parry. Eswords reflect lasers on parry. Throwing bodies at a dsword user may not work well (#21463)

This commit is contained in:
Qwertytoforty
2023-07-01 10:42:44 +02:00
committed by GitHub
parent eee90b49d8
commit 04e1792d0d
3 changed files with 44 additions and 3 deletions
@@ -228,6 +228,24 @@
else
to_chat(user, "<span class='warning'>It's already fabulous!</span>")
/obj/item/melee/energy/sword/saber/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(!active)
return FALSE
. = ..()
if(!.) // they did not block the attack
return
if(istype(hitby, /obj/item/projectile))
var/obj/item/projectile/P = hitby
if(P.reflectability == REFLECTABILITY_NEVER) //only 1 magic spell does this, but hey, needed
owner.visible_message("<span class='danger'>[owner] blocks [attack_text] with [src]!</span>")
playsound(src, 'sound/weapons/effects/ric3.ogg', 100, TRUE)
return TRUE
owner.visible_message("<span class='danger'>[owner] parries [attack_text] with [src]!</span>")
add_attack_logs(P.firer, src, "hit by [P.type] but got parried by [src]")
return -1
return TRUE
/obj/item/melee/energy/sword/pirate
name = "energy cutlass"
desc = "Arrrr matey."
+17 -3
View File
@@ -334,9 +334,23 @@
sleep(1)
/obj/item/twohanded/dualsaber/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(wielded)
return ..()
return FALSE
if(!wielded)
return FALSE
. = ..()
if(!.) // they did not block the attack
return
if(attack_type == THROWN_PROJECTILE_ATTACK)
if(!isitem(hitby))
return TRUE
var/obj/item/TT = hitby
addtimer(CALLBACK(TT, TYPE_PROC_REF(/atom/movable, throw_at), locateUID(TT.thrownby), 10, 4, owner), 0.2 SECONDS) //Timer set to 0.2 seconds to ensure item finshes the throwing to prevent double embeds
return TRUE
if(isitem(hitby))
melee_attack_chain(owner, hitby.loc)
else
melee_attack_chain(owner, hitby)
return TRUE
/obj/item/twohanded/dualsaber/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE) //In case thats just so happens that it is still activated on the groud, prevents hulk from picking it up
if(wielded)
+9
View File
@@ -625,6 +625,15 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
hit_atom.hit_by_thrown_carbon(src, throwingdatum, damage, FALSE, FALSE)
/mob/living/carbon/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
for(var/obj/item/twohanded/dualsaber/D in contents)
if(D.wielded)
visible_message("<span class='danger'>[src] impales [C] with [D], before dropping them on the ground!</span>")
C.apply_damage(100, BRUTE, "chest", sharp = TRUE, used_weapon = "Impaled on [D].")
C.Stun(2 SECONDS) //Punishment. This could also be used by a traitor to throw someone into a dsword to kill them, but hey, teamwork!
C.KnockDown(6 SECONDS)
D.melee_attack_chain(src, C) //attack animation / jedi spin
C.emote("scream")
return
. = ..()
KnockDown(3 SECONDS)