Index: code/branches/release2012/data/levels/underAttack.oxw
===================================================================
--- code/branches/release2012/data/levels/underAttack.oxw	(revision 9369)
+++ code/branches/release2012/data/levels/underAttack.oxw	(revision 9370)
@@ -46,4 +46,8 @@
     <?lua end ?>
 
+
+
+
+
     <Destroyer
       position          = "100,150,0"
@@ -53,5 +57,5 @@
       angularDamping    = 0.9999999
       health            = 10000
-      maxhealth         = 10000
+      maxhealth         = 10000000
       initialhealth     = 10000
       radarname         = "Transporter"
@@ -59,9 +63,9 @@
 
       <attached>
-        <TeamSpawnPoint team=1 position="150,0,7" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
-        <TeamSpawnPoint team=1 position="0,0,7" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
-        <TeamSpawnPoint team=1 position="-50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
-        <TeamSpawnPoint team=1 position="100,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
-        <TeamSpawnPoint team=1 position="50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="150,0,-50" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="0,0,-50" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="-50,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="100,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="50,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
         <?lua for i = 1, 100, 1 do ?>
           <TeamSpawnPoint
Index: code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc	(revision 9369)
+++ code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc	(revision 9370)
@@ -188,4 +188,27 @@
     }
 
+    int TeamGametype::getTeamSize(int team)
+    {
+        int teamSize = 0;
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+        {
+            if (it->second == team)
+                teamSize++;
+        }
+        return teamSize;
+    }
+
+    int TeamGametype::getHumansInTeam(int team)
+    {
+        int teamSize = 0;
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+        {
+            if (it->second == team  && it->first->isHumanPlayer())
+                teamSize++;
+        }
+        return teamSize;
+    }
+
+
     SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
     {
Index: code/branches/release2012/src/orxonox/gametypes/TeamGametype.h
===================================================================
--- code/branches/release2012/src/orxonox/gametypes/TeamGametype.h	(revision 9369)
+++ code/branches/release2012/src/orxonox/gametypes/TeamGametype.h	(revision 9370)
@@ -63,5 +63,6 @@
                 { return this->teamcolours_[teamnr]; }
             int getTeamScore(PlayerInfo* player);
-
+            int getTeamSize(int team);
+            int getHumansInTeam(int team);
 
         protected:
Index: code/branches/release2012/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/branches/release2012/src/orxonox/gametypes/UnderAttack.cc	(revision 9369)
+++ code/branches/release2012/src/orxonox/gametypes/UnderAttack.cc	(revision 9370)
@@ -39,4 +39,6 @@
 {
     CreateUnloadableFactory(UnderAttack);
+    static const int attacker_ = 0; // teamnumber of the attacking team
+    static const int defender_ = 1; // defender's teamnumber
 
     UnderAttack::UnderAttack(BaseObject* creator) : TeamDeathmatch(creator)
@@ -51,4 +53,5 @@
         this->setConfigValues();
         this->timesequence_ = static_cast<int>(this->gameTime_);
+
     }
 
@@ -76,5 +79,5 @@
                 continue;
 
-            if (it->second == 0)
+            if (it->second == attacker_)
                 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());
             else
@@ -188,3 +191,25 @@
         }
     }
+
+    void UnderAttack::playerEntered(PlayerInfo* player)
+    {
+        if (!player)
+            return;
+        TeamDeathmatch::playerEntered(player);
+        this->setTransporterHealth();
+    }
+
+    void UnderAttack::setTransporterHealth()
+    {
+        if (this->destroyer_ != 0)
+        {
+            //Calculation: Each attacker deals about 3500 damage. A human attacker deals 1500 damage additionally.
+            //Each defender prevents 500 damage. If human 2000 damage will be additionally be prevented.
+            //TODO: use gametime and the damage dealt so far in order to calculate the transporter's life more precisely
+            float health = this->getTeamSize(attacker_)*3500.0f + this->getHumansInTeam(attacker_)*1500.0f - this->getTeamSize(defender_)*500.0f - this->getHumansInTeam(defender_)*2000.0f ;
+            this->destroyer_->setHealth(std::max(health, 5000.0f)); //the destoyer should have at least 5000.0f life. 
+        }
+    }
+
+
 }
Index: code/branches/release2012/src/orxonox/gametypes/UnderAttack.h
===================================================================
--- code/branches/release2012/src/orxonox/gametypes/UnderAttack.h	(revision 9369)
+++ code/branches/release2012/src/orxonox/gametypes/UnderAttack.h	(revision 9370)
@@ -51,7 +51,9 @@
             virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
             virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+            virtual void playerEntered(PlayerInfo* player);
 
         protected:
             virtual void killedDestroyer();
+            void setTransporterHealth();
 
             WeakPtr<Destroyer> destroyer_;
