Index: /code/branches/ppspickups3/data/levels/includes/pickups.oxi
===================================================================
--- /code/branches/ppspickups3/data/levels/includes/pickups.oxi	(revision 6883)
+++ /code/branches/ppspickups3/data/levels/includes/pickups.oxi	(revision 6884)
@@ -1,2 +1,14 @@
+<!-- Shield pickups -->
+
+<PickupRepresentation
+    pickupName = "Super Shield Pickup"
+    pickupDescription = "Gives you a shield with 1000000 helath points for 5 minutes"
+    inventoryRepresentation = "SmallHealth"
+    spawnerTemplate = "supershieldpickupRepresentation"
+>
+    <pickup>
+        <ShieldPickup template=supershieldpickup />
+    </pickup>
+</PickupRepresentation>
 
 <!-- Health pickups -->
Index: /code/branches/ppspickups3/data/levels/pickup.oxw
===================================================================
--- /code/branches/ppspickups3/data/levels/pickup.oxw	(revision 6883)
+++ /code/branches/ppspickups3/data/levels/pickup.oxw	(revision 6884)
@@ -26,4 +26,13 @@
     <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
 
+
+    <!-- Shield pickups -->
+    
+    <PickupSpawner position="-50,50,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
+        <pickup>
+            <ShieldPickup template=supershieldpickup />
+        </pickup>
+    </PickupSpawner>
+    
     <!-- Health pickups -->
     
Index: /code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt
===================================================================
--- /code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt	(revision 6883)
+++ /code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt	(revision 6884)
@@ -1,2 +1,29 @@
+<!-- Shield pickups: -->
+
+<Template name=supershieldpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="1,1,1" material="Sphere2" scale=0.1>
+                        <attached>
+                            <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=10 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=supershieldpickup>
+  <ShieldPickup
+    absorption = 1
+    duration = 6000
+    shieldhealth = 1000000
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
 
 <!-- Health pickups: -->
Index: /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.cc
===================================================================
--- /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.cc	(revision 6883)
+++ /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.cc	(revision 6884)
@@ -71,4 +71,22 @@
     /**
     @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* ShieldPickup::carrierToPawnHelper(void)
+    {
+        PickupCarrier* carrier = this->getCarrier();
+        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        
+        if(pawn == NULL)
+        {
+            COUT(1) << "Invalid PickupCarrier in ShieldPickup." << std::endl;
+        }
+        return pawn;
+    }
+    
+    /**
+    @brief
         Initializes the member variables.
     */
@@ -76,4 +94,6 @@
     {
         this->duration_ = 0.0f;
+        this->shieldAbsorption_ = 0.0f;
+        this->shieldHealth_ = 0.0f;
 
         this->addTarget(ClassIdentifier<Engine>::getIdentifier());
@@ -92,9 +112,15 @@
         this->pickupIdentifier_->addParameter(type1, val1);
 
-//         stream.clear();
-//         stream << this->getShieldAdd();
-//         std::string type2 = "ShieldAdd";
-//         std::string val2 = stream.str();
-//         this->pickupIdentifier_->addParameter(type2, val2);
+        stream.clear();
+        stream << this->getShieldHealth();
+        std::string type2 = "ShieldHealth";
+        std::string val2 = stream.str();
+        this->pickupIdentifier_->addParameter(type2, val2);
+        
+        stream.clear();
+        stream << this->getShieldAbsorption();
+        std::string type3 = "ShieldAbsorption";
+        std::string val3 = stream.str();
+        this->pickupIdentifier_->addParameter(type3, val3);
 
     }
@@ -109,4 +135,6 @@
 
         XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
+        XMLPortParam(ShieldPickup, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode);
+        XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
 
         this->initializeIdentifier();
@@ -124,4 +152,41 @@
         if(!this->isPickedUp())
             return;
+
+        Pawn* pawn = this->carrierToPawnHelper();
+        if(pawn == NULL)
+            this->destroy();
+
+        //! If the pickup has transited to used.
+        if(this->isUsed())
+        {
+            if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() > 0.0f)
+            {
+                this->getTimer()->unpauseTimer();
+            }
+            else
+            {
+                this->startPickupTimer(this->getDuration());
+            }
+            pawn->setShieldAbsorption(this->getShieldAbsorption());
+            pawn->setShieldHealth(this->getShieldHealth());
+        }
+        else
+        {
+            pawn->setShieldAbsorption(0.0f);
+            this->setShieldHealth(pawn->getShieldHealth());
+            pawn->setShieldHealth(0.0f);
+
+            if(this->isOnce())
+            {
+                if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
+                {
+                    this->destroy();
+                }
+                else
+                {
+                    this->getTimer()->pauseTimer();
+                }
+            }
+        }
     }
 
@@ -141,6 +206,45 @@
         ShieldPickup* pickup = dynamic_cast<ShieldPickup*>(item);
         pickup->setDuration(this->getDuration());
-
+        pickup->setShieldAbsorption(this->getShieldAbsorption());
+        pickup->setShieldHealth(this->getShieldHealth());
         pickup->initializeIdentifier();
