17 #ifndef HEADER_SUPERTUX_BADGUY_DISPENSER_HPP 18 #define HEADER_SUPERTUX_BADGUY_DISPENSER_HPP 20 #include "badguy/badguy.hpp" 21 #include "scripting/dispenser.hpp" 22 #include "squirrel/exposed_object.hpp" 28 enum class DispenserType {
29 DROPPER, ROCKETLAUNCHER, CANNON, POINT
32 static DispenserType DispenserType_from_string(
const std::string& type_string);
33 static std::string DispenserType_to_string(DispenserType type);
43 virtual void freeze()
override;
45 virtual bool is_freezable()
const override;
47 virtual std::string get_class()
const override {
return "dispenser"; }
48 virtual std::string get_display_name()
const override {
return _(
"Dispenser"); }
51 virtual void after_editor_set()
override;
54 if (m_limit_dispensed_badguys) {
65 void set_correct_action();
69 std::vector<std::string> m_badguys;
70 unsigned int m_next_badguy;
71 Timer m_dispense_timer;
78 std::string m_type_str;
81 bool m_limit_dispensed_badguys;
84 int m_max_concurrent_badguys;
87 int m_current_badguys;
Base class for moving sprites that can hurt the Player.
Definition: badguy.hpp:31
virtual bool collision_squished(GameObject &object) override
Called when the player hit the badguy from above.
Definition: dispenser.cpp:178
virtual void active_update(float dt_sec) override
called each frame when the badguy is activated.
Definition: dispenser.cpp:227
virtual void draw(DrawingContext &context) override
Called when the badguy is drawn.
Definition: dispenser.cpp:146
virtual void deactivate() override
called when the badguy has been deactivated
Definition: dispenser.cpp:171
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
Called when a collision with another object occurred.
Definition: dispenser.cpp:203
This class binds a certain GameObject class to a scripting class.
Definition: exposed_object.hpp:45
virtual bool is_flammable() const override
Returns whether to call ignite() when a badguy gets hit by a fire bullet.
Definition: dispenser.cpp:408
Definition: object_settings.hpp:35
Definition: dispenser.hpp:24
virtual void unfreeze() override
Called to unfreeze the badguy.
Definition: dispenser.cpp:389
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
virtual void activate() override
called when the badguy has been activated.
Definition: dispenser.cpp:154
virtual void freeze() override
Called when hit by an ice bullet, and is_freezable() returns true.
Definition: dispenser.cpp:353
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: reader_mapping.hpp:31
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44