OSDN Git Service

[Refactor] #1469 Moved stop_hex_spell_all() from global to RealmHex
[hengbandforosx/hengbandosx.git] / src / spell-realm / spells-hex.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 struct player_type;
6 class RealmHex {
7 public:
8     RealmHex() = delete;
9     RealmHex(player_type *caster_ptr);
10     virtual ~RealmHex() = default;
11
12     bool stop_hex_spell();
13     void check_hex();
14     bool stop_hex_spell_all();
15
16 private:
17     player_type *caster_ptr;
18
19     bool select_spell_stopping(int *sp, char *out_val, char *choice);
20     void display_spells_list(int *sp);
21     void process_mana_cost(const bool need_restart);
22     bool check_restart();
23     int calc_need_mana();
24     void gain_exp_from_hex();
25     bool gain_exp_skilled(const int spell);
26     bool gain_exp_expert(const int spell);
27     void gain_exp_master(const int spell);
28 };
29
30 bool hex_spell_fully(player_type *caster_ptr);
31 void revenge_spell(player_type *caster_ptr);
32 void revenge_store(player_type *caster_ptr, HIT_POINT dam);
33 bool teleport_barrier(player_type *caster_ptr, MONSTER_IDX m_idx);
34 bool magic_barrier(player_type *caster_ptr, MONSTER_IDX m_idx);
35 bool multiply_barrier(player_type *caster_ptr, MONSTER_IDX m_idx);
36 bool hex_spelling(player_type *caster_ptr, int hex);
37 bool hex_spelling_any(player_type *caster_ptr);
38
39 #define casting_hex_flags(P_PTR) ((P_PTR)->magic_num1[0])
40 #define casting_hex_num(P_PTR) ((P_PTR)->magic_num2[0])
41 #define hex_revenge_power(P_PTR) ((P_PTR)->magic_num1[2])
42 #define hex_revenge_turn(P_PTR) ((P_PTR)->magic_num2[2])
43 #define hex_revenge_type(P_PTR) ((P_PTR)->magic_num2[1])