ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/info.C
(Generate patch)

Comparing deliantra/server/socket/info.C (file contents):
Revision 1.5 by root, Sun Sep 10 13:43:33 2006 UTC vs.
Revision 1.10 by root, Tue Sep 19 10:21:58 2006 UTC

1
2/*
3 * static char *rcsid_sock_info_c =
4 * "$Id: info.C,v 1.5 2006/09/10 13:43:33 root Exp $";
5 */
6 1
7/* 2/*
8 CrossFire, A Multiplayer game for X-windows 3 CrossFire, A Multiplayer game for X-windows
9 4
10 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
22 17
23 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 21
27 The authors can be reached via e-mail at crossfire-devel@real-time.com 22 The authors can be reached via e-mail at <crossfire@schmorp.de>
28*/ 23*/
29 24
30/** 25/**
31 * \file 26 * \file
32 * Basic client output functions. 27 * Basic client output functions.
355/** 350/**
356 * Writes to everyone on the map *except* op. This is useful for emotions. 351 * Writes to everyone on the map *except* op. This is useful for emotions.
357 */ 352 */
358 353
359void 354void
360new_info_map_except (int color, mapstruct *map, object *op, const char *str) 355new_info_map_except (int color, maptile * map, object *op, const char *str)
361{ 356{
362 player *pl; 357 player *pl;
363 358
364 for (pl = first_player; pl != NULL; pl = pl->next) 359 for (pl = first_player; pl != NULL; pl = pl->next)
365 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) 360 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op)
371/** 366/**
372 * Writes to everyone on the map except op1 and op2 367 * Writes to everyone on the map except op1 and op2
373 */ 368 */
374 369
375void 370void
376new_info_map_except2 (int color, mapstruct *map, object *op1, object *op2, const char *str) 371new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str)
377{ 372{
378 player *pl; 373 player *pl;
379 374
380 for (pl = first_player; pl != NULL; pl = pl->next) 375 for (pl = first_player; pl != NULL; pl = pl->next)
381 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) 376 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2)
387/** 382/**
388 * Writes to everyone on the specified map 383 * Writes to everyone on the specified map
389 */ 384 */
390 385
391void 386void
392new_info_map (int color, mapstruct *map, const char *str) 387new_info_map (int color, maptile * map, const char *str)
393{ 388{
394 player *pl; 389 player *pl;
395 390
396 for (pl = first_player; pl != NULL; pl = pl->next) 391 for (pl = first_player; pl != NULL; pl = pl->next)
397 if (pl->ob != NULL && pl->ob->map == map) 392 if (pl->ob != NULL && pl->ob->map == map)
417void 412void
418rangetostring (object *pl, char *obuf) 413rangetostring (object *pl, char *obuf)
419{ 414{
420 switch (pl->contr->shoottype) 415 switch (pl->contr->shoottype)
421 { 416 {
422 case range_none: 417 case range_none:
423 strcpy (obuf, "Range: nothing"); 418 strcpy (obuf, "Range: nothing");
424 break; 419 break;
425 420
426 case range_bow: 421 case range_bow:
422 {
423 object *op;
424
425 for (op = pl->inv; op; op = op->below)
426 if (op->type == BOW && QUERY_FLAG (op, FLAG_APPLIED))
427 break;
428
429 if (op == NULL)
430 break;
431
432 sprintf (obuf, "Range: %s (%s)", query_base_name (op, 0), op->race ? (const char *) op->race : "nothing");
433 }
434 break;
435
436 case range_magic:
437 if (settings.casting_time == TRUE)
427 { 438 {
428 object *op; 439 if (pl->casting_time > -1)
429 440 {
430 for (op = pl->inv; op; op = op->below) 441 if (pl->casting_time == 0)
431 if (op->type == BOW && QUERY_FLAG (op, FLAG_APPLIED)) 442 sprintf (obuf, "Range: Holding spell (%s)", &pl->spell->name);
432 break; 443 else
433 if (op == NULL) 444 sprintf (obuf, "Range: Casting spell (%s)", &pl->spell->name);
434 break; 445 }
435 446 else
436 sprintf (obuf, "Range: %s (%s)", query_base_name (op, 0), op->race ? (const char *) op->race : "nothing"); 447 sprintf (obuf, "Range: spell (%s)", &pl->contr->ranges[range_magic]->name);
437 } 448 }
438 break;
439
440 case range_magic:
441 if (settings.casting_time == TRUE)
442 {
443 if (pl->casting_time > -1)
444 {
445 if (pl->casting_time == 0)
446 sprintf (obuf, "Range: Holding spell (%s)", (const char *) pl->spell->name);
447 else
448 sprintf (obuf, "Range: Casting spell (%s)", (const char *) pl->spell->name);
449 }
450 else
451 sprintf (obuf, "Range: spell (%s)", &pl->contr->ranges[range_magic]->name);
452 }
453 else 449 else
454 sprintf (obuf, "Range: spell (%s)", &pl->contr->ranges[range_magic]->name); 450 sprintf (obuf, "Range: spell (%s)", &pl->contr->ranges[range_magic]->name);
455 break; 451 break;
456 452
457 case range_misc: 453 case range_misc:
458 sprintf (obuf, "Range: %s", pl->contr->ranges[range_misc] ? query_base_name (pl->contr->ranges[range_misc], 0) : "none"); 454 sprintf (obuf, "Range: %s", pl->contr->ranges[range_misc] ? query_base_name (pl->contr->ranges[range_misc], 0) : "none");
459 break; 455 break;
460 456
461 /* range_scroll is only used for controlling golems. If the 457 /* range_scroll is only used for controlling golems. If the
462 * the player does not have a golem, reset some things. 458 * the player does not have a golem, reset some things.
463 */ 459 */
464 case range_golem: 460 case range_golem:
465 if (pl->contr->ranges[range_golem] != NULL) 461 if (pl->contr->ranges[range_golem] != NULL)
466 sprintf (obuf, "Range: golem (%s)", &pl->contr->ranges[range_golem]->name); 462 sprintf (obuf, "Range: golem (%s)", &pl->contr->ranges[range_golem]->name);
467 else 463 else
468 { 464 {
469 pl->contr->shoottype = range_none; 465 pl->contr->shoottype = range_none;
470 strcpy (obuf, "Range: nothing"); 466 strcpy (obuf, "Range: nothing");
471 } 467 }
472 break; 468 break;
473 469
474 case range_skill: 470 case range_skill:
475 sprintf (obuf, "Skill: %s", pl->chosen_skill != NULL ? (const char *) pl->chosen_skill->name : "none"); 471 sprintf (obuf, "Skill: %s", pl->chosen_skill != NULL ? (const char *) pl->chosen_skill->name : "none");
476 break; 472 break;
477 473
478 case range_builder: 474 case range_builder:
479 sprintf (obuf, "Builder: %s", query_base_name (pl->contr->ranges[range_builder], 0)); 475 sprintf (obuf, "Builder: %s", query_base_name (pl->contr->ranges[range_builder], 0));
480 break; 476 break;
481 477
482 default: 478 default:
483 strcpy (obuf, "Range: illegal"); 479 strcpy (obuf, "Range: illegal");
484 } 480 }
485} 481}
486 482
487/** 483/**
488 * Sets player title. 484 * Sets player title.
512static void 508static void
513magic_mapping_mark_recursive (object *pl, char *map_mark, int px, int py) 509magic_mapping_mark_recursive (object *pl, char *map_mark, int px, int py)
514{ 510{
515 int x, y, dx, dy, mflags; 511 int x, y, dx, dy, mflags;
516 sint16 nx, ny; 512 sint16 nx, ny;
517 mapstruct *mp; 513 maptile *mp;
518 New_Face *f; 514 New_Face *f;
519 515
520 for (dx = -1; dx <= 1; dx++) 516 for (dx = -1; dx <= 1; dx++)
521 { 517 {
522 for (dy = -1; dy <= 1; dy++) 518 for (dy = -1; dy <= 1; dy++)
578void 574void
579magic_mapping_mark (object *pl, char *map_mark, int strength) 575magic_mapping_mark (object *pl, char *map_mark, int strength)
580{ 576{
581 int x, y, mflags; 577 int x, y, mflags;
582 sint16 nx, ny; 578 sint16 nx, ny;
583 mapstruct *mp; 579 maptile *mp;
584 New_Face *f; 580 New_Face *f;
585 581
586 for (x = -strength; x < strength; x++) 582 for (x = -strength; x < strength; x++)
587 { 583 {
588 for (y = -strength; y < strength; y++) 584 for (y = -strength; y < strength; y++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines