Logo Search packages:      
Sourcecode: rafkill version File versions  Download package


#ifndef _hull_h_
#define _hull_h_

#include "allegro.h"
class ECollide;
class WeaponObject;
class SpaceObject;
class Section;

class HullObject{

      //c = color
      //l = life
      //s = strength
      //num_guns = number of guns
      //dl = drawing plane
      HullObject( BITMAP * _drawBitmap, double _life, double _strength, int num_guns, int level, int _drawing_plane, bool _trans, ECollide * ec );

      //process: determines if point is within hull
      virtual bool Inside( int mx, int my, int ax, int ay );

      //tells the hull it has been moved
      virtual void Moved( double _dx, double _dy, double _ax, double _ay );

      //process: draws hull onto bitmap
      virtual void Draw( BITMAP * who, int x, int y );

      virtual BITMAP * getShadow();
      //Shadow: draws a shadow
      virtual void Shadow( BITMAP * who, int x, int y );

      //process: determines if hull is within check->hull
      virtual bool Collide( int mx, int my, SpaceObject * check );

      //process: returns amount of hull structural integrity
      double GetLife();

      //does something when collided with something else
      virtual void Collided();

      //process: returns whether or not hull can be hit by bullets
      bool Translucent();

      //returns how much damage hull should do
      virtual double Hurt();

      //allows hull to change how much damage it is going to take
      virtual double Damage( double much );

      //forces the hull to take so much damage
      virtual void takeDamage( double r );

      //adds current object to the section
      virtual void addSection( SpaceObject * who, Section * onscreen, int x, int y );

      //returns the guns the hull contains
      virtual WeaponObject ** Guns();

      //gives us a new weapon
      virtual void giveWeapon( WeaponObject * weap, int num );

      virtual void eraseWeapon( int num );

      //returns the maximum number of guns the hull can contain
      //usually a constant as guns is set to a specific number
      //in the constructor
      virtual int maxGuns();

      //returns crash. sets crash to false
      bool haveBeenHit();

      //sets the current life according to the level
      void setLife( double zx );
      int getLife();

      //debug stuff
      void debug( BITMAP * work, int x, int y );

      //returns a copy of this hull
      virtual HullObject * copy();

      //virtual destructor
      virtual ~HullObject();

      bool crash;
      int color;
      double life;
      double original_life;
      bool trans;

      double strength;

      int drawNum;
      int drawLevel;

      ECollide * collide;
      BITMAP * Bitmap;
      BITMAP * Shadow_Bitmap;

      WeaponObject ** guns;


      int max_guns;

      double dx, dy;



Generated by  Doxygen 1.6.0   Back to index