OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / spells2.c
index 7d8e3e5..b4a628d 100644 (file)
@@ -4993,12 +4993,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue)
        (void)set_image(0);
        (void)set_stun(0);
        (void)set_cut(0);
-       (void)do_res_stat(A_STR);
-       (void)do_res_stat(A_CON);
-       (void)do_res_stat(A_DEX);
-       (void)do_res_stat(A_WIS);
-       (void)do_res_stat(A_INT);
-       (void)do_res_stat(A_CHR);
+       (void)restore_all_status();
        (void)set_shero(0, TRUE);
        update_stuff();
        hp_player(5000);
@@ -5015,6 +5010,15 @@ bool_hack heroism(int base)
        return ident;
 }
 
+bool_hack berserk(int base)
+{
+       bool_hack ident = FALSE;
+       if (set_afraid(0)) ident = TRUE;
+       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(30)) ident = TRUE;
+       return ident;
+}
+
 bool_hack cure_light_wounds(int dice, int sides)
 {
        bool_hack ident = FALSE;
@@ -5049,6 +5053,19 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
        return ident;
 }
 
+bool_hack true_healing(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_image(0)) ident = TRUE;
+       return ident;
+}
+
 bool_hack restore_mana(bool_hack magic_eater)
 {
        bool_hack ident = FALSE;
@@ -5083,4 +5100,104 @@ bool_hack restore_mana(bool_hack magic_eater)
        }
 
        return ident;
+}
+
+bool restore_all_status(void)
+{
+       bool ident = FALSE; 
+       if (do_res_stat(A_STR)) ident = TRUE;
+       if (do_res_stat(A_INT)) ident = TRUE;
+       if (do_res_stat(A_WIS)) ident = TRUE;
+       if (do_res_stat(A_DEX)) ident = TRUE;
+       if (do_res_stat(A_CON)) ident = TRUE;
+       if (do_res_stat(A_CHR)) ident = TRUE;
+       return ident;
+}
+
+/*!
+ * @brief 口を使う継続的な処理を中断する
+ * @return なし
+ */
+void stop_mouth(void)
+{
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
+bool_hack vampirism(void)
+{
+       DIRECTION dir;
+       int x, y, dummy;
+       cave_type *c_ptr;
+
+       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       {
+               msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
+               return FALSE;
+       }
+
+       /* Only works on adjacent monsters */
+       if (!get_rep_dir2(&dir)) return FALSE;
+       y = p_ptr->y + ddy[dir];
+       x = p_ptr->x + ddx[dir];
+       c_ptr = &cave[y][x];
+
+       stop_mouth();
+
+       if (!(c_ptr->m_idx))
+       {
+               msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
+               return FALSE;
+       }
+
+       msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
+
+       dummy = p_ptr->lev * 2;
+
+       if (hypodynamic_bolt(dir, dummy))
+       {
+               if (p_ptr->food < PY_FOOD_FULL)
+                       /* No heal if we are "full" */
+                       (void)hp_player(dummy);
+               else
+                       msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
+
+               /* Gain nutritional sustenance: 150/hp drained */
+               /* A Food ration gives 5000 food points (by contrast) */
+               /* Don't ever get more than "Full" this way */
+               /* But if we ARE Gorged,  it won't cure us */
+               dummy = p_ptr->food + MIN(5000, 100 * dummy);
+               if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
+                       (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
+       }
+       else
+               msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
+       return TRUE;
+}
+
+bool panic_hit(void)
+{
+       DIRECTION dir;
+       POSITION x, y;
+
+       if (!get_rep_dir2(&dir)) return FALSE;
+       y = p_ptr->y + ddy[dir];
+       x = p_ptr->x + ddx[dir];
+       if (cave[y][x].m_idx)
+       {
+               py_attack(y, x, 0);
+               if (randint0(p_ptr->skill_dis) < 7)
+                       msg_print(_("うまく逃げられなかった。", "You failed to run away."));
+               else
+                       teleport_player(30, 0L);
+               return TRUE;
+       }
+       else
+       {
+               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+               msg_print(NULL);
+               return FALSE;
+       }
+
 }
\ No newline at end of file