OSDN Git Service

1c22c2e6b95746eda316e000f1186dd15cead514
[hengbandforosx/hengbandosx.git] / src / spell-realm / spells-hex.h
1 #pragma once
2
3 #include "system/angband.h"
4 #include "realm/realm-hex-numbers.h"
5 #include <tuple>
6
7 enum class SpellHexRevengeType : byte {
8     NONE = 0,
9     PATIENCE = 1,
10     REVENGE = 2,
11 };
12
13 class MonsterAttackPlayer;
14 class PlayerType;
15 struct spell_hex_data_type;
16 class SpellHex {
17 public:
18     SpellHex(PlayerType *player_ptr);
19     SpellHex(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr);
20     virtual ~SpellHex() = default;
21
22     bool stop_spells_with_selection();
23     void decrease_mana();
24     void stop_all_spells();
25     bool is_casting_full_capacity() const;
26     void continue_revenge();
27     void store_vengeful_damage(HIT_POINT dam);
28     bool check_hex_barrier(MONSTER_IDX m_idx, spell_hex_type type) const;
29     bool is_spelling_specific(int hex) const;
30     bool is_spelling_any() const;
31     void interrupt_spelling();
32     void eyes_on_eyes();
33     void thief_teleport();
34     void set_casting_flag(spell_hex_type type);
35     void reset_casting_flag(spell_hex_type type);
36     int32_t get_casting_num() const;
37     int32_t get_revenge_power() const;
38     void set_revenge_power(int32_t power, bool substitution);
39     byte get_revenge_turn() const;
40     void set_revenge_turn(byte power, bool substitution);
41     SpellHexRevengeType get_revenge_type() const;
42     void set_revenge_type(SpellHexRevengeType type);
43
44 private:
45     PlayerType *player_ptr;
46     std::vector<int> casting_spells;
47     MonsterAttackPlayer *monap_ptr = nullptr;
48     std::shared_ptr<spell_hex_data_type> spell_hex_data;
49
50     std::tuple<bool, bool, char> select_spell_stopping(char *out_val);
51     void display_casting_spells_list();
52     bool process_mana_cost(const bool need_restart);
53     bool check_restart();
54     int calc_need_mana();
55     void gain_exp();
56 };