| 1 | //  SuperTux | 
|---|
| 2 | // | 
|---|
| 3 | //  This program is free software: you can redistribute it and/or modify | 
|---|
| 4 | //  it under the terms of the GNU General Public License as published by | 
|---|
| 5 | //  the Free Software Foundation, either version 3 of the License, or | 
|---|
| 6 | //  (at your option) any later version. | 
|---|
| 7 | // | 
|---|
| 8 | //  This program is distributed in the hope that it will be useful, | 
|---|
| 9 | //  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 10 | //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 11 | //  GNU General Public License for more details. | 
|---|
| 12 | // | 
|---|
| 13 | //  You should have received a copy of the GNU General Public License | 
|---|
| 14 | //  along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
|---|
| 15 |  | 
|---|
| 16 | #ifndef HEADER_SUPERTUX_BADGUY_GHOUL_HPP | 
|---|
| 17 | #define | 
|---|
| 18 |  | 
|---|
| 19 | #include "badguy/badguy.hpp" | 
|---|
| 20 | #include "object/path_object.hpp" | 
|---|
| 21 |  | 
|---|
| 22 | class Ghoul final : public BadGuy, | 
|---|
| 23 | public PathObject | 
|---|
| 24 | { | 
|---|
| 25 | public: | 
|---|
| 26 | Ghoul(const ReaderMapping& reader); | 
|---|
| 27 | std::string get_class() const override { return "ghoul"; } | 
|---|
| 28 | std::string get_display_name() const override { return _( "Ghoul"); } | 
|---|
| 29 | bool is_freezable() const override; | 
|---|
| 30 | bool is_flammable() const override; | 
|---|
| 31 |  | 
|---|
| 32 | void finish_construction() override; | 
|---|
| 33 |  | 
|---|
| 34 | void activate() override; | 
|---|
| 35 | void deactivate() override; | 
|---|
| 36 | void active_update(float dt_sec) override; | 
|---|
| 37 |  | 
|---|
| 38 | void goto_node(int node_no); | 
|---|
| 39 | void set_state(const std::string& state); | 
|---|
| 40 | void start_moving(); | 
|---|
| 41 | void stop_moving(); | 
|---|
| 42 |  | 
|---|
| 43 | void move_to(const Vector& pos) override; | 
|---|
| 44 |  | 
|---|
| 45 | protected: | 
|---|
| 46 | bool collision_squished(GameObject& object) override; | 
|---|
| 47 |  | 
|---|
| 48 | private: | 
|---|
| 49 | enum MyState { | 
|---|
| 50 | STATE_STOPPED, STATE_IDLE, STATE_TRACKING, STATE_PATHMOVING, STATE_PATHMOVING_TRACK | 
|---|
| 51 | }; | 
|---|
| 52 |  | 
|---|
| 53 | private: | 
|---|
| 54 | MyState m_mystate; | 
|---|
| 55 | float m_flyspeed; | 
|---|
| 56 | float m_track_range; | 
|---|
| 57 |  | 
|---|
| 58 | private: | 
|---|
| 59 | Ghoul(const Ghoul&) = delete; | 
|---|
| 60 | Ghoul& operator=(const Ghoul&) = delete; | 
|---|
| 61 | }; | 
|---|
| 62 |  | 
|---|
| 63 | #endif | 
|---|
| 64 |  | 
|---|
| 65 | /* EOF */ | 
|---|
| 66 |  | 
|---|