Files
oboe/src/pattern.hpp
Celtic Minstrel 628b0ee677 Add a new spell pattern picker.
The picker is used in the special node dialog and also in monster abilities.

Some changes were made to the game as well:
* If the rotatable wall is used for a field missile or touch ability, there's no longer an option for the designer to pick an orientation. Instead, it behaves like the rotatable wall in a radiate field ability, selecting an orientation based on the creature's facing direction.
* The magic values sent to place_spell_pattern for direct damage were rearranged to match the order of the eDamageType enum. This should have no effect, since the core place_spell_pattern function is only called by the various wrapper overloads. It also simplifies the code quite a bit.
* The Protective Circle spell pattern is now exposed to the place patten special nodes. It can be used as just a radius 4 circle, but the effect of different layers of fields can also be obtained by specifying a field type or damage type of -1.

There is also a change to the dialog engine:
* Calling setText() also implicitly calls recalcRect()
2025-03-08 20:05:12 -05:00

50 lines
1.0 KiB
C++

//
// pattern.hpp
// BoE
//
// Created by Celtic Minstrel on 2025-03-03.
//
#ifndef BoE_DATA_PATTERN_HPP
#define BoE_DATA_PATTERN_HPP
#include <array>
#include <vector>
enum eSpellPat {
PAT_SINGLE,
PAT_SQ, PAT_SMSQ, PAT_OPENSQ,
PAT_RAD2, PAT_RAD3, PAT_PLUS,
PAT_WALL,
PAT_PROT = PAT_WALL + 8,
PAT_CUSTOM,
PAT_CURRENT = -1
};
using effect_pat_type = std::array<std::array<unsigned short, 9>, 9>;
class cPattern {
static std::vector<cPattern> builtin_patterns;
public:
eSpellPat id = PAT_CUSTOM;
std::string name;
const bool rotatable = false;
union {
effect_pat_type pattern;
std::vector<effect_pat_type> patterns;
};
cPattern(const std::string& name, bool rotatable);
cPattern(const cPattern&);
cPattern(cPattern&&);
cPattern& with_id(eSpellPat id);
cPattern& with_pattern(effect_pat_type pat);
cPattern builtin();
~cPattern();
static const cPattern& get_builtin(eSpellPat id);
};
std::ostream& operator<< (std::ostream& out, eSpellPat pat);
std::istream& operator>> (std::istream& in, eSpellPat& pat);
#endif