… | |
… | |
461 | if (op->flag [FLAG_WIZ]) |
461 | if (op->flag [FLAG_WIZ]) |
462 | new_draw_info (NDI_UNIQUE, 0, op, "Your mortal self is blinded."); |
462 | new_draw_info (NDI_UNIQUE, 0, op, "Your mortal self is blinded."); |
463 | else |
463 | else |
464 | { |
464 | { |
465 | new_draw_info (NDI_UNIQUE, 0, op, "You are blinded."); |
465 | new_draw_info (NDI_UNIQUE, 0, op, "You are blinded."); |
466 | SET_FLAG (op, FLAG_BLIND); |
466 | op->set_flag (FLAG_BLIND); |
467 | if (op->type == PLAYER) |
467 | if (op->type == PLAYER) |
468 | op->contr->do_los = 1; |
468 | op->contr->do_los = 1; |
469 | } |
469 | } |
470 | } |
470 | } |
471 | else |
471 | else |
… | |
… | |
473 | if (op->flag [FLAG_WIZ]) |
473 | if (op->flag [FLAG_WIZ]) |
474 | new_draw_info (NDI_UNIQUE, 0, op, "Your mortal self can now see again."); |
474 | new_draw_info (NDI_UNIQUE, 0, op, "Your mortal self can now see again."); |
475 | else |
475 | else |
476 | { |
476 | { |
477 | new_draw_info (NDI_UNIQUE, 0, op, "Your vision returns."); |
477 | new_draw_info (NDI_UNIQUE, 0, op, "Your vision returns."); |
478 | CLEAR_FLAG (op, FLAG_BLIND); |
478 | op->clr_flag (FLAG_BLIND); |
479 | if (op->type == PLAYER) |
479 | if (op->type == PLAYER) |
480 | op->contr->do_los = 1; |
480 | op->contr->do_los = 1; |
481 | } |
481 | } |
482 | } |
482 | } |
483 | } |
483 | } |
… | |
… | |
610 | |
610 | |
611 | if (!tmp) |
611 | if (!tmp) |
612 | { |
612 | { |
613 | tmp = at->instance (); |
613 | tmp = at->instance (); |
614 | tmp = insert_ob_in_ob (tmp, this); |
614 | tmp = insert_ob_in_ob (tmp, this); |
615 | SET_FLAG (tmp, FLAG_APPLIED); |
615 | tmp->set_flag (FLAG_APPLIED); |
616 | } |
616 | } |
617 | } |
617 | } |
618 | |
618 | |
619 | new_draw_info (NDI_UNIQUE, 0, this, drain_msg[deplete_stats]); |
619 | new_draw_info (NDI_UNIQUE, 0, this, drain_msg[deplete_stats]); |
620 | change_attr_value (&tmp->stats, deplete_stats, -1); |
620 | change_attr_value (&tmp->stats, deplete_stats, -1); |
… | |
… | |
640 | if (!value) |
640 | if (!value) |
641 | return; |
641 | return; |
642 | |
642 | |
643 | tmp = at->instance (); |
643 | tmp = at->instance (); |
644 | tmp = insert_ob_in_ob (tmp, this); |
644 | tmp = insert_ob_in_ob (tmp, this); |
645 | SET_FLAG (tmp, FLAG_APPLIED); |
645 | tmp->set_flag (FLAG_APPLIED); |
646 | } |
646 | } |
647 | |
647 | |
648 | if (value) |
648 | if (value) |
649 | { |
649 | { |
650 | /* Limit the luck value of the bad luck object to +/-100. This |
650 | /* Limit the luck value of the bad luck object to +/-100. This |
… | |
… | |
767 | for (int i = NUM_BODY_LOCATIONS; i--; ) |
767 | for (int i = NUM_BODY_LOCATIONS; i--; ) |
768 | slot[i].used = slot[i].info; |
768 | slot[i].used = slot[i].info; |
769 | |
769 | |
770 | slaying = 0; |
770 | slaying = 0; |
771 | |
771 | |
772 | if (!QUERY_FLAG (this, FLAG_WIZ)) |
772 | if (!this->flag [FLAG_WIZ]) |
773 | { |
|
|
774 | CLEAR_FLAG (this, FLAG_XRAYS); |
|
|
775 | CLEAR_FLAG (this, FLAG_MAKE_INVIS); |
|
|
776 | } |
773 | { |
|
|
774 | this->clr_flag (FLAG_XRAYS); |
|
|
775 | this->clr_flag (FLAG_MAKE_INVIS); |
|
|
776 | } |
777 | |
777 | |
778 | CLEAR_FLAG (this, FLAG_LIFESAVE); |
778 | this->clr_flag (FLAG_LIFESAVE); |
779 | CLEAR_FLAG (this, FLAG_STEALTH); |
779 | this->clr_flag (FLAG_STEALTH); |
780 | CLEAR_FLAG (this, FLAG_BLIND); |
780 | this->clr_flag (FLAG_BLIND); |
781 | |
781 | |
782 | if (!QUERY_FLAG (arch, FLAG_REFL_SPELL )) CLEAR_FLAG (this, FLAG_REFL_SPELL); |
782 | if (!arch->flag [FLAG_REFL_SPELL ]) this->clr_flag (FLAG_REFL_SPELL); |
783 | if (!QUERY_FLAG (arch, FLAG_REFL_MISSILE)) CLEAR_FLAG (this, FLAG_REFL_MISSILE); |
783 | if (!arch->flag [FLAG_REFL_MISSILE]) this->clr_flag (FLAG_REFL_MISSILE); |
784 | if (!QUERY_FLAG (arch, FLAG_UNDEAD )) CLEAR_FLAG (this, FLAG_UNDEAD); |
784 | if (!arch->flag [FLAG_UNDEAD ]) this->clr_flag (FLAG_UNDEAD); |
785 | if (!QUERY_FLAG (arch, FLAG_SEE_IN_DARK )) CLEAR_FLAG (this, FLAG_SEE_IN_DARK); |
785 | if (!arch->flag [FLAG_SEE_IN_DARK ]) this->clr_flag (FLAG_SEE_IN_DARK); |
786 | |
786 | |
787 | path_attuned = arch->path_attuned; |
787 | path_attuned = arch->path_attuned; |
788 | path_repelled = arch->path_repelled; |
788 | path_repelled = arch->path_repelled; |
789 | path_denied = arch->path_denied; |
789 | path_denied = arch->path_denied; |
790 | glow_radius = arch->glow_radius; |
790 | glow_radius = arch->glow_radius; |
… | |
… | |
813 | * the fact that maxlevel is factored in could be considered sort of bogus - |
813 | * the fact that maxlevel is factored in could be considered sort of bogus - |
814 | * we should probably give them some bonus and cap it off - otherwise, |
814 | * we should probably give them some bonus and cap it off - otherwise, |
815 | * basically, if a server updates its max level, these playes may find |
815 | * basically, if a server updates its max level, these playes may find |
816 | * that their protection from physical goes down |
816 | * that their protection from physical goes down |
817 | */ |
817 | */ |
818 | if (!QUERY_FLAG (this, FLAG_USE_ARMOUR) && type == PLAYER) |
818 | if (!this->flag [FLAG_USE_ARMOUR] && type == PLAYER) |
819 | { |
819 | { |
820 | ac = max (-10, arch->stats.ac - level / 3); |
820 | ac = max (-10, arch->stats.ac - level / 3); |
821 | prot[ATNR_PHYSICAL] += ((100 - prot[AT_PHYSICAL]) * (80 * level / settings.max_level)) / 100; |
821 | prot[ATNR_PHYSICAL] += ((100 - prot[AT_PHYSICAL]) * (80 * level / settings.max_level)) / 100; |
822 | } |
822 | } |
823 | else |
823 | else |
… | |
… | |
835 | { |
835 | { |
836 | /* This happens because apply_potion calls change_abil with the potion |
836 | /* This happens because apply_potion calls change_abil with the potion |
837 | * applied so we can tell the player what changed. But change_abil |
837 | * applied so we can tell the player what changed. But change_abil |
838 | * then calls this function. |
838 | * then calls this function. |
839 | */ |
839 | */ |
840 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->type == POTION) |
840 | if (tmp->flag [FLAG_APPLIED] && tmp->type == POTION) |
841 | continue; |
841 | continue; |
842 | |
842 | |
843 | glow_radius += tmp->glow_radius; |
843 | glow_radius += tmp->glow_radius; |
844 | |
844 | |
845 | /* For some things, we don't care what is equipped */ |
845 | /* For some things, we don't care what is equipped */ |
… | |
… | |
934 | stats.luck += tmp->stats.luck; |
934 | stats.luck += tmp->stats.luck; |
935 | } |
935 | } |
936 | |
936 | |
937 | flag |= tmp->flag & copy_flags; |
937 | flag |= tmp->flag & copy_flags; |
938 | |
938 | |
939 | if (QUERY_FLAG (tmp, FLAG_UNDEAD) && !QUERY_FLAG (arch, FLAG_UNDEAD)) |
939 | if (tmp->flag [FLAG_UNDEAD] && !arch->flag [FLAG_UNDEAD]) |
940 | SET_FLAG (this, FLAG_UNDEAD); |
940 | this->set_flag (FLAG_UNDEAD); |
941 | |
941 | |
942 | //TODO: copy_flags? |
942 | //TODO: copy_flags? |
943 | if (QUERY_FLAG (tmp, FLAG_MAKE_INVIS)) |
943 | if (tmp->flag [FLAG_MAKE_INVIS]) |
944 | { |
944 | { |
945 | SET_FLAG (this, FLAG_MAKE_INVIS); |
945 | this->set_flag (FLAG_MAKE_INVIS); |
946 | invisible = 1; |
946 | invisible = 1; |
947 | } |
947 | } |
948 | |
948 | |
949 | if (tmp->stats.exp && tmp->type != SKILL) |
949 | if (tmp->stats.exp && tmp->type != SKILL) |
950 | { |
950 | { |
… | |
… | |
977 | |
977 | |
978 | chosen_skill = tmp; |
978 | chosen_skill = tmp; |
979 | |
979 | |
980 | if (tmp->stats.dam > 0) |
980 | if (tmp->stats.dam > 0) |
981 | { /* skill is a 'weapon' */ |
981 | { /* skill is a 'weapon' */ |
982 | if (!QUERY_FLAG (this, FLAG_READY_WEAPON)) |
982 | if (!this->flag [FLAG_READY_WEAPON]) |
983 | weapon_speed = max (0, WEAPON_SPEED (tmp)); |
983 | weapon_speed = max (0, WEAPON_SPEED (tmp)); |
984 | |
984 | |
985 | weapon_weight = tmp->weight; |
985 | weapon_weight = tmp->weight; |
986 | stats.dam += 1 + chosen_skill->level * tmp->stats.dam / 9; |
986 | stats.dam += 1 + chosen_skill->level * tmp->stats.dam / 9; |
987 | |
987 | |
… | |
… | |
1525 | } |
1525 | } |
1526 | |
1526 | |
1527 | /* clear the flag - exp goes into this bucket, but player |
1527 | /* clear the flag - exp goes into this bucket, but player |
1528 | * still doesn't know it. |
1528 | * still doesn't know it. |
1529 | */ |
1529 | */ |
1530 | CLEAR_FLAG (skill_obj, FLAG_CAN_USE_SKILL); |
1530 | skill_obj->clr_flag (FLAG_CAN_USE_SKILL); |
1531 | skill_obj->stats.exp = 0; |
1531 | skill_obj->stats.exp = 0; |
1532 | skill_obj->level = 1; |
1532 | skill_obj->level = 1; |
1533 | op->insert (skill_obj); |
1533 | op->insert (skill_obj); |
1534 | |
1534 | |
1535 | if (player *pl = op->contr) |
1535 | if (player *pl = op->contr) |
… | |
… | |
1848 | * worth. |
1848 | * worth. |
1849 | */ |
1849 | */ |
1850 | if (op->type != PLAYER) |
1850 | if (op->type != PLAYER) |
1851 | { |
1851 | { |
1852 | /* Sanity check */ |
1852 | /* Sanity check */ |
1853 | if (!QUERY_FLAG (op, FLAG_ALIVE)) |
1853 | if (!op->flag [FLAG_ALIVE]) |
1854 | return; |
1854 | return; |
1855 | |
1855 | |
1856 | /* reset exp to max allowed value. We subtract from |
1856 | /* reset exp to max allowed value. We subtract from |
1857 | * MAX_EXPERIENCE to prevent overflows. If the player somehow has |
1857 | * MAX_EXPERIENCE to prevent overflows. If the player somehow has |
1858 | * more than max exp, just return. |
1858 | * more than max exp, just return. |