- Timestamp:
- May 25, 2011, 9:41:29 PM (13 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
-
code/branches/presentation/src/modules/weapons/projectiles/SimpleRocket.cc
r8579 r8580 23 23 * Oliver Scheuss 24 24 * Co-authors: 25 * ...25 * simonmie 26 26 * 27 27 */ … … 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;56 55 this->lifetime_ = 120; 57 56 58 57 this->setMass(15); 59 COUT(4) << "simplerocket constructed\n";58 // COUT(4) << "simplerocket constructed\n"; 60 59 61 60 if (GameMode::isMaster()) … … 115 114 this->disableFire(); 116 115 117 if( this-> bDestroy_)116 if( this->getBDestroy() ) 118 117 this->destroy(); 119 118 } … … 159 158 { 160 159 this->owner_ = owner; 161 this->player_ = this-> owner_->getPlayer();162 } 163 164 165 166 160 this->player_ = this->getOwner()->getPlayer(); 161 } 162 163 164 /* Calls the collidesAgainst function of BasicProjectile 165 */ 167 166 bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 168 167 { 169 if (!this->bDestroy_ && GameMode::isMaster()) 170 { 171 if (otherObject == this->owner_) 172 return false; 173 174 this->bDestroy_ = true; 175 176 if (this->owner_) 177 { 178 { 179 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 180 effect->setPosition(this->getPosition()); 181 effect->setOrientation(this->getOrientation()); 182 effect->setDestroyAfterLife(true); 183 effect->setSource("Orxonox/explosion4"); 184 effect->setLifetime(2.0f); 185 } 186 187 { 188 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 189 effect->setPosition(this->getPosition()); 190 effect->setOrientation(this->getOrientation()); 191 effect->setDestroyAfterLife(true); 192 effect->setSource("Orxonox/smoke4"); 193 effect->setLifetime(3.0f); 194 } 195 } 196 197 float dmg = this->damage_; 198 // if (this->owner_) 199 // dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false); 200 201 Pawn* victim = orxonox_cast<Pawn*>(otherObject); 202 if (victim) 203 victim->hit(this->owner_, contactPoint, dmg); 204 } 205 return false; 168 return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->getOwner(),this); 206 169 } 207 170
Note: See TracChangeset
for help on using the changeset viewer.