int i, k;
/* Extract "shot" power */
- i = (weight + ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2));
+ i = ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2);
+
+ /* Snipers can shot more critically with crossbows */
+ if (p_ptr->concent) i += ((i * p_ptr->concent) / 5);
+ if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->tval_ammo == TV_BOLT)) i *= 2;
/* Critical hit */
if (randint1(5000) <= i)
{
- k = weight + randint1(500);
+ k = weight * randint1(500);
- if (k < 500)
+ if (k < 900)
{
#ifdef JP
msg_print("¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
msg_print("It was a good hit!");
#endif
- dam = 2 * dam + 5;
+ dam += (dam / 2);
}
- else if (k < 1000)
+ else if (k < 1350)
{
#ifdef JP
msg_print("¤«¤Ê¤ê¤Î¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
msg_print("It was a great hit!");
#endif
- dam = 2 * dam + 10;
+ dam *= 2;
}
else
{
msg_print("It was a superb hit!");
#endif
- dam = 3 * dam + 15;
+ dam *= 3;
}
}
/* Extract the flags */
object_flags(o_ptr, flgs);
+ torch_flags(o_ptr, flgs); /* torches has secret flags */
+
+ if (!thrown)
+ {
+ /* Magical Swords */
+ if (p_ptr->special_attack & (ATTACK_ACID)) add_flag(flgs, TR_BRAND_ACID);
+ if (p_ptr->special_attack & (ATTACK_COLD)) add_flag(flgs, TR_BRAND_COLD);
+ if (p_ptr->special_attack & (ATTACK_ELEC)) add_flag(flgs, TR_BRAND_ELEC);
+ if (p_ptr->special_attack & (ATTACK_FIRE)) add_flag(flgs, TR_BRAND_FIRE);
+ if (p_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
+ }
/* Some "weapons" and "ammo" do extra damage */
switch (o_ptr->tval)
case TV_POLEARM:
case TV_SWORD:
case TV_DIGGING:
+ case TV_LITE:
{
/* Slay Animal */
if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
mult *= 3;
}
+ /* Hex - Slay Good (Runesword) */
+ if (hex_spelling(HEX_RUNESWORD) &&
+ (r_ptr->flags3 & RF3_GOOD))
+ {
+ if (is_original_ap_and_seen(m_ptr))
+ {
+ r_ptr->r_flags3 |= RF3_GOOD;
+ }
+
+ if (mult < 20) mult = 20;
+ }
+
/* Brand (Acid) */
- if (have_flag(flgs, TR_BRAND_ACID) || ((p_ptr->special_attack & (ATTACK_ACID)) && !thrown))
+ if (have_flag(flgs, TR_BRAND_ACID))
{
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
}
/* Brand (Elec) */
- if (have_flag(flgs, TR_BRAND_ELEC) || ((p_ptr->special_attack & (ATTACK_ELEC)) && !thrown) || (mode == HISSATSU_ELEC))
+ if (have_flag(flgs, TR_BRAND_ELEC))
{
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
}
/* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_ELEC) || ((p_ptr->special_attack & (ATTACK_ELEC)) && !thrown)) && (mode == HISSATSU_ELEC))
- {
- if (mult < 70) mult = 70;
- }
- else if (mode == HISSATSU_ELEC)
- {
- if (mult < 50) mult = 50;
- }
-
else
{
if (mult < 25) mult = 25;
}
/* Brand (Fire) */
- if (have_flag(flgs, TR_BRAND_FIRE) || ((p_ptr->special_attack & (ATTACK_FIRE)) && !thrown) || (mode == HISSATSU_FIRE))
+ if (have_flag(flgs, TR_BRAND_FIRE))
{
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
}
/* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_FIRE) || ((p_ptr->special_attack & (ATTACK_FIRE)) && !thrown)) && (mode == HISSATSU_FIRE))
- {
- if (r_ptr->flags3 & RF3_HURT_FIRE)
- {
- if (mult < 70) mult = 70;
- if (is_original_ap_and_seen(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_FIRE;
- }
- }
- else if (mult < 35) mult = 35;
- }
else
{
if (r_ptr->flags3 & RF3_HURT_FIRE)
}
/* Brand (Cold) */
- if (have_flag(flgs, TR_BRAND_COLD) || ((p_ptr->special_attack & (ATTACK_COLD)) && !thrown) || (mode == HISSATSU_COLD))
+ if (have_flag(flgs, TR_BRAND_COLD))
{
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
}
}
/* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_COLD) || ((p_ptr->special_attack & (ATTACK_COLD)) && !thrown)) && (mode == HISSATSU_COLD))
- {
- if (r_ptr->flags3 & RF3_HURT_COLD)
- {
- if (mult < 70) mult = 70;
- if (is_original_ap_and_seen(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_COLD;
- }
- }
- else if (mult < 35) mult = 35;
- }
else
{
if (r_ptr->flags3 & RF3_HURT_COLD)
}
/* Brand (Poison) */
- if (have_flag(flgs, TR_BRAND_POIS) || ((p_ptr->special_attack & (ATTACK_POIS)) && !thrown) || (mode == HISSATSU_POISON))
+ if (have_flag(flgs, TR_BRAND_POIS))
{
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
}
/* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_POIS) || ((p_ptr->special_attack & (ATTACK_POIS)) && !thrown)) && (mode == HISSATSU_POISON))
- {
- if (mult < 35) mult = 35;
- }
else
{
if (mult < 25) mult = 25;
}
}
- if ((mode == HISSATSU_ZANMA) && !monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
- {
- if (mult < 15) mult = 25;
- else if (mult < 50) mult = MIN(50, mult+20);
- }
- if (mode == HISSATSU_UNDEAD)
- {
- if (r_ptr->flags3 & RF3_UNDEAD)
- {
- if (is_original_ap_and_seen(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_UNDEAD;
- }
- if (mult == 10) mult = 70;
- else if (mult < 140) mult = MIN(140, mult+60);
- }
- if (mult == 10) mult = 40;
- else if (mult < 60) mult = MIN(60, mult+30);
- }
- if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
+
+ /* Hissatsu */
+ if (p_ptr->pclass == CLASS_SAMURAI)
{
- int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
- if (mult < tmp) mult = tmp;
- }
- if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
- {
- if (is_original_ap_and_seen(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_ROCK;
- }
- if (mult == 10) mult = 40;
- else if (mult < 60) mult = 60;
+ mult = mult_hissatsu(mult, flgs, m_ptr, mode);
}
+
if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
{
p_ptr->csp -= (1+(o_ptr->dd * o_ptr->ds / 5));
#endif
/* Disturb */
- disturb(0, 0);
+ disturb(0, 1);
}
/* Secret door */
#endif
/* Disturb the player */
- disturb(0, 0);
+ disturb(0, 1);
cave_alter_feat(y, x, FF_HIT_TRAP);
}
/* Vampiric drain */
- if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN))
+ if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN) || hex_spelling(HEX_VAMP_BLADE))
{
/* Only drain "living" monsters */
if (monster_living(r_ptr))
can_drain = FALSE;
}
- if ((have_flag(flgs, TR_VORPAL)) && (randint1(vorpal_chance*3/2) == 1) && !zantetsu_mukou)
+ if ((have_flag(flgs, TR_VORPAL) || hex_spelling(HEX_RUNESWORD)) && (randint1(vorpal_chance*3/2) == 1) && !zantetsu_mukou)
vorpal_cut = TRUE;
else vorpal_cut = FALSE;
{
int special_effect = 0, stun_effect = 0, times = 0, max_times;
int min_level = 1;
- martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
+ const martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
int resist_stun = 0;
int weight = 8;
{
drain_heal = damroll(2, drain_result / 6);
+ /* Hex */
+ if (hex_spelling(HEX_VAMP_BLADE)) drain_heal *= 2;
+
if (cheat_xtra)
{
#ifdef JP
drain_result = 0;
/* Confusion attack */
- if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF))
+ if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF) || hex_spelling(HEX_CONFUSION))
{
/* Cancel glowing hands */
if (p_ptr->special_attack & ATTACK_CONFUSE)
char m_name[80];
/* Disturb the player */
- disturb(0, 0);
+ disturb(0, 1);
energy_use = 100;
if (have_flag(f_ptr->flags, FF_STORE))
{
/* Disturb */
- disturb(0, 0);
+ disturb(0, 1);
energy_use = 0;
/* Hack -- Enter store */
else if (have_flag(f_ptr->flags, FF_BLDG))
{
/* Disturb */
- disturb(0, 0);
+ disturb(0, 1);
energy_use = 0;
/* Hack -- Enter building */
else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
{
/* Disturb */
- disturb(0, 0);
+ disturb(0, 1);
energy_use = 0;
/* Hack -- Enter quest level */
else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
{
/* Disturb */
- disturb(0, 0);
+ disturb(0, 1);
/* Hidden trap */
if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
#endif
}
- if (disturb_trap_detect) disturb(0, 0);
+ if (disturb_trap_detect) disturb(0, 1);
}
}
#endif
energy_use = 0;
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
else if (MON_MONFEAR(riding_m_ptr))
{
msg_format("%^s is too scared to control.", m_name);
#endif
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
else if (p_ptr->riding_ryoute)
{
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
{
#endif
energy_use = 0;
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
#endif
energy_use = 0;
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
#endif
energy_use = 0;
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
msg_format("You cannot control stunned %s!",m_name);
#endif
oktomove = FALSE;
- disturb(0, 0);
+ disturb(0, 1);
}
}
oktomove = FALSE;
- /* Disturb the player */
- disturb(0, 0);
-
/* Notice things in the dark */
if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
{
}
}
+ /* Disturb the player */
+ disturb(0, 1);
+
/* Sound */
if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
}
}
/* To avoid a loop with running */
- disturb(0, 0);
+ disturb(0, 1);
oktomove = FALSE;
}
disturb(0, 0);
}
}
+
+
+#ifdef TRAVEL
+/*
+ * Test for traveling
+ */
+static int travel_test(int prev_dir)
+{
+ int new_dir = 0;
+ int i, max;
+ const cave_type *c_ptr;
+ int cost;
+
+ /* Cannot travel when blind */
+ if (p_ptr->blind || no_lite())
+ {
+ msg_print(_("Ìܤ¬¸«¤¨¤Ê¤¤¡ª", "You cannot see!"));
+ return (0);
+ }
+
+ /* break run when leaving trap detected region */
+ if ((disturb_trap_detect || alert_trap_detect)
+ && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
+ {
+ /* No duplicate warning */
+ p_ptr->dtrap = FALSE;
+
+ /* You are just on the edge */
+ if (!(cave[py][px].info & CAVE_UNSAFE))
+ {
+ if (alert_trap_detect)
+ {
+#ifdef JP
+ msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
+#else
+ msg_print("*Leaving trap detect region!*");
+#endif
+ }
+
+ if (disturb_trap_detect)
+ {
+ /* Break Run */
+ return (0);
+ }
+ }
+ }
+
+ /* Range of newly adjacent grids */
+ max = (prev_dir & 0x01) + 1;
+
+ /* Look at every newly adjacent square. */
+ for (i = -max; i <= max; i++)
+ {
+ /* New direction */
+ int dir = cycle[chome[prev_dir] + i];
+
+ /* New location */
+ int row = py + ddy[dir];
+ int col = px + ddx[dir];
+
+ /* Access grid */
+ c_ptr = &cave[row][col];
+
+ /* Visible monsters abort running */
+ if (c_ptr->m_idx)
+ {
+ monster_type *m_ptr = &m_list[c_ptr->m_idx];
+
+ /* Visible monster */
+ if (m_ptr->ml) return (0);
+ }
+
+ }
+
+ /* Travel cost of current grid */
+ cost = travel.cost[py][px];
+
+ /* Determine travel direction */
+ for (i = 0; i < 8; ++ i) {
+ int dir_cost = travel.cost[py+ddy_ddd[i]][px+ddx_ddd[i]];
+
+ if (dir_cost < cost)
+ {
+ new_dir = ddd[i];
+ cost = dir_cost;
+ }
+ }
+
+ if (!new_dir) return (0);
+
+ /* Access newly move grid */
+ c_ptr = &cave[py+ddy[new_dir]][px+ddx[new_dir]];
+
+ /* Close door abort traveling */
+ if (!easy_open && is_closed_door(c_ptr->feat)) return (0);
+
+ /* Visible and unignorable trap abort tarveling */
+ if (!c_ptr->mimic && !trap_can_be_ignored(c_ptr->feat)) return (0);
+
+ /* Move new grid */
+ return (new_dir);
+}
+
+
+/*
+ * Travel command
+ */
+void travel_step(void)
+{
+ /* Get travel direction */
+ travel.dir = travel_test(travel.dir);
+
+ /* disturb */
+ if (!travel.dir)
+ {
+ if (travel.run == 255)
+ {
+#ifdef JP
+ msg_print("Æ»¶Ú¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡ª");
+#else
+ msg_print("No route is found!");
+#endif
+ }
+ disturb(0, 1);
+ return;
+ }
+
+ energy_use = 100;
+
+ move_player(travel.dir, always_pickup, FALSE);
+
+ if ((py == travel.y) && (px == travel.x))
+ travel.run = 0;
+ else if (travel.run > 0)
+ travel.run--;
+
+ /* Travel Delay */
+ Term_xtra(TERM_XTRA_DELAY, delay_factor);
+}
+#endif