supertux
boss.hpp
1 // SuperTux
2 // Copyright (C) 2024 Daniel Ward <weluvgoatz@gmail.com>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_BADGUY_BOSS_HPP
18 #define HEADER_SUPERTUX_BADGUY_BOSS_HPP
19 
20 #include "badguy/badguy.hpp"
21 
22 // This is a class for our (currently two) bosses, but can apply to future ones also.
23 // Includes information on lives, HUD, pinch mode activation, and death behavior.
24 
25 class Boss : public BadGuy
26 {
27 public:
28  Boss(const ReaderMapping& mapping, const std::string& sprite_name, int layer = LAYER_OBJECTS);
29  virtual void boss_update(float dt_sec);
30  virtual void draw(DrawingContext& context) override;
31  void draw_hit_points(DrawingContext& context);
32  virtual ObjectSettings get_settings() override;
33  virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Boss)); }
34 
35  virtual bool is_flammable() const override { return false; }
36  virtual bool is_freezable() const override { return false; }
37 
38 protected:
39  int m_lives;
40  int m_pinch_lives;
41  SurfacePtr m_hud_head;
42  std::string m_hud_icon;
43  bool m_pinch_mode;
44  std::string m_pinch_activation_script;
45 
46 private:
47  Boss(const Boss&) = delete;
48  Boss& operator=(const Boss&) = delete;
49 };
50 
51 #endif
52 
53 /* EOF */
Base class for moving sprites that can hurt the Player.
Definition: badguy.hpp:38
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: badguy.hpp:71
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: boss.hpp:33
Definition: object_settings.hpp:39
A helper structure to list all the type_indexes of the classes in the type hierarchy of a given class...
Definition: game_object.hpp:57
virtual void draw(DrawingContext &context) override
Called when the badguy is drawn.
Definition: boss.cpp:58
Definition: boss.hpp:25
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
virtual bool is_flammable() const override
Returns whether to call ignite() when a badguy gets hit by a fire bullet.
Definition: boss.hpp:35