[Orxonox-commit 5598] r10260 - in code/trunk: . data/levels data/overlays src/modules/jump

landauf at orxonox.net landauf at orxonox.net
Fri Feb 6 23:03:00 CET 2015


Author: landauf
Date: 2015-02-06 23:03:00 +0100 (Fri, 06 Feb 2015)
New Revision: 10260

Modified:
   code/trunk/
   code/trunk/data/levels/jump.oxw
   code/trunk/data/overlays/jumpHUD.oxo
   code/trunk/src/modules/jump/Jump.cc
   code/trunk/src/modules/jump/Jump.h
   code/trunk/src/modules/jump/JumpBoots.cc
   code/trunk/src/modules/jump/JumpBoots.h
   code/trunk/src/modules/jump/JumpFigure.cc
   code/trunk/src/modules/jump/JumpFigure.h
   code/trunk/src/modules/jump/JumpItem.h
   code/trunk/src/modules/jump/JumpPropeller.cc
   code/trunk/src/modules/jump/JumpPropeller.h
   code/trunk/src/modules/jump/JumpRocket.cc
   code/trunk/src/modules/jump/JumpRocket.h
   code/trunk/src/modules/jump/JumpScore.cc
   code/trunk/src/modules/jump/JumpScore.h
   code/trunk/src/modules/jump/JumpShield.cc
   code/trunk/src/modules/jump/JumpShield.h
Log:
merged the latest changes from pickupsFS14 to trunk


Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10112
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
   + /code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10259
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237

Modified: code/trunk/data/levels/jump.oxw
===================================================================
--- code/trunk/data/levels/jump.oxw	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/data/levels/jump.oxw	2015-02-06 22:03:00 UTC (rev 10260)
@@ -242,13 +242,15 @@
             <Model position="0,0,-1000" mesh="JumpPlatform05.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpPlatform06.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpProjectile.mesh" scale="1" />
-            <Model position="0,0,-1000" mesh="JumpFigure.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy1.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy2.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy3.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy4.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpSpring.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpRocket.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpPropeller.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpBoots.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpShield.mesh" scale="1" />
           </attached>
         </JumpCenterpoint>
       </attached>

Modified: code/trunk/data/overlays/jumpHUD.oxo
===================================================================
--- code/trunk/data/overlays/jumpHUD.oxo	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/data/overlays/jumpHUD.oxo	2015-02-06 22:03:00 UTC (rev 10260)
@@ -1,5 +1,6 @@
 <Template name="JumpHUD">
   <OverlayGroup name="JumpHUD" scale = "1, 1">
+
     <JumpScore
      position  = "0.5, 0.05"
      pickpoint = "0.0, 0.0"
@@ -8,10 +9,23 @@
      colour    = "1.0, 1.0, 1.0, 1.0"
      align     = "center"
      showScore = true
+     showFuel = false
      showMessages = false
     />
 
     <JumpScore
+     position  = "0.1, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 0.5, 0.0, 1.0"
+     align     = "left"
+     showScore = false
+     showFuel = true
+     showMessages = false
+    />
+
+    <JumpScore
      position  = "0.5, 0.5"
      pickpoint = "0.0, 0.0"
      font      = "ShareTechMono"
@@ -20,8 +34,25 @@
      align     = "center"
      gameOverText = "GAME OVER"
      showScore = false
+     showFuel = false
      showMessages = true
     />    
 
+  <HUDBar
+     name          = "SpeedBar1"
+     background    = "Orxonox/BarBackground"
+     size          = "0.35, 0.05"
+     position      = "0.0 , 1.0 "
+     pickpoint     = "0, 1"
+     correctaspect = false
+
+     initialvalue = 50
+
+     >
+      <BarColour position = 0.0 colour = "0.7,0.5,0.2" />
+      <BarColour position = 0.5 colour = "0.2,0.7,0.2" />
+      <BarColour position = 1.0 colour = "0.7,0.2,0.2" />
+    </HUDBar>
+
   </OverlayGroup>
 </Template>

