Changeset 11153 for code/branches/sagerjFS16/src
- Timestamp:
- Mar 24, 2016, 3:56:35 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc
r11142 r11153 52 52 53 53 this->reloadTime_ = 0.1f; 54 this->damage_ = 9000.1f ;55 this->speed_ = 9000.1f ;54 this->damage_ = 9000.1f*loaded_; 55 this->speed_ = 9000.1f*loaded_; 56 56 57 57 this->setMunitionName("dEnergy"); … … 68 68 void Discharger::fire() 69 69 { 70 71 } 72 void Discharger::unfire() 73 { 74 BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 70 /*BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 75 71 76 72 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); … … 82 78 projectile->setDamage(this->getDamage()); 83 79 projectile->setShieldDamage(this->getShieldDamage()); 84 projectile->setHealthDamage(this->getHealthDamage()); 80 projectile->setHealthDamage(this->getHealthDamage());*/ 81 extern unsigned int beginLoad_ = time; 82 } 83 void Discharger::release() 84 { 85 extern unsigned int endLoad_ = time; 86 extern unsigned int loaded_ = endLoad_ - beginLoad_; 87 85 88 } 86 89 } -
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
r11142 r11153 55 55 56 56 virtual void fire() override; 57 virtual void unfire() override;57 virtual void release() override; 58 58 59 59 private: 60 60 float speed_; //!< The speed of the fired projectile. 61 float loaded_; // The time how long the weapon charged 62 float beginLoad_; 63 float endLoad_; 61 64 }; 62 65 } -
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.cc
r11071 r11153 42 42 extern const std::string __CC_fire_name = "fire"; 43 43 extern const std::string __CC_suicide_name = "suicide"; 44 extern const std::string __CC_release_name = "release"; 44 45 45 46 SetConsoleCommand("HumanController", "moveFrontBack", &HumanController::moveFrontBack ).addShortcut().setAsInputCommand(); … … 52 53 SetConsoleCommand("HumanController", "FFChangeMode", &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress); 53 54 SetConsoleCommand("HumanController", __CC_fire_name, &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold); 55 SetConsoleCommand("HumanController", __CC_release_name, &HumanController::release ).addShortcut().keybindMode(KeybindMode::OnRelease); 54 56 SetConsoleCommand("HumanController", "reload", &HumanController::reload ).addShortcut(); 55 57 SetConsoleCommand("HumanController", "boost", &HumanController::boost ).addShortcut().setAsInputCommand().keybindMode(KeybindMode::OnPressAndRelease); … … 167 169 HumanController::localController_s->controllableEntity_->fire(firemode); 168 170 //if human fires, set slaves free. See FormationController::forceFreeSlaves() 171 if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL) 172 { 173 HumanController::localController_s->forceFreeSlaves(); 174 } 175 } 176 } 177 178 void HumanController::release(unsigned int firemode) 179 { 180 if (HumanController::localController_s) 181 HumanController::localController_s->doRelease(firemode); 182 } 183 184 void HumanController::doRelease(unsigned int firemode) 185 { 186 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 187 { 188 HumanController::localController_s->controllableEntity_->release(firemode); 189 //if human releases, set slaves free. See FormationController::forceFreeSlaves() 169 190 if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL) 170 191 { -
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.h
r11071 r11153 64 64 virtual void doFire(unsigned int firemode); 65 65 static void reload(); 66 static void release(unsigned int firemode); 67 virtual void doRelease(unsigned int firemode); 66 68 67 69 static void boost(const Vector2& value); // Static method, controls boosting. -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.cc
r11142 r11153 54 54 SetConsoleCommand("NewHumanController", "accelerate", &NewHumanController::accelerate).keybindMode(KeybindMode::OnPress); 55 55 SetConsoleCommand("NewHumanController", "decelerate", &NewHumanController::decelerate).keybindMode(KeybindMode::OnPress); 56 SetConsoleCommand("NewHumanController", " unfire", &NewHumanController::unfire ).keybindMode(KeybindMode::OnRelease).addShortcut();56 SetConsoleCommand("NewHumanController", "release", &NewHumanController::release ).keybindMode(KeybindMode::OnRelease).addShortcut(); 57 57 58 58 RegisterUnloadableClass(NewHumanController); … … 344 344 } 345 345 346 void NewHumanController:: unfire()346 void NewHumanController::release(unsigned int firemode) 347 347 { 348 348 if (NewHumanController::localController_s) 349 NewHumanController::localController_s->doUnfire(); 350 orxout() << "unfire" << endl; 351 } 352 353 void NewHumanController::doUnfire() 354 { 355 this->firemode_ = -1; 356 hideArrows(); 349 NewHumanController::localController_s->doRelease(); 350 orxout() << "Trigger" << endl; 351 } 352 353 void NewHumanController::doRelease(unsigned int firemode) 354 { 355 // this->firemode_ = -1; (outdated code from unfire) 356 // hideArrows(); 357 if (!this->controllableEntity_) 358 return; 359 360 this->firemode_ = firemode; 361 362 HumanController::doRelease(firemode); //call for formationflight 357 363 } 358 364 -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.h
r11071 r11153 58 58 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) override; 59 59 60 static void unfire();61 virtual void do Unfire();60 static void release(unsigned int firemode); 61 virtual void doRelease(unsigned int firemode); 62 62 63 63 void centerCursor(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11108 r11153 169 169 } 170 170 171 void WeaponMode::release() 172 171 173 bool WeaponMode::reload() 172 174 { -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc
r11099 r11153 294 294 } 295 295 296 void WeaponSystem::release(unsigned int firemode) 297 { 298 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 299 if (it != this->weaponSets_.end() && it->second) 300 it->second->release(); 301 } 302 296 303 void WeaponSystem::reload() 297 304 { -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.h
r11071 r11153 76 76 void fire(unsigned int firemode); 77 77 void reload(); 78 void release(unsigned int firemode); 78 79 79 80 Munition * getMunition(SubclassIdentifier<Munition> * identifier);
Note: See TracChangeset
for help on using the changeset viewer.