1// SuperTux - Badguy "Igel"
2// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
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_IGEL_HPP
18#define HEADER_SUPERTUX_BADGUY_IGEL_HPP
19
20#include "badguy/walking_badguy.hpp"
21
22/** Badguy "Igel" - a hedgehog that can absorb bullets */
23class Igel final : public WalkingBadguy
24{
25public:
26 Igel(const ReaderMapping& reader);
27
28 virtual HitResponse collision_bullet(Bullet& bullet, const CollisionHit& hit) override;
29
30 virtual void active_update(float dt_sec) override;
31
32 virtual bool is_freezable() const override;
33 virtual std::string get_class() const override { return "igel"; }
34 virtual std::string get_display_name() const override { return _("Igel"); }
35
36protected:
37 // virtual bool collision_squished(GameObject& object) override;
38 // Enable this and the igel will no longer be butt-jumpable when frozen.
39 // Remember to enable it in .cpp too!
40 void be_normal(); /**< switch to state STATE_NORMAL */
41 void turn_around(); /**< reverse direction, assumes we are in STATE_NORMAL */
42 bool can_see(const MovingObject& o) const; /**< check if we can see o */
43
44private:
45 Timer turn_recover_timer; /**< wait time until we will turn around again when shot at */
46
47private:
48 Igel(const Igel&) = delete;
49 Igel& operator=(const Igel&) = delete;
50};
51
52#endif
53
54/* EOF */
55