Modified: code/trunk/src/modules/jump/Jump.cc
===================================================================
--- code/trunk/src/modules/jump/Jump.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/Jump.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -1270,6 +1270,31 @@
         return sectionNumber_ - 2;
     }
 
+    float Jump::getFuel() const
+    {
+        if (this->figure_ != NULL)
+        {
+            if (this->figure_->rocketActive_ != NULL)
+            {
+                return this->figure_->rocketActive_->getFuelState();
+            }
+            else if (this->figure_->propellerActive_ != NULL)
+            {
+                return this->figure_->propellerActive_->getFuelState();
+            }
+            else if (this->figure_->shieldActive_ != NULL)
+            {
+                return this->figure_->shieldActive_->getFuelState();
+            }
+            else if (this->figure_->bootsActive_ != NULL)
+            {
+                return this->figure_->bootsActive_->getFuelState();
+            }
+        }
+
+        return 0.0;
+    }
+
     bool Jump::getDead(PlayerInfo* player) const
     {
         return figure_->dead_;

Modified: code/trunk/src/modules/jump/Jump.h
===================================================================
--- code/trunk/src/modules/jump/Jump.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/Jump.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -20,7 +20,7 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      Fabien Vultier
  *   Co-authors:
  *      ...
  *
@@ -48,6 +48,7 @@
             virtual void end();
             virtual void spawnPlayer(PlayerInfo* player);
             int getScore(PlayerInfo* player) const;
+            float getFuel() const;
             bool getDead(PlayerInfo* player) const;
             void setCenterpoint(JumpCenterpoint* center)
                 { center_ = center; }

Modified: code/trunk/src/modules/jump/JumpBoots.cc
===================================================================
--- code/trunk/src/modules/jump/JumpBoots.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpBoots.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpBoots);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -101,4 +102,9 @@
 
         attachedToFigure_ = figure_->StartBoots(this);
     }
+
+    float JumpBoots::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/trunk/src/modules/jump/JumpBoots.h
===================================================================
--- code/trunk/src/modules/jump/JumpBoots.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpBoots.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -44,9 +44,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/trunk/src/modules/jump/JumpFigure.cc
===================================================================
--- code/trunk/src/modules/jump/JumpFigure.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpFigure.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -69,10 +69,10 @@
         handAngle_ = 0.0;
         animateHands_ = false;
         turnUp_ = false;
-        rocketActive_ = false;
-        propellerActive_ = false;
-        bootsActive_ = false;
-        shieldActive_ = false;
+        rocketActive_ = NULL;
+        propellerActive_ = NULL;
+        bootsActive_ = NULL;
+        shieldActive_ = NULL;
         rocketSpeed_ = 0.0;
         propellerSpeed_ = 0.0;
         dead_ = false;
@@ -105,11 +105,11 @@
 
             // Move up/down
             Vector3 velocity = getVelocity();
-            if (rocketActive_ == true)
+            if (rocketActive_ != NULL)
             {
                 velocity.z = rocketSpeed_;
             }
-            else if (propellerActive_ == true)
+            else if (propellerActive_ != NULL)
             {
                 velocity.z = propellerSpeed_;
             }
@@ -206,9 +206,15 @@
         if (dead_ == false)
         {
             Vector3 velocity = getVelocity();
-            velocity.z = (bootsActive_ ? 1.2f*jumpSpeed_ : jumpSpeed_);
+            if (bootsActive_ == NULL)
+            {
+                velocity.z = 1.2f*jumpSpeed_;
+            }
+            else
+            {
+                velocity.z = jumpSpeed_;
+            }
             setVelocity(velocity);
-
             animateHands_ = true;
             handAngle_ = 0.0;
             turnUp_ = true;
@@ -227,7 +233,7 @@
 
     void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy)
     {
-        if (rocketActive_ == false && propellerActive_ == false && shieldActive_ == false)
+        if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)
         {
             dead_ = true;
         }
