4 #include <common/items/all.qh>
6 #include <common/t_items.qh>
7 #include <server/resources.qh>
17 .int ammo_plasma = _STAT(PLASMA);
18 .int ammo_fuel = _STAT(FUEL);
30 PROPERTY(float, g_pickup_ammo_anyway);
35 ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc);
36 ATTRIB(Ammo, m_respawntime, float(), GET(g_pickup_respawntime_ammo));
37 ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo));
38 ATTRIB(Ammo, m_pickupanyway, float(), GET(g_pickup_ammo_anyway));
44 MODEL(Bullets_ITEM, Item_Model("a_bullets.mdl"));
48 PROPERTY(int, g_pickup_nails);
49 void ammo_bullets_init(Pickup this, entity item)
51 if(!GetResourceAmount(item, RESOURCE_BULLETS))
52 SetResourceAmountExplicit(item, RESOURCE_BULLETS, g_pickup_nails);
59 REGISTER_ITEM(Bullets, Bullets) {
60 this.m_canonical_spawnfunc = "item_bullets";
62 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
63 this.m_model = MDL_Bullets_ITEM;
65 this.netname = "bullets";
66 this.m_name = "bullets";
67 this.m_icon = "ammo_bullets";
69 this.m_botvalue = 1500;
70 this.m_itemid = IT_NAILS;
71 this.m_iteminit = ammo_bullets_init;
75 SPAWNFUNC_ITEM(item_bullets, ITEM_Bullets)
78 MODEL(Cells_ITEM, Item_Model("a_cells.md3"));
82 PROPERTY(int, g_pickup_cells);
83 void ammo_cells_init(Pickup this, entity item)
85 if(!GetResourceAmount(item, RESOURCE_CELLS))
86 SetResourceAmountExplicit(item, RESOURCE_CELLS, g_pickup_cells);
89 REGISTER_ITEM(Cells, Ammo) {
90 this.m_canonical_spawnfunc = "item_cells";
92 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
93 this.m_model = MDL_Cells_ITEM;
95 this.netname = "cells";
96 this.m_name = "cells";
97 this.m_icon = "ammo_cells";
99 this.m_botvalue = 1500;
100 this.m_itemid = IT_CELLS;
101 this.m_iteminit = ammo_cells_init;
105 SPAWNFUNC_ITEM(item_cells, ITEM_Cells)
108 MODEL(Plasma_ITEM, Item_Model("a_cells.md3"));
112 PROPERTY(int, g_pickup_plasma);
113 void ammo_plasma_init(Pickup this, entity item)
115 if(!GetResourceAmount(item, RESOURCE_PLASMA))
116 SetResourceAmountExplicit(item, RESOURCE_PLASMA, g_pickup_plasma);
119 REGISTER_ITEM(Plasma, Ammo) {
120 this.m_canonical_spawnfunc = "item_plasma";
122 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
123 this.m_model = MDL_Plasma_ITEM;
125 this.netname = "plasma";
126 this.m_name = "plasma";
127 this.m_icon = "ammo_plasma";
129 this.m_botvalue = 1500;
130 this.m_itemid = IT_PLASMA;
131 this.m_iteminit = ammo_plasma_init;
135 SPAWNFUNC_ITEM(item_plasma, ITEM_Plasma)
138 MODEL(Rockets_ITEM, Item_Model("a_rockets.md3"));
142 PROPERTY(int, g_pickup_rockets);
143 void ammo_rockets_init(Pickup this, entity item)
145 if(!GetResourceAmount(item, RESOURCE_ROCKETS))
146 SetResourceAmountExplicit(item, RESOURCE_ROCKETS, g_pickup_rockets);
149 REGISTER_ITEM(Rockets, Ammo) {
150 this.m_canonical_spawnfunc = "item_rockets";
152 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
153 this.m_model = MDL_Rockets_ITEM;
155 this.netname = "rockets";
156 this.m_name = "rockets";
157 this.m_icon = "ammo_rockets";
159 this.m_botvalue = 1500;
160 this.m_itemid = IT_ROCKETS;
161 this.m_iteminit = ammo_rockets_init;
165 SPAWNFUNC_ITEM(item_rockets, ITEM_Rockets)
168 MODEL(Shells_ITEM, Item_Model("a_shells.md3"));
172 PROPERTY(int, g_pickup_shells);
173 void ammo_shells_init(Pickup this, entity item)
175 if(!GetResourceAmount(item, RESOURCE_SHELLS))
176 SetResourceAmountExplicit(item, RESOURCE_SHELLS, g_pickup_shells);
183 REGISTER_ITEM(Shells, Shells) {
184 this.m_canonical_spawnfunc = "item_shells";
186 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
187 this.m_model = MDL_Shells_ITEM;
189 this.netname = "shells";
190 this.m_name = "shells";
191 this.m_icon = "ammo_shells";
193 this.m_botvalue = 1000;
194 this.m_itemid = IT_SHELLS;
195 this.m_iteminit = ammo_shells_init;
199 SPAWNFUNC_ITEM(item_shells, ITEM_Shells)