Changeset 8533 for code/branches/gameimmersion
- Timestamp:
- May 23, 2011, 2:26:25 PM (14 years ago)
- Location:
- code/branches/gameimmersion/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc
r8492 r8533 36 36 #include "worldentities/pawns/Pawn.h" 37 37 #include "graphics/ParticleSpawner.h" 38 #include "BasicProjectile.h"39 38 40 39 namespace orxonox -
code/branches/gameimmersion/src/modules/weapons/projectiles/Rocket.cc
r7848 r8533 43 43 #include "Scene.h" 44 44 45 #include "BasicProjectile.h" 46 45 47 namespace orxonox 46 48 { … … 52 54 Constructor. Registers the object and initializes some default values. 53 55 */ 54 Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator) 56 Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile() 55 57 { 56 58 RegisterObject(Rocket);// - register the Rocket class to the core 57 59 58 60 this->localAngularVelocity_ = 0; 59 this->bDestroy_ = false;61 // this->bDestroy_ = false; 60 62 this->lifetime_ = 100; 61 63 … … 175 177 if( GameMode::isMaster() ) 176 178 { 177 if( this-> bDestroy_)179 if( this->getBDestroy() ) 178 180 this->destroy(); 179 181 … … 183 185 bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 184 186 { 185 if (!this->bDestroy_ && GameMode::isMaster()) 187 return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this); 188 189 /* * / if (!this->bDestroy_ && GameMode::isMaster()) 186 190 { 187 191 if (otherObject == this->owner_) … … 216 220 // this->destroy(); 217 221 } 218 return false;222 / * */ return false; 219 223 } 220 224 -
code/branches/gameimmersion/src/modules/weapons/projectiles/Rocket.h
r7163 r8533 35 35 #include "worldentities/ControllableEntity.h" 36 36 37 #include "BasicProjectile.h" 38 37 39 namespace orxonox 38 40 { … … 46 48 Oli Scheuss 47 49 */ 48 class _WeaponsExport Rocket : public ControllableEntity 50 class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile 49 51 { 50 52 public: … … 109 111 { return this->owner_; } 110 112 111 inline void setDamage(float damage)113 /* inline void setDamage(float damage) 112 114 { this->damage_ = damage; } 113 115 inline float getDamage() const 114 116 { return this->damage_; } 117 */ 118 115 119 virtual void fired(unsigned int firemode); 116 120 … … 118 122 WeakPtr<Pawn> owner_; 119 123 Vector3 localAngularVelocity_; 120 float damage_;121 bool bDestroy_;124 // float damage_; 125 // bool bDestroy_; 122 126 123 127 WeakPtr<PlayerInfo> player_; -
code/branches/gameimmersion/src/modules/weapons/projectiles/SimpleRocket.cc
r7163 r8533 48 48 CreateFactory(SimpleRocket); 49 49 50 SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator) 50 SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile() 51 51 { 52 52 RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core 53 53 54 54 this->localAngularVelocity_ = 0; 55 this->bDestroy_ = false;55 // this->bDestroy_ = false; 56 56 this->lifetime_ = 120; 57 57 … … 115 115 this->disableFire(); 116 116 117 if( this-> bDestroy_)117 if( this->getBDestroy() ) 118 118 this->destroy(); 119 119 } … … 167 167 bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 168 168 { 169 if (!this->bDestroy_ && GameMode::isMaster()) 169 return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this); 170 /* if (!this->bDestroy_ && GameMode::isMaster()) 170 171 { 171 172 if (otherObject == this->owner_) … … 204 205 } 205 206 return false; 207 */ 206 208 } 207 209 -
code/branches/gameimmersion/src/modules/weapons/projectiles/SimpleRocket.h
r7163 r8533 36 36 #include "graphics/ParticleSpawner.h" 37 37 38 #include "BasicProjectile.h" 39 38 40 namespace orxonox 39 41 { … … 46 48 Gabriel Nadler (Original file: Oli Scheuss) 47 49 */ 48 class _WeaponsExport SimpleRocket : public ControllableEntity 50 class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile 49 51 { 50 52 public: … … 114 116 { return this->fuel_; } 115 117 116 inline void setDamage(float damage)118 /* inline void setDamage(float damage) 117 119 { this->damage_ = damage; } 118 120 inline float getDamage() const 119 121 { return this->damage_; } 120 122 */ 121 123 122 124 private: 123 125 WeakPtr<Pawn> owner_; 124 126 Vector3 localAngularVelocity_; 125 float damage_;126 bool bDestroy_;127 // float damage_; 128 // bool bDestroy_; 127 129 bool fuel_; //!< Bool is true while the rocket "has fuel" 128 130 -
code/branches/gameimmersion/src/orxonox/weaponsystem/WeaponMode.h
r8386 r8533 104 104 // Fire 105 105 inline void setDamage(float damage) 106 { this->damage_ = damage; COUT(3) << "DAMAGE-SET-FUNKTION (WeaponMode) WIRD AUFGERUFEN" << endl;}106 { this->damage_ = damage;} 107 107 inline float getDamage() const 108 108 { return this->damage_; } … … 115 115 116 116 inline void setShieldDamage(float shielddamage) 117 { this->shielddamage_ = shielddamage;} //ShieldDamage wird korrekt gesettet vom XML-File117 { this->shielddamage_ = shielddamage;} 118 118 inline float getShieldDamage() const 119 119 { return this->shielddamage_; } -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc
r8492 r8533 249 249 } 250 250 251 else { COUT(3) << "## SHIELD : " << this->getShieldHealth() << endl; }251 // else { COUT(3) << "## SHIELD : " << this->getShieldHealth() << endl; } 252 252 253 253 this->setHealth(this->health_ - healthdamage); … … 319 319 void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage) 320 320 { 321 COUT(3) << "neue hit-Funktion wurde aufgerufen // " << std::flush;321 // COUT(3) << "neue hit-Funktion wurde aufgerufen // " << std::flush; 322 322 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 323 323 {
Note: See TracChangeset
for help on using the changeset viewer.