src/weapon/snipe_rifle.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *  Wormux is a convivial mass murder game.
00003  *  Copyright (C) 2001-2004 Lawrence Azzoug.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00018  ******************************************************************************
00019  * Snipe Rifle. Overide the Draw method in order to draw the laser beam.
00020  *****************************************************************************/
00021 
00022 #ifndef SNIPE_RIFLE_H
00023 #define SNIPE_RIFLE_H
00024 
00025 #include <vector>
00026 #include "launcher.h"
00027 #include "../include/base.h"
00028 
00029 class SnipeBullet : public WeaponBullet
00030 {
00031   public:
00032     SnipeBullet(ExplosiveWeaponConfig& cfg,
00033                 WeaponLauncher * p_launcher); 
00034   protected:
00035     void ShootSound();
00036 };
00037 
00038 class SnipeRifle : public WeaponLauncher
00039 {
00040   private:
00041     double last_angle;
00042     Point2i last_rifle_pos;
00043     Point2i laser_beam_start;
00044     Point2i targeted_point;
00045     bool targeting_something;
00046     Sprite * m_laser_image;
00047     Color laser_beam_color;
00048     bool ComputeCrossPoint(bool force);
00049 
00050   protected:
00051     bool p_Shoot();
00052     void p_Deselect();
00053     WeaponProjectile * GetProjectileInstance();
00054   public:
00055     SnipeRifle();
00056     void SignalProjectileGhostState();
00057     void DrawBeam();
00058     void Draw();  // In order to draw the laser beam / and the contact point.
00059 };
00060 
00061 #endif /* SNIPE_RIFLE_H */

Generated on Mon Jan 1 13:11:00 2007 for Wormux by  doxygen 1.4.7