supertux
granito_giant.hpp
1 // SuperTux
2 // Copyright (C) 2023 MatusGuy
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_GRANITO_GIANT_HPP
18 #define HEADER_SUPERTUX_BADGUY_GRANITO_GIANT_HPP
19 
20 #include "badguy/badguy.hpp"
21 
22 class GranitoGiant final : public BadGuy
23 {
24 public:
25  explicit GranitoGiant(const ReaderMapping& reader);
26 
27  virtual HitResponse collision_player(Player& player, const CollisionHit& hit) override;
28  virtual void initialize() override;
29 
30  static std::string class_name() { return "granito_giant"; }
31  virtual std::string get_class_name() const override { return class_name(); }
32  static std::string display_name() { return _("Giant Granito"); }
33  virtual std::string get_display_name() const override { return display_name(); }
34  virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GranitoGiant)); }
35 
36  virtual void kill_fall() override;
37 
38  virtual bool is_flammable() const override { return false; }
39  virtual bool is_freezable() const override { return false; }
40  virtual bool is_hurtable() const override { return false; }
41  virtual bool is_snipable() const override { return false; }
42 
43  GameObjectTypes get_types() const override;
44  virtual std::string get_default_sprite_name() const override;
45  virtual void after_editor_set() override;
46 
47 private:
48  enum Type { AWAKE, SLEEP, CORRUPTED_A, CORRUPTED_B, CORRUPTED_C };
49 
50 private:
51  GranitoGiant(const GranitoGiant&) = delete;
52  GranitoGiant& operator=(const GranitoGiant&) = delete;
53 };
54 
55 #endif
56 
57 /* EOF */
virtual void initialize() override
called immediately before the first call to initialize
Definition: granito_giant.cpp:34
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
GameObjectTypes get_types() const override
Get all types of the object, if available.
Definition: granito_giant.cpp:68
virtual void kill_fall() override
Set the badguy to kill/falling state, which makes him falling of the screen (his sprite is turned ups...
Definition: granito_giant.cpp:62
virtual bool is_flammable() const override
Returns whether to call ignite() when a badguy gets hit by a fire bullet.
Definition: granito_giant.hpp:38
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user&#39;s locale.
Definition: granito_giant.hpp:33
Definition: granito_giant.hpp:22
virtual HitResponse collision_player(Player &player, const CollisionHit &hit) override
Called when the badguy collided with a player.
Definition: granito_giant.cpp:28
virtual bool is_hurtable() const override
Return true if this badguy can be hurt by tiles with the attribute "hurts".
Definition: granito_giant.hpp:40
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 bool is_snipable() const override
Can enemy be sniped by sliding or swimboosting Tux? Returns false if enemy is spiky or too large...
Definition: granito_giant.hpp:41
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: granito_giant.hpp:34
Definition: reader_mapping.hpp:32
This module contains methods controlling the player.
Definition: player.hpp:47
This class collects data about a collision.
Definition: collision_hit.hpp:44