[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: |
---|
| 23 | * Fabien Vultier |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
[10889] | 30 | @file MineProjectile.h |
---|
[10836] | 31 | @brief Definition of the MineProjectile class. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | #ifndef _MineProjectile_H__ |
---|
| 35 | #define _MineProjectile_H__ |
---|
| 36 | |
---|
| 37 | #include "weapons/WeaponsPrereqs.h" |
---|
| 38 | #include "tools/Timer.h" |
---|
[10889] | 39 | #include "worldentities/MovableEntity.h" |
---|
| 40 | #include "objects/collisionshapes/SphereCollisionShape.h" |
---|
| 41 | #include "objects/triggers/DistanceTrigger.h" |
---|
| 42 | #include "BasicProjectile.h" |
---|
[10836] | 43 | |
---|
| 44 | namespace orxonox |
---|
| 45 | { |
---|
| 46 | |
---|
| 47 | /** |
---|
| 48 | @brief |
---|
[10889] | 49 | TODO |
---|
[10836] | 50 | @ingroup WeaponsProjectiles |
---|
| 51 | */ |
---|
[10889] | 52 | class _WeaponsExport MineProjectile : public MovableEntity, public BasicProjectile |
---|
[10836] | 53 | { |
---|
| 54 | public: |
---|
| 55 | MineProjectile(Context* context); |
---|
[10889] | 56 | virtual ~MineProjectile(); |
---|
[10836] | 57 | |
---|
[10889] | 58 | virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion); |
---|
| 59 | virtual void setTimeUntilActivation(float timeUntilActivation); |
---|
[10836] | 60 | |
---|
[10889] | 61 | private: |
---|
| 62 | bool bActive_; // The mine can only explode if it is active |
---|
| 63 | float maxTimeUntilExplosion_; |
---|
| 64 | float timeUntilActivation_; |
---|
| 65 | Timer activationTimer_; |
---|
| 66 | Timer explodeTimer_; |
---|
| 67 | Model* modelCore_; |
---|
| 68 | Model* modelRing1_; |
---|
| 69 | Model* modelRing2_; |
---|
| 70 | MovableEntity* rings_; |
---|
[10836] | 71 | |
---|
[10889] | 72 | WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile. |
---|
| 73 | WeakPtr<DistanceTrigger> distanceTrigger_; |
---|
[10836] | 74 | |
---|
[10889] | 75 | virtual void Activate(); |
---|
| 76 | virtual void Explode(); |
---|
[10836] | 77 | }; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | #endif /* _MineProjectile_H__ */ |
---|