//----------------------------------------------------------------------------- // Nightfall - amckern - amckern@yahoo.com //----------------------------------------------------------------------------- // Purpose: Nightvision //----------------------------------------------------------------------------- // Code based on www.planethalflife.com/hlprogramming/old/tuts/tut_nvcrossbow.htm // Shader code results, based on Dystopia's "Predy" Mode // Warning, this file is not to be made public, with out the premision from // Adam "amckern" McKern - amckern@yahoo.com //----------------------------------------------------------------------------- // (C) 2005 Nigredo Stuios, and Adam McKern //----------------------------------------------------------------------------- // We include all the usual files for weapons... #include "cbase.h" #include "beam_shared.h" //...But making sure to add "beam_shared.h" between them. // We are going to need it for our weapon's beam effects. #include "NPCEvent.h" #include "basehlcombatweapon.h" #include "basecombatcharacter.h" #include "AI_BaseNPC.h" #include "player.h" #include "gamerules.h" #include "in_buttons.h" #include "IEffects.h" #include "sprite.h" #include "soundent.h" #include "game.h" #include "vstdlib/random.h" #include "engine/IEngineSound.h" #include "te_effect_dispatch.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" //----------------------------------------------------------------------------- // CWeaponDominator //----------------------------------------------------------------------------- // We must declare our weapon class by extending the BaseHLCombatWeapon class. class CWeaponNightVision : public CBaseHLCombatWeapon { DECLARE_CLASS( CWeaponNightVision, CBaseHLCombatWeapon ); public: // Then, we need to declare all of our functions: CWeaponNightVision( void ); // Our constructor. void PrimaryAttack( void ); // The primary attack. void ClearBrainwash( void ); // Secondary attack. void KillBrainwashed( void ); // Third attack. void ControlBrainwashed( void ); // Forth attack. }; // Now do all this funky Valve stuff to declare our weapon's entity and so on. LINK_ENTITY_TO_CLASS( weapon_nvis, CWeaponNightVision ); PRECACHE_WEAPON_REGISTER( weapon_nvis ); IMPLEMENT_SERVERCLASS_ST( CWeaponNightVision, DT_WeaponNVis ) END_SEND_TABLE() BEGIN_DATADESC( CWeaponNVis ) END_DATADESC() //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- // Our weapon's constructor will just initialize our EHANDLE to a null value // and set a pair of the BaseHLCombatWeapon Class variables. CWeaponDominator::CWeaponDominator( void ) { m_bReloadsSingly = false;// The weapon doesn't reload at all, so... m_bFiresUnderwater = true; // Let's make it fire underwater. // CurrentEnemy = NULL; // And initialize our EHANDLE. } /* //Fades Away to Normal Vision UTIL_ScreenFade( m_pPlayer, Vector(0,255,0), 0.01, 0.5, 128, FFADE_IN); //Fades into Green Night Vision UTIL_ScreenFade( m_pPlayer, Vector(0,255,0), 1, 0.5, 128, FFADE_OUT | FFADE_STAYOUT); */