[Orxonox-commit 244] r2901 - branches/weapons/src/orxonox/objects/weaponSystem/weapons

Hagen at orxonox.net Hagen at orxonox.net
Mon Apr 6 16:23:16 CEST 2009


Author: Hagen
Date: 2009-04-06 16:23:16 +0200 (Mon, 06 Apr 2009)
New Revision: 2901

Added:
   branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc
   branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.h
Log:
The class HsW01 was added, but is only a copy of LaserGun

Added: branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc
===================================================================
--- branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc	                        (rev 0)
+++ branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc	2009-04-06 14:23:16 UTC (rev 2901)
@@ -0,0 +1,83 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Debug.h"
+
+#include "HsW01.h"
+
+
+namespace orxonox
+{
+    CreateFactory(HsW01);
+
+    HsW01::HsW01(BaseObject* creator) : Weapon(creator)
+    {
+        RegisterObject(HsW01);
+
+        this->speed_ = 1250;
+
+    }
+
+    HsW01::~HsW01()
+    {
+    }
+
+    void HsW01::reloadBullet()
+    {
+        this->bulletTimer(this->bulletLoadingTime_);
+    }
+
+    void HsW01::reloadMagazine()
+    {
+        this->magazineTimer(this->magazineLoadingTime_);
+    }
+
+    void HsW01::takeBullets()
+    {
+        this->munition_->removeBullets(1);
+    }
+
+    void HsW01::takeMagazines()
+    {
+        this->munition_->removeMagazines(1);
+    }
+
+    void HsW01::createProjectile()
+    {
+        BillboardProjectile* projectile = new ParticleProjectile(this);
+        projectile->setOrientation(this->getWorldOrientation());
+        projectile->setPosition(this->getWorldPosition());
+        projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
+        projectile->setOwner(this->getParentWeaponSystem()->getParentPawn());
+    }
+}

Added: branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.h
===================================================================
--- branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.h	                        (rev 0)
+++ branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.h	2009-04-06 14:23:16 UTC (rev 2901)
@@ -0,0 +1,62 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HsW01_H__
+#define _HsW01_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+
+#include "../munitions/LaserGunMunition.h"
+#include "util/Math.h"
+#include "../Weapon.h"
+#include "../projectiles/BillboardProjectile.h"
+#include "../projectiles/ParticleProjectile.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HsW01 : public Weapon
+    {
+        public:
+            HsW01(BaseObject* creator);
+            virtual ~HsW01();
+
+            virtual void takeBullets();
+            virtual void takeMagazines();
+            virtual void createProjectile();
+            virtual void reloadBullet();
+            virtual void reloadMagazine();
+
+        private:
+            float speed_;
+
+    };
+}
+
+#endif /* _HsW01_H__ */




More information about the Orxonox-commit mailing list