- 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/Projectile.cc
r8579 r8580 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * simonmie 26 26 * 27 27 */ … … 41 41 CreateFactory(Projectile); 42 42 43 Projectile::Projectile(BaseObject* creator) : MovableEntity(creator) 43 Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile() 44 44 { 45 45 RegisterObject(Projectile); 46 46 47 47 this->setConfigValues(); 48 this->bDestroy_ = false;49 48 this->owner_ = 0; 50 this->damage_ = 15;51 49 52 50 // Get notification about collisions 53 54 51 if (GameMode::isMaster()) 55 52 { … … 84 81 return; 85 82 86 if (this-> bDestroy_)83 if (this->getBDestroy()) 87 84 this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick() 88 85 } … … 94 91 } 95 92 93 /* Calls the collidesAgainst function of BasicProjectile 94 */ 96 95 bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 97 96 { 98 if (!this->bDestroy_ && GameMode::isMaster()) 99 { 100 if (otherObject == this->owner_) 101 return false; 102 103 this->bDestroy_ = true; 104 105 if (this->owner_) 106 { 107 { 108 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 109 effect->setPosition(this->getPosition()); 110 effect->setOrientation(this->getOrientation()); 111 effect->setDestroyAfterLife(true); 112 effect->setSource("Orxonox/explosion3"); 113 effect->setLifetime(2.0f); 114 } 115 { 116 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 117 effect->setPosition(this->getPosition()); 118 effect->setOrientation(this->getOrientation()); 119 effect->setDestroyAfterLife(true); 120 effect->setSource("Orxonox/smoke4"); 121 effect->setLifetime(3.0f); 122 } 123 } 124 125 Pawn* victim = orxonox_cast<Pawn*>(otherObject); 126 if (victim) 127 victim->hit(this->owner_, contactPoint, this->damage_); 128 } 129 return false; 97 return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->getOwner(),this); 130 98 } 131 99
Note: See TracChangeset
for help on using the changeset viewer.