]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/pickup.qh
1bcbc389950ace48d927602879138988beca896c
[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     METHOD(Pickup, respondTo, bool(entity, int))
6     ATTRIB(Pickup, m_model, string, string_null)
7     ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
8     ATTRIB(Pickup, m_name, string, string_null)
9 #ifdef SVQC
10     ATTRIB(Pickup, m_botvalue, int, 0)
11     ATTRIB(Pickup, m_itemflags, int, 0)
12     ATTRIB(Pickup, m_itemid, int, 0)
13     ATTRIB(Pickup, m_pickupevalfunc, float(entity player, entity item), generic_pickupevalfunc)
14     ATTRIB(Pickup, m_respawntime, float(), func_null)
15     ATTRIB(Pickup, m_respawntimejitter, float(), func_null)
16 #endif
17 ENDCLASS(Pickup)
18
19 #ifdef SVQC
20 // For g_pickup_respawntime
21 #include "../../../server/defs.qh"
22 // Getters to dynamically retrieve the values of g_pickup_respawntime* as they aren't autocvars
23 GETTER(float, g_pickup_respawntime_weapon)
24 GETTER(float, g_pickup_respawntime_superweapon)
25 GETTER(float, g_pickup_respawntime_ammo)
26 GETTER(float, g_pickup_respawntime_short)
27 GETTER(float, g_pickup_respawntime_medium)
28 GETTER(float, g_pickup_respawntime_long)
29 GETTER(float, g_pickup_respawntime_powerup)
30 GETTER(float, g_pickup_respawntimejitter_weapon)
31 GETTER(float, g_pickup_respawntimejitter_superweapon)
32 GETTER(float, g_pickup_respawntimejitter_ammo)
33 GETTER(float, g_pickup_respawntimejitter_short)
34 GETTER(float, g_pickup_respawntimejitter_medium)
35 GETTER(float, g_pickup_respawntimejitter_long)
36 GETTER(float, g_pickup_respawntimejitter_powerup)
37 #endif
38
39 bool Pickup_respondTo(entity this, int request)
40 {
41     switch (request) {
42         default: return false;
43         case ITEM_SIGNAL(Default):
44             print(strcat(this.m_name, " responding\n"));
45             return true;
46     }
47 }
48
49 #endif