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/targeting.h"
23 #include "io/write-diary.h"
24 #include "main/sound-of-music.h"
25 #include "monster-floor/monster-object.h"
26 #include "monster-floor/monster-remover.h"
27 #include "monster-race/monster-race.h"
28 #include "monster-race/race-flags1.h"
29 #include "monster-race/race-flags7.h"
30 #include "monster/monster-describer.h"
31 #include "monster/monster-description-types.h"
32 #include "monster/monster-info.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.h"
43 #include "player/special-defense-types.h"
44 #include "status/action-setter.h"
45 #include "system/floor-type-definition.h"
46 #include "term/screen-processor.h"
47 #include "util/bit-flags-calculator.h"
48 #include "util/int-char-converter.h"
49 #include "util/quarks.h"
50 #include "util/sort.h"
51 #include "view/display-messages.h"
52 #include "world/world.h"
54 int total_friends = 0;
57 * @brief ペットを開放するコマンドのメインルーチン
60 void do_cmd_pet_dismiss(player_type *creature_ptr)
63 bool all_pets = FALSE;
78 /* Allocate the "who" array */
79 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
81 /* Process the monsters (backwards) */
82 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
83 if (is_pet(&creature_ptr->current_floor_ptr->m_list[pet_ctr]))
84 who[max_pet++] = pet_ctr;
87 ang_sort(creature_ptr, who, &dummy_why, max_pet, ang_sort_comp_pet_dismiss, ang_sort_swap_hook);
89 /* Process the monsters (backwards) */
90 for (i = 0; i < max_pet; i++) {
92 GAME_TEXT friend_name[MAX_NLEN];
96 m_ptr = &creature_ptr->current_floor_ptr->m_list[pet_ctr];
99 kakunin = ((pet_ctr == creature_ptr->riding) || (m_ptr->nickname));
100 monster_desc(creature_ptr, friend_name, m_ptr, MD_ASSUME_VISIBLE);
103 /* Hack -- health bar for this monster */
104 health_track(creature_ptr, pet_ctr);
105 handle_stuff(creature_ptr);
107 msg_format(_("%sを放しますか? [Yes/No/Unnamed (%d体)]", "Dismiss %s? [Yes/No/Unnamed (%d remain)]"), friend_name, max_pet - i);
110 move_cursor_relative(m_ptr->fy, m_ptr->fx);
115 if (ch == 'Y' || ch == 'y') {
119 msg_format(_("本当によろしいですか? (%s) ", "Are you sure? (%s) "), friend_name);
121 if (ch != 'Y' && ch != 'y')
127 if (ch == 'U' || ch == 'u') {
132 if (ch == ESCAPE || ch == 'N' || ch == 'n')
139 if ((all_pets && !kakunin) || (!all_pets && delete_this)) {
140 if (record_named_pet && m_ptr->nickname) {
141 GAME_TEXT m_name[MAX_NLEN];
143 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
144 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_DISMISS, m_name);
147 if (pet_ctr == creature_ptr->riding) {
148 msg_format(_("%sから降りた。", "You have got off %s. "), friend_name);
150 creature_ptr->riding = 0;
152 creature_ptr->update |= (PU_MONSTERS);
153 creature_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
156 /* HACK : Add the line to message buffer */
157 msg_format(_("%s を放した。", "Dismissed %s."), friend_name);
158 creature_ptr->update |= (PU_BONUS);
159 creature_ptr->window |= (PW_MESSAGE);
161 delete_monster_idx(creature_ptr, pet_ctr);
170 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
173 msg_format("%d 体のペットを放しました。", Dismissed);
175 msg_format("You have dismissed %d pet%s.", Dismissed, (Dismissed == 1 ? "" : "s"));
177 if (Dismissed == 0 && all_pets)
178 msg_print(_("'U'nnamed は、乗馬以外の名前のないペットだけを全て解放します。", "'U'nnamed means all your pets except named pets and your mount."));
180 handle_stuff(creature_ptr);
184 * @brief ペットから騎乗/下馬するコマンドのメインルーチン /
185 * @param force 強制的に騎乗/下馬するならばTRUE
186 * @return 騎乗/下馬できたらTRUE
188 bool do_cmd_riding(player_type *creature_ptr, bool force)
195 if (!get_direction(creature_ptr, &dir, FALSE, FALSE))
197 y = creature_ptr->y + ddy[dir];
198 x = creature_ptr->x + ddx[dir];
199 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
201 if (creature_ptr->special_defense & KATA_MUSOU)
202 set_action(creature_ptr, ACTION_NONE);
204 if (creature_ptr->riding) {
205 /* Skip non-empty grids */
206 if (!can_player_ride_pet(creature_ptr, g_ptr, FALSE)) {
207 msg_print(_("そちらには降りられません。", "You cannot go that direction."));
211 if (!pattern_seq(creature_ptr, creature_ptr->y, creature_ptr->x, y, x))
215 take_turn(creature_ptr, 100);
217 msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
219 do_cmd_attack(creature_ptr, y, x, 0);
223 creature_ptr->riding = 0;
224 creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
225 creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
227 if (cmd_limit_confused(creature_ptr))
230 m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
232 if (!g_ptr->m_idx || !m_ptr->ml) {
233 msg_print(_("その場所にはモンスターはいません。", "There is no monster here."));
236 if (!is_pet(m_ptr) && !force) {
237 msg_print(_("そのモンスターはペットではありません。", "That monster is not a pet."));
240 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING)) {
241 msg_print(_("そのモンスターには乗れなさそうだ。", "This monster doesn't seem suitable for riding."));
245 if (!pattern_seq(creature_ptr, creature_ptr->y, creature_ptr->x, y, x))
248 if (!can_player_ride_pet(creature_ptr, g_ptr, TRUE)) {
249 /* Feature code (applying "mimic" field) */
250 feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)];
252 msg_format("そのモンスターは%sの%sにいる。", f_name + f_ptr->name,
253 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
254 || (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE)))
258 msg_format("This monster is %s the %s.",
259 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
260 || (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE)))
263 f_name + f_ptr->name);
268 if (r_info[m_ptr->r_idx].level > randint1((creature_ptr->skill_exp[GINOU_RIDING] / 50 + creature_ptr->lev / 2 + 20))) {
269 msg_print(_("うまく乗れなかった。", "You failed to ride."));
270 take_turn(creature_ptr, 100);
274 if (monster_csleep_remaining(m_ptr)) {
275 GAME_TEXT m_name[MAX_NLEN];
276 monster_desc(creature_ptr, m_name, m_ptr, 0);
277 (void)set_monster_csleep(creature_ptr, g_ptr->m_idx, 0);
278 msg_format(_("%sを起こした。", "You have woken %s up."), m_name);
281 if (creature_ptr->action == ACTION_KAMAE)
282 set_action(creature_ptr, ACTION_NONE);
284 creature_ptr->riding = g_ptr->m_idx;
286 /* Hack -- remove tracked monster */
287 if (creature_ptr->riding == creature_ptr->health_who)
288 health_track(creature_ptr, 0);
291 take_turn(creature_ptr, 100);
293 /* Mega-Hack -- Forget the view and lite */
294 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
295 creature_ptr->update |= (PU_BONUS);
296 creature_ptr->redraw |= (PR_MAP | PR_EXTRA);
297 creature_ptr->redraw |= (PR_UHEALTH);
299 (void)move_player_effect(creature_ptr, y, x, MPE_HANDLE_STUFF | MPE_ENERGY_USE | MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
305 * @brief ペットに名前をつけるコマンドのメインルーチン
308 static void do_name_pet(player_type *creature_ptr)
312 GAME_TEXT m_name[MAX_NLEN];
313 bool old_name = FALSE;
314 bool old_target_pet = target_pet;
317 if (!target_set(creature_ptr, TARGET_KILL)) {
318 target_pet = old_target_pet;
322 target_pet = old_target_pet;
324 if (creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) {
325 m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
327 if (!is_pet(m_ptr)) {
328 msg_print(_("そのモンスターはペットではない。", "This monster is not a pet."));
331 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE) {
332 msg_print(_("そのモンスターの名前は変えられない!", "You cannot change name of this monster!"));
335 monster_desc(creature_ptr, m_name, m_ptr, 0);
337 msg_format(_("%sに名前をつける。", "Name %s."), m_name);
340 /* Start with nothing */
343 /* Use old inscription */
344 if (m_ptr->nickname) {
345 /* Start with the old inscription */
346 strcpy(out_val, quark_str(m_ptr->nickname));
350 /* Get a new inscription (possibly empty) */
351 if (get_string(_("名前: ", "Name: "), out_val, 15)) {
353 /* Save the inscription */
354 m_ptr->nickname = quark_add(out_val);
355 if (record_named_pet) {
356 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
357 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_NAME, m_name);
360 if (record_named_pet && old_name) {
361 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
362 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_UNNAME, m_name);
371 * @brief ペットに関するコマンドリストのメインルーチン /
372 * Issue a pet command
375 void do_cmd_pet(player_type *creature_ptr)
380 concptr power_desc[36];
387 PET_COMMAND_IDX mode = 0;
390 char target_buf[160];
392 int menu_line = use_menu ? 1 : 0;
396 if (creature_ptr->wild_mode)
399 power_desc[num] = _("ペットを放す", "dismiss pets");
400 powers[num++] = PET_DISMISS;
403 sprintf(target_buf, "ペットのターゲットを指定 (現在:%s)",
404 (creature_ptr->pet_t_m_idx
405 ? (creature_ptr->image ? "何か奇妙な物" : (r_name + r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name))
408 sprintf(target_buf, "specify a target of pet (now:%s)",
409 (creature_ptr->pet_t_m_idx ? (
410 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))
413 power_desc[num] = target_buf;
414 powers[num++] = PET_TARGET;
415 power_desc[num] = _("近くにいろ", "stay close");
417 if (creature_ptr->pet_follow_distance == PET_CLOSE_DIST)
419 powers[num++] = PET_STAY_CLOSE;
420 power_desc[num] = _("ついて来い", "follow me");
422 if (creature_ptr->pet_follow_distance == PET_FOLLOW_DIST)
424 powers[num++] = PET_FOLLOW_ME;
425 power_desc[num] = _("敵を見つけて倒せ", "seek and destroy");
427 if (creature_ptr->pet_follow_distance == PET_DESTROY_DIST)
429 powers[num++] = PET_SEEK_AND_DESTROY;
430 power_desc[num] = _("少し離れていろ", "give me space");
432 if (creature_ptr->pet_follow_distance == PET_SPACE_DIST)
434 powers[num++] = PET_ALLOW_SPACE;
435 power_desc[num] = _("離れていろ", "stay away");
437 if (creature_ptr->pet_follow_distance == PET_AWAY_DIST)
439 powers[num++] = PET_STAY_AWAY;
441 if (creature_ptr->pet_extra_flags & PF_OPEN_DOORS) {
442 power_desc[num] = _("ドアを開ける (現在:ON)", "pets open doors (now On)");
444 power_desc[num] = _("ドアを開ける (現在:OFF)", "pets open doors (now Off)");
446 powers[num++] = PET_OPEN_DOORS;
448 if (creature_ptr->pet_extra_flags & PF_PICKUP_ITEMS) {
449 power_desc[num] = _("アイテムを拾う (現在:ON)", "pets pick up items (now On)");
451 power_desc[num] = _("アイテムを拾う (現在:OFF)", "pets pick up items (now Off)");
453 powers[num++] = PET_TAKE_ITEMS;
455 if (creature_ptr->pet_extra_flags & PF_TELEPORT) {
456 power_desc[num] = _("テレポート系魔法を使う (現在:ON)", "allow teleport (now On)");
458 power_desc[num] = _("テレポート系魔法を使う (現在:OFF)", "allow teleport (now Off)");
460 powers[num++] = PET_TELEPORT;
462 if (creature_ptr->pet_extra_flags & PF_ATTACK_SPELL) {
463 power_desc[num] = _("攻撃魔法を使う (現在:ON)", "allow cast attack spell (now On)");
465 power_desc[num] = _("攻撃魔法を使う (現在:OFF)", "allow cast attack spell (now Off)");
467 powers[num++] = PET_ATTACK_SPELL;
469 if (creature_ptr->pet_extra_flags & PF_SUMMON_SPELL) {
470 power_desc[num] = _("召喚魔法を使う (現在:ON)", "allow cast summon spell (now On)");
472 power_desc[num] = _("召喚魔法を使う (現在:OFF)", "allow cast summon spell (now Off)");
474 powers[num++] = PET_SUMMON_SPELL;
476 if (creature_ptr->pet_extra_flags & PF_BALL_SPELL) {
477 power_desc[num] = _("プレイヤーを巻き込む範囲魔法を使う (現在:ON)", "allow involve player in area spell (now On)");
479 power_desc[num] = _("プレイヤーを巻き込む範囲魔法を使う (現在:OFF)", "allow involve player in area spell (now Off)");
481 powers[num++] = PET_BALL_SPELL;
483 if (creature_ptr->riding) {
484 power_desc[num] = _("ペットから降りる", "get off a pet");
486 power_desc[num] = _("ペットに乗る", "ride a pet");
488 powers[num++] = PET_RIDING;
489 power_desc[num] = _("ペットに名前をつける", "name pets");
490 powers[num++] = PET_NAME;
492 if (creature_ptr->riding) {
493 if ((creature_ptr->right_hand_weapon && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM)
494 && object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_RARM]))
495 || (creature_ptr->left_hand_weapon && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM)
496 && object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_LARM]))) {
497 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
498 power_desc[num] = _("武器を片手で持つ", "use one hand to control the pet you are riding");
500 power_desc[num] = _("武器を両手で持つ", "use both hands for a weapon");
503 powers[num++] = PET_TWO_HANDS;
505 switch (creature_ptr->pclass) {
507 case CLASS_FORCETRAINER:
508 case CLASS_BERSERKER:
509 if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) {
510 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
511 power_desc[num] = _("片手で格闘する", "use one hand to control the pet you are riding");
513 power_desc[num] = _("両手で格闘する", "use both hands for melee");
516 powers[num++] = PET_TWO_HANDS;
517 } else if ((empty_hands(creature_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(creature_ptr, INVEN_RARM)
518 && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
519 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
520 power_desc[num] = _("格闘を行わない", "use one hand to control the pet you are riding");
522 power_desc[num] = _("格闘を行う", "use one hand for melee");
525 powers[num++] = PET_TWO_HANDS;
532 if (!(repeat_pull(&i) && (i >= 0) && (i < num))) {
538 strnfmt(out_val, 78, _("(コマンド、ESC=終了) コマンドを選んでください:", "(Command, ESC=exit) Choose command from menu."));
540 strnfmt(out_val, 78, _("(コマンド %c-%c、'*'=一覧、ESC=終了) コマンドを選んでください:", "(Command %c-%c, *=List, ESC=exit) Select a command: "),
541 I2A(0), I2A(num - 1));
544 choice = (always_show_list || use_menu) ? ESCAPE : 1;
546 /* Get a command from the user */
550 if (choice == ESCAPE)
552 else if (!get_com(out_val, &choice, TRUE))
555 if (use_menu && (choice != ' ')) {
564 menu_line += (num - 1);
598 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask)) {
600 if (!redraw || use_menu) {
602 PET_COMMAND_IDX ctr = 0;
610 for (ctr = 0; ctr < num; ctr++) {
611 /* Letter/number for power selection */
613 sprintf(buf, "%c%s ", (ctr == mode) ? '*' : ' ', (ctr == (menu_line - 1)) ? _("》", "> ") : " ");
615 sprintf(buf, "%c%c) ", (ctr == mode) ? '*' : ' ', I2A(ctr));
617 strcat(buf, power_desc[ctr]);
619 prt(buf, y + ctr, x);
622 prt("", y + MIN(ctr, 17), x);
638 ask = (isupper(choice));
642 choice = (char)tolower(choice);
644 /* Extract request */
645 i = (islower(choice) ? A2I(choice) : -1);
648 /* Totally Illegal */
649 if ((i < 0) || (i >= num)) {
657 strnfmt(buf, 78, _("%sを使いますか? ", "Use %s? "), power_desc[i]);
659 /* Belay that order */
670 /* Abort if needed */
672 free_turn(creature_ptr);
679 case PET_DISMISS: /* Dismiss pets */
681 /* Check pets (backwards) */
682 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
684 if (is_pet(&creature_ptr->current_floor_ptr->m_list[pet_ctr]))
689 msg_print(_("ペットがいない!", "You have no pets!"));
692 do_cmd_pet_dismiss(creature_ptr);
693 (void)calculate_upkeep(creature_ptr);
698 if (!target_set(creature_ptr, TARGET_KILL))
699 creature_ptr->pet_t_m_idx = 0;
701 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[target_row][target_col];
702 if (g_ptr->m_idx && (creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
703 creature_ptr->pet_t_m_idx = creature_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
704 creature_ptr->pet_follow_distance = PET_DESTROY_DIST;
706 creature_ptr->pet_t_m_idx = 0;
713 case PET_STAY_CLOSE: {
714 creature_ptr->pet_follow_distance = PET_CLOSE_DIST;
715 creature_ptr->pet_t_m_idx = 0;
719 case PET_FOLLOW_ME: {
720 creature_ptr->pet_follow_distance = PET_FOLLOW_DIST;
721 creature_ptr->pet_t_m_idx = 0;
724 /* "Seek and destoy" */
725 case PET_SEEK_AND_DESTROY: {
726 creature_ptr->pet_follow_distance = PET_DESTROY_DIST;
729 /* "Give me space" */
730 case PET_ALLOW_SPACE: {
731 creature_ptr->pet_follow_distance = PET_SPACE_DIST;
735 case PET_STAY_AWAY: {
736 creature_ptr->pet_follow_distance = PET_AWAY_DIST;
739 /* flag - allow pets to open doors */
740 case PET_OPEN_DOORS: {
741 if (creature_ptr->pet_extra_flags & PF_OPEN_DOORS)
742 creature_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
744 creature_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
747 /* flag - allow pets to pickup items */
748 case PET_TAKE_ITEMS: {
749 if (creature_ptr->pet_extra_flags & PF_PICKUP_ITEMS) {
750 creature_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
751 for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--) {
752 m_ptr = &creature_ptr->current_floor_ptr->m_list[pet_ctr];
755 monster_drop_carried_objects(creature_ptr, m_ptr);
759 creature_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
763 /* flag - allow pets to teleport */
765 if (creature_ptr->pet_extra_flags & PF_TELEPORT)
766 creature_ptr->pet_extra_flags &= ~(PF_TELEPORT);
768 creature_ptr->pet_extra_flags |= (PF_TELEPORT);
771 /* flag - allow pets to cast attack spell */
772 case PET_ATTACK_SPELL: {
773 if (creature_ptr->pet_extra_flags & PF_ATTACK_SPELL)
774 creature_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
776 creature_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
779 /* flag - allow pets to cast attack spell */
780 case PET_SUMMON_SPELL: {
781 if (creature_ptr->pet_extra_flags & PF_SUMMON_SPELL)
782 creature_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
784 creature_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
787 /* flag - allow pets to cast attack spell */
788 case PET_BALL_SPELL: {
789 if (creature_ptr->pet_extra_flags & PF_BALL_SPELL)
790 creature_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
792 creature_ptr->pet_extra_flags |= (PF_BALL_SPELL);
797 (void)do_cmd_riding(creature_ptr, FALSE);
802 do_name_pet(creature_ptr);
806 case PET_TWO_HANDS: {
807 if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
808 creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
810 creature_ptr->pet_extra_flags |= (PF_TWO_HANDS);
811 creature_ptr->update |= (PU_BONUS);
812 handle_stuff(creature_ptr);