Changeset 10608
- Timestamp:
- Oct 2, 2015, 11:03:31 PM (9 years ago)
- Location:
- code/branches/towerdefenseFabien/src/modules/weapons
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseFabien/src/modules/weapons/IceGunFreezer.cc
r10606 r10608 92 92 } 93 93 94 /** 95 @brief 96 Try to slow down the WorldEntity where this is attached to. It is only possible to slow down a SpaceShip. 97 */ 94 98 void IceGunFreezer::startFreezing() 95 99 { 96 100 WorldEntity* parent = this->getParent(); 97 101 102 // Check if the freezer is attached to a parent and check if the parent is a SpaceShip 98 103 if (parent != NULL && parent->isA(Class(SpaceShip))) 99 104 { 100 105 freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent); 106 //Slow down the SpaceShip 101 107 freezedSpaceShip_->addSpeedFactor(freezeFactor_); 102 108 } … … 106 112 } 107 113 114 /** 115 @brief 116 This method is called by the timer. It gives back the original engine strength to the hit SpaceShip. 117 */ 108 118 void IceGunFreezer::stopFreezing() 109 119 { -
code/branches/towerdefenseFabien/src/modules/weapons/IceGunFreezer.h
r10606 r10608 47 47 /** 48 48 @brief 49 blablabla49 This is the WorldEntity that gets attached to a victim hit by a IceGunProjectile. It slows down the hit SpaceShip by a defined amount and time. 50 50 @ingroup Weapons 51 51 */ -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/IceGunProjectile.cc
r10606 r10608 76 76 77 77 bool IceGunProjectile::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) 78 { 78 { 79 79 bool bCollision = Projectile::collidesAgainst(otherObject, cs, contactPoint); 80 80 81 81 if (bCollision) 82 82 { 83 // If there was a collision, attach a IceGunFreezer to the hit object. 83 84 IceGunFreezer* freezer = new IceGunFreezer(this->getContext()); 84 85 freezer->setFreezeTime(freezeTime_); … … 89 90 freezer->setPosition(Vector3(0,0,0)); 90 91 freezer->translate(offset, WorldEntity::World); 92 // Start the freezing effect. 91 93 freezer->startFreezing(); 92 94 } -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/IceGunProjectile.h
r10606 r10608 47 47 /** 48 48 @brief 49 The IceGunProjectile is a projectile that may split up into many child projectiles.49 The IceGunProjectile is a projectile that attaches a IceGunFreezer to the hit object. This object gets slowed down by the IceGunFreezer. 50 50 @author 51 51 Fabien Vultier -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/IceGun.cc
r10606 r10608 51 51 RegisterObject(IceGun); 52 52 53 // Default values 53 54 this->reloadTime_ = 1.0f; 54 55 this->damage_ = 0.0f; 55 56 this->speed_ = 750.0f; 56 57 57 58 58 this->setFreezeTime(3.0); -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/IceGun.h
r10606 r10608 43 43 /** 44 44 @brief 45 A slow ball of lightning.45 A Gun that fires ice arrows that slow down any SpaceShip object that gets hit. 46 46 @author 47 47 Fabien Vultier … … 56 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 57 57 virtual void fire(); 58 59 58 60 59 inline void setFreezeTime(float freezeTime)
Note: See TracChangeset
for help on using the changeset viewer.