[Orxonox-commit 1977] r6694 - in code/branches/ppspickups1: . data/levels data/levels/includes data/levels/templates src/modules/pickup/items

ebeier at orxonox.net ebeier at orxonox.net
Mon Apr 12 16:08:15 CEST 2010


Author: ebeier
Date: 2010-04-12 16:08:15 +0200 (Mon, 12 Apr 2010)
New Revision: 6694

Removed:
   code/branches/ppspickups1/svntest.txt
Modified:
   code/branches/ppspickups1/data/levels/includes/pickups_speed.oxi
   code/branches/ppspickups1/data/levels/pickup_ppstest1.oxw
   code/branches/ppspickups1/data/levels/templates/pickup_representation_templates_speed.oxt
   code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc
Log:
added some speedpickup templates

Modified: code/branches/ppspickups1/data/levels/includes/pickups_speed.oxi
===================================================================
--- code/branches/ppspickups1/data/levels/includes/pickups_speed.oxi	2010-04-12 14:06:46 UTC (rev 6693)
+++ code/branches/ppspickups1/data/levels/includes/pickups_speed.oxi	2010-04-12 14:08:15 UTC (rev 6694)
@@ -1,9 +1,42 @@
 <PickupRepresentation
     name = "Small Speed Boost"
-    description = "Adds a small amout of speed (?) to the ship."
+    description = "Multiplies Speed of the Ship with a small
+amount."
     spawnerTemplate = "smallspeedpickupRepresentation"
 >
     <pickup>
         <SpeedPickup template=smallspeedpickup />
     </pickup>
 </PickupRepresentation>
+
+<PickupRepresentation
+    name = "Medium Speed Boost"
+    description = "Multiplies Speed of the Ship with a bigger
+amount."
+    spawnerTemplate = "mediumspeedpickupRepresentation"
+>
+    <pickup>
+        <SpeedPickup template=mediumspeedpickup />
+    </pickup>
+</PickupRepresentation>
+
+<PickupRepresentation
+    name = "Huge Speed Boost"
+    description = "Multiplies Speed of the Ship with a huge
+amount."
+    spawnerTemplate = "hugespeedpickupRepresentation"
+>
+    <pickup>
+        <SpeedPickup template=hugespeedpickup />
+    </pickup>
+</PickupRepresentation>
+
+<PickupRepresentation
+    name = "Small Jump Boost"
+    description = "Boosts the Ship with a massive amount for a very short time."
+    spawnerTemplate = "smalljumppickupRepresentation"
+>
+    <pickup>
+        <SpeedPickup template=smalljumppickup />
+    </pickup>
+</PickupRepresentation>
\ No newline at end of file

Modified: code/branches/ppspickups1/data/levels/pickup_ppstest1.oxw
===================================================================
--- code/branches/ppspickups1/data/levels/pickup_ppstest1.oxw	2010-04-12 14:06:46 UTC (rev 6693)
+++ code/branches/ppspickups1/data/levels/pickup_ppstest1.oxw	2010-04-12 14:08:15 UTC (rev 6694)
@@ -28,8 +28,71 @@
         </pickup>
     </PickupSpawner>
 
+    <PickupSpawner position="0,0,-100" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
+        <pickup>
+            <SpeedPickup template=mediumspeedpickup />
+        </pickup>
+    </PickupSpawner>
 
+    <PickupSpawner position="25,0,-100" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
+        <pickup>
+            <SpeedPickup template=hugespeedpickup />
+        </pickup>
+    </PickupSpawner>
+
+    <PickupSpawner position="50,0,-100" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
+        <pickup>
+            <SpeedPickup template=smalljumppickup />
+        </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" />
     <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+
+
+    <MovableEntity scale=1.5 position="0,0,-300" velocity="0,0,0" rotationaxis="0,1,0" rotationrate=90>
+      <events>
+        <activity>
+          <DistanceTrigger position="0,0,-300" distance=50 target="ControllableEntity" invert=1 />
+        </activity>
+      </events>
+      <attached>
+        <Model position="0,0,0" scale=10 mesh="ast1.mesh" />
+        <StaticEntity position="0,0,100">
+          <attached>
+            <Model position="0,0,0" scale=6 mesh="ast1.mesh" />
+            <MovableEntity position="0,0,0" velocity="0,0,0" rotationaxis="0,0,1" rotationrate=500>
+              <attached>
+                <Model position="0,35,0" scale=2 mesh="ast1.mesh" />
+                <Model position="0,-35,0" scale=2 mesh="ast1.mesh" />
+                <Model position="35,0,0" scale=2 mesh="ast1.mesh">
+                  <attached>
+                    <ParticleEmitter position="0,0,0" source="Orxonox/ExplosionComp4" />
+                  </attached>
+                </Model>
+                <Model position="-35,0,0" scale=2 mesh="ast1.mesh">
+                  <attached>
+                    <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
+                  </attached>
+                </Model>
+              </attached>
+            </MovableEntity>
+          </attached>
+        </StaticEntity>
+        <MovableEntity position="0,0,-100" velocity="0,0,0" rotationaxis="0,1,0" rotationrate=200>
+          <attached>
+            <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
+            <Model position="0,0,0" scale=6 mesh="ast1.mesh" />
+            <Model position="0,0,-50" scale=3 mesh="ast1.mesh" />
+            <Model position="0,0,50" scale=3 mesh="ast1.mesh" />
+          </attached>
+        </MovableEntity>
+      </attached>
+    </MovableEntity>
+
+    <ExplosionChunk position="-500,0,-200" lifetime=3.0 loop=1/>
+
   </Scene>
 </Level>

