[Orxonox-commit 4677] r9348 - in code/trunk: . cmake/tools data/gui/layouts data/gui/scripts data/levels data/levels/includes data/levels/old data/levels/templates data/overlays data/particle doc/api/groups src src/external/enet src/external/tolua src/libraries/core src/libraries/core/command src/libraries/util/output src/modules src/modules/docking src/modules/gametypes src/modules/objects/triggers src/modules/overlays src/modules/overlays/hud src/modules/pickup src/modules/pickup/items src/modules/pong src/modules/tetris src/modules/weapons src/orxonox src/orxonox/controllers src/orxonox/gamestates src/orxonox/gametypes src/orxonox/infos src/orxonox/interfaces src/orxonox/worldentities src/orxonox/worldentities/pawns
landauf at orxonox.net
landauf at orxonox.net
Thu Aug 30 23:08:18 CEST 2012
Author: landauf
Date: 2012-08-30 23:08:17 +0200 (Thu, 30 Aug 2012)
New Revision: 9348
Added:
code/trunk/data/gui/layouts/ShipSelectionMenu.layout
code/trunk/data/gui/scripts/ShipSelectionMenu.lua
code/trunk/data/levels/SurfaceRacePresentation.oxw
code/trunk/data/levels/includes/towerWeaponSettings.oxi
code/trunk/data/levels/surfaceRace.oxw
code/trunk/data/levels/templates/spaceshipRace.oxt
code/trunk/data/levels/templates/tower.oxt
code/trunk/data/levels/towerDefense.oxw
code/trunk/data/overlays/tetrisHUD.oxo
code/trunk/data/overlays/towerdefenseHUD.oxo
code/trunk/src/modules/pickup/items/DamageBoostPickup.cc
code/trunk/src/modules/pickup/items/DamageBoostPickup.h
code/trunk/src/modules/tetris/TetrisBrick.cc
code/trunk/src/modules/tetris/TetrisBrick.h
code/trunk/src/modules/tetris/TetrisScore.cc
code/trunk/src/modules/tetris/TetrisScore.h
code/trunk/src/modules/towerdefense/
Removed:
code/trunk/data/overlays/underAttackHUD.oxo
code/trunk/data/particle/smoke1.particle
code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc
code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h
code/trunk/src/modules/pickup/DroppedPickup.cc
code/trunk/src/modules/pickup/DroppedPickup.h
code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
code/trunk/src/orxonox/pickup/
Modified:
code/trunk/
code/trunk/cmake/tools/BuildUnits.cmake
code/trunk/data/gui/layouts/GUILayout.xsd
code/trunk/data/gui/layouts/InGamePickupHUD.layout
code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout
code/trunk/data/gui/scripts/AudioMenu.lua
code/trunk/data/gui/scripts/PickupInventory.lua
code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua
code/trunk/data/gui/scripts/SingleplayerMenu.lua
code/trunk/data/levels/FPSTest.oxw
code/trunk/data/levels/Spacerace2.oxw
code/trunk/data/levels/asteroidField.oxw
code/trunk/data/levels/asteroids.oxw
code/trunk/data/levels/docking.oxw
code/trunk/data/levels/dynamicMatch.oxw
code/trunk/data/levels/events.oxw
code/trunk/data/levels/fightInOurBack.oxw
code/trunk/data/levels/includes/CuboidSpaceStation.lua
code/trunk/data/levels/includes/asteroidField.lua
code/trunk/data/levels/includes/pickups.oxi
code/trunk/data/levels/includes/weaponSettingsFPS.oxi
code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
code/trunk/data/levels/lastManStanding.oxw
code/trunk/data/levels/lastTeamStanding.oxw
code/trunk/data/levels/lastTeamStandingII.oxw
code/trunk/data/levels/missionOne.oxw
code/trunk/data/levels/notifications.oxw
code/trunk/data/levels/old/CuboidSpaceStation.oxw
code/trunk/data/levels/old/presentationPhysics.oxw
code/trunk/data/levels/old/princessAeryn.oxw
code/trunk/data/levels/pickups.oxw
code/trunk/data/levels/pirateAttack.oxw
code/trunk/data/levels/planets.oxw
code/trunk/data/levels/pong.oxw
code/trunk/data/levels/portals.oxw
code/trunk/data/levels/presentation09.oxw
code/trunk/data/levels/presentation09b.oxw
code/trunk/data/levels/presentationDM.oxw
code/trunk/data/levels/presentationFS10.oxw
code/trunk/data/levels/presentationFS102.oxw
code/trunk/data/levels/presentationFS10Ed.oxw
code/trunk/data/levels/presentationFS11.oxw
code/trunk/data/levels/presentationHS09.oxw
code/trunk/data/levels/presentationHS11.oxw
code/trunk/data/levels/princessAeryn.oxw
code/trunk/data/levels/screenshot.oxw
code/trunk/data/levels/teamBaseMatch.oxw
code/trunk/data/levels/teamDeathMatch.oxw
code/trunk/data/levels/templates/FPS.oxt
code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt
code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
code/trunk/data/levels/testStars.oxw
code/trunk/data/levels/testSwallow.oxw
code/trunk/data/levels/tetris.oxw
code/trunk/data/levels/theTimeMachine.oxw
code/trunk/data/levels/tutorial.oxw
code/trunk/data/levels/underAttack.oxw
code/trunk/data/levels/waypoints.oxw
code/trunk/data/overlays/dynamicMatchHUD.oxo
code/trunk/data/overlays/lastManStandingHUD.oxo
code/trunk/data/overlays/lastTeamStandingHUD.oxo
code/trunk/doc/api/groups/Portals.dox
code/trunk/doc/api/groups/Weapons.dox
code/trunk/src/BuildUnitsConfigGCC.cmake
code/trunk/src/BuildUnitsConfigMSVC.cmake
code/trunk/src/external/enet/VERSION
code/trunk/src/external/tolua/README_ORXONOX
code/trunk/src/libraries/core/Super.h
code/trunk/src/libraries/core/Template.cc
code/trunk/src/libraries/core/XMLPort.h
code/trunk/src/libraries/core/command/ConsoleCommand.cc
code/trunk/src/libraries/core/command/ConsoleCommand.h
code/trunk/src/libraries/util/output/ConsoleWriter.cc
code/trunk/src/modules/CMakeLists.txt
code/trunk/src/modules/docking/DockingController.cc
code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
code/trunk/src/modules/gametypes/OldRaceCheckPoint.h
code/trunk/src/modules/gametypes/OldSpaceRace.cc
code/trunk/src/modules/gametypes/OldSpaceRace.h
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
code/trunk/src/modules/gametypes/SpaceRace.cc
code/trunk/src/modules/gametypes/SpaceRaceManager.cc
code/trunk/src/modules/gametypes/SpaceRaceManager.h
code/trunk/src/modules/objects/triggers/CheckPoint.cc
code/trunk/src/modules/overlays/OverlaysPrereqs.h
code/trunk/src/modules/overlays/hud/CMakeLists.txt
code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
code/trunk/src/modules/overlays/hud/HUDBoostBar.h
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
code/trunk/src/modules/overlays/hud/HUDNavigation.h
code/trunk/src/modules/overlays/hud/HUDRadar.cc
code/trunk/src/modules/pickup/CMakeLists.txt
code/trunk/src/modules/pickup/CollectiblePickup.cc
code/trunk/src/modules/pickup/CollectiblePickup.h
code/trunk/src/modules/pickup/Pickup.cc
code/trunk/src/modules/pickup/Pickup.h
code/trunk/src/modules/pickup/PickupCollection.cc
code/trunk/src/modules/pickup/PickupCollection.h
code/trunk/src/modules/pickup/PickupManager.cc
code/trunk/src/modules/pickup/PickupManager.h
code/trunk/src/modules/pickup/PickupPrereqs.h
code/trunk/src/modules/pickup/PickupRepresentation.cc
code/trunk/src/modules/pickup/PickupRepresentation.h
code/trunk/src/modules/pickup/PickupSpawner.cc
code/trunk/src/modules/pickup/PickupSpawner.h
code/trunk/src/modules/pickup/items/CMakeLists.txt
code/trunk/src/modules/pickup/items/DronePickup.cc
code/trunk/src/modules/pickup/items/DronePickup.h
code/trunk/src/modules/pickup/items/HealthPickup.cc
code/trunk/src/modules/pickup/items/HealthPickup.h
code/trunk/src/modules/pickup/items/InvisiblePickup.cc
code/trunk/src/modules/pickup/items/InvisiblePickup.h
code/trunk/src/modules/pickup/items/MetaPickup.cc
code/trunk/src/modules/pickup/items/MetaPickup.h
code/trunk/src/modules/pickup/items/ShieldPickup.cc
code/trunk/src/modules/pickup/items/ShieldPickup.h
code/trunk/src/modules/pickup/items/ShrinkPickup.cc
code/trunk/src/modules/pickup/items/ShrinkPickup.h
code/trunk/src/modules/pickup/items/SpeedPickup.cc
code/trunk/src/modules/pickup/items/SpeedPickup.h
code/trunk/src/modules/pong/Pong.cc
code/trunk/src/modules/pong/Pong.h
code/trunk/src/modules/tetris/CMakeLists.txt
code/trunk/src/modules/tetris/Tetris.cc
code/trunk/src/modules/tetris/Tetris.h
code/trunk/src/modules/tetris/TetrisCenterpoint.cc
code/trunk/src/modules/tetris/TetrisCenterpoint.h
code/trunk/src/modules/tetris/TetrisPrereqs.h
code/trunk/src/modules/tetris/TetrisStone.cc
code/trunk/src/modules/tetris/TetrisStone.h
code/trunk/src/modules/weapons/RocketController.cc
code/trunk/src/orxonox/CMakeLists.txt
code/trunk/src/orxonox/CameraManager.cc
code/trunk/src/orxonox/LevelInfo.cc
code/trunk/src/orxonox/LevelInfo.h
code/trunk/src/orxonox/OrxonoxPrereqs.h
code/trunk/src/orxonox/Scene.cc
code/trunk/src/orxonox/controllers/FormationController.cc
code/trunk/src/orxonox/controllers/FormationController.h
code/trunk/src/orxonox/controllers/NewHumanController.cc
code/trunk/src/orxonox/gamestates/GSRoot.cc
code/trunk/src/orxonox/gametypes/Deathmatch.cc
code/trunk/src/orxonox/gametypes/Deathmatch.h
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
code/trunk/src/orxonox/gametypes/Gametype.cc
code/trunk/src/orxonox/gametypes/Gametype.h
code/trunk/src/orxonox/gametypes/LastManStanding.cc
code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
code/trunk/src/orxonox/gametypes/Mission.cc
code/trunk/src/orxonox/gametypes/Mission.h
code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
code/trunk/src/orxonox/gametypes/TeamBaseMatch.h
code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc
code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
code/trunk/src/orxonox/gametypes/TeamGametype.cc
code/trunk/src/orxonox/gametypes/TeamGametype.h
code/trunk/src/orxonox/gametypes/UnderAttack.cc
code/trunk/src/orxonox/infos/GametypeInfo.cc
code/trunk/src/orxonox/infos/GametypeInfo.h
code/trunk/src/orxonox/infos/PlayerInfo.cc
code/trunk/src/orxonox/interfaces/Pickupable.cc
code/trunk/src/orxonox/interfaces/Pickupable.h
code/trunk/src/orxonox/interfaces/RadarViewable.h
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
code/trunk/src/orxonox/worldentities/ControllableEntity.h
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
merged branch presentation2012merge back to trunk
Property changes on: code/trunk
___________________________________________________________________
Modified: svn:ignore
- build
codeblocks
vs
dependencies
+ .project
build
codeblocks
dependencies
vs
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/presentation2011:8974-9015
/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
+ /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/newlevel2012:9033-9244
/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/pCuts:9023-9284
/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/pickup2012:9029-9189
/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/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/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/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/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/surfaceRace:9028-9199
/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
Modified: code/trunk/cmake/tools/BuildUnits.cmake
===================================================================
--- code/trunk/cmake/tools/BuildUnits.cmake 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/cmake/tools/BuildUnits.cmake 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,146 +1,146 @@
- #
- # ORXONOX - the hottest 3D action shooter ever to exist
- # > www.orxonox.net <
- #
- # 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:
- # Reto Grieder
- #
-
-FUNCTION(GENERATE_BUILD_UNITS _target_name _all_files_var)
- SET(_source_files)
- SET(_total_file_count 0)
-
- # Count the number of actual C++ source files
- FOREACH(_file ${${_all_files_var}})
- # Only look at C++ source files
- IF(_file MATCHES "\\.(cpp|cc|cxx)$")
- # Some files might be marked as not to compile at all
- GET_SOURCE_FILE_PROPERTY(_skip1 ${_file} HEADER_FILE_ONLY)
- GET_SOURCE_FILE_PROPERTY(_skip2 ${_file} EXCLUDE_FROM_BUILD_UNITS)
- IF(NOT _skip1 AND NOT _skip2)
- GET_SOURCE_FILE_PROPERTY(_size ${_file} BUILD_UNIT_SIZE)
- IF(NOT _size)
- SET(_size 1)
- ENDIF()
- # Append file AND size to the list (like storing an std::pair)
- LIST(APPEND _source_files ${_file} ${_size})
- MATH(EXPR _total_file_count "${_total_file_count} + ${_size}")
- # Don't compile
- SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
- ENDIF()
- ENDIF()
- ENDFOREACH(_file)
-
- # Get number of build units we have to make. The default is NR_OF_BUILD_UNITS
- # However we can specify different values in a config file
- SET(_config ${BUILD_UNITS_CONFIG_${NR_OF_BUILD_UNITS}_THREADS})
- SET(_nr_of_units)
- IF(_config)
- LIST(FIND _config ${_target_name} _index)
- IF(NOT _index EQUAL -1)
- # Nr of build units is the next element in the list (we assume it exists)
- MATH(EXPR _index "${_index} + 1")
- LIST(GET _config ${_index} _nr_of_units)
- ENDIF()
- ENDIF()
- IF(NOT _nr_of_units)
- # Use default as specified (e.g. "full4" --> 4) or 1 for externals
- IF(_arg_ORXONOX_EXTERNAL)
- SET(_nr_of_units 1)
- ELSE()
- SET(_nr_of_units ${NR_OF_BUILD_UNITS})
- ENDIF()
- ENDIF()
-
- # Disable precompiled header files for targets with two or less build units
- IF(_nr_of_units LESS 3)
- SET(PCH_DISABLE_${_target_name} TRUE PARENT_SCOPE)
- ENDIF()
-
- SET(_remaining_files ${_total_file_count})
- SET(_remaining_units ${_nr_of_units})
- SET(_unit_nr 1)
- # Loop counts back from ${_nr_of_units} to 1
- FOREACH(_remaining_units RANGE ${_nr_of_units} 1 -1)
- # Use integer division to get the current build unit size
- MATH(EXPR _aimed_size "${_remaining_files} / ${_remaining_units}")
-
- SET(_current_size 0)
- SET(_current_unit)
-
- SET(_file_index 0)
- LIST(LENGTH _source_files _list_size)
- WHILE(${_file_index} LESS ${_list_size} AND NOT ${_current_size} EQUAL ${_aimed_size})
- # _source_files stores pairs of values (file followed by its size)
- MATH(EXPR _size_index "${_file_index} + 1")
- LIST(GET _source_files ${_file_index} _file)
- LIST(GET _source_files ${_size_index} _size)
-
- MATH(EXPR _new_size "${_current_size} + ${_size}")
- IF(${_new_size} GREATER ${_aimed_size})
- # Try next file in list (jump 2 because pairs are stored)
- MATH(EXPR _file_index "${_file_index} + 2")
- ELSE()
- SET(_current_size ${_new_size})
- LIST(APPEND _current_unit ${_file})
- # Remove from _source_files list
- LIST(REMOVE_AT _source_files ${_file_index} ${_size_index})
- MATH(EXPR _list_size "${_list_size} - 2")
- ENDIF()
- ENDWHILE()
-
- # Finalise
- LIST(LENGTH _current_unit _nr_of_included_files)
- IF(_nr_of_included_files EQUAL 1)
- # If unit consists of one file, we can compile it the old fashioned way
- SET_SOURCE_FILES_PROPERTIES(${_current_unit} PROPERTIES HEADER_FILE_ONLY FALSE)
- ELSEIF(_nr_of_included_files GREATER 1)
- # Assemble unit by writing some #include statements
- SET(_include_string)
- FOREACH(_file ${_current_unit})
- SET(_include_string "${_include_string}#include \"${_file}\"\n")
- ENDFOREACH(_file)
-
- # Generate the filename
- IF(NOT _nr_of_units EQUAL 1)
- SET(_suffix ${_unit_nr})
- ENDIF()
- SET(_unit_file ${CMAKE_CURRENT_BINARY_DIR}/${_target_name}BuildUnit${_suffix}.cc)
- # Only write if content has changed (avoids recompile)
- IF(EXISTS ${_unit_file})
- FILE(READ ${_unit_file} _file_include_string)
- ENDIF()
- IF(NOT _include_string STREQUAL "${_file_include_string}")
- FILE(WRITE ${_unit_file} "${_include_string}")
- ENDIF()
-
- LIST(APPEND _build_units ${_unit_file})
-
- # Increase file name counter
- MATH(EXPR _unit_nr "${_unit_nr} + 1")
- ENDIF()
-
- # Compute remaining files
- MATH(EXPR _remaining_files "${_remaining_files} - ${_current_size}")
- ENDFOREACH(_remaining_units)
-
- # Add units to list of source files (function, not macro --> parent scope)
- # Do this ONCE because parent scope changes will NOT be visible here
- SET(${_all_files_var} ${${_all_files_var}} ${_build_units} PARENT_SCOPE)
-
-ENDFUNCTION(GENERATE_BUILD_UNITS)
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # 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:
+ # Reto Grieder
+ #
+
+FUNCTION(GENERATE_BUILD_UNITS _target_name _all_files_var)
+ SET(_source_files)
+ SET(_total_file_count 0)
+
+ # Count the number of actual C++ source files
+ FOREACH(_file ${${_all_files_var}})
+ # Only look at C++ source files
+ IF(_file MATCHES "\\.(cpp|cc|cxx)$")
+ # Some files might be marked as not to compile at all
+ GET_SOURCE_FILE_PROPERTY(_skip1 ${_file} HEADER_FILE_ONLY)
+ GET_SOURCE_FILE_PROPERTY(_skip2 ${_file} EXCLUDE_FROM_BUILD_UNITS)
+ IF(NOT _skip1 AND NOT _skip2)
+ GET_SOURCE_FILE_PROPERTY(_size ${_file} BUILD_UNIT_SIZE)
+ IF(NOT _size)
+ SET(_size 1)
+ ENDIF()
+ # Append file AND size to the list (like storing an std::pair)
+ LIST(APPEND _source_files ${_file} ${_size})
+ MATH(EXPR _total_file_count "${_total_file_count} + ${_size}")
+ # Don't compile
+ SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
+ ENDIF()
+ ENDIF()
+ ENDFOREACH(_file)
+
+ # Get number of build units we have to make. The default is NR_OF_BUILD_UNITS
+ # However we can specify different values in a config file
+ SET(_config ${BUILD_UNITS_CONFIG_${NR_OF_BUILD_UNITS}_THREADS})
+ SET(_nr_of_units)
+ IF(_config)
+ LIST(FIND _config ${_target_name} _index)
+ IF(NOT _index EQUAL -1)
+ # Nr of build units is the next element in the list (we assume it exists)
+ MATH(EXPR _index "${_index} + 1")
+ LIST(GET _config ${_index} _nr_of_units)
+ ENDIF()
+ ENDIF()
+ IF(NOT _nr_of_units)
+ # Use default as specified (e.g. "full4" --> 4) or 1 for externals
+ IF(_arg_ORXONOX_EXTERNAL)
+ SET(_nr_of_units 1)
+ ELSE()
+ SET(_nr_of_units ${NR_OF_BUILD_UNITS})
+ ENDIF()
+ ENDIF()
+
+ # Disable precompiled header files for targets with two or less build units
+ IF(_nr_of_units LESS 3)
+ SET(PCH_DISABLE_${_target_name} TRUE PARENT_SCOPE)
+ ENDIF()
+
+ SET(_remaining_files ${_total_file_count})
+ SET(_remaining_units ${_nr_of_units})
+ SET(_unit_nr 1)
+ # Loop counts back from ${_nr_of_units} to 1
+ FOREACH(_remaining_units RANGE ${_nr_of_units} 1 -1)
+ # Use integer division to get the current build unit size
+ MATH(EXPR _aimed_size "${_remaining_files} / ${_remaining_units}")
+
+ SET(_current_size 0)
+ SET(_current_unit)
+
+ SET(_file_index 0)
+ LIST(LENGTH _source_files _list_size)
+ WHILE(${_file_index} LESS ${_list_size} AND NOT ${_current_size} EQUAL ${_aimed_size})
+ # _source_files stores pairs of values (file followed by its size)
+ MATH(EXPR _size_index "${_file_index} + 1")
+ LIST(GET _source_files ${_file_index} _file)
+ LIST(GET _source_files ${_size_index} _size)
+
+ MATH(EXPR _new_size "${_current_size} + ${_size}")
+ IF(${_new_size} GREATER ${_aimed_size})
+ # Try next file in list (jump 2 because pairs are stored)
+ MATH(EXPR _file_index "${_file_index} + 2")
+ ELSE()
+ SET(_current_size ${_new_size})
+ LIST(APPEND _current_unit ${_file})
+ # Remove from _source_files list
+ LIST(REMOVE_AT _source_files ${_file_index} ${_size_index})
+ MATH(EXPR _list_size "${_list_size} - 2")
+ ENDIF()
+ ENDWHILE()
+
+ # Finalise
+ LIST(LENGTH _current_unit _nr_of_included_files)
+ IF(_nr_of_included_files EQUAL 1)
+ # If unit consists of one file, we can compile it the old fashioned way
+ SET_SOURCE_FILES_PROPERTIES(${_current_unit} PROPERTIES HEADER_FILE_ONLY FALSE)
+ ELSEIF(_nr_of_included_files GREATER 1)
+ # Assemble unit by writing some #include statements
+ SET(_include_string)
+ FOREACH(_file ${_current_unit})
+ SET(_include_string "${_include_string}#include \"${_file}\"\n")
+ ENDFOREACH(_file)
+
+ # Generate the filename
+ IF(NOT _nr_of_units EQUAL 1)
+ SET(_suffix ${_unit_nr})
+ ENDIF()
+ SET(_unit_file ${CMAKE_CURRENT_BINARY_DIR}/${_target_name}BuildUnit${_suffix}.cc)
+ # Only write if content has changed (avoids recompile)
+ IF(EXISTS ${_unit_file})
+ FILE(READ ${_unit_file} _file_include_string)
+ ENDIF()
+ IF(NOT _include_string STREQUAL "${_file_include_string}")
+ FILE(WRITE ${_unit_file} "${_include_string}")
+ ENDIF()
+
+ LIST(APPEND _build_units ${_unit_file})
+
+ # Increase file name counter
+ MATH(EXPR _unit_nr "${_unit_nr} + 1")
+ ENDIF()
+
+ # Compute remaining files
+ MATH(EXPR _remaining_files "${_remaining_files} - ${_current_size}")
+ ENDFOREACH(_remaining_units)
+
+ # Add units to list of source files (function, not macro --> parent scope)
+ # Do this ONCE because parent scope changes will NOT be visible here
+ SET(${_all_files_var} ${${_all_files_var}} ${_build_units} PARENT_SCOPE)
+
+ENDFUNCTION(GENERATE_BUILD_UNITS)
Property changes on: code/trunk/cmake/tools/BuildUnits.cmake
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/gui/layouts/GUILayout.xsd
===================================================================
--- code/trunk/data/gui/layouts/GUILayout.xsd 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/gui/layouts/GUILayout.xsd 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,63 +1,63 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xsd:element name="GUILayout" type="GUILayoutType"/>
-
- <xsd:complexType name="GUILayoutType">
- <xsd:sequence>
- <xsd:element name="Window" type="WindowType" />
- </xsd:sequence>
- <xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
- </xsd:complexType>
-
- <xsd:complexType name="WindowType">
- <xsd:sequence>
- <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="Window" type="WindowType" />
- <xsd:element name="AutoWindow" type="AutoWindowType" />
- </xsd:choice>
- <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="Type" type="xsd:string" use="required"/>
- <xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
- </xsd:complexType>
+ <xsd:element name="GUILayout" type="GUILayoutType"/>
- <xsd:complexType name="AutoWindowType">
- <xsd:sequence>
- <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="Window" type="WindowType" />
- <xsd:element name="AutoWindow" type="AutoWindowType" />
- </xsd:choice>
- <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
- </xsd:complexType>
+ <xsd:complexType name="GUILayoutType">
+ <xsd:sequence>
+ <xsd:element name="Window" type="WindowType" />
+ </xsd:sequence>
+ <xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+ </xsd:complexType>
- <xsd:complexType name="PropertyType">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="Name" type="xsd:string" use="required"/>
- <xsd:attribute name="Value" type="xsd:string" use="optional"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
+ <xsd:complexType name="WindowType">
+ <xsd:sequence>
+ <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="Window" type="WindowType" />
+ <xsd:element name="AutoWindow" type="AutoWindowType" />
+ </xsd:choice>
+ <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="Type" type="xsd:string" use="required"/>
+ <xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
+ </xsd:complexType>
- <xsd:complexType name="LayoutImportType">
- <xsd:attribute name="Filename" type="xsd:string" use="required"/>
- <xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
- <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" />
- </xsd:complexType>
+ <xsd:complexType name="AutoWindowType">
+ <xsd:sequence>
+ <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="Window" type="WindowType" />
+ <xsd:element name="AutoWindow" type="AutoWindowType" />
+ </xsd:choice>
+ <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
+ </xsd:complexType>
- <xsd:complexType name="EventType">
- <xsd:attribute name="Name" type="xsd:string" use="required"/>
- <xsd:attribute name="Function" type="xsd:string" use="required"/>
- </xsd:complexType>
+ <xsd:complexType name="PropertyType">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="Name" type="xsd:string" use="required"/>
+ <xsd:attribute name="Value" type="xsd:string" use="optional"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="LayoutImportType">
+ <xsd:attribute name="Filename" type="xsd:string" use="required"/>
+ <xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+ <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" />
+ </xsd:complexType>
+
+ <xsd:complexType name="EventType">
+ <xsd:attribute name="Name" type="xsd:string" use="required"/>
+ <xsd:attribute name="Function" type="xsd:string" use="required"/>
+ </xsd:complexType>
+
</xsd:schema>
Modified: code/trunk/data/gui/layouts/InGamePickupHUD.layout
===================================================================
--- code/trunk/data/gui/layouts/InGamePickupHUD.layout 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/gui/layouts/InGamePickupHUD.layout 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,53 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
- <Window Type="DefaultWindow" Name="orxonox/InGamePickupHUD_RootWindow" >
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
- <Window Type="TaharezLook/StaticImage" Name="orxonox/InGamePickupHUD_Overview" >
- <Property Name="Font" Value="BlueHighway-12" />
- <Property Name="Text" Value="Pickup List" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0,5},{0.15,0},{0.2,0},{0.45,0}}" />
- <Property Name="Alpha" Value="0.3" />
- <!--Event Name="Clicked" Function="InGameMenu.button_return_clicked"/-->
- <Window Type="TaharezLook/StaticText" Name="orxonox/InGamePickupHUD_PickupTitle" >
- <Property Name="Alpha" Value="0.8"/>
- <Property Name="Text" Value="Pickup List" />
- <Property Name="Font" Value="BlueHighway-10" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,-20},{0,20}}" />
- </Window>
- <Window Type="TaharezLook/Button" Name="orxonox/InGamePickupHUD_closeButton" >
- <Property Name="Alpha" Value="0.8" />
- <Property Name="Font" Value="BlueHighway-12" />
- <Property Name="Text" Value="X" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{1,-20},{0,0},{1,0},{0,20}}" />
- <!-- alle Grössen / anordnungen angepasst - da überschneidungen von absoluten
- und relativen Positionsangaben (problematisch bei kleinen auflösungen) -->
- <Event Name="Clicked" Function="InGamePickupHUD.close_button_clicked"/>
- </Window>
- <Window Type="TaharezLook/Listbox" Name="orxonox/InGamePickupHUD_PickupListBox">
- <Property Name="Alpha" Value="0.8" />
- <Property Name="Font" Value="BlueHighway-12" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0,5},{0,25},{1,-5},{1,-5}}" />
- <!--
- <Window Type="TaharezLook/ListboxItem" Name="orxonox/InGamePickupHUD_TestPickupOne">
- <Property Name="Alpha" Value="0.8" />
- <Property Name="Font" Value="BlueHighway-12" />
- <Property Name="Text" Value="First Pickup" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,30},{1,0}}" />
- </Window>
- -->
- </Window>
-
- </Window>
-
-
- </Window>
-
+ <Window Type="DefaultWindow" Name="orxonox/InGamePickupHUD_RootWindow" >
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Window Type="TaharezLook/StaticImage" Name="orxonox/InGamePickupHUD_Overview" >
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="Text" Value="Pickup List" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,5},{0.15,0},{0.2,0},{0.45,0}}" />
+ <Property Name="Alpha" Value="0.3" />
+ <!--Event Name="Clicked" Function="InGameMenu.button_return_clicked"/-->
+ <Window Type="TaharezLook/StaticText" Name="orxonox/InGamePickupHUD_PickupTitle" >
+ <Property Name="Alpha" Value="0.8"/>
+ <Property Name="Text" Value="Pickup List" />
+ <Property Name="Font" Value="BlueHighway-10" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,-20},{0,20}}" />
+ </Window>
+ <Window Type="TaharezLook/Button" Name="orxonox/InGamePickupHUD_closeButton" >
+ <Property Name="Alpha" Value="0.8" />
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="Text" Value="X" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{1,-20},{0,0},{1,0},{0,20}}" />
+ <!-- alle Grössen / anordnungen angepasst - da überschneidungen von absoluten
+ und relativen Positionsangaben (problematisch bei kleinen auflösungen) -->
+ <Event Name="Clicked" Function="InGamePickupHUD.close_button_clicked"/>
+ </Window>
+ <Window Type="TaharezLook/Listbox" Name="orxonox/InGamePickupHUD_PickupListBox">
+ <Property Name="Alpha" Value="0.8" />
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,5},{0,25},{1,-5},{1,-5}}" />
+ <!--
+ <Window Type="TaharezLook/ListboxItem" Name="orxonox/InGamePickupHUD_TestPickupOne">
+ <Property Name="Alpha" Value="0.8" />
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="Text" Value="First Pickup" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,30},{1,0}}" />
+ </Window>
+ -->
+ </Window>
+ </Window>
+ </Window>
</GUILayout>
Copied: code/trunk/data/gui/layouts/ShipSelectionMenu.layout (from rev 9347, code/branches/presentation2012merge/data/gui/layouts/ShipSelectionMenu.layout)
===================================================================
--- code/trunk/data/gui/layouts/ShipSelectionMenu.layout (rev 0)
+++ code/trunk/data/gui/layouts/ShipSelectionMenu.layout 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+
+ <Window Type="MenuWidgets/StaticImage" Name="orxonox/ShipSelectionBackground" >
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ <!-- -->
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/ShipSelectionWindow" >
+ <Property Name="Text" Value="ShipSelection" />
+ <Property Name="Alpha" Value="0.8" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.15,0},{0.8,0},{0.7,0}}" />
+ <Window Type="MenuWidgets/TabControl" Name="orxonox/ShipSelectionTabControl" >
+ <Property Name="TabHeight" Value="{0,26.4388}" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="TabPanePosition" Value="Top" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" />
+
+ </Window>
+
+ <!-- TODO: Ship Description and Image
+ <Window Type="MenuWidgets/StaticImage" Name="orxonox/ShipSelectionShipImage" >
+ <Property Name="AlwaysOnTop" Value="True" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0.675,0}}" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/ShipSelectionLevelDescription" >
+ <Property Name="AlwaysOnTop" Value="True" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="VertScrollbar" Value="True" />
+ <Property Name="HorzScrollbar" Value="True" />
+ <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" />
+ </Window>-->
+
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionStartButton" >
+ <Property Name="Text" Value="Start" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" />
+ <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionStartButton_clicked"/>
+ </Window>
+ <!-- TODO: set ship properties
+ <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionConfigButton" >
+ <Property Name="Text" Value="Configure" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.725,0},{0.575,0},{0.775,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionConfigButton_clicked"/>
+ </Window> -->
+ <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionBackButton" >
+ <Property Name="Text" Value="Back" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" />
+ <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionBackButton_clicked"/>
+ </Window>
+ </Window>
+</GUILayout>
Property changes on: code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/AudioMenu.lua 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/gui/scripts/AudioMenu.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -33,6 +33,7 @@
table.insert(themeList, "Drum n' Bass")
table.insert(themeList, "8-Bit Style")
table.insert(themeList, "Corny Jazz")
+ table.insert(themeList, "Metal")
for k,v in pairs(themeList) do
item = CEGUI.createListboxTextItem(v)
item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
@@ -44,6 +45,8 @@
listboxwindow:setItemSelectState(2,true)
elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
listboxwindow:setItemSelectState(3,true)
+ elseif orxonox.getConfig("MoodManager", "mood_") == "metal" then
+ listboxwindow:setItemSelectState(4,true)
else
listboxwindow:setItemSelectState(0,true)
end
@@ -177,6 +180,8 @@
orxonox.config("MoodManager", "mood_", "eightbit")
elseif listboxwindow:isItemSelected(3) then
orxonox.config("MoodManager", "mood_", "jazzy")
+ elseif listboxwindow:isItemSelected(4) then
+ orxonox.config("MoodManager", "mood_", "metal")
else
orxonox.config("MoodManager", "mood_", "default")
end
Modified: code/trunk/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/trunk/data/gui/scripts/PickupInventory.lua 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/gui/scripts/PickupInventory.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -107,7 +107,7 @@
end
function P.createPickupEntry(index, pickup)
- local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup)
+ local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName)
local name = "orxonox/PickupInventory/Box/Pickup" .. index
@@ -175,7 +175,7 @@
end
for k,v in pairs(P.detailsWindows) do
if v ~= nil then
- winMgr:destroyWindow(v)
+ P.destroyDetailWindow(k)
end
end
end
@@ -192,7 +192,7 @@
function P.createDetailsWindow(pickupIndex)
local pickup = P.pickupsList[pickupIndex]
- local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup)
+ local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName)
local index = P.getNewDetailNumber()
local name = "orxonox/PickupInventory/Details" .. index
@@ -322,6 +322,10 @@
local match = string.gmatch(name, "%d+")
local detailNr = tonumber(match())
+ P.destroyDetailWindow(detailNr)
+end
+
+function P.destroyDetailWindow(detailNr)
local window = P.detailsWindows[detailNr]
winMgr:destroyWindow(window)
P.detailsWindows[detailNr] = nil
Copied: code/trunk/data/gui/scripts/ShipSelectionMenu.lua (from rev 9347, code/branches/presentation2012merge/data/gui/scripts/ShipSelectionMenu.lua)
===================================================================
--- code/trunk/data/gui/scripts/ShipSelectionMenu.lua (rev 0)
+++ code/trunk/data/gui/scripts/ShipSelectionMenu.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,132 @@
+-- ShipSelectionMenu.lua
+
+local P = createMenuSheet("ShipSelectionMenu")
+P.activeTabIndexes = {}
+P.scrollbarWidth = 13
+P.shipList = {}
+function P.onLoad()
+ orxonox.execute("set shipmodelsfile [open {../levels/templates/.shipmodels} w+]")
+ orxonox.execute("foreach line [glob -directory ../levels/templates/ spaceship*] { regexp {.*/(.*)\\..*} $line matchall match1; puts $shipmodelsfile $match1 }")
+ orxonox.execute("close $shipmodelsfile")
+ P.createFilterTab("All Ships")
+end
+
+function P.createShipList() --generates list with tagged shipmodels
+ P.shipList = {}
+ file = io.open("../levels/templates/.shipmodels")
+ if file ~= nil then
+ for line in file:lines() do --checks if shipmodel is included in level file
+ if selectedlevel:hasStartingShip(string.lower(line)) then
+ P.shipList[#P.shipList+1] = string.lower(line)
+ end
+ end
+ --file.close() -- TODO: investigate why close() seems to crash?
+ end
+end
+
+function P.update() --updates listbox with found models
+ P.createShipList()
+ listbox:resetList()
+ --orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
+ local tabIndexes = {}
+ for k,v in pairs(P.shipList) do
+ --TODO: only add ship if is in the right filter tab
+ --if tag == nil or v:hasStartingShip(tag) then
+ local item = CEGUI.createListboxTextItem(v)
+ item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+ listbox:addItem(item)
+ table.insert(tabIndexes, k)
+ --orxonox.GUIManager:setTooltipTextHelper(item, v:getDescription())
+ --end
+ end
+ table.insert(P.activeTabIndexes, tabIndexes)
+end
+
+function P.createFilterTab(name) -- generates filter tab and list box, sets handler for selection changes
+ tabName = "orxonox/ShipSelectionLevelTab"
+ -- create new tab window with desired name
+ listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
+ listbox:setText(name)
+ listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
+ --[[TODO: smaller list if image and description is implemented.
+ listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") --]]
+ listbox:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
+ -- fill listbox with items
+ P.update()
+ -- listen to selection changes
+ orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".ShipSelectionSelectionChanged")
+ local tabControl = winMgr:getWindow("orxonox/ShipSelectionTabControl")
+ orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".ShipSelectionSelectionChanged")
+ if listbox:getItemCount() > 0 then
+ tabControl:addChildWindow(tabName)
+ end
+end
+
+function P.ShipSelectionGetSelectedModel() --returns selected model, if available.
+ -- choose the active listbox
+ local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/ShipSelectionTabControl"))
+ local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
+ local choice = listbox:getFirstSelectedItem()
+ if choice ~= nil then
+ -- get the right tab and the right index
+ local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
+ local index = tabIndexes[listbox:getItemIndex(choice)+1]
+ return P.shipList[index]
+ else
+ return nil
+ end
+end
+
+function P.ShipSelectionSelectionChanged(e)
+ --[[ TODO: Get image and description from template file
+ local levelImage = winMgr:getWindow("orxonox/ShipSelectionLevelImage")
+ local levelDescription = winMgr:getWindow("orxonox/ShipSelectionLevelDescription")
+ local configButton = winMgr:getWindow("orxonox/ShipSelectionConfigButton")
+ local level = P.ShipSelectionGetSelectedModel()
+ if level ~= nil then
+ --local levelXMLFilename = selectedlevel:getXMLFilename()
+ --local imageName = selectedlevel:getScreenshot()
+ -- set the screenshot and the description for the selected level
+ --levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
+ --levelDescription:setText(level:getDescription())
+ -- only enable config button for "gametype" levels
+ --if level:hasTag("gametype") then
+ -- configButton:setProperty("Disabled", "False")
+ --else
+ -- configButton:setProperty("Disabled", "True")
+ --end
+ else
+ -- also take care of "no level selected"
+ levelImage:setProperty("Image", nil)
+ levelDescription:setText("")
+ end
+ --]]
+end
+
+function P.ShipSelectionStartButton_clicked(e)
+
+ if (selectedlevel ~= nil and P.ShipSelectionGetSelectedModel() ~= nil) then
+ selectedlevel:selectStartingShip(P.ShipSelectionGetSelectedModel())
+ orxonox.execute("startGame " .. "_temp.oxw")
+ hideAllMenuSheets()
+ else
+ orxonox.execute("orxout user_warning no ship model selected or no tagged shipmodel installed")
+ end
+end
+
+--[[ TODO: function P.ShipSelectionConfigButton_clicked(e)
+
+ local level = P.ShipSelectionGetSelectedModel()
+ if level ~= nil then
+ local configMenu = showMenuSheet("ShipSelectionConfigMenu")
+ configMenu:loadConfig(level)
+ end
+end
+--]]
+
+
+function P.ShipSelectionBackButton_clicked(e)
+ orxonox.execute("keyESC")
+end
+
+return P
Property changes on: code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerMenu.lua 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/gui/scripts/SingleplayerMenu.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,14 +1,15 @@
-- SingleplayerMenu.lua
local P = createMenuSheet("SingleplayerMenu")
-
+P.loadAlong = {"ShipSelectionMenu"}
P.levelList = {}
P.activeTabIndexes = {}
P.scrollbarWidth = 13
+selectedlevel = {} -- level for ship selection
function P.onLoad()
P.createLevelList()
-
+
-- create tabs with desired tab as argument (nil for all)
P.createFilterTab("Gametypes", "gametype")
P.createFilterTab("Missions", "mission")
@@ -17,10 +18,10 @@
P.createFilterTab("Presentations", "presentation")
P.createFilterTab("Tests", "test")
P.createFilterTab("Show All", nil)
-
+
-- update description and screenshot boxes
P.SingleplayerSelectionChanged()
-
+
--buttons are arranged in a 1x3 matrix
P:setButton(1, 1, {
["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
@@ -45,7 +46,7 @@
local level = nil
while index < size do
level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
- if level ~= nil then
+ if (level ~= nil and level:getXMLFilename() ~= "_temp.oxw") then
local levelXMLFilename = level:getXMLFilename()
-- create an imageset for each screenshot
local imageName = level:getScreenshot()
@@ -140,10 +141,15 @@
end
function P.SingleplayerStartButton_clicked(e)
- local level = P.SingleplayerGetSelectedLevel()
- if level ~= nil then
- orxonox.execute("startGame " .. level:getXMLFilename())
- hideAllMenuSheets()
+ selectedlevel = P.SingleplayerGetSelectedLevel()
+ if selectedlevel ~= nil then
+ if selectedlevel:hasTag("shipselection") then
+ local shipSelectionMenu = showMenuSheet("ShipSelectionMenu", true)
+ shipSelectionMenu:update()
+ else
+ orxonox.execute("startGame " .. selectedlevel:getXMLFilename())
+ hideAllMenuSheets()
+ end
end
end
Modified: code/trunk/data/levels/FPSTest.oxw
===================================================================
--- code/trunk/data/levels/FPSTest.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/FPSTest.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
<Scene
ambientlight = "0.1, 0.1, 0.1"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
gravity = "0,-1000,0"
negativeWorldRange = "-100000, -100000, -100000"
positiveWorldRange = " 100000, 100000, 100000"
Modified: code/trunk/data/levels/Spacerace2.oxw
===================================================================
--- code/trunk/data/levels/Spacerace2.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/Spacerace2.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -11,7 +11,7 @@
include("templates/lodInformation.oxt")
include("templates/spaceshipAssff.oxt")
-
+
?>
<?lua
@@ -36,61 +36,61 @@
<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>
+ <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="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="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="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>
+ <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>
-
-<SpaceShip position="0,0,200" lookat="0,0,0">
+ <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>
@@ -201,7 +201,7 @@
</MovableEntity>
-
+
</Scene>
</Level>
Property changes on: code/trunk/data/levels/Spacerace2.oxw
___________________________________________________________________
Added: svn:eol-style
+ native
Copied: code/trunk/data/levels/SurfaceRacePresentation.oxw (from rev 9347, code/branches/presentation2012merge/data/levels/SurfaceRacePresentation.oxw)
===================================================================
--- code/trunk/data/levels/SurfaceRacePresentation.oxw (rev 0)
+++ code/trunk/data/levels/SurfaceRacePresentation.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,376 @@
+<LevelInfo
+ name = "Surface Race Presentation"
+ description = "just awesome 2.0"
+ screenshot = "surfaceRace.png"
+ tags = "gametype, shipselection"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser, spaceshiprace"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/spaceshipRace.oxt")
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipGhost.oxt")
+ include("templates/spaceshipSpacecruiser.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+<Level
+gametype = SpaceRace
+>
+
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "2.0, 2.0, 2.0"
+ skybox = "Orxonox/skyBoxClouds"
+ gravity = "0,-75,0"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ hasPhysics = true
+ >
+
+ <Template name=PortalDefault>
+ <PortalEndPoint>
+ <attached>
+ <Model mesh="Spacegate.mesh" scale="3"/>
+ </attached>
+ </PortalEndPoint>
+ </Template>
+
+ <PortalEndPoint position="6000,8050,2500" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+ <PortalEndPoint position="6100,8050,-4500" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+ <PortalLink fromID="1" toID="2" />
+ <PortalLink fromID="2" toID="1" />
+
+ <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"/>
+
+
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile01.mesh" shadow=true />
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile02.mesh" shadow=true />
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile03.mesh" shadow=true />
+
+ <MovableEntity position="-700,8090,-300" velocity="80,0,0" rotationaxis="1,0,1" rotationrate=200>
+ <attached>
+ <Model position="0,0,-20" scale=10 mesh="cokebottle.mesh" />
+ </attached>
+ </MovableEntity>
+
+
+<SpaceRaceManager>
+ <checkpoints>
+ <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=shipselection />
+
+
+ <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90" scale="4" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+ <!--
+ <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+ <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="0,-320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="320,0,2400" halfExtents="72,360,2400" />
+ <BoxCollisionShape position="-320,0,2400" halfExtents="72,360,2400" />
+
+
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+
+
+
+ <!-- ------------------Boden----------------- -->
+ <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+ <attached>
+ <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+ </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+ <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60" maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+ max = 15
+ for i = 0, max, 1
+ do
+ x=-12000
+ y=10000
+ z=-12000
+
+ ?>
+ <?lua
+ for k = 1, 15, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+ collisionType = "dynamic"
+ linearDamping = "0.5"
+ angularDamping = "0.5"
+ collisiondamage = "100"
+ 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 == 0 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 ?>
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/asteroidField.oxw
===================================================================
--- code/trunk/data/levels/asteroidField.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/asteroidField.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -38,27 +38,27 @@
<!-- Belt that's far away *** TURNED OFF FOR PERFORMANCE REASONS *** -->
- <!-- Generate asteroid field and asteroid belt -->
+ <!-- Generate asteroid field and asteroid belt -->
<!--
<?lua
- dofile("includes/asteroidField.lua")
- asteroidBelt(0, 0, 0, -48, -34, 70, 100, 200, 219900, 210000, 900, 1)
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(0, 0, 0, -48, -34, 70, 100, 200, 219900, 210000, 900, 1)
?>
-->
<!-- triple large belt around the planet -->
<?lua
- dofile("includes/asteroidField.lua")
- asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
?>
<?lua
- dofile("includes/asteroidField.lua")
- asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
?>
<?lua
- dofile("includes/asteroidField.lua")
- asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
?>
@@ -94,7 +94,7 @@
-
+
</Scene>
</Level>
Property changes on: code/trunk/data/levels/asteroidField.oxw
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/levels/asteroids.oxw
===================================================================
--- code/trunk/data/levels/asteroids.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/asteroids.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -148,10 +148,10 @@
</ForceField>
- <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=30 />
+ <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=24 />
- <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=17>
+ <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=20>
<events>
<activity>
<EventListener event=trigger1 />
@@ -202,7 +202,7 @@
</CheckPoint>
- <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=16>
+ <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
<events>
<activity>
<EventListener event=trigger2 />
@@ -253,7 +253,7 @@
</CheckPoint>
- <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=17>
+ <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
<events>
<activity>
<EventListener event=trigger3 />
@@ -304,7 +304,7 @@
</CheckPoint>
- <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=16>
+ <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
<events>
<activity>
<EventListener event=trigger4 />
@@ -355,7 +355,7 @@
</CheckPoint>
- <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=22>
+ <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=15>
<events>
<activity>
<EventListener event=trigger5 />
Modified: code/trunk/data/levels/docking.oxw
===================================================================
--- code/trunk/data/levels/docking.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/docking.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -20,7 +20,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/dynamicMatch.oxw
===================================================================
--- code/trunk/data/levels/dynamicMatch.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/dynamicMatch.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -9,6 +9,8 @@
include("HUDTemplates3.oxo")
include("stats.oxo")
include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipSwallow.oxt")
+ include("templates/spaceshipPirate.oxt")
include("templates/spaceshipGhost.oxt")
include("dynamicMatchHUD.oxo")
include("templates/lodInformation.oxt")
@@ -38,19 +40,19 @@
<!-- -----------12-Spawnpoints around the planet------------- -->
<!-- inner Spawnpoints -->
-<TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,-1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,-1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+<TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,-1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,-1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
<!--outer Spawnpoints -->
-<TeamSpawnPoint team=0 position="2000,0,0" lookat="0,0,1" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="-2000,0,0" lookat="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,2000,0" lookat="0,1,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,-2000,0" lookat="0,-1,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,2000" lookat="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,-2000" lookat="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+<TeamSpawnPoint team=0 position="2000,0,0" lookat="0,0,1" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="-2000,0,0" lookat="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,2000,0" lookat="0,1,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,-2000,0" lookat="0,-1,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,2000" lookat="1,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,-2000" lookat="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
<?lua
dofile("includes/CuboidSpaceStation.lua")
@@ -63,9 +65,9 @@
<?lua
createSpaceStationPar(0,2,1,2,1,4,1,50)
?>
- <TeamSpawnPoint team=2 position="20,20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
- <TeamSpawnPoint team=2 position="-20,-20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
- <TeamSpawnPoint team=2 position="-10,10,20" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+ <TeamSpawnPoint team=2 position="20,20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+ <TeamSpawnPoint team=2 position="-20,-20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+ <TeamSpawnPoint team=2 position="-10,10,20" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
</attached>
</StaticEntity>
</attached>
@@ -89,10 +91,10 @@
<StaticEntity position="<?lua print(x + math.random() * 1000-500) ?>,<?lua print(y + math.random() * 1000-500) ?>,<?lua print(z + math.random() * 5000-2500) ?>" 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">
- <attached><!-- ---------asteroid fog----- -->
+ <attached><!-- ---------asteroid fog----- -->
<ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
</attached>
- </Model>
+ </Model>
</attached>
<?lua if i == 5 then ?><collisionShapes>
<SphereCollisionShape radius="<?lua print(j * 70) ?>" />
Modified: code/trunk/data/levels/events.oxw
===================================================================
--- code/trunk/data/levels/events.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/events.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -21,7 +21,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/fightInOurBack.oxw
===================================================================
--- code/trunk/data/levels/fightInOurBack.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/fightInOurBack.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -120,7 +120,7 @@
<!-- Ausgang: Szene ===> ambientlight/skybox -->
<Scene
ambientlight="0.8,0.8,0.8"
- skybox="Orxonox/skypanoramagen1"
+ skybox="Orxonox/skyBoxBasic"
>
<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
Modified: code/trunk/data/levels/includes/CuboidSpaceStation.lua
===================================================================
--- code/trunk/data/levels/includes/CuboidSpaceStation.lua 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/includes/CuboidSpaceStation.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,19 +1,19 @@
----------------------------------------------------------------------------------------------------
-- This lua script creates a totally random generated space station for the orxonox computer game!--
--- (c) Wallah 2008, published under GPL licence! --
+-- (c) Wallah 2008, published under GPL licence! --
----------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- IMPORTANT: If you need more parameters, do the following: copy the actual function (just the headline and the end statement) to the end of the file, --
+-- IMPORTANT: If you need more parameters, do the following: copy the actual function (just the headline and the end statement) to the end of the file, --
-- like I did with createSpaceStation() and let that function call the new function where you can modify the parameters. For all parameters which the old function--
-- doesn't have you just give the standard default values, which I have defined. This is to make sure, that anyone else who uses the old function can still use it--
--- the same way he/she always did. If you want a function with less parameters, just create a new one at the end of the file and call this function with some --
--- default values. REMEMBER: Function overloading is not possible, be sure to call your function differently from others already existing ones. --
+-- the same way he/she always did. If you want a function with less parameters, just create a new one at the end of the file and call this function with some --
+-- default values. REMEMBER: Function overloading is not possible, be sure to call your function differently from others already existing ones. --
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- This function creates a randomly generated space station.
-- The first argument ranSeed, must be 0, or a positive Integer, if it is 0 your space station is always chosen randomly, if you give an integer,
--- your space station will be generated randomly, but once you have the space station it will always be the same.
+-- your space station will be generated randomly, but once you have the space station it will always be the same.
-- The argument xLength defines how large the space station will be into the x-direction.
-- The argument xVar defines how much the space station will vary at the ends in x-direction, this is so that the station is no cube.
-- The argument yLength is the same as xLength, but for the y-direction.
@@ -36,9 +36,9 @@
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Create a randomseed, so that the math.random() function is actually random.
if ranSeed == 0 then
- math.randomseed(os.time())
+ math.randomseed(os.time())
else
- math.randomseed(ranSeed)
+ math.randomseed(ranSeed)
end
-- End create randomseed.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -51,11 +51,11 @@
-- Define the maximal size of the grid, this value is based on how large you define the area of bodyparts plus 20 gridpoints for attachparts.
sSSize=30
if xLength>=yLength and xLength>=zLength then
- sSSize=xLength+20
+ sSSize=xLength+20
elseif yLength>=xLength and yLength>=zLength then
- sSSize=yLength+20
+ sSSize=yLength+20
elseif zLength>=xLength and zLength>=yLength then
- sSSize=zLength+20
+ sSSize=zLength+20
end
-- Define how many parts the space station has, this value has to be exact, so be sure to increment it if you're adding a new part.
sSParts=9
@@ -77,7 +77,7 @@
-- It should be at least 1 bigger than the biggest part needs, because I guarantee that it works with odd numbers, to do so I use the math.floor function.
pDim=6
-- Define the griddimension, be sure this value matches the size of a single space station part plus the size of a connection part, which means your parts must be:
--- integer*(gridDim-connectionSize), then integer tells you how many griddimensions your part is.
+-- integer*(gridDim-connectionSize), then integer tells you how many griddimensions your part is.
gridDim=2.25
-- End define global parameters.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -88,26 +88,26 @@
-- This creates a 4-dimensional grid, which tells us if there is a part or not, and in which direction it has connections.
-- The parameters x,y,z are the axis of the space station, which iterate to sSSize, the maximal size of the space station.
-- The griddimension, this word I will use later, means that the distance of a point to the next point is gridDim in the game, so the absolute x-axis is x*gridDim*sSScale,
--- and so on for the other dimensions y and z.
+-- and so on for the other dimensions y and z.
-- grid[x][y][z][0] contains 0 if there is no part at the position (x,y,z), otherwise 1.
-- grid[x][y][z][1] contains 0 if there is no connection from (x,y,z) in x-direction, "+" if there is one in the positive x-direction,
--- "-" if there is one in the negative x-direction, "+-" if there are in both x-directions.
+-- "-" if there is one in the negative x-direction, "+-" if there are in both x-directions.
-- grid[x][y][z][2] contains 0 if there is no connection from (x,y,z) in y-direction, "+" if there is one in the positive y-direction,
--- "-" if there is one in the negative y-direction, "+-" if there are in both y-directions.
+-- "-" if there is one in the negative y-direction, "+-" if there are in both y-directions.
-- grid[x][y][z][3] contains 0 if there is no connection from (x,y,z) in z-direction, "+" if there is one in the positive z-direction,
--- "-" if there is one in the negative z-direction, "+-" if there are in both z-directions.
+-- "-" if there is one in the negative z-direction, "+-" if there are in both z-directions.
grid = {}
for x=-math.floor(sSSize/2),math.floor(sSSize/2) do
- grid[x] = {}
- for y=-math.floor(sSSize/2),math.floor(sSSize/2) do
- grid[x][y]= {}
- for z=-math.floor(sSSize/2),math.floor(sSSize/2) do
- grid[x][y][z]={}
- for i=0,3 do
- grid[x][y][z][i]=0
- end
- end
- end
+ grid[x] = {}
+ for y=-math.floor(sSSize/2),math.floor(sSSize/2) do
+ grid[x][y]= {}
+ for z=-math.floor(sSSize/2),math.floor(sSSize/2) do
+ grid[x][y][z]={}
+ for i=0,3 do
+ grid[x][y][z][i]=0
+ end
+ end
+ end
end
-- End create 4-dim grid.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -118,39 +118,39 @@
-- This creates an array which stores all the parts, it's size is depending on the global values pDim and sSParts.
-- The first parameter i, tells us how many parts fit into the array, so it iterates from 1 to sSParts, each part has his own value i.
-- The second, third and fourth parameters are the relative coordinates of the part, you have to start at (0,0,0) and be sure you fill the array into the right direction.
--- A short example: your part is 2 griddimensions long and you place it in the game, that the relative coordinate point is at (0,0,0) and the part lies in the positive
--- z-axis, then you have to use the coordinate point (0,0,1).
+-- A short example: your part is 2 griddimensions long and you place it in the game, that the relative coordinate point is at (0,0,0) and the part lies in the positive
+-- z-axis, then you have to use the coordinate point (0,0,1).
-- The fifth parameter is an array with size 4, at index=0, you have to set 1 if your part covers the gridpoint at (x,y,z), otherwise 0.
--- At index=1,2,3 you define the possible connection directions (1 for x, 2 for y and 3 for z), be sure to use the notation from above (0, "+-", "+", "-").
+-- At index=1,2,3 you define the possible connection directions (1 for x, 2 for y and 3 for z), be sure to use the notation from above (0, "+-", "+", "-").
bodyParts={}
for i=1,sSParts do
- bodyParts[i]={}
- for x=-math.floor(pDim/2),math.floor(pDim/2) do
- bodyParts[i][x]={}
- for y=-math.floor(pDim/2),math.floor(pDim/2) do
- bodyParts[i][x][y]={}
- for z=-math.floor(pDim/2),math.floor(pDim/2) do
- bodyParts[i][x][y][z]={}
- for k=0,3 do
- bodyParts[i][x][y][z][k]=0
- end
- end
- end
- end
- -- This contains the name of the mesh file.
- bodyParts[i][0][0][0][4]=""
- -- This contains the first possible rotation of your part, pitch=... yaw=... roll=... .
- bodyParts[i][0][0][0][5]=""
- -- This contains the second possible rotation of your part, pitch=... yaw=... roll=... .
- bodyParts[i][0][0][0][6]=""
- -- This contains the third possible rotation of your part, pitch=... yaw=... roll=... .
- bodyParts[i][0][0][0][7]=""
- -- Contains the movement rotation, rotationaxis=... rotationrate=... .
- bodyParts[i][0][0][0][8]=""
- -- Contains the attachment, if your part has an attachment, e.g. <ParticleEmitter .../>.
- bodyParts[i][0][0][0][9]=""
- -- Contains how many of this part you want to attach to your space station.
- bodyParts[i][0][0][0][10]=1
+ bodyParts[i]={}
+ for x=-math.floor(pDim/2),math.floor(pDim/2) do
+ bodyParts[i][x]={}
+ for y=-math.floor(pDim/2),math.floor(pDim/2) do
+ bodyParts[i][x][y]={}
+ for z=-math.floor(pDim/2),math.floor(pDim/2) do
+ bodyParts[i][x][y][z]={}
+ for k=0,3 do
+ bodyParts[i][x][y][z][k]=0
+ end
+ end
+ end
+ end
+ -- This contains the name of the mesh file.
+ bodyParts[i][0][0][0][4]=""
+ -- This contains the first possible rotation of your part, pitch=... yaw=... roll=... .
+ bodyParts[i][0][0][0][5]=""
+ -- This contains the second possible rotation of your part, pitch=... yaw=... roll=... .
+ bodyParts[i][0][0][0][6]=""
+ -- This contains the third possible rotation of your part, pitch=... yaw=... roll=... .
+ bodyParts[i][0][0][0][7]=""
+ -- Contains the movement rotation, rotationaxis=... rotationrate=... .
+ bodyParts[i][0][0][0][8]=""
+ -- Contains the attachment, if your part has an attachment, e.g. <ParticleEmitter .../>.
+ bodyParts[i][0][0][0][9]=""
+ -- Contains how many of this part you want to attach to your space station.
+ bodyParts[i][0][0][0][10]=1
end
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -192,7 +192,7 @@
-- End insert DoubleCuboidBody.
-- Insert the CuboidConnectionBody, it is three griddimensions long and one wide and high and can have only connections at griddimension 1
--- (except the side in direction of griddimension 2) and griddimension 3 (except the side in direction of griddimension 2).
+-- (except the side in direction of griddimension 2) and griddimension 3 (except the side in direction of griddimension 2).
bodyParts[3][0][0][0][4]="CuboidConnBody.mesh"
bodyParts[3][0][0][0][5]="pitch=-90"
@@ -372,115 +372,115 @@
--This function actualizes the grid, which I have to call always after I have added a new part to the space station.
function actualizeGrid(Index,x,y,z)
- for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- if bodyParts[Index][i][j][k][0] == 1 then
- for l=0,3 do
- grid[x+i][y+j][z+k][l] = bodyParts[Index][i][j][k][l]
- end
- end
- end
- end
- end
+ for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ if bodyParts[Index][i][j][k][0] == 1 then
+ for l=0,3 do
+ grid[x+i][y+j][z+k][l] = bodyParts[Index][i][j][k][l]
+ end
+ end
+ end
+ end
+ end
end
-- End actualizeGrid.
-- This function checks wheter a given parts fits at that position or not.
-- If the part fits there it returns 1, otherwise 0.
function checkPart(Index,x,y,z)
- check=1
- for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
- -- If the part occupies the position (i,j,k), the grid must be empty there ((x+i, y+j, z+k)==0), if not, check is zero,
- -- which means that the part doesn't fit there.
- if bodyParts[Index][i][j][k][0] == 1 and grid[x+i][y+j][z+k][0] == 1 then
- check=0
- end
- end
- end
- end
- return check
+ check=1
+ for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+ -- If the part occupies the position (i,j,k), the grid must be empty there ((x+i, y+j, z+k)==0), if not, check is zero,
+ -- which means that the part doesn't fit there.
+ if bodyParts[Index][i][j][k][0] == 1 and grid[x+i][y+j][z+k][0] == 1 then
+ check=0
+ end
+ end
+ end
+ end
+ return check
end
-- End checkPart function.
-- This function prints the model with tempPartIndex in the bodyParts array at position lx,ly,lz.
-- If you need to rotate the model around his own axis, then you have to set movEntity true and define the details of the rotation in
--- bodyParts[tempPartIndex][0][0][0][8].
+-- bodyParts[tempPartIndex][0][0][0][8].
-- If your model needs to be rotated like bodyParts[tempPartIndex][0][0][0][5], then side must be 1, for bodyParts[tempPartIndex][0][0][0][6] side must be 2,
--- for bodyParts[tempPartIndex][0][0][0][7] side must be 3.
+-- for bodyParts[tempPartIndex][0][0][0][7] side must be 3.
function printModel(lx,ly,lz,tempPartIndex,movEntity,side)
- if movEntity == true then
- print("<MovableEntity scale=1 position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale) print("\" ")
- print(bodyParts[tempPartIndex][0][0][0][8]) print(">")
- print("<attached>")
- lx=0 ly=0 lz=0
- end
+ if movEntity == true then
+ print("<MovableEntity scale=1 position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale) print("\" ")
+ print(bodyParts[tempPartIndex][0][0][0][8]) print(">")
+ print("<attached>")
+ lx=0 ly=0 lz=0
+ end
- print("<Model position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale)
- print("\" scale=") print(sSScale) print(" mesh= \"") print(bodyParts[tempPartIndex][0][0][0][4]) print("\"")
+ print("<Model position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale)
+ print("\" scale=") print(sSScale) print(" mesh= \"") print(bodyParts[tempPartIndex][0][0][0][4]) print("\"")
- if side == 1 then
- print(bodyParts[tempPartIndex][0][0][0][5]) print(">")
- elseif side == 2 then
- print(bodyParts[tempPartIndex][0][0][0][6]) print(">")
- elseif side == 3 then
- print(bodyParts[tempPartIndex][0][0][0][7]) print(">")
- end
+ if side == 1 then
+ print(bodyParts[tempPartIndex][0][0][0][5]) print(">")
+ elseif side == 2 then
+ print(bodyParts[tempPartIndex][0][0][0][6]) print(">")
+ elseif side == 3 then
+ print(bodyParts[tempPartIndex][0][0][0][7]) print(">")
+ end
- print("<attached>")
- print(bodyParts[tempPartIndex][0][0][0][9])
- print("</attached>")
+ print("<attached>")
+ print(bodyParts[tempPartIndex][0][0][0][9])
+ print("</attached>")
- print("</Model>")
+ print("</Model>")
- if movEntity == true then
- print("</attached>")
- print("</MovableEntity>")
- end
+ if movEntity == true then
+ print("</attached>")
+ print("</MovableEntity>")
+ end
end
-- End function printModel().
-- This function sets a part to a side of the space station.
-- The arguments lx,ly,lz are the coordinates of the grid, where you want to set the part.
-- The arguments xAxis,yAxis,zAxis can be 0 or 1, but only one argument out of the three can be 1. This means two of them must always be zero. You have to set xAxis to one,
--- if your part is attached to a side, which faces into the x-direction (negative or positive, this is later specified with Dir), that means the x-Axis is a normal vector
--- of the side to which you want to attach the part. The same for yAxis and zAxis.
+-- if your part is attached to a side, which faces into the x-direction (negative or positive, this is later specified with Dir), that means the x-Axis is a normal vector
+-- of the side to which you want to attach the part. The same for yAxis and zAxis.
-- The argument Dir must be 1 if your side, where you want to attach the part, faces into the positive direction, -1 if the side faces into the negative direction. The side
--- faces into the positive direction means, that the side of the side where the part will be attached is directed into the direction of the positive direction of the
--- corresponding axis.
+-- faces into the positive direction means, that the side of the side where the part will be attached is directed into the direction of the positive direction of the
+-- corresponding axis.
-- The argument index is the index of the part for the bodyParts array.
-- The argument printMovEnt must be false if your part doesn't need to be attached to an extra MovableEntity. If your part must be attached to an extra MovableEntity
--- this argument must be true. The extra MovableEntity is used to rotate the part around his own axis, or something like that.
+-- this argument must be true. The extra MovableEntity is used to rotate the part around his own axis, or something like that.
-- The argument printSide is like the argument side of the printModel() function. It defines how your part will be rotated. Read the commentary there.
-- The function returns 0 if the part couldn't be set, because it did not fit there or there was no side to attach the part. It returns 1 if the part is successfully set.
function setPart(lx,ly,lz,xAxis,yAxis,zAxis,Dir,index,printMovEnt,printSide)
- partSet=0
- -- For the bodyParts array I use 1 as x-, 2 as y- and 3 as z-Axis for the definition in which directions a part can have connections.
- coord=1*xAxis+2*yAxis+3*zAxis
- -- If I try to attach the part from the positive direction to the side of the space station, the part of the station (where I want to attach the new part) must have
- -- a connection into the positive direction. Otherwise I look from the negative side and so the part of the station must have a connection into the negative direction.
- if Dir==1 then
- conn="+"
- elseif Dir==-1 then
- conn="-"
- end
- -- I look from the direction defined through Dir, and here I check, whether I have reached a side of the space station, which means at position lx,ly,lz is nothing and
- -- at the next position is a part which can have a connection into the direction from where I look.
- if grid[lx][ly][lz][0] == 0 and grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][0] == 1 and (grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]=="+-" or grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]==conn) then
- -- This checks whether the part fits at that position or not.
- check=checkPart(index,lx,ly,lz)
- if check == 1 then
- -- This prints the part.
- printModel(lx,ly,lz,index,printMovEnt,printSide)
- partSet=1
- -- This actualizes the grid array with the values of the array bodyParts at the position index.
- actualizeGrid(index,lx,ly,lz)
- end
- end
- return partSet
+ partSet=0
+ -- For the bodyParts array I use 1 as x-, 2 as y- and 3 as z-Axis for the definition in which directions a part can have connections.
+ coord=1*xAxis+2*yAxis+3*zAxis
+ -- If I try to attach the part from the positive direction to the side of the space station, the part of the station (where I want to attach the new part) must have
+ -- a connection into the positive direction. Otherwise I look from the negative side and so the part of the station must have a connection into the negative direction.
+ if Dir==1 then
+ conn="+"
+ elseif Dir==-1 then
+ conn="-"
+ end
+ -- I look from the direction defined through Dir, and here I check, whether I have reached a side of the space station, which means at position lx,ly,lz is nothing and
+ -- at the next position is a part which can have a connection into the direction from where I look.
+ if grid[lx][ly][lz][0] == 0 and grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][0] == 1 and (grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]=="+-" or grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]==conn) then
+ -- This checks whether the part fits at that position or not.
+ check=checkPart(index,lx,ly,lz)
+ if check == 1 then
+ -- This prints the part.
+ printModel(lx,ly,lz,index,printMovEnt,printSide)
+ partSet=1
+ -- This actualizes the grid array with the values of the array bodyParts at the position index.
+ actualizeGrid(index,lx,ly,lz)
+ end
+ end
+ return partSet
end
-- End function setPart().
@@ -489,47 +489,47 @@
-- The argument index here must be an array, where you define the index for your part for the bodyParts array. The first used index is 1 and goes up to parts.
-- The argument parts is the number of different parts which you want to attach to a side.
function spiralSet(xAxis,yAxis,zAxis,Dir,index,parts,printMovEnt,printSide)
- if index[0] ~= false then
- -- The array vector contains the actual position where you try to set the part. vector[0],vector[1] and vector[3] contains the x,y,z-coordinate.
- vector={}
- -- This must be done, because there are different sides from where I try to attach a part.
- coord1=1*yAxis+2*zAxis
- coord2=math.mod(coord1+1,3)
- coord3=math.mod(coord2+1,3)
+ if index[0] ~= false then
+ -- The array vector contains the actual position where you try to set the part. vector[0],vector[1] and vector[3] contains the x,y,z-coordinate.
+ vector={}
+ -- This must be done, because there are different sides from where I try to attach a part.
+ coord1=1*yAxis+2*zAxis
+ coord2=math.mod(coord1+1,3)
+ coord3=math.mod(coord2+1,3)
- for pc=1,parts do
- tempIndex = index[pc]
- for eachPart=1,bodyParts[tempIndex][0][0][0][10] do
- partSet=0
- vector[coord1]=math.floor(Dir*sSSize/2)-2*Dir
- while vector[coord1]~=math.floor(-1*Dir*sSSize/2)+2*Dir and partSet==0 do
- round=0
- while round<=math.floor(sSSize/2)-2 and partSet==0 do
- vector[coord2]=round
- vector[coord3]=-round
- while vector[coord3]<=round and partSet==0 do
- partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
- vector[coord3]=vector[coord3]+1
- end
- while vector[coord2]>=-round and partSet==0 do
- partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
- vector[coord2]=vector[coord2]-1
- end
- while vector[coord3]>-round and partSet==0 do
- partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
- vector[coord3]=vector[coord3]-1
- end
- while vector[coord2]<=round and partSet==0 do
- partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
- vector[coord2]=vector[coord2]+1
- end
- round=round+1
- end
- vector[coord1]=vector[coord1]-Dir
- end
- end
- end
- end
+ for pc=1,parts do
+ tempIndex = index[pc]
+ for eachPart=1,bodyParts[tempIndex][0][0][0][10] do
+ partSet=0
+ vector[coord1]=math.floor(Dir*sSSize/2)-2*Dir
+ while vector[coord1]~=math.floor(-1*Dir*sSSize/2)+2*Dir and partSet==0 do
+ round=0
+ while round<=math.floor(sSSize/2)-2 and partSet==0 do
+ vector[coord2]=round
+ vector[coord3]=-round
+ while vector[coord3]<=round and partSet==0 do
+ partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+ vector[coord3]=vector[coord3]+1
+ end
+ while vector[coord2]>=-round and partSet==0 do
+ partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+ vector[coord2]=vector[coord2]-1
+ end
+ while vector[coord3]>-round and partSet==0 do
+ partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+ vector[coord3]=vector[coord3]-1
+ end
+ while vector[coord2]<=round and partSet==0 do
+ partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+ vector[coord2]=vector[coord2]+1
+ end
+ round=round+1
+ end
+ vector[coord1]=vector[coord1]-Dir
+ end
+ end
+ end
+ end
end
-- End function spiralSet().
@@ -553,37 +553,37 @@
-- Define at which position in the x-direction you're space station will end.
xMax=math.random(math.floor(xLength/2),math.floor(xLength/2)+xVar)
while x<xMax do
- -- The same for the y- and z-direction.
- y=math.random(-math.floor(yLength/2),-math.floor(yLength/2)+yVar)
- yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
- while y<yMax do
- yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
- z=math.random(-math.floor(zLength/2),-math.floor(zLength/2)+zVar)
- zMax=math.random(math.floor(zLength/2),math.floor(zLength/2)+zVar)
- while z<zMax do
- -- This loop choses a bodypart, which fits at position (x,y,z).
- -- If after the fifth time the part does still not fit we terminate the loop and set no part at postition (x,y,z).
- partSet=0
- counter=0
- while counter<5 and partSet==0 do
- -- This choses randomly a bodyPartIndex, which is the index used for the parts in the array bodyParts.
- tempBodyPartIndex=math.random(1,sSBodyParts)
- check=checkPart(tempBodyPartIndex,x,y,z)
- -- If check == 1, this means that the part fits there, so we put it there and break the while true loop, to go on.
- if check == 1 then
- -- This prints the chosen part at position (x*gridDim*sSScale,y*gridDim*sSScale,z*gridDim*sSScale).
- printModel(x,y,z,tempBodyPartIndex,false,1)
- -- This actualizes the grid array with the values of the array bodyParts at the position tempBodyPartIndex, which is our randomly chosen part.
- actualizeGrid(tempBodyPartIndex,x,y,z)
- partSet=1
- end
- counter=counter+1
- end
- z=z+1
- end
- y=y+1
- end
- x=x+1
+ -- The same for the y- and z-direction.
+ y=math.random(-math.floor(yLength/2),-math.floor(yLength/2)+yVar)
+ yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
+ while y<yMax do
+ yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
+ z=math.random(-math.floor(zLength/2),-math.floor(zLength/2)+zVar)
+ zMax=math.random(math.floor(zLength/2),math.floor(zLength/2)+zVar)
+ while z<zMax do
+ -- This loop choses a bodypart, which fits at position (x,y,z).
+ -- If after the fifth time the part does still not fit we terminate the loop and set no part at postition (x,y,z).
+ partSet=0
+ counter=0
+ while counter<5 and partSet==0 do
+ -- This choses randomly a bodyPartIndex, which is the index used for the parts in the array bodyParts.
+ tempBodyPartIndex=math.random(1,sSBodyParts)
+ check=checkPart(tempBodyPartIndex,x,y,z)
+ -- If check == 1, this means that the part fits there, so we put it there and break the while true loop, to go on.
+ if check == 1 then
+ -- This prints the chosen part at position (x*gridDim*sSScale,y*gridDim*sSScale,z*gridDim*sSScale).
+ printModel(x,y,z,tempBodyPartIndex,false,1)
+ -- This actualizes the grid array with the values of the array bodyParts at the position tempBodyPartIndex, which is our randomly chosen part.
+ actualizeGrid(tempBodyPartIndex,x,y,z)
+ partSet=1
+ end
+ counter=counter+1
+ end
+ z=z+1
+ end
+ y=y+1
+ end
+ x=x+1
end
-- End attach all bodyparts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -592,31 +592,31 @@
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Attach backParts, if there are some.
- spiralSet(0,0,1,1,backPartsIndex,backParts,false,1)
+ spiralSet(0,0,1,1,backPartsIndex,backParts,false,1)
-- End attach backParts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Attach frontParts, if there are.
- spiralSet(0,0,1,-1,frontPartsIndex,frontParts,false,1)
+ spiralSet(0,0,1,-1,frontPartsIndex,frontParts,false,1)
-- End attach frontParts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Attach parts on the left side of the space station.
- spiralSet(1,0,0,-1,leftSidePartsIndex,leftSideParts,true,1)
+ spiralSet(1,0,0,-1,leftSidePartsIndex,leftSideParts,true,1)
-- End attach left side parts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Attach parts on the right side of the space station.
- spiralSet(1,0,0,1,rightSidePartsIndex,rightSideParts,true,2)
+ spiralSet(1,0,0,1,rightSidePartsIndex,rightSideParts,true,2)
-- End attach right side parts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Attach parts on top of the space station.
- spiralSet(0,1,0,1,topPartsIndex,topParts,true,1)
+ spiralSet(0,1,0,1,topPartsIndex,topParts,true,1)
-- End attach top parts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -626,28 +626,28 @@
-- Attach all connectionparts.
-- This iterates through the whole grid array.
if connPartsIndex[0] ~= false then
- for x=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
- for y=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
- for z=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
- tempConnPartIndex=connPartsIndex[math.random(1,connParts)]
- -- This checks whether there has to be a connection part between (x,y,z) and (x+1,y,z) or not. First it checks if there is a part at (x,y,z) and
- -- then it checks if that part can have a connection into the positive x-direction, if it can, it checks if there is a part at (x+1,y,z) and
- -- if that part can have a connection into the negative x-direction, if both can, it prints the xml code to set a connection part.
- if grid[x][y][z][0]==1 and (grid[x][y][z][1]=="+" or grid[x][y][z][1]=="+-") and grid[x+1][y][z][0]==1 and (grid[x+1][y][z][1]=="-" or grid[x+1][y][z][1]=="+-") then
- -- This prints the connection part, the +1/2 is because the connection is set exactly in the middle of two gridpoints.
- printModel(x+1/2,y,z,tempConnPartIndex,false,1)
- end
- -- The same as in the x-direction, but for the y-direction.
- if grid[x][y][z][0]==1 and ( grid[x][y][z][2]=="+" or grid[x][y][z][2]=="+-" ) and grid[x][y+1][z][0]==1 and ( grid[x][y+1][z][2]=="-" or grid[x][y+1][z][2]=="+-" ) then
- printModel(x,y+1/2,z,tempConnPartIndex,false,2)
- end
- -- The same as in the x-direction, but for the z-direction.
- if grid[x][y][z][0]==1 and ( grid[x][y][z][3]=="+" or grid[x][y][z][3]=="+-" ) and grid[x][y][z+1][0]==1 and ( grid[x][y][z+1][3]=="-" or grid[x][y][z+1][3]=="+-" ) then
- printModel(x,y,z+1/2,tempConnPartIndex,false,3)
- end
- end
- end
- end
+ for x=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+ for y=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+ for z=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+ tempConnPartIndex=connPartsIndex[math.random(1,connParts)]
+ -- This checks whether there has to be a connection part between (x,y,z) and (x+1,y,z) or not. First it checks if there is a part at (x,y,z) and
+ -- then it checks if that part can have a connection into the positive x-direction, if it can, it checks if there is a part at (x+1,y,z) and
+ -- if that part can have a connection into the negative x-direction, if both can, it prints the xml code to set a connection part.
+ if grid[x][y][z][0]==1 and (grid[x][y][z][1]=="+" or grid[x][y][z][1]=="+-") and grid[x+1][y][z][0]==1 and (grid[x+1][y][z][1]=="-" or grid[x+1][y][z][1]=="+-") then
+ -- This prints the connection part, the +1/2 is because the connection is set exactly in the middle of two gridpoints.
+ printModel(x+1/2,y,z,tempConnPartIndex,false,1)
+ end
+ -- The same as in the x-direction, but for the y-direction.
+ if grid[x][y][z][0]==1 and ( grid[x][y][z][2]=="+" or grid[x][y][z][2]=="+-" ) and grid[x][y+1][z][0]==1 and ( grid[x][y+1][z][2]=="-" or grid[x][y+1][z][2]=="+-" ) then
+ printModel(x,y+1/2,z,tempConnPartIndex,false,2)
+ end
+ -- The same as in the x-direction, but for the z-direction.
+ if grid[x][y][z][0]==1 and ( grid[x][y][z][3]=="+" or grid[x][y][z][3]=="+-" ) and grid[x][y][z+1][0]==1 and ( grid[x][y][z+1][3]=="-" or grid[x][y][z+1][3]=="+-" ) then
+ printModel(x,y,z+1/2,tempConnPartIndex,false,3)
+ end
+ end
+ end
+ end
end
-- End attach all connectionparts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -670,7 +670,7 @@
-- This function is for the lazy guys, which do not care how the space station looks like, so I use some good standard values.
function createSpaceStation()
- createSpaceStationPar(0,4,1,2,1,6,1,100)
+ createSpaceStationPar(0,4,1,2,1,6,1,100)
end
-- End createSpaceStaion() function.
Modified: code/trunk/data/levels/includes/asteroidField.lua
===================================================================
--- code/trunk/data/levels/includes/asteroidField.lua 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/includes/asteroidField.lua 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,103 +1,101 @@
--[[ fog generator
generates fog
- posX, posY, posZ - position in space
- size - size of billboard
- brightness - [0,1] fog brightness
+ posX, posY, posZ - position in space
+ size - size of billboard
+ brightness - [0,1] fog brightness
--]]
function generateFog(posX, posY, posZ, size, brightness)
- print("<Billboard ")
- print("position = \"")
- print(posX) print(",")
- print(posY) print(",")
- print(posZ) print("\" ")
- print("colour=\"")
- print(brightness) print(",")
- print(brightness) print(",")
- print(brightness) print("\" ")
- print("material=\"Smoke/Smoke\" scale=")
- print(size)
- print(" />")
+ print("<Billboard ")
+ print("position = \"")
+ print(posX) print(",")
+ print(posY) print(",")
+ print(posZ) print("\" ")
+ print("colour=\"")
+ print(brightness) print(",")
+ print(brightness) print(",")
+ print(brightness) print("\" ")
+ print("material=\"Smoke/Smoke\" scale=")
+ print(size)
+ print(" />")
end
--[[ asteroid field generator
generates asteroid field
- posX, posY, posZ - position in space
- minSize, maxSize - size boundaries of each asteroid
- radius - size of the cube around position in space
- count - number of asteroids
- fog - enable fog 0/1
+ posX, posY, posZ - position in space
+ minSize, maxSize - size boundaries of each asteroid
+ radius - size of the cube around position in space
+ count - number of asteroids
+ fog - enable fog 0/1
--]]
function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count, fog)
- for i = 1, count, 1
- do
- size = (math.random() * (maxSize - minSize)) + minSize
- pX = (2 * math.random() * radius) - radius + posX
- pY = (2 * math.random() * radius) - radius + posY
- pZ = (2 * math.random() * radius) - radius + posZ
- print("<StaticEntity ")
-
- print("position = \"")
- print(pX) print(",")
- print(pY) print(",")
- print(pZ) print("\" ")
-
- print("scale = \"") print(size) print("\" ")
-
- print("collisionType = static linearDamping = 0.8 angularDamping = 1 ")
- print("collisiondamage = 1000 enablecollisiondamage = true>")
-
- print("<attached>")
- print("<Model mass=\"") print(size * 10) print("\" ")
- print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
- print("</attached>")
-
- print("<collisionShapes> ")
- print("<SphereCollisionShape radius=\"")
- print(size * 2.5) print("\" />")
- print("</collisionShapes>")
-
- print("</StaticEntity>")
-
- if fog == 1 and i % 5 == 0 then
- generateFog(pX, pY, pZ, radius*0.04, 0.2)
- end
- end
+ for i = 1, count, 1 do
+ size = (math.random() * (maxSize - minSize)) + minSize
+ pX = (2 * math.random() * radius) - radius + posX
+ pY = (2 * math.random() * radius) - radius + posY
+ pZ = (2 * math.random() * radius) - radius + posZ
+ print("<StaticEntity ")
+
+ print("position = \"")
+ print(pX) print(",")
+ print(pY) print(",")
+ print(pZ) print("\" ")
+
+ print("scale = \"") print(size) print("\" ")
+
+ print("collisionType = static linearDamping = 0.8 angularDamping = 1 ")
+ print("collisiondamage = 1000 enablecollisiondamage = true>")
+
+ print("<attached>")
+ print("<Model mass=\"") print(size * 10) print("\" ")
+ print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
+ print("</attached>")
+
+ print("<collisionShapes> ")
+ print("<SphereCollisionShape radius=\"")
+ print(size * 2.5) print("\" />")
+ print("</collisionShapes>")
+
+ print("</StaticEntity>")
+
+ if fog == 1 and i % 5 == 0 then
+ generateFog(pX, pY, pZ, radius*0.04, 0.2)
+ end
+ end
end
--[[ asteroid belt generator
generates asteroid belt
- posX, posY, posZ - position in space
- yaw, pitch - rotation
- minSize, maxSize - size boundaries of each asteroid
- radius0, radius1 - inner/outer radius
- count - number of asteroids
- fog - enable fog 0/1
+ posX, posY, posZ - position in space
+ yaw, pitch - rotation
+ minSize, maxSize - size boundaries of each asteroid
+ radius0, radius1 - inner/outer radius
+ count - number of asteroids
+ fog - enable fog 0/1
--]]
function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog)
- dPhi = (2 * math.pi) / segments
- width = math.abs(radius1 - radius0)
- radius = (radius1 + radius0) / 2
- segmentCount = count / segments
-
- print("<StaticEntity collisionType=static yaw=") print(yaw)
- print(" pitch=") print(pitch)
-
- print(" position = \"")
- print(centerX) print(",")
- print(centerY) print(",")
- print(centerZ) print("\"")
- print(">")
-
- print("<attached>")
-
- for i = 0, segments - 1, 1
- do
- asteroidField((radius * math.cos(i * dPhi)),
- (radius * math.sin(i * dPhi)),
- 0, minSize, maxSize, width, segmentCount, fog)
- end
-
- print("</attached>")
- print("</StaticEntity>")
+ dPhi = (2 * math.pi) / segments
+ width = math.abs(radius1 - radius0)
+ radius = (radius1 + radius0) / 2
+ segmentCount = count / segments
+
+ print("<StaticEntity collisionType=static yaw=") print(yaw)
+ print(" pitch=") print(pitch)
+
+ print(" position = \"")
+ print(centerX) print(",")
+ print(centerY) print(",")
+ print(centerZ) print("\"")
+ print(">")
+
+ print("<attached>")
+
+ for i = 0, segments - 1, 1 do
+ asteroidField((radius * math.cos(i * dPhi)),
+ (radius * math.sin(i * dPhi)),
+ 0, minSize, maxSize, width, segmentCount, fog)
+ end
+
+ print("</attached>")
+ print("</StaticEntity>")
end
Property changes on: code/trunk/data/levels/includes/asteroidField.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/levels/includes/pickups.oxi
===================================================================
--- code/trunk/data/levels/includes/pickups.oxi 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/includes/pickups.oxi 2012-08-30 21:08:17 UTC (rev 9348)
@@ -2,245 +2,207 @@
<!-- Shield pickups -->
<PickupRepresentation
+ name = "smallshieldpickup"
pickupName = "Small Shield Pickup"
pickupDescription = "Gives you a small-sized shield for 30 seconds."
inventoryRepresentation = "SmallShield"
spawnerTemplate = "smallshieldpickupRepresentation"
->
- <pickup>
- <ShieldPickup template=smallshieldpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "mediumshieldpickup"
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
+ name = "hugeshieldpickup"
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
+ name = "smallhealthpickup"
pickupName = "Small Health Boost"
pickupDescription = "Adds a small amout of health to the ship."
inventoryRepresentation = "SmallHealth"
spawnerTemplate = "smallhealthpickupRepresentation"
->
- <pickup>
- <HealthPickup template=smallhealthpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "mediumhealthpickup"
pickupName = "Medium Health Boost"
pickupDescription = "Adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
->
- <pickup>
- <HealthPickup template=mediumhealthpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "hugehealthpickup"
pickupName = "Huge Health Boost"
pickupDescription = "Adds a huge amout of health to the ship."
spawnerTemplate = "hugehealthpickupRepresentation"
inventoryRepresentation = "HugeHealth"
->
- <pickup>
- <HealthPickup template=hugehealthpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "crazyhealthpickup"
pickupName = "Crazy Madness Health Boost"
pickupDescription = "Adds a crazy amout of health to the ship."
spawnerTemplate = "crazyhealthpickupRepresentation"
inventoryRepresentation = "CrazyMadnessHealth"
->
- <pickup>
- <HealthPickup template=crazyhealthpickup />
- </pickup>
-</PickupRepresentation>
+/>
<!-- Meta pickups -->
<PickupRepresentation
+ name = "use"
pickupName = "Use Pickup"
pickupDescription = "Uses all pickups you have."
spawnerTemplate = "usepickupRepresentation"
inventoryRepresentation = "usePickup"
->
- <pickup>
- <MetaPickup metaType="use" />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "drop"
pickupName = "Drop Pickup"
pickupDescription = "Drops all pickups you have."
spawnerTemplate = "droppickupRepresentation"
inventoryRepresentation = "dropPickup"
->
- <pickup>
- <MetaPickup metaType="drop" />
- </pickup>
-</PickupRepresentation>
+/>
<!-- Speed pickups -->
<PickupRepresentation
+ name = "smallspeedpickup"
pickupName = "Small Speed Boost"
pickupDescription = "Multiplies Speed of the Ship by a small amount."
spawnerTemplate = "smallspeedpickupRepresentation"
inventoryRepresentation = "SmallSpeed"
->
- <pickup>
- <SpeedPickup template=smallspeedpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "mediumspeedpickup"
pickupName = "Medium Speed Boost"
pickupDescription = "Multiplies Speed of the Ship by a bigger amount."
spawnerTemplate = "mediumspeedpickupRepresentation"
inventoryRepresentation = "MediumSpeed"
->
- <pickup>
- <SpeedPickup template=mediumspeedpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "hugespeedpickup"
pickupName = "Huge Speed Boost"
pickupDescription = "Multiplies Speed of the Ship by a huge amount."
spawnerTemplate = "hugespeedpickupRepresentation"
inventoryRepresentation = "HugeSpeed"
->
- <pickup>
- <SpeedPickup template=hugespeedpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "smalljumppickup"
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 />
- </pickup>
-</PickupRepresentation>
+/>
<!-- Invisible pickups -->
<PickupRepresentation
+ name = "smallinvisiblepickup"
pickupName = "Small Invisibility"
pickupDescription = "Makes you invisible for 5 seconds."
spawnerTemplate = "smallinvisiblepickupRepresentation"
inventoryRepresentation = "SmallInvisible"
->
- <pickup>
- <InvisiblePickup template=smallinvisiblepickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "mediuminvisiblepickup"
pickupName = "Medium Invisibility"
pickupDescription = "Makes you invisible for 10 seconds."
spawnerTemplate = "mediuminvisiblepickupRepresentation"
inventoryRepresentation = "MediumInvisible"
->
- <pickup>
- <InvisiblePickup template=mediuminvisiblepickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "hugeinvisiblepickup"
pickupName = "Huge Invisibility"
pickupDescription = "Makes you invisible for 20 seconds."
spawnerTemplate = "hugeinvisiblepickupRepresentation"
inventoryRepresentation = "HugeInvisible"
->
- <pickup>
- <InvisiblePickup template=hugeinvisiblepickup />
- </pickup>
-</PickupRepresentation>
+/>
<!-- Pickup Collection pickups -->
<PickupRepresentation
+ name = "triplehealthspeedinvisibilitypickup"
pickupName = "Tri Pickup"
pickupDescription = "Adds health, speed and invisibility."
spawnerTemplate = "triplehealthspeedinvisibilitypickupRepresentation"
->
- <pickup>
- <PickupCollection template=triplehealthspeedinvisibilitypickup />
- </pickup>
-</PickupRepresentation>
+/>
<!-- Drone Pickup -->
<PickupRepresentation
+ name = "dronepickup"
pickupName = "Drone Pickup"
pickupDescription = "Adds a Drone to the Player's Spaceship"
spawnerTemplate = "dronepickupRepresentation"
->
- <pickup>
- <DronePickup template=dronepickup />
- </pickup>
-</PickupRepresentation>
+/>
+<!-- DamageBoost Pickup -->
+
+<PickupRepresentation
+ name = "smalldamageboostpickup"
+ pickupName = "Small DamageBoost Pickup"
+ pickupDescription = "Multiplies the ship damage with 2."
+ spawnerTemplate = "smalldamageboostpickupRepresentation"
+ inventoryRepresentation = "SmallDamageBoost"
+/>
+
+<PickupRepresentation
+ name = "mediumdamageboostpickup"
+ pickupName = "Medium DamageBoost Pickup"
+ pickupDescription = "Multiplies the ship damage with 5."
+ spawnerTemplate = "mediumdamageboostpickupRepresentation"
+ inventoryRepresentation = "MediumDamageBoost"
+/>
+
+<PickupRepresentation
+ name = "largedamageboostpickup"
+ pickupName = "Large DamageBoost Pickup"
+ pickupDescription = "Multiplies the ship damage with 7."
+ spawnerTemplate = "largedamageboostpickupRepresentation"
+ inventoryRepresentation = "LargeDamageBoost"
+/>
+
<!-- Shrink Pickup -->
<PickupRepresentation
+ name = "smallshrinkpickup"
pickupName = "Small Shrink"
pickupDescription = "Shrinks the Ship by a bit"
spawnerTemplate = "smallshrinkpickupRepresentation"
inventoryRepresentation = "SmallShrink"
->
- <pickup>
- <ShrinkPickup template=smallshrinkpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "mediumshrinkpickup"
pickupName = "Medium Shrink"
pickupDescription = "Shrinks the Ship"
spawnerTemplate = "mediumshrinkpickupRepresentation"
inventoryRepresentation = "MediumShrink"
->
- <pickup>
- <ShrinkPickup template=mediumshrinkpickup />
- </pickup>
-</PickupRepresentation>
+/>
<PickupRepresentation
+ name = "hugeshrinkpickup"
pickupName = "Huge Shrink"
pickupDescription = "Shrinks the Ship considerably"
spawnerTemplate = "hugeshrinkpickupRepresentation"
inventoryRepresentation = "HugeShrink"
->
- <pickup>
- <ShrinkPickup template=hugeshrinkpickup />
- </pickup>
-</PickupRepresentation>
-
+/>
Copied: code/trunk/data/levels/includes/towerWeaponSettings.oxi (from rev 9347, code/branches/presentation2012merge/data/levels/includes/towerWeaponSettings.oxi)
===================================================================
--- code/trunk/data/levels/includes/towerWeaponSettings.oxi (rev 0)
+++ code/trunk/data/levels/includes/towerWeaponSettings.oxi 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,55 @@
+ <weaponslots>
+ <WeaponSlot position="-15.0,-1.5,0" />
+ <WeaponSlot position=" 15.0,-1.5,0" />
+ <WeaponSlot position=" 0, 0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ <WeaponSet firemode=3 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+ </links>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,200" scale=1/>
+ <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,200" scale=1 />
+ <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=10 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=314.159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ </Weapon>
+
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ <!--Weapon>
+ <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
+ </Weapon-->
+ </WeaponPack>
+ </weapons>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsFPS.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFPS.oxi 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/includes/weaponSettingsFPS.oxi 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,8 +1,10 @@
<weaponslots>
<WeaponSlot position="0,0,0" yaw=0 pitch=0 roll=0 />
- <!-- <WeaponSlot position="-0.5,0.8,2.5" yaw=0 pitch=0 roll=0 />
+<!--
+ <WeaponSlot position="-0.5,0.8,2.5" yaw=0 pitch=0 roll=0 />
<WeaponSlot position="15,-1.5,-25" yaw=0 pitch=0 roll=0 />
- <WeaponSlot position="0,0,-45" yaw=0 pitch=0 roll=0 /> -->
+ <WeaponSlot position="0,0,-45" yaw=0 pitch=0 roll=0 />
+-->
</weaponslots>
<weaponsets>
<WeaponSet firemode=0 />
@@ -10,14 +12,14 @@
</weaponsets>
<weapons>
<WeaponPack firemode=0>
- <links>
+ <links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
<DefaultWeaponmodeLink firemode=2 weaponmode=2 />
</links>
- <Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.7, -0.3, -3" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
+ <Weapon>
+ <HsW01 mode=0 munitionpershot=0 delay=0.0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.7, -0.3, -3" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
</Weapon>
<LaserGun
position="0,0,0"
@@ -27,7 +29,7 @@
speed="1000"
unlimitedMunition=true
/>
- <!-- <LaserGun
+ <!--LaserGun
position="0,0,0"
munitionType="LaserGunMunition"
bulletLoadingTime="0.2"
@@ -44,6 +46,6 @@
magazineLoadingTime="3"
speed="600"
unlimitedMunition=true
- /> -->
+ /-->
</WeaponPack>
</weapons>
Property changes on: code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/levels/lastManStanding.oxw
===================================================================
--- code/trunk/data/levels/lastManStanding.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/lastManStanding.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -32,7 +32,7 @@
include("includes/pickups.oxi")
?>
-<!----- Spawnpoints
+<!----- Spawnpoints
<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 team=0 position="-1150,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
<SpawnPoint team=0 position="1150,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
@@ -43,17 +43,13 @@
<Bot />
<!-- ------------ middle asteroid -------------- -->
- <StaticEntity position="0,0,0" collisionType=static>
+ <StaticEntity position="0,0,0" collisionType=static>
<attached>
<MovableEntity position="0,20,0" rotationrate="-4.5" rotationaxis="0,1,0" >
<attached>
<Model position="0,0,0" scale=140 mesh="asteroid_UV.mesh" shadow=true />
<Model position="-160,40,28.4" scale=1 mesh="sphere.mesh" /><!--EasterEgg indicator-->
- <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
- <pickup>
- <InvisiblePickup template=hugeinvisiblepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugeinvisiblepickup position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15" /><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
</attached>
</MovableEntity>
</attached>
@@ -78,7 +74,7 @@
<StaticEntity position="<?lua print(y) ?>,0,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="<?lua print(j * 2) ?>,100,<?lua print(j * 2) ?>" position = "0,0,0" />
@@ -88,7 +84,7 @@
<StaticEntity position="<?lua print(y) ?>,100,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i+3,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -98,7 +94,7 @@
<StaticEntity position="<?lua print(y) ?>,200,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*5,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -108,7 +104,7 @@
<StaticEntity position="<?lua print(y) ?>,-100,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*13+1,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -118,7 +114,7 @@
<StaticEntity position="<?lua print(y) ?>,-200,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*17,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -129,7 +125,7 @@
<StaticEntity position="<?lua print(y) ?>,300,<?lua print(z) ?>" scale="<?lua print(j * 2.1) ?>" pitch="90" roll="180" yaw="<?lua print(-90+i*360/max) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=25 mesh="ast6.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="50,140,30" position="0,0,0"/>
Modified: code/trunk/data/levels/lastTeamStanding.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStanding.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/lastTeamStanding.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -17,7 +17,7 @@
<Level
name = "Last Team Standing"
description = "testmap for gametype last team standing"
- gametype = "TeamGametype"
+ gametype = "LastTeamStanding"
>
<templates>
<Template link=lodtemplate_default />
@@ -26,9 +26,8 @@
<Scene
ambientlight = "0.8, 0.8, 0.8"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
- <?lua include("includes/notifications.oxi") ?>
<?lua
include("includes/pickups.oxi")
@@ -47,11 +46,7 @@
</collisionShapes>
</StaticEntity>
- <PickupSpawner position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
- <pickup>
- <InvisiblePickup template=hugeinvisiblepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugeinvisiblepickup position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10" /><!--EasterEgg-->
<StaticEntity position="-160,60,28.4"><!--EasterEgg-Indicator-->
<attached>
<Model position="0,0,0" scale=1 mesh="sphere.mesh" />
@@ -73,7 +68,7 @@
<StaticEntity position="<?lua print(y) ?>,0,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="<?lua print(j * 2) ?>,100,<?lua print(j * 2) ?>" position = "0,0,0" />
@@ -83,7 +78,7 @@
<StaticEntity position="<?lua print(y) ?>,100,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i+3,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -93,7 +88,7 @@
<StaticEntity position="<?lua print(y) ?>,200,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*5,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -103,7 +98,7 @@
<StaticEntity position="<?lua print(y) ?>,-100,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*13+1,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -113,7 +108,7 @@
<StaticEntity position="<?lua print(y) ?>,-200,<?lua print(z) ?>" scale="<?lua print(j * 2) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*17,6) + 1) ?>.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="45,100,45" position = "0,0,0" />
@@ -124,7 +119,7 @@
<StaticEntity position="<?lua print(y) ?>,300,<?lua print(z) ?>" scale="<?lua print(j * 2.1) ?>" pitch="90" roll="180" yaw="<?lua print(-90+i*360/max) ?>" collisionType=static >
<attached>
<Model position="0,0,0" scale=25 mesh="ast6.mesh">
- </Model>
+ </Model>
</attached>
<collisionShapes>
<BoxCollisionShape halfExtents="50,140,30" position="0,0,0"/>
Modified: code/trunk/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStandingII.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/lastTeamStandingII.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -24,7 +24,7 @@
<Scene
ambientlight = "0.8, 0.8, 0.8"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<!-- TODO:
1. make collisionshapes bulletproof: -> attach movable entity with dynamic collisionshape within a static collisionshape
Modified: code/trunk/data/levels/missionOne.oxw
===================================================================
--- code/trunk/data/levels/missionOne.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/missionOne.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1152,11 +1152,7 @@
<!-- @Objects: Pickup - find better place !! -->
- <PickupSpawner position="-48650,700,100" triggerDistance="70" respawnTime="30" maxSpawnedItems="1">
- <pickup>
- <ShieldPickup template=hugeshieldpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugeshieldpickup position="-48650,700,100" triggerDistance="70" respawnTime="30" maxSpawnedItems="1" />
<DistanceTrigger name="pickup" position="-48650,700,100" target="Pawn" distance=60 stayActive="true" delay=0 />
Property changes on: code/trunk/data/levels/missionOne.oxw
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/levels/notifications.oxw
===================================================================
--- code/trunk/data/levels/notifications.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/notifications.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -20,7 +20,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/old/CuboidSpaceStation.oxw
===================================================================
--- code/trunk/data/levels/old/CuboidSpaceStation.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/old/CuboidSpaceStation.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,25 +1,25 @@
<?lua
- include("HUDTemplates3.oxo")
+ include("HUDTemplates3.oxo")
?>
<?lua
- include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipAssff.oxt")
?>
<Level
- name = "SpaceStation test Space!"
- description = "All the new SpaceStations are created here!"
+ name = "SpaceStation test Space!"
+ description = "All the new SpaceStations are created here!"
>
- <Scene
- ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/Starbox"
- >
+ <Scene
+ ambientlight = "0.5, 0.5, 0.5"
+ skybox = "Orxonox/Starbox"
+ >
<!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<?lua
- dofile("includes/CuboidSpaceStation.lua")
+ dofile("includes/CuboidSpaceStation.lua")
?>
<!-- The following examples insert some space station in various ways, so I guess you will understand how to use my .lua file and the functions of it.
@@ -28,7 +28,7 @@
<!-- Here I add a space station at position 0,0,0 without velocity and no rotation.
--->
<?lua
- createSpaceStation()
+ createSpaceStation()
?>
@@ -36,11 +36,11 @@
<!-- Here I add a space station at position 0,0,-5000 without velocity and no rotation.
--->
<PositionableEntity scale=1 position="0,0,-5000">
- <attached>
- <?lua
- createSpaceStation()
- ?>
- </attached>
+ <attached>
+ <?lua
+ createSpaceStation()
+ ?>
+ </attached>
</PositionableEntity>
@@ -48,11 +48,11 @@
<!-- Here I add a space station at position 5000,0,0 with velocity 50,0,0 and a rotation so that the space station faces into the positive x-axis.
--->
<MovableEntity scale=1 position="5000,0,0" velocity="50,0,0" yaw=-90>
- <attached>
- <?lua
- createSpaceStation()
- ?>
- </attached>
+ <attached>
+ <?lua
+ createSpaceStation()
+ ?>
+ </attached>
</MovableEntity>
@@ -60,11 +60,11 @@
<!-- Here I add a space station at position -5000,0,0 without velocity but rotation around his own y-axis.
--->
<MovableEntity scale=1 position="-5000,0,0" rotationaxis="0,1,0" rotationrate=5>
- <attached>
- <?lua
- createSpaceStation()
- ?>
- </attached>
+ <attached>
+ <?lua
+ createSpaceStation()
+ ?>
+ </attached>
</MovableEntity>
@@ -76,16 +76,16 @@
---- Then I rotate also the second MovableEntity around his own z-axis, so the space station rotates also around its own axis.
--->
<MovableEntity scale=1 position="0,0,0" rotationaxis="0,1,0" rotationrate=3>
- <attached>
- <MovableEntity scale=1 position="10000,0,0" rotationaxis="0,0,1" rotationrate=2>
- <attached>
- <?lua
- -- Here I use the createSpaceStationPar(...) function, which has 8 arguments, see the .lua file at the top to understand them.
- createSpaceStationPar(0,2,1,2,1,2,1,50)
- ?>
- </attached>
- </MovableEntity>
- </attached>
+ <attached>
+ <MovableEntity scale=1 position="10000,0,0" rotationaxis="0,0,1" rotationrate=2>
+ <attached>
+ <?lua
+ -- Here I use the createSpaceStationPar(...) function, which has 8 arguments, see the .lua file at the top to understand them.
+ createSpaceStationPar(0,2,1,2,1,2,1,50)
+ ?>
+ </attached>
+ </MovableEntity>
+ </attached>
</MovableEntity>
@@ -94,7 +94,7 @@
- <ParticleSpawner position="0,0,0" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
+ <ParticleSpawner position="0,0,0" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
<events>
<spawn>
<EventTrigger delay=1>
Modified: code/trunk/data/levels/old/presentationPhysics.oxw
===================================================================
--- code/trunk/data/levels/old/presentationPhysics.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/old/presentationPhysics.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -11,7 +11,7 @@
>
<Scene
ambientlight = "0.8, 0.8, 0.8"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
gravity = "0, -10, 0"
>
<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" />
Modified: code/trunk/data/levels/old/princessAeryn.oxw
===================================================================
--- code/trunk/data/levels/old/princessAeryn.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/old/princessAeryn.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -14,7 +14,7 @@
>
<Scene
ambientlight = "0.3, 0.3, 0.3"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
Modified: code/trunk/data/levels/pickups.oxw
===================================================================
--- code/trunk/data/levels/pickups.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/pickups.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -36,176 +36,145 @@
<!-- Shield pickups -->
- <PickupSpawner position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <ShieldPickup template=smallshieldpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smallshieldpickup position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediumshieldpickup position="0,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugeshieldpickup position="25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
- <PickupSpawner position="0,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <ShieldPickup template=mediumshieldpickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <ShieldPickup template=hugeshieldpickup />
- </pickup>
- </PickupSpawner>
-
<!-- Health pickups -->
- <PickupSpawner position="-25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <HealthPickup template=smallhealthpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smallhealthpickup position="-25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediumhealthpickup position="0,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugehealthpickup position="25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=crazyhealthpickup position="50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
- <PickupSpawner position="0,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <HealthPickup template=mediumhealthpickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <HealthPickup template=hugehealthpickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <HealthPickup template=crazyhealthpickup />
- </pickup>
- </PickupSpawner>
-
<!-- Speed pickups -->
- <PickupSpawner position="-25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=smallspeedpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smallspeedpickup position="-25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+ <PickupSpawner pickup=mediumspeedpickup position="0,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+ <PickupSpawner pickup=hugespeedpickup position="25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+ <PickupSpawner pickup=smalljumppickup position="50,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
- <PickupSpawner position="0,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=mediumspeedpickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=hugespeedpickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="50,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=smalljumppickup />
- </pickup>
- </PickupSpawner>
-
<!-- Invisible pickups -->
- <PickupSpawner position="-25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <InvisiblePickup template=smallinvisiblepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smallinvisiblepickup position="-25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediuminvisiblepickup position="0,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugeinvisiblepickup position="25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
- <PickupSpawner position="0,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <InvisiblePickup template=mediuminvisiblepickup />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <InvisiblePickup template=hugeinvisiblepickup />
- </pickup>
- </PickupSpawner>
-
<!-- Meta pickups -->
- <PickupSpawner position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <MetaPickup metaType="use" />
- </pickup>
- </PickupSpawner>
+ <Template name=usemetapickup baseclass=MetaPickup>
+ <MetaPickup representation="use" metaType="use" />
+ </Template>
+
+ <Template name=dropmetapickup baseclass=MetaPickup>
+ <MetaPickup representation="drop" metaType="drop" />
+ </Template>
+
+ <Template name=destroymetapickup baseclass=MetaPickup>
+ <MetaPickup metaType="destroy" />
+ </Template>
+
+ <Template name=destroycarriermetapickup baseclass=MetaPickup>
+ <MetaPickup metaType="destroyCarrier" />
+ </Template>
+
+ <PickupSpawner pickup=usemetapickup position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=dropmetapickup position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=destroymetapickup position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=destroycarriermetapickup position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
- <PickupSpawner position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <MetaPickup metaType="drop" />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <MetaPickup metaType="destroy" />
- </pickup>
- </PickupSpawner>
-
- <PickupSpawner position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <MetaPickup metaType="destroyCarrier" />
- </pickup>
- </PickupSpawner>
-
<!-- Pickup Collection pickups -->
- <PickupSpawner position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <PickupCollection template=triplehealthspeedinvisibilitypickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=triplehealthspeedinvisibilitypickup position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
<!-- Drone pickup -->
- <PickupSpawner position="-50,50,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <DronePickup template=dronepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=dronepickup position="-50,50,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <!-- DamageBoost pickup -->
+
+ <PickupSpawner pickup=smalldamageboostpickup position="-50,75,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediumdamageboostpickup position="-50,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=largedamageboostpickup position="-50,125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+
<!-- Other pickups -->
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
+ name = "MediumHealth"
pickupName = "Medium Health Pack"
pickupDescription = "Once used adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
- >
- <pickup>
- <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
- </pickup>
- </PickupRepresentation>
+ />
- <PickupSpawner position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
- </pickup>
- </PickupSpawner>
+ <Template name=continuoushealthpickup baseclass=HealthPickup>
+ <HealthPickup representation="MediumHealth" health=500 activationType=immediate healthRate=10 durationType=continuous />
+ </Template>
+
+ <PickupSpawner pickup=continuoushealthpickup position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
- <PickupSpawner position="-25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <ShrinkPickup template ="smallshrinkpickup"/>
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup="smallshrinkpickup" position="-25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+ <PickupSpawner pickup="mediumshrinkpickup" position="0,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+ <PickupSpawner pickup="hugeshrinkpickup" position="25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+
+ <!-- @Objects: 4 boxes (uncontrolled pawns) -->
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
- <PickupSpawner position="0,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <ShrinkPickup template ="mediumshrinkpickup"/>
- </pickup>
- </PickupSpawner>
+ <Pawn team=1 health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
- <PickupSpawner position="25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <ShrinkPickup template ="hugeshrinkpickup"/>
- </pickup>
- </PickupSpawner>
+ <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+ <Pawn health=30 position="0,400,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
<!--StaticEntity position="0,-200,0" direction="0,-1,0" collisionType=static mass=500 friction=0.01 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
Modified: code/trunk/data/levels/pirateAttack.oxw
===================================================================
--- code/trunk/data/levels/pirateAttack.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/pirateAttack.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -38,7 +38,7 @@
<Scene
ambientlight = "0.3, 0.3, 0.3"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
Modified: code/trunk/data/levels/planets.oxw
===================================================================
--- code/trunk/data/levels/planets.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/planets.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -20,7 +20,7 @@
<Scene
ambientlight = "0.8, 0.8, 0.8"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<WorldAmbientSound
Modified: code/trunk/data/levels/pong.oxw
===================================================================
--- code/trunk/data/levels/pong.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/pong.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -56,13 +56,12 @@
</templates>
<?lua include("includes/notifications.oxi") ?>
- <WorldAmbientSound source="Ganymede.ogg" playOnLoad=true looping=true />
-
+ <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
<PongBot />
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
@@ -91,13 +90,15 @@
<ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
<ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
- <WorldSound name="scoreSound" position="0,0,0" source="sounds/pong_score.wav" >
+<!-- TODO: Create a Pong Score Sound and include it here.
+This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
+ <!--WorldSound name="scoreSound" position="0,0,0" source="ambient/default/Earth.ogg" >
<events>
<play>
<EventListener event=pongcenter />
</play>
</events>
- </WorldSound>
+ </WorldSound-->
<?lua
for i = 1, 15, 1 do
Modified: code/trunk/data/levels/portals.oxw
===================================================================
--- code/trunk/data/levels/portals.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/portals.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,13 +22,13 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<Template name=PortalDefault>
<PortalEndPoint>
<attached>
- <Billboard material="Portals/Default" />
+ <Model mesh="Spacegate.mesh" yaw="90"/>
</attached>
</PortalEndPoint>
</Template>
@@ -38,11 +38,7 @@
<PortalLink fromID="1" toID="2" />
<PortalLink fromID="2" toID="1" />
- <!--PickupSpawner position="-200,0,0" triggerDistance="10" respawnTime="10" maxSpawnedItems="10">
- <pickup>
- <DronePickup template=dronepickup />
- </pickup>
- </PickupSpawner-->
+ <!--PickupSpawner pickup=dronepickup position="-200,0,0" triggerDistance="10" respawnTime="10" maxSpawnedItems="10" /-->
<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" />
Modified: code/trunk/data/levels/presentation09.oxw
===================================================================
--- code/trunk/data/levels/presentation09.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentation09.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -21,7 +21,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/presentation09b.oxw
===================================================================
--- code/trunk/data/levels/presentation09b.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentation09b.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -25,7 +25,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen2"
+ skybox = "Orxonox/skyBoxSomeNebula"
>
<?lua
@@ -93,36 +93,25 @@
</controller>
</SpaceShip>
- <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <SpeedPickup template=smalljumppickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smalljumppickup position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
+ name = "MediumHealth"
pickupName = "Medium Health Pack"
pickupDescription = "Once used adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
- >
- <pickup>
- <HealthPickup health=100 activationType="onUse" durationType="once" />
- </pickup>
- </PickupRepresentation>
+ />
- <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <HealthPickup health=100 activationType=onUse durationType=once />
- </pickup>
- </PickupSpawner>
+ <Template name=onusehealthpickup baseclass=HealthPickup>
+ <HealthPickup representation="MediumHealth" health=100 activationType=onUse durationType=once />
+ </Template>
- <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
- <pickup>
- <HealthPickup template=mediumhealthpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=onusehealthpickup position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+ <PickupSpawner pickup=mediumhealthpickup position="2300, 4300, 2400" respawnTime="5" triggerDistance="20" />
+
<Billboard position="-2500, 2400, 1500" material="Examples/Flare" />
<EventDispatcher>
<targets>
Modified: code/trunk/data/levels/presentationDM.oxw
===================================================================
--- code/trunk/data/levels/presentationDM.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationDM.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -23,7 +23,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/presentationFS10.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationFS10.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -101,67 +101,39 @@
</SpaceShip>
<?lua end ?>
- <PickupSpawner position="500,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <DronePickup template=dronepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=dronepickup position="500,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<!-- Shield pickups -->
- <PickupSpawner position="-25,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <ShieldPickup template=hugeshieldpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugeshieldpickup position="-25,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<!-- Health pickups -->
- <PickupSpawner position="0,-75,-500" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
- <pickup>
- <HealthPickup template=hugehealthpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugehealthpickup position="0,-75,-500" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
<!-- Speed pickups -->
- <PickupSpawner position="25,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=hugespeedpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugespeedpickup position="25,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+ <PickupSpawner pickup=smalljumppickup position="50,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
- <PickupSpawner position="50,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
- <pickup>
- <SpeedPickup template=smalljumppickup />
- </pickup>
- </PickupSpawner>
-
<!-- Invisible pickups -->
- <PickupSpawner position="0,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
- <pickup>
- <InvisiblePickup template=hugeinvisiblepickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=hugeinvisiblepickup position="0,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
+ name = "MediumHealth"
pickupName = "Medium Health Pack"
pickupDescription = "Once used adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
- >
- <pickup>
- <HealthPickup health=50 activationType="onUse" durationType="once" />
- </pickup>
- </PickupRepresentation>
+ />
- <PickupSpawner position="25,-75,-500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <HealthPickup health=50 activationType=onUse durationType=once />
- </pickup>
- </PickupSpawner>
+ <Template name=onusehealthpickup baseclass=HealthPickup>
+ <HealthPickup representation="MediumHealth" health=50 activationType=onUse durationType=once />
+ </Template>
+ <PickupSpawner pickup=onusehealthpickup position="25,-75,-500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+
</Scene>
</Level>
Modified: code/trunk/data/levels/presentationFS102.oxw
===================================================================
--- code/trunk/data/levels/presentationFS102.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationFS102.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
<Scene
ambientlight = "0.1, 0.1, 0.1"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
gravity = "0,-1000,0"
negativeWorldRange = "-100000, -100000, -100000"
positiveWorldRange = " 100000, 100000, 100000"
Modified: code/trunk/data/levels/presentationFS10Ed.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10Ed.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationFS10Ed.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
<Scene
ambientlight = "0.1, 0.1, 0.1"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
gravity = "0,-1000,0"
negativeWorldRange = "-100000, -100000, -100000"
positiveWorldRange = " 100000, 100000, 100000"
@@ -38,7 +38,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="25,25,25" />
</collisionShapes>
</Pawn>
-
+
<Pawn health=100 position="0,-35,0" direction="0,-1,0" collisionType=dynamic mass=100000>
<attached>
<Model position="0,0,0" mesh="crate.mesh" scale3D="5,5,5" />
@@ -47,7 +47,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="25,25,25" />
</collisionShapes>
</Pawn>
-
+
<StaticEntity position="0,-50,0" direction="0,-1,0" collisionType=static mass=100000 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="100,100,10" />
@@ -65,7 +65,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="100,100,10" />
</collisionShapes>
</StaticEntity>
-
+
<StaticEntity position="600,-20,0" direction="0,-1,0" collisionType=static mass=100000 >
<attached>
<Model position="0,0,0" mesh="cube_green.mesh" scale3D="100,100,10" />
@@ -83,7 +83,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="100,100,10" />
</collisionShapes>
</StaticEntity>
-
+
<StaticEntity position="600,40,250" direction="0,-1,0" collisionType=static mass=100000 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="100,100,10" />
@@ -92,8 +92,8 @@
<BoxCollisionShape position="0,0,0" halfExtents="100,100,10" />
</collisionShapes>
</StaticEntity>
-
-
+
+
<StaticEntity position="6000,0,10250" direction="0,0,0" collisionType=static mass=100000 >
<attached>
<Model position="0,0,0" mesh="cube_green.mesh" scale3D="10000,10,10000" />
@@ -102,7 +102,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="10000,10,10000" />
</collisionShapes>
</StaticEntity>
-
+
<Pawn health=100 position="530,70,1450" direction="-1,0,0" collisionType=dynamic mass=1 >
<attached>
<Model position="0,0,0" mesh="cube_red.mesh" scale3D="60,60,10" />
@@ -111,7 +111,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="60,60,10" />
</collisionShapes>
</Pawn>
-
+
<Pawn health=100 position="670,70,1450" direction="-1,0,0" collisionType=dynamic mass=1 >
<attached>
<Model position="0,0,0" mesh="cube_red.mesh" scale3D="60,60,10" />
@@ -120,7 +120,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="60,60,10" />
</collisionShapes>
</Pawn>
-
+
<Pawn health=100 position="600,70,1500" direction="0,0,-1" collisionType=dynamic mass=1 >
<attached>
<Model position="0,0,0" mesh="cube_red.mesh" scale3D="60,60,10" />
@@ -129,7 +129,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="60,60,10" />
</collisionShapes>
</Pawn>
-
+
<Pawn health=100 position="600,150,1450" direction="0,-1,0" collisionType=dynamic mass=1 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="90,80,10" />
@@ -138,7 +138,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="90,80,10" />
</collisionShapes>
</Pawn>
-
+
<Pawn health=100 position="600,35,1450" direction="0,-1,0" collisionType=dynamic mass=1 >
<attached>
<Model position="0,0,0" mesh="crate.mesh" scale3D="5,5,5" />
@@ -147,8 +147,8 @@
<BoxCollisionShape position="0,0,0" halfExtents="25,25,25" />
</collisionShapes>
</Pawn>
-
+
<SpawnPoint position="0,300,0" direction="0, 0, 0" lookat="0,0,100000000" spawnclass=FpsPlayer pawndesign=fps />
@@ -162,10 +162,10 @@
<Pawn position="<?lua print( (math.random()+10) * 1000 - 9800) ?>,<?lua print(math.random()) ?>,<?lua print( (math.random()+10) * 2000 - 19500) ?>" direction="<?lua print( (math.random()+10) * 10 - 100) ?>,<?lua print(math.random()) ?>,<?lua print(math.random()) ?>" collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 100)?> >
<attached>
<Model position="0,0,0" scale3D="<?lua print(j*100) ?>,<?lua print(g*100) ?>,<?lua print(h*100) ?>" mesh="cube<?lua
- if math.mod(i,4)==0 then print('_green') end
- if math.mod(i,4)==1 then print('_red') end
- if math.mod(i,4)==2 then print('_orange') end
- ?>.mesh" /> <!--if it's 3, cube.mesh is taken -> yellow -->
+ if math.mod(i,4)==0 then print('_green') end
+ if math.mod(i,4)==1 then print('_red') end
+ if math.mod(i,4)==2 then print('_orange') end
+ ?>.mesh" /> <!--if it's 3, cube.mesh is taken -> yellow -->
</attached>
<collisionShapes>
<BoxCollisionShape position="0,0,0" halfExtents="<?lua print(j*100) ?>,<?lua print(g*100) ?>,<?lua print(h*100) ?>" />
Modified: code/trunk/data/levels/presentationFS11.oxw
===================================================================
--- code/trunk/data/levels/presentationFS11.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationFS11.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -421,10 +421,7 @@
</events>
</SimpleNotification>
- <PickupSpawner position="-72487,420,-63" respawnTime="10" triggerDistance="20" maxSpawnedItems="5" active="false">
- <pickup>
- <ShrinkPickup template ="smallshrinkpickup"/>
- </pickup>
+ <PickupSpawner pickup="smallshrinkpickup" position="-72487,420,-63" respawnTime="10" triggerDistance="20" maxSpawnedItems="5" active="false">
<events>
<activity>
<EventListener event=portaldelaytrigger3 />
Modified: code/trunk/data/levels/presentationHS09.oxw
===================================================================
--- code/trunk/data/levels/presentationHS09.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationHS09.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -26,7 +26,7 @@
<Scene
ambientlight = "0.6, 0.4, 0.4"
- skybox = "Orxonox/skypanoramagen2"
+ skybox = "Orxonox/skyBoxSomeNebula"
>
<?lua
@@ -96,36 +96,25 @@
<Billboard material="Test/Fog" position="-3800, 2500, 1500" alpha="0.1" color="1, 1, 1, 0.1" scale="0.5" />
- <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <SpeedPickup template=smalljumppickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=smalljumppickup position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
+ name = "MediumHealth"
pickupName = "Medium Health Pack"
pickupDescription = "Once used adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
- >
- <pickup>
- <HealthPickup health=100 activationType="onUse" durationType="once" />
- </pickup>
- </PickupRepresentation>
+ />
- <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
- <pickup>
- <HealthPickup health=100 activationType=onUse durationType=once />
- </pickup>
- </PickupSpawner>
+ <Template name=onusehealthpickup baseclass=HealthPickup>
+ <HealthPickup representation="MediumHealth" health=100 activationType=onUse durationType=once />
+ </Template>
- <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
- <pickup>
- <HealthPickup template=mediumhealthpickup />
- </pickup>
- </PickupSpawner>
+ <PickupSpawner pickup=onusehealthpickup position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+ <PickupSpawner pickup=mediumhealthpickup position="2300, 4300, 2400" respawnTime="5" triggerDistance="20" />
+
<Billboard position="-2500, 2400, 1500" material="Examples/Flare" />
<EventDispatcher>
<targets>
Modified: code/trunk/data/levels/presentationHS11.oxw
===================================================================
--- code/trunk/data/levels/presentationHS11.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/presentationHS11.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,6 +1,9 @@
+<!-- -->
+
+
<LevelInfo
name = "Presentation HS 2011"
- description = "Oxonox Proudly Presents New Features From HS 2011"
+ description = "New Features: Asteroid field/belt generator; Formationflight; HUD (Enemyhealthbar, displaying Names)"
tags = "presentation"
/>
@@ -80,6 +83,8 @@
</SimpleNotification>
+
+
<!-- ADDING FORMATION: 5 Swallows -->
<?lua for i=0,4,1 do
?>
@@ -130,17 +135,105 @@
</SpaceShip>
<?lua end ?>
+<!-- @Triggers: "hintX" <-> delayed LetsGo -->
+ <EventTrigger name="hint1" activations="1" stayactive="true" delay=4.2>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="hint2" activations="1" stayactive="true" delay=8.4>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="hint3" activations="1" stayactive="true" delay=12.6>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="hint4" activations="1" stayactive="true" delay=16.8>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="hint5" activations="1" stayactive="true" delay=21>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="hint6" activations="1" stayactive="true" delay=25.2>
+ <events>
+ <trigger>
+ <EventListener event="LetsGo" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <SimpleNotification message="Make bots follow you: Press (1)" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint1 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <SimpleNotification message="Toggle group behaviour: Press (1)" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint2 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <SimpleNotification message="Tell the bots to defend you: Press (2)" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint3 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <SimpleNotification message="Make them attack opponents: Press (2) again" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint4 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Let the bots behave 'normal': Press (2) again" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint5 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Have a look at the console to verify this." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=hint6 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
<!-- Generate asteroid field and asteroid belt -->
-<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
+<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
<?lua
- dofile("includes/asteroidField.lua")
- asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)
?>
Property changes on: code/trunk/data/levels/presentationHS11.oxw
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/data/levels/princessAeryn.oxw
===================================================================
--- code/trunk/data/levels/princessAeryn.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/princessAeryn.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -25,7 +25,7 @@
<Scene
ambientlight = "0.3, 0.3, 0.3"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
Modified: code/trunk/data/levels/screenshot.oxw
===================================================================
--- code/trunk/data/levels/screenshot.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/screenshot.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -24,7 +24,7 @@
<Scene
ambientlight = "0.7, 0.6, 0.6"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<!--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" /-->
<Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Copied: code/trunk/data/levels/surfaceRace.oxw (from rev 9347, code/branches/presentation2012merge/data/levels/surfaceRace.oxw)
===================================================================
--- code/trunk/data/levels/surfaceRace.oxw (rev 0)
+++ code/trunk/data/levels/surfaceRace.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,450 @@
+<!--
+TODO:
+ Replace bottom's texture. It just does not look good.
+-->
+
+<LevelInfo
+ name = "Surface Race"
+ description = "Race on a planet's surface. Try to reach the goal in 70 Seconds."
+ screenshot = "surfaceRace.png"
+ tags = "gametype"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/spaceshipRace.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+
+<Level
+ gametype = SpaceRace
+>
+
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "2.0, 2.0, 2.0"
+ skybox = "Orxonox/skyBoxClouds"
+ gravity = "0,-75,0"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ hasPhysics = true
+ >
+
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+
+ <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,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+
+<!--
+ <Model position="0,0,55" mesh="testcube.mesh" scale3D="110,20,20" />
+ <Model position="0,0,-55" mesh="testcube.mesh" scale3D="110,20,20" />
+ <Model position="55,0,0" mesh="testcube.mesh" scale3D="20,20,110" />
+ <Model position="-55,0,0" mesh="testcube.mesh" scale3D="20,20,110" />
+
+-->
+
+
+ </attached>
+
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+
+
+
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+
+
+ <collisionShapes>
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+ </collisionShapes>
+ </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+ </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+ </collisionShapes>
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+
+ </collisionShapes>
+
+ </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+ </collisionShapes>
+ </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+
+ </collisionShapes>
+ </RaceCheckPoint>
+
+
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=spaceshiprace />
+
+
+ <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90" scale="4" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+ <!--
+ <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+ <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="0,-320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="320,0,2400" halfExtents="72,360,2400" />
+ <BoxCollisionShape position="-320,0,2400" halfExtents="72,360,2400" />
+
+
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+
+
+
+ <!-- ------------------Boden----------------- -->
+ <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+ <attached>
+ <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+ </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+ <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60" maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+ max = 15
+ for i = 0, max, 1
+ do
+ x=-12000
+ y=10000
+ z=-12000
+
+ ?>
+ <?lua
+ for k = 1, 15, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+ collisionType = "dynamic"
+ linearDamping = "0.5"
+ angularDamping = "0.5"
+ collisiondamage = "100"
+ 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 == 0 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 ?>
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/teamBaseMatch.oxw
===================================================================
--- code/trunk/data/levels/teamBaseMatch.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/teamBaseMatch.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -25,7 +25,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/teamDeathMatch.oxw
===================================================================
--- code/trunk/data/levels/teamDeathMatch.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/teamDeathMatch.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -24,7 +24,7 @@
<Scene
ambientlight = "0.7, 0.6, 0.6"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/templates/FPS.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS.oxt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/templates/FPS.oxt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -16,20 +16,20 @@
mass = 100
linearDamping = 0.7
angularDamping = 0.9999999
- friction = 0.01
-
+ friction = 0.01
+
weapon = "hs-w01.mesh"
>
<collisionShapes>
<BoxCollisionShape position="0,-20,0" halfExtents="15,25,15" />
</collisionShapes>
-
+
<camerapositions>
<CameraPosition position="-1,1,2.2" drag=false mouselook=true />
</camerapositions>
-
+
<?lua
- include("../includes/weaponSettingsFPS.oxi")
+ include("../includes/weaponSettingsFPS.oxi")
?>
</FpsPlayer>
@@ -39,14 +39,14 @@
<FpsPlayer>
<camerapositions>
<CameraPosition position="0,0,20" drag=false mouselook=true />
-
+
<!--
CameraPosition position="0,150,-25" pitch=-90 drag=true />
<CameraPosition position="0,0,-40" yaw=180 drag=true />
<CameraPosition position="0,3,-14" yaw=0 />
<CameraPosition position="-50,5,-8" yaw=-90 drag=true />
<CameraPosition position="50,5,-8" yaw=90 drag=true /
-
+
</camerapositions>
</FpsPlayer>
</Template>
Modified: code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -16,8 +16,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallshieldpickup>
+<Template name=smallshieldpickup baseclass=ShieldPickup>
<ShieldPickup
+ representation = "smallshieldpickup"
duration = 10
shieldabsorption = 0.7
shieldhealth = 300
@@ -42,8 +43,9 @@
</PickupRepresentation>
</Template>
-<Template name=mediumshieldpickup>
+<Template name=mediumshieldpickup baseclass=ShieldPickup>
<ShieldPickup
+ representation = "mediumshieldpickup"
duration = 30
shieldabsorption = 0.8
shieldhealth = 500
@@ -69,8 +71,9 @@
</PickupRepresentation>
</Template>
-<Template name=hugeshieldpickup>
+<Template name=hugeshieldpickup baseclass=ShieldPickup>
<ShieldPickup
+ representation = "hugeshieldpickup"
duration = 60
shieldabsorption = 0.95
shieldhealth = 700
@@ -97,8 +100,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallhealthpickup>
+<Template name=smallhealthpickup baseclass=HealthPickup>
<HealthPickup
+ representation = "smallhealthpickup"
health = 10
healthType = "limited"
activationType = "immediate"
@@ -122,8 +126,9 @@
</PickupRepresentation>
</Template>
-<Template name=mediumhealthpickup>
+<Template name=mediumhealthpickup baseclass=HealthPickup>
<HealthPickup
+ representation = "mediumhealthpickup"
health = 50
healthType = "limited"
activationType = "immediate"
@@ -147,8 +152,9 @@
</PickupRepresentation>
</Template>
-<Template name=hugehealthpickup>
+<Template name=hugehealthpickup baseclass=HealthPickup>
<HealthPickup
+ representation = "hugehealthpickup"
health = 100
healthType = "limited"
activationType = "immediate"
@@ -172,8 +178,9 @@
</PickupRepresentation>
</Template>
-<Template name=crazyhealthpickup>
+<Template name=crazyhealthpickup baseclass=HealthPickup>
<HealthPickup
+ representation = "crazyhealthpickup"
health = 1000
healthType = "permanent"
activationType = "immediate"
@@ -215,6 +222,87 @@
</PickupRepresentation>
</Template>
+<!-- DamageBoost pickups -->
+
+<Template name=smalldamageboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+ <attached>
+ <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageSmall" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=smalldamageboostpickup baseclass=DamageBoostPickup>
+ <DamageBoostPickup
+ representation = "smalldamageboostpickup"
+ duration = 10.0
+ damageMultiplier = 2.0
+ activationType = "immediate"
+ durationType = "continuous"
+ />
+</Template>
+
+<Template name=mediumdamageboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+ <attached>
+ <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageMedium" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=mediumdamageboostpickup baseclass=DamageBoostPickup>
+ <DamageBoostPickup
+ representation = "mediumdamageboostpickup"
+ duration = 10.0
+ damageMultiplier = 5.0
+ activationType = "immediate"
+ durationType = "continuous"
+ />
+</Template>
+
+<Template name=largedamageboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+ <attached>
+ <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageLarge" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=largedamageboostpickup baseclass=DamageBoostPickup>
+ <DamageBoostPickup
+ representation = "largedamageboostpickup"
+ duration = 10.0
+ damageMultiplier = 7.0
+ activationType = "immediate"
+ durationType = "continuous"
+ />
+</Template>
+
+
<!-- Speed pickups -->
<Template name=smallspeedpickupRepresentation>
@@ -233,8 +321,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallspeedpickup>
+<Template name=smallspeedpickup baseclass=SpeedPickup>
<SpeedPickup
+ representation = "smallspeedpickup"
duration = 10.0
speedAdd = 0.0
SpeedMultiply = 10.0
@@ -259,8 +348,9 @@
</PickupRepresentation>
</Template>
-<Template name=mediumspeedpickup>
+<Template name=mediumspeedpickup baseclass=SpeedPickup>
<SpeedPickup
+ representation = "mediumspeedpickup"
duration = 10.0
speedAdd = 0.0
SpeedMultiply = 25.0
@@ -285,8 +375,9 @@
</PickupRepresentation>
</Template>
-<Template name=hugespeedpickup>
+<Template name=hugespeedpickup baseclass=SpeedPickup>
<SpeedPickup
+ representation = "hugespeedpickup"
duration = 10.0
speedAdd = 0.0
SpeedMultiply = 50.0
@@ -311,8 +402,9 @@
</PickupRepresentation>
</Template>
-<Template name=smalljumppickup>
+<Template name=smalljumppickup baseclass=SpeedPickup>
<SpeedPickup
+ representation = "smalljumppickup"
duration = 0.7
speedAdd = 5000.0
SpeedMultiply = 1.0
@@ -339,8 +431,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallinvisiblepickup>
+<Template name=smallinvisiblepickup baseclass=InvisiblePickup>
<InvisiblePickup
+ representation = "smallinvisiblepickup"
duration = 5.0
activaionType = "immediate"
durationType = "continuous"
@@ -363,8 +456,9 @@
</PickupRepresentation>
</Template>
-<Template name=mediuminvisiblepickup>
+<Template name=mediuminvisiblepickup baseclass=InvisiblePickup>
<InvisiblePickup
+ representation = "mediuminvisiblepickup"
duration = 10.0
activaionType = "immediate"
durationType = "continuous"
@@ -387,8 +481,9 @@
</PickupRepresentation>
</Template>
-<Template name=hugeinvisiblepickup>
+<Template name=hugeinvisiblepickup baseclass=InvisiblePickup>
<InvisiblePickup
+ representation = "hugeinvisiblepickup"
duration = 20.0
activaionType = "immediate"
durationType = "continuous"
@@ -411,8 +506,9 @@
</PickupRepresentation>
</Template>
-<Template name=smallshrinkpickup>
- <InvisiblePickup
+<Template name=smallshrinkpickup baseclass=ShrinkPickup>
+ <ShrinkPickup
+ representation = "smallshrinkpickup"
duration = 10.0
shrinkFactor = 2.5
activaionType = "immediate"
@@ -436,8 +532,9 @@
</PickupRepresentation>
</Template>
-<Template name=mediumshrinkpickup>
- <InvisiblePickup
+<Template name=mediumshrinkpickup baseclass=ShrinkPickup>
+ <ShrinkPickup
+ representation = "mediumshrinkpickup"
duration = 30.0
shrinkFactor = 5.0
activaionType = "immediate"
@@ -461,8 +558,9 @@
</PickupRepresentation>
</Template>
-<Template name=hugeshrinkpickup>
- <InvisiblePickup
+<Template name=hugeshrinkpickup baseclass=ShrinkPickup>
+ <ShrinkPickup
+ representation = "hugeshrinkpickup"
duration = 60.0
shrinkFactor = 10.0
activaionType = "immediate"
@@ -490,8 +588,10 @@
</PickupRepresentation>
</Template>
-<Template name=triplehealthspeedinvisibilitypickup>
- <PickupCollection>
+<Template name=triplehealthspeedinvisibilitypickup baseclass=PickupCollection>
+ <PickupCollection
+ representation = "triplehealthspeedinvisibilitypickup"
+ >
<pickupables>
<HealthPickup template=mediumhealthpickup />
<SpeedPickup template=mediumspeedpickup />
@@ -550,7 +650,7 @@
</PickupRepresentation>
</Template>
-<Template name=dronepickup>
- <DronePickup droneTemplate=droneTemplate />
+<Template name=dronepickup baseclass=DronePickup>
+ <DronePickup representation=dronepickup droneTemplate=droneTemplate />
</Template>
Copied: code/trunk/data/levels/templates/spaceshipRace.oxt (from rev 9347, code/branches/presentation2012merge/data/levels/templates/spaceshipRace.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipRace.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipRace.oxt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,119 @@
+<Template name=spaceshiprace>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipassffcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 100
+ maxhealth = 200
+ initialhealth = 100
+
+ shieldhealth = 30
+ initialshieldhealth = 30
+ maxshieldhealth = 50
+ shieldabsorption = 0.8
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 100
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 15
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 9
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
+ <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+ <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+ </attached>
+ <collisionShapes>
+
+ <BoxCollisionShape position="0,0,0" halfExtents="10, 3, 5" />
+ <BoxCollisionShape position="13,-1.3,0" halfExtents="3, 1, 2" />
+ <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+ <BoxCollisionShape position="0,0,7" halfExtents="3, 2, 2" />
+ <BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
+ <BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
+
+ </collisionShapes>
+<?lua
+ include("../includes/weaponSettingsAssff.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipassffcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,10, 40" drag=true mouselook=true />
+ <CameraPosition position="0,20, 80" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 2500
+ speedback = 50
+ speedleftright = 50
+ speedupdown = 50
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 500
+ accelerationbrake = 500
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+<!-- <EffectContainer condition="brake">
+ <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+-->
+ </MultiStateEngine>
+</Template>
Property changes on: code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
___________________________________________________________________
Added: svn:eol-style
+ native
Copied: code/trunk/data/levels/templates/tower.oxt (from rev 9347, code/branches/presentation2012merge/data/levels/templates/tower.oxt)
===================================================================
--- code/trunk/data/levels/templates/tower.oxt (rev 0)
+++ code/trunk/data/levels/templates/tower.oxt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,37 @@
+<Template name=tower>
+ <Tower
+
+
+ explosionchunks = 6
+
+ reloadrate = 3
+ reloadwaittime = 1
+
+ collisionType = "dynamic"
+ team = 2
+
+
+ >
+ <controller>
+ <WaypointPatrolController alertnessradius=1000 team=5>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position=" 700, 200, 100" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+
+
+ <attached>
+ <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
+ </attached>
+
+ <!--collisionShapes>
+
+ </collisionShapes-->
+
+<?lua
+ include("../includes/towerWeaponSettings.oxi")
+?>
+ </Tower>
+</Template>
+
Modified: code/trunk/data/levels/testStars.oxw
===================================================================
--- code/trunk/data/levels/testStars.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/testStars.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -29,16 +29,16 @@
<!--Rocket position="-10, 3.5,800" velocity="0,0,-100">
<attached>
<Model pitch=180 position="0,0,0" scale=1.5 mesh="rocket_test.mesh" >
- <attached>
- <ParticleEmitter pitch=0 roll=0 position="0,5,0" source="Orxonox/laser" lifetime=2.0 loop=1 startdelay=3.0/>
- <ParticleEmitter pitch=-90 roll=0 position="0,-5,0" source="Orxonox/particlecanon" lifetime=2.0 loop=1 startdelay=3.0/>
- <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/rocketfire" lifetime=2.0 loop=1 startdelay=3.0 />
- <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/smoke" lifetime=2.0 loop=1 startdelay=3.0 />
+ <attached>
+ <ParticleEmitter pitch=0 roll=0 position="0,5,0" source="Orxonox/laser" lifetime=2.0 loop=1 startdelay=3.0/>
+ <ParticleEmitter pitch=-90 roll=0 position="0,-5,0" source="Orxonox/particlecanon" lifetime=2.0 loop=1 startdelay=3.0/>
+ <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/rocketfire" lifetime=2.0 loop=1 startdelay=3.0 />
+ <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/smoke" lifetime=2.0 loop=1 startdelay=3.0 />
</attached>
- </Model>
- </attached>
+ </Model>
+ </attached>
</Rocket-->
-
+
<CreateStars numStars="6000" material="Examples/Flare" colour="1,1,1" radius=10000 colourDiff=0.1/>
<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" />
Modified: code/trunk/data/levels/testSwallow.oxw
===================================================================
--- code/trunk/data/levels/testSwallow.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/testSwallow.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/tetris.oxw
===================================================================
--- code/trunk/data/levels/tetris.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/tetris.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -8,15 +8,20 @@
<?lua
include("HUDTemplates3.oxo")
include("stats.oxo")
+ include("tetrisHUD.oxo")
include("templates/lodInformation.oxt")
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipGhost.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipSwallow.oxt")
+ include("templates/spaceshipTransporter.oxt")
+ include("templates/spaceshipH2.oxt")
?>
<Template name=tetrisstonecameras defaults=0>
<TetrisStone>
<camerapositions>
<CameraPosition position="55,75,200" absolute=true />
- <CameraPosition position="0,50,160" drag=true mouselook=true />
- <CameraPosition position="0,50,0" pitch=-90 drag=true mouselook=true />
</camerapositions>
</TetrisStone>
</Template>
@@ -24,11 +29,29 @@
<Template name=tetrisstone>
<TetrisStone camerapositiontemplate=tetrisstonecameras>
<attached>
- <Model position="0,0,0" mesh="crate.mesh" scale=1 />
+ <Model position="0,0,0" mesh="crate.mesh" scale=0.9 />
</attached>
</TetrisStone>
</Template>
+
+
+<Template name=tetrisbrickcameras defaults=0>
+ <TetrisBrick>
+ <camerapositions>
+ <CameraPosition position="55,75,200" absolute=true />
+ <!--CameraPosition position="0,50,160" drag=true mouselook=true />
+ <CameraPosition position="0,50,0" pitch=-90 drag=true mouselook=true /-->
+ </camerapositions>
+ </TetrisBrick>
+</Template>
+
+<Template name=tetrisbrick>
+ <TetrisBrick camerapositiontemplate=tetrisbrickcameras>
+ </TetrisBrick>
+</Template>
+
+
<Level
gametype = "Tetris"
>
@@ -39,23 +62,128 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
+<!--luke_grey_-_hypermode.ogg allgorythm-lift_up.ogg Fight1.ogg -->
+ <WorldAmbientSound
+ source="Ganymede.ogg"
+ looping="true"
+ playOnLoad="true"
+ />
+
<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" />
+
<?lua
for i = 1, 10, 1 do
?>
<SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" />
<?lua end ?>
- <TetrisCenterpoint name=tetriscenter width=11 height=15 stoneSize=10 stoneTemplate=tetrisstone stoneSpeed=10 position="-55,-75,0">
+ <TetrisCenterpoint name=tetriscenter width=11 height=15 stoneSize=10 stoneTemplate=tetrisstone brickTemplate=tetrisbrick stoneSpeed=10 position="-55,-75,0">
<attached>
<Model position="55,-1,0" mesh="cube.mesh" scale3D="57,1,11" />
<Model position="-1,76,0" mesh="cube.mesh" scale3D="1,76,1" />
<Model position="111,76,0" mesh="cube.mesh" scale3D="1,76,1" />
</attached>
+ <!--collisionShapes>
+ <BoxCollisionShape position="55,-1,0" halfExtents="57,1,11" />
+ <BoxCollisionShape position="-1,76,0" halfExtents="1,76,1" />
+ <BoxCollisionShape position="111,76,0" halfExtents="1,76,1" />
+ </collisionShapes-->
</TetrisCenterpoint>
+<!-- ------------ insert eye candy here ---------------- -->
+
+<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
+<!-- DONT DARE TO TURN THE FOG ON, whithout finding a better belt position -->
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(10000, 0, 0, -40, -90, 70, 100, 200, 24000, 20000, 500, 0)
+
+ ?>
+<!-- -------- 4 spaceships rotating around the tetris field --------- -->
+ <SpaceShip position="1000,-75,1" lookat="0,0,0">
+ <templates>
+ <Template link=spaceshipswallow />
+ </templates>
+ <controller>
+ <WaypointController team=10 accuracy=200>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="1000,-75,0" />
+ <Model mesh="cube.mesh" scale=0 position="650,-75,650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,-75,1000" />
+ <Model mesh="cube.mesh" scale=0 position="-700,-75,650" />
+ <Model mesh="cube.mesh" scale=0 position="-1000,-75,0" />
+ <Model mesh="cube.mesh" scale=0 position="-700,-75,-650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,-75,-1000" />
+ <Model mesh="cube.mesh" scale=0 position="650,-75,-650" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="-500,-500,-400" lookat="0,0,0">
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointController team=10>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1000,-200,0" />
+ <Model mesh="cube.mesh" scale=0 position="-700,-150,650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,-75,1000" />
+ <Model mesh="cube.mesh" scale=0 position="650,100,650" />
+ <Model mesh="cube.mesh" scale=0 position="1000,150,0" />
+ <Model mesh="cube.mesh" scale=0 position="650,100,-650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,0,-1000" />
+ <Model mesh="cube.mesh" scale=0 position="-700,-100,-650" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="-700,200,651" lookat="1,0,0">
+ <templates>
+ <Template link=spaceshipghost />
+ </templates>
+ <controller>
+ <WaypointController team=10 accuracy=300>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-700,200,650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,100,1000" />
+ <Model mesh="cube.mesh" scale=0 position="650,0,650" />
+ <Model mesh="cube.mesh" scale=0 position="1000,-100,0" />
+ <Model mesh="cube.mesh" scale=0 position="650,0,-650" />
+ <Model mesh="cube.mesh" scale=0 position="-55,100,-1000" />
+ <Model mesh="cube.mesh" scale=0 position="-700,200,-650" />
+ <Model mesh="cube.mesh" scale=0 position="-1000,300,0" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="1000,-75,0" lookat="0,0,0">
+ <templates>
+ <Template link=spaceshipHtwo />
+ </templates>
+ <controller>
+ <WaypointController team=10>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="400,240,400" />
+ <Model mesh="cube.mesh" scale=0 position="-55,240,700" />
+ <Model mesh="cube.mesh" scale=0 position="-500,240,400" />
+ <Model mesh="cube.mesh" scale=0 position="-700,240,0" />
+ <Model mesh="cube.mesh" scale=0 position="-500,240,-400" />
+ <Model mesh="cube.mesh" scale=0 position="-55,240,-700" />
+ <Model mesh="cube.mesh" scale=0 position="400,240,-400" />
+ <Model mesh="cube.mesh" scale=0 position="700,240,0" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+
+
</Scene>
</Level>
Modified: code/trunk/data/levels/theTimeMachine.oxw
===================================================================
--- code/trunk/data/levels/theTimeMachine.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/theTimeMachine.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -38,6 +38,10 @@
linearDamping = 0.7
angularDamping = 0.9999999
>
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+ </engines>
<attached>
<Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
<BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
@@ -70,7 +74,7 @@
<Scene
ambientlight="0.8,0.8,0.8"
- skybox="Orxonox/skypanoramagen2"
+ skybox="Orxonox/skyBoxSomeNebula"
>
<Light type=directional position="0,0,0" direction="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 1.0, 0.9" />
Copied: code/trunk/data/levels/towerDefense.oxw (from rev 9347, code/branches/presentation2012merge/data/levels/towerDefense.oxw)
===================================================================
--- code/trunk/data/levels/towerDefense.oxw (rev 0)
+++ code/trunk/data/levels/towerDefense.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,140 @@
+<!-- TODO: Update the level's image-->
+
+<!-- See TowerDefenseReadme.txt for Information on this file -->
+
+<LevelInfo
+ name = "Tower Defense"
+ description = "Defend your Spacestation from incoming waves."
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("towerdefenseHUD.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/tower.oxt")
+?>
+
+<!-- Specify the position of the camera -->
+<Template name=centerpointmarkcamera defaults=0>
+ <Pawn>
+ <camerapositions>
+ <CameraPosition position="0,0,1500"/>
+ </camerapositions>
+ </Pawn>
+</Template>
+
+<!-- Loads a mesh to mark the center-->
+<Template name=centerpointmark>
+ <Pawn camerapositiontemplate=centerpointmarkcamera>
+ <attached>
+ <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->
+ </attached>
+ </Pawn>
+</Template>
+
+
+<!-- Template for a tower EDIT: new towertemplate is included with "templates/tower" -->
+<!--Template name=towertemplate>
+ <Tower>
+ <attached>
+ <Model position="0,0,0" scale=0.25 mesh="Tower_ME.mesh" />
+ </attached>
+ </Tower>
+</Template-->
+
+
+
+
+
+<Level gametype = "TowerDefense">
+ <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"/>
+
+ <!-- Spawns the camera, attached to a crate -->
+ <SpawnPoint team=0 position="0,0,0" spawnclass=Pawn pawndesign=centerpointmark />
+ <!--TeamSpawnPoint team=1 position="-7,7,4" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+ <!--SpawnPoint team=1 position="0,0,10" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+ <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+ <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=3 team=1 >
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WaypointController accuracy=60>
+ <waypoints>
+ <!-- 1,3 10,3 10,11, 13,11 -->
+ <Model mesh="cube.mesh" scale=0 position="-700,-500, 150" />
+ <Model mesh="cube.mesh" scale=0 position=" 200,-500, 150" />
+ <Model mesh="cube.mesh" scale=0 position=" 200, 300, 150" />
+ <Model mesh="cube.mesh" scale=0 position=" 500, 300, 150" />
+ <Model mesh="cube.mesh" scale=0 position=" 500, 700, 150" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+
+ <!--invisible entity to attach towers to, since playfield is static and towers are dynamic-->
+ <StaticEntity position=0,0,0>
+
+ <attached>
+ <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
+ <!-- Base -->
+ <Model position="500,700,100" mesh="sphere.mesh" scale=80 />
+ <!--Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /--> <!-- Only temporary needed to help align the collisionshape -->
+ <!-- This was used to mark the playfield, let's let it be here for now -->
+ <!--Model position="-8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="-8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ </attached>
+ <collisionShapes> <!-- The collisionshape forbids other worldentities that have a collisionShape to fly through it.
+
+ TODO: Find correct size for the collisionshape; since a collisionShape is invisible
+ I added the crate wich currently has the same dimensions as the collisionshape.
+ You have to adjust the crate's scale3D as well as the collisionshape's halfExtens to
+ find the proper shape. -->
+ <BoxCollisionShape position="0,0,0" halfExtents="400,400,100" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+ <!-- PlayField -->
+ <TowerDefenseCenterpoint
+ name=towerdefensecenter
+ width=16
+ height=16
+ tileScale=100
+ towerTemplate=tower
+ position="0,0,0"
+ direction="0,0,0"
+ collisionType=dynamic
+ mass=100000>
+
+ </TowerDefenseCenterpoint>
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/tutorial.oxw
===================================================================
--- code/trunk/data/levels/tutorial.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/tutorial.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,14 +1,17 @@
<LevelInfo
name = "Coding Tutorial"
description = "Level for the coding tutorial."
- tags = "tutorial"
+ tags = "tutorial, shipselection"
screenshot = "codingtutorial.png"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser"
/>
<?lua
include("HUDTemplates3.oxo")
include("stats.oxo")
include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipGhost.oxt")
+ include("templates/spaceshipSpacecruiser.oxt")
include("templates/lodInformation.oxt")
?>
@@ -20,12 +23,8 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
-
-
-
-
<Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
<attached>
<Model scale="1" mesh="drone.mesh"/>
@@ -52,7 +51,7 @@
<?lua
for i = 1, 10, 1 do
?>
- <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+ <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=shipselection />
<?lua end ?>
<GlobalShader compositor="Bloom" visible=false>
Modified: code/trunk/data/levels/underAttack.oxw
===================================================================
--- code/trunk/data/levels/underAttack.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/underAttack.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -11,7 +11,6 @@
include("templates/spaceshipAssff.oxt")
include("templates/lodInformation.oxt")
?>
-<!--OUTDATED: include("underAttackHUD.oxo") -->
<Level
gametype = "UnderAttack"
@@ -23,7 +22,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/levels/waypoints.oxw
===================================================================
--- code/trunk/data/levels/waypoints.oxw 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/levels/waypoints.oxw 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
<Scene
ambientlight = "0.5, 0.5, 0.5"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/skyBoxBasic"
>
<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" />
Modified: code/trunk/data/overlays/dynamicMatchHUD.oxo
===================================================================
--- code/trunk/data/overlays/dynamicMatchHUD.oxo 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/overlays/dynamicMatchHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,6 +1,27 @@
<Template name="DynamicmatchHUD">
<OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
+ <!--OverlayText
+ position = "0.02, 0.02"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Target:"
+ />
+
+ <OverlayText
+ position = "0.02, 0.055"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Score:"
+ /-->
+
+
<GametypeStaticMessage
name = "staticmessage"
position = "0.5, 0.01"
Modified: code/trunk/data/overlays/lastManStandingHUD.oxo
===================================================================
--- code/trunk/data/overlays/lastManStandingHUD.oxo 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/overlays/lastManStandingHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,45 +1,24 @@
<Template name="LastmanstandingHUD">
- <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
-
- <!--GametypeStaticMessage
- name = "staticmessage"
- position = "0.5, 0.01"
- font = "VeraMono"
- caption = ""
- textsize = 0.033
- colour = "1.0, 1.0, 0.5, 1.0"
- align = "center"
- /-->
-
-<GametypeFadingMessage
- name = "fadingmessage"
- position = "0.5, 0.01"
- font = "VeraMono"
- textsize = 0.04
- colour = "1.0, 1.0, 0.5, 1.0"
- align = "center"
- />
-
- <OverlayText
- position = "0.02, 0.02"
+ <OverlayGroup name="LastmanstandingHUD" scale = "1, 1">
+ <LastManStandingInfos
+ position = "0.14, 0.02"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- caption = "Lives: "
- />
- <LastManStandingInfos
- position = "0.14, 0.02"
+ showlives = true
+ showplayers = false
+ />
+ <OverlayText
+ position = "0.02, 0.02"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
-
- showlives = true
- showplayers = false
+ caption = "Lives: "
/>
<OverlayText
Modified: code/trunk/data/overlays/lastTeamStandingHUD.oxo
===================================================================
--- code/trunk/data/overlays/lastTeamStandingHUD.oxo 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/overlays/lastTeamStandingHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,35 +1,25 @@
<Template name="lastTeamStandingHUD">
<OverlayGroup name="lastTeamStandingHUD" scale = "1, 1">
-
-<GametypeFadingMessage
- name = "fadingmessage"
- position = "0.5, 0.01"
- font = "VeraMono"
- textsize = 0.04
- colour = "1.0, 1.0, 0.5, 1.0"
- align = "center"
- />
-
- <OverlayText
- position = "0.02, 0.02"
+ <LastTeamStandingInfos
+ position = "0.14, 0.02"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- caption = "Lives: "
+
+ showlives = true
+ showteams = false
/>
- <LastTeamStandingInfos
- position = "0.14, 0.02"
+ <OverlayText
+ position = "0.02, 0.02"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
-
- showlives = true
- showteams = false
+ caption = "Lives: "
/>
<OverlayText
Copied: code/trunk/data/overlays/tetrisHUD.oxo (from rev 9347, code/branches/presentation2012merge/data/overlays/tetrisHUD.oxo)
===================================================================
--- code/trunk/data/overlays/tetrisHUD.oxo (rev 0)
+++ code/trunk/data/overlays/tetrisHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,37 @@
+<Template name="TetrisHUD">
+ <OverlayGroup name="TetrisHUD" scale = "1, 1">
+ <TetrisScore
+ position = "0.9, 0.1"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ />
+
+ <OverlayText
+ position = "0.7, 0.10"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ caption = "Points: "
+ />
+
+ <OverlayText
+ position = "0.7, 0.20"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ caption = "Next Brick"
+ />
+
+
+
+ </OverlayGroup>
+</Template>
Copied: code/trunk/data/overlays/towerdefenseHUD.oxo (from rev 9347, code/branches/presentation2012merge/data/overlays/towerdefenseHUD.oxo)
===================================================================
--- code/trunk/data/overlays/towerdefenseHUD.oxo (rev 0)
+++ code/trunk/data/overlays/towerdefenseHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,14 @@
+<Template name="TowerDefenseHUD">
+ <OverlayGroup name="TowerDefenseHUD" scale = "1, 1">
+ <OverlayText
+ position = "0.05, 0.05"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ caption = "Hello World"
+ />
+ </OverlayGroup>
+</Template>
Deleted: code/trunk/data/overlays/underAttackHUD.oxo
===================================================================
--- code/trunk/data/overlays/underAttackHUD.oxo 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/overlays/underAttackHUD.oxo 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,26 +0,0 @@
-< Template name="UnderAttackHUD">
- <OverlayGroup name="UnderAttackHUD" scale = "1, 1">
- <OUTDATED-- UnderAttackHealthBar
- name = "HealthBar"
- background = "Orxonox/HealthBarBackground"
- size = "0.45, 0.0875"
- position = "0.99 , 0.01"
- pickpoint = "1, 0"
- bartexture = "healthbar_bar.png"
- textfont = "VeraMono"
- textusebarcolour = true
- textsize = 0.039
- textoffset = "0.315, 0.05"
- textpickpoint = "0, 0"
- textalign = "right"
- correctaspect = false
- textcorrectaspect = false
- descriptionpickpoint = "0, 0"
- descriptionoffset = "0.5, 1"
- >
- <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
- <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
- <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
- </UnderAttackHealthBar>
- </OverlayGroup>
-</Template>
Deleted: code/trunk/data/particle/smoke1.particle
===================================================================
--- code/trunk/data/particle/smoke1.particle 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/data/particle/smoke1.particle 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,43 +0,0 @@
-// Example particle systems
-
-// smoke
-particle_system Examples/Smoke
-{
- material Examples/Smoke
- particle_width 55
- particle_height 55
- cull_each true
- quota 500
- billboard_type point
- sorted true
-
- // Area emitter
- emitter Point
- {
- angle 11
- emission_rate 15
- time_to_live 4
- direction 0 1 0
- velocity_min 150
- velocity_max 240
- }
-
- affector ColourImage
- {
- image smokecolors.png
- }
-
- affector Rotator
- {
- rotation_range_start 0
- rotation_range_end 360
- rotation_speed_range_start -60
- rotation_speed_range_end 200
- }
-
- affector Scaler
- {
- rate 100
- }
-
-}
Property changes on: code/trunk/doc/api/groups/Portals.dox
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/doc/api/groups/Weapons.dox
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/BuildUnitsConfigGCC.cmake
===================================================================
--- code/trunk/src/BuildUnitsConfigGCC.cmake 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/BuildUnitsConfigGCC.cmake 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,74 +1,74 @@
- #
- # ORXONOX - the hottest 3D action shooter ever to exist
- # > www.orxonox.net <
- #
- # 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:
- # Reto Grieder
- # Description:
- # Configures the number of build units per library
- #
-
-SET(BUILD_UNITS_CONFIG_1_THREADS
- util 1
- core 2
- network 1
- tools 1
- orxonox 8
- designtools 1
- notifications 1
- objects 2
- overlays 2
- pickup 2
- pong 1
- questsystem 1
- weapons 1
-)
-
-SET(BUILD_UNITS_CONFIG_2_THREADS ${BUILD_UNITS_CONFIG_1_THREADS})
-
-SET(BUILD_UNITS_CONFIG_4_THREADS
- util 1
- core 4
- network 2
- tools 2
- orxonox 8
- designtools 1
- notifications 1
- objects 2
- overlays 2
- pickup 1
- pong 1
- questsystem 1
- weapons 1
-)
-
-SET(BUILD_UNITS_CONFIG_8_THREADS
- util 2
- core 8
- network 5
- tools 3
- orxonox 8
- designtools 1
- notifications 1
- objects 3
- overlays 3
- pickup 2
- pong 1
- questsystem 3
- weapons 3
-)
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # 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:
+ # Reto Grieder
+ # Description:
+ # Configures the number of build units per library
+ #
+
+SET(BUILD_UNITS_CONFIG_1_THREADS
+ util 1
+ core 2
+ network 1
+ tools 1
+ orxonox 8
+ designtools 1
+ notifications 1
+ objects 2
+ overlays 2
+ pickup 2
+ pong 1
+ questsystem 1
+ weapons 1
+)
+
+SET(BUILD_UNITS_CONFIG_2_THREADS ${BUILD_UNITS_CONFIG_1_THREADS})
+
+SET(BUILD_UNITS_CONFIG_4_THREADS
+ util 1
+ core 4
+ network 2
+ tools 2
+ orxonox 8
+ designtools 1
+ notifications 1
+ objects 2
+ overlays 2
+ pickup 1
+ pong 1
+ questsystem 1
+ weapons 1
+)
+
+SET(BUILD_UNITS_CONFIG_8_THREADS
+ util 2
+ core 8
+ network 5
+ tools 3
+ orxonox 8
+ designtools 1
+ notifications 1
+ objects 3
+ overlays 3
+ pickup 2
+ pong 1
+ questsystem 3
+ weapons 3
+)
Property changes on: code/trunk/src/BuildUnitsConfigGCC.cmake
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/BuildUnitsConfigMSVC.cmake
===================================================================
--- code/trunk/src/BuildUnitsConfigMSVC.cmake 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/BuildUnitsConfigMSVC.cmake 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,88 +1,88 @@
- #
- # ORXONOX - the hottest 3D action shooter ever to exist
- # > www.orxonox.net <
- #
- # 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:
- # Reto Grieder
- # Description:
- # Configures the number of build units per library
- #
-
-SET(BUILD_UNITS_CONFIG_1_THREADS
- util 1
- core 1
- network 1
- tools 1
- orxonox 2 # Avoids running out of symbol adresses (fix with /bigobj)
- designtools 1
- notifications 1
- objects 1
- overlays 1
- pickup 1
- pong 1
- questsystem 1
- weapons 1
-)
-
-SET(BUILD_UNITS_CONFIG_2_THREADS
- util 1
- core 2
- network 1
- tools 1
- orxonox 2
- designtools 1
- notifications 1
- objects 2
- overlays 1
- pickup 1
- pong 1
- questsystem 1
- weapons 1
-)
-
-SET(BUILD_UNITS_CONFIG_4_THREADS
- util 2
- core 4
- network 2
- tools 2
- orxonox 4
- designtools 1
- notifications 1
- objects 2
- overlays 2
- pickup 1
- pong 1
- questsystem 2
- weapons 2
-)
-
-SET(BUILD_UNITS_CONFIG_8_THREADS
- util 2
- core 8
- network 5
- tools 3
- orxonox 8
- designtools 1
- notifications 1
- objects 3
- overlays 3
- pickup 2
- pong 1
- questsystem 3
- weapons 3
-)
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # 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:
+ # Reto Grieder
+ # Description:
+ # Configures the number of build units per library
+ #
+
+SET(BUILD_UNITS_CONFIG_1_THREADS
+ util 1
+ core 1
+ network 1
+ tools 1
+ orxonox 2 # Avoids running out of symbol adresses (fix with /bigobj)
+ designtools 1
+ notifications 1
+ objects 1
+ overlays 1
+ pickup 1
+ pong 1
+ questsystem 1
+ weapons 1
+)
+
+SET(BUILD_UNITS_CONFIG_2_THREADS
+ util 1
+ core 2
+ network 1
+ tools 1
+ orxonox 2
+ designtools 1
+ notifications 1
+ objects 2
+ overlays 1
+ pickup 1
+ pong 1
+ questsystem 1
+ weapons 1
+)
+
+SET(BUILD_UNITS_CONFIG_4_THREADS
+ util 2
+ core 4
+ network 2
+ tools 2
+ orxonox 4
+ designtools 1
+ notifications 1
+ objects 2
+ overlays 2
+ pickup 1
+ pong 1
+ questsystem 2
+ weapons 2
+)
+
+SET(BUILD_UNITS_CONFIG_8_THREADS
+ util 2
+ core 8
+ network 5
+ tools 3
+ orxonox 8
+ designtools 1
+ notifications 1
+ objects 3
+ overlays 3
+ pickup 2
+ pong 1
+ questsystem 3
+ weapons 3
+)
Property changes on: code/trunk/src/BuildUnitsConfigMSVC.cmake
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/external/enet/VERSION
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/external/tolua/README_ORXONOX
===================================================================
--- code/trunk/src/external/tolua/README_ORXONOX 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/external/tolua/README_ORXONOX 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,2 +1,2 @@
-Beware that this tolua folder does not fully contain Tolua++. Instead you can only find the source code required for the generator executable.
-The actual tolua library has to be supplied and is called CEGUI_TOLUA_LIBRARY because we use the one supplied with CEGUI.
+Beware that this tolua folder does not fully contain Tolua++. Instead you can only find the source code required for the generator executable.
+The actual tolua library has to be supplied and is called CEGUI_TOLUA_LIBRARY because we use the one supplied with CEGUI.
Property changes on: code/trunk/src/external/tolua/README_ORXONOX
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/Super.h
===================================================================
--- code/trunk/src/libraries/core/Super.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/core/Super.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -279,9 +279,6 @@
#define SUPER_changedUsed(classname, functionname, ...) \
SUPER_NOARGS(classname, functionname)
- #define SUPER_clone(classname, functionname, ...) \
- SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
#define SUPER_changedCarrier(classname, functionname, ...) \
SUPER_NOARGS(classname, functionname)
@@ -397,7 +394,7 @@
public: \
inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
{ \
- (dynamic_cast<T*>(object))->T:: functionname
+ (orxonox_cast<T*>(object))->T:: functionname
/*
JUST ADD THE FUNCTION ARGUMENTS BETWEEN BOTH MACROS, ENCLOSED BY BRACKETS
@@ -507,7 +504,7 @@
// @param ... The arguments of the function
inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
{
- (dynamic_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
+ (orxonox_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
}
Identifier* getParentIdentifier() const
@@ -565,15 +562,11 @@
()
SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
- SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, clone, true, OrxonoxClass*& item)
- (item)
- SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
- SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedCarrier, false)
+ SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
()
SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
- SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(13, changedPickedUp, false)
+ SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
()
SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
@@ -631,7 +624,6 @@
SUPER_INTRUSIVE_DECLARATION(changedName);
SUPER_INTRUSIVE_DECLARATION(changedGametype);
SUPER_INTRUSIVE_DECLARATION(changedUsed);
- SUPER_INTRUSIVE_DECLARATION(clone);
SUPER_INTRUSIVE_DECLARATION(changedCarrier);
SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
// (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
Modified: code/trunk/src/libraries/core/Template.cc
===================================================================
--- code/trunk/src/libraries/core/Template.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/core/Template.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -148,6 +148,11 @@
orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
+ // check if the template is applied on an object of the right type
+ Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());
+ if (!object->getIdentifier()->isA(identifier))
+ orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl;
+
Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
if (this->bLoadDefaults_)
Modified: code/trunk/src/libraries/core/XMLPort.h
===================================================================
--- code/trunk/src/libraries/core/XMLPort.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/core/XMLPort.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -196,7 +196,7 @@
containername = new orxonox::XMLPortClassParamContainer<objectclass>(std::string(paramname), ClassIdentifier<classname>::getIdentifier(), loadexecutor, saveexecutor); \
ClassIdentifier<classname>::getIdentifier()->addXMLPortParamContainer(paramname, containername); \
} \
- containername->port(dynamic_cast<BaseObject*>(this), object, xmlelement, mode)
+ containername->port(orxonox_cast<BaseObject*>(this), object, xmlelement, mode)
// --------------------
// XMLPortObjectExtended
Modified: code/trunk/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -593,7 +593,7 @@
@param name The group of the requested command
@param bPrintError If true, an error is printed if the command doesn't exist
*/
- /* static */ const ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+ /* static */ ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
{
// find the group
std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommand::getCommandMap().find(group);
@@ -623,7 +623,7 @@
@param name The group of the requested command in lowercase
@param bPrintError If true, an error is printed if the command doesn't exist
*/
- /* static */ const ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+ /* static */ ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
{
std::string groupLC = getLowercase(group);
std::string nameLC = getLowercase(name);
Modified: code/trunk/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -381,7 +381,7 @@
{
public:
/// Constructor: Creates a manipulator for a given ConsoleCommand.
- ConsoleCommandManipulator(const ConsoleCommand* command) : command_(const_cast<ConsoleCommand*>(command)) {}
+ ConsoleCommandManipulator(ConsoleCommand* command) : command_(command) {}
/// Changes the current function of the command. @param function The new function-pointer @param bForce If true, the new function-pointer is always assigned, even if the headers don't match
template <class F>
@@ -618,7 +618,7 @@
{ return this->inputConfiguredParam_; }
/// Returns a manipulator for this command.
- inline ConsoleCommandManipulator getManipulator() const
+ inline ConsoleCommandManipulator getManipulator()
{ return this; }
private:
@@ -666,14 +666,14 @@
{ return ConsoleCommand::getCommandMapLC(); }
/// Returns a command (shortcut) with given name. @param name The name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
- static inline const ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
+ static inline ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
{ return ConsoleCommand::getCommand("", name, bPrintError); }
/// Returns a command (shortcut) with given name in lowercase. @param name The lowercase name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
- static inline const ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
+ static inline ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
{ return ConsoleCommand::getCommandLC("", name, bPrintError); }
- static const ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
- static const ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
+ static ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
+ static ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
static void destroyAll();
Modified: code/trunk/src/libraries/util/output/ConsoleWriter.cc
===================================================================
--- code/trunk/src/libraries/util/output/ConsoleWriter.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/libraries/util/output/ConsoleWriter.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,107 +1,107 @@
-/*
- * 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:
- * Fabian 'x3n' Landau
- * Co-authors:
- * Reto Grieder
- *
- */
-
-/**
- @file
- @brief Implementation of the ConsoleWriter singleton.
-*/
-
-#include "ConsoleWriter.h"
-
-#include <iostream>
-
-#include "OutputManager.h"
-
-namespace orxonox
-{
- /**
- @brief Constructor, initializes the output level.
-
- In debug builds, it writes output up to level::internal_warning to the
- console, in release builds only up to level::user_info.
-
- After creation, the instance is enabled.
- */
- ConsoleWriter::ConsoleWriter() : BaseWriter("Console")
- {
-#ifdef ORXONOX_RELEASE
- this->setLevelMax(level::user_info);
-#else
- this->setLevelMax(level::internal_warning);
-#endif
- this->bEnabled_ = true;
- }
-
- /**
- @brief Destructor.
- */
- ConsoleWriter::~ConsoleWriter()
- {
- }
-
- /**
- @brief Returns the only existing instance of this class.
- */
- /*static*/ ConsoleWriter& ConsoleWriter::getInstance()
- {
- static ConsoleWriter instance;
- return instance;
- }
-
- /**
- @brief Inherited function from BaseWriter, writes output to the console using std::cout.
- */
- void ConsoleWriter::printLine(const std::string& line, OutputLevel)
- {
- std::cout << line << std::endl;
- }
-
- /**
- @brief Enables the instance by registering itself as listener at OutputManager.
- */
- void ConsoleWriter::enable()
- {
- if (!this->bEnabled_)
- {
- OutputManager::getInstance().registerListener(this);
- this->bEnabled_ = true;
- }
- }
-
- /**
- @brief Disables the instance by unregistering itself from OutputManager.
- */
- void ConsoleWriter::disable()
- {
- if (this->bEnabled_)
- {
- OutputManager::getInstance().unregisterListener(this);
- this->bEnabled_ = false;
- }
- }
-}
+/*
+ * 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:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * Reto Grieder
+ *
+ */
+
+/**
+ @file
+ @brief Implementation of the ConsoleWriter singleton.
+*/
+
+#include "ConsoleWriter.h"
+
+#include <iostream>
+
+#include "OutputManager.h"
+
+namespace orxonox
+{
+ /**
+ @brief Constructor, initializes the output level.
+
+ In debug builds, it writes output up to level::internal_warning to the
+ console, in release builds only up to level::user_info.
+
+ After creation, the instance is enabled.
+ */
+ ConsoleWriter::ConsoleWriter() : BaseWriter("Console")
+ {
+#ifdef ORXONOX_RELEASE
+ this->setLevelMax(level::user_info);
+#else
+ this->setLevelMax(level::internal_warning);
+#endif
+ this->bEnabled_ = true;
+ }
+
+ /**
+ @brief Destructor.
+ */
+ ConsoleWriter::~ConsoleWriter()
+ {
+ }
+
+ /**
+ @brief Returns the only existing instance of this class.
+ */
+ /*static*/ ConsoleWriter& ConsoleWriter::getInstance()
+ {
+ static ConsoleWriter instance;
+ return instance;
+ }
+
+ /**
+ @brief Inherited function from BaseWriter, writes output to the console using std::cout.
+ */
+ void ConsoleWriter::printLine(const std::string& line, OutputLevel)
+ {
+ std::cout << line << std::endl;
+ }
+
+ /**
+ @brief Enables the instance by registering itself as listener at OutputManager.
+ */
+ void ConsoleWriter::enable()
+ {
+ if (!this->bEnabled_)
+ {
+ OutputManager::getInstance().registerListener(this);
+ this->bEnabled_ = true;
+ }
+ }
+
+ /**
+ @brief Disables the instance by unregistering itself from OutputManager.
+ */
+ void ConsoleWriter::disable()
+ {
+ if (this->bEnabled_)
+ {
+ OutputManager::getInstance().unregisterListener(this);
+ this->bEnabled_ = false;
+ }
+ }
+}
Property changes on: code/trunk/src/libraries/util/output/ConsoleWriter.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,3 +37,4 @@
ADD_SUBDIRECTORY(tetris)
ADD_SUBDIRECTORY(weapons)
ADD_SUBDIRECTORY(docking)
+ADD_SUBDIRECTORY(towerdefense)
Modified: code/trunk/src/modules/docking/DockingController.cc
===================================================================
--- code/trunk/src/modules/docking/DockingController.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/docking/DockingController.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -59,7 +59,7 @@
return;
float distance = (this->dock_->getWorldPosition() - entity->getPosition()).length();
- Vector2 coord = get2DViewdirection( // I don't understand this too
+ Vector2 coord = get2DViewcoordinates( // I don't understand this too
entity->getPosition(),
entity->getOrientation() * WorldEntity::FRONT,
entity->getOrientation() * WorldEntity::UP,
@@ -69,8 +69,8 @@
// adjust direction of spaceship
if (distance > 10)
{
- entity->rotateYaw(-1.0f * 0.8f * sgn(coord.x) * coord.x*coord.x);
- entity->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
+ entity->rotateYaw(-1.0f * 0.8f * clamp(coord.x * 10, -1.0f, 1.0f));
+ entity->rotatePitch(0.8f * clamp(coord.y * 10, -1.0f, 1.0f));
}
/*// adjust speed
Modified: code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -111,7 +111,7 @@
{
const std::string& message = "You have " + multi_cast<std::string>(this->bTimeLimit_)
+ " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
- const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
+ gametype->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
}
Property changes on: code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/gametypes/OldRaceCheckPoint.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/gametypes/OldSpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -57,7 +57,7 @@
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!";
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
else
@@ -67,7 +67,7 @@
int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
+ "." + multi_cast<std::string>(ms) + " seconds.";
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
/*
float time = this->clock_.getSecondsPrecise();
@@ -84,7 +84,7 @@
Gametype::start();
std::string message("The match has started! Reach the check points as quickly as possible!");
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
@@ -97,7 +97,7 @@
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_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
Property changes on: code/trunk/src/modules/gametypes/OldSpaceRace.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/gametypes/OldSpaceRace.h
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -58,6 +58,8 @@
virtual void end();
virtual void newCheckpointReached();
+ virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command.
+ //<! This is only a temporary solution. Better: create racingBots.
inline void setCheckpointsReached(int n)
{ this->checkpointsReached_ = n;}
Property changes on: code/trunk/src/modules/gametypes/OldSpaceRace.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -96,7 +96,7 @@
{
std::string message = "You have " + multi_cast<std::string>(this->timeLimit_)
+ " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
- const_cast<GametypeInfo*>(this->getGametype()->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametype()->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
}
Modified: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
* Author:
* Mauro Salomon
* Co-authors:
- * ...
+ * Celine Egger
*
*/
@@ -47,6 +47,8 @@
this->cantMove_ = false;
this->bTimeIsUp_ = false;
+ this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race
+ // remove this line, if a raceBot has been created.
}
void SpaceRace::end()
@@ -69,7 +71,7 @@
+ "." + multi_cast<std::string>(ms) + " seconds.";
}
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
@@ -96,7 +98,7 @@
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);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
}
@@ -111,7 +113,7 @@
const std::string& message = "Checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
+ " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
Modified: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -148,7 +148,7 @@
gametype->end();
}
else
- {
+ {
// adjust the radarvisibility
gametype->newCheckpointReached(newCheckpoint, player);
this->updateRadarVisibility(oldCheckpoint, newCheckpoint);
Property changes on: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/gametypes/SpaceRaceManager.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/CheckPoint.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/objects/triggers/CheckPoint.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -108,13 +108,13 @@
if (bIsDestination_)
{
- const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Congratulations - you have won the match!");
+ gametype->getGametypeInfo()->sendAnnounceMessage("Congratulations - you have won the match!");
gametype->end();
}
if (!bIsFirst_ && !bIsDestination_)
{
- const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Checkpoint reached");
+ gametype->getGametypeInfo()->sendAnnounceMessage("Checkpoint reached");
}
}
}
Modified: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -94,7 +94,6 @@
class LastManStandingInfos;
class PauseNotice;
class TeamBaseMatchScore;
- class UnderAttackHealthBar;
// stats
class CreateLines;
Modified: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -11,7 +11,6 @@
AnnounceMessage.cc
KillMessage.cc
DeathMessage.cc
- UnderAttackHealthBar.cc
TeamBaseMatchScore.cc
GametypeStaticMessage.cc
GametypeFadingMessage.cc
Property changes on: code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/overlays/hud/HUDBoostBar.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
* Author:
* Matthias Spalinger
* Co-authors:
- * Fabian 'x3n' Landau
+ * Fabian 'x3n' Landau
*
*/
@@ -55,8 +55,8 @@
void HUDEnemyHealthBar::tick(float dt)
{
this->updateTarget();
-
- SUPER(HUDEnemyHealthBar, tick, dt);
+
+ SUPER(HUDEnemyHealthBar, tick, dt);
}
void HUDEnemyHealthBar::updateTarget()
@@ -81,9 +81,9 @@
void HUDEnemyHealthBar::changedOwner()
{
- SUPER(HUDEnemyHealthBar, changedOwner);
-
- this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
- this->updateTarget();
+ SUPER(HUDEnemyHealthBar, changedOwner);
+
+ this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
+ this->updateTarget();
}
}
Property changes on: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,7 +22,7 @@
* Author:
* Matthias Spalinger
* Co-authors:
- * Fabian 'x3n' Landau
+ * Fabian 'x3n' Landau
*
*/
Property changes on: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -54,395 +54,374 @@
namespace orxonox
{
-bool compareDistance ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b )
-{
- return a.second<b.second;
+ bool compareDistance(std::pair<RadarViewable*, unsigned int> a, std::pair<RadarViewable*, unsigned int> b)
+ {
+ return a.second < b.second;
+ }
-}
+ CreateFactory ( HUDNavigation );
-void HUDNavigation::setConfigValues()
-{
- SetConfigValue(markerLimit_, 3);
- SetConfigValue(showDistance, false);
-}
+ HUDNavigation::HUDNavigation(BaseObject* creator) : OrxonoxOverlay(creator)
+ {
+ RegisterObject(HUDNavigation);
+ this->setConfigValues();
-CreateFactory ( HUDNavigation );
+ // Set default values
+ this->setFont("Monofur");
+ this->setTextSize(0.05f);
+ this->setNavMarkerSize(0.05f);
+ this->setDetectionLimit(10000.0f);
+ }
-HUDNavigation::HUDNavigation ( BaseObject* creator )
- : OrxonoxOverlay ( creator )
-{
- RegisterObject ( HUDNavigation );
- this->setConfigValues();
+ HUDNavigation::~HUDNavigation()
+ {
+ if (this->isInitialized())
+ {
+ for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end();)
+ removeObject((it++)->first);
+ }
+ this->sortedObjectList_.clear();
+ }
- // Set default values
- this->setFont ( "Monofur" );
- this->setTextSize ( 0.05f );
- this->setNavMarkerSize ( 0.05f );
- this->setDetectionLimit( 10000.0f );
-}
+ void HUDNavigation::setConfigValues()
+ {
+ SetConfigValue(markerLimit_, 3);
+ SetConfigValue(showDistance_, false);
+ }
-HUDNavigation::~HUDNavigation()
-{
- if ( this->isInitialized() )
+ void HUDNavigation::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
- for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); )
- removeObject ( ( it++ )->first );
+ SUPER(HUDNavigation, XMLPort, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "font", setFont, getFont, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
}
- sortedObjectList_.clear();
-}
+ void HUDNavigation::setFont(const std::string& font)
+ {
+ const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName(font);
+ if (fontPtr.isNull())
+ {
+ orxout(internal_warning) << "HUDNavigation: Font '" << font << "' not found" << endl;
+ return;
+ }
+ this->fontName_ = font;
+ for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
+ {
+ if (it->second.text_ != NULL)
+ it->second.text_->setFontName(this->fontName_);
+ }
+ }
-void HUDNavigation::XMLPort ( Element& xmlelement, XMLPort::Mode mode )
-{
- SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
-
- XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
-}
-
-void HUDNavigation::setFont ( const std::string& font )
-{
- const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName ( font );
- if ( fontPtr.isNull() )
+ const std::string& HUDNavigation::getFont() const
{
- orxout(internal_warning) << "HUDNavigation: Font '" << font << "' not found" << endl;
- return;
+ return this->fontName_;
}
- fontName_ = font;
- for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it )
+
+ void HUDNavigation::setTextSize(float size)
{
- if ( it->second.text_ != NULL )
- it->second.text_->setFontName ( fontName_ );
+ if (size <= 0.0f)
+ {
+ orxout(internal_warning) << "HUDNavigation: Negative font size not allowed" << endl;
+ return;
+ }
+ this->textSize_ = size;
+ for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)
+ {
+ if (it->second.text_)
+ it->second.text_->setCharHeight(size);
+ }
}
-}
-const std::string& HUDNavigation::getFont() const
-{
- return fontName_;
-}
-
-void HUDNavigation::setTextSize ( float size )
-{
- if ( size <= 0.0f )
+ float HUDNavigation::getTextSize() const
{
- orxout(internal_warning) << "HUDNavigation: Negative font size not allowed" << endl;
- return;
+ return this->textSize_;
}
- textSize_ = size;
- for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
+
+ float HUDNavigation::getArrowSizeX(int dist) const
{
- if ( it->second.text_ )
- it->second.text_->setCharHeight ( size );
+ if (dist < 600)
+ dist = 600;
+ return this->getActualSize().x * 900 * this->navMarkerSize_ / dist;
}
-}
-float HUDNavigation::getTextSize() const
-{
- return textSize_;
-}
-
-float HUDNavigation::getArrowSizeX(int dist)
-{
- if (dist < 600)
- dist = 600;
- return this->getActualSize().x * 900 * navMarkerSize_ / dist;
-}
-
-float HUDNavigation::getArrowSizeY(int dist)
-{
- if (dist < 600)
- dist = 600;
- return this->getActualSize().y * 900 * navMarkerSize_ / dist;
-}
-
-void HUDNavigation::tick ( float dt )
-{
- SUPER ( HUDNavigation, tick, dt );
-
- Camera* cam = CameraManager::getInstance().getActiveCamera();
- if ( cam == NULL )
- return;
- const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
-
-
- for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+ float HUDNavigation::getArrowSizeY(int dist) const
{
- listIt->second = ( int ) ( ( listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition() ).length() + 0.5f );
+ if (dist < 600)
+ dist = 600;
+ return this->getActualSize().y * 900 * this->navMarkerSize_ / dist;
}
- sortedObjectList_.sort ( compareDistance );
-
- unsigned int markerCount_ = 0;
- bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
-
-// for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
- for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
+ void HUDNavigation::tick(float dt)
{
- ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
- closeEnough_ = listIt->second < detectionLimit_ ;
- // display radarviewables on HUD if the marker limit and max-distance is not exceeded
- if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) )
- {
+ SUPER(HUDNavigation, tick, dt);
+ Camera* cam = CameraManager::getInstance().getActiveCamera();
+ if (cam == NULL)
+ return;
+ const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
- // Get Distance to HumanController and save it in the TextAreaOverlayElement.
- int dist = listIt->second;
- float textLength = 0.0f;
- //display distance next to cursor
- if (showDistance){
- it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
- textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
- }
+ for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
+ listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
- //display name next to cursor
- else{
- it->second.text_->setCaption(it->first->getRadarName());
- textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
- }
+ this->sortedObjectList_.sort(compareDistance);
- // Transform to screen coordinates
- Vector3 pos = camTransform * it->first->getRVWorldPosition();
+ unsigned int markerCount = 0;
+ bool closeEnough = false; // only display objects that are close enough to be relevant for the player
- bool outOfView = true;
- if ( pos.z > 1.0 )
+ for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
+ {
+ std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
+ closeEnough = listIt->second < this->detectionLimit_;
+ // display radarviewables on HUD if the marker limit and max-distance is not exceeded
+ if (markerCount < this->markerLimit_ && (closeEnough || this->detectionLimit_ < 0))
{
- // z > 1.0 means that the object is behind the camera
- outOfView = true;
- // we have to switch all coordinates (if you don't know why,
- // try linear algebra lectures, because I can't explain..)
- pos.x = -pos.x;
- pos.y = -pos.y;
- }
- else
- outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
+ // Get Distance to HumanController and save it in the TextAreaOverlayElement.
+ int dist = listIt->second;
+ float textLength = 0.0f;
- if ( outOfView )
- {
- // Object is not in view
-
- // Change material only if outOfView changed
- if ( !it->second.wasOutOfView_ )
+ if (this->showDistance_)
{
- it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "arrows.png", it->first->getRadarObjectColour()) );
- it->second.wasOutOfView_ = true;
+ //display distance next to cursor
+ it->second.text_->setCaption(multi_cast<std::string>(dist));
+ textLength = multi_cast<std::string>(dist).size() * it->second.text_->getCharHeight() * 0.3f;
}
+ else
+ {
+ //display name next to cursor
+ it->second.text_->setCaption(it->first->getRadarName());
+ textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
+ }
- //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist;
- //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist;
+ // Transform to screen coordinates
+ Vector3 pos = camTransform * it->first->getRVWorldPosition();
- // Adjust Arrowsize according to distance
- it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist));
+ bool outOfView = true;
+ if (pos.z > 1.0)
+ {
+ // z > 1.0 means that the object is behind the camera
+ outOfView = true;
+ // we have to switch all coordinates (if you don't know why,
+ // try linear algebra lectures, because I can't explain..)
+ pos.x = -pos.x;
+ pos.y = -pos.y;
+ }
+ else
+ outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
- // Switch between top, bottom, left and right position of the arrow at the screen border
- if ( pos.x < pos.y )
+ if (outOfView)
{
- if ( pos.y > -pos.x )
+ // Object is not in view
+
+ // Change material only if outOfView changed
+ if (!it->second.wasOutOfView_)
{
- // Top
- float position = pos.x / pos.y + 1.0f;
- it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 0.0f );
- it->second.panel_->setUV ( 0.5f, 0.0f, 1.0f, 0.5f );
- it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
- it->second.text_->setTop ( it->second.panel_->getHeight() );
+ it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
+ it->second.wasOutOfView_ = true;
}
+
+ //float xDistScale = this->getActualSize().x * 1000.0f * this->navMarkerSize_ / dist;
+ //float yDistScale = this->getActualSize().y * 1000.0f * this->navMarkerSize_ / dist;
+
+ // Adjust Arrowsize according to distance
+ it->second.panel_->setDimensions(getArrowSizeX(dist), getArrowSizeY(dist));
+
+ // Switch between top, bottom, left and right position of the arrow at the screen border
+ if (pos.x < pos.y)
+ {
+ if (pos.y > -pos.x)
+ {
+ // Top
+ float position = pos.x / pos.y + 1.0f;
+ it->second.panel_->setPosition((position - it->second.panel_->getWidth()) * 0.5f, 0.0f);
+ it->second.panel_->setUV(0.5f, 0.0f, 1.0f, 0.5f);
+ it->second.text_->setLeft((position - textLength) * 0.5f);
+ it->second.text_->setTop(it->second.panel_->getHeight());
+ }
+ else
+ {
+ // Left
+ float position = pos.y / pos.x + 1.0f;
+ it->second.panel_->setPosition(0.0f, (position - it->second.panel_->getWidth()) * 0.5f);
+ it->second.panel_->setUV(0.0f, 0.0f, 0.5f, 0.5f);
+ it->second.text_->setLeft(it->second.panel_->getWidth() + 0.01f);
+ it->second.text_->setTop((position - it->second.text_->getCharHeight()) * 0.5f);
+ }
+ }
else
{
- // Left
- float position = pos.y / pos.x + 1.0f;
- it->second.panel_->setPosition ( 0.0f, ( position - it->second.panel_->getWidth() ) * 0.5f );
- it->second.panel_->setUV ( 0.0f, 0.0f, 0.5f, 0.5f );
- it->second.text_->setLeft ( it->second.panel_->getWidth() + 0.01f );
- it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
+ if (pos.y < -pos.x)
+ {
+ // Bottom
+ float position = -pos.x / pos.y + 1.0f;
+ it->second.panel_->setPosition((position - it->second.panel_->getWidth()) * 0.5f, 1.0f - it->second.panel_->getHeight());
+ it->second.panel_->setUV(0.0f, 0.5f, 0.5f, 1.0f );
+ it->second.text_->setLeft((position - textLength) * 0.5f);
+ it->second.text_->setTop(1.0f - it->second.panel_->getHeight() - it->second.text_->getCharHeight());
+ }
+ else
+ {
+ // Right
+ float position = -pos.y / pos.x + 1.0f;
+ it->second.panel_->setPosition(1.0f - it->second.panel_->getWidth(), (position - it->second.panel_->getHeight()) * 0.5f);
+ it->second.panel_->setUV(0.5f, 0.5f, 1.0f, 1.0f);
+ it->second.text_->setLeft(1.0f - it->second.panel_->getWidth() - textLength - 0.01f);
+ it->second.text_->setTop((position - it->second.text_->getCharHeight()) * 0.5f);
+ }
}
}
-
else
{
+ // Object is in view
- if ( pos.y < -pos.x )
+ // Change material only if outOfView changed
+ if (it->second.wasOutOfView_)
{
- // Bottom
- float position = -pos.x / pos.y + 1.0f;
- it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 1.0f - it->second.panel_->getHeight() );
- it->second.panel_->setUV ( 0.0f, 0.5f, 0.5f, 1.0f );
- it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
- it->second.text_->setTop ( 1.0f - it->second.panel_->getHeight() - it->second.text_->getCharHeight() );
+ //it->second.panel_->setMaterialName("Orxonox/NavTDC");
+ it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("tdc.png", it->first->getRadarObjectColour()));
+ it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
+ it->second.wasOutOfView_ = false;
}
- else
- {
- // Right
- float position = -pos.y / pos.x + 1.0f;
- it->second.panel_->setPosition ( 1.0f - it->second.panel_->getWidth(), ( position - it->second.panel_->getHeight() ) * 0.5f );
- it->second.panel_->setUV ( 0.5f, 0.5f, 1.0f, 1.0f );
- it->second.text_->setLeft ( 1.0f - it->second.panel_->getWidth() - textLength - 0.01f );
- it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
- }
- }
- }
- else
- {
- // Object is in view
- // Change material only if outOfView changed
- if ( it->second.wasOutOfView_ )
- {
- //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
- it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) );
- it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y );
- it->second.wasOutOfView_ = false;
+ // Position marker
+ it->second.panel_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+ it->second.panel_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f);
+ it->second.panel_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f);
+
+ // Position text
+ it->second.text_->setLeft((pos.x + 1.0f + it->second.panel_->getWidth()) * 0.5f);
+ it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
}
- // Position marker
- it->second.panel_->setUV ( 0.0f, 0.0f, 1.0f, 1.0f );
- it->second.panel_->setLeft ( ( pos.x + 1.0f - it->second.panel_->getWidth() ) * 0.5f );
- it->second.panel_->setTop ( ( -pos.y + 1.0f - it->second.panel_->getHeight() ) * 0.5f );
-
- // Position text
- it->second.text_->setLeft ( ( pos.x + 1.0f + it->second.panel_->getWidth() ) * 0.5f );
- it->second.text_->setTop ( ( -pos.y + 1.0f + it->second.panel_->getHeight() ) * 0.5f );
+ // Make sure the overlays are shown
+ it->second.panel_->show();
+ it->second.text_->show();
}
-
- // Make sure the overlays are shown
- it->second.panel_->show();
- it->second.text_->show();
+ else // do not display on HUD
+ {
+ it->second.panel_->hide();
+ it->second.text_->hide();
+ }
}
- else // do not display on HUD
- {
- it->second.panel_->hide();
- it->second.text_->hide();
- }
-
}
-}
-
-/** Overridden method of OrxonoxOverlay.
- at details
- Usually the entire overlay scales with scale().
- Here we obviously have to adjust this.
-*/
-void HUDNavigation::sizeChanged()
-{
- // Use size to compensate for aspect ratio if enabled.
- float xScale = this->getActualSize().x;
- float yScale = this->getActualSize().y;
-
- for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
+ /** Overridden method of OrxonoxOverlay.
+ @details
+ Usually the entire overlay scales with scale().
+ Here we obviously have to adjust this.
+ */
+ void HUDNavigation::sizeChanged()
{
- if ( it->second.panel_ != NULL )
- it->second.panel_->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
- if ( it->second.text_ != NULL )
- it->second.text_->setCharHeight ( it->second.text_->getCharHeight() * yScale );
+ // Use size to compensate for aspect ratio if enabled.
+ float xScale = this->getActualSize().x;
+ float yScale = this->getActualSize().y;
+
+ for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
+ {
+ if (it->second.panel_ != NULL)
+ it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
+ if (it->second.text_ != NULL)
+ it->second.text_->setCharHeight(it->second.text_->getCharHeight() * yScale);
+ }
}
-}
-void HUDNavigation::addObject ( RadarViewable* object )
-{
- if( showObject(object)==false )
- return;
-
- if ( activeObjectList_.size() >= markerLimit_ )
- if ( object == NULL )
+ void HUDNavigation::addObject(RadarViewable* object)
+ {
+ if (showObject(object) == false)
return;
- // Object hasn't been added yet (we know that)
- assert ( this->activeObjectList_.find ( object ) == this->activeObjectList_.end() );
+ if (this->activeObjectList_.size() >= this->markerLimit_)
+ if (object == NULL)
+ return;
- // Scales used for dimensions and text size
- float xScale = this->getActualSize().x;
- float yScale = this->getActualSize().y;
+ // Object hasn't been added yet (we know that)
+ assert(this->activeObjectList_.find(object) == this->activeObjectList_.end());
- // Create everything needed to display the object on the radar and add it to the map
+ // Scales used for dimensions and text size
+ float xScale = this->getActualSize().x;
+ float yScale = this->getActualSize().y;
- // Create arrow/marker
- Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*> ( Ogre::OverlayManager::getSingleton()
- .createOverlayElement ( "Panel", "HUDNavigation_navMarker_" + getUniqueNumberString() ) );
-// panel->setMaterialName ( "Orxonox/NavTDC" );
- panel->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", object->getRadarObjectColour()) );
- panel->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
-// panel->setColour( object->getRadarObjectColour() );
+ // Create everything needed to display the object on the radar and add it to the map
- Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*> ( Ogre::OverlayManager::getSingleton()
- .createOverlayElement ( "TextArea", "HUDNavigation_navText_" + getUniqueNumberString() ) );
- text->setFontName ( this->fontName_ );
- text->setCharHeight ( text->getCharHeight() * yScale );
- text->setColour( object->getRadarObjectColour() );
+ // Create arrow/marker
+ Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton()
+ .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
+ //panel->setMaterialName("Orxonox/NavTDC");
+ panel->setMaterialName(TextureGenerator::getMaterialName("tdc.png", object->getRadarObjectColour()));
+ panel->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
+ //panel->setColour(object->getRadarObjectColour());
- panel->hide();
- text->hide();
+ Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton()
+ .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+ text->setFontName(this->fontName_);
+ text->setCharHeight(text->getCharHeight() * yScale);
+ text->setColour(object->getRadarObjectColour());
- ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
- activeObjectList_[object] = tempStruct;
+ panel->hide();
+ text->hide();
- this->background_->addChild ( panel );
- this->background_->addChild ( text );
+ ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
+ this->activeObjectList_[object] = tempStruct;
- sortedObjectList_.push_front ( std::make_pair ( object, ( unsigned int ) 0 ) );
+ this->background_->addChild(panel);
+ this->background_->addChild(text);
+ this->sortedObjectList_.push_front(std::make_pair(object, (unsigned int)0));
+ }
-}
-
-void HUDNavigation::removeObject ( RadarViewable* viewable )
-{
- ObjectMap::iterator it = activeObjectList_.find ( viewable );
-
- if ( activeObjectList_.find ( viewable ) != activeObjectList_.end() )
+ void HUDNavigation::removeObject(RadarViewable* viewable)
{
- // Detach overlays
- this->background_->removeChild ( it->second.panel_->getName() );
- this->background_->removeChild ( it->second.text_->getName() );
- // Properly destroy the overlay elements (do not use delete!)
- Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.panel_ );
- Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.text_ );
- // Remove from the list
- activeObjectList_.erase ( viewable );
+ std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(viewable);
+ if (this->activeObjectList_.find(viewable) != this->activeObjectList_.end())
+ {
+ // Detach overlays
+ this->background_->removeChild(it->second.panel_->getName());
+ this->background_->removeChild(it->second.text_->getName());
+ // Properly destroy the overlay elements (do not use delete!)
+ Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
+ Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.text_);
+ // Remove from the list
+ this->activeObjectList_.erase(viewable);
+ }
+ for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
+ {
+ if ((listIt->first) == viewable)
+ {
+ this->sortedObjectList_.erase(listIt);
+ break;
+ }
+ }
}
- for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+ void HUDNavigation::objectChanged(RadarViewable* viewable)
{
- if ( (listIt->first) == viewable )
- {
- sortedObjectList_.erase ( listIt );
- break;
- }
+ // TODO: niceification neccessary ;)
+ removeObject(viewable);
+ addObject(viewable);
+ }
+ bool HUDNavigation::showObject(RadarViewable* rv)
+ {
+ if (rv == orxonox_cast<RadarViewable*>(this->getOwner()))
+ return false;
+ assert(rv->getWorldEntity());
+ if (rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false)
+ return false;
+ return true;
}
-}
-
-void HUDNavigation::objectChanged(RadarViewable* viewable)
-{
- // TODO: niceification neccessary ;)
- removeObject(viewable);
- addObject(viewable);
-}
-
-
-bool HUDNavigation::showObject(RadarViewable* rv)
-{
- if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
- return false;
- assert( rv->getWorldEntity() );
- if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
- return false;
- return true;
-}
-
-void HUDNavigation::changedOwner()
-{
-
- const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
- for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it )
+ void HUDNavigation::changedOwner()
{
- if ( ! ( *it )->isHumanShip_ )
- this->addObject ( *it );
+ const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
+ for (std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)
+ {
+ if (!(*it)->isHumanShip_)
+ this->addObject(*it);
+ }
}
}
-
-}
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -35,7 +35,6 @@
#include <map>
#include <string>
-
#include "util/OgreForwardRefs.h"
#include "tools/interfaces/Tickable.h"
#include "interfaces/RadarListener.h"
@@ -43,79 +42,78 @@
namespace orxonox
{
-class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
-{
-public:
- HUDNavigation ( BaseObject* creator );
- virtual ~HUDNavigation();
+ class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
+ {
+ public:
+ HUDNavigation(BaseObject* creator);
+ virtual ~HUDNavigation();
- void setConfigValues();
+ void setConfigValues();
- virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
- virtual void tick ( float dt );
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt);
- // RadarListener interface
- virtual void addObject ( RadarViewable* object );
- virtual void removeObject ( RadarViewable* viewable );
- virtual void objectChanged ( RadarViewable* viewable );
+ // RadarListener interface
+ virtual void addObject(RadarViewable* object);
+ virtual void removeObject(RadarViewable* viewable);
+ virtual void objectChanged(RadarViewable* viewable);
- virtual void changedOwner();
- virtual void sizeChanged();
- virtual void angleChanged() { }
- virtual void positionChanged() { }
- virtual void radarTick ( float dt ) {}
+ virtual void changedOwner();
+ virtual void sizeChanged();
+ virtual void angleChanged() { }
+ virtual void positionChanged() { }
+ virtual void radarTick(float dt) {}
- inline float getRadarSensitivity() const
- { return 1.0f; }
+ inline float getRadarSensitivity() const
+ { return 1.0f; }
- unsigned int getMarkerLimit() { return this->markerLimit_; }
+ inline unsigned int getMarkerLimit() const
+ { return this->markerLimit_; }
-private:
- struct ObjectInfo
- {
- Ogre::PanelOverlayElement* panel_;
- Ogre::TextAreaOverlayElement* text_;
- bool outOfView_;
- bool wasOutOfView_;
+ private:
+ struct ObjectInfo
+ {
+ Ogre::PanelOverlayElement* panel_;
+ Ogre::TextAreaOverlayElement* text_;
+ bool outOfView_;
+ bool wasOutOfView_;
+ };
- };
+ bool showObject(RadarViewable* rv);
- bool showObject( RadarViewable* rv );
+ // XMLPort accessors
+ inline void setNavMarkerSize(float size)
+ {
+ navMarkerSize_ = size;
+ this->sizeChanged();
+ }
+ inline float getNavMarkerSize() const
+ { return navMarkerSize_; }
+ inline void setDetectionLimit(float limit)
+ { this->detectionLimit_ = limit; }
+ inline float getDetectionLimit() const
+ { return this->detectionLimit_; }
- // XMLPort accessors
- void setNavMarkerSize ( float size )
- { navMarkerSize_ = size; this->sizeChanged(); }
- float getNavMarkerSize() const
- { return navMarkerSize_; }
- void setDetectionLimit( float limit )
- { this->detectionLimit_ = limit; }
- float getDetectionLimit() const
- { return this->detectionLimit_; }
+ void setTextSize(float size);
+ float getTextSize() const;
- void setTextSize ( float size );
- float getTextSize() const;
+ void setFont(const std::string& font);
+ const std::string& getFont() const;
- void setFont ( const std::string& font );
- const std::string& getFont() const;
+ float getArrowSizeX(int dist) const;
+ float getArrowSizeY(int dist) const;
- typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
- ObjectMap activeObjectList_;
+ std::map<RadarViewable*, ObjectInfo> activeObjectList_;
+ std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
- typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
- sortedList sortedObjectList_;
+ float navMarkerSize_;
+ std::string fontName_;
+ float textSize_;
+ bool showDistance_;
- float getArrowSizeX(int dist);
- float getArrowSizeY(int dist);
-
- float navMarkerSize_;
- std::string fontName_;
- float textSize_;
- bool showDistance;
-
- unsigned int markerLimit_;
- float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
-
-};
+ unsigned int markerLimit_;
+ float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
+ };
}
#endif /* _HUDNavigation_H__ */
Modified: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -91,7 +91,7 @@
void HUDRadar::addObject(RadarViewable* object)
{
- if (object == dynamic_cast<RadarViewable*>(this->owner_))
+ if (object == orxonox_cast<RadarViewable*>(this->owner_))
return;
if( showObject(object) == false ) //do not show objects that are "invisible" or "radar invisible"
return;
@@ -188,7 +188,7 @@
bool HUDRadar::showObject(RadarViewable* rv)
{
- if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
+ if ( rv == orxonox_cast<RadarViewable*> ( this->getOwner() ) )
return false;
assert( rv->getWorldEntity() );
if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
Deleted: code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,108 +0,0 @@
-/*
- * 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:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#include "UnderAttackHealthBar.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "infos/PlayerInfo.h"
-#include "gametypes/UnderAttack.h"
-#include "worldentities/pawns/Destroyer.h"
-#include "overlays/OverlayGroup.h"
-
-namespace orxonox
-{
- CreateFactory(UnderAttackHealthBar);
-
- UnderAttackHealthBar::UnderAttackHealthBar(BaseObject* creator) : HUDHealthBar(creator)
- {
- RegisterObject(UnderAttackHealthBar);
-
- this->owner_ = 0;
-
- this->text_ = new OverlayText(this);
- this->text_->setFont("Monofur");
- this->text_->setTextSize(0.04f);
- this->text_->setAlignmentString("center");
- this->text_->setColour(ColourValue::White);
- this->text_->setPickPoint(Vector2(0.5, 0));
-
- this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this)));
- }
-
- UnderAttackHealthBar::~UnderAttackHealthBar()
- {
- if (this->isInitialized())
- {
- this->text_->destroy();
- this->text_ = 0;
- }
- }
-
- void UnderAttackHealthBar::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(UnderAttackHealthBar, XMLPort, xmlelement, mode);
-
- XMLPortParam(UnderAttackHealthBar, "descriptionpickpoint", setDescriptionPickPoint, getDescriptionPickPoint, xmlelement, mode);
- XMLPortParam(UnderAttackHealthBar, "descriptionoffset", setDescriptionOffset, getDescriptionOffset, xmlelement, mode);
- }
-
- void UnderAttackHealthBar::changedOwner()
- {
- SUPER(UnderAttackHealthBar, changedOwner);
-
- PlayerInfo* player = orxonox_cast<PlayerInfo*>(this->getOwner());
- if (player)
- {
- this->owner_ = player;
-
- UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype().get());
- if (ua)
- {
- this->setOwner(ua->getDestroyer());
-
- if (ua->getTeam(player) == 0)
- this->text_->setCaption("Attack the Transporter!");
- else
- this->text_->setCaption("Defend the Transporter!");
- }
- }
- }
-
- void UnderAttackHealthBar::changedOverlayGroup()
- {
- SUPER(UnderAttackHealthBar, changedOverlayGroup);
-
- this->getOverlayGroup()->addElement(this->text_.get());
- }
-
- void UnderAttackHealthBar::init()
- {
- this->setOwner(this->owner_);
- }
-}
Deleted: code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,68 +0,0 @@
-/*
- * 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:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _UnderAttackHealthBar_H__
-#define _UnderAttackHealthBar_H__
-
-#include "overlays/OverlaysPrereqs.h"
-
-#include "util/Math.h"
-#include "tools/Timer.h"
-#include "HUDHealthBar.h"
-
-namespace orxonox
-{
- class _OverlaysExport UnderAttackHealthBar : public HUDHealthBar
- {
- public:
- UnderAttackHealthBar(BaseObject* creator);
- virtual ~UnderAttackHealthBar();
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedOwner();
- virtual void changedOverlayGroup();
-
- inline void setDescriptionPickPoint(const Vector2& pickpoint)
- { this->text_->setPickPoint(pickpoint); }
- inline Vector2 getDescriptionPickPoint() const
- { return this->text_->getPickPoint(); }
-
- inline void setDescriptionOffset(const Vector2& position)
- { this->text_->setPosition(this->getPosition() + (position - this->getPickPoint()) * this->getSize()); }
- inline Vector2 getDescriptionOffset() const
- { return (this->text_->getPosition() - this->getPosition()) / this->getSize() + this->getPickPoint(); }
-
- private:
- void init();
-
- PlayerInfo* owner_;
- SmartPtr<OverlayText> text_;
- Timer inittimer_;
- };
-}
-#endif /* _UnderAttackHealthBar_H__ */
Modified: code/trunk/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,9 +1,7 @@
SET_SOURCE_FILES(PICKUP_SRC_FILES
CollectiblePickup.cc
- DroppedPickup.cc
Pickup.cc
PickupCollection.cc
- PickupCollectionIdentifier.cc
PickupManager.cc
PickupRepresentation.cc
PickupSpawner.cc
Modified: code/trunk/src/modules/pickup/CollectiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/CollectiblePickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -44,11 +44,9 @@
Constructor.
Registers the object and initializes variables.
*/
- CollectiblePickup::CollectiblePickup() : isInCollection_(false)
+ CollectiblePickup::CollectiblePickup() : collection_(NULL)
{
RegisterObject(CollectiblePickup);
-
- this->collection_ = NULL;
}
/**
@@ -57,55 +55,12 @@
*/
CollectiblePickup::~CollectiblePickup()
{
-
+ if (this->isInCollection())
+ this->collection_->removePickupable(this);
}
/**
@brief
- Is called by OrxonoxClass::destroy() before the object is actually destroyed.
- */
- void CollectiblePickup::preDestroy(void)
- {
- this->Pickupable::preDestroy();
-
- // The PickupCollection has to be destroyed as well.
- if(this->isInCollection())
- this->collection_->Pickupable::destroy();
- }
-
- /**
- @brief
- Destroys a Pickupable.
- */
- void CollectiblePickup::destroyPickup(void)
- {
- if(!this->isInCollection()) // If the CollectiblePickup is not in a PickupCollection the destroyPickup method of Pickupable is called.
- this->Pickupable::destroyPickup();
- else // Else the ColectiblePickup is dropped and disabled,
- {
- this->drop(false);
- if(this->isInCollection() && this->isEnabled()) // It is only disabled if it is enabled and still ina PickupCollection after having been dropped.
- {
- this->setDisabled();
- this->collection_->pickupDisabled();
- }
- }
- }
-
- /**
- @brief
- Is called by the PickupCarrier when it is being destroyed.
- */
- void CollectiblePickup::carrierDestroyed(void)
- {
- if(!this->isInCollection())
- this->Pickupable::destroy();
- else // If the CollectiblePickup is part of a PickupCollection it is just dropped instead of destroyed.
- this->drop(false);
- }
-
- /**
- @brief
Is called when the pickup has transited from used to unused or the other way around.
*/
void CollectiblePickup::changedUsed(void)
@@ -130,36 +85,21 @@
/**
@brief
- Adds this CollectiblePickup to the input PickupCollection.
+ Notifies this CollectiblePickup that it was added to a PickupCollection.
@param collection
A pointer to the PickupCollection to which the CollectiblePickup should be added.
- @return
- Returns true if the CollectiblePickup was successfully added to the PickupCollection.
*/
- bool CollectiblePickup::addToCollection(PickupCollection* collection)
+ void CollectiblePickup::wasAddedToCollection(PickupCollection* collection)
{
- if(this->isInCollection() || collection == NULL) //If the CollectiblePickup already is in a PickupCollection or if the input pointer is NULL.
- return false;
-
- this->isInCollection_ = true;
this->collection_ = collection;
- return true;
}
/**
@brief
- Removes this CollectiblePickup from its PickupCollection.
- @return
- Returns true if the CollectiblePickup was succcessfully removed.
+ Notifies this CollectiblePickup that it was removed from its PickupCollection.
*/
- bool CollectiblePickup::removeFromCollection(void)
+ void CollectiblePickup::wasRemovedFromCollection(void)
{
- if(!this->isInCollection()) //If the CollectiblePickup is not in a PickupCollection.
- return false;
-
- this->isInCollection_ = false;
this->collection_ = NULL;
- return true;
}
-
}
Modified: code/trunk/src/modules/pickup/CollectiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/CollectiblePickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -54,6 +54,7 @@
*/
class _PickupExport CollectiblePickup : public Pickupable
{
+ friend class PickupCollection;
public:
CollectiblePickup(); //!< Constructor.
@@ -67,21 +68,13 @@
@return Returns true if the CollectiblePickup is part of a PickupCollection.
*/
bool isInCollection(void) const
- { return this->isInCollection_; }
+ { return this->collection_ != NULL; }
- bool addToCollection(PickupCollection* collection); //!< Adds this CollectiblePickup to the input PickupCollection.
- bool removeFromCollection(void); //!< Removes this CollectiblePickup from its PickupCollection.
-
- void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
-
- protected:
- virtual void preDestroy(void); //!< Is called by OrxonoxClass::destroy() before the object is actually destroyed.
- virtual void destroyPickup(void); //!< Destroys a Pickupable.
-
private:
- bool isInCollection_; //!< True if the CollectiblePickup is in a PickupCollection.
- PickupCollection* collection_; //!< A pointer to the PickupCollection this CollectiblePickup is in.
+ void wasAddedToCollection(PickupCollection* collection);
+ void wasRemovedFromCollection(void);
+ PickupCollection* collection_; //!< A pointer to the PickupCollection this CollectiblePickup is in.
};
}
Deleted: code/trunk/src/modules/pickup/DroppedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/DroppedPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,96 +0,0 @@
-/*
- * 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:
- * Daniel 'Huty' Haggenmueller
- * Co-authors:
- * Damian 'Mozork' Frick
- *
- */
-
-/**
- @file DroppedPickup.cc
- @brief Implementation of the DroppedPickup class.
-*/
-
-#include "DroppedPickup.h"
-
-#include "core/CoreIncludes.h"
-
-#include "interfaces/Pickupable.h"
-#include "interfaces/PickupCarrier.h"
-
-namespace orxonox
-{
-
- CreateFactory(DroppedPickup);
-
- /**
- @brief
- Default constructor. Registers object and sets default values.
- */
- DroppedPickup::DroppedPickup(BaseObject* creator) : PickupSpawner(creator)
- {
- RegisterObject(DroppedPickup);
- }
-
- /**
- @brief
- Constructor. Registers the object and sets values.
- @param creator
- The creator of the DroppedPickup.
- @param pickup
- The Pickupable that was dropped.
- @param carrier
- The PickupCarrier that carried the input pickup before it was dropped.
- @param triggerDistance
- The distance at which the PickupSpawner triggers. Default is 10.
- */
- DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 5, 1)
- {
- RegisterObject(DroppedPickup);
-
- this->setPosition(carrier->getCarrierPosition());
- this->block(carrier, DEFAULT_BLOCKED_TIME);
- }
-
- /**
- @brief
- Destructor.
- */
- DroppedPickup::~DroppedPickup()
- {
-
- }
-
- /**
- @brief
- Creates the Pickupable that is going to get picked up.
- In the case of the DroppedItem it is the one and only Pickupable that was dropped. No additional Pickupables of the same type are created.
- */
- Pickupable* DroppedPickup::getPickup(void)
- {
- Pickupable* pickup = this->pickup_;
- this->pickup_ = NULL;
- return pickup;
- }
-
-}
Deleted: code/trunk/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/DroppedPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,72 +0,0 @@
-/*
- * 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:
- * Daniel 'Huty' Haggenmueller
- * Co-authors:
- * Damian 'Mozork' Frick
- *
- */
-
-/**
- @file DroppedPickup.h
- @brief Definition of the DroppedPickup class.
- @ingroup Pickup
-*/
-
-#ifndef _DroppedPickup_H__
-#define _DroppedPickup_H__
-
-#include "PickupPrereqs.h"
-
-#include "PickupSpawner.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Special PickupSpawner that is created when a @ref orxonox::Pickupable "Pickupable" is dropped. It just spawns one pickup, the one that was dropped.
-
- @author
- Daniel 'Huty' Haggenmueller
- @author
- Damian 'Mozork' Frick
-
- @ingroup Pickup
- */
- class _PickupExport DroppedPickup : public PickupSpawner
- {
- public:
- DroppedPickup(BaseObject* creator);
- DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0); //!< Constructor.
- virtual ~DroppedPickup();
-
- protected:
- virtual Pickupable* getPickup(void); //!< Creates the Pickupable that is going to get picked up.
-
- private:
- static const unsigned int DEFAULT_BLOCKED_TIME = 10; //!< The default time a PickupCarrier is blocked from picking up the pickupable again, after it has dropped it.
-
- };
-}
-
-#endif /* _DroppedPickup_H__ */
Modified: code/trunk/src/modules/pickup/Pickup.cc
===================================================================
--- code/trunk/src/modules/pickup/Pickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/Pickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -36,10 +36,8 @@
#include "core/CoreIncludes.h"
#include "util/StringUtils.h"
-#include "pickup/PickupIdentifier.h"
+#include "PickupSpawner.h"
-#include "DroppedPickup.h"
-
namespace orxonox
{
@@ -85,31 +83,15 @@
/**
@brief
- Initializes the PickupIdentififer of this Pickup.
- */
- void Pickup::initializeIdentifier(void)
- {
- std::string val1 = this->getActivationType();
- std::string type1 = "activationType";
- this->pickupIdentifier_->addParameter(type1, val1);
-
- std::string val2 = this->getDurationType();
- std::string type2 = "durationType";
- this->pickupIdentifier_->addParameter(type2, val2);
- }
-
- /**
- @brief
Method for creating a Pickup object through XML.
*/
void Pickup::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(Pickup, XMLPort, xmlelement, mode);
- XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
- XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
-
- this->initializeIdentifier();
+ XMLPortParam(Pickup, "representation", setRepresentationName, getRepresentationName, xmlelement, mode);
+ XMLPortParam(Pickup, "activationType", setActivationTypeAsString, getActivationTypeAsString, xmlelement, mode);
+ XMLPortParam(Pickup, "durationType", setDurationTypeAsString, getDurationTypeAsString, xmlelement, mode);
}
/**
@@ -118,9 +100,9 @@
@return
Returns a string containing the activation type.
*/
- const std::string& Pickup::getActivationType(void) const
+ const std::string& Pickup::getActivationTypeAsString(void) const
{
- switch(this->activationType_)
+ switch(this->getActivationType())
{
case pickupActivationType::immediate:
return activationTypeImmediate_s;
@@ -137,9 +119,9 @@
@return
Returns a string containing the duration type.
*/
- const std::string& Pickup::getDurationType(void) const
+ const std::string& Pickup::getDurationTypeAsString(void) const
{
- switch(this->durationType_)
+ switch(this->getDurationType())
{
case pickupDurationType::once:
return durationTypeOnce_s;
@@ -156,12 +138,12 @@
@param type
The activation type of the Pickup as a string.
*/
- void Pickup::setActivationType(const std::string& type)
+ void Pickup::setActivationTypeAsString(const std::string& type)
{
if(type == Pickup::activationTypeImmediate_s)
- this->activationType_ = pickupActivationType::immediate;
+ this->setActivationType(pickupActivationType::immediate);
else if(type == Pickup::activationTypeOnUse_s)
- this->activationType_ = pickupActivationType::onUse;
+ this->setActivationType(pickupActivationType::onUse);
else
orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
}
@@ -172,12 +154,12 @@
@param type
The duration type of the Pickup as a string.
*/
- void Pickup::setDurationType(const std::string& type)
+ void Pickup::setDurationTypeAsString(const std::string& type)
{
if(type == Pickup::durationTypeOnce_s)
- this->durationType_ = pickupDurationType::once;
+ this->setDurationType(pickupDurationType::once);
else if(type == Pickup::durationTypeContinuous_s)
- this->durationType_ = pickupDurationType::continuous;
+ this->setDurationType(pickupDurationType::continuous);
else
orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
}
@@ -198,35 +180,13 @@
/**
@brief
- Creates a duplicate of the OrxonoxClass.
- @param item
- A reference to the pointer of the item that we're duplicating.
- */
- void Pickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new Pickup(this);
-
- SUPER(Pickup, clone, item);
-
- Pickup* pickup = dynamic_cast<Pickup*>(item);
- pickup->setActivationTypeDirect(this->getActivationTypeDirect());
- pickup->setDurationTypeDirect(this->getDurationTypeDirect());
-
- pickup->initializeIdentifier();
- }
-
- /**
- @brief
Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
- This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
- DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
@return
Returns true if a spawner was created, false if not.
*/
bool Pickup::createSpawner(void)
{
- new DroppedPickup(this, this, this->getCarrier());
+ PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
return true;
}
Modified: code/trunk/src/modules/pickup/Pickup.h
===================================================================
--- code/trunk/src/modules/pickup/Pickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/Pickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -104,74 +104,81 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual const std::string& getRepresentationName() const
+ { return this->representationName_; }
+
/**
@brief Get the activation type of the Pickup.
@return Returns the activation type of the Pickup.
*/
- inline pickupActivationType::Value getActivationTypeDirect(void) const
+ inline pickupActivationType::Value getActivationType(void) const
{ return this->activationType_; }
/**
@brief Get the duration type of the Pickup.
@return Returns the duration type of the Pickup.
*/
- inline pickupDurationType::Value getDurationTypeDirect(void) const
+ inline pickupDurationType::Value getDurationType(void) const
{ return this->durationType_; }
- const std::string& getActivationType(void) const; //!< Get the activation type of the Pickup.
- const std::string& getDurationType(void) const; //!< Get the duration type of the Pickup.
+ const std::string& getActivationTypeAsString(void) const; //!< Get the activation type of the Pickup.
+ const std::string& getDurationTypeAsString(void) const; //!< Get the duration type of the Pickup.
/**
@brief Get whether the activation type is 'immediate'.
@return Returns true if the activation type is 'immediate'.
*/
inline bool isImmediate(void) const
- { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
+ { return this->getActivationType() == pickupActivationType::immediate; }
/**
@brief Get whether the activation type is 'onUse'.
@return Returns true if the activation type is 'onUse'.
*/
inline bool isOnUse(void) const
- { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
+ { return this->getActivationType() == pickupActivationType::onUse; }
/**
@brief Get whether the duration type is 'once'.
@return Returns true if the duration type is 'once'.
*/
inline bool isOnce(void) const
- { return this->getDurationTypeDirect() == pickupDurationType::once; }
+ { return this->getDurationType() == pickupDurationType::once; }
/**
@brief Get whether the duration type is 'continuous'.
@return Returns true if the duration type is 'continuous'.
*/
inline bool isContinuous(void) const
- { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
+ { return this->getDurationType() == pickupDurationType::continuous; }
virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
- virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass.
protected:
- void initializeIdentifier(void);
-
virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
/**
+ @brief Sets the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup.
+ */
+ inline void setRepresentationName(const std::string& name)
+ { this->representationName_ = name; }
+
+ /**
@brief Set the activation type of the Pickup.
@param type The activation type of the Pickup.
*/
- inline void setActivationTypeDirect(pickupActivationType::Value type)
+ inline void setActivationType(pickupActivationType::Value type)
{ this->activationType_ = type; }
/**
@brief Set the duration type of the Pickup.
@param type The duration type of the Pickup.
*/
- inline void setDurationTypeDirect(pickupDurationType::Value type)
+ inline void setDurationType(pickupDurationType::Value type)
{ this->durationType_ = type; }
- void setActivationType(const std::string& type); //!< Set the activation type of the Pickup.
- void setDurationType(const std::string& type); //!< Set the duration type of the Pickup.
+ void setActivationTypeAsString(const std::string& type); //!< Set the activation type of the Pickup.
+ void setDurationTypeAsString(const std::string& type); //!< Set the duration type of the Pickup.
private:
void initialize(void); //!< Initializes the member variables.
+ std::string representationName_; //!< The name of the associated PickupRepresentation.
pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
pickupDurationType::Value durationType_; //!< The duration type of the Pickup.
Modified: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupCollection.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,8 +37,7 @@
#include "interfaces/PickupCarrier.h"
#include "CollectiblePickup.h"
-#include "DroppedPickup.h"
-#include "PickupCollectionIdentifier.h"
+#include "PickupSpawner.h"
#include "PickupCollection.h"
@@ -53,14 +52,10 @@
@param creator
The creator of the object.
*/
- PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator), pickupCollectionIdentifier_(NULL)
+ PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator)
{
RegisterObject(PickupCollection);
- this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(this);
- this->usedCounter_ = 0;
- this->pickedUpCounter_ = 0;
- this->disabledCounter_ = 0;
this->processingUsed_ = false;
this->processingPickedUp_ = false;
}
@@ -69,18 +64,15 @@
@brief
Destructor. Iterates through all Pickupables this PickupCollection consists of and destroys them if they haven't been already.
*/
- PickupCollection::~ PickupCollection()
+ PickupCollection::~PickupCollection()
{
// Destroy all Pickupables constructing this PickupCollection.
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
{
- (*it)->removeFromCollection();
+ (*it)->wasRemovedFromCollection();
(*it)->destroy();
}
this->pickups_.clear();
-
- if(this->pickupCollectionIdentifier_ != NULL)
- delete this->pickupCollectionIdentifier_;
}
/**
@@ -91,25 +83,12 @@
{
SUPER(PickupCollection, XMLPort, xmlelement, mode);
+ XMLPortParam(PickupCollection, "representation", setRepresentationName, getRepresentationName, xmlelement, mode);
XMLPortObject(PickupCollection, CollectiblePickup, "pickupables", addPickupable, getPickupable, xmlelement, mode);
-
- this->initializeIdentifier();
}
/**
@brief
- Initializes the PickupIdentifier for this pickup.
- */
- void PickupCollection::initializeIdentifier(void)
- {
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
- {
- this->pickupCollectionIdentifier_->addPickup((*it)->getPickupIdentifier());
- }
- }
-
- /**
- @brief
Is called when the pickup has transited from used to unused or the other way around.
Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedUsed); to their changdeUsed method.
*/
@@ -119,7 +98,7 @@
this->processingUsed_ = true;
// Change used for all Pickupables this PickupCollection consists of.
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
(*it)->setUsed(this->isUsed());
this->processingUsed_ = false;
@@ -137,12 +116,22 @@
if(this->processingUsed_)
return;
+ size_t numPickupsEnabled = 0;
+ size_t numPickupsInUse = 0;
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+ {
+ if ((*it)->isEnabled())
+ ++numPickupsEnabled;
+ if ((*it)->isUsed())
+ ++numPickupsInUse;
+ }
+
// If all the pickups are not in use but the PickupCollection is.
- if(this->usedCounter_ == 0 && this->isUsed())
+ if(numPickupsInUse == 0 && this->isUsed())
this->setUsed(false);
// If all the enabled pickups are in use but the PickupCollection is not.
- if(this->usedCounter_ != 0 && this->usedCounter_ == this->pickups_.size()-this->disabledCounter_ && !this->isUsed())
+ if(numPickupsInUse > 0 && numPickupsInUse == numPickupsEnabled && !this->isUsed())
this->setUsed(true);
}
@@ -156,7 +145,7 @@
SUPER(PickupCollection, changedCarrier);
// Change the PickupCarrier for all Pickupables this PickupCollection consists of.
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
{
if(this->getCarrier() == NULL)
(*it)->setCarrier(NULL);
@@ -176,8 +165,8 @@
this->processingPickedUp_ = true;
// Change the pickedUp status for all Pickupables this PickupCollection consists of.
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
- (*it)->setPickedUp(this->isPickedUp());
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); )
+ (*(it++))->setPickedUp(this->isPickedUp());
this->processingPickedUp_ = false;
@@ -194,39 +183,18 @@
if(this->processingPickedUp_)
return;
- // If at least all the enabled pickups of this PickupCollection are no longer picked up.
- if(this->pickedUpCounter_ <= this->disabledCounter_ && this->isPickedUp())
- this->Pickupable::destroy();
-
- // If the PickupCollection is no longer picked up.
- if(!this->isPickedUp())
- this->pickedUpCounter_ = 0;
- }
-
- /**
- @brief
- Creates a duplicate of the input Pickupable.
- This method needs to be implemented by any Class inheriting from Pickupable.
- @param item
- A reference to a pointer to the OrxonoxClass that is to be duplicated.
- */
- void PickupCollection::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new PickupCollection(this);
-
- SUPER(PickupCollection, clone, item);
-
- PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
- // Clone all Pickupables this PickupCollection consist of.
- for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+ // If at least all the enabled pickups of this PickupCollection are no longer picked up.
+ bool isOnePickupEnabledAndPickedUp = false;
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
{
- Pickupable* newPickup = (*it)->clone();
- CollectiblePickup* collectible = static_cast<CollectiblePickup*>(newPickup);
- pickup->addPickupable(collectible);
+ if ((*it)->isEnabled() && (*it)->isPickedUp())
+ {
+ isOnePickupEnabledAndPickedUp = true;
+ break;
+ }
}
-
- pickup->initializeIdentifier();
+ if(!isOnePickupEnabledAndPickedUp && this->isPickedUp())
+ this->Pickupable::destroy();
}
/**
@@ -239,7 +207,7 @@
*/
bool PickupCollection::isTarget(const PickupCarrier* carrier) const
{
- for(std::vector<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+ for(std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
{
if(!carrier->isTarget(*it))
return false;
@@ -250,18 +218,6 @@
/**
@brief
- Get the PickupIdentifier of this PickupCollection.
- This is in fact the PickupCollectionIdentifier.
- @return
- Returns a pointer to the PickupIdentifier of this PickupCollection.
- */
- const PickupIdentifier* PickupCollection::getPickupIdentifier(void) const
- {
- return this->pickupCollectionIdentifier_;
- }
-
- /**
- @brief
Add the input Pickupable to list of Pickupables combined by this PickupCollection.
@param pickup
The Pickupable to be added.
@@ -273,8 +229,9 @@
if(pickup == NULL)
return false;
- pickup->addToCollection(this);
this->pickups_.push_back(pickup);
+ pickup->wasAddedToCollection(this);
+ this->pickupsChanged();
return true;
}
@@ -288,23 +245,46 @@
*/
const Pickupable* PickupCollection::getPickupable(unsigned int index) const
{
- return this->pickups_[index];
+ if(this->pickups_.size() >= index)
+ return NULL;
+
+ std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin();
+ std::advance(it, index);
+ return *it;
}
/**
@brief
+ Removes the Pickup from the Collection.
+ @param pickup
+ The Pickup to be removed.
+ @return
+ Returns true if the pickup was in the collection.
+ */
+ bool PickupCollection::removePickupable(CollectiblePickup* pickup)
+ {
+ for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+ {
+ if (*it == pickup)
+ {
+ this->pickups_.erase(it);
+ pickup->wasRemovedFromCollection();
+ this->pickupsChanged();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ @brief
Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
This is used internally by the CollectiblePickup class.
@param changed
- The value the used status has changed to.
+ The value the used status has changed to.
*/
void PickupCollection::pickupChangedUsed(bool changed)
{
- if(changed)
- this->usedCounter_++;
- else
- this->usedCounter_--;
-
this->changedUsedAction();
}
@@ -317,11 +297,6 @@
*/
void PickupCollection::pickupChangedPickedUp(bool changed)
{
- if(changed)
- this->pickedUpCounter_++;
- else
- this->pickedUpCounter_--;
-
this->changedPickedUpAction();
}
@@ -332,20 +307,27 @@
*/
void PickupCollection::pickupDisabled(void)
{
- this->disabledCounter_++;
}
/**
@brief
+ Helpfer function if the number of pickups in this collection has changed.
+ */
+ void PickupCollection::pickupsChanged(void)
+ {
+ this->changedUsedAction();
+ this->changedPickedUpAction();
+ }
+
+ /**
+ @brief
Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
- This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
- DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
@return
Returns true if a spawner was created, false if not.
*/
bool PickupCollection::createSpawner(void)
{
- new DroppedPickup(this, this, this->getCarrier());
+ PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
return true;
}
Modified: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupCollection.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -49,8 +49,6 @@
@brief
The PickupCollection combines different @ref orxonox::Pickupable "Pickupables" (more precisely @ref orxonox::CollectiblePickup "CollectiblePickups") to a coherent, single pickup and makes them seem (from the outside looking in) just as if they were just one @ref orxonox::Pickupable "Pickupable".
- To differentiate between different types of @ref orxonox::PickupCollection "PickupCollections" (just as we differentiate between different types of @ref orxonox::Pickupable "Pickupables") we define a new identifyer called the @ref orxonox::PickupCollectionIdentifier "PickupCollectionIdentifier" which has pretty much the same properties as the @ref orxonox::PickupIdentifier "PickupIdentifier" but extende to @ref orxonox::PickupCollection "PickupCollections".
-
A PickupCollection can be created in XML as follows:
@code
<PickupCollection>
@@ -80,36 +78,35 @@
virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier.
virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
- virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input pickup.
-
virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
- virtual const PickupIdentifier* getPickupIdentifier(void) const; //!< Get the PickupIdentifier of this PickupCollection.
+ inline void setRepresentationName(const std::string& name)
+ { this->representationName_ = name; }
+ virtual const std::string& getRepresentationName() const
+ { return this->representationName_; }
bool addPickupable(CollectiblePickup* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
const Pickupable* getPickupable(unsigned int index) const; //!< Get the Pickupable at the given index.
+ bool removePickupable(CollectiblePickup* pickup); //!< Removes the input Pickupable from the list of Pickupables in this PickupCollection.
+ inline const std::list<CollectiblePickup*>& getPickups() const
+ { return this->pickups_; }
+
void pickupChangedUsed(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
void pickupChangedPickedUp(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its picked up status to the input value.
void pickupDisabled(void); //!< Informs the PickupCollection, that one of its pickups has been disabled.
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
-
virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
- PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
-
private:
void changedUsedAction(void); //!< Helper method.
void changedPickedUpAction(void); //!< Helper method.
+ void pickupsChanged(void); //!< Helper method.
- std::vector<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
+ std::string representationName_; //!< The name of the associated PickupRepresentation.
+ std::list<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
- unsigned int usedCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are in use.
- unsigned int pickedUpCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are picked up.
- unsigned int disabledCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are disabled.
-
bool processingUsed_; //!< Boolean to ensure, that the PickupCollection doesn't update its used status while its internal state is inconsistent.
bool processingPickedUp_; //!< Boolean to ensure, that the PickupCollection doesn't update its picked upp status while its internal state is inconsistent.
Deleted: code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,112 +0,0 @@
-/*
- * 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:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
-*/
-
-/**
- @file PickupCollectionIdentifier.cc
- @brief Implementation of PickupCollectionIdentifier.
-*/
-
-#include "core/CoreIncludes.h"
-
-#include "PickupCollectionIdentifier.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Constructor. Registers the object.
- */
- PickupCollectionIdentifier::PickupCollectionIdentifier(Pickupable* pickup) : PickupIdentifier(pickup)
- {
- RegisterObject(PickupCollectionIdentifier);
- }
-
- /**
- @brief
- Destructor.
- */
- PickupCollectionIdentifier::~PickupCollectionIdentifier()
- {
-
- }
-
- /**
- @brief
- Compares a PickupCollectionIdentifier with a PickupIdentifier and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b), where a is a PickupCollectionIdentifier and b is just some PickupIdentifier.
- @param identifier
- Pointer to the second PickupIdentifier, b.
- @return
- Returns an integer. 0 if the two compared PickupIdentifiers are the same, <0 if a < b and >0 if a > b.
- */
- int PickupCollectionIdentifier::compare(const PickupIdentifier* identifier) const
- {
- assert(identifier);
-
- // Slight un-niceity to cast the const PickupIdentifier to a const PickupCollectionIdentifier, but since we cast to a const, there is no harm done.
- PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier);
- const PickupCollectionIdentifier* collectionIdentifier = orxonox_cast<PickupCollectionIdentifier*>(temp);
-
- // If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
- if(collectionIdentifier == NULL)
- {
- return this->PickupIdentifier::compare(identifier);
- }
-
- // If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
- if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
- return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
-
- // Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
- std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin();
- for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++)
- {
-
- if((*it)->compare(*it2) < 0)
- return -1;
- if((*it2)->compare(*it) < 0)
- return 1;
- }
-
- // This means they are equal.
- return 0;
- }
-
- /**
- @brief
- Add a Pickupable to the PickupCollectionIdentifier.
- @param identifier
- A pointer to the PickupIdentifier of the Pickupable to be added.
- */
- void PickupCollectionIdentifier::addPickup(const PickupIdentifier* identifier)
- {
- this->identifiers_.insert(identifier);
- }
-
-}
-
Deleted: code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -1,77 +0,0 @@
-/*
- * 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:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
-*/
-
-/**
- @file PickupCollectionIdentifier.h
- @brief Declaration of PickupCollectionIdentifier.
- @ingroup Pickup
-*/
-
-#ifndef _PickupCollectionIdentifier_H__
-#define _PickupCollectionIdentifier_H__
-
-#include "PickupPrereqs.h"
-
-#include <set>
-
-#include "pickup/PickupIdentifier.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- The PickupCollectionIdentifier is the specialization of the PickupIdentifier for the @ref orxonox::PickupCollection "PickupCollection" class.
- It identifies @ref orxonox::PickupCollection "PickupCollections" based on the different @ref orxonox::CollectiblePickup "CollectiblePickups" they consist of.
-
- @ref orxonox::Pickupable "Pickupables" (resp. @ref orxonox::CollectiblePickup "CollectiblePickups") can be added to the PickupCollectionIdentifier via the addPickup method.
-
- @author
- Damian 'Mozork' Frick
-
- @ingroup Pickup
- */
- class _PickupExport PickupCollectionIdentifier : public PickupIdentifier
- {
-
- public:
- PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor.
- ~PickupCollectionIdentifier(); //!< Destructor.
-
- virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier.
-
- void addPickup(const PickupIdentifier* identifier); //!< Add a @ref orxonox::Pickupable "Pickupable" to the PickupCollectionIdentifier.
-
- private:
- std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the @ref orxonox::Pickupable "Pickupables", the @ref orxonox::PickupCollection "PickupCollection" with this PickupCollectionIdentifier consists of, ordered by the rule set by @ref orxonox::PickupIdentifierCompare "PickupIdentifierCompare".
-
- };
-
-}
-
-#endif // _PickupCollectionIdentifier_H__
Modified: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupManager.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -86,7 +86,6 @@
this->defaultRepresentation_->destroy();
this->representations_.clear();
- this->representationsNetworked_.clear();
// Destroying all the PickupInventoryContainers that are still there.
for(std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.begin(); it != this->pickupInventoryContainers_.end(); it++)
@@ -105,25 +104,23 @@
/**
@brief
- Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents, on the server (or in standalone mode).
- For every type of Pickupable (uniquely identified by a PickupIdentifier) there can be one (and just one) PickupRepresentation registered.
- @param identifier
- The PickupIdentifier identifying the Pickupable.
+ Registers a PickupRepresentation.
+ @param name
+ The representation's name.
@param representation
A pointer to the PickupRepresentation.
@return
Returns true if successful and false if not.
*/
- bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
+ bool PickupManager::registerRepresentation(const std::string& name, PickupRepresentation* representation)
{
- assert(identifier);
assert(representation);
// If the list is not empty and Pickupable already has a Representation registered.
- if(!this->representations_.empty() && this->representations_.find(identifier) != this->representations_.end())
+ if(!this->representations_.empty() && this->representations_.find(name) != this->representations_.end())
return false;
- this->representations_[identifier] = representation;
+ this->representations_[name] = representation;
orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " registered with the PickupManager." << endl;
return true;
@@ -131,81 +128,36 @@
/**
@brief
- Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents, on the server (or in standalone mode).
- @param identifier
- The PickupIdentifier identifying the Pickupable.
- @param representation
- A pointer to the PickupRepresentation.
+ Unegisters a PickupRepresentation.
+ @param name
+ The representation's name.
@return
Returns true if successful and false if not.
*/
- bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
+ bool PickupManager::unregisterRepresentation(const std::string& name)
{
- assert(identifier);
- assert(representation);
-
- std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
+ std::map<std::string, PickupRepresentation*>::iterator it = this->representations_.find(name);
if(it == this->representations_.end()) // If the Pickupable is not registered in the first place.
return false;
this->representations_.erase(it);
- orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << endl;
+ orxout(verbose, context::pickups) << "PickupRepresentation &" << name << " unregistered with the PickupManager." << endl;
return true;
}
/**
@brief
- Registers a PickupRepresentation on the host it was created.
- @param representation
- A pointer to the PickupRepresentation.
+ Get the PickupRepresentation with the given name.
+ @param name
+ The name of the PickupRepresentation.
@return
- Returns true if successful, false if not.
- */
- bool PickupManager::registerRepresentation(PickupRepresentation* representation)
- {
- assert(representation);
-
- // If the list is not empty and PickupRepresentation is already registered.
- if(!this->representationsNetworked_.empty() && this->representationsNetworked_.find(representation->getObjectID()) != this->representationsNetworked_.end())
- return false;
-
- this->representationsNetworked_[representation->getObjectID()] = representation;
- return true;
- }
-
- /**
- @brief
- Unregisters a PickupRepresentation on the host it is being destroyed (which is the same host on which it was created).
- @param representation
- A pointer to the Pickuprepresentation.
- @return
- Returns true if successful, false if not.
- */
- bool PickupManager::unregisterRepresentation(PickupRepresentation* representation)
- {
- assert(representation);
-
- std::map<uint32_t, PickupRepresentation*>::iterator it = this->representationsNetworked_.find(representation->getObjectID());
- if(it == this->representationsNetworked_.end()) // If the Pickupable is not registered in the first place.
- return false;
-
- this->representationsNetworked_.erase(it);
- return true;
- }
-
- /**
- @brief
- Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
- @param identifier
- The PickupIdentifier.
- @return
Returns a pointer to the PickupRepresentation.
*/
- PickupRepresentation* PickupManager::getRepresentation(const PickupIdentifier* identifier)
+ PickupRepresentation* PickupManager::getRepresentation(const std::string& name)
{
- std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
- if(it == this->representations_.end()) // If there is no PickupRepresentation associated with the input PickupIdentifier.
+ std::map<std::string, PickupRepresentation*>::iterator it = this->representations_.find(name);
+ if(it == this->representations_.end()) // If there is no PickupRepresentation associated with the input name.
{
orxout(verbose, context::pickups) << "PickupManager::getRepresentation() returned default representation." << endl;
return this->defaultRepresentation_;
@@ -352,22 +304,22 @@
if(GameMode::isStandalone() || Host::getPlayerID() == clientId)
{
// If there is no PickupRepresentation registered the default representation is used.
- if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
- PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
+ if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
+ PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickup->getRepresentationName(), pickedUp);
else
- PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
+ PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickup->getRepresentationName(), pickedUp);
}
// If the concerned host is somewhere in the network, we call pickupChangedPickedUpNetwork() on its PickupManager.
else
{
// If there is no PickupRepresentation registered the default representation is used.
- if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
+ if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
{
callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
}
else
{
- callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
+ callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
}
}
@@ -387,7 +339,7 @@
@param pickedUp
The pickedUp status the Pickupable changed to.
*/
- /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, bool pickedUp)
+ /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp)
{
PickupManager& manager = PickupManager::getInstance(); // Get the PickupManager singleton on this host.
// If the Pickupable has been picked up, we create a new PickupInventoryContainer for it.
@@ -401,6 +353,7 @@
container->usable = usable;
container->unusable = false;
container->representationObjectId = representationObjectId;
+ container->representationName = representationName;
// Insert the container into the pickupInventoryContainers_ list.
manager.pickupInventoryContainers_.insert(std::pair<uint32_t, PickupInventoryContainer*>(pickup, container));
@@ -420,36 +373,6 @@
/**
@brief
- Get the PickupRepresentation of an input Pickupable.
- This method spares us the hassle to export the PickupIdentifier class to lua.
- @param pickup
- The number identifying the Pickupable whose PickupRepresentation should be returned.
- @return
- Returns the PickupRepresentation of the input Pickupable or NULL if an error occurred.
- */
- orxonox::PickupRepresentation* PickupManager::getPickupRepresentation(uint32_t pickup)
- {
- // Clear and rebuild the representationsNetworked_ list.
- //TODO: Better solution?
- this->representationsNetworked_.clear();
- for(ObjectList<PickupRepresentation>::iterator it = ObjectList<PickupRepresentation>::begin(); it != ObjectList<PickupRepresentation>::end(); ++it)
- this->representationsNetworked_[it->getObjectID()] = *it;
-
- // Get the container belonging to the input pickup, if not found return the default representation.
- std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.find(pickup);
- if(it == this->pickupInventoryContainers_.end())
- return this->defaultRepresentation_;
-
- // Get the PickupRepresentation of the input pickup (through the objecId of the representation stored in the PickupInventoryContainer belonging to the pickup), if not found return the default representation.
- std::map<uint32_t, PickupRepresentation*>::iterator it2 = this->representationsNetworked_.find(it->second->representationObjectId);
- if(it2 == this->representationsNetworked_.end())
- return this->defaultRepresentation_;
-
- return it2->second;
- }
-
- /**
- @brief
Get the number of pickups currently picked up by the player.
This method is used in lua to populate the PickupInventory. The intended usage is to call this method to reset the iterator of the list of PickupInventoryContainers and then use popPickup() to get the individual PickupInventoryContainers.
@return
Modified: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupManager.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -40,8 +40,6 @@
#include <map>
#include "core/WeakPtr.h"
-#include "pickup/PickupIdentifier.h"
-
#include "PickupRepresentation.h"
#include "util/Singleton.h"
@@ -66,6 +64,7 @@
bool usable; //!< Whether the @ref orxonox::Pickupable "Pickupable" is usable.
bool unusable; //!< Whether the @ref orxonox::Pickupable "Pickupable" is droppable.
uint32_t representationObjectId; //!< The objectId of the @ref orxonox::PickupRepresentation "PickupRepresentation" that represents the @ref orxonox::Pickupable "Pickupable".
+ std::string representationName; //!< The name of the associated PickupRepresentation
};
// tolua_end
@@ -73,7 +72,7 @@
@brief
The PickupManager class manages @ref orxonox::Pickupable "Pickupables".
- It has in essence two tasks to fulfill. Firstly it must link @ref orxonox::Pickupable "Pickupables" (through their @ref orxonox::PickupIdentifier "PickupIdentifiers") to their respective @ref orxonox::PickupRepresentation "PickupRepresentations". Secondly it manages the PickupInventory. (The PickupInventory is the GUI that displays @ref orxonox::Pickupable "Pickupables" for the covenience of the user.)
+ It has in essence two tasks to fulfill. Firstly it must link @ref orxonox::Pickupable "Pickupables" (through their representation-name attribute) to the respective @ref orxonox::PickupRepresentation "PickupRepresentations". Secondly it manages the PickupInventory. (The PickupInventory is the GUI that displays @ref orxonox::Pickupable "Pickupables" for the covenience of the user.)
@section PickupManagerTechnicalDetails Technical details
Unfortunately <em>under the hood</em> it isn't just as easy. At least the PickupInventory part isn't. To grasp why this is we need to have a brief look at how the pickups module works over the network:
@@ -85,8 +84,7 @@
This leaves us with the PickupInventory component (and this is really the source of all the complexity).
Firstly there are a number of lists (where by list I really mean any kind of ordered data structure) kept.
- - The @ref orxonox::PickupManager::representations_ "representations_" list links @ref orxonox::PickupRepresentation "PickupRepresentations" with @ref orxonox::PickupIdentifier "PickupIdentifiers" and can be used to get the @ref orxonox::PickupRepresentation "PickupRepresentation" for a given @ref orxonox::Pickupable "Pickupable". It is only populated on the server (or in standalone mode). Each @ref orxonox::PickupRepresentation "PickupRepresentation" that is generated through XML registers itself with the PickupManager and is thereby added to the list.
- - The @ref orxonox::PickupManager::representationsNetworked_ "representationsNetworked_" list is the networked (hence the name) equivalent to the @ref orxonox::PickupManager::representations_ "representations_" list. It links an objectId of a @ref orxonox::PickupRepresentation "PickupRepresentation" to a @ref orxonox::PickupRepresentation "PickupRepresentation". This list is maintained on all hosts, each representation registers itself (in its constructor) with the PickupManager. Since the representations are synchronised they are created on each host. The "same" instance on each host is identified by the same objectId and that is why we store the representations with the objectId as key. We can then use this list to get a @ref orxonox::PickupRepresentation "PickupRepresentation" for a specific @ref orxonox::Pickupable "Pickupable" (or more precisely a number identifiying that particular pickup, but we'll see that, when we look at the next list) on a client to be used in the PickupInventory.
+ - The @ref orxonox::PickupManager::representations_ "representations_" list links @ref orxonox::PickupRepresentation "PickupRepresentations" with its name and can be used to get the @ref orxonox::PickupRepresentation "PickupRepresentation" for a given @ref orxonox::Pickupable "Pickupable". It is only populated on the server (or in standalone mode). Each @ref orxonox::PickupRepresentation "PickupRepresentation" that is generated through XML registers itself with the PickupManager and is thereby added to the list.
- The @ref orxonox::PickupManager::pickupInventoryContainers_ "pickupInventoryContainers_" list links a number identifying a @ref orxonox::Pickupable "Pickupable" to a data structure (the @ref orxonox::PickupInventoryContainer "PickupInventoryContainer"), which contains all necessary information about that @ref orxonox::Pickupable "Pickupable". This list is maintained on all hosts, a new container is inserted when a @ref orxonox::Pickupable "Pickupable" is picked up, but only if it has been picked up by the repsective host. This list is then used by the PickupInventory to access the required information and to get the correct @ref orxonox::PickupRepresentation "PickupRepresentation".
- The @ref orxonox::PickupManager::pickups_ "pickups_" list links a number identifiying a @ref orxonox::Pickupable "Pickupable" to a (weak pointer to a) @ref orxonox::Pickupable "Pickupable". It is only maintained by the server (or in standalone mode), to be able to use, unuse and drop @ref orxonox::Pickupable "Pickupables" through the PickupInventory. Since @ref orxonox::Pickupable "Pickupables" only exist on the server a client that wants to change a pickups status has so send a request over the network (with the number identifying the pickup) to the server and then the server facilitates the change, using this list to map from the identifyer to the actual @ref orxonox::Pickupable "Pickupable".
- The @ref orxonox::PickupManager::indexes_ "indexes_" list links a @ref orxonox::Pickupable "Pickupable" to the number identifying it. This is only maintained on the server (or in standalone mode), and is used for the inverse mapping of the previous list, which means the server uses it identify pickups on clients when it communicates changes in pickups to clients.
@@ -113,24 +111,19 @@
*/
static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export
- bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
- bool unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
+ bool registerRepresentation(const std::string& name, PickupRepresentation* representation);
+ bool unregisterRepresentation(const std::string& name);
- bool registerRepresentation(PickupRepresentation* representation); //!< Registers a PickupRepresentation on the host it was created.
- bool unregisterRepresentation(PickupRepresentation* representation); //!< Unregisters a PickupRepresentation on the host it is being destroyed.
+ PickupRepresentation* getRepresentation(const std::string& name); // tolua_export
- PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
-
virtual void pickupChangedUsed(Pickupable* pickup, bool used); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input used state.
static void pickupChangedUsedNetwork(uint32_t pickup, bool inUse, bool usable, bool unusable); //!< Helper method to react to the change in the used status of a Pickupable.
virtual void pickupChangedPickedUp(Pickupable* pickup, bool pickedUp); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input pickedUp state.
- static void pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, bool pickedUp); //!< Helper method to react to the change in the pickedUp status of a Pickupable.
+ static void pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp); //!< Helper method to react to the change in the pickedUp status of a Pickupable.
// Methods to be used by the PickupInventory.
public:
// tolua_begin
- orxonox::PickupRepresentation* getPickupRepresentation(uint32_t pickup); //!< Get the PickupRepresentation of an input indentifier for Pickupable.
-
int getNumPickups(void); //!< Get the number of pickups currently picked up by the player.
/**
@brief Get the next PickupInventoryContainer in the list.
@@ -162,8 +155,7 @@
PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
- std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types of Pickupables) and PickupRepresentations.
- std::map<uint32_t, PickupRepresentation*> representationsNetworked_; //!< Map linking the PickupRepresentation's objectId to the PickupRepresentation itself. It is used for networking purposes.
+ std::map<std::string, PickupRepresentation*> representations_; //!< Map linking PickupRepresentations and their names.
std::map<uint32_t, PickupInventoryContainer*> pickupInventoryContainers_; //!< Map linking a number identifying a Pickupable to a PickupInventoryContainer, which contains all necessary information about that Pickupable.
std::map<uint32_t, PickupInventoryContainer*>::iterator pickupsIterator_; //!< An iterator pointing to the current Pickupable in pickupsList_.
Modified: code/trunk/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/trunk/src/modules/pickup/PickupPrereqs.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupPrereqs.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -69,10 +69,8 @@
{
class CollectiblePickup;
- class DroppedPickup;
class Pickup;
class PickupCollection;
- class PickupCollectionIdentifier;
class PickupManager;
class PickupRepresentation;
class PickupSpawner;
@@ -85,7 +83,7 @@
class SpeedPickup;
class ShieldPickup;
class ShrinkPickup;
-
+ class DamageBoostPickup;
}
#endif /* _PickupPrereqs_H__ */
Modified: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -51,7 +51,7 @@
Constructor. Registers the object and initializes its member variables.
This is primarily for use of the PickupManager in creating a default PickupRepresentation.
*/
- PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL), pickup_(NULL)
+ PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)
{
RegisterObject(PickupRepresentation);
@@ -63,14 +63,12 @@
@brief
Default Constructor. Registers the object and initializes its member variables.
*/
- PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL), pickup_(NULL)
+ PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL)
{
RegisterObject(PickupRepresentation);
this->initialize();
this->registerVariables();
-
- PickupManager::getInstance().registerRepresentation(this); // Registers the PickupRepresentation with the PickupManager.
}
/**
@@ -83,13 +81,7 @@
this->spawnerRepresentation_->destroy();
if(this->isInitialized())
- {
- if(GameMode::isMaster() && this->pickup_ != NULL)
- {
- PickupManager::getInstance().unregisterRepresentation(this->pickup_->getPickupIdentifier(), this);
- }
- PickupManager::getInstance().unregisterRepresentation(this);
- }
+ PickupManager::getInstance().unregisterRepresentation(this->getName());
}
/**
@@ -127,18 +119,8 @@
XMLPortParam(PickupRepresentation, "pickupDescription", setPickupDescription, getPickupDescription, xmlelement, mode);
XMLPortParam(PickupRepresentation, "spawnerTemplate", setSpawnerTemplate, getSpawnerTemplate, xmlelement, mode);
XMLPortParam(PickupRepresentation, "inventoryRepresentation", setInventoryRepresentation, getInventoryRepresentation, xmlelement, mode);
- XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
- if(GameMode::isMaster())
- {
- // Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents.
- PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this);
- }
-
- if(this->spawnerRepresentation_ != NULL)
- this->spawnerRepresentation_->setVisible(false);
-
orxout(verbose, context::pickups) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << endl;
}
@@ -150,29 +132,41 @@
@return
Returns a pointer to the StaticEntity.
*/
- StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
+ StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
{
if(this->spawnerRepresentation_ == NULL)
{
orxout(verbose, context::pickups) << "PickupRepresentation: No spawner representation found." << endl;
if(this->spawnerTemplate_ == "")
{
- orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
+ orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
// If neither spawnerRepresentation nor spawnerTemplate was specified
return this->getDefaultSpawnerRepresentation(spawner);
}
this->addTemplate(this->spawnerTemplate_);
}
- StaticEntity* representation = this->spawnerRepresentation_;
- representation->setVisible(true);
+ this->spawnerRepresentation_->setVisible(true);
+ StaticEntity* temp = this->spawnerRepresentation_;
+ this->spawnerRepresentation_ = NULL;
- this->addTemplate(this->spawnerTemplate_);
- this->spawnerRepresentation_->setVisible(false);
+ return temp;
+ }
- return representation;
+ void PickupRepresentation::changedName()
+ {
+ // Registers the PickupRepresentation with the PickupManager.
+ PickupManager::getInstance().unregisterRepresentation(this->getOldName());
+ PickupManager::getInstance().registerRepresentation(this->getName(), this);
}
+ void PickupRepresentation::setSpawnerRepresentation(StaticEntity* representation)
+ {
+ this->spawnerRepresentation_ = representation;
+ if(this->spawnerRepresentation_ != NULL)
+ this->spawnerRepresentation_->setVisible(false);
+ }
+
/**
@brief
Get the default spawnerRepresentation for a specific PickupSpawner.
Modified: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -40,7 +40,6 @@
#include "core/XMLPort.h"
#include "interfaces/Pickupable.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/StaticEntity.h"
#include "PickupSpawner.h"
@@ -53,7 +52,7 @@
/**
@brief
- The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentifier "PickupIdentifier"). It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.
+ The PickupRepresentation class represents a specific pickup type. It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.
They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager".
Creating a PickupRepresentation in XML could look as follows:
@@ -63,11 +62,7 @@
description = "This is the most awesome Pickup ever to exist."
spawnerTemplate = "awesomePickupRepresentation"
inventoryRepresentation = "AwesomePickup"
- >
- <pickup>
- <SomePickup />
- </pickup>
- </PickupRepresentation>
+ />
@endcode
As you might have noticed, there is a parameter called <em>spawnerTemplate</em> and also another parameter called <em>inventoryRepresentation</em>. Let's first explain the second one, <em>inventoryRepresentation</em>.
- The <b>inventoryRepresentation</b> specifies the image that is displayed in the PickupInventory for the specific type of @ref orxonox::Pickupable "Pickupable". More technically, it is the name of an image located in the <code>PickupInventory.imageset</code>, which in turn is located in <code>data_extern/gui/imagesets/</code>.
@@ -132,16 +127,11 @@
@return Returns the name of the image as a string.
*/
inline const std::string& getInventoryRepresentation(void) const { return this->inventoryRepresentation_; } // tolua_export
- /**
- @brief Get the Pickupable represented by this PickupRepresentation.
- @param index The index.
- @return Returns (for index = 0) a pointer to the Pickupable. For index > 0 it returns NULL.
- */
- inline const Pickupable* getPickup(unsigned int index) const
- { if(index == 0) return this->pickup_; return NULL; }
- StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner.
+ virtual void changedName();
+ StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner.
+
protected:
/**
@brief Set the name of the Pickupable represented by this PickupRepresentation.
@@ -167,20 +157,14 @@
This will be set by the spawnerTemplate. Setting it when creating the PickupRepresentation without creating a template and specifying its name will be futile, because through the course of the game many PickupSpawners for one specific pickup type may have to be created, thus the StaticEntity that is the spawnerRepresentation has to be generated (with the template) for every new PickupSpawner spawning the Pickupable represented by this PickupRepresentation. The spawnerRepresentation that is set here, however can only be used once.
@param representation A pointer to the StaticEntity that is the spawnerRepresentation of this PickupRepresentation.
*/
- inline void setSpawnerRepresentation(StaticEntity* representation)
- { this->spawnerRepresentation_ = representation; }
+ void setSpawnerRepresentation(StaticEntity* representation);
+
/**
@brief Set the image representing the pickup in the PickupInventory.
@param image A string with the name of the image representing the pickup.
*/
inline void setInventoryRepresentation(const std::string& image)
{ this->inventoryRepresentation_ = image; }
- /**
- @brief Set the Pickupable that is represented by this PickupRepresentation.
- @param pickup A pointer to the Pickupable.
- */
- inline void setPickup(Pickupable* pickup)
- { this->pickup_ = pickup; }
private:
void initialize(void); //!< Initializes the member variables of this PickupRepresentation.
@@ -194,8 +178,6 @@
StaticEntity* spawnerRepresentation_; //!< The spawnerRepresentation of this PickupRepresentation.
std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory.
- Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation.
-
}; // tolua_export
} // tolua_export
Modified: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -54,7 +54,7 @@
@param creator
Pointer to the object which created this item.
*/
- PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator), pickup_(NULL)
+ PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator), pickup_(NULL), representation_(NULL), pickupTemplate_(NULL)
{
RegisterObject(PickupSpawner);
@@ -63,45 +63,6 @@
/**
@brief
- Constructor, Creates a fully functional PickupSpawner.
- @param creator
- The creator of this PickupSpawner.
- @param pickup
- The Pickupable to be spawned by this PickupSpawner.
- @param triggerDistance
- The distance at which the PickupSpawner will trigger.
- @param respawnTime
- The minimum time between two spawns.
- @param maxSpawnedItems
- The maximum number of items spawned by this PickupSpawner.
- */
- PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator), pickup_(NULL)
- {
- RegisterObject(PickupSpawner);
-
- this->initialize();
-
- this->pickup_ = pickup;
-
- this->triggerDistance_ = triggerDistance;
- this->respawnTime_ = respawnTime;
- this->setMaxSpawnedItems(maxSpawnedItems);
-
- if(this->pickup_ == NULL)
- {
- orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
- this->setActive(false);
- }
- else
- {
- PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
- this->attach(representation->getSpawnerRepresentation(this));
- this->setActive(true);
- }
- }
-
- /**
- @brief
Registers the object and sets some default values.
*/
void PickupSpawner::initialize(void)
@@ -111,6 +72,8 @@
this->maxSpawnedItems_ = INF;
this->spawnsRemaining_ = INF;
this->selfDestruct_ = false;
+
+ this->setPickupable(NULL);
}
/**
@@ -125,6 +88,32 @@
/**
@brief
+ Factory method, Creates a fully functional PickupSpawner.
+ @param creator
+ The creator of this PickupSpawner.
+ @param pickup
+ The Pickupable to be spawned by this PickupSpawner.
+ @param carrier
+ The PickupCarrier that carried the input pickup before it was dropped.
+ @param triggerDistance
+ The distance at which the PickupSpawner will trigger.
+ */
+ /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance)
+ {
+ PickupSpawner* spawner = new PickupSpawner(creator);
+
+ spawner->setPickupable(pickup);
+ spawner->setTriggerDistance(triggerDistance);
+ spawner->setMaxSpawnedItems(1);
+
+ spawner->setPosition(carrier->getCarrierPosition());
+ spawner->block(carrier);
+
+ return spawner;
+ }
+
+ /**
+ @brief
Method for creating a PickupSpawner through XML.
@param xmlelement
XML element which contains the PickupSpawner.
@@ -135,39 +124,14 @@
{
SUPER(PickupSpawner, XMLPort, xmlelement, mode);
- XMLPortObject(PickupSpawner, Pickupable, "pickup", setPickupable, getPickupable, xmlelement, mode);
-
+ XMLPortParam(PickupSpawner, "pickup", setPickupTemplateName, getPickupTemplateName, xmlelement, mode);
XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode);
-
- if(this->pickup_ == NULL)
- {
- orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
- this->setActive(false);
- }
- else
- {
- PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
- this->attach(representation->getSpawnerRepresentation(this));
- this->setActive(true);
- }
}
/**
@brief
- Invoked when the activity has changed. Sets visibility of attached objects.
- */
- void PickupSpawner::changedActivity()
- {
- SUPER(PickupSpawner, changedActivity);
-
- if(GameMode::isMaster())
- this->setVisible(this->isActive());
- }
-
- /**
- @brief
Tick, checks if any Pawn is close enough to trigger.
@param dt
Time since last tick.
@@ -198,7 +162,7 @@
break;
Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
- PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(*it);
+ PickupCarrier* carrier = static_cast<PickupCarrier*>(*it);
// If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
if(distance.length() < this->triggerDistance_ && carrier != NULL && this->blocked_.find(carrier) == this->blocked_.end())
{
@@ -211,6 +175,45 @@
/**
@brief
+ Trigger the PickupSpawner.
+ Adds the pickup to the Pawn that triggered, sets the timer to re-activate and deactives the PickupSpawner.
+ @param carrier
+ Carrier which triggered the PickupSpawner.
+ */
+ void PickupSpawner::trigger(PickupCarrier* carrier)
+ {
+ orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered and active." << endl;
+
+ PickupCarrier* target = carrier->getTarget(this->pickup_);
+
+ this->block(carrier);
+
+ assert(target);
+ bool pickedUp = this->pickup_->pickup(target);
+ assert(pickedUp);
+ pickedUp = false; // To avoid compiler warning.
+
+ this->setPickupable(NULL);
+ this->decrementSpawnsRemaining();
+ }
+
+ void PickupSpawner::setPickupTemplateName(const std::string& name)
+ {
+ Template* temp = Template::getTemplate(name);
+ if (temp)
+ this->setPickupTemplate(temp);
+ }
+
+ void PickupSpawner::setPickupTemplate(Template* temp)
+ {
+ this->pickupTemplate_ = temp;
+ this->pickupTemplateName_ = temp->getName();
+
+ this->setPickupable(this->createPickup());
+ }
+
+ /**
+ @brief
Sets the maximum number of spawned items.
@param items
The maximum number of spawned items to be set.
@@ -232,17 +235,16 @@
if(this->spawnsRemaining_ != INF)
this->spawnsRemaining_--;
+ this->setActive(false);
+
if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0)
{
this->startRespawnTimer();
-
- this->setActive(false);
this->fireEvent();
}
else
{
orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") empty, selfdestruct initialized." << endl;
- this->setActive(false);
this->destroy();
}
}
@@ -258,101 +260,74 @@
/**
@brief
- Sets a Pickupable for the PickupSpawner to spawn.
- @param pickup
- The Pickupable to be set.
+ Invoked by the timer, re-activates the PickupSpawner.
*/
- void PickupSpawner::setPickupable(Pickupable* pickup)
+ void PickupSpawner::respawnTimerCallback()
{
- if(this->pickup_ != NULL)
- {
- orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): setPickupable called, with this->pickup_ already set." << endl;
- return;
- }
- if(pickup == NULL)
- {
- orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): Argument of setPickupable is NULL." << endl;
- return;
- }
+ orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") reactivated." << endl;
- this->pickup_ = pickup;
+ this->setPickupable(this->createPickup());
}
/**
@brief
- Get the Pickupable that is spawned by this PickupSpawner.
+ Creates a new Pickupable.
@return
- Returns the Pickupable that is spawned by this PickupSpawner.
+ The Pickupable created.
*/
- const Pickupable* PickupSpawner::getPickupable(void) const
+ Pickupable* PickupSpawner::createPickup(void)
{
- return this->pickup_;
- }
-
- /**
- @brief
- Trigger the PickupSpawner.
- Adds the pickup to the Pawn that triggered, sets the timer to re-activate and deactives the PickupSpawner.
- @param pawn
- Pawn which triggered the PickupSpawner.
- */
- void PickupSpawner::trigger(Pawn* pawn)
- {
- if(this->isActive()) // Checks whether PickupSpawner is active.
+ if(this->spawnsRemaining_ == 0)
{
- orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered and active." << endl;
+ orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
+ return NULL;
+ }
- PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
- assert(carrier);
-
- // If the Pawn isn't a target of the Pickupable.
- if(!carrier->isTarget(this->pickup_))
+ if (this->pickupTemplate_ != NULL)
+ {
+ Identifier* identifier = this->pickupTemplate_->getBaseclassIdentifier();
+ if (identifier != NULL)
{
- orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered but Pawn wasn't a target of the Pickupable." << endl;
- return;
+ Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this));
+ orxonox_cast<BaseObject*>(pickup)->addTemplate(this->pickupTemplate_);
+ return pickup;
}
-
- PickupCarrier* target = carrier->getTarget(this->pickup_);
- Pickupable* pickup = this->getPickup();
-
- this->block(carrier);
-
- assert(pickup);
- assert(target);
- bool pickedUp = pickup->pickup(target);
- assert(pickedUp);
- pickedUp = false; // To avoid compiler warning.
-
- this->decrementSpawnsRemaining();
+ else
+ orxout(internal_error, context::pickups) << "No base class defined in pickup-template " << this->pickupTemplateName_ << endl;
}
+
+ return NULL;
}
/**
@brief
- Creates a new Pickupable.
- @return
- The Pickupable created.
+ Sets a Pickupable for the PickupSpawner to spawn.
+ @param pickup
+ The Pickupable to be set.
*/
- Pickupable* PickupSpawner::getPickup(void)
+ void PickupSpawner::setPickupable(Pickupable* pickup)
{
- if(this->spawnsRemaining_ == 0)
+ if (this->representation_ != NULL)
{
- orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
- return NULL;
+ this->representation_->destroy();
+ this->representation_ = NULL;
}
- Pickupable* pickup = this->pickup_->clone();
- return pickup;
- }
+ if (pickup != NULL)
+ {
+ if (this->pickup_ != NULL)
+ this->pickup_->destroy();
- /**
- @brief
- Invoked by the timer, re-activates the PickupSpawner.
- */
- void PickupSpawner::respawnTimerCallback()
- {
- orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") reactivated." << endl;
+ PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(pickup->getRepresentationName());
+ this->representation_ = representation->createSpawnerRepresentation(this);
+ this->attach(this->representation_);
+ this->setActive(true);
+ }
+ else
+ {
+ this->setActive(false);
+ }
- this->setActive(true);
+ this->pickup_ = pickup;
}
}
Modified: code/trunk/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/PickupSpawner.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -77,11 +77,11 @@
{
public:
PickupSpawner(BaseObject* creator); //!< Default Constructor.
- PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems); //!< Constructor.
virtual ~PickupSpawner(); //!< Destructor.
+ static PickupSpawner* createDroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0);
+
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupSpawner through XML.
- virtual void changedActivity(); //!< Invoked when activity has changed (set visibilty).
virtual void tick(float dt); //!< Tick, checks if any Pawn is close enough to trigger.
/**
@@ -102,8 +102,23 @@
*/
inline int getMaxSpawnedItems(void) const
{ return this->maxSpawnedItems_; }
+ /**
+ @brief Returns the name of the template which is used to create a pickup for this spawner.
+ */
+ inline const std::string& getPickupTemplateName() const
+ { return this->pickupTemplateName_; }
+ /**
+ @brief Returns the template which is used to create a pickup for this spawner.
+ */
+ inline Template* getPickupTemplate() const
+ {return this->pickupTemplate_; }
- protected:
+ private:
+ void initialize(void);
+
+ void trigger(PickupCarrier* carrier); //!< Method called when a carrier is close enough.
+ void respawnTimerCallback(); //!< Method called when the timer runs out.
+
void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns.
void startRespawnTimer(void); //!< Invoked by the timer, re-activates the PickupSpawner.
@@ -127,21 +142,20 @@
*/
inline void setRespawnTime(float time)
{ this->respawnTime_ = time; }
+
void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
- virtual Pickupable* getPickup(void); //!< Creates a new Pickupable.
+ void setPickupTemplateName(const std::string& name);
+ void setPickupTemplate(Template* temp);
+ Pickupable* createPickup(void); //!< Creates a new Pickupable.
void setPickupable(Pickupable* pickup); //!< Sets a Pickupable for the PickupSpawner to spawn.
- const Pickupable* getPickupable(void) const; //!< Get the Pickupable that is spawned by this PickupSpawner.
Pickupable* pickup_; //!< The pickup to be spawned.
+ StaticEntity* representation_; //!< The active representation of the spawner.
+ std::string pickupTemplateName_; //!< The name of the pickup template.
+ Template* pickupTemplate_; //!< The template to be used to create a pickupable.
- private:
- void initialize(void);
-
- void trigger(Pawn* pawn); //!< Method called when a Pawn is close enough.
- void respawnTimerCallback(); //!< Method called when the timer runs out.
-
int maxSpawnedItems_; //!< Maximum number of items spawned by this PickupSpawner.
int spawnsRemaining_; //!< Number of items that can be spawned by this PickupSpawner until it selfdestructs.
Modified: code/trunk/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/items/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -6,4 +6,5 @@
SpeedPickup.cc
ShieldPickup.cc
ShrinkPickup.cc
+ DamageBoostPickup.cc
)
Copied: code/trunk/src/modules/pickup/items/DamageBoostPickup.cc (from rev 9347, code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.cc)
===================================================================
--- code/trunk/src/modules/pickup/items/DamageBoostPickup.cc (rev 0)
+++ code/trunk/src/modules/pickup/items/DamageBoostPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,198 @@
+/*
+ * 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:
+ * Kevin Lengauer
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DamageBoostPickup.cc
+ @brief Implementation of the DamageBoostPickup class.
+*/
+
+#include "DamageBoostPickup.h"
+
+#include <sstream>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ CreateFactory(DamageBoostPickup);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes the member variables.
+ */
+ DamageBoostPickup::DamageBoostPickup(BaseObject* creator) : Pickup(creator)
+ {
+ RegisterObject(DamageBoostPickup);
+
+ this->initialize();
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ DamageBoostPickup::~DamageBoostPickup()
+ {
+ }
+
+ /**
+ @brief
+ Initializes the member variables.
+ */
+ void DamageBoostPickup::initialize(void)
+ {
+ this->duration_ = 0.0f;
+ this->damageMultiplier_ = 1.0f; //The default damage multiplier.
+ //Defines who is allowed to pick up the pickup.
+ this->addTarget(ClassIdentifier<SpaceShip>::getIdentifier());
+ }
+
+ /**
+ @brief
+ Method for creating a DamageBoostPickup object through XML.
+ */
+ void DamageBoostPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+ {
+ SUPER(DamageBoostPickup, XMLPort, xmlelement, mode);
+
+ XMLPortParam(DamageBoostPickup, "duration", setDuration, getDuration, xmlelement, mode);
+ XMLPortParam(DamageBoostPickup, "damageMultiplier", setDamageMultiplier, getDamageMultiplier, xmlelement, mode);
+ }
+
+ // Work in Progress setDamage Function
+ void DamageBoostPickup::setDamageMultiplier(float damageMultiplier)
+ {
+ if(damageMultiplier >= 1.0f)
+ {
+ this->damageMultiplier_ = damageMultiplier;
+ }
+ }
+
+
+ /**
+ @brief
+ Is called when the pickup has transisted from used to unused or the other way around.
+ */
+ void DamageBoostPickup::changedUsed(void)
+ {
+ SUPER(DamageBoostPickup, changedUsed);
+
+ SpaceShip* ship = this->carrierToSpaceShipHelper();
+ if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
+ this->Pickupable::destroy();
+
+
+ // If the pickup has transited to used.
+ if(this->isUsed())
+ {
+ // If its durationType is continuous, we set a Timer to be reminded, when the time has run out.
+ if(this->isContinuous())
+ {
+ if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)
+ {
+ this->durationTimer_.unpauseTimer();
+ }
+ else
+ {
+ this->durationTimer_.setTimer(this->getDuration(), false, createExecutor(createFunctor(&DamageBoostPickup::pickupTimerCallback, this)));
+ }
+ }
+
+ // Saves the old default Damage that is needed to restore the original damage
+ this->olddamageMultiplier_ = 1.0f;
+ // Sets the new Damage with the damage multiplier
+ ship->setDamageMultiplier(this->getDamageMultiplier());
+ }
+ else
+ {
+
+ // We destroy the pickup if either, the pickup has activationType immediate and durationType once or it has durationType continuous and the duration was exceeded.
+ if((!this->isContinuous() && this->isImmediate()) || (this->isContinuous() && !this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration()))
+ {
+ this->Pickupable::destroy();
+ ship->setDamageMultiplier ( this->olddamageMultiplier_);
+ }
+ // We pause the Timer if the pickup is continuous and the duration is not yet exceeded,
+ else if(this->isContinuous() && this->durationTimer_.isActive())
+ {
+ this->durationTimer_.pauseTimer();
+ }
+ }
+ }
+
+ /**
+ @brief
+ Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+ @return
+ A pointer to the SpaceShip, or NULL if the conversion failed.
+ */
+ SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void)
+ {
+ PickupCarrier* carrier = this->getCarrier();
+ SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
+
+ if(ship == NULL)
+ {
+ orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl;
+ }
+
+ return ship;
+ }
+
+ /**
+ @brief
+ Sets the duration for which the DamageBoostPickup stays active.
+ @param duration
+ The duration in seconds.
+ */
+ void DamageBoostPickup::setDuration(float duration)
+ {
+ if(duration >= 0.0f)
+ {
+ this->duration_ = duration;
+ }
+ else
+ {
+ orxout(internal_error, context::pickups) << "Invalid duration in DamagePickup." << endl;
+ this->duration_ = 0.0f;
+ }
+ }
+
+ /**
+ @brief
+ Helper method. Is called by the Timer as soon as it expires.
+ */
+ void DamageBoostPickup::pickupTimerCallback(void)
+ {
+ this->setUsed(false);
+ }
+
+}
+
Copied: code/trunk/src/modules/pickup/items/DamageBoostPickup.h (from rev 9347, code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.h)
===================================================================
--- code/trunk/src/modules/pickup/items/DamageBoostPickup.h (rev 0)
+++ code/trunk/src/modules/pickup/items/DamageBoostPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,100 @@
+/*
+ * 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:
+ * Kevin Lengauer
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DamageBoostPickup.h
+ @brief Declaration of the DamageBoostPickup class.
+ @ingroup PickupItems
+*/
+
+#ifndef _DamageBoostPickup_H__
+#define _DamageBoostPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+
+#include "pickup/Pickup.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox {
+
+ class _PickupExport DamageBoostPickup : public Pickup, public Tickable
+ {
+ public:
+
+ DamageBoostPickup(BaseObject* creator); //!< Constructor.
+ virtual ~DamageBoostPickup(); //!< Destructor.
+
+ virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DamageBoostPickup object through XML.
+
+ virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+
+ /**
+ @brief Get the time the DamagePickup lasts.
+ @return Returns the time in seconds the DamagePickup lasts.
+ */
+ inline float getDuration(void) const
+ { return this->duration_; }
+
+ inline void setDuration( float duration );
+
+
+
+ /**
+ @brief set Damage multiplier
+ @param multiplier The default damage multiplier to set
+ */
+ inline float getDamageMultiplier()
+ { return this->damageMultiplier_; }
+
+
+
+
+ protected:
+ void setDamageMultiplier(float damageMultiplier); //!< Sets the DamageMultiplier according to the XML.
+
+
+ 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.
+ SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+ void pickupTimerCallback(void);
+
+
+
+ float damageMultiplier_; //!< The damage boost that is transferred to the Pawn.
+ float olddamageMultiplier_; //!< Helper to remember what the actual damage of the Pawn was before we changed it.
+
+ Timer durationTimer_; //!< Timer.
+ float duration_; //! Duration of damage boost.
+
+ };
+}
+
+#endif // _DamageBoostPickup_H__
Modified: code/trunk/src/modules/pickup/items/DronePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/DronePickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -38,7 +38,6 @@
#include "core/XMLPort.h"
#include "controllers/DroneController.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/Drone.h"
#include "worldentities/pawns/Pawn.h"
@@ -74,31 +73,18 @@
void DronePickup::initialize(void)
{
this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
- this->setDurationTypeDirect(pickupDurationType::once);
+ this->setDurationType(pickupDurationType::once);
this->droneTemplate_ = "";
}
/**
@brief
- Initializes the PickupIdentifier of this pickup.
- */
- void DronePickup::initializeIdentifier(void)
- {
- std::string val = this->getDroneTemplate();
- std::string type = "droneTemplate";
- this->pickupIdentifier_->addParameter(type, val);
- }
-
- /**
- @brief
Method for creating a DronePickup object through XML.
*/
void DronePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
{
SUPER(DronePickup, XMLPort, xmlelement, mode);
XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode);
-
- this->initializeIdentifier();
}
/**
@@ -107,7 +93,7 @@
@param templatename
The name of the Template to e set.
*/
- void DronePickup::setDroneTemplate(std::string templatename){
+ void DronePickup::setDroneTemplate(const std::string& templatename){
droneTemplate_ = templatename;
}
@@ -143,7 +129,7 @@
drone->addTemplate(this->getDroneTemplate());
Controller* controller = drone->getController();
- DroneController* droneController = dynamic_cast<DroneController*>(controller);
+ DroneController* droneController = orxonox_cast<DroneController*>(controller);
if(droneController != NULL)
{
droneController->setOwner(pawn);
@@ -174,7 +160,7 @@
Pawn* DronePickup::carrierToPawnHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
if(pawn == NULL)
{
@@ -183,23 +169,4 @@
return pawn;
}
-
- /**
- @brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void DronePickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new DronePickup(this);
-
- SUPER(DronePickup, clone, item);
-
- DronePickup* pickup = dynamic_cast<DronePickup*>(item);
- pickup->setDroneTemplate(this->getDroneTemplate());
-
- pickup->initializeIdentifier();
- }
}
Modified: code/trunk/src/modules/pickup/items/DronePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/DronePickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -69,15 +69,12 @@
virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DronePickup 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.
const std::string& getDroneTemplate() const; //!< Get the name of the droneTemplate.
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
+ void setDroneTemplate(const std::string& templatename); //!< Set the droneTemplate.
- void setDroneTemplate(std::string templatename); //!< Set the droneTemplate.
-
private:
void initialize(void); //!< Initializes the member variables.
std::string droneTemplate_; //!< The name of the template, based upon which the Drone is created.
Modified: code/trunk/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/HealthPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,7 +37,6 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
namespace orxonox
@@ -86,29 +85,6 @@
/**
@brief
- Initializes the PickupIdentifier of this pickup.
- */
- void HealthPickup::initializeIdentifier(void)
- {
- std::stringstream stream;
- stream << this->getHealth();
- std::string type1 = "health";
- std::string val1 = stream.str();
- this->pickupIdentifier_->addParameter(type1, val1);
-
- std::string val2 = this->getHealthType();
- std::string type2 = "healthType";
- this->pickupIdentifier_->addParameter(type2, val2);
-
- stream.clear();
- stream << this->getHealthRate();
- std::string val3 = stream.str();
- std::string type3 = "healthRate";
- this->pickupIdentifier_->addParameter(type3, val3);
- }
-
- /**
- @brief
Method for creating a HealthPickup object through XML.
*/
void HealthPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
@@ -117,12 +93,10 @@
XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode);
XMLPortParam(HealthPickup, "healthRate", setHealthRate, getHealthRate, xmlelement, mode);
- XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode);
+ XMLPortParam(HealthPickup, "healthType", setHealthTypeAsString, getHealthTypeAsString, xmlelement, mode);
if(!this->isContinuous())
- this->healthRate_ = 0.0f;
-
- this->initializeIdentifier();
+ this->setHealthRate(0.0f); // TODO: this logic should be inside tick(), not in XMLPort
}
/**
@@ -150,7 +124,7 @@
float fullHealth = pawn->getHealth() + health;
this->setHealth(this->getHealth()-health);
- switch(this->getHealthTypeDirect())
+ switch(this->getHealthType())
{
case pickupHealthType::permanent:
if(pawn->getMaxHealth() < fullHealth)
@@ -197,7 +171,7 @@
this->Pickupable::destroy();
float health = 0.0f;
- switch(this->getHealthTypeDirect())
+ switch(this->getHealthType())
{
case pickupHealthType::permanent:
health = pawn->getHealth()+this->getHealth();
@@ -226,10 +200,10 @@
}
else
{
- if(this->getHealthTypeDirect() == pickupHealthType::temporary)
+ if(this->getHealthType() == pickupHealthType::temporary)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
if(pawn == NULL)
{
@@ -263,7 +237,7 @@
Pawn* HealthPickup::carrierToPawnHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
if(pawn == NULL)
orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl;
@@ -273,34 +247,13 @@
/**
@brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void HealthPickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new HealthPickup(this);
-
- SUPER(HealthPickup, clone, item);
-
- HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
- pickup->setHealth(this->getHealth());
- pickup->setHealthRate(this->getHealthRate());
- pickup->setHealthTypeDirect(this->getHealthTypeDirect());
-
- pickup->initializeIdentifier();
- }
-
- /**
- @brief
Get the health type of this pickup.
@return
Returns the health type as a string.
*/
- const std::string& HealthPickup::getHealthType(void) const
+ const std::string& HealthPickup::getHealthTypeAsString(void) const
{
- switch(this->getHealthTypeDirect())
+ switch(this->getHealthType())
{
case pickupHealthType::limited:
return HealthPickup::healthTypeLimited_s;
@@ -351,14 +304,14 @@
@param type
The type as a string.
*/
- void HealthPickup::setHealthType(std::string type)
+ void HealthPickup::setHealthTypeAsString(const std::string& type)
{
if(type == HealthPickup::healthTypeLimited_s)
- this->setHealthTypeDirect(pickupHealthType::limited);
+ this->setHealthType(pickupHealthType::limited);
else if(type == HealthPickup::healthTypeTemporary_s)
- this->setHealthTypeDirect(pickupHealthType::temporary);
+ this->setHealthType(pickupHealthType::temporary);
else if(type == HealthPickup::healthTypePermanent_s)
- this->setHealthTypeDirect(pickupHealthType::permanent);
+ this->setHealthType(pickupHealthType::permanent);
else
orxout(internal_error, context::pickups) << "Invalid healthType '" << type << "' in HealthPickup." << endl;
}
Modified: code/trunk/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/HealthPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -96,7 +96,6 @@
virtual void tick(float dt); //!< Is called every tick.
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.
/**
@brief Get the health that is transferred to the Pawn upon usage of this pickup.
@@ -115,13 +114,11 @@
@brief Get the type of HealthPickup, this pickup is.
@return Returns the health type as an enum.
*/
- inline pickupHealthType::Value getHealthTypeDirect(void) const
+ inline pickupHealthType::Value getHealthType(void) const
{ return this->healthType_; }
- const std::string& getHealthType(void) const; //!< Get the health type of this pickup.
+ const std::string& getHealthTypeAsString(void) const; //!< Get the health type of this pickup.
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
void setHealth(float health); //!< Sets the health.
void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous.
@@ -129,9 +126,9 @@
@brief Set the health type of this pickup.
@param type The type of this pickup as an enum.
*/
- inline void setHealthTypeDirect(pickupHealthType::Value type)
+ inline void setHealthType(pickupHealthType::Value type)
{ this->healthType_ = type; }
- void setHealthType(std::string type); //!< Set the type of the HealthPickup.
+ void setHealthTypeAsString(const std::string& type); //!< Set the type of the HealthPickup.
private:
void initialize(void); //!< Initializes the member variables.
Modified: code/trunk/src/modules/pickup/items/InvisiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -39,7 +39,6 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
namespace orxonox
@@ -78,27 +77,12 @@
/**
@brief
- Initializes the PickupIdentifier of this pickup.
- */
- void InvisiblePickup::initializeIdentifier(void)
- {
- std::stringstream stream;
- stream << this->getDuration();
- std::string type1 = "duration";
- std::string val1 = stream.str();
- this->pickupIdentifier_->addParameter(type1, val1);
- }
-
- /**
- @brief
Method for creating a HealthPickup object through XML.
*/
void InvisiblePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
{
SUPER(InvisiblePickup, XMLPort, xmlelement, mode);
XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
-
- this->initializeIdentifier();
}
/**
@@ -147,24 +131,6 @@
/**
@brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void InvisiblePickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new InvisiblePickup(this);
-
- SUPER(InvisiblePickup, clone, item);
-
- InvisiblePickup* pickup = dynamic_cast<InvisiblePickup*>(item);
- pickup->setDuration(this->getDuration());
- pickup->initializeIdentifier();
- }
-
- /**
- @brief
Sets the invisibility.
@param invisibility
The invisibility.
@@ -201,7 +167,7 @@
Pawn* InvisiblePickup::carrierToPawnHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
if(pawn == NULL)
{
Modified: code/trunk/src/modules/pickup/items/InvisiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -71,10 +71,9 @@
InvisiblePickup(BaseObject* creator); //!< Constructor.
virtual ~InvisiblePickup(); //!< 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.
/**
@brief Checks whether the Pawn is invisible.
@@ -90,8 +89,6 @@
{ return this->duration_; }
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
void setDuration(float duration); //!< Sets the time the InvisibilityPickup will last.
Modified: code/trunk/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/MetaPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -35,7 +35,6 @@
#include "core/XMLPort.h"
#include "interfaces/PickupCarrier.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
#include "MetaPickup.h"
@@ -79,32 +78,19 @@
{
this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
- this->setDurationTypeDirect(pickupDurationType::once);
+ this->setDurationType(pickupDurationType::once);
this->metaType_ = pickupMetaType::none;
}
/**
@brief
- Helper method to initialize the PickupIdentifier.
- */
- void MetaPickup::initializeIdentifier(void)
- {
- std::string val = this->getMetaType();
- std::string type = "metaType";
- this->pickupIdentifier_->addParameter(type, val);
- }
-
- /**
- @brief
Method for creating a MetaPickup object through XML.
*/
void MetaPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
{
SUPER(MetaPickup, XMLPort, xmlelement, mode);
- XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode);
-
- this->initializeIdentifier();
+ XMLPortParam(MetaPickup, "metaType", setMetaTypeAsString, getMetaTypeAsString, xmlelement, mode);
}
/**
@@ -120,10 +106,10 @@
if(this->isUsed() && this->metaType_ != pickupMetaType::none)
{
PickupCarrier* carrier = this->getCarrier();
- if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
+ if(this->getMetaType() != pickupMetaType::none && carrier != NULL)
{
// If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
- if(this->getMetaTypeDirect() == pickupMetaType::destroyCarrier)
+ if(this->getMetaType() == pickupMetaType::destroyCarrier)
{
Pawn* pawn = orxonox_cast<Pawn*>(carrier);
pawn->kill();
@@ -138,17 +124,17 @@
continue;
// If the metaType is use, then the Pickupable is set to used.
- if(this->getMetaTypeDirect() == pickupMetaType::use && !pickup->isUsed())
+ if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())
{
pickup->setUsed(true);
}
// If the metaType is drop, then the Pickupable is dropped.
- else if(this->getMetaTypeDirect() == pickupMetaType::drop)
+ else if(this->getMetaType() == pickupMetaType::drop)
{
pickup->drop();
}
// If the metaType is destroy, then the Pickupable is destroyed.
- else if(this->getMetaTypeDirect() == pickupMetaType::destroy)
+ else if(this->getMetaType() == pickupMetaType::destroy)
{
pickup->Pickupable::destroy();
}
@@ -160,32 +146,13 @@
/**
@brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void MetaPickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new MetaPickup(this);
-
- SUPER(MetaPickup, clone, item);
-
- MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
- pickup->setMetaTypeDirect(this->getMetaTypeDirect());
-
- pickup->initializeIdentifier();
- }
-
- /**
- @brief
Get the meta type of this MetaPickup.
@return
Returns a string with the meta type of the MetaPickup.
*/
- const std::string& MetaPickup::getMetaType(void) const
+ const std::string& MetaPickup::getMetaTypeAsString(void) const
{
- switch(this->getMetaTypeDirect())
+ switch(this->getMetaType())
{
case pickupMetaType::none:
return MetaPickup::metaTypeNone_s;
@@ -208,27 +175,27 @@
@param type
A string with the type to be set.
*/
- void MetaPickup::setMetaType(const std::string& type)
+ void MetaPickup::setMetaTypeAsString(const std::string& type)
{
if(type == MetaPickup::metaTypeNone_s)
{
- this->setMetaTypeDirect(pickupMetaType::none);
+ this->setMetaType(pickupMetaType::none);
}
else if(type == MetaPickup::metaTypeUse_s)
{
- this->setMetaTypeDirect(pickupMetaType::use);
+ this->setMetaType(pickupMetaType::use);
}
else if(type == MetaPickup::metaTypeDrop_s)
{
- this->setMetaTypeDirect(pickupMetaType::drop);
+ this->setMetaType(pickupMetaType::drop);
}
else if(type == MetaPickup::metaTypeDestroy_s)
{
- this->setMetaTypeDirect(pickupMetaType::destroy);
+ this->setMetaType(pickupMetaType::destroy);
}
else if(type == MetaPickup::metaTypeDestroyCarrier_s)
{
- this->setMetaTypeDirect(pickupMetaType::destroyCarrier);
+ this->setMetaType(pickupMetaType::destroyCarrier);
}
else
orxout(internal_warning, context::pickups) << "Invalid metaType '" << type << "' in MetaPickup." << endl;
Modified: code/trunk/src/modules/pickup/items/MetaPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/MetaPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -68,7 +68,7 @@
- @b destroyCarrier The PickupCarrier is immediately destroyed upon using the MetaPickup.
The default value is <em>none</em>, which basically does nothing.
-
+
The parameter <b>activation type</b> can be used to specify, whether the MetaPickup is used upon pickup (<em>immediate</em>) or not (<em>onUse</em>). With <em>immediate</em> being the default.
An example of a XML implementation of a MetaPickup would be:
@@ -94,26 +94,23 @@
virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup 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.
/**
@brief Returns the meta type of the MetaPickup.
@return Returns an enum with the meta type of the MetaPickup.
*/
- inline pickupMetaType::Value getMetaTypeDirect(void) const
+ inline pickupMetaType::Value getMetaType(void) const
{ return this->metaType_; }
- const std::string& getMetaType(void) const; //!< Get the meta type of this MetaPickup.
+ const std::string& getMetaTypeAsString(void) const; //!< Get the meta type of this MetaPickup.
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
/**
@brief Set the meta type of the MetaPickup.
@param type The meta type as an enum.
*/
- inline void setMetaTypeDirect(pickupMetaType::Value type)
+ inline void setMetaType(pickupMetaType::Value type)
{ this->metaType_ = type; }
- void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
+ void setMetaTypeAsString(const std::string& type); //!< Set the meta type of this MetaPickup.
private:
void initialize(void); //!< Initializes the member variables.
Modified: code/trunk/src/modules/pickup/items/ShieldPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,7 +37,6 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
namespace orxonox
@@ -79,32 +78,6 @@
/**
@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)
@@ -114,8 +87,6 @@
XMLPortParam(ShieldPickup, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode);
XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
-
- this->initializeIdentifier();
}
/**
@@ -176,7 +147,7 @@
Pawn* ShieldPickup::carrierToPawnHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
if(pawn == NULL)
{
@@ -187,26 +158,6 @@
/**
@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 duration.
@param duration
The duration in seconds.
Modified: code/trunk/src/modules/pickup/items/ShieldPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -81,7 +81,6 @@
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.
/**
@brief Get the duration, the time the shield is actvie at the most.
@@ -103,7 +102,6 @@
{ return this->shieldAbsorption_; }
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires.
void setDuration(float duration); //!< Sets the duration.
Modified: code/trunk/src/modules/pickup/items/ShrinkPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShrinkPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/ShrinkPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -39,7 +39,6 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
#include "worldentities/CameraPosition.h"
@@ -80,27 +79,6 @@
this->currentFactor_ = 1.0f;
}
- void ShrinkPickup::initializeIdentifier(void)
- {
- std::stringstream stream;
- stream << this->getShrinkFactor();
- std::string type1 = "shrinkFactor";
- std::string val1 = stream.str();
- this->pickupIdentifier_->addParameter(type1, val1);
-
- stream.clear();
- stream << this->getDuration();
- std::string val2 = stream.str();
- std::string type2 = "duration";
- this->pickupIdentifier_->addParameter(type2, val2);
-
- stream.clear();
- stream << this->getShrinkDuration();
- std::string val3 = stream.str();
- std::string type3 = "shrinkDuration";
- this->pickupIdentifier_->addParameter(type3, val3);
- }
-
/**
@brief
Method for creating a ShrinkPickup object through XML.
@@ -112,11 +90,51 @@
XMLPortParam(ShrinkPickup, "shrinkFactor", setShrinkFactor, getShrinkFactor, xmlelement, mode);
XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode);
XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode);
+ }
- this->initializeIdentifier();
+ /**
+ @brief Sets the shrinking factor.
+ @param factor The factor, needs to greater than 1.
+ */
+ void ShrinkPickup::setShrinkFactor(float factor)
+ {
+ if(factor <= 1.0f)
+ {
+ orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl;
+ return;
+ }
+ this->shrinkFactor_ = factor;
}
/**
+ @brief Set the duration for which the ship remains shrunken.
+ @param duration The duration, needs to be non-negative.
+ */
+ void ShrinkPickup::setDuration(float duration)
+ {
+ if(duration < 0.0f)
+ {
+ orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl;
+ return;
+ }
+ this->duration_ = duration;
+ }
+
+ /**
+ @brief Set the shrink duration.
+ @param speed The shrink duration, needs to be positive.
+ */
+ void ShrinkPickup::setShrinkDuration(float speed)
+ {
+ if(speed <= 0.0f)
+ {
+ orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl;
+ return;
+ }
+ this->shrinkDuration_ = speed;
+ }
+
+ /**
@brief
Prepares for shrinking.
*/
@@ -147,7 +165,7 @@
void ShrinkPickup::changedPickedUp(void)
{
SUPER(ShrinkPickup, changedPickedUp);
-
+
if(!this->isPickedUp() && this->isActive_)
{
if(this->isShrinking_ || this->isTerminating_)
@@ -270,7 +288,7 @@
this->currentFactor_ = currentFactor;
bool destroy = false;
-
+
// Stop shrinking if the desired size is reached.
if(this->timeRemainig_ <= 0.0f)
{
@@ -313,28 +331,8 @@
Pawn* ShrinkPickup::carrierToPawnHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
return pawn;
}
-
- /**
- @brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void ShrinkPickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new ShrinkPickup(this);
-
- SUPER(ShrinkPickup, clone, item);
- ShrinkPickup* pickup = dynamic_cast<ShrinkPickup*>(item);
- pickup->setShrinkFactor(this->getShrinkFactor());
- pickup->setDuration(this->getDuration());
- pickup->setShrinkDuration(this->getShrinkDuration());
-
- pickup->initializeIdentifier();
- }
}
Modified: code/trunk/src/modules/pickup/items/ShrinkPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShrinkPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/ShrinkPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -79,7 +79,6 @@
virtual void changedUsed(void); // Is called when the pickup has transited from used to unused or the other way around.
virtual void changedPickedUp(void);
- virtual void clone(OrxonoxClass*& item); // Creates a duplicate of the input OrxonoxClass.
/**
@brief Get the shrinking factor.
@@ -87,40 +86,24 @@
*/
inline float getShrinkFactor(void) const
{ return this->shrinkFactor_; }
+ void setShrinkFactor(float factor);
+
/**
- @brief Sets the shrinking factor.
- @param factor The factor, needs to greater than 1.
- */
- inline void setShrinkFactor(float factor)
- { if(factor <= 1.0f) { orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; }
- /**
@brief Get the duration for which the ship remains shrunken.
@return Returns the duration.
*/
inline float getDuration(void) const
{ return this->duration_; }
+ void setDuration(float duration);
+
/**
- @brief Set the duration for which the ship remains shrunken.
- @param duration The duration, needs to be non-negative.
- */
- inline void setDuration(float duration)
- { if(duration < 0.0f) { orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; }
- /**
@brief Get the shrink speed.
@return Returns the shrink speed.
*/
inline float getShrinkDuration(void) const
{ return this->shrinkDuration_; }
- /**
- @brief Set the shrink duration.
- @param speed The shrink duration, needs to be positive.
- */
- inline void setShrinkDuration(float speed)
- { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
+ void setShrinkDuration(float speed);
- protected:
- void initializeIdentifier(void);
-
private:
void initialize(void);
@@ -134,7 +117,7 @@
float currentFactor_; //!< The shrink factor that is currently applied.
float timeRemainig_; //!< The remaining shrink time.
-
+
Pawn* carrierToPawnHelper(void);
Timer durationTimer_;
void terminate(void);
Modified: code/trunk/src/modules/pickup/items/SpeedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,7 +37,6 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/SpaceShip.h"
namespace orxonox
@@ -79,31 +78,6 @@
/**
@brief
- Initializes the PickupIdentifier of this pickup.
- */
- void SpeedPickup::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->getSpeedAdd();
- std::string type2 = "speedAdd";
- std::string val2 = stream.str();
- this->pickupIdentifier_->addParameter(type2, val2);
-
- stream.clear();
- stream << this->getSpeedMultiply();
- std::string type3 = "speedMultiply";
- std::string val3 = stream.str();
- this->pickupIdentifier_->addParameter(type3, val3);
- }
-
- /**
- @brief
Method for creating a SpeedPickup object through XML.
*/
void SpeedPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
@@ -113,8 +87,6 @@
XMLPortParam(SpeedPickup, "duration", setDuration, getDuration, xmlelement, mode);
XMLPortParam(SpeedPickup, "speedAdd", setSpeedAdd, getSpeedAdd, xmlelement, mode);
XMLPortParam(SpeedPickup, "speedMultiply", setSpeedMultiply, getSpeedMultiply, xmlelement, mode);
-
- this->initializeIdentifier();
}
/**
@@ -175,7 +147,7 @@
SpaceShip* SpeedPickup::carrierToSpaceShipHelper(void)
{
PickupCarrier* carrier = this->getCarrier();
- SpaceShip* ship = dynamic_cast<SpaceShip*>(carrier);
+ SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
if(ship == NULL)
{
@@ -187,27 +159,6 @@
/**
@brief
- Creates a duplicate of the input OrxonoxClass.
- @param item
- A pointer to the Orxonox class.
- */
- void SpeedPickup::clone(OrxonoxClass*& item)
- {
- if(item == NULL)
- item = new SpeedPickup(this);
-
- SUPER(SpeedPickup, clone, item);
-
- SpeedPickup* pickup = dynamic_cast<SpeedPickup*>(item);
- pickup->setDuration(this->getDuration());
- pickup->setSpeedAdd(this->getSpeedAdd());
- pickup->setSpeedMultiply(this->getSpeedMultiply());
-
- pickup->initializeIdentifier();
- }
-
- /**
- @brief
Sets the duration for which the SpeedPickup stays active.
@param duration
The duration in seconds.
Modified: code/trunk/src/modules/pickup/items/SpeedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -80,7 +80,6 @@
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.
/**
@brief Get the duration, the time the SpeedPickup is active.
@@ -102,7 +101,6 @@
{ return this->speedMultiply_; }
protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
void pickupTimerCallback(void); //!< Function that gets called when timer ends.
void setDuration(float duration); //!< Sets the duration.
@@ -111,7 +109,7 @@
private:
void initialize(void); //!< Initializes the member variables.
- SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceSHip, and throw an error message if the conversion fails.
+ SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
Timer durationTimer_; //!< Timer.
Modified: code/trunk/src/modules/pong/Pong.cc
===================================================================
--- code/trunk/src/modules/pong/Pong.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pong/Pong.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -255,9 +255,9 @@
@brief
Is called when the player scored.
*/
- void Pong::playerScored(PlayerInfo* player)
+ void Pong::playerScored(PlayerInfo* player, int score)
{
- Deathmatch::playerScored(player);
+ Deathmatch::playerScored(player, score);
if (this->center_ != NULL) // If there is a centerpoint.
{
Modified: code/trunk/src/modules/pong/Pong.h
===================================================================
--- code/trunk/src/modules/pong/Pong.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/pong/Pong.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -72,7 +72,7 @@
virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
- virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored.
+ virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored.
/**
@brief Set the PongCenterpoint (the playing field).
Modified: code/trunk/src/modules/tetris/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/tetris/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -2,6 +2,8 @@
Tetris.cc
TetrisCenterpoint.cc
TetrisStone.cc
+ TetrisBrick.cc
+ TetrisScore.cc
)
ORXONOX_ADD_LIBRARY(tetris
@@ -9,5 +11,6 @@
FIND_HEADER_FILES
LINK_LIBRARIES
orxonox
+ overlays
SOURCE_FILES ${TETRIS_SRC_FILES}
)
Modified: code/trunk/src/modules/tetris/Tetris.cc
===================================================================
--- code/trunk/src/modules/tetris/Tetris.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/Tetris.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -22,8 +22,14 @@
* Author:
* ...
* Co-authors:
- * ...
+ * Johannes Ritz
*
+ *
+ *
+ *
+ *TASK c) end the game in a nicer way
+ *TASK d) save the highscore
+ *TASK e) eye candy
*/
/**
@@ -41,6 +47,7 @@
#include "TetrisCenterpoint.h"
#include "TetrisStone.h"
+#include "TetrisBrick.h"
#include "infos/PlayerInfo.h"
namespace orxonox
@@ -51,18 +58,21 @@
/**
@brief
Constructor. Registers and initializes the object.
+ @ingroup Tetris
*/
Tetris::Tetris(BaseObject* creator) : Deathmatch(creator)
{
RegisterObject(Tetris);
- this->activeStone_ = NULL;
+ this->activeBrick_ = 0;
// Pre-set the timer, but don't start it yet.
- this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Tetris::startStone, this)));
+ this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Tetris::startBrick, this)));
this->starttimer_.stopTimer();
this->player_ = NULL;
+ this->setHUDTemplate("TetrisHUD");
+ this->futureBrick_ = 0;
}
/**
@@ -81,20 +91,36 @@
*/
void Tetris::cleanup()
{
+ if (this->activeBrick_)
+ {
+ this->activeBrick_->destroy();
+ this->activeBrick_ = 0;
+ }
+ if (this->futureBrick_)
+ {
+ this->futureBrick_->destroy();
+ this->futureBrick_ = 0;
+ }
+ for (std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+ (*it)->destroy();
+ this->stones_.clear();
}
void Tetris::tick(float dt)
{
SUPER(Tetris, tick, dt);
- if(this->activeStone_ != NULL)
+ if((this->activeBrick_ != NULL)&&(!this->hasEnded()))
{
- if(!this->isValidStonePosition(this->activeStone_, this->activeStone_->getPosition()))
+ if(!this->isValidBrickPosition(this->activeBrick_))
{
- this->activeStone_->setVelocity(Vector3::ZERO);
- this->createStone();
- this->startStone();
+ for (unsigned int i = 0; i < this->activeBrick_->getNumberOfStones(); i++)
+ this->stones_.push_back(this->activeBrick_->getStone(i));
+ this->activeBrick_->setVelocity(Vector3::ZERO);
+ this->activeBrick_->releaseStones(this->center_);
+ this->findFullRows();
+ this->startBrick();
}
}
}
@@ -108,11 +134,8 @@
else if(position.x > (this->center_->getWidth()-0.5)*this->center_->getStoneSize()) //!< If the stone touches the right edge of the level
return false;
- for(std::vector<TetrisStone*>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+ for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
{
- if(stone == *it)
- continue;
-
const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
@@ -122,21 +145,63 @@
return true;
}
+ /**
+ @brief
+ Check for each stone in a brick if it is moved the right way.
+ */
+ bool Tetris::isValidMove(TetrisBrick* brick, const Vector3& position, bool isRotation = false)
+ {
+ assert(brick);
+
+ for (unsigned int i = 0; i < brick->getNumberOfStones(); i++ )
+ {
+ TetrisStone* stone = brick->getStone(i);
+ Vector3 stonePosition; //the current stone's offset to position
+ if(isRotation)
+ stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount()+1);
+ else
+ stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount());
+
+ if(! this->isValidMove(stone, position + stonePosition ))
+ {
+ return false;
+ }
+
+ //catch illegal rotation (such that collisions with ground are not permitted)
+ if(isRotation)
+ {
+ if((position + stonePosition).y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+
+ }
+
+
+
bool Tetris::isValidStonePosition(TetrisStone* stone, const Vector3& position)
{
assert(stone);
- // we use a reverse iterator because we have to check for collisions with the topmost stones first
- for(std::vector<TetrisStone*>::const_reverse_iterator it = this->stones_.rbegin(); it != this->stones_.rend(); ++it)
+ // check for collisions with all stones
+ for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
{
- if(stone == *it)
- continue;
-
+ //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
+ //!< Saves the position of the currentStone
+ //filter out cases where the falling stone is already below a steady stone
+ if(position.y < currentStonePosition.y - this->center_->getStoneSize()/2.0f)
+ continue;
if((position.x == currentStonePosition.x) && (position.y < currentStonePosition.y + this->center_->getStoneSize()))
{
- this->activeStone_->setPosition(Vector3(this->activeStone_->getPosition().x, currentStonePosition.y+this->center_->getStoneSize(), this->activeStone_->getPosition().z));
+ float y_offset = static_cast<int>((this->activeBrick_->getPosition().y-currentStonePosition.y+10)/10)*10 + currentStonePosition.y;
+ if(y_offset < 0) //filter out extreme cases (very rare bug)
+ y_offset = 0;
+ this->activeBrick_->setPosition(Vector3(this->activeBrick_->getPosition().x, y_offset, this->activeBrick_->getPosition().z));
return false;
}// This case applies if the stones overlap partially vertically
}
@@ -144,23 +209,66 @@
// after we checked for collision with all stones, we also check for collision with the bottom
if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
{
- stone->setPosition(Vector3(stone->getPosition().x, this->center_->getStoneSize()/2.0f, stone->getPosition().z));
+ float yOffset = stone->getPosition().y + this->center_->getStoneSize()/2.0f;//calculate offset
+ if(yOffset < 0) //catch brake-throughs
+ yOffset = 0;
+ this->activeBrick_->setPosition(Vector3(this->activeBrick_->getPosition().x, yOffset, this->activeBrick_->getPosition().z));
return false;
}
return true;
}
+ /**
+ * @brief This function determines wether a brick touches another brick or the ground.
+ *
+ */
+ bool Tetris::isValidBrickPosition(TetrisBrick* brick)
+ {
+ assert(brick);
+ const Vector3& brickPosition = this->activeBrick_->getPosition();
+
+ // check all stones in the brick
+ for (unsigned int i = 0; i < brick->getNumberOfStones(); i++ )
+ {
+ TetrisStone* stone = brick->getStone(i);
+ const Vector3& stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount());
+ if(! this->isValidStonePosition(stone, brickPosition + stonePosition) )
+ {
+ // recurse because all stones have to checked again after the brick was re-positioned
+ this->isValidBrickPosition(brick);
+ return false;
+ }
+ }
+ return true;
+ }
+
/**
@brief
+ A Vector3 is rolled 90 * degrees * amount (anticlockwise rotation)
+ */
+ Vector3 Tetris::rotateVector(Vector3 position, unsigned int amount)
+ {
+ float temp = 0;
+ for(unsigned int i = 0; i < amount; i++)
+ {
+ temp = position.x;
+ position.x = -position.y;
+ position.y = temp;
+ }
+ return position;
+ }
+
+ /**
+ @brief
Starts the Tetris minigame.
*/
void Tetris::start()
{
if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.
{
- // Create the first stone.
- this->createStone();
+ // Create the first brick.
+ this->createBrick();
}
else // If no centerpoint was specified, an error is thrown and the level is exited.
{
@@ -189,6 +297,12 @@
*/
void Tetris::end()
{
+ this->activeBrick_->setVelocity(Vector3::ZERO);
+ if(this->activeBrick_ != NULL)
+ {
+ this->player_->stopControl();
+ }
+
this->cleanup();
// Call end for the parent class.
@@ -224,52 +338,61 @@
}
}
- /**
- @brief
- Starts the first stone.
- */
- void Tetris::startStone(void)
+
+
+ void Tetris::startBrick(void)
{
if(this->player_ == NULL)
return;
unsigned int cameraIndex = 0;
- if(this->activeStone_ != NULL)
+ if(this->activeBrick_ != NULL)
{
// Get camera settings
- cameraIndex = this->activeStone_->getCurrentCameraIndex();
+ cameraIndex = this->activeBrick_->getCurrentCameraIndex();
this->player_->stopControl();
+ // destroy old active brick
+ this->activeBrick_->destroy();
}
-
- // Make the last stone to be created the active stone.
- this->activeStone_ = this->stones_.back();
-
- this->player_->startControl(this->activeStone_);
- this->activeStone_->setVelocity(0.0f, -this->center_->getStoneSpeed(), 0.0f);
- this->activeStone_->setCameraPosition(cameraIndex);
+
+ // Make the last brick to be created the active brick.
+ this->activeBrick_ = this->futureBrick_;
+ this->futureBrick_ = 0;
+
+ // set its position
+ this->player_->startControl(this->activeBrick_);
+ float xPos = (this->center_->getWidth()/2 + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
+ float yPos = (this->center_->getHeight()-0.5f)*this->center_->getStoneSize();
+ this->activeBrick_->setPosition(xPos, yPos, 0.0f);
+ this->activeBrick_->setVelocity(0.0f, -this->center_->getStoneSpeed(), 0.0f);
+ this->activeBrick_->setCameraPosition(cameraIndex);
+
+ // create a new future brick
+ this->createBrick();
+
+ // check if the new brick is in a valid position, otherwise end the game
+ if (!this->isValidBrickPosition(this->activeBrick_))
+ this->end();
}
- /**
- @brief
- Creates a new stone.
- */
- void Tetris::createStone(void)
+ void Tetris::createBrick(void) //TODO: random rotation offset between 0 and 3 (times 90°)
{
- // Create a new stone and add it to the list of stones.
- TetrisStone* stone = new TetrisStone(this->center_);
- this->stones_.push_back(stone);
-
+ // create new futureBrick_
+ this->futureBrick_ = new TetrisBrick(this->center_);
+
+
// Apply the stone template to the stone.
- stone->addTemplate(this->center_->getStoneTemplate());
-
- // Attach the stone to the Centerpoint and set the position of the stone to be at the top middle.
- this->center_->attach(stone);
- float xPos = (this->center_->getWidth()/2 + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
- float yPos = (this->center_->getHeight()-0.5f)*this->center_->getStoneSize();
- stone->setPosition(xPos, yPos, 0.0f);
- stone->setGame(this);
+ this->futureBrick_->addTemplate(this->center_->getBrickTemplate());
+
+ // Attach the brick to the Centerpoint and set the position of the brick to be at the left side.
+ this->center_->attach(this->futureBrick_);
+ float xPos = (this->center_->getWidth()*1.6f + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
+ float yPos = (this->center_->getHeight()-5.1f)*this->center_->getStoneSize();
+ this->futureBrick_->setPosition(xPos, yPos, 0.0f);
+ this->futureBrick_->setGame(this);
}
+
/**
@brief
Get the player.
@@ -281,6 +404,11 @@
return this->player_;
}
+ /*TetrisCenterpoint* Tetris::getCenterpoint(void) const
+ {
+ return this->center_;
+ }*/
+
/**
@brief Set the TetrisCenterpoint (the playing field).
@param center A pointer to the TetrisCenterpoint to be set.
@@ -290,4 +418,57 @@
this->center_ = center;
}
+ /**
+ @brief Check each row if it is full. Removes all full rows. Update
+ @brief Manages score.
+ */
+ void Tetris::findFullRows()
+ {
+ unsigned int correctPosition = 0;
+ unsigned int stonesPerRow = 0;
+ for (unsigned int row = 0; row < this->center_->getHeight(); row++)
+ {
+ stonesPerRow = 0;
+ for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+ {
+ std::list<SmartPtr<TetrisStone> >::iterator it_temp = it++;
+ correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
+ if(correctPosition == row)
+ {
+ stonesPerRow++;
+ if(stonesPerRow == this->center_->getWidth())
+ {
+ clearRow(row);
+ row--; //the row counter has to be decreased in order to detect multiple rows!
+ this->playerScored(this->player_);// add points
+ //increase the stone's speed
+ this->center_->setStoneSpeed(this->center_->getStoneSpeed()+1.0f);
+ }
+ }
+ }
+ }
+ }
+
+ void Tetris::clearRow(unsigned int row)
+ {// clear the full row
+ for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+ {
+ if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
+ {
+ (*it)->destroy();
+ this->stones_.erase(it++);
+ }
+ else
+ ++it;
+ }
+ // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
+ for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+ {
+ if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
+ (*it)->setPosition((*it)->getPosition()-Vector3(0,10,0));
+ }
+
+ }
+
+
}
Modified: code/trunk/src/modules/tetris/Tetris.h
===================================================================
--- code/trunk/src/modules/tetris/Tetris.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/Tetris.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -55,7 +55,7 @@
{
public:
Tetris(BaseObject* creator); //!< Constructor. Registers and initializes the object.
- virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.
+ virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.
virtual void start(void); //!< Starts the Tetris minigame.
virtual void end(void); ///!< Ends the Tetris minigame.
@@ -67,25 +67,34 @@
void setCenterpoint(TetrisCenterpoint* center);
PlayerInfo* getPlayer(void) const; //!< Get the player.
+ WeakPtr<TetrisCenterpoint> getCenterpoint(void)
+ { return this->center_; }
bool isValidMove(TetrisStone* stone, const Vector3& position);
+ bool isValidMove(TetrisBrick* brick, const Vector3& position, bool isRotation);
+ Vector3 rotateVector(Vector3 position, unsigned int amount);
protected:
virtual void spawnPlayersIfRequested(); //!< Spawns player.
+
private:
- void startStone(void); //!< Starts with the first stone.
- void createStone(void);
+ void startBrick(void);
+ void createBrick(void);
void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
bool isValidStonePosition(TetrisStone* stone, const Vector3& position);
-
+ bool isValidBrickPosition(TetrisBrick* brick);
+ void findFullRows(void);
+ void clearRow(unsigned int row);
+
+
PlayerInfo* player_;
WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
- std::vector<TetrisStone*> stones_; //!< A list of all stones in play.
- std::vector< std::vector<bool> > grid_;
- TetrisStone* activeStone_;
-
+ std::list<SmartPtr<TetrisStone> > stones_; //!< A list of all stones in play.
+ WeakPtr<TetrisBrick> activeBrick_;
+ WeakPtr<TetrisBrick> futureBrick_;
+
Timer starttimer_; //!< A timer to delay the start of the game.
};
}
Copied: code/trunk/src/modules/tetris/TetrisBrick.cc (from rev 9347, code/branches/presentation2012merge/src/modules/tetris/TetrisBrick.cc)
===================================================================
--- code/trunk/src/modules/tetris/TetrisBrick.cc (rev 0)
+++ code/trunk/src/modules/tetris/TetrisBrick.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,247 @@
+/*
+ * 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:
+ * ...
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TetrisBrick.cc
+ @brief Implementation of the TetrisBrick class.
+*/
+
+#include "TetrisBrick.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "TetrisCenterpoint.h"
+#include "TetrisStone.h"
+#include "Tetris.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+ CreateFactory(TetrisBrick);
+
+ /**
+ @brief
+ Constructor. Registers and initializes the object.
+ @ingroup Tetris
+ */
+ TetrisBrick::TetrisBrick(BaseObject* creator): ControllableEntity(creator)
+ {
+ RegisterObject(TetrisBrick);
+ this->shapeIndex_ = static_cast<unsigned int>(rnd(7.0f)); //<! random number between 0 and 7
+ this->stonesPerBrick_ = 4; //<! most tetris bricks is formed by 4 stones
+ this->delay_ = false;
+ this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisBrick::enableMovement, this)));
+ this->lockRotation_ = false;
+ this->tetris_ = this->getTetris();
+ this->size_ = 10.0f; //TODO: fix this via this->tetris_->center_->getStoneSize();
+ this->rotationCount_ = 0;
+ this->createBrick(); //<! create a whole new Brick;
+ }
+
+ /**
+ @brief
+ This function partly initializes a TetrisBrick as an array of TetrisStones
+ */
+ void TetrisBrick::createBrick(void)
+ { //Index 0 : single stone, 1 : 4 in a row; 2: 4-Block right shifted; 3: 'T' 4: 4-Block left shifted;
+ //Index 5 : 4-Block; 6 : 'L'; 7 : mirrored 'L';
+ if(this->shapeIndex_ == 0)
+ this->stonesPerBrick_ = 1;
+ for (unsigned int i = 0; i < this->stonesPerBrick_; i++)
+ {
+ // Create a new stone and add it to the brick.
+ TetrisStone* stone = new TetrisStone(this);
+ this->brickStones_.push_back(stone);
+ this->attach(stone);
+ this->formBrick(stone, i);
+ if(this->tetris_ != NULL)
+ {
+ stone->setGame(this->tetris_);
+ if(this->tetris_->getCenterpoint() != NULL)
+ stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate());
+ else
+ orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl;
+ }
+ else
+ orxout()<< "tetris_ == NULL in TetrisBrick.cc"<< endl;
+ }
+ }
+
+ /**
+ @brief
+ This function creates the shape of a TetrisBrick. ! Spaghetti-Code !
+ @param i
+ The stone's number.
+ @param stone
+ The TetrisStone that is placed relative to the brick's position.
+ */
+ void TetrisBrick::formBrick(TetrisStone* stone, unsigned int i)
+ {
+ if(i == 0) //setting the first stone as
+ {
+ stone->setPosition(0.0f, 0.0f, 0.0f);
+ }
+ else if(i == 1)
+ {
+ stone->setPosition(0.0f, size_, 0.0f);
+ }
+ else if(i == 2)
+ {
+ if(this->shapeIndex_ == 1 || this->shapeIndex_ == 6 || this->shapeIndex_ == 7)
+ {
+ stone->setPosition(0.0f, 2*size_, 0.0f);
+ }
+ else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5)
+ {
+ stone->setPosition(size_, 0, 0.0f);
+ }
+ else if(this->shapeIndex_ == 2)
+ {
+ stone->setPosition(-size_, 0, 0.0f);
+ }
+ }
+ else if(i == 3)
+ {
+ if(this->shapeIndex_ == 2 || this->shapeIndex_ == 5)
+ {
+ stone->setPosition(size_, size_, 0.0f);
+ }
+ else if(this->shapeIndex_ == 1)
+ {
+ stone->setPosition(0, 3*size_, 0.0f);
+ }
+ else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7)
+ {
+ stone->setPosition(-size_, 0, 0.0f);
+ }
+ else if(this->shapeIndex_ == 4)
+ {
+ stone->setPosition(-size_, size_, 0.0f);
+ }
+ else if(this->shapeIndex_ == 6)
+ {
+ stone->setPosition(size_, 0, 0.0f);
+ }
+ }
+ }
+
+ bool TetrisBrick::isValidMove(const Vector3& position, bool isRotation = false)
+ {
+ return this->tetris_->isValidMove(this,position, isRotation);
+ }
+
+ TetrisStone* TetrisBrick::getStone(unsigned int i)
+ {
+ if(i < this->brickStones_.size())
+ return this->brickStones_[i];
+ else return NULL;
+ }
+
+
+ Tetris* TetrisBrick::getTetris()
+ {
+ if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
+ {
+ Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
+ return tetrisGametype;
+ }
+ return NULL;
+ }
+
+ /**
+ @brief
+ Overloaded the function to rotate the Brick.
+ @param value
+ A vector whose first component is the angle by which to rotate.
+ */
+ void TetrisBrick::moveFrontBack(const Vector2& value)
+ {
+ if(value.x < 0) //speedup on key down
+ {
+ this->setVelocity(this->getVelocity()*1.1);
+ }
+ else if(!this->lockRotation_) //rotate when key up is pressed
+ {
+ if(!isValidMove(this->getPosition(), true)) //catch illegal rotations
+ return;
+ this->lockRotation_ = true; // multiple calls of this function have to be filtered out.
+ this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisBrick::unlockRotation, this)));
+ Quaternion q(Degree(90), Vector3::UNIT_Z);
+ this->setOrientation(this->getOrientation()*q); //rotation: roll 90°
+ this->rotationCount_ = (this->rotationCount_ + 1) % 4;
+ }
+ }
+
+ /**
+ @brief
+ Overloaded the function to steer the Brick right and left
+ @param value
+ A vector whose first component is the direction in which we want to steer the Brick.
+ */
+ void TetrisBrick::moveRightLeft(const Vector2& value)
+ {
+ if(!this->delay_)
+ {
+ const Vector3& position = this->getPosition();
+ Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
+ if(!this->isValidMove(newPos))
+ return;
+
+ this->setPosition(newPos);
+ this->delay_ = true;
+ this->delayTimer_.startTimer();
+ }
+ }
+
+ /**
+ @brief
+ Is called when the player changed.
+ */
+ void TetrisBrick::changedPlayer()
+ {
+ this->setVelocity(0.0f, 0.0f, 0.0f);
+ }
+
+ /**
+ @brief
+ Attaches stones to the Centerpoint.
+ */
+ void TetrisBrick::releaseStones(TetrisCenterpoint* center)
+ {
+ assert(this->tetris_);
+ for(unsigned int i = 0; i < this->brickStones_.size(); i++)
+ {
+ this->brickStones_[i]->detachFromParent();
+ this->brickStones_[i]->attachToParent(center);
+ this->brickStones_[i]->setPosition(this->getPosition()+this->tetris_->rotateVector(this->brickStones_[i]->getPosition(),this->rotationCount_ ));
+ }
+ this->brickStones_.clear();
+ }
+
+}
Copied: code/trunk/src/modules/tetris/TetrisBrick.h (from rev 9347, code/branches/presentation2012merge/src/modules/tetris/TetrisBrick.h)
===================================================================
--- code/trunk/src/modules/tetris/TetrisBrick.h (rev 0)
+++ code/trunk/src/modules/tetris/TetrisBrick.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,106 @@
+/*
+ * 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:
+ * ...
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TetrisBrick.h
+ @brief Declaration of the TetrisBrick class.
+ @ingroup Tetris
+*/
+
+#ifndef _TetrisBrick_H__
+#define _TetrisBrick_H__
+
+#include "tetris/TetrisPrereqs.h"
+
+#include "worldentities/ControllableEntity.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ ContainerClass in order to create TetrisBricks by combining TetrisStones.
+ @author
+
+ @ingroup Tetris
+ */
+ class _TetrisExport TetrisBrick : public ControllableEntity
+ {
+ public:
+ TetrisBrick(BaseObject* creator); //!< Constructor. Registers and initializes the object.
+ virtual ~TetrisBrick() {}
+
+ virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+ virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+ virtual void changedPlayer(); //!< Is called when the player changed.
+
+ bool isValidMove(const Vector3& position, bool isRotation);
+ unsigned int getNumberOfStones(void) const
+ { return this->brickStones_.size(); }
+ TetrisStone* getStone(unsigned int i);
+
+ void setGame(Tetris* tetris)
+ { assert(tetris); tetris_ = tetris; }
+ unsigned int getRotationCount(void)
+ { return this->rotationCount_;}
+
+ void releaseStones(TetrisCenterpoint* center);
+
+ protected:
+ void createBrick(void); //!< Create a cluster of TetrisStones
+ void formBrick(TetrisStone* stone, unsigned int i);
+ Tetris* getTetris();
+
+ unsigned int shapeIndex_; //!< My way to represent the different brick shapes.
+ unsigned int stonesPerBrick_; //!< So many stones are contained in this brick.
+ std::vector<TetrisStone*> brickStones_; //!< A list of all stones in a brick.
+
+
+ void enableMovement(void)
+ { this->delay_ = false; }
+ void unlockRotation(void)
+ { this->lockRotation_ = false; }
+
+ float getSize(void) const
+ { return this->size_; }
+
+
+ float size_; //!< The dimensions a stone has in the game world. //TODO: get stone dimensions
+ bool delay_;
+ bool lockRotation_;
+
+ unsigned int rotationCount_; //!< Stores the bricks orientation
+ Timer delayTimer_;
+ Timer rotationTimer_; ///!< This timer is used to filter out multiple rotation inputs.
+ Tetris* tetris_; //<! The Tetris class is responsible to initialize this value.
+
+ };
+}
+
+#endif /* _TetrisBrick_H__ */
Modified: code/trunk/src/modules/tetris/TetrisCenterpoint.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -29,6 +29,7 @@
/**
@file TetrisCenterpoint.cc
@brief Implementation of the TetrisCenterpoint class.
+ @ingroup Tetris
*/
#include "TetrisCenterpoint.h"
@@ -54,6 +55,7 @@
this->height_ = 11;
this->stoneSize_ = 10.0f;
this->stoneTemplate_ = "";
+ this->brickTemplate_ = "";
this->stoneSpeed_ = 20.0f;
this->checkGametype();
@@ -68,9 +70,10 @@
SUPER(TetrisCenterpoint, XMLPort, xmlelement, mode);
XMLPortParam(TetrisCenterpoint, "width", setWidth, getWidth, xmlelement, mode); // die Breite
- XMLPortParam(TetrisCenterpoint, "height", setHeight, setWidth, xmlelement, mode); // die Grösse
+ XMLPortParam(TetrisCenterpoint, "height", setHeight, getHeight, xmlelement, mode); // die Grösse //was sollte das mit setWidth??
XMLPortParam(TetrisCenterpoint, "stoneSize", setStoneSize, getStoneSize, xmlelement, mode);
XMLPortParam(TetrisCenterpoint, "stoneTemplate", setStoneTemplate, getStoneTemplate, xmlelement, mode);
+ XMLPortParam(TetrisCenterpoint, "brickTemplate", setBrickTemplate, getBrickTemplate, xmlelement, mode);
XMLPortParam(TetrisCenterpoint, "stoneSpeed", setStoneSpeed, getStoneSpeed, xmlelement, mode);
}
Modified: code/trunk/src/modules/tetris/TetrisCenterpoint.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -44,7 +44,8 @@
#include "worldentities/StaticEntity.h"
namespace orxonox
-{
+{//idea: add 2 triggers to the centerpoint (one to determine when a box would go above the centerpoint;
+//the other to find out when the lowest row is filled totally)
/**
@brief
@@ -117,6 +118,19 @@
{ return this->stoneTemplate_; }
/**
+ @brief Set the template for the bricks.
+ @param template The template name to be applied to each brick.
+ */
+ void setBrickTemplate(const std::string& templateName)
+ { this->brickTemplate_ = templateName; }
+ /**
+ @brief Get the template for the bricks.
+ @return Returns the template name to be applied to each brick.
+ */
+ const std::string& getBrickTemplate(void) const
+ { return this->brickTemplate_; }
+
+ /**
@brief Set the speed of the stones.
@param speed The speed to be set.
*/
@@ -136,6 +150,7 @@
unsigned int height_;
float stoneSize_;
std::string stoneTemplate_;
+ std::string brickTemplate_;
float stoneSpeed_;
};
Modified: code/trunk/src/modules/tetris/TetrisPrereqs.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisPrereqs.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/TetrisPrereqs.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -67,6 +67,8 @@
class Tetris;
class TetrisCenterpoint;
class TetrisStone;
+ class TetrisBrick;
+ class TetrisScore;
}
#endif /* _TetrisPrereqs_H__ */
Copied: code/trunk/src/modules/tetris/TetrisScore.cc (from rev 9347, code/branches/presentation2012merge/src/modules/tetris/TetrisScore.cc)
===================================================================
--- code/trunk/src/modules/tetris/TetrisScore.cc (rev 0)
+++ code/trunk/src/modules/tetris/TetrisScore.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,124 @@
+/*
+ * 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:
+ * Johannes Ritz
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TetrisScore.cc
+ @brief Implementation of the TetrisScore class.
+ @ingroup Tetris
+*/
+
+#include "TetrisScore.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+#include "infos/PlayerInfo.h"
+
+#include "Tetris.h"
+
+namespace orxonox
+{
+ CreateFactory(TetrisScore);
+
+ /**
+ @brief
+ Constructor. Registers and initializes the object.
+ @ingroup Tetris
+ */
+ TetrisScore::TetrisScore(BaseObject* creator) : OverlayText(creator)
+ {
+ RegisterObject(TetrisScore);
+
+ this->owner_ = 0;
+ this->player_ = NULL;
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ TetrisScore::~TetrisScore()
+ {
+ }
+
+ /**
+ @brief
+ Method to create a TetrisScore through XML.
+ */
+ void TetrisScore::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TetrisScore, XMLPort, xmlelement, mode);
+ }
+
+ /**
+ @brief
+ Is called each tick.
+ Creates and sets the caption to be displayed by the TetrisScore.
+ @param dt
+ The time that has elapsed since the last tick.
+ */
+ void TetrisScore::tick(float dt)
+ {
+ SUPER(TetrisScore, tick, dt);
+
+ // If the owner is set. The owner being a Tetris game.
+ if (this->owner_ != NULL)
+ {
+ std::string score("0");
+ if(!this->owner_->hasEnded())
+ {
+ //get the player
+ player_ = this->owner_->getPlayer();
+ }
+
+ if(this->owner_->hasStarted())
+ {
+ // Save the name and score of each player as a string.
+ if (player_ != NULL)
+ score = multi_cast<std::string>(this->owner_->getScore(player_));
+ }
+ this->setCaption(score);
+ }
+ }
+
+ /**
+ @brief
+ Is called when the owner changes.
+ Sets the owner to NULL, if it is not a pointer to a Tetris game.
+ */
+ void TetrisScore::changedOwner()
+ {
+ SUPER(TetrisScore, changedOwner);
+
+ if (this->getOwner() != NULL && this->getOwner()->getGametype())
+ this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype().get());
+ else
+ this->owner_ = 0;
+ }
+}
Copied: code/trunk/src/modules/tetris/TetrisScore.h (from rev 9347, code/branches/presentation2012merge/src/modules/tetris/TetrisScore.h)
===================================================================
--- code/trunk/src/modules/tetris/TetrisScore.h (rev 0)
+++ code/trunk/src/modules/tetris/TetrisScore.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -0,0 +1,71 @@
+/*
+ * 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:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TetrisScore.h
+ @brief Declaration of the TetrisScore class.
+ @ingroup Tetris
+*/
+
+#ifndef _TetrisScore_H__
+#define _TetrisScore_H__
+
+#include "tetris/TetrisPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ The TetrisScore class displays the score for a game of @ref orxonox::Tetris "Tetris".
+
+ @author
+ Johannes Ritz
+
+ @ingroup Tetris
+ */
+ class _TetrisExport TetrisScore : public OverlayText, public Tickable
+ {
+ public:
+ TetrisScore(BaseObject* creator);
+ virtual ~TetrisScore();
+
+ virtual void tick(float dt); //!< Creates and sets the caption to be displayed by the TetrisScore.
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner(); //!< Is called when the owner changes.
+
+ private:
+ Tetris* owner_; //!< The Tetris game that owns this TetrisScore.
+ PlayerInfo* player_; //!< Store information about the player permanently.
+ };
+}
+#endif /* _TetrisScore_H__ */
Modified: code/trunk/src/modules/tetris/TetrisStone.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisStone.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/TetrisStone.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -29,6 +29,7 @@
/**
@file TetrisStone.cc
@brief Implementation of the TetrisStone class.
+ @ingroup Tetris
*/
#include "TetrisStone.h"
@@ -46,13 +47,15 @@
@brief
Constructor. Registers and initializes the object.
*/
- TetrisStone::TetrisStone(BaseObject* creator) : ControllableEntity(creator)
+ TetrisStone::TetrisStone(BaseObject* creator) : MovableEntity(creator)
{
RegisterObject(TetrisStone);
-
+
this->size_ = 10.0f;
this->delay_ = false;
this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
+ this->lockRotation_ = false;
+
}
/**
@@ -63,10 +66,18 @@
*/
void TetrisStone::moveFrontBack(const Vector2& value)
{
- if(value.x < 0)
+ if(value.x < 0) //speedup on key down
{
this->setVelocity(this->getVelocity()*1.1);
}
+ else if(!this->lockRotation_) //rotate when key up is pressed
+ {
+ this->lockRotation_ = true; // multiple calls of this function have to be filtered out.
+ this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisStone::unlockRotation, this)));
+ Quaternion q(Degree(90), Vector3::UNIT_Z);
+ this->setOrientation(this->getOrientation()*q); //rotation: roll 90°
+
+ }
}
/**
Modified: code/trunk/src/modules/tetris/TetrisStone.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisStone.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/tetris/TetrisStone.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -37,7 +37,7 @@
#include "tetris/TetrisPrereqs.h"
-#include "worldentities/ControllableEntity.h"
+#include "worldentities/MovableEntity.h"
#include "tools/Timer.h"
namespace orxonox
@@ -50,7 +50,7 @@
@ingroup Tetris
*/
- class _TetrisExport TetrisStone : public ControllableEntity
+ class _TetrisExport TetrisStone : public MovableEntity
{
public:
TetrisStone(BaseObject* creator); //!< Constructor. Registers and initializes the object.
@@ -80,10 +80,14 @@
private:
void enableMovement(void)
{ this->delay_ = false; }
-
+ void unlockRotation(void)
+ { this->lockRotation_ = false; }
+
float size_; //!< The dimensions a stone has in the game world.
bool delay_;
+ bool lockRotation_;
Timer delayTimer_;
+ Timer rotationTimer_; ///!< This timer is used to filter out multiple rotation inputs.
Tetris* tetris_;
};
Modified: code/trunk/src/modules/weapons/RocketController.cc
===================================================================
--- code/trunk/src/modules/weapons/RocketController.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/modules/weapons/RocketController.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -52,7 +52,7 @@
// Create a rocket for the controller.
this->rocket_ = new SimpleRocket(this);
this->rocket_->setController(this);
- this->setControllableEntity(dynamic_cast<ControllableEntity*> (this->rocket_));
+ this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_));
}
Modified: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/CMakeLists.txt 2012-08-30 21:08:17 UTC (rev 9348)
@@ -49,7 +49,6 @@
ADD_SUBDIRECTORY(interfaces)
ADD_SUBDIRECTORY(items)
ADD_SUBDIRECTORY(overlays)
-ADD_SUBDIRECTORY(pickup)
ADD_SUBDIRECTORY(sound)
ADD_SUBDIRECTORY(weaponsystem)
ADD_SUBDIRECTORY(worldentities)
Modified: code/trunk/src/orxonox/CameraManager.cc
===================================================================
--- code/trunk/src/orxonox/CameraManager.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/CameraManager.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -47,6 +47,8 @@
CameraManager::CameraManager()
{
+ RegisterRootObject(CameraManager);
+
assert(GameMode::showsGraphics());
}
Modified: code/trunk/src/orxonox/LevelInfo.cc
===================================================================
--- code/trunk/src/orxonox/LevelInfo.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/LevelInfo.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -41,7 +41,7 @@
{
// LevelInfoItem
-
+
//! The list of allowed tags.
/*static*/ std::set<std::string> LevelInfoItem::possibleTags_s = std::set<std::string>();
@@ -92,6 +92,7 @@
LevelInfoItem::possibleTags_s.insert("mission");
LevelInfoItem::possibleTags_s.insert("gametype");
LevelInfoItem::possibleTags_s.insert("minigame");
+ LevelInfoItem::possibleTags_s.insert("shipselection");
}
}
@@ -105,12 +106,27 @@
{
SubString substr = SubString(tags, ",", " "); // Split the string into tags.
const std::vector<std::string>& strings = substr.getAllStrings();
- for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
+ for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
this->addTag(*it, false);
this->tagsUpdated();
}
+ /**
+ @brief
+ Set the starting ship models of the level
+ @param tags
+ A comma-seperated string of all the allowed ship models for the shipselection.
+ */
+ void LevelInfoItem::setStartingShips(const std::string& ships)
+ {
+ SubString substr = SubString(ships, ",", " "); // Split the string into tags.
+ const std::vector<std::string>& strings = substr.getAllStrings();
+ for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
+ this->addStartingShip(*it, false);
+ this->startingshipsUpdated();
+ }
+
/**
@brief
Add a tag to the set of tags the Level is tagged with.
@@ -136,6 +152,26 @@
/**
@brief
+ Add a ship model to allowed models for the shipselection
+ @param ship
+ The ship model to be added.
+ @param update
+ Whether the comma-seperated string of all ship models should be updated. Default is true.
+ @return
+ Returns true if the ship was successfully added, if the ship was already present it returns false.
+ */
+ bool LevelInfoItem::addStartingShip(const std::string& ship, bool update)
+ {
+ bool success = this->startingShips_.insert(ship).second;
+ if(update && success)
+ this->startingshipsUpdated();
+
+ return success;
+ }
+
+
+ /**
+ @brief
Updates the comma-seperated string of all tags, if the set of tags has changed.
*/
void LevelInfoItem::tagsUpdated(void)
@@ -154,6 +190,55 @@
this->tagsString_ = std::string(stream.str());
}
+ /**
+ @brief
+ Updates the comma-seperated string of all ships, if the set of tags has changed.
+ */
+ void LevelInfoItem::startingshipsUpdated(void)
+ {
+ std::stringstream stream;
+ std::set<std::string>::iterator temp;
+ for(std::set<std::string>::iterator it = this->startingShips_.begin(); it != this->startingShips_.end(); )
+ {
+ temp = it;
+ if(++it == this->startingShips_.end()) // If this is the last ship we don't add a comma.
+ stream << *temp;
+ else
+ stream << *temp << ", ";
+ }
+
+ this->startingShipsString_ = std::string(stream.str());
+ }
+
+ void LevelInfoItem::changeStartingShip(const std::string& model)
+ {
+ static std::string shipSelectionTag = "shipselection";
+ //HACK: Read Level XML File, find "shipselection", replace with ship model
+ std::string levelPath = "../levels/";
+ levelPath.append(this->getXMLFilename());
+ std::string tempPath = "../levels/";
+ tempPath.append("_temp.oxw");
+ orxout(user_status) << levelPath << endl;
+ orxout(user_status) << tempPath << endl;
+ std::ifstream myLevel (levelPath.c_str());
+ std::ofstream tempLevel (tempPath.c_str());
+ while(!myLevel.eof())
+ {
+ std::string buff;
+ std::getline(myLevel, buff);
+ std::string pawndesignString = "pawndesign=";
+ size_t found = buff.find(pawndesignString.append(shipSelectionTag));
+ if (found!= std::string::npos)
+ buff = buff.substr(0, found + 11) + model + buff.substr(found+11+shipSelectionTag.length(), std::string::npos);
+ tempLevel.write(buff.c_str(), buff.length());
+ tempLevel << std::endl;
+ }
+ myLevel.close();
+ tempLevel.close();
+ orxout(user_status) << "done" << endl;
+ }
+
+
// LevelInfo
CreateFactory(LevelInfo);
@@ -191,6 +276,7 @@
XMLPortParam(LevelInfo, "description", setDescription, getDescription, xmlelement, mode);
XMLPortParam(LevelInfo, "screenshot", setScreenshot, getScreenshot, xmlelement, mode);
XMLPortParam(LevelInfo, "tags", setTags, getTags, xmlelement, mode);
+ XMLPortParam(LevelInfo, "startingships", setStartingShips, getStartingShips, xmlelement, mode);
}
/**
@@ -206,6 +292,7 @@
info->setDescription(this->getDescription());
info->setScreenshot(this->getScreenshot());
info->setTags(this->getTags());
+ info->setStartingShips(this->getStartingShips());
return info;
}
Modified: code/trunk/src/orxonox/LevelInfo.h
===================================================================
--- code/trunk/src/orxonox/LevelInfo.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/LevelInfo.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -42,6 +42,8 @@
#include "util/StringUtils.h"
#include "core/BaseObject.h"
+#include <iostream>
+#include <fstream>
#include "core/OrxonoxClass.h"
namespace orxonox // tolua_export
@@ -76,7 +78,7 @@
@return Returns the name of the Level.
*/
inline const std::string& getName(void) const { return this->name_; } // tolua_export
-
+
/**
@brief Set the screenshot of the Level.
@param screenshot The screenshot to be set.
@@ -115,12 +117,28 @@
*/
inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
+ void setStartingShips(const std::string& ships); //!< Set the starting ship models of the level
+ bool addStartingShip(const std::string& ship, bool update = true); //!< Add a model to shipselection
/**
+ @brief Get the set of starting ship models the Level allows
+ @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
+ */
+ inline const std::string& getStartingShips(void) const
+ { return this->startingShipsString_; }
+ /**
+ @brief Get whether the Level allows a specific starting ship model
+ @param ship The ship model for which is checked.
+ @return Returns true if the Level allows the input ship model
+ */
+ inline bool hasStartingShip(const std::string& ship) const { return this->startingShips_.find(ship) != this->startingShips_.end(); } // tolua_export
+ inline void selectStartingShip(const std::string& ship) { this->changeStartingShip(ship); } // tolua_export
+ /**
@brief Get the XML-filename of the Level.
@return Returns the XML-filename (including *.oxw extension) of the Level.
*/
inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
+
protected:
/**
@brief Set the XML-filename of the Level.
@@ -132,8 +150,9 @@
std::string xmlfilename_; //!< The XML-filename of the Level.
private:
+ void changeStartingShip (const std::string& model);
+ void startingshipsUpdated(void); //!< Updates the comma-seperated string of all possible starting ships.
void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
-
static void initializeTags(void); //!< Initialize the set of allowed tags.
/**
@brief Check whether an input tag is allowed.
@@ -151,6 +170,8 @@
std::string screenshot_; //!< The screenshot of the Level.
std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
+ std::set<std::string> startingShips_; //!< The set of starting ship models the Level allows.
+ std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.
}; // tolua_export
/**
@@ -160,8 +181,8 @@
- @b name The name of the level.
- @b description The description of the level.
- @b screenshot The screenshot of the level.
- - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>.
-
+ - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>, <em>shipselection</em>.
+ - @b (optional) startingships The comma-seperated string of starting ship models
An example would be:
@code
<LevelInfo
@@ -175,7 +196,8 @@
@author
Damian 'Mozork' Frick
-
+ @edit
+ Matthias Hutter
@ingroup Orxonox
*/
class _OrxonoxExport LevelInfo : public BaseObject, public LevelInfoItem
@@ -185,7 +207,7 @@
virtual ~LevelInfo();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML.
-
+
/**
@brief Set the screenshot of the Level.
@param screenshot The screenshot to be set.
@@ -222,9 +244,20 @@
*/
inline const std::string& getTags(void) const
{ return this->LevelInfoItem::getTags(); }
+ /**
+ @brief Set the starting ship models of the level
+ @param A comma-seperated string of all the allowed ship models for the shipselection.
+ */
+ inline void setStartingShips(const std::string& ships)
+ { this->LevelInfoItem::setStartingShips(ships); }
+ /**
+ @brief Get the starting ship models of the level
+ @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
+ */
+ inline const std::string& getStartingShips(void) const
+ { return this->LevelInfoItem::getStartingShips(); }
LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
-
};
/**
@@ -242,7 +275,7 @@
return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0;
}
};
-
+
} // tolua_export
#endif /* _LevelInfo_H__ */
Modified: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -108,6 +108,7 @@
class TeamBaseMatch;
class TeamDeathmatch;
class UnderAttack;
+ class TeamGametype;
// graphics
class Backlight;
@@ -150,9 +151,6 @@
class OrxonoxOverlay;
class OverlayGroup;
- // pickup
- class PickupIdentifier;
-
//sound
class AmbientSound;
class BaseSound;
Modified: code/trunk/src/orxonox/Scene.cc
===================================================================
--- code/trunk/src/orxonox/Scene.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/Scene.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -257,8 +257,16 @@
void Scene::setSkybox(const std::string& skybox)
{
- if (GameMode::showsGraphics() && this->sceneManager_)
- this->sceneManager_->setSkyBox(true, skybox);
+ try
+ {
+ if (GameMode::showsGraphics() && this->sceneManager_)
+ this->sceneManager_->setSkyBox(true, skybox);
+ }
+ catch (const Ogre::Exception&)
+ {
+ orxout(internal_error) << "Could not load skybox '" << skybox << "':" << endl;
+ orxout(internal_error) << Exception::handleMessage() << endl;
+ }
this->skybox_ = skybox;
}
Modified: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/controllers/FormationController.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -49,27 +49,27 @@
namespace orxonox
{
- SetConsoleCommand("FormationController", "formationflight", &FormationController::formationflight);
- SetConsoleCommand("FormationController", "masteraction", &FormationController::masteraction);
- SetConsoleCommand("FormationController", "followme", &FormationController::followme);
- SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
- SetConsoleCommand("FormationController", "formationsize", &FormationController::formationsize);
+ SetConsoleCommand("FormationController", "formationflight", &FormationController::formationflight);
+ SetConsoleCommand("FormationController", "masteraction", &FormationController::masteraction);
+ SetConsoleCommand("FormationController", "followme", &FormationController::followme);
+ SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
+ SetConsoleCommand("FormationController", "formationsize", &FormationController::formationsize);
- static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
- static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
- static const float FORMATION_LENGTH = 110;
- static const float FORMATION_WIDTH = 110;
- static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
- static const float SPEED_MASTER = 0.6f;
- static const float ROTATEFACTOR_MASTER = 0.2f;
- static const float SPEED_FREE = 0.8f;
- static const float ROTATEFACTOR_FREE = 0.8f;
+ static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
+ static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
+ static const float FORMATION_LENGTH = 110;
+ static const float FORMATION_WIDTH = 110;
+ static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
+ static const float SPEED_MASTER = 0.6f;
+ static const float ROTATEFACTOR_MASTER = 0.2f;
+ static const float SPEED_FREE = 0.8f;
+ static const float ROTATEFACTOR_FREE = 0.8f;
- FormationController::FormationController(BaseObject* creator) : Controller(creator)
- {
+ FormationController::FormationController(BaseObject* creator) : Controller(creator)
+ {
RegisterObject(FormationController);
this->target_ = 0;
@@ -90,11 +90,11 @@
this->targetPosition_ = Vector3::ZERO;
this->team_=-1;
this->target_.setCallback(createFunctor(&FormationController::targetDied, this));
- }
+ }
- FormationController::~FormationController()
- {
- if (this->isInitialized())
+ FormationController::~FormationController()
+ {
+ if (this->isInitialized())
{
this->removeFromFormation();
@@ -122,9 +122,9 @@
}
}
}
- }
+ }
- void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(FormationController, XMLPort, xmlelement, mode);
@@ -136,11 +136,11 @@
- /**
+ /**
@brief Activates / deactivates formationflight behaviour
@param form activate formflight if form is true
*/
- void FormationController::formationflight(const bool form)
+ void FormationController::formationflight(const bool form)
{
for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
{
@@ -167,7 +167,7 @@
}
}
- /**
+ /**
@brief Get all masters to do a "specific master action"
@param action which action to perform (integer, so it can be called with a console command (tmp solution))
*/
@@ -197,7 +197,7 @@
}
}
- /**
+ /**
@brief Sets shooting behaviour of pawns.
@param passive if true, bots won't shoot.
*/
@@ -224,7 +224,7 @@
}
}
- /**
+ /**
@brief Sets maximal formation size
@param size maximal formation size.
*/
@@ -251,14 +251,14 @@
}
}
- //used, when slaves are in DEFEND mode.
- void FormationController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
- {
- if (!this->formationFlight_ || this->state_ != MASTER || this->formationMode_ != DEFEND)
- return;
- this->masterAttacked(originator);
- }
-
+ //used, when slaves are in DEFEND mode.
+ void FormationController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
+ {
+ if (!this->formationFlight_ || this->state_ != MASTER || this->formationMode_ != DEFEND)
+ return;
+ this->masterAttacked(originator);
+ }
+
void FormationController::removeFromFormation()
{
if (this->state_ == SLAVE || this->myMaster_) // slaves can also be temporary free, so check if myMaster_ is set
@@ -279,20 +279,21 @@
// return;
}
- Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
float distance = (target - this->getControllableEntity()->getPosition()).length();
+ float rotateX = clamp(coord.x * 10, -1.0f, 1.0f);
+ float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
-
if(this->state_ == FREE)
{
if (this->target_ || distance > 10)
{
// Multiply with ROTATEFACTOR_FREE to make them a bit slower
- this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * rotateX);
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * rotateY);
}
- if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+ if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
{
this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
} else this->getControllableEntity()->moveFrontBack(SPEED_FREE);
@@ -304,8 +305,8 @@
{
if (this->target_ || distance > 10)
{
- this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * rotateX);
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * rotateY);
}
if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
@@ -319,42 +320,42 @@
if(this->state_ == SLAVE)
{
- this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * rotateX);
+ this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * rotateY);
if (distance < 300)
{
- if (bHasTargetOrientation_)
- {
- copyTargetOrientation();
- }
+ if (bHasTargetOrientation_)
+ {
+ copyTargetOrientation();
+ }
if (distance < 100)
- { //linear speed reduction
+ { //linear speed reduction
this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
-
- } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
-
- } else {
- this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
+ }
+ else
+ this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
}
+ else
+ this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
}
if (distance < 10)
{
this->positionReached();
- bHasTargetOrientation_=false;
+ bHasTargetOrientation_=false;
}
}
- void FormationController::moveToTargetPosition()
+ void FormationController::moveToTargetPosition()
{
this->moveToPosition(this->targetPosition_);
}
- //copy the Roll orientation of given Quaternion.
- void FormationController::copyOrientation(const Quaternion& orient)
+ //copy the Roll orientation of given Quaternion.
+ void FormationController::copyOrientation(const Quaternion& orient)
{
//roll angle difference in radian
float diff=orient.getRoll(false).valueRadians()-(this->getControllableEntity()->getOrientation().getRoll(false).valueRadians());
@@ -372,7 +373,7 @@
}
- /**
+ /**
@brief Unregisters a slave from its master. Initiated by a slave.
*/
void FormationController::unregisterSlave()
@@ -462,11 +463,11 @@
this->myMaster_ = 0;
}
}
- /**
+
+ /**
@brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
*/
-
-void FormationController::commandSlaves()
+ void FormationController::commandSlaves()
{
if(this->state_ != MASTER) return;
@@ -480,11 +481,11 @@
this->slaves_.front()->setTargetPosition(dest);
}
else
- // formation:
+ // formation:
{
dest += 1.0f*orient*WorldEntity::BACK;
Vector3 pos = Vector3::ZERO;
- bool left=true;
+ bool left=true;
int i = 1;
for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
@@ -682,11 +683,12 @@
if(this->state_ != MASTER) return;
if (specificMasterActionHoldCount_ == 0)
- {
+ {
this->specificMasterAction_ = NONE;
this->searchNewTarget();
- }
- else specificMasterActionHoldCount_--;
+ }
+ else
+ specificMasterActionHoldCount_--;
}
/**
@@ -710,12 +712,12 @@
*/
void FormationController::turn180()
{
- Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
+ Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
- this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
+ this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
- this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+ this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
}
/**
@@ -733,8 +735,8 @@
*/
void FormationController::spin()
{
- this->moveToTargetPosition();
- this->getControllableEntity()->rotateRoll(0.8f);
+ this->moveToTargetPosition();
+ this->getControllableEntity()->rotateRoll(0.8f);
}
/**
@@ -772,27 +774,22 @@
if((humanPawn != NULL) && (allMasters.size() != 0))
{
- float posHuman = humanPawn->getPosition().length();
- float distance = 0.0f;
- float minDistance = FLT_MAX;
- int index = 0;
- int i = 0;
+ float posHuman = humanPawn->getPosition().length();
+ float distance = 0.0f;
+ float minDistance = FLT_MAX;
+ int index = 0;
+ int i = 0;
- for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
- {
- if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
- distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
- if(distance < minDistance) index = i;
- }
- allMasters[index]->followInit(humanPawn);
+ for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
+ {
+ if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
+ distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+ if(distance < minDistance) index = i;
}
-
+ allMasters[index]->followInit(humanPawn);
+ }
}
-
-
-
-
/**
@brief Master begins to follow a pawn. Is a "specific master action".
@param pawn pawn to follow.
@@ -813,7 +810,7 @@
}
- /**
+ /**
@brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action".
*/
void FormationController::followRandomHumanInit()
@@ -841,7 +838,7 @@
}
- /**
+ /**
@brief Master follows target with adjusted speed. Called within tick.
*/
void FormationController::follow()
@@ -853,7 +850,7 @@
}
- void FormationController::setTargetPosition(const Vector3& target)
+ void FormationController::setTargetPosition(const Vector3& target)
{
this->targetPosition_ = target;
this->bHasTargetPosition_ = true;
@@ -917,19 +914,19 @@
}
}
- void FormationController::forgetTarget()
+ void FormationController::forgetTarget()
{
this->target_ = 0;
this->bShooting_ = false;
}
- void FormationController::targetDied()
+ void FormationController::targetDied()
{
this->forgetTarget();
this->searchRandomTargetPosition();
}
- bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+ bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
{
if (entity1 == entity2)
return true;
@@ -1053,14 +1050,14 @@
if (!this->getControllableEntity())
return;
- Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
float distance = (target - this->getControllableEntity()->getPosition()).length();
if (this->target_ || distance > minDistance)
{
// Multiply with ROTATEFACTOR_FREE to make them a bit slower
- this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * clamp(coord.x * 10, -1.0f, 1.0f));
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * clamp(coord.y * 10, -1.0f, 1.0f));
this->getControllableEntity()->moveFrontBack(SPEED_FREE);
}
Property changes on: code/trunk/src/orxonox/controllers/FormationController.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/orxonox/controllers/FormationController.h
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/controllers/FormationController.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -95,7 +95,7 @@
inline FormationMode getFormationMode() const
{ return this->formationMode_; }
- virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
+ virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
protected:
bool formationFlight_;
Property changes on: code/trunk/src/orxonox/controllers/FormationController.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/controllers/NewHumanController.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -297,7 +297,7 @@
{
//Used in HumanController for formationFlight
HumanController::hit(originator,contactpoint,damage);
-
+
if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
{
Vector3 posA;
@@ -396,7 +396,7 @@
WorldEntity* wePtr;
try
{
- wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
+ wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
}
catch (...)
{
Modified: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -75,8 +75,9 @@
unsigned int nr=0;
for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
{
- if (dynamic_cast<Synchronisable*>(*it))
- orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << endl;
+ Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
+ if (synchronisable)
+ orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
else
orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
nr++;
Modified: code/trunk/src/orxonox/gametypes/Deathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -113,9 +113,9 @@
Gametype::pawnKilled(victim, killer);
}
- void Deathmatch::playerScored(PlayerInfo* player)
+ void Deathmatch::playerScored(PlayerInfo* player, int score)
{
- Gametype::playerScored(player);
+ Gametype::playerScored(player, score);
if (player)
{
Modified: code/trunk/src/orxonox/gametypes/Deathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -47,7 +47,7 @@
virtual bool playerChangedName(PlayerInfo* player);
virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
- virtual void playerScored(PlayerInfo* player);
+ virtual void playerScored(PlayerInfo* player, int score = 1);
};
}
Modified: code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -30,18 +30,19 @@
//killerfarbe schwarz; evtl. eigenes Raumfahrzeug;
//Low; Codeoptimierung und Dokumentation
-/*
-short gaming manual:
-There are three different parties a player can belong to: victim, chaser or killer
-Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
-In order to win you have to earn as much points as possible:
-- as victim by escaping the chasers
-- as chaser by shooting the victim
-- as killer by killing the chasers
+/**
+ at brief
+ Short Gaming Manual:
+ There are three different parties a player can belong to: victim, chaser or killer
+ Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
+ In order to win you have to earn as much points as possible:
+ - as victim by escaping the chasers
+ - as chaser by shooting the victim
+ - as killer by killing the chasers
-What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
-P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
+ What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
+ P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
*/
#include "Dynamicmatch.h"
@@ -80,7 +81,7 @@
this->numberOf[piggy]=0;
this->numberOf[killer]=0;
this->tutorial=true;
- this->pointsPerTime=0.0f;
+ this->pointsPerTime=1.0f;
this->setHUDTemplate("DynamicmatchHUD");
}
@@ -94,7 +95,6 @@
ColourValue(1.0f, 0.3f, 0.3f), //chasercolour
ColourValue(0.3f, 0.3f, 1.0f), //piggycolour
ColourValue(0.3f, 1.0f, 0.3f) //killercolour what about black: 0.0f, 0.0f, 0.0f
-
};
static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
@@ -110,8 +110,8 @@
return false;
if (victim && victim->getPlayer()) //&& originator && originator->getPlayer() ??
{
- int target= playerParty_[victim->getPlayer()];
- int source= playerParty_[originator->getPlayer()];
+ int target = playerParty_[victim->getPlayer()];
+ int source = playerParty_[originator->getPlayer()];
//Case: Not Enough Pigs: party change (= party management)
if (notEnoughPigs)
@@ -150,7 +150,7 @@
evaluatePlayerParties(); //check if the party change has to trigger futher party changes
//Give new pig boost
- SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
+ SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
this->grantPigBoost(spaceship);
}
@@ -244,7 +244,7 @@
}
}
//Give new pig boost
- SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
+ SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
this->grantPigBoost(spaceship);
}
// killer vs piggy
@@ -275,13 +275,9 @@
//Case: friendly fire
else if (friendlyfire && (source == target))
{
- std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer());
- if (it != this->players_.end())
- {
- it->second.frags_--;
- }
+ this->playerScored(originator->getPlayer(), -1);
}
- }// from far far away not to be removed!
+ }
return false; //default: no damage
}
@@ -295,30 +291,28 @@
{
if (playerParty_[originator->getPlayer()] == killer) //reward the killer
{
- std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer());
- if (it != this->players_.end())
- {
- it->second.frags_+=20; //value must be tested
- }
+ this->playerScored(originator->getPlayer(), 25);
}
- return true;
+ return true;
}
else return false;
}
/**
@brief
- Grant the piggy a boost.
+ Grant the victim a boost.
@param spaceship
The SpaceShip to give the boost.
*/
void Dynamicmatch::grantPigBoost(SpaceShip* spaceship)
{
- // Give pig boost
+ // Give victim boost
if (spaceship)
{
- spaceship->addSpeedFactor(5);
WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
+ if(ptr == NULL)
+ return;
+ spaceship->addSpeedFactor(5);
ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
executor->setDefaultValue(0, ptr);
new Timer(10, false, executor, true);
@@ -373,11 +367,12 @@
SUPER(Dynamicmatch, tick, dt);
if (this->hasStarted() && !gameEnded_)
- { pointsPerTime =pointsPerTime + dt;
- gameTime_ = gameTime_ - dt;
- if (pointsPerTime > 2.0f)//hard coded!! should be changed
+ {
+ pointsPerTime = pointsPerTime + dt; //increase points
+ gameTime_ = gameTime_ - dt; // decrease game time
+ if (pointsPerTime > 2.0f) //hard coded points for victim! should be changed
{
- pointsPerTime=0.0f;
+ pointsPerTime = 0.0f;
rewardPig();
}
if (gameTime_<= 0)
@@ -407,25 +402,23 @@
}
}
+/**
+ @brief The reward function is called every 2 seconds via the tick function and makes the victim score points.
+*/
void Dynamicmatch::rewardPig()
{
for (std::map< PlayerInfo*, int >::iterator it = this->playerParty_.begin(); it != this->playerParty_.end(); ++it) //durch alle Spieler iterieren und alle piggys finden
{
- if (it->second==piggy)
+ if (it->second==piggy)//Spieler mit der Pig-party frags++
{
- //Spieler mit der Pig-party frags++
- std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);// still not sure if right syntax
- if (it2 != this->players_.end())
- {
- it2->second.frags_++;
- }
+ this->playerScored(it->first);
}
}
}
void Dynamicmatch::setPlayerColour(PlayerInfo* player) // sets a player's colour
{
std::map<PlayerInfo*, int>::const_iterator it_player = this->playerParty_.find(player);
- Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+ Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
if (pawn)
{
pawn->setRadarObjectColour(this->partyColours_[it_player->second]);
@@ -445,7 +438,7 @@
void Dynamicmatch::evaluatePlayerParties() //manages the notEnough booleans (here the percentage of special players is implemented)
{
//pigs: 1 + every 6th player is a pig
- if ( (1+this->getNumberOfPlayers()/6) > numberOf[piggy])
+ if ( (1 + getPlayerCount()/6) > numberOf[piggy])
{
notEnoughPigs=true;
if (tutorial) // Announce selectionphase
@@ -494,7 +487,7 @@
}
}
//killers: every 4th player is a killer
- if (getNumberOfPlayers()/4 > numberOf[killer])
+ if ( static_cast<unsigned int>(getPlayerCount()/4) > numberOf[killer])
{
notEnoughKillers=true;
if (tutorial) // Announce selectionphase
Modified: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -80,7 +80,10 @@
void tick (float dt);// used to end the game
SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+
protected:
+ inline int getPlayerCount() const
+ { return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; }
std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
std::vector<ColourValue> partyColours_; //aus TeamDeathmatch
Modified: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -300,11 +300,11 @@
}
}
- void Gametype::playerScored(PlayerInfo* player)
+ void Gametype::playerScored(PlayerInfo* player, int score)
{
std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
if (it != this->players_.end())
- it->second.frags_++;
+ it->second.frags_ += score;
}
int Gametype::getScore(PlayerInfo* player) const
Modified: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Gametype.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -89,7 +89,7 @@
virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype);
virtual bool playerChangedName(PlayerInfo* player);
- virtual void playerScored(PlayerInfo* player);
+ virtual void playerScored(PlayerInfo* player, int score = 1);
virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
@@ -152,9 +152,14 @@
virtual void resetTimer();
virtual void resetTimer(float t);
+ /**
+ @brief Get number of Players in game.
+ */
inline unsigned int getNumberOfPlayers() const
- { return this->gtinfo_->getNumberOfPlayers(); }
+ { return this->players_.size(); }
+
+
protected:
virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
Modified: code/trunk/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/LastManStanding.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/LastManStanding.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -210,7 +210,7 @@
{
if(!player->getControllableEntity())
return;
- Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+ Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
if(!pawn)
return;
if(bHardPunishment)
Modified: code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/LastTeamStanding.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/LastTeamStanding.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -282,7 +282,7 @@
{
if(!player->getControllableEntity())
return;
- Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+ Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
if(!pawn)
return;
if(bHardPunishment)
Modified: code/trunk/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/Mission.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -62,7 +62,7 @@
if (victim && victim->getPlayer() && this->lives_ == 1)
{
this->missionAccomplished_ = false;
- this->end();
+ this->end();
}
}
@@ -77,11 +77,11 @@
void Mission::end()
{
Gametype::end();
- /*if (this->missionAccomplished_)
+ /*if (this->missionAccomplished_)
this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
- else
+ else
this->gtinfo_->sendAnnounceMessage("Mission failed!");
- * */
+ */
}
void Mission::setTeams()
Property changes on: code/trunk/src/orxonox/gametypes/Mission.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/orxonox/gametypes/Mission.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -127,7 +127,7 @@
// collect Points for killing oppenents
- void TeamBaseMatch::playerScored(PlayerInfo* player)
+ void TeamBaseMatch::playerScored(PlayerInfo* player, int score)
{
int teamnr = this->getTeam(player);
this->addTeamPoints(teamnr, 5);
Modified: code/trunk/src/orxonox/gametypes/TeamBaseMatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -46,7 +46,7 @@
virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
virtual bool allowPawnDamage(Pawn* victim, Pawn* originator);
- virtual void playerScored(PlayerInfo* player);
+ virtual void playerScored(PlayerInfo* player, int score = 1);
virtual void showPoints();
virtual void endGame();
Modified: code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -29,203 +29,98 @@
#include "TeamDeathmatch.h"
#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "interfaces/TeamColourable.h"
-#include "worldentities/TeamSpawnPoint.h"
+#include "chat/ChatManager.h"
+#include "infos/PlayerInfo.h"
#include "worldentities/pawns/Pawn.h"
namespace orxonox
{
CreateUnloadableFactory(TeamDeathmatch);
- TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : Deathmatch(creator)
+ TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : TeamGametype(creator)
{
RegisterObject(TeamDeathmatch);
+ }
- this->teams_ = 2;
+ void TeamDeathmatch::start()
+ {
+ TeamGametype::start();
- this->setConfigValues();
+ std::string message("The match has started!");
+ ChatManager::message(message);
}
- void TeamDeathmatch::setConfigValues()
+ void TeamDeathmatch::end()
{
- SetConfigValue(teams_, 2);
+ TeamGametype::end();
- static ColourValue colours[] =
- {
- ColourValue(1.0f, 0.3f, 0.3f),
- ColourValue(0.3f, 0.3f, 1.0f),
- ColourValue(0.3f, 1.0f, 0.3f),
- ColourValue(1.0f, 1.0f, 0.0f)
- };
- static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
-
- SetConfigValue(teamcolours_, defaultcolours);
+ std::string message("The match has ended.");
+ ChatManager::message(message);
}
void TeamDeathmatch::playerEntered(PlayerInfo* player)
{
- Deathmatch::playerEntered(player);
+ TeamGametype::playerEntered(player);
- std::vector<unsigned int> playersperteam(this->teams_, 0);
-
- for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
- if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
- playersperteam[it->second]++;
-
- unsigned int minplayers = static_cast<unsigned int>(-1);
- size_t minplayersteam = 0;
- for (size_t i = 0; i < this->teams_; ++i)
- {
- if (playersperteam[i] < minplayers)
- {
- minplayers = playersperteam[i];
- minplayersteam = i;
- }
- }
-
- this->teamnumbers_[player] = minplayersteam;
+ const std::string& message = player->getName() + " entered the game";
+ ChatManager::message(message);
}
bool TeamDeathmatch::playerLeft(PlayerInfo* player)
{
- bool valid_player = Deathmatch::playerLeft(player);
+ bool valid_player = TeamGametype::playerLeft(player);
if (valid_player)
- this->teamnumbers_.erase(player);
+ {
+ const std::string& message = player->getName() + " left the game";
+ ChatManager::message(message);
+ }
return valid_player;
}
-
- bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator)
+ bool TeamDeathmatch::playerChangedName(PlayerInfo* player)
{
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
- }
+ bool valid_player = TeamGametype::playerChangedName(player);
- bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
- }
+ if (valid_player)
+ {
+ const std::string& message = player->getOldName() + " changed name to " + player->getName();
+ ChatManager::message(message);
+ }
- bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
+ return valid_player;
}
- SpawnPoint* TeamDeathmatch::getBestSpawnPoint(PlayerInfo* player) const
+ void TeamDeathmatch::pawnKilled(Pawn* victim, Pawn* killer)
{
- int desiredTeamNr = -1;
- std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
- if (it_player != this->teamnumbers_.end())
- desiredTeamNr = it_player->second;
-
- // Only use spawnpoints of the own team (or non-team-spawnpoints)
- std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
- for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+ if (victim && victim->getPlayer())
{
- if ((*it)->isA(Class(TeamSpawnPoint)))
+ std::string message;
+ if (killer)
{
- TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
- if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
- {
- teamSpawnPoints.erase(it++);
- continue;
- }
+ if (killer->getPlayer())
+ message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+ else
+ message = victim->getPlayer()->getName() + " was killed";
}
+ else
+ message = victim->getPlayer()->getName() + " died";
- ++it;
+ ChatManager::message(message);
}
- SpawnPoint* fallbackSpawnPoint = NULL;
- if (teamSpawnPoints.size() > 0)
- {
- unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
- unsigned int index = 0;
- // Get random fallback spawnpoint in case there is no active SpawnPoint.
- for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
- {
- if (index == randomspawn)
- {
- fallbackSpawnPoint = (*it);
- break;
- }
-
- ++index;
- }
-
- // Remove all inactive SpawnPoints from the list.
- for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
- {
- if(!(*it)->isActive())
- {
- teamSpawnPoints.erase(it++);
- continue;
- }
-
- ++it;
- }
-
- randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
- index = 0;
- for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
- {
- if (index == randomspawn)
- return (*it);
-
- ++index;
- }
-
- return fallbackSpawnPoint;
- }
-
- return 0;
+ Gametype::pawnKilled(victim, killer);
}
- void TeamDeathmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+ void TeamDeathmatch::playerScored(PlayerInfo* player, int score)
{
- if (!player)
- return;
+ TeamGametype::playerScored(player, score);
- // Set the team colour
- std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
- if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
+ if (player)
{
- if (pawn)
- {
- pawn->setRadarObjectColour(this->teamcolours_[it_player->second]);
-
- std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
- for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
- {
- if ((*it)->isA(Class(TeamColourable)))
- {
- TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
- tc->setTeamColour(this->teamcolours_[it_player->second]);
- }
- }
- }
+ const std::string& message = player->getName() + " scores!";
+ ChatManager::message(message);
}
}
- bool TeamDeathmatch::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
- {
- if (pawn1 && pawn2)
- {
- std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
- std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
-
- if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
- return (it1->second == it2->second);
- }
- return false;
- }
-
- int TeamDeathmatch::getTeam(PlayerInfo* player)
- {
- std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
- if (it_player != this->teamnumbers_.end())
- return it_player->second;
- else
- return -1;
- }
}
Modified: code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -30,41 +30,24 @@
#define _TeamDeathmatch_H__
#include "OrxonoxPrereqs.h"
+#include "TeamGametype.h"
-#include <map>
-#include <vector>
-#include "Deathmatch.h"
-
namespace orxonox
{
- class _OrxonoxExport TeamDeathmatch : public Deathmatch
+ class _OrxonoxExport TeamDeathmatch : public TeamGametype
{
public:
TeamDeathmatch(BaseObject* creator);
virtual ~TeamDeathmatch() {}
- void setConfigValues();
-
+ virtual void start();
+ virtual void end();
virtual void playerEntered(PlayerInfo* player);
virtual bool playerLeft(PlayerInfo* player);
+ virtual bool playerChangedName(PlayerInfo* player);
- virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
- virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
- virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
-
- virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
-
- int getTeam(PlayerInfo* player);
- inline const ColourValue& getTeamColour(int teamnr) const
- { return this->teamcolours_[teamnr]; }
-
- protected:
- virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
- bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
-
- std::map<PlayerInfo*, int> teamnumbers_;
- std::vector<ColourValue> teamcolours_;
- unsigned int teams_;
+ virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+ virtual void playerScored(PlayerInfo* player, int score = 1);
};
}
Modified: code/trunk/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamGametype.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/TeamGametype.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -88,6 +88,11 @@
}
}
+ /**
+ @brief
+ Function that determines the player's team number when entering the game for the first time.
+ Override this function for other team structures.
+ */
void TeamGametype::findAndSetTeam(PlayerInfo* player)
{
if(player == NULL) return; // catch null pointers
@@ -130,7 +135,6 @@
this->allowedInGame_.erase(player);
}
-
return valid_player;
}
Property changes on: code/trunk/src/orxonox/gametypes/TeamGametype.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/orxonox/gametypes/TeamGametype.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/UnderAttack.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/gametypes/UnderAttack.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -48,8 +48,6 @@
this->destroyer_.setCallback(createFunctor(&UnderAttack::killedDestroyer, this));
this->gameEnded_ = false;
- //this->setHUDTemplate("UnderAttackHUD");
- //This HUD is in conflict with the HUDEnemyHealthBar
this->setConfigValues();
this->timesequence_ = static_cast<int>(this->gameTime_);
}
Modified: code/trunk/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/infos/GametypeInfo.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -67,7 +67,7 @@
GametypeInfo::GametypeInfo(BaseObject* creator) : Info(creator)
{
RegisterObject(GametypeInfo);
-
+
this->bStarted_ = false;
this->bEnded_ = false;
this->startCountdown_ = 10.0f;
@@ -164,11 +164,11 @@
{
if(this->bStarted_)
{ return;}
-
+
this->bStarted_ = true;
this->changedStarted();
-
-
+
+
}
/**
@@ -194,7 +194,7 @@
{
if(this->startCountdown_ == countdown || countdown < 0.0f)
return;
-
+
this->startCountdown_ = countdown;
// Set the counter to the ceiling of the current countdown.
this->counter_ = static_cast<unsigned int>(std::ceil(countdown));
@@ -224,7 +224,7 @@
{
if(this->counter_ == 0)
return;
-
+
this->counter_--;
this->changedCountdownCounter();
}
@@ -324,7 +324,7 @@
{
if(this->spawned_ == spawned)
return;
-
+
this->spawned_ = spawned;
// Clear the notifications if the Player has spawned.
if(this->spawned_ && !this->hasEnded())
@@ -394,7 +394,7 @@
// Announce messages.
// TODO: Replace with notifications.
- void GametypeInfo::sendAnnounceMessage(const std::string& message)
+ void GametypeInfo::sendAnnounceMessage(const std::string& message) const
{
if (GameMode::isMaster())
{
@@ -403,7 +403,7 @@
}
}
- void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID)
+ void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID) const
{
if (GameMode::isMaster())
{
@@ -414,7 +414,7 @@
}
}
- void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID)
+ void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID) const
{
if (GameMode::isMaster())
{
@@ -425,7 +425,7 @@
}
}
- void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID)
+ void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID) const
{
if (GameMode::isMaster())
{
@@ -436,7 +436,7 @@
}
}
- void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour)
+ void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const
{
if (GameMode::isMaster())
{
@@ -447,7 +447,7 @@
}
}
- void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID)
+ void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) const
{
if (GameMode::isMaster())
{
@@ -458,31 +458,31 @@
}
}
- void GametypeInfo::dispatchAnnounceMessage(const std::string& message)
+ void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
{
for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
it->announcemessage(this, message);
}
- void GametypeInfo::dispatchKillMessage(const std::string& message)
+ void GametypeInfo::dispatchKillMessage(const std::string& message) const
{
for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
it->killmessage(this, message);
}
- void GametypeInfo::dispatchDeathMessage(const std::string& message)
+ void GametypeInfo::dispatchDeathMessage(const std::string& message) const
{
for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
it->deathmessage(this, message);
}
- void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour)
+ void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const
{
for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
it->staticmessage(this, message, colour);
}
- void GametypeInfo::dispatchFadingMessage(const std::string& message)
+ void GametypeInfo::dispatchFadingMessage(const std::string& message) const
{
for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
it->fadingmessage(this, message);
Modified: code/trunk/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/infos/GametypeInfo.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -67,7 +67,7 @@
inline bool hasStarted() const
{ return this->bStarted_; }
void changedStarted(void); // Is called when the game has changed to started.
-
+
/**
@brief Get whether the game has ended yet.
@return Returns true if the game has ended, false if not.
@@ -107,7 +107,7 @@
inline bool isReadyToSpawn() const
{ return this->readyToSpawn_; }
void changedReadyToSpawn(bool ready); // Inform the GametypeInfo that the local player has changed its spawned status.
-
+
/**
@brief Get whether the local player is spawned.
@return Returns true if the local player is currently spawned, false if not.
@@ -118,23 +118,20 @@
inline const std::string& getHUDTemplate() const
{ return this->hudtemplate_; }
-
- inline unsigned int getNumberOfPlayers() const
- { return this->spawnedPlayers_.size(); }
- void sendAnnounceMessage(const std::string& message);
- void sendAnnounceMessage(const std::string& message, unsigned int clientID);
- void sendKillMessage(const std::string& message, unsigned int clientID);
- void sendDeathMessage(const std::string& message, unsigned int clientID);
- void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour);
- void sendFadingMessage(const std::string& message, unsigned int clientID);
+ void sendAnnounceMessage(const std::string& message) const;
+ void sendAnnounceMessage(const std::string& message, unsigned int clientID) const;
+ void sendKillMessage(const std::string& message, unsigned int clientID) const;
+ void sendDeathMessage(const std::string& message, unsigned int clientID) const;
+ void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const;
+ void sendFadingMessage(const std::string& message, unsigned int clientID) const;
- void dispatchAnnounceMessage(const std::string& message);
- void dispatchKillMessage(const std::string& message);
- void dispatchDeathMessage(const std::string& message);
- void dispatchStaticMessage(const std::string& message,const ColourValue& colour);
- void dispatchFadingMessage(const std::string& message);
-
+ void dispatchAnnounceMessage(const std::string& message) const;
+ void dispatchKillMessage(const std::string& message) const;
+ void dispatchDeathMessage(const std::string& message) const;
+ void dispatchStaticMessage(const std::string& message,const ColourValue& colour) const;
+ void dispatchFadingMessage(const std::string& message) const;
+
protected:
void start(void); // Inform the GametypeInfo that the game has started.
void end(void); // Inform the GametypeInfo that the game has ended.
@@ -164,7 +161,7 @@
float startCountdown_; //!< The current value of the start countdown.
unsigned int counter_; //!< The current integer value of the start countdown, the start countdown counter.
std::string hudtemplate_;
-
+
std::set<PlayerInfo*> spawnedPlayers_; //!< A set of players that are currently spawned.
bool spawned_; //!< Whether the local Player is currently spawned.
bool readyToSpawn_; //!< Whether the local Player is ready to spawn.
Modified: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -172,7 +172,7 @@
this->changedControllableEntity();
- RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
+ RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
if (radarviewable != NULL)
radarviewable->setRadarName(this->getName());
}
Modified: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -38,7 +38,6 @@
#include "util/Convert.h"
#include "infos/PlayerInfo.h"
-#include "pickup/PickupIdentifier.h"
#include "worldentities/pawns/Pawn.h"
#include "PickupCarrier.h"
@@ -51,13 +50,12 @@
@brief
Constructor. Registers the objects and initializes its member variables.
*/
- Pickupable::Pickupable() : pickupIdentifier_(NULL), used_(false), pickedUp_(false)
+ Pickupable::Pickupable() : used_(false), pickedUp_(false)
{
RegisterRootObject(Pickupable);
this->carrier_ = NULL;
- this->pickupIdentifier_ = new PickupIdentifier(this);
this->beingDestroyed_ = false;
this->enabled_ = true;
}
@@ -68,11 +66,6 @@
*/
Pickupable::~Pickupable()
{
- if(this->pickupIdentifier_ != NULL)
- {
- orxout(verbose, context::pickups) << "Pickupable (&" << this << ") destroyed." << endl;
- this->pickupIdentifier_->destroy();
- }
}
/**
@@ -103,7 +96,7 @@
*/
void Pickupable::destroyPickup(void)
{
- if(!this->beingDestroyed_)
+ if(!this->isBeingDestroyed())
this->OrxonoxClass::destroy();
else
orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl;
@@ -328,23 +321,6 @@
/**
@brief
- Creates a duplicate of the Pickupable.
- @return
- Returns the clone of this pickup as a pointer to a Pickupable.
- */
- Pickupable* Pickupable::clone(void)
- {
- OrxonoxClass* item = NULL;
- this->clone(item);
-
- Pickupable* pickup = dynamic_cast<Pickupable*>(item);
-
- orxout(verbose, context::pickups) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << endl;
- return pickup;
- }
-
- /**
- @brief
Method to transcribe a Pickupable as a Rewardable to the player.
@param player
A pointer to the PlayerInfo, do whatever you want with it.
Modified: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -52,8 +52,6 @@
Pickups (@ref orxonox::Pickupable "Pickupables") are objects that (quite unsurprisingly) can be picked up. Additionally they can be used and unused (transition from used to not used), and also dropped.
- A class of Pickups can incorporate many different types of pickups (see @ref orxonox::PickupIdentifier "PickupIdentifier"), each type is uniquely defined by a @ref orxonox::PickupIdentifier "PickupIdentifier". Each pickup has such an identifier identiying its type. This means that two pickups of the same type have identifiers which are equal.
-
@author
Damian 'Mozork' Frick
@@ -69,6 +67,9 @@
public:
virtual ~Pickupable(); //!< Default destructor.
+ //! @brief Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup.
+ virtual const std::string& getRepresentationName() const = 0;
+
/**
@brief Get whether the Pickupable is currently in use or not.
@return Returns true if the Pickupable is currently in use.
@@ -135,21 +136,6 @@
bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this Pickupable.
bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this Pickupable.
- Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.
- /**
- @brief Creates a duplicate of the input OrxonoxClass.
- This method needs to be implemented by any Class inheriting from Pickupable.
- @param item A reference to a pointer to the OrxonoxClass that is to be duplicated.
- */
- virtual void clone(OrxonoxClass*& item) {}
-
- /**
- @brief Get the PickupIdentifier of this Pickupable.
- @return Returns a pointer to the PickupIdentifier of this Pickupable.
- */
- virtual const PickupIdentifier* getPickupIdentifier(void) const
- { return this->pickupIdentifier_; }
-
bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
bool setCarrier(PickupCarrier* carrier, bool tell = true); //!< Sets the carrier of the Pickupable.
@@ -157,11 +143,6 @@
void destroy(void); //!< Is called internally within the Pickupable module to destroy pickups.
protected:
- /**
- @brief Helper method to initialize the PickupIdentifier.
- */
- void initializeIdentifier(void) {}
-
virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
virtual void destroyPickup(void); //!< Destroys a Pickupable.
virtual void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
@@ -173,15 +154,19 @@
{ this->enabled_ = false; }
/**
+ @brief Check whether the Pickupable is in the process of being destroyed.
+ @return Returns true if so.
+ */
+ inline bool isBeingDestroyed(void)
+ { return this->beingDestroyed_; }
+
+ /**
@brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
- This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
- DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance);
+ This method must be implemented by any class directly inheriting from Pickupable.
@return Returns true if a spawner was created, false if not.
*/
virtual bool createSpawner(void) = 0;
- PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
-
private:
bool used_; //!< Whether the Pickupable is currently in use or not.
@@ -202,9 +187,8 @@
//! SUPER functions.
SUPER_FUNCTION(10, Pickupable, changedUsed, false);
- SUPER_FUNCTION(12, Pickupable, changedCarrier, false);
- SUPER_FUNCTION(13, Pickupable, changedPickedUp, false);
- SUPER_FUNCTION(11, Pickupable, clone, false);
+ SUPER_FUNCTION(11, Pickupable, changedCarrier, false);
+ SUPER_FUNCTION(12, Pickupable, changedPickedUp, false);
}
#endif /* _Pickupable_H__ */
Modified: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -60,16 +60,16 @@
RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
virtual ~RadarViewable();
- virtual void setRadarName(const std::string& name)
- {
- if (this->radarName_ != name)
- {
- this->radarName_ = name;
- this->settingsChanged();
- }
- }
- const std::string& getRadarName() const
- { return this->radarName_; }
+ virtual void setRadarName(const std::string& name)
+ {
+ if (this->radarName_ != name)
+ {
+ this->radarName_ = name;
+ this->settingsChanged();
+ }
+ }
+ const std::string& getRadarName() const
+ { return this->radarName_; }
inline void setRadarObjectCamouflage(float camouflage)
{
@@ -162,7 +162,7 @@
std::string radarObjectDescription_;
ColourValue radarObjectColour_;
float scale_;
- std::string radarName_;
+ std::string radarName_;
};
}
Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -86,7 +86,7 @@
this->setConfigValues();
this->setPriority( Priority::VeryHigh );
this->registerVariables();
- this->team_ = -1;
+ this->team_ = -1;
}
ControllableEntity::~ControllableEntity()
@@ -265,7 +265,7 @@
this->cameraPositionRootNode_->setOrientation(Quaternion::IDENTITY);
this->cameraPositionRootNode_->_update(true, false); // update the camera node because otherwise the camera will drag back in position which looks strange
- NewHumanController* controller = dynamic_cast<NewHumanController*>(this->getController());
+ NewHumanController* controller = orxonox_cast<NewHumanController*>(this->getController());
if (controller)
controller->centerCursor();
}
Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -163,10 +163,10 @@
{ return this->target_.get(); }
void setTargetInternal( uint32_t targetID );
- inline void setTeam(int team)
- { this->team_ = team; }
- inline int getTeam() const
- { return this->team_; }
+ inline void setTeam(int team)
+ { this->team_ = team; }
+ inline int getTeam() const
+ { return this->team_; }
protected:
virtual void preDestroy();
@@ -242,7 +242,7 @@
CameraPosition* reverseCamera_;
WeakPtr<WorldEntity> target_;
- int team_ ; //<! teamnumber
+ int team_ ; //<! teamnumber
};
}
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -74,6 +74,9 @@
this->lastHitOriginator_ = 0;
+ // set damage multiplier to default value 1, meaning nominal damage
+ this->damageMultiplier_ = 1;
+
this->spawnparticleduration_ = 3.0f;
this->aimPosition_ = Vector3::ZERO;
@@ -227,6 +230,10 @@
void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
{
+ // Applies multiplier given by the DamageBoost Pickup.
+ if (originator)
+ damage *= originator->getDamageMultiplier();
+
if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
{
if (shielddamage >= this->getShieldHealth())
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2012-08-30 21:08:17 UTC (rev 9348)
@@ -143,9 +143,6 @@
virtual void addedWeaponPack(WeaponPack* wPack) {}
- inline const WorldEntity* getWorldEntity() const
- { return const_cast<Pawn*>(this); }
-
inline void setSpawnParticleSource(const std::string& source)
{ this->spawnparticlesource_ = source; }
inline const std::string& getSpawnParticleSource() const
@@ -161,6 +158,13 @@
inline unsigned int getExplosionChunks() const
{ return this->numexplosionchunks_; }
+ // These are used with the Damage Boost Pickup to use the damage multiplier.
+ inline void setDamageMultiplier(float multiplier)
+ { this->damageMultiplier_ = multiplier; }
+ inline float getDamageMultiplier() const
+ { return this->damageMultiplier_; }
+
+
virtual void startLocalHumanControl();
void setAimPosition( Vector3 position )
@@ -202,11 +206,13 @@
float shieldHealth_;
float maxShieldHealth_;
float initialShieldHealth_;
- float shieldAbsorption_; // Has to be between 0 and 1
+ float shieldAbsorption_; ///< Has to be between 0 and 1
float reloadRate_;
float reloadWaitTime_;
float reloadWaitCountdown_;
+ float damageMultiplier_; ///< Used by the Damage Boost Pickup.
+
WeakPtr<Pawn> lastHitOriginator_;
WeaponSystem* weaponSystem_;
Modified: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2012-08-30 20:32:58 UTC (rev 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2012-08-30 21:08:17 UTC (rev 9348)
@@ -132,7 +132,7 @@
void SpaceShip::setConfigValues()
{
SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
-
+
SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
.description("Enable or disable the motion blur effect when moving very fast")
.callback(this, &SpaceShip::changedEnableMotionBlur);
@@ -502,8 +502,8 @@
*/
void SpaceShip::resetCamera()
{
- if(this->hasLocalController() && this->hasHumanController())
- {
+ if(this->hasLocalController() && this->hasHumanController())
+ {
Camera *camera = this->getCamera();
if (camera == 0)
{
@@ -513,7 +513,7 @@
this->shakeDt_ = 0.0f;
camera->setPosition(this->cameraOriginalPosition_);
camera->setOrientation(this->cameraOriginalOrientation_);
- }
+ }
}
}
More information about the Orxonox-commit
mailing list