| 1 | #ifndef _WagnisGun__ |
|---|
| 2 | #define _WagnisGun__ |
|---|
| 3 | |
|---|
| 4 | #include "weapons/WeaponsPrereqs.h" |
|---|
| 5 | |
|---|
| 6 | #include "tools/Timer.h" |
|---|
| 7 | #include "weaponsystem/WeaponMode.h" |
|---|
| 8 | |
|---|
| 9 | namespace orxonox |
|---|
| 10 | { |
|---|
| 11 | |
|---|
| 12 | /** |
|---|
| 13 | @brief |
|---|
| 14 | Shoots laser beams. |
|---|
| 15 | @author |
|---|
| 16 | Hagen Seifert |
|---|
| 17 | @ingroup WeaponsWeaponModes |
|---|
| 18 | */ |
|---|
| 19 | class _WeaponsExport WagnisGun : public WeaponMode |
|---|
| 20 | { |
|---|
| 21 | public: |
|---|
| 22 | WagnisGun(Context* context); |
|---|
| 23 | virtual ~WagnisGun(); |
|---|
| 24 | |
|---|
| 25 | virtual void fire() override; |
|---|
| 26 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
|---|
| 27 | |
|---|
| 28 | protected: |
|---|
| 29 | /** |
|---|
| 30 | @brief Set the mesh. |
|---|
| 31 | @param mesh The mesh name. |
|---|
| 32 | */ |
|---|
| 33 | void setMesh(const std::string& mesh) |
|---|
| 34 | { this->mesh_ = mesh; } |
|---|
| 35 | |
|---|
| 36 | /** |
|---|
| 37 | @brief Get the mesh. |
|---|
| 38 | @return Returns the mesh name. |
|---|
| 39 | */ |
|---|
| 40 | const std::string& getMesh() const |
|---|
| 41 | { return this->mesh_; } |
|---|
| 42 | |
|---|
| 43 | /** |
|---|
| 44 | @brief Set the sound. |
|---|
| 45 | @param sound The Sound name. |
|---|
| 46 | */ |
|---|
| 47 | void setSound(const std::string& sound) |
|---|
| 48 | { this->sound_ = sound; } |
|---|
| 49 | |
|---|
| 50 | /** |
|---|
| 51 | @brief Get the sound. |
|---|
| 52 | @return Returns the sound name. |
|---|
| 53 | */ |
|---|
| 54 | const std::string& getSound() const |
|---|
| 55 | { return this->sound_; } |
|---|
| 56 | |
|---|
| 57 | /** |
|---|
| 58 | @brief Set the material. |
|---|
| 59 | @param material The material name. |
|---|
| 60 | */ |
|---|
| 61 | void setMaterial(const std::string& material) |
|---|
| 62 | { this->material_ = material; } |
|---|
| 63 | /** |
|---|
| 64 | @brief Get the material. |
|---|
| 65 | @return Returns the material name. |
|---|
| 66 | */ |
|---|
| 67 | const std::string& getMaterial() const |
|---|
| 68 | { return this->material_; } |
|---|
| 69 | |
|---|
| 70 | void setDelay(float delay); |
|---|
| 71 | /** |
|---|
| 72 | @brief Get the firing delay. |
|---|
| 73 | @return Returns the firing delay in seconds. |
|---|
| 74 | */ |
|---|
| 75 | float getDelay() const |
|---|
| 76 | { return this->delay_; } |
|---|
| 77 | |
|---|
| 78 | virtual void shot(); |
|---|
| 79 | void muzzleflash(); |
|---|
| 80 | |
|---|
| 81 | std::string material_; //!< The material. |
|---|
| 82 | std::string mesh_; //!< The mesh. |
|---|
| 83 | std::string sound_; //!< The sound. |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | float speed_; //!< The speed of the fired projectile. |
|---|
| 88 | float delay_; //!< The firing delay. |
|---|
| 89 | Timer delayTimer_; //!< A timer to delay the firing. |
|---|
| 90 | }; |
|---|
| 91 | } |
|---|
| 92 | |
|---|
| 93 | #endif /* _WagnisGun__ */ |
|---|