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

  1. /***************************************************************************
  2.  * krush.h  -  headers for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2004 - 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_KRUSH_H
  17. #define SMC_KRUSH_H
  18.  
  19. #include "../enemies/enemy.h"
  20.  
  21. /* *** *** *** *** *** Krush states *** *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. enum Krush_state
  24. {
  25.     KRUSH_DEAD        = 0,
  26.     KRUSH_WALK        = 1,
  27.     KRUSH_SMALL        = 2,
  28. };
  29.  
  30. /* *** *** *** *** *** cKrush *** *** *** *** *** *** *** *** *** *** *** *** */
  31.  
  32. class cKrush : public cEnemy
  33. {
  34. /* Krush
  35.  * Walking all Day and doesn't stop even if you hit him the first time :O
  36.  * but the second time he's out.
  37.  * Colors : Red
  38.  */
  39. public:
  40.     // constructor
  41.     cKrush( float x, float y );
  42.     // create from stream
  43.     cKrush( CEGUI::XMLAttributes &attributes );
  44.     // destructor
  45.     virtual ~cKrush( void );
  46.  
  47.     // init defaults
  48.     void Init( void );
  49.     // copy
  50.     virtual cKrush *Copy( void );
  51.  
  52.     // create from stream
  53.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  54.     // save to stream
  55.     virtual void Save_to_Stream( ofstream &file );
  56.  
  57.     // load from savegame
  58.     virtual void Load_from_Savegame( cSave_Level_Object *save_object );
  59.     // save to savegame
  60.     virtual cSave_Level_Object *Save_to_Savegame( void );
  61.  
  62.     // Set Direction
  63.     void Set_Direction( ObjectDirection dir );
  64.  
  65.     /* downgrade state ( if already weakest state : dies )
  66.      * force : usually dies or a complete downgrade
  67.     */
  68.     virtual void DownGrade( bool force = 0 );
  69.     virtual void DieStep( void );
  70.  
  71.     // update
  72.     virtual void Update( void );
  73.  
  74.     // if update is valid for the current state
  75.     virtual bool Is_Update_Valid( void );
  76.  
  77.     /* Validate the given collision object
  78.      * returns 1 if an internal collision with this object is valid
  79.      * returns 2 if the given object collides with this object (blocking)
  80.     */
  81.     virtual unsigned int Validate_Collision( cSprite *obj );
  82.     // collision from player
  83.     virtual void Handle_Collision_Player( cObjectCollision *collision );
  84.     // collision from an enemy
  85.     virtual void Handle_Collision_Enemy( cObjectCollision *collision );
  86.     // collision with massive
  87.     virtual void Handle_Collision_Massive( cObjectCollision *collision );
  88.  
  89.     // Krush state
  90.     Krush_state krush_state;
  91.  
  92.     // speed
  93.     float speed;
  94. };
  95.  
  96. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  97.  
  98. #endif
  99.