]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/resources.qh
Merge branch 'terencehill/scoreboard_stuff' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / resources.qh
index d1079e7e8263bf2c1de0c8e152a30572c01252f1..3aaa8aab593786ffd7b15f46909258899f6f7772 100644 (file)
@@ -6,9 +6,6 @@
 
 #include <common/resources.qh>
 
-/// \brief Unconditional maximum amount of resources the entity can have.
-const int RESOURCE_AMOUNT_HARD_LIMIT = 999;
-
 // ============================ Public API ====================================
 
 /// \brief Returns the current amount of resource the given entity has.
@@ -31,6 +28,22 @@ bool SetResourceAmountExplicit(entity e, int resource_type, float amount);
 /// \return No return.
 void SetResourceAmount(entity e, int resource_type, float amount);
 
+/// \brief Takes an entity some resource.
+/// \param[in,out] receiver Entity to take resource from.
+/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
+/// \param[in] amount Amount of resource to take.
+/// \return No return.
+void TakeResource(entity receiver, int resource_type, float amount);
+
+/// \brief Takes an entity some resource but not less than a limit.
+/// \param[in,out] receiver Entity to take resource from.
+/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
+/// \param[in] amount Amount of resource to take.
+/// \param[in] limit Limit of resources to take.
+/// \return No return.
+void TakeResourceWithLimit(entity receiver, int resource_type, float amount,
+       float limit);
+
 // ===================== Legacy and/or internal API ===========================
 
 /// \brief Converts an entity field to resource type.
@@ -42,3 +55,7 @@ int GetResourceType(.float resource_field);
 /// \param[in] resource_type Type of the resource.
 /// \return Entity field for that resource.
 .float GetResourceField(int resource_type);
+
+/// \brief Legacy fields for the resources. To be removed.
+.float health;
+.float armorvalue;