OSDN Git Service

Weaponsmiths can drain lite essence according to lite radius of draining objects
[hengband/hengband.git] / src / xtra1.c
index 39e13b6..0969c8b 100644 (file)
@@ -1792,6 +1792,153 @@ static void fix_inven(void)
 }
 
 
+/*
+ * Print monster info in line
+ * nnn X LV name
+ *  nnn : number or unique(U) or wanted unique(W)
+ *  X   : symbol of monster
+ *  LV  : monster lv if known
+ *  name: name of monster
+ */
+static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
+       char buf[256];
+       int i;
+       int r_idx = m_ptr->ap_r_idx;
+       monster_race* r_ptr = &r_info[r_idx];
+       Term_gotoxy(x, y);
+       if(!r_ptr)return;
+       //Number of 'U'nique
+       if(r_ptr->flags1&RF1_UNIQUE){//unique
+               bool is_kubi = FALSE;
+               for(i=0;i<MAX_KUBI;i++){
+                       if(kubi_r_idx[i] == r_idx){
+                               is_kubi = TRUE;
+                               break;
+                       }
+               }
+               Term_addstr(-1, TERM_WHITE, is_kubi?"  W":"  U");
+       }else{
+               sprintf(buf, "%3d", n_same);
+               Term_addstr(-1, TERM_WHITE, buf);
+       }
+       //symbol
+       Term_addstr(-1, TERM_WHITE, " ");
+       //Term_add_bigch(r_ptr->d_attr, r_ptr->d_char);
+       //Term_addstr(-1, TERM_WHITE, "/");
+       Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
+       //LV
+       if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){
+               sprintf(buf, " %2d", r_ptr->level);
+       }else{
+               strcpy(buf, " ??");
+       }
+       Term_addstr(-1, TERM_WHITE, buf);
+       //name
+       sprintf(buf, " %s ", r_name+r_ptr->name);
+       Term_addstr(-1, TERM_WHITE, buf);
+       //Term_addstr(-1, TERM_WHITE, look_mon_desc(m_ptr, 0));
+}
+
+ /*
+       max_lines : ºÇÂ粿¹ÔÉÁ²è¤¹¤ë¤«¡¥
+*/
+void print_monster_list(int x, int y, int max_lines){
+       int line = y;
+       monster_type* last_mons = NULL;
+       monster_type* m_ptr = NULL;
+       int n_same = 0;
+       int i;
+
+       for(i=0;i<temp_n;i++){
+               cave_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
+               if(!c_ptr->m_idx || !m_list[c_ptr->m_idx].ml)continue;//no mons or cannot look
+               m_ptr = &m_list[c_ptr->m_idx];
+               if(is_pet(m_ptr))continue;//pet
+               if(!m_ptr->r_idx)continue;//dead?
+               {
+                       /*
+                       int r_idx = m_ptr->ap_r_idx;
+                       monster_race* r_ptr = &r_info[r_idx];
+                       cptr name = (r_name + r_ptr->name);
+                       cptr ename = (r_name + r_ptr->name);
+                       //¥ß¥ß¥Ã¥¯Îà¤ä¡Ö¤½¤ì¡×Åù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
+                       if(r_ptr->flags1&RF1_CHAR_CLEAR)continue;
+                       if((r_ptr->flags1&RF1_NEVER_MOVE)&&(r_ptr->flags2&RF2_CHAR_MULTI))continue;
+                       //¡Ø¥Ì¥ë¡Ù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
+                       if((strcmp(name, "À¸¤±¤ëµõ̵¡Ø¥Ì¥ë¡Ù")==0)||
+                          (strcmp(ename, "Null the Living Void")==0))continue;
+                       //"¶â̵¹¤¤Î»ØÎØ"¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
+                       if((strcmp(name, "¶â̵¹¤¤Î»ØÎØ")==0)||
+                               (strcmp(ename, "Plain Gold Ring")==0))continue;
+                       */
+               }
+
+               //¥½¡¼¥ÈºÑ¤ß¤Ê¤Î¤ÇƱ¤¸¥â¥ó¥¹¥¿¡¼¤ÏϢ³¤¹¤ë¡¥¤³¤ì¤òÍøÍѤ·¤ÆƱ¤¸¥â¥ó¥¹¥¿¡¼¤ò¥«¥¦¥ó¥È¡¤¤Þ¤È¤á¤Æɽ¼¨¤¹¤ë¡¥
+               if(!last_mons){//ÀèƬ¥â¥ó¥¹¥¿¡¼
+                       last_mons = m_ptr;
+                       n_same = 1;
+                       continue;
+               }
+               //same race?
+               if(last_mons->ap_r_idx == m_ptr->ap_r_idx){
+                       n_same++;
+                       continue;//ɽ¼¨½èÍý¤ò¼¡¤Ë²ó¤¹
+               }
+               //print last mons info
+               print_monster_line(x, line++, last_mons, n_same);
+               n_same = 1;
+               last_mons = m_ptr;
+               if(line-y-1==max_lines){//»Ä¤ê1¹Ô
+                       break;
+               }
+       }
+       if(line-y-1==max_lines && i!=temp_n){
+               Term_gotoxy(x, line);
+               Term_addstr(-1, TERM_WHITE, "-- and more --");
+       }else{
+               if(last_mons)print_monster_line(x, line++, last_mons, n_same);
+       }
+}
+/*
+ * Hack -- display monster list in sub-windows
+ */
+static void fix_monster_list(void)
+{
+       int j;
+       int w, h;
+
+       /* Scan windows */
+       for (j = 0; j < 8; j++)
+       {
+               term *old = Term;
+
+               /* No window */
+               if (!angband_term[j]) continue;
+
+               /* No relevant flags */
+               if (!(window_flag[j] & (PW_MONSTER_LIST))) continue;
+
+               /* Activate */
+               Term_activate(angband_term[j]);
+               Term_get_size(&w, &h);
+
+               Term_clear();
+
+               target_set_prepare_look();//¥â¥ó¥¹¥¿¡¼°ìÍ÷¤òÀ¸À®¡¤¥½¡¼¥È
+               print_monster_list(0, 0, h);
+
+               /* Fresh */
+               Term_fresh();
+
+               /* Restore */
+               Term_activate(old);
+       }
+}
+
+
+
 
 /*
  * Hack -- display equipment in sub-windows
@@ -2100,7 +2247,7 @@ static void calc_spells(void)
        int                     num_allowed;
        int         num_boukyaku = 0;
 
-       magic_type              *s_ptr;
+       const magic_type        *s_ptr;
        int which;
        int bonus = 0;
 
@@ -2518,7 +2665,9 @@ static void calc_mana(void)
                /* Normal gloves hurt mage-type spells */
                if (o_ptr->k_idx &&
                    !(have_flag(flgs, TR_FREE_ACT)) &&
-                   !(have_flag(flgs, TR_MAGIC_MASTERY)) &&
+                       !(have_flag(flgs, TR_DEC_MANA)) &&
+                       !(have_flag(flgs, TR_EASY_SPELL)) &&
+                       !((have_flag(flgs, TR_MAGIC_MASTERY)) && (o_ptr->pval > 0)) &&
                    !((have_flag(flgs, TR_DEX)) && (o_ptr->pval > 0)))
                {
                        /* Encumbered */
@@ -2867,7 +3016,7 @@ static void calc_hitpoints(void)
  */
 static void calc_torch(void)
 {
-       int i;
+       int i, rad;
        object_type *o_ptr;
        u32b flgs[TR_FLAG_SIZE];
 
@@ -2878,69 +3027,34 @@ static void calc_torch(void)
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
                o_ptr = &inventory[i];
-
-               /* Examine actual lites */
-               if ((i == INVEN_LITE) && (o_ptr->k_idx) && (o_ptr->tval == TV_LITE))
+               /* Skip empty slots */
+               if (!o_ptr->k_idx) continue;
+               
+               if (o_ptr->name2 == EGO_LITE_SHINE) p_ptr->cur_lite++;
+               
+               /* Need Fuels */
+               if (o_ptr->name2 != EGO_LITE_DARKNESS)
                {
-                       if (o_ptr->name2 == EGO_LITE_DARKNESS)
-                       {
-                               if (o_ptr->sval == SV_LITE_TORCH)
-                               {
-                                       p_ptr->cur_lite -= 1;
-                               }
-
-                               /* Lanterns (with fuel) provide more lite */
-                               else if (o_ptr->sval == SV_LITE_LANTERN)
-                               {
-                                       p_ptr->cur_lite -= 2;
-                               }
-
-                               else if (o_ptr->sval == SV_LITE_FEANOR)
-                               {
-                                       p_ptr->cur_lite -= 3;
-                               }
-                       }
-                       /* Torches (with fuel) provide some lite */
-                       else if ((o_ptr->sval == SV_LITE_TORCH) && (o_ptr->xtra4 > 0))
-                       {
-                               p_ptr->cur_lite += 1;
-                       }
-
-                       /* Lanterns (with fuel) provide more lite */
-                       else if ((o_ptr->sval == SV_LITE_LANTERN) && (o_ptr->xtra4 > 0))
-                       {
-                               p_ptr->cur_lite += 2;
-                       }
-
-                       else if (o_ptr->sval == SV_LITE_FEANOR)
-                       {
-                               p_ptr->cur_lite += 2;
-                       }
-
-                       /* Artifact Lites provide permanent, bright, lite */
-                       else if (object_is_fixed_artifact(o_ptr))
+                       if (o_ptr->tval == TV_LITE)
                        {
-                               p_ptr->cur_lite += 3;
+                               if((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0)) continue;
+                               if((o_ptr->sval == SV_LITE_LANTERN) && !(o_ptr->xtra4 > 0)) continue;
                        }
-
-                       if (o_ptr->name2 == EGO_LITE_SHINE) p_ptr->cur_lite++;
                }
-               else
-               {
-                       /* Skip empty slots */
-                       if (!o_ptr->k_idx) continue;
 
-                       /* Extract the flags */
-                       object_flags(o_ptr, flgs);
-
-                       /* does this item glow? */
-                       if (have_flag(flgs, TR_LITE))
-                       {
-                               if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT)) p_ptr->cur_lite--;
-                               else p_ptr->cur_lite++;
-                       }
-               }
+               /* Extract the flags */
+               object_flags(o_ptr, flgs);
 
+               /* calc the lite_radius */
+               
+               rad = 0;
+               if (have_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 1;
+               if (have_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 2;
+               if (have_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 3;
+               if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
+               if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
+               if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
+               p_ptr->cur_lite += rad;
        }
 
        /* max radius is 14 (was 5) without rewriting other code -- */
@@ -2997,6 +3111,120 @@ bool buki_motteruka(int i)
        return ((inventory[i].k_idx && object_is_melee_weapon(&inventory[i])) ? TRUE : FALSE);
 }
 
+bool is_heavy_shoot(object_type *o_ptr)
+{
+       int hold = adj_str_hold[p_ptr->stat_ind[A_STR]];
+       /* It is hard to carholdry a heavy bow */
+       return (hold < o_ptr->weight / 10);
+}
+
+int bow_tval_ammo(object_type *o_ptr)
+{
+       /* Analyze the launcher */
+       switch (o_ptr->sval)
+       {
+               case SV_SLING:
+               {
+                       return TV_SHOT;
+               }
+
+               case SV_SHORT_BOW:
+               case SV_LONG_BOW:
+               case SV_NAMAKE_BOW:
+               {
+                       return TV_ARROW;
+               }
+
+               case SV_LIGHT_XBOW:
+               case SV_HEAVY_XBOW:
+               {
+                       return TV_BOLT;
+               }
+               case SV_CRIMSON:
+               {
+                       return TV_NO_AMMO;
+               }
+       }
+       
+       return 0;
+}
+
+/* calcurate the fire rate of target object */
+s16b calc_num_fire(object_type *o_ptr)
+{
+       int extra_shots = 0;
+       int i;
+       int num = 0;
+       int tval_ammo = bow_tval_ammo(o_ptr);
+       object_type *q_ptr;
+       u32b flgs[TR_FLAG_SIZE];
+       
+       /* Scan the usable inventory */
+       for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
+       {
+               q_ptr = &inventory[i];
+
+               /* Skip non-objects */
+               if (!q_ptr->k_idx) continue;
+               
+               /* Do not apply current equip */
+               if (i == INVEN_BOW) continue;
+
+               /* Extract the item flags */
+               object_flags(q_ptr, flgs);
+
+               /* Boost shots */
+               if (have_flag(flgs, TR_XTRA_SHOTS)) extra_shots++;
+       }
+       
+       object_flags(o_ptr, flgs);
+       if (have_flag(flgs, TR_XTRA_SHOTS)) extra_shots++;
+       
+       if (o_ptr->k_idx && !is_heavy_shoot(o_ptr))
+       {
+               num = 100;
+               /* Extra shots */
+               num += (extra_shots * 100);
+
+               /* Hack -- Rangers love Bows */
+               if ((p_ptr->pclass == CLASS_RANGER) && 
+                                       (tval_ammo == TV_ARROW))
+               {
+                       num += (p_ptr->lev * 4);
+               }
+
+               if ((p_ptr->pclass == CLASS_CAVALRY) &&
+                   (tval_ammo == TV_ARROW))
+               {
+                       num += (p_ptr->lev * 3);
+               }
+
+               if (p_ptr->pclass == CLASS_ARCHER)
+               {
+                       if (tval_ammo == TV_ARROW)
+                               num += ((p_ptr->lev * 5)+50);
+                       else if ((tval_ammo == TV_BOLT) || (tval_ammo == TV_SHOT))
+                               num += (p_ptr->lev * 4);
+               }
+
+               /*
+                * Addendum -- also "Reward" high level warriors,
+                * with _any_ missile weapon -- TY
+                */
+               if (p_ptr->pclass == CLASS_WARRIOR &&
+                  (tval_ammo <= TV_BOLT) &&
+                  (tval_ammo >= TV_SHOT))
+               {
+                       num += (p_ptr->lev * 2);
+               }
+               if ((p_ptr->pclass == CLASS_ROGUE) &&
+                   (tval_ammo == TV_SHOT))
+               {
+                       num += (p_ptr->lev * 4);
+               }
+       }
+       return num;
+}
 
 /*
  * Calculate the players current "state", taking into account
@@ -3025,7 +3253,6 @@ void calc_bonuses(void)
        int             default_hand = 0;
        int             empty_hands_status = empty_hands(TRUE);
        int             extra_blows[2];
-       int             extra_shots;
        object_type     *o_ptr;
        u32b flgs[TR_FLAG_SIZE];
        bool            omoi = FALSE;
@@ -3038,7 +3265,7 @@ void calc_bonuses(void)
        bool            easy_2weapon = FALSE;
        bool            riding_levitation = FALSE;
        s16b this_o_idx, next_o_idx = 0;
-       player_race *tmp_rp_ptr;
+       const player_race *tmp_rp_ptr;
 
        /* Save the old vision stuff */
        bool old_telepathy = p_ptr->telepathy;
@@ -3063,7 +3290,7 @@ void calc_bonuses(void)
 
 
        /* Clear extra blows/shots */
-       extra_blows[0] = extra_blows[1] = extra_shots = 0;
+       extra_blows[0] = extra_blows[1] = 0;
 
        /* Clear the stat modifiers */
        for (i = 0; i < 6; i++) p_ptr->stat_add[i] = 0;
@@ -3966,13 +4193,24 @@ void calc_bonuses(void)
                /* Hack -- cause earthquakes */
                if (have_flag(flgs, TR_IMPACT)) p_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
 
-               /* Boost shots */
-               if (have_flag(flgs, TR_XTRA_SHOTS)) extra_shots++;
-
                /* Various flags */
                if (have_flag(flgs, TR_AGGRAVATE))   p_ptr->cursed |= TRC_AGGRAVATE;
                if (have_flag(flgs, TR_DRAIN_EXP))   p_ptr->cursed |= TRC_DRAIN_EXP;
                if (have_flag(flgs, TR_TY_CURSE))    p_ptr->cursed |= TRC_TY_CURSE;
+               if (have_flag(flgs, TR_ADD_L_CURSE)) p_ptr->cursed |= TRC_ADD_L_CURSE;
+               if (have_flag(flgs, TR_ADD_H_CURSE)) p_ptr->cursed |= TRC_ADD_H_CURSE;
+               if (have_flag(flgs, TR_DRAIN_HP))    p_ptr->cursed |= TRC_DRAIN_HP;
+               if (have_flag(flgs, TR_DRAIN_MANA))  p_ptr->cursed |= TRC_DRAIN_MANA;
+               if (have_flag(flgs, TR_CALL_ANIMAL)) p_ptr->cursed |= TRC_CALL_ANIMAL;
+               if (have_flag(flgs, TR_CALL_DEMON))  p_ptr->cursed |= TRC_CALL_DEMON;
+               if (have_flag(flgs, TR_CALL_DRAGON)) p_ptr->cursed |= TRC_CALL_DRAGON;
+               if (have_flag(flgs, TR_CALL_UNDEAD)) p_ptr->cursed |= TRC_CALL_UNDEAD;
+               if (have_flag(flgs, TR_COWARDICE))   p_ptr->cursed |= TRC_COWARDICE;
+               if (have_flag(flgs, TR_LOW_MELEE))   p_ptr->cursed |= TRC_LOW_MELEE;
+               if (have_flag(flgs, TR_LOW_AC))      p_ptr->cursed |= TRC_LOW_AC;
+               if (have_flag(flgs, TR_LOW_MAGIC))   p_ptr->cursed |= TRC_LOW_MAGIC;
+               if (have_flag(flgs, TR_FAST_DIGEST)) p_ptr->cursed |= TRC_FAST_DIGEST;
+               if (have_flag(flgs, TR_SLOW_REGEN))  p_ptr->cursed |= TRC_SLOW_REGEN;
                if (have_flag(flgs, TR_DEC_MANA))    p_ptr->dec_mana = TRUE;
                if (have_flag(flgs, TR_BLESSED))     p_ptr->bless_blade = TRUE;
                if (have_flag(flgs, TR_XTRA_MIGHT))  p_ptr->xtra_might = TRUE;
@@ -4776,97 +5014,25 @@ void calc_bonuses(void)
        /* Examine the "current bow" */
        o_ptr = &inventory[INVEN_BOW];
 
-
-       /* Assume not heavy */
-       p_ptr->heavy_shoot = FALSE;
-
        /* It is hard to carholdry a heavy bow */
-       if (hold < o_ptr->weight / 10)
+       p_ptr->heavy_shoot = is_heavy_shoot(o_ptr);
+       if (p_ptr->heavy_shoot)
        {
                /* Hard to wield a heavy bow */
                p_ptr->to_h_b  += 2 * (hold - o_ptr->weight / 10);
                p_ptr->dis_to_h_b  += 2 * (hold - o_ptr->weight / 10);
-
-               /* Heavy Bow */
-               p_ptr->heavy_shoot = TRUE;
        }
 
-
        /* Compute "extra shots" if needed */
        if (o_ptr->k_idx)
        {
-               /* Analyze the launcher */
-               switch (o_ptr->sval)
-               {
-                       case SV_SLING:
-                       {
-                               p_ptr->tval_ammo = TV_SHOT;
-                               break;
-                       }
-
-                       case SV_SHORT_BOW:
-                       case SV_LONG_BOW:
-                       case SV_NAMAKE_BOW:
-                       {
-                               p_ptr->tval_ammo = TV_ARROW;
-                               break;
-                       }
-
-                       case SV_LIGHT_XBOW:
-                       case SV_HEAVY_XBOW:
-                       {
-                               p_ptr->tval_ammo = TV_BOLT;
-                               break;
-                       }
-                       case SV_CRIMSON:
-                       {
-                               p_ptr->tval_ammo = TV_NO_AMMO;
-                               break;
-                       }
-               }
+               p_ptr->tval_ammo = bow_tval_ammo(o_ptr);
 
                /* Apply special flags */
                if (o_ptr->k_idx && !p_ptr->heavy_shoot)
                {
                        /* Extra shots */
-                       p_ptr->num_fire += (extra_shots * 100);
-
-                       /* Hack -- Rangers love Bows */
-                       if ((p_ptr->pclass == CLASS_RANGER) &&
-                           (p_ptr->tval_ammo == TV_ARROW))
-                       {
-                               p_ptr->num_fire += (p_ptr->lev * 4);
-                       }
-
-                       if ((p_ptr->pclass == CLASS_CAVALRY) &&
-                           (p_ptr->tval_ammo == TV_ARROW))
-                       {
-                               p_ptr->num_fire += (p_ptr->lev * 3);
-                       }
-
-                       if (p_ptr->pclass == CLASS_ARCHER)
-                       {
-                               if (p_ptr->tval_ammo == TV_ARROW)
-                                       p_ptr->num_fire += ((p_ptr->lev * 5)+50);
-                               else if ((p_ptr->tval_ammo == TV_BOLT) || (p_ptr->tval_ammo == TV_SHOT))
-                                       p_ptr->num_fire += (p_ptr->lev * 4);
-                       }
-
-                       /*
-                        * Addendum -- also "Reward" high level warriors,
-                        * with _any_ missile weapon -- TY
-                        */
-                       if (p_ptr->pclass == CLASS_WARRIOR &&
-                          (p_ptr->tval_ammo <= TV_BOLT) &&
-                          (p_ptr->tval_ammo >= TV_SHOT))
-                       {
-                               p_ptr->num_fire += (p_ptr->lev * 2);
-                       }
-                       if ((p_ptr->pclass == CLASS_ROGUE) &&
-                           (p_ptr->tval_ammo == TV_SHOT))
-                       {
-                               p_ptr->num_fire += (p_ptr->lev * 4);
-                       }
+                       p_ptr->num_fire = calc_num_fire(o_ptr);
 
                        /* Snipers love Cross bows */
                        if ((p_ptr->pclass == CLASS_SNIPER) &&
@@ -4994,18 +5160,18 @@ void calc_bonuses(void)
                                case CLASS_SORCERER:
                                        num = 1; wgt = 1; mul = 1; break;
 
-                               /* Archer, Bard */
+                               /* Archer, Bard, Sniper */
                                case CLASS_ARCHER:
                                case CLASS_BARD:
+                               case CLASS_SNIPER:
                                        num = 4; wgt = 70; mul = 2; break;
 
                                /* ForceTrainer */
                                case CLASS_FORCETRAINER:
                                        num = 4; wgt = 60; mul = 2; break;
 
-                               /* Mirror Master, Sniper */
+                               /* Mirror Master */
                                case CLASS_MIRROR_MASTER:
-                               case CLASS_SNIPER:
                                        num = 3; wgt = 100; mul = 3; break;
 
                                /* Ninja */
@@ -5729,25 +5895,25 @@ msg_print("
 #if 0
        if (have_dd_s && ((p_ptr->realm1 == REALM_SORCERY) || (p_ptr->realm2 == REALM_SORCERY) || (p_ptr->pclass == CLASS_SORCERER)))
        {
-               magic_type *s_ptr = &mp_ptr->info[REALM_SORCERY-1][SPELL_DD_S];
+               const magic_type *s_ptr = &mp_ptr->info[REALM_SORCERY-1][SPELL_DD_S];
                if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
        }
 
        if (have_dd_t && ((p_ptr->realm1 == REALM_TRUMP) || (p_ptr->realm2 == REALM_TRUMP) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)))
        {
-               magic_type *s_ptr = &mp_ptr->info[REALM_TRUMP-1][SPELL_DD_T];
+               const magic_type *s_ptr = &mp_ptr->info[REALM_TRUMP-1][SPELL_DD_T];
                if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
        }
 #endif
        if (have_sw && ((p_ptr->realm1 == REALM_NATURE) || (p_ptr->realm2 == REALM_NATURE) || (p_ptr->pclass == CLASS_SORCERER)))
        {
-               magic_type *s_ptr = &mp_ptr->info[REALM_NATURE-1][SPELL_SW];
+               const magic_type *s_ptr = &mp_ptr->info[REALM_NATURE-1][SPELL_SW];
                if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
        }
 
        if (have_kabe && ((p_ptr->realm1 == REALM_CRAFT) || (p_ptr->realm2 == REALM_CRAFT) || (p_ptr->pclass == CLASS_SORCERER)))
        {
-               magic_type *s_ptr = &mp_ptr->info[REALM_CRAFT-1][SPELL_KABE];
+               const magic_type *s_ptr = &mp_ptr->info[REALM_CRAFT-1][SPELL_KABE];
                if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
        }
 }
@@ -6146,7 +6312,14 @@ void window_stuff(void)
                p_ptr->window &= ~(PW_PLAYER);
                fix_player();
        }
-
+       
+       /* Display monster list */
+       if (p_ptr->window & (PW_MONSTER_LIST))
+       {
+               p_ptr->window &= ~(PW_MONSTER_LIST);
+               fix_monster_list();
+       }
+       
        /* Display overhead view */
        if (p_ptr->window & (PW_MESSAGE))
        {
@@ -6234,3 +6407,14 @@ bool heavy_armor(void)
 
        return (monk_arm_wgt > (100 + (p_ptr->lev * 4)));
 }
+
+void update_playtime(void)
+{
+       /* Check if the game has started */
+       if (start_time != 0)
+       {
+               u32b tmp = time(NULL);
+               playtime += (tmp - start_time);
+               start_time = tmp;
+       }
+}