Modified: code/branches/ppspickups1/data/levels/templates/pickup_representation_templates_speed.oxt
===================================================================
--- code/branches/ppspickups1/data/levels/templates/pickup_representation_templates_speed.oxt	2010-04-12 14:06:46 UTC (rev 6693)
+++ code/branches/ppspickups1/data/levels/templates/pickup_representation_templates_speed.oxt	2010-04-12 14:08:15 UTC (rev 6694)
@@ -3,9 +3,9 @@
         <spawner-representation>
             <StaticEntity>
                 <attached>
-                    <Billboard position="0,0,0" colour="0.50,0.90,0.25" material="Sphere2" scale=0.1>
+                    <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.1>
                         <attached>
-                            <Billboard position="0,0,0" colour="0.90,0.90,0.10" material="3arrowsup" scale=0.7 />
+                            <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.3 />
                         </attached>
                     </Billboard>
                 </attached>
@@ -17,9 +17,87 @@
 <Template name=smallspeedpickup>
   <SpeedPickup
     duration = 10.0
-    speedAdd = 100
-    SpeedMultiply = 10
+    speedAdd = 0.0
+    SpeedMultiply = 10.0
     activationType = "immediate"
     durationType = "once"
   />
 </Template>
+
+<Template name=mediumspeedpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.1>
+                        <attached>
+                            <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.5 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=mediumspeedpickup>
+  <SpeedPickup
+    duration = 10.0
+    speedAdd = 0.0
+    SpeedMultiply = 25.0
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
+
+<Template name=hugespeedpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.1>
+                        <attached>
+                            <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.7 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=hugespeedpickup>
+  <SpeedPickup
+    duration = 10.0
+    speedAdd = 0.0
+    SpeedMultiply = 50.0
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
+
+<Template name=smalljumppickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.1>
+                        <attached>
+                            <Billboard position="0,0,0" colour="1,0,0" material="3arrowsup" scale=0.3 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=smalljumppickup>
+  <SpeedPickup
+    duration = 0.7
+    speedAdd = 5000.0
+    SpeedMultiply = 1.0
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
\ No newline at end of file

Modified: code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc
===================================================================
--- code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc	2010-04-12 14:06:46 UTC (rev 6693)
+++ code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc	2010-04-12 14:08:15 UTC (rev 6694)
@@ -136,11 +136,11 @@
         //! If the pickup has transited to used.
         if(this->isUsed())
         {
-            this->startPickupTimer(this->getDuration());
-
             Engine* engine = this->carrierToEngineHelper();
             if(engine == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
                 this->destroy();
+
+            this->startPickupTimer(this->getDuration());
             engine->setSpeedAdd(this->getSpeedAdd());
             engine->setSpeedMultiply(this->getSpeedMultiply());
         }
@@ -207,7 +207,7 @@
         else
         {
             COUT(1) << "Invalid duration in SpeedPickup." << std::endl;
-            this->duration_ = 0;
+            this->duration_ = 0.0f;
         }
     }
 
@@ -226,7 +226,7 @@
         else
         {
             COUT(1) << "Invalid speedAdd in SpeedPickup." << std::endl;
-            this->speedAdd_ = 0.0;
+            this->speedAdd_ = 0.0f;
         }
     }
 
@@ -245,11 +245,16 @@
         else
         {
             COUT(1) << "Invalid speedMultiply in SpeedPickup." << std::endl;
-            this->speedMultiply_ = 1.0;
+            this->speedMultiply_ = 1.0f;
         }
     }
 
     void SpeedPickup::PickupTimerCallBack(void) {
-        /* Reset values */
+            Engine* engine = this->carrierToEngineHelper();
+            if(engine == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
+                this->destroy();
+
+            engine->setSpeedAdd(0.0f);
+            engine->setSpeedMultiply(1.0f);
     }
 }

Deleted: code/branches/ppspickups1/svntest.txt
===================================================================
--- code/branches/ppspickups1/svntest.txt	2010-04-12 14:06:46 UTC (rev 6693)
+++ code/branches/ppspickups1/svntest.txt	2010-04-12 14:08:15 UTC (rev 6694)
@@ -1 +0,0 @@
-sdsd
\ No newline at end of file




More information about the Orxonox-commit mailing list