- Timestamp:
- Sep 25, 2015, 1:56:51 PM (9 years ago)
- Location:
- code/branches/towerdefenseFabien
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseFabien/data/levels/towerDefense.oxw
r10592 r10594 220 220 </links> 221 221 <Weapon> 222 < SimpleRocketFire mode=0 muzzleoffset="0,0,0" damage=30 shielddamage=20/>222 <<HsW01 mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0,0,0" projectileMesh="LaserBeam2.mesh" /> 223 223 </Weapon> 224 224 </WeaponPack> -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/CMakeLists.txt
r10592 r10594 5 5 Projectile.cc 6 6 LightningGunProjectile.cc 7 SplitGunProjectile.cc8 7 Rocket.cc 9 8 SimpleRocket.cc -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/SplitGunProjectile.cc
r10592 r10594 21 21 * 22 22 * Author: 23 * Joel Smely23 * Fabien Vultier 24 24 * Co-authors: 25 25 * ... … … 77 77 } 78 78 79 /** 80 @brief 81 This function starts a timer that will cause the projectile to split after a time defined by the argument @param splitTime. 82 */ 79 83 void SplitGunProjectile::setSplitTime(float splitTime) 80 84 { … … 95 99 } 96 100 101 /** 102 @brief 103 If this function is called the projectile splits up into many child projectiles. The original projectiles does not get destroyed but it will never split up again. 104 */ 97 105 void SplitGunProjectile::split() 98 106 { … … 100 108 { 101 109 -- numberOfSplits_; 110 111 // Reduce damage of this projectile by the number of childs plus one. This way the total amount of possible damage contained in the original projectile and its childs is unchanged after s aplit. 112 this->setDamage(this->getDamage()/(numberOfChilds_+1)); 102 113 103 114 // Calculate a normalized vector (velocityOffset) that is perpendicluar to the velocity of this projectile. Since there are infinitly many perpendicular vectors a random one is chosen. … … 131 142 projectile->setDamage(this->getDamage()); 132 143 projectile->setShieldDamage(this->getShieldDamage()); 133 projectile->setHealthDamage(this->getHealthDamage()); 144 projectile->setHealthDamage(this->getHealthDamage()); 134 145 } 135 146 -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/SplitGunProjectile.h
r10592 r10594 21 21 * 22 22 * Author: 23 * Joel Smely23 * Fabien Vultier 24 24 * Co-authors: 25 25 * ... … … 46 46 /** 47 47 @brief 48 The SplitGunProjectile is a projectile that is represented by a looped series of billboards. 49 48 The SplitGunProjectile is a projectile that may split up into many child projectiles. 50 49 @author 51 Joel Smely50 Fabien Vultier 52 51 @ingroup WeaponsProjectiles 53 52 */ -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.cc
r10592 r10594 21 21 * 22 22 * Author: 23 * Joel Smely23 * Fabien Vultier 24 24 * Co-authors: 25 * simonmie25 * ... 26 26 * 27 27 */ … … 69 69 /** 70 70 @brief 71 XMLPort for the SplitGun. You can define how often the projectiles split, how many childs should be created per split and the time between two splits.71 XMLPort for the SplitGun. You can define how often the projectiles split, how many childs should be created per split, the spread and the time between two splits. 72 72 */ 73 73 void SplitGun::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 95 95 projectile->setVelocity(this->getMuzzleDirection() * this->speed_); 96 96 97 // Pass important information to the projectile: Number of splits, Number of childs, split time, spread 97 98 projectile->setNumberOfSplits(getNumberOfSplits()); 98 99 projectile->setNumberOfChilds(getNumberOfChilds()); -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.h
r10592 r10594 21 21 * 22 22 * Author: 23 * Joel Smely23 * Fabien Vultier 24 24 * Co-authors: 25 25 * ... … … 45 45 A slow ball of lightning. 46 46 @author 47 Joel Smely47 Fabien Vultier 48 48 @ingroup WeaponsWeaponModes 49 49 */ … … 75 75 76 76 private: 77 float speed_; // !<The speed of the fired projectile.78 int numberOfSplits_; 79 int numberOfChilds_; 80 float splitTime_; 81 float spread_; 77 float speed_; //The speed of the fired projectile. 78 int numberOfSplits_; //The number of times the projectile will split into child projectiles 79 int numberOfChilds_; //The number of child projectiles that are created if the projectile splits 80 float splitTime_; //The time between creation of the projectile and the split of the projectile 81 float spread_; //Low spread means that the child projectiles are concentrated in a small area 82 82 }; 83 83 }
Note: See TracChangeset
for help on using the changeset viewer.