[10836] | 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: |
---|
[10908] | 23 | * Jannis Holzer |
---|
[10836] | 24 | * Fabien Vultier |
---|
| 25 | * Co-authors: |
---|
| 26 | * ... |
---|
| 27 | * |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | /** |
---|
[10889] | 31 | @file MineProjectile.h |
---|
[10836] | 32 | @brief Definition of the MineProjectile class. |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _MineProjectile_H__ |
---|
| 36 | #define _MineProjectile_H__ |
---|
| 37 | |
---|
| 38 | #include "weapons/WeaponsPrereqs.h" |
---|
| 39 | #include "tools/Timer.h" |
---|
[10889] | 40 | #include "worldentities/MovableEntity.h" |
---|
| 41 | #include "objects/collisionshapes/SphereCollisionShape.h" |
---|
| 42 | #include "objects/triggers/DistanceTrigger.h" |
---|
| 43 | #include "BasicProjectile.h" |
---|
[10836] | 44 | |
---|
| 45 | namespace orxonox |
---|
| 46 | { |
---|
| 47 | |
---|
| 48 | /** |
---|
| 49 | @brief |
---|
[10889] | 50 | TODO |
---|
[10836] | 51 | @ingroup WeaponsProjectiles |
---|
| 52 | */ |
---|
[10889] | 53 | class _WeaponsExport MineProjectile : public MovableEntity, public BasicProjectile |
---|
[10836] | 54 | { |
---|
| 55 | public: |
---|
| 56 | MineProjectile(Context* context); |
---|
[10889] | 57 | virtual ~MineProjectile(); |
---|
[10836] | 58 | |
---|
[11071] | 59 | virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
[10897] | 60 | |
---|
[11071] | 61 | void setMaxTimeUntilExplosion(float maxTimeUntilExplosion); |
---|
| 62 | void setTimeUntilActivation(float timeUntilActivation); |
---|
[10908] | 63 | protected: |
---|
| 64 | static const float triggerRadius_; |
---|
| 65 | static const float damageRadius_; |
---|
| 66 | static const float collisionShapeRadius_; |
---|
[10889] | 67 | private: |
---|
[10908] | 68 | bool bAllowExplosion_; // The mine can only explode if it is active |
---|
[10889] | 69 | float maxTimeUntilExplosion_; |
---|
| 70 | float timeUntilActivation_; |
---|
| 71 | Timer activationTimer_; |
---|
| 72 | Timer explodeTimer_; |
---|
| 73 | Model* modelCore_; |
---|
| 74 | Model* modelRing1_; |
---|
| 75 | Model* modelRing2_; |
---|
[10908] | 76 | Model* modelRing3_; |
---|
| 77 | Model* modelRing4_; |
---|
| 78 | MovableEntity* rings1_; |
---|
| 79 | MovableEntity* rings2_; |
---|
| 80 | MovableEntity* core_; |
---|
| 81 | ParticleEmitter* emitter_; |
---|
[10836] | 82 | |
---|
[10889] | 83 | WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile. |
---|
| 84 | WeakPtr<DistanceTrigger> distanceTrigger_; |
---|
[10836] | 85 | |
---|
[11071] | 86 | void destructionEffect(); |
---|
| 87 | void allowExplosion(); |
---|
| 88 | void explode(); |
---|
[10836] | 89 | }; |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | #endif /* _MineProjectile_H__ */ |
---|