Changeset 3073 for code/trunk/src/orxonox/objects
- Timestamp:
- May 25, 2009, 8:30:15 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 9 deleted
- 9 edited
- 27 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 dependencies
-
- Property svn:mergeinfo changed
/code/branches/pickups merged: 2828,2831,2864,2900 /code/branches/pickups2 merged: 2916-2917,2972,3001,3016,3040-3042,3046,3063
- Property svn:ignore
-
code/trunk/src/orxonox/objects/controllers/HumanController.cc
r3053 r3073 49 49 SetConsoleCommand(HumanController, boost, true).keybindMode(KeybindMode::OnHold); 50 50 SetConsoleCommand(HumanController, greet, true); 51 SetConsoleCommand(HumanController, use, true);52 51 SetConsoleCommand(HumanController, switchCamera, true); 53 52 SetConsoleCommand(HumanController, mouseLook, true); … … 56 55 SetConsoleCommand(HumanController, killBots, true).defaultValues(0); 57 56 SetConsoleCommand(HumanController, dropItems, true); 57 SetConsoleCommand(HumanController, useItem, true); 58 58 59 59 CreateUnloadableFactory(HumanController); … … 133 133 } 134 134 135 void HumanController::use()136 {137 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)138 HumanController::localController_s->controllableEntity_->use();139 }140 141 135 void HumanController::switchCamera() 142 136 { … … 163 157 } 164 158 159 void HumanController::useItem() 160 { 161 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 162 HumanController::localController_s->controllableEntity_->useItem(); 163 } 164 165 165 void HumanController::addBots(unsigned int amount) 166 166 { -
code/trunk/src/orxonox/objects/controllers/HumanController.h
r3053 r3073 34 34 #include "util/Math.h" 35 35 #include "Controller.h" 36 #include "objects/worldentities/pawns/Pawn.h" 36 37 37 38 namespace orxonox … … 56 57 static void boost(); 57 58 static void greet(); 58 static void use();59 59 static void switchCamera(); 60 60 static void mouseLook(); 61 61 static void dropItems(); 62 static void useItem(); 62 63 63 64 static void suicide(); … … 65 66 static void addBots(unsigned int amount); 66 67 static void killBots(unsigned int amount = 0); 68 69 static inline HumanController* getLocalControllerSingleton() 70 { return HumanController::localController_s; } 71 static inline Pawn* getLocalControllerEntityAsPawn() 72 { 73 if (HumanController::localController_s) { 74 return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity()); 75 } else { 76 return NULL; 77 } 78 } 67 79 68 80 private: -
code/trunk/src/orxonox/objects/items/Engine.cc
r3060 r3073 200 200 } 201 201 202 this->ship_->setAcceleration(this->ship_->get Orientation() * acceleration);202 this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false)); 203 203 204 204 if (!this->ship_->getPermanentBoost()) -
code/trunk/src/orxonox/objects/pickup/CMakeLists.txt
r2710 r3073 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 BaseItem.cc 3 DroppedItem.cc 4 EquipmentItem.cc 5 ModifierPickup.cc 6 PassiveItem.cc 7 PickupCollection.cc 8 PickupInventory.cc 2 9 PickupSpawner.cc 3 BaseItem.cc 4 Turbo.cc 5 ShipEquipment.cc 10 UsableItem.cc 6 11 ) 12 13 ADD_SUBDIRECTORY(items) -
code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc
r3053 r3073 126 126 } 127 127 128 float dmg = this->damage_; 129 if (this->owner_) 130 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false); 131 128 132 Pawn* victim = dynamic_cast<Pawn*>(otherObject); 129 133 if (victim) 130 victim->damage( this->damage_, this->owner_);134 victim->damage(dmg, this->owner_); 131 135 } 132 136 return false; -
code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h
r3053 r3073 85 85 virtual void boost() {} 86 86 virtual void greet() {} 87 virtual void use () {}87 virtual void useItem() {} 88 88 virtual void dropItems() {} 89 89 virtual void switchCamera(); -
code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
r3053 r3073 66 66 this->spawnparticleduration_ = 3.0f; 67 67 68 this->getPick Up().setPlayer(this);68 this->getPickups().setOwner(this); 69 69 70 70 if (GameMode::isMaster()) … … 214 214 this->setDestroyWhenPlayerLeft(false); 215 215 216 this->dropItems(); 217 216 218 if (this->getGametype()) 217 219 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); … … 278 280 void Pawn::dropItems() 279 281 { 280 pickUp.eraseAll();282 this->getPickups().clear(); 281 283 } 282 284 -
code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
r3053 r3073 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include "objects/pickup/ShipEquipment.h"34 33 #include "objects/worldentities/ControllableEntity.h" 35 34 #include "objects/RadarViewable.h" 35 #include "objects/pickup/PickupCollection.h" 36 36 37 37 namespace orxonox … … 106 106 { return this->numexplosionchunks_; } 107 107 108 inline ShipEquipment& getPickUp()109 {return this->pickUp;}110 111 108 virtual void dropItems(); 109 inline PickupCollection& getPickups() 110 { return this->pickups_; } 111 virtual void useItem() 112 { this->pickups_.useItem(); } 112 113 113 114 protected: … … 119 120 virtual void spawneffect(); 120 121 121 ShipEquipment pickUp;122 122 bool bAlive_; 123 123 124 PickupCollection pickups_; 124 125 125 126 float health_;
Note: See TracChangeset
for help on using the changeset viewer.