/* $Id: missile.hpp,v 1.12.4.1 2006/01/20 11:33:53 chfreund Exp $ */ #ifndef _MISSILE_HPP_ #define _MISSILE_HPP_ /**********************************************************/ #include #include "global.hpp" #include "constants.hpp" #include "collidableobject.hpp" #include "audio.hpp" #include "vector.hpp" #include "counter.hpp" /**********************************************************/ class Missile : public CollidableObject { friend class WeaponMissile; public: Missile(); bool initialize( const Vector& pos, const Vector& vel, const Uint8 owner, const Sint32 nShrapnels, const Sint32 damage, const real accelTime, const Vector& thrust ); virtual Sint32 getID() const { return MISSILE; } virtual void update(); virtual bool collidedWithObstacle( const Sint32 colX, const Sint32 colY ); virtual void explode( void ); virtual int applyDamage( const Particles::ParticleData& p ); void updateSpriteSelection(); //! returns the ID of the missile's owner Uint8 getOwner() const { return m_owner; } //! sets the ID of the missile's owner void setOwner( const Uint8 newOwner ) { m_owner = newOwner; } virtual void serialize( Uint8*& bufferPointer ) const; virtual void deserialize( Uint8*& bufferPointer ); virtual Uint32 getSerializeBufferSize() const; virtual void dump( std::ostream& out ) const; protected: Uint8 m_owner; //!< player ID (Player::getPlayerID()) of the owner Sint32 m_nShrapnels; Sint32 m_damage; SignalCounter m_accelTimer; Vector m_thrust; real m_AccumulatedDT; static Mix_Chunk* m_explodeSample, * m_damageSample; }; /**********************************************************/ #endif /* _MISSILE_HPP_ */