… | |
… | |
569 | } |
569 | } |
570 | |
570 | |
571 | int |
571 | int |
572 | perceive_self (object *op) |
572 | perceive_self (object *op) |
573 | { |
573 | { |
574 | char buf[MAX_BUF]; |
|
|
575 | const char *cp = describe_item (op, op); |
574 | const char *cp = describe_item (op, op); |
576 | archetype *at = archetype::find (ARCH_DEPLETION); |
575 | archetype *at = archetype::find (ARCH_DEPLETION); |
577 | object *tmp; |
|
|
578 | int i; |
|
|
579 | |
576 | |
|
|
577 | dynbuf_text buf; |
|
|
578 | |
|
|
579 | if (player *pl = op->contr) |
|
|
580 | if (object *race = archetype::find (op->race)) |
|
|
581 | buf << "You are a " << (pl->gender ? "female" : "male") << " " << &race->name << ".\n"; |
|
|
582 | |
580 | tmp = find_god (determine_god (op)); |
583 | if (object *god = find_god (determine_god (op))) |
581 | if (tmp) |
584 | buf << "You worship " << &god->name << ".\n"; |
582 | new_draw_info_format (NDI_UNIQUE, 0, op, "You worship %s", &tmp->name); |
|
|
583 | else |
585 | else |
584 | new_draw_info (NDI_UNIQUE, 0, op, "You worship no god"); |
586 | buf << "You worship no god.\n"; |
585 | |
587 | |
586 | tmp = present_arch_in_ob (at, op); |
588 | object *tmp = present_arch_in_ob (at, op); |
587 | |
589 | |
588 | if (*cp == '\0' && tmp == NULL) |
590 | if (*cp == '\0' && tmp == NULL) |
589 | new_draw_info (NDI_UNIQUE, 0, op, "You feel very mundane"); |
591 | buf << "You feel very mundane. "; |
590 | else |
592 | else |
591 | { |
593 | { |
592 | new_draw_info (NDI_UNIQUE, 0, op, "You have:"); |
594 | buf << "You have: " << cp << ".\n"; |
593 | new_draw_info (NDI_UNIQUE, 0, op, cp); |
|
|
594 | |
595 | |
595 | if (tmp) |
596 | if (tmp) |
596 | for (i = 0; i < NUM_STATS; i++) |
597 | for (int i = 0; i < NUM_STATS; i++) |
597 | if (tmp->stats.stat (i) < 0) |
598 | if (tmp->stats.stat (i) < 0) |
598 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s is depleted by %d", statname[i], -tmp->stats.stat (i)); |
599 | buf.printf ("Your %s is depleted by %d.\n", statname[i], -tmp->stats.stat (i)); |
599 | } |
600 | } |
600 | |
601 | |
601 | if (is_dragon_pl (op)) |
602 | if (is_dragon_pl (op)) |
602 | { |
|
|
603 | /* now grab the 'dragon_ability'-force from the player's inventory */ |
603 | /* now grab the 'dragon_ability'-force from the player's inventory */ |
604 | for (tmp = op->inv; tmp != NULL; tmp = tmp->below) |
604 | for (tmp = op->inv; tmp; tmp = tmp->below) |
605 | { |
605 | { |
606 | if (tmp->type == FORCE && !strcmp (tmp->arch->archname, "dragon_ability_force")) |
606 | if (tmp->type == FORCE && !strcmp (tmp->arch->archname, "dragon_ability_force")) |
607 | { |
607 | { |
608 | if (tmp->stats.exp == 0) |
608 | if (tmp->stats.exp == 0) |
609 | sprintf (buf, "Your metabolism isn't focused on anything."); |
609 | buf << "Your metabolism isn't focused on anything.\n"; |
610 | else |
610 | else |
611 | sprintf (buf, "Your metabolism is focused on %s.", change_resist_msg[tmp->stats.exp]); |
611 | buf << "Your metabolism is focused on " << change_resist_msg[tmp->stats.exp] << ".\n"; |
612 | |
612 | |
613 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
|
|
614 | break; |
613 | break; |
615 | } |
614 | } |
616 | } |
615 | } |
617 | } |
616 | |
|
|
617 | new_draw_info (NDI_UNIQUE, 0, op, buf.linearise ()); |
618 | |
618 | |
619 | return 1; |
619 | return 1; |
620 | } |
620 | } |
621 | |
621 | |
622 | /* This creates magic walls. Really, it can create most any object, |
622 | /* This creates magic walls. Really, it can create most any object, |