*/
void extract_day_hour_min(int *day, int *hour, int *min)
{
- s32b len = TURNS_PER_TICK * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
+ const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
+ s32b turn_in_today = (turn + A_DAY / 4) % A_DAY;
switch (p_ptr->start_race)
{
case RACE_SKELETON:
case RACE_ZOMBIE:
case RACE_SPECTRE:
- *day = (turn - (TURNS_PER_TICK * TOWN_DAWN * 3 / 4)) / len + 1;
+ *day = (turn - A_DAY * 3 / 4) / A_DAY + 1;
break;
default:
- *day = (turn + (TURNS_PER_TICK * TOWN_DAWN / 4)) / len + 1;
+ *day = (turn + A_DAY / 4) / A_DAY + 1;
break;
}
- *hour = (24 * tick / len) % 24;
- *min = (1440 * tick / len) % 60;
+ *hour = (24 * turn_in_today / A_DAY) % 24;
+ *min = (1440 * turn_in_today / A_DAY) % 60;
}
/*
put_str("HP", ROW_CURHP, COL_CURHP);
/* ¸½ºß¤Î¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", p_ptr->chp);
+ sprintf(tmp, "%4ld", p_ptr->chp);
if (p_ptr->chp >= p_ptr->mhp)
{
put_str( "/", ROW_CURHP, COL_CURHP + 7 );
/* ºÇÂç¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", p_ptr->mhp);
+ sprintf(tmp, "%4ld", p_ptr->mhp);
color = TERM_L_GREEN;
c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 8 );
#endif
/* ¸½ºß¤Î¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", p_ptr->csp);
+ sprintf(tmp, "%4ld", p_ptr->csp);
if (p_ptr->csp >= p_ptr->msp)
{
put_str( "/", ROW_CURSP, COL_CURSP + 7 );
/* ºÇÂç¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
- sprintf(tmp, "%4d", p_ptr->msp);
+ sprintf(tmp, "%4ld", p_ptr->msp);
color = TERM_L_GREEN;
c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 8);