OSDN Git Service

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