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

  1. /***************************************************************************
  2.  * rokko.h  -  headers for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2003 - 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_ROKKO_H
  17. #define SMC_ROKKO_H
  18.  
  19. #include "../enemies/enemy.h"
  20.  
  21. /* *** *** *** *** *** *** cRokko *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. /*    A giant, slow-moving bullet
  24.  */
  25. class cRokko : public cEnemy 
  26. {
  27. public:
  28.     // constructor
  29.     cRokko( float x, float y );
  30.     // create from stream
  31.     cRokko( CEGUI::XMLAttributes &attributes );
  32.     // destructor
  33.     virtual ~cRokko( void );
  34.  
  35.     // init defaults
  36.     void Init( void );
  37.     // copy
  38.     virtual cRokko *Copy( void );
  39.  
  40.     // create from stream
  41.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  42.     // save to stream
  43.     virtual void Save_to_Stream( ofstream &file );
  44.  
  45.     // load from savegame
  46.     virtual void Load_from_Savegame( cSave_Level_Object *save_object );
  47.  
  48.     // Set Direction
  49.     void Set_Direction( ObjectDirection dir );
  50.     // set flying speed
  51.     void Set_Speed( float nspeed );
  52.     // Set max detection distance for the front
  53.     void Set_Max_Distance_Front( float distance );
  54.     // Set max detection distance for the sides
  55.     void Set_Max_Distance_Sides( float distance );
  56.     // activate
  57.     void Activate( void );
  58.  
  59.     /* downgrade state ( if already weakest state : dies )
  60.      * force : usually dies or a complete downgrade
  61.     */
  62.     virtual void DownGrade( bool force = 0 );
  63.     virtual void DieStep( void );
  64.  
  65.     // update
  66.     virtual void Update( void );
  67.     // draw
  68.     virtual void Draw( cSurfaceRequest *request = NULL );
  69.  
  70.     // update the distance rect
  71.     void Update_Distance_rect( void );
  72.     // Get the final distance rect
  73.     GL_rect Get_Final_Distance_Rect( void );
  74.  
  75.     // Generates Smoke Particles
  76.     void Generate_Smoke( unsigned int quota = 10 );
  77.  
  78.     // if update is valid for the current state
  79.     virtual bool Is_Update_Valid( void );
  80.     // if draw is valid for the current state and position
  81.     virtual bool Is_Draw_Valid( void );
  82.  
  83.     // ignore onground check
  84.     virtual void Check_on_Ground( void ) {};
  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.     // handle moved out of Level
  93.     virtual void Handle_out_of_Level( ObjectDirection dir );
  94.  
  95.     // leveleditor activation
  96.     virtual void Editor_Activate( void );
  97.     // leveleditor events
  98.     bool Editor_Speed_Key( const CEGUI::EventArgs &event );  // editor speed key up
  99.  
  100.     // smoke particle counter
  101.     float smoke_counter;
  102.     // flying speed
  103.     float speed;
  104.     // maximum detection distance for the front
  105.     float max_distance_front;
  106.     // maximum detection distance for the sides
  107.     float max_distance_sides;
  108.     // detection distance rect
  109.     GL_rect distance_rect;
  110. };
  111.  
  112. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  113.  
  114. #endif
  115.