1 #include "racial/racial-vampire.h"
2 #include "dungeon/dungeon-flag-types.h"
3 #include "floor/geometry.h"
4 #include "hpmp/hp-mp-processor.h"
5 #include "player/digestion-processor.h"
6 #include "player/player-status.h"
7 #include "spell-kind/spells-specific-bolt.h"
8 #include "system/dungeon-info.h"
9 #include "system/floor-type-definition.h"
10 #include "system/grid-type-definition.h"
11 #include "system/player-type-definition.h"
12 #include "target/target-getter.h"
13 #include "view/display-messages.h"
15 bool vampirism(PlayerType *player_ptr)
17 const auto &floor = *player_ptr->current_floor_ptr;
18 if (floor.get_dungeon_definition().flags.has(DungeonFeatureType::NO_MELEE)) {
19 msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
24 if (!get_direction(player_ptr, &dir)) {
28 POSITION y = player_ptr->y + ddy[dir];
29 POSITION x = player_ptr->x + ddx[dir];
30 const auto *g_ptr = &floor.grid_array[y][x];
31 stop_mouth(player_ptr);
32 if (!(g_ptr->m_idx)) {
33 msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
37 msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
39 int dummy = player_ptr->lev * 2;
40 if (!hypodynamic_bolt(player_ptr, dir, dummy)) {
41 msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
45 if (player_ptr->food < PY_FOOD_FULL) {
46 (void)hp_player(player_ptr, dummy);
48 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
51 /* Gain nutritional sustenance: 150/hp drained */
52 /* A Food ration gives 5000 food points (by contrast) */
53 /* Don't ever get more than "Full" this way */
54 /* But if we ARE Gorged, it won't cure us */
55 dummy = player_ptr->food + std::min(5000, 100 * dummy);
56 if (player_ptr->food < PY_FOOD_MAX) { /* Not gorged already */
57 (void)set_food(player_ptr, dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);