From c806c62e01f485b9d5a9a5a08a51b36921ff50c4 Mon Sep 17 00:00:00 2001 From: mogami Date: Sun, 4 Jan 2004 12:55:34 +0000 Subject: [PATCH] =?utf8?q?=E3=83=80=E3=83=B3=E3=82=B8=E3=83=A7=E3=83=B3?= =?utf8?q?=E3=81=AE=E9=9B=B0=E5=9B=B2=E6=B0=97=E3=81=8C=E3=80=81=E3=83=95?= =?utf8?q?=E3=83=AD=E3=82=A2=E3=81=AE=E7=94=9F=E6=88=90=E6=99=82=E3=81=A7?= =?utf8?q?=E3=81=AF=E7=84=A1=E3=81=8F=E3=83=AA=E3=82=A2=E3=83=AB=E3=82=BF?= =?utf8?q?=E3=82=A4=E3=83=A0=E3=81=AB=E8=A8=88=E7=AE=97=E3=81=95=E3=82=8C?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97?= =?utf8?q?=E3=81=9F=E3=80=82=20=E7=9F=A5=E8=A6=9A=E3=81=AE=E6=8A=80?= =?utf8?q?=E8=83=BD=E5=80=A4=E3=81=8C=E9=AB=98=E3=81=84=E3=81=A8=E9=9B=B0?= =?utf8?q?=E5=9B=B2=E6=B0=97=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?utf8?q?=E3=82=8B=E3=81=BE=E3=81=A7=E3=81=AE=E6=99=82=E9=96=93=E3=81=8C?= =?utf8?q?=E7=9F=AD=E3=81=8B=E3=81=8F=E3=81=AA=E3=82=8B=E3=80=82=20?= =?utf8?q?=E3=83=94=E3=83=83=E3=83=88=E3=82=84vault=E3=81=A7=E9=9B=B0?= =?utf8?q?=E5=9B=B2=E6=B0=97=E3=81=8C=E4=B8=8A=E3=81=8C=E3=82=8B=E4=BB=95?= =?utf8?q?=E6=A7=98=E3=81=AF=E5=86=8D=E7=8F=BE=E3=81=A7=E3=81=8D=E3=81=AA?= =?utf8?q?=E3=81=84=E3=81=AE=E3=81=A7=E3=80=81=20=E3=81=8B=E3=82=8F?= =?utf8?q?=E3=82=8A=E3=81=AB=E5=A4=9A=E6=95=B0=E9=9A=A3=E6=8E=A5=E3=81=97?= =?utf8?q?=E3=81=9F=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AF?= =?utf8?q?=E3=83=AC=E3=83=99=E3=83=AB=E3=81=AB=E9=96=A2=E3=82=8F=E3=82=89?= =?utf8?q?=E3=81=9A=E5=B0=91=E3=81=97=E3=81=A0=E3=81=91=E9=9B=B0=E5=9B=B2?= =?utf8?q?=E6=B0=97=E3=81=AB=E5=AF=84=E4=B8=8E=E3=81=99=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=80=82=20=E3=81=BE?= =?utf8?q?=E3=81=9F=E9=9B=B0=E5=9B=B2=E6=B0=97=E3=81=AE=E5=8A=A0=E7=AE=97?= =?utf8?q?=E3=81=AE=E4=BB=95=E6=96=B9=E3=82=92=E5=A4=89=E6=9B=B4=E3=80=822?= =?utf8?q?=E6=AC=A1=E5=BC=8F=E3=81=A7=E5=AF=84=E4=B8=8E=E3=82=92=E6=B1=BA?= =?utf8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?utf8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E3=80=81=205=E3=83=AC=E3=83=99?= =?utf8?q?=E3=83=ABOOD=E3=81=AE=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF?= =?utf8?q?=E3=83=BC=E3=81=8C2=E4=BD=93=E3=82=88=E3=82=8A=E3=82=82=E3=80=81?= =?utf8?q?10=E3=83=AC=E3=83=99=E3=83=ABOOD=E3=81=AE=E3=83=A2=E3=83=B3?= =?utf8?q?=E3=82=B9=E3=82=BF=E3=83=BC1=E4=BD=93=E3=81=AE=E6=96=B9=E3=81=8C?= =?utf8?q?=E8=89=AF=E3=81=84=E9=9B=B0=E5=9B=B2=E6=B0=97=E3=81=AB=E3=81=AA?= =?utf8?q?=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd4.c | 22 ++--- src/defines.h | 2 +- src/dungeon.c | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++------ src/externs.h | 3 - src/floors.c | 4 + src/generate.c | 42 +--------- src/load.c | 18 +++- src/monster2.c | 17 +--- src/object2.c | 43 ---------- src/rooms.c | 63 +------------- src/save.c | 12 +-- src/store.c | 6 -- src/types.h | 3 + src/variable.c | 7 +- src/xtra1.c | 29 +++---- 15 files changed, 286 insertions(+), 241 deletions(-) diff --git a/src/cmd4.c b/src/cmd4.c index 835f295cd..2427c7f9c 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -4909,9 +4909,6 @@ static cptr do_cmd_feeling_text_lucky[11] = */ void do_cmd_feeling(void) { - /* Verify the feeling */ - if (feeling > 10) feeling = 10; - /* No useful feeling in quests */ if (p_ptr->inside_quest && !random_quest_number(dun_level)) { @@ -4966,20 +4963,13 @@ void do_cmd_feeling(void) } /* Display the feeling */ - if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra) - { - if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]); - else { - if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){ - msg_print(do_cmd_feeling_text_combat[feeling]); - }else - msg_print(do_cmd_feeling_text[feeling]); - } - } + if (p_ptr->muta3 & MUT3_GOOD_LUCK) + msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]); + else if (p_ptr->pseikaku == SEIKAKU_COMBAT || + inventory[INVEN_BOW].name1 == ART_CRIMSON) + msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]); else - { - msg_print(do_cmd_feeling_text[0]); - } + msg_print(do_cmd_feeling_text[p_ptr->feeling]); } diff --git a/src/defines.h b/src/defines.h index fc0a16ca0..a33d7f9ec 100644 --- a/src/defines.h +++ b/src/defines.h @@ -76,7 +76,7 @@ #define H_VER_MAJOR 1 #define H_VER_MINOR 7 #define H_VER_PATCH 0 -#define H_VER_EXTRA 3 +#define H_VER_EXTRA 4 #define ANGBAND_2_8_1 diff --git a/src/dungeon.c b/src/dungeon.c index da2cf7272..a841fc774 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -3748,41 +3748,251 @@ msg_print(" /* - * Handle certain things once every 10 game turns + * Count number of adjacent monsters */ -static void process_world(void) +static int get_monster_crowd_number(int m_idx) { - int day, hour, min; + monster_type *m_ptr = &m_list[m_idx]; + int my = m_ptr->fy; + int mx = m_ptr->fx; + int i; + int count = 0; + + for (i = 0; i < 7; i++) + { + int ay = my + ddy_ddd[i]; + int ax = mx + ddx_ddd[i]; + + if (!in_bounds(ay, ax)) continue; + + /* Count number of monsters */ + if (cave[ay][ax].m_idx > 0) count++; + } + + return count; +} - const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN; - s32b prev_turn_in_today = ((turn - TURNS_PER_TICK) % A_DAY + A_DAY / 4) % A_DAY; - int prev_min = (1440 * prev_turn_in_today / A_DAY) % 60; - - extract_day_hour_min(&day, &hour, &min); - if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK) - && dun_level && !p_ptr->inside_battle) +/* + * Dungeon rating is no longer linear + */ +#define RATING_BOOST(delta) (delta * delta + 50 * delta) + +/* + * Examine all monsters and unidentified objects, + * and get the feeling of current dungeon floor + */ +static byte get_dungeon_feeling(void) +{ + const int base = 10; + int rating = 0; + int i; + + /* Hack -- no feeling in the town */ + if (!dun_level) return 0; + + /* Examine each monster */ + for (i = 1; i < m_max; i++) { - int quest_num = quest_number(dun_level); + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr; + int delta = 0; + + /* Skip dead monsters */ + if (!m_ptr->r_idx) continue; + + /* Ignore pet */ + if (is_pet(m_ptr)) continue; + + r_ptr = &r_info[m_ptr->r_idx]; - /* Get dungeon level feeling */ - if (!(quest_num && - (is_fixed_quest_idx(quest_num) && - !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || - !(quest[quest_num].flags & QUEST_FLAG_PRESET))))) + /* Unique monsters */ + if (r_ptr->flags1 & (RF1_UNIQUE)) { - /* Announce feeling */ - do_cmd_feeling(); + /* Nearly out-of-depth unique monsters */ + if (r_ptr->level + 10 > dun_level) + { + /* Boost rating by twice delta-depth */ + delta += (r_ptr->level + 10 - dun_level) * 2 * base; + } + } + else + { + /* Out-of-depth monsters */ + if (r_ptr->level > dun_level) + { + /* Boost rating by delta-depth */ + delta += (r_ptr->level - dun_level) * base; + } + } - /* Update the level indicator */ - p_ptr->redraw |= (PR_DEPTH); + /* Unusually crowded monsters get a little bit of rating boost */ + if (r_ptr->flags1 & RF1_FRIENDS) + { + if (5 <= get_monster_crowd_number(i)) delta += 1; + } + else + { + if (2 <= get_monster_crowd_number(i)) delta += 1; + } - /* Disturb */ - if (disturb_minor) disturb(0, 0); + + rating += RATING_BOOST(delta); + } + + /* Examine each unidentified object */ + for (i = 1; i < o_max; i++) + { + object_type *o_ptr = &o_list[i]; + object_kind *k_ptr = &k_info[o_ptr->k_idx]; + int delta = 0; + + /* Skip dead objects */ + if (!o_ptr->k_idx) continue; + + /* Skip known objects */ + if (object_is_known(o_ptr)) continue; + + /* Skip pseudo-known objects */ + if (o_ptr->ident & IDENT_SENSE) continue; + + /* Ego objects */ + if (object_is_ego(o_ptr)) + { + ego_item_type *e_ptr = &e_info[o_ptr->name2]; + + delta += e_ptr->rating * base; } + + /* Artifacts */ + if (object_is_artifact(o_ptr)) + { + s32b cost = object_value_real(o_ptr); + + delta += 10 * base; + if (cost > 10000L) delta += 10 * base; + if (cost > 50000L) delta += 10 * base; + if (cost > 100000L) delta += 10 * base; + + /* Special feeling */ + if (!preserve_mode) return 1; + } + + if (o_ptr->tval == TV_DRAG_ARMOR) delta += 30 * base; + if (o_ptr->tval == TV_SHIELD && + o_ptr->sval == SV_DRAGON_SHIELD) delta += 5 * base; + if (o_ptr->tval == TV_GLOVES && + o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) delta += 5 * base; + if (o_ptr->tval == TV_BOOTS && + o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) delta += 5 * base; + if (o_ptr->tval == TV_HELM && + o_ptr->sval == SV_DRAGON_HELM) delta += 5 * base; + if (o_ptr->tval == TV_RING && + o_ptr->sval == SV_RING_SPEED && + !object_is_cursed(o_ptr)) delta += 25 * base; + if (o_ptr->tval == TV_RING && + o_ptr->sval == SV_RING_LORDLY && + !object_is_cursed(o_ptr)) delta += 15 * base; + if (o_ptr->tval == TV_AMULET && + o_ptr->sval == SV_AMULET_THE_MAGI && + !object_is_cursed(o_ptr)) delta += 15 * base; + + /* Out-of-depth objects */ + if (!object_is_cursed(o_ptr) && !object_is_broken(o_ptr) && + k_ptr->level > dun_level) + { + /* Rating increase */ + delta += (k_ptr->level - dun_level) * base; + } + + rating += RATING_BOOST(delta); } + + if (rating > RATING_BOOST(1000)) return 2; + if (rating > RATING_BOOST(800)) return 3; + if (rating > RATING_BOOST(600)) return 4; + if (rating > RATING_BOOST(400)) return 5; + if (rating > RATING_BOOST(300)) return 6; + if (rating > RATING_BOOST(200)) return 7; + if (rating > RATING_BOOST(100)) return 8; + if (rating > RATING_BOOST(0)) return 9; + + return 10; +} + + +/* + * Update dungeon feeling, and announce it if changed + */ +static void update_dungeon_feeling(void) +{ + byte new_feeling; + int quest_num; + int delay; + + /* No feeling on the surface */ + if (!dun_level) return; + + /* No feeling in the arena */ + if (p_ptr->inside_battle) return; + + /* Extract delay time */ + delay = MAX(10, 150 - p_ptr->skill_fos) * (150 - dun_level) * TURNS_PER_TICK / 100; + + /* Not yet felt anything */ + if (turn < p_ptr->feeling_turn + delay && !cheat_xtra) return; + + /* Extract quest number (if any) */ + quest_num = quest_number(dun_level); + + /* No feeling in a quest */ + if (quest_num && + (is_fixed_quest_idx(quest_num) && + !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || + !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) return; + + + /* Get new dungeon feeling */ + new_feeling = get_dungeon_feeling(); + + /* Remember last time updated */ + p_ptr->feeling_turn = turn; + + /* No change */ + if (p_ptr->feeling == new_feeling) return; + + /* Dungeon feeling is changed */ + p_ptr->feeling = new_feeling; + + /* Announce feeling */ + do_cmd_feeling(); + + /* Update the level indicator */ + p_ptr->redraw |= (PR_DEPTH); + + /* Disturb */ + if (disturb_minor) disturb(0, 0); +} + + +/* + * Handle certain things once every 10 game turns + */ +static void process_world(void) +{ + int day, hour, min; + + const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN; + s32b prev_turn_in_today = ((turn - TURNS_PER_TICK) % A_DAY + A_DAY / 4) % A_DAY; + int prev_min = (1440 * prev_turn_in_today / A_DAY) % 60; + + extract_day_hour_min(&day, &hour, &min); + + /* Update dungeon feeling, and announce it if changed */ + update_dungeon_feeling(); + /*** Check monster arena ***/ if (p_ptr->inside_battle && !p_ptr->leaving) { @@ -3855,7 +4065,7 @@ static void process_world(void) p_ptr->energy_need = 0; battle_monsters(); } - else if(turn - old_turn == 150*TURNS_PER_TICK) + else if (turn - old_turn == 150*TURNS_PER_TICK) { #ifdef JP msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤­Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£"); diff --git a/src/externs.h b/src/externs.h index e3e3f2884..41367a0db 100644 --- a/src/externs.h +++ b/src/externs.h @@ -386,9 +386,6 @@ extern byte delay_factor; extern s16b autosave_freq; extern bool autosave_t; extern bool autosave_l; -extern byte feeling; -extern s16b rating; -extern bool good_item_flag; extern bool closing_flag; extern s16b panel_row_min, panel_row_max; extern s16b panel_col_min, panel_col_max; diff --git a/src/floors.c b/src/floors.c index 27bfec21b..33f5f2c8d 100644 --- a/src/floors.c +++ b/src/floors.c @@ -1402,6 +1402,10 @@ void change_floor(void) /* Remember when this level was "created" */ old_turn = turn; + /* No dungeon feeling yet */ + p_ptr->feeling_turn = old_turn; + p_ptr->feeling = 0; + /* Clear all flags */ change_floor_mode = 0L; } diff --git a/src/generate.c b/src/generate.c index d61a58e3b..091116fa5 100644 --- a/src/generate.c +++ b/src/generate.c @@ -1393,29 +1393,6 @@ static bool level_gen(cptr *why) else return TRUE; } -static byte extract_feeling(void) -{ - /* Hack -- no feeling in the town */ - if (!dun_level) return 0; - - /* Hack -- Have a special feeling sometimes */ - if (good_item_flag && !preserve_mode) return 1; - - if (rating > 100) return 2; - if (rating > 80) return 3; - if (rating > 60) return 4; - if (rating > 40) return 5; - if (rating > 30) return 6; - if (rating > 20) return 7; - if (rating > 10) return 8; - if (rating > 0) return 9; - - if((turn - old_turn) > TURNS_PER_TICK * TOWN_DAWN /2) - chg_virtue(V_PATIENCE, 1); - - return 10; -} - /* * Wipe all unnecessary flags after cave generation @@ -1513,12 +1490,6 @@ void clear_cave(void) /* Reset the object generation level */ object_level = base_level; - - /* Nothing special here yet */ - good_item_flag = FALSE; - - /* Nothing good here yet */ - rating = 0; } @@ -1529,7 +1500,7 @@ void clear_cave(void) */ void generate_cave(void) { - int num, i; + int num; /* Fill the arrays of floors and walls in the good proportions */ set_floor_and_wall(dungeon_type); @@ -1544,15 +1515,6 @@ void generate_cave(void) /* Clear and empty the cave */ clear_cave(); - for (i = 0; i < DUNGEON_FEAT_PROB_NUM; i++) - { - if (have_flag(f_info[d_info[dungeon_type].fill[i].feat].flags, FF_HAS_GOLD)) - { - rating += 40; - break; - } - } - /* Build the arena -KMW- */ if (p_ptr->inside_arena) { @@ -1586,8 +1548,6 @@ void generate_cave(void) okay = level_gen(&why); } - /* Extract the feeling */ - feeling = extract_feeling(); /* Prevent object over-flow */ if (o_max >= max_o_idx) diff --git a/src/load.c b/src/load.c index 101f8126f..58b8b97fb 100644 --- a/src/load.c +++ b/src/load.c @@ -2001,12 +2001,21 @@ static void rd_extra(void) p_ptr->is_dead = tmp8u; /* Read "feeling" */ - rd_byte(&tmp8u); - feeling = tmp8u; + rd_byte(&p_ptr->feeling); - /* Turn of last "feeling" */ + /* Turn when level began */ rd_s32b(&old_turn); + if (h_older_than(1, 7, 0, 4)) + { + p_ptr->feeling_turn = old_turn; + } + else + { + /* Turn of last "feeling" */ + rd_s32b(&p_ptr->feeling_turn); + } + /* Current turn */ rd_s32b(&turn); @@ -2019,6 +2028,7 @@ static void rd_extra(void) if (z_older_than(11, 0, 13)) { old_turn /= 2; + p_ptr->feeling_turn /= 2; turn /= 2; dungeon_turn /= 2; } @@ -2723,7 +2733,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) rd_s16b(&cur_hgt); rd_s16b(&cur_wid); - rd_byte(&feeling); + rd_byte(&p_ptr->feeling); diff --git a/src/monster2.c b/src/monster2.c index 149d69c32..333380352 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -3050,10 +3050,6 @@ msg_print(" #else if (cheat_hear) msg_format("Deep Unique (%s).", name); #endif - - - /* Boost rating by twice delta-depth */ - rating += (r_ptr->level - dun_level) * 2; } /* Normal monsters */ @@ -3065,10 +3061,6 @@ msg_print(" #else if (cheat_hear) msg_format("Deep Monster (%s).", name); #endif - - - /* Boost rating by delta-depth */ - rating += (r_ptr->level - dun_level); } } @@ -3151,7 +3143,6 @@ msg_print(" choose_new_monster(c_ptr->m_idx, TRUE, 0); r_ptr = &r_info[m_ptr->r_idx]; m_ptr->mflag2 |= MFLAG2_CHAMELEON; - rating++; /* Hack - Set sub_align to neutral when the Chameleon Lord is generated as "GUARDIAN" */ if ((r_ptr->flags1 & RF1_UNIQUE) && (who <= 0)) @@ -3478,7 +3469,7 @@ static bool place_monster_group(int who, int y, int x, int r_idx, u32b mode) { monster_race *r_ptr = &r_info[r_idx]; - int old, n, i; + int n, i; int total = 0, extra = 0; int hack_n = 0; @@ -3517,9 +3508,6 @@ static bool place_monster_group(int who, int y, int x, int r_idx, u32b mode) if (total > GROUP_MAX) total = GROUP_MAX; - /* Save the rating */ - old = rating; - /* Start on the monster */ hack_n = 1; hack_x[0] = x; @@ -3553,9 +3541,6 @@ static bool place_monster_group(int who, int y, int x, int r_idx, u32b mode) } } - /* Hack -- restore the rating */ - rating = old; - /* Success */ return (TRUE); diff --git a/src/object2.c b/src/object2.c index c7f52bb5e..66aae951e 100644 --- a/src/object2.c +++ b/src/object2.c @@ -2280,7 +2280,6 @@ static byte get_random_ego(byte slot, bool good) * * Hack -- note special base damage dice boosting * Hack -- note special processing for weapon/digger - * Hack -- note special rating boost for dragon scale mail */ static void a_m_aux_1(object_type *o_ptr, int level, int power) { @@ -2673,8 +2672,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) { case TV_DRAG_ARMOR: { - /* Rating boost */ - rating += 30; if (one_in_(50) || (power > 2)) /* power > 2 is debug only */ create_artifact(o_ptr, FALSE); @@ -2759,9 +2756,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) if (o_ptr->sval == SV_DRAGON_SHIELD) { - /* Rating boost */ - rating += 5; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); dragon_resist(o_ptr); @@ -2797,9 +2791,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) { if (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) { - /* Rating boost */ - rating += 5; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); dragon_resist(o_ptr); @@ -2828,9 +2819,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) { if (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) { - /* Rating boost */ - rating += 5; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); dragon_resist(o_ptr); @@ -2920,9 +2908,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) { if (o_ptr->sval == SV_DRAGON_HELM) { - /* Rating boost */ - rating += 5; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); dragon_resist(o_ptr); @@ -3010,8 +2995,6 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) /* * Apply magic to an item known to be a "ring" or "amulet" * - * Hack -- note special rating boost for ring of speed - * Hack -- note special rating boost for amulet of the magi * Hack -- note special "pval boost" code for ring of speed * Hack -- note that some items must be cursed (or blessed) */ @@ -3101,9 +3084,6 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power) break; } - /* Rating boost */ - rating += 25; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); @@ -3120,7 +3100,6 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power) /* Bonus to armor class */ o_ptr->to_a = 10 + randint1(5) + m_bonus(10, level); - rating += 15; } break; @@ -3612,9 +3591,6 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power) /* gain one low ESP */ add_esp_weak(o_ptr, FALSE); - /* Boost the rating */ - rating += 15; - /* Mention the item */ if (cheat_peek) object_mention(o_ptr); @@ -4276,17 +4252,6 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode) if (a_ptr->gen_flags & (TRG_RANDOM_CURSE1)) o_ptr->curse_flags |= get_curse(1, o_ptr); if (a_ptr->gen_flags & (TRG_RANDOM_CURSE2)) o_ptr->curse_flags |= get_curse(2, o_ptr); - /* Mega-Hack -- increase the rating */ - rating += 10; - - /* Mega-Hack -- increase the rating again */ - if (a_ptr->cost > 50000L) rating += 10; - - /* Mega-Hack -- increase the rating again */ - if (a_ptr->cost > 100000L) rating += 10; - - /* Set the good item flag */ - good_item_flag = TRUE; /* Cheat -- peek at the item */ if (cheat_peek) object_mention(o_ptr); @@ -4378,8 +4343,6 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode) add_flag(o_ptr->art_flags, TR_CHR); } - if (o_ptr->art_name) rating += 30; - /* Hack -- analyze ego-items */ else if (object_is_ego(o_ptr)) { @@ -4472,9 +4435,6 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode) o_ptr->pval = 2; } - /* Hack -- apply rating bonus */ - rating += e_ptr->rating; - /* Cheat -- describe the item */ if (cheat_peek) object_mention(o_ptr); @@ -4664,9 +4624,6 @@ bool make_object(object_type *j_ptr, u32b mode) if (!object_is_cursed(j_ptr) && !object_is_broken(j_ptr) && (obj_level > dun_level)) { - /* Rating increase */ - rating += (obj_level - dun_level); - /* Cheat -- peek at items */ if (cheat_peek) object_mention(j_ptr); } diff --git a/src/rooms.c b/src/rooms.c index 7007af346..9065ac9b3 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -2091,7 +2091,7 @@ static void ang_sort_swap_nest_mon_info(vptr u, vptr v, int a, int b) * "appropriate" non-unique monsters for the nest. * * Note that the "get_mon_num()" function may (rarely) fail, in which - * case the nest will be empty, and will not affect the level rating. + * case the nest will be empty. * * Note that "monster nests" will never contain "unique" monsters. */ @@ -2238,15 +2238,6 @@ static bool build_type5(void) #endif } - /* Increase the level rating */ - rating += 10; - - /* (Sometimes) Cause a "special feeling" (for "Monster Nests") */ - if ((dun_level <= 40) && (randint1(dun_level * dun_level + 50) < 300)) - { - good_item_flag = TRUE; - } - /* Place some monsters */ for (y = yval - 2; y <= yval + 2; y++) { @@ -2319,7 +2310,7 @@ static bool build_type5(void) * "appropriate" non-unique monsters for the pit. * * Note that the "get_mon_num()" function may (rarely) fail, in which case - * the pit will be empty, and will not effect the level rating. + * the pit will be empty. * * Note that "monster pits" will never contain "unique" monsters. */ @@ -2499,15 +2490,6 @@ static bool build_type6(void) } } - /* Increase the level rating */ - rating += 10; - - /* (Sometimes) Cause a "special feeling" (for "Monster Pits") */ - if ((dun_level <= 40) && (randint1(dun_level * dun_level + 50) < 300)) - { - good_item_flag = TRUE; - } - /* Top and bottom rows */ for (x = xval - 9; x <= xval + 9; x++) { @@ -2918,16 +2900,6 @@ static bool build_type7(void) if (cheat_room) msg_format("Lesser vault (%s)", v_name + v_ptr->name); #endif - /* Boost the rating */ - rating += v_ptr->rat; - - /* (Sometimes) Cause a special feeling */ - if ((dun_level <= 50) || - (randint1((dun_level - 40) * (dun_level - 40) + 50) < 400)) - { - good_item_flag = TRUE; - } - /* Hack -- Build the vault */ build_vault(yval, xval, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text, xoffset, yoffset, transno); @@ -3026,16 +2998,6 @@ static bool build_type8(void) if (cheat_room) msg_format("Greater vault (%s)", v_name + v_ptr->name); #endif - /* Boost the rating */ - rating += v_ptr->rat; - - /* (Sometimes) Cause a special feeling */ - if ((dun_level <= 50) || - (randint1((dun_level - 40) * (dun_level - 40) + 50) < 400)) - { - good_item_flag = TRUE; - } - /* Hack -- Build the vault */ build_vault(yval, xval, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text, xoffset, yoffset, transno); @@ -5343,16 +5305,6 @@ static bool build_type10(void) /* Find and reserve some space in the dungeon. Get center of room. */ if (!find_space(&y0, &x0, ysize + 1, xsize + 1)) return FALSE; - /* Boost the rating- higher than lesser vaults and lower than greater vaults */ - rating += 10; - - /* (Sometimes) Cause a special feeling */ - if ((dun_level <= 50) || - (randint1((dun_level - 40) * (dun_level - 40) + 1) < 400)) - { - good_item_flag = TRUE; - } - /* Select type of vault */ #ifdef ALLOW_CAVERNS_AND_LAKES vtype = randint1(15); @@ -5582,7 +5534,7 @@ static bool vault_aux_trapped_pit(int r_idx) * "appropriate" non-unique monsters for the pit. * * Note that the "get_mon_num()" function may (rarely) fail, in which case - * the pit will be empty, and will not effect the level rating. + * the pit will be empty. * * Note that "monster pits" will never contain "unique" monsters. */ @@ -5823,15 +5775,6 @@ static bool build_type13(void) } } - /* Increase the level rating */ - rating += 20; - - /* (Sometimes) Cause a "special feeling" (for "Monster Pits") */ - if ((dun_level <= 40) && (randint1(dun_level * dun_level + 50) < 300)) - { - good_item_flag = TRUE; - } - for (i = 0; placing[i][2] >= 0; i++) { y = yval + placing[i][0]; diff --git a/src/save.c b/src/save.c index c12aa8a34..9379d7bd0 100644 --- a/src/save.c +++ b/src/save.c @@ -750,11 +750,14 @@ static void wr_extra(void) wr_byte(p_ptr->is_dead); /* Write feeling */ - wr_byte(feeling); + wr_byte(p_ptr->feeling); - /* Turn of last "feeling" */ + /* Turn when level began */ wr_s32b(old_turn); + /* Turn of last "feeling" */ + wr_s32b(p_ptr->feeling_turn); + /* Current turn */ wr_s32b(turn); @@ -865,7 +868,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr) wr_u16b((u16b)px); wr_u16b(cur_hgt); wr_u16b(cur_wid); - wr_byte(feeling); + wr_byte(p_ptr->feeling); @@ -1939,9 +1942,6 @@ bool load_player(void) /* Count lives */ sf_lives++; - /* Forget turns */ - turn = old_turn = 0; - /* Done */ return (TRUE); } diff --git a/src/store.c b/src/store.c index 5901ccbe7..703578be4 100644 --- a/src/store.c +++ b/src/store.c @@ -4949,8 +4949,6 @@ void store_maint(int town_num, int store_num) { int j; - int old_rating = rating; - cur_store_num = store_num; /* Ignore home */ @@ -5021,10 +5019,6 @@ void store_maint(int town_num, int store_num) /* Acquire some new items */ while (st_ptr->stock_num < j) store_create(); - - - /* Hack -- Restore the rating */ - rating = old_rating; } diff --git a/src/types.h b/src/types.h index cbb79b7ec..2db27e13e 100644 --- a/src/types.h +++ b/src/types.h @@ -1140,6 +1140,9 @@ struct player_type bool autopick_autoregister; /* auto register is in-use or not */ + byte feeling; /* Most recent dungeon feeling */ + s32b feeling_turn; /* The turn of the last dungeon feeling */ + /*** Temporary fields ***/ diff --git a/src/variable.c b/src/variable.c index 42946f29d..d04bc72c3 100644 --- a/src/variable.c +++ b/src/variable.c @@ -121,7 +121,7 @@ s16b base_level; /* Base dungeon level */ s32b turn; /* Current game turn */ s32b dungeon_turn; /* Game turn in dungeon */ -s32b old_turn; /* Turn when level began (feelings) */ +s32b old_turn; /* Turn when level began */ s32b old_battle; bool use_sound; /* The "sound" mode is enabled */ @@ -362,11 +362,6 @@ s16b autosave_freq; /* Autosave frequency */ * Dungeon variables */ -byte feeling; /* Most recent feeling */ -s16b rating; /* Level's current rating */ - -bool good_item_flag; /* True if "Artifact" on this level */ - bool closing_flag; /* Dungeon is closing */ diff --git a/src/xtra1.c b/src/xtra1.c index 70646d070..400952455 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -978,24 +978,21 @@ static void prt_depth(void) else (void)sprintf(depths, "Lev %d", dun_level); #endif - attr = TERM_SLATE; /* Get color of level based on feeling -JSV- */ - if ((turn - old_turn >= (150 - dun_level) * TURNS_PER_TICK) || cheat_xtra) - { - switch (feeling) - { - case 1: attr = TERM_L_BLUE; break; /* Special */ - case 2: attr = TERM_VIOLET; break; /* Horrible visions */ - case 3: attr = TERM_RED; break; /* Very dangerous */ - case 4: attr = TERM_L_RED; break; /* Very bad feeling */ - case 5: attr = TERM_ORANGE; break; /* Bad feeling */ - case 6: attr = TERM_YELLOW; break; /* Nervous */ - case 7: attr = TERM_L_UMBER; break; /* Luck is turning */ - case 8: attr = TERM_L_WHITE; break; /* Don't like */ - case 9: attr = TERM_WHITE; break; /* Reasonably safe */ - case 10: attr = TERM_WHITE; break; /* Boring place */ - } + switch (p_ptr->feeling) + { + case 0: attr = TERM_SLATE; break; /* Unknown */ + case 1: attr = TERM_L_BLUE; break; /* Special */ + case 2: attr = TERM_VIOLET; break; /* Horrible visions */ + case 3: attr = TERM_RED; break; /* Very dangerous */ + case 4: attr = TERM_L_RED; break; /* Very bad feeling */ + case 5: attr = TERM_ORANGE; break; /* Bad feeling */ + case 6: attr = TERM_YELLOW; break; /* Nervous */ + case 7: attr = TERM_L_UMBER; break; /* Luck is turning */ + case 8: attr = TERM_L_WHITE; break; /* Don't like */ + case 9: attr = TERM_WHITE; break; /* Reasonably safe */ + case 10: attr = TERM_WHITE; break; /* Boring place */ } } -- 2.11.0