mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Fixes touch spells on_hand hit signals (#86849)
## About The Pull Request Fixes touch spells on_hand hit signals ## Why It's Good For The Game Mainly fixes the issues with mansus grasp not being able to attack things properly, specifically unanchor the mawed crucible.
This commit is contained in:
@@ -69,12 +69,6 @@
|
||||
bite_the_hand(user)
|
||||
return TRUE
|
||||
|
||||
if(istype(weapon, /obj/item/codex_cicatrix) || istype(weapon, /obj/item/melee/touch_attack/mansus_fist))
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 30, TRUE, ignore_walls = FALSE)
|
||||
set_anchored(!anchored)
|
||||
balloon_alert(user, "[anchored ? "":"un"]anchored")
|
||||
return TRUE
|
||||
|
||||
if(isbodypart(weapon))
|
||||
|
||||
var/obj/item/bodypart/consumed = weapon
|
||||
@@ -99,6 +93,13 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/structure/destructible/eldritch_crucible/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(istype(tool, /obj/item/codex_cicatrix) || istype(tool, /obj/item/melee/touch_attack/mansus_fist))
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 30, TRUE, ignore_walls = FALSE)
|
||||
set_anchored(!anchored)
|
||||
balloon_alert(user, "[anchored ? "":"un"]anchored")
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/structure/destructible/eldritch_crucible/attack_hand(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
@@ -170,10 +170,9 @@
|
||||
SHOULD_NOT_OVERRIDE(TRUE) // DEFINITELY don't put effects here, put them in cast_on_hand_hit
|
||||
|
||||
if(!can_hit_with_hand(target, caster))
|
||||
return
|
||||
return NONE
|
||||
|
||||
INVOKE_ASYNC(src, PROC_REF(do_hand_hit), source, target, caster)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
return do_hand_hit(source, target, caster)
|
||||
|
||||
/**
|
||||
* Signal proc for [COMSIG_ITEM_INTERACTING_WITH_ATOM_SECONDARY] from our attached hand.
|
||||
@@ -185,10 +184,9 @@
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
|
||||
if(!can_hit_with_hand(target, caster))
|
||||
return
|
||||
return NONE
|
||||
|
||||
INVOKE_ASYNC(src, PROC_REF(do_secondary_hand_hit), source, target, caster)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
return do_secondary_hand_hit(source, target, caster)
|
||||
|
||||
/// Checks if the passed victim can be cast on by the caster.
|
||||
/datum/action/cooldown/spell/touch/proc/can_hit_with_hand(atom/victim, mob/living/caster)
|
||||
@@ -220,14 +218,15 @@
|
||||
on_antimagic_triggered(hand, victim, caster)
|
||||
|
||||
else if(!cast_on_hand_hit(hand, victim, caster))
|
||||
return
|
||||
return NONE
|
||||
|
||||
log_combat(caster, victim, "cast the touch spell [name] on", hand)
|
||||
spell_feedback(caster)
|
||||
INVOKE_ASYNC(src, PROC_REF(spell_feedback), caster)
|
||||
caster.do_attack_animation(victim)
|
||||
caster.changeNext_move(CLICK_CD_MELEE)
|
||||
victim.add_fingerprint(caster)
|
||||
remove_hand(caster)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/**
|
||||
* Calls do_secondary_hand_hit() from the caster onto the victim.
|
||||
@@ -243,11 +242,12 @@
|
||||
// Continue will remove the hand here and stop
|
||||
if(SECONDARY_ATTACK_CONTINUE_CHAIN)
|
||||
log_combat(caster, victim, "cast the touch spell [name] on", hand, "(secondary / alt cast)")
|
||||
spell_feedback(caster)
|
||||
INVOKE_ASYNC(src, PROC_REF(spell_feedback), caster)
|
||||
caster.do_attack_animation(victim)
|
||||
caster.changeNext_move(CLICK_CD_MELEE)
|
||||
victim.add_fingerprint(caster)
|
||||
remove_hand(caster)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
// Call normal will call the normal cast proc
|
||||
if(SECONDARY_ATTACK_CALL_NORMAL)
|
||||
@@ -255,7 +255,7 @@
|
||||
|
||||
// Cancel chain will do nothing,
|
||||
if(SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
return NONE
|
||||
|
||||
/**
|
||||
* The actual process of casting the spell on the victim from the caster.
|
||||
|
||||
Reference in New Issue
Block a user