@@ -235,12 +241,12 @@
 
     bool JumpFigure::StartRocket(JumpRocket* rocket)
     {
-        if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
         {
             attach(rocket);
             rocket->setPosition(0.0, rocketPos_, 0.0);
             rocket->setVelocity(0.0, 0.0, 0.0);
-            rocketActive_ = true;
+            rocketActive_ = rocket;
 
             return true;
         }
@@ -254,17 +260,17 @@
         rocket->setVelocity(0.0, 0.0, 0.0);
         detach(rocket);
         rocket->destroy();
-        rocketActive_ = false;
+        rocketActive_ = NULL;
     }
 
     bool JumpFigure::StartPropeller(JumpPropeller* propeller)
     {
-        if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
         {
             attach(propeller);
             propeller->setPosition(0.0, 0.0, propellerPos_);
             propeller->setVelocity(0.0, 0.0, 0.0);
-            propellerActive_ = true;
+            propellerActive_ = propeller;
 
             return true;
         }
@@ -278,17 +284,17 @@
         propeller->setVelocity(0.0, 0.0, 0.0);
         detach(propeller);
         propeller->destroy();
-        propellerActive_ = false;
+        propellerActive_ = NULL;
     }
 
     bool JumpFigure::StartBoots(JumpBoots* boots)
     {
-        if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
         {
             attach(boots);
             boots->setPosition(0.0, 0.0, bootsPos_);
             boots->setVelocity(0.0, 0.0, 0.0);
-            bootsActive_ = true;
+            bootsActive_ = boots;
 
             return true;
         }
@@ -302,7 +308,7 @@
         boots->setVelocity(0.0, 0.0, 0.0);
         detach(boots);
         boots->destroy();
-        bootsActive_ = false;
+        bootsActive_ = NULL;
     }
 
     bool JumpFigure::StartShield(JumpShield* shield)
@@ -312,7 +318,7 @@
             attach(shield);
             shield->setPosition(0.0, 0.0, propellerPos_);
             shield->setVelocity(0.0, 0.0, 0.0);
-            shieldActive_ = true;
+            shieldActive_ = shield;
 
             return true;
         }
@@ -326,7 +332,7 @@
         shield->setVelocity(0.0, 0.0, 0.0);
         detach(shield);
         shield->destroy();
-        shieldActive_ = false;
+        shieldActive_ = NULL;
     }
 
     void JumpFigure::InitializeAnimation(Context* context)

Modified: code/trunk/src/modules/jump/JumpFigure.h
===================================================================
--- code/trunk/src/modules/jump/JumpFigure.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpFigure.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -30,7 +30,6 @@
 #define _JumpFigure_H__
 
 #include "jump/JumpPrereqs.h"
-
 #include "worldentities/ControllableEntity.h"
 
 namespace orxonox
@@ -118,9 +117,12 @@
                 { return handSpeed_; }
 
             bool fireSignal_;
-            bool rocketActive_;
-            bool propellerActive_;
             bool dead_;
+
+            JumpRocket* rocketActive_;
+            JumpPropeller* propellerActive_;
+            JumpBoots* bootsActive_;
+            JumpShield* shieldActive_;
         private:
             std::string modelLeftHand_;
             std::string modelRightHand_;
@@ -148,8 +150,6 @@
             float handAngle_;
             bool animateHands_;
             bool turnUp_;
-            bool bootsActive_;
-            bool shieldActive_;
             float rocketSpeed_;
             float propellerSpeed_;
     };

Modified: code/trunk/src/modules/jump/JumpItem.h
===================================================================
--- code/trunk/src/modules/jump/JumpItem.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpItem.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -52,7 +52,7 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
-            virtual void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.
+            virtual void setFigure(WeakPtr<JumpFigure> bats);
             virtual void touchFigure();
 
             void setFieldDimension(float width, float height)
@@ -73,9 +73,9 @@
             bool attachedToFigure_;
 
         protected:
-            float fieldWidth_; //!< The width of the playing field.
-            float fieldHeight_; //!< The height of the playing field.
-            WeakPtr<JumpFigure> figure_; //!< An array with the two bats.
+            float fieldWidth_;
+            float fieldHeight_;
+            WeakPtr<JumpFigure> figure_;
             float height_;
             float width_;
             float leftBoundary_;

