*/
void extract_day_hour_min(int *day, int *hour, int *min)
{
- s32b len = TURNS_PER_TICK * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
+ const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
+ s32b turn_in_today = (turn + A_DAY / 4) % A_DAY;
switch (p_ptr->start_race)
{
case RACE_SKELETON:
case RACE_ZOMBIE:
case RACE_SPECTRE:
- *day = (turn - (TURNS_PER_TICK * TOWN_DAWN * 3 / 4)) / len + 1;
+ *day = (turn - A_DAY * 3 / 4) / A_DAY + 1;
break;
default:
- *day = (turn + (TURNS_PER_TICK * TOWN_DAWN / 4)) / len + 1;
+ *day = (turn + A_DAY / 4) / A_DAY + 1;
break;
}
- *hour = (24 * tick / len) % 24;
- *min = (1440 * tick / len) % 60;
+ *hour = (24 * turn_in_today / A_DAY) % 24;
+ *min = (1440 * turn_in_today / A_DAY) % 60;
}
/*
extract_day_hour_min(&day, &hour, &min);
/* Dump the info itself */
- c_put_str(TERM_WHITE, format(
#ifdef JP
- "%2dÆüÌÜ",
+ if (day < 1000) c_put_str(TERM_WHITE, format("%2dÆüÌÜ", day), ROW_DAY, COL_DAY);
+ else c_put_str(TERM_WHITE, "***ÆüÌÜ", ROW_DAY, COL_DAY);
#else
- "Day %-2d",
+ if (day < 1000) c_put_str(TERM_WHITE, format("Day%3d", day), ROW_DAY, COL_DAY);
+ else c_put_str(TERM_WHITE, "Day***", ROW_DAY, COL_DAY);
#endif
- day), ROW_DAY, COL_DAY);
-
+
c_put_str(TERM_WHITE, format("%2d:%02d", hour, min), ROW_DAY, COL_DAY+7);
}
#define BAR_SUPERSTEALTH 50
#define BAR_RECALL 51
#define BAR_ALTER 52
-
+#define BAR_SHCOLD 53
+#define BAR_SHELEC 54
+#define BAR_SHSHADOW 55
+#define BAR_MIGHT 56
+#define BAR_BUILD 57
+#define BAR_ANTIMULTI 58
+#define BAR_ANTITELE 59
+#define BAR_ANTIMAGIC 60
+#define BAR_PATIENCE 61
+#define BAR_REVENGE 62
+#define BAR_RUNESWORD 63
+#define BAR_VAMPILIC 64
+#define BAR_CURE 65
+#define BAR_ESP_EVIL 66
static struct {
byte attr;
{TERM_YELLOW, "±£", "Ķ±£Ì©"},
{TERM_WHITE, "µ¢", "µ¢´Ô"},
{TERM_WHITE, "¸½", "¸½¼ÂÊÑÍÆ"},
+ /* Hex */
+ {TERM_WHITE, "¥ª", "ɹ¥ª¡¼¥é"},
+ {TERM_BLUE, "¥ª", "ÅÅ¥ª¡¼¥é"},
+ {TERM_L_DARK, "¥ª", "±Æ¥ª¡¼¥é"},
+ {TERM_YELLOW, "ÏÓ", "ÏÓÎ϶¯²½"},
+ {TERM_RED, "Æù", "ÆùÂζ¯²½"},
+ {TERM_L_DARK, "¿£", "È¿Áý¿£"},
+ {TERM_ORANGE, "¥Æ", "È¿¥Æ¥ì¥Ý"},
+ {TERM_RED, "Ëâ", "È¿ËâË¡"},
+ {TERM_SLATE, "²æ", "²æËý"},
+ {TERM_SLATE, "Àë", "Àë¹ð"},
+ {TERM_L_DARK, "·õ", "Ëâ·õ²½"},
+ {TERM_RED, "µÛ", "µÛ·ìÂÇ·â"},
+ {TERM_WHITE, "²ó", "²óÉü"},
+ {TERM_L_DARK, "´¶", "¼Ù°´¶ÃÎ"},
{0, NULL, NULL}
};
#else
= {
{TERM_YELLOW, "Ts", "Tsuyoshi"},
- {TERM_VIOLET, "Hu", "Hullc"},
+ {TERM_VIOLET, "Ha", "Halluc"},
{TERM_L_DARK, "Bl", "Blind"},
{TERM_RED, "Pa", "Paralyzed"},
{TERM_VIOLET, "Cf", "Confused"},
{TERM_YELLOW, "Stlt", "Stealth"},
{TERM_WHITE, "Rc", "Recall"},
{TERM_WHITE, "Al", "Alter"},
+ /* Hex */
+ {TERM_WHITE, "SCo", "SCold"},
+ {TERM_BLUE, "SEl", "SElec"},
+ {TERM_L_DARK, "SSh", "SShadow"},
+ {TERM_YELLOW, "EMi", "ExMight"},
+ {TERM_RED, "Bu", "BuildUp"},
+ {TERM_L_DARK, "AMl", "AntiMulti"},
+ {TERM_ORANGE, "AT", "AntiTele"},
+ {TERM_RED, "AM", "AntiMagic"},
+ {TERM_SLATE, "Pa", "Patience"},
+ {TERM_SLATE, "Rv", "Revenge"},
+ {TERM_L_DARK, "Rs", "RuneSword"},
+ {TERM_RED, "Vm", "Vampiric"},
+ {TERM_WHITE, "Cu", "Cure"},
+ {TERM_L_DARK, "ET", "EvilTele"},
{0, NULL, NULL}
};
#endif
*/
static void prt_status(void)
{
- u32b bar_flags[2];
+ u32b bar_flags[3];
int wid, hgt, row_statbar, max_col_statbar;
int i, col = 0, num = 0;
int space = 2;
Term_erase(0, row_statbar, max_col_statbar);
- bar_flags[0] = bar_flags[1] = 0L;
+ bar_flags[0] = bar_flags[1] = bar_flags[2] = 0L;
/* Tsuyoshi */
if (p_ptr->tsuyoshi) ADD_FLG(BAR_TSUYOSHI);
if (p_ptr->ult_res) ADD_FLG(BAR_ULTIMATE);
/* tim levitation */
- if (p_ptr->tim_ffall) ADD_FLG(BAR_LEVITATE);
+ if (p_ptr->tim_levitation) ADD_FLG(BAR_LEVITATE);
if (p_ptr->tim_res_nether) ADD_FLG(BAR_RESNETH);
/* An Eye for an Eye */
if (p_ptr->tim_eyeeye) ADD_FLG(BAR_EYEEYE);
+ /* Hex spells */
+ if (p_ptr->realm1 == REALM_HEX)
+ {
+ if (hex_spelling(HEX_BLESS)) ADD_FLG(BAR_BLESSED);
+ if (hex_spelling(HEX_DEMON_AURA)) { ADD_FLG(BAR_SHFIRE); ADD_FLG(BAR_REGENERATION); }
+ if (hex_spelling(HEX_XTRA_MIGHT)) ADD_FLG(BAR_MIGHT);
+ if (hex_spelling(HEX_DETECT_EVIL)) ADD_FLG(BAR_ESP_EVIL);
+ if (hex_spelling(HEX_ICE_ARMOR)) ADD_FLG(BAR_SHCOLD);
+ if (hex_spelling(HEX_RUNESWORD)) ADD_FLG(BAR_RUNESWORD);
+ if (hex_spelling(HEX_BUILDING)) ADD_FLG(BAR_BUILD);
+ if (hex_spelling(HEX_ANTI_TELE)) ADD_FLG(BAR_ANTITELE);
+ if (hex_spelling(HEX_SHOCK_CLOAK)) ADD_FLG(BAR_SHELEC);
+ if (hex_spelling(HEX_SHADOW_CLOAK)) ADD_FLG(BAR_SHSHADOW);
+ if (hex_spelling(HEX_CONFUSION)) ADD_FLG(BAR_ATTKCONF);
+ if (hex_spelling(HEX_EYE_FOR_EYE)) ADD_FLG(BAR_EYEEYE);
+ if (hex_spelling(HEX_ANTI_MULTI)) ADD_FLG(BAR_ANTIMULTI);
+ if (hex_spelling(HEX_VAMP_BLADE)) ADD_FLG(BAR_VAMPILIC);
+ if (hex_spelling(HEX_ANTI_MAGIC)) ADD_FLG(BAR_ANTIMAGIC);
+ if (hex_spelling(HEX_CURE_LIGHT) ||
+ hex_spelling(HEX_CURE_SERIOUS) ||
+ hex_spelling(HEX_CURE_CRITICAL)) ADD_FLG(BAR_CURE);
+
+ if (p_ptr->magic_num2[2])
+ {
+ if (p_ptr->magic_num2[1] == 1) ADD_FLG(BAR_PATIENCE);
+ if (p_ptr->magic_num2[1] == 2) ADD_FLG(BAR_REVENGE);
+ }
+ }
+
/* Calcurate length */
for (i = 0; bar[i].sstr; i++)
{
{
char out_val[32];
+ if ((!exp_need)||(p_ptr->prace == RACE_ANDROID))
+ {
#ifdef JP
-(void)sprintf(out_val, "%7ld", (long)p_ptr->exp);
+ (void)sprintf(out_val, "%7ld", (long)p_ptr->exp);
#else
(void)sprintf(out_val, "%8ld", (long)p_ptr->exp);
#endif
-
+ }
+ else
+ {
+ if (p_ptr->lev >= PY_MAX_LEVEL)
+ {
+ (void)sprintf(out_val, "********");
+ }
+ else
+ {
+#ifdef JP
+ (void)sprintf(out_val, "%7ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp);
+#else
+ (void)sprintf(out_val, "%8ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp);
+#endif
+ }
+ }
if (p_ptr->exp >= p_ptr->max_exp)
{
}
}
-
/*
* Prints current gold
*/
put_str("HP", ROW_CURHP, COL_CURHP);
/* ¸½ºß¤Î¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", 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, "%4d", 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, "%4d", p_ptr->csp);
+ sprintf(tmp, "%4ld", (long int)p_ptr->csp);
if (p_ptr->csp >= p_ptr->msp)
{
color = TERM_L_GREEN;
}
- else if (p_ptr->csp > p_ptr->msp / 5)
+ else if (p_ptr->csp > (p_ptr->msp * mana_warn) / 10)
{
color = TERM_YELLOW;
}
put_str( "/", ROW_CURSP, COL_CURSP + 7 );
/* ºÇÂç¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", 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);
{
char depths[32];
int wid, hgt, row_depth, col_depth;
+ byte attr = TERM_WHITE;
Term_get_size(&wid, &hgt);
col_depth = wid + COL_DEPTH;
else if (p_ptr->inside_quest && !dungeon_type)
{
#ifdef JP
-strcpy(depths, "ÃϾå");
+ strcpy(depths, "ÃϾå");
#else
strcpy(depths, "Quest");
#endif
-
- }
- else if (depth_in_feet)
- {
-#ifdef JP
-(void)sprintf(depths, "%d ft", dun_level * 50);
-#else
- (void)sprintf(depths, "%d ft", dun_level * 50);
-#endif
-
}
else
{
#ifdef JP
-sprintf(depths, "%d ³¬", dun_level);
+ if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50);
+ else (void)sprintf(depths, "%d ³¬", dun_level);
#else
- (void)sprintf(depths, "Lev %d", dun_level);
+ if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50);
+ else (void)sprintf(depths, "Lev %d", dun_level);
#endif
+
+ /* Get color of level based on feeling -JSV- */
+ 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 */
+ }
}
/* Right-Adjust the "depth", and clear old values */
- prt(format("%7s", depths), row_depth, col_depth);
+ c_prt(attr, format("%7s", depths), row_depth, col_depth);
}
#endif
break;
}
+ case ACTION_SPELL:
+ {
+#ifdef JP
+ strcpy(text, "±Ó¾§");
+#else
+ strcpy(text, "Spel");
+#endif
+ break;
+ }
default:
{
strcpy(text, " ");
row_speed = hgt + ROW_SPEED;
/* Hack -- Visually "undo" the Search Mode Slowdown */
- if (p_ptr->action == ACTION_SEARCH) i += 10;
+ if (p_ptr->action == ACTION_SEARCH && !p_ptr->lightspeed) i += 10;
/* Fast */
if (i > 110)
{
if (p_ptr->riding)
{
- if (m_list[p_ptr->riding].fast && !m_list[p_ptr->riding].slow) attr = TERM_L_BLUE;
- else if (m_list[p_ptr->riding].slow && !m_list[p_ptr->riding].fast) attr = TERM_VIOLET;
+ monster_type *m_ptr = &m_list[p_ptr->riding];
+ if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
+ else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_GREEN;
}
else if ((is_fast && !p_ptr->slow) || p_ptr->lightspeed) attr = TERM_YELLOW;
{
if (p_ptr->riding)
{
- if (m_list[p_ptr->riding].fast && !m_list[p_ptr->riding].slow) attr = TERM_L_BLUE;
- else if (m_list[p_ptr->riding].slow && !m_list[p_ptr->riding].fast) attr = TERM_VIOLET;
+ monster_type *m_ptr = &m_list[p_ptr->riding];
+ if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
+ else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_RED;
}
else if (is_fast && !p_ptr->slow) attr = TERM_YELLOW;
}
-static void prt_mane(void)
+static void prt_imitation(void)
{
int wid, hgt, row_study, col_study;
#ifdef JP
c_put_str(attr, "¤Þ¤Í", row_study, col_study);
#else
- c_put_str(attr, "Mane", row_study, col_study);
+ c_put_str(attr, "Imit", row_study, col_study);
#endif
}
else
* Auto-track current target monster when bored. Note that the
* health-bar stops tracking any monster that "disappears".
*/
-static void health_redraw(void)
+static void health_redraw(bool riding)
{
+ s16b health_who;
+ int row, col;
+ monster_type *m_ptr;
+
+ if (riding)
+ {
+ health_who = p_ptr->riding;
+ row = ROW_RIDING_INFO;
+ col = COL_RIDING_INFO;
+ }
+ else
+ {
+ health_who = p_ptr->health_who;
+ row = ROW_INFO;
+ col = COL_INFO;
+ }
-#ifdef DRS_SHOW_HEALTH_BAR
+ m_ptr = &m_list[health_who];
/* Not tracking */
- if (!p_ptr->health_who)
+ if (!health_who)
{
/* Erase the health bar */
- Term_erase(COL_INFO, ROW_INFO, 12);
+ Term_erase(col, row, 12);
}
/* Tracking an unseen monster */
- else if (!m_list[p_ptr->health_who].ml)
+ else if (!m_ptr->ml)
{
/* Indicate that the monster health is "unknown" */
- Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]");
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
}
/* Tracking a hallucinatory monster */
else if (p_ptr->image)
{
/* Indicate that the monster health is "unknown" */
- Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]");
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
}
/* Tracking a dead monster (???) */
- else if (!m_list[p_ptr->health_who].hp < 0)
+ else if (m_ptr->hp < 0)
{
/* Indicate that the monster health is "unknown" */
- Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]");
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
}
/* Tracking a visible monster */
else
{
- int pct, pct2, len;
-
- monster_type *m_ptr = &m_list[p_ptr->health_who];
-
- /* Default to almost dead */
- byte attr = TERM_RED;
-
/* Extract the "percent" of health */
- pct = 100L * m_ptr->hp / m_ptr->maxhp;
- pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
-
- /* Badly wounded */
- if (pct >= 10) attr = TERM_L_RED;
-
- /* Wounded */
- if (pct >= 25) attr = TERM_ORANGE;
-
- /* Somewhat Wounded */
- if (pct >= 60) attr = TERM_YELLOW;
-
- /* Healthy */
- if (pct >= 100) attr = TERM_L_GREEN;
-
- /* Afraid */
- if (m_ptr->monfear) attr = TERM_VIOLET;
-
- /* Asleep */
- if (m_ptr->csleep) attr = TERM_BLUE;
-
- /* Invulnerable */
- if (m_ptr->invulner) attr = TERM_WHITE;
+ int pct = 100L * m_ptr->hp / m_ptr->maxhp;
+ int pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
/* Convert percent into "health" */
- len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
-
- /* Default to "unknown" */
- Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]");
-
- /* Dump the current "health" (use '*' symbols) */
- Term_putstr(COL_INFO + 1, ROW_INFO, len, attr, "**********");
- }
-
-#endif
-
-}
-
-
-
-static void riding_health_redraw(void)
-{
-
-#ifdef DRS_SHOW_HEALTH_BAR
-
- /* Not tracking */
- if (!p_ptr->riding)
- {
- /* Erase the health bar */
- Term_erase(COL_RIDING_INFO, ROW_RIDING_INFO, 12);
- }
-
- /* Tracking a hallucinatory monster */
- else if (p_ptr->image)
- {
- /* Indicate that the monster health is "unknown" */
- Term_putstr(COL_RIDING_INFO, ROW_RIDING_INFO, 12, TERM_WHITE, "[----------]");
- }
-
- /* Tracking a dead monster (???) */
- else if (!m_list[p_ptr->health_who].hp < 0)
- {
- /* Indicate that the monster health is "unknown" */
- Term_putstr(COL_RIDING_INFO, ROW_RIDING_INFO, 12, TERM_WHITE, "[----------]");
- }
-
- /* Tracking a visible monster */
- else
- {
- int pct, pct2, len;
-
- monster_type *m_ptr = &m_list[p_ptr->riding];
+ int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
/* Default to almost dead */
byte attr = TERM_RED;
- /* Extract the "percent" of health */
- pct = 100L * m_ptr->hp / m_ptr->maxhp;
- pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
-
- /* Badly wounded */
- if (pct >= 10) attr = TERM_L_RED;
+ /* Invulnerable */
+ if (MON_INVULNER(m_ptr)) attr = TERM_WHITE;
- /* Wounded */
- if (pct >= 25) attr = TERM_ORANGE;
+ /* Asleep */
+ else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE;
- /* Somewhat Wounded */
- if (pct >= 60) attr = TERM_YELLOW;
+ /* Afraid */
+ else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET;
/* Healthy */
- if (pct >= 100) attr = TERM_L_GREEN;
-
- /* Afraid */
- if (m_ptr->monfear) attr = TERM_VIOLET;
+ else if (pct >= 100) attr = TERM_L_GREEN;
- /* Asleep */
- if (m_ptr->csleep) attr = TERM_BLUE;
+ /* Somewhat Wounded */
+ else if (pct >= 60) attr = TERM_YELLOW;
- /* Invulnerable */
- if (m_ptr->invulner) attr = TERM_WHITE;
+ /* Wounded */
+ else if (pct >= 25) attr = TERM_ORANGE;
- /* Convert percent into "health" */
- len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
+ /* Badly wounded */
+ else if (pct >= 10) attr = TERM_L_RED;
/* Default to "unknown" */
- Term_putstr(COL_RIDING_INFO, ROW_RIDING_INFO, 12, TERM_WHITE, "[----------]");
+ Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
/* Dump the current "health" (use '*' symbols) */
- Term_putstr(COL_RIDING_INFO + 1, ROW_RIDING_INFO, len, attr, "**********");
+ Term_putstr(col + 1, row, len, attr, "**********");
}
-
-#endif
-
}
prt_depth();
/* Special */
- health_redraw();
- riding_health_redraw();
+ health_redraw(FALSE);
+ health_redraw(TRUE);
}
/* Study spells */
prt_study();
- prt_mane();
+ prt_imitation();
prt_status();
}
{
int i, j, k, levels;
int num_allowed;
- int num_boukyaku = 0;
+ int num_boukyaku = 0;
magic_type *s_ptr;
int which;
/* Message */
#ifdef JP
msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
- spell_names[technic2magic(which)-1][j%32], p );
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have forgotten the %s of %s.", p,
- spell_names[technic2magic(which)-1][j%32]);
+ do_spell(which, j%32, SPELL_NAME));
#endif
/* Message */
#ifdef JP
msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
- spell_names[technic2magic(which)-1][j%32], p );
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have forgotten the %s of %s.", p,
- spell_names[technic2magic(which)-1][j%32]);
+ do_spell(which, j%32, SPELL_NAME));
#endif
/* Message */
#ifdef JP
msg_format("%s¤Î%s¤ò»×¤¤½Ð¤·¤¿¡£",
- spell_names[technic2magic(which)-1][j%32], p );
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have remembered the %s of %s.",
- p, spell_names[technic2magic(which)-1][j%32]);
+ p, do_spell(which, j%32, SPELL_NAME));
#endif
/* Count it */
k++;
}
- if (k>32) k = 32;
+ if (k > 32) k = 32;
if ((p_ptr->new_spells > k) && ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) p_ptr->new_spells = k;
}
if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) mhp += 30;
if (p_ptr->tsuyoshi) mhp += 50;
+ /* Factor in the hex spell settings */
+ if (hex_spelling(HEX_XTRA_MIGHT)) mhp += 15;
+ if (hex_spelling(HEX_BUILDING)) mhp += 60;
+
/* New maximum hitpoints */
if (p_ptr->mhp != mhp)
{
}
/* Artifact Lites provide permanent, bright, lite */
- else if (artifact_p(o_ptr))
+ else if (object_is_fixed_artifact(o_ptr))
{
p_ptr->cur_lite += 3;
}
/* end experimental mods */
- /* Reduce lite when running if requested */
- if (running && view_reduce_lite)
- {
- /* Reduce the lite radius if needed */
- if (p_ptr->cur_lite > 1) p_ptr->cur_lite = 1;
- }
-
/* Notice changes in the "lite radius" */
if (p_ptr->old_lite != p_ptr->cur_lite)
{
- /* Update the lite */
+ /* Update stuff */
/* Hack -- PU_MON_LITE for monsters' darkness */
- p_ptr->update |= (PU_LITE | PU_MON_LITE);
-
- /* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ p_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS);
/* Remember the old lite */
p_ptr->old_lite = p_ptr->cur_lite;
/*
* Computes current weight limit.
*/
-static int weight_limit(void)
+u32b weight_limit(void)
{
- int i;
+ u32b i;
/* Weight limit based only on strength */
- i = adj_str_wgt[p_ptr->stat_ind[A_STR]] * 100;
- if (p_ptr->pclass == CLASS_BERSERKER) i = i*3/2;
+ i = (u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
+ if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
/* Return the result */
- return (i);
+ return i;
}
bool buki_motteruka(int i)
{
- return ((inventory[i].k_idx && inventory[i].tval >= TV_DIGGING && inventory[i].tval <= TV_SWORD) ? TRUE : FALSE);
+ return ((inventory[i].k_idx && object_is_melee_weapon(&inventory[i])) ? TRUE : FALSE);
}
+
/*
* Calculate the players current "state", taking into account
* not only race/class intrinsics, but also objects being worn
{
int i, j, hold, neutral[2];
int new_speed;
- bool old_telepathy;
- bool old_esp_animal;
- bool old_esp_undead;
- bool old_esp_demon;
- bool old_esp_orc;
- bool old_esp_troll;
- bool old_esp_giant;
- bool old_esp_dragon;
- bool old_esp_human;
- bool old_esp_evil;
- bool old_esp_good;
- bool old_esp_nonliving;
- bool old_esp_unique;
- int old_see_inv;
- int old_dis_ac;
- int old_dis_to_a;
+ int default_hand = 0;
+ int empty_hands_status = empty_hands(TRUE);
int extra_blows[2];
int extra_shots;
object_type *o_ptr;
#endif
bool have_sw = FALSE, have_kabe = FALSE;
bool easy_2weapon = FALSE;
+ bool riding_levitation = FALSE;
s16b this_o_idx, next_o_idx = 0;
player_race *tmp_rp_ptr;
-
/* Save the old vision stuff */
- old_telepathy = p_ptr->telepathy;
- old_esp_animal = p_ptr->esp_animal;
- old_esp_undead = p_ptr->esp_undead;
- old_esp_demon = p_ptr->esp_demon;
- old_esp_orc = p_ptr->esp_orc;
- old_esp_troll = p_ptr->esp_troll;
- old_esp_giant = p_ptr->esp_giant;
- old_esp_dragon = p_ptr->esp_dragon;
- old_esp_human = p_ptr->esp_human;
- old_esp_evil = p_ptr->esp_evil;
- old_esp_good = p_ptr->esp_good;
- old_esp_nonliving = p_ptr->esp_nonliving;
- old_esp_unique = p_ptr->esp_unique;
-
- old_see_inv = p_ptr->see_inv;
+ bool old_telepathy = p_ptr->telepathy;
+ bool old_esp_animal = p_ptr->esp_animal;
+ bool old_esp_undead = p_ptr->esp_undead;
+ bool old_esp_demon = p_ptr->esp_demon;
+ bool old_esp_orc = p_ptr->esp_orc;
+ bool old_esp_troll = p_ptr->esp_troll;
+ bool old_esp_giant = p_ptr->esp_giant;
+ bool old_esp_dragon = p_ptr->esp_dragon;
+ bool old_esp_human = p_ptr->esp_human;
+ bool old_esp_evil = p_ptr->esp_evil;
+ bool old_esp_good = p_ptr->esp_good;
+ bool old_esp_nonliving = p_ptr->esp_nonliving;
+ bool old_esp_unique = p_ptr->esp_unique;
+ bool old_see_inv = p_ptr->see_inv;
+ bool old_mighty_throw = p_ptr->mighty_throw;
/* Save the old armor class */
- old_dis_ac = p_ptr->dis_ac;
- old_dis_to_a = p_ptr->dis_to_a;
+ bool old_dis_ac = p_ptr->dis_ac;
+ bool old_dis_to_a = p_ptr->dis_to_a;
/* Clear extra blows/shots */
p_ptr->slow_digest = FALSE;
p_ptr->regenerate = FALSE;
p_ptr->can_swim = FALSE;
- p_ptr->ffall = FALSE;
+ p_ptr->levitation = FALSE;
p_ptr->hold_life = FALSE;
p_ptr->telepathy = FALSE;
p_ptr->esp_animal = FALSE;
p_ptr->hidarite = FALSE;
p_ptr->no_flowed = FALSE;
- p_ptr->align = 0;
+ p_ptr->align = friend_align;
if (p_ptr->mimic_form) tmp_rp_ptr = &mimic_info[p_ptr->mimic_form];
else tmp_rp_ptr = &race_info[p_ptr->prace];
/* Base skill -- digging */
p_ptr->skill_dig = 0;
- if (buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE;
- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == 3) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE;
- if (buki_motteruka(INVEN_RARM) || !buki_motteruka(INVEN_LARM)) p_ptr->migite = TRUE;
- if (buki_motteruka(INVEN_LARM)) p_ptr->hidarite = TRUE;
+ if (buki_motteruka(INVEN_RARM)) p_ptr->migite = TRUE;
+ if (buki_motteruka(INVEN_LARM))
+ {
+ p_ptr->hidarite = TRUE;
+ if (!p_ptr->migite) default_hand = 1;
+ }
+
+ if (CAN_TWO_HANDS_WIELDING())
+ {
+ if (p_ptr->migite && (empty_hands(FALSE) == EMPTY_HAND_LARM) &&
+ object_allow_two_hands_wielding(&inventory[INVEN_RARM]))
+ {
+ p_ptr->ryoute = TRUE;
+ }
+ else if (p_ptr->hidarite && (empty_hands(FALSE) == EMPTY_HAND_RARM) &&
+ object_allow_two_hands_wielding(&inventory[INVEN_LARM]))
+ {
+ p_ptr->ryoute = TRUE;
+ }
+ else
+ {
+ switch (p_ptr->pclass)
+ {
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ case CLASS_BERSERKER:
+ if (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
+ {
+ p_ptr->migite = TRUE;
+ p_ptr->ryoute = TRUE;
+ }
+ break;
+ }
+ }
+ }
+
+ if (!p_ptr->migite && !p_ptr->hidarite)
+ {
+ if (empty_hands_status & EMPTY_HAND_RARM) p_ptr->migite = TRUE;
+ else if (empty_hands_status == EMPTY_HAND_LARM)
+ {
+ p_ptr->hidarite = TRUE;
+ default_hand = 1;
+ }
+ }
if (p_ptr->special_defense & KAMAE_MASK)
{
- if (empty_hands(TRUE) < 2)
+ if (!(empty_hands_status & EMPTY_HAND_RARM))
{
set_action(ACTION_NONE);
}
new_speed -= (p_ptr->lev) / 10;
p_ptr->skill_stl -= (p_ptr->lev)/10;
}
- else if (!inventory[INVEN_LARM].tval || p_ptr->hidarite)
+ else if ((!inventory[INVEN_RARM].k_idx || p_ptr->migite) &&
+ (!inventory[INVEN_LARM].k_idx || p_ptr->hidarite))
{
new_speed += 3;
if (!(prace_is_(RACE_KLACKON) ||
if (p_ptr->lev > 24)
p_ptr->free_act = TRUE;
}
- if (!inventory[INVEN_LARM].tval || p_ptr->hidarite)
+ if ((!inventory[INVEN_RARM].k_idx || p_ptr->migite) &&
+ (!inventory[INVEN_LARM].k_idx || p_ptr->hidarite))
{
p_ptr->to_a += p_ptr->lev/2+5;
p_ptr->dis_to_a += p_ptr->lev/2+5;
/***** Races ****/
if (p_ptr->mimic_form)
{
- switch(p_ptr->mimic_form)
+ switch (p_ptr->mimic_form)
{
case MIMIC_DEMON:
- p_ptr->hold_life=TRUE;
- p_ptr->resist_chaos=TRUE;
- p_ptr->resist_neth=TRUE;
- p_ptr->resist_fire=TRUE;
+ p_ptr->hold_life = TRUE;
+ p_ptr->resist_chaos = TRUE;
+ p_ptr->resist_neth = TRUE;
+ p_ptr->resist_fire = TRUE;
p_ptr->oppose_fire = 1;
p_ptr->see_inv=TRUE;
new_speed += 3;
p_ptr->redraw |= PR_STATUS;
p_ptr->to_a += 10;
p_ptr->dis_to_a += 10;
+ p_ptr->align -= 200;
break;
case MIMIC_DEMON_LORD:
- p_ptr->hold_life=TRUE;
- p_ptr->resist_chaos=TRUE;
- p_ptr->resist_neth=TRUE;
- p_ptr->immune_fire=TRUE;
+ p_ptr->hold_life = TRUE;
+ p_ptr->resist_chaos = TRUE;
+ p_ptr->resist_neth = TRUE;
+ p_ptr->immune_fire = TRUE;
p_ptr->resist_acid = TRUE;
- p_ptr->resist_fire=TRUE;
+ p_ptr->resist_fire = TRUE;
p_ptr->resist_cold = TRUE;
p_ptr->resist_elec = TRUE;
p_ptr->resist_pois = TRUE;
p_ptr->sh_fire = TRUE;
p_ptr->see_inv = TRUE;
p_ptr->telepathy = TRUE;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
p_ptr->kill_wall = TRUE;
new_speed += 5;
p_ptr->to_a += 20;
p_ptr->dis_to_a += 20;
+ p_ptr->align -= 200;
break;
case MIMIC_VAMPIRE:
p_ptr->resist_dark = TRUE;
}
else
{
- switch (p_ptr->prace)
- {
+ switch (p_ptr->prace)
+ {
case RACE_ELF:
p_ptr->resist_lite = TRUE;
break;
case RACE_HOBBIT:
- p_ptr->sustain_dex = TRUE;
+ p_ptr->hold_life = TRUE;
break;
case RACE_GNOME:
p_ptr->free_act = TRUE;
if (p_ptr->lev > 19) p_ptr->see_inv = TRUE;
break;
case RACE_DRACONIAN:
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
if (p_ptr->lev > 4) p_ptr->resist_fire = TRUE;
if (p_ptr->lev > 9) p_ptr->resist_cold = TRUE;
if (p_ptr->lev > 14) p_ptr->resist_acid = TRUE;
if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
break;
case RACE_SPECTRE:
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
p_ptr->free_act = TRUE;
p_ptr->resist_neth = TRUE;
p_ptr->hold_life = TRUE;
if (p_ptr->lev > 34) p_ptr->telepathy = TRUE;
break;
case RACE_SPRITE:
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
p_ptr->resist_lite = TRUE;
/* Sprites become faster */
if (p_ptr->lev > 45) p_ptr->stat_add[A_CON]++;
break;
case RACE_ANGEL:
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
p_ptr->see_inv = TRUE;
+ p_ptr->align += 200;
break;
case RACE_DEMON:
p_ptr->resist_fire = TRUE;
p_ptr->resist_neth = TRUE;
p_ptr->hold_life = TRUE;
- if (p_ptr->lev > 9)
- p_ptr->see_inv = TRUE;
+ if (p_ptr->lev > 9) p_ptr->see_inv = TRUE;
if (p_ptr->lev > 44)
{
p_ptr->oppose_fire = 1;
p_ptr->redraw |= PR_STATUS;
}
+ p_ptr->align -= 200;
break;
case RACE_DUNADAN:
p_ptr->sustain_con = TRUE;
break;
case RACE_S_FAIRY:
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
break;
- case RACE_KUTA:
+ case RACE_KUTAR:
p_ptr->resist_conf = TRUE;
break;
case RACE_ANDROID:
default:
/* Do nothing */
;
- }
+ }
}
if (p_ptr->ult_res || (p_ptr->special_defense & KATA_MUSOU))
p_ptr->free_act = TRUE;
p_ptr->slow_digest = TRUE;
p_ptr->regenerate = TRUE;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
p_ptr->hold_life = TRUE;
p_ptr->telepathy = TRUE;
p_ptr->lite = TRUE;
new_speed += (p_ptr->lev) / 10 + 5;
}
- if (p_ptr->riding)
+ if (music_singing(MUSIC_WALL))
{
- if (!(r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_PASS_WALL))
- p_ptr->pass_wall = FALSE;
- if (r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_KILL_WALL)
- p_ptr->pass_wall = TRUE;
+ p_ptr->kill_wall = TRUE;
}
- if (music_singing(MUSIC_WALL)) p_ptr->kill_wall = TRUE;
-
- if (p_ptr->kill_wall) p_ptr->pass_wall = TRUE;
/* Hack -- apply racial/class stat maxes */
/* Apply the racial modifiers */
if (p_ptr->muta3 & MUT3_WINGS)
{
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
if (p_ptr->muta3 & MUT3_FEARLESS)
if (have_flag(flgs, TR_ESP_UNIQUE)) p_ptr->esp_unique = TRUE;
if (have_flag(flgs, TR_SEE_INVIS)) p_ptr->see_inv = TRUE;
- if (have_flag(flgs, TR_FEATHER)) p_ptr->ffall = TRUE;
+ if (have_flag(flgs, TR_LEVITATION)) p_ptr->levitation = TRUE;
if (have_flag(flgs, TR_FREE_ACT)) p_ptr->free_act = TRUE;
if (have_flag(flgs, TR_HOLD_LIFE)) p_ptr->hold_life = TRUE;
if (have_flag(flgs, TR_WARNING)){
- if (!o_ptr->inscription || !(strchr(quark_str(o_ptr->inscription),'$')))
+ if (!o_ptr->inscription || !(my_strchr(quark_str(o_ptr->inscription),'$')))
p_ptr->warning = TRUE;
}
if (have_flag(flgs, TR_TELEPORT))
{
- if (cursed_p(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
+ if (object_is_cursed(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
else
{
cptr insc = quark_str(o_ptr->inscription);
- if (o_ptr->inscription &&
- (strchr(insc, '.') || strchr(insc, '%')))
+ if (o_ptr->inscription && my_strchr(insc, '.'))
{
/*
* {.} will stop random teleportation.
- * {%} includes '.' after conversion.
*/
}
else
p_ptr->to_a += o_ptr->to_a;
/* Apply the mental bonuses to armor class, if known */
- if (object_known_p(o_ptr)) p_ptr->dis_to_a += o_ptr->to_a;
+ if (object_is_known(o_ptr)) p_ptr->dis_to_a += o_ptr->to_a;
if (o_ptr->curse_flags & TRC_LOW_MELEE)
{
p_ptr->to_d_m += bonus_to_d;
/* Apply the mental bonuses tp hit/damage, if known */
- if (object_known_p(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
+ if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
/* To Melee */
if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute)
p_ptr->to_d[i-INVEN_RIGHT] += bonus_to_d;
/* Apply the mental bonuses tp hit/damage, if known */
- if (object_known_p(o_ptr))
+ if (object_is_known(o_ptr))
{
p_ptr->dis_to_h[i-INVEN_RIGHT] += bonus_to_h;
p_ptr->dis_to_d[i-INVEN_RIGHT] += bonus_to_d;
p_ptr->to_d[1] += (bonus_to_d > 0) ? bonus_to_d/2 : bonus_to_d;
/* Apply the mental bonuses tp hit/damage, if known */
- if (object_known_p(o_ptr))
+ if (object_is_known(o_ptr))
{
p_ptr->dis_to_h[0] += (bonus_to_h > 0) ? (bonus_to_h+1)/2 : bonus_to_h;
p_ptr->dis_to_h[1] += (bonus_to_h > 0) ? bonus_to_h/2 : bonus_to_h;
else
{
/* Apply the bonuses to hit/damage */
- p_ptr->to_h[0] += bonus_to_h;
- p_ptr->to_d[0] += bonus_to_d;
+ p_ptr->to_h[default_hand] += bonus_to_h;
+ p_ptr->to_d[default_hand] += bonus_to_d;
- /* Apply the mental bonuses tp hit/damage, if known */
- if (object_known_p(o_ptr))
+ /* Apply the mental bonuses to hit/damage, if known */
+ if (object_is_known(o_ptr))
{
- p_ptr->dis_to_h[0] += bonus_to_h;
- p_ptr->dis_to_d[0] += bonus_to_d;
+ p_ptr->dis_to_h[default_hand] += bonus_to_h;
+ p_ptr->dis_to_d[default_hand] += bonus_to_d;
}
}
}
+ if (old_mighty_throw != p_ptr->mighty_throw)
+ {
+ /* Redraw average damege display of Shuriken */
+ p_ptr->window |= PW_INVEN;
+ }
+
if (p_ptr->cursed & TRC_TELEPORT) p_ptr->cursed &= ~(TRC_TELEPORT_SELF);
/* Monks get extra ac for armour _not worn_ */
p_ptr->dis_to_a += 10 + (p_ptr->lev * 2 / 5);
}
+ /* Hex bonuses */
+ if (p_ptr->realm1 == REALM_HEX)
+ {
+ if (hex_spelling_any()) p_ptr->skill_stl -= (1 + p_ptr->magic_num2[0]);
+ if (hex_spelling(HEX_DETECT_EVIL)) p_ptr->esp_evil = TRUE;
+ if (hex_spelling(HEX_XTRA_MIGHT)) p_ptr->stat_add[A_STR] += 4;
+ if (hex_spelling(HEX_BUILDING))
+ {
+ p_ptr->stat_add[A_STR] += 4;
+ p_ptr->stat_add[A_DEX] += 4;
+ p_ptr->stat_add[A_CON] += 4;
+ }
+ if (hex_spelling(HEX_DEMON_AURA))
+ {
+ p_ptr->sh_fire = TRUE;
+ p_ptr->regenerate = TRUE;
+ }
+ if (hex_spelling(HEX_ICE_ARMOR))
+ {
+ p_ptr->sh_cold = TRUE;
+ p_ptr->to_a += 30;
+ p_ptr->dis_to_a += 30;
+ }
+ if (hex_spelling(HEX_SHOCK_CLOAK))
+ {
+ p_ptr->sh_elec = TRUE;
+ new_speed += 3;
+ }
+ for (i = INVEN_RARM; i <= INVEN_FEET; i++)
+ {
+ int ac = 0;
+ o_ptr = &inventory[i];
+ if (!o_ptr->k_idx) continue;
+ if (!object_is_armour(o_ptr)) continue;
+ if (!object_is_cursed(o_ptr)) continue;
+ ac += 5;
+ if (o_ptr->curse_flags & TRC_HEAVY_CURSE) ac += 7;
+ if (o_ptr->curse_flags & TRC_PERMA_CURSE) ac += 13;
+ p_ptr->to_a += ac;
+ p_ptr->dis_to_a += ac;
+ }
+ }
+
/* Calculate stats */
for (i = 0; i < 6; i++)
{
p_ptr->dis_to_d[1] -= 5;
}
- /* wraith_form */
+ /* Wraith form */
if (p_ptr->wraith_form)
{
p_ptr->reflect = TRUE;
+ p_ptr->pass_wall = TRUE;
+ }
+
+ if (p_ptr->kabenuke)
+ {
+ p_ptr->pass_wall = TRUE;
}
/* Temporary blessing */
p_ptr->resist_conf = TRUE;
p_ptr->reflect = TRUE;
p_ptr->free_act = TRUE;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
/* Temporary "Hero" */
}
/* Temporary levitation */
- if (p_ptr->tim_ffall)
+ if (p_ptr->tim_levitation)
{
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
/* Temporary reflection */
if (p_ptr->special_defense & KAMAE_SUZAKU) new_speed += 10;
- if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+ if ((p_ptr->migite && (empty_hands_status & EMPTY_HAND_RARM)) ||
+ (p_ptr->hidarite && (empty_hands_status & EMPTY_HAND_LARM)))
{
- p_ptr->to_h[0] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
- p_ptr->dis_to_h[0] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
+ p_ptr->to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
+ p_ptr->dis_to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
}
if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
/* Extract the current weight (in tenth pounds) */
j = p_ptr->total_weight;
- /* Extract the "weight limit" (in tenth pounds) */
- i = weight_limit();
-
- if (p_ptr->riding)
+ if (!p_ptr->riding)
{
- int speed = m_list[p_ptr->riding].mspeed;
- if (m_list[p_ptr->riding].mspeed > 110)
+ /* Extract the "weight limit" (in tenth pounds) */
+ i = (int)weight_limit();
+ }
+ else
+ {
+ monster_type *riding_m_ptr = &m_list[p_ptr->riding];
+ monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
+ int speed = riding_m_ptr->mspeed;
+
+ if (riding_m_ptr->mspeed > 110)
{
new_speed = 110 + (s16b)((speed - 110) * (p_ptr->skill_exp[GINOU_RIDING] * 3 + p_ptr->lev * 160L - 10000L) / (22000L));
if (new_speed < 110) new_speed = 110;
{
new_speed = speed;
}
- if (m_list[p_ptr->riding].fast) new_speed += 10;
- if (m_list[p_ptr->riding].slow) new_speed -= 10;
- if (r_info[m_list[p_ptr->riding].r_idx].flags7 & RF7_CAN_FLY) p_ptr->ffall = TRUE;
- if (r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_CAN_SWIM | RF7_AQUATIC)) p_ptr->can_swim = TRUE;
+ new_speed += (p_ptr->skill_exp[GINOU_RIDING] + p_ptr->lev *160L)/3200;
+ if (MON_FAST(riding_m_ptr)) new_speed += 10;
+ if (MON_SLOW(riding_m_ptr)) new_speed -= 10;
+ riding_levitation = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? TRUE : FALSE;
+ if (riding_r_ptr->flags7 & (RF7_CAN_SWIM | RF7_AQUATIC)) p_ptr->can_swim = TRUE;
+
+ if (!(riding_r_ptr->flags2 & RF2_PASS_WALL)) p_ptr->pass_wall = FALSE;
+ if (riding_r_ptr->flags2 & RF2_KILL_WALL) p_ptr->kill_wall = TRUE;
if (p_ptr->skill_exp[GINOU_RIDING] < RIDING_EXP_SKILLED) j += (p_ptr->wt * 3 * (RIDING_EXP_SKILLED - p_ptr->skill_exp[GINOU_RIDING])) / RIDING_EXP_SKILLED;
- i = 3000 + r_info[m_list[p_ptr->riding].r_idx].level * 50;
+ /* Extract the "weight limit" */
+ i = 1500 + riding_r_ptr->level * 25;
}
/* XXX XXX XXX Apply "encumbrance" from weight */
- if (j > i/2) new_speed -= ((j - (i/2)) / (i / 10));
+ if (j > i) new_speed -= ((j - i) / (i / 5));
/* Searching slows the player down */
if (p_ptr->action == ACTION_SEARCH) new_speed -= 10;
{
p_ptr->num_fire += (p_ptr->lev * 4);
}
+
+ /* Snipers love Cross bows */
+ if ((p_ptr->pclass == CLASS_SNIPER) &&
+ (p_ptr->tval_ammo == TV_BOLT))
+ {
+ p_ptr->to_h_b += (10 + (p_ptr->lev / 5));
+ p_ptr->dis_to_h_b += (10 + (p_ptr->lev / 5));
+ }
}
}
case CLASS_BLUE_MAGE:
num = 3; wgt = 100; mul = 2; break;
- /* Priest, Mindcrafter */
+ /* Priest, Mindcrafter, Magic-Eater */
case CLASS_PRIEST:
case CLASS_MAGIC_EATER:
case CLASS_MINDCRAFTER:
case CLASS_SAMURAI:
num = 5; wgt = 70; mul = 4; break;
- /* Kaji */
+ /* Weaponsmith */
case CLASS_SMITH:
num = 5; wgt = 150; mul = 5; break;
case CLASS_BEASTMASTER:
num = 5; wgt = 70; mul = 3; break;
+ /* Cavalry */
case CLASS_CAVALRY:
if ((p_ptr->riding) && (have_flag(flgs, TR_RIDING))) {num = 5; wgt = 70; mul = 4;}
else {num = 5; wgt = 100; mul = 3;}
case CLASS_SORCERER:
num = 1; wgt = 1; mul = 1; break;
- /* Archer, Magic eater */
+ /* Archer, Bard */
case CLASS_ARCHER:
case CLASS_BARD:
num = 4; wgt = 70; mul = 2; break;
case CLASS_FORCETRAINER:
num = 4; wgt = 60; mul = 2; break;
- /* Mirror Master */
+ /* Mirror Master, Sniper */
case CLASS_MIRROR_MASTER:
+ case CLASS_SNIPER:
num = 3; wgt = 100; mul = 3; break;
/* Ninja */
num = 4; wgt = 20; mul = 1; break;
}
+ /* Hex - extra mights gives +1 bonus to max blows */
+ if (hex_spelling(HEX_XTRA_MIGHT) || hex_spelling(HEX_BUILDING)) { num++; wgt /= 2; mul += 2; }
+
/* Enforce a minimum "weight" (tenth pounds) */
div = ((o_ptr->weight < wgt) ? wgt : o_ptr->weight);
p_ptr->to_d[i] += p_ptr->lev/6;
p_ptr->dis_to_h[i] += p_ptr->lev/5;
p_ptr->dis_to_d[i] += p_ptr->lev/6;
- if (!p_ptr->hidarite || p_ptr->ryoute)
+ if (((i == 0) && !p_ptr->hidarite) || p_ptr->ryoute)
{
p_ptr->to_h[i] += p_ptr->lev/5;
p_ptr->to_d[i] += p_ptr->lev/6;
p_ptr->dis_to_d[i] -= 10;
}
}
+ /* Hex bonuses */
+ if (p_ptr->realm1 == REALM_HEX)
+ {
+ if (object_is_cursed(o_ptr))
+ {
+ if (o_ptr->curse_flags & (TRC_CURSED)) { p_ptr->to_h[i] += 5; p_ptr->dis_to_h[i] += 5; }
+ if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { p_ptr->to_h[i] += 7; p_ptr->dis_to_h[i] += 7; }
+ if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { p_ptr->to_h[i] += 13; p_ptr->dis_to_h[i] += 13; }
+ if (o_ptr->curse_flags & (TRC_TY_CURSE)) { p_ptr->to_h[i] += 5; p_ptr->dis_to_h[i] += 5; }
+ if (hex_spelling(HEX_RUNESWORD))
+ {
+ if (o_ptr->curse_flags & (TRC_CURSED)) { p_ptr->to_d[i] += 5; p_ptr->dis_to_d[i] += 5; }
+ if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { p_ptr->to_d[i] += 7; p_ptr->dis_to_d[i] += 7; }
+ if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { p_ptr->to_d[i] += 13; p_ptr->dis_to_d[i] += 13; }
+ }
+ }
+ }
if (p_ptr->riding)
{
if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
int penalty = 0;
p_ptr->riding_ryoute = FALSE;
- if (p_ptr->ryoute || !empty_hands(FALSE)) p_ptr->riding_ryoute = TRUE;
+
+ if (p_ptr->ryoute || (empty_hands(FALSE) == EMPTY_HAND_NONE)) p_ptr->riding_ryoute = TRUE;
+ else if (p_ptr->pet_extra_flags & PF_RYOUTE)
+ {
+ switch (p_ptr->pclass)
+ {
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ case CLASS_BERSERKER:
+ if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+ p_ptr->riding_ryoute = TRUE;
+ break;
+ }
+ }
if ((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY))
{
}
/* Different calculation for monks with empty hands */
- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1))
+ if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) &&
+ (empty_hands_status & EMPTY_HAND_RARM) && !p_ptr->hidarite)
{
int blow_base = p_ptr->lev + adj_dex_blow[p_ptr->stat_ind[A_DEX]];
p_ptr->num_blow[0] = 0;
p_ptr->sh_fire = TRUE;
p_ptr->sh_elec = TRUE;
p_ptr->sh_cold = TRUE;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
else if (p_ptr->special_defense & KAMAE_GENBU)
{
p_ptr->dis_to_h[0] -= (p_ptr->lev / 3);
p_ptr->dis_to_d[0] -= (p_ptr->lev / 6);
p_ptr->num_blow[0] /= 2;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
p_ptr->num_blow[0] += 1+extra_blows[0];
}
+ if (p_ptr->riding) p_ptr->levitation = riding_levitation;
+
monk_armour_aux = FALSE;
if (heavy_armor())
monk_armour_aux = TRUE;
}
- for (i = 0 ; i < 2 ; i++)
+ for (i = 0; i < 2; i++)
{
if (buki_motteruka(INVEN_RARM+i))
{
- int tval = inventory[INVEN_RARM+i].tval - TV_BOW;
+ int tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
int sval = inventory[INVEN_RARM+i].sval;
p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
- if ((p_ptr->pclass == CLASS_MONK) && !(s_info[CLASS_MONK].w_max[tval][sval]))
- {
- p_ptr->to_h[i] -= 40;
- p_ptr->dis_to_h[i] -= 40;
- p_ptr->icky_wield[i] = TRUE;
- }
- else if ((p_ptr->pclass == CLASS_FORCETRAINER) && !(s_info[CLASS_FORCETRAINER].w_max[tval][sval]))
+ if ((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER))
{
- p_ptr->to_h[i] -= 40;
- p_ptr->dis_to_h[i] -= 40;
- p_ptr->icky_wield[i] = TRUE;
+ if (!s_info[p_ptr->pclass].w_max[tval][sval])
+ {
+ p_ptr->to_h[i] -= 40;
+ p_ptr->dis_to_h[i] -= 40;
+ p_ptr->icky_wield[i] = TRUE;
+ }
}
else if (p_ptr->pclass == CLASS_NINJA)
{
if (p_ptr->num_blow[i] < 1) p_ptr->num_blow[i] = 1;
}
}
+
+ if (inventory[INVEN_RARM + i].name1 == ART_IRON_BALL) p_ptr->align -= 1000;
}
}
bonus_to_d = ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128)/2;
bonus_to_h = ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128) + ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
- p_ptr->to_h[0] += MAX(bonus_to_h,1);
- p_ptr->dis_to_h[0] += MAX(bonus_to_h,1);
- p_ptr->to_d[0] += MAX(bonus_to_d,1);
- p_ptr->dis_to_d[0] += MAX(bonus_to_d,1);
+ p_ptr->to_h[default_hand] += MAX(bonus_to_h,1);
+ p_ptr->dis_to_h[default_hand] += MAX(bonus_to_h,1);
+ p_ptr->to_d[default_hand] += MAX(bonus_to_d,1);
+ p_ptr->dis_to_d[default_hand] += MAX(bonus_to_d,1);
}
- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == 3)) p_ptr->ryoute = FALSE;
+ if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE;
/* Affect Skill -- stealth (bonus one) */
p_ptr->skill_stl += 1;
if (p_ptr->immune_fire) p_ptr->resist_fire = TRUE;
if (p_ptr->immune_cold) p_ptr->resist_cold = TRUE;
+ /* Determine player alignment */
+ for (i = 0, j = 0; i < 8; i++)
+ {
+ switch (p_ptr->vir_types[i])
+ {
+ case V_JUSTICE:
+ p_ptr->align += p_ptr->virtues[i] * 2;
+ break;
+ case V_CHANCE:
+ /* Do nothing */
+ break;
+ case V_NATURE:
+ case V_HARMONY:
+ neutral[j++] = i;
+ break;
+ case V_UNLIFE:
+ p_ptr->align -= p_ptr->virtues[i];
+ break;
+ default:
+ p_ptr->align += p_ptr->virtues[i];
+ break;
+ }
+ }
+
+ for (i = 0; i < j; i++)
+ {
+ if (p_ptr->align > 0)
+ {
+ p_ptr->align -= p_ptr->virtues[neutral[i]] / 2;
+ if (p_ptr->align < 0) p_ptr->align = 0;
+ }
+ else if (p_ptr->align < 0)
+ {
+ p_ptr->align += p_ptr->virtues[neutral[i]] / 2;
+ if (p_ptr->align > 0) p_ptr->align = 0;
+ }
+ }
+
/* Hack -- handle "xtra" mode */
if (character_xtra) return;
p_ptr->old_heavy_shoot = p_ptr->heavy_shoot;
}
- for(i = 0 ; i < 2 ; i++)
+ for (i = 0 ; i < 2 ; i++)
{
/* Take note when "heavy weapon" changes */
if (p_ptr->old_heavy_wield[i] != p_ptr->heavy_wield[i])
if (p_ptr->riding_ryoute)
{
#ifdef JP
- msg_print("ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ¤¤¤ÆÇϤòÁà¤ì¤Ê¤¤¡£");
+ msg_format("%sÇϤòÁà¤ì¤Ê¤¤¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ¤¤¤Æ" : "");
#else
msg_print("You are using both hand for fighting, and you can't control a riding pet.");
#endif
else
{
#ifdef JP
- msg_print("¼ê¤¬¶õ¤¤¤ÆÇϤòÁà¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
+ msg_format("%sÇϤòÁà¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "¼ê¤¬¶õ¤¤¤Æ" : "");
#else
msg_print("You began to control riding pet with one hand.");
#endif
monk_notify_aux = monk_armour_aux;
}
- j = 0;
- p_ptr->align = friend_align;
-
- /* Determine player alignment */
- for (i = 0; i < 8; i++)
- {
- if ((p_ptr->vir_types[i] == V_HARMONY) || (p_ptr->vir_types[i] == V_NATURE))
- {
- neutral[j] = i;
- j++;
- }
- else if (p_ptr->vir_types[i] == V_UNLIFE) p_ptr->align -= p_ptr->virtues[i];
- else if (p_ptr->vir_types[i] == V_JUSTICE) p_ptr->align += (p_ptr->virtues[i]*2);
- else if (p_ptr->vir_types[i] != V_CHANCE) p_ptr->align += p_ptr->virtues[i];
- }
- if ((inventory[INVEN_RARM].name1 == ART_IRON_BALL) || (inventory[INVEN_LARM].name1 == ART_IRON_BALL)) p_ptr->align -= 1000;
- if (prace_is_(RACE_ANGEL)) p_ptr->align += 200;
- if ((prace_is_(RACE_DEMON)) || (p_ptr->mimic_form == MIMIC_DEMON_LORD) || (p_ptr->mimic_form == MIMIC_DEMON)) p_ptr->align -= 200;
- while (j)
- {
- j--;
- if (p_ptr->align > 0)
- {
- p_ptr->align -= (p_ptr->virtues[neutral[j]]/2);
- if (p_ptr->align < 0) p_ptr->align = 0;
- }
- else if (p_ptr->align < 0)
- {
- p_ptr->align += (p_ptr->virtues[neutral[j]]/2);
- if (p_ptr->align > 0) p_ptr->align = 0;
- }
- }
-
for (i = 0; i < INVEN_PACK; i++)
{
#if 0
if ((inventory[i].tval == TV_TRUMP_BOOK) && (inventory[i].sval == 1)) have_dd_t = TRUE;
#endif
if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE;
- if ((inventory[i].tval == TV_ENCHANT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
+ if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
}
for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
if ((o_ptr->tval == TV_TRUMP_BOOK) && (o_ptr->sval == 1)) have_dd_t = TRUE;
#endif
if ((o_ptr->tval == TV_NATURE_BOOK) && (o_ptr->sval == 2)) have_sw = TRUE;
- if ((o_ptr->tval == TV_ENCHANT_BOOK) && (o_ptr->sval == 2)) have_kabe = TRUE;
+ if ((o_ptr->tval == TV_CRAFT_BOOK) && (o_ptr->sval == 2)) have_kabe = TRUE;
}
- if ((p_ptr->pass_wall && !p_ptr->kill_wall) || p_ptr->kabenuke || p_ptr->wraith_form) p_ptr->no_flowed = TRUE;
+ if (p_ptr->pass_wall && !p_ptr->kill_wall) p_ptr->no_flowed = TRUE;
#if 0
if (have_dd_s && ((p_ptr->realm1 == REALM_SORCERY) || (p_ptr->realm2 == REALM_SORCERY) || (p_ptr->pclass == CLASS_SORCERER)))
{
if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
}
- if (have_kabe && ((p_ptr->realm1 == REALM_ENCHANT) || (p_ptr->realm2 == REALM_ENCHANT) || (p_ptr->pclass == CLASS_SORCERER)))
+ 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_ENCHANT-1][SPELL_KABE];
+ magic_type *s_ptr = &mp_ptr->info[REALM_CRAFT-1][SPELL_KABE];
if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
}
}
if (p_ptr->notice & (PN_AUTODESTROY))
{
p_ptr->notice &= ~(PN_AUTODESTROY);
- delayed_auto_destroy();
+ autopick_delayed_alter();
}
/* Combine the pack */
if (p_ptr->redraw & (PR_HEALTH))
{
p_ptr->redraw &= ~(PR_HEALTH);
- health_redraw();
+ health_redraw(FALSE);
}
if (p_ptr->redraw & (PR_UHEALTH))
{
p_ptr->redraw &= ~(PR_UHEALTH);
- riding_health_redraw();
+ health_redraw(TRUE);
}
p_ptr->redraw &= ~(PR_EXTRA);
p_ptr->redraw &= ~(PR_CUT | PR_STUN);
p_ptr->redraw &= ~(PR_HUNGER);
- p_ptr->redraw &= ~(PR_STATE | PR_SPEED | PR_STUDY | PR_MANE | PR_STATUS);
+ p_ptr->redraw &= ~(PR_STATE | PR_SPEED | PR_STUDY | PR_IMITATION | PR_STATUS);
prt_frame_extra();
}
if (p_ptr->pclass == CLASS_IMITATOR)
{
- if (p_ptr->redraw & (PR_MANE))
+ if (p_ptr->redraw & (PR_IMITATION))
{
- p_ptr->redraw &= ~(PR_MANE);
- prt_mane();
+ p_ptr->redraw &= ~(PR_IMITATION);
+ prt_imitation();
}
}
else if (p_ptr->redraw & (PR_STUDY))
}
-s16b empty_hands(bool is_monk)
+s16b empty_hands(bool riding_control)
{
- s16b kaerichi = 0;
- if (is_monk && (p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_BERSERKER)) return FALSE;
+ s16b status = EMPTY_HAND_NONE;
+
+ if (!inventory[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM;
+ if (!inventory[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM;
- if (!(inventory[INVEN_RARM].k_idx)) kaerichi +=2;
- if (!(inventory[INVEN_LARM].k_idx)) kaerichi +=1;
- return kaerichi;
+ if (riding_control && (status != EMPTY_HAND_NONE) && p_ptr->riding && !(p_ptr->pet_extra_flags & PF_RYOUTE))
+ {
+ if (status & EMPTY_HAND_LARM) status &= ~(EMPTY_HAND_LARM);
+ else if (status & EMPTY_HAND_RARM) status &= ~(EMPTY_HAND_RARM);
+ }
+
+ return status;
}
return (monk_arm_wgt > (100 + (p_ptr->lev * 4)));
}
-
-int number_of_quests(void)
-{
- int i, j;
-
- /* Clear the counter */
- i = 0;
-
- for (j = MIN_RANDOM_QUEST; j < MAX_RANDOM_QUEST+1; j++)
- {
- if (quest[j].status != QUEST_STATUS_UNTAKEN)
- {
- /* Increment count of quests taken. */
- i++;
- }
- }
-
- /* Return the number of quests taken */
- return (i);
-}