Index: code/branches/ppspickups2/data/levels/pickup_pps_invi.oxw
===================================================================
--- code/branches/ppspickups2/data/levels/pickup_pps_invi.oxw	(revision 6640)
+++ code/branches/ppspickups2/data/levels/pickup_pps_invi.oxw	(revision 6641)
@@ -7,5 +7,5 @@
   include("templates/spaceship_assff.oxt")
   include("templates/spaceship_pirate.oxt")
-  include("templates/pickup_representation_templates.oxt")
+  include("templates/pickup_representation_templates_invisible.oxt")
 ?>
 
@@ -20,62 +20,13 @@
 
 <?lua
-  include("includes/pickups.oxi")
+  include("includes/pickups_invisible.oxi")
 ?>
-    
-<!--
-    <PickupSpawner position="-100,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
+
+    <PickupSpawner position="-75,0,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
         <pickup>
-            <MetaPickup metaType="drop" />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="-75,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <MetaPickup metaType="use" />
+            <InvisiblePickup template=invisiblepickup />
         </pickup>
     </PickupSpawner>
 
-    <PickupSpawner position="-50,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup health=50 healthRate=5 durationType=continuous activationType=immediate healthType=permanent />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="-25,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup template=smallhealthpickup />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="0,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup template=mediumhealthpickup />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="25,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup template=hugehealthpickup />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="50,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup template=crazyhealthpickup />
-        </pickup>
-    </PickupSpawner>
-    
-    <PickupSpawner position="75,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <PickupCollection template=doublepickup />
-        </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="100,100,100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-        <pickup>
-            <HealthPickup health=50 healthRate=5 durationType=continuous activationType=immediate healthType=limited />
-        </pickup>
-    </PickupSpawner>
--->
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/branches/ppspickups2/src/modules/pickup/Pickup.cc
===================================================================
--- code/branches/ppspickups2/src/modules/pickup/Pickup.cc	(revision 6640)
+++ code/branches/ppspickups2/src/modules/pickup/Pickup.cc	(revision 6641)
@@ -39,24 +39,26 @@
 #include "DroppedPickup.h"
 
+#include "tools/Timer.h"
+
 namespace orxonox
 {
-    
+
     /*static*/ const std::string Pickup::activationTypeImmediate_s = "immediate";
     /*static*/ const std::string Pickup::activationTypeOnUse_s = "onUse";
     /*static*/ const std::string Pickup::durationTypeOnce_s = "once";
     /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
-    
+
     Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
     {
         RegisterObject(Pickup);
-        
+
         this->initialize();
     }
-    
+
     Pickup::~Pickup()
     {
-        
-    }
-    
+
+    }
+
     /**
     @brief
@@ -68,5 +70,5 @@
         this->durationType_ = pickupDurationType::once;
     }
-    
+
     /**
     @brief
@@ -74,14 +76,14 @@
     */
     void Pickup::initializeIdentifier(void)
-    {        
+    {
         std::string val1 = this->getActivationType();
         std::string type1 = "activationType";
         this->pickupIdentifier_->addParameter(type1, val1);
-        
+
         std::string val2 = this->getDurationType();
         std::string type2 = "durationType";
         this->pickupIdentifier_->addParameter(type2, val2);
     }
-    
+
     /**
     @brief
@@ -94,8 +96,8 @@
         XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
         XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
-        
+
         this->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -116,5 +118,5 @@
         }
     }
-        
+
     /**
     @brief
@@ -135,5 +137,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -157,5 +159,5 @@
         }
     }
-        
+
     /**
     @brief
@@ -179,5 +181,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -188,5 +190,5 @@
     {
         SUPER(Pickup, changedPickedUp);
-        
+
         //! Sets the Pickup to used if the Pickup has activation type 'immediate' and gets picked up.
         if(this->getCarrier() != NULL && this->isPickedUp() && this->isImmediate())
@@ -195,5 +197,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -206,14 +208,14 @@
         if(item == NULL)
             item = new Pickup(this);
-        
+
         SUPER(Pickup, clone, item);
-        
+
         Pickup* pickup = dynamic_cast<Pickup*>(item);
         pickup->setActivationTypeDirect(this->getActivationTypeDirect());
         pickup->setDurationTypeDirect(this->getDurationTypeDirect());
-        
+
         pickup->initializeIdentifier();
     }
-        
+
     /**
     @brief
@@ -231,4 +233,23 @@
         return true;
     }
-    
+
+    /**
+    @brief
+        Starts the Pickup duration Timer.
+    */
+    bool Pickup::startPickupTimer(float durationTime)
+    {
+        if (durationTime<=0)
+        {
+            COUT(1) << "Invalid durationTime in pickup." << std::endl;
+            return false;
+        }
+        if (false) /*TODO*/
+        {
+            COUT(1) << "Pickup durationTimer already in use." << std::endl;
+            return false;
+        }
+        this->durationTimer_.setTimer(durationTime, false, createExecutor(createFunctor(&Pickup::PickupTimerCallBack, this)));
+        return true;
+    }
 }
