put_str("HP", ROW_CURHP, COL_CURHP);
/* ¸½ºß¤Î¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4ld", p_ptr->chp);
+ sprintf(tmp, "%4ld", (long int)p_ptr->chp);
if (p_ptr->chp >= p_ptr->mhp)
{
put_str( "/", ROW_CURHP, COL_CURHP + 7 );
/* ºÇÂç¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4ld", p_ptr->mhp);
+ sprintf(tmp, "%4ld", (long int)p_ptr->mhp);
color = TERM_L_GREEN;
c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 8 );
#endif
/* ¸½ºß¤Î¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4ld", p_ptr->csp);
+ sprintf(tmp, "%4ld", (long int)p_ptr->csp);
if (p_ptr->csp >= p_ptr->msp)
{
put_str( "/", ROW_CURSP, COL_CURSP + 7 );
/* ºÇÂç¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4ld", p_ptr->msp);
+ sprintf(tmp, "%4ld", (long int)p_ptr->msp);
color = TERM_L_GREEN;
c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 8);
*/
static void prt_hunger(void)
{
+ if(p_ptr->wizard && p_ptr->inside_arena) return;
+
/* Fainting / Starving */
if (p_ptr->food < PY_FOOD_FAINT)
{
m_ptr = &m_list[health_who];
- /* Not tracking */
- if (!health_who)
+ if (p_ptr->wizard && p_ptr->inside_battle)
{
- /* Erase the health bar */
- Term_erase(col, row, 12);
- }
+ row = ROW_INFO - 2;
+ col = COL_INFO + 2;
- /* Tracking an unseen monster */
- else if (!m_ptr->ml)
- {
- /* Indicate that the monster health is "unknown" */
- Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
- }
+ Term_putstr(col - 2, row, 12, TERM_WHITE, " / ");
+ Term_putstr(col - 2, row + 1, 12, TERM_WHITE, " / ");
+ Term_putstr(col - 2, row + 2, 12, TERM_WHITE, " / ");
+ Term_putstr(col - 2, row + 3, 12, TERM_WHITE, " / ");
- /* Tracking a hallucinatory monster */
- else if (p_ptr->image)
- {
- /* Indicate that the monster health is "unknown" */
- Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
- }
+ if(m_list[1].r_idx)
+ {
+ Term_putstr(col - 2, row, 2, r_info[m_list[1].r_idx].x_attr, format("%c", r_info[m_list[1].r_idx].x_char));
+ Term_putstr(col - 1, row, 5, TERM_WHITE, format("%5d", m_list[1].hp));
+ Term_putstr(col + 5, row, 6, TERM_WHITE, format("%5d", m_list[1].max_maxhp));
+ }
- /* Tracking a dead monster (???) */
- else if (m_ptr->hp < 0)
- {
- /* Indicate that the monster health is "unknown" */
- Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
- }
+ if(m_list[2].r_idx)
+ {
+ Term_putstr(col - 2, row + 1, 2, r_info[m_list[2].r_idx].x_attr, format("%c", r_info[m_list[2].r_idx].x_char));
+ Term_putstr(col - 1, row + 1, 5, TERM_WHITE, format("%5d", m_list[2].hp));
+ Term_putstr(col + 5, row + 1, 6, TERM_WHITE, format("%5d", m_list[2].max_maxhp));
+ }
+
+ if(m_list[3].r_idx)
+ {
+ Term_putstr(col - 2, row + 2, 2, r_info[m_list[3].r_idx].x_attr, format("%c", r_info[m_list[3].r_idx].x_char));
+ Term_putstr(col - 1, row + 2, 5, TERM_WHITE, format("%5d", m_list[3].hp));
+ Term_putstr(col + 5, row + 2, 6, TERM_WHITE, format("%5d", m_list[3].max_maxhp));
+ }
- /* Tracking a visible monster */
+ if(m_list[4].r_idx)
+ {
+ Term_putstr(col - 2, row + 3, 2, r_info[m_list[4].r_idx].x_attr, format("%c", r_info[m_list[4].r_idx].x_char));
+ Term_putstr(col - 1, row + 3, 5, TERM_WHITE, format("%5d", m_list[4].hp));
+ Term_putstr(col + 5, row + 3, 6, TERM_WHITE, format("%5d", m_list[4].max_maxhp));
+ }
+ }
else
{
- /* Extract the "percent" of health */
- int pct = 100L * m_ptr->hp / m_ptr->maxhp;
- int pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
- /* Convert percent into "health" */
- int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
+ /* Not tracking */
+ if (!health_who)
+ {
+ /* Erase the health bar */
+ Term_erase(col, row, 12);
+ }
- /* Default to almost dead */
- byte attr = TERM_RED;
+ /* Tracking an unseen monster */
+ else if (!m_ptr->ml)
+ {
+ /* Indicate that the monster health is "unknown" */
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
+ }
- /* Invulnerable */
- if (MON_INVULNER(m_ptr)) attr = TERM_WHITE;
+ /* Tracking a hallucinatory monster */
+ else if (p_ptr->image)
+ {
+ /* Indicate that the monster health is "unknown" */
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
+ }
- /* Asleep */
- else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE;
+ /* Tracking a dead monster (???) */
+ else if (m_ptr->hp < 0)
+ {
+ /* Indicate that the monster health is "unknown" */
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
+ }
- /* Afraid */
- else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET;
+ /* Tracking a visible monster */
+ else
+ {
+ /* Extract the "percent" of health */
+ int pct = 100L * m_ptr->hp / m_ptr->maxhp;
+ int pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
- /* Healthy */
- else if (pct >= 100) attr = TERM_L_GREEN;
+ /* Convert percent into "health" */
+ int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
- /* Somewhat Wounded */
- else if (pct >= 60) attr = TERM_YELLOW;
+ /* Default to almost dead */
+ byte attr = TERM_RED;
- /* Wounded */
- else if (pct >= 25) attr = TERM_ORANGE;
+ /* Invulnerable */
+ if (MON_INVULNER(m_ptr)) attr = TERM_WHITE;
- /* Badly wounded */
- else if (pct >= 10) attr = TERM_L_RED;
+ /* Asleep */
+ else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE;
- /* Default to "unknown" */
- Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
+ /* Afraid */
+ else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET;
- /* Dump the current "health" (use '*' symbols) */
- Term_putstr(col + 1, row, len, attr, "**********");
+ /* Healthy */
+ else if (pct >= 100) attr = TERM_L_GREEN;
+
+ /* Somewhat Wounded */
+ else if (pct >= 60) attr = TERM_YELLOW;
+
+ /* Wounded */
+ else if (pct >= 25) attr = TERM_ORANGE;
+
+ /* Badly wounded */
+ else if (pct >= 10) attr = TERM_L_RED;
+
+ /* Default to "unknown" */
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
+
+ /* Dump the current "health" (use '*' symbols) */
+ Term_putstr(col + 1, row, len, attr, "**********");
+ }
}
}
}
+/*
+ * 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
int num_allowed;
int num_boukyaku = 0;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
int which;
int bonus = 0;
/* 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 */
*/
static void calc_torch(void)
{
- int i;
+ int i, rad;
object_type *o_ptr;
u32b flgs[TR_FLAG_SIZE];
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))
+ if (o_ptr->tval == TV_LITE)
{
- p_ptr->cur_lite += 1;
+ if((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0)) continue;
+ if((o_ptr->sval == SV_LITE_LANTERN) && !(o_ptr->xtra4 > 0)) continue;
}
-
- /* 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))
- {
- p_ptr->cur_lite += 3;
- }
-
- 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 -- */
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
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;
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;
/* 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;
/* 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;
/* 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) &&
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 */
#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;
}
}
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))
{
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;
+ }
+}