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;
22 REGISTRY(Nades, BITS(4))
23 #define Nades_from(i) _Nades_from(i, NADE_TYPE_Null)
24 REGISTER_REGISTRY(Nades)
27 #define REGISTER_NADE(id) REGISTER(Nades, NADE_TYPE, id, m_id, NEW(Nade))
30 ATTRIB(Nade, m_id, int, 0);
31 ATTRIB(Nade, m_color, vector, '0 0 0');
32 ATTRIB(Nade, m_name, string, _("Grenade"));
33 ATTRIB(Nade, m_icon, string, "nade_normal");
34 ATTRIBARRAY(Nade, m_projectile, int, 2);
35 ATTRIBARRAY(Nade, m_trail, entity, 2);
36 METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) {
37 returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon));
43 Nade Nade_FromProjectile(int proj)
45 FOREACH(Nades, true, LAMBDA(
46 for (int j = 0; j < 2; j++)
48 if (it.m_projectile[j] == proj) return it;
51 return NADE_TYPE_Null;
55 #include "effects.inc"
67 .float nade_timer = _STAT(NADE_TIMER);
69 .float bonus_nades = _STAT(NADE_BONUS);
70 .float nade_special_time;
71 .float bonus_nade_score = _STAT(NADE_BONUS_SCORE);
72 .int nade_type = _STAT(NADE_BONUS_TYPE);
73 .string pokenade_type;
74 .entity nade_damage_target;
75 .float cvar_cl_nade_type;
76 .string cvar_cl_pokenade_type;
78 .float stat_healing_orb = _STAT(HEALING_ORB);
79 .float stat_healing_orb_alpha = _STAT(HEALING_ORB_ALPHA);
80 .float nade_show_particles;
82 bool orb_send(entity this, entity to, int sf);
84 // Remove nades that are being thrown
85 void nades_Clear(entity player);
87 // Give a bonus grenade to a player
88 void nades_GiveBonus(entity player, float score);
91 * called to adjust nade damage and force on hit
93 #define EV_Nade_Damage(i, o) \
94 /** nade */ i(entity, MUTATOR_ARGV_0_entity) \
95 /** weapon */ i(entity, MUTATOR_ARGV_1_entity) \
96 /** force */ i(vector, MUTATOR_ARGV_2_vector) \
97 /**/ o(vector, MUTATOR_ARGV_2_vector) \
98 /** damage */ i(float, MUTATOR_ARGV_3_float) \
99 /**/ o(float, MUTATOR_ARGV_3_float) \
101 MUTATOR_HOOKABLE(Nade_Damage, EV_Nade_Damage);