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