[Orxonox-commit 2264] r6980 - in code/branches/ppspickups3: data/levels data/levels/includes data/levels/templates src/orxonox/worldentities/pawns

ebeier at orxonox.net ebeier at orxonox.net
Thu May 27 19:05:36 CEST 2010


Author: ebeier
Date: 2010-05-27 19:05:36 +0200 (Thu, 27 May 2010)
New Revision: 6980

Removed:
   code/branches/ppspickups3/data/levels/pickup_pps_invi.oxw
   code/branches/ppspickups3/data/levels/pickup_ppstest1.oxw
Modified:
   code/branches/ppspickups3/data/levels/includes/pickups.oxi
   code/branches/ppspickups3/data/levels/pickup.oxw
   code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt
   code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc
Log:
created more pickup representations, prepared pickup-level for presentation, removed debug code etc.


Modified: code/branches/ppspickups3/data/levels/includes/pickups.oxi
===================================================================
--- code/branches/ppspickups3/data/levels/includes/pickups.oxi	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/data/levels/includes/pickups.oxi	2010-05-27 17:05:36 UTC (rev 6980)
@@ -1,16 +1,38 @@
 <!-- Shield pickups -->
 
 <PickupRepresentation
-    pickupName = "Super Shield Pickup"
-    pickupDescription = "Gives you a shield with 1000000 helath points for 5 minutes"
-    inventoryRepresentation = "SmallHealth"
-    spawnerTemplate = "supershieldpickupRepresentation"
+    pickupName = "Small Shield Pickup"
+    pickupDescription = "Gives you a small shield for 10 seconds."
+    inventoryRepresentation = "SmallShield"
+    spawnerTemplate = "smallshieldpickupRepresentation"
 >
     <pickup>
-        <ShieldPickup template=supershieldpickup />
+        <ShieldPickup template=smallshieldpickup />
     </pickup>
 </PickupRepresentation>
 
+<PickupRepresentation
+    pickupName = "Medium Shield Pickup"
+    pickupDescription = "Gives you a medium-sized shield for 30 seconds."
+    inventoryRepresentation = "MediumShield"
+    spawnerTemplate = "mediumshieldpickupRepresentation"
+>
+    <pickup>
+        <ShieldPickup template=mediumshieldpickup />
+    </pickup>
+</PickupRepresentation>
+
+<PickupRepresentation
+    pickupName = "Huge Shield Pickup"
+    pickupDescription = "Gives you a big shield for 60 seconds."
+    inventoryRepresentation = "HugeShield"
+    spawnerTemplate = "hugeshieldpickupRepresentation"
+>
+    <pickup>
+        <ShieldPickup template=hugeshieldpickup />
+    </pickup>
+</PickupRepresentation>
+
 <!-- Health pickups -->
 
 <PickupRepresentation

Modified: code/branches/ppspickups3/data/levels/pickup.oxw
===================================================================
--- code/branches/ppspickups3/data/levels/pickup.oxw	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/data/levels/pickup.oxw	2010-05-27 17:05:36 UTC (rev 6980)
@@ -28,11 +28,23 @@
 
     <!-- Shield pickups -->
     
-    <PickupSpawner position="-50,50,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
+    <PickupSpawner position="-25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
         <pickup>
-            <ShieldPickup template=supershieldpickup />
+            <ShieldPickup template=smallshieldpickup />
         </pickup>
     </PickupSpawner>
+
+    <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
+        <pickup>
+            <ShieldPickup template=mediumshieldpickup />
+        </pickup>
+    </PickupSpawner>
+
+    <PickupSpawner position="25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
+        <pickup>
+            <ShieldPickup template=hugeshieldpickup />
+        </pickup>
+    </PickupSpawner>
     
     <!-- Health pickups -->
     

Deleted: code/branches/ppspickups3/data/levels/pickup_pps_invi.oxw
===================================================================
--- code/branches/ppspickups3/data/levels/pickup_pps_invi.oxw	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/data/levels/pickup_pps_invi.oxw	2010-05-27 17:05:36 UTC (rev 6980)
@@ -1,46 +0,0 @@
-<?lua
-  include("stats.oxo")
-  include("hudtemplates3.oxo")
-?>
-
-<?lua
-  include("templates/spaceship_assff.oxt")
-  include("templates/spaceship_pirate.oxt")
-  include("templates/pickup_representation_templates.oxt")
-?>
-
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
-  <Scene
-    ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/Starbox"
-  >
-
-<?lua
-  include("includes/pickups.oxi")
-?>
-
-    <PickupSpawner position="-75,0,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-        <pickup>
-            <InvisiblePickup template=smallinvisiblepickup />
-        </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="-50,0,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-        <pickup>
-            <InvisiblePickup template=mediuminvisiblepickup />
-        </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="-25,0,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-        <pickup>
-            <InvisiblePickup template=hugeinvisiblepickup />
-        </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 />
-  </Scene>
-</Level>

