*/
void extract_day_hour_min(int *day, int *hour, int *min)
{
- s32b len = TURNS_PER_TICK * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
-
- if ((p_ptr->prace == RACE_VAMPIRE) ||
- (p_ptr->prace == RACE_SKELETON) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_SPECTRE))
- *day = (turn - (TURNS_PER_TICK * TOWN_DAWN *3/4)) / len + 1;
- else
- *day = (turn + (TURNS_PER_TICK * TOWN_DAWN /4))/ len + 1;
- *hour = (24 * tick / len) % 24;
- *min = (1440 * tick / len) % 60;
+ 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_VAMPIRE:
+ case RACE_SKELETON:
+ case RACE_ZOMBIE:
+ case RACE_SPECTRE:
+ *day = (turn - A_DAY * 3 / 4) / A_DAY + 1;
+ break;
+ default:
+ *day = (turn + A_DAY / 4) / A_DAY + 1;
+ break;
+ }
+ *hour = (24 * turn_in_today / A_DAY) % 24;
+ *min = (1440 * turn_in_today / A_DAY) % 60;
}
/*
cptr map_name(void)
{
- if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)
+ if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)
&& (quest[p_ptr->inside_quest].flags & QUEST_FLAG_PRESET))
#ifdef JP
return "¥¯¥¨¥¹¥È";
if (p_ptr->tim_invis) ADD_FLG(BAR_SENSEUNSEEN);
/* Timed esp */
- if (p_ptr->tim_esp || music_singing(MUSIC_MIND)) ADD_FLG(BAR_TELEPATHY);
+ if (IS_TIM_ESP()) ADD_FLG(BAR_TELEPATHY);
/* Timed regenerate */
if (p_ptr->tim_regen) ADD_FLG(BAR_REGENERATION);
if (p_ptr->protevil) ADD_FLG(BAR_PROTEVIL);
/* Invulnerability */
- if (p_ptr->invuln || music_singing(MUSIC_INVULN)) ADD_FLG(BAR_INVULN);
+ if (IS_INVULN()) ADD_FLG(BAR_INVULN);
/* Wraith form */
if (p_ptr->wraith_form) ADD_FLG(BAR_WRAITH);
if (p_ptr->tim_reflect) ADD_FLG(BAR_REFLECTION);
/* Heroism */
- if (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO)) ADD_FLG(BAR_HEROISM);
+ if (IS_HERO()) ADD_FLG(BAR_HEROISM);
/* Super Heroism / berserk */
if (p_ptr->shero) ADD_FLG(BAR_BERSERK);
/* Blessed */
- if (p_ptr->blessed || music_singing(MUSIC_BLESS)) ADD_FLG(BAR_BLESSED);
+ if (IS_BLESSED()) ADD_FLG(BAR_BLESSED);
/* Shield */
if (p_ptr->magicdef) ADD_FLG(BAR_MAGICDEFENSE);
/* Oppose Acid */
if (p_ptr->special_defense & DEFENSE_ACID) ADD_FLG(BAR_IMMACID);
- if (p_ptr->oppose_acid || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU)) ADD_FLG(BAR_RESACID);
+ if (IS_OPPOSE_ACID()) ADD_FLG(BAR_RESACID);
/* Oppose Lightning */
if (p_ptr->special_defense & DEFENSE_ELEC) ADD_FLG(BAR_IMMELEC);
- if (p_ptr->oppose_elec || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU)) ADD_FLG(BAR_RESELEC);
+ if (IS_OPPOSE_ELEC()) ADD_FLG(BAR_RESELEC);
/* Oppose Fire */
if (p_ptr->special_defense & DEFENSE_FIRE) ADD_FLG(BAR_IMMFIRE);
- if (p_ptr->oppose_fire || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU)) ADD_FLG(BAR_RESFIRE);
+ if (IS_OPPOSE_FIRE()) ADD_FLG(BAR_RESFIRE);
/* Oppose Cold */
if (p_ptr->special_defense & DEFENSE_COLD) ADD_FLG(BAR_IMMCOLD);
- if (p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU)) ADD_FLG(BAR_RESCOLD);
+ if (IS_OPPOSE_COLD()) ADD_FLG(BAR_RESCOLD);
/* Oppose Poison */
- if (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU)) ADD_FLG(BAR_RESPOIS);
+ if (IS_OPPOSE_POIS()) ADD_FLG(BAR_RESPOIS);
/* Word of Recall */
if (p_ptr->word_recall) ADD_FLG(BAR_RECALL);
if (p_ptr->special_attack & ATTACK_POIS) ADD_FLG(BAR_ATTKPOIS);
if (p_ptr->special_defense & NINJA_S_STEALTH) ADD_FLG(BAR_SUPERSTEALTH);
- /* tim stealth */
if (p_ptr->tim_sh_fire) ADD_FLG(BAR_SHFIRE);
- if (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH)) ADD_FLG(BAR_STEALTH);
+ /* tim stealth */
+ if (IS_TIM_STEALTH()) ADD_FLG(BAR_STEALTH);
if (p_ptr->tim_sh_touki) ADD_FLG(BAR_TOUKI);
/* Winner */
else if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
{
- if ((p_ptr->arena_number > MAX_ARENA_MONS+2) && (p_ptr->arena_number < 99))
+ if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
{
#ifdef JP
/* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
p = "*¿¿¡¦¾¡Íø¼Ô*";
-
#else
p = "*TRUEWINNER*";
#endif
#ifdef JP
/* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
p = "***¾¡Íø¼Ô***";
-
#else
p = "***WINNER***";
#endif
{
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", 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", 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", 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", 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
+ 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 */
+ }
+ }
}
/* 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);
}
static void prt_speed(void)
{
int i = p_ptr->pspeed;
- bool is_fast = (p_ptr->fast || music_singing(MUSIC_SPEED) || music_singing(MUSIC_SHERO));
+ bool is_fast = IS_FAST();
byte attr = TERM_WHITE;
char buf[32] = "";
* 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;
-#ifdef DRS_SHOW_HEALTH_BAR
+ 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;
+ }
+
+ 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 (m_ptr->invulner) attr = TERM_WHITE;
- /* Wounded */
- if (pct >= 25) attr = TERM_ORANGE;
+ /* Asleep */
+ else if (m_ptr->csleep) attr = TERM_BLUE;
- /* Somewhat Wounded */
- if (pct >= 60) attr = TERM_YELLOW;
+ /* Afraid */
+ else if (m_ptr->monfear) 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);
}
return;
}
- p = spell_categoly_name(mp_ptr->spell_book);
+ p = spell_category_name(mp_ptr->spell_book);
/* Determine the number of spells allowed */
levels = p_ptr->lev - mp_ptr->spell_first + 1;
if (mhp < p_ptr->lev + 1) mhp = p_ptr->lev + 1;
/* Factor in the hero / superhero settings */
- if (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO)) mhp += 10;
+ if (IS_HERO()) mhp += 10;
if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) mhp += 30;
if (p_ptr->tsuyoshi) mhp += 50;
/* 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 */
- p_ptr->update |= (PU_LITE);
+ /* Hack -- PU_MON_LITE for monsters' darkness */
+ p_ptr->update |= (PU_LITE | PU_MON_LITE);
/* Update the monsters */
p_ptr->update |= (PU_MONSTERS);
return ((inventory[i].k_idx && inventory[i].tval >= TV_DIGGING && inventory[i].tval <= TV_SWORD) ? TRUE : FALSE);
}
+
/*
* Calculate the players current "state", taking into account
* not only race/class intrinsics, but also objects being worn
void calc_bonuses(void)
{
int i, j, hold, neutral[2];
- int old_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 new_speed;
int extra_blows[2];
int extra_shots;
object_type *o_ptr;
bool omoi = FALSE;
bool yoiyami = FALSE;
bool down_saving = FALSE;
- bool have_dd_s, have_dd_t, have_sw, have_kabe;
+#if 0
+ bool have_dd_s = FALSE, have_dd_t = FALSE;
+#endif
+ bool have_sw = FALSE, have_kabe = FALSE;
bool easy_2weapon = FALSE;
+ bool riding_ffall = FALSE;
s16b this_o_idx, next_o_idx = 0;
player_race *tmp_rp_ptr;
-
- /* Save the old speed */
- old_speed = p_ptr->pspeed;
-
/* 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->to_m_chance = 0;
+ /* Clear the Extra Dice Bonuses */
+ p_ptr->to_dd[0] = p_ptr->to_ds[0] = 0;
+ p_ptr->to_dd[1] = p_ptr->to_ds[1] = 0;
+
/* Start with "normal" speed */
- p_ptr->pspeed = 110;
+ new_speed = 110;
/* Start with a single blow per turn */
p_ptr->num_blow[0] = 1;
p_ptr->anti_tele = FALSE;
p_ptr->warning = FALSE;
p_ptr->mighty_throw = FALSE;
+ p_ptr->see_nocto = FALSE;
p_ptr->immune_acid = FALSE;
p_ptr->immune_elec = 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) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((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) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) && (!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 (p_ptr->special_defense & KAMAE_MASK)
{
- if (empty_hands(TRUE) < 2)
+ if (!(empty_hands(TRUE) & EMPTY_HAND_RARM))
{
set_action(ACTION_NONE);
}
/* Unencumbered Monks become faster every 10 levels */
if (!(heavy_armor()))
{
- if (!((p_ptr->prace == RACE_KLACKON) ||
- (p_ptr->prace == RACE_SPRITE) ||
+ if (!(prace_is_(RACE_KLACKON) ||
+ prace_is_(RACE_SPRITE) ||
(p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
- p_ptr->pspeed += (p_ptr->lev) / 10;
+ new_speed += (p_ptr->lev) / 10;
/* Free action if unencumbered at level 25 */
if (p_ptr->lev > 24)
p_ptr->sustain_con = TRUE;
p_ptr->regenerate = TRUE;
p_ptr->free_act = TRUE;
- p_ptr->pspeed += 2;
- if (p_ptr->lev > 29) p_ptr->pspeed++;
- if (p_ptr->lev > 39) p_ptr->pspeed++;
- if (p_ptr->lev > 44) p_ptr->pspeed++;
- if (p_ptr->lev > 49) p_ptr->pspeed++;
+ new_speed += 2;
+ if (p_ptr->lev > 29) new_speed++;
+ if (p_ptr->lev > 39) new_speed++;
+ if (p_ptr->lev > 44) new_speed++;
+ if (p_ptr->lev > 49) new_speed++;
p_ptr->to_a += 10+p_ptr->lev/2;
p_ptr->dis_to_a += 10+p_ptr->lev/2;
p_ptr->skill_dig += (100+p_ptr->lev*8);
if (p_ptr->lev > 39) p_ptr->reflect = TRUE;
break;
case CLASS_NINJA:
- /* Unencumbered Monks become faster every 10 levels */
+ /* Unencumbered Ninjas become faster every 10 levels */
if (heavy_armor())
{
- p_ptr->pspeed -= (p_ptr->lev) / 10;
+ new_speed -= (p_ptr->lev) / 10;
p_ptr->skill_stl -= (p_ptr->lev)/10;
}
else if (!inventory[INVEN_LARM].tval || p_ptr->hidarite)
{
- p_ptr->pspeed += 3;
- if (!((p_ptr->prace == RACE_KLACKON) ||
- (p_ptr->prace == RACE_SPRITE) ||
+ new_speed += 3;
+ if (!(prace_is_(RACE_KLACKON) ||
+ prace_is_(RACE_SPRITE) ||
(p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
- p_ptr->pspeed += (p_ptr->lev) / 10;
+ new_speed += (p_ptr->lev) / 10;
p_ptr->skill_stl += (p_ptr->lev)/10;
/* Free action if unencumbered at level 25 */
p_ptr->oppose_pois = 1;
p_ptr->redraw |= PR_STATUS;
}
+ p_ptr->see_nocto = TRUE;
break;
}
/***** 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;
- p_ptr->pspeed += 3;
+ 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->telepathy = TRUE;
p_ptr->ffall = TRUE;
p_ptr->kill_wall = TRUE;
- p_ptr->pspeed += 5;
+ 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;
p_ptr->resist_cold = TRUE;
p_ptr->resist_pois = TRUE;
p_ptr->see_inv = TRUE;
- p_ptr->pspeed += 3;
+ new_speed += 3;
p_ptr->to_a += 10;
p_ptr->dis_to_a += 10;
if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = 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;
p_ptr->resist_acid = TRUE;
/* Klackons become faster */
- p_ptr->pspeed += (p_ptr->lev) / 10;
+ new_speed += (p_ptr->lev) / 10;
break;
case RACE_KOBOLD:
p_ptr->resist_pois = TRUE;
p_ptr->resist_lite = TRUE;
/* Sprites become faster */
- p_ptr->pspeed += (p_ptr->lev) / 10;
+ new_speed += (p_ptr->lev) / 10;
break;
case RACE_BEASTMAN:
p_ptr->resist_conf = TRUE;
case RACE_ANGEL:
p_ptr->ffall = 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;
default:
/* Do nothing */
;
- }
+ }
}
if (p_ptr->ult_res || (p_ptr->special_defense & KATA_MUSOU))
if ((p_ptr->prace != RACE_KLACKON) && (p_ptr->prace != RACE_SPRITE))
/* Munchkin become faster */
- p_ptr->pspeed += (p_ptr->lev) / 10 + 5;
+ 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_XTRA_FAT)
{
p_ptr->stat_add[A_CON] += 2;
- p_ptr->pspeed -= 2;
+ new_speed -= 2;
}
if (p_ptr->muta3 & MUT3_ALBINO)
if (p_ptr->muta3 & MUT3_XTRA_LEGS)
{
- p_ptr->pspeed += 3;
+ new_speed += 3;
}
if (p_ptr->muta3 & MUT3_SHORT_LEG)
{
- p_ptr->pspeed -= 3;
+ new_speed -= 3;
}
if (p_ptr->muta3 & MUT3_ELEC_TOUC)
if (have_flag(flgs, TR_TUNNEL)) p_ptr->skill_dig += (o_ptr->pval * 20);
/* Affect speed */
- if (have_flag(flgs, TR_SPEED)) p_ptr->pspeed += o_ptr->pval;
+ if (have_flag(flgs, TR_SPEED)) new_speed += o_ptr->pval;
/* Affect blows */
if (have_flag(flgs, TR_BLOWS))
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;
}
{
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_h[0] += bonus_to_h;
p_ptr->to_d[0] += bonus_to_d;
- /* Apply the mental bonuses tp hit/damage, if known */
+ /* Apply the mental bonuses to hit/damage, if known */
if (object_known_p(o_ptr))
{
p_ptr->dis_to_h[0] += bonus_to_h;
}
}
+ 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_ */
if (p_ptr->sh_fire) p_ptr->lite = TRUE;
/* Golems also get an intrinsic AC bonus */
- if ((p_ptr->prace == RACE_GOLEM) || (p_ptr->prace == RACE_ANDROID))
+ if (prace_is_(RACE_GOLEM) || prace_is_(RACE_ANDROID))
{
p_ptr->to_a += 10 + (p_ptr->lev * 2 / 5);
p_ptr->dis_to_a += 10 + (p_ptr->lev * 2 / 5);
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 */
- if (p_ptr->blessed || music_singing(MUSIC_BLESS))
+ if (IS_BLESSED())
{
p_ptr->to_a += 5;
p_ptr->dis_to_a += 5;
}
/* Temporary "Hero" */
- if (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
+ if (IS_HERO())
{
p_ptr->to_h[0] += 12;
p_ptr->to_h[1] += 12;
p_ptr->skill_dig += 30;
}
-/* Temporary "fast" */
- if (p_ptr->fast || music_singing(MUSIC_SPEED) || music_singing(MUSIC_SHERO))
+ /* Temporary "fast" */
+ if (IS_FAST())
{
- p_ptr->pspeed += 10;
+ new_speed += 10;
}
/* Temporary "slow" */
if (p_ptr->slow)
{
- p_ptr->pspeed -= 10;
+ new_speed -= 10;
}
/* Temporary "telepathy" */
- if (p_ptr->tim_esp || music_singing(MUSIC_MIND))
+ if (IS_TIM_ESP())
{
p_ptr->telepathy = TRUE;
}
p_ptr->ffall = TRUE;
}
+ /* Temporary reflection */
+ if (p_ptr->tim_reflect)
+ {
+ p_ptr->reflect = TRUE;
+ }
+
/* Hack -- Hero/Shero -> Res fear */
- if (p_ptr->hero || p_ptr->shero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
+ if (IS_HERO() || p_ptr->shero)
{
p_ptr->resist_fear = TRUE;
}
}
/* Bloating slows the player down (a little) */
- if (p_ptr->food >= PY_FOOD_MAX) p_ptr->pspeed -= 10;
+ if (p_ptr->food >= PY_FOOD_MAX) new_speed -= 10;
- if (p_ptr->special_defense & KAMAE_SUZAKU) p_ptr->pspeed += 10;
+ if (p_ptr->special_defense & KAMAE_SUZAKU) new_speed += 10;
if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
{
- p_ptr->to_h[0] += (p_ptr->skill_exp[GINOU_SUDE]-4000)/200;
- p_ptr->dis_to_h[0] += (p_ptr->skill_exp[GINOU_SUDE]-4000)/200;
+ 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;
}
if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
{
int penalty1, penalty2;
- penalty1 = ((100-p_ptr->skill_exp[GINOU_NITOURYU]/160) - (130-inventory[INVEN_RARM].weight)/8);
- penalty2 = ((100-p_ptr->skill_exp[GINOU_NITOURYU]/160) - (130-inventory[INVEN_LARM].weight)/8);
+ penalty1 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - inventory[INVEN_RARM].weight) / 8);
+ penalty2 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - inventory[INVEN_LARM].weight) / 8);
if ((inventory[INVEN_RARM].name1 == ART_QUICKTHORN) && (inventory[INVEN_LARM].name1 == ART_TINYTHORN))
{
penalty1 = penalty1 / 2 - 5;
penalty2 = penalty2 / 2 - 5;
- p_ptr->pspeed += 7;
+ new_speed += 7;
p_ptr->to_a += 10;
p_ptr->dis_to_a += 10;
}
if (p_ptr->riding)
{
- int speed = m_list[p_ptr->riding].mspeed;
- if (m_list[p_ptr->riding].mspeed > 110)
+ 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)
{
- p_ptr->pspeed = 110 + (s16b)((speed-110)*(p_ptr->skill_exp[GINOU_RIDING]*3 + p_ptr->lev*160L - 10000L)/(22000L));
- if (p_ptr->pspeed < 110) p_ptr->pspeed = 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;
}
else
{
- p_ptr->pspeed = speed;
+ new_speed = speed;
}
- if (m_list[p_ptr->riding].fast) p_ptr->pspeed += 10;
- if (m_list[p_ptr->riding].slow) p_ptr->pspeed -= 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 (riding_m_ptr->fast) new_speed += 10;
+ if (riding_m_ptr->slow) new_speed -= 10;
+ riding_ffall = (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] < 2000) j += (p_ptr->wt*3*(2000 - p_ptr->skill_exp[GINOU_RIDING]))/2000;
+ 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;
+ i = 3000 + riding_r_ptr->level * 50;
}
/* XXX XXX XXX Apply "encumbrance" from weight */
- if (j > i/2) p_ptr->pspeed -= ((j - (i/2)) / (i / 10));
+ if (j > i/2) new_speed -= ((j - (i/2)) / (i / 10));
/* Searching slows the player down */
- if (p_ptr->action == ACTION_SEARCH) p_ptr->pspeed -= 10;
+ if (p_ptr->action == ACTION_SEARCH) new_speed -= 10;
/* Actual Modifier Bonuses (Un-inflate stat bonuses) */
p_ptr->to_a += ((int)(adj_dex_ta[p_ptr->stat_ind[A_DEX]]) - 128);
{
p_ptr->to_h[i] +=15;
p_ptr->dis_to_h[i] +=15;
+ p_ptr->to_dd[i] += 2;
}
else if (!(have_flag(flgs, TR_RIDING)))
{
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;
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(TRUE) & EMPTY_HAND_RARM))
{
int blow_base = p_ptr->lev + adj_dex_blow[p_ptr->stat_ind[A_DEX]];
p_ptr->num_blow[0] = 0;
p_ptr->num_blow[0] += 1+extra_blows[0];
}
+ if (p_ptr->riding) p_ptr->ffall = riding_ffall;
+
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))
+ 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]-4000)/200;
- p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval]-4000)/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]))
+ 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) || (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 ((s_info[CLASS_NINJA].w_max[tval][sval] <= 4000) || (inventory[INVEN_LARM-i].tval == TV_SHIELD))
+ if ((s_info[CLASS_NINJA].w_max[tval][sval] <= WEAPON_EXP_BEGINNER) || (inventory[INVEN_LARM-i].tval == TV_SHIELD))
{
p_ptr->to_h[i] -= 40;
p_ptr->dis_to_h[i] -= 40;
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;
}
}
- /* Temporary lightspeed */
- if ((p_ptr->lightspeed && !p_ptr->riding) || (p_ptr->pspeed > 209))
+ /* Maximum speed is (+99). (internally it's 110 + 99) */
+ /* Temporary lightspeed forces to be maximum speed */
+ if ((p_ptr->lightspeed && !p_ptr->riding) || (new_speed > 209))
{
- p_ptr->pspeed = 209;
+ new_speed = 209;
}
- if (p_ptr->pspeed < 11) p_ptr->pspeed = 11;
+
+ /* Minimum speed is (-99). (internally it's 110 - 99) */
+ if (new_speed < 11) new_speed = 11;
/* Display the speed (if needed) */
- if (p_ptr->pspeed != old_speed) p_ptr->redraw |= (PR_SPEED);
+ if (p_ptr->pspeed != (byte)new_speed)
+ {
+ p_ptr->pspeed = (byte)new_speed;
+ p_ptr->redraw |= (PR_SPEED);
+ }
if (yoiyami)
{
p_ptr->dis_to_d[0] += 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(TRUE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE;
/* Affect Skill -- stealth (bonus one) */
p_ptr->skill_stl += 1;
- if (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
- p_ptr->skill_stl += 99;
+ if (IS_TIM_STEALTH()) p_ptr->skill_stl += 99;
/* Affect Skill -- disarming (DEX and INT) */
p_ptr->skill_dis += adj_dex_dis[p_ptr->stat_ind[A_DEX]];
if (down_saving) p_ptr->skill_sav /= 2;
+ /* Hack -- Each elemental immunity includes resistance */
+ if (p_ptr->immune_acid) p_ptr->resist_acid = TRUE;
+ if (p_ptr->immune_elec) p_ptr->resist_elec = TRUE;
+ 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])
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;
- }
- }
-
- have_dd_s = FALSE;
- have_dd_t = FALSE;
- have_sw = FALSE;
- have_kabe = FALSE;
for (i = 0; i < INVEN_PACK; i++)
{
+#if 0
if ((inventory[i].tval == TV_SORCERY_BOOK) && (inventory[i].sval == 2)) have_dd_s = TRUE;
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;
}
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
+#if 0
if ((o_ptr->tval == TV_SORCERY_BOOK) && (o_ptr->sval == 3)) have_dd_s = TRUE;
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 ((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->notice & (PN_AUTODESTROY))
{
p_ptr->notice &= ~(PN_AUTODESTROY);
- delayed_auto_destroy();
+ autopick_delayed_alter();
}
/* Combine the pack */
update_mon_lite();
}
+ /*
+ * Mega-Hack -- Delayed visual update
+ * Only used if update_view(), update_lite() or update_mon_lite() was called
+ */
+ if (p_ptr->update & (PU_DELAY_VIS))
+ {
+ p_ptr->update &= ~(PU_DELAY_VIS);
+ delayed_visual_update();
+ }
+
if (p_ptr->update & (PU_MONSTERS))
{
p_ptr->update &= ~(PU_MONSTERS);
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);
}
s16b empty_hands(bool is_monk)
{
- 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 (is_monk && (p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_BERSERKER)) return EMPTY_HAND_NONE;
- if (!(inventory[INVEN_RARM].k_idx)) kaerichi +=2;
- if (!(inventory[INVEN_LARM].k_idx)) kaerichi +=1;
- return kaerichi;
+ if (!(inventory[INVEN_RARM].k_idx)) status |= EMPTY_HAND_RARM;
+ if (!(inventory[INVEN_LARM].k_idx)) status |= EMPTY_HAND_LARM;
+ 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);
-}