Changeset 8492 for code/branches/gameimmersion/src/modules
- Timestamp:
- May 16, 2011, 5:25:00 PM (14 years ago)
- Location:
- code/branches/gameimmersion/src/modules/weapons
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/src/modules/weapons/projectiles/CMakeLists.txt
r7163 r8492 6 6 Rocket.cc 7 7 SimpleRocket.cc 8 BasicProjectile.cc 8 9 ) -
code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc
r8386 r8492 36 36 #include "worldentities/pawns/Pawn.h" 37 37 #include "graphics/ParticleSpawner.h" 38 #include "BasicProjectile.h" 38 39 39 40 namespace orxonox … … 41 42 CreateFactory(Projectile); 42 43 43 Projectile::Projectile(BaseObject* creator) : MovableEntity(creator) 44 Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile() 44 45 { 45 46 RegisterObject(Projectile); 46 47 47 48 this->setConfigValues(); 48 this->bDestroy_ = false;49 // this->bDestroy_ = false; 49 50 this->owner_ = 0; 50 this->damage_ = 115;51 // this->damage_ = 115; 51 52 ///////////////////me 52 this->healthdamage_ = 0;53 this->shielddamage_ = 0;53 // this->healthdamage_ = 0; 54 // this->shielddamage_ = 0; 54 55 ///////////////////end me 55 56 … … 88 89 return; 89 90 90 if (this-> bDestroy_)91 if (this->getBDestroy()) 91 92 this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick() 92 93 } … … 98 99 } 99 100 101 bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 102 { 103 return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this); 104 } 105 100 106 //////////////////////////me edit 101 bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)107 /* bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 102 108 { 103 109 if (!this->bDestroy_ && GameMode::isMaster()) … … 150 156 } 151 157 //////////////////////////////////////////////////////////////////////end edit 152 158 */ 153 159 void Projectile::setOwner(Pawn* owner) 154 160 { 155 161 this->owner_ = owner; 156 162 } 163 157 164 } -
code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.h
r8386 r8492 35 35 #include "worldentities/MovableEntity.h" 36 36 37 #include "BasicProjectile.h" 38 37 39 namespace orxonox 38 40 { 39 class _WeaponsExport Projectile : public MovableEntity 41 class _WeaponsExport Projectile : public MovableEntity, public BasicProjectile 40 42 { 41 43 public: … … 49 51 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 50 52 51 inline void setDamage(float damage)53 /* inline void setDamage(float damage) 52 54 { this->damage_ = damage; COUT(3) << "DAMAGE-SET-FUNKTION WIRD AUFGERUFEN" << endl; } 53 55 inline float getDamage() const 54 56 { return this->damage_; } 55 57 */ 56 58 void setOwner(Pawn* owner); 57 59 inline Pawn* getOwner() const 58 60 { return this->owner_; } 59 61 60 / ///////////////////me62 /*///////////////////me 61 63 62 64 inline void setHealthDamage(float healthdamage) … … 71 73 72 74 ///////////////////end me 73 75 */ 74 76 75 77 private: 76 78 WeakPtr<Pawn> owner_; 77 79 float lifetime_; 78 float damage_;80 /* float damage_; 79 81 ///////me 80 82 float healthdamage_; … … 82 84 ///////end me 83 85 bool bDestroy_; 84 Timer destroyTimer_;86 */ Timer destroyTimer_; 85 87 }; 86 88 } -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/EnergyDrink.cc
r7284 r8492 112 112 projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 113 113 projectile->setDamage(this->getDamage()); 114 projectile->setShieldDamage(this->getShieldDamage()); 115 projectile->setHealthDamage(this->getHealthDamage()); 114 116 115 117 EnergyDrink::muendungsfeuer(); -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/FusionFire.cc
r6732 r8492 65 65 projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 66 66 projectile->setDamage(this->getDamage()); 67 projectile->setShieldDamage(this->getShieldDamage()); 68 projectile->setHealthDamage(this->getHealthDamage()); 69 67 70 projectile->setColour(ColourValue(1.0f, 0.7f, 0.3f, 1.0f)); 68 71 } -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/HsW01.cc
r7284 r8492 126 126 projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 127 127 projectile->setDamage(this->getDamage()); 128 projectile->setShieldDamage(this->getShieldDamage()); 129 projectile->setHealthDamage(this->getHealthDamage()); 128 130 129 131 HsW01::muendungsfeuer(); -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/LaserFire.cc
r6732 r8492 61 61 projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 62 62 projectile->setDamage(this->getDamage()); 63 projectile->setShieldDamage(this->getShieldDamage()); 64 projectile->setHealthDamage(this->getHealthDamage()); 63 65 } 64 66 } -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/LightningGun.cc
r8386 r8492 70 70 projectile->setDamage(this->getDamage()); 71 71 projectile->setShieldDamage(this->getShieldDamage()); 72 projectile->setHealthDamage(this->getHealthDamage()); 72 73 } 73 74 } -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/RocketFire.cc
r7846 r8492 71 71 rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 72 72 rocket->setDamage(this->getDamage()); 73 // rocket->setShieldDamage(this->getShieldDamage()); 74 // rocket->setHealthDamage(this->getHealthDamage()); 73 75 } 74 76 } -
code/branches/gameimmersion/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r7846 r8492 71 71 rocket->setVelocity(this->getMuzzleDirection()*this->speed_); 72 72 rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 73 73 74 rocket->setDamage(this->damage_); 75 // rocket->setShieldDamage(this->getShieldDamage()); 76 // rocket->setHealthDamage(this->getHealthDamage()); 77 74 78 WorldEntity* pawnn=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget(); 75 79 if (pawnn) con->setTarget(pawnn);
Note: See TracChangeset
for help on using the changeset viewer.