Collision of zombie body parts completed and different damage added depending on the body part hit

This commit is contained in:
Morph01
2024-08-22 16:15:54 +02:00
parent d88cb9fbff
commit 1f52eb2c52
12 changed files with 467 additions and 124 deletions

30
src/BoneCollisionShape.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <godot_cpp/classes/area3d.hpp>
namespace blitz {
class BoneCollisionShape : public godot::Area3D {
GDCLASS(BoneCollisionShape, godot::Area3D)
protected:
static void _bind_methods();
public:
BoneCollisionShape();
~BoneCollisionShape();
void _ready();
void headshot_hit();
void bodyshot_hit();
private:
int m_HeadDamage = 2;
int m_BodyDamage = 1;
void set_head_damage(int d);
int get_head_damage() const;
void set_body_damage(int d);
int get_body_damage() const;
};
} // namespace blitz