diff --git a/code/datums/components/spooky.dm b/code/datums/components/spooky.dm new file mode 100644 index 0000000000..966baf7c4a --- /dev/null +++ b/code/datums/components/spooky.dm @@ -0,0 +1,60 @@ +/datum/component/spooky + var/too_spooky = TRUE //will it spawn a new instrument? + +/datum/component/spooky/Initialize() + RegisterSignal(COMSIG_ITEM_ATTACK, .proc/spectral_attack) + +/datum/component/spooky/proc/spectral_attack(mob/living/carbon/C, mob/user) + if(ishuman(user)) //this weapon wasn't meant for mortals. + var/mob/living/carbon/human/U = user + if(!istype(U.dna.species, /datum/species/skeleton)) + U.adjustStaminaLoss(35) //Extra Damage + U.Jitter(35) + U.stuttering = 20 + if(U.getStaminaLoss() > 95) + to_chat(U, "Your ears weren't meant for this spectral sound.") + spectral_change(U) + return + + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if(istype(H.dna.species, /datum/species/skeleton)) + return ..() //undeads are unaffected by the spook-pocalypse. + if(istype(H.dna.species, /datum/species/zombie)) + H.adjustStaminaLoss(25) + H.Knockdown(15) //zombies can't resist the doot + C.Jitter(35) + C.stuttering = 20 + if((!istype(H.dna.species, /datum/species/skeleton)) && (!istype(H.dna.species, /datum/species/golem)) && (!istype(H.dna.species, /datum/species/android)) && (!istype(H.dna.species, /datum/species/jelly))) + C.adjustStaminaLoss(25) //boneless humanoids don't lose the will to live + to_chat(C, "DOOT") + spectral_change(H) + + else //the sound will spook monkeys. + C.Jitter(15) + C.stuttering = 20 + +/datum/component/spooky/proc/spectral_change(mob/living/carbon/human/H, mob/user) + if((H.getStaminaLoss() > 95) && (!istype(H.dna.species, /datum/species/skeleton)) && (!istype(H.dna.species, /datum/species/golem)) && (!istype(H.dna.species, /datum/species/android)) && (!istype(H.dna.species, /datum/species/jelly))) + H.Knockdown(20) + H.set_species(/datum/species/skeleton) + H.visible_message("[H] has given up on life as a mortal.") + var/T = get_turf(H) + if(too_spooky) + if(prob(30)) + new/obj/item/device/instrument/saxophone/spectral(T) + else if(prob(30)) + new/obj/item/device/instrument/trumpet/spectral(T) + else if(prob(30)) + new/obj/item/device/instrument/trombone/spectral(T) + else + to_chat(H, "The spooky gods forgot to ship your instrument. Better luck next unlife.") + to_chat(H, "You are the spooky skeleton!") + to_chat(H, "A new life and identity has begun. Help your fellow skeletons into bringing out the spooky-pocalypse. You haven't forgotten your past life, and are still beholden to past loyalties.") + change_name(H) //time for a new name! + +/datum/component/spooky/proc/change_name(mob/living/carbon/human/H) + var/t = stripped_input(H, "Enter your new skeleton name", H.real_name, null, MAX_NAME_LEN) + if(!t) + t = "spooky skeleton" + H.fully_replace_character_name(H.real_name, t) diff --git a/code/game/objects/items/devices/instruments.dm b/code/game/objects/items/devices/instruments.dm index 8418e61146..acdfa1bc79 100644 --- a/code/game/objects/items/devices/instruments.dm +++ b/code/game/objects/items/devices/instruments.dm @@ -110,6 +110,30 @@ item_state = "accordion" instrumentId = "accordion" +/obj/item/device/instrument/trumpet + name = "trumpet" + desc = "To announce the arrival of the king!" + icon_state = "trumpet" + item_state = "trombone" + instrumentId = "trombone" + +/obj/item/device/instrument/trumpet/spectral + name = "spectral trumpet" + desc = "Things are about to get spooky!" + icon_state = "trumpet" + item_state = "trombone" + force = 0 + instrumentId = "trombone" + attack_verb = list("played","jazzed","trumpeted","mourned","dooted","spooked") + +/obj/item/device/instrument/trumpet/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) + +/obj/item/device/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user) + playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1) + ..() + /obj/item/device/instrument/saxophone name = "saxophone" desc = "This soothing sound will be sure to leave your audience in tears." @@ -117,6 +141,23 @@ item_state = "saxophone" instrumentId = "saxophone" +/obj/item/device/instrument/saxophone/spectral + name = "spectral saxophone" + desc = "This spooky sound will be sure to leave mortals in bones." + icon_state = "saxophone" + item_state = "saxophone" + instrumentId = "saxophone" + force = 0 + attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked") + +/obj/item/device/instrument/saxophone/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) + +/obj/item/device/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user) + playsound (loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1) + ..() + /obj/item/device/instrument/trombone name = "trombone" desc = "How can any pool table ever hope to compete?" @@ -124,6 +165,23 @@ item_state = "trombone" instrumentId = "trombone" +/obj/item/device/instrument/trombone/spectral + name = "spectral trombone" + desc = "A skeleton's favorite instrument. Apply directly on the mortals." + instrumentId = "trombone" + icon_state = "trombone" + item_state = "trombone" + force = 0 + attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked") + +/obj/item/device/instrument/trombone/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) + +/obj/item/device/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user) + playsound (loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1) + ..() + /obj/item/device/instrument/recorder name = "recorder" desc = "Just like in school, playing ability and all." @@ -163,4 +221,3 @@ throw_speed = 3 throw_range = 15 hitsound = 'sound/items/bikehorn.ogg' - diff --git a/icons/obj/musician.dmi b/icons/obj/musician.dmi index 1f1e7e5a30..8375b38ee9 100644 Binary files a/icons/obj/musician.dmi and b/icons/obj/musician.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 737187cb49..71fe026012 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -323,6 +323,7 @@ #include "code\datums\components\rad_insulation.dm" #include "code\datums\components\radioactive.dm" #include "code\datums\components\slippery.dm" +#include "code\datums\components\spooky.dm" #include "code\datums\components\squeek.dm" #include "code\datums\components\thermite.dm" #include "code\datums\diseases\_disease.dm"