X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fdungeon.c;h=c2702a8ad93db790c2aa978380e2a598a0a1a43e;hb=eff1770d37d6d43e9b093dfbd2cc2e8c43b259e3;hp=f188c084c439cb496b6975e3a41c94c30bb113ad;hpb=5f6aa2feaf392e1b60d5826a27764fc0e221e24d;p=hengbandforosx%2Fhengbandosx.git diff --git a/src/dungeon.c b/src/dungeon.c index f188c084c..c2702a8ad 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -96,6 +96,7 @@ static void sense_inventory_aux(int slot, bool heavy) byte feel; object_type *o_ptr = &inventory[slot]; char o_name[MAX_NLEN]; + int idx; /* We know about it already, do not tell us again */ if (o_ptr->ident & (IDENT_SENSE))return; @@ -194,6 +195,11 @@ o_name, index_to_label(slot),game_inscriptions[feel]); /* Set the "inscription" */ o_ptr->feeling = feel; + /* Auto-inscription/destroy */ + idx = is_autopick(o_ptr); + auto_inscribe_item(slot, idx); + auto_destroy_item(slot, idx, FALSE); + /* Combine / Reorder the pack (later) */ p_ptr->notice |= (PN_COMBINE | PN_REORDER); @@ -609,7 +615,11 @@ if (get_check("¾ else if (dun_level == 100) max_level = 100; } - else max_level = d_info[dungeon_type].maxdepth; + else + { + max_level = d_info[dungeon_type].maxdepth; + min_level = d_info[dungeon_type].mindepth; + } /* Prompt */ #ifdef JP @@ -1379,7 +1389,7 @@ else msg_format("%s } -static void check_music() +static void check_music(void) { magic_type *s_ptr; u32b shouhimana; @@ -1388,25 +1398,25 @@ static void check_music() if(p_ptr->pclass != CLASS_BARD) return; if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return; - s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]]; + s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][p_ptr->magic_num2[0]]; - shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399); + shouhimana = (s_ptr->smana*(3800-p_ptr->spell_exp[p_ptr->magic_num2[0]])+2399); if(p_ptr->dec_mana) shouhimana *= 3; else shouhimana *= 4; shouhimana /= 9600; if(shouhimana < 1) shouhimana = 1; shouhimana *= 0x8000; - if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic)) + if (((u16b)(p_ptr->csp) < (shouhimana / 0x10000)) || (p_ptr->anti_magic)) { stop_singing(); return; } else { - p_ptr->csp -= shouhimana / 0x10000; - shouhimana = (shouhimana & 0xffff); - if (p_ptr->csp_frac < shouhimana) + p_ptr->csp -= (u16b) (shouhimana / 0x10000); + shouhimana = (shouhimana & 0xffff); + if (p_ptr->csp_frac < shouhimana) { p_ptr->csp--; p_ptr->csp_frac += (u16b)(0x10000L - shouhimana); @@ -1435,20 +1445,20 @@ static void check_music() p_ptr->redraw |= (PR_STATUS); } } - if (spell_exp[p_ptr->magic_num2[0]] < 900) - spell_exp[p_ptr->magic_num2[0]]+=5; - else if(spell_exp[p_ptr->magic_num2[0]] < 1200) - {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;} - else if(spell_exp[p_ptr->magic_num2[0]] < 1400) - {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;} - else if(spell_exp[p_ptr->magic_num2[0]] < 1600) - {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;} + if (p_ptr->spell_exp[p_ptr->magic_num2[0]] < 900) + p_ptr->spell_exp[p_ptr->magic_num2[0]]+=5; + else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1200) + {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;} + else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1400) + {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;} + else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1600) + {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;} gere_music(p_ptr->magic_num1[0]); } /* Choose one of items that have cursed flag */ -object_type *choose_cursed_obj_name(u32b flag) +static object_type *choose_cursed_obj_name(u32b flag) { int i; int choices[INVEN_TOTAL-INVEN_RARM]; @@ -1495,7 +1505,7 @@ static void process_world(void) s32b tick = turn % len + len / 4; extract_day_hour_min(&day, &hour, &min); - prev_min = (1440 * (tick - 20) / len) % 60; + prev_min = (1440 * (tick - TURNS_PER_TICK) / len) % 60; if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK) && (dun_level) && @@ -1627,7 +1637,7 @@ msg_print(" /* Stop playing */ - alive = FALSE; + p_ptr->playing = FALSE; /* Leaving */ p_ptr->leaving = TRUE; @@ -1723,7 +1733,7 @@ msg_print(" (y == 0) || (y == cur_hgt-1)) { /* Forget the grid */ - c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK); + if (!(c_ptr->info & CAVE_IN_MIRROR)) c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK); /* Hack -- Notice spot */ note_spot(y, x); @@ -2331,7 +2341,7 @@ msg_print(" regenmana(upkeep_regen/100); #ifdef TRACK_FRIENDS - if (wizard) + if (p_ptr->wizard) { #ifdef JP msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount); @@ -2485,6 +2495,18 @@ msg_print(" (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE); } + /* Timed sh_holy */ + if (p_ptr->tim_sh_holy) + { + (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE); + } + + /* Timed eyeeye */ + if (p_ptr->tim_eyeeye) + { + (void)set_tim_eyeeye(p_ptr->tim_eyeeye - 1, TRUE); + } + /* Timed resist-magic */ if (p_ptr->resist_magic) { @@ -2868,10 +2890,13 @@ msg_print(" !p_ptr->anti_magic && (randint1(6666) == 666)) { bool pet = one_in_(6); - bool not_pet = (bool)(!pet); + u32b mode = PM_ALLOW_GROUP; + + if (pet) mode |= PM_FORCE_PET; + else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); if (summon_specific((pet ? -1 : 0), py, px, - dun_level, SUMMON_DEMON, TRUE, FALSE, pet, not_pet, not_pet)) + dun_level, SUMMON_DEMON, mode)) { #ifdef JP msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤­´ó¤»¤¿¡ª"); @@ -3000,10 +3025,12 @@ msg_print(" !p_ptr->anti_magic && one_in_(7000)) { bool pet = one_in_(3); - bool not_pet = (bool)(!pet); + u32b mode = PM_ALLOW_GROUP; + + if (pet) mode |= PM_FORCE_PET; + else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, - TRUE, FALSE, pet, not_pet, not_pet)) + if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode)) { #ifdef JP msg_print("ưʪ¤ò°ú¤­´ó¤»¤¿¡ª"); @@ -3106,10 +3133,12 @@ msg_print(" !p_ptr->anti_magic && one_in_(3000)) { bool pet = one_in_(5); - bool not_pet = (bool)(!pet); + u32b mode = PM_ALLOW_GROUP; - if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, - TRUE, FALSE, pet, not_pet, not_pet)) + if (pet) mode |= PM_FORCE_PET; + else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); + + if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode)) { #ifdef JP msg_print("¥É¥é¥´¥ó¤ò°ú¤­´ó¤»¤¿¡ª"); @@ -3423,7 +3452,7 @@ msg_format(" if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500)) { if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL, - TRUE, FALSE, FALSE, TRUE, TRUE)) + (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; @@ -3440,8 +3469,7 @@ msg_format("%s /* Call demon */ if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111)) { - if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, - TRUE, FALSE, FALSE, TRUE, TRUE)) + if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; @@ -3459,7 +3487,7 @@ msg_format("%s if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800)) { if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON, - TRUE, FALSE, FALSE, TRUE, TRUE)) + (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; @@ -3778,7 +3806,7 @@ msg_print(" static bool enter_wizard_mode(void) { /* Ask first time */ - if (!noscore) + if (!p_ptr->noscore) { /* Mention effects */ #ifdef JP @@ -3803,7 +3831,7 @@ if (!get_check(" } /* Mark savefile */ - noscore |= 0x0002; + p_ptr->noscore |= 0x0002; } /* Success */ @@ -3819,7 +3847,7 @@ if (!get_check(" static bool enter_debug_mode(void) { /* Ask first time */ - if (!noscore) + if (!p_ptr->noscore) { /* Mention effects */ #ifdef JP @@ -3849,7 +3877,7 @@ if (!get_check(" do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands."); #endif /* Mark savefile */ - noscore |= 0x0008; + p_ptr->noscore |= 0x0008; } /* Success */ @@ -3872,7 +3900,7 @@ extern void do_cmd_debug(void); static bool enter_borg_mode(void) { /* Ask first time */ - if (!(noscore & 0x0010)) + if (!(p_ptr->noscore & 0x0010)) { /* Mention effects */ #ifdef JP @@ -3897,7 +3925,7 @@ if (!get_check(" } /* Mark savefile */ - noscore |= 0x0010; + p_ptr->noscore |= 0x0010; } /* Success */ @@ -3954,9 +3982,9 @@ static void process_command(void) /* Toggle Wizard Mode */ case KTRL('W'): { - if (wizard) + if (p_ptr->wizard) { - wizard = FALSE; + p_ptr->wizard = FALSE; #ifdef JP msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£"); #else @@ -3966,7 +3994,7 @@ msg_print(" } else if (enter_wizard_mode()) { - wizard = TRUE; + p_ptr->wizard = TRUE; #ifdef JP msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£"); #else @@ -4179,21 +4207,21 @@ msg_print(" /*** Stairs and Doors and Chests and Traps ***/ /* Enter store */ - case 253: + case SPECIAL_KEY_STORE: { if (!p_ptr->wild_mode) do_cmd_store(); break; } /* Enter building -KMW- */ - case 254: + case SPECIAL_KEY_BUILDING: { if (!p_ptr->wild_mode) do_cmd_bldg(); break; } /* Enter quest level -KMW- */ - case 255: + case SPECIAL_KEY_QUEST: { if (!p_ptr->wild_mode) do_cmd_quest(); break; @@ -4316,6 +4344,8 @@ msg_print(" ) do_cmd_mind_browse(); else if (p_ptr->pclass == CLASS_SMITH) do_cmd_kaji(TRUE); + else if (p_ptr->pclass == CLASS_MAGIC_EATER) + do_cmd_magic_eater(TRUE); else do_cmd_browse(); break; } @@ -4339,7 +4369,7 @@ msg_print(" #ifdef JP msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); #else - msg_print("The arena absorbs all attempted magic!"); + msg_print("The dungeon absorbs all attempted magic!"); #endif msg_print(NULL); } @@ -4415,7 +4445,7 @@ msg_print(" else if (p_ptr->pclass == CLASS_IMITATOR) do_cmd_mane(FALSE); else if (p_ptr->pclass == CLASS_MAGIC_EATER) - do_cmd_magic_eater(); + do_cmd_magic_eater(FALSE); else if (p_ptr->pclass == CLASS_SAMURAI) do_cmd_hissatsu(); else if (p_ptr->pclass == CLASS_BLUE_MAGE) @@ -4499,18 +4529,7 @@ msg_print(" { if (!p_ptr->wild_mode) { - if (!p_ptr->inside_arena) do_cmd_throw(); - else - { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª"); -#else - msg_print("You're in the arena now. This is hand-to-hand!"); -#endif - - msg_print(NULL); - } } break; } @@ -4824,6 +4843,7 @@ msg_print(" /* Save and quit */ case KTRL('X'): + case SPECIAL_KEY_QUIT: { do_cmd_save_and_exit(); break; @@ -4903,7 +4923,7 @@ prt(" '?' -bool monster_tsuri(int r_idx) +static bool monster_tsuri(int r_idx) { monster_race *r_ptr = &r_info[r_idx]; @@ -5015,7 +5035,7 @@ msg_print(" int y, x; y = py+ddy[tsuri_dir]; x = px+ddx[tsuri_dir]; - if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE)) + if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE)) { char m_name[80]; monster_desc(m_name, &m_list[cave[y][x].m_idx], 0); @@ -5040,7 +5060,7 @@ msg_print(" } /* Handle "abort" */ - if (avoid_abort) + if (check_abort) { /* Check for "player abort" (semi-efficiently for resting) */ if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH)) @@ -5095,7 +5115,7 @@ msg_format("%^s int d = 1; /* Make a "saving throw" against stun */ - if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING]) + if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING]) { /* Recover fully */ d = m_ptr->stunned; @@ -5135,7 +5155,7 @@ msg_format("%^s int d = 1; /* Make a "saving throw" against stun */ - if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING]) + if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING]) { /* Recover fully */ d = m_ptr->confused; @@ -5175,7 +5195,7 @@ msg_format("%^s int d = 1; /* Make a "saving throw" against stun */ - if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING]) + if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING]) { /* Recover fully */ d = m_ptr->monfear; @@ -5563,13 +5583,13 @@ msg_format("%s(%c) } if (p_ptr->pclass == CLASS_IMITATOR) { - if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1)) + if (p_ptr->mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1)) { - mane_num--; - for (i = 0; i < mane_num; i++) + p_ptr->mane_num--; + for (i = 0; i < p_ptr->mane_num; i++) { - mane_spell[i] = mane_spell[i+1]; - mane_dam[i] = mane_dam[i+1]; + p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1]; + p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1]; } } new_mane = FALSE; @@ -5606,7 +5626,7 @@ msg_format("%s(%c) } /* Hack -- notice death */ - if (!alive || death) + if (!p_ptr->playing || p_ptr->is_dead) { world_player = FALSE; break; @@ -5834,7 +5854,7 @@ msg_print(" p_ptr->magic_num1[0] = MUSIC_DETECT; /* Hack -- notice death or departure */ - if (!alive || death) return; + if (!p_ptr->playing || p_ptr->is_dead) return; /* Print quest message if appropriate */ if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND)) @@ -5925,7 +5945,7 @@ msg_print(" if (fresh_after) Term_fresh(); /* Hack -- Notice death or departure */ - if (!alive || death) break; + if (!p_ptr->playing || p_ptr->is_dead) break; /* Process all of the monsters */ process_monsters(); @@ -5949,7 +5969,7 @@ msg_print(" if (fresh_after) Term_fresh(); /* Hack -- Notice death or departure */ - if (!alive || death) break; + if (!p_ptr->playing || p_ptr->is_dead) break; /* Process the world */ @@ -5974,7 +5994,7 @@ msg_print(" if (fresh_after) Term_fresh(); /* Hack -- Notice death or departure */ - if (!alive || death) break; + if (!p_ptr->playing || p_ptr->is_dead) break; /* Handle "leaving" */ if (p_ptr->leaving) break; @@ -5994,7 +6014,7 @@ msg_print(" } /* Not save-and-quit and not dead? */ - if (alive && !death) + if (p_ptr->playing && !p_ptr->is_dead) { for(num = 0; num < 21; num++) { @@ -6059,6 +6079,7 @@ msg_print(" static void load_all_pref_files(void) { char buf[1024]; + errr err; /* Access the "user" pref file */ sprintf(buf, "user.prf"); @@ -6090,17 +6111,26 @@ static void load_all_pref_files(void) /* Process that file */ process_pref_file(buf); + /* Free old entries */ + init_autopicker(); + #ifdef JP sprintf(buf, "picktype-%s.prf", player_base); #else sprintf(buf, "pickpref-%s.prf", player_base); #endif - process_pickpref_file(buf); + + err = process_pickpref_file(buf); + + /* Process 'pick????.prf' if 'pick????-.prf' doesn't exist */ + if (0 > err) + { #ifdef JP - process_pickpref_file("picktype.prf"); + process_pickpref_file("picktype.prf"); #else - process_pickpref_file("pickpref.prf"); + process_pickpref_file("pickpref.prf"); #endif + } /* Access the "realm 1" pref file */ if (p_ptr->realm1 != REALM_NONE) @@ -6205,15 +6235,15 @@ quit(" } /* Report waited score */ - if (wait_report_score) + if (p_ptr->wait_report_score) { char buf[1024]; bool success; #ifdef JP - if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©")) + if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY)) #else - if (!get_check("Do you register score now? ")) + if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY)) #endif quit(0); @@ -6223,7 +6253,7 @@ quit(" /* Update stuff */ update_stuff(); - death = TRUE; + p_ptr->is_dead = TRUE; start_time = time(NULL); @@ -6243,9 +6273,9 @@ quit(" success = send_world_score(TRUE); #ifdef JP - if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©")) + if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY)) #else - if (!success && !get_check("Do you give up score registration? ")) + if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY)) #endif { #ifdef JP @@ -6257,7 +6287,7 @@ quit(" } else { - wait_report_score = FALSE; + p_ptr->wait_report_score = FALSE; top_twenty(); #ifdef JP if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª"); @@ -6498,7 +6528,7 @@ prt(" /* Hack -- Enter wizard mode */ - if (arg_wizard && enter_wizard_mode()) wizard = TRUE; + if (arg_wizard && enter_wizard_mode()) p_ptr->wizard = TRUE; /* Initialize the town-buildings if necessary */ if (!dun_level && !p_ptr->inside_quest) @@ -6535,7 +6565,7 @@ if (init_v_info()) quit(" /* Start game */ - alive = TRUE; + p_ptr->playing = TRUE; /* Reset the visual mappings */ reset_visuals(); @@ -6561,7 +6591,7 @@ if (init_v_info()) quit(" if (arg_force_roguelike) rogue_like_commands = TRUE; /* Hack -- Enforce "delayed death" */ - if (p_ptr->chp < 0) death = TRUE; + if (p_ptr->chp < 0) p_ptr->is_dead = TRUE; if (p_ptr->prace == RACE_ANDROID) calc_android_exp(); @@ -6570,8 +6600,8 @@ if (init_v_info()) quit(" monster_type *m_ptr; int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE); monster_race *r_ptr = &r_info[pet_r_idx]; - place_monster_aux(py, px - 1, pet_r_idx, - FALSE, FALSE, TRUE, TRUE, TRUE, FALSE); + place_monster_aux(0, py, px - 1, pet_r_idx, + (PM_FORCE_PET | PM_NO_KAGE)); m_ptr = &m_list[hack_m_idx_ii]; m_ptr->mspeed = r_ptr->speed; m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2; @@ -6616,11 +6646,11 @@ if (init_v_info()) quit(" clear_mon_lite(); /* Handle "quit and save" */ - if (!alive && !death) break; + if (!p_ptr->playing && !p_ptr->is_dead) break; /* Erase the old cave */ wipe_o_list(); - if (!death) wipe_m_list(); + if (!p_ptr->is_dead) wipe_m_list(); /* XXX XXX XXX */ @@ -6629,7 +6659,7 @@ if (init_v_info()) quit(" load_game = FALSE; /* Accidental Death */ - if (alive && death) + if (p_ptr->playing && p_ptr->is_dead) { if (p_ptr->inside_arena) { @@ -6638,7 +6668,7 @@ if (init_v_info()) quit(" p_ptr->arena_number++; else p_ptr->arena_number = 99; - death = FALSE; + p_ptr->is_dead = FALSE; p_ptr->chp = 0; p_ptr->chp_frac = 0; p_ptr->exit_bldg = TRUE; @@ -6648,9 +6678,9 @@ if (init_v_info()) quit(" { /* Mega-Hack -- Allow player to cheat death */ #ifdef JP -if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? ")) +if ((p_ptr->wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? ")) #else - if ((wizard || cheat_live) && !get_check("Die? ")) + if ((p_ptr->wizard || cheat_live) && !get_check("Die? ")) #endif { @@ -6661,7 +6691,7 @@ if ((wizard || cheat_live) && !get_check(" p_ptr->age++; /* Mark savefile */ - noscore |= 0x0001; + p_ptr->noscore |= 0x0001; /* Message */ #ifdef JP @@ -6724,14 +6754,14 @@ msg_print("Ä¥ /* Note cause of death XXX XXX XXX */ #ifdef JP -(void)strcpy(died_from, "»à¤Îµ½¤­"); +(void)strcpy(p_ptr->died_from, "»à¤Îµ½¤­"); #else - (void)strcpy(died_from, "Cheating death"); + (void)strcpy(p_ptr->died_from, "Cheating death"); #endif /* Do not die */ - death = FALSE; + p_ptr->is_dead = FALSE; dun_level = 0; p_ptr->inside_arena = FALSE; @@ -6777,7 +6807,7 @@ msg_print("Ä¥ } /* Handle "death" */ - if (death) break; + if (p_ptr->is_dead) break; /* Make a new level */ generate_cave();