Index: code/branches/ppspickups2/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/ppspickups2/src/modules/pickup/Pickup.h	(revision 6640)
+++ code/branches/ppspickups2/src/modules/pickup/Pickup.h	(revision 6641)
@@ -42,4 +42,6 @@
 #include "interfaces/Pickupable.h"
 
+#include "tools/Timer.h"
+
 namespace orxonox
 {
@@ -54,5 +56,5 @@
         };
     }
-    
+
     //! Enum for the duration tyoe.
     namespace pickupDurationType
@@ -64,5 +66,5 @@
         };
     }
-    
+
     /**
     @brief
@@ -74,13 +76,13 @@
     class _PickupExport Pickup : public Pickupable, public BaseObject
     {
-        
+
         protected:
             Pickup(BaseObject* creator); //!< Constructor.
-        
+
         public:
             virtual ~Pickup(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            
+
             /**
             @brief Get the activation type of the pickup.
@@ -95,8 +97,8 @@
             inline pickupDurationType::Value getDurationTypeDirect(void)
                 { return this->durationType_; }
-            
+
             const std::string& getActivationType(void); //!< Get the activation type of the pickup.
             const std::string& getDurationType(void); //!< Get the duration type of the pickup.
-            
+
             /**
             @brief Get whether the activation type is 'immediate'.
@@ -123,14 +125,18 @@
             inline bool isContinuous(void)
                 { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
-            
+
             virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
-                                    
+
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the Pickup.
-                
+
         protected:
             void initializeIdentifier(void);
-            
+
             virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-            
+
+            bool startPickupTimer(float durationTime);
+
+            virtual void PickupTimerCallBack(void) {}
+
             /**
             @brief Set the activation type of the pickup.
@@ -145,21 +151,23 @@
             inline void setDurationTypeDirect(pickupDurationType::Value type)
                 { this->durationType_ = type; }
-                
+
             void setActivationType(const std::string& type); //!< Set the activation type of the pickup.
             void setDurationType(const std::string& type); //!< Set the duration type of the pickup
-                
+
         private:
             void initialize(void); //!< Initializes the member variables.
-            
+
             pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
             pickupDurationType::Value durationType_; //!< The duration type of the pickup.
-            
+
             static const std::string activationTypeImmediate_s;
             static const std::string activationTypeOnUse_s;
             static const std::string durationTypeOnce_s;
             static const std::string durationTypeContinuous_s;
-        
+
+            float durationTime_;
+            Timer durationTimer_;
     };
-    
+
 }
 #endif // _Pickup_H__
Index: code/branches/ppspickups2/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/branches/ppspickups2/src/modules/pickup/items/CMakeLists.txt	(revision 6640)
+++ code/branches/ppspickups2/src/modules/pickup/items/CMakeLists.txt	(revision 6641)
@@ -2,3 +2,4 @@
   HealthPickup.cc
   MetaPickup.cc
+  InvisiblePickup.cc
 )
Index: code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.cc
===================================================================
--- code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.cc	(revision 6640)
+++ code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.cc	(revision 6641)
@@ -0,0 +1,209 @@
+/*
+ *   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:
+ *      Benedict Simlinger
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file InvisiblePickup.cc
+    @brief Implementation of the InvisiblePickup class.
+*/
+
+#include "InvisiblePickup.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/StringUtils.h"
+
+#include "worldentities/pawns/Pawn.h"
+#include "pickup/PickupIdentifier.h"
+
+#include <sstream>
+
+namespace orxonox
+{
+    
+    
+    CreateFactory(InvisiblePickup);
+    
+    /**
+    @brief
+        Constructor. Registers the object and initializes the member variables.
+    */
+    InvisiblePickup::InvisiblePickup(BaseObject* creator) : Pickup(creator)
+    {
+        RegisterObject(InvisiblePickup);
+	//! Defines who is allowed to pick up the pickup.
+	this->initialize(); 
+    }
+    
+    /**
+    @brief
+        Destructor.
+    */
+    InvisiblePickup::~InvisiblePickup()
+    {        
+    }
+    
+    
+    void InvisiblePickup::initializeIdentifier(void)
+    {
+	std::stringstream stream;
+	stream << this->getDuration();
+	std::string type1 = "duration";
+	std::string val1 = stream.str();
+	this->pickupIdentifier_->addParameter(type1, val1);
+    }
+    
+    /**
+    @brief
+    Initializes the member variables.
+    */
+    void InvisiblePickup::initialize(void)
+    {
+	this->duration_ = 0.0;
+	this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+    }
+ 
+   
+    
+
+    /**
+    @brief
+        Method for creating a HealthPickup object through XML.
+    */
+    void InvisiblePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+    {
+        SUPER(InvisiblePickup, XMLPort, xmlelement, mode);    
+	XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
+	 
+	 this->initializeIdentifier();
+    }
+    
+    
+    /**
+    @brief
+        Is called when the pickup has transited from used to unused or the other way around.
+    */
+    void InvisiblePickup::changedUsed(void)
+    {
+        SUPER(InvisiblePickup, changedUsed);
+	
+        
+        //! If the pickup is not picked up nothing must be done.
+        if(!this->isPickedUp())
+            return;
+	if (this->isUsed())
+	{
+	    this->setInvisible(true);
+	    this->startPickupTimer(this->getDuration());
+	}
+	else
+	  this->setInvisible(false);
+	
+    }
+    
+    /**
+    @brief
+        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+    @return
+        A pointer to the Pawn, or NULL if the conversion failed.
+    */
+    Pawn* InvisiblePickup::carrierToPawnHelper(void)
+    {
+        PickupCarrier* carrier = this->getCarrier();
+        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        
+        if(pawn == NULL)
+        {
+            COUT(1) << "Invalid PickupCarrier in InvisiblePickup." << std::endl;
+        }
+        return pawn;
+    }
+    
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+    @param item
+        A pointer to the Orxonox class.
+    */
+    void InvisiblePickup::clone(OrxonoxClass*& item)
+    {
+        if(item == NULL)
+            item = new InvisiblePickup(this);
+        
+        SUPER(InvisiblePickup, clone, item);
+	
+	InvisiblePickup* pickup = dynamic_cast<InvisiblePickup*>(item);
+	pickup->setDuration(this->getDuration());
+	pickup->initializeIdentifier();
+    }
+    
+    
+    
+    
+     
+    /**
+    @brief
+        Sets the invisibility.
+    @param health
+        The invisibility.
+    */
+    bool InvisiblePickup::setInvisible(bool invisibility)
+    {
+      
+      Pawn* pawn = this->carrierToPawnHelper();
+      pawn->setVisible(!invisibility);
+      return 0;
+    }
+    
+   
+    
+    /**
+    @brief
+    Sets the duration.
+    @param duration
+    The duration
+    */
+    void InvisiblePickup::setDuration(float duration)
+    {
+	if(duration >= 0.0f)
+	{
+	    this->duration_ = duration;
+	}
+	else
+	{
+	    COUT(1) << "Invalid duration in InvisiblePickup." << std::endl;
+	    this->duration_ = 0;
+	}
+    }
+    
+    
+    
+    void InvisiblePickup::PickupTimerCallBack(void){
+	this->setInvisible(false);
+    }
+
+}
Index: code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.h
===================================================================
--- code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.h	(revision 6640)
+++ code/branches/ppspickups2/src/modules/pickup/items/InvisiblePickup.h	(revision 6641)
@@ -0,0 +1,89 @@
+/*
+ *   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:
+ *      Benedict Simlinger
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file InvisiblePickup.h
+    @brief Declaration of the InvisiblePickup class.
+*/
+
+#ifndef _InvisiblePickup_H__
+#define _InvisiblePickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include <worldentities/pawns/Pawn.h>
+#include "worldentities/StaticEntity.h"
+
+#include "pickup/Pickup.h"
+
+namespace orxonox {
+        
+    /**
+    @brief
+        A pickup that makes the Pawn invisible.
+        There are 2 parameters that can be chosen:
+        1) The activation type: It can be chosen to be either 'immediate' or 'onUse'. The activation type essentially (as indicated by the name) defines when the Pawn will be invisible, either immediately after being picked up or only after the player uses it.
+        2) The duration type: It can be chosen how long the Pawn will be invisibel.
+    @author
+        Benedict Simlinger
+    */
+    class _PickupExport InvisiblePickup : public Pickup
+    {
+        public:
+        
+            InvisiblePickup(BaseObject* creator); //!< Constructor.
+            virtual ~InvisiblePickup(); //!< Destructor.
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
+            
+	     /**
+            @brief Checks wether the Pawn is invisible.
+            @return Returns if the Pawn is invisible.
+            */
+            inline bool getInvisibility(bool)
+                { return this->invisible_; }
+	    inline float getDuration()
+		{return this->duration_;}
+ 
+        protected:
+	    bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
+	    void setDuration(float duration);
+	    void initializeIdentifier(void);
+        
+        private:
+	   void initialize(void); //!< Initializes the member variables.
+            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+            void PickupTimerCallBack(void); //!< Function that gets called when the timer ends.
+	    bool invisible_; //!< Helper to remember wether the Pawn is invisible.
+	    float duration_; //! Duration of invisibility.
+    };
+}
+
+#endif // _InvisiblePickup_H__
Index: code/branches/ppspickups2/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/branches/ppspickups2/src/orxonox/interfaces/PickupCarrier.h	(revision 6640)
+++ code/branches/ppspickups2/src/orxonox/interfaces/PickupCarrier.h	(revision 6641)
@@ -48,8 +48,4 @@
 {
 
-    //! Pre-declarations.
-    class Pickup;
-    class HealthPickup;
-    class MetaPickup;
 
     /**
@@ -66,4 +62,5 @@
         friend class HealthPickup;
         friend class MetaPickup;
+	friend class InvisiblePickup;
         
         public:
