Changeset 2908 for code/branches/questsystem5/src/orxonox/objects
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 22 deleted
- 106 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/CMakeLists.txt
r2907 r2908 8 8 RadarListener.cc 9 9 RadarViewable.cc 10 Teamcolourable.cc11 10 Tickable.cc 12 11 Test.cc -
code/branches/questsystem5/src/orxonox/objects/EventTarget.cc
r2907 r2908 66 66 void EventTarget::addAsEvent(BaseObject* object) 67 67 { 68 if (object != static_cast<BaseObject*>(this))68 if (object != (BaseObject*)this) 69 69 object->addEvent(this, ""); 70 70 } -
code/branches/questsystem5/src/orxonox/objects/Level.cc
- Property svn:mergeinfo changed
/code/branches/gui/src/orxonox/objects/Level.cc removed /code/branches/miniprojects/src/orxonox/objects/Level.cc removed /code/branches/weaponsystem/src/orxonox/objects/Level.cc removed
r2907 r2908 105 105 { 106 106 Identifier* identifier = ClassByString(gametype); 107 108 if (!identifier || !identifier->isA(Class(Gametype))) 107 if (identifier && identifier->isA(Class(Gametype))) 109 108 { 110 COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;111 identifier = Class(Gametype);112 this->gametype_ = "Gametype";113 }114 else115 109 this->gametype_ = gametype; 116 110 117 std::cout << "Load Gametype: " << this->gametype_ << std::endl; 111 Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this)); 112 this->setGametype(rootgametype); 118 113 119 Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));120 this->setGametype(rootgametype);114 for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it) 115 (*it)->setGametype(rootgametype); 121 116 122 std::cout << "root gametype: " << rootgametype->getIdentifier()->getName() << std::endl; 123 124 for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it) 125 (*it)->setGametype(rootgametype); 126 127 if (LevelManager::getInstancePtr()) 128 LevelManager::getInstance().requestActivity(this); 117 if (LevelManager::getInstancePtr()) 118 LevelManager::getInstance().requestActivity(this); 119 } 129 120 } 130 121 - Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/Level.h
- Property svn:mergeinfo changed
/code/branches/gui/src/orxonox/objects/Level.h removed /code/branches/miniprojects/src/orxonox/objects/Level.h removed /code/branches/weaponsystem/src/orxonox/objects/Level.h removed
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/Radar.cc
r2907 r2908 144 144 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it) 145 145 { 146 if (*it == static_cast<RadarViewable*>(this)->owner_)146 if (*it == (RadarViewable*)this->owner_) 147 147 continue; 148 148 -
code/branches/questsystem5/src/orxonox/objects/Scene.cc
r2907 r2908 41 41 42 42 #include "core/CoreIncludes.h" 43 #include "core/ GameMode.h"43 #include "core/Core.h" 44 44 #include "core/XMLPort.h" 45 45 #include "tools/BulletConversions.h" … … 57 57 this->bShadows_ = true; 58 58 59 if ( GameMode::showsGraphics())59 if (Core::showsGraphics()) 60 60 { 61 61 if (Ogre::Root::getSingletonPtr()) … … 99 99 Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_); 100 100 } 101 else if (! GameMode::showsGraphics())101 else if (!Core::showsGraphics()) 102 102 { 103 103 delete this->sceneManager_; … … 227 227 void Scene::tick(float dt) 228 228 { 229 if (! GameMode::showsGraphics())229 if (!Core::showsGraphics()) 230 230 { 231 231 // We need to update the scene nodes if we don't render … … 256 256 void Scene::setSkybox(const std::string& skybox) 257 257 { 258 if ( GameMode::showsGraphics() && this->sceneManager_)258 if (Core::showsGraphics() && this->sceneManager_) 259 259 this->sceneManager_->setSkyBox(true, skybox); 260 260 … … 264 264 void Scene::setAmbientLight(const ColourValue& colour) 265 265 { 266 if ( GameMode::showsGraphics() && this->sceneManager_)266 if (Core::showsGraphics() && this->sceneManager_) 267 267 this->sceneManager_->setAmbientLight(colour); 268 268 … … 272 272 void Scene::setShadow(bool bShadow) 273 273 { 274 if ( GameMode::showsGraphics() && this->sceneManager_)274 if (Core::showsGraphics() && this->sceneManager_) 275 275 { 276 276 if (bShadow) -
code/branches/questsystem5/src/orxonox/objects/collisionshapes
- Property svn:mergeinfo changed
/code/branches/miniprojects/src/orxonox/objects/collisionshapes removed /code/branches/weaponsystem/src/orxonox/objects/collisionshapes removed
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc
r2907 r2908 30 30 #include "AIController.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/Executor.h" … … 45 45 RegisterObject(AIController); 46 46 47 if ( GameMode::isMaster())47 if (Core::isMaster()) 48 48 this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action))); 49 49 } -
code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt
r2907 r2908 5 5 AIController.cc 6 6 ScriptController.cc 7 PongAI.cc8 7 ) -
code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc
r2907 r2908 43 43 this->player_ = 0; 44 44 this->controllableEntity_ = 0; 45 this->hud_ = 0; 46 this->bUpdateHUD_ = false; 45 47 } 46 48 47 49 Controller::~Controller() 48 50 { 51 if (this->isInitialized() && this->hud_) 52 delete this->hud_; 53 } 54 55 void Controller::changedControllableEntity() 56 { 57 if (this->bUpdateHUD_) 58 { 59 this->updateHUD(); 60 this->bUpdateHUD_ = false; 61 } 62 63 if (this->hud_) 64 this->hud_->setOwner(this->getControllableEntity()); 65 } 66 67 void Controller::updateHUD() 68 { 69 if (this->hud_) 70 { 71 delete this->hud_; 72 this->hud_ = 0; 73 } 74 75 if (this->hudtemplate_ != "") 76 { 77 this->hud_ = new OverlayGroup(this); 78 this->hud_->addTemplate(this->hudtemplate_); 79 this->hud_->setOwner(this->getControllableEntity()); 80 } 49 81 } 50 82 } -
code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h
r2907 r2908 57 57 inline ControllableEntity* getControllableEntity() const 58 58 { return this->controllableEntity_; } 59 virtual void changedControllableEntity() {} 59 virtual void changedControllableEntity(); 60 61 inline void setHUDTemplate(const std::string& name) 62 { 63 if (name != this->hudtemplate_) 64 { 65 this->hudtemplate_ = name; 66 if (this->controllableEntity_) 67 this->updateHUD(); 68 else 69 this->bUpdateHUD_ = true; 70 } 71 } 72 inline const std::string& getHUDTemplate() const 73 { return this->hudtemplate_; } 74 75 inline OverlayGroup* getHUD() const 76 { return this->hud_; } 60 77 61 78 protected: 79 void updateHUD(); 80 62 81 PlayerInfo* player_; 63 82 ControllableEntity* controllableEntity_; 83 std::string hudtemplate_; 84 OverlayGroup* hud_; 85 bool bUpdateHUD_; 64 86 }; 65 87 } -
code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc
r2907 r2908 35 35 #include "objects/worldentities/pawns/Pawn.h" 36 36 #include "objects/gametypes/Gametype.h" 37 #include "objects/infos/PlayerInfo.h"38 37 39 38 namespace orxonox … … 158 157 if (pawn) 159 158 pawn->kill(); 160 else if (HumanController::localController_s->player_)161 HumanController::localController_s->player_->stopControl(HumanController::localController_s->controllableEntity_);162 159 } 163 160 } -
code/branches/questsystem5/src/orxonox/objects/gametypes/CMakeLists.txt
r2907 r2908 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 2 Gametype.cc 3 Deathmatch.cc4 TeamDeathmatch.cc5 Pong.cc6 3 ) -
code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.cc
r2907 r2908 36 36 #include "core/ConfigValueIncludes.h" 37 37 #include "core/Template.h" 38 #include "core/ GameMode.h"38 #include "core/Core.h" 39 39 #include "overlays/OverlayGroup.h" 40 40 #include "objects/infos/PlayerInfo.h" … … 44 44 #include "objects/worldentities/Camera.h" 45 45 46 #include "network/Host.h" 47 46 48 namespace orxonox 47 49 { … … 64 66 this->setConfigValues(); 65 67 68 this->addBots(this->numberOfBots_); 69 66 70 // load the corresponding score board 67 if ( GameMode::showsGraphics() && this->scoreboardTemplate_ != "")71 if (Core::showsGraphics() && this->scoreboardTemplate_ != "") 68 72 { 69 73 this->scoreboard_ = new OverlayGroup(this); … … 101 105 void Gametype::start() 102 106 { 103 this->addBots(this->numberOfBots_); 104 107 COUT(0) << "game started" << std::endl; 105 108 this->gtinfo_.bStarted_ = true; 106 109 … … 110 113 void Gametype::end() 111 114 { 115 COUT(0) << "game ended" << std::endl; 112 116 this->gtinfo_.bEnded_ = true; 113 117 } … … 116 120 { 117 121 this->players_[player].state_ = PlayerState::Joined; 118 } 119 120 bool Gametype::playerLeft(PlayerInfo* player) 122 123 std::string message = player->getName() + " entered the game"; 124 COUT(0) << message << std::endl; 125 Host::Broadcast(message); 126 } 127 128 void Gametype::playerLeft(PlayerInfo* player) 121 129 { 122 130 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); … … 124 132 { 125 133 this->players_.erase(it); 126 return true; 127 } 128 return false; 134 135 std::string message = player->getName() + " left the game"; 136 COUT(0) << message << std::endl; 137 Host::Broadcast(message); 138 } 129 139 } 130 140 … … 137 147 } 138 148 139 boolGametype::playerChangedName(PlayerInfo* player)149 void Gametype::playerChangedName(PlayerInfo* player) 140 150 { 141 151 if (this->players_.find(player) != this->players_.end()) … … 143 153 if (player->getName() != player->getOldName()) 144 154 { 145 return true; 146 } 147 } 148 return false; 155 std::string message = player->getOldName() + " changed name to " + player->getName(); 156 COUT(0) << message << std::endl; 157 Host::Broadcast(message); 158 } 159 } 149 160 } 150 161 … … 157 168 } 158 169 159 void Gametype::playerPreSpawn(PlayerInfo* player)160 {161 }162 163 void Gametype::playerPostSpawn(PlayerInfo* player)164 {165 }166 167 void Gametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)168 {169 }170 171 void Gametype::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn)172 {173 }174 175 bool Gametype::allowPawnHit(Pawn* victim, Pawn* originator)176 {177 return true;178 }179 180 bool Gametype::allowPawnDamage(Pawn* victim, Pawn* originator)181 {182 return true;183 }184 185 bool Gametype::allowPawnDeath(Pawn* victim, Pawn* originator)186 {187 return true;188 }189 190 170 void Gametype::pawnKilled(Pawn* victim, Pawn* killer) 191 171 { 172 if (victim && victim->getPlayer()) 173 { 174 std::string message; 175 if (killer) 176 { 177 if (killer->getPlayer()) 178 message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName(); 179 else 180 message = victim->getPlayer()->getName() + " was killed"; 181 } 182 else 183 message = victim->getPlayer()->getName() + " died"; 184 185 COUT(0) << message << std::endl; 186 Host::Broadcast(message); 187 } 188 192 189 if (victim && victim->getPlayer()) 193 190 { … … 201 198 if (killer) 202 199 { 203 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(killer->getPlayer()); 204 if (it != this->players_.end()) 205 it->second.frags_++; 200 std::map<PlayerInfo*, Player>::iterator itKiller = this->players_.find(killer->getPlayer()); 201 if (itKiller != this->players_.end()) 202 { 203 this->playerScored(itKiller->second); 204 } 205 else 206 COUT(2) << "Warning: Killing Pawn was not in the playerlist" << std::endl; 206 207 } 207 208 … … 224 225 } 225 226 226 void Gametype::playerScored(PlayerInfo* player) 227 { 228 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); 229 if (it != this->players_.end()) 230 it->second.frags_++; 231 } 232 233 int Gametype::getScore(PlayerInfo* player) const 234 { 235 std::map<PlayerInfo*, Player>::const_iterator it = this->players_.find(player); 236 if (it != this->players_.end()) 237 return it->second.frags_; 238 else 239 return 0; 227 void Gametype::playerScored(Player& player) 228 { 229 player.frags_++; 240 230 } 241 231 … … 346 336 if (spawnpoint) 347 337 { 348 this->playerPreSpawn(player);349 338 player->startControl(spawnpoint->spawn()); 350 339 this->players_[player].state_ = PlayerState::Alive; 351 this->playerPostSpawn(player);352 340 } 353 341 else … … 361 349 { 362 350 for (unsigned int i = 0; i < amount; ++i) 363 this->botclass_.fabricate(this);351 new Bot(this); 364 352 } 365 353 -
code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.h
r2907 r2908 84 84 virtual void end(); 85 85 virtual void playerEntered(PlayerInfo* player); 86 virtual boolplayerLeft(PlayerInfo* player);86 virtual void playerLeft(PlayerInfo* player); 87 87 virtual void playerSwitched(PlayerInfo* player, Gametype* newgametype); 88 88 virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype); 89 virtual boolplayerChangedName(PlayerInfo* player);89 virtual void playerChangedName(PlayerInfo* player); 90 90 91 virtual void playerScored(PlayerInfo* player); 92 93 virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0); 94 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); 95 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); 91 virtual void playerScored(Player& player); 96 92 97 93 virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); 98 94 virtual void pawnPreSpawn(Pawn* pawn); 99 95 virtual void pawnPostSpawn(Pawn* pawn); 100 virtual void playerPreSpawn(PlayerInfo* player);101 virtual void playerPostSpawn(PlayerInfo* player);102 103 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);104 virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn);105 96 106 97 inline const std::map<PlayerInfo*, Player>& getPlayers() const 107 98 { return this->players_; } 108 109 int getScore(PlayerInfo* player) const;110 99 111 100 inline void registerSpawnPoint(SpawnPoint* spawnpoint) … … 117 106 { return this->gtinfo_.startCountdown_; } 118 107 119 inline void setHUDTemplate(const std::string& name)120 { this->gtinfo_.hudtemplate_ = name; }121 inline const std::string& getHUDTemplate() const122 { return this->gtinfo_.hudtemplate_; }123 124 108 void addBots(unsigned int amount); 125 109 void killBots(unsigned int amount = 0); … … 128 112 { return this->players_.size(); } 129 113 130 pr otected:114 private: 131 115 virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const; 132 116 133 virtual void assignDefaultPawnsIfNeeded(); 134 virtual void checkStart(); 135 virtual void spawnPlayer(PlayerInfo* player); 136 virtual void spawnPlayersIfRequested(); 137 virtual void spawnDeadPlayersIfRequested(); 117 void addPlayer(PlayerInfo* player); 118 void removePlayer(PlayerInfo* player); 119 120 void assignDefaultPawnsIfNeeded(); 121 void checkStart(); 122 void spawnPlayer(PlayerInfo* player); 123 void spawnPlayersIfRequested(); 124 void spawnDeadPlayersIfRequested(); 138 125 139 126 GametypeInfo gtinfo_; … … 144 131 float initialStartCountdown_; 145 132 unsigned int numberOfBots_; 146 SubclassIdentifier<Bot> botclass_;147 133 148 134 std::map<PlayerInfo*, Player> players_; -
code/branches/questsystem5/src/orxonox/objects/infos/Bot.cc
r2907 r2908 30 30 #include "Bot.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/ConfigValueIncludes.h" … … 46 46 47 47 this->bHumanPlayer_ = false; 48 this->bLocalPlayer_ = GameMode::isMaster();48 this->bLocalPlayer_ = Core::isMaster(); 49 49 this->bSetUnreadyAfterSpawn_ = false; 50 50 this->setReadyToSpawn(true); -
code/branches/questsystem5/src/orxonox/objects/infos/CMakeLists.txt
r2907 r2908 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 2 Bot.cc 3 PongBot.cc4 3 Info.cc 5 4 PlayerInfo.cc -
code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.cc
r2907 r2908 58 58 registerVariable(this->startCountdown_, variableDirection::toclient); 59 59 registerVariable(this->bStartCountdownRunning_, variableDirection::toclient); 60 registerVariable(this->hudtemplate_, variableDirection::toclient);61 60 } 62 61 } -
code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.h
r2907 r2908 56 56 { return this->startCountdown_; } 57 57 58 inline const std::string& getHUDTemplate() const59 { return this->hudtemplate_; }60 61 58 private: 62 59 bool bStarted_; … … 64 61 bool bStartCountdownRunning_; 65 62 float startCountdown_; 66 std::string hudtemplate_;67 63 }; 68 64 } -
code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.cc
r2907 r2908 30 30 #include "HumanPlayer.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/ConfigValueIncludes.h" … … 47 47 RegisterObject(HumanPlayer); 48 48 49 this->server_initialized_ = GameMode::isMaster();49 this->server_initialized_ = Core::isMaster(); 50 50 this->client_initialized_ = false; 51 51 52 52 this->bHumanPlayer_ = true; 53 53 this->defaultController_ = Class(HumanController); 54 55 this->humanHud_ = 0;56 this->gametypeHud_ = 0;57 54 58 55 this->setConfigValues(); … … 62 59 HumanPlayer::~HumanPlayer() 63 60 { 64 if (this->BaseObject::isInitialized())65 {66 if (this->humanHud_)67 delete this->humanHud_;68 69 if (this->gametypeHud_)70 delete this->gametypeHud_;71 }72 61 } 73 62 … … 93 82 this->synchronize_nick_ = this->nick_; 94 83 95 if ( GameMode::isMaster())84 if (Core::isMaster()) 96 85 this->setName(this->nick_); 97 86 } … … 100 89 void HumanPlayer::configvaluecallback_changedHUDTemplate() 101 90 { 102 this-> setHumanHUDTemplate(this->hudtemplate_);91 this->changedController(); 103 92 } 104 93 … … 116 105 this->client_initialized_ = true; 117 106 118 if (! GameMode::isMaster())107 if (!Core::isMaster()) 119 108 this->setObjectMode(objectDirection::bidirectional); 120 109 else … … 122 111 123 112 this->createController(); 124 this->updateHumanHUD();125 113 } 126 114 } … … 158 146 } 159 147 160 void HumanPlayer::changed Gametype()148 void HumanPlayer::changedController() 161 149 { 162 PlayerInfo::changedGametype(); 150 if (this->getController()) 151 { 152 this->getController()->setHUDTemplate(this->hudtemplate_); 163 153 164 if (this->isInitialized() && this->isLocalPlayer()) 165 if (this->getGametype()->getHUDTemplate() != "") 166 this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate()); 167 } 168 169 void HumanPlayer::changedControllableEntity() 170 { 171 PlayerInfo::changedControllableEntity(); 172 173 if (this->humanHud_) 174 this->humanHud_->setOwner(this->getControllableEntity()); 175 } 176 177 void HumanPlayer::updateHumanHUD() 178 { 179 if (this->humanHud_) 180 { 181 delete this->humanHud_; 182 this->humanHud_ = 0; 183 } 184 185 if (this->isLocalPlayer() && this->humanHudTemplate_ != "") 186 { 187 this->humanHud_ = new OverlayGroup(this); 188 this->humanHud_->addTemplate(this->humanHudTemplate_); 189 this->humanHud_->setOwner(this->getControllableEntity()); 190 } 191 } 192 193 void HumanPlayer::updateGametypeHUD() 194 { 195 if (this->gametypeHud_) 196 { 197 delete this->gametypeHud_; 198 this->gametypeHud_ = 0; 199 } 200 201 if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "") 202 { 203 this->gametypeHud_ = new OverlayGroup(this); 204 this->gametypeHud_->addTemplate(this->gametypeHudTemplate_); 205 this->gametypeHud_->setOwner(this->getGametype()); 154 if (this->getController() && this->getController()->getHUD()) 155 this->getController()->getHUD()->setOwner(this->getControllableEntity()); 206 156 } 207 157 } -
code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.h
r2907 r2908 51 51 void setClientID(unsigned int clientID); 52 52 53 virtual void changedGametype(); 54 virtual void changedControllableEntity(); 55 56 inline void setHumanHUDTemplate(const std::string& name) 57 { 58 if (name != this->humanHudTemplate_) 59 { 60 this->humanHudTemplate_ = name; 61 this->updateHumanHUD(); 62 } 63 } 64 inline const std::string& getHumanHUDTemplate() const 65 { return this->humanHudTemplate_; } 66 inline OverlayGroup* getHumanHUD() const 67 { return this->humanHud_; } 68 69 inline void setGametypeHUDTemplate(const std::string& name) 70 { 71 if (name != this->gametypeHudTemplate_) 72 { 73 this->gametypeHudTemplate_ = name; 74 this->updateGametypeHUD(); 75 } 76 } 77 inline const std::string& getGametypeHUDTemplate() const 78 { return this->gametypeHudTemplate_; } 79 inline OverlayGroup* getGametypeHUD() const 80 { return this->gametypeHud_; } 53 virtual void changedController(); 81 54 82 55 protected: … … 88 61 void networkcallback_client_initialized(); 89 62 90 void updateHumanHUD();91 void updateGametypeHUD();92 93 63 std::string nick_; 94 64 std::string synchronize_nick_; … … 96 66 bool server_initialized_; 97 67 bool client_initialized_; 98 99 std::string humanHudTemplate_;100 OverlayGroup* humanHud_;101 std::string gametypeHudTemplate_;102 OverlayGroup* gametypeHud_;103 68 }; 104 69 } -
code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.cc
r2907 r2908 110 110 void PlayerInfo::createController() 111 111 { 112 if (this->controller_)113 {114 delete this->controller_;115 this->controller_ = 0;116 }117 112 this->controller_ = this->defaultController_.fabricate(this); 118 113 assert(this->controller_); … … 146 141 if (this->controller_) 147 142 this->controller_->setControllableEntity(entity); 148 149 this->changedControllableEntity();150 143 } 151 144 … … 162 155 if (callback) 163 156 entity->removePlayer(); 164 165 this->changedControllableEntity();166 157 } 167 158 } -
code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.h
r2907 r2908 49 49 virtual void changedGametype(); 50 50 51 virtual void changedController() {}52 virtual void changedControllableEntity() {}53 54 51 inline bool isHumanPlayer() const 55 52 { return this->bHumanPlayer_; } … … 76 73 inline Controller* getController() const 77 74 { return this->controller_; } 75 virtual void changedController() {} 78 76 79 77 protected: -
code/branches/questsystem5/src/orxonox/objects/items/MultiStateEngine.cc
r2907 r2908 30 30 #include "MultiStateEngine.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" … … 123 123 } 124 124 125 if ( GameMode::isMaster())125 if (Core::isMaster()) 126 126 { 127 127 for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it) -
code/branches/questsystem5/src/orxonox/objects/pickup/PickupSpawner.cc
r2907 r2908 89 89 ExecutorMember<BaseObject>* executor = createExecutor(createFunctor(&BaseObject::setActive)); 90 90 executor->setDefaultValues(true); 91 RespawnTimer_.setTimer(this->respawntimer_, false, this, executor);91 RespawnTimer_.setTimer(this->respawntimer_, false, (BaseObject*)this, executor); 92 92 COUT(0) << "TIMER SET" << std::endl; 93 93 } -
code/branches/questsystem5/src/orxonox/objects/pickup/Usable.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/AddQuest.cc
- Property svn:mergeinfo changed
r2907 r2908 42 42 #include "orxonox/objects/infos/PlayerInfo.h" 43 43 #include "QuestManager.h" 44 #include "QuestDescription.h" 44 #include "QuestDescription.h"; 45 45 #include "Quest.h" 46 46 -
code/branches/questsystem5/src/orxonox/objects/quest/AddQuest.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/AddQuestHint.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/AddQuestHint.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/AddReward.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/AddReward.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/ChangeQuestStatus.cc
-
code/branches/questsystem5/src/orxonox/objects/quest/ChangeQuestStatus.h
-
code/branches/questsystem5/src/orxonox/objects/quest/CompleteQuest.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/CompleteQuest.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/FailQuest.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/FailQuest.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/GlobalQuest.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/GlobalQuest.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/LocalQuest.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/LocalQuest.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/Quest.cc
- Property svn:mergeinfo changed
/code/branches/gui/src/orxonox/objects/quest/Quest.cc removed /code/branches/miniprojects/src/orxonox/objects/quest/Quest.cc removed /code/branches/weaponsystem/src/orxonox/objects/quest/Quest.cc removed
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/Quest.h
- Property svn:mergeinfo changed
/code/branches/gui/src/orxonox/objects/quest/Quest.h removed /code/branches/miniprojects/src/orxonox/objects/quest/Quest.h removed /code/branches/weaponsystem/src/orxonox/objects/quest/Quest.h removed
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestDescription.cc
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestDescription.h
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestEffect.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestEffect.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestHint.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestHint.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestItem.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestItem.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestManager.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/QuestManager.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/Rewardable.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/quest/Rewardable.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/weaponSystem/Munition.cc
r2907 r2908 105 105 void Munition::fillBullets() 106 106 { 107 //COUT(0) << "Munition::fillBullets maxBullets_=" << this->maxBullets_ << std::endl; 107 108 this->bullets_ = this->maxBullets_; 108 109 } -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.cc
r2907 r2908 42 42 { 43 43 RegisterObject(Weapon); 44 45 44 this->bulletReadyToShoot_ = true; 46 45 this->magazineReadyToShoot_ = true; 47 46 this->parentWeaponSystem_ = 0; 48 47 this->attachedToWeaponSlot_ = 0; 48 this->munition_ = 0; 49 49 this->bulletLoadingTime_ = 0; 50 50 this->magazineLoadingTime_ = 0; 51 51 this->bReloading_ = false; 52 this->bulletAmount_= 0; 53 this->magazineAmount_ = 0; 54 this->munition_ = 0; 55 this->unlimitedMunition_ = false; 52 56 53 this->setObjectMode(0x0); 57 54 } … … 68 65 XMLPortParam(Weapon, "bulletLoadingTime", setBulletLoadingTime, getBulletLoadingTime, xmlelement, mode); 69 66 XMLPortParam(Weapon, "magazineLoadingTime", setMagazineLoadingTime, getMagazineLoadingTime, xmlelement, mode); 70 XMLPortParam(Weapon, "bullets", setBulletAmount, getBulletAmount, xmlelement, mode);71 XMLPortParam(Weapon, "magazines", setMagazineAmount, getMagazineAmount, xmlelement, mode);72 XMLPortParam(Weapon, "unlimitedMunition", setUnlimitedMunition, getUnlimitedMunition, xmlelement, mode);73 67 } 74 68 … … 79 73 } 80 74 81 void Weapon::setMunition()82 {83 this->munition_->setMaxBullets(this->bulletAmount_);84 this->munition_->setMaxMagazines(this->magazineAmount_);85 }86 75 87 76 void Weapon::fire() 88 77 { 78 //COUT(0) << "LaserGun::fire, this=" << this << std::endl; 89 79 if ( this->bulletReadyToShoot_ && this->magazineReadyToShoot_ && !this->bReloading_) 90 80 { 81 //COUT(0) << "LaserGun::fire - ready to shoot" << std::endl; 82 //COUT(0) << "LaserGun::fire - bullets" << this->munition_->bullets() << std::endl; 91 83 this->bulletReadyToShoot_ = false; 92 if ( this-> unlimitedMunition_== true)84 if ( this->munition_->bullets() > 0) 93 85 { 94 86 //shoot 95 this-> reloadBullet();87 this->takeBullets(); 96 88 this->createProjectile(); 89 } 90 //if there are no bullets, but magazines 91 else if ( this->munition_->magazines() > 0 && this->munition_->bullets() == 0 ) 92 { 93 //COUT(0) << "LaserGun::fire - no bullets" << std::endl; 94 this->takeMagazines(); 97 95 } 98 96 else 99 97 { 100 if ( this->munition_->bullets() > 0) 101 { 102 //shoot and reload 103 this->takeBullets(); 104 this->reloadBullet(); 105 this->createProjectile(); 106 } 107 //if there are no bullets, but magazines 108 else if ( this->munition_->magazines() > 0 && this->munition_->bullets() == 0 ) 109 { 110 //reload magazine 111 this->takeMagazines(); 112 this->reloadMagazine(); 113 } 114 else 115 { 116 //no magazines 117 } 98 //COUT(0) << "LaserGun::fire - no magazines" << std::endl; 99 //actions 118 100 } 119 101 } 120 102 else 121 103 { 122 //weapon not reloaded 104 //COUT(0) << "LaserGun::fire - weapon not reloaded - bullets remaining:" << this->munition_->bullets() << std::endl; 105 //actions 123 106 } 124 107 … … 126 109 127 110 128 //weapon reloading129 111 void Weapon::bulletTimer(float bulletLoadingTime) 130 112 { 113 //COUT(0) << "Weapon::bulletTimer started" << std::endl; 131 114 this->bReloading_ = true; 132 115 this->bulletReloadTimer_.setTimer( bulletLoadingTime , false , this , createExecutor(createFunctor(&Weapon::bulletReloaded))); … … 134 117 void Weapon::magazineTimer(float magazineLoadingTime) 135 118 { 119 //COUT(0) << "Weapon::magazineTimer started" << std::endl; 136 120 this->bReloading_ = true; 137 121 this->magazineReloadTimer_.setTimer( magazineLoadingTime , false , this , createExecutor(createFunctor(&Weapon::magazineReloaded))); … … 148 132 this->bReloading_ = false; 149 133 this->munition_->fillBullets(); 134 this->magazineReadyToShoot_ = true; 135 this->bulletReadyToShoot_ = true; 150 136 } 151 152 137 153 138 154 139 void Weapon::attachNeededMunition(std::string munitionName) 155 140 { 156 /* if munition type already exists attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem 157 */141 //COUT(0) << "Weapon::attachNeededMunition, parentWeaponSystem=" << this->parentWeaponSystem_ << std::endl; 142 //if munition type already exists attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem 158 143 if (this->parentWeaponSystem_) 159 144 { 160 //getMunitionType returns 0 if there is no such munitionType 145 //COUT(0) << "Weapon::attachNeededMunition " << munitionName << std::endl; 161 146 Munition* munition = this->parentWeaponSystem_->getMunitionType(munitionName); 162 147 if ( munition ) 163 {164 148 this->munition_ = munition; 165 this->setMunition();166 }167 149 else 168 150 { 169 //create new munition with identifier because there is no such munitionType 151 //create new munition with identifier 152 //COUT(0) << "Weapon::attachNeededMunition, create new Munition of Type " << munitionName << std::endl; 170 153 this->munitionIdentifier_ = ClassByString(munitionName); 171 154 this->munition_ = this->munitionIdentifier_.fabricate(this); 172 155 this->parentWeaponSystem_->setNewMunition(munitionName, this->munition_); 173 this->setMunition();174 156 } 175 157 } … … 177 159 178 160 179 Munition * Weapon::getAttachedMunition(std::string munitionType) 180 { 181 this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionType); 182 return this->munition_; 183 } 161 /*get and set functions 162 * 163 */ 184 164 185 186 //these function are defined in the weapon classes187 void Weapon::takeBullets() { };188 void Weapon::createProjectile() { };189 void Weapon::takeMagazines() { };190 void Weapon::reloadBullet() { };191 void Weapon::reloadMagazine() { };192 193 194 //get and set functions for XMLPort195 165 void Weapon::setMunitionType(std::string munitionType) 196 166 { this->munitionType_ = munitionType; } … … 211 181 { return this->magazineLoadingTime_; } 212 182 213 void Weapon::setBulletAmount(unsigned int amount)214 { this->bulletAmount_ = amount; }215 183 216 const unsigned int Weapon::getBulletAmount() 217 { return this->bulletAmount_; } 184 Munition * Weapon::getAttachedMunition(std::string munitionType) 185 { 186 //COUT(0) << "Weapon::getAttachedMunition, parentWeaponSystem_="<< this->parentWeaponSystem_ << std::endl; 187 this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionType); 188 //COUT(0) << "Weapon::getAttachedMunition, munition_="<< this->munition_ << std::endl; 189 return this->munition_; 190 } 218 191 219 void Weapon::setMagazineAmount(unsigned int amount) 220 { this->magazineAmount_ = amount; } 221 222 const unsigned int Weapon::getMagazineAmount() 223 { return this->magazineAmount_; } 224 225 void Weapon::setUnlimitedMunition(bool unlimitedMunition) 226 { this->unlimitedMunition_ = unlimitedMunition; } 227 228 const bool Weapon::getUnlimitedMunition() 229 { return this->unlimitedMunition_; } 192 void Weapon::takeBullets() { }; 193 void Weapon::createProjectile() { }; 194 void Weapon::takeMagazines() { }; 230 195 231 196 } -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.h
r2907 r2908 62 62 void magazineReloaded(); 63 63 64 //XMLPort functions65 64 virtual void setMunitionType(std::string munitionType); 66 65 virtual const std::string getMunitionType(); … … 69 68 virtual void setMagazineLoadingTime(float loadingTime); 70 69 virtual const float getMagazineLoadingTime(); 71 virtual void setBulletAmount(unsigned int amount);72 virtual const unsigned int getBulletAmount();73 virtual void setMagazineAmount(unsigned int amount);74 virtual const unsigned int getMagazineAmount();75 virtual void setUnlimitedMunition(bool unlimitedMunition);76 virtual const bool getUnlimitedMunition();77 70 78 //weapon actions79 71 virtual void takeBullets(); 80 72 virtual void takeMagazines(); 81 73 virtual void createProjectile(); 82 virtual void reloadBullet();83 virtual void reloadMagazine();84 74 85 //manually set or reset86 virtual void setWeapon();87 virtual void setMunition();88 89 75 inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem) 90 76 { this->parentWeaponSystem_=parentWeaponSystem; }; … … 97 83 { return this->attachedToWeaponSlot_; } 98 84 85 virtual void setWeapon(); 99 86 100 87 private: … … 104 91 bool bulletReadyToShoot_; 105 92 bool magazineReadyToShoot_; 106 bool unlimitedMunition_;107 93 float bulletLoadingTime_; 108 94 float magazineLoadingTime_; 109 unsigned int bulletAmount_;110 unsigned int magazineAmount_;111 95 std::string munitionType_; 112 96 -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.cc
r2907 r2908 63 63 for (int i=0; i < (int) this->weapons_.size(); i++) 64 64 { 65 //COUT(0) << "WeaponPack::fire (attached from WeaponSet) from Weapon: "<< i << std::endl; 65 66 this->weapons_[i]->getAttachedToWeaponSlot()->fire(); 66 67 } … … 82 83 void WeaponPack::setFireMode(unsigned int firemode) 83 84 { 85 //COUT(0) << "WeaponPack::setFireMode " << std::endl; 84 86 this->firemode_ = firemode; 85 87 } … … 92 94 void WeaponPack::addWeapon(Weapon * weapon) 93 95 { 96 //COUT(0) << "WeaponPack::addWeapon:" << weapon << " munition " << weapon->getMunitionType() << std::endl; 94 97 this->weapons_.push_back(weapon); 95 98 } … … 114 117 { 115 118 this->weapons_[i]->attachNeededMunition(weapons_[i]->getMunitionType()); 119 //hack! 116 120 this->weapons_[i]->setWeapon(); 117 121 } -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.h
r2907 r2908 59 59 const Weapon * getWeapon(unsigned int index); 60 60 61 //functions with effect to all weapons of the weaponPack62 61 //functions needed for creating Pointer to the right objects (-->Pawn.cc) 63 62 void setParentWeaponSystemToAllWeapons(WeaponSystem * weaponSystem); -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSet.cc
r2907 r2908 56 56 void WeaponSet::attachWeaponPack(WeaponPack *wPack) 57 57 { 58 //COUT(0) << "WeaponSet::attachWeaponPack" << std::endl; 59 //COUT(0) << "........ parentWeaponSystem_=" << this->parentWeaponSystem_ << std::endl; 60 //COUT(0) << "........ this->parentWeaponSystem_->getWeaponSlotSize()" << this->parentWeaponSystem_->getWeaponSlotSize() << std::endl; 61 //COUT(0) << "........ wPack->getSize()" << wPack->getSize() << std::endl; 58 62 if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) ) 59 63 { 64 //COUT(0) << "WeaponSet::attachWeaponPack after if" << std::endl; 60 65 this->attachedWeaponPack_ = wPack; 61 66 int wPackWeapon = 0; //WeaponCounter for Attaching 62 63 67 //should be possible to choose which slot to use 64 //attach every weapon of the weaponPack to a weaponSlot65 68 for ( int i=0; i < wPack->getSize() ; i++ ) 66 69 { 67 70 //at the moment this function only works for one weaponPack in the entire WeaponSystem... 68 //it also takes the first free weaponSlot...69 71 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full 70 72 { 73 //COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl; 71 74 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) ); 72 75 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); … … 80 83 if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 ) 81 84 { 85 //COUT(0) << "WeaponSet::attachWeaponPack mode 2 k="<< k << std::endl; 82 86 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) ); 83 87 this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); … … 95 99 { 96 100 //fires all WeaponSlots available for this weaponSet attached from the WeaponPack 101 //COUT(0) << "WeaponSet::fire from Pack: " << this->attachedWeaponPack_ << std::endl; 97 102 if (this->attachedWeaponPack_) 98 103 this->attachedWeaponPack_->fire(); -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.cc
- Property svn:mergeinfo changed
r2907 r2908 38 38 39 39 40 /* WeaponSystem 40 /* WEAPONSYSTEM 41 * creates the WeaponSystem and the ability to use weapons and munition 42 * loads the weapon the whole weaponSystem setting from an xml file 41 43 * 42 * www.orxonox.net/wiki/WeaponSystem43 44 */ 44 45 … … 51 52 RegisterObject(WeaponSystem); 52 53 54 this->activeWeaponSet_ = 0; 53 55 this->parentPawn_ = 0; 54 56 } … … 82 84 } 83 85 84 85 //returns the Pointer to the munitionType, if this munitionType doesn't exist returns 0, see Weapon::attachNeededMunition 86 //returns the Pointer to the munitionType 86 87 Munition * WeaponSystem::getMunitionType(std::string munitionType) 87 88 { 89 //COUT(0) << "WeaponSystem::getMunitionType " << munitionType << std::endl; 88 90 std::map<std::string, Munition *>::const_iterator it = this->munitionSet_.find(munitionType); 89 91 if (it != this->munitionSet_.end()) … … 94 96 95 97 98 /* 99 //the first weaponSet is at n=0 100 void WeaponSystem::setActiveWeaponSet(unsigned int n) 101 { 102 if (n < this->weaponSets_.size()) 103 this->activeWeaponSet_ = this->weaponSets_[n]; 104 else 105 this->activeWeaponSet_ = this->weaponSets_[0]; 106 } 107 */ 108 109 96 110 //n is the n'th weaponSet, starting with zero 97 //SpaceShip.cc only needs to have the keybinding to a specific Set-number n (=firemode) 98 //in future this could be well defined and not only for 3 different WeaponModes 111 //SpaceShip.cc only needs to have the keybinding to a specific Set-number n 99 112 void WeaponSystem::fire(WeaponMode::Enum n) 100 113 { … … 112 125 break; 113 126 } 127 //COUT(0) << "WeaponSystem::fire" << std::endl; 114 128 if (set < (int)this->weaponSets_.size()) 129 //COUT(0) << "WeaponSystem::fire - after if" << std::endl; 115 130 this->weaponSets_[set]->fire(); 116 131 } -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.h
- Property svn:mergeinfo changed
r2907 r2908 53 53 //void fire(); 54 54 void fire(WeaponMode::Enum fireMode); 55 //void setActiveWeaponSet(unsigned int n); 55 56 void attachWeaponPack(WeaponPack * wPack, unsigned int firemode); 56 57 WeaponSet * getWeaponSetPointer(unsigned int n); … … 58 59 WeaponPack * getWeaponPackPointer(unsigned int n); 59 60 void setNewMunition(std::string munitionType, Munition * munitionToAdd); 60 void setNewSharedMunition(std::string munitionType, Munition * munitionToAdd);61 61 Munition * getMunitionType(std::string munitionType); 62 62 … … 74 74 std::vector<WeaponPack *> weaponPacks_; 75 75 std::map<std::string, Munition *> munitionSet_; 76 WeaponSet *activeWeaponSet_; 76 77 Pawn *parentPawn_; 77 78 }; -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt
r2907 r2908 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 2 LaserGunMunition.cc 3 FusionMunition.cc4 3 ) -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc
r2907 r2908 43 43 RegisterObject(LaserGunMunition); 44 44 45 //default if not defined in XML46 45 this->maxBullets_ = 40; 47 46 this->maxMagazines_ = 100; -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
r2907 r2908 32 32 #include <OgreBillboardSet.h> 33 33 34 #include "core/ GameMode.h"34 #include "core/Core.h" 35 35 #include "core/CoreIncludes.h" 36 36 #include "objects/Scene.h" … … 44 44 RegisterObject(BillboardProjectile); 45 45 46 if ( GameMode::showsGraphics())46 if (Core::showsGraphics()) 47 47 { 48 48 assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity … … 56 56 BillboardProjectile::~BillboardProjectile() 57 57 { 58 if (this->isInitialized() && GameMode::showsGraphics() && this->billboard_.getBillboardSet())58 if (this->isInitialized() && Core::showsGraphics() && this->billboard_.getBillboardSet()) 59 59 this->detachOgreObject(this->billboard_.getBillboardSet()); 60 60 } -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
r2907 r2908 33 33 #include <OgreParticleEmitter.h> 34 34 35 #include "core/ GameMode.h"35 #include "core/Core.h" 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/ConfigValueIncludes.h" … … 46 46 RegisterObject(ParticleProjectile); 47 47 48 if ( GameMode::showsGraphics())48 if (Core::showsGraphics()) 49 49 { 50 50 this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal); -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
r2907 r2908 41 41 #include "objects/worldentities/ParticleSpawner.h" 42 42 #include "objects/collisionshapes/SphereCollisionShape.h" 43 #include "core/ GameMode.h"43 #include "core/Core.h" 44 44 45 45 namespace orxonox … … 55 55 // Get notification about collisions 56 56 57 if ( GameMode::isMaster())57 if (Core::isMaster()) 58 58 { 59 59 this->enableCollisionCallback(); … … 93 93 void Projectile::destroyObject() 94 94 { 95 if ( GameMode::isMaster())95 if (Core::isMaster()) 96 96 delete this; 97 97 } … … 99 99 bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 100 100 { 101 if (!this->bDestroy_ && GameMode::isMaster())101 if (!this->bDestroy_ && Core::isMaster()) 102 102 { 103 103 this->bDestroy_ = true; -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2907 r2908 53 53 } 54 54 55 void LaserGun::reloadBullet()56 {57 this->bulletTimer(this->bulletLoadingTime_);58 }59 60 void LaserGun::reloadMagazine()61 {62 this->magazineTimer(this->magazineLoadingTime_);63 }64 65 55 void LaserGun::takeBullets() 66 56 { 57 //COUT(0) << "LaserGun::takeBullets" << std::endl; 67 58 this->munition_->removeBullets(1); 59 this->bulletTimer(this->bulletLoadingTime_); 68 60 } 69 61 … … 71 63 { 72 64 this->munition_->removeMagazines(1); 65 this->magazineTimer(this->magazineLoadingTime_); 73 66 } 74 67 75 68 void LaserGun::createProjectile() 76 69 { 70 //COUT(0) << "LaserGun::createProjectile" << std::endl; 77 71 BillboardProjectile* projectile = new ParticleProjectile(this); 78 72 projectile->setOrientation(this->getWorldOrientation()); -
code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
r2907 r2908 51 51 virtual void takeMagazines(); 52 52 virtual void createProjectile(); 53 virtual void reloadBullet();54 virtual void reloadMagazine();55 53 56 54 private: -
code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.cc
- Property svn:mergeinfo changed
r2907 r2908 33 33 #include <OgreSceneManager.h> 34 34 35 #include "core/ GameMode.h"35 #include "core/Core.h" 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/Executor.h" … … 58 58 this->tickcount_ = 0; 59 59 60 if ( GameMode::showsGraphics())60 if (Core::showsGraphics()) 61 61 { 62 62 if (!this->getScene()) -
code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.h
- Property svn:mergeinfo changed
r2907 r2908 32 32 #include "OrxonoxPrereqs.h" 33 33 #include "FadingBillboard.h" 34 #include " tools/TimeFactorListener.h"34 #include "gamestates/GSRoot.h" 35 35 36 36 namespace orxonox -
code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.cc
r2907 r2908 34 34 #include "core/CoreIncludes.h" 35 35 #include "core/XMLPort.h" 36 #include "core/ GameMode.h"36 #include "core/Core.h" 37 37 #include "objects/Scene.h" 38 38 … … 81 81 if (!this->billboard_.getBillboardSet()) 82 82 { 83 if (this->getScene() && GameMode::showsGraphics())83 if (this->getScene() && Core::showsGraphics()) 84 84 { 85 85 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); … … 98 98 { 99 99 /* 100 if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))100 if (this->getScene() && Core::showsGraphics() && (this->material_ != "")) 101 101 { 102 102 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); -
code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.h
r2907 r2908 34 34 #include "util/Math.h" 35 35 #include "tools/BillboardSet.h" 36 #include "objects/Teamcolourable.h"37 36 38 37 namespace orxonox 39 38 { 40 class _OrxonoxExport Billboard : public StaticEntity , public Teamcolourable39 class _OrxonoxExport Billboard : public StaticEntity 41 40 { 42 41 public: … … 62 61 { return this->colour_; } 63 62 64 virtual void setTeamColour(const ColourValue& colour)65 { this->setColour(colour); }66 67 63 protected: 68 64 inline BillboardSet& getBillboardSet() -
code/branches/questsystem5/src/orxonox/objects/worldentities/BlinkingBillboard.cc
r2907 r2908 30 30 #include "BlinkingBillboard.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" … … 77 77 SUPER(BlinkingBillboard, tick, dt); 78 78 79 if ( GameMode::isMaster() && this->isActive())79 if (Core::isMaster() && this->isActive()) 80 80 { 81 81 this->time_ += dt; -
code/branches/questsystem5/src/orxonox/objects/worldentities/CMakeLists.txt
r2907 r2908 19 19 Planet.cc 20 20 SpawnPoint.cc 21 TeamSpawnPoint.cc22 PongCenterpoint.cc23 PongBall.cc24 PongBat.cc25 21 ) 26 22 -
code/branches/questsystem5/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.cc
r2907 r2908 44 44 this->bDrag_ = false; 45 45 this->bAllowMouseLook_ = false; 46 this->bAbsolute_ = false;47 46 48 47 this->setObjectMode(0x0); … … 59 58 XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false); 60 59 XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false); 61 XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);62 60 } 63 61 -
code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.h
r2907 r2908 54 54 { return this->bAllowMouseLook_; } 55 55 56 inline void setIsAbsolute(bool bAbsolute)57 { this->bAbsolute_ = bAbsolute; }58 inline bool getIsAbsolute() const59 { return this->bAbsolute_; }60 61 56 void attachCamera(Camera* camera); 62 57 … … 64 59 bool bDrag_; 65 60 bool bAllowMouseLook_; 66 bool bAbsolute_;67 61 }; 68 62 } -
code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.cc
r2907 r2908 34 34 #include "core/CoreIncludes.h" 35 35 #include "core/ConfigValueIncludes.h" 36 #include "core/ GameMode.h"36 #include "core/Core.h" 37 37 #include "core/XMLPort.h" 38 38 #include "core/Template.h" … … 144 144 void ControllableEntity::addCameraPosition(CameraPosition* position) 145 145 { 146 if (!position->getIsAbsolute()) 147 { 148 if (position->getAllowMouseLook()) 149 position->attachToNode(this->cameraPositionRootNode_); 150 else 151 this->attach(position); 152 } 146 if (position->getAllowMouseLook()) 147 position->attachToNode(this->cameraPositionRootNode_); 153 148 else 154 { 155 WorldEntity* parent = this->getParent(); 156 if (parent) 157 parent->attach(position); 158 } 149 this->attach(position); 159 150 this->cameraPositions_.push_back(position); 160 151 } … … 245 236 this->startLocalHumanControl(); 246 237 247 if (! GameMode::isMaster())238 if (!Core::isMaster()) 248 239 { 249 240 this->client_overwrite_ = this->server_overwrite_; … … 251 242 } 252 243 } 253 254 this->changedPlayer();255 244 } 256 245 … … 265 254 this->bHasHumanController_ = false; 266 255 this->setObjectMode(objectDirection::toclient); 267 268 this->changedPlayer();269 256 270 257 if (this->bDestroyWhenPlayerLeft_) … … 335 322 } 336 323 337 void ControllableEntity::parentChanged()338 {339 WorldEntity::parentChanged();340 341 WorldEntity* parent = this->getParent();342 if (parent)343 {344 for (std::list<CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)345 if ((*it)->getIsAbsolute())346 parent->attach((*it));347 }348 }349 350 324 void ControllableEntity::tick(float dt) 351 325 { … … 357 331 if (!this->isDynamic()) 358 332 { 359 if ( GameMode::isMaster())333 if (Core::isMaster()) 360 334 { 361 335 this->server_position_ = this->getPosition(); … … 472 446 void ControllableEntity::setPosition(const Vector3& position) 473 447 { 474 if ( GameMode::isMaster())448 if (Core::isMaster()) 475 449 { 476 450 MobileEntity::setPosition(position); … … 487 461 void ControllableEntity::setOrientation(const Quaternion& orientation) 488 462 { 489 if ( GameMode::isMaster())463 if (Core::isMaster()) 490 464 { 491 465 MobileEntity::setOrientation(orientation); … … 502 476 void ControllableEntity::setVelocity(const Vector3& velocity) 503 477 { 504 if ( GameMode::isMaster())478 if (Core::isMaster()) 505 479 { 506 480 MobileEntity::setVelocity(velocity); … … 517 491 void ControllableEntity::setAngularVelocity(const Vector3& velocity) 518 492 { 519 if ( GameMode::isMaster())493 if (Core::isMaster()) 520 494 { 521 495 MobileEntity::setAngularVelocity(velocity); … … 533 507 { 534 508 MobileEntity::setWorldTransform(worldTrans); 535 if ( GameMode::isMaster())509 if (Core::isMaster()) 536 510 { 537 511 this->server_position_ = this->getPosition(); -
code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.h
r2907 r2908 49 49 50 50 virtual void changedGametype(); 51 virtual void changedPlayer() {}52 51 53 52 virtual void setPlayer(PlayerInfo* player); … … 137 136 virtual void startLocalHumanControl(); 138 137 virtual void stopLocalHumanControl(); 139 virtual void parentChanged();140 138 141 139 inline void setHudTemplate(const std::string& name) -
code/branches/questsystem5/src/orxonox/objects/worldentities/ExplosionChunk.cc
r2907 r2908 32 32 #include <OgreParticleSystem.h> 33 33 34 #include "core/ GameMode.h"34 #include "core/Core.h" 35 35 #include "core/CoreIncludes.h" 36 36 #include "core/Executor.h" … … 47 47 RegisterObject(ExplosionChunk); 48 48 49 if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )49 if ( Core::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) ) 50 50 ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given."); 51 51 … … 53 53 this->LOD_ = LODParticle::normal; 54 54 55 if ( GameMode::showsGraphics() )55 if ( Core::showsGraphics() ) 56 56 { 57 57 try … … 75 75 } 76 76 77 if ( GameMode::isMaster())77 if (Core::isMaster()) 78 78 { 79 79 Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)); … … 132 132 this->smoke_->setEnabled(false); 133 133 134 if ( GameMode::isMaster())134 if (Core::isMaster()) 135 135 { 136 136 this->bStop_ = true; … … 148 148 static const unsigned int CHANGES_PER_SECOND = 5; 149 149 150 if ( GameMode::isMaster() && rnd() < dt*CHANGES_PER_SECOND)150 if (Core::isMaster() && rnd() < dt*CHANGES_PER_SECOND) 151 151 { 152 152 float length = this->getVelocity().length(); -
code/branches/questsystem5/src/orxonox/objects/worldentities/Light.cc
r2907 r2908 37 37 #include "util/String.h" 38 38 #include "util/Exception.h" 39 #include "core/ GameMode.h"39 #include "core/Core.h" 40 40 #include "core/CoreIncludes.h" 41 41 #include "core/XMLPort.h" … … 57 57 this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f); 58 58 59 if ( GameMode::showsGraphics())59 if (Core::showsGraphics()) 60 60 { 61 61 if (!this->getScene()) -
code/branches/questsystem5/src/orxonox/objects/worldentities/Light.h
r2907 r2908 37 37 38 38 #include "util/Math.h" 39 #include "objects/Teamcolourable.h"40 39 41 40 namespace orxonox 42 41 { 43 class _OrxonoxExport Light : public StaticEntity , public Teamcolourable42 class _OrxonoxExport Light : public StaticEntity 44 43 { 45 44 public: … … 69 68 inline const ColourValue& getSpecularColour() const 70 69 { return this->specular_; } 71 72 virtual void setTeamColour(const ColourValue& colour)73 { this->setDiffuseColour(colour); this->setSpecularColour(colour); }74 70 75 71 /** -
code/branches/questsystem5/src/orxonox/objects/worldentities/MobileEntity.cc
- Property svn:mergeinfo changed
r2907 r2908 182 182 // We use a dynamic body. So we translate our node accordingly. 183 183 this->node_->setPosition(Vector3(worldTrans.getOrigin().x(), worldTrans.getOrigin().y(), worldTrans.getOrigin().z())); 184 btQuaternion temp(worldTrans.getRotation()); 185 this->node_->setOrientation(Quaternion(temp.w(), temp.x(), temp.y(), temp.z())); 184 this->node_->setOrientation(Quaternion(worldTrans.getRotation().w(), worldTrans.getRotation().x(), worldTrans.getRotation().y(), worldTrans.getRotation().z())); 186 185 this->linearVelocity_.x = this->physicalBody_->getLinearVelocity().x(); 187 186 this->linearVelocity_.y = this->physicalBody_->getLinearVelocity().y(); -
code/branches/questsystem5/src/orxonox/objects/worldentities/MobileEntity.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/worldentities/Model.cc
r2907 r2908 31 31 #include <OgreEntity.h> 32 32 #include "Model.h" 33 #include "core/GameMode.h"34 33 #include "core/CoreIncludes.h" 35 34 #include "core/XMLPort.h" … … 71 70 void Model::changedMesh() 72 71 { 73 if ( GameMode::showsGraphics())72 if (Core::showsGraphics()) 74 73 { 75 74 if (this->mesh_.getEntity()) -
code/branches/questsystem5/src/orxonox/objects/worldentities/MovableEntity.cc
r2907 r2908 34 34 #include "core/XMLPort.h" 35 35 #include "core/Executor.h" 36 #include "core/ GameMode.h"36 #include "core/Core.h" 37 37 38 38 namespace orxonox … … 89 89 void MovableEntity::resynchronize() 90 90 { 91 if ( GameMode::isMaster() && !this->continuousResynchroTimer_)91 if (Core::isMaster() && !this->continuousResynchroTimer_) 92 92 { 93 93 // Resynchronise every few seconds because we only work with velocities (no positions) -
code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleEmitter.cc
r2907 r2908 39 39 #include "tools/ParticleInterface.h" 40 40 #include "util/Exception.h" 41 #include "core/GameMode.h"42 41 #include "core/CoreIncludes.h" 43 42 #include "core/XMLPort.h" … … 52 51 RegisterObject(ParticleEmitter); 53 52 54 if ( GameMode::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))53 if (Core::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager())) 55 54 ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given."); 56 55 … … 108 107 } 109 108 110 if ( GameMode::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())109 if (Core::showsGraphics() && this->getScene() && this->getScene()->getSceneManager()) 111 110 { 112 111 try -
code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleSpawner.cc
-
code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleSpawner.h
-
code/branches/questsystem5/src/orxonox/objects/worldentities/Planet.cc
r2907 r2908 42 42 #include "CameraManager.h" 43 43 #include "Camera.h" 44 #include "Graphics Manager.h"44 #include "GraphicsEngine.h" 45 45 46 46 namespace orxonox -
code/branches/questsystem5/src/orxonox/objects/worldentities/StaticEntity.cc
-
code/branches/questsystem5/src/orxonox/objects/worldentities/StaticEntity.h
-
code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.cc
r2907 r2908 181 181 182 182 // Attach to parent if necessary 183 registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity:: networkcallback_parentChanged));183 registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::parentChanged)); 184 184 } 185 185 … … 188 188 Network function that object this instance to its correct parent. 189 189 */ 190 void WorldEntity:: networkcallback_parentChanged()190 void WorldEntity::parentChanged() 191 191 { 192 192 if (this->parentID_ != OBJECTID_UNKNOWN) … … 362 362 this->parentID_ = newParent->getObjectID(); 363 363 364 this->parentChanged();365 366 364 // apply transform to collision shape 367 365 this->collisionShape_->setPosition(this->getPosition()); 368 366 this->collisionShape_->setOrientation(this->getOrientation()); 369 367 // TODO: Scale 370 368 371 369 return true; 372 370 } … … 408 406 this->parent_ = 0; 409 407 this->parentID_ = OBJECTID_UNKNOWN; 410 411 this->parentChanged();412 408 413 409 // reset orientation of the collisionShape (cannot be set within a WE usually) … … 492 488 493 489 // Note: These functions are placed in WorldEntity.h as inline functions for the release build. 494 #ifndef NDEBUG490 #ifndef _NDEBUG 495 491 const Vector3& WorldEntity::getPosition() const 496 492 { … … 660 656 case TransformSpace::World: 661 657 ogreRelativeTo = Ogre::Node::TS_WORLD; break; 662 default: OrxAssert(false, "Faulty TransformSpace::Enum assigned.");663 658 } 664 659 this->node_->setDirection(direction, ogreRelativeTo, localDirectionVector); … … 760 755 { 761 756 case Dynamic: 762 this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & ! btCollisionObject::CF_STATIC_OBJECT & !btCollisionObject::CF_KINEMATIC_OBJECT);757 this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !(btCollisionObject::CF_STATIC_OBJECT | btCollisionObject::CF_KINEMATIC_OBJECT)); 763 758 break; 764 759 case Kinematic: -
code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.h
r2907 r2908 33 33 #include "OrxonoxPrereqs.h" 34 34 35 #ifdef NDEBUG35 #ifdef _NDEBUG 36 36 #include <OgreSceneNode.h> 37 37 #else … … 176 176 177 177 protected: 178 virtual void parentChanged() {}179 180 178 Ogre::SceneNode* node_; 181 179 … … 193 191 194 192 // network callbacks 195 void networkcallback_parentChanged();193 void parentChanged(); 196 194 inline void scaleChanged() 197 195 { this->setScale3D(this->getScale3D()); } … … 271 269 @brief 272 270 Sets how much reaction is applied in a collision. 273 271 274 272 Consider two equal spheres colliding with equal velocities: 275 273 Restitution 1 means that both spheres simply reverse their velocity (no loss of energy) … … 421 419 422 420 // Inline heavily used functions for release builds. In debug, we better avoid including OgreSceneNode here. 423 #ifdef NDEBUG421 #ifdef _NDEBUG 424 422 inline const Vector3& WorldEntity::getPosition() const 425 423 { return this->node_->getPosition(); } 426 424 inline const Quaternion& WorldEntity::getOrientation() const 427 { return this->node_->get Orientation(); }425 { return this->node_->getrOrientation(); } 428 426 inline const Vector3& WorldEntity::getScale3D(void) const 429 427 { return this->node_->getScale(); } -
code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2907 r2908 30 30 #include "Pawn.h" 31 31 32 #include "core/ GameMode.h"32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" … … 63 63 this->getPickUp().setPlayer(this); 64 64 65 if ( GameMode::isMaster())65 if (Core::isMaster()) 66 66 { 67 67 this->weaponSystem_ = new WeaponSystem(this); … … 133 133 } 134 134 135 void Pawn::setPlayer(PlayerInfo* player)136 {137 ControllableEntity::setPlayer(player);138 139 if (this->getGametype())140 this->getGametype()->playerStartsControllingPawn(player, this);141 }142 143 void Pawn::removePlayer()144 {145 if (this->getGametype())146 this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);147 148 ControllableEntity::removePlayer();149 }150 151 135 void Pawn::setHealth(float health) 152 136 { … … 156 140 void Pawn::damage(float damage, Pawn* originator) 157 141 { 158 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) 159 { 160 this->setHealth(this->health_ - damage); 161 this->lastHitOriginator_ = originator; 162 163 // play damage effect 164 } 142 this->setHealth(this->health_ - damage); 143 this->lastHitOriginator_ = originator; 144 145 // play damage effect 165 146 } 166 147 167 148 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) 168 149 { 169 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator)) 170 { 171 this->damage(damage, originator); 172 this->setVelocity(this->getVelocity() + force); 173 174 // play hit effect 175 } 150 this->damage(damage, originator); 151 this->setVelocity(this->getVelocity() + force); 152 153 // play hit effect 176 154 } 177 155 … … 198 176 void Pawn::death() 199 177 { 200 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 201 { 202 // Set bAlive_ to false and wait for PawnManager to do the destruction 203 this->bAlive_ = false; 204 205 this->setDestroyWhenPlayerLeft(false); 206 207 if (this->getGametype()) 208 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 209 210 if (this->getPlayer()) 211 this->getPlayer()->stopControl(this); 212 213 if (GameMode::isMaster()) 214 this->deatheffect(); 215 } 216 else 217 this->setHealth(1); 178 // Set bAlive_ to false and wait for PawnManager to do the destruction 179 this->bAlive_ = false; 180 181 this->setDestroyWhenPlayerLeft(false); 182 183 if (this->getGametype()) 184 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 185 186 if (this->getPlayer()) 187 this->getPlayer()->stopControl(this); 188 189 if (Core::isMaster()) 190 this->deatheffect(); 218 191 } 219 192 … … 249 222 ExplosionChunk* chunk = new ExplosionChunk(this->getCreator()); 250 223 chunk->setPosition(this->getPosition()); 224 251 225 } 252 226 } … … 260 234 { 261 235 this->setHealth(this->initialHealth_); 262 if ( GameMode::isMaster())236 if (Core::isMaster()) 263 237 this->spawneffect(); 264 238 } … … 269 243 } 270 244 271 272 /* WeaponSystem:273 * functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.274 * with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.275 * --> e.g. Pickup-Items276 */277 245 void Pawn::setWeaponSlot(WeaponSlot * wSlot) 278 246 { -
code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.h
r2907 r2908 47 47 virtual void tick(float dt); 48 48 void registerVariables(); 49 50 virtual void setPlayer(PlayerInfo* player);51 virtual void removePlayer();52 49 53 50 inline bool isAlive() const -
code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2907 r2908 34 34 #include "core/CoreIncludes.h" 35 35 #include "core/ConfigValueIncludes.h" 36 #include "core/ GameMode.h"36 #include "core/Core.h" 37 37 #include "objects/worldentities/Model.h" 38 38 #include "objects/Scene.h" … … 63 63 this->setDestroyWhenPlayerLeft(true); 64 64 65 if ( GameMode::showsGraphics())65 if (Core::showsGraphics()) 66 66 { 67 67 this->greetingFlare_ = new BillboardSet(); … … 206 206 this->bGreeting_ = !this->bGreeting_; 207 207 208 if ( GameMode::isMaster())208 if (Core::isMaster()) 209 209 { 210 210 this->bGreetingFlareVisible_ = this->bGreeting_; -
code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/Trigger.cc
- Property svn:mergeinfo changed
r2907 r2908 36 36 #include "core/ConsoleCommand.h" 37 37 #include "core/XMLPort.h" 38 #include "core/ GameMode.h"38 #include "core/Core.h" 39 39 #include "objects/Scene.h" 40 40 … … 67 67 // this->bUpdating_ = false; 68 68 69 if (this->getScene() && GameMode::showsGraphics())69 if (this->getScene() && Core::showsGraphics()) 70 70 { 71 71 this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); -
code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/Trigger.h
Note: See TracChangeset
for help on using the changeset viewer.