/datum/spell/horsemask
name = "Curse of the Horseman"
desc = "This spell triggers a curse on a target, causing them to wield an unremovable horse head mask. They will speak like a horse! Any masks they are wearing will be disintegrated. This spell does not require robes."
school = "transmutation"
base_cooldown = 150
clothes_req = FALSE
stat_allowed = CONSCIOUS
invocation = "KN'A FTAGHU, PUCK 'BTHNK!"
invocation_type = "shout"
cooldown_min = 30 //30 deciseconds reduction per rank
selection_activated_message = "You start to quietly neigh an incantation. Click on or near a target to cast the spell."
selection_deactivated_message = "You stop neighing to yourself."
action_icon_state = "barn"
sound = 'sound/magic/HorseHead_curse.ogg'
/datum/spell/horsemask/create_new_targeting()
var/datum/spell_targeting/click/T = new()
T.selection_type = SPELL_SELECTION_RANGE
return T
/datum/spell/horsemask/cast(list/targets, mob/user = usr)
if(!length(targets))
to_chat(user, "No target found in range.")
return
var/mob/living/carbon/human/target = targets[1]
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
magichead.flags |= NODROP | DROPDEL //curses!
magichead.flags_inv = null //so you can still see their face
magichead.voicechange = TRUE //NEEEEIIGHH
target.visible_message( "[target]'s face lights up in fire, and after the event a horse's head takes its place!", \
"Your face burns up, and shortly after the fire you realise you have the face of a horse!")
if(!target.unEquip(target.wear_mask))
qdel(target.wear_mask)
target.equip_to_slot_if_possible(magichead, SLOT_HUD_WEAR_MASK, TRUE, TRUE)
target.flash_eyes()