#ifndef NADES_ALL_H #define NADES_ALL_H #include "../teams.qh" .float healer_lifetime; .float healer_radius; // use slots 70-100 const int PROJECTILE_NADE = 71; const int PROJECTILE_NADE_BURN = 72; const int PROJECTILE_NADE_NAPALM = 73; const int PROJECTILE_NADE_NAPALM_BURN = 74; const int PROJECTILE_NAPALM_FOUNTAIN = 75; const int PROJECTILE_NADE_ICE = 76; const int PROJECTILE_NADE_ICE_BURN = 77; const int PROJECTILE_NADE_TRANSLOCATE = 78; const int PROJECTILE_NADE_SPAWN = 79; const int PROJECTILE_NADE_HEAL = 80; const int PROJECTILE_NADE_HEAL_BURN = 81; const int PROJECTILE_NADE_MONSTER = 82; const int PROJECTILE_NADE_MONSTER_BURN = 83; REGISTRY(Nades, BIT(3)) REGISTER_REGISTRY(RegisterNades) #define REGISTER_NADE(id) REGISTER(RegisterNades, NADE_TYPE, Nades, id, m_id, NEW(Nade)) CLASS(Nade, Object) ATTRIB(Nade, m_id, int, 0) ATTRIB(Nade, m_color, vector, '0 0 0') ATTRIB(Nade, m_name, string, _("Grenade")) ATTRIB(Nade, m_icon, string, "nade_normal") ATTRIBARRAY(Nade, m_projectile, int, 2) ATTRIBARRAY(Nade, m_trail, entity, 2) METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); } ENDCLASS(Nade) REGISTER_NADE(Null); #ifdef SVQC bool healer_send(entity this, entity to, int sf); #endif entity Nade_FromProjectile(float proj) { FOREACH(Nades, true, LAMBDA( for (int j = 0; j < 2; j++) { if (it.m_projectile[j] == proj) return it; } )); return NADE_TYPE_Null; } entity Nade_TrailEffect(int proj, int nade_team) { switch (proj) { case PROJECTILE_NADE: return EFFECT_NADE_TRAIL(nade_team); case PROJECTILE_NADE_BURN: return EFFECT_NADE_TRAIL_BURN(nade_team); } FOREACH(Nades, true, LAMBDA( for (int j = 0; j < 2; j++) { if (it.m_projectile[j] == proj) { string trail = it.m_trail[j].eent_eff_name; if (trail) return it.m_trail[j]; break; } } )); return EFFECT_Null; } #include "all.inc" #endif