Modified: code/trunk/src/modules/jump/JumpPropeller.cc
===================================================================
--- code/trunk/src/modules/jump/JumpPropeller.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpPropeller.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpPropeller);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -105,4 +106,9 @@
             setAngularVelocity(Vector3(0,0,10.0));
         }
     }
+
+    float JumpPropeller::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/trunk/src/modules/jump/JumpPropeller.h
===================================================================
--- code/trunk/src/modules/jump/JumpPropeller.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpPropeller.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -46,9 +46,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/trunk/src/modules/jump/JumpRocket.cc
===================================================================
--- code/trunk/src/modules/jump/JumpRocket.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpRocket.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -48,7 +48,8 @@
     {
         RegisterObject(JumpRocket);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -98,4 +99,9 @@
 
         attachedToFigure_ = figure_->StartRocket(this);
     }
+
+    float JumpRocket::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/trunk/src/modules/jump/JumpRocket.h
===================================================================
--- code/trunk/src/modules/jump/JumpRocket.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpRocket.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -43,9 +43,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/trunk/src/modules/jump/JumpScore.cc
===================================================================
--- code/trunk/src/modules/jump/JumpScore.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpScore.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -49,6 +49,7 @@
 
         owner_ = NULL;
         showScore_ = false;
+        showFuel_ = false;
         showMessages_ = false;
     }
 
@@ -62,6 +63,7 @@
         SUPER(JumpScore, XMLPort, xmlelement, mode);
 
         XMLPortParam(JumpScore, "showScore", setShowScore, getShowScore, xmlelement, mode);
+        XMLPortParam(JumpScore, "showFuel", setShowFuel, getShowFuel, xmlelement, mode);
         XMLPortParam(JumpScore, "showMessages", setShowMessages, getShowMessages, xmlelement, mode);
         XMLPortParam(JumpScore, "gameOverText", setGameOverText, getGameOverText, xmlelement, mode);
     }
@@ -85,9 +87,24 @@
                         std::string str = multi_cast<std::string>(score);
                         setCaption(str);
                     }
+                    else if (showFuel_ == true)
+                    {
+                        float fuel = owner_->getFuel();
+                        orxout() <<  fuel << endl;
+                        std::string str;
+
+                        if (fuel <= 0.0)
+                        {
+                            str = "";
+                        }
+                        else
+                        {
+                            str = multi_cast<std::string>(fuel);
+                        }
+                        setCaption(str);
+                    }
                     else if (showMessages_ == true)
                     {
-
                         setCaption(owner_->getDead(player_) == true ? gameOverText_ : "");
                     }
                 }

Modified: code/trunk/src/modules/jump/JumpScore.h
===================================================================
--- code/trunk/src/modules/jump/JumpScore.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpScore.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -53,6 +53,12 @@
             const bool getShowScore() const
                 { return showScore_; }
 
+            void setShowFuel(const bool showFuel)
+                { showFuel_ = showFuel; }
+
+            const bool getShowFuel() const
+                { return showFuel_; }
+
             void setShowMessages(const bool showMessages)
                 { showMessages_ = showMessages; }
 
@@ -70,6 +76,7 @@
             WeakPtr<PlayerInfo> player_;
             WorldSound* scoreSound_;
             bool showScore_;
+            bool showFuel_;
             bool showMessages_;
             std::string gameOverText_;
     };

Modified: code/trunk/src/modules/jump/JumpShield.cc
===================================================================
--- code/trunk/src/modules/jump/JumpShield.cc	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpShield.cc	2015-02-06 22:03:00 UTC (rev 10260)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpShield);
 
-        fuel_ = 7.0;
+        initialFuel_ = 7.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -101,4 +102,9 @@
 
         attachedToFigure_ = figure_->StartShield(this);
     }
+
+    float JumpShield::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/trunk/src/modules/jump/JumpShield.h
===================================================================
--- code/trunk/src/modules/jump/JumpShield.h	2015-02-06 21:55:17 UTC (rev 10259)
+++ code/trunk/src/modules/jump/JumpShield.h	2015-02-06 22:03:00 UTC (rev 10260)
@@ -46,9 +46,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 




More information about the Orxonox-commit mailing list