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

  1. /***************************************************************************
  2.  * bonusbox.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_BONUSBOX_H
  17. #define SMC_BONUSBOX_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../objects/box.h"
  21. #include "../objects/powerup.h"
  22.  
  23. /* *** *** *** *** *** *** *** *** cBonusBox *** *** *** *** *** *** *** *** *** */
  24.  
  25. class cBonusBox : public cBaseBox
  26. {
  27. public:
  28.     // constructor
  29.     cBonusBox( float x, float y );
  30.     // create from stream
  31.     cBonusBox( CEGUI::XMLAttributes &attributes );
  32.     // destructor
  33.     virtual ~cBonusBox( void );
  34.  
  35.     // init defaults
  36.     void Init( void );
  37.  
  38.     // copy
  39.     virtual cBonusBox *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.     // sets the count this object can be activated
  47.     virtual void Set_Useable_Count( int count, bool new_startcount = 0 );
  48.     /* Set the bonus type
  49.      * TYPE_UNDEFINED            for empty
  50.      * TYPE_MUSHROOM_DEFAULT    for Mushroom
  51.      * TYPE_FIREPLANT            for Mushroom or Fireplant
  52.      * TYPE_MUSHROOM_BLUE        for Mushroom or Blue Mushroom
  53.      * TYPE_MUSHROOM_GHOST        for Mushroom or Ghost Mushroom
  54.      * TYPE_MUSHROOM_LIVE_1        for 1-UP Mushroom
  55.      * TYPE_JSTAR                for Star
  56.      * TYPE_GOLDPIECE            for Goldpiece
  57.      * TYPE_MUSHROOM_POISON        for Poison Mushroom
  58.     */
  59.     void Set_Bonus_Type( SpriteType nbonus_type );
  60.     /* Set if to force the best possible item
  61.      * and not to use lower items automatically
  62.     */
  63.     void Set_Force_Best_Item( bool enable );
  64.     // Set the gold color
  65.     void Set_Goldcolor( DefaultColor ncolor );
  66.  
  67.     // Activates the bonus item
  68.     virtual void Activate( void );
  69.  
  70.     // update
  71.     virtual void Update( void );
  72.     // draw
  73.     virtual void Draw( cSurfaceRequest *request = NULL );
  74.  
  75.     // if update is valid for the current state
  76.     virtual bool Is_Update_Valid( void );
  77.  
  78.     // ignore onground check
  79.     virtual void Check_on_Ground( void ) {};
  80.  
  81.     // level editor activation
  82.     virtual void Editor_Activate( void );
  83.     // level editor state update
  84.     virtual void Editor_State_Update( void );
  85.     // level editor events
  86.     bool Editor_Animation_Select( const CEGUI::EventArgs &event ); // editor animation option selected
  87.     bool Editor_Item_Select( const CEGUI::EventArgs &event ); // editor item option selected
  88.     bool Editor_Force_best_item_Select( const CEGUI::EventArgs &event ); // editor force best item option selected
  89.     bool Editor_Gold_Color_Select( const CEGUI::EventArgs &event ); // editor gold color option selected
  90.  
  91.     // force best possible item
  92.     bool force_best_item;
  93.  
  94.     /* active items
  95.      * list of active item is available
  96.      * and gets added to the level objects if finished
  97.     */
  98.     typedef vector<cMovingSprite *> MovingSpriteList;
  99.     MovingSpriteList active_items;
  100.     // Goldpiece color
  101.     DefaultColor gold_color;
  102. };
  103.  
  104. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  105.  
  106. #endif
  107.