[Orxonox-commit 3153] r7846 - in code/trunk/src/modules/weapons: . munitions weaponmodes

landauf at orxonox.net landauf at orxonox.net
Thu Feb 10 16:59:00 CET 2011


Author: landauf
Date: 2011-02-10 16:59:00 +0100 (Thu, 10 Feb 2011)
New Revision: 7846

Added:
   code/trunk/src/modules/weapons/munitions/RocketMunition.cc
   code/trunk/src/modules/weapons/munitions/RocketMunition.h
Modified:
   code/trunk/src/modules/weapons/WeaponsPrereqs.h
   code/trunk/src/modules/weapons/munitions/CMakeLists.txt
   code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
   code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
Log:
fixed "No munition class defined in WeaponMode" warning:
you have to actually create the munition class, it's not just a string
-> added RocketMunition

Modified: code/trunk/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/trunk/src/modules/weapons/WeaponsPrereqs.h	2011-02-10 15:56:45 UTC (rev 7845)
+++ code/trunk/src/modules/weapons/WeaponsPrereqs.h	2011-02-10 15:59:00 UTC (rev 7846)
@@ -70,6 +70,7 @@
     class FusionMunition;
     class LaserMunition;
     class ReplenishingMunition;
+    class RocketMunition;
 
     // projectiles
     class BillboardProjectile;

Modified: code/trunk/src/modules/weapons/munitions/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/munitions/CMakeLists.txt	2011-02-10 15:56:45 UTC (rev 7845)
+++ code/trunk/src/modules/weapons/munitions/CMakeLists.txt	2011-02-10 15:59:00 UTC (rev 7846)
@@ -2,4 +2,5 @@
   ReplenishingMunition.cc
   LaserMunition.cc
   FusionMunition.cc
+  RocketMunition.cc
 )

Added: code/trunk/src/modules/weapons/munitions/RocketMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/RocketMunition.cc	                        (rev 0)
+++ code/trunk/src/modules/weapons/munitions/RocketMunition.cc	2011-02-10 15:59:00 UTC (rev 7846)
@@ -0,0 +1,51 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "RocketMunition.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(RocketMunition);
+
+    RocketMunition::RocketMunition(BaseObject* creator) : Munition(creator)
+    {
+        RegisterObject(RocketMunition);
+
+        this->maxMunitionPerMagazine_ = 1;
+        this->maxMagazines_ = 30;
+        this->magazines_ = 10;
+
+        this->bUseSeparateMagazines_ = false;
+        this->bStackMunition_ = true;
+        this->reloadTime_ = 0.5f;
+
+        this->bAllowMunitionRefilling_ = false;
+        this->bAllowMultiMunitionRemovementUnderflow_ = false;
+    }
+}


Property changes on: code/trunk/src/modules/weapons/munitions/RocketMunition.cc
___________________________________________________________________
Added: svn:eol-style
   + native

Added: code/trunk/src/modules/weapons/munitions/RocketMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/RocketMunition.h	                        (rev 0)
+++ code/trunk/src/modules/weapons/munitions/RocketMunition.h	2011-02-10 15:59:00 UTC (rev 7846)
@@ -0,0 +1,45 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RocketMunition_H__
+#define _RocketMunition_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+    class _WeaponsExport RocketMunition : public Munition
+    {
+        public:
+            RocketMunition(BaseObject* creator);
+            virtual ~RocketMunition() {}
+    };
+}
+
+#endif /* _RocketMunition_H__ */


Property changes on: code/trunk/src/modules/weapons/munitions/RocketMunition.h
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc	2011-02-10 15:56:45 UTC (rev 7845)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc	2011-02-10 15:59:00 UTC (rev 7846)
@@ -50,7 +50,7 @@
         this->damage_ = 100;
         this->speed_ = 500;
 
-        this->setMunitionName("LaserMunition");
+        this->setMunitionName("RocketMunition");
         // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     }
 

Modified: code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	2011-02-10 15:56:45 UTC (rev 7845)
+++ code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	2011-02-10 15:59:00 UTC (rev 7846)
@@ -52,8 +52,8 @@
         this->damage_ = 100;
         this->speed_ = 500;
 
-            this->setMunitionName("TargetSeeking Rockets");
-            this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f);
+        this->setMunitionName("RocketMunition");
+        this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f);
         // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     }
 




More information about the Orxonox-commit mailing list