17 #ifndef HEADER_SUPERTUX_BADGUY_GRANITO_HPP 18 #define HEADER_SUPERTUX_BADGUY_GRANITO_HPP 20 #include "badguy/walking_badguy.hpp" 37 static void register_class(ssq::VM& vm);
41 const std::string& sprite_name =
"images/creatures/granito/granito.sprite",
42 int layer = LAYER_OBJECTS);
49 static std::string class_name() {
return "granito"; }
50 virtual std::string get_class_name()
const override {
return class_name(); }
51 virtual std::string get_exposed_class_name()
const override {
return "Granito"; }
52 static std::string display_name() {
return _(
"Granito"); }
57 virtual bool is_freezable()
const override {
return false; }
63 virtual GameObjectTypes
get_types()
const override;
64 virtual void after_editor_set()
override;
67 void turn(
const Direction& direction);
86 void turn(
const std::string& direction);
130 virtual void eject();
136 int get_state()
const {
return static_cast<int>(m_state); }
159 enum Type { DEFAULT, STAND, WALK, SCRIPTABLE, SIT };
178 virtual bool try_wave();
179 virtual bool try_jump();
181 void restore_original_state();
184 Timer m_walk_interval;
186 State m_original_state;
193 std::string m_carried_script;
void reset_detection()
Resets the player detection used for waving, allowing the Detect Script to be ran again...
Definition: granito.hpp:150
void walk()
Makes the Granito walk.
Definition: granito.cpp:479
std::string m_detect_script
Unfortunately, on_ground() sucks.
Definition: granito.hpp:192
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
Called when a collision with another object occurred.
Definition: granito.cpp:211
virtual void initialize() override
called immediately before the first call to initialize
Definition: granito.cpp:327
A ""GranitoBig"" that was given a name can be controlled by scripts.
Definition: granito_big.hpp:29
State
NOTE: Make sure to expose any new enumerators to Squirrel.
Definition: granito.hpp:167
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.hpp:56
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: walking_badguy.hpp:55
Definition: granito.hpp:171
virtual void sit()
Makes the Granito sit.
Definition: granito.cpp:420
Definition: granito.hpp:173
int get_state() const
Gets the current Granito state.
Definition: granito.hpp:136
void stand()
Makes the Granito stand, or stop if walking.
Definition: granito.cpp:497
std::string get_carrier_name() const
Gets the name of the Big Granito that is carrying the Granito.
Definition: granito.cpp:320
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: granito.hpp:54
Base class for Badguys that walk on the floor.
Definition: walking_badguy.hpp:25
void activate() override
called when the badguy has been activated.
Definition: granito.cpp:266
Definition: object_settings.hpp:39
Definition: granito.hpp:169
virtual GameObjectTypes get_types() const override
Get all types of the object, if available.
Definition: granito.cpp:273
virtual void jump()
Makes the Granito jump.
Definition: granito.cpp:547
virtual void eject()
Eject itself from the Big Granito.
Definition: granito.cpp:553
virtual void update_hitbox() override
Update hitbox, based on sprite.
Definition: granito.cpp:360
void walk_for(float seconds)
Makes the Granito walk for a specified amount of seconds.
Definition: granito.cpp:489
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
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.cpp:247
Interactable friendly NPC.
Definition: granito.hpp:34
bool m_airborne
True if tux was on top of granito last frame.
Definition: granito.hpp:190
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
void set_walking(bool walking)
Sets the walking state for the Granito.
Definition: granito.hpp:93
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
virtual bool is_flammable() const override
Returns whether to call ignite() when a badguy gets hit by a fire bullet.
Definition: granito.hpp:58
Definition: granito.hpp:174
Definition: granito.hpp:170
virtual void wave()
Makes the Granito wave.
Definition: granito.cpp:406
Definition: reader_mapping.hpp:32
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: granito.hpp:53
This module contains methods controlling the player.
Definition: player.hpp:47
Definition: granito.hpp:172
virtual HitResponse collision_player(Player &player, const CollisionHit &hit) override
Called when the badguy collided with a player.
Definition: granito.cpp:187
This class collects data about a collision.
Definition: collision_hit.hpp:44
virtual void active_update(float dt_sec) override
called each frame when the badguy is activated.
Definition: granito.cpp:51