3 #include <common/teams.qh>
6 const int PROJECTILE_NADE = 71;
7 const int PROJECTILE_NADE_BURN = 72;
8 const int PROJECTILE_NADE_NAPALM = 73;
9 const int PROJECTILE_NADE_NAPALM_BURN = 74;
10 const int PROJECTILE_NAPALM_FOUNTAIN = 75;
11 const int PROJECTILE_NADE_ICE = 76;
12 const int PROJECTILE_NADE_ICE_BURN = 77;
13 const int PROJECTILE_NADE_TRANSLOCATE = 78;
14 const int PROJECTILE_NADE_SPAWN = 79;
15 const int PROJECTILE_NADE_HEAL = 80;
16 const int PROJECTILE_NADE_HEAL_BURN = 81;
17 const int PROJECTILE_NADE_MONSTER = 82;
18 const int PROJECTILE_NADE_MONSTER_BURN = 83;
19 const int PROJECTILE_NADE_ENTRAP = 84;
20 const int PROJECTILE_NADE_ENTRAP_BURN = 85;
21 const int PROJECTILE_NADE_VEIL = 86;
22 const int PROJECTILE_NADE_VEIL_BURN = 87;
24 REGISTRY(Nades, BITS(4))
25 #define Nades_from(i) _Nades_from(i, NADE_TYPE_Null)
26 REGISTER_REGISTRY(Nades)
29 #define REGISTER_NADE(id) REGISTER(Nades, NADE_TYPE, id, m_id, NEW(Nade))
32 ATTRIB(Nade, m_id, int, 0);
33 ATTRIB(Nade, m_color, vector, '0 0 0');
34 ATTRIB(Nade, m_name, string, _("Grenade"));
35 ATTRIB(Nade, m_icon, string, "nade_normal");
36 ATTRIB(Nade, m_alpha, float, 1);
37 ATTRIBARRAY(Nade, m_projectile, int, 2);
38 ATTRIBARRAY(Nade, m_trail, entity, 2);
39 METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) {
40 returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon));
46 Nade Nade_FromProjectile(int proj)
48 FOREACH(Nades, true, {
49 for (int j = 0; j < 2; j++)
51 if (it.m_projectile[j] == proj) return it;
54 return NADE_TYPE_Null;
58 #include "effects.inc"
71 .float nade_special_time;
72 .string pokenade_type;
73 .entity nade_damage_target;
74 .float cvar_cl_nade_type;
75 .string cvar_cl_pokenade_type;
77 .float nade_show_particles;
78 .float nade_veil_prevalpha;
80 bool orb_send(entity this, entity to, int sf);
82 // Remove nades that are being thrown
83 void nades_Clear(entity player);
85 // Give a bonus grenade to a player
86 void nades_GiveBonus(entity player, float score);
89 * called to adjust nade damage and force on hit
91 #define EV_Nade_Damage(i, o) \
92 /** nade */ i(entity, MUTATOR_ARGV_0_entity) \
93 /** weapon */ i(entity, MUTATOR_ARGV_1_entity) \
94 /** force */ i(vector, MUTATOR_ARGV_2_vector) \
95 /**/ o(vector, MUTATOR_ARGV_2_vector) \
96 /** damage */ i(float, MUTATOR_ARGV_3_float) \
97 /**/ o(float, MUTATOR_ARGV_3_float) \
99 MUTATOR_HOOKABLE(Nade_Damage, EV_Nade_Damage);
104 bool Projectile_isnade(int proj); // TODO: remove
106 void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator