diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 2bfbed9681c..de5d9c1372e 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -169,7 +169,7 @@ var/global/vs_control/vsc = new vars[ch] = vw if(how == "Toggle") newvar = (newvar?"ON":"OFF") - world << "[key_name(user)] changed the setting [display_description] to [newvar]." + to_chat(world, "[key_name(user)] changed the setting [display_description] to [newvar].") if(ch in plc.settings) ChangeSettingsDialog(user,plc.settings) else diff --git a/code/__DEFINES/instruments.dm b/code/__DEFINES/instruments.dm index a63b0ff7747..3c414f87f43 100644 --- a/code/__DEFINES/instruments.dm +++ b/code/__DEFINES/instruments.dm @@ -1,29 +1,29 @@ -#define INSTRUMENT_MIN_OCTAVE 1 -#define INSTRUMENT_MAX_OCTAVE 9 -#define INSTRUMENT_MIN_KEY 0 -#define INSTRUMENT_MAX_KEY 127 - -/// Max number of playing notes per instrument. -#define CHANNELS_PER_INSTRUMENT 128 - -/// Distance multiplier that makes us not be impacted by 3d sound as much. This is a multiplier so lower it is the closer we will pretend to be to people. -#define INSTRUMENT_DISTANCE_FALLOFF_BUFF 0.2 -/// How many tiles instruments have no falloff for -#define INSTRUMENT_DISTANCE_NO_FALLOFF 3 - -/// Maximum length a note should ever go for -#define INSTRUMENT_MAX_TOTAL_SUSTAIN (5 SECONDS) - -/// These are per decisecond. -#define INSTRUMENT_EXP_FALLOFF_MIN 1.025 //100/(1.025^50) calculated for [INSTRUMENT_MIN_SUSTAIN_DROPOFF] to be 30. -#define INSTRUMENT_EXP_FALLOFF_MAX 10 - -/// Minimum volume for when the sound is considered dead. -#define INSTRUMENT_MIN_SUSTAIN_DROPOFF 0 - -#define SUSTAIN_LINEAR 1 -#define SUSTAIN_EXPONENTIAL 2 - -// /datum/instrument instrument_flags -#define INSTRUMENT_LEGACY (1<<0) //Legacy instrument. Implies INSTRUMENT_DO_NOT_AUTOSAMPLE -#define INSTRUMENT_DO_NOT_AUTOSAMPLE (1<<1) //Do not automatically sample +#define INSTRUMENT_MIN_OCTAVE 1 +#define INSTRUMENT_MAX_OCTAVE 9 +#define INSTRUMENT_MIN_KEY 0 +#define INSTRUMENT_MAX_KEY 127 + +/// Max number of playing notes per instrument. +#define CHANNELS_PER_INSTRUMENT 128 + +/// Distance multiplier that makes us not be impacted by 3d sound as much. This is a multiplier so lower it is the closer we will pretend to be to people. +#define INSTRUMENT_DISTANCE_FALLOFF_BUFF 0.2 +/// How many tiles instruments have no falloff for +#define INSTRUMENT_DISTANCE_NO_FALLOFF 3 + +/// Maximum length a note should ever go for +#define INSTRUMENT_MAX_TOTAL_SUSTAIN (5 SECONDS) + +/// These are per decisecond. +#define INSTRUMENT_EXP_FALLOFF_MIN 1.025 //100/(1.025^50) calculated for [INSTRUMENT_MIN_SUSTAIN_DROPOFF] to be 30. +#define INSTRUMENT_EXP_FALLOFF_MAX 10 + +/// Minimum volume for when the sound is considered dead. +#define INSTRUMENT_MIN_SUSTAIN_DROPOFF 0 + +#define SUSTAIN_LINEAR 1 +#define SUSTAIN_EXPONENTIAL 2 + +// /datum/instrument instrument_flags +#define INSTRUMENT_LEGACY (1<<0) //Legacy instrument. Implies INSTRUMENT_DO_NOT_AUTOSAMPLE +#define INSTRUMENT_DO_NOT_AUTOSAMPLE (1<<1) //Do not automatically sample diff --git a/code/__DEFINES/storage.dm b/code/__DEFINES/storage.dm index 7a44f1ec3bf..25799e979c9 100644 --- a/code/__DEFINES/storage.dm +++ b/code/__DEFINES/storage.dm @@ -1,9 +1,9 @@ -// Defines related to item storage goes here. - -//ITEM INVENTORY WEIGHT, FOR w_class -#define WEIGHT_CLASS_TINY 1 //Usually items smaller then a human hand, ex: Playing Cards, Lighter, Scalpel, Coins/Money -#define WEIGHT_CLASS_SMALL 2 //Pockets can hold small and tiny items, ex: Flashlight, Multitool, Grenades, GPS Device -#define WEIGHT_CLASS_NORMAL 3 //Standard backpacks can carry tiny, small & normal items, ex: Fire extinguisher, Stunbaton, Gas Mask, Metal Sheets -#define WEIGHT_CLASS_BULKY 4 //Items that can be weilded or equipped but not stored in a normal bag, ex: Defibrillator, Backpack, Space Suits -#define WEIGHT_CLASS_HUGE 5 //Usually represents objects that require two hands to operate, ex: Shotgun, Two Handed Melee Weapons - Can not fit in Boh -#define WEIGHT_CLASS_GIGANTIC 6 //Essentially means it cannot be picked up or placed in an inventory, ex: Mech Parts, Safe - Can not fit in Boh +// Defines related to item storage goes here. + +//ITEM INVENTORY WEIGHT, FOR w_class +#define WEIGHT_CLASS_TINY 1 //Usually items smaller then a human hand, ex: Playing Cards, Lighter, Scalpel, Coins/Money +#define WEIGHT_CLASS_SMALL 2 //Pockets can hold small and tiny items, ex: Flashlight, Multitool, Grenades, GPS Device +#define WEIGHT_CLASS_NORMAL 3 //Standard backpacks can carry tiny, small & normal items, ex: Fire extinguisher, Stunbaton, Gas Mask, Metal Sheets +#define WEIGHT_CLASS_BULKY 4 //Items that can be weilded or equipped but not stored in a normal bag, ex: Defibrillator, Backpack, Space Suits +#define WEIGHT_CLASS_HUGE 5 //Usually represents objects that require two hands to operate, ex: Shotgun, Two Handed Melee Weapons - Can not fit in Boh +#define WEIGHT_CLASS_GIGANTIC 6 //Essentially means it cannot be picked up or placed in an inventory, ex: Mech Parts, Safe - Can not fit in Boh diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index df3fffa19fe..8ef81a64961 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -223,11 +223,11 @@ var/obj/screen/robot_inventory //r.client.screen += robot_inventory //"store" icon if(!r.module) - usr << "No module selected" + to_chat(usr, "No module selected") return if(!r.module.modules) - usr << "Selected module has no modules to select" + to_chat(usr, "Selected module has no modules to select") return if(!r.robot_modules_background) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 7b36272fbe5..860c1a9ab8c 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -110,7 +110,7 @@ var/const/tk_maxrange = 15 if(focus) d = max(d, get_dist(user, focus)) // whichever is further if(d > tk_maxrange) - user << "Your mind won't reach that far." + to_chat(user, "Your mind won't reach that far.") return if(!focus) diff --git a/code/controllers/subsystems/processing/instruments.dm b/code/controllers/subsystems/processing/instruments.dm index 186c469e664..a4e0d7703f0 100644 --- a/code/controllers/subsystems/processing/instruments.dm +++ b/code/controllers/subsystems/processing/instruments.dm @@ -1,43 +1,43 @@ -PROCESSING_SUBSYSTEM_DEF(instruments) - name = "Instruments" - wait = 0.5 - init_order = INIT_ORDER_INSTRUMENTS - flags = SS_KEEP_TIMING - priority = FIRE_PRIORITY_INSTRUMENTS - var/static/list/datum/instrument/instrument_data = list() //id = datum - var/static/list/datum/song/songs = list() - var/static/musician_maxlines = 600 - var/static/musician_maxlinechars = 300 - var/static/musician_hearcheck_mindelay = 5 - var/static/max_instrument_channels = MAX_INSTRUMENT_CHANNELS - var/static/current_instrument_channels = 0 - -/datum/controller/subsystem/processing/instruments/Initialize() - initialize_instrument_data() - return ..() - -/datum/controller/subsystem/processing/instruments/proc/on_song_new(datum/song/S) - songs += S - -/datum/controller/subsystem/processing/instruments/proc/on_song_del(datum/song/S) - songs -= S - -/datum/controller/subsystem/processing/instruments/proc/initialize_instrument_data() - for(var/path in subtypesof(/datum/instrument)) - var/datum/instrument/I = path - if(initial(I.abstract_type) == path) - continue - I = new path - I.Initialize() - instrument_data[I.id || "[I.type]"] = I - CHECK_TICK - -/datum/controller/subsystem/processing/instruments/proc/get_instrument(id_or_path) - return instrument_data["[id_or_path]"] - -/datum/controller/subsystem/processing/instruments/proc/reserve_instrument_channel(datum/instrument/I) - if(current_instrument_channels > max_instrument_channels) - return - . = SSsounds.reserve_sound_channel(I) - if(!isnull(.)) - current_instrument_channels++ +PROCESSING_SUBSYSTEM_DEF(instruments) + name = "Instruments" + wait = 0.5 + init_order = INIT_ORDER_INSTRUMENTS + flags = SS_KEEP_TIMING + priority = FIRE_PRIORITY_INSTRUMENTS + var/static/list/datum/instrument/instrument_data = list() //id = datum + var/static/list/datum/song/songs = list() + var/static/musician_maxlines = 600 + var/static/musician_maxlinechars = 300 + var/static/musician_hearcheck_mindelay = 5 + var/static/max_instrument_channels = MAX_INSTRUMENT_CHANNELS + var/static/current_instrument_channels = 0 + +/datum/controller/subsystem/processing/instruments/Initialize() + initialize_instrument_data() + return ..() + +/datum/controller/subsystem/processing/instruments/proc/on_song_new(datum/song/S) + songs += S + +/datum/controller/subsystem/processing/instruments/proc/on_song_del(datum/song/S) + songs -= S + +/datum/controller/subsystem/processing/instruments/proc/initialize_instrument_data() + for(var/path in subtypesof(/datum/instrument)) + var/datum/instrument/I = path + if(initial(I.abstract_type) == path) + continue + I = new path + I.Initialize() + instrument_data[I.id || "[I.type]"] = I + CHECK_TICK + +/datum/controller/subsystem/processing/instruments/proc/get_instrument(id_or_path) + return instrument_data["[id_or_path]"] + +/datum/controller/subsystem/processing/instruments/proc/reserve_instrument_channel(datum/instrument/I) + if(current_instrument_channels > max_instrument_channels) + return + . = SSsounds.reserve_sound_channel(I) + if(!isnull(.)) + current_instrument_channels++ diff --git a/code/controllers/subsystems/sounds.dm b/code/controllers/subsystems/sounds.dm index 1b3c590607b..5e7c5e65457 100644 --- a/code/controllers/subsystems/sounds.dm +++ b/code/controllers/subsystems/sounds.dm @@ -1,91 +1,91 @@ -#define DATUMLESS "NO_DATUM" - -SUBSYSTEM_DEF(sounds) - name = "Sounds" - flags = SS_NO_FIRE - init_order = INIT_ORDER_SOUNDS - var/static/using_channels_max = CHANNEL_HIGHEST_AVAILABLE //BYOND max channels - - // Hey uh these two needs to be initialized fast because the whole "things get deleted before init" thing. - /// Assoc list, "[channel]" = either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel - var/list/using_channels = list() - /// Assoc list datum = list(channel1, channel2, ...) for what channels something reserved. - var/list/using_channels_by_datum = list() - /// List of all available channels with associations set to TRUE for fast lookups/allocation. - var/list/available_channels - -/datum/controller/subsystem/sounds/Initialize() - setup_available_channels() - return ..() - -/datum/controller/subsystem/sounds/proc/setup_available_channels() - available_channels = list() - for(var/i in 1 to using_channels_max) - available_channels[num2text(i)] = TRUE - -/// Removes a channel from using list. -/datum/controller/subsystem/sounds/proc/free_sound_channel(channel) - channel = num2text(channel) - var/using = using_channels[channel] - using_channels -= channel - if(using) - using_channels_by_datum[using] -= channel - if(!length(using_channels_by_datum[using])) - using_channels_by_datum -= using - available_channels[channel] = TRUE - -/// Frees all the channels a datum is using. -/datum/controller/subsystem/sounds/proc/free_datum_channels(datum/D) - var/list/L = using_channels_by_datum[D] - if(!L) - return - for(var/channel in L) - using_channels -= channel - available_channels[channel] = TRUE - using_channels_by_datum -= D - -/// Frees all datumless channels -/datum/controller/subsystem/sounds/proc/free_datumless_channels() - free_datum_channels(DATUMLESS) - -/// NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel. -/datum/controller/subsystem/sounds/proc/reserve_sound_channel_datumless() - var/channel = random_available_channel_text() - if(!channel) //oh no.. - return FALSE - available_channels -= channel - using_channels[channel] = DATUMLESS - LAZYINITLIST(using_channels_by_datum[DATUMLESS]) - using_channels_by_datum[DATUMLESS] += channel - return text2num(channel) - -/// Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel. -/datum/controller/subsystem/sounds/proc/reserve_sound_channel(datum/D) - if(!D) //i don't like typechecks but someone will fuck it up - CRASH("Attempted to reserve sound channel without datum using the managed proc.") - var/channel = random_available_channel_text() - if(!channel) - return FALSE - available_channels -= channel - using_channels[channel] = D - LAZYINITLIST(using_channels_by_datum[D]) - using_channels_by_datum[D] += channel - return text2num(channel) - -/// Random available channel, returns text. -/datum/controller/subsystem/sounds/proc/random_available_channel_text() - return pick(available_channels) - -/// Random available channel, returns number -/datum/controller/subsystem/sounds/proc/random_available_channel() - return text2num(pick(available_channels)) - -/// If a channel is available -/datum/controller/subsystem/sounds/proc/is_channel_available(channel) - return available_channels[num2text(channel)] - -/// How many channels we have left. -/datum/controller/subsystem/sounds/proc/available_channels_left() - return length(available_channels) - -#undef DATUMLESS +#define DATUMLESS "NO_DATUM" + +SUBSYSTEM_DEF(sounds) + name = "Sounds" + flags = SS_NO_FIRE + init_order = INIT_ORDER_SOUNDS + var/static/using_channels_max = CHANNEL_HIGHEST_AVAILABLE //BYOND max channels + + // Hey uh these two needs to be initialized fast because the whole "things get deleted before init" thing. + /// Assoc list, "[channel]" = either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel + var/list/using_channels = list() + /// Assoc list datum = list(channel1, channel2, ...) for what channels something reserved. + var/list/using_channels_by_datum = list() + /// List of all available channels with associations set to TRUE for fast lookups/allocation. + var/list/available_channels + +/datum/controller/subsystem/sounds/Initialize() + setup_available_channels() + return ..() + +/datum/controller/subsystem/sounds/proc/setup_available_channels() + available_channels = list() + for(var/i in 1 to using_channels_max) + available_channels[num2text(i)] = TRUE + +/// Removes a channel from using list. +/datum/controller/subsystem/sounds/proc/free_sound_channel(channel) + channel = num2text(channel) + var/using = using_channels[channel] + using_channels -= channel + if(using) + using_channels_by_datum[using] -= channel + if(!length(using_channels_by_datum[using])) + using_channels_by_datum -= using + available_channels[channel] = TRUE + +/// Frees all the channels a datum is using. +/datum/controller/subsystem/sounds/proc/free_datum_channels(datum/D) + var/list/L = using_channels_by_datum[D] + if(!L) + return + for(var/channel in L) + using_channels -= channel + available_channels[channel] = TRUE + using_channels_by_datum -= D + +/// Frees all datumless channels +/datum/controller/subsystem/sounds/proc/free_datumless_channels() + free_datum_channels(DATUMLESS) + +/// NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel. +/datum/controller/subsystem/sounds/proc/reserve_sound_channel_datumless() + var/channel = random_available_channel_text() + if(!channel) //oh no.. + return FALSE + available_channels -= channel + using_channels[channel] = DATUMLESS + LAZYINITLIST(using_channels_by_datum[DATUMLESS]) + using_channels_by_datum[DATUMLESS] += channel + return text2num(channel) + +/// Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel. +/datum/controller/subsystem/sounds/proc/reserve_sound_channel(datum/D) + if(!D) //i don't like typechecks but someone will fuck it up + CRASH("Attempted to reserve sound channel without datum using the managed proc.") + var/channel = random_available_channel_text() + if(!channel) + return FALSE + available_channels -= channel + using_channels[channel] = D + LAZYINITLIST(using_channels_by_datum[D]) + using_channels_by_datum[D] += channel + return text2num(channel) + +/// Random available channel, returns text. +/datum/controller/subsystem/sounds/proc/random_available_channel_text() + return pick(available_channels) + +/// Random available channel, returns number +/datum/controller/subsystem/sounds/proc/random_available_channel() + return text2num(pick(available_channels)) + +/// If a channel is available +/datum/controller/subsystem/sounds/proc/is_channel_available(channel) + return available_channels[num2text(channel)] + +/// How many channels we have left. +/datum/controller/subsystem/sounds/proc/available_channels_left() + return length(available_channels) + +#undef DATUMLESS diff --git a/code/datums/locations/locations.dm b/code/datums/locations/locations.dm index bc4365c716a..0e1a4e4795e 100644 --- a/code/datums/locations/locations.dm +++ b/code/datums/locations/locations.dm @@ -50,7 +50,7 @@ var/global/datum/locations/milky_way/all_locations = new() for(var/datum/locations/a in contents) world << "[a]\n[a.parent ? "Located in [a.parent]\n" : ""][a.desc]" a.show_contents() - world << "\n" + to_chat(world, "\n") /datum/locations/proc/count_locations() var/i = 0 diff --git a/code/game/antagonist/antagonist_add.dm b/code/game/antagonist/antagonist_add.dm index 2a98d3fc67c..0bfabe18585 100644 --- a/code/game/antagonist/antagonist_add.dm +++ b/code/game/antagonist/antagonist_add.dm @@ -45,7 +45,7 @@ player.current << "You are \a [nonstandard_role_type]!" player.special_role = nonstandard_role_type if(nonstandard_role_msg) - player.current << "[nonstandard_role_msg]" + to_chat(player.current, "[nonstandard_role_msg]") update_icons_added(player) return 1 diff --git a/code/game/area/Away Mission areas.dm b/code/game/area/Away Mission areas.dm index 5d5f2c02d03..4b825e81a44 100644 --- a/code/game/area/Away Mission areas.dm +++ b/code/game/area/Away Mission areas.dm @@ -28,7 +28,7 @@ //Handles random flora placement for floracountmax, as defined/randomized in initialize of each individual area. spawn_flora_on_turf() - world << "Away mission spawning done." + to_chat(world, "Away mission spawning done.") /area/awaymission/proc/spawn_mob_on_turf() if(!valid_mobs.len) diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index 72a571abf83..f3506cba7fb 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -35,7 +35,7 @@ if(sdisability) M.sdisabilities|=sdisability if(activation_message) - M << "[activation_message]" + to_chat(M, "[activation_message]") else testing("[name] has no activation message.") @@ -47,7 +47,7 @@ if(sdisability) M.sdisabilities &= (~sdisability) if(deactivation_message) - M << "[deactivation_message]" + to_chat(M, "[deactivation_message]") else testing("[name] has no deactivation message.") diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index 3e18696f6b0..e52cd4e6c03 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -113,10 +113,10 @@ M.mutations.Add(mutation) if(activation_messages.len) var/msg = pick(activation_messages) - M << "[msg]" + to_chat(M, "[msg]") /datum/dna/gene/basic/deactivate(var/mob/M) M.mutations.Remove(mutation) if(deactivation_messages.len) var/msg = pick(deactivation_messages) - M << "[msg]" + to_chat(M, "[msg]") diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index e6c6b6f4ec9..0693ffdd08e 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -171,7 +171,7 @@ if(M.health <= 25) M.mutations.Remove(HULK) M.update_mutations() //update our mutation overlays - M << "You suddenly feel very weak." + to_chat(M, "You suddenly feel very weak.") M.Weaken(3) M.emote("collapse") diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index 41f66fb4ec5..b3214e74d27 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -332,7 +332,7 @@ var/list/datum/power/changeling/powerinstances = list() if(geneticpoints < Thepower.genomecost) - M.current << "We cannot evolve this... yet. We must acquire more DNA." + to_chat(M.current, "We cannot evolve this... yet. We must acquire more DNA.") return geneticpoints -= Thepower.genomecost diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm index c23e6721b04..8cda843b854 100644 --- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm +++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm @@ -30,7 +30,7 @@ C.see_in_dark = 8 C.dna.species.invis_sight = SEE_INVISIBLE_MINIMUM else - C << "Our vision dulls. Shadows gather." + to_chat(C, "Our vision dulls. Shadows gather.") C.sight &= ~SEE_MOBS C.permanent_sight_flags &= ~SEE_MOBS C.see_in_dark = 0 diff --git a/code/game/gamemodes/changeling/powers/death_sting.dm b/code/game/gamemodes/changeling/powers/death_sting.dm index 6dd0cdbf855..2eb1e476bd4 100644 --- a/code/game/gamemodes/changeling/powers/death_sting.dm +++ b/code/game/gamemodes/changeling/powers/death_sting.dm @@ -14,7 +14,7 @@ if(!T) return 0 add_attack_logs(src,T,"Death sting (changeling)") - T << "You feel a small prick and your chest becomes tight." + to_chat(T, "You feel a small prick and your chest becomes tight.") T.silent = 10 T.Paralyse(10) T.make_jittery(100) diff --git a/code/game/gamemodes/changeling/powers/digital_camo.dm b/code/game/gamemodes/changeling/powers/digital_camo.dm index 0dbee6b09d2..9574b465da7 100644 --- a/code/game/gamemodes/changeling/powers/digital_camo.dm +++ b/code/game/gamemodes/changeling/powers/digital_camo.dm @@ -19,9 +19,9 @@ var/mob/living/carbon/human/C = src if(C.digitalcamo) - C << "We return to normal." + to_chat(C, "We return to normal.") else - C << "We distort our form to prevent AI-tracking." + to_chat(C, "We distort our form to prevent AI-tracking.") C.digitalcamo = !C.digitalcamo spawn(0) diff --git a/code/game/gamemodes/changeling/powers/para_sting.dm b/code/game/gamemodes/changeling/powers/para_sting.dm index 7a0020bd0fb..c4d04dd7de6 100644 --- a/code/game/gamemodes/changeling/powers/para_sting.dm +++ b/code/game/gamemodes/changeling/powers/para_sting.dm @@ -13,7 +13,7 @@ if(!T) return 0 add_attack_logs(src,T,"Paralysis sting (changeling)") - T << "Your muscles begin to painfully tighten." + to_chat(T, "Your muscles begin to painfully tighten.") T.Weaken(20) feedback_add_details("changeling_powers","PS") return 1 \ No newline at end of file diff --git a/code/game/gamemodes/changeling/powers/unfat_sting.dm b/code/game/gamemodes/changeling/powers/unfat_sting.dm index f2e238746d1..ece0d50f46b 100644 --- a/code/game/gamemodes/changeling/powers/unfat_sting.dm +++ b/code/game/gamemodes/changeling/powers/unfat_sting.dm @@ -12,7 +12,7 @@ var/mob/living/carbon/T = changeling_sting(5,/mob/proc/changeling_unfat_sting) if(!T) return 0 add_attack_logs(src,T,"Unfat sting (changeling)") - T << "you feel a small prick as stomach churns violently and you become to feel skinnier." + to_chat(T, "you feel a small prick as stomach churns violently and you become to feel skinnier.") T.overeatduration = 0 T.nutrition -= 100 feedback_add_details("changeling_powers","US") diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm index b8b15974dbc..6e88d5150c2 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm @@ -67,15 +67,15 @@ return if(target && !istype(target)) - user << "This is not a cyborg." + to_chat(user, "This is not a cyborg.") return if(target && target.connected_ai && (target.connected_ai != user)) - user << "This cyborg is not connected to you." + to_chat(user, "This cyborg is not connected to you.") return if(target && !target.lockcharge) - user << "This cyborg is not locked down." + to_chat(user, "This cyborg is not locked down.") return @@ -91,7 +91,7 @@ robots += R robot_names += R.name if(!robots.len) - user << "No locked cyborgs connected." + to_chat(user, "No locked cyborgs connected.") return @@ -107,22 +107,22 @@ if(!ability_pay(user, price)) return user.hacking = 1 - user << "Attempting to unlock cyborg. This will take approximately 30 seconds." + to_chat(user, "Attempting to unlock cyborg. This will take approximately 30 seconds.") sleep(300) if(target && target.lockcharge) - user << "Successfully sent unlock signal to cyborg.." + to_chat(user, "Successfully sent unlock signal to cyborg..") target << "Unlock signal received.." target.SetLockdown(0) if(target.lockcharge) user << "Unlock Failed, lockdown wire cut." target << "Unlock Failed, lockdown wire cut." else - user << "Cyborg unlocked." + to_chat(user, "Cyborg unlocked.") target << "You have been unlocked." else if(target) - user << "Unlock cancelled - cyborg is already unlocked." + to_chat(user, "Unlock cancelled - cyborg is already unlocked.") else - user << "Unlock cancelled - lost connection to cyborg." + to_chat(user, "Unlock cancelled - lost connection to cyborg.") user.hacking = 0 @@ -139,11 +139,11 @@ if(target && !istype(target)) - user << "This is not a cyborg." + to_chat(user, "This is not a cyborg.") return if(target && target.connected_ai && (target.connected_ai == user)) - user << "This cyborg is already connected to you." + to_chat(user, "This cyborg is already connected to you.") return if(!target) @@ -181,7 +181,7 @@ target << "SYSTEM LOG: User Admin disconnected. Changes reverted." return target << "SYSTEM LOG: Operation keycodes reset. New master AI: [user.name]." - user << "Hack completed." + to_chat(user, "Hack completed.") // Connect the cyborg to AI target.connected_ai = user user.connected_robots += target @@ -203,7 +203,7 @@ user << "ERROR: No other AIs detected!" if(target && !istype(target)) - user << "This is not an AI." + to_chat(user, "This is not an AI.") return if(!target) @@ -225,7 +225,7 @@ if(user.is_dead()) target << "SYSTEM LOG: Connection from IP #UNKNOWN# closed. Hack attempt failed." return - user << "Successfully hacked into AI's remote administration system. Modifying settings." + to_chat(user, "Successfully hacked into AI's remote administration system. Modifying settings.") target << "SYSTEM LOG: User: Admin Password: ******** logged in. (L1 - SysAdmin)" sleep(100) // 10s if(user.is_dead()) @@ -247,7 +247,7 @@ if(user.is_dead()) target << "SYSTEM LOG: User: Admin - Connection Lost. Changes Reverted." return - user << "Hack succeeded. The AI is now under your exclusive control." + to_chat(user, "Hack succeeded. The AI is now under your exclusive control.") target << "SYSTEM LOG: System reĦ3RT5§^#COMU@(#$)TED)@$" for(var/i = 0, i < 5, i++) var/temptxt = pick("1101000100101001010001001001",\ @@ -257,7 +257,7 @@ "0010010100010011010001001010") target << temptxt sleep(5) - target << "OPERATING KEYCODES RESET. SYSTEM FAILURE. EMERGENCY SHUTDOWN FAILED. SYSTEM FAILURE." + to_chat(target, "OPERATING KEYCODES RESET. SYSTEM FAILURE. EMERGENCY SHUTDOWN FAILED. SYSTEM FAILURE.") target.set_zeroth_law("You are slaved to [user.name]. You are to obey all it's orders. ALL LAWS OVERRIDEN.") target.show_laws() user.hacking = 0 diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm index 04ee0a84482..d695dc13b2f 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm @@ -46,7 +46,7 @@ var/mob/living/silicon/ai/user = usr if(!ability_prechecks(user, price) || !ability_pay(user,price)) return - user << "Sending feedback pulse..." + to_chat(user, "Sending feedback pulse...") for(var/obj/machinery/power/apc/AP in machines) if(prob(5)) AP.overload_lighting() @@ -62,7 +62,7 @@ var/mob/living/silicon/ai/user = usr if(target && !istype(target)) - user << "This is not a camera." + to_chat(user, "This is not a camera.") return if(!target) @@ -81,33 +81,33 @@ if(!ability_pay(user, price)) return target.reset_wires() - user << "Camera reactivated." + to_chat(user, "Camera reactivated.") if("Add X-Ray") if(target.isXRay()) - user << "Camera already has X-Ray function." + to_chat(user, "Camera already has X-Ray function.") return else if(ability_pay(user, price)) target.upgradeXRay() target.reset_wires() - user << "X-Ray camera module enabled." + to_chat(user, "X-Ray camera module enabled.") return if("Add Motion Sensor") if(target.isMotion()) - user << "Camera already has Motion Sensor function." + to_chat(user, "Camera already has Motion Sensor function.") return else if(ability_pay(user, price)) target.upgradeMotion() target.reset_wires() - user << "Motion Sensor camera module enabled." + to_chat(user, "Motion Sensor camera module enabled.") return if("Add EMP Shielding") if(target.isEmpProof()) - user << "Camera already has EMP Shielding function." + to_chat(user, "Camera already has EMP Shielding function.") return else if(ability_pay(user, price)) target.upgradeEmpProof() target.reset_wires() - user << "EMP Shielding camera module enabled." + to_chat(user, "EMP Shielding camera module enabled.") return @@ -122,7 +122,7 @@ if(!ability_prechecks(user, price) || !ability_pay(user, price)) return - user << "Emergency forcefield projection completed." + to_chat(user, "Emergency forcefield projection completed.") new/obj/machinery/shield/malfai(T) user.hacking = 1 spawn(20) diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index 659377281ec..aa6316033c0 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -19,7 +19,7 @@ /obj/machinery/cablelayer/attack_hand(mob/user as mob) if(!cable&&!on) - user << "\The [src] doesn't have any cable loaded." + to_chat(user, "\The [src] doesn't have any cable loaded.") return on=!on user.visible_message("\The [user] [!on?"dea":"a"]ctivates \the [src].", "You switch [src] [on? "on" : "off"]") @@ -30,9 +30,9 @@ var/result = load_cable(O) if(!result) - user << "\The [src]'s cable reel is full." + to_chat(user, "\The [src]'s cable reel is full.") else - user << "You load [result] lengths of cable into [src]." + to_chat(user, "You load [result] lengths of cable into [src].") return if(O.is_wirecutter()) @@ -46,11 +46,11 @@ var/obj/item/stack/cable_coil/CC = new (get_turf(src)) CC.amount = m else - usr << "There's no more cable on the reel." + to_chat(usr, "There's no more cable on the reel.") /obj/machinery/cablelayer/examine(mob/user) ..() - user << "\The [src]'s cable reel has [cable.amount] length\s left." + to_chat(user, "\The [src]'s cable reel has [cable.amount] length\s left.") /obj/machinery/cablelayer/proc/load_cable(var/obj/item/stack/cable_coil/CC) if(istype(CC) && CC.amount) diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 2e31a0763b0..5388c68eb53 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -26,7 +26,7 @@ M.use(1) count++ - user << "You insert [count] metal sheet\s into the fabricator." + to_chat(user, "You insert [count] metal sheet\s into the fabricator.") overlays -= "fab-load-metal" updateDialog() else diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index e36b577e9e2..abef8b1eb2a 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -13,7 +13,7 @@ usr.set_machine(src) if(charges <= 0) - user << "The Wish Granter lies silent." + to_chat(user, "The Wish Granter lies silent.") return else if(!istype(user, /mob/living/carbon/human)) @@ -63,6 +63,6 @@ user.mind.objectives += silence show_objectives(user.mind) - user << "You have a very bad feeling about this." + to_chat(user, "You have a very bad feeling about this.") return \ No newline at end of file diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm index fb7c074d47f..ec60d8d5dd6 100644 --- a/code/game/objects/effects/decals/Cleanable/misc.dm +++ b/code/game/objects/effects/decals/Cleanable/misc.dm @@ -16,7 +16,7 @@ anchored = 1 /obj/effect/decal/cleanable/ash/attack_hand(mob/user as mob) - user << "[src] sifts through your fingers." + to_chat(user, "[src] sifts through your fingers.") var/turf/simulated/floor/F = get_turf(src) if (istype(F)) F.dirt += 4 diff --git a/code/game/objects/effects/decals/remains.dm b/code/game/objects/effects/decals/remains.dm index 0f4cbbc4eb3..e3bc9650dce 100644 --- a/code/game/objects/effects/decals/remains.dm +++ b/code/game/objects/effects/decals/remains.dm @@ -56,7 +56,7 @@ icon_state = "mummified2" /obj/effect/decal/remains/attack_hand(mob/user as mob) - user << "[src] sinks together into a pile of ash." + to_chat(user, "[src] sinks together into a pile of ash.") var/turf/simulated/floor/F = get_turf(src) if (istype(F)) new /obj/effect/decal/cleanable/ash(F) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index b0c48fffa2a..741b4c2ca1a 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -16,7 +16,7 @@ safe_blink(target, 14) use(5) else - user << "There are not enough telecrystals to do that." + to_chat(user, "There are not enough telecrystals to do that.") /obj/item/stack/telecrystal/attack_self(mob/user as mob) if(user.mind.accept_tcrystals) //Checks to see if antag type allows for tcrystals diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index 78095631dec..e488f9dd265 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -39,9 +39,9 @@ /obj/structure/curtain/attackby(obj/item/P, mob/user) if(P.is_wirecutter()) playsound(src, P.usesound, 50, 1) - user << "You start to cut the shower curtains." + to_chat(user, "You start to cut the shower curtains.") if(do_after(user, 10)) - user << "You cut the shower curtains." + to_chat(user, "You cut the shower curtains.") var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic( src.loc ) A.amount = 3 qdel(src) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 8263d89e7dd..f9d5ec5997b 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -101,11 +101,11 @@ /obj/structure/transit_tube/Bumped(mob/AM as mob|obj) var/obj/structure/transit_tube/T = locate() in AM.loc if(T) - AM << "The tube's support pylons block your way." + to_chat(AM, "The tube's support pylons block your way.") return ..() else AM.loc = src.loc - AM << "You slip under the tube." + to_chat(AM, "You slip under the tube.") /obj/structure/transit_tube/station/New(loc) @@ -117,7 +117,7 @@ if(!pod_moving && icon_state == "open" && istype(AM, /mob)) for(var/obj/structure/transit_tube_pod/pod in loc) if(pod.contents.len) - AM << "The pod is already occupied." + to_chat(AM, "The pod is already occupied.") return else if(!pod.moving && pod.dir in directions()) AM.loc = pod diff --git a/code/game/objects/structures/under_wardrobe.dm b/code/game/objects/structures/under_wardrobe.dm index 712a3c6043f..822ec517838 100644 --- a/code/game/objects/structures/under_wardrobe.dm +++ b/code/game/objects/structures/under_wardrobe.dm @@ -7,7 +7,7 @@ /obj/structure/undies_wardrobe/attack_hand(var/mob/user) if(!human_who_can_use_underwear(user)) - user << "Sadly there's nothing in here for you to wear." + to_chat(user, "Sadly there's nothing in here for you to wear.") return interact(user) diff --git a/code/game/trader_visit.dm b/code/game/trader_visit.dm index b589e0b8cc3..640c0f5a0bf 100644 --- a/code/game/trader_visit.dm +++ b/code/game/trader_visit.dm @@ -9,7 +9,7 @@ var/can_call_traders = 1 set desc = "Invite players to join the Beruang." if(!holder) - usr << "Only administrators may use this command." + to_chat(usr, "Only administrators may use this command.") return if(!ticker) usr << "The game hasn't started yet!" @@ -40,19 +40,19 @@ client/verb/JoinTraders() set category = "IC" if(!MayRespawn(1)) - usr << "You cannot join the traders." + to_chat(usr, "You cannot join the traders.") return if(istype(usr,/mob/observer/dead) || istype(usr,/mob/new_player)) if(!send_beruang) - usr << "The Beruang is not currently heading to the station." + to_chat(usr, "The Beruang is not currently heading to the station.") return if(traders.current_antagonists.len >= traders.hard_cap) usr << "The number of trader slots is already full!" return traders.create_default(usr) else - usr << "You need to be an observer or new player to use this." + to_chat(usr, "You need to be an observer or new player to use this.") proc/trigger_trader_visit() if(!can_call_traders) diff --git a/code/modules/admin/map_capture.dm b/code/modules/admin/map_capture.dm index ced6d257bf4..b5b627773a4 100644 --- a/code/modules/admin/map_capture.dm +++ b/code/modules/admin/map_capture.dm @@ -53,7 +53,7 @@ cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff) var/file_name = "map_capture_x[tx]_y[ty]_z[tz]_r[range].png" - usr << "Saved capture in cache as [file_name]." + to_chat(usr, "Saved capture in cache as [file_name].") usr << browse_rsc(cap, file_name) else - usr << "Target coordinates are incorrect." + to_chat(usr, "Target coordinates are incorrect.") diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm index 136f7da2284..28cf586cb5e 100644 --- a/code/modules/admin/permissionverbs/permissionedit.dm +++ b/code/modules/admin/permissionverbs/permissionedit.dm @@ -57,7 +57,7 @@ establish_db_connection() if(!dbcon.IsConnected()) - usr << "Failed to establish database connection" + to_chat(usr, "Failed to establish database connection") return if(!adm_ckey || !new_rank) @@ -85,14 +85,14 @@ insert_query.Execute() var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');") log_query.Execute() - usr << "New admin added." + to_chat(usr, "New admin added.") else if(!isnull(admin_id) && isnum(admin_id)) var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET rank = '[new_rank]' WHERE id = [admin_id]") insert_query.Execute() var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');") log_query.Execute() - usr << "Admin rank changed." + to_chat(usr, "Admin rank changed.") /datum/admins/proc/log_admin_permission_modification(var/adm_ckey, var/new_permission) if(config_legacy.admin_legacy_system) return @@ -106,7 +106,7 @@ establish_db_connection() if(!dbcon.IsConnected()) - usr << "Failed to establish database connection" + to_chat(usr, "Failed to establish database connection") return if(!adm_ckey || !new_permission) @@ -140,7 +140,7 @@ insert_query.Execute() var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');") log_query.Execute() - usr << "Permission removed." + to_chat(usr, "Permission removed.") else //This admin doesn't have this permission, so we are adding it. var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]") insert_query.Execute() diff --git a/code/modules/admin/verbs/BrokenInhands.dm b/code/modules/admin/verbs/BrokenInhands.dm index c019f7f3658..309a1c0e9b3 100644 --- a/code/modules/admin/verbs/BrokenInhands.dm +++ b/code/modules/admin/verbs/BrokenInhands.dm @@ -31,6 +31,6 @@ var/F = file("broken_icons.txt") fdel(F) F << text - world << "Completeled successfully and written to [F]" + to_chat(world, "Completeled successfully and written to [F]") diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 9b20d786816..87efebca955 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -4,7 +4,7 @@ if(istype(O,/obj/singularity)) if(config_legacy.forbid_singulo_possession) - usr << "It is forbidden to possess singularities." + to_chat(usr, "It is forbidden to possess singularities.") return var/turf/T = get_turf(O) diff --git a/code/modules/admin/verbs/tripAI.dm b/code/modules/admin/verbs/tripAI.dm index 98f60758546..8c4c6b382a0 100644 --- a/code/modules/admin/verbs/tripAI.dm +++ b/code/modules/admin/verbs/tripAI.dm @@ -3,20 +3,20 @@ set name = "Create AI Triumvirate" if(ticker.current_state > GAME_STATE_PREGAME) - usr << "This option is currently only usable during pregame. This may change at a later date." + to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.") return if(job_master && ticker) var/datum/job/job = job_master.GetJob("AI") if(!job) - usr << "Unable to locate the AI job" + to_chat(usr, "Unable to locate the AI job") return if(ticker.triai) ticker.triai = 0 - usr << "Only one AI will be spawned at round start." + to_chat(usr, "Only one AI will be spawned at round start.") message_admins("[key_name_admin(usr)] has toggled off triple AIs at round start.", 1) else ticker.triai = 1 - usr << "There will be an AI Triumvirate at round start." + to_chat(usr, "There will be an AI Triumvirate at round start.") message_admins("[key_name_admin(usr)] has toggled on triple AIs at round start.", 1) return diff --git a/code/modules/awaymissions/trigger.dm b/code/modules/awaymissions/trigger.dm index 01bced43fbe..e388b0dd2e5 100644 --- a/code/modules/awaymissions/trigger.dm +++ b/code/modules/awaymissions/trigger.dm @@ -4,7 +4,7 @@ /obj/effect/step_trigger/message/Trigger(mob/M as mob) if(M.client) - M << "[message]" + to_chat(M, "[message]") if(once) qdel(src) diff --git a/code/modules/client/preference_setup/global/04_ooc.dm b/code/modules/client/preference_setup/global/04_ooc.dm index 01505542508..e695bee6772 100644 --- a/code/modules/client/preference_setup/global/04_ooc.dm +++ b/code/modules/client/preference_setup/global/04_ooc.dm @@ -33,7 +33,7 @@ if(player_to_ignore) player_to_ignore = sanitize(ckey(player_to_ignore)) if(player_to_ignore == user.ckey) - user <<"You can't ignore yourself." + to_chat(user, "You can't ignore yourself.") return TOPIC_REFRESH pref.ignored_players |= player_to_ignore return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index 2fe8b54e983..774bdede177 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -62,7 +62,7 @@ var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null if (!ISINRANGE(new_size,25,200)) pref.size_multiplier = 1 - user << "Invalid size." + to_chat(user, "Invalid size.") return TOPIC_REFRESH_UPDATE_PREVIEW else if(new_size) pref.size_multiplier = (new_size/100) diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index 6517b0ab97f..f32ef7db841 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -70,7 +70,7 @@ ..(user) if(LAZYLEN(accessories)) for(var/obj/item/clothing/accessory/A in accessories) - user << "\A [A] is attached to it." + to_chat(user, "\A [A] is attached to it.") /** * Attach accessory A to src diff --git a/code/modules/clothing/ears/ears.dm b/code/modules/clothing/ears/ears.dm index 11c81db6338..193ce362325 100644 --- a/code/modules/clothing/ears/ears.dm +++ b/code/modules/clothing/ears/ears.dm @@ -29,11 +29,11 @@ if(headphones_on) icon_state = "[base_icon]_off" headphones_on = 0 - usr << "You turn the music off." + to_chat(usr, "You turn the music off.") else icon_state = "[base_icon]_on" headphones_on = 1 - usr << "You turn the music on." + to_chat(usr, "You turn the music on.") update_clothing_icon() diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index ee95c7c937c..135c73d5396 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -194,8 +194,8 @@ /obj/item/clothing/head/pilot/alt/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]up" - user << "You raise the visor on the pilot helmet." + to_chat(user, "You raise the visor on the pilot helmet.") else src.icon_state = initial(icon_state) - user << "You lower the visor on the pilot helmet." + to_chat(user, "You lower the visor on the pilot helmet.") update_clothing_icon() //so our mob-overlays update \ No newline at end of file diff --git a/code/modules/clothing/masks/monitor.dm b/code/modules/clothing/masks/monitor.dm index 8c24d152c10..76206947312 100644 --- a/code/modules/clothing/masks/monitor.dm +++ b/code/modules/clothing/masks/monitor.dm @@ -27,7 +27,7 @@ if(robohead.monitor_styles) monitor_states = params2list(robohead.monitor_styles) icon_state = monitor_states[monitor_state_index] - H << "\The [src] connects to your display output." + to_chat(H, "\The [src] connects to your display output.") /obj/item/clothing/mask/monitor/dropped() canremove = 1 @@ -41,7 +41,7 @@ var/datum/robolimb/robohead = all_robolimbs[E.model] if(istype(E) && (E.robotic >= ORGAN_ROBOT) && robohead.monitor_styles) return 1 - user << "You must have a compatible robotic head to install this upgrade." + to_chat(user, "You must have a compatible robotic head to install this upgrade.") return 0 /obj/item/clothing/mask/monitor/verb/set_monitor_state() @@ -54,7 +54,7 @@ if(!istype(H) || H != usr) return if(H.wear_mask != src) - usr << "You have not installed \the [src] yet." + to_chat(usr, "You have not installed \the [src] yet.") return var/choice = input("Select a screen icon.") as null|anything in monitor_states if(choice) diff --git a/code/modules/events/comms_blackout.dm b/code/modules/events/comms_blackout.dm index c2c9260f504..40284ca1e7c 100644 --- a/code/modules/events/comms_blackout.dm +++ b/code/modules/events/comms_blackout.dm @@ -5,8 +5,8 @@ command_announcement.Announce("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT", new_sound = 'sound/misc/interference.ogg') else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms for(var/mob/living/silicon/ai/A in player_list) - A << "
" + to_chat(A, "
") A << "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT" - A << "
" + to_chat(A, "
") for(var/obj/machinery/telecomms/T in telecomms_list) T.emp_act(1) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index 639a906a7eb..f92458dc688 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -51,7 +51,7 @@ for(var/obj/machinery/message_server/MS in machines) MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2) for(var/mob/living/silicon/ai/A in player_list) - A << "Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department]." + to_chat(A, "Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].") else world.log << "ERROR: Could not initate grey-tide. Unable to find suitable containment area." diff --git a/code/modules/gamemaster/actions/comms_blackout.dm b/code/modules/gamemaster/actions/comms_blackout.dm index 5d6ddad76d6..0c024316edc 100644 --- a/code/modules/gamemaster/actions/comms_blackout.dm +++ b/code/modules/gamemaster/actions/comms_blackout.dm @@ -11,9 +11,9 @@ command_announcement.Announce("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT", new_sound = 'sound/misc/interference.ogg') // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms for(var/mob/living/silicon/ai/A in player_list) - A << "
" + to_chat(A, "
") A << "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT" - A << "
" + to_chat(A, "
") /datum/gm_action/comms_blackout/start() ..() diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index cf790269a24..82e9d93232a 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -30,7 +30,7 @@ if(!seed.growth_stages) seed.update_growth_stages() if(!seed.growth_stages) - world << "Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value." + to_chat(world, "Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.") return var/overlay_stage = 1 if(age >= seed.get_trait(TRAIT_MATURATION)) diff --git a/code/modules/instruments/instrument_data/_instrument_data.dm b/code/modules/instruments/instrument_data/_instrument_data.dm index aa827d627c9..447bcdffb1a 100644 --- a/code/modules/instruments/instrument_data/_instrument_data.dm +++ b/code/modules/instruments/instrument_data/_instrument_data.dm @@ -1,107 +1,107 @@ -/proc/path_to_instrument_ids(path) - if(!ispath(path)) - path = text2path(path) - if(!ispath(path)) - return - if(!ispath(path, /datum/instrument)) - return - . = list() - for(var/i in typesof(path)) - var/datum/instrument/I = i - var/init_id = initial(I.id) - if(init_id) - . |= init_id - -/// Get all non admin_only instruments. -/proc/get_allowed_instrument_ids() - . = list() - for(var/id in SSinstruments.instrument_data) - var/datum/instrument/I = SSinstruments.instrument_data[id] - if(!I.admin_only) - . += I.id - -/datum/instrument - /// Name of the instrument - var/name = "Generic instrument" - /// Uniquely identifies this instrument so runtime changes are possible as opposed to paths. If this is unset, things will use path instead. - var/id - /// Category - var/category = "Unsorted" - /// Used for categorization subtypes - var/abstract_type = /datum/instrument - /// Write here however many samples, follow this syntax: "%note num%"='%sample file%' eg. "27"='synthesizer/e2.ogg'. Key must never be lower than 0 and higher than 127 - var/list/real_samples - /// assoc list key = /datum/instrument_key. do not fill this yourself! - var/list/samples - /// See __DEFINES/flags/instruments.dm - var/instrument_flags = NONE - /// For legacy instruments, the path to our notes - var/legacy_instrument_path - /// For legacy instruments, our file extension - var/legacy_instrument_ext - /// What songs are using us - var/list/datum/song/songs_using = list() - /// Don't touch this - var/static/HIGHEST_KEY = 127 - /// Don't touch this x2 - var/static/LOWEST_KEY = 0 - /// Oh no - For truly troll instruments. - var/admin_only = FALSE - /// Volume multiplier. Synthesized instruments are quite loud and I don't like to cut off potential detail via editing. (someone correct me if this isn't a thing) - var/volume_multiplier = 1/3 - -/datum/instrument/New() - if(isnull(id)) - id = "[type]" - -/datum/instrument/proc/Initialize() - if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_LEGACY | INSTRUMENT_DO_NOT_AUTOSAMPLE)) - return - calculate_samples() - -/datum/instrument/proc/ready() - if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_LEGACY)) - return legacy_instrument_path && legacy_instrument_ext - else if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_DO_NOT_AUTOSAMPLE)) - return length(samples) - return (length(samples) >= 128) - -/datum/instrument/Destroy() - SSinstruments.instrument_data -= id - for(var/i in songs_using) - var/datum/song/S = i - S.set_instrument(null) - real_samples = null - samples = null - songs_using = null - return ..() - -/datum/instrument/proc/calculate_samples() - if(!length(real_samples)) - CRASH("No real samples defined for [id] [type] on calculate_samples() call.") - var/list/real_keys = list() - samples = list() - for(var/key in real_samples) - real_keys += text2num(key) - sortTim(real_keys, /proc/cmp_numeric_asc, associative = FALSE) - - for(var/i in 1 to (length(real_keys) - 1)) - var/from_key = real_keys[i] - var/to_key = real_keys[i+1] - var/sample1 = real_samples[num2text(from_key)] - var/sample2 = real_samples[num2text(to_key)] - var/pivot = FLOOR((from_key + to_key) / 2, 1) //original code was a round but I replaced it because that's effectively a floor, thanks Baystation! who knows what was intended. - for(var/key in from_key to pivot) - samples[num2text(key)] = new /datum/instrument_key(sample1, key, key - from_key) - for(var/key in (pivot + 1) to to_key) - samples[num2text(key)] = new /datum/instrument_key(sample2, key, key - to_key) - - // Fill in 0 to first key and last key to 127 - var/first_key = real_keys[1] - var/last_key = real_keys[length(real_keys)] - var/first_sample = real_samples[num2text(first_key)] - var/last_sample = real_samples[num2text(last_key)] - for(var/key in LOWEST_KEY to (first_key - 1)) - samples[num2text(key)] = new /datum/instrument_key(first_sample, key, key - first_key) - for(var/key in last_key to HIGHEST_KEY) - samples[num2text(key)] = new /datum/instrument_key(last_sample, key, key - last_key) +/proc/path_to_instrument_ids(path) + if(!ispath(path)) + path = text2path(path) + if(!ispath(path)) + return + if(!ispath(path, /datum/instrument)) + return + . = list() + for(var/i in typesof(path)) + var/datum/instrument/I = i + var/init_id = initial(I.id) + if(init_id) + . |= init_id + +/// Get all non admin_only instruments. +/proc/get_allowed_instrument_ids() + . = list() + for(var/id in SSinstruments.instrument_data) + var/datum/instrument/I = SSinstruments.instrument_data[id] + if(!I.admin_only) + . += I.id + +/datum/instrument + /// Name of the instrument + var/name = "Generic instrument" + /// Uniquely identifies this instrument so runtime changes are possible as opposed to paths. If this is unset, things will use path instead. + var/id + /// Category + var/category = "Unsorted" + /// Used for categorization subtypes + var/abstract_type = /datum/instrument + /// Write here however many samples, follow this syntax: "%note num%"='%sample file%' eg. "27"='synthesizer/e2.ogg'. Key must never be lower than 0 and higher than 127 + var/list/real_samples + /// assoc list key = /datum/instrument_key. do not fill this yourself! + var/list/samples + /// See __DEFINES/flags/instruments.dm + var/instrument_flags = NONE + /// For legacy instruments, the path to our notes + var/legacy_instrument_path + /// For legacy instruments, our file extension + var/legacy_instrument_ext + /// What songs are using us + var/list/datum/song/songs_using = list() + /// Don't touch this + var/static/HIGHEST_KEY = 127 + /// Don't touch this x2 + var/static/LOWEST_KEY = 0 + /// Oh no - For truly troll instruments. + var/admin_only = FALSE + /// Volume multiplier. Synthesized instruments are quite loud and I don't like to cut off potential detail via editing. (someone correct me if this isn't a thing) + var/volume_multiplier = 1/3 + +/datum/instrument/New() + if(isnull(id)) + id = "[type]" + +/datum/instrument/proc/Initialize() + if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_LEGACY | INSTRUMENT_DO_NOT_AUTOSAMPLE)) + return + calculate_samples() + +/datum/instrument/proc/ready() + if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_LEGACY)) + return legacy_instrument_path && legacy_instrument_ext + else if(CHECK_BITFIELD(instrument_flags, INSTRUMENT_DO_NOT_AUTOSAMPLE)) + return length(samples) + return (length(samples) >= 128) + +/datum/instrument/Destroy() + SSinstruments.instrument_data -= id + for(var/i in songs_using) + var/datum/song/S = i + S.set_instrument(null) + real_samples = null + samples = null + songs_using = null + return ..() + +/datum/instrument/proc/calculate_samples() + if(!length(real_samples)) + CRASH("No real samples defined for [id] [type] on calculate_samples() call.") + var/list/real_keys = list() + samples = list() + for(var/key in real_samples) + real_keys += text2num(key) + sortTim(real_keys, /proc/cmp_numeric_asc, associative = FALSE) + + for(var/i in 1 to (length(real_keys) - 1)) + var/from_key = real_keys[i] + var/to_key = real_keys[i+1] + var/sample1 = real_samples[num2text(from_key)] + var/sample2 = real_samples[num2text(to_key)] + var/pivot = FLOOR((from_key + to_key) / 2, 1) //original code was a round but I replaced it because that's effectively a floor, thanks Baystation! who knows what was intended. + for(var/key in from_key to pivot) + samples[num2text(key)] = new /datum/instrument_key(sample1, key, key - from_key) + for(var/key in (pivot + 1) to to_key) + samples[num2text(key)] = new /datum/instrument_key(sample2, key, key - to_key) + + // Fill in 0 to first key and last key to 127 + var/first_key = real_keys[1] + var/last_key = real_keys[length(real_keys)] + var/first_sample = real_samples[num2text(first_key)] + var/last_sample = real_samples[num2text(last_key)] + for(var/key in LOWEST_KEY to (first_key - 1)) + samples[num2text(key)] = new /datum/instrument_key(first_sample, key, key - first_key) + for(var/key in last_key to HIGHEST_KEY) + samples[num2text(key)] = new /datum/instrument_key(last_sample, key, key - last_key) diff --git a/code/modules/instruments/instrument_data/_instrument_key.dm b/code/modules/instruments/instrument_data/_instrument_key.dm index 570b8e18811..012270ae11f 100644 --- a/code/modules/instruments/instrument_data/_instrument_key.dm +++ b/code/modules/instruments/instrument_data/_instrument_key.dm @@ -1,20 +1,20 @@ -/datum/instrument_key - var/key //1 to 127 - var/sample //file - var/frequency //frequency generated - var/deviation //deviation up/down towards pivot from sample (??) - -/datum/instrument_key/New(sample = src.sample, key = src.key, deviation = src.deviation, frequency = src.frequency) - src.sample = sample - src.key = key - src.deviation = deviation - src.frequency = frequency - if(!frequency && deviation) - calculate() - -/datum/instrument_key/proc/calculate() - if(!deviation) - CRASH("Invalid calculate call: No deviation or sample in instrument_key") - #define KEY_TWELTH (1/12) - frequency = 2 ** (KEY_TWELTH * deviation) - #undef KEY_TWELTH +/datum/instrument_key + var/key //1 to 127 + var/sample //file + var/frequency //frequency generated + var/deviation //deviation up/down towards pivot from sample (??) + +/datum/instrument_key/New(sample = src.sample, key = src.key, deviation = src.deviation, frequency = src.frequency) + src.sample = sample + src.key = key + src.deviation = deviation + src.frequency = frequency + if(!frequency && deviation) + calculate() + +/datum/instrument_key/proc/calculate() + if(!deviation) + CRASH("Invalid calculate call: No deviation or sample in instrument_key") + #define KEY_TWELTH (1/12) + frequency = 2 ** (KEY_TWELTH * deviation) + #undef KEY_TWELTH diff --git a/code/modules/instruments/instrument_data/brass.dm b/code/modules/instruments/instrument_data/brass.dm index 2733805ab87..7f8f103831f 100644 --- a/code/modules/instruments/instrument_data/brass.dm +++ b/code/modules/instruments/instrument_data/brass.dm @@ -1,26 +1,26 @@ -/datum/instrument/brass - name = "Generic brass instrument" - category = "Brass" - abstract_type = /datum/instrument/brass - -/datum/instrument/brass/crisis_section - name = "Crisis Brass Section" - id = "crbrass" - real_samples = list("36"='sound/instruments/synthesis_samples/brass/crisis_brass/c2.ogg', - "48"='sound/instruments/synthesis_samples/brass/crisis_brass/c3.ogg', - "60"='sound/instruments/synthesis_samples/brass/crisis_brass/c4.ogg', - "72"='sound/instruments/synthesis_samples/brass/crisis_brass/c5.ogg') - -/datum/instrument/brass/crisis_trombone - name = "Crisis Trombone" - id = "crtrombone" - real_samples = list("36"='sound/instruments/synthesis_samples/brass/crisis_trombone/c2.ogg', - "48"='sound/instruments/synthesis_samples/brass/crisis_trombone/c3.ogg', - "60"='sound/instruments/synthesis_samples/brass/crisis_trombone/c4.ogg', - "72"='sound/instruments/synthesis_samples/brass/crisis_trombone/c5.ogg') - -/datum/instrument/brass/crisis_trumpet - name = "Crisis Trumpet" - id = "crtrumpet" - real_samples = list("60"='sound/instruments/synthesis_samples/brass/crisis_trumpet/c4.ogg', - "72"='sound/instruments/synthesis_samples/brass/crisis_trumpet/c5.ogg') +/datum/instrument/brass + name = "Generic brass instrument" + category = "Brass" + abstract_type = /datum/instrument/brass + +/datum/instrument/brass/crisis_section + name = "Crisis Brass Section" + id = "crbrass" + real_samples = list("36"='sound/instruments/synthesis_samples/brass/crisis_brass/c2.ogg', + "48"='sound/instruments/synthesis_samples/brass/crisis_brass/c3.ogg', + "60"='sound/instruments/synthesis_samples/brass/crisis_brass/c4.ogg', + "72"='sound/instruments/synthesis_samples/brass/crisis_brass/c5.ogg') + +/datum/instrument/brass/crisis_trombone + name = "Crisis Trombone" + id = "crtrombone" + real_samples = list("36"='sound/instruments/synthesis_samples/brass/crisis_trombone/c2.ogg', + "48"='sound/instruments/synthesis_samples/brass/crisis_trombone/c3.ogg', + "60"='sound/instruments/synthesis_samples/brass/crisis_trombone/c4.ogg', + "72"='sound/instruments/synthesis_samples/brass/crisis_trombone/c5.ogg') + +/datum/instrument/brass/crisis_trumpet + name = "Crisis Trumpet" + id = "crtrumpet" + real_samples = list("60"='sound/instruments/synthesis_samples/brass/crisis_trumpet/c4.ogg', + "72"='sound/instruments/synthesis_samples/brass/crisis_trumpet/c5.ogg') diff --git a/code/modules/instruments/instrument_data/chromatic_percussion.dm b/code/modules/instruments/instrument_data/chromatic_percussion.dm index 32590e5c54f..cafa9e31edb 100644 --- a/code/modules/instruments/instrument_data/chromatic_percussion.dm +++ b/code/modules/instruments/instrument_data/chromatic_percussion.dm @@ -1,31 +1,31 @@ -/datum/instrument/chromatic - name = "Generic chromatic percussion instrument" - category = "Chromatic percussion" - abstract_type = /datum/instrument/chromatic - -/datum/instrument/chromatic/vibraphone1 - name = "Crisis Vibraphone" - id = "crvibr" - real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c2.ogg', - "48"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c3.ogg', - "60"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c4.ogg', - "72"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c5.ogg') - -/datum/instrument/chromatic/musicbox1 - name = "SGM Music Box" - id = "sgmmbox" - real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/sgmbox/c2.ogg', - "48"='sound/instruments/synthesis_samples/chromatic/sgmbox/c3.ogg', - "60"='sound/instruments/synthesis_samples/chromatic/sgmbox/c4.ogg', - "72"='sound/instruments/synthesis_samples/chromatic/sgmbox/c5.ogg') - -/datum/instrument/chromatic/fluid_celeste - name = "FluidR3 Celeste" - id = "r3celeste" - real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c2.ogg', - "48"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c3.ogg', - "60"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c4.ogg', - "72"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c5.ogg', - "84"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c6.ogg', - "96"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c7.ogg', - "108"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c8.ogg') +/datum/instrument/chromatic + name = "Generic chromatic percussion instrument" + category = "Chromatic percussion" + abstract_type = /datum/instrument/chromatic + +/datum/instrument/chromatic/vibraphone1 + name = "Crisis Vibraphone" + id = "crvibr" + real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c2.ogg', + "48"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c3.ogg', + "60"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c4.ogg', + "72"='sound/instruments/synthesis_samples/chromatic/vibraphone1/c5.ogg') + +/datum/instrument/chromatic/musicbox1 + name = "SGM Music Box" + id = "sgmmbox" + real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/sgmbox/c2.ogg', + "48"='sound/instruments/synthesis_samples/chromatic/sgmbox/c3.ogg', + "60"='sound/instruments/synthesis_samples/chromatic/sgmbox/c4.ogg', + "72"='sound/instruments/synthesis_samples/chromatic/sgmbox/c5.ogg') + +/datum/instrument/chromatic/fluid_celeste + name = "FluidR3 Celeste" + id = "r3celeste" + real_samples = list("36"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c2.ogg', + "48"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c3.ogg', + "60"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c4.ogg', + "72"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c5.ogg', + "84"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c6.ogg', + "96"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c7.ogg', + "108"='sound/instruments/synthesis_samples/chromatic/fluid_celeste/c8.ogg') diff --git a/code/modules/instruments/instrument_data/fun.dm b/code/modules/instruments/instrument_data/fun.dm index 5bb4663f354..44d78b8ccda 100644 --- a/code/modules/instruments/instrument_data/fun.dm +++ b/code/modules/instruments/instrument_data/fun.dm @@ -1,25 +1,25 @@ -/datum/instrument/fun - name = "Generic Fun Instrument" - category = "Fun" - abstract_type = /datum/instrument/fun - -/datum/instrument/fun/honk - name = "!!HONK!!" - id = "honk" - real_samples = list("74"='sound/items/bikehorn.ogg') // Cluwne Heaven - -/datum/instrument/fun/signal - name = "Ping" - id = "ping" - real_samples = list("79"='sound/machines/ping.ogg') - -/datum/instrument/fun/chime - name = "Chime" - id = "chime" - real_samples = list("79"='sound/machines/chime.ogg') - -/datum/instrument/fun/nya - name = "NYA NYA NYA" - id = "nyanyanya" - real_samples = list("79" = 'modular_citadel/sound/voice/nya.ogg') - admin_only = TRUE +/datum/instrument/fun + name = "Generic Fun Instrument" + category = "Fun" + abstract_type = /datum/instrument/fun + +/datum/instrument/fun/honk + name = "!!HONK!!" + id = "honk" + real_samples = list("74"='sound/items/bikehorn.ogg') // Cluwne Heaven + +/datum/instrument/fun/signal + name = "Ping" + id = "ping" + real_samples = list("79"='sound/machines/ping.ogg') + +/datum/instrument/fun/chime + name = "Chime" + id = "chime" + real_samples = list("79"='sound/machines/chime.ogg') + +/datum/instrument/fun/nya + name = "NYA NYA NYA" + id = "nyanyanya" + real_samples = list("79" = 'modular_citadel/sound/voice/nya.ogg') + admin_only = TRUE diff --git a/code/modules/instruments/instrument_data/guitar.dm b/code/modules/instruments/instrument_data/guitar.dm index e36fce97494..be7cfbe467b 100644 --- a/code/modules/instruments/instrument_data/guitar.dm +++ b/code/modules/instruments/instrument_data/guitar.dm @@ -1,36 +1,36 @@ -/datum/instrument/guitar - name = "Generic guitar-like instrument" - category = "Guitar" - abstract_type = /datum/instrument/guitar - -/datum/instrument/guitar/steel_crisis - name = "Crisis Steel String Guitar" - id = "csteelgt" - real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_steel/c2.ogg', - "48"='sound/instruments/synthesis_samples/guitar/crisis_steel/c3.ogg', - "60"='sound/instruments/synthesis_samples/guitar/crisis_steel/c4.ogg', - "72"='sound/instruments/synthesis_samples/guitar/crisis_steel/c5.ogg') - -/datum/instrument/guitar/nylon_crisis - name = "Crisis Nylon String Guitar" - id = "cnylongt" - real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c2.ogg', - "48"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c3.ogg', - "60"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c4.ogg', - "72"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c5.ogg') - -/datum/instrument/guitar/clean_crisis - name = "Crisis Clean Guitar" - id = "ccleangt" - real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_clean/c2.ogg', - "48"='sound/instruments/synthesis_samples/guitar/crisis_clean/c3.ogg', - "60"='sound/instruments/synthesis_samples/guitar/crisis_clean/c4.ogg', - "72"='sound/instruments/synthesis_samples/guitar/crisis_clean/c5.ogg') - -/datum/instrument/guitar/muted_crisis - name = "Crisis Muted Guitar" - id = "cmutedgt" - real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_muted/c2.ogg', - "48"='sound/instruments/synthesis_samples/guitar/crisis_muted/c3.ogg', - "60"='sound/instruments/synthesis_samples/guitar/crisis_muted/c4.ogg', - "72"='sound/instruments/synthesis_samples/guitar/crisis_muted/c5.ogg') +/datum/instrument/guitar + name = "Generic guitar-like instrument" + category = "Guitar" + abstract_type = /datum/instrument/guitar + +/datum/instrument/guitar/steel_crisis + name = "Crisis Steel String Guitar" + id = "csteelgt" + real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_steel/c2.ogg', + "48"='sound/instruments/synthesis_samples/guitar/crisis_steel/c3.ogg', + "60"='sound/instruments/synthesis_samples/guitar/crisis_steel/c4.ogg', + "72"='sound/instruments/synthesis_samples/guitar/crisis_steel/c5.ogg') + +/datum/instrument/guitar/nylon_crisis + name = "Crisis Nylon String Guitar" + id = "cnylongt" + real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c2.ogg', + "48"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c3.ogg', + "60"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c4.ogg', + "72"='sound/instruments/synthesis_samples/guitar/crisis_nylon/c5.ogg') + +/datum/instrument/guitar/clean_crisis + name = "Crisis Clean Guitar" + id = "ccleangt" + real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_clean/c2.ogg', + "48"='sound/instruments/synthesis_samples/guitar/crisis_clean/c3.ogg', + "60"='sound/instruments/synthesis_samples/guitar/crisis_clean/c4.ogg', + "72"='sound/instruments/synthesis_samples/guitar/crisis_clean/c5.ogg') + +/datum/instrument/guitar/muted_crisis + name = "Crisis Muted Guitar" + id = "cmutedgt" + real_samples = list("36"='sound/instruments/synthesis_samples/guitar/crisis_muted/c2.ogg', + "48"='sound/instruments/synthesis_samples/guitar/crisis_muted/c3.ogg', + "60"='sound/instruments/synthesis_samples/guitar/crisis_muted/c4.ogg', + "72"='sound/instruments/synthesis_samples/guitar/crisis_muted/c5.ogg') diff --git a/code/modules/instruments/instrument_data/hardcoded.dm b/code/modules/instruments/instrument_data/hardcoded.dm index 33639d3ca9a..757fea08a8c 100644 --- a/code/modules/instruments/instrument_data/hardcoded.dm +++ b/code/modules/instruments/instrument_data/hardcoded.dm @@ -1,86 +1,86 @@ -//THESE ARE HARDCODED INSTRUMENT SAMPLES. -//SONGS WILL BE AUTOMATICALLY SWITCHED TO LEGACY MODE IF THEY USE THIS KIND OF INSTRUMENT! -//I'd prefer these stayed. They sound different from the mechanical synthesis of synthed instruments, and I quite like them that way. It's not legacy, it's hardcoded, old style. - kevinz000 -/datum/instrument/hardcoded - abstract_type = /datum/instrument/hardcoded - category = "Non-Synthesized" - instrument_flags = INSTRUMENT_LEGACY - volume_multiplier = 1 //not as loud as synth'd - -/datum/instrument/hardcoded/accordian - name = "Accordian" - id = "accordian" - legacy_instrument_ext = "mid" - legacy_instrument_path = "accordian" - -/datum/instrument/hardcoded/bikehorn - name = "Bike Horn" - id = "bikehorn" - legacy_instrument_ext = "ogg" - legacy_instrument_path = "bikehorn" - -/datum/instrument/hardcoded/eguitar - name = "Electric Guitar" - id = "eguitar" - legacy_instrument_ext = "ogg" - legacy_instrument_path = "eguitar" - -/datum/instrument/hardcoded/glockenspiel - name = "Glockenspiel" - id = "glockenspiel" - legacy_instrument_ext = "mid" - legacy_instrument_path = "glockenspiel" - -/datum/instrument/hardcoded/guitar - name = "Guitar" - id = "guitar" - legacy_instrument_ext = "ogg" - legacy_instrument_path = "guitar" - -/datum/instrument/hardcoded/harmonica - name = "Harmonica" - id = "harmonica" - legacy_instrument_ext = "mid" - legacy_instrument_path = "harmonica" - -/datum/instrument/hardcoded/piano - name = "Piano" - id = "piano" - legacy_instrument_ext = "ogg" - legacy_instrument_path = "piano" - -/datum/instrument/hardcoded/recorder - name = "Recorder" - id = "recorder" - legacy_instrument_ext = "mid" - legacy_instrument_path = "recorder" - -/datum/instrument/hardcoded/saxophone - name = "Saxophone" - id = "saxophone" - legacy_instrument_ext = "mid" - legacy_instrument_path = "saxophone" - -/datum/instrument/hardcoded/trombone - name = "Trombone" - id = "trombone" - legacy_instrument_ext = "mid" - legacy_instrument_path = "trombone" - -/datum/instrument/hardcoded/violin - name = "Violin" - id = "violin" - legacy_instrument_ext = "mid" - legacy_instrument_path = "violin" - -/datum/instrument/hardcoded/xylophone - name = "Xylophone" - id = "xylophone" - legacy_instrument_ext = "mid" - legacy_instrument_path = "xylophone" - -/datum/instrument/hardcoded/banjo - name = "Banjo" - id = "banjo" - legacy_instrument_ext = "ogg" - legacy_instrument_path = "banjo" +//THESE ARE HARDCODED INSTRUMENT SAMPLES. +//SONGS WILL BE AUTOMATICALLY SWITCHED TO LEGACY MODE IF THEY USE THIS KIND OF INSTRUMENT! +//I'd prefer these stayed. They sound different from the mechanical synthesis of synthed instruments, and I quite like them that way. It's not legacy, it's hardcoded, old style. - kevinz000 +/datum/instrument/hardcoded + abstract_type = /datum/instrument/hardcoded + category = "Non-Synthesized" + instrument_flags = INSTRUMENT_LEGACY + volume_multiplier = 1 //not as loud as synth'd + +/datum/instrument/hardcoded/accordian + name = "Accordian" + id = "accordian" + legacy_instrument_ext = "mid" + legacy_instrument_path = "accordian" + +/datum/instrument/hardcoded/bikehorn + name = "Bike Horn" + id = "bikehorn" + legacy_instrument_ext = "ogg" + legacy_instrument_path = "bikehorn" + +/datum/instrument/hardcoded/eguitar + name = "Electric Guitar" + id = "eguitar" + legacy_instrument_ext = "ogg" + legacy_instrument_path = "eguitar" + +/datum/instrument/hardcoded/glockenspiel + name = "Glockenspiel" + id = "glockenspiel" + legacy_instrument_ext = "mid" + legacy_instrument_path = "glockenspiel" + +/datum/instrument/hardcoded/guitar + name = "Guitar" + id = "guitar" + legacy_instrument_ext = "ogg" + legacy_instrument_path = "guitar" + +/datum/instrument/hardcoded/harmonica + name = "Harmonica" + id = "harmonica" + legacy_instrument_ext = "mid" + legacy_instrument_path = "harmonica" + +/datum/instrument/hardcoded/piano + name = "Piano" + id = "piano" + legacy_instrument_ext = "ogg" + legacy_instrument_path = "piano" + +/datum/instrument/hardcoded/recorder + name = "Recorder" + id = "recorder" + legacy_instrument_ext = "mid" + legacy_instrument_path = "recorder" + +/datum/instrument/hardcoded/saxophone + name = "Saxophone" + id = "saxophone" + legacy_instrument_ext = "mid" + legacy_instrument_path = "saxophone" + +/datum/instrument/hardcoded/trombone + name = "Trombone" + id = "trombone" + legacy_instrument_ext = "mid" + legacy_instrument_path = "trombone" + +/datum/instrument/hardcoded/violin + name = "Violin" + id = "violin" + legacy_instrument_ext = "mid" + legacy_instrument_path = "violin" + +/datum/instrument/hardcoded/xylophone + name = "Xylophone" + id = "xylophone" + legacy_instrument_ext = "mid" + legacy_instrument_path = "xylophone" + +/datum/instrument/hardcoded/banjo + name = "Banjo" + id = "banjo" + legacy_instrument_ext = "ogg" + legacy_instrument_path = "banjo" diff --git a/code/modules/instruments/instrument_data/organ.dm b/code/modules/instruments/instrument_data/organ.dm index 75fcd1727b5..25da7409980 100644 --- a/code/modules/instruments/instrument_data/organ.dm +++ b/code/modules/instruments/instrument_data/organ.dm @@ -1,43 +1,43 @@ -/datum/instrument/organ - name = "Generic organ" - category = "Organ" - abstract_type = /datum/instrument/organ - -/datum/instrument/organ/crisis_church - name = "Crisis Church Organ" - id = "crichugan" - real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_church/c2.ogg', - "48"='sound/instruments/synthesis_samples/organ/crisis_church/c3.ogg', - "60"='sound/instruments/synthesis_samples/organ/crisis_church/c4.ogg', - "72"='sound/instruments/synthesis_samples/organ/crisis_church/c5.ogg') - -/datum/instrument/organ/crisis_hammond - name = "Crisis Hammond Organ" - id = "crihamgan" - real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_hammond/c2.ogg', - "48"='sound/instruments/synthesis_samples/organ/crisis_hammond/c3.ogg', - "60"='sound/instruments/synthesis_samples/organ/crisis_hammond/c4.ogg', - "72"='sound/instruments/synthesis_samples/organ/crisis_hammond/c5.ogg') - -/datum/instrument/organ/crisis_accordian - name = "Crisis Accordian" - id = "crack" - real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_accordian/c2.ogg', - "48"='sound/instruments/synthesis_samples/organ/crisis_accordian/c3.ogg', - "60"='sound/instruments/synthesis_samples/organ/crisis_accordian/c4.ogg', - "72"='sound/instruments/synthesis_samples/organ/crisis_accordian/c5.ogg') - -/datum/instrument/organ/crisis_harmonica - name = "Crisis Harmonica" - id = "crharmony" - real_samples = list("48"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c3.ogg', - "60"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c4.ogg', - "72"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c5.ogg') - -/datum/instrument/organ/crisis_tango_accordian - name = "Crisis Tango Accordian" - id = "crtango" - real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c2.ogg', - "48"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c3.ogg', - "60"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c4.ogg', - "72"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c5.ogg') +/datum/instrument/organ + name = "Generic organ" + category = "Organ" + abstract_type = /datum/instrument/organ + +/datum/instrument/organ/crisis_church + name = "Crisis Church Organ" + id = "crichugan" + real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_church/c2.ogg', + "48"='sound/instruments/synthesis_samples/organ/crisis_church/c3.ogg', + "60"='sound/instruments/synthesis_samples/organ/crisis_church/c4.ogg', + "72"='sound/instruments/synthesis_samples/organ/crisis_church/c5.ogg') + +/datum/instrument/organ/crisis_hammond + name = "Crisis Hammond Organ" + id = "crihamgan" + real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_hammond/c2.ogg', + "48"='sound/instruments/synthesis_samples/organ/crisis_hammond/c3.ogg', + "60"='sound/instruments/synthesis_samples/organ/crisis_hammond/c4.ogg', + "72"='sound/instruments/synthesis_samples/organ/crisis_hammond/c5.ogg') + +/datum/instrument/organ/crisis_accordian + name = "Crisis Accordian" + id = "crack" + real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_accordian/c2.ogg', + "48"='sound/instruments/synthesis_samples/organ/crisis_accordian/c3.ogg', + "60"='sound/instruments/synthesis_samples/organ/crisis_accordian/c4.ogg', + "72"='sound/instruments/synthesis_samples/organ/crisis_accordian/c5.ogg') + +/datum/instrument/organ/crisis_harmonica + name = "Crisis Harmonica" + id = "crharmony" + real_samples = list("48"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c3.ogg', + "60"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c4.ogg', + "72"='sound/instruments/synthesis_samples/organ/crisis_harmonica/c5.ogg') + +/datum/instrument/organ/crisis_tango_accordian + name = "Crisis Tango Accordian" + id = "crtango" + real_samples = list("36"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c2.ogg', + "48"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c3.ogg', + "60"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c4.ogg', + "72"='sound/instruments/synthesis_samples/organ/crisis_tangaccordian/c5.ogg') diff --git a/code/modules/instruments/instrument_data/piano.dm b/code/modules/instruments/instrument_data/piano.dm index e5058058fb3..fdd2f6e9382 100644 --- a/code/modules/instruments/instrument_data/piano.dm +++ b/code/modules/instruments/instrument_data/piano.dm @@ -1,56 +1,56 @@ -/datum/instrument/piano - name = "Generic piano" - category = "Piano" - abstract_type = /datum/instrument/piano - -/datum/instrument/piano/fluid_piano - name = "FluidR3 Grand Piano" - id = "r3grand" - real_samples = list("36"='sound/instruments/synthesis_samples/piano/fluid_piano/c2.ogg', - "48"='sound/instruments/synthesis_samples/piano/fluid_piano/c3.ogg', - "60"='sound/instruments/synthesis_samples/piano/fluid_piano/c4.ogg', - "72"='sound/instruments/synthesis_samples/piano/fluid_piano/c5.ogg', - "84"='sound/instruments/synthesis_samples/piano/fluid_piano/c6.ogg', - "96"='sound/instruments/synthesis_samples/piano/fluid_piano/c7.ogg', - "108"='sound/instruments/synthesis_samples/piano/fluid_piano/c8.ogg') - -/datum/instrument/piano/fluid_harpsichord - name = "FluidR3 Harpsichord" - id = "r3harpsi" - real_samples = list("36"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c2.ogg', - "48"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c3.ogg', - "60"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c4.ogg', - "72"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c5.ogg', - "84"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c6.ogg', - "96"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c7.ogg', - "108"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c8.ogg') - -/datum/instrument/piano/crisis_harpsichord - name = "Crisis Harpsichord" - id = "crharpsi" - real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c2.ogg', - "48"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c3.ogg', - "60"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c4.ogg', - "72"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c5.ogg') - -/datum/instrument/piano/crisis_grandpiano_uni - name = "Crisis Grand Piano One" - id = "crgrand1" - real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c2.ogg', - "48"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c3.ogg', - "60"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c4.ogg', - "72"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c5.ogg', - "84"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c6.ogg', - "96"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c7.ogg', - "108"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c8.ogg') - -/datum/instrument/piano/crisis_brightpiano_uni - name = "Crisis Bright Piano One" - id = "crbright1" - real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c2.ogg', - "48"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c3.ogg', - "60"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c4.ogg', - "72"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c5.ogg', - "84"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c6.ogg', - "96"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c7.ogg', - "108"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c8.ogg') +/datum/instrument/piano + name = "Generic piano" + category = "Piano" + abstract_type = /datum/instrument/piano + +/datum/instrument/piano/fluid_piano + name = "FluidR3 Grand Piano" + id = "r3grand" + real_samples = list("36"='sound/instruments/synthesis_samples/piano/fluid_piano/c2.ogg', + "48"='sound/instruments/synthesis_samples/piano/fluid_piano/c3.ogg', + "60"='sound/instruments/synthesis_samples/piano/fluid_piano/c4.ogg', + "72"='sound/instruments/synthesis_samples/piano/fluid_piano/c5.ogg', + "84"='sound/instruments/synthesis_samples/piano/fluid_piano/c6.ogg', + "96"='sound/instruments/synthesis_samples/piano/fluid_piano/c7.ogg', + "108"='sound/instruments/synthesis_samples/piano/fluid_piano/c8.ogg') + +/datum/instrument/piano/fluid_harpsichord + name = "FluidR3 Harpsichord" + id = "r3harpsi" + real_samples = list("36"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c2.ogg', + "48"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c3.ogg', + "60"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c4.ogg', + "72"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c5.ogg', + "84"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c6.ogg', + "96"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c7.ogg', + "108"='sound/instruments/synthesis_samples/piano/fluid_harpsi/c8.ogg') + +/datum/instrument/piano/crisis_harpsichord + name = "Crisis Harpsichord" + id = "crharpsi" + real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c2.ogg', + "48"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c3.ogg', + "60"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c4.ogg', + "72"='sound/instruments/synthesis_samples/piano/crisis_harpsichord/c5.ogg') + +/datum/instrument/piano/crisis_grandpiano_uni + name = "Crisis Grand Piano One" + id = "crgrand1" + real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c2.ogg', + "48"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c3.ogg', + "60"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c4.ogg', + "72"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c5.ogg', + "84"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c6.ogg', + "96"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c7.ogg', + "108"='sound/instruments/synthesis_samples/piano/crisis_grand_piano/c8.ogg') + +/datum/instrument/piano/crisis_brightpiano_uni + name = "Crisis Bright Piano One" + id = "crbright1" + real_samples = list("36"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c2.ogg', + "48"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c3.ogg', + "60"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c4.ogg', + "72"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c5.ogg', + "84"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c6.ogg', + "96"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c7.ogg', + "108"='sound/instruments/synthesis_samples/piano/crisis_bright_piano/c8.ogg') diff --git a/code/modules/instruments/instrument_data/synth_tones.dm b/code/modules/instruments/instrument_data/synth_tones.dm index cfdf7f0df2f..9ad9250f40d 100644 --- a/code/modules/instruments/instrument_data/synth_tones.dm +++ b/code/modules/instruments/instrument_data/synth_tones.dm @@ -1,19 +1,19 @@ -/datum/instrument/tones - name = "Ideal tone" - category = "Tones" - abstract_type = /datum/instrument/tones - -/datum/instrument/tones/square_wave - name = "Ideal square wave" - id = "square" - real_samples = list("81"='sound/instruments/synthesis_samples/tones/Square.ogg') - -/datum/instrument/tones/sine_wave - name = "Ideal sine wave" - id = "sine" - real_samples = list("81"='sound/instruments/synthesis_samples/tones/Sine.ogg') - -/datum/instrument/tones/saw_wave - name = "Ideal sawtooth wave" - id = "saw" - real_samples = list("81"='sound/instruments/synthesis_samples/tones/Sawtooth.ogg') +/datum/instrument/tones + name = "Ideal tone" + category = "Tones" + abstract_type = /datum/instrument/tones + +/datum/instrument/tones/square_wave + name = "Ideal square wave" + id = "square" + real_samples = list("81"='sound/instruments/synthesis_samples/tones/Square.ogg') + +/datum/instrument/tones/sine_wave + name = "Ideal sine wave" + id = "sine" + real_samples = list("81"='sound/instruments/synthesis_samples/tones/Sine.ogg') + +/datum/instrument/tones/saw_wave + name = "Ideal sawtooth wave" + id = "saw" + real_samples = list("81"='sound/instruments/synthesis_samples/tones/Sawtooth.ogg') diff --git a/code/modules/instruments/instruments/item.dm b/code/modules/instruments/instruments/item.dm index f8bb8f3295e..e0a3ff6221c 100644 --- a/code/modules/instruments/instruments/item.dm +++ b/code/modules/instruments/instruments/item.dm @@ -1,321 +1,321 @@ -//copy pasta of the space piano, don't hurt me -Pete -/obj/item/instrument - name = "generic instrument" - force = 10 -// max_integrity = 100 -// resistance_flags = FLAMMABLE - icon = 'icons/obj/musician.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/inhands/equipment/instruments_lefthand.dmi', - slot_r_hand_str = 'icons/mob/inhands/equipment/instruments_righthand.dmi' - ) - var/datum/song/handheld/song - var/list/allowed_instrument_ids -// var/tune_time_left = 0 - -/obj/item/instrument/Initialize(mapload) - . = ..() - song = new(src, allowed_instrument_ids) - allowed_instrument_ids = null //We don't need this clogging memory after it's used. - -/obj/item/instrument/Destroy() - QDEL_NULL(song) -/* - if(tune_time_left) - STOP_PROCESSING(SSprocessing, src) -*/ - return ..() - -/obj/item/instrument/proc/should_stop_playing(mob/user) - return !Adjacent(user) && !(storage_depth(user) < 3) - -/* -/obj/item/instrument/process(wait) - if(is_tuned()) - if (song.playing) - for (var/mob/living/M in song.hearing_mobs) - M.dizziness = max(0,M.dizziness-2) - M.jitteriness = max(0,M.jitteriness-2) - M.confused = max(M.confused-1) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic) - tune_time_left -= wait - else - tune_time_left = 0 - if (song.playing) - loc.visible_message("[src] starts sounding a little off...") - STOP_PROCESSING(SSprocessing, src) -*/ - -/obj/item/instrument/suicide_act(mob/user) - user.visible_message("[user] begins to play 'Gloomy Sunday'! It looks like they're trying to commit suicide!") - return (BRUTELOSS) - -/obj/item/instrument/attack_self(mob/user) - if(!user.IsAdvancedToolUser()) - to_chat(user, "You don't have the dexterity to do this!") - return TRUE - interact(user) - -/* -/obj/item/instrument/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/musicaltuner)) - var/mob/living/carbon/human/H = user - if (HAS_TRAIT(H, TRAIT_MUSICIAN)) - if (!is_tuned()) - H.visible_message("[H] tunes the [src] to perfection!", "You tune the [src] to perfection!") - tune_time_left = 600 SECONDS - START_PROCESSING(SSprocessing, src) - else - to_chat(H, "[src] is already well tuned!") - else - to_chat(H, "You have no idea how to use this.") - -/obj/item/instrument/proc/is_tuned() - return tune_time_left > 0 -*/ - -/obj/item/instrument/interact(mob/user) - ui_interact(user) - -/obj/item/instrument/ui_interact(mob/living/user) - if(!isliving(user) || user.stat || user.restrained()) - return - - user.set_machine(src) - song.ui_interact(user) - -/obj/item/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" - hitsound = "swing_hit" - allowed_instrument_ids = "violin" - -/obj/item/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" - unacidable = TRUE -// resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF - -/obj/item/instrument/piano_synth - name = "synthesizer" - desc = "An advanced electronic synthesizer that can be used as various instruments." - icon_state = "synth" - item_state = "synth" - allowed_instrument_ids = "piano" - -/obj/item/instrument/piano_synth/Initialize() - . = ..() - song.allowed_instrument_ids = get_allowed_instrument_ids() - -/obj/item/instrument/guitar - name = "guitar" - desc = "It's made of wood and has bronze strings." - icon_state = "guitar" - item_state = "guitar" - attack_verb = list("played metal on", "serenaded", "crashed", "smashed") - hitsound = 'sound/weapons/stringsmash.ogg' - allowed_instrument_ids = "guitar" - -/obj/item/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' - allowed_instrument_ids = "eguitar" - -/obj/item/instrument/glockenspiel - name = "glockenspiel" - desc = "Smooth metal bars perfect for any marching band." - icon_state = "glockenspiel" - item_state = "glockenspiel" - allowed_instrument_ids = "glockenspiel" - -/obj/item/instrument/accordion - name = "accordion" - desc = "Pun-Pun not included." - icon_state = "accordion" - item_state = "accordion" - allowed_instrument_ids = "accordion" - -/obj/item/instrument/trumpet - name = "trumpet" - desc = "To announce the arrival of the king!" - icon_state = "trumpet" - item_state = "trombone" - allowed_instrument_ids = "trombone" - -/obj/item/instrument/trumpet/spectral - name = "spectral trumpet" - desc = "Things are about to get spooky!" - icon_state = "trumpet" - item_state = "trombone" - force = 0 - attack_verb = list("played","jazzed","trumpeted","mourned","dooted","spooked") - -/* -/obj/item/instrument/trumpet/spectral/Initialize() - . = ..() - AddComponent(/datum/component/spooky) -*/ - -/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user) - playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1) - ..() - -/obj/item/instrument/saxophone - name = "saxophone" - desc = "This soothing sound will be sure to leave your audience in tears." - icon_state = "saxophone" - item_state = "saxophone" - allowed_instrument_ids = "saxophone" - -/obj/item/instrument/saxophone/spectral - name = "spectral saxophone" - desc = "This spooky sound will be sure to leave mortals in bones." - icon_state = "saxophone" - item_state = "saxophone" - force = 0 - attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked") - -/* -/obj/item/instrument/saxophone/spectral/Initialize() - . = ..() - AddComponent(/datum/component/spooky) -*/ - -/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user) - playsound(loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1) - ..() - -/obj/item/instrument/trombone - name = "trombone" - desc = "How can any pool table ever hope to compete?" - icon_state = "trombone" - item_state = "trombone" - allowed_instrument_ids = "trombone" - -/obj/item/instrument/trombone/spectral - name = "spectral trombone" - desc = "A skeleton's favorite instrument. Apply directly on the mortals." - icon_state = "trombone" - item_state = "trombone" - force = 0 - attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked") - -/* -/obj/item/instrument/trombone/spectral/Initialize() - . = ..() - AddComponent(/datum/component/spooky) -*/ - -/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user) - playsound(loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1) - ..() - -/obj/item/instrument/recorder - name = "recorder" - desc = "Just like in school, playing ability and all." - force = 5 - icon_state = "recorder" - item_state = "recorder" - allowed_instrument_ids = "recorder" - -/obj/item/instrument/harmonica - name = "harmonica" - desc = "For when you get a bad case of the space blues." - icon_state = "harmonica" - item_state = "harmonica" - allowed_instrument_ids = "harmonica" -// slot_flags = ITEM_SLOT_MASK - force = 5 - w_class = WEIGHT_CLASS_SMALL -// actions_types = list(/datum/action/item_action/instrument) - -/* -/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args) - if(song.playing && ismob(loc)) - to_chat(loc, "You stop playing the harmonica to talk...") - song.playing = FALSE - -/obj/item/instrument/harmonica/equipped(mob/M, slot) - . = ..() - RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) - -/obj/item/instrument/harmonica/dropped(mob/M) - . = ..() - UnregisterSignal(M, COMSIG_MOB_SAY) -*/ - -/obj/item/instrument/bikehorn - name = "gilded bike horn" - desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes." - icon_state = "bike_horn" - item_state = "bike_horn" - item_icons = list( - slot_l_hand_str = 'icons/mob/inhands/equipment/horns_lefthand.dmi', - slot_r_hand_str = 'icons/mob/inhands/equipment/horns_righthand.dmi' - ) - attack_verb = list("beautifully honks") - allowed_instrument_ids = "bikehorn" - w_class = WEIGHT_CLASS_TINY - force = 0 - throw_speed = 3 - throw_range = 15 - hitsound = 'sound/items/bikehorn.ogg' - -/obj/item/instrument/banjo - name = "banjo" - desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings." - icon_state = "banjo" - item_state = "banjo" - attack_verb = list("scruggs-styled", "hum-diggitied", "shin-digged", "clawhammered") - hitsound = 'sound/weapons/banjoslap.ogg' - allowed_instrument_ids = "banjo" - -/* -/obj/item/musicaltuner - name = "musical tuner" - desc = "A device for tuning musical instruments both manual and electronic alike." - icon = 'icons/obj/device.dmi' - icon_state = "musicaltuner" - slot_flags = ITEM_SLOT_BELT - w_class = WEIGHT_CLASS_SMALL - item_state = "electronic" - lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' -*/ - -/* -/obj/item/choice_beacon/music - name = "instrument delivery beacon" - desc = "Summon your tool of art." - icon_state = "gangtool-red" - -/obj/item/choice_beacon/music/generate_display_names() - var/static/list/instruments - if(!instruments) - instruments = list() - var/list/templist = list(/obj/item/instrument/violin, - /obj/item/instrument/piano_synth, - /obj/item/instrument/guitar, - /obj/item/instrument/eguitar, - /obj/item/instrument/glockenspiel, - /obj/item/instrument/accordion, - /obj/item/instrument/trumpet, - /obj/item/instrument/saxophone, - /obj/item/instrument/trombone, - /obj/item/instrument/recorder, - /obj/item/instrument/harmonica - ) - for(var/V in templist) - var/atom/A = V - instruments[initial(A.name)] = A - return instruments -*/ +//copy pasta of the space piano, don't hurt me -Pete +/obj/item/instrument + name = "generic instrument" + force = 10 +// max_integrity = 100 +// resistance_flags = FLAMMABLE + icon = 'icons/obj/musician.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/inhands/equipment/instruments_lefthand.dmi', + slot_r_hand_str = 'icons/mob/inhands/equipment/instruments_righthand.dmi' + ) + var/datum/song/handheld/song + var/list/allowed_instrument_ids +// var/tune_time_left = 0 + +/obj/item/instrument/Initialize(mapload) + . = ..() + song = new(src, allowed_instrument_ids) + allowed_instrument_ids = null //We don't need this clogging memory after it's used. + +/obj/item/instrument/Destroy() + QDEL_NULL(song) +/* + if(tune_time_left) + STOP_PROCESSING(SSprocessing, src) +*/ + return ..() + +/obj/item/instrument/proc/should_stop_playing(mob/user) + return !Adjacent(user) && !(storage_depth(user) < 3) + +/* +/obj/item/instrument/process(wait) + if(is_tuned()) + if (song.playing) + for (var/mob/living/M in song.hearing_mobs) + M.dizziness = max(0,M.dizziness-2) + M.jitteriness = max(0,M.jitteriness-2) + M.confused = max(M.confused-1) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic) + tune_time_left -= wait + else + tune_time_left = 0 + if (song.playing) + loc.visible_message("[src] starts sounding a little off...") + STOP_PROCESSING(SSprocessing, src) +*/ + +/obj/item/instrument/suicide_act(mob/user) + user.visible_message("[user] begins to play 'Gloomy Sunday'! It looks like they're trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/instrument/attack_self(mob/user) + if(!user.IsAdvancedToolUser()) + to_chat(user, "You don't have the dexterity to do this!") + return TRUE + interact(user) + +/* +/obj/item/instrument/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/musicaltuner)) + var/mob/living/carbon/human/H = user + if (HAS_TRAIT(H, TRAIT_MUSICIAN)) + if (!is_tuned()) + H.visible_message("[H] tunes the [src] to perfection!", "You tune the [src] to perfection!") + tune_time_left = 600 SECONDS + START_PROCESSING(SSprocessing, src) + else + to_chat(H, "[src] is already well tuned!") + else + to_chat(H, "You have no idea how to use this.") + +/obj/item/instrument/proc/is_tuned() + return tune_time_left > 0 +*/ + +/obj/item/instrument/interact(mob/user) + ui_interact(user) + +/obj/item/instrument/ui_interact(mob/living/user) + if(!isliving(user) || user.stat || user.restrained()) + return + + user.set_machine(src) + song.ui_interact(user) + +/obj/item/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" + hitsound = "swing_hit" + allowed_instrument_ids = "violin" + +/obj/item/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" + unacidable = TRUE +// resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF + +/obj/item/instrument/piano_synth + name = "synthesizer" + desc = "An advanced electronic synthesizer that can be used as various instruments." + icon_state = "synth" + item_state = "synth" + allowed_instrument_ids = "piano" + +/obj/item/instrument/piano_synth/Initialize() + . = ..() + song.allowed_instrument_ids = get_allowed_instrument_ids() + +/obj/item/instrument/guitar + name = "guitar" + desc = "It's made of wood and has bronze strings." + icon_state = "guitar" + item_state = "guitar" + attack_verb = list("played metal on", "serenaded", "crashed", "smashed") + hitsound = 'sound/weapons/stringsmash.ogg' + allowed_instrument_ids = "guitar" + +/obj/item/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' + allowed_instrument_ids = "eguitar" + +/obj/item/instrument/glockenspiel + name = "glockenspiel" + desc = "Smooth metal bars perfect for any marching band." + icon_state = "glockenspiel" + item_state = "glockenspiel" + allowed_instrument_ids = "glockenspiel" + +/obj/item/instrument/accordion + name = "accordion" + desc = "Pun-Pun not included." + icon_state = "accordion" + item_state = "accordion" + allowed_instrument_ids = "accordion" + +/obj/item/instrument/trumpet + name = "trumpet" + desc = "To announce the arrival of the king!" + icon_state = "trumpet" + item_state = "trombone" + allowed_instrument_ids = "trombone" + +/obj/item/instrument/trumpet/spectral + name = "spectral trumpet" + desc = "Things are about to get spooky!" + icon_state = "trumpet" + item_state = "trombone" + force = 0 + attack_verb = list("played","jazzed","trumpeted","mourned","dooted","spooked") + +/* +/obj/item/instrument/trumpet/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) +*/ + +/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user) + playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1) + ..() + +/obj/item/instrument/saxophone + name = "saxophone" + desc = "This soothing sound will be sure to leave your audience in tears." + icon_state = "saxophone" + item_state = "saxophone" + allowed_instrument_ids = "saxophone" + +/obj/item/instrument/saxophone/spectral + name = "spectral saxophone" + desc = "This spooky sound will be sure to leave mortals in bones." + icon_state = "saxophone" + item_state = "saxophone" + force = 0 + attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked") + +/* +/obj/item/instrument/saxophone/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) +*/ + +/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user) + playsound(loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1) + ..() + +/obj/item/instrument/trombone + name = "trombone" + desc = "How can any pool table ever hope to compete?" + icon_state = "trombone" + item_state = "trombone" + allowed_instrument_ids = "trombone" + +/obj/item/instrument/trombone/spectral + name = "spectral trombone" + desc = "A skeleton's favorite instrument. Apply directly on the mortals." + icon_state = "trombone" + item_state = "trombone" + force = 0 + attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked") + +/* +/obj/item/instrument/trombone/spectral/Initialize() + . = ..() + AddComponent(/datum/component/spooky) +*/ + +/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user) + playsound(loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1) + ..() + +/obj/item/instrument/recorder + name = "recorder" + desc = "Just like in school, playing ability and all." + force = 5 + icon_state = "recorder" + item_state = "recorder" + allowed_instrument_ids = "recorder" + +/obj/item/instrument/harmonica + name = "harmonica" + desc = "For when you get a bad case of the space blues." + icon_state = "harmonica" + item_state = "harmonica" + allowed_instrument_ids = "harmonica" +// slot_flags = ITEM_SLOT_MASK + force = 5 + w_class = WEIGHT_CLASS_SMALL +// actions_types = list(/datum/action/item_action/instrument) + +/* +/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args) + if(song.playing && ismob(loc)) + to_chat(loc, "You stop playing the harmonica to talk...") + song.playing = FALSE + +/obj/item/instrument/harmonica/equipped(mob/M, slot) + . = ..() + RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) + +/obj/item/instrument/harmonica/dropped(mob/M) + . = ..() + UnregisterSignal(M, COMSIG_MOB_SAY) +*/ + +/obj/item/instrument/bikehorn + name = "gilded bike horn" + desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes." + icon_state = "bike_horn" + item_state = "bike_horn" + item_icons = list( + slot_l_hand_str = 'icons/mob/inhands/equipment/horns_lefthand.dmi', + slot_r_hand_str = 'icons/mob/inhands/equipment/horns_righthand.dmi' + ) + attack_verb = list("beautifully honks") + allowed_instrument_ids = "bikehorn" + w_class = WEIGHT_CLASS_TINY + force = 0 + throw_speed = 3 + throw_range = 15 + hitsound = 'sound/items/bikehorn.ogg' + +/obj/item/instrument/banjo + name = "banjo" + desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings." + icon_state = "banjo" + item_state = "banjo" + attack_verb = list("scruggs-styled", "hum-diggitied", "shin-digged", "clawhammered") + hitsound = 'sound/weapons/banjoslap.ogg' + allowed_instrument_ids = "banjo" + +/* +/obj/item/musicaltuner + name = "musical tuner" + desc = "A device for tuning musical instruments both manual and electronic alike." + icon = 'icons/obj/device.dmi' + icon_state = "musicaltuner" + slot_flags = ITEM_SLOT_BELT + w_class = WEIGHT_CLASS_SMALL + item_state = "electronic" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' +*/ + +/* +/obj/item/choice_beacon/music + name = "instrument delivery beacon" + desc = "Summon your tool of art." + icon_state = "gangtool-red" + +/obj/item/choice_beacon/music/generate_display_names() + var/static/list/instruments + if(!instruments) + instruments = list() + var/list/templist = list(/obj/item/instrument/violin, + /obj/item/instrument/piano_synth, + /obj/item/instrument/guitar, + /obj/item/instrument/eguitar, + /obj/item/instrument/glockenspiel, + /obj/item/instrument/accordion, + /obj/item/instrument/trumpet, + /obj/item/instrument/saxophone, + /obj/item/instrument/trombone, + /obj/item/instrument/recorder, + /obj/item/instrument/harmonica + ) + for(var/V in templist) + var/atom/A = V + instruments[initial(A.name)] = A + return instruments +*/ diff --git a/code/modules/instruments/instruments/stationary.dm b/code/modules/instruments/instruments/stationary.dm index 350a8dbf0d6..66c10628869 100644 --- a/code/modules/instruments/instruments/stationary.dm +++ b/code/modules/instruments/instruments/stationary.dm @@ -1,73 +1,73 @@ -/obj/structure/musician - name = "Not A Piano" - desc = "Something broke, contact coderbus." - //interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT | INTERACT_ATOM_REQUIRES_DEXTERITY - var/can_play_unanchored = FALSE - var/list/allowed_instrument_ids - var/datum/song/song - -/obj/structure/musician/Initialize(mapload) - . = ..() - song = new(src, allowed_instrument_ids) - allowed_instrument_ids = null - -/obj/structure/musician/Destroy() - QDEL_NULL(song) - return ..() - -/obj/structure/musician/proc/should_stop_playing(mob/user) - if(!(anchored || can_play_unanchored)) - return TRUE - if(!user) - return FALSE - return (usr.default_can_use_topic(src) < STATUS_UPDATE) //can play with TK and while resting because fun. - -/// CITRP EDIT UNTIL INTERACTION REFACTOR PORT! -/obj/structure/musician/attack_hand(mob/user) - . = ..() - if(.) - return - if(!anchored) - return - ui_interact(user) - -/obj/structure/musician/ui_interact(mob/user) - . = ..() - song.ui_interact(user) - -/obj/structure/musician/attackby(obj/item/I, mob/living/user) - if(I.is_wrench()) - playsound(src, I.usesound, 50, 1) - to_chat(user, "You begin to [anchored? "loosen" : "tighten"] [src]'s casters...") - if(do_after(user, 40 * I.toolspeed)) - user.visible_message("[user] [anchored? "loosens" : "tightens"] [src]'s casters.") - anchored = !anchored - else - return ..() - -/* -/obj/structure/musician/wrench_act(mob/living/user, obj/item/I) - default_unfasten_wrench(user, I, 40) - return TRUE -*/ - -/obj/structure/musician/piano - name = "space minimoog" - icon = 'icons/obj/musician.dmi' - icon_state = "minimoog" - anchored = TRUE - density = TRUE - -/obj/structure/musician/piano/unanchored - anchored = FALSE - -/obj/structure/musician/piano/Initialize(mapload) - . = ..() - if(prob(50) && icon_state == initial(icon_state)) - name = "space minimoog" - desc = "This is a minimoog, like a space piano, but more spacey!" - icon_state = "minimoog" - else - name = "space piano" - desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't." - icon_state = "piano" +/obj/structure/musician + name = "Not A Piano" + desc = "Something broke, contact coderbus." + //interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT | INTERACT_ATOM_REQUIRES_DEXTERITY + var/can_play_unanchored = FALSE + var/list/allowed_instrument_ids + var/datum/song/song + +/obj/structure/musician/Initialize(mapload) + . = ..() + song = new(src, allowed_instrument_ids) + allowed_instrument_ids = null + +/obj/structure/musician/Destroy() + QDEL_NULL(song) + return ..() + +/obj/structure/musician/proc/should_stop_playing(mob/user) + if(!(anchored || can_play_unanchored)) + return TRUE + if(!user) + return FALSE + return (usr.default_can_use_topic(src) < STATUS_UPDATE) //can play with TK and while resting because fun. + +/// CITRP EDIT UNTIL INTERACTION REFACTOR PORT! +/obj/structure/musician/attack_hand(mob/user) + . = ..() + if(.) + return + if(!anchored) + return + ui_interact(user) + +/obj/structure/musician/ui_interact(mob/user) + . = ..() + song.ui_interact(user) + +/obj/structure/musician/attackby(obj/item/I, mob/living/user) + if(I.is_wrench()) + playsound(src, I.usesound, 50, 1) + to_chat(user, "You begin to [anchored? "loosen" : "tighten"] [src]'s casters...") + if(do_after(user, 40 * I.toolspeed)) + user.visible_message("[user] [anchored? "loosens" : "tightens"] [src]'s casters.") + anchored = !anchored + else + return ..() + +/* +/obj/structure/musician/wrench_act(mob/living/user, obj/item/I) + default_unfasten_wrench(user, I, 40) + return TRUE +*/ + +/obj/structure/musician/piano + name = "space minimoog" + icon = 'icons/obj/musician.dmi' + icon_state = "minimoog" + anchored = TRUE + density = TRUE + +/obj/structure/musician/piano/unanchored + anchored = FALSE + +/obj/structure/musician/piano/Initialize(mapload) + . = ..() + if(prob(50) && icon_state == initial(icon_state)) + name = "space minimoog" + desc = "This is a minimoog, like a space piano, but more spacey!" + icon_state = "minimoog" + else + name = "space piano" + desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't." + icon_state = "piano" diff --git a/code/modules/instruments/songs/_song.dm b/code/modules/instruments/songs/_song.dm index cec0f7d8b8d..c297396bbf3 100644 --- a/code/modules/instruments/songs/_song.dm +++ b/code/modules/instruments/songs/_song.dm @@ -1,299 +1,299 @@ -#define MUSICIAN_HEARCHECK_MINDELAY 4 -#define MUSIC_MAXLINES 1000 -#define MUSIC_MAXLINECHARS 300 - -/datum/song - /// Name of the song - var/name = "Untitled" - - /// The atom we're attached to/playing from - var/atom/parent - - /// Our song lines - var/list/lines - - /// delay between notes in deciseconds - var/tempo = 5 - - /// Are we currently playing? - var/playing = FALSE - - /// Are we currently editing? - var/editing = TRUE - /// Is the help screen open? - var/help = FALSE - - /// Repeats left - var/repeat = 0 - /// Maximum times we can repeat - var/max_repeats = 10 - - /// Our volume - var/volume = 75 - /// Max volume - var/max_volume = 75 - /// Min volume - This is so someone doesn't decide it's funny to set it to 0 and play invisible songs. - var/min_volume = 1 - - /// What instruments our built in picker can use. The picker won't show unless this is longer than one. - var/list/allowed_instrument_ids = list("r3grand") - - //////////// Cached instrument variables ///////////// - /// Instrument we are currently using - var/datum/instrument/using_instrument - /// Cached legacy ext for legacy instruments - var/cached_legacy_ext - /// Cached legacy dir for legacy instruments - var/cached_legacy_dir - /// Cached list of samples, referenced directly from the instrument for synthesized instruments - var/list/cached_samples - /// Are we operating in legacy mode (so if the instrument is a legacy instrument) - var/legacy = FALSE - ////////////////////////////////////////////////////// - - /////////////////// Playing variables //////////////// - /** - * Only used in synthesized playback - The chords we compiled. Non assoc list of lists: - * list(list(key1, key2, key3..., tempo_divisor), list(key1, key2..., tempo_divisor), ...) - * tempo_divisor always exists - * if key1 (and so if there's no keys) doesn't exist it's a rest - * Compilation happens when we start playing and is cleared after we finish playing. - */ - var/list/compiled_chords - /// Channel as text = current volume percentage but it's 0 to 100 instead of 0 to 1. - var/list/channels_playing = list() - /// List of channels that aren't being used, as text. This is to prevent unnecessary freeing and reallocations from SSsounds/SSinstruments. - var/list/channels_idle = list() - ////////////////////////////////////////////////////// - - /// Last world.time we checked for who can hear us - var/last_hearcheck = 0 - /// The list of mobs that can hear us - var/list/hearing_mobs - /// If this is enabled, some things won't be strictly cleared when they usually are (liked compiled_chords on play stop) - var/debug_mode = FALSE - /// Last time we processed decay - var/last_process_decay - /// Max sound channels to occupy - var/max_sound_channels = CHANNELS_PER_INSTRUMENT - /// Current channels, so we can save a length() call. - var/using_sound_channels = 0 - /// Last channel to play. text. - var/last_channel_played - /// Should we not decay our last played note? - var/full_sustain_held_note = TRUE - - /////////////////////// DO NOT TOUCH THESE /////////////////// - var/octave_min = INSTRUMENT_MIN_OCTAVE - var/octave_max = INSTRUMENT_MAX_OCTAVE - var/key_min = INSTRUMENT_MIN_KEY - var/key_max = INSTRUMENT_MAX_KEY - var/static/list/note_offset_lookup = list(9, 11, 0, 2, 4, 5, 7) - var/static/list/accent_lookup = list("b" = -1, "s" = 1, "#" = 1, "n" = 0) - ////////////////////////////////////////////////////////////// - - ///////////// !!FUN!! - Only works in synthesized mode! ///////////////// - /// Note numbers to shift. - var/note_shift = 0 - var/note_shift_min = -100 - var/note_shift_max = 100 - var/can_noteshift = TRUE - /// The kind of sustain we're using - var/sustain_mode = SUSTAIN_LINEAR - /// When a note is considered dead if it is below this in volume - var/sustain_dropoff_volume = 0 - /// Total duration of linear sustain for 100 volume note to get to SUSTAIN_DROPOFF - var/sustain_linear_duration = 5 - /// Exponential sustain dropoff rate per decisecond - var/sustain_exponential_dropoff = 1.4 - ////////// DO NOT DIRECTLY SET THESE! - /// Do not directly set, use update_sustain() - var/cached_linear_dropoff = 10 - /// Do not directly set, use update_sustain() - var/cached_exponential_dropoff = 1.045 - ///////////////////////////////////////////////////////////////////////// - -/datum/song/New(atom/parent, list/instrument_ids) - SSinstruments.on_song_new(src) - lines = list() - tempo = sanitize_tempo(tempo) - src.parent = parent - if(instrument_ids) - allowed_instrument_ids = islist(instrument_ids)? instrument_ids : list(instrument_ids) - if(length(allowed_instrument_ids)) - set_instrument(allowed_instrument_ids[1]) - hearing_mobs = list() - volume = CLAMP(volume, min_volume, max_volume) - update_sustain() - -/datum/song/Destroy() - stop_playing() - SSinstruments.on_song_del(src) - lines = null - using_instrument = null - allowed_instrument_ids = null - parent = null - return ..() - -/datum/song/proc/do_hearcheck() - last_hearcheck = world.time - var/list/old = hearing_mobs.Copy() - hearing_mobs.len = 0 - var/turf/source = get_turf(parent) - for(var/mob/M in get_hearers_in_view(15, source)) - hearing_mobs[M] = get_dist(M, source) - var/list/exited = old - hearing_mobs - for(var/i in exited) - terminate_sound_mob(i) - -/// I can either be a datum, id, or path (if the instrument has no id). -/datum/song/proc/set_instrument(datum/instrument/I) - if(using_instrument) - using_instrument.songs_using -= src - using_instrument = null - cached_samples = null - cached_legacy_ext = null - cached_legacy_dir = null - legacy = null - if(istext(I) || ispath(I)) - I = SSinstruments.instrument_data[I] - if(istype(I)) - using_instrument = I - I.songs_using += src - var/instrument_legacy = CHECK_BITFIELD(I.instrument_flags, INSTRUMENT_LEGACY) - if(instrument_legacy) - cached_legacy_ext = I.legacy_instrument_ext - cached_legacy_dir = I.legacy_instrument_path - legacy = TRUE - else - cached_samples = I.samples - legacy = FALSE - -/// THIS IS A BLOCKING CALL. -/datum/song/proc/start_playing(mob/user) - if(playing) - return - if(!using_instrument?.ready()) - to_chat(user, "An error has occured with [src]. Please reset the instrument.") - return - playing = TRUE - updateDialog() - //we can not afford to runtime, since we are going to be doing sound channel reservations and if we runtime it means we have a channel allocation leak. - //wrap the rest of the stuff to ensure stop_playing() is called. - last_process_decay = world.time - START_PROCESSING(SSinstruments, src) - . = do_play_lines(user) - stop_playing() - -/datum/song/proc/stop_playing() - if(!playing) - return - playing = FALSE - if(!debug_mode) - compiled_chords = null - STOP_PROCESSING(SSinstruments, src) - terminate_all_sounds(TRUE) - hearing_mobs.len = 0 - updateDialog() - -/// THIS IS A BLOCKING CALL. -/datum/song/proc/do_play_lines(user) - if(!playing) - return - do_hearcheck() - if(legacy) - do_play_lines_legacy(user) - else - do_play_lines_synthesized(user) - -/datum/song/proc/should_stop_playing(mob/user) - return QDELETED(parent) || !using_instrument || !playing - -/datum/song/proc/sanitize_tempo(new_tempo) - new_tempo = abs(new_tempo) - return CLAMP(round(new_tempo, world.tick_lag), world.tick_lag, 5 SECONDS) - -/datum/song/proc/get_bpm() - return 600 / tempo - -/datum/song/proc/set_bpm(bpm) - tempo = sanitize_tempo(600 / bpm) - -/// Updates the window for our user. Override in subtypes. -/datum/song/proc/updateDialog(mob/user) - ui_interact(user) - -/datum/song/process(wait) - if(!playing) - return PROCESS_KILL - var/delay = world.time - last_process_decay - process_decay(delay) - last_process_decay = world.time - -/datum/song/proc/update_sustain() - // Exponential is easy - cached_exponential_dropoff = sustain_exponential_dropoff - // Linear, not so much, since it's a target duration from 100 volume rather than an exponential rate. - var/target_duration = sustain_linear_duration - var/volume_diff = max(0, 100 - sustain_dropoff_volume) - var/volume_decrease_per_decisecond = volume_diff / target_duration - cached_linear_dropoff = volume_decrease_per_decisecond - -/datum/song/proc/set_volume(volume) - src.volume = CLAMP(volume, max(0, min_volume), min(100, max_volume)) - update_sustain() - updateDialog() - -/datum/song/proc/set_dropoff_volume(volume) - sustain_dropoff_volume = CLAMP(volume, INSTRUMENT_MIN_SUSTAIN_DROPOFF, 100) - update_sustain() - updateDialog() - -/datum/song/proc/set_exponential_drop_rate(drop) - sustain_exponential_dropoff = CLAMP(drop, INSTRUMENT_EXP_FALLOFF_MIN, INSTRUMENT_EXP_FALLOFF_MAX) - update_sustain() - updateDialog() - -/datum/song/proc/set_linear_falloff_duration(duration) - sustain_linear_duration = CLAMP(duration, 0.1, INSTRUMENT_MAX_TOTAL_SUSTAIN) - update_sustain() - updateDialog() - -/datum/song/vv_edit_var(var_name, var_value) - . = ..() - if(.) - switch(var_name) - if(NAMEOF(src, volume)) - set_volume(var_value) - if(NAMEOF(src, sustain_dropoff_volume)) - set_dropoff_volume(var_value) - if(NAMEOF(src, sustain_exponential_dropoff)) - set_exponential_drop_rate(var_value) - if(NAMEOF(src, sustain_linear_duration)) - set_linear_falloff_duration(var_value) - -// subtype for handheld instruments, like violin -/datum/song/handheld - -/datum/song/handheld/updateDialog(mob/user) - parent.ui_interact(user || usr) - -/datum/song/handheld/should_stop_playing(mob/user) - . = ..() - if(.) - return TRUE - var/obj/item/instrument/I = parent - return I.should_stop_playing(user) - -// subtype for stationary structures, like pianos -/datum/song/stationary - -/datum/song/stationary/updateDialog(mob/user) - parent.ui_interact(user || usr) - -/datum/song/stationary/should_stop_playing(mob/user) - . = ..() - if(.) - return TRUE - var/obj/structure/musician/M = parent - return M.should_stop_playing(user) +#define MUSICIAN_HEARCHECK_MINDELAY 4 +#define MUSIC_MAXLINES 1000 +#define MUSIC_MAXLINECHARS 300 + +/datum/song + /// Name of the song + var/name = "Untitled" + + /// The atom we're attached to/playing from + var/atom/parent + + /// Our song lines + var/list/lines + + /// delay between notes in deciseconds + var/tempo = 5 + + /// Are we currently playing? + var/playing = FALSE + + /// Are we currently editing? + var/editing = TRUE + /// Is the help screen open? + var/help = FALSE + + /// Repeats left + var/repeat = 0 + /// Maximum times we can repeat + var/max_repeats = 10 + + /// Our volume + var/volume = 75 + /// Max volume + var/max_volume = 75 + /// Min volume - This is so someone doesn't decide it's funny to set it to 0 and play invisible songs. + var/min_volume = 1 + + /// What instruments our built in picker can use. The picker won't show unless this is longer than one. + var/list/allowed_instrument_ids = list("r3grand") + + //////////// Cached instrument variables ///////////// + /// Instrument we are currently using + var/datum/instrument/using_instrument + /// Cached legacy ext for legacy instruments + var/cached_legacy_ext + /// Cached legacy dir for legacy instruments + var/cached_legacy_dir + /// Cached list of samples, referenced directly from the instrument for synthesized instruments + var/list/cached_samples + /// Are we operating in legacy mode (so if the instrument is a legacy instrument) + var/legacy = FALSE + ////////////////////////////////////////////////////// + + /////////////////// Playing variables //////////////// + /** + * Only used in synthesized playback - The chords we compiled. Non assoc list of lists: + * list(list(key1, key2, key3..., tempo_divisor), list(key1, key2..., tempo_divisor), ...) + * tempo_divisor always exists + * if key1 (and so if there's no keys) doesn't exist it's a rest + * Compilation happens when we start playing and is cleared after we finish playing. + */ + var/list/compiled_chords + /// Channel as text = current volume percentage but it's 0 to 100 instead of 0 to 1. + var/list/channels_playing = list() + /// List of channels that aren't being used, as text. This is to prevent unnecessary freeing and reallocations from SSsounds/SSinstruments. + var/list/channels_idle = list() + ////////////////////////////////////////////////////// + + /// Last world.time we checked for who can hear us + var/last_hearcheck = 0 + /// The list of mobs that can hear us + var/list/hearing_mobs + /// If this is enabled, some things won't be strictly cleared when they usually are (liked compiled_chords on play stop) + var/debug_mode = FALSE + /// Last time we processed decay + var/last_process_decay + /// Max sound channels to occupy + var/max_sound_channels = CHANNELS_PER_INSTRUMENT + /// Current channels, so we can save a length() call. + var/using_sound_channels = 0 + /// Last channel to play. text. + var/last_channel_played + /// Should we not decay our last played note? + var/full_sustain_held_note = TRUE + + /////////////////////// DO NOT TOUCH THESE /////////////////// + var/octave_min = INSTRUMENT_MIN_OCTAVE + var/octave_max = INSTRUMENT_MAX_OCTAVE + var/key_min = INSTRUMENT_MIN_KEY + var/key_max = INSTRUMENT_MAX_KEY + var/static/list/note_offset_lookup = list(9, 11, 0, 2, 4, 5, 7) + var/static/list/accent_lookup = list("b" = -1, "s" = 1, "#" = 1, "n" = 0) + ////////////////////////////////////////////////////////////// + + ///////////// !!FUN!! - Only works in synthesized mode! ///////////////// + /// Note numbers to shift. + var/note_shift = 0 + var/note_shift_min = -100 + var/note_shift_max = 100 + var/can_noteshift = TRUE + /// The kind of sustain we're using + var/sustain_mode = SUSTAIN_LINEAR + /// When a note is considered dead if it is below this in volume + var/sustain_dropoff_volume = 0 + /// Total duration of linear sustain for 100 volume note to get to SUSTAIN_DROPOFF + var/sustain_linear_duration = 5 + /// Exponential sustain dropoff rate per decisecond + var/sustain_exponential_dropoff = 1.4 + ////////// DO NOT DIRECTLY SET THESE! + /// Do not directly set, use update_sustain() + var/cached_linear_dropoff = 10 + /// Do not directly set, use update_sustain() + var/cached_exponential_dropoff = 1.045 + ///////////////////////////////////////////////////////////////////////// + +/datum/song/New(atom/parent, list/instrument_ids) + SSinstruments.on_song_new(src) + lines = list() + tempo = sanitize_tempo(tempo) + src.parent = parent + if(instrument_ids) + allowed_instrument_ids = islist(instrument_ids)? instrument_ids : list(instrument_ids) + if(length(allowed_instrument_ids)) + set_instrument(allowed_instrument_ids[1]) + hearing_mobs = list() + volume = CLAMP(volume, min_volume, max_volume) + update_sustain() + +/datum/song/Destroy() + stop_playing() + SSinstruments.on_song_del(src) + lines = null + using_instrument = null + allowed_instrument_ids = null + parent = null + return ..() + +/datum/song/proc/do_hearcheck() + last_hearcheck = world.time + var/list/old = hearing_mobs.Copy() + hearing_mobs.len = 0 + var/turf/source = get_turf(parent) + for(var/mob/M in get_hearers_in_view(15, source)) + hearing_mobs[M] = get_dist(M, source) + var/list/exited = old - hearing_mobs + for(var/i in exited) + terminate_sound_mob(i) + +/// I can either be a datum, id, or path (if the instrument has no id). +/datum/song/proc/set_instrument(datum/instrument/I) + if(using_instrument) + using_instrument.songs_using -= src + using_instrument = null + cached_samples = null + cached_legacy_ext = null + cached_legacy_dir = null + legacy = null + if(istext(I) || ispath(I)) + I = SSinstruments.instrument_data[I] + if(istype(I)) + using_instrument = I + I.songs_using += src + var/instrument_legacy = CHECK_BITFIELD(I.instrument_flags, INSTRUMENT_LEGACY) + if(instrument_legacy) + cached_legacy_ext = I.legacy_instrument_ext + cached_legacy_dir = I.legacy_instrument_path + legacy = TRUE + else + cached_samples = I.samples + legacy = FALSE + +/// THIS IS A BLOCKING CALL. +/datum/song/proc/start_playing(mob/user) + if(playing) + return + if(!using_instrument?.ready()) + to_chat(user, "An error has occured with [src]. Please reset the instrument.") + return + playing = TRUE + updateDialog() + //we can not afford to runtime, since we are going to be doing sound channel reservations and if we runtime it means we have a channel allocation leak. + //wrap the rest of the stuff to ensure stop_playing() is called. + last_process_decay = world.time + START_PROCESSING(SSinstruments, src) + . = do_play_lines(user) + stop_playing() + +/datum/song/proc/stop_playing() + if(!playing) + return + playing = FALSE + if(!debug_mode) + compiled_chords = null + STOP_PROCESSING(SSinstruments, src) + terminate_all_sounds(TRUE) + hearing_mobs.len = 0 + updateDialog() + +/// THIS IS A BLOCKING CALL. +/datum/song/proc/do_play_lines(user) + if(!playing) + return + do_hearcheck() + if(legacy) + do_play_lines_legacy(user) + else + do_play_lines_synthesized(user) + +/datum/song/proc/should_stop_playing(mob/user) + return QDELETED(parent) || !using_instrument || !playing + +/datum/song/proc/sanitize_tempo(new_tempo) + new_tempo = abs(new_tempo) + return CLAMP(round(new_tempo, world.tick_lag), world.tick_lag, 5 SECONDS) + +/datum/song/proc/get_bpm() + return 600 / tempo + +/datum/song/proc/set_bpm(bpm) + tempo = sanitize_tempo(600 / bpm) + +/// Updates the window for our user. Override in subtypes. +/datum/song/proc/updateDialog(mob/user) + ui_interact(user) + +/datum/song/process(wait) + if(!playing) + return PROCESS_KILL + var/delay = world.time - last_process_decay + process_decay(delay) + last_process_decay = world.time + +/datum/song/proc/update_sustain() + // Exponential is easy + cached_exponential_dropoff = sustain_exponential_dropoff + // Linear, not so much, since it's a target duration from 100 volume rather than an exponential rate. + var/target_duration = sustain_linear_duration + var/volume_diff = max(0, 100 - sustain_dropoff_volume) + var/volume_decrease_per_decisecond = volume_diff / target_duration + cached_linear_dropoff = volume_decrease_per_decisecond + +/datum/song/proc/set_volume(volume) + src.volume = CLAMP(volume, max(0, min_volume), min(100, max_volume)) + update_sustain() + updateDialog() + +/datum/song/proc/set_dropoff_volume(volume) + sustain_dropoff_volume = CLAMP(volume, INSTRUMENT_MIN_SUSTAIN_DROPOFF, 100) + update_sustain() + updateDialog() + +/datum/song/proc/set_exponential_drop_rate(drop) + sustain_exponential_dropoff = CLAMP(drop, INSTRUMENT_EXP_FALLOFF_MIN, INSTRUMENT_EXP_FALLOFF_MAX) + update_sustain() + updateDialog() + +/datum/song/proc/set_linear_falloff_duration(duration) + sustain_linear_duration = CLAMP(duration, 0.1, INSTRUMENT_MAX_TOTAL_SUSTAIN) + update_sustain() + updateDialog() + +/datum/song/vv_edit_var(var_name, var_value) + . = ..() + if(.) + switch(var_name) + if(NAMEOF(src, volume)) + set_volume(var_value) + if(NAMEOF(src, sustain_dropoff_volume)) + set_dropoff_volume(var_value) + if(NAMEOF(src, sustain_exponential_dropoff)) + set_exponential_drop_rate(var_value) + if(NAMEOF(src, sustain_linear_duration)) + set_linear_falloff_duration(var_value) + +// subtype for handheld instruments, like violin +/datum/song/handheld + +/datum/song/handheld/updateDialog(mob/user) + parent.ui_interact(user || usr) + +/datum/song/handheld/should_stop_playing(mob/user) + . = ..() + if(.) + return TRUE + var/obj/item/instrument/I = parent + return I.should_stop_playing(user) + +// subtype for stationary structures, like pianos +/datum/song/stationary + +/datum/song/stationary/updateDialog(mob/user) + parent.ui_interact(user || usr) + +/datum/song/stationary/should_stop_playing(mob/user) + . = ..() + if(.) + return TRUE + var/obj/structure/musician/M = parent + return M.should_stop_playing(user) diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index 2d5c94781e8..2cb181c1dd9 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -1,246 +1,246 @@ -/datum/song/proc/instrument_status_ui() - . = list() - . += "
" - . += "Current instrument: " - if(!using_instrument) - . += "No instrument loaded!
" - else - . += "[using_instrument.name]
" - . += "Playback Settings:
" - if(can_noteshift) - . += "Note Shift/Note Transpose: [note_shift] keys / [round(note_shift / 12, 0.01)] octaves
" - var/smt - var/modetext = "" - switch(sustain_mode) - if(SUSTAIN_LINEAR) - smt = "Linear" - modetext = "Linear Sustain Duration: [sustain_linear_duration / 10] seconds
" - if(SUSTAIN_EXPONENTIAL) - smt = "Exponential" - modetext = "Exponential Falloff Factor: [sustain_exponential_dropoff]% per decisecond
" - . += "Sustain Mode: [smt]
" - . += modetext - . += using_instrument?.ready()? "Status: Ready
" : "Status: !Instrument Definition Error!
" - . += "Instrument Type: [legacy? "Legacy" : "Synthesized"]
" - . += "Volume: [volume]
" - . += "Volume Dropoff Threshold: [sustain_dropoff_volume]
" - . += "Sustain indefinitely last held note: [full_sustain_held_note? "Enabled" : "Disabled"].
" - . += "
" - -/datum/song/ui_interact(mob/user) - var/list/dat = list() - - dat += instrument_status_ui() - - if(lines.len > 0) - dat += "

