Index: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc	(revision 11577)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc	(revision 11578)
@@ -62,31 +62,35 @@
 
         //Vars for movement of player
-        moveUpPressed_ = false;
-        moveDownPressed_ = false;
-        moveLeftPressed_ = false;
-        moveDownPressed_ = false;
-        firePressed_ = false;
-        collDisZ_ = 0;
+        moveUpPressed_      = false;
+        moveDownPressed_    = false;
+        moveLeftPressed_    = false;
+        moveDownPressed_    = false;
+        firePressed_        = false;
+        collDisZ_           = 0;
 
         //Times and turning
-        timeSinceLastFire_ = 0.0;
-        lastSpeed_z = 0.0;
-        pitch_ = 0.0;
-        timeCounter_ = 0;
+        timeSinceLastFire_  = 0.0;
+        lastSpeed_z         = 0.0;
+        pitch_              = 0.0;
+        timeCounter_        = 0;
 
         //Properties of player
-        gotPowerUp_ = false;
-        isColliding_ = true;
-        particlespawner_ = NULL;
+
+        isColliding_        = true;
+        particlespawner_    = NULL;
 
         //Properties of players life
-        predead_ = false;
-        dead_ = false;
-        lvlEnded_ = false;
+        predead_            = false;
+        dead_               = false;
+        lvlEnded_           = false;
         reachedLvlEndState_ = 0;
 
+        // Properties concerning PowerUps and items
+        PowerUpCounter_     = 0;
+        maxPowerUp_         = 2;
+        FireballPower       = 2;
         //Properties of fireing Fireballs, NOTE! fireballs are fired with the moveUP Key, not with the fire key
-        fireallowed_=true;
-        firecooldown_=0;
+        fireallowed_        = true;
+        firecooldown_       = 0;
 
         
@@ -110,16 +114,19 @@
         SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*> (otherObject);
         SOBFireball* fireball       = orxonox_cast<SOBFireball*>    (otherObject);
-
-        //Check if otherObject is a powerup
+        SOB* SOBGame                = orxonox_cast<SOB*>            (getGametype()); 
+
+
+        //Check if otherObject is a powerup-mushroom
         if (mush != nullptr && !(mush->hasCollided_)) {
             otherObject->destroyLater();
-            gotPowerUp_ = true;
-            SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); //Get the Gametype
+
+            PowerUpCounter_++;
+            if(PowerUpCounter_ > maxPowerUp_)   PowerUpCounter_ = maxPowerUp_; // you had already the max
+            else                                this->changeClothes();
+
             SOBGame->addMushroom(); // Tell the gametype to increase points
             mush->hasCollided_ = true; // needed because of destroyLater takes some time and player should receive points only once
 
-            // now, change the clothes of the Figure to red
-            std::string name = "orxo_material_gross";
-            this->changeClothes(name);
+            
             
         }
