[Orxonox-commit 4573] r9244 - in code/branches/presentation2012: . data/levels src/modules/gametypes src/modules/pickup src/modules/pickup/items
landauf at orxonox.net
landauf at orxonox.net
Thu May 24 22:01:01 CEST 2012
Author: landauf
Date: 2012-05-24 22:01:01 +0200 (Thu, 24 May 2012)
New Revision: 9244
Removed:
code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.cc
code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h
code/branches/presentation2012/src/modules/pickup/items/FlagPickup.cc
code/branches/presentation2012/src/modules/pickup/items/FlagPickup.h
Modified:
code/branches/presentation2012/
code/branches/presentation2012/data/levels/emptyLevel.oxw
code/branches/presentation2012/src/modules/pickup/PickupPrereqs.h
Log:
reverted the rest of r9241
Property changes on: code/branches/presentation2012
___________________________________________________________________
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/newlevel2012:9033-9240
/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/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/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,9215-9240*
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacegate:9030-9215
/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
/code/trunk:9189-9204
+ /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-9228
/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/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/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/spacegate:9030-9215
/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
/code/trunk:9189-9204
Modified: code/branches/presentation2012/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/presentation2012/data/levels/emptyLevel.oxw 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/data/levels/emptyLevel.oxw 2012-05-24 20:01:01 UTC (rev 9244)
@@ -14,7 +14,6 @@
<?lua
include("templates/spaceshipAssff2.oxt")
include("templates/spaceshipPirate.oxt")
- include("templates/pickupRepresentationTemplates.oxt")
?>
<Level>
@@ -29,10 +28,6 @@
skybox = "Orxonox/Starbox"
>
- <?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"/>
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 />
Deleted: code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.cc
===================================================================
--- code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.cc 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.cc 2012-05-24 20:01:01 UTC (rev 9244)
@@ -1,355 +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:
- * Nino Weingart
- * Co-authors:
- * ...
- *
- */
-#include "CaptureTheFlag.h"
-
-#include "core/ConfigValueIncludes.h"
-#include "interfaces/TeamColourable.h"
-#include "worldentities/TeamSpawnPoint.h"
-#include "worldentities/pawns/Pawn.h"
-
-
-
-namespace orxonox
-{
- CreateUnloadableFactory(CaptureTheFlag);
-
- CaptureTheFlag::CaptureTheFlag(BaseObject* creator) : TeamBaseMatch(creator)
- {
- RegisterObject(CaptureTheFlag);
-
- this->teams_ = 2;
- this->pointsTeam1_ = 0;
- this->pointsTeam2_ = 0;
-
-// this->flagTeamBlue = new FlagPickup(this);
-// this->flagTeamRed = new FlagPickup(this);
-
- this->setConfigValues();
- }
-
- void CaptureTheFlag::tick(float dt){
-
- SUPER(CaptureTheFlag, tick, dt);
-
- if(this->flagTeamBlue->isPickedUp()){
- teamnr = getTeam(this->flagTeamBlue->pickedUpBy()->getPlayer());
- if(teamnr == 1){
- this->flagTeamBlue->ignorePickedUp();
-
- if(this->flagTeamBlue->pickedUpBy()->hasFlag()){
- this->addTeamPoints(teamnr, 1000);
- this->flagTeamBlue->pickedUpBy()->setHasFlag(false);
- }
- this->flagTeamBlue->setPickedUp(false);
- }
- else{
- this->flagTeamBlue->pickedUpBy()->setHasFlag(true);
- }
- }
- if(this->flagTeamRed->isPickedUp()){
- teamnr = getTeam(this->flagTeamBlue->pickedUpBy()->getPlayer());
- if(teamnr == 0){
- this->flagTeamRed->ignorePickedUp();
-
- if(this->flagTeamRed->pickedUpBy()->hasFlag()){
- this->addTeamPoints(teamnr, 1000);
- this->flagTeamRed->pickedUpBy()->setHasFlag(false);
- }
- this->flagTeamRed->setPickedUp(false);
- }
- else{
- this->flagTeamRed->pickedUpBy()->setHasFlag(true);
- }
- }
-
- }
- void CaptureTheFlag::setConfigValues()
- {
- SetConfigValue(teams_, 2);
-
- 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);
- }
-
- void CaptureTheFlag::playerEntered(PlayerInfo* player)
- {
- TeamBaseMatch::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;
- }
-
- bool CaptureTheFlag::playerLeft(PlayerInfo* player)
- {
- bool valid_player = Deathmatch::playerLeft(player);
-
- if (valid_player)
- this->teamnumbers_.erase(player);
-
- return valid_player;
- }
-
- bool CaptureTheFlag::allowPawnHit(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
- }
-
- bool CaptureTheFlag::allowPawnDamage(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
- }
-
- bool CaptureTheFlag::allowPawnDeath(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
- }
-
- // collect Points for killing oppenents
- void CaptureTheFlag::playerScored(PlayerInfo* player)
- {
- int teamnr = this->getTeam(player);
- this->addTeamPoints(teamnr, 5);
- }
-
-
- // show points or each interval of time
- void CaptureTheFlag::showPoints()
- {
- if (!this->hasStarted() || this->hasEnded())
- return;
-
- orxout(message) << "Points standing:" << '\n' << "Team Blue: "<< pointsTeam1_ << '\n' << "Team Red: " << pointsTeam2_ << endl;
- if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) orxout(message) << "Team Blue is near victory!" << endl;
- if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) orxout(message) << "Team Red is near victory!" << endl;
- }
-
- // end game if one team reaches 2000 points
- void CaptureTheFlag::endGame()
- {
- if (this->pointsTeam1_ >= 2000 || this->pointsTeam2_ >= 2000)
- {
- int winningteam = -1;
-
- if (this->pointsTeam1_ > this->pointsTeam2_)
- {
- orxout(message) << "Team Blue has won the match" << endl;
- winningteam = 0;
- }
- else
- {
- orxout(message) << "Team Red has won the match" << endl;
- winningteam = 1;
- }
-
- for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
- {
- if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
- continue;
-
- if (it->second == winningteam)
- this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());
- else
- this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());
- }
-
- this->end();
- this->scoreTimer_.stopTimer();
- this->outputTimer_.stopTimer();
- }
- }
-
- // this function is called by the function winPoints() which adds points to the teams for every base and killed openents at a certain time
- void CaptureTheFlag::addTeamPoints(int team, int points)
- {
- if(team == 0)
- {
- this->pointsTeam1_ += points;
- }
- if(team == 1)
- {
- this->pointsTeam2_ += points;
- }
-
- this->endGame();
- }
-
- int TeamBaseMatch::getTeamPoints(int team)
- {
- if(team == 0)
- {
- return this->pointsTeam1_;
- }
- if(team == 1)
- {
- return this->pointsTeam2_;
- }
-
- return 0;
- }
-
- SpawnPoint* CaptureTheFlag::getBestSpawnPoint(PlayerInfo* player) const
- {
- 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 ((*it)->isA(Class(TeamSpawnPoint)))
- {
- TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
- if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
- {
- teamSpawnPoints.erase(it++);
- continue;
- }
- }
-
- ++it;
- }
-
- 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;
- }
-
- void CaptureTheFlag::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
- {
- if (!player)
- return;
-
- // 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 (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]);
- }
- }
- }
- }
- }
-
- bool CaptureTheFlag::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 CaptureTheFlag::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;
- }
-}
Deleted: code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h
===================================================================
--- code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h 2012-05-24 20:01:01 UTC (rev 9244)
@@ -1,94 +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:
- * Nino Weingart
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _CaptureTheFlag_H__
-#define _CaptureTheFlag_H__
-
-#include "OrxonoxPrereqs.h"
-#include <set>
-#include "core/CoreIncludes.h"
-
-#include "tools/Timer.h"
-#include "gametypes/TeamBaseMatch.h"
-#include "infos/PlayerInfo.h"
-#include "pickup/items/FlagPickup.h"
-#include "pickup/PickupPrereqs.h"
-
-namespace orxonox
-{
- class _OrxonoxExport CaptureTheFlag : public TeamBaseMatch
- {
- public:
- CaptureTheFlag(BaseObject* creator);
- virtual ~CaptureTheFlag() {}
-
- void tick(float dt);
-
- void setConfigValues();
-
- virtual void playerEntered(PlayerInfo* player);
- virtual bool playerLeft(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 playerScored(PlayerInfo* player);
- virtual void showPoints();
- virtual void endGame();
-
- void addTeamPoints(int team, int points);
- int getTeamPoints(int team);
-
- 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_;
-
- FlagPickup* flagTeamBlue;
- FlagPickup* flagTeamRed;
-
- //points for each team
- int pointsTeam1_;
- int pointsTeam2_;
- int teamnr;
-
- };
-}
-
-#endif // _CaptureTheFlag_H__
-
Modified: code/branches/presentation2012/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/presentation2012/src/modules/pickup/PickupPrereqs.h 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/src/modules/pickup/PickupPrereqs.h 2012-05-24 20:01:01 UTC (rev 9244)
@@ -67,6 +67,7 @@
namespace orxonox
{
+
class CollectiblePickup;
class DroppedPickup;
class Pickup;
Deleted: code/branches/presentation2012/src/modules/pickup/items/FlagPickup.cc
===================================================================
--- code/branches/presentation2012/src/modules/pickup/items/FlagPickup.cc 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/src/modules/pickup/items/FlagPickup.cc 2012-05-24 20:01:01 UTC (rev 9244)
@@ -1,188 +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:
- * Nino Weingart
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file FlagPickup.cc
- @brief Implementation of the FlagPickup class.
- */
-
-#include "FlagPickup.h"
-
-#include <sstream>
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "pickup/PickupIdentifier.h"
-
-namespace orxonox
-{
-
- CreateFactory(FlagPickup);
-
- /**
- @brief
- Constructor. Registers the object and initializes the member variables.
- */
- FlagPickup::FlagPickup(BaseObject* creator) : Pickup(creator)
- {
- RegisterObject(FlagPickup);
-
- this->initialize();
- }
-
- /**
- @brief
- Destructor.
- */
- FlagPickup::~FlagPickup()
- {
-
- }
-
- /**
- @brief
- Initializes the member variables.
- */
- void FlagPickup::initialize(void)
- {
- this->flagType_ = 0;
-
- this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
- }
-
- /**
- @brief
- Initializes the PickupIdentifier of this pickup.
- */
- void FlagPickup::initializeIdentifier(void)
- {
- std::stringstream stream;
- int type = this->getFlagType();
- stream << type;
- std::string val = stream.str();
-
- std::string type1 = "flagType";
- this->pickupIdentifier_->addParameter(type1, val);
- }
-
- /**
- @brief
- Method for creating a FlagPickup object through XML.
- */
- void FlagPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
- {
- SUPER(FlagPickup, XMLPort, xmlelement, mode);
-
- XMLPortParam(FlagPickup, "flagType", setFlagType, getFlagType, xmlelement, mode);
- //XMLPortParam(FlagPickup, "teamNumber", setTeamNumber, getTeamNumber, xmlelement, mode);
-
- this->initializeIdentifier();
- }
-
-
- /**
- @brief
- Get the flag type of this pickup.
- @return
- Returns the falg type as a string.
- */
- const int FlagPickup::getFlagType(void) const
- {
- return this->flagType_;
- }
-
- /**
- @brief
- Set the type of the FlagPickup.
- @param type
- The type as a string.
- */
- void FlagPickup::setFlagType(int type)
- {
- if(type<3){
- this->flagType_ = type;
- }
-
- else{
- orxout(internal_error, context::pickups) << "Invalid flagType '" << type << "' in FlagPickup." << endl;
- }
- }
-
- /**
- @brief
- Is called when the pickup has transited from used to unused or the other way around.
- */
- void FlagPickup::changedUsed(void)
- {
- SUPER(FlagPickup, changedUsed);
-
- Pawn* pawn = this->carrierToPawnHelper();
-
- if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
- this->Pickupable::destroy();
-
- // If the pickup has transited to used.
- if(this->isUsed())
- {
- this->bPickedUp_ = true;
- this->pickedUpBy_ = pawn;
- orxout(internal_error, context::pickups) << "flag picked up." << endl;
-
- }
- }
-
- /**
- @brief
- Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
- @return
- A pointer to the Pawn, or NULL if the conversion failed.
- */
- Pawn* FlagPickup::carrierToPawnHelper(void)
- {
- PickupCarrier* carrier = this->getCarrier();
- Pawn* pawn = dynamic_cast<Pawn*>(carrier);
-
- if(pawn == NULL)
- orxout(internal_error, context::pickups) << "Invalid PickupCarrier in Flag Pickup." << endl;
-
- return pawn;
- }
-
-
-
- void FlagPickup::tick(float dt)
- {
- SUPER(FlagPickup, tick, dt);
-
- //Pawn* pawn = this->carrierToPawnHelper();
-
-// if(pawn->isAlive() && pawn->hasFlag()){
-// this->Pickupable::destroy();
-// }
-
- }
-}
\ No newline at end of file
Deleted: code/branches/presentation2012/src/modules/pickup/items/FlagPickup.h
===================================================================
--- code/branches/presentation2012/src/modules/pickup/items/FlagPickup.h 2012-05-24 19:33:31 UTC (rev 9243)
+++ code/branches/presentation2012/src/modules/pickup/items/FlagPickup.h 2012-05-24 20:01:01 UTC (rev 9244)
@@ -1,107 +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:
- * Nino Weingart
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file FlagPickup.h
- @brief Declaration of the FlagPickup class.
- @ingroup PickupItems
- */
-
-#ifndef _FlagPickup_H__
-#define _FlagPickup_H__
-
-#include "pickup/PickupPrereqs.h"
-#include "worldentities/pawns/Pawn.h"
-
-#include <string>
-
-#include "pickup/Pickup.h"
-#include "tools/Timer.h"
-#include "tools/interfaces/Tickable.h"
-
-
-namespace orxonox {
- /*
- @ingroup PickupItems
-
-
- @author
- Nino Weingart
-
- @ingroup PickupItems
- */
- class _PickupExport FlagPickup : public Pickup, public Tickable
- {
- public:
-
- FlagPickup(BaseObject* creator); //!< Constructor.
- ~FlagPickup(); //!< Destructor.
-
- virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a FlagPickup object through XML.
-
- virtual void tick(float dt);
-
- const int getFlagType(void) const; //!< Get the flag type of this pickup.
-
- inline bool isPickedUp() const
- { return this->bPickedUp_; }
- inline Pawn* pickedUpBy() const
- { return this->pickedUpBy_; }
-
- inline void setPickedUp(bool pickedUp)
- { this->bPickedUp_ = pickedUp; }
-
- inline void ignorePickedUp()
- { this->Pickupable::destroy(); }
-
- virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-
- protected:
- void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
- /**
- @brief Set the flag type of this pickup.
- @param type The type of this pickup as an enum.
- */
- inline void setFlagTypeDirect(int type)
- { this->flagType_ = type; }
-
- void setFlagType(int type); //!< Set the type of the FlagPickup.
-
- private:
- Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
- void initialize(void); //!< Initializes the member variables.
- Pawn* pickedUpBy_;
- int flagType_;
-
- bool bPickedUp_;
-
- };
-}
-
-#endif // _FlagPickup_H__
More information about the Orxonox-commit
mailing list