]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/ammo.qh
Merge branch 'master' into Mario/killsound
[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 #endif
33 REGISTER_ITEM(Bullets, Ammo) {
34 #ifdef GAMEQC
35     this.m_model    =   MDL_Bullets_ITEM;
36 #endif
37     this.netname    =   "bullets";
38     this.m_name     =   "bullets";
39     this.m_icon     =   "ammo_bullets";
40 #ifdef SVQC
41     this.m_botvalue =   1500;
42     this.m_itemid   =   IT_NAILS;
43     this.m_iteminit =   ammo_bullets_init;
44 #endif
45 }
46
47 #ifdef GAMEQC
48 MODEL(Cells_ITEM, Item_Model("a_cells.md3"));
49 #endif
50
51 #ifdef SVQC
52 PROPERTY(int, g_pickup_cells);
53 void ammo_cells_init(entity item)
54 {
55     if(!item.ammo_cells)
56         item.ammo_cells = g_pickup_cells;
57 }
58 #endif
59 REGISTER_ITEM(Cells, Ammo) {
60 #ifdef GAMEQC
61     this.m_model    =   MDL_Cells_ITEM;
62 #endif
63     this.netname    =   "cells";
64     this.m_name     =   "cells";
65     this.m_icon     =   "ammo_cells";
66 #ifdef SVQC
67     this.m_botvalue =   1500;
68     this.m_itemid   =   IT_CELLS;
69     this.m_iteminit =   ammo_cells_init;
70 #endif
71 }
72
73 #ifdef GAMEQC
74 MODEL(Plasma_ITEM, Item_Model("a_cells.md3"));
75 #endif
76
77 #ifdef SVQC
78 PROPERTY(int, g_pickup_plasma);
79 void ammo_plasma_init(entity item)
80 {
81     if(!item.ammo_plasma)
82         item.ammo_plasma = g_pickup_plasma;
83 }
84 #endif
85 REGISTER_ITEM(Plasma, Ammo) {
86 #ifdef GAMEQC
87     this.m_model    =   MDL_Plasma_ITEM;
88 #endif
89     this.netname    =   "plasma";
90     this.m_name     =   "plasma";
91     this.m_icon     =   "ammo_plasma";
92 #ifdef SVQC
93     this.m_botvalue =   1500;
94     this.m_itemid   =   IT_PLASMA;
95     this.m_iteminit =   ammo_plasma_init;
96 #endif
97 }
98
99 #ifdef GAMEQC
100 MODEL(Rockets_ITEM, Item_Model("a_rockets.md3"));
101 #endif
102
103 #ifdef SVQC
104 PROPERTY(int, g_pickup_rockets);
105 void ammo_rockets_init(entity item)
106 {
107     if(!item.ammo_rockets)
108         item.ammo_rockets = g_pickup_rockets;
109 }
110 #endif
111 REGISTER_ITEM(Rockets, Ammo) {
112 #ifdef GAMEQC
113     this.m_model    =   MDL_Rockets_ITEM;
114 #endif
115     this.netname    =   "rockets";
116     this.m_name     =   "rockets";
117     this.m_icon     =   "ammo_rockets";
118 #ifdef SVQC
119     this.m_botvalue =   1500;
120     this.m_itemid   =   IT_ROCKETS;
121     this.m_iteminit =   ammo_rockets_init;
122 #endif
123 }
124
125 #ifdef GAMEQC
126 MODEL(Shells_ITEM, Item_Model("a_shells.md3"));
127 #endif
128
129 #ifdef SVQC
130 PROPERTY(int, g_pickup_shells);
131 void ammo_shells_init(entity item)
132 {
133     if(!item.ammo_shells)
134         item.ammo_shells = g_pickup_shells;
135 }
136 #endif
137 REGISTER_ITEM(Shells, Ammo) {
138 #ifdef GAMEQC
139     this.m_model    =   MDL_Shells_ITEM;
140 #endif
141     this.netname    =   "shells";
142     this.m_name     =   "shells";
143     this.m_icon     =   "ammo_shells";
144 #ifdef SVQC
145     this.m_botvalue =   1000;
146     this.m_itemid   =   IT_SHELLS;
147     this.m_iteminit =   ammo_shells_init;
148 #endif
149 }