feat: reloading withdraws ammo from inventory

This commit is contained in:
Sara 2025-08-10 16:37:02 +02:00
parent a2035e0db0
commit ed85b557a7
8 changed files with 92 additions and 17 deletions

View file

@ -28,6 +28,15 @@ public:
void pickup_demo_pack();
bool try_use_demo_pack();
void deposit_pistol_ammo(int amount);
void set_pistol_ammo(int amount);
int get_pistol_ammo() const;
int withdraw_pistol_ammo(int max_amount);
void deposit_rifle_ammo(int amount);
void set_rifle_ammo(int amount);
int get_rifle_ammo() const;
int withdraw_rifle_ammo(int max_amount);
private:
Node3D *weapon_parent{ nullptr };
unsigned current{ 0 };
@ -36,8 +45,8 @@ private:
Ref<PackedScene> starting_weapon{};
int pistol_ammo{ 60 };
int rifle_ammo{ 0 };
int pistol_ammo{ 16 };
int rifle_ammo{ 30 };
};
#endif // !WEAPON_INVENTORY_H