|
8 | 8 |
|
9 | 9 | /obj/structure/synthesized_instrument/New()
|
10 | 10 | ..()
|
11 |
| - src.maximum_lines = global.musical_config.max_lines |
12 |
| - src.maximum_line_length = global.musical_config.max_line_length |
| 11 | + maximum_lines = global.musical_config.max_lines |
| 12 | + maximum_line_length = global.musical_config.max_line_length |
13 | 13 |
|
14 | 14 |
|
15 | 15 | /obj/structure/synthesized_instrument/Destroy()
|
16 |
| - qdel(src.player) |
| 16 | + qdel(player) |
17 | 17 | ..()
|
18 | 18 |
|
19 | 19 |
|
20 | 20 | /obj/structure/synthesized_instrument/attack_hand(mob/user)
|
21 |
| - src.interact(user) |
| 21 | + interact(user) |
22 | 22 |
|
23 | 23 |
|
24 | 24 | /obj/structure/synthesized_instrument/interact(mob/user) // CONDITIONS ..(user) that shit in subclasses
|
25 |
| - src.ui_interact(user) |
| 25 | + ui_interact(user) |
26 | 26 |
|
27 | 27 |
|
28 | 28 | /obj/structure/synthesized_instrument/ui_interact(mob/user)
|
|
43 | 43 | to_chat(usr, "Non-numeric value was given")
|
44 | 44 | return 0
|
45 | 45 |
|
46 |
| - src.add_fingerprint(usr) |
| 46 | + add_fingerprint(usr) |
47 | 47 |
|
48 | 48 | switch (target)
|
49 |
| - if ("tempo") src.player.song.tempo = src.player.song.sanitize_tempo(src.player.song.tempo + value*world.tick_lag) |
| 49 | + if ("tempo") player.song.tempo = player.song.sanitize_tempo(player.song.tempo + value*world.tick_lag) |
50 | 50 | if ("play")
|
51 |
| - src.player.song.playing = value |
52 |
| - if (src.player.song.playing) |
53 |
| - src.player.song.play_song(usr) |
| 51 | + player.song.playing = value |
| 52 | + if (player.song.playing) |
| 53 | + player.song.play_song(usr) |
54 | 54 | if ("newsong")
|
55 |
| - src.player.song.lines.Cut() |
56 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) // default 120 BPM |
| 55 | + player.song.lines.Cut() |
| 56 | + player.song.tempo = player.song.sanitize_tempo(5) // default 120 BPM |
57 | 57 | if ("import")
|
58 | 58 | var/t = ""
|
59 | 59 | do
|
60 | 60 | t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
|
61 | 61 | if(!in_range(src, usr))
|
62 | 62 | return
|
63 | 63 |
|
64 |
| - if(length(t) >= 2*src.maximum_lines*src.maximum_line_length) |
| 64 | + if(length(t) >= 2*maximum_lines*maximum_line_length) |
65 | 65 | var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
|
66 | 66 | if(cont == "no")
|
67 | 67 | break
|
68 |
| - while(length(t) > 2*src.maximum_lines*src.maximum_line_length) |
| 68 | + while(length(t) > 2*maximum_lines*maximum_line_length) |
69 | 69 | if (length(t))
|
70 |
| - src.player.song.lines = splittext(t, "\n") |
71 |
| - if(copytext(src.player.song.lines[1],1,6) == "BPM: ") |
72 |
| - if(text2num(copytext(src.player.song.lines[1],6)) != 0) |
73 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(600 / text2num(copytext(src.player.song.lines[1],6))) |
74 |
| - src.player.song.lines.Cut(1,2) |
| 70 | + player.song.lines = splittext(t, "\n") |
| 71 | + if(copytext(player.song.lines[1],1,6) == "BPM: ") |
| 72 | + if(text2num(copytext(player.song.lines[1],6)) != 0) |
| 73 | + player.song.tempo = player.song.sanitize_tempo(600 / text2num(copytext(player.song.lines[1],6))) |
| 74 | + player.song.lines.Cut(1,2) |
75 | 75 | else
|
76 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) |
| 76 | + player.song.tempo = player.song.sanitize_tempo(5) |
77 | 77 | else
|
78 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) // default 120 BPM |
79 |
| - if(src.player.song.lines.len > maximum_lines) |
| 78 | + player.song.tempo = player.song.sanitize_tempo(5) // default 120 BPM |
| 79 | + if(player.song.lines.len > maximum_lines) |
80 | 80 | to_chat(usr,"Too many lines!")
|
81 |
| - src.player.song.lines.Cut(maximum_lines+1) |
| 81 | + player.song.lines.Cut(maximum_lines+1) |
82 | 82 | var/linenum = 1
|
83 |
| - for(var/l in src.player.song.lines) |
| 83 | + for(var/l in player.song.lines) |
84 | 84 | if(length(l) > maximum_line_length)
|
85 | 85 | to_chat(usr, "Line [linenum] too long!")
|
86 |
| - src.player.song.lines.Remove(l) |
| 86 | + player.song.lines.Remove(l) |
87 | 87 | else
|
88 | 88 | linenum++
|
89 | 89 | else
|
|
103 | 103 |
|
104 | 104 | /obj/item/device/synthesized_instrument/New()
|
105 | 105 | ..()
|
106 |
| - src.maximum_lines = global.musical_config.max_lines |
107 |
| - src.maximum_line_length = global.musical_config.max_line_length |
| 106 | + maximum_lines = global.musical_config.max_lines |
| 107 | + maximum_line_length = global.musical_config.max_line_length |
108 | 108 |
|
109 | 109 |
|
110 | 110 | /obj/item/device/synthesized_instrument/Destroy()
|
111 |
| - qdel(src.player) |
| 111 | + qdel(player) |
112 | 112 | ..()
|
113 | 113 |
|
114 | 114 |
|
115 | 115 | /obj/item/device/synthesized_instrument/attack_hand(mob/user)
|
116 |
| - src.interact(user) |
| 116 | + interact(user) |
117 | 117 |
|
118 | 118 |
|
119 | 119 | /obj/item/device/synthesized_instrument/interact(mob/user) // CONDITIONS ..(user) that shit in subclasses
|
120 |
| - src.ui_interact(user) |
| 120 | + ui_interact(user) |
121 | 121 |
|
122 | 122 | /obj/item/device/synthesized_instrument/ui_interact(mob/user)
|
123 | 123 | return 0
|
|
137 | 137 | to_chat(usr, "Non-numeric value was given")
|
138 | 138 | return 0
|
139 | 139 |
|
140 |
| - src.add_fingerprint(usr) |
| 140 | + add_fingerprint(usr) |
141 | 141 |
|
142 | 142 | switch (target)
|
143 |
| - if ("tempo") src.player.song.tempo = src.player.song.sanitize_tempo(src.player.song.tempo + value*world.tick_lag) |
| 143 | + if ("tempo") player.song.tempo = player.song.sanitize_tempo(player.song.tempo + value*world.tick_lag) |
144 | 144 | if ("play")
|
145 |
| - src.player.song.playing = value |
146 |
| - if (src.player.song.playing) |
147 |
| - src.player.song.play_song(usr) |
| 145 | + player.song.playing = value |
| 146 | + if (player.song.playing) |
| 147 | + player.song.play_song(usr) |
148 | 148 | if ("newsong")
|
149 |
| - src.player.song.lines.Cut() |
150 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) // default 120 BPM |
| 149 | + player.song.lines.Cut() |
| 150 | + player.song.tempo = player.song.sanitize_tempo(5) // default 120 BPM |
151 | 151 | if ("import")
|
152 | 152 | var/t = ""
|
153 | 153 | do
|
154 | 154 | t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
|
155 | 155 | if(!in_range(src, usr))
|
156 | 156 | return
|
157 | 157 |
|
158 |
| - if(length(t) >= 2*src.maximum_lines*src.maximum_line_length) |
| 158 | + if(length(t) >= 2*maximum_lines*maximum_line_length) |
159 | 159 | var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
|
160 | 160 | if(cont == "no")
|
161 | 161 | break
|
162 |
| - while(length(t) > 2*src.maximum_lines*src.maximum_line_length) |
| 162 | + while(length(t) > 2*maximum_lines*maximum_line_length) |
163 | 163 | if (length(t))
|
164 |
| - src.player.song.lines = splittext(t, "\n") |
165 |
| - if(copytext(src.player.song.lines[1],1,6) == "BPM: ") |
166 |
| - if(text2num(copytext(src.player.song.lines[1],6)) != 0) |
167 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(600 / text2num(copytext(src.player.song.lines[1],6))) |
168 |
| - src.player.song.lines.Cut(1,2) |
| 164 | + player.song.lines = splittext(t, "\n") |
| 165 | + if(copytext(player.song.lines[1],1,6) == "BPM: ") |
| 166 | + if(text2num(copytext(player.song.lines[1],6)) != 0) |
| 167 | + player.song.tempo = player.song.sanitize_tempo(600 / text2num(copytext(player.song.lines[1],6))) |
| 168 | + player.song.lines.Cut(1,2) |
169 | 169 | else
|
170 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) |
| 170 | + player.song.tempo = player.song.sanitize_tempo(5) |
171 | 171 | else
|
172 |
| - src.player.song.tempo = src.player.song.sanitize_tempo(5) // default 120 BPM |
173 |
| - if(src.player.song.lines.len > maximum_lines) |
| 172 | + player.song.tempo = player.song.sanitize_tempo(5) // default 120 BPM |
| 173 | + if(player.song.lines.len > maximum_lines) |
174 | 174 | to_chat(usr, "Too many lines!")
|
175 |
| - src.player.song.lines.Cut(maximum_lines+1) |
| 175 | + player.song.lines.Cut(maximum_lines+1) |
176 | 176 | var/linenum = 1
|
177 |
| - for(var/l in src.player.song.lines) |
| 177 | + for(var/l in player.song.lines) |
178 | 178 | if(length(l) > maximum_line_length)
|
179 | 179 | to_chat(usr, "Line [linenum] too long!")
|
180 |
| - src.player.song.lines.Remove(l) |
| 180 | + player.song.lines.Remove(l) |
181 | 181 | else
|
182 | 182 | linenum++
|
183 | 183 | else
|
|
0 commit comments