[Orxonox-commit 2282] r6998 - in code/branches/presentation3: . data/levels data/levels/includes data/levels/templates src/modules/pickup src/modules/pickup/items src/orxonox/controllers src/orxonox/worldentities/pawns
dafrick at orxonox.net
dafrick at orxonox.net
Thu May 27 23:50:25 CEST 2010
Author: dafrick
Date: 2010-05-27 23:50:24 +0200 (Thu, 27 May 2010)
New Revision: 6998
Added:
code/branches/presentation3/src/modules/pickup/items/ShieldPickup.cc
code/branches/presentation3/src/modules/pickup/items/ShieldPickup.h
Removed:
code/branches/presentation3/data/levels/pickup_pps_invi.oxw
code/branches/presentation3/data/levels/pickup_ppstest1.oxw
Modified:
code/branches/presentation3/
code/branches/presentation3/data/levels/includes/pickups.oxi
code/branches/presentation3/data/levels/pickup.oxw
code/branches/presentation3/data/levels/templates/pickup_representation_templates.oxt
code/branches/presentation3/src/modules/pickup/PickupPrereqs.h
code/branches/presentation3/src/modules/pickup/items/CMakeLists.txt
code/branches/presentation3/src/orxonox/controllers/AIController.cc
code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h
Log:
Merged pickup branch into presentation3 branch.
Seems to be working just fine so not much changes at all. (Except for some representations that had the parameters 'name' instead of 'pickupName' and 'description' instead of 'pickupDescription').
Property changes on: code/branches/presentation3
___________________________________________________________________
Modified: svn:mergeinfo
- /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/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/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/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/menu:5941-6146,6148
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network64:2210-2355
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/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/pickup2:5942-6405
/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/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/presentation:2369-2652,2654-2660
/code/branches/presentation2:6106-6416
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
+ /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/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/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/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/menu:5941-6146,6148
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network64:2210-2355
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/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/pickup2:5942-6405
/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/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/presentation:2369-2652,2654-2660
/code/branches/presentation2:6106-6416
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
Modified: code/branches/presentation3/data/levels/includes/pickups.oxi
===================================================================
--- code/branches/presentation3/data/levels/includes/pickups.oxi 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/data/levels/includes/pickups.oxi 2010-05-27 21:50:24 UTC (rev 6998)
@@ -1,4 +1,38 @@
+<!-- Shield pickups -->
+<PickupRepresentation
+ pickupName = "Small Shield Pickup"
+ pickupDescription = "Gives you a small shield for 10 seconds."
+ inventoryRepresentation = "SmallShield"
+ spawnerTemplate = "smallshieldpickupRepresentation"
+>
+ <pickup>
+ <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
@@ -72,9 +106,10 @@
<!-- Speed pickups -->
<PickupRepresentation
- name = "Small Speed Boost"
- description = "Multiplies Speed of the Ship by a small amount."
+ pickupName = "Small Speed Boost"
+ pickupDescription = "Multiplies Speed of the Ship by a small amount."
spawnerTemplate = "smallspeedpickupRepresentation"
+ inventoryRepresentation = "SmallSpeed"
>
<pickup>
<SpeedPickup template=smallspeedpickup />
@@ -82,9 +117,10 @@
</PickupRepresentation>
<PickupRepresentation
- name = "Medium Speed Boost"
- description = "Multiplies Speed of the Ship by a bigger amount."
+ pickupName = "Medium Speed Boost"
+ pickupDescription = "Multiplies Speed of the Ship by a bigger amount."
spawnerTemplate = "mediumspeedpickupRepresentation"
+ inventoryRepresentation = "MediumSpeed"
>
<pickup>
<SpeedPickup template=mediumspeedpickup />
@@ -92,9 +128,10 @@
</PickupRepresentation>
<PickupRepresentation
- name = "Huge Speed Boost"
- description = "Multiplies Speed of the Ship by a huge amount."
+ pickupName = "Huge Speed Boost"
+ pickupDescription = "Multiplies Speed of the Ship by a huge amount."
spawnerTemplate = "hugespeedpickupRepresentation"
+ inventoryRepresentation = "HugeSpeed"
>
<pickup>
<SpeedPickup template=hugespeedpickup />
@@ -102,9 +139,10 @@
</PickupRepresentation>
<PickupRepresentation
- name = "Small Jump Boost"
- description = "Boosts the Ship with a massive amount for a very short time."
+ pickupName = "Small Jump Boost"
+ pickupDescription = "Boosts the Ship with a massive amount for a very short time."
spawnerTemplate = "smalljumppickupRepresentation"
+ inventoryRepresentation = "SmallSpeed"
>
<pickup>
<SpeedPickup template=smalljumppickup />
@@ -114,9 +152,10 @@
<!-- Invisible pickups -->
<PickupRepresentation
- name = "small Invisibility"
- description = "Makes you invisible for 5 seconds."
+ pickupName = "Small Invisibility"
+ pickupDescription = "Makes you invisible for 5 seconds."
spawnerTemplate = "smallinvisiblepickupRepresentation"
+ inventoryRepresentation = "SmallInvisible"
>
<pickup>
<InvisiblePickup template=smallinvisiblepickup />
@@ -124,9 +163,10 @@
</PickupRepresentation>
<PickupRepresentation
- name = "medium Invisibility"
- description = "Makes you invisible for 10 seconds."
+ pickupName = "Medium Invisibility"
+ pickupDescription = "Makes you invisible for 10 seconds."
spawnerTemplate = "mediuminvisiblepickupRepresentation"
+ inventoryRepresentation = "MediumInvisible"
>
<pickup>
<InvisiblePickup template=mediuminvisiblepickup />
@@ -134,9 +174,10 @@
</PickupRepresentation>
<PickupRepresentation
- name = "hunge Invisibility"
- description = "Makes you invisible for 20 seconds."
+ pickupName = "Huge Invisibility"
+ pickupDescription = "Makes you invisible for 20 seconds."
spawnerTemplate = "hugeinvisiblepickupRepresentation"
+ inventoryRepresentation = "HugeInvisible"
>
<pickup>
<InvisiblePickup template=hugeinvisiblepickup />
Modified: code/branches/presentation3/data/levels/pickup.oxw
===================================================================
--- code/branches/presentation3/data/levels/pickup.oxw 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/data/levels/pickup.oxw 2010-05-27 21:50:24 UTC (rev 6998)
@@ -25,6 +25,27 @@
<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 />
+
+ <!-- Shield pickups -->
+
+ <PickupSpawner position="-25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
+ <pickup>
+ <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 -->
<PickupSpawner position="-25,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
@@ -113,7 +134,7 @@
<!-- Pickup Collection pickups -->
- <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
+ <PickupSpawner position="0,100,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
<pickup>
<PickupCollection template=triplehealthspeedinvisibilitypickup />
</pickup>
Deleted: code/branches/presentation3/data/levels/pickup_pps_invi.oxw
===================================================================
--- code/branches/presentation3/data/levels/pickup_pps_invi.oxw 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/data/levels/pickup_pps_invi.oxw 2010-05-27 21:50:24 UTC (rev 6998)
@@ -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/presentation3/data/levels/pickup_ppstest1.oxw
===================================================================
--- code/branches/presentation3/data/levels/pickup_ppstest1.oxw 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/data/levels/pickup_ppstest1.oxw 2010-05-27 21:50:24 UTC (rev 6998)
@@ -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/presentation3/data/levels/templates/pickup_representation_templates.oxt
===================================================================
--- code/branches/presentation3/data/levels/templates/pickup_representation_templates.oxt 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/data/levels/templates/pickup_representation_templates.oxt 2010-05-27 21:50:24 UTC (rev 6998)
@@ -1,4 +1,85 @@
+<!-- Shield pickups: -->
+<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=0.3 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=smallshieldpickup>
+ <ShieldPickup
+ 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>
@@ -137,110 +218,110 @@
<!-- Speed pickups -->
-<Template name=smallspeedpickupRepresentation>
- <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.3 />
- </attached>
- </Billboard>
- </attached>
- </StaticEntity>
- </spawner-representation>
- </PickupRepresentation>
-</Template>
-
-<Template name=smallspeedpickup>
- <SpeedPickup
- duration = 10.0
- 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 name=smallspeedpickupRepresentation>
+ <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.3 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
</Template>
+<Template name=smallspeedpickup>
+ <SpeedPickup
+ duration = 10.0
+ 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>
+
<!-- Invisible pickups -->
<Template name=smallinvisiblepickupRepresentation>
Modified: code/branches/presentation3/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/presentation3/src/modules/pickup/PickupPrereqs.h 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/src/modules/pickup/PickupPrereqs.h 2010-05-27 21:50:24 UTC (rev 6998)
@@ -78,6 +78,7 @@
class InvisiblePickup;
class MetaPickup;
class SpeedPickup;
+ class ShieldPickup;
}
Modified: code/branches/presentation3/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/pickup/items/CMakeLists.txt 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/src/modules/pickup/items/CMakeLists.txt 2010-05-27 21:50:24 UTC (rev 6998)
@@ -3,4 +3,5 @@
InvisiblePickup.cc
MetaPickup.cc
SpeedPickup.cc
+ ShieldPickup.cc
)
Copied: code/branches/presentation3/src/modules/pickup/items/ShieldPickup.cc (from rev 6997, code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.cc)
===================================================================
--- code/branches/presentation3/src/modules/pickup/items/ShieldPickup.cc (rev 0)
+++ code/branches/presentation3/src/modules/pickup/items/ShieldPickup.cc 2010-05-27 21:50:24 UTC (rev 6998)
@@ -0,0 +1,274 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Eric Beier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file ShieldPickup.cc
+ @brief Implementation of the ShieldPickup class.
+*/
+
+#include "ShieldPickup.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/StringUtils.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+#include "items/Engine.h"
+#include "pickup/PickupIdentifier.h"
+
+#include <sstream>
+
+
+namespace orxonox
+{
+ CreateFactory(ShieldPickup);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes the member variables.
+ */
+ ShieldPickup::ShieldPickup(BaseObject* creator) : Pickup(creator)
+ {
+ RegisterObject(ShieldPickup);
+
+ this->initialize();
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ ShieldPickup::~ShieldPickup()
+ {
+
+ }
+
+ /**
+ @brief
+ Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+ @return
+ A pointer to the Pawn, or NULL if the conversion failed.
+ */
+ Pawn* ShieldPickup::carrierToPawnHelper(void)
+ {
+ PickupCarrier* carrier = this->getCarrier();
+ Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+
+ if(pawn == NULL)
+ {
+ COUT(1) << "Invalid PickupCarrier in ShieldPickup." << std::endl;
+ }
+ return pawn;
+ }
+
+ /**
+ @brief
+ Initializes the member variables.
+ */
+ void ShieldPickup::initialize(void)
+ {
+ this->duration_ = 0.0f;
+ this->shieldAbsorption_ = 0.0f;
+ this->shieldHealth_ = 0.0f;
+
+ this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+ }
+
+ /**
+ @brief
+ Initializes the PickupIdentifier of this pickup.
+ */
+ void ShieldPickup::initializeIdentifier(void)
+ {
+ std::stringstream stream;
+ stream << this->getDuration();
+ std::string type1 = "duration";
+ std::string val1 = stream.str();
+ this->pickupIdentifier_->addParameter(type1, val1);
+
+ stream.clear();
+ stream << this->getShieldHealth();
+ std::string type2 = "ShieldHealth";
+ std::string val2 = stream.str();
+ this->pickupIdentifier_->addParameter(type2, val2);
+
+ stream.clear();
+ stream << this->getShieldAbsorption();
+ std::string type3 = "ShieldAbsorption";
+ std::string val3 = stream.str();
+ this->pickupIdentifier_->addParameter(type3, val3);
+
+ }
+
+ /**
+ @brief
+ Method for creating a ShieldPickup object through XML.
+ */
+ void ShieldPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+ {
+ SUPER(ShieldPickup, XMLPort, xmlelement, mode);
+
+ XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
+ XMLPortParam(ShieldPickup, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode);
+ XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
+
+ this->initializeIdentifier();
+ }
+
+ /**
+ @brief
+ Is called when the pickup has transited from used to unused or the other way around.
+ */
+ void ShieldPickup::changedUsed(void)
+ {
+ SUPER(ShieldPickup, changedUsed);
+
+ //! If the pickup is not picked up nothing must be done.
+ if(!this->isPickedUp())
+ return;
+
+ Pawn* pawn = this->carrierToPawnHelper();
+ if(pawn == NULL)
+ this->destroy();
+
+ //! If the pickup has transited to used.
+ if(this->isUsed())
+ {
+ if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() > 0.0f)
+ {
+ this->getTimer()->unpauseTimer();
+ }
+ else
+ {
+ this->startPickupTimer(this->getDuration());
+ }
+ pawn->setShieldAbsorption(this->getShieldAbsorption());
+ pawn->setShieldHealth(this->getShieldHealth());
+ }
+ else
+ {
+ pawn->setShieldAbsorption(0.0f);
+ this->setShieldHealth(pawn->getShieldHealth());
+ pawn->setShieldHealth(0.0f);
+
+ if(this->isOnce())
+ {
+ if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
+ {
+ this->destroy();
+ }
+ else
+ {
+ this->getTimer()->pauseTimer();
+ }
+ }
+ }
+ }
+
+ /**
+ @brief
+ Creates a duplicate of the input OrxonoxClass.
+ @param item
+ A pointer to the Orxonox class.
+ */
+ void ShieldPickup::clone(OrxonoxClass*& item)
+ {
+ if(item == NULL)
+ item = new ShieldPickup(this);
+
+ SUPER(ShieldPickup, clone, item);
+
+ ShieldPickup* pickup = dynamic_cast<ShieldPickup*>(item);
+ pickup->setDuration(this->getDuration());
+ pickup->setShieldAbsorption(this->getShieldAbsorption());
+ pickup->setShieldHealth(this->getShieldHealth());
+ pickup->initializeIdentifier();
+ }
+
+ /**
+ @brief
+ Sets the percentage the shield absorbs of the dealt damage.
+ @param shieldAbsorption
+ The shieldAbsorption. Has to be between 0 and 1
+ */
+ void ShieldPickup::setShieldAbsorption(float shieldAbsorption)
+ {
+ if (shieldAbsorption>=0 && shieldAbsorption<=1)
+ {
+ this->shieldAbsorption_=shieldAbsorption;
+ }
+ else
+ {
+ COUT(1) << "Invalid Absorption in ShieldPickup." << std::endl;
+ this->shieldAbsorption_=0;
+ }
+ }
+
+ /**
+ @brief
+ Sets the health of the shield.
+ @param shieldHealth
+ The shieldHealth
+ */
+ void ShieldPickup::setShieldHealth(float shieldHealth)
+ {
+ if (shieldHealth>=0)
+ {
+ this->shieldHealth_=shieldHealth;
+ }
+ else
+ {
+ COUT(1) << "Invalid Shieldhealth in ShieldPickup." << std::endl;
+ this->shieldHealth_=0;
+ }
+ }
+
+ /**
+ @brief
+ Sets the duration.
+ @param duration
+ The duration
+ */
+ void ShieldPickup::setDuration(float duration)
+ {
+ if(duration >= 0.0f)
+ {
+ this->duration_ = duration;
+ }
+ else
+ {
+ COUT(1) << "Invalid duration in ShieldPickup." << std::endl;
+ this->duration_ = 0.0f;
+ }
+ }
+
+ void ShieldPickup::pickupTimerCallback(void)
+ {
+ this->setUsed(false);
+ }
+}
Copied: code/branches/presentation3/src/modules/pickup/items/ShieldPickup.h (from rev 6997, code/branches/ppspickups3/src/modules/pickup/items/ShieldPickup.h)
===================================================================
--- code/branches/presentation3/src/modules/pickup/items/ShieldPickup.h (rev 0)
+++ code/branches/presentation3/src/modules/pickup/items/ShieldPickup.h 2010-05-27 21:50:24 UTC (rev 6998)
@@ -0,0 +1,99 @@
+
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Eric Beier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file ShieldPickup.h
+ @brief Declaration of the ShieldPickup class.
+*/
+
+#ifndef _ShieldPickup_H__
+#define _ShieldPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/StaticEntity.h"
+
+#include "pickup/Pickup.h"
+
+namespace orxonox {
+
+ /**
+ @brief
+ A Pickup which can add a Shield to the Pawn.
+
+ 1) The percentage: The percentage the shield takes from the damage dealt to a Pawn
+ 2) The hit points: The amount of damage points a shield can teake before collapsing
+ 3) The activation type: 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it.
+ 4) The duration: the activation time of the pickup.
+
+ @author
+ Eric Beier
+ */
+ class _PickupExport ShieldPickup : public Pickup
+ {
+ public:
+
+ ShieldPickup(BaseObject* creator); //!< Constructor.
+ virtual ~ShieldPickup(); //!< Destructor.
+
+ virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
+
+ virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+ virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
+
+ inline float getDuration(void)
+ { return this->duration_; }
+ inline float getShieldHealth()
+ { return this->shieldHealth_; }
+ inline float getShieldAbsorption()
+ { return this->shieldAbsorption_; }
+
+ protected:
+ void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
+
+ virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends.
+
+ void setDuration(float duration);
+ void setShieldHealth(float shieldHealth);
+ void setShieldAbsorption(float shieldAbsorption);
+
+ private:
+ void initialize(void); //!< Initializes the member variables.
+ Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+
+ float duration_; //!< The health that is transferred to the Pawn.
+ float shieldHealth_;
+ float shieldAbsorption_; // Has to be between 0 and 1
+
+ };
+}
+
+#endif // _ShieldPickup_H__
Property changes on: code/branches/presentation3/src/orxonox/controllers/AIController.cc
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/buildsystem/src/orxonox/controllers/AIController.cc:1874-2276,2278-2400
/code/branches/buildsystem2/src/orxonox/controllers/AIController.cc:2506-2658
/code/branches/buildsystem3/src/orxonox/controllers/AIController.cc:2662-2708
/code/branches/ceguilua/src/orxonox/controllers/AIController.cc:1802-1808
/code/branches/chat/src/orxonox/controllers/AIController.cc:6527-6797
/code/branches/chat2/src/orxonox/controllers/AIController.cc:6836-6910
/code/branches/console/src/orxonox/controllers/AIController.cc:5941-6104
/code/branches/core3/src/orxonox/controllers/AIController.cc:1572-1739
/code/branches/core4/src/orxonox/controllers/AIController.cc: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/src/orxonox/controllers/AIController.cc:5768-5928,6009
/code/branches/gamestate/src/orxonox/controllers/AIController.cc:6430-6572,6621-6661
/code/branches/gamestates2/src/orxonox/controllers/AIController.cc:6594-6745
/code/branches/gametypes/src/orxonox/controllers/AIController.cc:2826-3031
/code/branches/gcc43/src/orxonox/controllers/AIController.cc:1580
/code/branches/gui/src/orxonox/controllers/AIController.cc:1635-1723,2795-2894
/code/branches/hudelements/src/orxonox/controllers/AIController.cc:6584-6941
/code/branches/ingamemenu/src/orxonox/controllers/AIController.cc:6000-6023
/code/branches/input/src/orxonox/controllers/AIController.cc:1629-1636
/code/branches/libraries/src/orxonox/controllers/AIController.cc:5612-5692
/code/branches/libraries2/src/orxonox/controllers/AIController.cc:5703-5737
/code/branches/lod/src/orxonox/controllers/AIController.cc:6586-6911
/code/branches/lodfinal/src/orxonox/controllers/AIController.cc:2372-2411
/code/branches/map/src/orxonox/controllers/AIController.cc:2801-3086,3089
/code/branches/menu/src/orxonox/controllers/AIController.cc:5941-6146,6148
/code/branches/miniprojects/src/orxonox/controllers/AIController.cc:2754-2824
/code/branches/netp2/src/orxonox/controllers/AIController.cc:2835-2988
/code/branches/netp3/src/orxonox/controllers/AIController.cc:2988-3082
/code/branches/netp6/src/orxonox/controllers/AIController.cc:3214-3302
/code/branches/network/src/orxonox/controllers/AIController.cc:2356
/code/branches/network64/src/orxonox/controllers/AIController.cc:2210-2355
/code/branches/objecthierarchy/src/orxonox/controllers/AIController.cc:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2/src/orxonox/controllers/AIController.cc:2171-2479
/code/branches/overlay/src/orxonox/controllers/AIController.cc:2117-2385
/code/branches/particles/src/orxonox/controllers/AIController.cc:2829-3085
/code/branches/particles2/src/orxonox/controllers/AIController.cc:6050-6106,6109
/code/branches/pch/src/orxonox/controllers/AIController.cc:3113-3194
/code/branches/physics/src/orxonox/controllers/AIController.cc:1912-2055,2107-2439
/code/branches/physics_merge/src/orxonox/controllers/AIController.cc:2436-2457
/code/branches/pickup2/src/orxonox/controllers/AIController.cc:5942-6405
/code/branches/pickup3/src/orxonox/controllers/AIController.cc:6418-6523
/code/branches/pickup4/src/orxonox/controllers/AIController.cc:6594-6710
/code/branches/pickups/src/orxonox/controllers/AIController.cc:1926-2086,2127,2827-2915
/code/branches/pickups2/src/orxonox/controllers/AIController.cc:2107-2497,2915-3071
/code/branches/ppspickups1/src/orxonox/controllers/AIController.cc:6552-6708
/code/branches/ppspickups2/src/orxonox/controllers/AIController.cc:6527-6532,6554-6709
/code/branches/presentation/src/orxonox/controllers/AIController.cc:2369-2652,2654-2660
/code/branches/presentation2/src/orxonox/controllers/AIController.cc:6106-6416
/code/branches/questsystem/src/orxonox/controllers/AIController.cc:1894-2088
/code/branches/questsystem2/src/orxonox/controllers/AIController.cc:2107-2259
/code/branches/questsystem5/src/orxonox/controllers/AIController.cc:2776-2905
/code/branches/resource/src/orxonox/controllers/AIController.cc:3327-3366
/code/branches/resource2/src/orxonox/controllers/AIController.cc:3372-5694
/code/branches/rocket/src/orxonox/controllers/AIController.cc:6779-6950
/code/branches/script_trigger/src/orxonox/controllers/AIController.cc:1295-1953,1955
/code/branches/skybox2/src/orxonox/controllers/AIController.cc:6559-6989
/code/branches/sound/src/orxonox/controllers/AIController.cc:2829-3010
/code/branches/sound3/src/orxonox/controllers/AIController.cc:5941-6102
/code/branches/steering/src/orxonox/controllers/AIController.cc:5949-6091
/code/branches/weapon/src/orxonox/controllers/AIController.cc:1925-2094
/code/branches/weapon2/src/orxonox/controllers/AIController.cc:2107-2488
/code/branches/weapons/src/orxonox/controllers/AIController.cc:2897-3051
/code/branches/weaponsystem/src/orxonox/controllers/AIController.cc:2742-2890
+ /code/branches/buildsystem/src/orxonox/controllers/AIController.cc:1874-2276,2278-2400
/code/branches/buildsystem2/src/orxonox/controllers/AIController.cc:2506-2658
/code/branches/buildsystem3/src/orxonox/controllers/AIController.cc:2662-2708
/code/branches/ceguilua/src/orxonox/controllers/AIController.cc:1802-1808
/code/branches/chat/src/orxonox/controllers/AIController.cc:6527-6797
/code/branches/chat2/src/orxonox/controllers/AIController.cc:6836-6910
/code/branches/console/src/orxonox/controllers/AIController.cc:5941-6104
/code/branches/core3/src/orxonox/controllers/AIController.cc:1572-1739
/code/branches/core4/src/orxonox/controllers/AIController.cc: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/src/orxonox/controllers/AIController.cc:5768-5928,6009
/code/branches/gamestate/src/orxonox/controllers/AIController.cc:6430-6572,6621-6661
/code/branches/gamestates2/src/orxonox/controllers/AIController.cc:6594-6745
/code/branches/gametypes/src/orxonox/controllers/AIController.cc:2826-3031
/code/branches/gcc43/src/orxonox/controllers/AIController.cc:1580
/code/branches/gui/src/orxonox/controllers/AIController.cc:1635-1723,2795-2894
/code/branches/hudelements/src/orxonox/controllers/AIController.cc:6584-6941
/code/branches/ingamemenu/src/orxonox/controllers/AIController.cc:6000-6023
/code/branches/input/src/orxonox/controllers/AIController.cc:1629-1636
/code/branches/libraries/src/orxonox/controllers/AIController.cc:5612-5692
/code/branches/libraries2/src/orxonox/controllers/AIController.cc:5703-5737
/code/branches/lod/src/orxonox/controllers/AIController.cc:6586-6911
/code/branches/lodfinal/src/orxonox/controllers/AIController.cc:2372-2411
/code/branches/map/src/orxonox/controllers/AIController.cc:2801-3086,3089
/code/branches/menu/src/orxonox/controllers/AIController.cc:5941-6146,6148
/code/branches/miniprojects/src/orxonox/controllers/AIController.cc:2754-2824
/code/branches/netp2/src/orxonox/controllers/AIController.cc:2835-2988
/code/branches/netp3/src/orxonox/controllers/AIController.cc:2988-3082
/code/branches/netp6/src/orxonox/controllers/AIController.cc:3214-3302
/code/branches/network/src/orxonox/controllers/AIController.cc:2356
/code/branches/network64/src/orxonox/controllers/AIController.cc:2210-2355
/code/branches/objecthierarchy/src/orxonox/controllers/AIController.cc:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2/src/orxonox/controllers/AIController.cc:2171-2479
/code/branches/overlay/src/orxonox/controllers/AIController.cc:2117-2385
/code/branches/particles/src/orxonox/controllers/AIController.cc:2829-3085
/code/branches/particles2/src/orxonox/controllers/AIController.cc:6050-6106,6109
/code/branches/pch/src/orxonox/controllers/AIController.cc:3113-3194
/code/branches/physics/src/orxonox/controllers/AIController.cc:1912-2055,2107-2439
/code/branches/physics_merge/src/orxonox/controllers/AIController.cc:2436-2457
/code/branches/pickup2/src/orxonox/controllers/AIController.cc:5942-6405
/code/branches/pickup3/src/orxonox/controllers/AIController.cc:6418-6523
/code/branches/pickup4/src/orxonox/controllers/AIController.cc:6594-6710
/code/branches/pickups/src/orxonox/controllers/AIController.cc:1926-2086,2127,2827-2915
/code/branches/pickups2/src/orxonox/controllers/AIController.cc:2107-2497,2915-3071
/code/branches/ppspickups1/src/orxonox/controllers/AIController.cc:6552-6708
/code/branches/ppspickups2/src/orxonox/controllers/AIController.cc:6527-6532,6554-6709
/code/branches/ppspickups3/src/orxonox/controllers/AIController.cc:6757-6997
/code/branches/presentation/src/orxonox/controllers/AIController.cc:2369-2652,2654-2660
/code/branches/presentation2/src/orxonox/controllers/AIController.cc:6106-6416
/code/branches/questsystem/src/orxonox/controllers/AIController.cc:1894-2088
/code/branches/questsystem2/src/orxonox/controllers/AIController.cc:2107-2259
/code/branches/questsystem5/src/orxonox/controllers/AIController.cc:2776-2905
/code/branches/resource/src/orxonox/controllers/AIController.cc:3327-3366
/code/branches/resource2/src/orxonox/controllers/AIController.cc:3372-5694
/code/branches/rocket/src/orxonox/controllers/AIController.cc:6779-6950
/code/branches/script_trigger/src/orxonox/controllers/AIController.cc:1295-1953,1955
/code/branches/skybox2/src/orxonox/controllers/AIController.cc:6559-6989
/code/branches/sound/src/orxonox/controllers/AIController.cc:2829-3010
/code/branches/sound3/src/orxonox/controllers/AIController.cc:5941-6102
/code/branches/steering/src/orxonox/controllers/AIController.cc:5949-6091
/code/branches/weapon/src/orxonox/controllers/AIController.cc:1925-2094
/code/branches/weapon2/src/orxonox/controllers/AIController.cc:2107-2488
/code/branches/weapons/src/orxonox/controllers/AIController.cc:2897-3051
/code/branches/weaponsystem/src/orxonox/controllers/AIController.cc:2742-2890
Modified: code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc 2010-05-27 21:50:24 UTC (rev 6998)
@@ -65,6 +65,8 @@
this->health_ = 0;
this->maxHealth_ = 0;
this->initialHealth_ = 0;
+ this->shieldHealth_ = 0;
+ this->shieldAbsorption_ = 0.5;
this->lastHitOriginator_ = 0;
@@ -79,7 +81,7 @@
}
else
this->weaponSystem_ = 0;
-
+
this->setCarrierName("Pawn");
this->setRadarObjectColour(ColourValue::Red);
@@ -106,6 +108,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);
@@ -117,11 +123,13 @@
void Pawn::registerVariables()
{
- registerVariable(this->bAlive_, VariableDirection::ToClient);
- registerVariable(this->health_, VariableDirection::ToClient);
- registerVariable(this->initialHealth_, VariableDirection::ToClient);
- registerVariable(this->bReload_, VariableDirection::ToServer);
- registerVariable(this->aimPosition_, Bidirectionality::ServerMaster, 0, true);
+ registerVariable(this->bAlive_, VariableDirection::ToClient);
+ registerVariable(this->health_, VariableDirection::ToClient);
+ registerVariable(this->initialHealth_, VariableDirection::ToClient);
+ registerVariable(this->shieldHealth_, VariableDirection::ToClient);
+ registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
+ registerVariable(this->bReload_, VariableDirection::ToServer);
+ registerVariable(this->aimPosition_, Bidirectionality::ServerMaster, 0, true);
}
void Pawn::tick(float dt)
@@ -163,7 +171,24 @@
{
if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
{
- this->setHealth(this->health_ - damage);
+ //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())
+ {
+ healthdamage += shielddamage-this->getShieldHealth();
+ this->setShieldHealth(0);
+ }
+
+ this->setHealth(this->health_ - healthdamage);
+
+ if (this->getShieldHealth() > 0)
+ {
+ this->setShieldHealth(this->shieldHealth_ - shielddamage);
+ }
+
this->lastHitOriginator_ = originator;
// play damage effect
Modified: code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h 2010-05-27 20:47:23 UTC (rev 6997)
+++ code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h 2010-05-27 21:50:24 UTC (rev 6998)
@@ -72,6 +72,16 @@
inline float getInitialHealth() const
{ return this->initialHealth_; }
+ inline void setShieldHealth(float shieldHealth)
+ { this->shieldHealth_ = shieldHealth; }
+ inline float getShieldHealth()
+ { return this->shieldHealth_; }
+
+ inline void setShieldAbsorption(float shieldAbsorption)
+ { this->shieldAbsorption_ = shieldAbsorption; }
+ inline float getShieldAbsorption()
+ { return this->shieldAbsorption_; }
+
inline ControllableEntity* getLastHitOriginator() const
{ return this->lastHitOriginator_; }
@@ -140,6 +150,8 @@
float health_;
float maxHealth_;
float initialHealth_;
+ float shieldHealth_;
+ float shieldAbsorption_; // Has to be between 0 and 1
Pawn* lastHitOriginator_;
More information about the Orxonox-commit
mailing list