X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd-activate.c;h=46a236e9a6a726b5a0ee0b1a87ff9bb4c71da152;hb=6ab40036f862c33829d4a5fbe66cda44214db2ad;hp=64da2f7a4b3159909b9fc61d123a74c3fff4e03d;hpb=10d7d0a4b2ebfacbc135e795e208355292772b5c;p=hengband%2Fhengband.git diff --git a/src/cmd-activate.c b/src/cmd-activate.c index 64da2f7a4..46a236e9a 100644 --- a/src/cmd-activate.c +++ b/src/cmd-activate.c @@ -9,6 +9,7 @@ #include "angband.h" #include "cmd-activate.h" #include "object-hook.h" +#include "spells-summon.h" /*! * @brief ペット入りモンスターボールをソートするための比較関数 @@ -65,7 +66,9 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b) */ void do_cmd_activate_aux(INVENTORY_IDX item) { - int dir, lev, chance, fail; + DIRECTION dir; + DEPTH lev; + int chance, fail; object_type *o_ptr; bool success; @@ -82,7 +85,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item) o_ptr = &o_list[0 - item]; } - /* Take a turn */ p_ptr->energy_use = 100; /* Extract the item level */ @@ -166,7 +168,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item) { (void)activate_artifact(o_ptr); - /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP); /* Success */ @@ -179,14 +180,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item) if (music_singing_any()) stop_singing(); if (hex_spelling_any()) stop_hex_spell_all(); -#if 0 - if (object_is_cursed(o_ptr)) - { - msg_print(_("カン高い音が響き渡った。", "You produce a shrill whistling sound.")); - aggravate_monsters(0); - } - else -#endif { IDX pet_ctr, i; IDX *who; @@ -219,7 +212,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item) /* Free the "who" array */ C_KILL(who, max_m_idx, IDX); } - o_ptr->timeout = 100+randint1(100); + o_ptr->timeout = 100 + randint1(100); return; } else if (o_ptr->tval == TV_CAPTURE) @@ -283,7 +276,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item) else { success = FALSE; - if (!get_rep_dir2(&dir)) return; + if (!get_direction(&dir, FALSE, FALSE)) return; if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0)) { if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE))) @@ -379,10 +372,8 @@ void do_cmd_activate(void) } item_tester_no_ryoute = TRUE; - /* Prepare the hook */ item_tester_hook = item_tester_hook_activate; - /* Get an item */ q = _("どのアイテムを始動させますか? ", "Activate which item? "); s = _("始動できるアイテムを装備していない。", "You have nothing to activate."); @@ -400,10 +391,11 @@ void do_cmd_activate(void) */ static bool activate_dragon_breath(object_type *o_ptr) { - u32b flgs[TR_FLAG_SIZE]; /* for resistance flags */ + BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */ int type[20]; cptr name[20]; - int i, dir, t, n = 0; + int i, t, n = 0; + DIRECTION dir; if (!get_aim_dir(&dir)) return FALSE; @@ -637,25 +629,7 @@ bool activate_artifact(object_type *o_ptr) case ACT_WHIRLWIND: { - { - int y = 0, x = 0; - cave_type *c_ptr; - monster_type *m_ptr; - - for (dir = 0; dir <= 9; dir++) - { - y = p_ptr->y + ddy[dir]; - x = p_ptr->x + ddx[dir]; - c_ptr = &cave[y][x]; - - /* Get the monster */ - m_ptr = &m_list[c_ptr->m_idx]; - - /* Hack -- attack monsters */ - if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) - py_attack(y, x, 0); - } - } + massacre(); break; } @@ -986,22 +960,7 @@ bool activate_artifact(object_type *o_ptr) case ACT_SUMMON_DEMON: { - bool pet = one_in_(3); - BIT_FLAGS mode = 0L; - - if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP; - if (pet) mode |= PM_FORCE_PET; - else mode |= PM_NO_PET; - - if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), SUMMON_DEMON, mode)) - { - msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone.")); - if (pet) - msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'")); - else - msg_print(_("「NON SERVIAM! Wretch! お前の魂を頂くぞ!」", "'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'")); - } - + cast_summon_demon((plev * 3) / 2); break; } @@ -1481,10 +1440,7 @@ bool activate_artifact(object_type *o_ptr) case ACT_DISP_CURSE_XTRA: { msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name); - if (remove_all_curse()) - { - msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you.")); - } + (void)remove_all_curse(); (void)probing(); break; } @@ -1526,15 +1482,12 @@ bool activate_artifact(object_type *o_ptr) p_ptr->csp = 0; p_ptr->csp_frac = 0; - /* Message */ msg_print(_("石を制御できない!", "You are too weak to control the stone!")); /* Hack -- Bypass free action */ - (void)set_paralyzed(p_ptr->paralyzed + - randint1(5 * oops + 1)); + (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1)); /* Confusing. */ - (void)set_confused(p_ptr->confused + - randint1(5 * oops + 1)); + (void)set_confused(p_ptr->confused + randint1(5 * oops + 1)); } /* Redraw mana */ @@ -1542,12 +1495,10 @@ bool activate_artifact(object_type *o_ptr) } take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1); /* Confusing. */ - if (one_in_(5)) (void)set_confused(p_ptr->confused + - randint1(10)); + if (one_in_(5)) (void)set_confused(p_ptr->confused + randint1(10)); /* Exercise a little care... */ - if (one_in_(20)) - take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1); + if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1); break; } @@ -1673,10 +1624,10 @@ bool activate_artifact(object_type *o_ptr) { POSITION x, y; - if (!get_rep_dir2(&dir)) return FALSE; + if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - tsuri_dir = dir; + p_ptr->fishing_dir = dir; if (!cave_have_flag_bold(y, x, FF_WATER)) { msg_print(_("そこは水辺ではない。", "There is no fishing place."));