#pragma once #include #include #ifdef SVQC // For FL_POWERUP #include #include #endif #ifdef GAMEQC MODEL(Invisibility_ITEM, Item_Model("g_strength.md3")); SOUND(Invisibility, Item_Sound("powerup")); #endif #ifdef SVQC .float invisibility_finished; float autocvar_g_balance_powerup_invisibility_alpha = 0.15; float autocvar_g_balance_powerup_invisibility_time = 30; void powerup_invisibility_init(Pickup this, entity item) { if(!item.invisibility_finished) item.invisibility_finished = autocvar_g_balance_powerup_invisibility_time; } #endif REGISTER_ITEM(Invisibility, Powerup) { this.m_canonical_spawnfunc = "item_invisibility"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; // TODO: ITEM_FLAG_NORMAL (once it has a model!) this.m_model = MDL_Invisibility_ITEM; this.m_sound = SND_Invisibility; this.m_glow = true; this.m_respawnsound = SND_STRENGTH_RESPAWN; #endif this.netname = "invisibility"; this.m_name = _("Invisibility"); this.m_icon = "buff_invisible"; this.m_color = '0.5 0.5 1'; this.m_waypoint = _("Invisibility"); this.m_waypointblink = 2; #ifdef GAMEQC this.m_itemid = IT_INVISIBILITY; #endif #ifdef SVQC this.m_iteminit = powerup_invisibility_init; #endif } SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility) // compat SPAWNFUNC_ITEM(item_invis, ITEM_Invisibility) CLASS(Invisibility, Powerups) ATTRIB(Invisibility, netname, string, "invisibility"); ATTRIB(Invisibility, m_name, string, _("Invisibility")); ATTRIB(Invisibility, m_color, vector, '0.5 0.5 1'); ATTRIB(Invisibility, m_icon, string, "buff_invisible"); ENDCLASS(Invisibility) REGISTER_STATUSEFFECT(Invisibility, NEW(Invisibility));