Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2826


Ignore:
Timestamp:
Mar 23, 2009, 12:02:49 PM (16 years ago)
Author:
landauf
Message:

merged miniprojects branch back to trunk

Location:
code/trunk
Files:
100 edited
16 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/bin/client1.bat.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/bin/client2.bat.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/bin/dedicated.bat.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/bin/run.bat.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/bin/server.bat.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/cmake/FindDirectX.cmake

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/cmake/LibraryConfigTardis.cmake

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/LuaBind.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/LuaBind.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/Template.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/Template.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/XMLFile.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/core/XMLIncludes.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/cpptcl/cpptcl.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/cpptcl/cpptcl.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/network/synchronisable/NetworkCallback.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/network/synchronisable/Synchronisable.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/network/synchronisable/Synchronisable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/CameraManager.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/CameraManager.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/OrxonoxPrereqs.h

    r2710 r2826  
    104104    class RadarListener;
    105105
     106    class Teamcolourable;
     107
    106108    class CameraManager;
    107109    class LevelManager;
     
    149151    class ParticleSpawner;
    150152
     153    class PongCenterpoint;
     154    class PongBall;
     155    class PongBat;
     156
    151157    class Camera;
    152158    class CameraPosition;
    153159    class SpawnPoint;
     160    class TeamSpawnPoint;
    154161
    155162    class Spectator;
     
    193200
    194201    class Gametype;
     202    class Deathmatch;
     203    class TeamDeathmatch;
     204    class Pong;
    195205
    196206    class Scores;
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r2759 r2826  
    4949namespace orxonox
    5050{
    51     SetCommandLineArgument(level, "presentation.oxw").shortcut("l");
     51    SetCommandLineArgument(level, "presentation_dm.oxw").shortcut("l");
    5252
    5353    GSLevel::GSLevel()
  • code/trunk/src/orxonox/objects/CMakeLists.txt

    r2710 r2826  
    88  RadarListener.cc
    99  RadarViewable.cc
     10  Teamcolourable.cc
    1011  Tickable.cc
    1112  Test.cc
  • code/trunk/src/orxonox/objects/Level.cc

    r2710 r2826  
    105105    {
    106106        Identifier* identifier = ClassByString(gametype);
    107         if (identifier && identifier->isA(Class(Gametype)))
     107
     108        if (!identifier || !identifier->isA(Class(Gametype)))
    108109        {
     110            COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;
     111            identifier = Class(Gametype);
     112            this->gametype_ = "Gametype";
     113        }
     114        else
    109115            this->gametype_ = gametype;
    110116
    111             Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
    112             this->setGametype(rootgametype);
     117std::cout << "Load Gametype: " << this->gametype_ << std::endl;
    113118
    114             for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
    115                 (*it)->setGametype(rootgametype);
     119        Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
     120        this->setGametype(rootgametype);
    116121
    117             if (LevelManager::getInstancePtr())
    118                 LevelManager::getInstance().requestActivity(this);
    119         }
     122std::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);
    120129    }
    121130
  • code/trunk/src/orxonox/objects/Level.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/collisionshapes

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/controllers/Controller.cc

    r2662 r2826  
    4343        this->player_ = 0;
    4444        this->controllableEntity_ = 0;
    45         this->hud_ = 0;
    46         this->bUpdateHUD_ = false;
    4745    }
    4846
    4947    Controller::~Controller()
    5048    {
    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         }
    8149    }
    8250}
  • code/trunk/src/orxonox/objects/controllers/Controller.h

    r2662 r2826  
    5757            inline ControllableEntity* getControllableEntity() const
    5858                { return this->controllableEntity_; }
    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_; }
     59            virtual void changedControllableEntity() {}
    7760
    7861        protected:
    79             void updateHUD();
    80 
    8162            PlayerInfo* player_;
    8263            ControllableEntity* controllableEntity_;
    83             std::string hudtemplate_;
    84             OverlayGroup* hud_;
    85             bool bUpdateHUD_;
    8664    };
    8765}
  • code/trunk/src/orxonox/objects/gametypes/CMakeLists.txt

    r2710 r2826  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    22  Gametype.cc
     3  Deathmatch.cc
     4  TeamDeathmatch.cc
     5  Pong.cc
    36)
  • code/trunk/src/orxonox/objects/gametypes/Gametype.cc

    r2710 r2826  
    4444#include "objects/worldentities/Camera.h"
    4545
    46 #include "network/Host.h"
    47 
    4846namespace orxonox
    4947{
     
    6563
    6664        this->setConfigValues();
    67 
    68         this->addBots(this->numberOfBots_);
    6965
    7066        // load the corresponding score board
     
    105101    void Gametype::start()
    106102    {
    107         COUT(0) << "game started" << std::endl;
     103        this->addBots(this->numberOfBots_);
     104
    108105        this->gtinfo_.bStarted_ = true;
    109106
     
    113110    void Gametype::end()
    114111    {
    115         COUT(0) << "game ended" << std::endl;
    116112        this->gtinfo_.bEnded_ = true;
    117113    }
     
    120116    {
    121117        this->players_[player].state_ = PlayerState::Joined;
    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)
     118    }
     119
     120    bool Gametype::playerLeft(PlayerInfo* player)
    129121    {
    130122        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
     
    132124        {
    133125            this->players_.erase(it);
    134 
    135             std::string message = player->getName() + " left the game";
    136             COUT(0) << message << std::endl;
    137             Host::Broadcast(message);
    138         }
     126            return true;
     127        }
     128        return false;
    139129    }
    140130
     
    147137    }
    148138
    149     void Gametype::playerChangedName(PlayerInfo* player)
     139    bool Gametype::playerChangedName(PlayerInfo* player)
    150140    {
    151141        if (this->players_.find(player) != this->players_.end())
     
    153143            if (player->getName() != player->getOldName())
    154144            {
    155                 std::string message = player->getOldName() + " changed name to " + player->getName();
    156                 COUT(0) << message << std::endl;
    157                 Host::Broadcast(message);
    158             }
    159         }
     145                return true;
     146            }
     147        }
     148        return false;
    160149    }
    161150
     
    168157    }
    169158
     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
    170190    void Gametype::pawnKilled(Pawn* victim, Pawn* killer)
    171191    {
    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 
    189192        if (victim && victim->getPlayer())
    190193        {
     
    197200                // Reward killer
    198201                if (killer)
    199                 {
    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;
    207                 }
     202                    this->playerScored(killer->getPlayer());
    208203
    209204                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
     
    225220    }
    226221
    227     void Gametype::playerScored(Player& player)
    228     {
    229         player.frags_++;
     222    void Gametype::playerScored(PlayerInfo* player)
     223    {
     224        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
     225        if (it != this->players_.end())
     226            it->second.frags_++;
    230227    }
    231228
     
    336333        if (spawnpoint)
    337334        {
     335            this->playerPreSpawn(player);
    338336            player->startControl(spawnpoint->spawn());
    339337            this->players_[player].state_ = PlayerState::Alive;
     338            this->playerPostSpawn(player);
    340339        }
    341340        else
  • code/trunk/src/orxonox/objects/gametypes/Gametype.h

    r2662 r2826  
    8484            virtual void end();
    8585            virtual void playerEntered(PlayerInfo* player);
    86             virtual void playerLeft(PlayerInfo* player);
     86            virtual bool playerLeft(PlayerInfo* player);
    8787            virtual void playerSwitched(PlayerInfo* player, Gametype* newgametype);
    8888            virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype);
    89             virtual void playerChangedName(PlayerInfo* player);
     89            virtual bool playerChangedName(PlayerInfo* player);
    9090
    91             virtual void playerScored(Player& player);
     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);
    9296
    9397            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
    9498            virtual void pawnPreSpawn(Pawn* pawn);
    9599            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);
    96105
    97106            inline const std::map<PlayerInfo*, Player>& getPlayers() const
     
    106115                { return this->gtinfo_.startCountdown_; }
    107116
     117            inline void setHUDTemplate(const std::string& name)
     118                { this->gtinfo_.hudtemplate_ = name; }
     119            inline const std::string& getHUDTemplate() const
     120                { return this->gtinfo_.hudtemplate_; }
     121
    108122            void addBots(unsigned int amount);
    109123            void killBots(unsigned int amount = 0);
     
    112126                { return this->players_.size(); }
    113127
    114         private:
     128        protected:
    115129            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
    116130
    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();
     131            virtual void assignDefaultPawnsIfNeeded();
     132            virtual void checkStart();
     133            virtual void spawnPlayer(PlayerInfo* player);
     134            virtual void spawnPlayersIfRequested();
     135            virtual void spawnDeadPlayersIfRequested();
    125136
    126137            GametypeInfo gtinfo_;
  • code/trunk/src/orxonox/objects/infos/GametypeInfo.cc

    r2662 r2826  
    5858        registerVariable(this->startCountdown_,         variableDirection::toclient);
    5959        registerVariable(this->bStartCountdownRunning_, variableDirection::toclient);
     60        registerVariable(this->hudtemplate_,            variableDirection::toclient);
    6061    }
    6162}
  • code/trunk/src/orxonox/objects/infos/GametypeInfo.h

    r2662 r2826  
    5656                { return this->startCountdown_; }
    5757
     58            inline const std::string& getHUDTemplate() const
     59                { return this->hudtemplate_; }
     60
    5861        private:
    5962            bool bStarted_;
     
    6164            bool bStartCountdownRunning_;
    6265            float startCountdown_;
     66            std::string hudtemplate_;
    6367    };
    6468}
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.cc

    r2662 r2826  
    5353        this->defaultController_ = Class(HumanController);
    5454
     55        this->humanHud_ = 0;
     56        this->gametypeHud_ = 0;
     57
    5558        this->setConfigValues();
    5659        this->registerVariables();
     
    5962    HumanPlayer::~HumanPlayer()
    6063    {
     64        if (this->BaseObject::isInitialized())
     65        {
     66            if (this->humanHud_)
     67                delete this->humanHud_;
     68
     69            if (this->gametypeHud_)
     70                delete this->gametypeHud_;
     71        }
    6172    }
    6273
     
    89100    void HumanPlayer::configvaluecallback_changedHUDTemplate()
    90101    {
    91         this->changedController();
     102        this->setHumanHUDTemplate(this->hudtemplate_);
    92103    }
    93104
     
    111122
    112123            this->createController();
     124            this->updateHumanHUD();
    113125        }
    114126    }
     
    146158    }
    147159
    148     void HumanPlayer::changedController()
    149     {
    150         if (this->getController())
    151         {
    152             this->getController()->setHUDTemplate(this->hudtemplate_);
    153 
    154             if (this->getController() && this->getController()->getHUD())
    155                 this->getController()->getHUD()->setOwner(this->getControllableEntity());
     160    void HumanPlayer::changedGametype()
     161    {
     162        PlayerInfo::changedGametype();
     163
     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        if (this->gametypeHud_)
     177            this->gametypeHud_->setOwner(this->getControllableEntity());
     178    }
     179
     180    void HumanPlayer::updateHumanHUD()
     181    {
     182        if (this->humanHud_)
     183        {
     184            delete this->humanHud_;
     185            this->humanHud_ = 0;
     186        }
     187
     188        if (this->isLocalPlayer() && this->humanHudTemplate_ != "")
     189        {
     190            this->humanHud_ = new OverlayGroup(this);
     191            this->humanHud_->addTemplate(this->humanHudTemplate_);
     192            this->humanHud_->setOwner(this->getControllableEntity());
     193        }
     194    }
     195
     196    void HumanPlayer::updateGametypeHUD()
     197    {
     198        if (this->gametypeHud_)
     199        {
     200            delete this->gametypeHud_;
     201            this->gametypeHud_ = 0;
     202        }
     203
     204        if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "")
     205        {
     206            this->gametypeHud_ = new OverlayGroup(this);
     207            this->gametypeHud_->addTemplate(this->gametypeHudTemplate_);
     208            this->gametypeHud_->setOwner(this->getControllableEntity());
    156209        }
    157210    }
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.h

    r2662 r2826  
    5151            void setClientID(unsigned int clientID);
    5252
    53             virtual void changedController();
     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_; }
    5481
    5582        protected:
     
    6188            void networkcallback_client_initialized();
    6289
     90            void updateHumanHUD();
     91            void updateGametypeHUD();
     92
    6393            std::string nick_;
    6494            std::string synchronize_nick_;
     
    6696            bool server_initialized_;
    6797            bool client_initialized_;
     98
     99            std::string humanHudTemplate_;
     100            OverlayGroup* humanHud_;
     101            std::string gametypeHudTemplate_;
     102            OverlayGroup* gametypeHud_;
    68103    };
    69104}
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.cc

    r2662 r2826  
    141141        if (this->controller_)
    142142            this->controller_->setControllableEntity(entity);
     143
     144        this->changedControllableEntity();
    143145    }
    144146
     
    155157            if (callback)
    156158                entity->removePlayer();
     159
     160            this->changedControllableEntity();
    157161        }
    158162    }
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.h

    r2662 r2826  
    4949            virtual void changedGametype();
    5050
     51            virtual void changedController() {}
     52            virtual void changedControllableEntity() {}
     53
    5154            inline bool isHumanPlayer() const
    5255                { return this->bHumanPlayer_; }
     
    7376            inline Controller* getController() const
    7477                { return this->controller_; }
    75             virtual void changedController() {}
    7678
    7779        protected:
  • code/trunk/src/orxonox/objects/pickup/Usable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddReward.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/AddReward.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/FailQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/FailQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/LocalQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/LocalQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/Quest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/Quest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestDescription.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestDescription.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestEffect.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestEffect.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestHint.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestHint.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestItem.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestItem.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestManager.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/QuestManager.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/Rewardable.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/quest/Rewardable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/weaponSystem/WeaponSystem.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/weaponSystem/WeaponSystem.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Backlight.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Backlight.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Billboard.h

    r2662 r2826  
    3434#include "util/Math.h"
    3535#include "tools/BillboardSet.h"
     36#include "objects/Teamcolourable.h"
    3637
    3738namespace orxonox
    3839{
    39     class _OrxonoxExport Billboard : public StaticEntity
     40    class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable
    4041    {
    4142        public:
     
    6162                { return this->colour_; }
    6263
     64            virtual void setTeamColour(const ColourValue& colour)
     65                { this->setColour(colour); }
     66
    6367        protected:
    6468            inline BillboardSet& getBillboardSet()
  • code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt

    r2710 r2826  
    1919  Planet.cc
    2020  SpawnPoint.cc
     21  TeamSpawnPoint.cc
     22  PongCenterpoint.cc
     23  PongBall.cc
     24  PongBat.cc
    2125)
    2226
  • code/trunk/src/orxonox/objects/worldentities/Camera.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Camera.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc

    r2662 r2826  
    4444        this->bDrag_ = false;
    4545        this->bAllowMouseLook_ = false;
     46        this->bAbsolute_ = false;
    4647
    4748        this->setObjectMode(0x0);
     
    5859        XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
    5960        XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
     61        XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);
    6062    }
    6163
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.h

    r2662 r2826  
    5454                { return this->bAllowMouseLook_; }
    5555
     56            inline void setIsAbsolute(bool bAbsolute)
     57                { this->bAbsolute_ = bAbsolute; }
     58            inline bool getIsAbsolute() const
     59                { return this->bAbsolute_; }
     60
    5661            void attachCamera(Camera* camera);
    5762
     
    5964            bool bDrag_;
    6065            bool bAllowMouseLook_;
     66            bool bAbsolute_;
    6167    };
    6268}
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2662 r2826  
    144144    void ControllableEntity::addCameraPosition(CameraPosition* position)
    145145    {
    146         if (position->getAllowMouseLook())
    147             position->attachToNode(this->cameraPositionRootNode_);
     146        if (!position->getIsAbsolute())
     147        {
     148            if (position->getAllowMouseLook())
     149                position->attachToNode(this->cameraPositionRootNode_);
     150            else
     151                this->attach(position);
     152        }
    148153        else
    149             this->attach(position);
     154        {
     155            WorldEntity* parent = this->getParent();
     156            if (parent)
     157                parent->attach(position);
     158        }
    150159        this->cameraPositions_.push_back(position);
    151160    }
  • code/trunk/src/orxonox/objects/worldentities/Light.h

    r2662 r2826  
    3737
    3838#include "util/Math.h"
     39#include "objects/Teamcolourable.h"
    3940
    4041namespace orxonox
    4142{
    42     class _OrxonoxExport Light : public StaticEntity
     43    class _OrxonoxExport Light : public StaticEntity, public Teamcolourable
    4344    {
    4445        public:
     
    6869            inline const ColourValue& getSpecularColour() const
    6970                { return this->specular_; }
     71
     72            virtual void setTeamColour(const ColourValue& colour)
     73                { this->setDiffuseColour(colour); this->setSpecularColour(colour); }
    7074
    7175            /**
  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.cc

  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.h

  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/StaticEntity.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/StaticEntity.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2809 r2826  
    133133    }
    134134
     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
    135151    void Pawn::setHealth(float health)
    136152    {
     
    140156    void Pawn::damage(float damage, Pawn* originator)
    141157    {
    142         this->setHealth(this->health_ - damage);
    143         this->lastHitOriginator_ = originator;
    144 
    145         // play damage effect
     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        }
    146165    }
    147166
    148167    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
    149168    {
    150         this->damage(damage, originator);
    151         this->setVelocity(this->getVelocity() + force);
    152 
    153         // play hit effect
     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        }
    154176    }
    155177
     
    176198    void Pawn::death()
    177199    {
    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();
     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 (Core::isMaster())
     214                this->deatheffect();
     215        }
     216        else
     217            this->setHealth(1);
    191218    }
    192219
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2662 r2826  
    4747            virtual void tick(float dt);
    4848            void registerVariables();
     49
     50            virtual void setPlayer(PlayerInfo* player);
     51            virtual void removePlayer();
    4952
    5053            inline bool isAlive() const
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/tolua/all-5.0.lua

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/tolua/all-5.1.lua

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/util

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/util/Exception.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/util/Exception.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/util/SignalHandler.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/util/SignalHandler.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.