Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h @ 12277

Last change on this file since 12277 was 11108, checked in by fvultier, 9 years ago

A few modifications in the weapon system: WeaponModes may play a reload sound now. Fireing Sounds of WeaponModes may overlap now. New weapon: FlameGun, a flame thrower for close combat (e.g. for the FPS player)

  • Property svn:eol-style set to native
File size: 2.7 KB
RevLine 
[2983]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
[8855]29/**
30    @file EnergyDrink.h
31    @brief Definition of the EnergyDrink class.
32*/
33
[2983]34#ifndef _EnergyDrink_H__
35#define _EnergyDrink_H__
36
[5724]37#include "weapons/WeaponsPrereqs.h"
[3196]38
39#include <string>
40#include "tools/Timer.h"
[5735]41#include "weaponsystem/WeaponMode.h"
[2983]42
43namespace orxonox
44{
[8855]45
46    /**
47    @brief
48        Shoots a can.
49    @author
50        Hagen Seifert
51    @ingroup WeaponsWeaponModes
52    */
[5724]53    class _WeaponsExport EnergyDrink : public WeaponMode
[2983]54    {
55        public:
[9667]56            EnergyDrink(Context* context);
[2983]57            virtual ~EnergyDrink() {}
58
[11108]59            virtual bool fire(float* reloadTime) override;
[11071]60            virtual void fire() override;
61            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
[2983]62
63        private:
[8855]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
[3196]75                { return this->material_; }
[8855]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
[2983]85            void shot();
[8855]86            void muzzleflash();
[2983]87
[8855]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.
[11108]92            bool timerStarted_;
[2983]93    };
94}
95
96#endif /* _EnergyDrink_H__ */
Note: See TracBrowser for help on using the repository browser.