17 #ifndef HEADER_SUPERTUX_OBJECT_THUNDERSTORM_HPP 18 #define HEADER_SUPERTUX_OBJECT_THUNDERSTORM_HPP 23 #include "supertux/game_object.hpp" 24 #include "supertux/timer.hpp" 41 static void register_class(ssq::VM& vm);
46 virtual void update(
float dt_sec)
override;
49 static std::string class_name() {
return "thunderstorm"; }
50 virtual std::string get_class_name()
const override {
return class_name(); }
51 virtual std::string get_exposed_class_name()
const override {
return "Thunderstorm"; }
52 static std::string display_name() {
return _(
"Thunderstorm"); }
58 virtual const std::string get_icon_path()
const override {
return "images/engine/editor/thunderstorm.png"; }
99 void lightning_general(
bool is_scripted =
false);
101 void change_background_colors(
bool is_lightning,
bool is_scripted =
false);
102 void restore_background_colors();
109 std::string m_strike_script;
111 Timer time_to_thunder;
112 Timer time_to_lightning;
113 Timer flash_display_timer;
114 Timer restore_background_color_timer;
115 std::list<Color> m_background_colors;
117 std::map<uint32_t, uint32_t> changing_tiles;
void stop()
Stops playing thunder and lightning at a configured interval.
Definition: thunderstorm.cpp:167
void electrify()
Electrifies water throughout the whole sector for a short time.
Definition: thunderstorm.cpp:196
Definition: object_settings.hpp:39
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: thunderstorm.cpp:91
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: thunderstorm.hpp:53
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: thunderstorm.cpp:134
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: thunderstorm.hpp:54
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
void start()
Starts playing thunder and lightning at a configured interval.
Definition: thunderstorm.cpp:158
void lightning()
Plays lightning, i.e.
Definition: thunderstorm.cpp:183
Thunderstorm scriptable GameObject: Plays thunder, lightning and electrifies water at regular interva...
Definition: thunderstorm.hpp:38
virtual GameObjectClasses get_class_types() const
List notable classes in inheritance hierarchy of class.
Definition: game_object.cpp:113
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 flash()
Displays a flash.
Definition: thunderstorm.cpp:189
void thunder()
Plays thunder.
Definition: thunderstorm.cpp:176
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42