]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/items.qh
Bot waypoints: fix creation of a jump / support link from wp A to wp B breaking hardw...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items.qh
index 37b7d10c6fed2eb8fa6ca97457cbdd5bd3a31d7c..b52449e7158dffab62269d6b17d32a6a7cdcc439 100644 (file)
@@ -1,16 +1,40 @@
+#pragma once
+
 /// \file
 /// \brief Header file that describes the functions related to game items.
 /// \copyright GNU GPLv2 or any later version.
 
-#pragma once
+bool startitem_failed;
+
+/// \brief Returns the item definition corresponding to the given class name.
+/// \param[in] class_name Class name to search for.
+/// \return Item definition corresponding to the given class name or NULL is not
+/// found.
+entity Item_FindDefinition(string class_name);
+
+/// \brief Checks whether the items with the specified class name are allowed to
+/// spawn.
+/// \param[in] class_name Item class name to check.
+/// \return True items with the specified class name are allowed to spawn, false
+/// otherwise.
+bool Item_IsAllowed(string class_name);
+
+/// \brief Checks whether the items with the specified definition are allowed to
+/// spawn.
+/// \param[in] definition Item definition to check.
+/// \return True items with the specified definition are allowed to spawn, false
+/// otherwise.
+bool Item_IsDefinitionAllowed(entity definition);
 
 /// \brief Creates a new item.
 /// \param[in] class_name Class name of the item.
 /// \param[in] position Position of the item.
+/// \param[in] no_align True if item should be placed directly at specified
+/// position, false to let it drop to the ground.
 /// \return Item on success, NULL otherwise.
-entity Item_Create(string class_name, vector position);
+entity Item_Create(string class_name, vector position, bool no_align);
 
-/// \brief Initializes the item according to classname.
+/// \brief Initializes the item according to class name.
 /// \param[in,out] item Item to initialize.
 /// \param[in] class_name Class name to use.
 /// \return No return.
@@ -49,27 +73,22 @@ bool Item_IsLoot(entity item);
 /// \return No return.
 void Item_SetLoot(entity item, bool loot);
 
-// Item spawn functions.
-// If a function is declared like this:
-// spawnfunc(foo);
-// You need to call it like this:
-// spawnfunc_foo(item);
+/// \brief Returns whether item should keep its position or be dropped to the
+/// ground.
+/// \param[in] item Item to check.
+/// \return True if item should keep its position or false if it should be
+/// dropped to the ground.
+bool Item_ShouldKeepPosition(entity item);
+
+/// \brief Returns whether the item is expiring (i.e. its strength, shield and
+/// superweapon timers expire while it is on the ground).
+/// \param[in] item Item to check.
+/// \return True if the item is expiring, false otherwise.
+bool Item_IsExpiring(entity item);
 
-spawnfunc(item_health_small);
-spawnfunc(item_health_medium);
-spawnfunc(item_health_big);
-spawnfunc(item_health_mega);
-spawnfunc(item_armor_small);
-spawnfunc(item_armor_medium);
-spawnfunc(item_armor_big);
-spawnfunc(item_armor_mega);
-spawnfunc(item_shells);
-spawnfunc(item_bullets);
-spawnfunc(item_rockets);
-spawnfunc(item_cells);
-spawnfunc(item_plasma);
-spawnfunc(item_fuel);
-spawnfunc(item_strength);
-spawnfunc(item_invincible);
-spawnfunc(item_fuel_regen);
-spawnfunc(item_jetpack);
+/// \brief Sets the item expiring status (i.e. whether its strength, shield
+/// and superweapon timers expire while it is on the ground).
+/// \param[in,out] item Item to adjust.
+/// \param[in] expiring Whether item is expiring.
+/// \return No return.
+void Item_SetExpiring(entity item, bool expiring);