Address comments

This commit is contained in:
mochi
2020-07-20 06:59:40 +02:00
parent c60f8761fa
commit dd5c88eb74
9 changed files with 19 additions and 15 deletions
@@ -25,7 +25,7 @@
/obj/item/instrument/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
return BRUTELOSS
/obj/item/instrument/attack_self(mob/user)
if(!user.IsAdvancedToolUser())
@@ -170,7 +170,7 @@
w_class = WEIGHT_CLASS_TINY
force = 0
throw_speed = 3
throw_range = 15
throw_range = 7
hitsound = 'sound/items/bikehorn.ogg'
allowed_instrument_ids = "bikehorn"
+8 -4
View File
@@ -33,7 +33,7 @@
var/help = FALSE
/// Repeats left
var/repeat = 1
var/repeat = 0
/// Maximum times we can repeat
var/max_repeats = 10
@@ -135,7 +135,7 @@
tempo = sanitize_tempo(tempo)
src.parent = parent
if(instrument_ids)
allowed_instrument_ids = islist(instrument_ids)? instrument_ids : list(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()
@@ -274,7 +274,8 @@
* Converts a tempodiv to ticks to elapse before playing the next chord, taking into account our tempo.
*/
/datum/song/proc/tempodiv_to_delay(tempodiv)
return max(1, round((tempo/tempodiv) / world.tick_lag, 1))
tempodiv = tempodiv || world.tick_lag // Default to world.tick_lag in case someone's trying to be smart
return max(1, round((tempo / tempodiv) / world.tick_lag, 1))
/**
* Compiles chords.
@@ -340,7 +341,10 @@
/datum/song/proc/set_volume(volume)
src.volume = clamp(volume, max(0, min_volume), min(100, max_volume))
update_sustain()
SStgui.update_uis(parent)
// We don't want to send the whole payload (song included) just for volume
var/datum/tgui/ui = SStgui.get_open_ui(usr, parent, "main")
if(ui)
ui.push_data(list("volume" = volume), force = TRUE)
/**
* Setter for setting how low the volume has to get before a note is considered "dead" and dropped
+1 -2
View File
@@ -104,7 +104,7 @@
lines.Cut(num, num + 1)
return TRUE
if("modifyline")
var/num = round(text2num(params["line"]), 1)
var/num = round(text2num(params["line"]))
var/content = stripped_input(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS)
if(!content || !in_range(parent, usr))
return
@@ -122,7 +122,6 @@
return TRUE
if("setvolume")
set_volume(round(text2num(params["new"]), 1))
return TRUE
if("setdropoffvolume")
set_dropoff_volume(round(text2num(params["new"]), 0.01))
return TRUE