17 #ifndef HEADER_SUPERTUX_BADGUY_WILLOWISP_HPP 18 #define HEADER_SUPERTUX_BADGUY_WILLOWISP_HPP 20 #include "badguy/badguy.hpp" 21 #include "object/path_object.hpp" 35 static void register_class(ssq::VM& vm);
41 virtual void after_editor_set()
override;
48 virtual bool is_freezable()
const override {
return false; }
52 void goto_node(
int node_idx);
66 static std::string class_name() {
return "willowisp"; }
67 virtual std::string get_class_name()
const override {
return class_name(); }
68 virtual std::string get_exposed_class_name()
const override {
return "WillOWisp"; }
69 static std::string display_name() {
return _(
"Will o' Wisp"); }
74 virtual void move_to(
const Vector& pos)
override;
76 virtual void on_flip(
float height)
override;
81 Color get_color()
const {
return m_color; }
88 virtual HitResponse collision_player(
Player& player,
const CollisionHit& hit)
override;
92 STATE_STOPPED, STATE_IDLE, STATE_TRACKING, STATE_VANISHING, STATE_WARPING,
93 STATE_PATHMOVING, STATE_PATHMOVING_TRACK
99 std::string m_target_sector;
100 std::string m_target_spawnpoint;
101 std::string m_hit_script;
103 std::unique_ptr<SoundSource> m_sound_source;
106 float m_vanish_range;
virtual void deactivate() override
called when the badguy has been deactivated
Definition: willowisp.cpp:194
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: willowisp.hpp:71
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: willowisp.hpp:50
virtual void stop_looping_sounds() override
stops all looping sounds
Definition: willowisp.cpp:323
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: willowisp.hpp:70
void vanish()
make WillOWisp vanish
Definition: willowisp.cpp:215
virtual void finish_construction() override
Called after all objects have been added to the Sector and the Sector is fully constructed.
Definition: willowisp.cpp:92
Definition: object_settings.hpp:39
virtual void play_looping_sounds() override
continues all looping sounds
Definition: willowisp.cpp:330
virtual void on_flip(float height) override
When level is flipped vertically.
Definition: willowisp.cpp:354
virtual std::vector< Direction > get_allowed_directions() const override
Returns a vector of directions the badguy can be set to.
Definition: willowisp.cpp:348
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
A sound source represents the source of audio output.
Definition: sound_source.hpp:25
virtual void active_update(float dt_sec) override
called each frame when the badguy is activated.
Definition: willowisp.cpp:111
virtual bool is_hurtable() const override
Return true if this badguy can be hurt by tiles with the attribute "hurts".
Definition: willowisp.hpp:49
A base class for all objects that contain, or make use of a path.
Definition: path_object.hpp:36
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
A ""WillOWisp"" that was given a name can be controlled by scripts.
Definition: willowisp.hpp:31
Definition: reader_mapping.hpp:32
This module contains methods controlling the player.
Definition: player.hpp:47
virtual bool is_flammable() const override
Returns whether to call ignite() when a badguy gets hit by a fire bullet.
Definition: willowisp.hpp:47
virtual void activate() override
called when the badguy has been activated.
Definition: willowisp.cpp:180
void set_state(const std::string &state)
Sets the state of the WillOWisp.
Definition: willowisp.cpp:272
This class collects data about a collision.
Definition: collision_hit.hpp:44