- Timestamp:
- Dec 17, 2008, 8:00:43 AM (15 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/pickups2 (added) merged: 2110,2136,2202,2227,2289-2290,2293-2294,2324,2342,2389,2397
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/pickup/Turbo.cc
- Property svn:eol-style set to native
r2498 r2500 8 8 namespace orxonox 9 9 { 10 10 11 11 12 12 CreateFactory(Turbo); 13 13 14 Turbo::Turbo(BaseObject* creator) : Item(creator)14 Turbo::Turbo(BaseObject* creator) : BaseItem(creator) 15 15 { 16 16 RegisterObject(Turbo); … … 33 33 XMLPortParam(Turbo, "duration", setDuration, getDuration, xmlelement, mode); 34 34 XMLPortParam(Turbo, "accboost", setAccBoost, getAccBoost, xmlelement, mode); 35 XMLPortParam(Turbo, "rotacc", setRotAcc, getRotAcc, xmlelement, mode); 36 35 XMLPortParam(Turbo, "rotacc", setRotAcc, getRotAcc, xmlelement, mode); 37 36 } 38 37 39 38 bool Turbo::pickedUp(Pawn* player) 40 39 { 41 40 42 41 if(player-> isA(this->getPlayerBaseClass())) 43 42 { 44 43 SpaceShip* ship = dynamic_cast <SpaceShip*>(player); 45 44 if(duration_==0 ) 46 { 45 { 47 46 if(addTo(player)) 48 { 47 { 49 48 COUT(3)<<"ITEM EQUIPPED"<<std::endl; 50 49 this->setSpeedBoost(ship); … … 63 62 64 63 } 65 66 64 65 67 66 void Turbo::unsetSpeedBoost(SpaceShip* ship) 68 67 { 68 /* 69 69 ship->setMaxSpeed( ship->getMaxSpeed() - this->boost_); 70 70 ship->setTransAcc( ship->getTransAcc()/this->accboost_); … … 73 73 COUT(3)<<"BOOST UNSET"<<std::endl; 74 74 COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl; 75 */ 76 ship->setPermanentBoost(false); 75 77 } 76 78 77 79 void Turbo::setSpeedBoost(SpaceShip* ship) 78 80 { 81 /* 79 82 COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl; 80 83 ship->setMaxSpeed( ship->getMaxSpeed() + this->boost_); … … 82 85 ship->setMaxRotation( ship->getMaxRotation()+this->rotacc_); 83 86 ship->setRotAcc( ship->getRotAcc()+this->rotacc_); 87 */ 88 ship->setPermanentBoost(true); 89 ship->setBoost(true); 90 84 91 if( this->duration_ != 0) 85 92 { … … 88 95 turbotimer_.setTimer(this->duration_, false, this, executor); 89 96 } 90 COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl;97 // COUT(3)<<"Speed:"<< ship->getMaxSpeed()<<std::endl; 91 98 } 92 99 bool Turbo::dropped(Pawn* player) … … 99 106 SpaceShip* ship = dynamic_cast <SpaceShip*>(player); 100 107 this->unsetSpeedBoost(ship); 101 } 108 } 102 109 } 103 110 return true; 104 111 } 105 112 106 113 } 107 114 /*<Template baseclass="Turbo" name=turboitem> … … 115 122 </PickupSpawner>*/ 116 123 117 118 119 120 124 125 126 127
Note: See TracChangeset
for help on using the changeset viewer.