Most compoennts/elements that register COMSIG_PROJECTILE_ON_HIT can now be applied to turrets and projectile spells (#68238)

expands elements that register COMSIG_PROJECTILE_ON_HIT
This commit is contained in:
Y0SH1M4S73R
2022-07-16 02:59:36 -04:00
committed by GitHub
parent 8ec444f191
commit 111b1ffe01
12 changed files with 47 additions and 22 deletions
@@ -165,9 +165,9 @@
/datum/action/cooldown/spell/pointed/projectile/proc/ready_projectile(obj/projectile/to_fire, atom/target, mob/user, iteration)
to_fire.firer = owner
to_fire.fired_from = get_turf(owner)
to_fire.fired_from = src
to_fire.preparePixelProjectile(target, owner)
RegisterSignal(to_fire, COMSIG_PROJECTILE_ON_HIT, .proc/on_cast_hit)
RegisterSignal(to_fire, COMSIG_PROJECTILE_SELF_ON_HIT, .proc/on_cast_hit)
if(istype(to_fire, /obj/projectile/magic))
var/obj/projectile/magic/magic_to_fire = to_fire
@@ -175,7 +175,7 @@
/// Signal proc for whenever the projectile we fire hits someone.
/// Pretty much relays to the spell when the projectile actually hits something.
/datum/action/cooldown/spell/pointed/projectile/proc/on_cast_hit(atom/source, mob/firer, atom/hit, angle)
/datum/action/cooldown/spell/pointed/projectile/proc/on_cast_hit(datum/source, mob/firer, atom/target, angle, hit_limb)
SIGNAL_HANDLER
SEND_SIGNAL(src, COMSIG_SPELL_PROJECTILE_HIT, hit, firer, source)
SEND_SIGNAL(src, COMSIG_SPELL_PROJECTILE_HIT, source, firer, target, angle, hit_limb)