- Timestamp:
- Oct 6, 2015, 9:37:11 PM (9 years ago)
- Location:
- code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/IceGun.cc
r10608 r10627 54 54 this->reloadTime_ = 1.0f; 55 55 this->damage_ = 0.0f; 56 this->speed_ = 750.0f;56 this->speed_ = 1200.0f; 57 57 58 58 this->setFreezeTime(3.0); -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.cc
r10606 r10627 56 56 this->numberOfSplits_ = 2; 57 57 this->numberOfChilds_ = 3; 58 this->splitTime_ = 0.3; 59 this->spread_ = 0.1; 58 this->splitTime_ = 0.3f; 59 this->spread_ = 0.1f; 60 this->damageReduction_ = 1.0f; 60 61 61 this->setMunitionName(" LaserMunition");62 this->setMunitionName("SplitMunition"); 62 63 this->setDefaultSound("sounds/Weapon_LightningGun.ogg"); 63 64 } … … 79 80 XMLPortParam(SplitGun, "splittime", setSplitTime, getSplitTime, xmlelement, mode); 80 81 XMLPortParam(SplitGun, "spread", setSpread, getSpread, xmlelement, mode); 82 XMLPortParam(SplitGun, "damagereduction", setDamageReduction, getDamageReduction, xmlelement, mode); 81 83 } 82 84 … … 95 97 projectile->setVelocity(this->getMuzzleDirection() * this->speed_); 96 98 97 // Pass important information to the projectile: Number of splits, Number of childs, split time, spread 99 // Pass important information to the projectile: Number of splits, Number of childs, split time, spread and the damage reduction 98 100 projectile->setNumberOfSplits(getNumberOfSplits()); 99 101 projectile->setNumberOfChilds(getNumberOfChilds()); 100 102 projectile->setSplitTime(getSplitTime()); 101 103 projectile->setSpread(getSpread()); 104 projectile->setDamageReduction(getDamageReduction()); 102 105 103 106 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.h
r10606 r10627 73 73 inline float getSpread() const 74 74 { return this->spread_; } 75 inline void setDamageReduction(float damageReduction) 76 { this->damageReduction_ = (damageReduction >= 0.0f ? damageReduction : 1.0f); } 77 inline float getDamageReduction() const 78 { return this->damageReduction_; } 75 79 76 80 private: … … 80 84 float splitTime_; //The time between creation of the projectile and the split of the projectile 81 85 float spread_; //Low spread means that the child projectiles are concentrated in a small area 86 float damageReduction_; //The damage of a child projectile is reduced by this factor 82 87 }; 83 88 }
Note: See TracChangeset
for help on using the changeset viewer.