… | |
… | |
150 | * |
150 | * |
151 | * If message is black, and not NDI_UNIQUE, gets sent through output buffers. |
151 | * If message is black, and not NDI_UNIQUE, gets sent through output buffers. |
152 | * |
152 | * |
153 | */ |
153 | */ |
154 | void |
154 | void |
155 | new_draw_info (int flags, int pri, const object *pl, const char *buf) |
155 | new_draw_info (int flags, int pri, const object *op, const char *buf) |
156 | { |
156 | { |
157 | if (flags & NDI_ALL) |
157 | if (flags & NDI_ALL) |
158 | { |
|
|
159 | for_all_players (pl) |
158 | for_all_players (pl) |
160 | new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf); |
159 | new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf); |
161 | |
160 | else |
|
|
161 | { |
|
|
162 | if (!op || !op->contr || !op->contr->ns) |
162 | return; |
163 | return; |
163 | } |
|
|
164 | |
164 | |
165 | if (!pl || pl->type != PLAYER || !pl->contr || !pl->contr->ns) |
|
|
166 | return; |
|
|
167 | |
|
|
168 | if (pri >= pl->contr->listening) |
165 | if (pri >= op->contr->listening) |
169 | return; |
166 | return; |
170 | |
167 | |
171 | if ((flags & (NDI_COLOR_MASK | NDI_UNIQUE)) != NDI_BLACK |
168 | if ((flags & (NDI_COLOR_MASK | NDI_UNIQUE)) != NDI_BLACK |
172 | || !pl->contr->ns->msg_suppressed (buf)) |
169 | || !op->contr->ns->msg_suppressed (buf)) |
173 | print_message (flags & NDI_COLOR_MASK, pl, buf); |
170 | print_message (flags & NDI_COLOR_MASK, op, buf); |
|
|
171 | } |
174 | } |
172 | } |
175 | |
173 | |
176 | /** |
174 | /** |
177 | * Wrapper for new_draw_info printf-like. |
175 | * Wrapper for new_draw_info printf-like. |
178 | * |
176 | * |
… | |
… | |
298 | * to handle this |
296 | * to handle this |
299 | */ |
297 | */ |
300 | void |
298 | void |
301 | clear_win_info (object *op) |
299 | clear_win_info (object *op) |
302 | { |
300 | { |
303 | } |
|
|
304 | |
|
|
305 | /** |
|
|
306 | * Get player's current range attack in obuf. |
|
|
307 | */ |
|
|
308 | void |
|
|
309 | rangetostring (object *pl, char *obuf) |
|
|
310 | { |
|
|
311 | switch (pl->contr->shoottype) |
|
|
312 | { |
|
|
313 | case range_bow: |
|
|
314 | for (object *op = pl->inv; op; op = op->below) |
|
|
315 | if (op->type == BOW && QUERY_FLAG (op, FLAG_APPLIED)) |
|
|
316 | { |
|
|
317 | sprintf (obuf, "Range: %s (%s)", query_base_name (op, 0), op->race ? &op->race : "nothing"); |
|
|
318 | return; |
|
|
319 | } |
|
|
320 | |
|
|
321 | break; |
|
|
322 | |
|
|
323 | case range_magic: |
|
|
324 | if (settings.casting_time == TRUE) |
|
|
325 | { |
|
|
326 | if (pl->casting_time > -1) |
|
|
327 | { |
|
|
328 | if (pl->casting_time == 0) |
|
|
329 | sprintf (obuf, "Holding spell: %s", &pl->spell->name); |
|
|
330 | else |
|
|
331 | sprintf (obuf, "Casting spell: %s", &pl->spell->name); |
|
|
332 | } |
|
|
333 | else |
|
|
334 | sprintf (obuf, "Spell: %s", &pl->contr->ranges[range_magic]->name); |
|
|
335 | } |
|
|
336 | else |
|
|
337 | sprintf (obuf, "Spell: %s", &pl->contr->ranges[range_magic]->name); |
|
|
338 | |
|
|
339 | return; |
|
|
340 | |
|
|
341 | case range_misc: |
|
|
342 | if (object *op = pl->contr->ranges[range_misc]) |
|
|
343 | { |
|
|
344 | sprintf (obuf, "Item: %s", query_base_name (op, 0)); |
|
|
345 | return; |
|
|
346 | } |
|
|
347 | |
|
|
348 | break; |
|
|
349 | |
|
|
350 | /* range_scroll is only used for controlling golems. If the |
|
|
351 | * the player does not have a golem, reset some things. |
|
|
352 | */ |
|
|
353 | case range_golem: |
|
|
354 | if (object *golem = pl->contr->ranges[range_golem]) |
|
|
355 | { |
|
|
356 | sprintf (obuf, "Golem: %s", &golem->name); |
|
|
357 | return; |
|
|
358 | } |
|
|
359 | |
|
|
360 | break; |
|
|
361 | |
|
|
362 | case range_skill: |
|
|
363 | if (object *op = pl->chosen_skill) |
|
|
364 | { |
|
|
365 | sprintf (obuf, "Skill: %s", &op->name); |
|
|
366 | return; |
|
|
367 | } |
|
|
368 | |
|
|
369 | break; |
|
|
370 | |
|
|
371 | case range_builder: |
|
|
372 | sprintf (obuf, "Builder: %s", query_base_name (pl->contr->ranges[range_builder], 0)); |
|
|
373 | return; |
|
|
374 | } |
|
|
375 | |
|
|
376 | pl->contr->shoottype = range_none; |
|
|
377 | strcpy (obuf, "Range: nothing"); |
|
|
378 | } |
301 | } |
379 | |
302 | |
380 | /** |
303 | /** |
381 | * Sets player title. |
304 | * Sets player title. |
382 | */ |
305 | */ |