/* $Id: bonusinvisible.hpp,v 1.3 2005/10/05 14:46:44 chfreund Exp $ */ #ifndef _BONUSINVISIBLE_HPP_ #define _BONUSINVISIBLE_HPP_ /**********************************************************/ #include "bonus.hpp" #include "invisiblecorona.hpp" /**********************************************************/ //! bonus, that creates a protective invisible class BonusInvisible : public Bonus { public: BonusInvisible( World* wp ); ~BonusInvisible(); //! reimplemented from base class Object inline Sint32 getID() const { return BONUS_INVISIBLE; } //! reimplemented from base class Bonus inline bool isWeapon() const { return false; } inline void setProtectionTime( Sint32 protectionTime ) { m_protectionTime = protectionTime; } //! \name functions for the interaction with avatars //@{ //! invisible boni can always be picked up inline bool canBePickedUpByAvatar( const Avatar* const avatar ) { return true; } //! do not generate blue glow virtual void beingPickedUp( const Avatar* const avatar ) {} virtual void apply( Avatar* const avatar ); //! adds two invisible boni void add( const Bonus *const bonus ); //! update for the invisible bonus in the avtar's bonus pack bool updateInBonusPack( Avatar *const avatar ); //! invisible boni must be put into the bonus pack of the avatar inline bool mustBePutIntoPack() const { return true; } //@} //! \name (de)serialization //@{ virtual Uint32 getSerializeBufferSize() const; virtual void serialize( Uint8*& bufferPointer ) const; virtual void deserialize( Uint8*& bufferPointer ); //@} protected: //! number of frames left until the invisible loses its effect Sint32 m_protectionTime; //! pointer to the invisiblecorona InvisibleCorona *m_corona; }; /**********************************************************/ #endif // _BONUSINVISIBLE_HPP_