#pragma once #include "break_utopia/macros.h" #include "core/math/math_defs.h" #include "scene/main/node.h" #include "scene/resources/packed_scene.h" class LevelStatus : public Node { GDCLASS(LevelStatus, Node); static void _bind_methods(); void process(double delta); protected: void _notification(int what); public: void notify_object_destroyed(int value); bool try_use_energy(double amount); void set_energy(double energy); double get_energy() const; void set_style(double style); double get_style() const; void set_score(int score); int get_score() const; void set_player_health(double health); double get_player_health() const; void increment_destroyed_objects(); void increment_total_objects(); void give_energy(double amount); private: static LevelStatus *instance; double energy{ 0.0 }; double style{ 0.0 }; int score{ 0 }; double player_health{ 1.0 }; double base_style_per_object{ 0.25 }; double time_since_last{ Math::INF }; int max_score_mult{ 5 }; int max_style_mult{ 1 }; int total_objects{ 0 }; int destroyed_objects{ 0 }; double max_time_between{ 1.f }; Ref game_over_scene{}; public: static String const sig_object_destroyed; static String const sig_health_changed; static String const sig_meter_changed; static String const sig_style_changed; static String const sig_score_changed; static LevelStatus *get_instance(); GET_SET_FNS(int, total_objects); GET_SET_FNS(int, destroyed_objects); GET_SET_FNS(Ref, game_over_scene); };