Allows us to drop NODROP items if there is other way to get rid of them (#21080)

* adds proc to check if we can drop nodrop items

* C:/Program Files/Git/obj/effect/proc_holder/spell/touch refactor, support for wizard spells, xeno spells and changeling shield

* bug fixes, cleanup

* moved to signals, added support for mime fingergun

* fixed bugs

* cleanup

* same proc for removing weapon from active or any hand

* changeling fast swap exist again

* cleanup

* fix runtime

* signals cleanup

* review update

* Update code/datums/spells/mime.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Update code/datums/spells/mime.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Update code/datums/spells/touch_attacks.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* review updates

* fixing bug

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
HMBGERDO
2023-06-15 20:18:17 +02:00
committed by GitHub
parent b05e27bb17
commit b74cd79c03
10 changed files with 127 additions and 52 deletions
+15 -17
View File
@@ -9,26 +9,14 @@
/obj/effect/proc_holder/spell/touch/Click(mob/user = usr)
if(attached_hand)
qdel(attached_hand)
cooldown_handler.revert_cast()
attached_hand = null
if(on_remove_message)
to_chat(user, "<span class='notice'>You draw the power out of your hand.</span>")
discharge_hand(user, TRUE)
return FALSE
..()
charge_hand(user)
/obj/effect/proc_holder/spell/touch/cast(list/targets, mob/user = usr)
for(var/mob/living/carbon/target in targets)
if(!attached_hand)
if(!ChargeHand(target))
return FALSE
while(attached_hand) //hibernate untill the spell is actually used
cooldown_handler.recharge_time++ // adds a tick onto the cooldown each tick
sleep(1)
/obj/effect/proc_holder/spell/touch/proc/ChargeHand(mob/living/carbon/user)
/obj/effect/proc_holder/spell/touch/proc/charge_hand(mob/living/carbon/user)
var/hand_handled = 1
attached_hand = new hand_path(src)
RegisterSignal(user, COMSIG_MOB_WILLINGLY_DROP, PROC_REF(discharge_hand))
if(isalien(user))
user.put_in_hands(attached_hand)
return
@@ -42,13 +30,23 @@
hand_handled = 0
if(!hand_handled)
qdel(attached_hand)
cooldown_handler.revert_cast()
attached_hand = null
to_chat(user, "<span class='warning'>Your hands are full!</span>")
return 0
to_chat(user, "<span class='notice'>You channel the power of the spell to your hand.</span>")
return 1
/obj/effect/proc_holder/spell/touch/proc/discharge_hand(atom/target, any = FALSE)
SIGNAL_HANDLER
var/mob/living/carbon/user = action.owner
if(!istype(attached_hand))
return
if(!any && attached_hand != user.get_active_hand())
return
QDEL_NULL(attached_hand)
if(on_remove_message)
to_chat(user, "<span class='notice'>You draw the power out of your hand.</span>")
/obj/effect/proc_holder/spell/touch/disintegrate
name = "Disintegrate"