OSDN Git Service

[Refactor] #38862 Moved object*.c/h to object/
[hengband/hengband.git] / src / cmd / cmd-zaprod.c
index 80a1d9f..2379df6 100644 (file)
@@ -1,20 +1,23 @@
 #include "angband.h"
 #include "util.h"
+#include "main/sound-definitions-table.h"
 
 #include "avatar.h"
 #include "player-status.h"
 #include "player-effects.h"
 #include "player-class.h"
 #include "player-inventory.h"
-#include "objectkind.h"
-#include "object-hook.h"
-#include "spells.h"
+#include "object/object-kind.h"
+#include "object/object-hook.h"
+#include "spell/spells-type.h"
 #include "spells-status.h"
 #include "spells-floor.h"
 #include "cmd-basic.h"
-#include "floor.h"
+#include "floor/floor.h"
 #include "targeting.h"
-#include "view-mainwindow.h"
+#include "view/display-main-window.h"
+#include "spell/spells2.h"
+#include "spell/spells3.h"
 
 /*!
  * @brief ロッドの効果を発動する
@@ -55,10 +58,10 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        case SV_ROD_IDENTIFY:
        {
                if (powerful) {
-                       if (!identify_fully(FALSE)) *use_charge = FALSE;
+                       if (!identify_fully(creature_ptr, FALSE, 0)) *use_charge = FALSE;
                }
                else {
-                       if (!ident_spell(creature_ptr, FALSE)) *use_charge = FALSE;
+                       if (!ident_spell(creature_ptr, FALSE, 0)) *use_charge = FALSE;
                }
                ident = TRUE;
                break;
@@ -73,7 +76,7 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
 
        case SV_ROD_ILLUMINATION:
        {
-               if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
+               if (lite_area(creature_ptr, damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
                break;
        }
 
@@ -126,21 +129,21 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
 
        case SV_ROD_PESTICIDE:
        {
-               if (dispel_monsters(powerful ? 8 : 4)) ident = TRUE;
+               if (dispel_monsters(creature_ptr, powerful ? 8 : 4)) ident = TRUE;
                break;
        }
 
        case SV_ROD_TELEPORT_AWAY:
        {
                int distance = MAX_SIGHT * (powerful ? 8 : 5);
-               if (teleport_monster(dir, distance)) ident = TRUE;
+               if (teleport_monster(creature_ptr, dir, distance)) ident = TRUE;
                break;
        }
 
        case SV_ROD_DISARMING:
        {
-               if (disarm_trap(dir)) ident = TRUE;
-               if (powerful && disarm_traps_touch()) ident = TRUE;
+               if (disarm_trap(creature_ptr, dir)) ident = TRUE;
+               if (powerful && disarm_traps_touch(creature_ptr)) ident = TRUE;
                break;
        }
 
@@ -148,59 +151,59 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        {
                HIT_POINT dam = damroll((powerful ? 12 : 6), 8);
                msg_print(_("青く輝く光線が放たれた。", "A line of blue shimmering light appears."));
-               (void)lite_line(dir, dam);
+               (void)lite_line(creature_ptr, dir, dam);
                ident = TRUE;
                break;
        }
 
        case SV_ROD_SLEEP_MONSTER:
        {
-               if (sleep_monster(dir, lev)) ident = TRUE;
+               if (sleep_monster(creature_ptr, dir, lev)) ident = TRUE;
                break;
        }
 
        case SV_ROD_SLOW_MONSTER:
        {
-               if (slow_monster(dir, lev)) ident = TRUE;
+               if (slow_monster(creature_ptr, dir, lev)) ident = TRUE;
                break;
        }
 
        case SV_ROD_HYPODYNAMIA:
        {
-               if (hypodynamic_bolt(dir, 70 + 3 * lev / 2)) ident = TRUE;
+               if (hypodynamic_bolt(creature_ptr, dir, 70 + 3 * lev / 2)) ident = TRUE;
                break;
        }
 
        case SV_ROD_POLYMORPH:
        {
-               if (poly_monster(dir, lev)) ident = TRUE;
+               if (poly_monster(creature_ptr, dir, lev)) ident = TRUE;
                break;
        }
 
        case SV_ROD_ACID_BOLT:
        {
-               fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + lev / 7, 8));
+               fire_bolt_or_beam(creature_ptr, 10, GF_ACID, dir, damroll(6 + lev / 7, 8));
                ident = TRUE;
                break;
        }
 
        case SV_ROD_ELEC_BOLT:
        {
-               fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + lev / 9, 8));
+               fire_bolt_or_beam(creature_ptr, 10, GF_ELEC, dir, damroll(4 + lev / 9, 8));
                ident = TRUE;
                break;
        }
 
        case SV_ROD_FIRE_BOLT:
        {
-               fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + lev / 6, 8));
+               fire_bolt_or_beam(creature_ptr, 10, GF_FIRE, dir, damroll(7 + lev / 6, 8));
                ident = TRUE;
                break;
        }
 
        case SV_ROD_COLD_BOLT:
        {
-               fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + lev / 8, 8));
+               fire_bolt_or_beam(creature_ptr, 10, GF_COLD, dir, damroll(5 + lev / 8, 8));
                ident = TRUE;
                break;
        }
@@ -243,13 +246,13 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        case SV_ROD_STONE_TO_MUD:
        {
                HIT_POINT dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
-               if (wall_to_mud(dir, dam)) ident = TRUE;
+               if (wall_to_mud(creature_ptr, dir, dam)) ident = TRUE;
                break;
        }
 
        case SV_ROD_AGGRAVATE:
        {
-               aggravate_monsters(0);
+               aggravate_monsters(creature_ptr, 0);
                ident = TRUE;
                break;
        }
@@ -257,9 +260,11 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        return ident;
 }
 
+
 /*!
 * @brief ロッドを使うコマンドのサブルーチン /
 * Activate (zap) a Rod
+* @param creature_ptr プレーヤーへの参照ポインタ
 * @param item 使うオブジェクトの所持品ID
 * @return なし
 * @details
@@ -297,7 +302,7 @@ void exe_zap_rod(player_type *creature_ptr, INVENTORY_IDX item)
                !object_is_aware(o_ptr))
        {
                /* Get a direction, allow cancel */
-               if (!get_aim_dir(&dir)) return;
+               if (!get_aim_dir(creature_ptr, &dir)) return;
        }
 
 
@@ -378,15 +383,17 @@ void exe_zap_rod(player_type *creature_ptr, INVENTORY_IDX item)
        /* Successfully determined the object function */
        if (ident && !object_is_aware(o_ptr))
        {
-               object_aware(o_ptr);
+               object_aware(creature_ptr, o_ptr);
                gain_exp(creature_ptr, (lev + (creature_ptr->lev >> 1)) / creature_ptr->lev);
        }
 
        creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 }
 
+
 /*!
 * @brief ロッドを使うコマンドのメインルーチン /
+* @param creature_ptr プレーヤーへの参照ポインタ
 * @return なし
 */
 void do_cmd_zap_rod(player_type *creature_ptr)