- Timestamp:
- Dec 17, 2008, 2:10:11 AM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/weapon2 (added) merged: 2108,2145,2186,2203,2232,2272-2273,2288,2308,2319,2327,2331,2337,2347,2354,2366-2368,2379,2391,2393,2398,2410
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/worldentities/Backlight.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/Backlight.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/ControllableEntity.h
r2485 r2493 33 33 34 34 #include "MobileEntity.h" 35 #include "objects/weaponSystem/WeaponSystem.h" 35 36 36 37 namespace orxonox … … 81 82 { this->rotateRoll(Vector2(value, 0)); } 82 83 83 virtual void fire( ) {}84 virtual void altFire( ) {}84 virtual void fire(WeaponMode::Enum fireMode) {} 85 virtual void altFire(WeaponMode::Enum fireMode) {} 85 86 86 87 virtual void boost() {} -
code/branches/presentation/src/orxonox/objects/worldentities/ParticleSpawner.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/ParticleSpawner.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2485 r2493 37 37 #include "objects/infos/PlayerInfo.h" 38 38 #include "objects/gametypes/Gametype.h" 39 #include "objects/weaponSystem/WeaponSystem.h"40 39 #include "objects/worldentities/ParticleSpawner.h" 41 40 #include "objects/worldentities/ExplosionChunk.h" … … 52 51 53 52 this->bAlive_ = true; 53 this->fire_ = 0x0; 54 54 55 55 this->health_ = 0; … … 58 58 59 59 this->lastHitOriginator_ = 0; 60 this->weaponSystem_ = 0;61 60 62 61 this->spawnparticleduration_ = 3.0f; 63 62 64 /*65 //WeaponSystem66 weaponSystem_ = new WeaponSystem();67 WeaponSet * weaponSet1 = new WeaponSet(1);68 this->weaponSystem_->attachWeaponSet(weaponSet1);69 this->weaponSystem_->getWeaponSetPointer(0)->getWeaponSlotPointer(0)->setAmmoType(true);70 */63 if (Core::isMaster()) 64 { 65 this->weaponSystem_ = new WeaponSystem(this); 66 this->weaponSystem_->setParentPawn(this); 67 } 68 else 69 this->weaponSystem_ = 0; 71 70 72 71 this->setRadarObjectColour(ColourValue::Red); … … 82 81 for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it) 83 82 it->destroyedPawn(this); 83 84 if (this->weaponSystem_) 85 delete this->weaponSystem_; 84 86 } 85 87 } … … 95 97 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); 96 98 XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7); 99 100 XMLPortObject(Pawn, WeaponSlot, "weaponslots", setWeaponSlot, getWeaponSlot, xmlelement, mode); 101 XMLPortObject(Pawn, WeaponSet, "weaponsets", setWeaponSet, getWeaponSet, xmlelement, mode); 102 XMLPortObject(Pawn, WeaponPack, "weapons", setWeaponPack, getWeaponPack, xmlelement, mode); 97 103 } 98 104 … … 102 108 registerVariable(this->health_, variableDirection::toclient); 103 109 registerVariable(this->initialHealth_, variableDirection::toclient); 110 registerVariable(this->fire_, variableDirection::toclient); 104 111 } 105 112 … … 107 114 { 108 115 SUPER(Pawn, tick, dt); 116 117 if (this->weaponSystem_) 118 { 119 if (this->fire_ & WeaponMode::fire) 120 this->weaponSystem_->fire(WeaponMode::fire); 121 if (this->fire_ & WeaponMode::altFire) 122 this->weaponSystem_->fire(WeaponMode::altFire); 123 if (this->fire_ & WeaponMode::altFire2) 124 this->weaponSystem_->fire(WeaponMode::altFire2); 125 } 126 this->fire_ = 0x0; 109 127 110 128 if (this->health_ <= 0) … … 205 223 } 206 224 207 void Pawn::fire() 208 { 209 if (this->weaponSystem_) 210 this->weaponSystem_->fire(); 225 void Pawn::fire(WeaponMode::Enum fireMode) 226 { 227 this->fire_ |= fireMode; 211 228 } 212 229 … … 217 234 this->spawneffect(); 218 235 } 236 237 void Pawn::setWeaponSlot(WeaponSlot * wSlot) 238 { 239 this->attach(wSlot); 240 if (this->weaponSystem_) 241 this->weaponSystem_->attachWeaponSlot(wSlot); 242 } 243 244 WeaponSlot * Pawn::getWeaponSlot(unsigned int index) const 245 { 246 if (this->weaponSystem_) 247 return this->weaponSystem_->getWeaponSlotPointer(index); 248 else 249 return 0; 250 } 251 252 void Pawn::setWeaponPack(WeaponPack * wPack) 253 { 254 if (this->weaponSystem_) 255 { 256 wPack->setParentWeaponSystem(this->weaponSystem_); 257 wPack->setParentWeaponSystemToAllWeapons(this->weaponSystem_); 258 this->weaponSystem_->attachWeaponPack( wPack,wPack->getFireMode() ); 259 wPack->attachNeededMunitionToAllWeapons(); 260 } 261 } 262 263 WeaponPack * Pawn::getWeaponPack(unsigned int firemode) const 264 { 265 if (this->weaponSystem_) 266 return this->weaponSystem_->getWeaponPackPointer(firemode); 267 else 268 return 0; 269 } 270 271 void Pawn::setWeaponSet(WeaponSet * wSet) 272 { 273 if (this->weaponSystem_) 274 this->weaponSystem_->attachWeaponSet(wSet); 275 } 276 277 WeaponSet * Pawn::getWeaponSet(unsigned int index) const 278 { 279 if (this->weaponSystem_) 280 return this->weaponSystem_->getWeaponSetPointer(index); 281 else 282 return 0; 283 } 284 219 285 220 286 /////////////////// -
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.h
r2485 r2493 34 34 #include "objects/worldentities/ControllableEntity.h" 35 35 #include "objects/RadarViewable.h" 36 #include "objects/weaponSystem/WeaponSystem.h" 36 37 37 38 namespace orxonox … … 75 76 virtual void kill(); 76 77 77 virtual void fire( );78 virtual void fire(WeaponMode::Enum fireMode); 78 79 79 80 virtual void postSpawn(); 81 82 void setWeaponSlot(WeaponSlot * wSlot); 83 WeaponSlot * getWeaponSlot(unsigned int index) const; 84 void setWeaponPack(WeaponPack * wPack); 85 WeaponPack * getWeaponPack(unsigned int firemode) const; 86 void setWeaponSet(WeaponSet * wSet); 87 WeaponSet * getWeaponSet(unsigned int index) const; 80 88 81 89 inline const WorldEntity* getWorldEntity() const … … 111 119 112 120 WeaponSystem* weaponSystem_; 121 unsigned int fire_; 113 122 114 123 std::string spawnparticlesource_; … … 117 126 }; 118 127 119 class _OrxonoxExport PawnListener : public OrxonoxClass128 class _OrxonoxExport PawnListener : virtual public OrxonoxClass 120 129 { 121 130 friend class Pawn; -
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2485 r2493 196 196 } 197 197 198 void Spectator::fire( )198 void Spectator::fire(WeaponMode::Enum fireMode) 199 199 { 200 200 if (this->getPlayer()) -
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.h
r2485 r2493 57 57 virtual void rotateRoll(const Vector2& value); 58 58 59 virtual void fire( );59 virtual void fire(WeaponMode::Enum fireMode); 60 60 virtual void greet(); 61 61 -
code/branches/presentation/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/triggers/Trigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation/src/orxonox/objects/worldentities/triggers/Trigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset
for help on using the changeset viewer.