@@ -133,13 +140,11 @@
             if (getVelocity().z >= -20) {
                 // If player hasn't a power up, he dies. Else he shrinks and the gumba dies.
-                if(!gotPowerUp_){
+                if(PowerUpCounter_ == 0){
                     this->die();
-                } else{
-                    gotPowerUp_ = false;
-                    
-                   
-           // now, change the clothes of the Figure to old ones
-            std::string name = "orxo_material";
-            this->changeClothes(name);
+                } 
+                else{
+                    PowerUpCounter_--;
+                    this->changeClothes();
+
                     gumba->destroyLater();
                     gumba->hasCollided_ = true;
@@ -149,5 +154,4 @@
             gumba->destroyLater();
             gumba->hasCollided_ = true;
-            SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
             SOBGame->addGumba();
 
@@ -164,5 +168,5 @@
         flagstone->hasCollided_ = true;
         reachedLvlEndState_ = 1;
-        SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+
         SOBGame->setDone(true);
         SOBGame->addPoints(flagstone->getPoints());
@@ -237,8 +241,8 @@
     //if input blocked, then cancel every movement operation
     if (!inputAllowed) {
-        moveUpPressed_ = false;
-        moveDownPressed_ = false;
-        moveLeftPressed_ = false;
-        moveRightPressed_ = false;
+        moveUpPressed_      = false;
+        moveDownPressed_    = false;
+        moveLeftPressed_    = false;
+        moveRightPressed_   = false;
     }
 
@@ -251,4 +255,5 @@
     if (hasLocalController())
     {
+        SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
         Vector3 velocity = getVelocity();
         Vector3 position = getPosition();
@@ -259,5 +264,4 @@
         if (position.z < -100) {
             dead_ = true;
-            SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
             SOBGame->setDone(true);
         }
@@ -268,5 +272,5 @@
             velocity.z = 0;
             setVelocity(velocity);
-            SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+           
             if (firePressed_)
                 SOBGame->restart();
@@ -322,19 +326,19 @@
 
         //If moveUp pressed, fire a fireball
-        if(moveUpPressed_ && gotPowerUp_ && fireallowed_)
+        if(moveUpPressed_ && (PowerUpCounter_ >= FireballPower) && fireallowed_)
         {
             spawnFireball();
-            fireallowed_=false;
-            firecooldown_=0;
+            fireallowed_  = false;
+            firecooldown_ = 0;
         }
 
         //Increase the firecooldown
-        if(firecooldown_>0.5)
+        if(firecooldown_> 0.5)
         {
-            fireallowed_=true;
+            fireallowed_ = true;
         }
         if(!fireallowed_)
         {
-            firecooldown_+=dt;
+            firecooldown_ += dt;
         }
 
@@ -371,16 +375,11 @@
         }
 
-
-
-
-    }
-
-
+    }
 
     // Reset key variables
-    moveUpPressed_ = false;
-    moveDownPressed_ = false;
-    moveLeftPressed_ = false;
-    moveRightPressed_ = false;
+    moveUpPressed_      = false;
+    moveDownPressed_    = false;
+    moveLeftPressed_    = false;
+    moveRightPressed_   = false;
 
     isColliding_ = false;
@@ -430,6 +429,10 @@
 
 // PRE: name is an existing name of a material. Example orxo_material for orxo_material.material in data_extern/materials
+//      !!! PowerUpCounter_ has to be modified before changing the clothes!!!
 // POST: clothes of body of player are changed to name
-void SOBFigure::changeClothes(std::string& name){
+void SOBFigure::changeClothes(){
+            // clothes: white (basic), red (one PowerUp), orange (Fireball enabled)
+            std::string clothes[] = {"orxo_material", "orxo_material_gross", "orxo_material_fire"};
+
             std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
             std::set<WorldEntity*>::iterator it;
@@ -439,11 +442,10 @@
                 if (FiguresModel != nullptr)
                 {
-
-                    FiguresModel->setSubMaterial(name, 4); // 4 is the body
-
+                    FiguresModel->setSubMaterial(clothes[PowerUpCounter_] , 4); // 4 is the body
                 }
             }   
 }
-
+// PRE:
+// POST: Player jumps out of the game, game is finished and can be restarted.
 void SOBFigure::die(){
     Vector3 vel = getVelocity();
@@ -451,5 +453,5 @@
     vel.z = 200;
     setVelocity(vel);
-    predead_=true; 
+    predead_= true; 
     SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
     SOBGame->setDone(true);
Index: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.h
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.h	(revision 11577)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.h	(revision 11578)
@@ -46,5 +46,5 @@
             virtual void boost(bool boost) override;
             virtual  bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
-            void changeClothes(std::string& name);
+            void changeClothes();
             void spawnFireball();
             void die();
@@ -58,5 +58,5 @@
             //Soooo many declarations
             bool fireallowed_;
-            bool gotPowerUp_;
+
             bool moveUpPressed_;
             bool moveDownPressed_;
@@ -72,4 +72,7 @@
             bool isColliding_;
             WorldEntity* particlespawner_;
+            int PowerUpCounter_;
+            int maxPowerUp_;
+            int FireballPower;
             int sgn(float x);
             int reachedLvlEndState_;
