Files
Bubberstation/code/datums/spells/touch_attacks.dm
Incoming dcf3c3d9de When disintegrate was added it was certainly intended to be a touch attack, but there was no in game mechanics to properly have someone explode when you touch them. But now thanks to things like nodrop and abstract items, I could totally code an item that a wizard summons to his hand that represents a touch attack. So I did.
Disintergrate summons a glowing hand (gesture up in the air [pointing? Hand flat? Fist?]) nodrop abstract item. It has a noticeable on mob sprite and (obviously) requires a free hand to use. It removes that shitty drop down menu UI and requires that a wizard be robust enough to actually smack someone with his hand to work. Spell doesn't recharge until the hand actually connects, reusing the spell with the hand out just refunds the charge and puts the hand away. Spell still gibs.

Nerfs:
*Requires a modicum of robustness in clicking a guy
*Offers a tell to spessman that the wizard is going for it
*Can't be used on the floor or while cuffed
*Takes up a hand slot during use

Buffs:
*Don't have to fiddle with a shitty drop down if you use it in a crowded area.
2015-07-12 19:39:39 -04:00

70 lines
2.4 KiB
Plaintext

/obj/effect/proc_holder/spell/targeted/touch/
var/hand_path = "/obj/item/weapon/melee/touch_attack"
var/obj/item/weapon/melee/touch_attack/attached_hand = null
invocation_type = "none" //you scream on connecting, not summoning
include_user = 1
range = -1
/obj/effect/proc_holder/spell/targeted/touch/Click(mob/user = usr)
if(attached_hand)
qdel(attached_hand)
charge_counter = charge_max
attached_hand = null
user << "<span class='notice'>You draw the power out of your hand.</span>"
return 0
..()
/obj/effect/proc_holder/spell/targeted/touch/cast(list/targets)
for(var/mob/living/carbon/user in targets)
if(!attached_hand)
if(!ChargeHand(user))
return 0
while(attached_hand) //hibernate untill the spell is actually used
charge_counter = 0
sleep(1)
/obj/effect/proc_holder/spell/targeted/touch/proc/ChargeHand(mob/living/carbon/user)
var/hand_handled = 1
attached_hand = new hand_path(src)
if(user.hand) //left active hand
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, 0, 1, 1))
hand_handled = 0
else //right active hand
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, 0, 1, 1))
hand_handled = 0
if(!hand_handled)
qdel(attached_hand)
charge_counter = charge_max
attached_hand = null
user << "<span class='warning'>Your hands are full!</span>"
return 0
user << "<span class='notice'>You channel the power of the spell to your hand.</span>"
return 1
/obj/effect/proc_holder/spell/targeted/touch/disintegrate
name = "Disintegrate"
desc = "This spell charges your hand with vile energy that can be used to violently explode victims."
hand_path = "/obj/item/weapon/melee/touch_attack/disintegrate"
school = "evocation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "gib"
/obj/effect/proc_holder/spell/targeted/touch/flesh_to_stone
name = "Flesh to Stone"
desc = "This spell charges your hand with the power to turn victims into inert statues for a long period of time."
hand_path = "/obj/item/weapon/melee/touch_attack/fleshtostone"
school = "transmutation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "statue"
sound = "sound/magic/FleshToStone.ogg"