28 lines
683 B
C++
28 lines
683 B
C++
#pragma once
|
|
|
|
#include "break_utopia/hit_box.h"
|
|
#include "break_utopia/macros.h"
|
|
#include "scene/resources/packed_scene.h"
|
|
|
|
class DestructableObject : public HitBox {
|
|
GDCLASS(DestructableObject, HitBox);
|
|
static void _bind_methods();
|
|
void process(double delta);
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
void damaged(int level) override;
|
|
void damage_blocked(int level) override;
|
|
|
|
private:
|
|
Ref<PackedScene> destroyed_object{};
|
|
Node3D *shake_object{};
|
|
Vector3 shake_base_position{};
|
|
double shake_timer{ 0.0 };
|
|
bool count_in_total{ true };
|
|
|
|
public:
|
|
GET_SET_FNS(Node3D *, shake_object);
|
|
GET_SET_FNS(Ref<PackedScene>, destroyed_object);
|
|
GET_SET_FNS(bool, count_in_total);
|
|
};
|