[Orxonox-commit 4327] r8998 - in code/branches/presentation2011: . data/levels src/modules/gametypes src/modules/objects/triggers src/orxonox/gametypes src/orxonox/infos
jo at orxonox.net
jo at orxonox.net
Sun Dec 18 14:35:03 CET 2011
Author: jo
Date: 2011-12-18 14:35:02 +0100 (Sun, 18 Dec 2011)
New Revision: 8998
Added:
code/branches/presentation2011/data/levels/Spacerace2.oxw
code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.cc
code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.h
Modified:
code/branches/presentation2011/
code/branches/presentation2011/src/modules/gametypes/CMakeLists.txt
code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.cc
code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.h
code/branches/presentation2011/src/modules/gametypes/SpaceRace.cc
code/branches/presentation2011/src/modules/gametypes/SpaceRace.h
code/branches/presentation2011/src/modules/objects/triggers/DistanceMultiTrigger.h
code/branches/presentation2011/src/modules/objects/triggers/MultiTrigger.h
code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc
code/branches/presentation2011/src/orxonox/gametypes/Gametype.h
code/branches/presentation2011/src/orxonox/infos/GametypeInfo.cc
code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc
Log:
Merged SpaceraceTwo. Old racelevel does not work anymore.
Property changes on: code/branches/presentation2011
___________________________________________________________________
Modified: svn:mergeinfo
- /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/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/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/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/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/miniprojects:2754-2824
/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/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/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/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/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/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/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/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/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/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/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/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/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/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/miniprojects:2754-2824
/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/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/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/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/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/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/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/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/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
Copied: code/branches/presentation2011/data/levels/Spacerace2.oxw (from rev 8996, code/branches/spaceraceTwo/data/levels/Spacerace2.oxw)
===================================================================
--- code/branches/presentation2011/data/levels/Spacerace2.oxw (rev 0)
+++ code/branches/presentation2011/data/levels/Spacerace2.oxw 2011-12-18 13:35:02 UTC (rev 8998)
@@ -0,0 +1,206 @@
+<LevelInfo
+ name = "Spacerace2"
+ description = "Just a few tests"
+ tags = "test"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+
+ include("templates/spaceshipAssff.oxt")
+
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+?>
+
+<Level
+ name = "Spacerace2"
+ description = "Just a few tests"
+gametype = SpaceRace
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+
+ <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"/>
+
+
+ <SpaceRaceManager>
+<checkpoints>
+ <RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="1,2,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint2" position="0,2100,2300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint3" position="0,700,2700" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint4" position="0,-400,300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="true">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
+ </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+
+<SpaceShip position="0,0,200" lookat="0,0,0">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=0 team=10>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="0,-2000,1000" />
+ <Model mesh="cube.mesh" scale=0 position="0,2100,2300" />
+ <Model mesh="cube.mesh" scale=0 position="0,-400,300" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+
+ <!-- ------------------Planet----------------- -->
+ <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+ <StaticEntity position="0,0,0" collisionType=static>
+ <collisionShapes>
+ <SphereCollisionShape radius="399" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <!-- ---------------asteroid ellipse----------------- -->
+ <?lua
+ max = 20
+ for i = 0, max, 1
+ do
+ y = math.sin(i/max*6)*2000
+ z = math.cos(i/max*6)*2500
+ x = 0
+ ?>
+ <?lua
+ for k = 1, 15, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(x + math.random() * 500) ?>,<?lua print(y + math.random() * 500) ?>,<?lua print(z + math.random() * 1000) ?>"
+ collisionType = "dynamic"
+ linearDamping = "0.5"
+ angularDamping = "0.01"
+ collisiondamage = "0.01"
+ enablecollisiondamage = "true"
+ scale="<?lua print(j * 5) ?>" >
+ <attached>
+ <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+ <?lua if k == 5 then ?><attached><!-- ---------asteroid fog----- -->
+ <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+ </attached> <?lua end ?>
+ </Model>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+ </collisionShapes>
+ </MovableEntity>
+ <?lua
+ end
+ ?>
+ <?lua end ?>
+
+ <!-- ---------------ForceFields----------------- -->
+ <ForceField position="0,-700,2700" direction="0,1,0" diameter=500 velocity=2000 length=600 />
+ <MovableEntity position="0,-400,2700">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,2500,2000" direction="0,0,-1" diameter=250 velocity=2000 length=600 />
+ <MovableEntity position="0,2500,2000">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,1300,-800" direction="0,-1,-1" diameter=250 velocity=2000 length=800 />
+ <MovableEntity position="0,1300,-800">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,20,1 do ?>
+ <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,-1400,-700" direction="0,-1,1" diameter=250 velocity=2000 length=600 />
+ <MovableEntity position="0,-1400,-700">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+
+
+ </Scene>
+</Level>
+
Modified: code/branches/presentation2011/src/modules/gametypes/CMakeLists.txt
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/CMakeLists.txt 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/gametypes/CMakeLists.txt 2011-12-18 13:35:02 UTC (rev 8998)
@@ -1,6 +1,7 @@
SET_SOURCE_FILES(GAMETYPES_SRC_FILES
SpaceRace.cc
RaceCheckPoint.cc
+ SpaceRaceManager.cc
)
ORXONOX_ADD_LIBRARY(gametypes
Modified: code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.cc 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -33,28 +33,39 @@
#include "core/XMLPort.h"
#include "chat/ChatManager.h"
+#include <infos/PlayerInfo.h>
+#include <worldentities/ControllableEntity.h>
+
#include "SpaceRace.h"
namespace orxonox
{
CreateFactory(RaceCheckPoint);
+
+
- RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
+ RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
{
RegisterObject(RaceCheckPoint);
-
- this->bCheckpointIndex_ = 0;
- this->bIsLast_ = false;
+ this->setDistance(100);
+ this->setBeaconMode("off");
+ this->setBroadcast(false);
+ this->setSimultaneousTriggerers(100);
this->bTimeLimit_ = 0;
this->setRadarObjectColour(ColourValue::Blue);
this->setRadarObjectShape(RadarViewable::Triangle);
this->setRadarVisibility(false);
+ this->settingsChanged();
+ this->reached_=NULL;
+
}
+
- RaceCheckPoint::~RaceCheckPoint()
- {
- }
+ RaceCheckPoint::~RaceCheckPoint()
+ {
+
+ }
void RaceCheckPoint::tick(float dt)
{
@@ -62,43 +73,30 @@
SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
assert(gametype);
- if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
- this->setRadarVisibility(true);
- else
- this->setRadarVisibility(false);
}
void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(RaceCheckPoint, XMLPort, xmlelement, mode);
-
+ Vector3 v= Vector3(0,0,0);
XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
+ XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&).defaultValues(v);
}
- void RaceCheckPoint::triggered(bool bIsTriggered)
+ void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player)
{
- DistanceTrigger::triggered(bIsTriggered);
-
+ DistanceMultiTrigger::fire((bool)bIsTriggered,player);
+
SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
- if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
- {
- gametype->clock_.capture();
- float time = gametype->clock_.getSecondsPrecise();
- if (this->bTimeLimit_!=0 && time > this->bTimeLimit_)
- {
- gametype->timeIsUp();
- gametype->end();
- }
- else if (this->getLast())
- gametype->end();
- else
- {
- gametype->newCheckpointReached();
- this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
- }
- }
+ assert(gametype);
+ ControllableEntity* entity = (ControllableEntity*) player;
+
+ PlayerInfo* player2 = entity->getPlayer();
+
+ if(bIsTriggered)
+ this->reached_=player2;
}
void RaceCheckPoint::setTimelimit(float timeLimit)
@@ -107,6 +105,7 @@
if (this->bTimeLimit_ != 0)
{
SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ assert(gametype);
if (gametype)
{
const std::string& message = "You have " + multi_cast<std::string>(this->bTimeLimit_)
Modified: code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.h 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/gametypes/RaceCheckPoint.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -31,7 +31,9 @@
#include "gametypes/GametypesPrereqs.h"
-#include "objects/triggers/DistanceTrigger.h"
+
+
+#include "objects/triggers/DistanceMultiTrigger.h"
#include "interfaces/RadarViewable.h"
namespace orxonox
@@ -39,9 +41,9 @@
/**
@brief
The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
- !!! Don't forget to control the indexes of your check points and to set one last check point!!!
+ Don't forget to control the indexes of your check points and to set one last check point
*/
- class _GametypesExport RaceCheckPoint : public DistanceTrigger, public RadarViewable
+ class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
{
public:
RaceCheckPoint(BaseObject* creator);
@@ -49,29 +51,41 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
virtual void tick(float dt);
+ inline void setCheckpointIndex(int checkpointIndex)
+ { this->bCheckpointIndex_ = checkpointIndex; }
+ inline int getCheckpointIndex()
+ { return this->bCheckpointIndex_; }
- protected:
- virtual void triggered(bool bIsTriggered);
+ inline void setNextcheckpoint(const Vector3& checkpoints)
+ { this->nextcheckpoints_=checkpoints; }
+ inline void setNextcheckpoint(float x, float y, float z)
+ { this->setNextcheckpoint(Vector3(x, y, z)); }
+ inline const Vector3& getNextcheckpoint() const
+ { return this->nextcheckpoints_; }
inline void setLast(bool isLast)
{ this->bIsLast_ = isLast; }
inline bool getLast()
{ return this->bIsLast_; }
- inline void setCheckpointIndex(int checkpointIndex)
- { this->bCheckpointIndex_ = checkpointIndex; }
- inline int getCheckpointIndex()
- { return this->bCheckpointIndex_; }
+
+ bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+ float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+ PlayerInfo* reached_;
+
+ inline float getTimeLimit()
+ { return this->bTimeLimit_; }
+
+ protected:
+ virtual void fire(bool bIsTriggered,BaseObject* player);
virtual void setTimelimit(float timeLimit);
- inline float getTimeLimit()
- { return this->bTimeLimit_;}
+
inline const WorldEntity* getWorldEntity() const
{ return this; }
private:
- int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
- bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
- float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
-
+ int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0
+ Vector3 nextcheckpoints_; //the indexes of the next check points
+
};
}
-#endif /* _RaceCheckPoint_H__ */
\ No newline at end of file
+#endif /* _RaceCheckPoint_H__ */
Modified: code/branches/presentation2011/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/SpaceRace.cc 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/gametypes/SpaceRace.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -28,11 +28,16 @@
#include "SpaceRace.h"
+
+#include "items/Engine.h"
+
#include "core/CoreIncludes.h"
#include "chat/ChatManager.h"
#include "util/Convert.h"
#include "util/Math.h"
+#include "items/Engine.h"
+
namespace orxonox
{
CreateUnloadableFactory(SpaceRace);
@@ -40,10 +45,17 @@
SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator)
{
RegisterObject(SpaceRace);
- this->checkpointsReached_ = 0;
+
this->bTimeIsUp_ = false;
this->numberOfBots_ = 0;
+ this->cantMove_=false;
+
}
+
+
+ // void SpaceRace::SetConfigValues(){
+ //SUPER(Gametype,setConfigValues);
+ //this->Gametype::SetConfigValue(initialStartCountdown_, 3.0f);}
void SpaceRace::end()
{
@@ -55,8 +67,7 @@
int s = this->clock_.getSeconds();
int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
- + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
- + " before the time limit. You lose!";
+ + "You didn't reach the check point before the time limit. You lose!";
const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
ChatManager::message(message);
}
@@ -69,36 +80,112 @@
+ "." + multi_cast<std::string>(ms) + " seconds.";
const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
ChatManager::message(message);
-/*
+
float time = this->clock_.getSecondsPrecise();
this->scores_.insert(time);
std::set<float>::iterator it;
- for (it=this->scores_.begin(); it!=this->scores_.end(); it++)
- orxout(level::message) << multi_cast<std::string>(*it) << endl;
-*/
+
+
}
}
void SpaceRace::start()
{
- Gametype::start();
- std::string message("The match has started! Reach the check points as quickly as possible!");
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
- ChatManager::message(message);
+ this->spawnPlayersIfRequested();
+ Gametype::checkStart();
+ this->cantMove_=true;
+
+ for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
+ {
+ it->setActive(false);
+
+ }
+ this->addBots(this->numberOfBots_);
}
+
+ void SpaceRace::tick(float dt)
+ {
+ SUPER(SpaceRace,tick,dt);
+
+ if(!this->isStartCountdownRunning() && this->cantMove_)
+ {
+ for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
+ {
+ it->setActive(true);
+
+ }
+ this->cantMove_= false;
+
+ std::string message("The match has started! Reach the check points as quickly as possible!");
+ const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ ChatManager::message(message);
+ }
+
+ }
- void SpaceRace::newCheckpointReached()
+
+
+ void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
{
- this->checkpointsReached_++;
+ this->checkpointReached_[pl]=index;
this->clock_.capture();
int s = this->clock_.getSeconds();
int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
- const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
- + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
- + " seconds.";
+ const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
+ + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+ + " seconds.";// Message is too long for a normal screen.
const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
ChatManager::message(message);
}
+
+ void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl)
+ {
+ int index = p->getCheckpointIndex();
+ this->checkpointReached_[pl]=index;
+ this->clock_.capture();
+ int s = this->clock_.getSeconds();
+ int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+ const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
+ + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+ + " seconds.";
+ const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ ChatManager::message(message);
+ }
+
+
+ void SpaceRace::playerEntered(PlayerInfo* player)
+ {
+ Gametype::playerEntered(player);
+
+ this->checkpointReached_[player]=-1;
+ //this->playersAlive_++;
+ }
+
+ bool SpaceRace::playerLeft(PlayerInfo* player)
+ {
+ return Gametype::playerLeft(player);
+ // bool valid_player = true;
+ //if (valid_player)
+ // {
+ // this->playersAlive_--;
+ //}
+ // return valid_player;
+ }
+
+ bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
+ {
+ return false;
+ }
+
+ bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator)
+ {
+ return false;
+ }
+
+ bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
+ {
+ return false;
+ }
}
Modified: code/branches/presentation2011/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/SpaceRace.h 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/gametypes/SpaceRace.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -33,12 +33,13 @@
#include <set>
#include <string>
+# include <vector>
#include <util/Clock.h>
#include "gametypes/Gametype.h"
-#include "RaceCheckPoint.h"
+#include "SpaceRaceManager.h"
namespace orxonox
{
@@ -49,6 +50,7 @@
class _GametypesExport SpaceRace : public Gametype
{
friend class RaceCheckPoint;
+
public:
SpaceRace(BaseObject* creator);
@@ -57,22 +59,35 @@
virtual void start();
virtual void end();
- virtual void newCheckpointReached();
+ virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl);
+ virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl);
- inline void setCheckpointsReached(int n)
- { this->checkpointsReached_ = n;}
- inline int getCheckpointsReached()
- { return this->checkpointsReached_; }
+ inline void setCheckpointReached(int n, PlayerInfo* p)
+ { this->checkpointReached_[p] = n;}
+ inline int getCheckpointReached(PlayerInfo* p)
+ { return this->checkpointReached_[p]; }
+
inline void timeIsUp()
{ this->bTimeIsUp_ = true;}
+ void tick(float dt);
+ Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
+
+ bool allowPawnHit(Pawn* victim, Pawn* originator);
+
+ bool allowPawnDamage(Pawn* victim, Pawn* originator);
+
+ bool allowPawnDeath(Pawn* victim, Pawn* originator);
protected:
-
+ virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
+ virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
private:
- int checkpointsReached_; //The current number of check points reached by the player.
+ bool cantMove_;
+ std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player.
std::set<float> scores_; //The times of the players are saved in a set.
bool bTimeIsUp_; //True if one of the check points is reached too late.
- Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
+
+ int playersAlive_;
};
}
Copied: code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.cc (from rev 8996, code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc)
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.cc (rev 0)
+++ code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -0,0 +1,195 @@
+/*
+ * 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:
+ * Celine Eggenberger
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "SpaceRaceManager.h"
+#include "SpaceRace.h"
+#include "infos/PlayerInfo.h"
+
+#include "core/XMLPort.h"
+
+#include "core/CoreIncludes.h"
+
+#include "util/Convert.h"
+#include "util/Math.h"
+
+
+
+namespace orxonox
+{
+ CreateFactory(SpaceRaceManager);
+
+ SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator)
+ {
+ RegisterObject(SpaceRaceManager);
+
+ this->firstcheckpointvisible_=false;
+
+ }
+
+ SpaceRaceManager::~SpaceRaceManager()
+ {
+ if (this->isInitialized())
+ {
+ for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ this->checkpoints_[i]->destroy();
+ }
+ }
+
+ void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint)
+ {
+ this->checkpoints_.push_back(checkpoint);
+ }
+
+ RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const
+ {
+ if (index < this->checkpoints_.size())
+ return this->checkpoints_[index];
+ else
+ return 0;
+ }
+
+ int SpaceRaceManager::getIndex(RaceCheckPoint* r)
+ {
+ for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ if (this->checkpoints_[i]==r) {return i;}
+
+ return -1;
+ }
+
+ void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
+
+
+ XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint, xmlelement, mode);
+ }
+
+ void SpaceRaceManager::tick(float dt)
+ {
+ SUPER(SpaceRaceManager,tick,dt);
+
+ if(this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
+ {
+ this->checkpoints_[0]->setRadarVisibility(true);
+ this->firstcheckpointvisible_=true;
+ }
+
+ for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ {
+ if(this->checkpoints_[i]->reached_!=NULL)
+ this->checkpointReached(this->checkpoints_[i],this->checkpoints_[i]->reached_);
+ }
+ }
+
+
+ void SpaceRaceManager::checkpointReached(RaceCheckPoint* check, PlayerInfo* player)
+ {
+ SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ assert(gametype);
+
+ bool b =false;
+
+ int index=gametype->getCheckpointReached(player);
+ Vector3 v=Vector3 (-1,-1,-1);
+ if (index>-1)
+ {
+ RaceCheckPoint* tmp= this->getCheckpoint(index);
+ v= tmp->getNextcheckpoint();
+
+ if (this->getCheckpoint(v.x) == check)
+ {
+ b = true;
+ }
+
+ if (this->getCheckpoint(v.y) == check)
+ {
+ b = true;
+ }
+ if (this->getCheckpoint(v.z) == check)
+ {
+ b = true;
+ }
+ }
+ else
+ {
+ b = (this->getIndex(check) == 0);
+ }
+
+ if (gametype && b)
+ {
+ gametype->clock_.capture();
+ float time = gametype->clock_.getSecondsPrecise();
+ if (check->getTimeLimit()!=0 && time > check->getTimeLimit())
+ {
+ gametype->timeIsUp();
+ gametype->end();
+ }
+ else if (check->getLast())
+ gametype->end();
+ else
+ {
+ if (index > -1)this->setRadVis(player,false);
+ else this->getCheckpoint(0)->setRadarVisibility(false);
+ gametype->newCheckpointReached(check,player);
+
+
+ this->setRadVis(player, true);
+ }
+ }
+ check->reached_=NULL;
+ }
+
+ void SpaceRaceManager::setRadVis(PlayerInfo* player, bool b)
+ {
+ SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ assert(gametype);
+ int index = gametype->getCheckpointReached(player);
+ Vector3 v = Vector3(-1,-1,-1);
+ RaceCheckPoint* tmp = this->getCheckpoint(index);
+ v = tmp->getNextcheckpoint();
+
+ if(v.x > -1)
+ {
+ this->getCheckpoint(v.x)->setRadarVisibility(b);
+ this->getCheckpoint(v.x)->settingsChanged();
+ }
+ if(v.y > -1)
+ {
+ this->getCheckpoint(v.y)->setRadarVisibility(b);
+ this->getCheckpoint(v.y)->settingsChanged();
+ }
+ if(v.z > -1)
+ {
+ this->getCheckpoint(v.z)->setRadarVisibility(b);
+ this->getCheckpoint(v.z)->settingsChanged();
+ }
+
+
+ }
+
+}
Copied: code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.h (from rev 8996, code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h)
===================================================================
--- code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.h (rev 0)
+++ code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -0,0 +1,79 @@
+/*
+ * 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:
+ * Mauro Salomon
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _SpaceRaceManager_H__
+#define _SpaceRaceManager_H__
+
+#include "gametypes/GametypesPrereqs.h"
+
+#include <set>
+#include <string>
+#include <vector>
+
+#include <util/Clock.h>
+
+#include "gametypes/Gametype.h"
+#include "tools/interfaces/Tickable.h"
+#include "RaceCheckPoint.h"
+
+
+
+namespace orxonox
+{
+ /**
+ @brief
+ The SpaceRaceManager class controls a space race level, where the player has to reach check points in a given order.
+ */
+ class _GametypesExport SpaceRaceManager : public BaseObject, public Tickable
+ {
+ friend class RaceCheckPoint;
+
+ public:
+ SpaceRaceManager(BaseObject* creator);
+ virtual ~SpaceRaceManager() ;
+
+ void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ int getIndex(RaceCheckPoint* r);
+ void addCheckpoint(RaceCheckPoint* checkpoint);
+ RaceCheckPoint* getCheckpoint(unsigned int index) const;
+
+ void checkpointReached(RaceCheckPoint* check, PlayerInfo* player);
+
+ void tick(float dt);
+
+ protected:
+ void setRadVis(PlayerInfo* player, bool b);//sets RadarVisibility of the checkpoints the player can reach.
+
+ private:
+ std::vector<RaceCheckPoint*> checkpoints_;
+ bool firstcheckpointvisible_;//true if the first check point is visible.
+
+ };
+}
+
+#endif /* _SpaceRaceManager_H__ */
Modified: code/branches/presentation2011/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/branches/presentation2011/src/modules/objects/triggers/DistanceMultiTrigger.h 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/objects/triggers/DistanceMultiTrigger.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -90,7 +90,7 @@
@ingroup MultiTrigger
*/
- class _ObjectsExport DistanceMultiTrigger : public MultiTrigger
+ class _ObjectsExport DistanceMultiTrigger : public MultiTrigger
{
public:
Modified: code/branches/presentation2011/src/modules/objects/triggers/MultiTrigger.h
===================================================================
--- code/branches/presentation2011/src/modules/objects/triggers/MultiTrigger.h 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/modules/objects/triggers/MultiTrigger.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -156,7 +156,7 @@
bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whether the MultiTrigger is triggered concerning it's children.
bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
- void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.
+ virtual void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.
void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target.
void removeTarget(const std::string& target); //!< Remove some target from the MultiTrigger.
Modified: code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -84,7 +84,6 @@
this->dedicatedAddBots_ = createConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) );
this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );
/* HACK HACK HACK */
- //this->numberOfPlayers_ = 0;
}
Gametype::~Gametype()
@@ -123,7 +122,7 @@
if (this->gtinfo_->isStartCountdownRunning() && !this->gtinfo_->hasStarted())
this->gtinfo_->countdownStartCountdown(dt);
-
+
if (!this->gtinfo_->hasStarted())
{
for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
@@ -131,8 +130,9 @@
// Inform the GametypeInfo that the player is ready to spawn.
if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
this->gtinfo_->playerReadyToSpawn(it->first);
+
+
}
-
this->checkStart();
}
else if (!this->gtinfo_->hasEnded())
@@ -143,11 +143,14 @@
void Gametype::start()
{
+
this->addBots(this->numberOfBots_);
this->gtinfo_->start();
this->spawnPlayersIfRequested();
+
+
}
void Gametype::end()
@@ -376,7 +379,7 @@
if (this->gtinfo_->getStartCountdown() <= 0.0f)
{
this->gtinfo_->stopStartCountdown();
- this->gtinfo_->setStartCountdown(0.0f);;
+ this->gtinfo_->setStartCountdown(0.0f);
this->start();
}
}
@@ -397,6 +400,7 @@
if (it->first->isHumanPlayer())
hashumanplayers = true;
}
+
if (allplayersready && hashumanplayers)
{
// If in developer's mode, there is no start countdown.
@@ -408,6 +412,7 @@
}
}
}
+
}
}
Modified: code/branches/presentation2011/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.h 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.h 2011-12-18 13:35:02 UTC (rev 8998)
@@ -154,6 +154,8 @@
inline unsigned int getNumberOfPlayers()
{ return this->gtinfo_->getNumberOfPlayers(); }
+
+
protected:
virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
Modified: code/branches/presentation2011/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/infos/GametypeInfo.cc 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/orxonox/infos/GametypeInfo.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -70,9 +70,9 @@
this->bStarted_ = false;
this->bEnded_ = false;
- this->startCountdown_ = 0.0f;
+ this->startCountdown_ = 10.0f;
this->bStartCountdownRunning_ = false;
- this->counter_ = 0;
+ this->counter_ = 10;
this->spawned_ = false;
this->readyToSpawn_ = false;
@@ -163,10 +163,12 @@
void GametypeInfo::start(void)
{
if(this->bStarted_)
- return;
+ { return;}
this->bStarted_ = true;
this->changedStarted();
+
+
}
/**
Modified: code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc 2011-12-18 12:58:58 UTC (rev 8997)
+++ code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc 2011-12-18 13:35:02 UTC (rev 8998)
@@ -57,6 +57,7 @@
this->updateGametypeInfo();
this->registerVariables();
+
}
PlayerInfo::~PlayerInfo()
More information about the Orxonox-commit
mailing list