home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / demos / shootout / build / sheriff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-06  |  1.1 KB  |  62 lines

  1. // ------- sheriff.h
  2.  
  3. #ifndef SHERIFF_H
  4. #define SHERIFF_H
  5.  
  6. #include "shootout.h"
  7.  
  8. class BitPart;
  9.  
  10. class Sheriff : public Player    {
  11.     short int frame;
  12.     short int incr;
  13.     short int of;
  14.     short int offset;
  15.     short int steps;
  16.     short int forward;
  17.     short int bullets;
  18.     static short int walkincr[];
  19.     static short int shoot[4][5];
  20.     enum Mode {
  21.         front,        // don't change the order or
  22.         rear,        // values of front through left
  23.         right,
  24.         left,
  25.         walk,
  26.         reload,
  27.         dying,
  28.         falling,
  29.         dead,
  30.         resurrecting,
  31.         resurrected
  32.     };
  33.     Mode mode;
  34.     short int resurrections;
  35.     short int shootseq;
  36.     short int deadx;
  37.     void Shoot(Mode md);
  38.     BitPart *findtarget();
  39.     void targetzone(short int& zone1, short int& zone2);
  40.     void fire();
  41.     void Walk();
  42.     void OnShoot(int);
  43.     void OnChangeDirection(int);
  44.     void OnReload(int);
  45.     void Reload();
  46.     void OnResurrection(int=0);
  47. protected:
  48.     DECLARE_CUELIST
  49. public:
  50.     Sheriff();
  51.     virtual ~Sheriff() { }
  52.     void initialize_sheriff();
  53.     void update_position();
  54.     short int zone();
  55.     void getshot();
  56.     int isdead()
  57.         { return mode == dead || mode == dying || mode == falling; }
  58. };
  59.  
  60. #endif
  61.  
  62.