[Orxonox-commit 4447] r9118 - in code/branches/pickup2012: data/levels data/levels/templates src/orxonox/worldentities/pawns
lkevin at orxonox.net
lkevin at orxonox.net
Fri Apr 27 14:36:52 CEST 2012
Author: lkevin
Date: 2012-04-27 14:36:52 +0200 (Fri, 27 Apr 2012)
New Revision: 9118
Modified:
code/branches/pickup2012/data/levels/pickups.oxw
code/branches/pickup2012/data/levels/templates/pickupRepresentationTemplates.oxt
code/branches/pickup2012/src/orxonox/worldentities/pawns/Pawn.cc
Log:
First working version. Default damage increase is
currently set to 20. Now fixing things and documenting.
Modified: code/branches/pickup2012/data/levels/pickups.oxw
===================================================================
--- code/branches/pickup2012/data/levels/pickups.oxw 2012-04-27 12:17:32 UTC (rev 9117)
+++ code/branches/pickup2012/data/levels/pickups.oxw 2012-04-27 12:36:52 UTC (rev 9118)
@@ -168,6 +168,15 @@
</pickup>
</PickupSpawner>
+ <!-- DamageBoost pickup -->
+
+ <PickupSpawner position="-100,300,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
+ <pickup>
+ <DamageBoostPickup template=normaldamageboostpickup />
+ </pickup>
+ </PickupSpawner>
+
+
<!-- Other pickups -->
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
@@ -205,7 +214,64 @@
<ShrinkPickup template ="hugeshrinkpickup"/>
</pickup>
</PickupSpawner>
+
+ <!-- @Objects: 4 boxes (uncontrolled pawns) -->
+ <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
<!--StaticEntity position="0,-200,0" direction="0,-1,0" collisionType=static mass=500 friction=0.01 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
Modified: code/branches/pickup2012/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/branches/pickup2012/data/levels/templates/pickupRepresentationTemplates.oxt 2012-04-27 12:17:32 UTC (rev 9117)
+++ code/branches/pickup2012/data/levels/templates/pickupRepresentationTemplates.oxt 2012-04-27 12:36:52 UTC (rev 9118)
@@ -224,7 +224,7 @@
<attached>
<Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.5>
<attached>
- <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="asterisk" scale=0.5 />
+ <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.5 />
</attached>
</Billboard>
</attached>
@@ -233,10 +233,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallspeedpickup>
- <SpeedPickup
+<Template name=normaldamageboostpickup>
+ <DamageBoostPickup
duration = 10.0
- damageBoost = damageBoost*2
activationType = "immediate"
durationType = "continuous"
/>
Modified: code/branches/pickup2012/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/pickup2012/src/orxonox/worldentities/pawns/Pawn.cc 2012-04-27 12:17:32 UTC (rev 9117)
+++ code/branches/pickup2012/src/orxonox/worldentities/pawns/Pawn.cc 2012-04-27 12:36:52 UTC (rev 9118)
@@ -231,7 +231,9 @@
void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
{
// apply multiplier
- damage *= originator->getDamageMultiplier();
+ Pawn *test = dynamic_cast<Pawn *>(originator);
+ if( test != NULL )
+ damage *= originator->getDamageMultiplier();
if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
{
More information about the Orxonox-commit
mailing list