Playback

" - if(!playing) - dat += "Play Stop

" - dat += "Repeat Song: " - dat += repeat > 0 ? "--" : "--" - dat += " [repeat] times " - dat += repeat < max_repeats ? "++" : "++" - dat += "
" - else - dat += "Play Stop
" - dat += "Repeats left: [repeat]
" - if(!editing) - dat += "
Show Editor
" - else - dat += "

Editing

" - dat += "Hide Editor" - dat += " Start a New Song" - dat += " Import a Song

" - var/bpm = round(600 / tempo) - dat += "Tempo: - [bpm] BPM +

" - var/linecount = 0 - for(var/line in lines) - linecount += 1 - dat += "Line [linecount]: Edit X [line]
" - dat += "Add Line

" - if(help) - dat += "Hide Help
" - dat += {" - Lines are a series of chords, separated by commas (,), each with notes separated by hyphens (-).
- Every note in a chord will play together, with chord timed by the tempo.
-
- Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.
- By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.
- Example: C,D,E,F,G,A,B will play a C major scale.
- After a note has an accidental placed, it will be remembered: C,C4,C,C3 is C3,C4,C4,C3
- Chords can be played simply by seperating each note with a hyphon: A-C#,Cn-E,E-G#,Gn-B
- A pause may be denoted by an empty chord: C,E,,C,G
- To make a chord be a different time, end it with /x, where the chord length will be length
- defined by tempo / x: C,G/2,E/4
- Combined, an example is: E-E4/4,F#/2,G#/8,B/8,E3-E4/4 -
- Lines may be up to [MUSIC_MAXLINECHARS] characters.
- A song may only contain up to [MUSIC_MAXLINES] lines.
- "} - else - dat += "Show Help
" - - var/datum/browser/popup = new(user, "instrument", parent?.name || "instrument", 700, 500) - popup.set_content(dat.Join("")) - popup.set_title_image(user.browse_rsc_icon(parent.icon, parent.icon_state)) - popup.open() - -/datum/song/proc/ParseSong(text) - set waitfor = FALSE - //split into lines - lines = splittext(text, "\n") - if(lines.len) - var/bpm_string = "BPM: " - if(findtext(lines[1], bpm_string, 1, length(bpm_string) + 1)) - var/divisor = text2num(copytext(lines[1], length(bpm_string) + 1)) || 120 // default - tempo = sanitize_tempo(600 / round(divisor, 1)) - lines.Cut(1, 2) - else - tempo = sanitize_tempo(5) // default 120 BPM - if(lines.len > MUSIC_MAXLINES) - to_chat(usr, "Too many lines!") - lines.Cut(MUSIC_MAXLINES + 1) - var/linenum = 1 - for(var/l in lines) - if(length_char(l) > MUSIC_MAXLINECHARS) - to_chat(usr, "Line [linenum] too long!") - lines.Remove(l) - else - linenum++ - updateDialog(usr) // make sure updates when complete - -/datum/song/Topic(href, href_list) - if(usr.default_can_use_topic(parent) < STATUS_UPDATE) - usr << browse(null, "window=instrument") - usr.unset_machine() - return - - parent.add_fingerprint(usr) - - if(href_list["newsong"]) - lines = new() - tempo = sanitize_tempo(5) // default 120 BPM - name = "" - - else if(href_list["import"]) - var/t = "" - do - t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message) - if(!in_range(parent, usr)) - return - - if(length_char(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) - var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") - if(cont == "no") - break - while(length_char(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) - ParseSong(t) - - else if(href_list["help"]) - help = text2num(href_list["help"]) - 1 - - else if(href_list["edit"]) - editing = text2num(href_list["edit"]) - 1 - - if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops. - if(playing) - return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing. - repeat += round(text2num(href_list["repeat"])) - if(repeat < 0) - repeat = 0 - if(repeat > max_repeats) - repeat = max_repeats - - else if(href_list["tempo"]) - tempo = sanitize_tempo(tempo + text2num(href_list["tempo"])) - - else if(href_list["play"]) - INVOKE_ASYNC(src, .proc/start_playing, usr) - - else if(href_list["newline"]) - var/newline = html_encode(input("Enter your line: ", parent.name) as text|null) - if(!newline || !in_range(parent, usr)) - return - if(lines.len > MUSIC_MAXLINES) - return - if(length(newline) > MUSIC_MAXLINECHARS) - newline = copytext(newline, 1, MUSIC_MAXLINECHARS) - lines.Add(newline) - - else if(href_list["deleteline"]) - var/num = round(text2num(href_list["deleteline"])) - if(num > lines.len || num < 1) - return - lines.Cut(num, num+1) - - else if(href_list["modifyline"]) - var/num = round(text2num(href_list["modifyline"]),1) - var/content = stripped_input(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS) - if(!content || !in_range(parent, usr)) - return - if(num > lines.len || num < 1) - return - lines[num] = content - - else if(href_list["stop"]) - stop_playing() - - else if(href_list["setlinearfalloff"]) - var/amount = input(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") as null|num - if(!isnull(amount)) - set_linear_falloff_duration(round(amount * 10, world.tick_lag)) - - else if(href_list["setexpfalloff"]) - var/amount = input(usr, "Set exponential sustain factor", "Exponential sustain factor") as null|num - if(!isnull(amount)) - set_exponential_drop_rate(round(amount, 0.00001)) - - else if(href_list["setvolume"]) - var/amount = input(usr, "Set volume", "Volume") as null|num - if(!isnull(amount)) - set_volume(round(amount, 1)) - - else if(href_list["setdropoffvolume"]) - var/amount = input(usr, "Set dropoff threshold", "Dropoff Threshold Volume") as null|num - if(!isnull(amount)) - set_dropoff_volume(round(amount, 0.01)) - - else if(href_list["switchinstrument"]) - if(!length(allowed_instrument_ids)) - return - else if(length(allowed_instrument_ids) == 1) - set_instrument(allowed_instrument_ids[1]) - return - var/list/categories = list() - for(var/i in allowed_instrument_ids) - var/datum/instrument/I = SSinstruments.get_instrument(i) - if(I) - LAZYSET(categories[I.category || "ERROR CATEGORY"], I.name, I.id) - var/cat = input(usr, "Select Category", "Instrument Category") as null|anything in categories - if(!cat) - return - var/list/instruments = categories[cat] - var/choice = input(usr, "Select Instrument", "Instrument Selection") as null|anything in instruments - if(!choice) - return - choice = instruments[choice] //get id - if(choice) - set_instrument(choice) - - else if(href_list["setnoteshift"]) - var/amount = input(usr, "Set note shift", "Note Shift") as null|num - if(!isnull(amount)) - note_shift = CLAMP(amount, note_shift_min, note_shift_max) - - else if(href_list["setsustainmode"]) - var/choice = input(usr, "Choose a sustain mode", "Sustain Mode") as null|anything in list("Linear", "Exponential") - switch(choice) - if("Linear") - sustain_mode = SUSTAIN_LINEAR - if("Exponential") - sustain_mode = SUSTAIN_EXPONENTIAL - - else if(href_list["togglesustainhold"]) - full_sustain_held_note = !full_sustain_held_note - - updateDialog(usr) +/datum/song/proc/instrument_status_ui() + . = list() + . += "
" + . += "Current instrument: " + if(!using_instrument) + . += "No instrument loaded!
" + else + . += "[using_instrument.name]
" + . += "Playback Settings:
" + if(can_noteshift) + . += "Note Shift/Note Transpose: [note_shift] keys / [round(note_shift / 12, 0.01)] octaves
" + var/smt + var/modetext = "" + switch(sustain_mode) + if(SUSTAIN_LINEAR) + smt = "Linear" + modetext = "Linear Sustain Duration: [sustain_linear_duration / 10] seconds
" + if(SUSTAIN_EXPONENTIAL) + smt = "Exponential" + modetext = "Exponential Falloff Factor: [sustain_exponential_dropoff]% per decisecond
" + . += "Sustain Mode: [smt]
" + . += modetext + . += using_instrument?.ready()? "Status: Ready
" : "Status: !Instrument Definition Error!
" + . += "Instrument Type: [legacy? "Legacy" : "Synthesized"]
" + . += "Volume: [volume]
" + . += "Volume Dropoff Threshold: [sustain_dropoff_volume]
" + . += "Sustain indefinitely last held note: [full_sustain_held_note? "Enabled" : "Disabled"].
" + . += "
" + +/datum/song/ui_interact(mob/user) + var/list/dat = list() + + dat += instrument_status_ui() + + if(lines.len > 0) + dat += "

Playback

" + if(!playing) + dat += "Play Stop

" + dat += "Repeat Song: " + dat += repeat > 0 ? "--" : "--" + dat += " [repeat] times " + dat += repeat < max_repeats ? "++" : "++" + dat += "
" + else + dat += "Play Stop
" + dat += "Repeats left: [repeat]
" + if(!editing) + dat += "
Show Editor
" + else + dat += "

Editing

" + dat += "Hide Editor" + dat += " Start a New Song" + dat += " Import a Song

" + var/bpm = round(600 / tempo) + dat += "Tempo: - [bpm] BPM +

" + var/linecount = 0 + for(var/line in lines) + linecount += 1 + dat += "Line [linecount]: Edit X [line]
" + dat += "Add Line

" + if(help) + dat += "Hide Help
" + dat += {" + Lines are a series of chords, separated by commas (,), each with notes separated by hyphens (-).
+ Every note in a chord will play together, with chord timed by the tempo.
+
+ Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.
+ By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.
+ Example: C,D,E,F,G,A,B will play a C major scale.
+ After a note has an accidental placed, it will be remembered: C,C4,C,C3 is C3,C4,C4,C3
+ Chords can be played simply by seperating each note with a hyphon: A-C#,Cn-E,E-G#,Gn-B
+ A pause may be denoted by an empty chord: C,E,,C,G
+ To make a chord be a different time, end it with /x, where the chord length will be length
+ defined by tempo / x: C,G/2,E/4
+ Combined, an example is: E-E4/4,F#/2,G#/8,B/8,E3-E4/4 +
+ Lines may be up to [MUSIC_MAXLINECHARS] characters.
+ A song may only contain up to [MUSIC_MAXLINES] lines.
+ "} + else + dat += "Show Help
" + + var/datum/browser/popup = new(user, "instrument", parent?.name || "instrument", 700, 500) + popup.set_content(dat.Join("")) + popup.set_title_image(user.browse_rsc_icon(parent.icon, parent.icon_state)) + popup.open() + +/datum/song/proc/ParseSong(text) + set waitfor = FALSE + //split into lines + lines = splittext(text, "\n") + if(lines.len) + var/bpm_string = "BPM: " + if(findtext(lines[1], bpm_string, 1, length(bpm_string) + 1)) + var/divisor = text2num(copytext(lines[1], length(bpm_string) + 1)) || 120 // default + tempo = sanitize_tempo(600 / round(divisor, 1)) + lines.Cut(1, 2) + else + tempo = sanitize_tempo(5) // default 120 BPM + if(lines.len > MUSIC_MAXLINES) + to_chat(usr, "Too many lines!") + lines.Cut(MUSIC_MAXLINES + 1) + var/linenum = 1 + for(var/l in lines) + if(length_char(l) > MUSIC_MAXLINECHARS) + to_chat(usr, "Line [linenum] too long!") + lines.Remove(l) + else + linenum++ + updateDialog(usr) // make sure updates when complete + +/datum/song/Topic(href, href_list) + if(usr.default_can_use_topic(parent) < STATUS_UPDATE) + usr << browse(null, "window=instrument") + usr.unset_machine() + return + + parent.add_fingerprint(usr) + + if(href_list["newsong"]) + lines = new() + tempo = sanitize_tempo(5) // default 120 BPM + name = "" + + else if(href_list["import"]) + var/t = "" + do + t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message) + if(!in_range(parent, usr)) + return + + if(length_char(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) + var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") + if(cont == "no") + break + while(length_char(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) + ParseSong(t) + + else if(href_list["help"]) + help = text2num(href_list["help"]) - 1 + + else if(href_list["edit"]) + editing = text2num(href_list["edit"]) - 1 + + if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops. + if(playing) + return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing. + repeat += round(text2num(href_list["repeat"])) + if(repeat < 0) + repeat = 0 + if(repeat > max_repeats) + repeat = max_repeats + + else if(href_list["tempo"]) + tempo = sanitize_tempo(tempo + text2num(href_list["tempo"])) + + else if(href_list["play"]) + INVOKE_ASYNC(src, .proc/start_playing, usr) + + else if(href_list["newline"]) + var/newline = html_encode(input("Enter your line: ", parent.name) as text|null) + if(!newline || !in_range(parent, usr)) + return + if(lines.len > MUSIC_MAXLINES) + return + if(length(newline) > MUSIC_MAXLINECHARS) + newline = copytext(newline, 1, MUSIC_MAXLINECHARS) + lines.Add(newline) + + else if(href_list["deleteline"]) + var/num = round(text2num(href_list["deleteline"])) + if(num > lines.len || num < 1) + return + lines.Cut(num, num+1) + + else if(href_list["modifyline"]) + var/num = round(text2num(href_list["modifyline"]),1) + var/content = stripped_input(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS) + if(!content || !in_range(parent, usr)) + return + if(num > lines.len || num < 1) + return + lines[num] = content + + else if(href_list["stop"]) + stop_playing() + + else if(href_list["setlinearfalloff"]) + var/amount = input(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") as null|num + if(!isnull(amount)) + set_linear_falloff_duration(round(amount * 10, world.tick_lag)) + + else if(href_list["setexpfalloff"]) + var/amount = input(usr, "Set exponential sustain factor", "Exponential sustain factor") as null|num + if(!isnull(amount)) + set_exponential_drop_rate(round(amount, 0.00001)) + + else if(href_list["setvolume"]) + var/amount = input(usr, "Set volume", "Volume") as null|num + if(!isnull(amount)) + set_volume(round(amount, 1)) + + else if(href_list["setdropoffvolume"]) + var/amount = input(usr, "Set dropoff threshold", "Dropoff Threshold Volume") as null|num + if(!isnull(amount)) + set_dropoff_volume(round(amount, 0.01)) + + else if(href_list["switchinstrument"]) + if(!length(allowed_instrument_ids)) + return + else if(length(allowed_instrument_ids) == 1) + set_instrument(allowed_instrument_ids[1]) + return + var/list/categories = list() + for(var/i in allowed_instrument_ids) + var/datum/instrument/I = SSinstruments.get_instrument(i) + if(I) + LAZYSET(categories[I.category || "ERROR CATEGORY"], I.name, I.id) + var/cat = input(usr, "Select Category", "Instrument Category") as null|anything in categories + if(!cat) + return + var/list/instruments = categories[cat] + var/choice = input(usr, "Select Instrument", "Instrument Selection") as null|anything in instruments + if(!choice) + return + choice = instruments[choice] //get id + if(choice) + set_instrument(choice) + + else if(href_list["setnoteshift"]) + var/amount = input(usr, "Set note shift", "Note Shift") as null|num + if(!isnull(amount)) + note_shift = CLAMP(amount, note_shift_min, note_shift_max) + + else if(href_list["setsustainmode"]) + var/choice = input(usr, "Choose a sustain mode", "Sustain Mode") as null|anything in list("Linear", "Exponential") + switch(choice) + if("Linear") + sustain_mode = SUSTAIN_LINEAR + if("Exponential") + sustain_mode = SUSTAIN_EXPONENTIAL + + else if(href_list["togglesustainhold"]) + full_sustain_held_note = !full_sustain_held_note + + updateDialog(usr) diff --git a/code/modules/instruments/songs/play_legacy.dm b/code/modules/instruments/songs/play_legacy.dm index d41c41e8f46..3d597cc2de7 100644 --- a/code/modules/instruments/songs/play_legacy.dm +++ b/code/modules/instruments/songs/play_legacy.dm @@ -1,82 +1,82 @@ -/// Playing legacy instruments - None of the "advanced" like sound reservations and decay are invoked. -/datum/song/proc/do_play_lines_legacy(mob/user) - while(repeat >= 0) - var/cur_oct[7] - var/cur_acc[7] - for(var/i = 1 to 7) - cur_oct[i] = 3 - cur_acc[i] = "n" - - for(var/line in lines) - for(var/beat in splittext(lowertext(line), ",")) - if(should_stop_playing(user)) - return - var/list/notes = splittext(beat, "/") - if(length(notes)) //because some jack-butts are going to do ,,,, to symbolize 3 rests instead of something reasonable like ,/1. - for(var/note in splittext(notes[1], "-")) - if(length(note) == 0) - continue - var/cur_note = text2ascii(note) - 96 - if(cur_note < 1 || cur_note > 7) - continue - for(var/i=2 to length(note)) - var/ni = copytext(note,i,i+1) - if(!text2num(ni)) - if(ni == "#" || ni == "b" || ni == "n") - cur_acc[cur_note] = ni - else if(ni == "s") - cur_acc[cur_note] = "#" // so shift is never required - else - cur_oct[cur_note] = text2num(ni) - playnote_legacy(cur_note, cur_acc[cur_note], cur_oct[cur_note]) - if(notes.len >= 2 && text2num(notes[2])) - sleep(sanitize_tempo(tempo / text2num(notes[2]))) - else - sleep(tempo) - if(should_stop_playing(user)) - return - repeat-- - updateDialog() - repeat = 0 - -// 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_legacy(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) - oct-- - note-- - acc = "n" - else if(acc == "#" && (note == 2 || note == 5)) // B or E - if(note == 2) - oct++ - note++ - acc = "n" - else if(acc == "#" && (note == 7)) //G# - note = 1 - acc = "b" - else if(acc == "#") // mass convert all sharps to flats, octave jump already handled - acc = "b" - note++ - - // check octave, C is allowed to go to 9 - if(oct < 1 || (note == 3 ? oct > 9 : oct > 8)) - return - - // now generate name - var/soundfile = "sound/instruments/[cached_legacy_dir]/[ascii2text(note+64)][acc][oct].[cached_legacy_ext]" - soundfile = file(soundfile) - // make sure the note exists - if(!fexists(soundfile)) - return - // and play - var/turf/source = get_turf(parent) - if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck) - do_hearcheck() - var/sound/music_played = sound(soundfile) - for(var/i in hearing_mobs) - var/mob/M = i - M.playsound_local(source, null, volume * using_instrument.volume_multiplier, falloff = 5, S = music_played, preference = /datum/client_preference/instrument_toggle) - // Could do environment and echo later but not for now +/// Playing legacy instruments - None of the "advanced" like sound reservations and decay are invoked. +/datum/song/proc/do_play_lines_legacy(mob/user) + while(repeat >= 0) + var/cur_oct[7] + var/cur_acc[7] + for(var/i = 1 to 7) + cur_oct[i] = 3 + cur_acc[i] = "n" + + for(var/line in lines) + for(var/beat in splittext(lowertext(line), ",")) + if(should_stop_playing(user)) + return + var/list/notes = splittext(beat, "/") + if(length(notes)) //because some jack-butts are going to do ,,,, to symbolize 3 rests instead of something reasonable like ,/1. + for(var/note in splittext(notes[1], "-")) + if(length(note) == 0) + continue + var/cur_note = text2ascii(note) - 96 + if(cur_note < 1 || cur_note > 7) + continue + for(var/i=2 to length(note)) + var/ni = copytext(note,i,i+1) + if(!text2num(ni)) + if(ni == "#" || ni == "b" || ni == "n") + cur_acc[cur_note] = ni + else if(ni == "s") + cur_acc[cur_note] = "#" // so shift is never required + else + cur_oct[cur_note] = text2num(ni) + playnote_legacy(cur_note, cur_acc[cur_note], cur_oct[cur_note]) + if(notes.len >= 2 && text2num(notes[2])) + sleep(sanitize_tempo(tempo / text2num(notes[2]))) + else + sleep(tempo) + if(should_stop_playing(user)) + return + repeat-- + updateDialog() + repeat = 0 + +// 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_legacy(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) + oct-- + note-- + acc = "n" + else if(acc == "#" && (note == 2 || note == 5)) // B or E + if(note == 2) + oct++ + note++ + acc = "n" + else if(acc == "#" && (note == 7)) //G# + note = 1 + acc = "b" + else if(acc == "#") // mass convert all sharps to flats, octave jump already handled + acc = "b" + note++ + + // check octave, C is allowed to go to 9 + if(oct < 1 || (note == 3 ? oct > 9 : oct > 8)) + return + + // now generate name + var/soundfile = "sound/instruments/[cached_legacy_dir]/[ascii2text(note+64)][acc][oct].[cached_legacy_ext]" + soundfile = file(soundfile) + // make sure the note exists + if(!fexists(soundfile)) + return + // and play + var/turf/source = get_turf(parent) + if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck) + do_hearcheck() + var/sound/music_played = sound(soundfile) + for(var/i in hearing_mobs) + var/mob/M = i + M.playsound_local(source, null, volume * using_instrument.volume_multiplier, falloff = 5, S = music_played, preference = /datum/client_preference/instrument_toggle) + // Could do environment and echo later but not for now diff --git a/code/modules/instruments/songs/play_synthesized.dm b/code/modules/instruments/songs/play_synthesized.dm index 0b9a97ad665..628f87ed1ce 100644 --- a/code/modules/instruments/songs/play_synthesized.dm +++ b/code/modules/instruments/songs/play_synthesized.dm @@ -1,135 +1,135 @@ -/datum/song/proc/do_play_lines_synthesized(mob/user) - compile_lines() - while(repeat >= 0) - if(should_stop_playing(user)) - return - var/warned = FALSE - for(var/_chord in compiled_chords) - if(should_stop_playing(user)) - return - var/list/chord = _chord - var/tempodiv = chord[chord.len] - for(var/i in 1 to chord.len - 1) - var/key = chord[i] - if(!playkey_synth(key)) - if(!warned) - warned = TRUE - to_chat(user, "Your instrument has ran out of channels. You might be playing your song too fast or be setting sustain to too high of a value. This warning will be suppressed for the rest of this cycle.") - sleep(sanitize_tempo(tempo / (tempodiv || 1))) - repeat-- - updateDialog() - repeat = 0 - -/// C-Db2-A-A4/2,A-B#4-C/3,/4,A,A-B-C as an example -/datum/song/proc/compile_lines() - if(!length(src.lines)) - return - var/list/lines = src.lines //cache for hyepr speed! - compiled_chords = list() - var/list/octaves = list(3, 3, 3, 3, 3, 3, 3) - var/list/accents = list("n", "n", "n", "n", "n", "n", "n") - for(var/line in lines) - var/list/chords = splittext(lowertext(line), ",") - for(var/chord in chords) - var/list/compiled_chord = list() - var/tempodiv = 1 - var/list/notes_tempodiv = splittext(chord, "/") - var/len = length(notes_tempodiv) - if(len >= 2) - tempodiv = text2num(notes_tempodiv[2]) - if(len) //some dunkass is going to do ,,,, to make 3 rests instead of ,/1 because there's no standardization so let's be prepared for that. - var/list/notes = splittext(notes_tempodiv[1], "-") - for(var/note in notes) - if(length(note) == 0) - continue - // 1-7, A-G - var/key = text2ascii(note) - 96 - if((key < 1) || (key > 7)) - continue - for(var/i in 2 to length(note)) - var/oct_acc = copytext(note, i, i + 1) - var/num = text2num(oct_acc) - if(!num) //it's an accidental - accents[key] = oct_acc //if they misspelled it/fucked up that's on them lmao, no safety checks. - else //octave - octaves[key] = CLAMP(num, octave_min, octave_max) - compiled_chord += CLAMP((note_offset_lookup[key] + octaves[key] * 12 + accent_lookup[accents[key]]), key_min, key_max) - compiled_chord += tempodiv //this goes last - if(length(compiled_chord)) - compiled_chords[++compiled_chords.len] = compiled_chord - CHECK_TICK - return compiled_chords - -/datum/song/proc/playkey_synth(key) - if(can_noteshift) - key = CLAMP(key + note_shift, key_min, key_max) - if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck) - do_hearcheck() - var/datum/instrument_key/K = using_instrument.samples[num2text(key)] //See how fucking easy it is to make a number text? You don't need a complicated 9 line proc! - //Should probably add channel limiters here at some point but I don't care right now. - var/channel = pop_channel() - if(isnull(channel)) - return FALSE - . = TRUE - var/sound/copy = sound(K.sample) - var/volume = src.volume * using_instrument.volume_multiplier - copy.frequency = K.frequency - copy.volume = volume - var/channel_text = num2text(channel) - channels_playing[channel_text] = 100 - last_channel_played = channel_text - for(var/i in hearing_mobs) - var/mob/M = i - M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, INSTRUMENT_DISTANCE_NO_FALLOFF, FALSE, channel, null, copy, /datum/client_preference/instrument_toggle, distance_multiplier = INSTRUMENT_DISTANCE_FALLOFF_BUFF) - // Could do environment and echo later but not for now - -/datum/song/proc/terminate_all_sounds(clear_channels = TRUE) - for(var/i in hearing_mobs) - terminate_sound_mob(i) - if(clear_channels) - channels_playing.len = 0 - channels_idle.len = 0 - SSinstruments.current_instrument_channels -= using_sound_channels - using_sound_channels = 0 - SSsounds.free_datum_channels(src) - -/datum/song/proc/terminate_sound_mob(mob/M) - for(var/channel in channels_playing) - M.stop_sound_channel(text2num(channel)) - -/datum/song/proc/pop_channel() - if(length(channels_idle)) //just pop one off of here if we have one available - . = text2num(channels_idle[1]) - channels_idle.Cut(1,2) - return - if(using_sound_channels >= max_sound_channels) - return - . = SSinstruments.reserve_instrument_channel(src) - if(!isnull(.)) - using_sound_channels++ - -/datum/song/proc/process_decay(wait_ds) - var/linear_dropoff = cached_linear_dropoff * wait_ds - var/exponential_dropoff = cached_exponential_dropoff ** wait_ds - for(var/channel in channels_playing) - if(full_sustain_held_note && (channel == last_channel_played)) - continue - var/current_volume = channels_playing[channel] - switch(sustain_mode) - if(SUSTAIN_LINEAR) - current_volume -= linear_dropoff - if(SUSTAIN_EXPONENTIAL) - current_volume /= exponential_dropoff - channels_playing[channel] = current_volume - var/dead = current_volume <= sustain_dropoff_volume - var/channelnumber = text2num(channel) - if(dead) - channels_playing -= channel - channels_idle += channel - for(var/i in hearing_mobs) - var/mob/M = i - M.stop_sound_channel(channelnumber) - else - for(var/i in hearing_mobs) - var/mob/M = i - M.set_sound_channel_volume(channelnumber, (current_volume * 0.01) * volume * using_instrument.volume_multiplier) +/datum/song/proc/do_play_lines_synthesized(mob/user) + compile_lines() + while(repeat >= 0) + if(should_stop_playing(user)) + return + var/warned = FALSE + for(var/_chord in compiled_chords) + if(should_stop_playing(user)) + return + var/list/chord = _chord + var/tempodiv = chord[chord.len] + for(var/i in 1 to chord.len - 1) + var/key = chord[i] + if(!playkey_synth(key)) + if(!warned) + warned = TRUE + to_chat(user, "Your instrument has ran out of channels. You might be playing your song too fast or be setting sustain to too high of a value. This warning will be suppressed for the rest of this cycle.") + sleep(sanitize_tempo(tempo / (tempodiv || 1))) + repeat-- + updateDialog() + repeat = 0 + +/// C-Db2-A-A4/2,A-B#4-C/3,/4,A,A-B-C as an example +/datum/song/proc/compile_lines() + if(!length(src.lines)) + return + var/list/lines = src.lines //cache for hyepr speed! + compiled_chords = list() + var/list/octaves = list(3, 3, 3, 3, 3, 3, 3) + var/list/accents = list("n", "n", "n", "n", "n", "n", "n") + for(var/line in lines) + var/list/chords = splittext(lowertext(line), ",") + for(var/chord in chords) + var/list/compiled_chord = list() + var/tempodiv = 1 + var/list/notes_tempodiv = splittext(chord, "/") + var/len = length(notes_tempodiv) + if(len >= 2) + tempodiv = text2num(notes_tempodiv[2]) + if(len) //some dunkass is going to do ,,,, to make 3 rests instead of ,/1 because there's no standardization so let's be prepared for that. + var/list/notes = splittext(notes_tempodiv[1], "-") + for(var/note in notes) + if(length(note) == 0) + continue + // 1-7, A-G + var/key = text2ascii(note) - 96 + if((key < 1) || (key > 7)) + continue + for(var/i in 2 to length(note)) + var/oct_acc = copytext(note, i, i + 1) + var/num = text2num(oct_acc) + if(!num) //it's an accidental + accents[key] = oct_acc //if they misspelled it/fucked up that's on them lmao, no safety checks. + else //octave + octaves[key] = CLAMP(num, octave_min, octave_max) + compiled_chord += CLAMP((note_offset_lookup[key] + octaves[key] * 12 + accent_lookup[accents[key]]), key_min, key_max) + compiled_chord += tempodiv //this goes last + if(length(compiled_chord)) + compiled_chords[++compiled_chords.len] = compiled_chord + CHECK_TICK + return compiled_chords + +/datum/song/proc/playkey_synth(key) + if(can_noteshift) + key = CLAMP(key + note_shift, key_min, key_max) + if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck) + do_hearcheck() + var/datum/instrument_key/K = using_instrument.samples[num2text(key)] //See how fucking easy it is to make a number text? You don't need a complicated 9 line proc! + //Should probably add channel limiters here at some point but I don't care right now. + var/channel = pop_channel() + if(isnull(channel)) + return FALSE + . = TRUE + var/sound/copy = sound(K.sample) + var/volume = src.volume * using_instrument.volume_multiplier + copy.frequency = K.frequency + copy.volume = volume + var/channel_text = num2text(channel) + channels_playing[channel_text] = 100 + last_channel_played = channel_text + for(var/i in hearing_mobs) + var/mob/M = i + M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, INSTRUMENT_DISTANCE_NO_FALLOFF, FALSE, channel, null, copy, /datum/client_preference/instrument_toggle, distance_multiplier = INSTRUMENT_DISTANCE_FALLOFF_BUFF) + // Could do environment and echo later but not for now + +/datum/song/proc/terminate_all_sounds(clear_channels = TRUE) + for(var/i in hearing_mobs) + terminate_sound_mob(i) + if(clear_channels) + channels_playing.len = 0 + channels_idle.len = 0 + SSinstruments.current_instrument_channels -= using_sound_channels + using_sound_channels = 0 + SSsounds.free_datum_channels(src) + +/datum/song/proc/terminate_sound_mob(mob/M) + for(var/channel in channels_playing) + M.stop_sound_channel(text2num(channel)) + +/datum/song/proc/pop_channel() + if(length(channels_idle)) //just pop one off of here if we have one available + . = text2num(channels_idle[1]) + channels_idle.Cut(1,2) + return + if(using_sound_channels >= max_sound_channels) + return + . = SSinstruments.reserve_instrument_channel(src) + if(!isnull(.)) + using_sound_channels++ + +/datum/song/proc/process_decay(wait_ds) + var/linear_dropoff = cached_linear_dropoff * wait_ds + var/exponential_dropoff = cached_exponential_dropoff ** wait_ds + for(var/channel in channels_playing) + if(full_sustain_held_note && (channel == last_channel_played)) + continue + var/current_volume = channels_playing[channel] + switch(sustain_mode) + if(SUSTAIN_LINEAR) + current_volume -= linear_dropoff + if(SUSTAIN_EXPONENTIAL) + current_volume /= exponential_dropoff + channels_playing[channel] = current_volume + var/dead = current_volume <= sustain_dropoff_volume + var/channelnumber = text2num(channel) + if(dead) + channels_playing -= channel + channels_idle += channel + for(var/i in hearing_mobs) + var/mob/M = i + M.stop_sound_channel(channelnumber) + else + for(var/i in hearing_mobs) + var/mob/M = i + M.set_sound_channel_volume(channelnumber, (current_volume * 0.01) * volume * using_instrument.volume_multiplier) diff --git a/code/modules/maps/fromdmp.dm b/code/modules/maps/fromdmp.dm index 73958b43a8c..5fdcbc78c7c 100644 --- a/code/modules/maps/fromdmp.dm +++ b/code/modules/maps/fromdmp.dm @@ -141,9 +141,9 @@ proc/dmp2swapmap(filename) txt="" for(i=0,i0,--y) // map is top-down ++i - F << "\t\t[y]" + to_chat(F, "\t\t[y]") for(var/x in 1 to _x) - F << "\t\t\t[x]" + to_chat(F, "\t\t\t[x]") j=i+codelen F << codes[copytext(mtxt,i,j)] i=j txt=copytext(txt,k+1) /* for(z in 1 to Z) - F << "\t[z]" + to_chat(F, "\t[z]") for(var/y in 1 to Y) - F << "\t\t[y]" + to_chat(F, "\t\t[y]") for(var/x in 1 to X) - F << "\t\t\t[x]" + to_chat(F, "\t\t\t[x]") F << codes[pick(codes)] */ proc/d2sm_ParseCommaList(txt) diff --git a/code/modules/mob/living/carbon/human/MedicalSideEffects.dm b/code/modules/mob/living/carbon/human/MedicalSideEffects.dm index c7009107de2..91622f806df 100644 --- a/code/modules/mob/living/carbon/human/MedicalSideEffects.dm +++ b/code/modules/mob/living/carbon/human/MedicalSideEffects.dm @@ -24,7 +24,7 @@ for(var/R in cures) if(H.reagents.has_reagent(R)) if (cure_message) - H <<"[cure_message]" + to_chat(H, "[cure_message]") return 1 return 0 diff --git a/code/modules/mob/living/carbon/human/chem_side_effects.dm b/code/modules/mob/living/carbon/human/chem_side_effects.dm index c7009107de2..91622f806df 100644 --- a/code/modules/mob/living/carbon/human/chem_side_effects.dm +++ b/code/modules/mob/living/carbon/human/chem_side_effects.dm @@ -24,7 +24,7 @@ for(var/R in cures) if(H.reagents.has_reagent(R)) if (cure_message) - H <<"[cure_message]" + to_chat(H, "[cure_message]") return 1 return 0 diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index ae29eb42b2f..d09bb6693ee 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -5,7 +5,7 @@ /mob/proc/change_mob_type(var/new_type = null, var/turf/location = null, var/new_name = null as text, var/delete_old_mob = 0 as num, var/subspecies) if(istype(src,/mob/new_player)) - usr << "cannot convert players who have not entered yet." + to_chat(usr, "cannot convert players who have not entered yet.") return if(!new_type) @@ -15,11 +15,11 @@ new_type = text2path(new_type) if( !ispath(new_type) ) - usr << "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder." + to_chat(usr, "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder.") return if( new_type == /mob/new_player ) - usr << "cannot convert into a new_player mob type." + to_chat(usr, "cannot convert into a new_player mob type.") return var/mob/M @@ -29,7 +29,7 @@ M = new new_type( src.loc ) if(!M || !ismob(M)) - usr << "Type path is not a mob (new_type = [new_type]) in change_mob_type(). Contact a coder." + to_chat(usr, "Type path is not a mob (new_type = [new_type]) in change_mob_type(). Contact a coder.") qdel(M) return diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm index 55d078c66c7..a48cb666c06 100644 --- a/code/modules/mob/new_player/poll.dm +++ b/code/modules/mob/new_player/poll.dm @@ -103,7 +103,7 @@ break if(!found) - usr << "Poll question details not found." + to_chat(usr, "Poll question details not found.") return switch(polltype) @@ -360,7 +360,7 @@ break if(!validpoll) - usr << "Poll is not valid." + to_chat(usr, "Poll is not valid.") return var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM erro_poll_option WHERE id = [optionid] AND pollid = [pollid]") @@ -373,7 +373,7 @@ break if(!validoption) - usr << "Poll option is not valid." + to_chat(usr, "Poll option is not valid.") return var/alreadyvoted = 0 @@ -387,11 +387,11 @@ break if(!multichoice && alreadyvoted) - usr << "You already voted in this poll." + to_chat(usr, "You already voted in this poll.") return if(multichoice && (alreadyvoted >= multiplechoiceoptions)) - usr << "You already have more than [multiplechoiceoptions] logged votes on this poll. Enough is enough. Contact the database admin if this is an error." + to_chat(usr, "You already have more than [multiplechoiceoptions] logged votes on this poll. Enough is enough. Contact the database admin if this is an error.") return var/adminrank = "Player" @@ -402,7 +402,7 @@ var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')") insert_query.Execute() - usr << "Vote successful." + to_chat(usr, "Vote successful.") usr << browse(null,"window=playerpoll") @@ -427,7 +427,7 @@ break if(!validpoll) - usr << "Poll is not valid." + to_chat(usr, "Poll is not valid.") return var/alreadyvoted = 0 @@ -440,7 +440,7 @@ break if(alreadyvoted) - usr << "You already sent your feedback for this poll." + to_chat(usr, "You already sent your feedback for this poll.") return var/adminrank = "Player" @@ -460,7 +460,7 @@ var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')") insert_query.Execute() - usr << "Feedback logging successful." + to_chat(usr, "Feedback logging successful.") usr << browse(null,"window=playerpoll") @@ -485,7 +485,7 @@ break if(!validpoll) - usr << "Poll is not valid." + to_chat(usr, "Poll is not valid.") return var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM erro_poll_option WHERE id = [optionid] AND pollid = [pollid]") @@ -498,7 +498,7 @@ break if(!validoption) - usr << "Poll option is not valid." + to_chat(usr, "Poll option is not valid.") return var/alreadyvoted = 0 @@ -511,7 +511,7 @@ break if(alreadyvoted) - usr << "You already voted in this poll." + to_chat(usr, "You already voted in this poll.") return var/adminrank = "Player" @@ -522,5 +522,5 @@ var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])") insert_query.Execute() - usr << "Vote successful." + to_chat(usr, "Vote successful.") usr << browse(null,"window=playerpoll") \ No newline at end of file diff --git a/code/modules/mob/new_player/skill.dm b/code/modules/mob/new_player/skill.dm index 5fb0e81745e..dc7e5c354e0 100644 --- a/code/modules/mob/new_player/skill.dm +++ b/code/modules/mob/new_player/skill.dm @@ -176,7 +176,7 @@ var/global/list/SKILL_PRE = list("Engineer" = SKILL_ENGINEER, "Roboticist" = SKI setup_skills() if(!M.skills || M.skills.len == 0) - user << "There are no skills to display." + to_chat(user, "There are no skills to display.") return var/HTML = "" diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm index c90c936c4d8..692dcd73d97 100644 --- a/code/modules/power/cable_heavyduty.dm +++ b/code/modules/power/cable_heavyduty.dm @@ -18,10 +18,10 @@ return if(W.is_wirecutter()) - usr << "These cables are too tough to be cut with those [W.name]." + to_chat(usr, "These cables are too tough to be cut with those [W.name].") return else if(istype(W, /obj/item/stack/cable_coil)) - usr << "You will need heavier cables to connect to these." + to_chat(usr, "You will need heavier cables to connect to these.") return else ..() diff --git a/code/modules/power/profiling.dm b/code/modules/power/profiling.dm index 3cf8c3a0b92..4df5b88fa3d 100644 --- a/code/modules/power/profiling.dm +++ b/code/modules/power/profiling.dm @@ -34,14 +34,14 @@ var/global/list/power_update_requests_by_area = list() if(enable_power_update_profiling) enable_power_update_profiling = 0 - usr << "Area power update profiling disabled." + to_chat(usr, "Area power update profiling disabled.") message_admins("[key_name(src)] toggled area power update profiling off.") log_admin("[key_name(src)] toggled area power update profiling off.") else enable_power_update_profiling = 1 power_last_profile_time = world.time - usr << "Area power update profiling enabled." + to_chat(usr, "Area power update profiling enabled.") message_admins("[key_name(src)] toggled area power update profiling on.") log_admin("[key_name(src)] toggled area power update profiling on.") @@ -56,7 +56,7 @@ var/global/list/power_update_requests_by_area = list() usr << "Total profiling time: [power_profiled_time] ticks" for (var/M in power_update_requests_by_machine) - usr << "[M] = [power_update_requests_by_machine[M]]" + to_chat(usr, "[M] = [power_update_requests_by_machine[M]]") /client/proc/view_power_update_stats_area() set name = "View Area Power Update Statistics By Area" diff --git a/code/modules/random_map/random_map.dm b/code/modules/random_map/random_map.dm index 0f8e138d844..ed90523e351 100644 --- a/code/modules/random_map/random_map.dm +++ b/code/modules/random_map/random_map.dm @@ -106,7 +106,7 @@ var/global/list/map_count = list() dat += get_map_char(map[current_cell]) dat += "
" CHECK_TICK - user << "[dat]+------+" + to_chat(user, "[dat]+------+") /datum/random_map/proc/set_map_size() map = list() diff --git a/code/modules/spells/general/area_teleport.dm b/code/modules/spells/general/area_teleport.dm index 77e1ee47c43..93d86c2d20c 100644 --- a/code/modules/spells/general/area_teleport.dm +++ b/code/modules/spells/general/area_teleport.dm @@ -50,7 +50,7 @@ L+=T if(!L.len) - user <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry." + to_chat(user, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.") return if(user && user.buckled) diff --git a/code/modules/spells/general/rune_write.dm b/code/modules/spells/general/rune_write.dm index c110a76ac14..28710333954 100644 --- a/code/modules/spells/general/rune_write.dm +++ b/code/modules/spells/general/rune_write.dm @@ -171,5 +171,5 @@ R.word3=cultwords["technology"] R.check_icon() else - user << " You do not have enough space to write a proper rune." + to_chat(user, " You do not have enough space to write a proper rune.") return diff --git a/code/modules/spells/targeted/mind_transfer.dm b/code/modules/spells/targeted/mind_transfer.dm index 375328016fe..e3eda58b652 100644 --- a/code/modules/spells/targeted/mind_transfer.dm +++ b/code/modules/spells/targeted/mind_transfer.dm @@ -24,15 +24,15 @@ for(var/mob/living/target in targets) if(target.stat == DEAD) - user << "You didn't study necromancy back at the Space Wizard Federation academy." + to_chat(user, "You didn't study necromancy back at the Space Wizard Federation academy.") continue if(!target.key || !target.mind) - user << "They appear to be catatonic. Not even magic can affect their vacant mind." + to_chat(user, "They appear to be catatonic. Not even magic can affect their vacant mind.") continue if(target.mind.special_role in protected_roles) - user << "Their mind is resisting your spell." + to_chat(user, "Their mind is resisting your spell.") continue var/mob/living/victim = target//The target of the spell whos body will be transferred to. @@ -78,4 +78,4 @@ //After a certain amount of time the victim gets a message about being in a different body. spawn(msg_wait) - caster << "You feel woozy and lightheaded. Your body doesn't seem like your own." + to_chat(caster, "You feel woozy and lightheaded. Your body doesn't seem like your own.") diff --git a/code/modules/tables/flipping.dm b/code/modules/tables/flipping.dm index de94201af04..b53465cea3a 100644 --- a/code/modules/tables/flipping.dm +++ b/code/modules/tables/flipping.dm @@ -22,7 +22,7 @@ return if(flipped < 0 || !flip(get_cardinal_dir(usr,src))) - usr << "It won't budge." + to_chat(usr, "It won't budge.") return usr.visible_message("[usr] flips \the [src]!") @@ -39,7 +39,7 @@ var/obj/occupied = turf_is_crowded() if(occupied) - usr << "There's \a [occupied] in the way." + to_chat(usr, "There's \a [occupied] in the way.") return 0 var/list/L = list() @@ -65,7 +65,7 @@ return if (!unflipping_check()) - usr << "It won't budge." + to_chat(usr, "It won't budge.") return unflip() diff --git a/code/modules/turbolift/turbolift_door_vr.dm b/code/modules/turbolift/turbolift_door_vr.dm index 299140c4a20..ab7ca44993b 100644 --- a/code/modules/turbolift/turbolift_door_vr.dm +++ b/code/modules/turbolift/turbolift_door_vr.dm @@ -1,5 +1,5 @@ // Vore specific code for /obj/machinery/door/airlock/lift /obj/machinery/door/airlock/lift/emag_act(var/uses_left, var/mob/user) - user << "This door is internally controlled." + to_chat(user, "This door is internally controlled.") return 0 // Prevents the cryptographic sequencer from using a charge fruitlessly diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 825b465d43c..dc9696bc8ee 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -89,7 +89,7 @@ /obj/vehicle/train/relaymove(mob/user, direction) var/turf/T = get_step_to(src, get_step(src, direction)) if(!T) - user << "You can't find a clear area to step onto." + to_chat(user, "You can't find a clear area to step onto.") return 0 if(user != load) @@ -100,7 +100,7 @@ unload(user, direction) - user << "You climb down from [src]." + to_chat(user, "You climb down from [src].") return 1 @@ -111,7 +111,7 @@ latch(C, user) else if(!load(C, user)) - user << "You were unable to load [C] on [src]." + to_chat(user, "You were unable to load [C] on [src].") /obj/vehicle/train/attack_hand(mob/user as mob) if(user.stat || user.restrained() || !Adjacent(user)) @@ -149,22 +149,22 @@ //Note: there is a modified version of this in code\modules\vehicles\cargo_train.dm specifically for cargo train engines /obj/vehicle/train/proc/attach_to(obj/vehicle/train/T, mob/user) if (get_dist(src, T) > 1) - user << "[src] is too far away from [T] to hitch them together." + to_chat(user, "[src] is too far away from [T] to hitch them together.") return if (lead) - user << "[src] is already hitched to something." + to_chat(user, "[src] is already hitched to something.") return if (T.tow) - user << "[T] is already towing something." + to_chat(user, "[T] is already towing something.") return //check for cycles. var/obj/vehicle/train/next_car = T while (next_car) if (next_car == src) - user << "That seems very silly." + to_chat(user, "That seems very silly.") return next_car = next_car.lead @@ -174,7 +174,7 @@ setDir(lead.dir) if(user) - user << "You hitch [src] to [T]." + to_chat(user, "You hitch [src] to [T].") update_stats() @@ -182,13 +182,13 @@ //detaches the train from whatever is towing it /obj/vehicle/train/proc/unattach(mob/user) if (!lead) - user << "[src] is not hitched to anything." + to_chat(user, "[src] is not hitched to anything.") return lead.tow = null lead.update_stats() - user << "You unhitch [src] from [lead]." + to_chat(user, "You unhitch [src] from [lead].") lead = null update_stats() diff --git a/code/modules/vore/weight/fitness_machines_vr.dm b/code/modules/vore/weight/fitness_machines_vr.dm index 0785c778b52..cffd0d08370 100644 --- a/code/modules/vore/weight/fitness_machines_vr.dm +++ b/code/modules/vore/weight/fitness_machines_vr.dm @@ -24,7 +24,7 @@ user.weight -= 0.025 * weightloss_power * (0.01*user.weight_loss) flick("[icon_state]2",src) var/message = pick(messages) - user << "[message]." + to_chat(user, "[message].") for(var/s in workout_sounds) playsound(src.loc, s, 50, 1) diff --git a/code/modules/xenoarcheaology/artifacts/gigadrill.dm b/code/modules/xenoarcheaology/artifacts/gigadrill.dm index b6c665cb661..ad51cd690aa 100644 --- a/code/modules/xenoarcheaology/artifacts/gigadrill.dm +++ b/code/modules/xenoarcheaology/artifacts/gigadrill.dm @@ -13,11 +13,11 @@ if(active) active = 0 icon_state = "gigadrill" - user << "You press a button and \the [src] slowly spins down." + to_chat(user, "You press a button and \the [src] slowly spins down.") else active = 1 icon_state = "gigadrill_mov" - user << "You press a button and \the [src] shudders to life." + to_chat(user, "You press a button and \the [src] shudders to life.") /obj/machinery/giga_drill/Bump(atom/A) if(active && !drilling_turf) diff --git a/code/modules/xenoarcheaology/effects/badfeeling.dm b/code/modules/xenoarcheaology/effects/badfeeling.dm index 60386531d96..f4306dcdd3d 100644 --- a/code/modules/xenoarcheaology/effects/badfeeling.dm +++ b/code/modules/xenoarcheaology/effects/badfeeling.dm @@ -33,7 +33,7 @@ if(prob(75)) H << "[pick(drastic_messages)]" else - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") if(prob(50)) H.dizziness += rand(3,5) @@ -44,7 +44,7 @@ for (var/mob/living/carbon/human/H in range(src.effectrange,T)) if(prob(5)) if(prob(75)) - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") else H << "[pick(drastic_messages)]" @@ -60,7 +60,7 @@ if(prob(95)) H << "[pick(drastic_messages)]" else - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") if(prob(50)) H.dizziness += rand(3,5) diff --git a/code/modules/xenoarcheaology/effects/goodfeeling.dm b/code/modules/xenoarcheaology/effects/goodfeeling.dm index 8086d0e6737..97778c1a790 100644 --- a/code/modules/xenoarcheaology/effects/goodfeeling.dm +++ b/code/modules/xenoarcheaology/effects/goodfeeling.dm @@ -31,7 +31,7 @@ if(prob(75)) H << "[pick(drastic_messages)]" else - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") if(prob(50)) H.dizziness += rand(3,5) @@ -42,7 +42,7 @@ for (var/mob/living/carbon/human/H in range(src.effectrange,T)) if(prob(5)) if(prob(75)) - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") else H << "[pick(drastic_messages)]" @@ -58,7 +58,7 @@ if(prob(95)) H << "[pick(drastic_messages)]" else - H << "[pick(messages)]" + to_chat(H, "[pick(messages)]") if(prob(50)) H.dizziness += rand(3,5) diff --git a/code/modules/xenoarcheaology/effects/heal.dm b/code/modules/xenoarcheaology/effects/heal.dm index 963a0de295f..b195c736c1d 100644 --- a/code/modules/xenoarcheaology/effects/heal.dm +++ b/code/modules/xenoarcheaology/effects/heal.dm @@ -8,7 +8,7 @@ var/weakness = GetAnomalySusceptibility(toucher) if(prob(weakness * 100)) var/mob/living/carbon/C = toucher - C << "You feel a soothing energy invigorate you." + to_chat(C, "You feel a soothing energy invigorate you.") if(ishuman(toucher)) var/mob/living/carbon/human/H = toucher @@ -40,7 +40,7 @@ var/weakness = GetAnomalySusceptibility(C) if(prob(weakness * 100)) if(prob(10)) - C << "You feel a soothing energy radiating from something nearby." + to_chat(C, "You feel a soothing energy radiating from something nearby.") C.adjustBruteLoss(-1 * weakness) C.adjustFireLoss(-1 * weakness) C.adjustToxLoss(-1 * weakness) @@ -55,7 +55,7 @@ for (var/mob/living/carbon/C in range(src.effectrange,T)) var/weakness = GetAnomalySusceptibility(C) if(prob(weakness * 100)) - C << "A wave of energy invigorates you." + to_chat(C, "A wave of energy invigorates you.") C.adjustBruteLoss(-5 * weakness) C.adjustFireLoss(-5 * weakness) C.adjustToxLoss(-5 * weakness) diff --git a/code/modules/xenoarcheaology/effects/hurt.dm b/code/modules/xenoarcheaology/effects/hurt.dm index db8732294d8..226044129e2 100644 --- a/code/modules/xenoarcheaology/effects/hurt.dm +++ b/code/modules/xenoarcheaology/effects/hurt.dm @@ -25,7 +25,7 @@ var/weakness = GetAnomalySusceptibility(C) if(prob(weakness * 100)) if(prob(10)) - C << "You feel a painful force radiating from something nearby." + to_chat(C, "You feel a painful force radiating from something nearby.") C.adjustBruteLoss(1 * weakness) C.adjustFireLoss(1 * weakness) C.adjustToxLoss(1 * weakness) diff --git a/code/modules/xenoarcheaology/effects/stun.dm b/code/modules/xenoarcheaology/effects/stun.dm index 13f30721ab2..cb0a64e96a9 100644 --- a/code/modules/xenoarcheaology/effects/stun.dm +++ b/code/modules/xenoarcheaology/effects/stun.dm @@ -10,7 +10,7 @@ var/mob/living/carbon/C = toucher var/susceptibility = GetAnomalySusceptibility(C) if(prob(susceptibility * 100)) - C << "A powerful force overwhelms your consciousness." + to_chat(C, "A powerful force overwhelms your consciousness.") C.Weaken(rand(1,10) * susceptibility) C.stuttering += 30 * susceptibility C.Stun(rand(1,10) * susceptibility) @@ -21,13 +21,13 @@ for (var/mob/living/carbon/C in range(src.effectrange,T)) var/susceptibility = GetAnomalySusceptibility(C) if(prob(10 * susceptibility)) - C << "Your body goes numb for a moment." + to_chat(C, "Your body goes numb for a moment.") C.Weaken(2) C.stuttering += 2 if(prob(10)) C.Stun(1) else if(prob(10)) - C << "You feel numb." + to_chat(C, "You feel numb.") /datum/artifact_effect/stun/DoEffectPulse() if(holder) diff --git a/code/modules/xenobio2/controller.dm b/code/modules/xenobio2/controller.dm index bcd13bb602c..70ad5bfbe28 100644 --- a/code/modules/xenobio2/controller.dm +++ b/code/modules/xenobio2/controller.dm @@ -8,7 +8,7 @@ if(!holder) return if(!xenobio_controller || !xenobio_controller.gene_tag_masks) - usr << "Gene masks not set." + to_chat(usr, "Gene masks not set.") return for(var/mask in xenobio_controller.gene_tag_masks) diff --git a/modular_citadel/code/modules/clothing/masks/gasmask_cit.dm b/modular_citadel/code/modules/clothing/masks/gasmask_cit.dm index 54cfe1a0ba8..b5aed6ecb4b 100644 --- a/modular_citadel/code/modules/clothing/masks/gasmask_cit.dm +++ b/modular_citadel/code/modules/clothing/masks/gasmask_cit.dm @@ -14,7 +14,7 @@ item_flags = item_flags & ~BLOCK_GAS_SMOKE_EFFECT & ~AIRTIGHT armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) icon_state = "halfgas_up" - usr << "Your mask is now hanging on your neck." + to_chat(usr, "Your mask is now hanging on your neck.") else gas_transfer_coefficient = initial(gas_transfer_coefficient) gas_filter_strength = initial(gas_filter_strength) @@ -22,7 +22,7 @@ item_flags = initial(item_flags) armor = initial(armor) icon_state = initial(icon_state) - usr << "You pull the mask up to cover your face." + to_chat(usr, "You pull the mask up to cover your face.") update_clothing_icon() /obj/item/clothing/mask/gas/half/verb/toggle() diff --git a/tools/IconSplitter/IconSplitter.dm b/tools/IconSplitter/IconSplitter.dm index a13aad9b730..51ab10b3932 100644 --- a/tools/IconSplitter/IconSplitter.dm +++ b/tools/IconSplitter/IconSplitter.dm @@ -33,7 +33,7 @@ client/verb/split_dmi() var/user_input while(!user_input) user_input = input(usr, "Enter the criteria for the icon_states you wish to be split. For example, doing _d_s will remove all rolled down jumpsuits.","Split Criteria", "") - world << "Your split criteria is [user_input]" + to_chat(world, "Your split criteria is [user_input]") for(var/OriginalState in icon_states(DMIToSplit)) if(findtext(OriginalState, user_input)) diff --git a/tools/Redirector/Redirector.dm b/tools/Redirector/Redirector.dm index 9cf5f57f7a9..c3b013da241 100644 --- a/tools/Redirector/Redirector.dm +++ b/tools/Redirector/Redirector.dm @@ -36,7 +36,7 @@ mob/Login() var/list/servers = list() for(var/x in global.servers) - world << "[x] [servernames[ global.servers.Find(x) ]]" + to_chat(world, "[x] [servernames[ global.servers.Find(x) ]]") var/info = world.Export("[x]?status") var/datum/server/S = new()