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

  1. /***************************************************************************
  2.  * powerup.h  -  header 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_POWERUP_H
  17. #define SMC_POWERUP_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../objects/objectsprite.h"
  21.  
  22. /* *** *** *** *** *** cPowerUp *** *** *** *** *** *** *** *** *** *** *** *** */
  23.  
  24. class cPowerUp : public cImageObjectSprite
  25. {
  26. public:
  27.     // constructor
  28.     cPowerUp( float x = 0, float y = 0 );
  29.     // destructor
  30.     virtual ~cPowerUp( void );
  31.  
  32.     // load from savegame
  33.     virtual void Load_from_Savegame( cSave_Level_Object *save_object );
  34.     // save to savegame
  35.     virtual cSave_Level_Object *Save_to_Savegame( void );
  36.  
  37.     /* draw
  38.      * a spawned powerup doesn't draw in editor mode
  39.     */
  40.     virtual void Draw( cSurfaceRequest *request = NULL );
  41.  
  42.     // if update is valid for the current state
  43.     virtual bool Is_Update_Valid( void );
  44.  
  45.     /* Validate the given collision object
  46.      * returns 1 if an internal collision with this object is valid
  47.      * returns 2 if the given object collides with this object (blocking)
  48.     */
  49.     virtual unsigned int Validate_Collision( cSprite *obj );
  50.     // handle moved out of Level
  51.     virtual void Handle_out_of_Level( ObjectDirection dir );
  52.  
  53.     float counter;
  54. };
  55.  
  56. /* *** *** *** *** *** cMushroom *** *** *** *** *** *** *** *** *** *** *** *** */
  57.  
  58. class cMushroom : public cPowerUp
  59. {
  60. public:
  61.     // constructor
  62.     cMushroom( float x, float y );
  63.     // create from stream
  64.     cMushroom( CEGUI::XMLAttributes &attributes );
  65.     // destructor
  66.     virtual ~cMushroom( void );
  67.  
  68.     // init defaults
  69.     void Init( void );
  70.  
  71.     // copy
  72.     virtual cMushroom *Copy( void );
  73.  
  74.     // create from stream
  75.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  76.     // save to stream
  77.     virtual void Save_to_Stream( ofstream &file );
  78.  
  79.     // Set the Mushroom Type
  80.     void Set_Type( SpriteType ntype );
  81.  
  82.     // Activates the item
  83.     virtual void Activate( void );
  84.  
  85.     // update
  86.     virtual void Update( void );
  87.  
  88.     // collision with massive
  89.     virtual void Handle_Collision_Massive( cObjectCollision *collision );
  90.     // collision from a box
  91.     virtual void Handle_Collision_Box( ObjectDirection cdirection, GL_rect *r2 );
  92.  
  93.     // glim animation modifier
  94.     bool glim_mod;
  95. };
  96.  
  97. /* *** *** *** *** *** cFirePlant *** *** *** *** *** *** *** *** *** *** *** *** */
  98.  
  99. class cFirePlant : public cPowerUp
  100. {
  101. public:
  102.     // constructor
  103.     cFirePlant( float x, float y );
  104.     // destructor
  105.     virtual ~cFirePlant( void );
  106.  
  107.     // copy
  108.     virtual cFirePlant *Copy( void );
  109.  
  110.     // update
  111.     virtual void Update( void );
  112.  
  113.     // ignore onground check
  114.     virtual void Check_on_Ground( void ) {};
  115. };
  116.  
  117. /* *** *** *** *** *** cMoon *** *** *** *** *** *** *** *** *** *** *** *** */
  118.  
  119. class cMoon : public cPowerUp
  120. {
  121. public:
  122.     // constructor
  123.     cMoon( float x, float y );
  124.     // create from stream
  125.     cMoon( CEGUI::XMLAttributes &attributes );
  126.     // destructor
  127.     virtual ~cMoon( void );
  128.  
  129.     // init defaults
  130.     void Init( void );
  131.  
  132.     // copy
  133.     virtual cMoon *Copy( void );
  134.  
  135.     // create from stream
  136.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  137.     // save to stream
  138.     virtual void Save_to_Stream( ofstream &file );
  139.  
  140.     // update
  141.     virtual void Update( void );
  142.  
  143.     // ignore onground check
  144.     virtual void Check_on_Ground( void ) {};
  145.  
  146.     float particle_counter;
  147. };
  148.  
  149. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  150.  
  151. #endif
  152.