Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 8:00:43 AM (15 years ago)
Author:
landauf
Message:

merged pickups2 to presentation

Location:
code/branches/presentation
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/pickup/Turbo.cc

    • Property svn:eol-style set to native
    r2498 r2500  
    88namespace orxonox
    99{
    10        
     10
    1111
    1212        CreateFactory(Turbo);
    1313
    14         Turbo::Turbo(BaseObject* creator) : Item(creator)
     14        Turbo::Turbo(BaseObject* creator) : BaseItem(creator)
    1515        {
    1616                RegisterObject(Turbo);
     
    3333        XMLPortParam(Turbo, "duration", setDuration, getDuration, xmlelement, mode);
    3434        XMLPortParam(Turbo, "accboost", setAccBoost, getAccBoost, xmlelement, mode);
    35         XMLPortParam(Turbo, "rotacc", setRotAcc, getRotAcc, xmlelement, mode);
    36        
     35        XMLPortParam(Turbo, "rotacc", setRotAcc, getRotAcc, xmlelement, mode);
    3736    }
    3837
    3938        bool Turbo::pickedUp(Pawn* player)
    4039        {
    41                
     40
    4241                if(player-> isA(this->getPlayerBaseClass()))
    4342                        {
    4443                        SpaceShip* ship = dynamic_cast <SpaceShip*>(player);
    4544                        if(duration_==0 )
    46                         {       
     45                        {
    4746                                if(addTo(player))
    48                                 {       
     47                                {
    4948                                                COUT(3)<<"ITEM EQUIPPED"<<std::endl;
    5049                                                this->setSpeedBoost(ship);
     
    6362
    6463        }
    65        
    66        
     64
     65
    6766        void Turbo::unsetSpeedBoost(SpaceShip* ship)
    6867        {
     68/*
    6969        ship->setMaxSpeed( ship->getMaxSpeed() - this->boost_);
    7070        ship->setTransAcc( ship->getTransAcc()/this->accboost_);
     
    7373        COUT(3)<<"BOOST UNSET"<<std::endl;
    7474        COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl;
     75*/
     76        ship->setPermanentBoost(false);
    7577        }
    7678
    7779        void Turbo::setSpeedBoost(SpaceShip* ship)
    7880        {
     81/*
    7982        COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl;
    8083        ship->setMaxSpeed( ship->getMaxSpeed() + this->boost_);
     
    8285        ship->setMaxRotation( ship->getMaxRotation()+this->rotacc_);
    8386        ship->setRotAcc( ship->getRotAcc()+this->rotacc_);
     87*/
     88    ship->setPermanentBoost(true);
     89    ship->setBoost(true);
     90
    8491        if( this->duration_ != 0)
    8592        {
     
    8895                turbotimer_.setTimer(this->duration_, false, this, executor);
    8996        }
    90         COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl;
     97//      COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl;
    9198        }
    9299        bool Turbo::dropped(Pawn* player)
     
    99106                        SpaceShip* ship = dynamic_cast <SpaceShip*>(player);
    100107                        this->unsetSpeedBoost(ship);
    101                         }       
     108                        }
    102109                }
    103110                return true;
    104111        }
    105        
     112
    106113}
    107114/*<Template baseclass="Turbo" name=turboitem>
     
    115122    </PickupSpawner>*/
    116123
    117        
    118        
    119        
    120        
     124
     125
     126
     127
Note: See TracChangeset for help on using the changeset viewer.