+    }
+
+    /**
+    @brief
+    Sets the percentage the shield absorbs of the dealt damage.
+    @param shieldAbsorption
+    The shieldAbsorption. Has to be between 0 and 1
+    */
+    void ShieldPickup::setShieldAbsorption(float shieldAbsorption)
+    {
+        if (shieldAbsorption>=0 && shieldAbsorption<=1)
+        {
+            this->shieldAbsorption_=shieldAbsorption;
+        }
+        else
+        {
+            COUT(1) << "Invalid Absorption in ShieldPickup." << std::endl;
+            this->shieldAbsorption_=0;
+        }
+    }
+
+    /**
+    @brief
+    Sets the health of the shield.
+    @param shieldHealth
+    The shieldHealth
+    */
+    void ShieldPickup::setShieldHealth(float shieldHealth)
+    {
+        if (shieldHealth>=0)
+        {
+            this->shieldHealth_=shieldHealth;
+        }
+        else
+        {
+            COUT(1) << "Invalid Shieldhealth in ShieldPickup." << std::endl;
+            this->shieldHealth_=0;
+        }
     }
 
Index: /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.h
===================================================================
--- /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.h	(revision 6883)
+++ /code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.h	(revision 6884)
@@ -1,2 +1,3 @@
+
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
@@ -49,7 +50,7 @@
         A Pickup which can add a Shield to the Pawn.
 
-        1) The Shield multiplier:
-           The additional (forward) Shield:
-        2) The activation type: 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it.
+	1) The percentage: The percentage the shield takes from the damage dealt to a Pawn
+	2) The hit points: The amount of damage points a shield can teake before collapsing
+        3) The activation type: 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it.
         4) The duration: the activation time of the pickup.
 
@@ -71,19 +72,26 @@
             inline float getDuration(void)
                 { return this->duration_; }
-
+            inline float getShieldHealth()
+                { return this->shieldHealth_; }
+            inline float getShieldAbsorption()
+                { return this->shieldAbsorption_; }
 
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-            
+
             virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends.
 
             void setDuration(float duration);
-
+            void setShieldHealth(float shieldHealth);
+            void setShieldAbsorption(float shieldAbsorption);
 
         private:
             void initialize(void); //!< Initializes the member variables.
-            Engine* carrierToEngineHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
 
             float duration_; //!< The health that is transferred to the Pawn.
+            float shieldHealth_;
+            float shieldAbsorption_; // Has to be between 0 and 1
+
     };
 }
Index: /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6883)
+++ /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6884)
@@ -64,4 +64,6 @@
         this->maxHealth_ = 0;
         this->initialHealth_ = 0;
+        this->shieldHealth_ = 0;
+        this->shieldAbsorption_ = 0;
 
         this->lastHitOriginator_ = 0;
@@ -105,4 +107,8 @@
         XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
         XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+        
+        XMLPortParam(Pawn, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode).defaultValues(0);
+        XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
+        
         XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
         XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
@@ -116,9 +122,11 @@
     void Pawn::registerVariables()
     {
-        registerVariable(this->bAlive_,        VariableDirection::ToClient);
-        registerVariable(this->health_,        VariableDirection::ToClient);
-        registerVariable(this->initialHealth_, VariableDirection::ToClient);
-        registerVariable(this->bReload_,       VariableDirection::ToServer);
-        registerVariable(this->aimPosition_,   Bidirectionality::ServerMaster, 0, true);
+        registerVariable(this->bAlive_,           VariableDirection::ToClient);
+        registerVariable(this->health_,           VariableDirection::ToClient);
+        registerVariable(this->initialHealth_,    VariableDirection::ToClient);
+        registerVariable(this->shieldHealth_,     VariableDirection::ToClient);
+        registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
+        registerVariable(this->bReload_,          VariableDirection::ToServer);
+        registerVariable(this->aimPosition_,      Bidirectionality::ServerMaster, 0, true);
     }
 
@@ -159,5 +167,22 @@
         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
         {
-            this->setHealth(this->health_ - damage);
+            //share the dealt damage to the shield and the Pawn.
+            float shielddamage = damage*this->shieldAbsorption_;
+            float healthdamage = damage*(1-this->shieldAbsorption_);
+            
+            // In case the shield can not take all the shield damage.
+            if (shielddamage > this->getShieldHealth()) 
+            {
+                healthdamage += shielddamage-this->getShieldHealth();
+                this->setShieldHealth(0);
+            }
+
+            this->setHealth(this->health_ - healthdamage);
+            
+            if (this->getShieldHealth() > 0)
+            {
+                this->setShieldHealth(this->shieldHealth_ - shielddamage);
+            }
+
             this->lastHitOriginator_ = originator;
 
@@ -165,5 +190,5 @@
         }
     }
-
+    
     void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
     {
Index: /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.h	(revision 6883)
+++ /code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.h	(revision 6884)
@@ -73,4 +73,14 @@
                 { return this->initialHealth_; }
 
+            inline void setShieldHealth(float shieldHealth)
+            { this->shieldHealth_ = shieldHealth; }
+            inline float getShieldHealth()
+            { return this->shieldHealth_; }
+            
+            inline void setShieldAbsorption(float shieldAbsorption)
+            { this->shieldAbsorption_ = shieldAbsorption; }
+            inline float getShieldAbsorption()
+            { return this->shieldAbsorption_; }
+
             inline ControllableEntity* getLastHitOriginator() const
                 { return this->lastHitOriginator_; }
@@ -141,4 +151,6 @@
             float maxHealth_;
             float initialHealth_;
+            float shieldHealth_;
+            float shieldAbsorption_; // Has to be between 0 and 1
 
             Pawn* lastHitOriginator_;
