#include "angband.h"
+bool confirm_leave_level(bool down_stair)
+{
+ quest_type *q_ptr = &quest[p_ptr->inside_quest];
+
+ /* Confirm leaving from once only quest */
+ if (confirm_quest && p_ptr->inside_quest &&
+ (q_ptr->type == QUEST_TYPE_RANDOM ||
+ (q_ptr->flags & QUEST_FLAG_ONCE &&
+ q_ptr->status != QUEST_STATUS_COMPLETED) ||
+ (q_ptr->flags & QUEST_FLAG_TOWER &&
+ ((q_ptr->status != QUEST_STATUS_STAGE_COMPLETED) ||
+ (down_stair && (quest[QUEST_TOWER1].status != QUEST_STATUS_COMPLETED))))))
+ {
+#ifdef JP
+ msg_print("¤³¤Î³¬¤ò°ìÅÙµî¤ë¤ÈÆóÅÙ¤ÈÌá¤Ã¤ÆÍè¤é¤ì¤Þ¤»¤ó¡£");
+ if (get_check("ËÜÅö¤Ë¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©")) return TRUE;
+#else
+ msg_print("You can't come back here once you leave this floor.");
+ if (get_check("Really leave this floor? ")) return TRUE;
+#endif
+ }
+ else
+ {
+ return TRUE;
+ }
+ return FALSE;
+}
+
/*
* Go up one level
/* Quest up stairs */
if (have_flag(f_ptr->flags, FF_QUEST))
{
+ /* Cancel the command */
+ if (!confirm_leave_level(FALSE)) return;
+
+
/* Success */
#ifdef JP
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
}
else
{
- quest_type *q_ptr = &quest[p_ptr->inside_quest];
-
- /* Confirm leaving from once only quest */
- if (confirm_quest && p_ptr->inside_quest &&
- (q_ptr->type == QUEST_TYPE_RANDOM ||
- (q_ptr->flags & QUEST_FLAG_ONCE &&
- q_ptr->status != QUEST_STATUS_COMPLETED)))
- {
-#ifdef JP
- msg_print("¤³¤Î³¬¤ò°ìÅÙµî¤ë¤ÈÆóÅÙ¤ÈÌá¤Ã¤ÆÍè¤é¤ì¤Þ¤»¤ó¡£");
- if (get_check("ËÜÅö¤Ë¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©")) go_up = TRUE;
-#else
- msg_print("You can't come back here once you leave this floor.");
- if (get_check("Really leave this floor? ")) go_up = TRUE;
-#endif
- }
- else
- {
- go_up = TRUE;
- }
+ go_up = confirm_leave_level(FALSE);
}
/* Cancel the command */
/* Quest down stairs */
else if (have_flag(f_ptr->flags, FF_QUEST))
{
+ /* Confirm Leaving */
+ if(!confirm_leave_level(TRUE)) return;
+
#ifdef JP
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
msg_print("¤Ê¤ó¤À¤³¤Î³¬Ãʤϡª");
msg_print("You enter the down staircase.");
#endif
-
leave_quest_check();
+ leave_tower_check();
p_ptr->inside_quest = c_ptr->special;
{
int dir;
int i, j, y, x, ny, nx, ty, tx, prev_y, prev_x;
- int tdam, tdis, thits, tmul;
+ int tdam_base, tdis, thits, tmul;
int bonus, chance;
int cur_dis, visible;
tdis = 10;
/* Base damage from thrown object plus launcher bonus */
- tdam = damroll(o_ptr->dd, o_ptr->ds) + o_ptr->to_d + j_ptr->to_d;
+ tdam_base = damroll(o_ptr->dd, o_ptr->ds) + o_ptr->to_d + j_ptr->to_d;
/* Actually "fire" the object */
bonus = (p_ptr->to_h_b + o_ptr->to_h + j_ptr->to_h);
tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
/* Boost the damage */
- tdam *= tmul;
- tdam /= 100;
-
- /* Get extra damage from concentration */
- if (p_ptr->concent) tdam = boost_concentration_damage(tdam);
+ tdam_base *= tmul;
+ tdam_base /= 100;
/* Base range */
tdis = 13 + tmul/80;
if (test_hit_fire(chance - cur_dis, armour, m_ptr->ml))
{
bool fear = FALSE;
+ int tdam = tdam_base;
+
+ /* Get extra damage from concentration */
+ if (p_ptr->concent) tdam = boost_concentration_damage(tdam);
/* Handle unseen monster */
if (!visible)
set_action(ACTION_NONE);
}
- if (shuriken)
+ if (shuriken >= 0)
{
item = shuriken;
}
/* Max distance of 10-18 */
if (tdis > mul) tdis = mul;
- if (shuriken)
+ if (shuriken >= 0)
{
ty = randint0(101)-50+py;
tx = randint0(101)-50+px;
*/
void do_cmd_throw(void)
{
- do_cmd_throw_aux(1, FALSE, 0);
+ do_cmd_throw_aux(1, FALSE, -1);
}
{
/* Forget the old data */
travel.cost[y][x] = TRAVEL_UNABLE;
- }
+ }
}
}