[2901] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[2979] | 23 | * Hagen Seifert |
---|
[2901] | 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
[8855] | 29 | /** |
---|
| 30 | @file HsW01.h |
---|
| 31 | @brief Definition of the HsW01 class. |
---|
| 32 | */ |
---|
| 33 | |
---|
[2901] | 34 | #ifndef _HsW01_H__ |
---|
| 35 | #define _HsW01_H__ |
---|
| 36 | |
---|
[5724] | 37 | #include "weapons/WeaponsPrereqs.h" |
---|
[3196] | 38 | |
---|
| 39 | #include "tools/Timer.h" |
---|
[5735] | 40 | #include "weaponsystem/WeaponMode.h" |
---|
[2901] | 41 | |
---|
| 42 | namespace orxonox |
---|
| 43 | { |
---|
[8855] | 44 | |
---|
| 45 | /** |
---|
| 46 | @brief |
---|
| 47 | Shoots laser beams. |
---|
| 48 | @author |
---|
| 49 | Hagen Seifert |
---|
| 50 | @ingroup WeaponsWeaponModes |
---|
| 51 | */ |
---|
[5724] | 52 | class _WeaponsExport HsW01 : public WeaponMode |
---|
[2901] | 53 | { |
---|
| 54 | public: |
---|
[9667] | 55 | HsW01(Context* context); |
---|
[6417] | 56 | virtual ~HsW01(); |
---|
[2901] | 57 | |
---|
[2979] | 58 | virtual void fire(); |
---|
| 59 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
[2901] | 60 | |
---|
[9744] | 61 | protected: |
---|
[8855] | 62 | /** |
---|
[9526] | 63 | @brief Set the mesh. |
---|
| 64 | @param mesh The mesh name. |
---|
| 65 | */ |
---|
| 66 | void setMesh(const std::string& mesh) |
---|
| 67 | { this->mesh_ = mesh; } |
---|
| 68 | |
---|
| 69 | /** |
---|
| 70 | @brief Get the mesh. |
---|
| 71 | @return Returns the mesh name. |
---|
| 72 | */ |
---|
| 73 | const std::string& getMesh() const |
---|
| 74 | { return this->mesh_; } |
---|
| 75 | |
---|
| 76 | /** |
---|
| 77 | @brief Set the sound. |
---|
| 78 | @param mesh The Sound name. |
---|
| 79 | */ |
---|
| 80 | void setSound(const std::string& sound) |
---|
| 81 | { this->sound_ = sound; } |
---|
| 82 | |
---|
| 83 | /** |
---|
| 84 | @brief Get the sound. |
---|
| 85 | @return Returns the sound name. |
---|
| 86 | */ |
---|
| 87 | const std::string& getSound() const |
---|
| 88 | { return this->sound_; } |
---|
| 89 | |
---|
| 90 | /** |
---|
[8855] | 91 | @brief Set the material. |
---|
| 92 | @param material The material name. |
---|
| 93 | */ |
---|
| 94 | void setMaterial(const std::string& material) |
---|
| 95 | { this->material_ = material; } |
---|
| 96 | /** |
---|
| 97 | @brief Get the material. |
---|
| 98 | @return Returns the material name. |
---|
| 99 | */ |
---|
| 100 | const std::string& getMaterial() const |
---|
| 101 | { return this->material_; } |
---|
| 102 | |
---|
| 103 | void setDelay(float delay); |
---|
| 104 | /** |
---|
| 105 | @brief Get the firing delay. |
---|
| 106 | @return Returns the firing delay in seconds. |
---|
| 107 | */ |
---|
| 108 | float getDelay() const |
---|
| 109 | { return this->delay_; } |
---|
| 110 | |
---|
[9744] | 111 | virtual void shot(); |
---|
[8855] | 112 | void muzzleflash(); |
---|
[2979] | 113 | |
---|
[8855] | 114 | std::string material_; //!< The material. |
---|
[9526] | 115 | std::string mesh_; //!< The mesh. |
---|
| 116 | std::string sound_; //!< The sound. |
---|
| 117 | |
---|
| 118 | |
---|
| 119 | |
---|
[8855] | 120 | float speed_; //!< The speed of the fired projectile. |
---|
| 121 | float delay_; //!< The firing delay. |
---|
| 122 | Timer delayTimer_; //!< A timer to delay the firing. |
---|
[2901] | 123 | }; |
---|
| 124 | } |
---|
| 125 | |
---|
| 126 | #endif /* _HsW01_H__ */ |
---|