1 #include "cmd-action/cmd-pet.h"
2 #include "action/action-limited.h"
3 #include "cmd-action/cmd-attack.h"
4 #include "cmd-io/cmd-dump.h"
5 #include "core/asking-player.h"
6 #include "core/player-redraw-types.h"
7 #include "core/player-update-types.h"
8 #include "core/stuff-handler.h"
9 #include "core/window-redrawer.h"
10 #include "effect/spells-effect-util.h"
11 #include "floor/pattern-walk.h"
12 #include "game-option/input-options.h"
13 #include "game-option/play-record-options.h"
14 #include "game-option/text-display-options.h"
15 #include "grid/feature.h"
16 #include "grid/grid.h"
17 #include "inventory/inventory-slot-types.h"
18 #include "io/command-repeater.h"
19 #include "io/cursor.h"
20 #include "io/input-key-acceptor.h"
21 #include "io/input-key-requester.h"
22 #include "io/write-diary.h"
23 #include "main/sound-of-music.h"
24 #include "monster-floor/monster-object.h"
25 #include "monster-floor/monster-remover.h"
26 #include "monster-race/monster-race.h"
27 #include "monster-race/race-flags1.h"
28 #include "monster-race/race-flags7.h"
29 #include "monster/monster-describer.h"
30 #include "monster/monster-description-types.h"
31 #include "monster/monster-info.h"
32 #include "monster/monster-status-setter.h"
33 #include "monster/monster-status.h"
34 #include "monster/smart-learn-types.h"
35 #include "object-hook/hook-weapon.h"
36 #include "pet/pet-util.h"
37 #include "player/attack-defense-types.h"
38 #include "player/player-class.h"
39 #include "player/player-damage.h"
40 #include "player/player-move.h"
41 #include "player/player-skill.h"
42 #include "player/player-status-flags.h"
43 #include "player/player-status.h"
44 #include "player/special-defense-types.h"
45 #include "status/action-setter.h"
46 #include "system/floor-type-definition.h"
47 #include "target/target-checker.h"
48 #include "target/target-getter.h"
49 #include "target/target-setter.h"
50 #include "target/target-types.h"
51 #include "term/screen-processor.h"
52 #include "util/bit-flags-calculator.h"
53 #include "util/int-char-converter.h"
54 #include "util/quarks.h"
55 #include "util/sort.h"
56 #include "view/display-messages.h"
57 #include "world/world.h"
59 int total_friends = 0;
62 * @brief ペットを開放するコマンドのメインルーチン
65 void do_cmd_pet_dismiss(player_type *creature_ptr)
68 bool all_pets = FALSE;
83 /* Allocate the "who" array */
84 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
86 /* Process the monsters (backwards) */
87 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
88 if (is_pet(&creature_ptr->current_floor_ptr->m_list[pet_ctr]))
89 who[max_pet++] = pet_ctr;
92 ang_sort(creature_ptr, who, &dummy_why, max_pet, ang_sort_comp_pet_dismiss, ang_sort_swap_hook);
94 /* Process the monsters (backwards) */
95 for (i = 0; i < max_pet; i++) {
97 GAME_TEXT friend_name[MAX_NLEN];
101 m_ptr = &creature_ptr->current_floor_ptr->m_list[pet_ctr];
104 kakunin = ((pet_ctr == creature_ptr->riding) || (m_ptr->nickname));
105 monster_desc(creature_ptr, friend_name, m_ptr, MD_ASSUME_VISIBLE);
108 /* Hack -- health bar for this monster */
109 health_track(creature_ptr, pet_ctr);
110 handle_stuff(creature_ptr);
112 msg_format(_("%sを放しますか? [Yes/No/Unnamed (%d体)]", "Dismiss %s? [Yes/No/Unnamed (%d remain)]"), friend_name, max_pet - i);
115 move_cursor_relative(m_ptr->fy, m_ptr->fx);
120 if (ch == 'Y' || ch == 'y') {
124 msg_format(_("本当によろしいですか? (%s) ", "Are you sure? (%s) "), friend_name);
126 if (ch != 'Y' && ch != 'y')
132 if (ch == 'U' || ch == 'u') {
137 if (ch == ESCAPE || ch == 'N' || ch == 'n')
144 if ((all_pets && !kakunin) || (!all_pets && delete_this)) {
145 if (record_named_pet && m_ptr->nickname) {
146 GAME_TEXT m_name[MAX_NLEN];
148 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
149 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_DISMISS, m_name);
152 if (pet_ctr == creature_ptr->riding) {
153 msg_format(_("%sから降りた。", "You dismount from %s. "), friend_name);
155 creature_ptr->riding = 0;
157 creature_ptr->update |= (PU_MONSTERS);
158 creature_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
161 /* HACK : Add the line to message buffer */
162 msg_format(_("%s を放した。", "Dismissed %s."), friend_name);
163 creature_ptr->update |= (PU_BONUS);
164 creature_ptr->window |= (PW_MESSAGE);
166 delete_monster_idx(creature_ptr, pet_ctr);
173 if (need_term_fresh(creature_ptr))
176 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
179 msg_format("%d 体のペットを放しました。", Dismissed);
181 msg_format("You have dismissed %d pet%s.", Dismissed, (Dismissed == 1 ? "" : "s"));
183 if (Dismissed == 0 && all_pets)
184 msg_print(_("'U'nnamed は、乗馬以外の名前のないペットだけを全て解放します。", "'U'nnamed means all your pets except named pets and your mount."));
186 handle_stuff(creature_ptr);
190 * @brief ペットから騎乗/下馬するコマンドのメインルーチン /
191 * @param force 強制的に騎乗/下馬するならばTRUE
192 * @return 騎乗/下馬できたらTRUE
194 bool do_cmd_riding(player_type *creature_ptr, bool force)
201 if (!get_direction(creature_ptr, &dir, FALSE, FALSE))
203 y = creature_ptr->y + ddy[dir];
204 x = creature_ptr->x + ddx[dir];
205 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
207 if (creature_ptr->special_defense & KATA_MUSOU)
208 set_action(creature_ptr, ACTION_NONE);
210 if (creature_ptr->riding) {
211 /* Skip non-empty grids */
212 if (!can_player_ride_pet(creature_ptr, g_ptr, FALSE)) {
213 msg_print(_("そちらには降りられません。", "You cannot go that direction."));
217 if (!pattern_seq(creature_ptr, creature_ptr->y, creature_ptr->x, y, x))
221 take_turn(creature_ptr, 100);
223 msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
225 do_cmd_attack(creature_ptr, y, x, 0);
229 creature_ptr->riding = 0;
230 creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
231 creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
233 if (cmd_limit_confused(creature_ptr))
236 m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
238 if (!g_ptr->m_idx || !m_ptr->ml) {
239 msg_print(_("その場所にはモンスターはいません。", "There is no monster here."));
242 if (!is_pet(m_ptr) && !force) {
243 msg_print(_("そのモンスターはペットではありません。", "That monster is not a pet."));
246 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING)) {
247 msg_print(_("そのモンスターには乗れなさそうだ。", "This monster doesn't seem suitable for riding."));
251 if (!pattern_seq(creature_ptr, creature_ptr->y, creature_ptr->x, y, x))
254 if (!can_player_ride_pet(creature_ptr, g_ptr, TRUE)) {
255 /* Feature code (applying "mimic" field) */
256 feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)];
258 msg_format("そのモンスターは%sの%sにいる。", f_name + f_ptr->name,
259 ((!has_flag(f_ptr->flags, FF_MOVE) && !has_flag(f_ptr->flags, FF_CAN_FLY))
260 || (!has_flag(f_ptr->flags, FF_LOS) && !has_flag(f_ptr->flags, FF_TREE)))
264 msg_format("This monster is %s the %s.",
265 ((!has_flag(f_ptr->flags, FF_MOVE) && !has_flag(f_ptr->flags, FF_CAN_FLY))
266 || (!has_flag(f_ptr->flags, FF_LOS) && !has_flag(f_ptr->flags, FF_TREE)))
269 f_name + f_ptr->name);
274 if (r_info[m_ptr->r_idx].level > randint1((creature_ptr->skill_exp[GINOU_RIDING] / 50 + creature_ptr->lev / 2 + 20))) {
275 msg_print(_("うまく乗れなかった。", "You failed to ride."));
276 take_turn(creature_ptr, 100);
280 if (monster_csleep_remaining(m_ptr)) {
281 GAME_TEXT m_name[MAX_NLEN];
282 monster_desc(creature_ptr, m_name, m_ptr, 0);
283 (void)set_monster_csleep(creature_ptr, g_ptr->m_idx, 0);
284 msg_format(_("%sを起こした。", "You have woken %s up."), m_name);
287 if (creature_ptr->action == ACTION_KAMAE)
288 set_action(creature_ptr, ACTION_NONE);
290 creature_ptr->riding = g_ptr->m_idx;
292 /* Hack -- remove tracked monster */
293 if (creature_ptr->riding == creature_ptr->health_who)
294 health_track(creature_ptr, 0);
297 take_turn(creature_ptr, 100);
299 /* Mega-Hack -- Forget the view and lite */
300 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
301 creature_ptr->update |= (PU_BONUS);
302 creature_ptr->redraw |= (PR_MAP | PR_EXTRA);
303 creature_ptr->redraw |= (PR_UHEALTH);
305 (void)move_player_effect(creature_ptr, y, x, MPE_HANDLE_STUFF | MPE_ENERGY_USE | MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
311 * @brief ペットに名前をつけるコマンドのメインルーチン
314 static void do_name_pet(player_type *creature_ptr)
318 GAME_TEXT m_name[MAX_NLEN];
319 bool old_name = FALSE;
320 bool old_target_pet = target_pet;
323 if (!target_set(creature_ptr, TARGET_KILL)) {
324 target_pet = old_target_pet;
328 target_pet = old_target_pet;
330 if (creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) {
331 m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
333 if (!is_pet(m_ptr)) {
334 msg_print(_("そのモンスターはペットではない。", "This monster is not a pet."));
337 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE) {
338 msg_print(_("そのモンスターの名前は変えられない!", "You cannot change the name of this monster!"));
341 monster_desc(creature_ptr, m_name, m_ptr, 0);
343 msg_format(_("%sに名前をつける。", "Name %s."), m_name);
346 /* Start with nothing */
349 /* Use old inscription */
350 if (m_ptr->nickname) {
351 /* Start with the old inscription */
352 strcpy(out_val, quark_str(m_ptr->nickname));
356 /* Get a new inscription (possibly empty) */
357 if (get_string(_("名前: ", "Name: "), out_val, 15)) {
359 /* Save the inscription */
360 m_ptr->nickname = quark_add(out_val);
361 if (record_named_pet) {
362 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
363 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_NAME, m_name);
366 if (record_named_pet && old_name) {
367 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
368 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_UNNAME, m_name);
377 * @brief ペットに関するコマンドリストのメインルーチン /
378 * Issue a pet command
381 void do_cmd_pet(player_type *creature_ptr)
386 concptr power_desc[36];
393 PET_COMMAND_IDX mode = 0;
396 char target_buf[160];
398 int menu_line = use_menu ? 1 : 0;
402 if (creature_ptr->wild_mode)
405 power_desc[num] = _("ペットを放す", "dismiss pets");
406 powers[num++] = PET_DISMISS;
409 sprintf(target_buf, "ペットのターゲットを指定 (現在:%s)",
410 (creature_ptr->pet_t_m_idx
411 ? (creature_ptr->image ? "何か奇妙な物" : (r_name + r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name))
414 sprintf(target_buf, "specify a target of pet (now:%s)",
415 (creature_ptr->pet_t_m_idx ? (
416 creature_ptr->image ? "something strange" : (r_name + r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name))
419 power_desc[num] = target_buf;
420 powers[num++] = PET_TARGET;
421 power_desc[num] = _("近くにいろ", "stay close");
423 if (creature_ptr->pet_follow_distance == PET_CLOSE_DIST)
425 powers[num++] = PET_STAY_CLOSE;
426 power_desc[num] = _("ついて来い", "follow me");
428 if (creature_ptr->pet_follow_distance == PET_FOLLOW_DIST)
430 powers[num++] = PET_FOLLOW_ME;
431 power_desc[num] = _("敵を見つけて倒せ", "seek and destroy");
433 if (creature_ptr->pet_follow_distance == PET_DESTROY_DIST)
435 powers[num++] = PET_SEEK_AND_DESTROY;
436 power_desc[num] = _("少し離れていろ", "give me space");
438 if (creature_ptr->pet_follow_distance == PET_SPACE_DIST)
440 powers[num++] = PET_ALLOW_SPACE;
441 power_desc[num] = _("離れていろ", "stay away");
443 if (creature_ptr->pet_follow_distance == PET_AWAY_DIST)
445 powers[num++] = PET_STAY_AWAY;
447 if (creature_ptr->pet_extra_flags & PF_OPEN_DOORS) {
448 power_desc[num] = _("ドアを開ける (現在:ON)", "pets open doors (now On)");
450 power_desc[num] = _("ドアを開ける (現在:OFF)", "pets open doors (now Off)");
452 powers[num++] = PET_OPEN_DOORS;
454 if (creature_ptr->pet_extra_flags & PF_PICKUP_ITEMS) {
455 power_desc[num] = _("アイテムを拾う (現在:ON)", "pets pick up items (now On)");
457 power_desc[num] = _("アイテムを拾う (現在:OFF)", "pets pick up items (now Off)");
459 powers[num++] = PET_TAKE_ITEMS;
461 if (creature_ptr->pet_extra_flags & PF_TELEPORT) {
462 power_desc[num] = _("テレポート系魔法を使う (現在:ON)", "allow teleport (now On)");
464 power_desc[num] = _("テレポート系魔法を使う (現在:OFF)", "allow teleport (now Off)");
466 powers[num++] = PET_TELEPORT;
468 if (creature_ptr->pet_extra_flags & PF_ATTACK_SPELL) {
469 power_desc[num] = _("攻撃魔法を使う (現在:ON)", "allow cast attack spell (now On)");
471 power_desc[num] = _("攻撃魔法を使う (現在:OFF)", "allow cast attack spell (now Off)");
473 powers[num++] = PET_ATTACK_SPELL;
475 if (creature_ptr->pet_extra_flags & PF_SUMMON_SPELL) {
476 power_desc[num] = _("召喚魔法を使う (現在:ON)", "allow cast summon spell (now On)");
478 power_desc[num] = _("召喚魔法を使う (現在:OFF)", "allow cast summon spell (now Off)");
480 powers[num++] = PET_SUMMON_SPELL;
482 if (creature_ptr->pet_extra_flags & PF_BALL_SPELL) {
483 power_desc[num] = _("プレイヤーを巻き込む範囲魔法を使う (現在:ON)", "allow involve player in area spell (now On)");
485 power_desc[num] = _("プレイヤーを巻き込む範囲魔法を使う (現在:OFF)", "allow involve player in area spell (now Off)");
487 powers[num++] = PET_BALL_SPELL;
489 if (creature_ptr->riding) {
490 power_desc[num] = _("ペットから降りる", "get off a pet");
492 power_desc[num] = _("ペットに乗る", "ride a pet");
494 powers[num++] = PET_RIDING;
495 power_desc[num] = _("ペットに名前をつける", "name pets");
496 powers[num++] = PET_NAME;
498 if (creature_ptr->riding) {
499 if ((can_attack_with_main_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_SUB)
500 && object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_MAIN_HAND]))
501 || (can_attack_with_sub_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_MAIN)
502 && object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_SUB_HAND]))) {
503 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
504 power_desc[num] = _("武器を片手で持つ", "use one hand to control the pet you are riding");
506 power_desc[num] = _("武器を両手で持つ", "use both hands for a weapon");
509 powers[num++] = PET_TWO_HANDS;
511 switch (creature_ptr->pclass) {
513 case CLASS_FORCETRAINER:
514 case CLASS_BERSERKER:
515 if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_MAIN | EMPTY_HAND_SUB)) {
516 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
517 power_desc[num] = _("片手で格闘する", "use one hand to control the pet you are riding");
519 power_desc[num] = _("両手で格闘する", "use both hands for melee");
522 powers[num++] = PET_TWO_HANDS;
523 } else if ((empty_hands(creature_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(creature_ptr, INVEN_MAIN_HAND)
524 && !has_melee_weapon(creature_ptr, INVEN_SUB_HAND)) {
525 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
526 power_desc[num] = _("格闘を行わない", "use one hand to control the pet you are riding");
528 power_desc[num] = _("格闘を行う", "use one hand for melee");
531 powers[num++] = PET_TWO_HANDS;
538 if (!(repeat_pull(&i) && (i >= 0) && (i < num))) {
544 strnfmt(out_val, 78, _("(コマンド、ESC=終了) コマンドを選んでください:", "(Command, ESC=exit) Choose command from menu."));
546 strnfmt(out_val, 78, _("(コマンド %c-%c、'*'=一覧、ESC=終了) コマンドを選んでください:", "(Command %c-%c, *=List, ESC=exit) Select a command: "),
547 I2A(0), I2A(num - 1));
550 choice = (always_show_list || use_menu) ? ESCAPE : 1;
552 /* Get a command from the user */
556 if (choice == ESCAPE)
558 else if (!get_com(out_val, &choice, TRUE))
561 if (use_menu && (choice != ' ')) {
570 menu_line += (num - 1);
604 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask)) {
606 if (!redraw || use_menu) {
608 PET_COMMAND_IDX ctr = 0;
616 for (ctr = 0; ctr < num; ctr++) {
617 /* Letter/number for power selection */
619 sprintf(buf, "%c%s ", (ctr == mode) ? '*' : ' ', (ctr == (menu_line - 1)) ? _("》", "> ") : " ");
621 sprintf(buf, "%c%c) ", (ctr == mode) ? '*' : ' ', I2A(ctr));
623 strcat(buf, power_desc[ctr]);
625 prt(buf, y + ctr, x);
628 prt("", y + MIN(ctr, 17), x);
644 ask = (isupper(choice));
648 choice = (char)tolower(choice);
650 /* Extract request */
651 i = (islower(choice) ? A2I(choice) : -1);
654 /* Totally Illegal */
655 if ((i < 0) || (i >= num)) {
663 strnfmt(buf, 78, _("%sを使いますか? ", "Use %s? "), power_desc[i]);
665 /* Belay that order */
676 /* Abort if needed */
678 free_turn(creature_ptr);
685 case PET_DISMISS: /* Dismiss pets */
687 /* Check pets (backwards) */
688 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
690 if (is_pet(&creature_ptr->current_floor_ptr->m_list[pet_ctr]))
695 msg_print(_("ペットがいない!", "You have no pets!"));
698 do_cmd_pet_dismiss(creature_ptr);
699 (void)calculate_upkeep(creature_ptr);
704 if (!target_set(creature_ptr, TARGET_KILL))
705 creature_ptr->pet_t_m_idx = 0;
707 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[target_row][target_col];
708 if (g_ptr->m_idx && (creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
709 creature_ptr->pet_t_m_idx = creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
710 creature_ptr->pet_follow_distance = PET_DESTROY_DIST;
712 creature_ptr->pet_t_m_idx = 0;
719 case PET_STAY_CLOSE: {
720 creature_ptr->pet_follow_distance = PET_CLOSE_DIST;
721 creature_ptr->pet_t_m_idx = 0;
725 case PET_FOLLOW_ME: {
726 creature_ptr->pet_follow_distance = PET_FOLLOW_DIST;
727 creature_ptr->pet_t_m_idx = 0;
730 /* "Seek and destoy" */
731 case PET_SEEK_AND_DESTROY: {
732 creature_ptr->pet_follow_distance = PET_DESTROY_DIST;
735 /* "Give me space" */
736 case PET_ALLOW_SPACE: {
737 creature_ptr->pet_follow_distance = PET_SPACE_DIST;
741 case PET_STAY_AWAY: {
742 creature_ptr->pet_follow_distance = PET_AWAY_DIST;
745 /* flag - allow pets to open doors */
746 case PET_OPEN_DOORS: {
747 if (creature_ptr->pet_extra_flags & PF_OPEN_DOORS)
748 creature_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
750 creature_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
753 /* flag - allow pets to pickup items */
754 case PET_TAKE_ITEMS: {
755 if (creature_ptr->pet_extra_flags & PF_PICKUP_ITEMS) {
756 creature_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
757 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
758 m_ptr = &creature_ptr->current_floor_ptr->m_list[pet_ctr];
761 monster_drop_carried_objects(creature_ptr, m_ptr);
765 creature_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
769 /* flag - allow pets to teleport */
771 if (creature_ptr->pet_extra_flags & PF_TELEPORT)
772 creature_ptr->pet_extra_flags &= ~(PF_TELEPORT);
774 creature_ptr->pet_extra_flags |= (PF_TELEPORT);
777 /* flag - allow pets to cast attack spell */
778 case PET_ATTACK_SPELL: {
779 if (creature_ptr->pet_extra_flags & PF_ATTACK_SPELL)
780 creature_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
782 creature_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
785 /* flag - allow pets to cast attack spell */
786 case PET_SUMMON_SPELL: {
787 if (creature_ptr->pet_extra_flags & PF_SUMMON_SPELL)
788 creature_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
790 creature_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
793 /* flag - allow pets to cast attack spell */
794 case PET_BALL_SPELL: {
795 if (creature_ptr->pet_extra_flags & PF_BALL_SPELL)
796 creature_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
798 creature_ptr->pet_extra_flags |= (PF_BALL_SPELL);
803 (void)do_cmd_riding(creature_ptr, FALSE);
808 do_name_pet(creature_ptr);
812 case PET_TWO_HANDS: {
813 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
814 creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
816 creature_ptr->pet_extra_flags |= (PF_TWO_HANDS);
817 creature_ptr->update |= (PU_BONUS);
818 handle_stuff(creature_ptr);