]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/ammo.qh
Merge branch 'master' into Lyberta/RandomItems
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qh
1 #pragma once
2
3 #include "pickup.qh"
4 #ifdef SVQC
5     #include <common/t_items.qh>
6 #endif
7
8 #ifdef SVQC
9 PROPERTY(float, g_pickup_ammo_anyway);
10 #endif
11
12 CLASS(Ammo, Pickup)
13 #ifdef SVQC
14     ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc);
15     ATTRIB(Ammo, m_respawntime, float(), GET(g_pickup_respawntime_ammo));
16     ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo));
17     ATTRIB(Ammo, m_pickupanyway, float(), GET(g_pickup_ammo_anyway));
18 #endif
19 ENDCLASS(Ammo)
20
21
22 #ifdef GAMEQC
23 MODEL(Bullets_ITEM, Item_Model("a_bullets.mdl"));
24 #endif
25
26 #ifdef SVQC
27 PROPERTY(int, g_pickup_nails);
28 void ammo_bullets_init(entity item)
29 {
30     if(!item.ammo_nails)
31         item.ammo_nails = g_pickup_nails;
32 }
33 #endif
34 REGISTER_ITEM(Bullets, Ammo) {
35 #ifdef GAMEQC
36     this.m_model    =   MDL_Bullets_ITEM;
37 #endif
38     this.netname    =   "bullets";
39     this.m_name     =   "bullets";
40     this.m_icon     =   "ammo_bullets";
41 #ifdef SVQC
42     this.m_botvalue =   1500;
43     this.m_itemid   =   IT_NAILS;
44     this.m_iteminit =   ammo_bullets_init;
45 #endif
46 }
47
48 #ifdef GAMEQC
49 MODEL(Cells_ITEM, Item_Model("a_cells.md3"));
50 #endif
51
52 #ifdef SVQC
53 PROPERTY(int, g_pickup_cells);
54 void ammo_cells_init(entity item)
55 {
56     if(!item.ammo_cells)
57         item.ammo_cells = g_pickup_cells;
58 }
59 #endif
60 REGISTER_ITEM(Cells, Ammo) {
61 #ifdef GAMEQC
62     this.m_model    =   MDL_Cells_ITEM;
63 #endif
64     this.netname    =   "cells";
65     this.m_name     =   "cells";
66     this.m_icon     =   "ammo_cells";
67 #ifdef SVQC
68     this.m_botvalue =   1500;
69     this.m_itemid   =   IT_CELLS;
70     this.m_iteminit =   ammo_cells_init;
71 #endif
72 }
73
74 #ifdef GAMEQC
75 MODEL(Plasma_ITEM, Item_Model("a_cells.md3"));
76 #endif
77
78 #ifdef SVQC
79 PROPERTY(int, g_pickup_plasma);
80 void ammo_plasma_init(entity item)
81 {
82     if(!item.ammo_plasma)
83         item.ammo_plasma = g_pickup_plasma;
84 }
85 #endif
86 REGISTER_ITEM(Plasma, Ammo) {
87 #ifdef GAMEQC
88     this.m_model    =   MDL_Plasma_ITEM;
89 #endif
90     this.netname    =   "plasma";
91     this.m_name     =   "plasma";
92     this.m_icon     =   "ammo_plasma";
93 #ifdef SVQC
94     this.m_botvalue =   1500;
95     this.m_itemid   =   IT_PLASMA;
96     this.m_iteminit =   ammo_plasma_init;
97 #endif
98 }
99
100 #ifdef GAMEQC
101 MODEL(Rockets_ITEM, Item_Model("a_rockets.md3"));
102 #endif
103
104 #ifdef SVQC
105 PROPERTY(int, g_pickup_rockets);
106 void ammo_rockets_init(entity item)
107 {
108     if(!item.ammo_rockets)
109         item.ammo_rockets = g_pickup_rockets;
110 }
111 #endif
112 REGISTER_ITEM(Rockets, Ammo) {
113 #ifdef GAMEQC
114     this.m_model    =   MDL_Rockets_ITEM;
115 #endif
116     this.netname    =   "rockets";
117     this.m_name     =   "rockets";
118     this.m_icon     =   "ammo_rockets";
119 #ifdef SVQC
120     this.m_botvalue =   1500;
121     this.m_itemid   =   IT_ROCKETS;
122     this.m_iteminit =   ammo_rockets_init;
123 #endif
124 }
125
126 #ifdef GAMEQC
127 MODEL(Shells_ITEM, Item_Model("a_shells.md3"));
128 #endif
129
130 #ifdef SVQC
131 PROPERTY(int, g_pickup_shells);
132 void ammo_shells_init(entity item)
133 {
134     if(!item.ammo_shells)
135         item.ammo_shells = g_pickup_shells;
136 }
137 #endif
138 REGISTER_ITEM(Shells, Ammo) {
139 #ifdef GAMEQC
140     this.m_model    =   MDL_Shells_ITEM;
141 #endif
142     this.netname    =   "shells";
143     this.m_name     =   "shells";
144     this.m_icon     =   "ammo_shells";
145 #ifdef SVQC
146     this.m_botvalue =   1000;
147     this.m_itemid   =   IT_SHELLS;
148     this.m_iteminit =   ammo_shells_init;
149 #endif
150 }