OSDN Git Service

魔道具術師は「杖」を吸収できないようにする為のHackの副作用で「杖」に
[hengband/hengband.git] / src / spells3.c
index f95857e..ae1c9c2 100644 (file)
@@ -521,6 +521,8 @@ msg_print("
  */
 void teleport_player_level(void)
 {
+       bool go_up;
+
        /* No effect in arena or quest */
        if (p_ptr->inside_arena || (p_ptr->inside_quest && !random_quest_number(dun_level)) ||
            (quest_number(dun_level) && (dun_level > 1) && ironman_downward))
@@ -545,6 +547,17 @@ msg_print("
                return;
        }
 
+       /* Choose up or down */
+       if (randint0(100) < 50) go_up = TRUE;
+       else go_up = FALSE;
+
+       if (p_ptr->wizard)
+       {
+               if (get_check("Force to go up? ")) go_up = TRUE;
+               else if (get_check("Force to go down? ")) go_up = FALSE;
+       }
+
+       /* Down only */ 
        if (ironman_downward || (dun_level <= d_info[dungeon_type].mindepth))
        {
 #ifdef JP
@@ -566,15 +579,18 @@ msg_print("
                if (!dun_level)
                {
                        dun_level = d_info[dungeon_type].mindepth;
+                       prepare_change_floor_mode(CFM_RAND_PLACE | CFM_CLEAR_ALL);
                }
                else
                {
-                       dun_level++;
+                       prepare_change_floor_mode(CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
                }
 
                /* Leaving */
                p_ptr->leaving = TRUE;
        }
+
+       /* Up only */
        else if (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth))
        {
 #ifdef JP
@@ -588,9 +604,7 @@ msg_print("
 
                if (autosave_l) do_cmd_save_game(TRUE);
 
-               dun_level--;
-
-               if (!dun_level) dungeon_type = 0;
+               prepare_change_floor_mode(CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
 
                leave_quest_check();
 
@@ -598,7 +612,7 @@ msg_print("
                p_ptr->inside_quest = 0;
                p_ptr->leaving = TRUE;
        }
-       else if (randint0(100) < 50)
+       else if (go_up)
        {
 #ifdef JP
 msg_print("¤¢¤Ê¤¿¤ÏÅ·°æ¤òÆͤ­ÇˤäÆÃè¤ØÉ⤤¤Æ¤¤¤¯¡£");
@@ -611,9 +625,7 @@ msg_print("
 
                if (autosave_l) do_cmd_save_game(TRUE);
 
-               dun_level--;
-
-               if (!dun_level) dungeon_type = 0;
+               prepare_change_floor_mode(CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
 
                /* Leaving */
                p_ptr->leaving = TRUE;
@@ -626,28 +638,19 @@ msg_print("
                msg_print("You sink through the floor.");
 #endif
 
-               if (!dun_level) dungeon_type = p_ptr->recall_dungeon;
+               /* Never reach this code on the surface */
+               /* if (!dun_level) dungeon_type = p_ptr->recall_dungeon; */
 
                if (record_stair) do_cmd_write_nikki(NIKKI_TELE_LEV, 1, NULL);
 
                if (autosave_l) do_cmd_save_game(TRUE);
 
-               dun_level++;
+               prepare_change_floor_mode(CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
 
                /* Leaving */
                p_ptr->leaving = TRUE;
        }
 
-       if (!dun_level && dungeon_type)
-       {
-               p_ptr->leaving_dungeon = TRUE;
-               p_ptr->wilderness_y = d_info[dungeon_type].dy;
-               p_ptr->wilderness_x = d_info[dungeon_type].dx;
-               p_ptr->recall_dungeon = dungeon_type;
-       }
-
-       if (!dun_level) dungeon_type = 0;
-
        /* Sound */
        sound(SOUND_TPLEVEL);
 }
@@ -1241,7 +1244,7 @@ act = "
 #ifdef JP
 act = "¤Ï¿Í´Ö¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for human!";
+                       act = "seems to be looking for humans!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_HUMAN;
@@ -1250,7 +1253,7 @@ act = "
 #ifdef JP
 act = "¤ÏÅÅ·â¤Ëʤ¤ï¤ì¤¿¡ª";
 #else
-                       act = "coverd with lightning!";
+                       act = "covered with lightning!";
 #endif
 
                        o_ptr->name2 = EGO_BRAND_ELEC;
@@ -1268,7 +1271,7 @@ act = "
 #ifdef JP
 act = "¤Ï¼Ù°­¤Ê¤ë²øʪ¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for evil monster!";
+                       act = "seems to be looking for evil monsters!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_EVIL;
@@ -1277,7 +1280,7 @@ act = "
 #ifdef JP
 act = "¤Ï°ÛÀ¤³¦¤Î½»¿Í¤ÎÆùÂΤòµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for demon!";
+                       act = "seems to be looking for demons!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_DEMON;
@@ -1286,7 +1289,7 @@ act = "
 #ifdef JP
 act = "¤Ï»Ó¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for undead!";
+                       act = "seems to be looking for undead!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_UNDEAD;
@@ -1295,7 +1298,7 @@ act = "
 #ifdef JP
 act = "¤Ïưʪ¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for animal!";
+                       act = "seems to be looking for animals!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_ANIMAL;
@@ -1304,7 +1307,7 @@ act = "
 #ifdef JP
 act = "¤Ï¥É¥é¥´¥ó¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for dragon!";
+                       act = "seems to be looking for dragons!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_DRAGON;
@@ -1313,7 +1316,7 @@ act = "
 #ifdef JP
 act = "¤Ï¥È¥í¥ë¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for troll!";
+                       act = "seems to be looking for troll!s";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_TROLL;
@@ -1322,7 +1325,7 @@ act = "
 #ifdef JP
 act = "¤Ï¥ª¡¼¥¯¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for orc!";
+                       act = "seems to be looking for orcs!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_ORC;
@@ -1331,7 +1334,7 @@ act = "
 #ifdef JP
 act = "¤Ïµð¿Í¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
 #else
-                       act = "seems looking for giant!";
+                       act = "seems to be looking for giants!";
 #endif
 
                        o_ptr->name2 = EGO_SLAY_GIANT;
@@ -1621,29 +1624,42 @@ msg_format("%^s
 
 void alter_reality(void)
 {
-       if (!quest_number(dun_level) && dun_level)
+       /* Ironman option */
+       if (p_ptr->inside_arena || ironman_downward)
        {
 #ifdef JP
-msg_print("À¤³¦¤¬ÊѤï¤Ã¤¿¡ª");
+               msg_print("²¿¤âµ¯¤³¤é¤Ê¤«¤Ã¤¿¡£");
 #else
-               msg_print("The world changes!");
+               msg_print("Nothing happens.");
 #endif
+               return;
+       }
 
+       if (!p_ptr->alter_reality)
+       {
+               int turns = randint0(21) + 15;
 
-               if (autosave_l) do_cmd_save_game(TRUE);
+               p_ptr->alter_reality = turns;
+#ifdef JP
+               msg_print("²ó¤ê¤Î·Ê¿§¤¬ÊѤï¤ê»Ï¤á¤¿...");
+#else
+               msg_print("The view around you begins to change...");
+#endif
 
-               /* Leaving */
-               p_ptr->leaving = TRUE;
+               p_ptr->redraw |= (PR_STATUS);
        }
        else
        {
+               p_ptr->alter_reality = 0;
 #ifdef JP
-msg_print("À¤³¦¤¬¾¯¤·¤Î´ÖÊѲ½¤·¤¿¤è¤¦¤À¡£");
+               msg_print("·Ê¿§¤¬¸µ¤ËÌá¤Ã¤¿...");
 #else
-               msg_print("The world seems to change for a moment!");
+               msg_print("The view around you got back...");
 #endif
 
+               p_ptr->redraw |= (PR_STATUS);
        }
+       return;
 }
 
 
@@ -1995,57 +2011,6 @@ msg_format("%s
 }
 
 
-/*
- * Create stairs at the player location
- */
-void stair_creation(void)
-{
-       /* XXX XXX XXX */
-       if (!cave_valid_bold(py, px))
-       {
-#ifdef JP
-msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");
-#else
-               msg_print("The object resists the spell.");
-#endif
-
-               return;
-       }
-
-       /* XXX XXX XXX */
-       delete_object(py, px);
-
-       /* Create a staircase */
-       if (p_ptr->inside_arena || (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) || p_ptr->inside_battle || !dun_level)
-       {
-               /* arena or quest */
-#ifdef JP
-msg_print("¸ú²Ì¤¬¤¢¤ê¤Þ¤»¤ó¡ª");
-#else
-               msg_print("There is no effect!");
-#endif
-
-       }
-       else if (ironman_downward)
-       {
-               /* Town/wilderness or Ironman */
-               cave_set_feat(py, px, FEAT_MORE);
-       }
-       else if (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth))
-       {
-               /* Quest level */
-               cave_set_feat(py, px, FEAT_LESS);
-       }
-       else if (randint0(100) < 50)
-       {
-               cave_set_feat(py, px, FEAT_MORE);
-       }
-       else
-       {
-               cave_set_feat(py, px, FEAT_LESS);
-       }
-}
-
 
 /*
  * Hook to specify "weapon"
@@ -2895,7 +2860,7 @@ s = "
        }
 
        /* Describe it fully */
-       (void)identify_fully_aux(o_ptr);
+       (void)screen_object(o_ptr, TRUE);
 
        /* Auto-inscription/destroy */
        idx = is_autopick(o_ptr);
@@ -5903,8 +5868,8 @@ msg_format("
 #endif
 
                                        /* Reduce rod stack maximum timeout, drain wands. */
-                                       if (o_ptr->tval == TV_ROD) o_ptr->timeout -= k_ptr->pval;
-                                       if (o_ptr->tval == TV_WAND) o_ptr->pval = o_ptr->pval * (o_ptr->number - 1) / o_ptr->number;
+                                       if (o_ptr->tval == TV_ROD) o_ptr->timeout = MIN(o_ptr->timeout, k_ptr->pval * (o_ptr->number - 1));
+                                       else if (o_ptr->tval == TV_WAND) o_ptr->pval = o_ptr->pval * (o_ptr->number - 1) / o_ptr->number;
 
                                }
                                else