]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/pickup.qh
Add an item dumping command
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / pickup.qh
1 #ifndef PICKUP_H
2 #define PICKUP_H
3 #include "../item.qh"
4 CLASS(Pickup, GameItem)
5     ATTRIB(Pickup, m_model, string, string_null)
6     ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
7     ATTRIB(Pickup, m_name, string, string_null)
8     METHOD(Pickup, show, void(entity this))
9     void Pickup_show(entity this) { printf("%s: %s\n", etos(this), this.m_name); }
10 #ifdef SVQC
11     ATTRIB(Pickup, m_botvalue, int, 0)
12     ATTRIB(Pickup, m_itemflags, int, 0)
13     ATTRIB(Pickup, m_itemid, int, 0)
14     ATTRIB(Pickup, m_pickupevalfunc, float(entity player, entity item), generic_pickupevalfunc)
15     ATTRIB(Pickup, m_respawntime, float(), func_null)
16     ATTRIB(Pickup, m_respawntimejitter, float(), func_null)
17     METHOD(Pickup, giveTo, bool(entity this, entity item, entity player))
18     bool Pickup_giveTo(entity this, entity item, entity player) { return Item_GiveTo(item, player); }
19     bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) { printf("%s picked up %s\n", etos(player), this.m_name); return this.giveTo(this, item, player); }
20 #endif
21 ENDCLASS(Pickup)
22
23 #ifdef SVQC
24 // For g_pickup_respawntime
25 #include "../../../server/defs.qh"
26 // Getters to dynamically retrieve the values of g_pickup_respawntime*
27 GETTER(float, g_pickup_respawntime_weapon)
28 GETTER(float, g_pickup_respawntime_superweapon)
29 GETTER(float, g_pickup_respawntime_ammo)
30 GETTER(float, g_pickup_respawntime_short)
31 GETTER(float, g_pickup_respawntime_medium)
32 GETTER(float, g_pickup_respawntime_long)
33 GETTER(float, g_pickup_respawntime_powerup)
34 GETTER(float, g_pickup_respawntimejitter_weapon)
35 GETTER(float, g_pickup_respawntimejitter_superweapon)
36 GETTER(float, g_pickup_respawntimejitter_ammo)
37 GETTER(float, g_pickup_respawntimejitter_short)
38 GETTER(float, g_pickup_respawntimejitter_medium)
39 GETTER(float, g_pickup_respawntimejitter_long)
40 GETTER(float, g_pickup_respawntimejitter_powerup)
41
42 #endif
43
44 #endif