Deleted: code/branches/ppspickups3/data/levels/pickup_ppstest1.oxw
===================================================================
--- code/branches/ppspickups3/data/levels/pickup_ppstest1.oxw	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/data/levels/pickup_ppstest1.oxw	2010-05-27 17:05:36 UTC (rev 6980)
@@ -1,98 +0,0 @@
-<?lua
-  include("stats.oxo")
-  include("hudtemplates3.oxo")
-?>
-
-<?lua
-  include("templates/spaceship_assff.oxt")
-  include("templates/spaceship_pirate.oxt")
-  include("templates/pickup_representation_templates.oxt")
-?>
-
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
-  <Scene
-    ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/Starbox"
-  >
-
-<?lua
-  include("includes/pickups.oxi")
-?>
-
-    <PickupSpawner position="-25,0,-100" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-        <pickup>
-            <SpeedPickup template=smallspeedpickup />
-        </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/ppspickups3/data/levels/templates/pickup_representation_templates.oxt
===================================================================
--- code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt	2010-05-27 17:05:36 UTC (rev 6980)
@@ -1,13 +1,13 @@
 <!-- Shield pickups: -->
 
-<Template name=supershieldpickupRepresentation>
+<Template name=smallshieldpickupRepresentation>
     <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 />
+                            <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=0.3 />
                         </attached>
                     </Billboard>
                 </attached>
@@ -16,16 +16,70 @@
     </PickupRepresentation>
 </Template>
 
-<Template name=supershieldpickup>
+<Template name=smallshieldpickup>
   <ShieldPickup
-    absorption = 1
-    duration = 6000
-    shieldhealth = 1000000
+    duration = 10
+    shieldabsorption = 0.7
+    shieldhealth = 300
     activationType = "immediate"
     durationType = "once"
   />
 </Template>
 
+
+<Template name=mediumshieldpickupRepresentation>
+    <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=0.5 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=mediumshieldpickup>
+  <ShieldPickup
+    duration = 30
+    shieldabsorption = 0.8
+    shieldhealth = 500
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
+
+
+<Template name=hugeshieldpickupRepresentation>
+    <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=0.7 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=hugeshieldpickup>
+  <ShieldPickup
+    duration = 60
+    shieldabsorption = 0.95
+    shieldhealth = 700
+    activationType = "immediate"
+    durationType = "once"
+  />
+</Template>
+
 <!-- Health pickups: -->
 
 <Template name=smallhealthpickupRepresentation>

Modified: code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc	2010-05-27 16:44:21 UTC (rev 6979)
+++ code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc	2010-05-27 17:05:36 UTC (rev 6980)
@@ -79,7 +79,7 @@
         }
         else
             this->weaponSystem_ = 0;
-        
+
         this->setCarrierName("Pawn");
 
         this->setRadarObjectColour(ColourValue::Red);
@@ -106,10 +106,10 @@
         XMLPortParam(Pawn, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
         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);
         XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
@@ -169,24 +169,19 @@
             //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()) 
+            if (shielddamage > this->getShieldHealth())
             {
-                COUT(1) << "the shield is too weak to take its share of the damage!" << std::endl;
-
                 healthdamage += shielddamage-this->getShieldHealth();
                 this->setShieldHealth(0);
             }
 
             this->setHealth(this->health_ - healthdamage);
-            
+
             if (this->getShieldHealth() > 0)
             {
                 this->setShieldHealth(this->shieldHealth_ - shielddamage);
-                COUT(1) << "damage " << damage  << " getShieldAbsorption " << getShieldAbsorption() << std::endl;
-                COUT(1) << "shielddamage " << shielddamage  << " healthdamage " << healthdamage << std::endl;
-                COUT(1) << "the shield takes its share of the damage and is left with " << this->getShieldHealth() << std::endl;
             }
 
             this->lastHitOriginator_ = originator;
@@ -194,7 +189,7 @@
             // play damage effect
         }
     }
-    
+
     void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
     {
         if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )




More information about the Orxonox-commit mailing list