Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/presentation/src/world_entities/weapons/fps_sniper_rifle.h @ 10704

Last change on this file since 10704 was 10704, checked in by rennerc, 17 years ago

FPSSniperRifle uses BspWeapon now

File size: 1.9 KB
Line 
1/*!
2    @file weapon.h
3  *  a weapon that a player can use
4
5    A Player has a list of weapons, that can be choosen to shoot projectiles
6    (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially
7    or (if able) combined. Therefore you can choose the weapon mode = choose
8    a weapon.
9
10    A weapon is characterized by:
11     o firing-rate: the initial firing rate of a weapon (1/s = Herz)
12     o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
13     o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
14
15    Furthermore there are some other attributes, that will help to represent a firing
16    weapon in this world:
17     o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
18     o shooting animation
19
20*/
21
22
23#ifndef _FPS_SNIPER_RIFLE_H
24#define _FPS_SNIPER_RIFLE_H
25
26#include "weapon.h"
27#include "bsp_weapon.h"
28
29
30//! a weapon can be left or right sided
31/**
32 * @todo this will be reset with mirror X/Y/Z
33 */
34#define    W_LEFT        0
35#define    W_RIGHT       1
36
37
38class Material;
39
40class FPSSniperRifle : public Weapon
41  {
42    ObjectListDeclaration(FPSSniperRifle);
43
44  public:
45    FPSSniperRifle (int leftRight, OM_LIST list);
46    FPSSniperRifle (const TiXmlElement* root);
47    virtual ~FPSSniperRifle ();
48
49    void init(OM_LIST list);
50    virtual void loadParams(const TiXmlElement* root);
51
52    virtual void activate();
53    virtual void deactivate();
54
55    virtual void fire();
56
57    virtual void draw() const;
58    virtual void tick( float dt );
59
60
61
62  private:
63    int              leftRight;   //!< this will become an enum
64    Material*        material;    //!< material
65   
66    BspWeapon*       weapon;
67    bool             bFire;
68
69  };
70#endif /* _FPS_SNIPER_RIFLE_H */
Note: See TracBrowser for help on using the repository browser.