home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / enemies / gee.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  3.8 KB  |  130 lines

  1. /***************************************************************************
  2.  * gee.h  -  headers for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2006 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_GEE_H
  17. #define SMC_GEE_H
  18.  
  19. #include "../enemies/enemy.h"
  20.  
  21. /* *** *** *** *** *** cGee *** *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. /*
  24.  * Shocks you with Electro, Lava or Gift
  25. */
  26. class cGee : public cEnemy
  27. {
  28. public:
  29.     // constructor
  30.     cGee( float x, float y );
  31.     // create from stream
  32.     cGee( CEGUI::XMLAttributes &attributes );
  33.     // destructor
  34.     virtual ~cGee( void );
  35.  
  36.     // init defaults
  37.     void Init( void );
  38.     // copy
  39.     virtual cGee *Copy( void );
  40.  
  41.     // create from stream
  42.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  43.     // save to stream
  44.     virtual void Save_to_Stream( ofstream &file );
  45.  
  46.     // load from savegame
  47.     virtual void Load_from_Savegame( cSave_Level_Object *save_object );
  48.  
  49.     // Set Direction
  50.     void Set_Direction( ObjectDirection dir );
  51.     // Set Max Distance
  52.     void Set_Max_Distance( int nmax_distance );
  53.     // set color
  54.     void Set_Color( DefaultColor col );
  55.  
  56.     /* downgrade state ( if already weakest state : dies )
  57.      * force : usually dies or a complete downgrade
  58.     */
  59.     virtual void DownGrade( bool force = 0 );
  60.     virtual void DieStep( void );
  61.  
  62.     // update
  63.     virtual void Update( void );
  64.     // draw
  65.     virtual void Draw( cSurfaceRequest *request = NULL );
  66.  
  67.     // Start Movement
  68.     void Activate( void );
  69.     // Stop Movement
  70.     void Stop( void );
  71.  
  72.     // generate small cloud particles ( for moving )
  73.     void Generate_Particles( void );
  74.  
  75.     // ignore onground check
  76.     virtual void Check_on_Ground( void ) {};
  77.     // Check if out of max distance
  78.     bool Check_Max_Distance( void );
  79.  
  80.     // if update is valid for the current state
  81.     virtual bool Is_Update_Valid( void );
  82.     // if draw is valid for the current state and position
  83.     virtual bool Is_Draw_Valid( void );
  84.  
  85.     /* Validate the given collision object
  86.      * returns 1 if an internal collision with this object is valid
  87.      * returns 2 if the given object collides with this object (blocking)
  88.     */
  89.     virtual unsigned int Validate_Collision( cSprite *obj );
  90.     // collision from player
  91.     virtual void Handle_Collision_Player( cObjectCollision *collision );
  92.  
  93.     // leveleditor activation
  94.     virtual void Editor_Activate( void );
  95.     // leveleditor events
  96.     bool Editor_Max_Distance_Key( const CEGUI::EventArgs &event );  // editor max distance key up
  97.     bool Editor_Always_Fly_Select( const CEGUI::EventArgs &event ); // editor always fly option selected
  98.     bool Editor_Wait_Time_Key( const CEGUI::EventArgs &event );  // editor wait time key up
  99.     bool Editor_Fly_Distance_Key( const CEGUI::EventArgs &event );  // editor fly distance key up
  100.  
  101.     // color
  102.     DefaultColor color_type;
  103.  
  104.     // destination direction velocity
  105.     float dest_velx, dest_vely;
  106.     // maximum distance from the startposition
  107.     int max_distance;
  108.     // always fly around
  109.     bool always_fly;
  110.     // time to wait until next movement
  111.     float wait_time;
  112.     // fly distance
  113.     int fly_distance;
  114.  
  115.     // wait time counter
  116.     float wait_time_counter;
  117.     // fly distance counter
  118.     float fly_distance_counter;
  119.     // clouds particle counter
  120.     float clouds_counter;
  121.  
  122. private:
  123.     // Create the Name from the current settings
  124.     void Create_Name( void );
  125. };
  126.  
  127. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  128.  
  129. #endif
  130.