#pragma once #include "BoneCollisionShape.h" #include "FirstPersonPlayer.h" #include #include #include #include #include #include #include namespace blitz { class Zombie : public godot::CharacterBody3D { GDCLASS(Zombie, godot::CharacterBody3D) protected: static void _bind_methods(); public: Zombie(); ~Zombie(); void _ready(); void _process(float delta); bool _target_in_range(); void _on_area_3d_a_zombie_head_shot_hit(int dam); void _on_area_3d_a_zombie_body_shot_hit(int dam); private: godot::NavigationAgent3D* m_NavigationAgent; FirstPersonPlayer* m_Player; godot::NodePath m_PlayerPath; godot::Vector3 m_Velocity; godot::AnimationTree* m_AnimationTree; godot::AnimationNodeStateMachinePlayback* m_StateMachine; BoneCollisionShape* m_HeadCollision; std::vector m_BodyPartsCollision = {"Neck", "Spine", "Hips", "LeftArm", "LeftForearm", "LeftHand", "RightArm", "RightForearm", "RightHand", "LeftUpLeg", "RightUpLeg", "LeftLeg", "RightLeg", "LeftFoot", "RightFoot"}; int m_Health = 6; godot::Timer* m_Timer; void set_m_PlayerPath(const godot::NodePath& path); godot::NodePath get_m_PlayerPath() const; void hit_finished(); void apply_damage(int dam); void connect_collision_shapes(const std::vector& body_parts); void _on_timer_timeout(); }; } // namespace blitz