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: |
---|
23 | * Hagen Seifert |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | /** |
---|
30 | @file EnergyDrink.h |
---|
31 | @brief Definition of the EnergyDrink class. |
---|
32 | */ |
---|
33 | |
---|
34 | #ifndef _EnergyDrink_H__ |
---|
35 | #define _EnergyDrink_H__ |
---|
36 | |
---|
37 | #include "weapons/WeaponsPrereqs.h" |
---|
38 | |
---|
39 | #include <string> |
---|
40 | #include "tools/Timer.h" |
---|
41 | #include "weaponsystem/WeaponMode.h" |
---|
42 | |
---|
43 | namespace orxonox |
---|
44 | { |
---|
45 | |
---|
46 | /** |
---|
47 | @brief |
---|
48 | Shoots a can. |
---|
49 | @author |
---|
50 | Hagen Seifert |
---|
51 | @ingroup WeaponsWeaponModes |
---|
52 | */ |
---|
53 | class _WeaponsExport EnergyDrink : public WeaponMode |
---|
54 | { |
---|
55 | public: |
---|
56 | EnergyDrink(Context* context); |
---|
57 | virtual ~EnergyDrink() {} |
---|
58 | |
---|
59 | virtual bool fire(float* reloadTime) override; |
---|
60 | virtual void fire() override; |
---|
61 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
62 | |
---|
63 | private: |
---|
64 | /** |
---|
65 | @brief Set the material of the EnergyDrink. |
---|
66 | @param material The name of the material. |
---|
67 | */ |
---|
68 | void setMaterial(const std::string& material) |
---|
69 | { this->material_ = material; } |
---|
70 | /** |
---|
71 | @brief Get the material of the EnergyDrink. |
---|
72 | @return Returns the material name. |
---|
73 | */ |
---|
74 | inline const std::string& getMaterial() const |
---|
75 | { return this->material_; } |
---|
76 | |
---|
77 | void setDelay(float delay); |
---|
78 | /** |
---|
79 | @brief Get the firing delay. |
---|
80 | @return Returns the delay in seconds. |
---|
81 | */ |
---|
82 | float getDelay() const |
---|
83 | { return this->delay_; } |
---|
84 | |
---|
85 | void shot(); |
---|
86 | void muzzleflash(); |
---|
87 | |
---|
88 | std::string material_; //!< The material. |
---|
89 | float speed_; //!< The speed of the EnergyDrink. |
---|
90 | float delay_; //!< The firing delay. |
---|
91 | Timer delayTimer_; //!< The timer to delay the firing. |
---|
92 | bool timerStarted_; |
---|
93 | }; |
---|
94 | } |
---|
95 | |
---|
96 | #endif /* _EnergyDrink_H__ */ |
---|