| 1702 | | char ch; |
|---|
| 1703 | | int i; |
|---|
| 1704 | | birther old_char; |
|---|
| 1705 | | byte old_hitdie; |
|---|
| 1706 | | u16b old_expfact; |
|---|
| 1707 | | s16b old_hp[PY_MAX_LEVEL]; |
|---|
| 1708 | | |
|---|
| 1709 | | old_hitdie = p_ptr->hitdie; |
|---|
| 1710 | | old_expfact = p_ptr->expfact; |
|---|
| 1711 | | |
|---|
| 1712 | | old_char.age = p_ptr->age; |
|---|
| 1713 | | old_char.au = p_ptr->au_birth; |
|---|
| 1714 | | old_char.ht = p_ptr->ht_birth; |
|---|
| 1715 | | old_char.wt = p_ptr->wt_birth; |
|---|
| 1716 | | old_char.sc = p_ptr->sc; |
|---|
| 1717 | | |
|---|
| 1718 | | /* Save the stats */ |
|---|
| 1719 | | for (i = 0; i < A_MAX; i++) |
|---|
| 1720 | | { |
|---|
| 1721 | | old_char.stat[i] = p_ptr->stat_birth[i]; |
|---|
| 1722 | | } |
|---|
| 1723 | | |
|---|
| 1724 | | /* Save the history */ |
|---|
| 1725 | | my_strcpy(old_char.history, p_ptr->history, sizeof(old_char.history)); |
|---|
| 1726 | | |
|---|
| 1727 | | /* Save the hp */ |
|---|
| 1728 | | for (i = 0; i < PY_MAX_LEVEL; i++) |
|---|
| 1729 | | { |
|---|
| 1730 | | old_hp[i] = p_ptr->player_hp[i]; |
|---|
| 1731 | | } |
|---|
| 1732 | | |
|---|
| 1733 | | /* Wipe the player */ |
|---|
| 1734 | | player_wipe(); |
|---|
| 1735 | | |
|---|
| 1736 | | /* Level one */ |
|---|
| 1737 | | p_ptr->max_lev = p_ptr->lev = 1; |
|---|
| 1738 | | |
|---|
| 1739 | | p_ptr->hitdie = old_hitdie; |
|---|
| 1740 | | p_ptr->expfact = old_expfact; |
|---|
| 1741 | | |
|---|
| 1742 | | p_ptr->age = old_char.age; |
|---|
| 1743 | | p_ptr->au_birth = p_ptr->au = old_char.au; |
|---|
| 1744 | | p_ptr->ht_birth = p_ptr->ht = old_char.ht; |
|---|
| 1745 | | p_ptr->wt_birth = p_ptr->wt = old_char.wt; |
|---|
| 1746 | | p_ptr->sc = old_char.sc; |
|---|
| 1747 | | |
|---|
| 1748 | | /* Load the stats */ |
|---|
| 1749 | | for (i = 0; i < A_MAX; i++) |
|---|
| 1750 | | { |
|---|
| 1751 | | p_ptr->stat_birth[i] = p_ptr->stat_cur[i] = p_ptr->stat_max[i] = old_char.stat[i]; |
|---|
| 1752 | | } |
|---|
| 1753 | | |
|---|
| 1754 | | /* Load the history */ |
|---|
| 1755 | | my_strcpy(p_ptr->history, old_char.history, sizeof(p_ptr->history)); |
|---|
| 1756 | | |
|---|
| 1757 | | /* Load the hp */ |
|---|
| 1758 | | for (i = 0; i < PY_MAX_LEVEL; i++) |
|---|
| 1759 | | { |
|---|
| 1760 | | p_ptr->player_hp[i] = old_hp[i]; |
|---|
| 1761 | | } |
|---|
| | 1702 | char ch; |
|---|
| | 1703 | int i; |
|---|
| | 1704 | birther old_char; |
|---|
| | 1705 | byte old_hitdie; |
|---|
| | 1706 | u16b old_expfact; |
|---|
| | 1707 | s16b old_hp[PY_MAX_LEVEL]; |
|---|
| | 1708 | |
|---|
| | 1709 | old_hitdie = p_ptr->hitdie; |
|---|
| | 1710 | old_expfact = p_ptr->expfact; |
|---|
| | 1711 | |
|---|
| | 1712 | old_char.age = p_ptr->age; |
|---|
| | 1713 | old_char.au = p_ptr->au_birth; |
|---|
| | 1714 | old_char.ht = p_ptr->ht_birth; |
|---|
| | 1715 | old_char.wt = p_ptr->wt_birth; |
|---|
| | 1716 | old_char.sc = p_ptr->sc; |
|---|
| | 1717 | |
|---|
| | 1718 | /* Save the stats */ |
|---|
| | 1719 | for (i = 0; i < A_MAX; i++) |
|---|
| | 1720 | { |
|---|
| | 1721 | old_char.stat[i] = p_ptr->stat_birth[i]; |
|---|
| | 1722 | } |
|---|
| | 1723 | |
|---|
| | 1724 | /* Save the history */ |
|---|
| | 1725 | my_strcpy(old_char.history, p_ptr->history, sizeof(old_char.history)); |
|---|
| | 1726 | |
|---|
| | 1727 | /* Save the hp */ |
|---|
| | 1728 | for (i = 0; i < PY_MAX_LEVEL; i++) |
|---|
| | 1729 | { |
|---|
| | 1730 | old_hp[i] = p_ptr->player_hp[i]; |
|---|
| | 1731 | } |
|---|
| | 1732 | |
|---|
| | 1733 | /* Wipe the player */ |
|---|
| | 1734 | player_wipe(); |
|---|
| | 1735 | |
|---|
| | 1736 | /* Level one */ |
|---|
| | 1737 | p_ptr->max_lev = p_ptr->lev = 1; |
|---|
| | 1738 | |
|---|
| | 1739 | p_ptr->hitdie = old_hitdie; |
|---|
| | 1740 | p_ptr->expfact = old_expfact; |
|---|
| | 1741 | |
|---|
| | 1742 | p_ptr->age = old_char.age; |
|---|
| | 1743 | p_ptr->au_birth = p_ptr->au = old_char.au; |
|---|
| | 1744 | p_ptr->ht_birth = p_ptr->ht = old_char.ht; |
|---|
| | 1745 | p_ptr->wt_birth = p_ptr->wt = old_char.wt; |
|---|
| | 1746 | p_ptr->sc = old_char.sc; |
|---|
| | 1747 | |
|---|
| | 1748 | /* Load the stats */ |
|---|
| | 1749 | for (i = 0; i < A_MAX; i++) |
|---|
| | 1750 | { |
|---|
| | 1751 | p_ptr->stat_birth[i] = p_ptr->stat_cur[i] = p_ptr->stat_max[i] = old_char.stat[i]; |
|---|
| | 1752 | } |
|---|
| | 1753 | |
|---|
| | 1754 | /* Load the history */ |
|---|
| | 1755 | my_strcpy(p_ptr->history, old_char.history, sizeof(p_ptr->history)); |
|---|
| | 1756 | |
|---|
| | 1757 | /* Load the hp */ |
|---|
| | 1758 | for (i = 0; i < PY_MAX_LEVEL; i++) |
|---|
| | 1759 | { |
|---|
| | 1760 | p_ptr->player_hp[i] = old_hp[i]; |
|---|
| | 1761 | } |
|---|
| 1775 | | /* Calculate the bonuses and hitpoints */ |
|---|
| 1776 | | p_ptr->update |= (PU_BONUS | PU_HP); |
|---|
| 1777 | | |
|---|
| 1778 | | /* Update stuff */ |
|---|
| 1779 | | update_stuff(); |
|---|
| 1780 | | |
|---|
| 1781 | | /* Fully healed */ |
|---|
| 1782 | | p_ptr->chp = p_ptr->mhp; |
|---|
| 1783 | | |
|---|
| 1784 | | /* Fully rested */ |
|---|
| 1785 | | p_ptr->csp = p_ptr->msp; |
|---|
| 1786 | | |
|---|
| 1787 | | /* Display the player */ |
|---|
| 1788 | | display_player(0); |
|---|
| 1789 | | |
|---|
| 1790 | | /* Get a name, prepare savefile */ |
|---|
| 1791 | | get_name(FALSE); |
|---|
| 1792 | | |
|---|
| 1793 | | /* Prompt for it */ |
|---|
| 1794 | | prt("['CTRL-X' to quit, 'ESC' to start over, or any other key to continue]", 23, 5); |
|---|
| 1795 | | |
|---|
| 1796 | | /* Get a key */ |
|---|
| 1797 | | ch = inkey(); |
|---|
| 1798 | | |
|---|
| 1799 | | /* Quit */ |
|---|
| 1800 | | if (ch == KTRL('X')) quit(NULL); |
|---|
| 1801 | | |
|---|
| 1802 | | /* Start over */ |
|---|
| 1803 | | if (ch == ESCAPE) return (FALSE); |
|---|
| 1804 | | |
|---|
| 1805 | | /* Accept */ |
|---|
| 1806 | | return (TRUE); |
|---|
| | 1775 | /* Calculate the bonuses and hitpoints */ |
|---|
| | 1776 | p_ptr->update |= (PU_BONUS | PU_HP); |
|---|
| | 1777 | |
|---|
| | 1778 | /* Update stuff */ |
|---|
| | 1779 | update_stuff(); |
|---|
| | 1780 | |
|---|
| | 1781 | /* Fully healed */ |
|---|
| | 1782 | p_ptr->chp = p_ptr->mhp; |
|---|
| | 1783 | |
|---|
| | 1784 | /* Fully rested */ |
|---|
| | 1785 | p_ptr->csp = p_ptr->msp; |
|---|
| | 1786 | |
|---|
| | 1787 | /* Display the player */ |
|---|
| | 1788 | display_player(0); |
|---|
| | 1789 | |
|---|
| | 1790 | /* Get a name, prepare savefile */ |
|---|
| | 1791 | get_name(FALSE); |
|---|
| | 1792 | |
|---|
| | 1793 | /* Prompt for it */ |
|---|
| | 1794 | prt("['CTRL-X' to quit, 'ESC' to start over, or any other key to continue]", 23, 5); |
|---|
| | 1795 | |
|---|
| | 1796 | /* Get a key */ |
|---|
| | 1797 | ch = inkey(); |
|---|
| | 1798 | |
|---|
| | 1799 | /* Quit */ |
|---|
| | 1800 | if (ch == KTRL('X')) quit(NULL); |
|---|
| | 1801 | |
|---|
| | 1802 | /* Start over */ |
|---|
| | 1803 | if (ch == ESCAPE) return (FALSE); |
|---|
| | 1804 | |
|---|
| | 1805 | /* Accept */ |
|---|
| | 1806 | return (TRUE); |
|---|