equipment-test/modules/tabtargeting/actor_body.h
2025-06-13 15:12:22 +02:00

27 lines
611 B
C++

#ifndef ACTOR_BODY_H
#define ACTOR_BODY_H
#include "scene/3d/physics/character_body_3d.h"
#include "equipment.h"
class ActorBody;
class ActorBody : public CharacterBody3D {
GDCLASS(ActorBody, CharacterBody3D);
static void _bind_methods();
void _notification(int what);
public:
void _attack();
bool is_attack_requested();
void receive_damage(DamageEvent event);
void request_attack(ActorBody *target);
void set_health(int health);
int get_health() const;
private:
int health{50};
int max_health{10};
ActorBody *attack_requested{nullptr};
Equipment *equipment{nullptr};
};
#endif // !ACTOR_BODY_H