Orxonox  0.0.5 Codename: Arcturus
MineProjectile.h
Go to the documentation of this file.
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  * Jannis Holzer
24  * Fabien Vultier
25  * Co-authors:
26  * ...
27  *
28  */
29 
35 #ifndef _MineProjectile_H__
36 #define _MineProjectile_H__
37 
38 #include "weapons/WeaponsPrereqs.h"
39 #include "tools/Timer.h"
43 #include "BasicProjectile.h"
44 
45 namespace orxonox
46 {
47 
54  {
55  public:
56  MineProjectile(Context* context);
57  virtual ~MineProjectile();
58 
59  virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
60 
61  void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
62  void setTimeUntilActivation(float timeUntilActivation);
63  protected:
64  static const float triggerRadius_;
65  static const float damageRadius_;
66  static const float collisionShapeRadius_;
67  private:
68  bool bAllowExplosion_; // The mine can only explode if it is active
82 
83  WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
85 
86  void destructionEffect();
87  void allowExplosion();
88  void explode();
89  };
90 }
91 
92 #endif /* _MineProjectile_H__ */
Model * modelRing2_
Definition: MineProjectile.h:75
ParticleEmitter * emitter_
Definition: MineProjectile.h:81
bool bAllowExplosion_
Definition: MineProjectile.h:68
float timeUntilActivation_
Definition: MineProjectile.h:70
WeakPtr< SphereCollisionShape > collisionShape_
Definition: MineProjectile.h:83
Shared library macros, enums, constants and forward declarations for the weapons module ...
Definition of the SphereCollisionShape class.
float maxTimeUntilExplosion_
Definition: MineProjectile.h:69
WeakPtr< DistanceTrigger > distanceTrigger_
Definition: MineProjectile.h:84
Definition: MovableEntity.h:42
TODO.
Definition: MineProjectile.h:53
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
Definition: ParticleEmitter.h:39
Model * modelRing3_
Definition: MineProjectile.h:76
static const float triggerRadius_
Definition: MineProjectile.h:64
MovableEntity * core_
Definition: MineProjectile.h:80
xmlelement
Definition: Super.h:519
Declaration of the Timer class, used to call functions after a given time-interval.
Definition of the DistanceTrigger class.
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Timer explodeTimer_
Definition: MineProjectile.h:72
Definition: Context.h:45
MovableEntity * rings2_
Definition: MineProjectile.h:79
static const float collisionShapeRadius_
Definition: MineProjectile.h:66
Implementation of the BasicProjectile class.
MovableEntity * rings1_
Definition: MineProjectile.h:78
Model * modelCore_
Definition: MineProjectile.h:73
Baseclass of all projectiles.
Definition: BasicProjectile.h:54
static const float damageRadius_
Definition: MineProjectile.h:65
Definition: Model.h:46
Model * modelRing1_
Definition: MineProjectile.h:74
Model * modelRing4_
Definition: MineProjectile.h:77
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
Timer activationTimer_
Definition: MineProjectile.h:71
#define _WeaponsExport
Definition: WeaponsPrereqs.h:60