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 void fire() override; |
---|
60 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
61 | |
---|
62 | private: |
---|
63 | /** |
---|
64 | @brief Set the material of the EnergyDrink. |
---|
65 | @param material The name of the material. |
---|
66 | */ |
---|
67 | void setMaterial(const std::string& material) |
---|
68 | { this->material_ = material; } |
---|
69 | /** |
---|
70 | @brief Get the material of the EnergyDrink. |
---|
71 | @return Returns the material name. |
---|
72 | */ |
---|
73 | inline const std::string& getMaterial() const |
---|
74 | { return this->material_; } |
---|
75 | |
---|
76 | void setDelay(float delay); |
---|
77 | /** |
---|
78 | @brief Get the firing delay. |
---|
79 | @return Returns the delay in seconds. |
---|
80 | */ |
---|
81 | float getDelay() const |
---|
82 | { return this->delay_; } |
---|
83 | |
---|
84 | void shot(); |
---|
85 | void muzzleflash(); |
---|
86 | |
---|
87 | std::string material_; //!< The material. |
---|
88 | float speed_; //!< The speed of the EnergyDrink. |
---|
89 | float delay_; //!< The firing delay. |
---|
90 | Timer delayTimer_; //!< The timer to delay the firing. |
---|
91 | }; |
---|
92 | } |
---|
93 | |
---|
94 | #endif /* _EnergyDrink_H__ */ |
---|