#include "cmd-item/cmd-throw.h"
#include "action/throw-util.h"
#include "action/weapon-shield.h"
-#include "art-definition/art-weapon-types.h"
+#include "artifact/fixed-art-types.h"
#include "combat/attack-power-table.h"
#include "combat/shoot.h"
#include "combat/slaying.h"
#include "object/object-kind.h"
#include "object/object-stack.h"
#include "player/attack-defense-types.h"
+#include "player/player-status-table.h"
#include "player/special-defense-types.h"
#include "racial/racial-android.h"
#include "specific-object/torch.h"
if (!it_ptr->boomerang)
return TRUE;
- if (has_melee_weapon(creature_ptr, INVEN_RARM) && has_melee_weapon(creature_ptr, INVEN_LARM)) {
+ if (has_melee_weapon(creature_ptr, INVEN_MAIN_HAND) && has_melee_weapon(creature_ptr, INVEN_SUB_HAND)) {
item_tester_hook = item_tester_hook_boomerang;
- *q = _("どの武器を投げますか? ", "Throw which it_ptr->item? ");
+ *q = _("どの武器を投げますか? ", "Throw which item? ");
*s = _("投げる武器がない。", "You have nothing to throw.");
it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, *q, *s, USE_EQUIP, 0);
if (!it_ptr->o_ptr) {
return TRUE;
}
- if (has_melee_weapon(creature_ptr, INVEN_LARM)) {
- it_ptr->item = INVEN_LARM;
+ if (has_melee_weapon(creature_ptr, INVEN_SUB_HAND)) {
+ it_ptr->item = INVEN_SUB_HAND;
it_ptr->o_ptr = &creature_ptr->inventory_list[it_ptr->item];
return TRUE;
}
- it_ptr->item = INVEN_RARM;
+ it_ptr->item = INVEN_MAIN_HAND;
it_ptr->o_ptr = &creature_ptr->inventory_list[it_ptr->item];
return TRUE;
}
if (!check_throw_boomerang(creature_ptr, it_ptr, &q, &s))
return FALSE;
- q = _("どのアイテムを投げますか? ", "Throw which it_ptr->item? ");
+ q = _("どのアイテムを投げますか? ", "Throw which item? ");
s = _("投げるアイテムがない。", "You have nothing to throw.");
it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
if (!it_ptr->o_ptr) {
if (!check_what_throw(creature_ptr, it_ptr))
return FALSE;
- if (object_is_cursed(it_ptr->o_ptr) && (it_ptr->item >= INVEN_RARM)) {
+ if (object_is_cursed(it_ptr->o_ptr) && (it_ptr->item >= INVEN_MAIN_HAND)) {
msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
return FALSE;
}
int mul = 10 + 2 * (it_ptr->mult - 1);
int div = ((it_ptr->q_ptr->weight > 10) ? it_ptr->q_ptr->weight : 10);
- if ((have_flag(it_ptr->obj_flags, TR_THROW)) || it_ptr->boomerang)
+ if ((has_flag(it_ptr->obj_flags, TR_THROW)) || it_ptr->boomerang)
div /= 2;
it_ptr->tdis = (adj_str_blow[creature_ptr->stat_ind[A_STR]] + 20) * mul / div;
it_ptr->x = creature_ptr->x;
handle_stuff(creature_ptr);
it_ptr->shuriken = (creature_ptr->pclass == CLASS_NINJA)
- && ((it_ptr->q_ptr->tval == TV_SPIKE) || ((have_flag(it_ptr->obj_flags, TR_THROW)) && (it_ptr->q_ptr->tval == TV_SWORD)));
+ && ((it_ptr->q_ptr->tval == TV_SPIKE) || ((has_flag(it_ptr->obj_flags, TR_THROW)) && (it_ptr->q_ptr->tval == TV_SWORD)));
}
static void set_racial_chance(player_type *creature_ptr, it_type *it_ptr)
{
- if (have_flag(it_ptr->obj_flags, TR_THROW))
+ if (has_flag(it_ptr->obj_flags, TR_THROW))
it_ptr->chance = ((creature_ptr->skill_tht) + ((creature_ptr->to_h_b + it_ptr->q_ptr->to_h) * BTH_PLUS_ADJ));
else
it_ptr->chance = (creature_ptr->skill_tht + (creature_ptr->to_h_b * BTH_PLUS_ADJ));
it_ptr->ny[it_ptr->cur_dis] = it_ptr->y;
it_ptr->nx[it_ptr->cur_dis] = it_ptr->x;
mmove2(&it_ptr->ny[it_ptr->cur_dis], &it_ptr->nx[it_ptr->cur_dis], creature_ptr->y, creature_ptr->x, it_ptr->ty, it_ptr->tx);
- if (cave_have_flag_bold(creature_ptr->current_floor_ptr, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis], FF_PROJECT))
+ if (cave_has_flag_bold(creature_ptr->current_floor_ptr, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis], FF_PROJECT))
return FALSE;
it_ptr->hit_wall = TRUE;
return;
}
- SYMBOL_CODE c = object_char(it_ptr->q_ptr);
- TERM_COLOR a = object_attr(it_ptr->q_ptr);
- print_rel(creature_ptr, c, a, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
- move_cursor_relative(it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
- term_fresh();
- term_xtra(TERM_XTRA_DELAY, it_ptr->msec);
- lite_spot(creature_ptr, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
- term_fresh();
+ if (it_ptr->msec > 0) {
+ SYMBOL_CODE c = object_char(it_ptr->q_ptr);
+ TERM_COLOR a = object_attr(it_ptr->q_ptr);
+ print_rel(creature_ptr, c, a, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
+ move_cursor_relative(it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
+ term_fresh();
+ term_xtra(TERM_XTRA_DELAY, it_ptr->msec);
+ lite_spot(creature_ptr, it_ptr->ny[it_ptr->cur_dis], it_ptr->nx[it_ptr->cur_dis]);
+ term_fresh();
+ }
}
static bool check_racial_target_monster(player_type *creature_ptr, it_type *it_ptr)
it_ptr->tdam += -it_ptr->q_ptr->to_d;
if (it_ptr->boomerang) {
- it_ptr->tdam *= (it_ptr->mult + creature_ptr->num_blow[it_ptr->item - INVEN_RARM]);
+ it_ptr->tdam *= (it_ptr->mult + creature_ptr->num_blow[it_ptr->item - INVEN_MAIN_HAND]);
it_ptr->tdam += creature_ptr->to_d_m;
- } else if (have_flag(it_ptr->obj_flags, TR_THROW)) {
+ } else if (has_flag(it_ptr->obj_flags, TR_THROW)) {
it_ptr->tdam *= (3 + it_ptr->mult);
it_ptr->tdam += creature_ptr->to_d_m;
} else {
msg_print(_("人形は捻じ曲がり砕け散ってしまった!", "The Figurine writhes and then shatters."));
return;
}
-
+
if (object_is_cursed(it_ptr->q_ptr))
msg_print(_("これはあまり良くない気がする。", "You have a bad feeling about this."));
}
if (!object_is_potion(it_ptr->q_ptr))
return;
- if (it_ptr->hit_body || it_ptr->hit_wall || (randint1(100) < it_ptr->corruption_possibility)) {
+ if (!it_ptr->hit_body && !it_ptr->hit_wall && (randint1(100) >= it_ptr->corruption_possibility)) {
it_ptr->corruption_possibility = 0;
- return;
+ return;
}
msg_format(_("%sは砕け散った!", "The %s shatters!"), it_ptr->o_name);
it_ptr->do_drop = FALSE;
return;
}
-
+
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[it_ptr->y][it_ptr->x].m_idx];
if ((creature_ptr->current_floor_ptr->grid_array[it_ptr->y][it_ptr->x].m_idx == 0) || !is_friendly(m_ptr) || monster_invulner_remaining(m_ptr)) {
it_ptr->do_drop = FALSE;
return;
}
-
+
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
SYMBOL_CODE c = object_char(it_ptr->q_ptr);
byte a = object_attr(it_ptr->q_ptr);
- print_rel(creature_ptr, c, a, it_ptr->ny[i], it_ptr->nx[i]);
- move_cursor_relative(it_ptr->ny[i], it_ptr->nx[i]);
- term_fresh();
- term_xtra(TERM_XTRA_DELAY, it_ptr->msec);
- lite_spot(creature_ptr, it_ptr->ny[i], it_ptr->nx[i]);
- term_fresh();
+
+ if (it_ptr->msec > 0) {
+ print_rel(creature_ptr, c, a, it_ptr->ny[i], it_ptr->nx[i]);
+ move_cursor_relative(it_ptr->ny[i], it_ptr->nx[i]);
+ term_fresh();
+ term_xtra(TERM_XTRA_DELAY, it_ptr->msec);
+ lite_spot(creature_ptr, it_ptr->ny[i], it_ptr->nx[i]);
+ term_fresh();
+ }
}
display_boomerang_throw(creature_ptr, it_ptr);
static void process_boomerang_back(player_type *creature_ptr, it_type *it_ptr)
{
if (it_ptr->come_back) {
- if ((it_ptr->item != INVEN_RARM) && (it_ptr->item != INVEN_LARM)) {
+ if ((it_ptr->item != INVEN_MAIN_HAND) && (it_ptr->item != INVEN_SUB_HAND)) {
store_item_to_inventory(creature_ptr, it_ptr->q_ptr);
it_ptr->do_drop = FALSE;
return;
it_ptr->o_ptr = &creature_ptr->inventory_list[it_ptr->item];
object_copy(it_ptr->o_ptr, it_ptr->q_ptr);
- creature_ptr->total_weight += it_ptr->q_ptr->weight;
creature_ptr->equip_cnt++;
creature_ptr->update |= PU_BONUS | PU_TORCH | PU_MANA;
creature_ptr->window |= PW_EQUIP;
it_ptr->do_drop = FALSE;
return;
}
-
+
if (it_ptr->equiped_item) {
verify_equip_slot(creature_ptr, it_ptr->item);
calc_android_exp(creature_ptr);
if (!it_ptr->do_drop)
return;
- if (cave_have_flag_bold(creature_ptr->current_floor_ptr, it_ptr->y, it_ptr->x, FF_PROJECT))
+ if (cave_has_flag_bold(creature_ptr->current_floor_ptr, it_ptr->y, it_ptr->x, FF_PROJECT))
(void)drop_near(creature_ptr, it_ptr->q_ptr, it_ptr->corruption_possibility, it_ptr->y, it_ptr->x);
else
(void)drop_near(creature_ptr, it_ptr->q_ptr, it_ptr->corruption_possibility, it_ptr->prev_y, it_ptr->prev_x);
return FALSE;
reflect_inventory_by_throw(creature_ptr, it_ptr);
- if (it_ptr->item >= INVEN_RARM) {
+ if (it_ptr->item >= INVEN_MAIN_HAND) {
it_ptr->equiped_item = TRUE;
creature_ptr->redraw |= PR_EQUIPPY;
}
process_boomerang_back(creature_ptr, it_ptr);
drop_thrown_item(creature_ptr, it_ptr);
return TRUE;
-}
+}
\ No newline at end of file