OSDN Git Service

Leon氏の勧めに従って、Vanillaのコードと同様に各ソースファイルの頭の
[hengband/hengband.git] / src / cmd5.c
index d482f40..860ff9f 100644 (file)
@@ -1,15 +1,15 @@
 /* File: cmd5.c */
 
-/* Purpose: Spell/Prayer commands */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: Spell/Prayer commands */
+
 #include "angband.h"
 
 #include "spellstips.h"
@@ -51,7 +51,6 @@ cptr spell_categoly_name(int tval)
  * The "known" should be TRUE for cast/pray, FALSE for study
  */
 
-bool select_spellbook=FALSE;
 bool select_the_force=FALSE;
 
 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
@@ -433,15 +432,12 @@ s = "
        s = "You have no books that you can read.";
 #endif
 
-       select_spellbook=TRUE;
        if (p_ptr->pclass == CLASS_FORCETRAINER)
                select_the_force = TRUE;
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
-           select_spellbook = FALSE;
            select_the_force = FALSE;
            return;
        }
-       select_spellbook = FALSE;
        select_the_force = FALSE;
 
        if (item == 1111) { /* the_force */
@@ -549,7 +545,7 @@ s = "
                        s_ptr = &mp_ptr->info[use_realm - 1][spell];
                }
 
-               roff_to_buf( spell_tips[technic2magic(use_realm)-1][spell] ,62,temp);
+               roff_to_buf(spell_tips[technic2magic(use_realm)-1][spell] ,62, temp, sizeof(temp));
                for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
                {
                        prt(&temp[j], line, 15);
@@ -698,9 +694,7 @@ s = "
        s = "You have no books that you can read.";
 #endif
 
-       select_spellbook=TRUE;
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-       select_spellbook=FALSE;
 
        /* Get the item (in the pack) */
        if (item >= 0)
@@ -1152,7 +1146,7 @@ static bool cast_life_spell(int spell)
                (void)mass_genocide_undead(plev+50,TRUE);
                break;
        case 27: /* Clairvoyance */
-               wiz_lite(FALSE, FALSE);
+               wiz_lite(FALSE);
                break;
        case 28: /* Restoration */
                (void)do_res_stat(A_STR);
@@ -1312,7 +1306,7 @@ msg_print("
                chg_virtue(V_KNOWLEDGE, 1);
                chg_virtue(V_ENLIGHTEN, 1);
 
-               wiz_lite(FALSE, FALSE);
+               wiz_lite(FALSE);
                if (!(p_ptr->telepathy))
                {
                        (void)set_tim_esp(randint1(30) + 25, FALSE);
@@ -1534,7 +1528,7 @@ msg_print("
                fire_ball(GF_LITE, 0, 150, 8);
                chg_virtue(V_KNOWLEDGE, 1);
                chg_virtue(V_ENLIGHTEN, 1);
-               wiz_lite(FALSE, FALSE);
+               wiz_lite(FALSE);
                if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
                {
 #ifdef JP
@@ -1713,7 +1707,7 @@ msg_print("
                        }
                        else if (die < 106)
                        {
-                               destroy_area(py, px, 13+randint0(5), TRUE);
+                               destroy_area(py, px, 13+randint0(5));
                        }
                        else if (die < 108)
                        {
@@ -1762,7 +1756,7 @@ msg_print("
                (void)fire_beam(GF_AWAY_ALL, dir, plev);
                break;
        case 14: /* Word of Destruction */
-               destroy_area(py, px, 13+randint0(5), TRUE);
+               destroy_area(py, px, 13+randint0(5));
                break;
        case 15: /* Invoke Logrus */
                if (!get_aim_dir(&dir)) return FALSE;
@@ -2174,7 +2168,7 @@ msg_print("
                        }
                        else if (die < 106)
                        {
-                               destroy_area(py, px, 13+randint0(5), TRUE);
+                               destroy_area(py, px, 13+randint0(5));
                        }
                        else if (die < 108)
                        {
@@ -2661,7 +2655,7 @@ msg_print("
 
                                        chg_virtue(V_KNOWLEDGE, 1);
                                        chg_virtue(V_ENLIGHTEN, 1);
-                                       wiz_lite(FALSE, FALSE);
+                                       wiz_lite(FALSE);
                                }
                                else
                                {
@@ -3455,7 +3449,7 @@ msg_print("
        case 31: /* Clairvoyance */
                chg_virtue(V_KNOWLEDGE, 1);
                chg_virtue(V_ENLIGHTEN, 1);
-               wiz_lite(FALSE, FALSE);
+               wiz_lite(FALSE);
                if (!p_ptr->telepathy)
                {
                        (void)set_tim_esp(randint1(30) + 25, FALSE);
@@ -4126,7 +4120,7 @@ msg_print("
                }
                break;
        case 27: /* Word of Destruction */
-               destroy_area(py, px, 13+randint0(5), TRUE);
+               destroy_area(py, px, 13+randint0(5));
                break;
        case 28: /* Eye for an Eye */
                set_tim_eyeeye(randint1(10)+10, FALSE);
@@ -4783,15 +4777,12 @@ s = "
        s = "You have no spell books!";
 #endif
 
-       select_spellbook=TRUE;
        if (p_ptr->pclass == CLASS_FORCETRAINER)
                select_the_force = TRUE;
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
-           select_spellbook = FALSE;
            select_the_force = FALSE;
            return;
        }
-       select_spellbook = FALSE;
        select_the_force = FALSE;
 
        if (item == 1111) { /* the_force */
@@ -5253,6 +5244,9 @@ static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
        monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
        monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
 
+       /* Unused */
+       (void)v;
+
        if (w1 == p_ptr->riding) return TRUE;
        if (w2 == p_ptr->riding) return FALSE;
 
@@ -5684,7 +5678,7 @@ msg_print("
 #ifdef JP
 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
 #else
-                       msg_print("That monster is no a pet.");
+                       msg_print("That monster is not a pet.");
 #endif
 
                        return FALSE;