rpgxef/code/game/g_items.h

84 lines
1.9 KiB
C
Raw Normal View History

#ifndef _G_ITEMS_H
#define _G_ITEMS_H
#include "g_local.h"
2013-07-12 16:52:19 +00:00
#include "g_active.h"
/**
* Data structures + functions for the PADD messaging system.
*
* \author Ubergames - Marcin
* \date 06/12/2008
*/
typedef struct
{
gentity_t* key; //!< PADD item entity pointer
char owner[64];
char value[256];
} paddData_t;
#define PADD_DATA_MAX 256 //!< max number of padds
#define MAX_DROPPED 255 //!< should be reasonable
extern paddData_t paddData[PADD_DATA_MAX];
extern int paddDataNum;
extern int numTotalDropped;
/**
* Run an item.
*
* \param ent The item.
*/
void G_RunItem( gentity_t* ent );
/**
* Sets the clipping size and plants the object on the floor.
* Items can't be immediately dropped to floor, because they might
* be on an entity that hasn't spawned yet.
*
* \param ent Entity for item.
* \param item The item.
*/
void G_SpawnItem (gentity_t* ent, gitem_t* item);
/**
* Spawns an item and tosses it forward.
*
* \param ent An entity to toss from.
* \param item The item.
* \param angle Direction to toss to.
* \return The entity for the item.
*/
2013-07-12 16:52:19 +00:00
/*@shared@*/ /*@null@*/ gentity_t* Drop_Item( gentity_t* ent, gitem_t* item, double angle );
/**
* Clear all registered items.
*/
void ClearRegisteredItems( void );
/**
* Register a new item. The item will be added to the precache list.
*
* \param item Item to register.
*/
void RegisterItem( gitem_t* item );
/**
* Write the needed items to a config string so the client will know which ones to precache.
*/
void SaveRegisteredItems( void );
2013-07-12 16:52:19 +00:00
/**
* Drop a weapon.
*
* \author Ubergames - Marcin
* \date 03/12/2008
* \param ent The client.
* \param item The item.
* \param angle Angle to throw at.
* \param flags Entity flags to use.
* \param Optional message for PADD dropping.
*/
/*@shared@*/ /*@null@*/ gentity_t *DropWeapon( gentity_t* ent, gitem_t* item, double angle, int32_t flags, char* txt );
#endif /* _G_ITEMS_H */