if (!feel) return;
/* Bad luck */
- if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !rand_int(13))
+ if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13))
{
switch (feel)
{
}
case FEEL_CURSED:
{
- feel = rand_int(3) ? FEEL_GOOD : FEEL_AVERAGE;
+ feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
break;
}
case FEEL_AVERAGE:
{
- feel = rand_int(2) ? FEEL_CURSED : FEEL_GOOD;
+ feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
break;
}
case FEEL_GOOD:
{
- feel = rand_int(3) ? FEEL_CURSED : FEEL_AVERAGE;
+ feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
break;
}
case FEEL_EXCELLENT:
case CLASS_CAVALRY:
{
/* Good sensing */
- if (0 != rand_int(9000L / (plev * plev + 40))) return;
+ if (0 != randint0(9000L / (plev * plev + 40))) return;
/* Heavy sensing */
heavy = TRUE;
case CLASS_SMITH:
{
/* Good sensing */
- if (0 != rand_int(6000L / (plev * plev + 50))) return;
+ if (0 != randint0(6000L / (plev * plev + 50))) return;
/* Heavy sensing */
heavy = TRUE;
case CLASS_MAGIC_EATER:
{
/* Very bad (light) sensing */
- if (0 != rand_int(240000L / (plev + 5))) return;
+ if (0 != randint0(240000L / (plev + 5))) return;
/* Done */
break;
case CLASS_BARD:
{
/* Good (light) sensing */
- if (0 != rand_int(10000L / (plev * plev + 40))) return;
+ if (0 != randint0(10000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_NINJA:
{
/* Okay sensing */
- if (0 != rand_int(20000L / (plev * plev + 40))) return;
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
/* Heavy sensing */
heavy = TRUE;
case CLASS_RANGER:
{
/* Bad sensing */
- if (0 != rand_int(95000L / (plev * plev + 40))) return;
+ if (0 != randint0(95000L / (plev * plev + 40))) return;
/* Changed! */
heavy = TRUE;
case CLASS_PALADIN:
{
/* Bad sensing */
- if (0 != rand_int(77777L / (plev * plev + 40))) return;
+ if (0 != randint0(77777L / (plev * plev + 40))) return;
/* Heavy sensing */
heavy = TRUE;
case CLASS_RED_MAGE:
{
/* Bad sensing */
- if (0 != rand_int(75000L / (plev * plev + 40))) return;
+ if (0 != randint0(75000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_MIRROR_MASTER:
{
/* Bad sensing */
- if (0 != rand_int(55000L / (plev * plev + 40))) return;
+ if (0 != randint0(55000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_CHAOS_WARRIOR:
{
/* Bad sensing */
- if (0 != rand_int(80000L / (plev * plev + 40))) return;
+ if (0 != randint0(80000L / (plev * plev + 40))) return;
/* Changed! */
heavy = TRUE;
case CLASS_FORCETRAINER:
{
/* Okay sensing */
- if (0 != rand_int(20000L / (plev * plev + 40))) return;
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_TOURIST:
{
/* Good sensing */
- if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
+ if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
/* Heavy sensing */
heavy = TRUE;
case CLASS_BLUE_MAGE:
{
/* Bad sensing */
- if (0 != rand_int(55000L / (plev * plev + 40))) return;
+ if (0 != randint0(55000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_BEASTMASTER:
{
/* Bad sensing */
- if (0 != rand_int(65000L / (plev * plev + 40))) return;
+ if (0 != randint0(65000L / (plev * plev + 40))) return;
/* Done */
break;
if (!okay) continue;
/* Occasional failure on inventory items */
- if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
+ if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
/* Good luck */
- if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !rand_int(13))
+ if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
{
heavy = TRUE;
}
case CLASS_NINJA:
{
/* Very bad (light) sensing */
- if (0 != rand_int(240000L / (plev + 5))) return;
+ if (0 != randint0(240000L / (plev + 5))) return;
/* Done */
break;
case CLASS_MONK:
{
/* Bad sensing */
- if (0 != rand_int(95000L / (plev * plev + 40))) return;
+ if (0 != randint0(95000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_MINDCRAFTER:
{
/* Good sensing */
- if (0 != rand_int(20000L / (plev * plev + 40))) return;
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_BLUE_MAGE:
{
/* Good sensing */
- if (0 != rand_int(9000L / (plev * plev + 40))) return;
+ if (0 != randint0(9000L / (plev * plev + 40))) return;
/* Done */
break;
case CLASS_TOURIST:
{
/* Good sensing */
- if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
+ if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
/* Done */
break;
if (!okay) continue;
/* Occasional failure on inventory items */
- if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
+ if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
sense_inventory_aux(i, TRUE);
}
#endif
- to_ruin = randint(45) + 35;
+ to_ruin = randint1(45) + 35;
while (to_ruin--)
{
return FALSE;
if ((prace_is_(RACE_AMBERITE)) &&
- (p_ptr->cut > 0) && (randint(10) == 1))
+ (p_ptr->cut > 0) && one_in_(10))
{
wreck_the_pattern();
}
}
else
{
- if ((prace_is_(RACE_AMBERITE)) && (randint(2) != 1))
+ if ((prace_is_(RACE_AMBERITE)) && !one_in_(2))
return TRUE;
else if (!p_ptr->invuln)
#ifdef JP
frac = m_ptr->maxhp / 100;
/* Hack -- Minimal regeneration rate */
- if (!frac) if (randint(2) == 1) frac = 1;
+ if (!frac) if (one_in_(2)) frac = 1;
/* Hack -- Some monsters regenerate quickly */
if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
frac = o_ptr->xtra5 / 100;
/* Hack -- Minimal regeneration rate */
- if (!frac) if (randint(2) == 1) frac = 1;
+ if (!frac) if (one_in_(2)) frac = 1;
/* Hack -- Some monsters regenerate quickly */
if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
}
+void leave_quest_check(void)
+{
+ /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
+ leaving_quest = p_ptr->inside_quest;
+
+ /* Leaving an 'only once' quest marks it as failed */
+ if (leaving_quest &&
+ ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
+ (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
+ {
+ quest[leaving_quest].status = QUEST_STATUS_FAILED;
+ quest[leaving_quest].complev = (byte)p_ptr->lev;
+ if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
+ {
+ r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
+ if (record_rand_quest)
+ do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
+ }
+ else if (record_fix_quest)
+ do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
+ }
+}
+
+
/*
* Forcibly pseudo-identify an object in the inventory
* (or on the floor)
project_hack(GF_TURN_ALL, p_ptr->lev);
break;
case MUSIC_PSI:
- project_hack(GF_PSI, randint(p_ptr->lev * 3 / 2));
+ project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
break;
case MUSIC_ID:
project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
break;
case MUSIC_DISPEL:
- dispel_monsters(randint(p_ptr->lev * 3));
- dispel_evil(randint(p_ptr->lev * 3));
+ dispel_monsters(randint1(p_ptr->lev * 3));
+ dispel_evil(randint1(p_ptr->lev * 3));
break;
case MUSIC_SARUMAN:
slow_monsters();
stasis_monsters(p_ptr->lev * 4);
break;
case MUSIC_SHERO:
- dispel_monsters(randint(p_ptr->lev * 3));
+ dispel_monsters(randint1(p_ptr->lev * 3));
break;
case MUSIC_H_LIFE:
hp_player(damroll(15,10));
/*** Process the monsters ***/
/* Check for creature generation. */
- if ((rand_int(d_info[dungeon_type].max_m_alloc_chance) == 0) &&
+ if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
!p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
{
/* Make a new monster */
if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
!p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
{
- int damage = 3000 + rand_int(2000);
+ int damage = 3000 + randint0(2000);
if (prace_is_(RACE_ENT)) damage += damage/3;
if (p_ptr->resist_fire) damage = damage / 3;
if (p_ptr->oppose_fire) damage = damage / 3;
- damage = damage / 100 + (rand_int(100) < (damage % 100));
+ damage = damage / 100 + (randint0(100) < (damage % 100));
if (damage)
{
else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
!p_ptr->invuln && !p_ptr->immune_fire)
{
- int damage = 6000 + rand_int(4000);
+ int damage = 6000 + randint0(4000);
cptr message;
cptr hit_from;
}
- damage = damage / 100 + (rand_int(100) < (damage % 100));
+ damage = damage / 100 + (randint0(100) < (damage % 100));
if (damage)
{
/* Take damage */
/* Take damage */
#ifdef JP
msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
-take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "Å®¤ì", -1);
+take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
#else
msg_print("You are drowning!");
- take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "drowning", -1);
+ take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
#endif
cave_no_regen = TRUE;
if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
{
/* Faint occasionally */
- if (!p_ptr->paralyzed && (rand_int(100) < 10))
+ if (!p_ptr->paralyzed && (randint0(100) < 10))
{
/* Message */
#ifdef JP
disturb(1, 0);
/* Hack -- faint (bypass free action) */
- (void)set_paralyzed(p_ptr->paralyzed + 1 + rand_int(5));
+ (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
}
}
}
#else
msg_print("Such much pets cannot be controled at once!");
#endif
+ msg_print(NULL);
do_cmd_pet_dismiss();
upkeep_factor = calculate_upkeep();
/*** Process mutation effects ***/
if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
{
- if ((p_ptr->muta2 & MUT2_BERS_RAGE) && (randint(3000) == 1))
+ if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
{
disturb(0, 0);
#ifdef JP
msg_print("You feel a fit of rage coming over you!");
#endif
- (void)set_shero(10 + randint(p_ptr->lev), FALSE);
+ (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
}
- if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint(3000) == 13))
+ if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
{
if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
{
msg_print("It's so dark... so scary!");
#endif
- set_afraid(p_ptr->afraid + 13 + randint(26));
+ set_afraid(p_ptr->afraid + 13 + randint1(26));
}
}
- if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint(5000) == 88))
+ if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
{
if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
!p_ptr->anti_tele)
}
}
- if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint(6400) == 321))
+ if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
{
if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
{
if (!p_ptr->resist_conf)
{
- (void)set_confused(p_ptr->confused + rand_int(20) + 15);
+ (void)set_confused(p_ptr->confused + randint0(20) + 15);
}
if (!p_ptr->resist_chaos)
msg_print("Thishcischs GooDSChtuff!");
#endif
- (void)set_image(p_ptr->image + rand_int(150) + 150);
+ (void)set_image(p_ptr->image + randint0(150) + 150);
}
}
}
}
- if ((p_ptr->muta2 & MUT2_HALLU) && (randint(6400) == 42))
+ if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
{
if (!p_ptr->resist_chaos)
{
disturb(0, 0);
p_ptr->redraw |= PR_EXTRA;
- (void)set_image(p_ptr->image + rand_int(50) + 20);
+ (void)set_image(p_ptr->image + randint0(50) + 20);
}
}
- if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint(3000) == 13))
+ if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
{
disturb(0, 0);
}
if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
- !p_ptr->anti_magic && (randint(9000) == 1))
+ !p_ptr->anti_magic && one_in_(9000))
{
int dire = 0;
disturb(0, 0);
}
if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
- !p_ptr->anti_magic && (randint(6666) == 666))
+ !p_ptr->anti_magic && (randint1(6666) == 666))
{
- bool pet = (randint(6) == 1);
+ bool pet = one_in_(6);
bool not_pet = (bool)(!pet);
if (summon_specific((pet ? -1 : 0), py, px,
}
}
- if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && (randint(6000) == 1))
+ if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
{
disturb(0, 0);
- if (randint(2) == 1)
+ if (one_in_(2))
{
#ifdef JP
msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
}
else
{
- set_slow(randint(30) + 10, FALSE);
+ set_slow(randint1(30) + 10, FALSE);
}
}
else
}
else
{
- set_fast(randint(30) + 10, FALSE);
+ set_fast(randint1(30) + 10, FALSE);
}
}
msg_print(NULL);
}
- if ((p_ptr->muta2 & MUT2_BANISH_ALL) && (randint(9000) == 1))
+ if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
{
disturb(0, 0);
#ifdef JP
msg_print("You see one of the shopkeepers running for the hills!");
#endif
- store_shuffle(rand_int(MAX_STORES));
+ store_shuffle(randint0(MAX_STORES));
}
msg_print(NULL);
}
if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
!p_ptr->anti_magic && one_in_(7000))
{
- bool pet = (randint(3) == 1);
+ bool pet = one_in_(3);
bool not_pet = (bool)(!pet);
if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
#endif
msg_print(NULL);
- set_wraith_form(randint(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
+ set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
}
if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
{
}
if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
{
- int which_stat = rand_int(6);
+ int which_stat = randint0(6);
int sustained = FALSE;
switch (which_stat)
#endif
msg_print(NULL);
- (void)dec_stat(which_stat, randint(6) + 6, randint(3) == 1);
+ (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
}
}
if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
!p_ptr->anti_magic && one_in_(3000))
{
- bool pet = (randint(5) == 1);
+ bool pet = one_in_(5);
bool not_pet = (bool)(!pet);
if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
#endif
msg_print(NULL);
- (void)set_invuln(randint(8) + 8, FALSE);
+ (void)set_invuln(randint1(8) + 8, FALSE);
}
if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
{
disturb(0, 0);
#ifdef JP
msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
-take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "žÅÝ", -1);
+take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
#else
msg_print("You trip over your own feet!");
- take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "tripping", -1);
+ take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
#endif
/* Handle experience draining */
if (p_ptr->exp_drain)
{
- if (rand_int(100) < 25)
+ if (randint0(100) < 25)
{
p_ptr->exp -= (p_ptr->lev+1)/2;
if (p_ptr->exp < 0) p_ptr->exp = 0;
}
/* Rarely, take damage from the Jewel of Judgement */
- if ((randint(999) == 1) && !p_ptr->anti_magic)
+ if (one_in_(999) && !p_ptr->anti_magic)
{
if ((inventory[INVEN_LITE].tval) &&
(inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
if (!p_ptr->inside_battle)
{
/* TY Curse */
- if ((f3 & TR3_TY_CURSE) && (randint(TY_CURSE_CHANCE) == 1))
+ if ((f3 & TR3_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
{
int count = 0;
}
/* Make a chainsword noise */
- if ((o_ptr->name1 == ART_CHAINSWORD) && randint(CHAINSWORD_NOISE) == 1)
+ if ((o_ptr->name1 == ART_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
{
char noise[1024];
#ifdef JP
* Hack: Uncursed teleporting items (e.g. Trump Weapons)
* can actually be useful!
*/
- if ((f3 & TR3_TELEPORT) && (rand_int(100) < 1))
+ if ((f3 & TR3_TELEPORT) && (randint0(100) < 1))
{
if ((o_ptr->ident & IDENT_CURSED) && !p_ptr->anti_tele)
{
dun_level = 0;
dungeon_type = 0;
- leaving_quest = p_ptr->inside_quest;
-
- /* Leaving an 'only once' quest marks it as failed */
- if (leaving_quest &&
- ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
- (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
- {
- quest[leaving_quest].status = QUEST_STATUS_FAILED;
- quest[leaving_quest].complev = (byte)p_ptr->lev;
- if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
- {
- r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
- if (record_rand_quest)
- do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
- }
- else if (record_fix_quest)
- do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
- }
+ leave_quest_check();
p_ptr->inside_quest = 0;
p_ptr->leaving = TRUE;
if (dun_level < 1) dun_level = 1;
/* Nightmare mode makes recall more dangerous */
- if (ironman_nightmare && !rand_int(666) && (dungeon_type == DUNGEON_ANGBAND))
+ if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
{
if (dun_level < 50)
{
default:
{
if (flush_failure) flush();
- if (randint(2) == 1)
+ if (one_in_(2))
{
char error_m[1024];
sound(SOUND_ILLEGAL);
}
/* Give the player some energy */
- else if((rand_int(60) < ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ? 1 : extract_energy[p_ptr->pspeed]))) && !(load && p_ptr->energy >= 100))
+ else if((randint0(60) < ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ? 1 : extract_energy[p_ptr->pspeed]))) && !(load && p_ptr->energy >= 100))
p_ptr->energy += gain_energy();
/* No turn yet */
int d = 1;
/* Make a "saving throw" against stun */
- if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
+ if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
{
/* Recover fully */
d = m_ptr->stunned;
int d = 1;
/* Make a "saving throw" against stun */
- if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
+ if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
{
/* Recover fully */
d = m_ptr->confused;
int d = 1;
/* Make a "saving throw" against stun */
- if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
+ if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
{
/* Recover fully */
d = m_ptr->monfear;
p_ptr->magic_num1[0] = 0;
}
else p_ptr->magic_num1[0] -= 40;
+ p_ptr->update |= (PU_BONUS);
}
if (p_ptr->action == ACTION_LEARN)
{
r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
}
- if (alive)
+ /* Not save-and-quit and not dead? */
+ if (alive && !death)
{
for(num = 0; num < 21; num++)
{
if (!is_pet(m_ptr)) continue;
if (i == p_ptr->riding) continue;
- /* »à¤ó¤À¤È¤¤Ë¤Ï¼ç¤Ê¥Ú¥Ã¥È¤Îɽ¼¨ÍѤˡ¢µ÷Î¥À©¸Â¤òűÇѤ¹¤ë¡£ */
- if (death)
+ if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
{
- if (!m_ptr->nickname) continue;
+ if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
}
else
{
- if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
- {
- if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
- }
- else
- {
- if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
- }
- if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
+ if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
}
+ if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
COPY(&party_mon[num], &m_list[i], monster_type);
delete_monster_idx(i);
}
}
}
- if (p_ptr->riding) p_ptr->riding = -1;
write_level = TRUE;
}
write_level = TRUE;
/* Hack -- seed for flavors */
- seed_flavor = rand_int(0x10000000);
+ seed_flavor = randint0(0x10000000);
/* Hack -- seed for town layout */
- seed_town = rand_int(0x10000000);
+ seed_town = randint0(0x10000000);
/* Roll up a new character */
player_birth();
do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
#endif
- if (p_ptr->riding)
+/*
+ * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
+ * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
+ */
+ if (p_ptr->riding == -1)
{
p_ptr->riding = 0;
for(i = m_max; i > 0; i--)
if (new_game)
{
wipe_o_list();
- wipe_m_list();
player_outfit();
}