diff --git a/code/game/objects/items/devices/guitar.dm b/code/game/objects/items/devices/guitar.dm deleted file mode 100644 index 6c0e4645cc9..00000000000 --- a/code/game/objects/items/devices/guitar.dm +++ /dev/null @@ -1,45 +0,0 @@ -//copy pasta of the space piano, don't hurt me -Pete - -/obj/item/device/guitar - name = "guitar" - desc = "It's made of wood and has bronze strings." - icon = 'icons/obj/musician.dmi' - icon_state = "guitar" - item_state = "guitar" - force = 10 - burn_state = FLAMMABLE - burntime = 20 - var/datum/song/handheld/song - hitsound = 'sound/effects/guitarsmash.ogg' - -/obj/item/device/guitar/New() - song = new("guitar", src) - song.instrumentExt = "ogg" - -/obj/item/device/guitar/Destroy() - QDEL_NULL(song) - return ..() - -/obj/item/device/guitar/attack_self(mob/user as mob) - ui_interact(user) - -/obj/item/device/guitar/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!isliving(user) || user.incapacitated()) - return - - song.ui_interact(user, ui_key, ui, force_open) - -/obj/item/device/guitar/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) - return song.ui_data(user, ui_key, state) - -/obj/item/device/guitar/Topic(href, href_list) - song.Topic(href, href_list) - -/datum/crafting_recipe/guitar - name = "Guitar" - result = /obj/item/device/guitar - reqs = list(/obj/item/stack/sheet/wood = 5, - /obj/item/stack/cable_coil = 6, - /obj/item/stack/tape_roll = 5) - tools = list(/obj/item/weapon/screwdriver, /obj/item/weapon/wirecutters) - time = 80 diff --git a/code/game/objects/items/devices/instruments.dm b/code/game/objects/items/devices/instruments.dm new file mode 100644 index 00000000000..3643b197d4c --- /dev/null +++ b/code/game/objects/items/devices/instruments.dm @@ -0,0 +1,103 @@ +//copy pasta of the space piano, don't hurt me -Pete +/obj/item/device/instrument + name = "generic instrument" + icon = 'icons/obj/musician.dmi' + burn_state = FLAMMABLE + var/datum/song/handheld/song + var/instrumentId = "generic" + var/instrumentExt = "ogg" + +/obj/item/device/instrument/New() + song = new(instrumentId, src) + song.instrumentExt = instrumentExt + ..() + +/obj/item/device/instrument/Destroy() + QDEL_NULL(song) + return ..() + +/obj/item/device/instrument/suicide_act(mob/user) + user.visible_message("[user] begins to play 'Gloomy Sunday'! It looks like \he's trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/device/instrument/initialize(mapload) + song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded + ..() + +/obj/item/device/instrument/attack_self(mob/user) + ui_interact(user) + +/obj/item/device/instrument/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) + if(!isliving(user) || user.incapacitated()) + return + + song.ui_interact(user, ui_key, ui, force_open) + +/obj/item/device/instrument/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) + return song.ui_data(user, ui_key, state) + +/obj/item/device/instrument/Topic(href, href_list) + song.Topic(href, href_list) + +/obj/item/device/instrument/violin + name = "space violin" + desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\"" + icon_state = "violin" + item_state = "violin" + force = 10 + hitsound = "swing_hit" + instrumentId = "violin" + +/obj/item/device/instrument/violin/golden + name = "golden violin" + desc = "A golden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\"" + icon_state = "golden_violin" + item_state = "golden_violin" + burn_state = LAVA_PROOF + +/obj/item/device/instrument/guitar + name = "guitar" + desc = "It's made of wood and has bronze strings." + icon_state = "guitar" + item_state = "guitar" + force = 10 + attack_verb = list("played metal on", "serenaded", "crashed", "smashed") + hitsound = 'sound/effects/guitarsmash.ogg' + instrumentId = "guitar" + +/obj/item/device/instrument/eguitar + name = "electric guitar" + desc = "Makes all your shredding needs possible." + icon_state = "eguitar" + item_state = "eguitar" + force = 12 + attack_verb = list("played metal on", "shredded", "crashed", "smashed") + hitsound = 'sound/weapons/stringsmash.ogg' + instrumentId = "eguitar" + +/datum/crafting_recipe/violin + name = "Violin" + result = /obj/item/device/instrument/violin + reqs = list(/obj/item/stack/sheet/wood = 5, + /obj/item/stack/cable_coil = 6, + /obj/item/stack/tape_roll = 5) + tools = list(/obj/item/weapon/screwdriver, /obj/item/weapon/wirecutters) + time = 80 + +/datum/crafting_recipe/guitar + name = "Guitar" + result = /obj/item/device/instrument/guitar + reqs = list(/obj/item/stack/sheet/wood = 5, + /obj/item/stack/cable_coil = 6, + /obj/item/stack/tape_roll = 5) + tools = list(/obj/item/weapon/screwdriver, /obj/item/weapon/wirecutters) + time = 80 + +/datum/crafting_recipe/eguitar + name = "Electric Guitar" + result = /obj/item/device/instrument/eguitar + reqs = list(/obj/item/stack/sheet/metal = 5, + /obj/item/stack/cable_coil = 6, + /obj/item/stack/tape_roll = 5) + tools = list(/obj/item/weapon/screwdriver, /obj/item/weapon/wirecutters) + time = 80 \ No newline at end of file diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm deleted file mode 100644 index 3ef6b2bef85..00000000000 --- a/code/game/objects/items/devices/violin.dm +++ /dev/null @@ -1,41 +0,0 @@ -//copy pasta of the space piano, don't hurt me -Pete - -/obj/item/device/violin - name = "space violin" - desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\"" - icon = 'icons/obj/musician.dmi' - icon_state = "violin" - item_state = "violin" - attack_verb = list("strung", "fiddled", "tuned", "pitched") - force = 10 - burn_state = FLAMMABLE - burntime = 20 - hitsound = 'sound/weapons/smash.ogg' - var/datum/song/handheld/song - -/obj/item/device/violin/New() - song = new("violin", src) - song.instrumentExt = "ogg" - -/obj/item/device/violin/Destroy() - QDEL_NULL(song) - return ..() - -/obj/item/device/violin/initialize() - song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded - ..() - -/obj/item/device/violin/attack_self(mob/user as mob) - ui_interact(user) - -/obj/item/device/violin/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!isliving(user) || user.incapacitated()) - return - - song.ui_interact(user, ui_key, ui, force_open) - -/obj/item/device/violin/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) - return song.ui_data(user, ui_key, state) - -/obj/item/device/violin/Topic(href, href_list) - song.Topic(href, href_list) diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 4e558f7b64e..e25dc445359 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -88,8 +88,8 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus, /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/vulgaris, /obj/item/device/paicard, - /obj/item/device/violin, - /obj/item/device/guitar, + /obj/item/device/instrument/violin, + /obj/item/device/instrument/guitar, /obj/item/weapon/storage/belt/utility/full, /obj/item/clothing/accessory/horrible, /obj/random/carp_plushie, diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index db917ca5588..37a7bb13115 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -1,14 +1,14 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 + /datum/song var/name = "Untitled" var/list/lines = new() - var/tempo = 5 // delay between notes + var/tempo = 5 // delay between notes - var/playing = 0 // if we're playing - var/help = 0 // if help is open - var/repeat = 0 // number of times remaining to repeat - var/max_repeat = 10 // maximum times we can repeat + var/playing = 0 // if we're playing + var/help = 0 // if help is open + var/repeat = 0 // number of times remaining to repeat + var/max_repeat = 10 // maximum times we can repeat var/instrumentDir = "piano" // the folder with the sounds var/instrumentExt = "ogg" // the file extension @@ -26,7 +26,7 @@ // note is a number from 1-7 for A-G // acc is either "b", "n", or "#" // oct is 1-8 (or 9 for C) -/datum/song/proc/playnote(var/note, var/acc as text, var/oct) +/datum/song/proc/playnote(note, acc as text, oct) // handle accidental -> B<>C of E<>F if(acc == "b" && (note == 3 || note == 6)) // C or F if(note == 3) @@ -70,7 +70,7 @@ else return 1 -/datum/song/proc/playsong(mob/user as mob) +/datum/song/proc/playsong(mob/user) while(repeat >= 0) var/cur_oct[7] var/cur_acc[7] @@ -79,18 +79,14 @@ cur_acc[i] = "n" for(var/line in lines) -// to_chat(world, line) for(var/beat in splittext(lowertext(line), ",")) -// to_chat(world, "beat: [beat]") var/list/notes = splittext(beat, "/") for(var/note in splittext(notes[1], "-")) -// to_chat(world, "note: [note]") - if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case + if(!playing || shouldStopPlaying(user)) //If the instrument is playing, or special case playing = 0 return if(lentext(note) == 0) continue -// to_chat(world, "Parse: [copytext(note,1,2)]") var/cur_note = text2ascii(note) - 96 if(cur_note < 1 || cur_note > 7) continue @@ -244,6 +240,7 @@ playing = 0 /datum/song/proc/sanitize_tempo(new_tempo) + new_tempo = abs(new_tempo) return max(round(new_tempo, world.tick_lag), world.tick_lag) // subclass for handheld instruments, like violin @@ -269,6 +266,7 @@ /obj/structure/piano/New() + ..() song = new("piano", src) if(prob(50)) @@ -304,7 +302,7 @@ song.Topic(href, href_list) /obj/structure/piano/attackby(obj/item/O as obj, mob/user as mob, params) - if(istype(O, /obj/item/weapon/wrench)) + if(iswrench(O)) if(!anchored && !isinspace()) playsound(src.loc, O.usesound, 50, 1) to_chat(user, " You begin to tighten \the [src] to the floor...") @@ -324,4 +322,4 @@ "You hear ratchet.") anchored = 0 else - ..() + return ..() diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index c5344b2a9ab..4d0b5a4c4bc 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -246,7 +246,7 @@ new /obj/item/weapon/reagent_containers/food/drinks/cans/cola(src) -/obj/item/device/guitar/jello_guitar //Antcolon3: Dan Jello +/obj/item/device/instrument/guitar/jello_guitar //Antcolon3: Dan Jello name = "Dan Jello's Pink Guitar" desc = "Dan Jello's special pink guitar." icon = 'icons/obj/custom_items.dmi' diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 7852fe0edd8..3c0acd1e7f1 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -482,7 +482,7 @@ var/obj/item/weapon/storage/pill_bottle/dice/D = new(src) load(D) else - var/obj/item/device/guitar/G = new(src) + var/obj/item/device/instrument/guitar/G = new(src) load(G) //Fans diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 31b4c826e9d..4d5ea6b983d 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -255,8 +255,9 @@ modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src) modules += new /obj/item/weapon/pen(src) modules += new /obj/item/weapon/razor(src) - modules += new /obj/item/device/violin(src) - modules += new /obj/item/device/guitar(src) + modules += new /obj/item/device/instrument/violin(src) + modules += new /obj/item/device/instrument/guitar(src) + modules += new /obj/item/device/instrument/eguitar(src) var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src) M.matter = 30 diff --git a/code/modules/store/items.dm b/code/modules/store/items.dm index 4eefa2847a1..f660efc0d16 100644 --- a/code/modules/store/items.dm +++ b/code/modules/store/items.dm @@ -96,14 +96,20 @@ /datum/storeitem/violin name = "space violin" desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\"" - typepath = /obj/item/device/violin + typepath = /obj/item/device/instrument/violin cost = 500 /datum/storeitem/guitar name = "guitar" desc = "It's made of wood and has bronze strings." - typepath = /obj/item/device/guitar - cost = 700 + typepath = /obj/item/device/instrument/guitar + cost = 500 + +/datum/storeitem/eguitar + name = "electric guitar" + desc = "Makes all your shredding needs possible." + typepath = /obj/item/device/instrument/eguitar + cost = 500 /datum/storeitem/baby name = "Toddler" diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index 1461df9bbbe..812c283df70 100644 Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index c66e67820a3..cd8866f5f4a 100644 Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ diff --git a/icons/obj/musician.dmi b/icons/obj/musician.dmi index b5d0526d670..c57114abf63 100644 Binary files a/icons/obj/musician.dmi and b/icons/obj/musician.dmi differ diff --git a/paradise.dme b/paradise.dme index 1121b1876bf..ce8a59f713d 100644 --- a/paradise.dme +++ b/paradise.dme @@ -733,7 +733,7 @@ #include "code\game\objects\items\devices\flash.dm" #include "code\game\objects\items\devices\flashlight.dm" #include "code\game\objects\items\devices\floor_painter.dm" -#include "code\game\objects\items\devices\guitar.dm" +#include "code\game\objects\items\devices\instruments.dm" #include "code\game\objects\items\devices\laserpointer.dm" #include "code\game\objects\items\devices\lightreplacer.dm" #include "code\game\objects\items\devices\machineprototype.dm" @@ -749,7 +749,6 @@ #include "code\game\objects\items\devices\traitordevices.dm" #include "code\game\objects\items\devices\transfer_valve.dm" #include "code\game\objects\items\devices\uplinks.dm" -#include "code\game\objects\items\devices\violin.dm" #include "code\game\objects\items\devices\whistle.dm" #include "code\game\objects\items\devices\radio\beacon.dm" #include "code\game\objects\items\devices\radio\electropack.dm" diff --git a/sound/eguitar/ab4.ogg b/sound/eguitar/ab4.ogg new file mode 100644 index 00000000000..de291593ee0 Binary files /dev/null and b/sound/eguitar/ab4.ogg differ diff --git a/sound/eguitar/ab5.ogg b/sound/eguitar/ab5.ogg new file mode 100644 index 00000000000..8103ab40234 Binary files /dev/null and b/sound/eguitar/ab5.ogg differ diff --git a/sound/eguitar/ab6.ogg b/sound/eguitar/ab6.ogg new file mode 100644 index 00000000000..220e1571d4c Binary files /dev/null and b/sound/eguitar/ab6.ogg differ diff --git a/sound/eguitar/an4.ogg b/sound/eguitar/an4.ogg new file mode 100644 index 00000000000..250b1b435a0 Binary files /dev/null and b/sound/eguitar/an4.ogg differ diff --git a/sound/eguitar/an5.ogg b/sound/eguitar/an5.ogg new file mode 100644 index 00000000000..54d198d3954 Binary files /dev/null and b/sound/eguitar/an5.ogg differ diff --git a/sound/eguitar/an6.ogg b/sound/eguitar/an6.ogg new file mode 100644 index 00000000000..aacaa90f036 Binary files /dev/null and b/sound/eguitar/an6.ogg differ diff --git a/sound/eguitar/bb4.ogg b/sound/eguitar/bb4.ogg new file mode 100644 index 00000000000..c275fdc0b75 Binary files /dev/null and b/sound/eguitar/bb4.ogg differ diff --git a/sound/eguitar/bb5.ogg b/sound/eguitar/bb5.ogg new file mode 100644 index 00000000000..3d32c5280d4 Binary files /dev/null and b/sound/eguitar/bb5.ogg differ diff --git a/sound/eguitar/bb6.ogg b/sound/eguitar/bb6.ogg new file mode 100644 index 00000000000..c89618326ae Binary files /dev/null and b/sound/eguitar/bb6.ogg differ diff --git a/sound/eguitar/bn4.ogg b/sound/eguitar/bn4.ogg new file mode 100644 index 00000000000..458ea14336a Binary files /dev/null and b/sound/eguitar/bn4.ogg differ diff --git a/sound/eguitar/bn5.ogg b/sound/eguitar/bn5.ogg new file mode 100644 index 00000000000..4bd02b83c3b Binary files /dev/null and b/sound/eguitar/bn5.ogg differ diff --git a/sound/eguitar/bn6.ogg b/sound/eguitar/bn6.ogg new file mode 100644 index 00000000000..c1d1cf5f4b0 Binary files /dev/null and b/sound/eguitar/bn6.ogg differ diff --git a/sound/eguitar/cn4.ogg b/sound/eguitar/cn4.ogg new file mode 100644 index 00000000000..43f43080632 Binary files /dev/null and b/sound/eguitar/cn4.ogg differ diff --git a/sound/eguitar/cn5.ogg b/sound/eguitar/cn5.ogg new file mode 100644 index 00000000000..4a97fdcfad1 Binary files /dev/null and b/sound/eguitar/cn5.ogg differ diff --git a/sound/eguitar/cn6.ogg b/sound/eguitar/cn6.ogg new file mode 100644 index 00000000000..c67fcae46c4 Binary files /dev/null and b/sound/eguitar/cn6.ogg differ diff --git a/sound/eguitar/cn7.ogg b/sound/eguitar/cn7.ogg new file mode 100644 index 00000000000..f193f5b0627 Binary files /dev/null and b/sound/eguitar/cn7.ogg differ diff --git a/sound/eguitar/db4.ogg b/sound/eguitar/db4.ogg new file mode 100644 index 00000000000..ee975d555a2 Binary files /dev/null and b/sound/eguitar/db4.ogg differ diff --git a/sound/eguitar/db5.ogg b/sound/eguitar/db5.ogg new file mode 100644 index 00000000000..6904962cd77 Binary files /dev/null and b/sound/eguitar/db5.ogg differ diff --git a/sound/eguitar/db6.ogg b/sound/eguitar/db6.ogg new file mode 100644 index 00000000000..421b0590492 Binary files /dev/null and b/sound/eguitar/db6.ogg differ diff --git a/sound/eguitar/dn4.ogg b/sound/eguitar/dn4.ogg new file mode 100644 index 00000000000..b6287800fb7 Binary files /dev/null and b/sound/eguitar/dn4.ogg differ diff --git a/sound/eguitar/dn5.ogg b/sound/eguitar/dn5.ogg new file mode 100644 index 00000000000..92f723cff01 Binary files /dev/null and b/sound/eguitar/dn5.ogg differ diff --git a/sound/eguitar/dn6.ogg b/sound/eguitar/dn6.ogg new file mode 100644 index 00000000000..53c2de97d23 Binary files /dev/null and b/sound/eguitar/dn6.ogg differ diff --git a/sound/eguitar/eb4.ogg b/sound/eguitar/eb4.ogg new file mode 100644 index 00000000000..0349b819b33 Binary files /dev/null and b/sound/eguitar/eb4.ogg differ diff --git a/sound/eguitar/eb5.ogg b/sound/eguitar/eb5.ogg new file mode 100644 index 00000000000..40d3c89a90b Binary files /dev/null and b/sound/eguitar/eb5.ogg differ diff --git a/sound/eguitar/eb6.ogg b/sound/eguitar/eb6.ogg new file mode 100644 index 00000000000..dd1fcbc58df Binary files /dev/null and b/sound/eguitar/eb6.ogg differ diff --git a/sound/eguitar/en4.ogg b/sound/eguitar/en4.ogg new file mode 100644 index 00000000000..2ceeafe4d7b Binary files /dev/null and b/sound/eguitar/en4.ogg differ diff --git a/sound/eguitar/en5.ogg b/sound/eguitar/en5.ogg new file mode 100644 index 00000000000..2be8538db7f Binary files /dev/null and b/sound/eguitar/en5.ogg differ diff --git a/sound/eguitar/en6.ogg b/sound/eguitar/en6.ogg new file mode 100644 index 00000000000..5b0a135a789 Binary files /dev/null and b/sound/eguitar/en6.ogg differ diff --git a/sound/eguitar/fn4.ogg b/sound/eguitar/fn4.ogg new file mode 100644 index 00000000000..b23a19278b0 Binary files /dev/null and b/sound/eguitar/fn4.ogg differ diff --git a/sound/eguitar/fn5.ogg b/sound/eguitar/fn5.ogg new file mode 100644 index 00000000000..4caadbee978 Binary files /dev/null and b/sound/eguitar/fn5.ogg differ diff --git a/sound/eguitar/fn6.ogg b/sound/eguitar/fn6.ogg new file mode 100644 index 00000000000..5177ad4dcd9 Binary files /dev/null and b/sound/eguitar/fn6.ogg differ diff --git a/sound/eguitar/gb4.ogg b/sound/eguitar/gb4.ogg new file mode 100644 index 00000000000..aba86ff66c1 Binary files /dev/null and b/sound/eguitar/gb4.ogg differ diff --git a/sound/eguitar/gb5.ogg b/sound/eguitar/gb5.ogg new file mode 100644 index 00000000000..758a83f792a Binary files /dev/null and b/sound/eguitar/gb5.ogg differ diff --git a/sound/eguitar/gb6.ogg b/sound/eguitar/gb6.ogg new file mode 100644 index 00000000000..7caed1f85f6 Binary files /dev/null and b/sound/eguitar/gb6.ogg differ diff --git a/sound/eguitar/gn4.ogg b/sound/eguitar/gn4.ogg new file mode 100644 index 00000000000..9f7a35b3935 Binary files /dev/null and b/sound/eguitar/gn4.ogg differ diff --git a/sound/eguitar/gn5.ogg b/sound/eguitar/gn5.ogg new file mode 100644 index 00000000000..d55d4148815 Binary files /dev/null and b/sound/eguitar/gn5.ogg differ diff --git a/sound/eguitar/gn6.ogg b/sound/eguitar/gn6.ogg new file mode 100644 index 00000000000..4cb5e2c63ee Binary files /dev/null and b/sound/eguitar/gn6.ogg differ diff --git a/sound/weapons/stringsmash.ogg b/sound/weapons/stringsmash.ogg new file mode 100644 index 00000000000..ea96bc0b50b Binary files /dev/null and b/sound/weapons/stringsmash.ogg differ