/* File: misc.c */
-/* Purpose: misc code */
-
/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
*
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
*/
+/* Purpose: misc code */
+
#include "angband.h"
/*
+ * Whether daytime or not
+ */
+bool is_daytime(void)
+{
+ s32b len = TURNS_PER_TICK * TOWN_DAWN;
+ if ((turn % len) < (len / 2))
+ return TRUE;
+ else
+ return FALSE;
+}
+
+/*
+ * Extract day, hour, min
+ */
+void extract_day_hour_min(int *day, int *hour, int *min)
+{
+ 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;
+}
+
+/*
* Print time
*/
void prt_time(void)
{
- s32b len = 20L * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
+ int day, hour, min;
/* Dump 13 spaces to clear */
c_put_str(TERM_WHITE, " ", ROW_DAY, COL_DAY);
+ 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
- ((p_ptr->prace == RACE_VAMPIRE) ||
- (p_ptr->prace == RACE_SKELETON) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_SPECTRE))
- ? (turn - (15L * TOWN_DAWN)) / len + 1
- : (turn + (5L * TOWN_DAWN))/ len + 1),
- ROW_DAY, COL_DAY);
-
- c_put_str(TERM_WHITE, format("%2d:%02d",
- (24 * tick / len) % 24,
- (1440 * tick / len) % 60),
- ROW_DAY, COL_DAY+7);
+
+ c_put_str(TERM_WHITE, format("%2d:%02d", hour, min), ROW_DAY, COL_DAY+7);
}
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 "¥¯¥¨¥¹¥È";
#else
- return "Quest";
+ return "Quest";
#endif
else if (p_ptr->wild_mode)
#ifdef JP
#ifdef JP
return "¥¢¥ê¡¼¥Ê";
#else
- return "Monster Arena";
+ return "Arena";
#endif
else if (p_ptr->inside_battle)
#ifdef JP
return "Æ®µ»¾ì";
#else
- return "Arena";
+ return "Monster Arena";
#endif
else if (!dun_level && p_ptr->town_num)
return town[p_ptr->town_num].name;
}
-/* Show status bar */
+/*
+ * Data structure for status bar
+ */
+#define BAR_TSUYOSHI 0
+#define BAR_HALLUCINATION 1
+#define BAR_BLINDNESS 2
+#define BAR_PARALYZE 3
+#define BAR_CONFUSE 4
+#define BAR_POISONED 5
+#define BAR_AFRAID 6
+#define BAR_LEVITATE 7
+#define BAR_REFLECTION 8
+#define BAR_PASSWALL 9
+#define BAR_WRAITH 10
+#define BAR_PROTEVIL 11
+#define BAR_KAWARIMI 12
+#define BAR_MAGICDEFENSE 13
+#define BAR_EXPAND 14
+#define BAR_STONESKIN 15
+#define BAR_MULTISHADOW 16
+#define BAR_REGMAGIC 17
+#define BAR_ULTIMATE 18
+#define BAR_INVULN 19
+#define BAR_IMMACID 20
+#define BAR_RESACID 21
+#define BAR_IMMELEC 22
+#define BAR_RESELEC 23
+#define BAR_IMMFIRE 24
+#define BAR_RESFIRE 25
+#define BAR_IMMCOLD 26
+#define BAR_RESCOLD 27
+#define BAR_RESPOIS 28
+#define BAR_RESNETH 29
+#define BAR_RESTIME 30
+#define BAR_DUSTROBE 31
+#define BAR_SHFIRE 32
+#define BAR_TOUKI 33
+#define BAR_SHHOLY 34
+#define BAR_EYEEYE 35
+#define BAR_BLESSED 36
+#define BAR_HEROISM 37
+#define BAR_BERSERK 38
+#define BAR_ATTKFIRE 39
+#define BAR_ATTKCOLD 40
+#define BAR_ATTKELEC 41
+#define BAR_ATTKACID 42
+#define BAR_ATTKPOIS 43
+#define BAR_ATTKCONF 44
+#define BAR_SENSEUNSEEN 45
+#define BAR_TELEPATHY 46
+#define BAR_REGENERATION 47
+#define BAR_INFRAVISION 48
+#define BAR_STEALTH 49
+#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;
+ cptr sstr;
+ cptr lstr;
+} bar[]
+#ifdef JP
+= {
+ {TERM_YELLOW, "¤Ä", "¤Ä¤è¤·"},
+ {TERM_VIOLET, "¸¸", "¸¸³Ð"},
+ {TERM_L_DARK, "ÌÕ", "ÌÕÌÜ"},
+ {TERM_RED, "áã", "Ëãáã"},
+ {TERM_VIOLET, "Íð", "º®Íð"},
+ {TERM_GREEN, "ÆÇ", "ÆÇ"},
+ {TERM_BLUE, "¶²", "¶²ÉÝ"},
+ {TERM_L_BLUE, "Éâ", "ÉâÍ·"},
+ {TERM_SLATE, "È¿", "È¿¼Í"},
+ {TERM_SLATE, "ÊÉ", "ÊÉÈ´¤±"},
+ {TERM_L_DARK, "Í©", "Í©ÂÎ"},
+ {TERM_SLATE, "¼Ù", "ËɼÙ"},
+ {TERM_VIOLET, "ÊÑ", "ÊѤï¤ê¿È"},
+ {TERM_YELLOW, "Ëâ", "ËâË¡³»"},
+ {TERM_L_UMBER, "¿", "¿¤Ó"},
+ {TERM_WHITE, "ÀÐ", "ÀÐÈ©"},
+ {TERM_L_BLUE, "ʬ", "ʬ¿È"},
+ {TERM_SLATE, "ËÉ", "ËâË¡Ëɸæ"},
+ {TERM_YELLOW, "µæ", "µæ¶Ë"},
+ {TERM_YELLOW, "̵", "̵Ũ"},
+ {TERM_L_GREEN, "»À", "»ÀÌȱÖ"},
+ {TERM_GREEN, "»À", "ÂÑ»À"},
+ {TERM_L_BLUE, "ÅÅ", "ÅÅÌȱÖ"},
+ {TERM_BLUE, "ÅÅ", "ÂÑÅÅ"},
+ {TERM_L_RED, "²Ð", "²ÐÌȱÖ"},
+ {TERM_RED, "²Ð", "ÂѲÐ"},
+ {TERM_WHITE, "Îä", "ÎäÌȱÖ"},
+ {TERM_SLATE, "Îä", "ÂÑÎä"},
+ {TERM_GREEN, "ÆÇ", "ÂÑÆÇ"},
+ {TERM_L_DARK, "¹ö", "ÂÑÃϹö"},
+ {TERM_L_BLUE, "»þ", "ÂÑ»þ´Ö"},
+ {TERM_L_DARK, "¶À", "¶À¥ª¡¼¥é"},
+ {TERM_L_RED, "¥ª", "²Ð¥ª¡¼¥é"},
+ {TERM_WHITE, "Æ®", "Æ®µ¤"},
+ {TERM_WHITE, "À»", "À»¥ª¡¼¥é"},
+ {TERM_VIOLET, "ÌÜ", "ÌܤˤÏÌÜ"},
+ {TERM_WHITE, "½Ë", "½ËÊ¡"},
+ {TERM_WHITE, "ͦ", "ͦ"},
+ {TERM_RED, "¶¸", "¶¸Íð"},
+ {TERM_L_RED, "²Ð", "Ëâ·õ²Ð"},
+ {TERM_WHITE, "Îä", "Ëâ·õÎä"},
+ {TERM_L_BLUE, "ÅÅ", "Ëâ·õÅÅ"},
+ {TERM_SLATE, "»À", "Ëâ·õ»À"},
+ {TERM_L_GREEN, "ÆÇ", "Ëâ·õÆÇ"},
+ {TERM_RED, "Íð", "º®ÍðÂÇ·â"},
+ {TERM_L_BLUE, "»ë", "Æ©ÌÀ»ë"},
+ {TERM_ORANGE, "¥Æ", "¥Æ¥ì¥Ñ¥·"},
+ {TERM_L_BLUE, "²ó", "²óÉü"},
+ {TERM_L_RED, "ÀÖ", "ÀÖ³°"},
+ {TERM_UMBER, "±£", "±£Ì©"},
+ {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, "Ha", "Halluc"},
+ {TERM_L_DARK, "Bl", "Blind"},
+ {TERM_RED, "Pa", "Paralyzed"},
+ {TERM_VIOLET, "Cf", "Confused"},
+ {TERM_GREEN, "Po", "Poisoned"},
+ {TERM_BLUE, "Af", "Afraid"},
+ {TERM_L_BLUE, "Lv", "Levit"},
+ {TERM_SLATE, "Rf", "Reflect"},
+ {TERM_SLATE, "Pw", "PassWall"},
+ {TERM_L_DARK, "Wr", "Wraith"},
+ {TERM_SLATE, "Ev", "PrtEvl"},
+ {TERM_VIOLET, "Kw", "Kawarimi"},
+ {TERM_YELLOW, "Md", "MgcArm"},
+ {TERM_L_UMBER, "Eh", "Expand"},
+ {TERM_WHITE, "Ss", "StnSkn"},
+ {TERM_L_BLUE, "Ms", "MltShdw"},
+ {TERM_SLATE, "Rm", "ResMag"},
+ {TERM_YELLOW, "Ul", "Ultima"},
+ {TERM_YELLOW, "Iv", "Invuln"},
+ {TERM_L_GREEN, "IAc", "ImmAcid"},
+ {TERM_GREEN, "Ac", "Acid"},
+ {TERM_L_BLUE, "IEl", "ImmElec"},
+ {TERM_BLUE, "El", "Elec"},
+ {TERM_L_RED, "IFi", "ImmFire"},
+ {TERM_RED, "Fi", "Fire"},
+ {TERM_WHITE, "ICo", "ImmCold"},
+ {TERM_SLATE, "Co", "Cold"},
+ {TERM_GREEN, "Po", "Pois"},
+ {TERM_L_DARK, "Nt", "Nthr"},
+ {TERM_L_BLUE, "Ti", "Time"},
+ {TERM_L_DARK, "Mr", "Mirr"},
+ {TERM_L_RED, "SFi", "SFire"},
+ {TERM_WHITE, "Fo", "Force"},
+ {TERM_WHITE, "Ho", "Holy"},
+ {TERM_VIOLET, "Ee", "EyeEye"},
+ {TERM_WHITE, "Bs", "Bless"},
+ {TERM_WHITE, "He", "Hero"},
+ {TERM_RED, "Br", "Berserk"},
+ {TERM_L_RED, "BFi", "BFire"},
+ {TERM_WHITE, "BCo", "BCold"},
+ {TERM_L_BLUE, "BEl", "BElec"},
+ {TERM_SLATE, "BAc", "BAcid"},
+ {TERM_L_GREEN, "BPo", "BPois"},
+ {TERM_RED, "TCf", "TchCnf"},
+ {TERM_L_BLUE, "Se", "SInv"},
+ {TERM_ORANGE, "Te", "Telepa"},
+ {TERM_L_BLUE, "Rg", "Regen"},
+ {TERM_L_RED, "If", "Infr"},
+ {TERM_UMBER, "Sl", "Stealth"},
+ {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
+
+#define ADD_FLG(FLG) (bar_flags[FLG / 32] |= (1L << (FLG % 32)))
+#define IS_FLG(FLG) (bar_flags[FLG / 32] & (1L << (FLG % 32)))
+
+/*
+ * Show status bar
+ */
static void prt_status(void)
{
+ u32b bar_flags[3];
+ int wid, hgt, row_statbar, max_col_statbar;
+ int i, col = 0, num = 0;
+ int space = 2;
+
+ Term_get_size(&wid, &hgt);
+ row_statbar = hgt + ROW_STATBAR;
+ max_col_statbar = wid + MAX_COL_STATBAR;
+
+ Term_erase(0, row_statbar, max_col_statbar);
+
+ bar_flags[0] = bar_flags[1] = bar_flags[2] = 0L;
+
/* Tsuyoshi */
- if (p_ptr->tsuyoshi)
- {
-#ifdef JP
- c_put_str(TERM_YELLOW, "¤Ä", ROW_STATBAR, COL_STATBAR);
-#else
- c_put_str(TERM_YELLOW, "Ts", ROW_STATBAR, COL_STATBAR);
-#endif
- }
+ if (p_ptr->tsuyoshi) ADD_FLG(BAR_TSUYOSHI);
/* Hallucinating */
- else if (p_ptr->image)
- {
-#ifdef JP
- c_put_str(TERM_VIOLET, "¸¸", ROW_STATBAR, COL_STATBAR);
-#else
- c_put_str(TERM_VIOLET, "Hu", ROW_STATBAR, COL_STATBAR);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR);
- }
+ if (p_ptr->image) ADD_FLG(BAR_HALLUCINATION);
/* Blindness */
- if (p_ptr->blind)
- {
-#ifdef JP
- c_put_str(TERM_L_DARK, "ÌÕ", ROW_STATBAR, COL_STATBAR+2);
-#else
- c_put_str(TERM_L_DARK, "Bl", ROW_STATBAR, COL_STATBAR+2);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+2);
- }
+ if (p_ptr->blind) ADD_FLG(BAR_BLINDNESS);
/* Paralysis */
- if (p_ptr->paralyzed)
- {
-#ifdef JP
- c_put_str(TERM_RED, "áã", ROW_STATBAR, COL_STATBAR+4);
-#else
- c_put_str(TERM_RED, "Pa", ROW_STATBAR, COL_STATBAR+4);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+4);
- }
+ if (p_ptr->paralyzed) ADD_FLG(BAR_PARALYZE);
/* Confusion */
- if (p_ptr->confused)
- {
-#ifdef JP
- c_put_str(TERM_VIOLET, "Íð", ROW_STATBAR, COL_STATBAR+6);
-#else
- c_put_str(TERM_VIOLET, "Cf", ROW_STATBAR, COL_STATBAR+6);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+6);
- }
+ if (p_ptr->confused) ADD_FLG(BAR_CONFUSE);
- /* Afraid */
- if (p_ptr->poisoned)
- {
-#ifdef JP
- c_put_str(TERM_GREEN, "ÆÇ", ROW_STATBAR, COL_STATBAR+8);
-#else
- c_put_str(TERM_GREEN, "Po", ROW_STATBAR, COL_STATBAR+8);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+8);
- }
+ /* Posioned */
+ if (p_ptr->poisoned) ADD_FLG(BAR_POISONED);
/* Times see-invisible */
- if (p_ptr->tim_invis)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "ȑ", ROW_STATBAR, COL_STATBAR+10);
-#else
- c_put_str(TERM_L_BLUE, "Se", ROW_STATBAR, COL_STATBAR+10);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+10);
- }
+ if (p_ptr->tim_invis) ADD_FLG(BAR_SENSEUNSEEN);
/* Timed esp */
- if (p_ptr->tim_esp || music_singing(MUSIC_MIND))
- {
-#ifdef JP
- c_put_str(TERM_ORANGE, "¥Æ", ROW_STATBAR, COL_STATBAR+12);
-#else
- c_put_str(TERM_ORANGE, "Te", ROW_STATBAR, COL_STATBAR+12);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+12);
- }
+ if (IS_TIM_ESP()) ADD_FLG(BAR_TELEPATHY);
/* Timed regenerate */
- if (p_ptr->tim_regen)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "²ó", ROW_STATBAR, COL_STATBAR+14);
-#else
- c_put_str(TERM_L_BLUE, "Rg", ROW_STATBAR, COL_STATBAR+14);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+14);
- }
+ if (p_ptr->tim_regen) ADD_FLG(BAR_REGENERATION);
/* Timed infra-vision */
- if (p_ptr->tim_infra)
- {
-#ifdef JP
- c_put_str(TERM_L_RED, "ÀÖ", ROW_STATBAR, COL_STATBAR+16);
-#else
- c_put_str(TERM_L_RED, "If", ROW_STATBAR, COL_STATBAR+16);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+16);
- }
+ if (p_ptr->tim_infra) ADD_FLG(BAR_INFRAVISION);
/* Protection from evil */
- if (p_ptr->protevil)
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "¼Ù", ROW_STATBAR, COL_STATBAR+18);
-#else
- c_put_str(TERM_SLATE, "Ev", ROW_STATBAR, COL_STATBAR+18);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+18);
- }
+ if (p_ptr->protevil) ADD_FLG(BAR_PROTEVIL);
/* Invulnerability */
- if (p_ptr->invuln || music_singing(MUSIC_INVULN))
- {
-#ifdef JP
- c_put_str(TERM_YELLOW, "̵", ROW_STATBAR, COL_STATBAR+20);
-#else
- c_put_str(TERM_YELLOW, "Iv", ROW_STATBAR, COL_STATBAR+20);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+20);
- }
+ if (IS_INVULN()) ADD_FLG(BAR_INVULN);
/* Wraith form */
- if (p_ptr->wraith_form)
- {
-#ifdef JP
- c_put_str(TERM_L_DARK, "ͩ", ROW_STATBAR, COL_STATBAR+22);
-#else
- c_put_str(TERM_L_DARK, "Gh", ROW_STATBAR, COL_STATBAR+22);
-#endif
- }
+ if (p_ptr->wraith_form) ADD_FLG(BAR_WRAITH);
+
/* Kabenuke */
- else if (p_ptr->kabenuke)
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "ÊÉ", ROW_STATBAR, COL_STATBAR+22);
-#else
- c_put_str(TERM_SLATE, "Wp", ROW_STATBAR, COL_STATBAR+22);
-#endif
- }
- else if (p_ptr->tim_reflect)
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "ȿ", ROW_STATBAR, COL_STATBAR+22);
-#else
- c_put_str(TERM_SLATE, "Rf", ROW_STATBAR, COL_STATBAR+22);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+22);
- }
+ if (p_ptr->kabenuke) ADD_FLG(BAR_PASSWALL);
+
+ if (p_ptr->tim_reflect) ADD_FLG(BAR_REFLECTION);
/* Heroism */
- if (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "ͦ", ROW_STATBAR, COL_STATBAR+24);
-#else
- c_put_str(TERM_WHITE, "He", ROW_STATBAR, COL_STATBAR+24);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+24);
- }
+ if (IS_HERO()) ADD_FLG(BAR_HEROISM);
/* Super Heroism / berserk */
- if (p_ptr->shero)
- {
-#ifdef JP
- c_put_str(TERM_RED, "¶¸", ROW_STATBAR, COL_STATBAR+26);
-#else
- c_put_str(TERM_RED, "Br", ROW_STATBAR, COL_STATBAR+26);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+26);
- }
+ if (p_ptr->shero) ADD_FLG(BAR_BERSERK);
/* Blessed */
- if (p_ptr->blessed || music_singing(MUSIC_BLESS))
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "½Ë", ROW_STATBAR, COL_STATBAR+28);
-#else
- c_put_str(TERM_WHITE, "Bs", ROW_STATBAR, COL_STATBAR+28);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+28);
- }
+ if (IS_BLESSED()) ADD_FLG(BAR_BLESSED);
/* Shield */
- if (p_ptr->magicdef)
- {
-#ifdef JP
- c_put_str(TERM_YELLOW, "Ëâ", ROW_STATBAR, COL_STATBAR+30);
-#else
- c_put_str(TERM_YELLOW, "Md", ROW_STATBAR, COL_STATBAR+30);
-#endif
- }
- else if (p_ptr->tsubureru)
- {
-#ifdef JP
- c_put_str(TERM_L_UMBER, "¿", ROW_STATBAR, COL_STATBAR+30);
-#else
- c_put_str(TERM_L_UMBER, "Eh", ROW_STATBAR, COL_STATBAR+30);
-#endif
- }
- else if (p_ptr->shield)
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "ÀÐ", ROW_STATBAR, COL_STATBAR+30);
-#else
- c_put_str(TERM_WHITE, "Ss", ROW_STATBAR, COL_STATBAR+30);
-#endif
- }
- else if (p_ptr->special_defense & NINJA_KAWARIMI)
- {
-#ifdef JP
- c_put_str(TERM_VIOLET, "ÊÑ", ROW_STATBAR, COL_STATBAR+30);
-#else
- c_put_str(TERM_VIOLET, "Qa", ROW_STATBAR, COL_STATBAR+30);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+30);
- }
+ if (p_ptr->magicdef) ADD_FLG(BAR_MAGICDEFENSE);
+
+ if (p_ptr->tsubureru) ADD_FLG(BAR_EXPAND);
+
+ if (p_ptr->shield) ADD_FLG(BAR_STONESKIN);
+
+ if (p_ptr->special_defense & NINJA_KAWARIMI) ADD_FLG(BAR_KAWARIMI);
/* Oppose Acid */
- if (p_ptr->special_defense & DEFENSE_ACID)
- {
-#ifdef JP
- c_put_str(TERM_L_GREEN, "»À", ROW_STATBAR, COL_STATBAR+32);
-#else
- c_put_str(TERM_L_GREEN, "Ac", ROW_STATBAR, COL_STATBAR+32);
-#endif
- }
- else if (p_ptr->oppose_acid || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
- {
-#ifdef JP
- c_put_str(TERM_GREEN, "»À", ROW_STATBAR, COL_STATBAR+32);
-#else
- c_put_str(TERM_GREEN, "Ac", ROW_STATBAR, COL_STATBAR+32);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+32);
- }
+ if (p_ptr->special_defense & DEFENSE_ACID) ADD_FLG(BAR_IMMACID);
+ if (IS_OPPOSE_ACID()) ADD_FLG(BAR_RESACID);
/* Oppose Lightning */
- if (p_ptr->special_defense & DEFENSE_ELEC)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "ÅÅ", ROW_STATBAR, COL_STATBAR+34);
-#else
- c_put_str(TERM_L_BLUE, "El", ROW_STATBAR, COL_STATBAR+34);
-#endif
- }
- else if (p_ptr->oppose_elec || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
- {
-#ifdef JP
- c_put_str(TERM_BLUE, "ÅÅ", ROW_STATBAR, COL_STATBAR+34);
-#else
- c_put_str(TERM_BLUE, "El", ROW_STATBAR, COL_STATBAR+34);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+34);
- }
+ if (p_ptr->special_defense & DEFENSE_ELEC) ADD_FLG(BAR_IMMELEC);
+ if (IS_OPPOSE_ELEC()) ADD_FLG(BAR_RESELEC);
/* Oppose Fire */
- if (p_ptr->special_defense & DEFENSE_FIRE)
- {
-#ifdef JP
- c_put_str(TERM_L_RED, "²Ð", ROW_STATBAR, COL_STATBAR+36);
-#else
- c_put_str(TERM_L_RED, "Fi", ROW_STATBAR, COL_STATBAR+36);
-#endif
- }
- else if (p_ptr->oppose_fire || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
- {
-#ifdef JP
- c_put_str(TERM_RED, "²Ð", ROW_STATBAR, COL_STATBAR+36);
-#else
- c_put_str(TERM_RED, "Fi", ROW_STATBAR, COL_STATBAR+36);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+36);
- }
+ if (p_ptr->special_defense & DEFENSE_FIRE) ADD_FLG(BAR_IMMFIRE);
+ if (IS_OPPOSE_FIRE()) ADD_FLG(BAR_RESFIRE);
/* Oppose Cold */
- if (p_ptr->special_defense & DEFENSE_COLD)
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "Îä", ROW_STATBAR, COL_STATBAR+38);
-#else
- c_put_str(TERM_WHITE, "Co", ROW_STATBAR, COL_STATBAR+38);
-#endif
- }
- else if (p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "Îä", ROW_STATBAR, COL_STATBAR+38);
-#else
- c_put_str(TERM_SLATE, "Co", ROW_STATBAR, COL_STATBAR+38);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+38);
- }
+ if (p_ptr->special_defense & DEFENSE_COLD) ADD_FLG(BAR_IMMCOLD);
+ 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))
- {
-#ifdef JP
- c_put_str(TERM_GREEN, "ÆÇ", ROW_STATBAR, COL_STATBAR+40);
-#else
- c_put_str(TERM_GREEN, "Po", ROW_STATBAR, COL_STATBAR+40);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+40);
- }
+ if (IS_OPPOSE_POIS()) ADD_FLG(BAR_RESPOIS);
/* Word of Recall */
- if (p_ptr->word_recall)
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "µ¢", ROW_STATBAR, COL_STATBAR+42);
-#else
- c_put_str(TERM_WHITE, "Wr", ROW_STATBAR, COL_STATBAR+42);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+42);
- }
-
- /* Afraid */
- if (p_ptr->afraid)
- {
-#ifdef JP
- c_put_str(TERM_BLUE, "¶²", ROW_STATBAR, COL_STATBAR+44);
-#else
- c_put_str(TERM_BLUE, "Fe", ROW_STATBAR, COL_STATBAR+44);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+44);
- }
-
- /* Blindness */
- if (p_ptr->tim_res_time)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "»þ", ROW_STATBAR, COL_STATBAR+46);
-#else
- c_put_str(TERM_L_BLUE, "Ti", ROW_STATBAR, COL_STATBAR+46);
-#endif
- }
- else if (p_ptr->multishadow)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "ʬ", ROW_STATBAR, COL_STATBAR+46);
-#else
- c_put_str(TERM_L_BLUE, "Ms", ROW_STATBAR, COL_STATBAR+46);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+46);
- }
-
- /* Confusing Hands */
- if (p_ptr->special_attack & ATTACK_CONFUSE)
- {
-#ifdef JP
- c_put_str(TERM_RED, "Íð", ROW_STATBAR, COL_STATBAR+48);
-#else
- c_put_str(TERM_RED, "Cf", ROW_STATBAR, COL_STATBAR+48);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+48);
- }
-
- if (p_ptr->resist_magic)
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "ËÉ", ROW_STATBAR, COL_STATBAR+50);
-#else
- c_put_str(TERM_SLATE, "Rm", ROW_STATBAR, COL_STATBAR+50);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+50);
- }
-
- /* Ultimate-resistance */
- if (p_ptr->ult_res)
- {
-#ifdef JP
- c_put_str(TERM_YELLOW, "µæ", ROW_STATBAR, COL_STATBAR+52);
-#else
- c_put_str(TERM_YELLOW, "Ul", ROW_STATBAR, COL_STATBAR+52);
-#endif
- }
- /* tim levitation */
- else if (p_ptr->tim_ffall)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "Éâ", ROW_STATBAR, COL_STATBAR+52);
-#else
- c_put_str(TERM_L_BLUE, "Lv", ROW_STATBAR, COL_STATBAR+52);
-#endif
- }
- else if (p_ptr->tim_res_nether)
- {
-#ifdef JP
- c_put_str(TERM_L_DARK, "¹ö", ROW_STATBAR, COL_STATBAR+52);
-#else
- c_put_str(TERM_L_DARK, "Nt", ROW_STATBAR, COL_STATBAR+52);
-#endif
- }
- else if (p_ptr->dustrobe)
- {
-#ifdef JP
- c_put_str(TERM_L_DARK, "¶À", ROW_STATBAR, COL_STATBAR+52);
-#else
- c_put_str(TERM_L_DARK, "Am", ROW_STATBAR, COL_STATBAR+52);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+52);
- }
+ if (p_ptr->word_recall) ADD_FLG(BAR_RECALL);
+
+ /* Alter realiry */
+ if (p_ptr->alter_reality) ADD_FLG(BAR_ALTER);
+
+ /* Afraid */
+ if (p_ptr->afraid) ADD_FLG(BAR_AFRAID);
+
+ /* Resist time */
+ if (p_ptr->tim_res_time) ADD_FLG(BAR_RESTIME);
+
+ if (p_ptr->multishadow) ADD_FLG(BAR_MULTISHADOW);
+
+ /* Confusing Hands */
+ if (p_ptr->special_attack & ATTACK_CONFUSE) ADD_FLG(BAR_ATTKCONF);
+
+ if (p_ptr->resist_magic) ADD_FLG(BAR_REGMAGIC);
+
+ /* Ultimate-resistance */
+ if (p_ptr->ult_res) ADD_FLG(BAR_ULTIMATE);
+
+ /* tim levitation */
+ if (p_ptr->tim_levitation) ADD_FLG(BAR_LEVITATE);
+
+ if (p_ptr->tim_res_nether) ADD_FLG(BAR_RESNETH);
+
+ if (p_ptr->dustrobe) ADD_FLG(BAR_DUSTROBE);
/* Mahouken */
- if (p_ptr->special_attack & ATTACK_FIRE)
- {
-#ifdef JP
- c_put_str(TERM_L_RED, "²Ð", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_L_RED, "Fi", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else if (p_ptr->special_attack & ATTACK_COLD)
- {
-#ifdef JP
- c_put_str(TERM_WHITE, "Îä", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_WHITE, "Co", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else if (p_ptr->special_attack & ATTACK_ELEC)
- {
-#ifdef JP
- c_put_str(TERM_L_BLUE, "ÅÅ", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_L_BLUE, "El", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else if (p_ptr->special_attack & ATTACK_ACID)
- {
-#ifdef JP
- c_put_str(TERM_SLATE, "»À", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_SLATE, "Ac", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else if (p_ptr->special_attack & ATTACK_POIS)
- {
-#ifdef JP
- c_put_str(TERM_L_GREEN, "ÆÇ", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_L_GREEN, "Po", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else if (p_ptr->special_defense & NINJA_S_STEALTH)
- {
-#ifdef JP
- c_put_str(TERM_YELLOW, "Ķ", ROW_STATBAR, COL_STATBAR+54);
-#else
- c_put_str(TERM_YELLOW, "St", ROW_STATBAR, COL_STATBAR+54);
-#endif
- }
- else
- {
- put_str(" ", ROW_STATBAR, COL_STATBAR+54);
- }
+ if (p_ptr->special_attack & ATTACK_FIRE) ADD_FLG(BAR_ATTKFIRE);
+ if (p_ptr->special_attack & ATTACK_COLD) ADD_FLG(BAR_ATTKCOLD);
+ if (p_ptr->special_attack & ATTACK_ELEC) ADD_FLG(BAR_ATTKELEC);
+ if (p_ptr->special_attack & ATTACK_ACID) ADD_FLG(BAR_ATTKACID);
+ if (p_ptr->special_attack & ATTACK_POIS) ADD_FLG(BAR_ATTKPOIS);
+ if (p_ptr->special_defense & NINJA_S_STEALTH) ADD_FLG(BAR_SUPERSTEALTH);
+
+ if (p_ptr->tim_sh_fire) ADD_FLG(BAR_SHFIRE);
/* tim stealth */
- if (p_ptr->tim_sh_fire)
- {
-#ifdef JP
- c_put_str(TERM_L_RED, "¥ª", ROW_STATBAR, COL_STATBAR+56);
-#else
- c_put_str(TERM_L_RED, "Sf", ROW_STATBAR, COL_STATBAR+56);
-#endif
- }
- else if (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
- {
-#ifdef JP
- c_put_str(TERM_UMBER, "±£", ROW_STATBAR, COL_STATBAR+56);
-#else
- c_put_str(TERM_UMBER, "Sl", ROW_STATBAR, COL_STATBAR+56);
-#endif
+ if (IS_TIM_STEALTH()) ADD_FLG(BAR_STEALTH);
+
+ if (p_ptr->tim_sh_touki) ADD_FLG(BAR_TOUKI);
+
+ /* Holy aura */
+ if (p_ptr->tim_sh_holy) ADD_FLG(BAR_SHHOLY);
+
+ /* 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);
+ }
}
- else if (p_ptr->special_defense & NINJA_S_STEALTH)
+
+ /* Calcurate length */
+ for (i = 0; bar[i].sstr; i++)
{
-#ifdef JP
- c_put_str(TERM_YELLOW, "±£", ROW_STATBAR, COL_STATBAR+56);
-#else
- c_put_str(TERM_YELLOW, "lt", ROW_STATBAR, COL_STATBAR+56);
-#endif
+ if (IS_FLG(i))
+ {
+ col += strlen(bar[i].lstr) + 1;
+ num++;
+ }
}
- else if (p_ptr->tim_sh_touki)
+
+ /* If there are not excess spaces for long strings, use short one */
+ if (col - 1 > max_col_statbar)
{
-#ifdef JP
- c_put_str(TERM_WHITE, "Ʈ", ROW_STATBAR, COL_STATBAR+56);
-#else
- c_put_str(TERM_WHITE, "Ae", ROW_STATBAR, COL_STATBAR+56);
-#endif
+ space = 0;
+ col = 0;
+
+ for (i = 0; bar[i].sstr; i++)
+ {
+ if (IS_FLG(i))
+ {
+ col += strlen(bar[i].sstr);
+ }
+ }
+
+ /* If there are excess spaces for short string, use more */
+ if (col - 1 <= max_col_statbar - (num-1))
+ {
+ space = 1;
+ col += num - 1;
+ }
}
- else
+
+
+ /* Centering display column */
+ col = (max_col_statbar - col) / 2;
+
+ /* Display status bar */
+ for (i = 0; bar[i].sstr; i++)
{
- put_str(" ", ROW_STATBAR, COL_STATBAR+56);
+ if (IS_FLG(i))
+ {
+ cptr str;
+ if (space == 2) str = bar[i].lstr;
+ else str = bar[i].sstr;
+
+ c_put_str(bar[i].attr, str, row_statbar, col);
+ col += strlen(str);
+ if (space > 0) col++;
+ if (col > max_col_statbar) break;
+ }
}
}
static void prt_title(void)
{
cptr p = "";
+ char str[14];
/* Wizard */
- if (wizard)
+ if (p_ptr->wizard)
{
#ifdef JP
- /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
+ /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
p = "[¥¦¥£¥¶¡¼¥É]";
#else
p = "[=-WIZARD-=]";
}
/* Winner */
- else if (total_winner || (p_ptr->lev > PY_MAX_LEVEL))
+ 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
else
{
#ifdef JP
- /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
+ /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
p = "***¾¡Íø¼Ô***";
-
#else
p = "***WINNER***";
#endif
/* Normal */
else
{
- p = player_title[p_ptr->pclass][(p_ptr->lev - 1) / 5];
-
-
+ my_strcpy(str, player_title[p_ptr->pclass][(p_ptr->lev - 1) / 5], sizeof(str));
+ p = str;
}
prt_field(p, ROW_TITLE, COL_TITLE);
{
char out_val[32];
- if ((p_ptr->prace == RACE_ANDROID) && !cheat_xtra)
- (void)strcpy(out_val, "*******");
- else
+ 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)
{
#ifdef JP
- put_str("·Ð¸³ ", ROW_EXP, 0);
+ if (p_ptr->prace == RACE_ANDROID) put_str("¶¯²½ ", ROW_EXP, 0);
+ else put_str("·Ð¸³ ", ROW_EXP, 0);
c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 5);
#else
- put_str("EXP ", ROW_EXP, 0);
+ if (p_ptr->prace == RACE_ANDROID) put_str("Cst ", ROW_EXP, 0);
+ else put_str("EXP ", ROW_EXP, 0);
c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 4);
#endif
}
}
-
/*
* 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 * hitpoint_warn) / 10)
+ 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);
static void prt_depth(void)
{
char depths[32];
+ int wid, hgt, row_depth, col_depth;
+ byte attr = TERM_WHITE;
+
+ Term_get_size(&wid, &hgt);
+ col_depth = wid + COL_DEPTH;
+ row_depth = hgt + ROW_DEPTH;
if (!dun_level)
{
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, " ");
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] = "";
+ int wid, hgt, row_speed, col_speed;
+
+ Term_get_size(&wid, &hgt);
+ col_speed = wid + COL_SPEED;
+ 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;
}
/* Display the speed */
- c_put_str(attr, format("%-9s", buf), ROW_SPEED, COL_SPEED);
+ c_put_str(attr, format("%-9s", buf), row_speed, col_speed);
}
static void prt_study(void)
{
+ int wid, hgt, row_study, col_study;
+
+ Term_get_size(&wid, &hgt);
+ col_study = wid + COL_STUDY;
+ row_study = hgt + ROW_STUDY;
+
if (p_ptr->new_spells)
{
#ifdef JP
- put_str("³Ø½¬", ROW_STUDY, COL_STUDY);
+ put_str("³Ø½¬", row_study, col_study);
#else
- put_str("Stud", ROW_STUDY, COL_STUDY);
+ put_str("Stud", row_study, col_study);
#endif
}
else
{
- put_str(" ", ROW_STUDY, COL_STUDY);
+ put_str(" ", row_study, col_study);
}
}
-static void prt_mane(void)
+static void prt_imitation(void)
{
+ int wid, hgt, row_study, col_study;
+
+ Term_get_size(&wid, &hgt);
+ col_study = wid + COL_STUDY;
+ row_study = hgt + ROW_STUDY;
+
if (p_ptr->pclass == CLASS_IMITATOR)
{
- if (mane_num)
+ if (p_ptr->mane_num)
{
byte attr;
if (new_mane) attr = TERM_L_RED;
else attr = TERM_WHITE;
#ifdef JP
- c_put_str(attr, "¤Þ¤Í", ROW_STUDY, COL_STUDY);
+ 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
{
- put_str(" ", ROW_STUDY, COL_STUDY);
+ put_str(" ", row_study, col_study);
}
}
}
* 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 (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_field(mimic_info[p_ptr->mimic_form].title, ROW_RACE, COL_RACE);
else
{
-#ifdef JP
char str[14];
- mb_strlcpy(str, rp_ptr->title, 14);
+ my_strcpy(str, rp_ptr->title, sizeof(str));
prt_field(str, ROW_RACE, COL_RACE);
-#else
- prt_field(rp_ptr->title, ROW_RACE, COL_RACE);
-#endif
}
/* prt_field(cp_ptr->title, ROW_CLASS, COL_CLASS); */
/* prt_field(ap_ptr->title, ROW_SEIKAKU, COL_SEIKAKU); */
prt_depth();
/* Special */
- health_redraw();
- riding_health_redraw();
+ health_redraw(FALSE);
+ health_redraw(TRUE);
}
/* Study spells */
prt_study();
- prt_mane();
+ prt_imitation();
prt_status();
}
for (j = 0; j < 8; j++)
{
term *old = Term;
+ int wid, hgt;
/* No window */
if (!angband_term[j]) continue;
/* Activate */
Term_activate(angband_term[j]);
- /* Redraw map */
- display_map(&cy, &cx);
+ /* Full map in too small window is useless */
+ Term_get_size(&wid, &hgt);
+ if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2)
+ {
+ /* Redraw map */
+ display_map(&cy, &cx);
- /* Fresh */
- Term_fresh();
+ /* Fresh */
+ Term_fresh();
+ }
/* Restore */
Term_activate(old);
{
int i, j, k, levels;
int num_allowed;
- int num_boukyaku = 0;
+ int num_boukyaku = 0;
magic_type *s_ptr;
- int use_realm1 = p_ptr->realm1 - 1;
- int use_realm2 = p_ptr->realm2 - 1;
int which;
int bonus = 0;
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 (num_allowed>(80+bonus)) num_allowed = 80+bonus;
}
- /* Count the number of spells we know */
- for (j = 0; j < 64; j++)
+ /* Count the number of spells we know */
+ for (j = 0; j < 64; j++)
{
/* Count known spells */
if ((j < 32) ?
- (spell_forgotten1 & (1L << j)) :
- (spell_forgotten2 & (1L << (j - 32))))
+ (p_ptr->spell_forgotten1 & (1L << j)) :
+ (p_ptr->spell_forgotten2 & (1L << (j - 32))))
{
num_boukyaku++;
- }
- }
+ }
+ }
/* See how many spells we must forget or may learn */
p_ptr->new_spells = num_allowed + p_ptr->add_spells + num_boukyaku - p_ptr->learned_spells;
for (i = 63; i >= 0; i--)
{
/* Efficiency -- all done */
- if (!spell_learned1 && !spell_learned2) break;
+ if (!p_ptr->spell_learned1 && !p_ptr->spell_learned2) break;
/* Access the spell */
- j = spell_order[i];
+ j = p_ptr->spell_order[i];
/* Skip non-spells */
if (j >= 99) continue;
/* Get the spell */
- if (!is_magic(((j < 32) ? use_realm1 : use_realm2)+1))
+ if (!is_magic((j < 32) ? p_ptr->realm1 : p_ptr->realm2))
{
if (j < 32)
- s_ptr = &technic_info[use_realm1 - MIN_TECHNIC][j];
+ s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][j];
else
- s_ptr = &technic_info[use_realm2 - MIN_TECHNIC][j%32];
+ s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][j%32];
}
else if (j < 32)
- s_ptr = &mp_ptr->info[use_realm1][j];
+ s_ptr = &mp_ptr->info[p_ptr->realm1-1][j];
else
- s_ptr = &mp_ptr->info[use_realm2][j%32];
+ s_ptr = &mp_ptr->info[p_ptr->realm2-1][j%32];
/* Skip spells we are allowed to know */
if (s_ptr->slevel <= p_ptr->lev) continue;
/* Is it known? */
if ((j < 32) ?
- (spell_learned1 & (1L << j)) :
- (spell_learned2 & (1L << (j - 32))))
+ (p_ptr->spell_learned1 & (1L << j)) :
+ (p_ptr->spell_learned2 & (1L << (j - 32))))
{
/* Mark as forgotten */
if (j < 32)
{
- spell_forgotten1 |= (1L << j);
- which = use_realm1;
+ p_ptr->spell_forgotten1 |= (1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_forgotten2 |= (1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_forgotten2 |= (1L << (j - 32));
+ which = p_ptr->realm2;
}
/* No longer known */
if (j < 32)
{
- spell_learned1 &= ~(1L << j);
- which = use_realm1;
+ p_ptr->spell_learned1 &= ~(1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_learned2 &= ~(1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_learned2 &= ~(1L << (j - 32));
+ which = p_ptr->realm2;
}
/* Message */
#ifdef JP
- msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
- spell_names[technic2magic(which+1)-1][j%32], p );
+ msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have forgotten the %s of %s.", p,
- spell_names[technic2magic(which+1)-1][j%32]);
+ do_spell(which, j%32, SPELL_NAME));
#endif
if (p_ptr->new_spells >= 0) break;
/* Efficiency -- all done */
- if (!spell_learned1 && !spell_learned2) break;
+ if (!p_ptr->spell_learned1 && !p_ptr->spell_learned2) break;
/* Get the (i+1)th spell learned */
- j = spell_order[i];
+ j = p_ptr->spell_order[i];
/* Skip unknown spells */
if (j >= 99) continue;
/* Forget it (if learned) */
if ((j < 32) ?
- (spell_learned1 & (1L << j)) :
- (spell_learned2 & (1L << (j - 32))))
+ (p_ptr->spell_learned1 & (1L << j)) :
+ (p_ptr->spell_learned2 & (1L << (j - 32))))
{
/* Mark as forgotten */
if (j < 32)
{
- spell_forgotten1 |= (1L << j);
- which = use_realm1;
+ p_ptr->spell_forgotten1 |= (1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_forgotten2 |= (1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_forgotten2 |= (1L << (j - 32));
+ which = p_ptr->realm2;
}
/* No longer known */
if (j < 32)
{
- spell_learned1 &= ~(1L << j);
- which = use_realm1;
+ p_ptr->spell_learned1 &= ~(1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_learned2 &= ~(1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_learned2 &= ~(1L << (j - 32));
+ which = p_ptr->realm2;
}
/* Message */
#ifdef JP
- msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
- spell_names[technic2magic(which+1)-1][j%32], p );
+ msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have forgotten the %s of %s.", p,
- spell_names[technic2magic(which+1)-1][j%32]);
+ do_spell(which, j%32, SPELL_NAME));
#endif
if (p_ptr->new_spells <= 0) break;
/* Efficiency -- all done */
- if (!spell_forgotten1 && !spell_forgotten2) break;
+ if (!p_ptr->spell_forgotten1 && !p_ptr->spell_forgotten2) break;
/* Get the next spell we learned */
- j = spell_order[i];
+ j = p_ptr->spell_order[i];
/* Skip unknown spells */
if (j >= 99) break;
/* Access the spell */
- if (!is_magic(((j < 32) ? use_realm1 : use_realm2)+1))
+ if (!is_magic((j < 32) ? p_ptr->realm1 : p_ptr->realm2))
{
if (j < 32)
- s_ptr = &technic_info[use_realm1 - MIN_TECHNIC][j];
+ s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][j];
else
- s_ptr = &technic_info[use_realm2 - MIN_TECHNIC][j%32];
+ s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][j%32];
}
else if (j<32)
- s_ptr = &mp_ptr->info[use_realm1][j];
+ s_ptr = &mp_ptr->info[p_ptr->realm1-1][j];
else
- s_ptr = &mp_ptr->info[use_realm2][j%32];
+ s_ptr = &mp_ptr->info[p_ptr->realm2-1][j%32];
/* Skip spells we cannot remember */
if (s_ptr->slevel > p_ptr->lev) continue;
/* First set of spells */
if ((j < 32) ?
- (spell_forgotten1 & (1L << j)) :
- (spell_forgotten2 & (1L << (j - 32))))
+ (p_ptr->spell_forgotten1 & (1L << j)) :
+ (p_ptr->spell_forgotten2 & (1L << (j - 32))))
{
/* No longer forgotten */
if (j < 32)
{
- spell_forgotten1 &= ~(1L << j);
- which = use_realm1;
+ p_ptr->spell_forgotten1 &= ~(1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_forgotten2 &= ~(1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_forgotten2 &= ~(1L << (j - 32));
+ which = p_ptr->realm2;
}
/* Known once more */
if (j < 32)
{
- spell_learned1 |= (1L << j);
- which = use_realm1;
+ p_ptr->spell_learned1 |= (1L << j);
+ which = p_ptr->realm1;
}
else
{
- spell_learned2 |= (1L << (j - 32));
- which = use_realm2;
+ p_ptr->spell_learned2 |= (1L << (j - 32));
+ which = p_ptr->realm2;
}
/* Message */
#ifdef JP
- msg_format("%s¤Î%s¤ò»×¤¤½Ð¤·¤¿¡£",
- spell_names[technic2magic(which+1)-1][j%32], p );
+ msg_format("%s¤Î%s¤ò»×¤¤½Ð¤·¤¿¡£",
+ do_spell(which, j%32, SPELL_NAME), p );
#else
msg_format("You have remembered the %s of %s.",
- p, spell_names[technic2magic(which+1)-1][j%32]);
+ p, do_spell(which, j%32, SPELL_NAME));
#endif
/* Count spells that can be learned */
for (j = 0; j < 32; j++)
{
- if (!is_magic(use_realm1+1)) s_ptr = &technic_info[use_realm1-MIN_TECHNIC][j];
- else s_ptr = &mp_ptr->info[use_realm1][j];
+ if (!is_magic(p_ptr->realm1)) s_ptr = &technic_info[p_ptr->realm1-MIN_TECHNIC][j];
+ else s_ptr = &mp_ptr->info[p_ptr->realm1-1][j];
/* Skip spells we cannot remember */
if (s_ptr->slevel > p_ptr->lev) continue;
/* Skip spells we already know */
- if (spell_learned1 & (1L << j))
+ if (p_ptr->spell_learned1 & (1L << j))
{
continue;
}
/* 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;
}
}
#else
msg_format("You can learn %d more %s%s.",
- p_ptr->new_spells, p,
- (p_ptr->new_spells != 1) ? "s" : "");
+ p_ptr->new_spells, p,
+ (p_ptr->new_spells != 1) ? "s" : "");
#endif
}
/* Redraw Study Status */
p_ptr->redraw |= (PR_STUDY);
+
+ /* Redraw object recall */
+ p_ptr->window |= (PW_OBJECT);
}
}
/* Only mages are affected */
if (mp_ptr->spell_xtra & MAGIC_GLOVE_REDUCE_MANA)
{
- u32b f1, f2, f3;
+ u32b flgs[TR_FLAG_SIZE];
/* Assume player is not encumbered by gloves */
p_ptr->cumber_glove = FALSE;
o_ptr = &inventory[INVEN_HANDS];
/* Examine the gloves */
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
/* Normal gloves hurt mage-type spells */
if (o_ptr->k_idx &&
- !(f2 & (TR2_FREE_ACT)) &&
- !(f1 & (TR1_MAGIC_MASTERY)) &&
- !((f1 & (TR1_DEX)) && (o_ptr->pval > 0)))
+ !(have_flag(flgs, TR_FREE_ACT)) &&
+ !(have_flag(flgs, TR_MAGIC_MASTERY)) &&
+ !((have_flag(flgs, TR_DEX)) && (o_ptr->pval > 0)))
{
/* Encumbered */
p_ptr->cumber_glove = TRUE;
}
#ifdef JP
- /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
- if ((level_up == 1) && (msp > p_ptr->msp))
- {
- msg_format("ºÇÂç¥Þ¥¸¥Ã¥¯¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
- (msp - p_ptr->msp));
- }
+ /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
+ if ((level_up == 1) && (msp > p_ptr->msp))
+ {
+ msg_format("ºÇÂç¥Þ¥¸¥Ã¥¯¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
+ (msp - p_ptr->msp));
+ }
#endif
/* Save new mana */
p_ptr->msp = msp;
bonus = ((int)(adj_con_mhp[p_ptr->stat_ind[A_CON]]) - 128) * p_ptr->lev / 4;
/* Calculate hitpoints */
- mhp = player_hp[p_ptr->lev - 1];
+ mhp = p_ptr->player_hp[p_ptr->lev - 1];
if (p_ptr->mimic_form)
{
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))
- if (p_ptr->shero) mhp += 30;
+ if (IS_HERO()) mhp += 10;
+ 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)
{
}
#ifdef JP
- /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
- if ((level_up == 1) && (mhp > p_ptr->mhp))
- {
- msg_format("ºÇÂç¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
- (mhp - p_ptr->mhp) );
- }
+ /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
+ if ((level_up == 1) && (mhp > p_ptr->mhp))
+ {
+ msg_format("ºÇÂç¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
+ (mhp - p_ptr->mhp) );
+ }
#endif
/* Save the new max-hitpoints */
p_ptr->mhp = mhp;
{
int i;
object_type *o_ptr;
- u32b f1, f2, f3;
+ u32b flgs[TR_FLAG_SIZE];
/* Assume no light */
p_ptr->cur_lite = 0;
}
/* 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;
}
if (!o_ptr->k_idx) continue;
/* Extract the flags */
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
/* does this item glow? */
- if (f3 & TR3_LITE)
+ 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++;
}
- /* max radius is 5 without rewriting other code -- */
+ /* max radius is 14 (was 5) without rewriting other code -- */
/* see cave.c:update_lite() and defines.h:LITE_MAX */
if (d_info[dungeon_type].flags1 & DF1_DARKNESS && p_ptr->cur_lite > 1)
p_ptr->cur_lite = 1;
- if (p_ptr->cur_lite > 5) p_ptr->cur_lite = 5;
- if (p_ptr->cur_lite < 0) p_ptr->cur_lite = 0;
- /* check if the player doesn't have a lite source, */
- /* but does glow as an intrinsic. */
- if (p_ptr->cur_lite == 0 && p_ptr->lite) p_ptr->cur_lite = 1;
+ /*
+ * check if the player doesn't have light radius,
+ * but does weakly glow as an intrinsic.
+ */
+ if (p_ptr->cur_lite <= 0 && p_ptr->lite) p_ptr->cur_lite++;
- /* end experimental mods */
+ if (p_ptr->cur_lite > 14) p_ptr->cur_lite = 14;
+ if (p_ptr->cur_lite < 0) p_ptr->cur_lite = 0;
- /* 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;
- }
+ /* end experimental mods */
/* Notice changes in the "lite radius" */
if (p_ptr->old_lite != p_ptr->cur_lite)
{
- /* Update the lite */
- p_ptr->update |= (PU_LITE);
-
- /* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ /* Update stuff */
+ /* Hack -- PU_MON_LITE for monsters' darkness */
+ 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
void calc_bonuses(void)
{
int i, j, hold, neutral[2];
- int old_speed;
- int old_telepathy;
- int old_see_inv;
- int old_dis_ac;
- int old_dis_to_a;
+ int new_speed;
+ int default_hand = 0;
+ int empty_hands_status = empty_hands(TRUE);
int extra_blows[2];
int extra_shots;
object_type *o_ptr;
- u32b f1, f2, f3;
+ u32b flgs[TR_FLAG_SIZE];
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_levitation = 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_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_h_m = 0;
p_ptr->to_d_m = 0;
+ 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->tval_ammo = 0;
/* Clear all the flags */
- p_ptr->aggravate = FALSE;
- p_ptr->teleport = FALSE;
- p_ptr->exp_drain = FALSE;
+ p_ptr->cursed = 0L;
p_ptr->bless_blade = FALSE;
p_ptr->xtra_might = FALSE;
p_ptr->impact[0] = FALSE;
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->esp_undead = FALSE;
+ p_ptr->esp_demon = FALSE;
+ p_ptr->esp_orc = FALSE;
+ p_ptr->esp_troll = FALSE;
+ p_ptr->esp_giant = FALSE;
+ p_ptr->esp_dragon = FALSE;
+ p_ptr->esp_human = FALSE;
+ p_ptr->esp_evil = FALSE;
+ p_ptr->esp_good = FALSE;
+ p_ptr->esp_nonliving = FALSE;
+ p_ptr->esp_unique = FALSE;
p_ptr->lite = FALSE;
p_ptr->sustain_str = FALSE;
p_ptr->sustain_int = FALSE;
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) || !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);
}
/* 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)
+ else if ((!inventory[INVEN_RARM].k_idx || p_ptr->migite) &&
+ (!inventory[INVEN_LARM].k_idx || 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 */
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;
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;
+ 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->resist_acid = TRUE;
- p_ptr->resist_fire=TRUE;
- p_ptr->resist_cold = TRUE;
- p_ptr->resist_elec = TRUE;
- p_ptr->resist_pois = TRUE;
- p_ptr->resist_conf = TRUE;
- p_ptr->resist_disen = TRUE;
- p_ptr->resist_nexus = TRUE;
- p_ptr->resist_fear = TRUE;
- p_ptr->sh_fire = TRUE;
- p_ptr->see_inv = 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_cold = TRUE;
+ p_ptr->resist_elec = TRUE;
+ p_ptr->resist_pois = TRUE;
+ p_ptr->resist_conf = TRUE;
+ p_ptr->resist_disen = TRUE;
+ p_ptr->resist_nexus = TRUE;
+ p_ptr->resist_fear = 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;
- 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;
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 */
- p_ptr->pspeed += (p_ptr->lev) / 10;
+ new_speed += (p_ptr->lev) / 10;
break;
case RACE_BEASTMAN:
p_ptr->resist_conf = TRUE;
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;
p_ptr->to_a += 100;
p_ptr->dis_to_a += 100;
}
+ /* Temporary shield */
+ else if (p_ptr->tsubureru || p_ptr->shield || p_ptr->magicdef)
+ {
+ p_ptr->to_a += 50;
+ p_ptr->dis_to_a += 50;
+ }
+
if (p_ptr->tim_res_nether)
{
p_ptr->resist_neth = TRUE;
}
/* Sexy Gal */
- if (p_ptr->pseikaku == SEIKAKU_SEXY) p_ptr->aggravate = TRUE;
+ if (p_ptr->pseikaku == SEIKAKU_SEXY) p_ptr->cursed |= (TRC_AGGRAVATE);
+ if (p_ptr->pseikaku == SEIKAKU_NAMAKE) p_ptr->to_m_chance += 10;
+ if (p_ptr->pseikaku == SEIKAKU_KIREMONO) p_ptr->to_m_chance -= 3;
+ if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) p_ptr->to_m_chance++;
/* Lucky man */
if (p_ptr->pseikaku == SEIKAKU_LUCKY) p_ptr->muta3 |= MUT3_GOOD_LUCK;
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 (p_ptr->muta3 & MUT3_WINGS)
{
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
if (p_ptr->muta3 & MUT3_FEARLESS)
/* Skip non-objects */
if (!o_ptr->k_idx) continue;
- if (o_ptr->tval == TV_CAPTURE) continue;
/* Extract the item flags */
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
+
+ p_ptr->cursed |= (o_ptr->curse_flags & (0xFFFFFFF0L));
+ if (o_ptr->name1 == ART_CHAINSWORD) p_ptr->cursed |= TRC_CHAINSWORD;
/* Affect stats */
- if (f1 & (TR1_STR)) p_ptr->stat_add[A_STR] += o_ptr->pval;
- if (f1 & (TR1_INT)) p_ptr->stat_add[A_INT] += o_ptr->pval;
- if (f1 & (TR1_WIS)) p_ptr->stat_add[A_WIS] += o_ptr->pval;
- if (f1 & (TR1_DEX)) p_ptr->stat_add[A_DEX] += o_ptr->pval;
- if (f1 & (TR1_CON)) p_ptr->stat_add[A_CON] += o_ptr->pval;
- if (f1 & (TR1_CHR)) p_ptr->stat_add[A_CHR] += o_ptr->pval;
+ if (have_flag(flgs, TR_STR)) p_ptr->stat_add[A_STR] += o_ptr->pval;
+ if (have_flag(flgs, TR_INT)) p_ptr->stat_add[A_INT] += o_ptr->pval;
+ if (have_flag(flgs, TR_WIS)) p_ptr->stat_add[A_WIS] += o_ptr->pval;
+ if (have_flag(flgs, TR_DEX)) p_ptr->stat_add[A_DEX] += o_ptr->pval;
+ if (have_flag(flgs, TR_CON)) p_ptr->stat_add[A_CON] += o_ptr->pval;
+ if (have_flag(flgs, TR_CHR)) p_ptr->stat_add[A_CHR] += o_ptr->pval;
- if (f1 & (TR1_MAGIC_MASTERY)) p_ptr->skill_dev += 8*o_ptr->pval;
+ if (have_flag(flgs, TR_MAGIC_MASTERY)) p_ptr->skill_dev += 8*o_ptr->pval;
/* Affect stealth */
- if (f1 & (TR1_STEALTH)) p_ptr->skill_stl += o_ptr->pval;
+ if (have_flag(flgs, TR_STEALTH)) p_ptr->skill_stl += o_ptr->pval;
/* Affect searching ability (factor of five) */
- if (f1 & (TR1_SEARCH)) p_ptr->skill_srh += (o_ptr->pval * 5);
+ if (have_flag(flgs, TR_SEARCH)) p_ptr->skill_srh += (o_ptr->pval * 5);
/* Affect searching frequency (factor of five) */
- if (f1 & (TR1_SEARCH)) p_ptr->skill_fos += (o_ptr->pval * 5);
+ if (have_flag(flgs, TR_SEARCH)) p_ptr->skill_fos += (o_ptr->pval * 5);
/* Affect infravision */
- if (f1 & (TR1_INFRA)) p_ptr->see_infra += o_ptr->pval;
+ if (have_flag(flgs, TR_INFRA)) p_ptr->see_infra += o_ptr->pval;
/* Affect digging (factor of 20) */
- if (f1 & (TR1_TUNNEL)) p_ptr->skill_dig += (o_ptr->pval * 20);
+ if (have_flag(flgs, TR_TUNNEL)) p_ptr->skill_dig += (o_ptr->pval * 20);
/* Affect speed */
- if (f1 & (TR1_SPEED)) p_ptr->pspeed += o_ptr->pval;
+ if (have_flag(flgs, TR_SPEED)) new_speed += o_ptr->pval;
/* Affect blows */
- if (f1 & (TR1_BLOWS))
+ if (have_flag(flgs, TR_BLOWS))
{
if((i == INVEN_RARM || i == INVEN_RIGHT) && !p_ptr->ryoute) extra_blows[0] += o_ptr->pval;
else if((i == INVEN_LARM || i == INVEN_LEFT) && !p_ptr->ryoute) extra_blows[1] += o_ptr->pval;
}
/* Hack -- cause earthquakes */
- if (f1 & (TR1_IMPACT)) p_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
+ if (have_flag(flgs, TR_IMPACT)) p_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
/* Boost shots */
- if (f3 & (TR3_XTRA_SHOTS)) extra_shots++;
+ if (have_flag(flgs, TR_XTRA_SHOTS)) extra_shots++;
/* Various flags */
- if (f3 & (TR3_DEC_MANA)) p_ptr->dec_mana = TRUE;
- if (f3 & (TR3_AGGRAVATE)) p_ptr->aggravate = TRUE;
- if (f3 & (TR3_TELEPORT)) p_ptr->teleport = TRUE;
- if (f3 & (TR3_DRAIN_EXP)) p_ptr->exp_drain = TRUE;
- if (f3 & (TR3_BLESSED)) p_ptr->bless_blade = TRUE;
- if (f3 & (TR3_XTRA_MIGHT)) p_ptr->xtra_might = TRUE;
- if (f3 & (TR3_SLOW_DIGEST)) p_ptr->slow_digest = TRUE;
- if (f3 & (TR3_REGEN)) p_ptr->regenerate = TRUE;
- if (f3 & (TR3_TELEPATHY)) p_ptr->telepathy = TRUE;
- if (f3 & (TR3_SEE_INVIS)) p_ptr->see_inv = TRUE;
- if (f3 & (TR3_FEATHER)) p_ptr->ffall = TRUE;
- if (f2 & (TR2_FREE_ACT)) p_ptr->free_act = TRUE;
- if (f2 & (TR2_HOLD_LIFE)) p_ptr->hold_life = TRUE;
- if (f3 & (TR3_WARNING)) p_ptr->warning = TRUE;
+ 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_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;
+ if (have_flag(flgs, TR_SLOW_DIGEST)) p_ptr->slow_digest = TRUE;
+ if (have_flag(flgs, TR_REGEN)) p_ptr->regenerate = TRUE;
+ if (have_flag(flgs, TR_TELEPATHY)) p_ptr->telepathy = TRUE;
+ if (have_flag(flgs, TR_ESP_ANIMAL)) p_ptr->esp_animal = TRUE;
+ if (have_flag(flgs, TR_ESP_UNDEAD)) p_ptr->esp_undead = TRUE;
+ if (have_flag(flgs, TR_ESP_DEMON)) p_ptr->esp_demon = TRUE;
+ if (have_flag(flgs, TR_ESP_ORC)) p_ptr->esp_orc = TRUE;
+ if (have_flag(flgs, TR_ESP_TROLL)) p_ptr->esp_troll = TRUE;
+ if (have_flag(flgs, TR_ESP_GIANT)) p_ptr->esp_giant = TRUE;
+ if (have_flag(flgs, TR_ESP_DRAGON)) p_ptr->esp_dragon = TRUE;
+ if (have_flag(flgs, TR_ESP_HUMAN)) p_ptr->esp_human = TRUE;
+ if (have_flag(flgs, TR_ESP_EVIL)) p_ptr->esp_evil = TRUE;
+ if (have_flag(flgs, TR_ESP_GOOD)) p_ptr->esp_good = TRUE;
+ if (have_flag(flgs, TR_ESP_NONLIVING)) p_ptr->esp_nonliving = TRUE;
+ 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_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 || !(my_strchr(quark_str(o_ptr->inscription),'$')))
+ p_ptr->warning = TRUE;
+ }
+
+ if (have_flag(flgs, TR_TELEPORT))
+ {
+ if (object_is_cursed(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
+ else
+ {
+ cptr insc = quark_str(o_ptr->inscription);
+
+ if (o_ptr->inscription && my_strchr(insc, '.'))
+ {
+ /*
+ * {.} will stop random teleportation.
+ */
+ }
+ else
+ {
+ /* Controlled random teleportation */
+ p_ptr->cursed |= TRC_TELEPORT_SELF;
+ }
+ }
+ }
/* Immunity flags */
- if (f2 & (TR2_IM_FIRE)) p_ptr->immune_fire = TRUE;
- if (f2 & (TR2_IM_ACID)) p_ptr->immune_acid = TRUE;
- if (f2 & (TR2_IM_COLD)) p_ptr->immune_cold = TRUE;
- if (f2 & (TR2_IM_ELEC)) p_ptr->immune_elec = TRUE;
+ if (have_flag(flgs, TR_IM_FIRE)) p_ptr->immune_fire = TRUE;
+ if (have_flag(flgs, TR_IM_ACID)) p_ptr->immune_acid = TRUE;
+ if (have_flag(flgs, TR_IM_COLD)) p_ptr->immune_cold = TRUE;
+ if (have_flag(flgs, TR_IM_ELEC)) p_ptr->immune_elec = TRUE;
/* Resistance flags */
- if (f2 & (TR2_RES_ACID)) p_ptr->resist_acid = TRUE;
- if (f2 & (TR2_RES_ELEC)) p_ptr->resist_elec = TRUE;
- if (f2 & (TR2_RES_FIRE)) p_ptr->resist_fire = TRUE;
- if (f2 & (TR2_RES_COLD)) p_ptr->resist_cold = TRUE;
- if (f2 & (TR2_RES_POIS)) p_ptr->resist_pois = TRUE;
- if (f2 & (TR2_RES_FEAR)) p_ptr->resist_fear = TRUE;
- if (f2 & (TR2_RES_CONF)) p_ptr->resist_conf = TRUE;
- if (f2 & (TR2_RES_SOUND)) p_ptr->resist_sound = TRUE;
- if (f2 & (TR2_RES_LITE)) p_ptr->resist_lite = TRUE;
- if (f2 & (TR2_RES_DARK)) p_ptr->resist_dark = TRUE;
- if (f2 & (TR2_RES_CHAOS)) p_ptr->resist_chaos = TRUE;
- if (f2 & (TR2_RES_DISEN)) p_ptr->resist_disen = TRUE;
- if (f2 & (TR2_RES_SHARDS)) p_ptr->resist_shard = TRUE;
- if (f2 & (TR2_RES_NEXUS)) p_ptr->resist_nexus = TRUE;
- if (f2 & (TR2_RES_BLIND)) p_ptr->resist_blind = TRUE;
- if (f2 & (TR2_RES_NETHER)) p_ptr->resist_neth = TRUE;
-
- if (f2 & (TR2_REFLECT)) p_ptr->reflect = TRUE;
- if (f3 & (TR3_SH_FIRE)) p_ptr->sh_fire = TRUE;
- if (f3 & (TR3_SH_ELEC)) p_ptr->sh_elec = TRUE;
- if (f3 & (TR3_SH_COLD)) p_ptr->sh_cold = TRUE;
- if (f3 & (TR3_NO_MAGIC)) p_ptr->anti_magic = TRUE;
- if (f3 & (TR3_NO_TELE)) p_ptr->anti_tele = TRUE;
+ if (have_flag(flgs, TR_RES_ACID)) p_ptr->resist_acid = TRUE;
+ if (have_flag(flgs, TR_RES_ELEC)) p_ptr->resist_elec = TRUE;
+ if (have_flag(flgs, TR_RES_FIRE)) p_ptr->resist_fire = TRUE;
+ if (have_flag(flgs, TR_RES_COLD)) p_ptr->resist_cold = TRUE;
+ if (have_flag(flgs, TR_RES_POIS)) p_ptr->resist_pois = TRUE;
+ if (have_flag(flgs, TR_RES_FEAR)) p_ptr->resist_fear = TRUE;
+ if (have_flag(flgs, TR_RES_CONF)) p_ptr->resist_conf = TRUE;
+ if (have_flag(flgs, TR_RES_SOUND)) p_ptr->resist_sound = TRUE;
+ if (have_flag(flgs, TR_RES_LITE)) p_ptr->resist_lite = TRUE;
+ if (have_flag(flgs, TR_RES_DARK)) p_ptr->resist_dark = TRUE;
+ if (have_flag(flgs, TR_RES_CHAOS)) p_ptr->resist_chaos = TRUE;
+ if (have_flag(flgs, TR_RES_DISEN)) p_ptr->resist_disen = TRUE;
+ if (have_flag(flgs, TR_RES_SHARDS)) p_ptr->resist_shard = TRUE;
+ if (have_flag(flgs, TR_RES_NEXUS)) p_ptr->resist_nexus = TRUE;
+ if (have_flag(flgs, TR_RES_BLIND)) p_ptr->resist_blind = TRUE;
+ if (have_flag(flgs, TR_RES_NETHER)) p_ptr->resist_neth = TRUE;
+
+ if (have_flag(flgs, TR_REFLECT)) p_ptr->reflect = TRUE;
+ if (have_flag(flgs, TR_SH_FIRE)) p_ptr->sh_fire = TRUE;
+ if (have_flag(flgs, TR_SH_ELEC)) p_ptr->sh_elec = TRUE;
+ if (have_flag(flgs, TR_SH_COLD)) p_ptr->sh_cold = TRUE;
+ if (have_flag(flgs, TR_NO_MAGIC)) p_ptr->anti_magic = TRUE;
+ if (have_flag(flgs, TR_NO_TELE)) p_ptr->anti_tele = TRUE;
/* Sustain flags */
- if (f2 & (TR2_SUST_STR)) p_ptr->sustain_str = TRUE;
- if (f2 & (TR2_SUST_INT)) p_ptr->sustain_int = TRUE;
- if (f2 & (TR2_SUST_WIS)) p_ptr->sustain_wis = TRUE;
- if (f2 & (TR2_SUST_DEX)) p_ptr->sustain_dex = TRUE;
- if (f2 & (TR2_SUST_CON)) p_ptr->sustain_con = TRUE;
- if (f2 & (TR2_SUST_CHR)) p_ptr->sustain_chr = TRUE;
+ if (have_flag(flgs, TR_SUST_STR)) p_ptr->sustain_str = TRUE;
+ if (have_flag(flgs, TR_SUST_INT)) p_ptr->sustain_int = TRUE;
+ if (have_flag(flgs, TR_SUST_WIS)) p_ptr->sustain_wis = TRUE;
+ if (have_flag(flgs, TR_SUST_DEX)) p_ptr->sustain_dex = TRUE;
+ if (have_flag(flgs, TR_SUST_CON)) p_ptr->sustain_con = TRUE;
+ if (have_flag(flgs, TR_SUST_CHR)) p_ptr->sustain_chr = TRUE;
if (o_ptr->name2 == EGO_YOIYAMI) yoiyami = TRUE;
if (o_ptr->name2 == EGO_2WEAPON) easy_2weapon = TRUE;
if (o_ptr->name2 == EGO_RING_RES_TIME) p_ptr->resist_time = TRUE;
if (o_ptr->name2 == EGO_RING_THROW) p_ptr->mighty_throw = TRUE;
- if (o_ptr->name2 == EGO_RING_WIZARD) p_ptr->easy_spell = TRUE;
+ if (have_flag(flgs, TR_EASY_SPELL)) p_ptr->easy_spell = TRUE;
if (o_ptr->name2 == EGO_AMU_FOOL) p_ptr->heavy_spell = TRUE;
if (o_ptr->name2 == EGO_AMU_NAIVETY) down_saving = TRUE;
+ if (o_ptr->curse_flags & TRC_LOW_MAGIC)
+ {
+ if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
+ {
+ p_ptr->to_m_chance += 10;
+ }
+ else
+ {
+ p_ptr->to_m_chance += 3;
+ }
+ }
+
+ if (o_ptr->tval == TV_CAPTURE) continue;
+
/* Modify the base armor class */
p_ptr->ac += o_ptr->ac;
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)
+ {
+ int slot = i - INVEN_RARM;
+ if (slot < 2)
+ {
+ if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
+ {
+ p_ptr->to_h[slot] -= 15;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h[slot] -= 15;
+ }
+ else
+ {
+ p_ptr->to_h[slot] -= 5;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h[slot] -= 5;
+ }
+ }
+ else
+ {
+ if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
+ {
+ p_ptr->to_h_b -= 15;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h_b -= 15;
+ }
+ else
+ {
+ p_ptr->to_h_b -= 5;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h_b -= 5;
+ }
+ }
+ }
+
+ if (o_ptr->curse_flags & TRC_LOW_AC)
+ {
+ if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
+ {
+ p_ptr->to_a -= 30;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_a -= 30;
+ }
+ else
+ {
+ p_ptr->to_a -= 10;
+ if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_a -= 10;
+ }
+ }
/* Hack -- do not apply "weapon" bonuses */
if (i == INVEN_RARM && buki_motteruka(i)) continue;
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_ */
if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && !heavy_armor())
{
{
for (i = 0; i < 6; i++)
p_ptr->stat_add[i] += 5;
- p_ptr->ac -= 50;
+ p_ptr->to_a -= 50;
+ p_ptr->dis_to_a -= 50;
}
/* Hack -- aura of fire also provides light */
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);
}
+ /* 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 */
- if (p_ptr->blessed || music_singing(MUSIC_BLESS))
+ if (IS_BLESSED())
{
p_ptr->to_a += 5;
p_ptr->dis_to_a += 5;
p_ptr->dis_to_h_b += 10;
}
- /* Temporary shield */
- if (p_ptr->tsubureru || p_ptr->shield || p_ptr->magicdef)
- {
- p_ptr->to_a += 50;
- p_ptr->dis_to_a += 50;
- }
if (p_ptr->magicdef)
{
p_ptr->resist_blind = TRUE;
p_ptr->resist_conf = TRUE;
p_ptr->reflect = TRUE;
p_ptr->free_act = TRUE;
- p_ptr->ffall = TRUE;
+ p_ptr->levitation = TRUE;
}
/* 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;
}
}
/* Temporary levitation */
- if (p_ptr->tim_ffall)
+ if (p_ptr->tim_levitation)
+ {
+ p_ptr->levitation = TRUE;
+ }
+
+ /* Temporary reflection */
+ if (p_ptr->tim_reflect)
{
- p_ptr->ffall = TRUE;
+ 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;
}
p_ptr->update |= (PU_MONSTERS);
}
+ if ((p_ptr->esp_animal != old_esp_animal) ||
+ (p_ptr->esp_undead != old_esp_undead) ||
+ (p_ptr->esp_demon != old_esp_demon) ||
+ (p_ptr->esp_orc != old_esp_orc) ||
+ (p_ptr->esp_troll != old_esp_troll) ||
+ (p_ptr->esp_giant != old_esp_giant) ||
+ (p_ptr->esp_dragon != old_esp_dragon) ||
+ (p_ptr->esp_human != old_esp_human) ||
+ (p_ptr->esp_evil != old_esp_evil) ||
+ (p_ptr->esp_good != old_esp_good) ||
+ (p_ptr->esp_nonliving != old_esp_nonliving) ||
+ (p_ptr->esp_unique != old_esp_unique))
+ {
+ p_ptr->update |= (PU_MONSTERS);
+ }
+
/* Hack -- See Invis Change */
if (p_ptr->see_inv != old_see_inv)
{
}
/* 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))
+ if ((p_ptr->migite && (empty_hands_status & EMPTY_HAND_RARM)) ||
+ (p_ptr->hidarite && (empty_hands_status & EMPTY_HAND_LARM)))
{
- p_ptr->to_h[0] += (skill_exp[GINOU_SUDE]-4000)/200;
- p_ptr->dis_to_h[0] += (skill_exp[GINOU_SUDE]-4000)/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))
{
int penalty1, penalty2;
- penalty1 = ((100-skill_exp[GINOU_NITOURYU]/160) - (130-inventory[INVEN_RARM].weight)/8);
- penalty2 = ((100-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;
}
{
penalty1 = MIN(0, penalty1);
penalty2 = MIN(0, penalty2);
+ p_ptr->to_a += 10;
+ p_ptr->dis_to_a += 10;
+ }
+ else
+ {
+ if ((inventory[INVEN_RARM].name1 == ART_MUSASI_KATANA) && (penalty1 > 0))
+ penalty1 /= 2;
+ if ((inventory[INVEN_LARM].name1 == ART_MUSASI_WAKIZASI) && (penalty2 > 0))
+ penalty2 /= 2;
}
if (inventory[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10;
if (inventory[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10;
/* 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)
+ {
+ /* Extract the "weight limit" (in tenth pounds) */
+ i = (int)weight_limit();
+ }
+ else
{
- 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)*(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 (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 (skill_exp[GINOU_RIDING] < 2000) j += (p_ptr->wt*3*(2000 - 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;
+ /* Extract the "weight limit" */
+ i = 1500 + riding_r_ptr->level * 25;
}
/* XXX XXX XXX Apply "encumbrance" from weight */
- if (j > i/2) p_ptr->pspeed -= ((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) 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);
if (p_ptr->pclass == CLASS_ARCHER)
{
if (p_ptr->tval_ammo == TV_ARROW)
- p_ptr->num_fire += (p_ptr->lev * 6);
+ 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);
}
{
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));
+ }
}
}
/* Examine the "main weapon" */
o_ptr = &inventory[INVEN_RARM+i];
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
/* Assume not heavy */
p_ptr->heavy_wield[i] = FALSE;
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) && (f2 & TR2_RIDING)) {num = 5; wgt = 70; mul = 4;}
+ if ((p_ptr->riding) && (have_flag(flgs, TR_RIDING))) {num = 5; wgt = 70; mul = 4;}
else {num = 5; wgt = 100; mul = 3;}
break;
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);
/* Assume okay */
/* Priest weapon penalty for non-blessed edged weapons */
- if ((p_ptr->pclass == CLASS_PRIEST) && (!(f3 & (TR3_BLESSED))) &&
+ if ((p_ptr->pclass == CLASS_PRIEST) && (!(have_flag(flgs, TR_BLESSED))) &&
((o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM)))
{
/* Reduce the real bonuses */
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)))
{
p_ptr->to_h[i] +=15;
p_ptr->dis_to_h[i] +=15;
+ p_ptr->to_dd[i] += 2;
}
- else if (!(f2 & TR2_RIDING))
+ else if (!(have_flag(flgs, TR_RIDING)))
{
int penalty;
if ((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY))
}
else
{
- penalty = r_info[m_list[p_ptr->riding].r_idx].level - skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
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))
{
}
else
{
- penalty = r_info[m_list[p_ptr->riding].r_idx].level - skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
}
/* 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;
if (blow_base > 31) p_ptr->num_blow[0]++;
if (blow_base > 44) p_ptr->num_blow[0]++;
if (blow_base > 58) p_ptr->num_blow[0]++;
+ if (p_ptr->magic_num1[0])
+ {
+ p_ptr->to_d[0] += (p_ptr->magic_num1[0]/5);
+ p_ptr->dis_to_d[0] += (p_ptr->magic_num1[0]/5);
+ }
}
else
{
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))
+ 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] += (weapon_exp[tval][sval]-4000)/200;
- p_ptr->dis_to_h[i] += (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)
{
if (p_ptr->ryoute && !omoi)
{
int bonus_to_h=0, bonus_to_d=0;
- bonus_to_d = ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
+ 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->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]];
p_ptr->skill_tht += ((cp_ptr->x_thb * p_ptr->lev / 10) + (ap_ptr->a_thb * p_ptr->lev / 50));
- if ((prace_is_(RACE_S_FAIRY)) && (p_ptr->pseikaku != SEIKAKU_SEXY) && p_ptr->aggravate)
+ if ((prace_is_(RACE_S_FAIRY)) && (p_ptr->pseikaku != SEIKAKU_SEXY) && (p_ptr->cursed & TRC_AGGRAVATE))
{
- p_ptr->aggravate = FALSE;
+ p_ptr->cursed &= ~(TRC_AGGRAVATE);
p_ptr->skill_stl = MIN(p_ptr->skill_stl - 3, (p_ptr->skill_stl + 2) / 2);
}
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])
#ifdef JP
msg_print("¤³¤ÎÉð´ï¤Ï¾èÇÏÃæ¤Ë»È¤¦¤Ë¤Ï¤à¤«¤Ê¤¤¤è¤¦¤À¡£");
#else
- msg_print("This weapon is not suitable for riding.");
+ msg_print("This weapon is not suitable for use while riding.");
#endif
}
#ifdef JP
msg_print("¤³¤ÎÉð´ï¤ÏÅÌÊâ¤Ç»È¤¤¤ä¤¹¤¤¡£");
#else
- msg_print("This weapon was not suitable for riding.");
+ msg_print("This weapon was not suitable for use while riding.");
#endif
}
#ifdef JP
msg_print("¤³¤ì¤Ê¤é¾èÇÏÃæ¤Ë¤Ô¤Ã¤¿¤ê¤À¡£");
#else
- msg_print("This weapon is suitable for riding.");
+ msg_print("This weapon is suitable for use while riding.");
#endif
}
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];
- }
- while (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;
- }
- j--;
- }
- 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;
-
- have_dd_s = FALSE;
- have_dd_t = FALSE;
- have_sw = FALSE;
- have_kabe = FALSE;
for (i = 0; i < INVEN_PACK; i++)
{
- if ((inventory[i].tval == TV_SORCERY_BOOK) && (inventory[i].sval == 3)) have_dd_s = TRUE;
+#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;
+ 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)
{
/* 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 ((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) return;
+ /* Actually do auto-destroy */
+ if (p_ptr->notice & (PN_AUTODESTROY))
+ {
+ p_ptr->notice &= ~(PN_AUTODESTROY);
+ autopick_delayed_alter();
+ }
+
/* Combine the pack */
if (p_ptr->notice & (PN_COMBINE))
{
update_flow();
}
+ if (p_ptr->update & (PU_DISTANCE))
+ {
+ p_ptr->update &= ~(PU_DISTANCE);
+
+ /* Still need to call update_monsters(FALSE) after update_mon_lite() */
+ /* p_ptr->update &= ~(PU_MONSTERS); */
+
+ update_monsters(TRUE);
+ }
+
if (p_ptr->update & (PU_MON_LITE))
{
p_ptr->update &= ~(PU_MON_LITE);
update_mon_lite();
}
- if (p_ptr->update & (PU_DISTANCE))
+ /*
+ * 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_DISTANCE);
- p_ptr->update &= ~(PU_MONSTERS);
- update_monsters(TRUE);
+ p_ptr->update &= ~(PU_DELAY_VIS);
+ delayed_visual_update();
}
if (p_ptr->update & (PU_MONSTERS))
prt_dungeon();
}
- if (p_ptr->redraw & (PR_DUNGEON))
- {
- p_ptr->redraw &= ~(PR_DUNGEON);
- }
-
if (p_ptr->redraw & (PR_EQUIPPY))
{
p_ptr->redraw &= ~(PR_EQUIPPY);
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 (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);
+ }
- if (!(inventory[INVEN_RARM].k_idx)) kaerichi +=2;
- if (!(inventory[INVEN_LARM].k_idx)) kaerichi +=1;
- return kaerichi;
+ 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);
-}