28 lines
611 B
C++
28 lines
611 B
C++
#ifndef HITBOX_H
|
|
#define HITBOX_H
|
|
|
|
#include "scene/3d/physics/area_3d.h"
|
|
#include "scene/resources/packed_scene.h"
|
|
class HealthStatus;
|
|
|
|
class Hitbox : public Area3D {
|
|
GDCLASS(Hitbox, Area3D);
|
|
static void _bind_methods();
|
|
|
|
public:
|
|
void set_health(HealthStatus *value);
|
|
HealthStatus *get_health() const;
|
|
void set_damage_modifier(float value);
|
|
float get_damage_modifier() const;
|
|
|
|
void set_impact_effect(Ref<PackedScene> scene);
|
|
Ref<PackedScene> get_impact_effect() const;
|
|
|
|
private:
|
|
HealthStatus *health{ nullptr };
|
|
float damage_modifier{ 1.f };
|
|
Ref<PackedScene> impact_effect{};
|
|
};
|
|
|
|
#endif // !HITBOX_H
|